From 90edbba221cdaca3c78595e8bbcfc96ca6bad400 Mon Sep 17 00:00:00 2001 From: pinage404 Date: Sun, 17 Oct 2021 12:34:36 +0200 Subject: [PATCH 0001/2020] fix: binary is not in a extracted folder --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index e232eee6..0bbd3ec8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -199,7 +199,11 @@ async fn main() -> Result<(), anyhow::Error> { // Generate install paths // Source path is the download dir + the generated binary path let source_file_path = bin_ctx.render(&meta.bin_dir)?; - let source = bin_path.join(&source_file_path); + let source = if meta.pkg_fmt == PkgFmt::Bin { + bin_path.clone() + } else { + bin_path.join(&source_file_path) + }; // Destination path is the install dir + base-name-version{.format} let dest_file_path = bin_ctx.render("{ bin }-v{ version }{ format }")?; From 6f05d630f040e0048b12e825c4a79535ba5d8ee1 Mon Sep 17 00:00:00 2001 From: pinage404 Date: Sun, 17 Oct 2021 12:35:15 +0200 Subject: [PATCH 0002/2020] fix: binary need to have the right to be executed --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index 0bbd3ec8..88e4dd75 100644 --- a/src/main.rs +++ b/src/main.rs @@ -239,6 +239,12 @@ async fn main() -> Result<(), anyhow::Error> { for (_name, source, dest, _link) in &bin_files { // TODO: check if file already exists std::fs::copy(source, dest)?; + + #[cfg(target_family = "unix")] + { + use std::os::unix::fs::PermissionsExt; + std::fs::set_permissions(dest, std::fs::Permissions::from_mode(0o755))?; + } } // Generate symlinks From 71c6b0d20952f6975546a70948f63953a1f088af Mon Sep 17 00:00:00 2001 From: pinage404 Date: Sun, 17 Oct 2021 12:45:53 +0200 Subject: [PATCH 0003/2020] fix: typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bfa5cdea..8850774a 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ yes `binstall` works with existing CI-built binary outputs, with configuration via `[package.metadata.binstall]` keys in the relevant crate manifest. When configuring `binstall` you can test against a local manifest with `--manifest-path=PATH` argument to use the crate and manifest at the provided `PATH`, skipping crate discovery and download. -To get started, add a `[package.metadata.binstall]` section to your `Cargo.toml. As an example, the default configuration would be: +To get started, add a `[package.metadata.binstall]` section to your `Cargo.toml`. As an example, the default configuration would be: ```toml [package.metadata.binstall] From 8b4e77918c0b1efaad01298eb995570e2c01075c Mon Sep 17 00:00:00 2001 From: Ryan Date: Fri, 22 Oct 2021 18:45:51 +1300 Subject: [PATCH 0004/2020] Update README.md Add curl commands for fetching latest release archives to readme --- README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/README.md b/README.md index 8850774a..f2464ea6 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,34 @@ `cargo binstall` provides a low-complexity mechanism for installing rust binaries as an alternative to building from source (via `cargo install`) or manually downloading packages. This is intended to work with existing CI artifacts and infrastructure, and with minimal overhead for package maintainers. To support `binstall` maintainers must add configuration values to `Cargo.toml` to allow the tool to locate the appropriate binary package for a given version and target. See [Supporting Binary Installation](#Supporting-Binary-Installation) for instructions on how to support `binstall` in your projects. +## Installing To get started _using_ `cargo-binstall`, first install the binary (either via `cargo install cargo-binstall` or by downloading a pre-compiled [release](https://github.com/ryankurte/cargo-binstall/releases). + +linux x86_64: +``` +wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-gnu.tgz +``` + +linux armv7: +``` +wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-armv7-unknown-linux-gnueabihf.tgz +``` + +macos x86_64: +``` +wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-apple-darwin.zip +``` + +windows x86_64: +``` +wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-pc-windows-msvc.zip +``` + +## Usage + Supported packages can be installed using `cargo binstall NAME` where `NAME` is the crate.io package name. + Package versions and targets may be specified using the `--version` and `--target` arguments respectively, and install directory with `--install-dir` (this defaults to `$HOME/.cargo/bin`, with fall-backs to `$HOME/.bin` if unavailable). For additional options please see `cargo binstall --help`. ``` From 0f9b4de44997b5141b9e785fb0d9c36fd95c6cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 17 Nov 2021 21:53:20 +1300 Subject: [PATCH 0005/2020] Update deps --- Cargo.lock | 769 ++++++++++++++++++++----------------------------- Cargo.toml | 36 +-- src/drivers.rs | 4 +- src/main.rs | 4 +- 4 files changed, 341 insertions(+), 472 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index da291b6c..dc739054 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3,16 +3,16 @@ version = 3 [[package]] -name = "adler32" -version = "1.2.0" +name = "adler" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "0.7.15" +version = "0.7.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" +checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" dependencies = [ "memchr", ] @@ -28,21 +28,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.40" +version = "1.0.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b2cd92db5cbd74e8e5028f7e27dd7aa3090e89e4f2a197cc7c8dfb69c7063b" - -[[package]] -name = "arrayref" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +checksum = "ee10e43ae4a853c0a3591d4e2ada1719e553be18199d9da9d4a83f5927c2f5c7" [[package]] name = "atty" @@ -69,26 +57,15 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" - -[[package]] -name = "blake2b_simd" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afa748e348ad3be8263be728124b24a24f268266f6f5d58af9d75f6a40b5c587" -dependencies = [ - "arrayref", - "arrayvec", - "constant_time_eq", -] +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bumpalo" -version = "3.4.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" [[package]] name = "byteorder" @@ -98,21 +75,15 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "0.5.6" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" - -[[package]] -name = "bytes" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" [[package]] name = "bzip2" -version = "0.3.3" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42b7c3cbf0fa9c1b82308d57191728ca0256cb821220f4e2fd410a72ade26e3b" +checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0" dependencies = [ "bzip2-sys", "libc", @@ -120,15 +91,24 @@ dependencies = [ [[package]] name = "bzip2-sys" -version = "0.1.10+1.0.8" +version = "0.1.11+1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17fa3d1ac1ca21c5c4e36a97f3c3eb25084576f6fc47bf0139c1123434216c6c" +checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" dependencies = [ "cc", "libc", "pkg-config", ] +[[package]] +name = "camino" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52d74260d9bf6944e2208aa46841b4b8f0d7ffc0849a06837b2f510337f86b2b" +dependencies = [ + "serde", +] + [[package]] name = "cargo-binstall" version = "0.4.1" @@ -160,31 +140,31 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0226944a63d1bf35a3b5f948dd7c59e263db83695c9e8bffc4037de02e30f1d7" +checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" dependencies = [ "serde", ] [[package]] name = "cargo_metadata" -version = "0.12.2" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11a47b6286279a9998588ef7050d1ebc2500c69892a557c90fe5d071c64415dc" +checksum = "ba2ae6de944143141f6155a473a6b02f66c7c3f9f47316f802f80204ebfe6e12" dependencies = [ + "camino", "cargo-platform", "semver", - "semver-parser", "serde", "serde_json", ] [[package]] name = "cargo_toml" -version = "0.8.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "513d17226888c7b8283ac02a1c1b0d8a9d4cbf6db65dfadb79f598f5d7966fe9" +checksum = "c6d613611c914a7db07f28526941ce1e956d2f977b0c5e2014fbfa42230d420f" dependencies = [ "serde", "serde_derive", @@ -193,19 +173,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.66" +version = "1.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c0496836a84f8d0495758516b8621a622beb77c0fed418570e50764093ced48" +checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" dependencies = [ "jobserver", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -241,17 +215,11 @@ dependencies = [ "vec_map", ] -[[package]] -name = "constant_time_eq" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - [[package]] name = "core-foundation" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" +checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" dependencies = [ "core-foundation-sys", "libc", @@ -259,18 +227,17 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "crates-index" -version = "0.16.2" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24823d553339d125040d989d2a593a01b034fe5ac17714423bcd2c3d168878" +checksum = "87c1041763543466e437ad3212f1dbfd73c0ae4f7323e44ff584c5273d1b39c8" dependencies = [ "git2", - "glob", "hex", "home", "memchr", @@ -283,9 +250,9 @@ dependencies = [ [[package]] name = "crates_io_api" -version = "0.7.0" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fb38f290ea3b9521e536be22d072cd93a04dd385552ba6c6bfb851513a3e5e9" +checksum = "f0ab4553806e9495b7e78a66454c16c5021cd3816d7b8e7e8fe28aa5474346bb" dependencies = [ "chrono", "futures", @@ -304,34 +271,23 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d96d1e189ef58269ebe5b97953da3274d83a93af647c2ddd6f9dab28cedb8d" -dependencies = [ - "autocfg", - "cfg-if 1.0.0", - "lazy_static", + "cfg-if", ] [[package]] name = "dirs" -version = "3.0.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "142995ed02755914747cc6ca76fc7e4583cd18578746716d0508ea6ed558b9ff" +checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e93d7f5705de3e49895a2b5e0b8855a1c27f080192ae9c32a6432d50741a57a" +checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" dependencies = [ "libc", "redox_users", @@ -340,18 +296,18 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.26" +version = "0.8.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "801bbab217d7f79c0062f4f7205b5d4427c6d1a7bd7aafdd1475f7c59d62b283" +checksum = "a74ea89a0a1b98f6332de42c95baff457ada66d1cb4030f9ff151b2041a1c746" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] name = "env_logger" -version = "0.8.2" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26ecb66b4bdca6c1409b40fb255eefc2bd4f6d135dab3c3124f80ffa2a9661e" +checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" dependencies = [ "atty", "humantime", @@ -362,23 +318,23 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.13" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c122a393ea57648015bf06fbd3d372378992e86b9ff5a7a497b076a28c79efe" +checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", - "redox_syscall 0.1.57", + "redox_syscall", "winapi", ] [[package]] name = "flate2" -version = "1.0.14" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfff41391129e0a856d6d822600b8d71179d46879e310417eb9c762eb178b42" +checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "crc32fast", "libc", "miniz_oxide", @@ -407,9 +363,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece68d15c92e84fa4f19d3780f1294e5ca82a78a6d515f1efaabcc144688be00" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" dependencies = [ "matches", "percent-encoding", @@ -423,9 +379,9 @@ checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" [[package]] name = "futures" -version = "0.3.8" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b3b0c040a1fe6529d30b3c5944b280c7f0dcb2930d2c3062bca967b602583d0" +checksum = "a12aa0eb539080d55c3f2d45a67c3b58b6b0773c1a3ca2dfec66d58c97fd66ca" dependencies = [ "futures-channel", "futures-core", @@ -438,9 +394,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.8" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b7109687aa4e177ef6fe84553af6280ef2778bdb7783ba44c9dc3399110fe64" +checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888" dependencies = [ "futures-core", "futures-sink", @@ -448,15 +404,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.8" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "847ce131b72ffb13b6109a221da9ad97a64cbe48feb1028356b836b47b8f1748" +checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" [[package]] name = "futures-executor" -version = "0.3.8" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4caa2b2b68b880003057c1dd49f1ed937e38f22fcf6c212188a121f08cf40a65" +checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c" dependencies = [ "futures-core", "futures-task", @@ -465,16 +421,17 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.8" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611834ce18aaa1bd13c4b374f5d653e1027cf99b6b502584ff8c9a64413b30bb" +checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377" [[package]] name = "futures-macro" -version = "0.3.8" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77408a692f1f97bcc61dc001d752e00643408fbc922e4d634c655df50d595556" +checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb" dependencies = [ + "autocfg", "proc-macro-hack", "proc-macro2", "quote", @@ -483,25 +440,23 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.8" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f878195a49cee50e006b02b93cf7e0a95a38ac7b776b4c4d9cc1207cd20fcb3d" +checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11" [[package]] name = "futures-task" -version = "0.3.8" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c554eb5bf48b2426c4771ab68c6b14468b6e76cc90996f528c3338d761a4d0d" -dependencies = [ - "once_cell", -] +checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99" [[package]] name = "futures-util" -version = "0.3.8" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d304cff4a7b99cfb7986f7d43fbe93d175e72e704a8860787cc95e9ffd85cbd2" +checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481" dependencies = [ + "autocfg", "futures-channel", "futures-core", "futures-io", @@ -509,7 +464,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project", + "pin-project-lite", "pin-utils", "proc-macro-hack", "proc-macro-nested", @@ -518,20 +473,20 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.15" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi", ] [[package]] name = "git2" -version = "0.13.15" +version = "0.13.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f267c9da8a4de3c615b59e23606c75f164f84896e97f4dd6c15a4294de4359" +checksum = "845e007a28f1fcac035715988a234e8ec5458fd825b20a20c7dec74237ef341f" dependencies = [ "bitflags", "libc", @@ -542,19 +497,13 @@ dependencies = [ "url", ] -[[package]] -name = "glob" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" - [[package]] name = "h2" -version = "0.3.2" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc018e188373e2777d0ef2467ebff62a08e66c3f5857b23c8fbec3018210dc00" +checksum = "7fd819562fcebdac5afc5c113c3ec36f902840b70fd4fc458799c8ce4607ae55" dependencies = [ - "bytes 1.0.1", + "bytes", "fnv", "futures-core", "futures-sink", @@ -569,33 +518,33 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.9.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" [[package]] name = "heck" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cbf45460356b7deeb5e3415b5563308c0a9b057c85e12b06ad551f98d0a6ac" +checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" dependencies = [ "unicode-segmentation", ] [[package]] name = "hermit-abi" -version = "0.1.17" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" dependencies = [ "libc", ] [[package]] name = "hex" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" dependencies = [ "serde", ] @@ -611,51 +560,51 @@ dependencies = [ [[package]] name = "http" -version = "0.2.2" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84129d298a6d57d246960ff8eb831ca4af3f96d29e2e28848dae275408658e26" +checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b" dependencies = [ - "bytes 0.5.6", + "bytes", "fnv", "itoa", ] [[package]] name = "http-body" -version = "0.4.1" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfb77c123b4e2f72a2069aeae0b4b4949cc7e966df277813fc16347e7549737" +checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" dependencies = [ - "bytes 1.0.1", + "bytes", "http", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.3.4" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" [[package]] name = "httpdate" -version = "0.3.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" +checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" [[package]] name = "humantime" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c1ad908cc71012b7bea4d0c53ba96a8cba9962f048fa68d143376143d863b7a" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.5" +version = "0.14.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf09f61b52cfcf4c00de50df88ae423d6c02354e385a86341133b5338630ad1" +checksum = "436ec0091e4f20e655156a30a0df3770fe2900aa301e548e08446ec794b6953c" dependencies = [ - "bytes 1.0.1", + "bytes", "futures-channel", "futures-core", "futures-util", @@ -665,7 +614,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project", + "pin-project-lite", "socket2", "tokio", "tower-service", @@ -694,7 +643,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ - "bytes 1.0.1", + "bytes", "hyper", "native-tls", "tokio", @@ -703,9 +652,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.2.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" dependencies = [ "matches", "unicode-bidi", @@ -714,9 +663,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb1fa934250de4de8aef298d81c729a7d33d8c239daa3a7575e6b92bfc7313b" +checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" dependencies = [ "autocfg", "hashbrown", @@ -724,39 +673,39 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.9" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] name = "ipnet" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" +checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" [[package]] name = "itoa" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "jobserver" -version = "0.1.21" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" +checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.46" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d7383929f7c9c7c2d0fa596f325832df98c3704f2c60553080f7127a58175" +checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" dependencies = [ "wasm-bindgen", ] @@ -769,15 +718,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.93" +version = "0.2.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9385f66bf6105b241aa65a61cb923ef20efc665cb9f9bb50ac2f0c4b7f378d41" +checksum = "fbe5e23404da5b4f555ef85ebed98fb4083e55a00c317800bc2a50ede9f3d219" [[package]] name = "libgit2-sys" -version = "0.12.17+1.1.0" +version = "0.12.25+1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ebdf65ca745126df8824688637aa0535a88900b83362d8ca63893bcf4e8841" +checksum = "8f68169ef08d6519b2fe133ecc637408d933c0174b23b80bb2f79828966fbaab" dependencies = [ "cc", "libc", @@ -789,9 +738,9 @@ dependencies = [ [[package]] name = "libssh2-sys" -version = "0.2.20" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df40b13fe7ea1be9b9dffa365a51273816c345fc1811478b57ed7d964fbfc4ce" +checksum = "b094a36eb4b8b8c8a7b4b8ae43b2944502be3e59cd87687595cf6b0a71b3f4ca" dependencies = [ "cc", "libc", @@ -803,9 +752,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602113192b08db8f38796c4e85c39e960c145965140e918018bcde1952429655" +checksum = "de5435b8549c16d423ed0c03dbaafe57cf6c3344744f1242520d59c9d8ecec66" dependencies = [ "cc", "libc", @@ -815,9 +764,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3c91c24eae6777794bb1997ad98bbb87daf92890acab859f7eaa4320333176" +checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" dependencies = [ "scopeguard", ] @@ -828,7 +777,7 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -844,15 +793,15 @@ dependencies = [ [[package]] name = "matches" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "memchr" -version = "2.3.4" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "mime" @@ -862,18 +811,19 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "miniz_oxide" -version = "0.3.7" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" +checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" dependencies = [ - "adler32", + "adler", + "autocfg", ] [[package]] name = "mio" -version = "0.7.11" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf80d3e903b34e0bd7282b218398aec54e082c840d9baf8339e0080a0c542956" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" dependencies = [ "libc", "log", @@ -893,9 +843,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8d96b2e1c8da3957d58100b09f102c6d9cfdfced01b7ec5a8974044bb09dbd4" +checksum = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d" dependencies = [ "lazy_static", "libc", @@ -949,35 +899,35 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.5.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" +checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" [[package]] name = "openssl" -version = "0.10.32" +version = "0.10.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038d43985d1ddca7a9900630d8cd031b56e4794eecc2e9ea39dd17aa04399a70" +checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" dependencies = [ "bitflags", - "cfg-if 1.0.0", + "cfg-if", "foreign-types", - "lazy_static", "libc", + "once_cell", "openssl-sys", ] [[package]] name = "openssl-probe" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" +checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" [[package]] name = "openssl-sys" -version = "0.9.60" +version = "0.9.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "921fc71883267538946025deffb622905ecad223c28efbfdef9bb59a0175f3e6" +checksum = "7df13d165e607909b363a4757a6f133f8a818a74e9d3a98d09c6128e15fa4c73" dependencies = [ "autocfg", "cc", @@ -988,9 +938,9 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", @@ -999,14 +949,14 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "instant", "libc", - "redox_syscall 0.2.5", + "redox_syscall", "smallvec", "winapi", ] @@ -1017,40 +967,11 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" -[[package]] -name = "pest" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" -dependencies = [ - "ucd-trie", -] - -[[package]] -name = "pin-project" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccc2237c2c489783abd8c4c80e5450fc0e98644555b1364da68cc29aa151ca7" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8e8d2bf0b23038a4424865103a4df472855692821aab4e4f5c3312d461d9e5f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "pin-project-lite" -version = "0.2.0" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b063f57ec186e6140e2b8b6921e5f1bd89c7356dda5b33acc5401203ca6131c" +checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" [[package]] name = "pin-utils" @@ -1060,15 +981,15 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.19" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +checksum = "12295df4f294471248581bc09bef3c38a5e46f1e36d6a37353621a0c6c357e1f" [[package]] name = "ppv-lite86" -version = "0.2.10" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" +checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" [[package]] name = "proc-macro-error" @@ -1102,24 +1023,24 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro-nested" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" +checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.24" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" +checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" dependencies = [ "unicode-xid", ] [[package]] name = "quote" -version = "1.0.8" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "991431c3519a3f36861882da93630ce66b52918dcf1b8e2fd66b397fc96f28df" +checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" dependencies = [ "proc-macro2", ] @@ -1139,25 +1060,24 @@ dependencies = [ [[package]] name = "rand" -version = "0.7.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" dependencies = [ - "getrandom", "libc", "rand_chacha", - "rand_core 0.5.1", + "rand_core 0.6.3", "rand_hc", ] [[package]] name = "rand_chacha" -version = "0.2.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core 0.5.1", + "rand_core 0.6.3", ] [[package]] @@ -1177,20 +1097,20 @@ checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" [[package]] name = "rand_core" -version = "0.5.1" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" dependencies = [ "getrandom", ] [[package]] name = "rand_hc" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" dependencies = [ - "rand_core 0.5.1", + "rand_core 0.6.3", ] [[package]] @@ -1204,47 +1124,39 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.1.57" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" - -[[package]] -name = "redox_syscall" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94341e4e44e24f6b591b59e47a8a027df12e008d73fd5672dbea9cc22f4507d9" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" dependencies = [ "bitflags", ] [[package]] name = "redox_users" -version = "0.3.5" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" dependencies = [ "getrandom", - "redox_syscall 0.1.57", - "rust-argon2", + "redox_syscall", ] [[package]] name = "regex" -version = "1.4.2" +version = "1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" +checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" dependencies = [ "aho-corasick", "memchr", "regex-syntax", - "thread_local", ] [[package]] name = "regex-syntax" -version = "0.6.21" +version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" +checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" [[package]] name = "remove_dir_all" @@ -1257,12 +1169,12 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.2" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf12057f289428dbf5c591c74bf10392e4a8003f993405a902f20117019022d4" +checksum = "66d2927ca2f685faf0fc620ac4834690d29e7abb153add10f5812eef20b5e280" dependencies = [ "base64", - "bytes 1.0.1", + "bytes", "encoding_rs", "futures-core", "futures-util", @@ -1309,23 +1221,11 @@ dependencies = [ "winapi", ] -[[package]] -name = "rust-argon2" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b18820d944b33caa75a71378964ac46f58517c92b6ae5f762636247c09e78fb" -dependencies = [ - "base64", - "blake2b_simd", - "constant_time_eq", - "crossbeam-utils", -] - [[package]] name = "rustls" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "064fd21ff87c6e87ed4506e68beb42459caa4a0e2eb144932e6776768556980b" +checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" dependencies = [ "base64", "log", @@ -1334,6 +1234,12 @@ dependencies = [ "webpki", ] +[[package]] +name = "rustversion" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" + [[package]] name = "ryu" version = "1.0.5" @@ -1358,9 +1264,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "sct" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3042af939fca8c3453b7af0f1c66e533a15a86169e39de2657310ade8f98d3c" +checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" dependencies = [ "ring", "untrusted", @@ -1368,9 +1274,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.0.0" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1759c2e3c8580017a484a7ac56d3abc5a6c1feadf88db2f3633f12ae4268c69" +checksum = "525bc1abfda2e1998d152c45cf13e696f76d0a4972310b22fac1658b05df7c87" dependencies = [ "bitflags", "core-foundation", @@ -1381,9 +1287,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.0.0" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f99b9d5e26d2a71633cc4f2ebae7cc9f874044e0c351a27e17892d76dce5678b" +checksum = "a9dd14d83160b528b7bfd66439110573efcfbe281b17fc2ca9f39f550d619c7e" dependencies = [ "core-foundation-sys", "libc", @@ -1391,37 +1297,27 @@ dependencies = [ [[package]] name = "semver" -version = "0.11.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" +checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" dependencies = [ - "semver-parser", "serde", ] -[[package]] -name = "semver-parser" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] - [[package]] name = "serde" -version = "1.0.119" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bdd36f49e35b61d49efd8aa7fc068fd295961fd2286d0b2ee9a4c7a14e99cc3" +checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.119" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552954ce79a059ddd5fd68c271592374bd15cab2274970380c000118aeffe1cd" +checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" dependencies = [ "proc-macro2", "quote", @@ -1430,9 +1326,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.61" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fceb2595057b6891a4ee808f70054bd2d12f0e97f1cbb78689b59f676df325a" +checksum = "e277c495ac6cd1a01a58d0a0c574568b4d1ddf14f59965c6a58b8d96400b54f3" dependencies = [ "itoa", "ryu", @@ -1453,18 +1349,18 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1d0fef1604ba8f7a073c7e701f213e056707210e9020af4528e0101ce11a6" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" dependencies = [ "libc", ] [[package]] name = "simplelog" -version = "0.9.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bc0ffd69814a9b251d43afcabf96dad1b29f5028378056257be9e3fecc9f720" +checksum = "8baa24de25f3092d9697c76f94cf09f67fca13db2ea11ce80c2f055c1aaf0795" dependencies = [ "chrono", "log", @@ -1473,21 +1369,21 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.2" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "smallvec" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" [[package]] name = "smartstring" -version = "0.2.6" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ada87540bf8ef4cf8a1789deb175626829bb59b1fefd816cf7f7f55efcdbae9" +checksum = "31aa6a31c0c2b21327ce875f7e8952322acfcfd0c27569a6e18a647281352c9b" dependencies = [ "serde", "static_assertions", @@ -1495,9 +1391,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.0" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e3dfc207c526015c632472a77be09cf1b6e46866581aecae5cc38fb4235dea2" +checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516" dependencies = [ "libc", "winapi", @@ -1523,9 +1419,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "structopt" -version = "0.3.21" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5277acd7ee46e63e5168a80734c9f6ee81b1367a7d8772a2d765df2a3705d28c" +checksum = "40b9788f4202aa75c240ecc9c15c65185e6a39ccdeb0fd5d008b98825464c87c" dependencies = [ "clap", "lazy_static", @@ -1534,9 +1430,9 @@ dependencies = [ [[package]] name = "structopt-derive" -version = "0.4.14" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ba9cdfda491b814720b6b06e0cac513d922fc407582032e8706e9f137976f90" +checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" dependencies = [ "heck", "proc-macro-error", @@ -1547,27 +1443,28 @@ dependencies = [ [[package]] name = "strum" -version = "0.20.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7318c509b5ba57f18533982607f24070a55d353e90d4cae30c467cdb2ad5ac5c" +checksum = "cae14b91c7d11c9a851d3fbc80a963198998c2a64eec840477fa92d8ce9b70bb" [[package]] name = "strum_macros" -version = "0.20.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee8bc6b87a5112aeeab1f4a9f7ab634fe6cbefc4850006df31267f4cfb9e3149" +checksum = "00ad150e9d51e33e8142984f577662c1324d49f3be45ed37bac8645fdcbe0fe5" dependencies = [ "heck", "proc-macro2", "quote", + "rustversion", "syn", ] [[package]] name = "syn" -version = "1.0.58" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc60a3d73ea6594cd712d830cc1f0390fd71542d8c8cd24e70cc54cdfd5e05d5" +checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" dependencies = [ "proc-macro2", "quote", @@ -1576,13 +1473,12 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.30" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489997b7557e9a43e192c527face4feacc78bfbe6eed67fd55c4c9e381cba290" +checksum = "d6f5515d3add52e0bbdcad7b83c388bb36ba7b754dda3b5f5bc2d38640cdba5c" dependencies = [ "filetime", "libc", - "redox_syscall 0.1.57", "xattr", ] @@ -1598,14 +1494,14 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" +checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "libc", - "rand 0.7.3", - "redox_syscall 0.1.57", + "rand 0.8.4", + "redox_syscall", "remove_dir_all", "winapi", ] @@ -1630,49 +1526,39 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.24" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.24" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", "syn", ] -[[package]] -name = "thread_local" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" -dependencies = [ - "lazy_static", -] - [[package]] name = "time" -version = "0.1.44" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ "libc", - "wasi 0.10.0+wasi-snapshot-preview1", "winapi", ] [[package]] name = "tinytemplate" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ada8616fad06a2d0c455adc530de4ef57605a8120cc65da9653e0e9623ca74" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" dependencies = [ "serde", "serde_json", @@ -1680,9 +1566,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.1.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccf8dbc19eb42fba10e8feaaec282fb50e2c14b2726d6301dbfeed0f73306a6f" +checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" dependencies = [ "tinyvec_macros", ] @@ -1695,12 +1581,12 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.4.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134af885d758d645f0f0505c9a8b3f9bf8a348fd822e112ab5248138348f1722" +checksum = "70e992e41e0d2fb9f755b37446f20900f64446ef54874f40a60c78f021ac6144" dependencies = [ "autocfg", - "bytes 1.0.1", + "bytes", "libc", "memchr", "mio", @@ -1715,9 +1601,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.1.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caf7b11a536f46a809a8a9f0bb4237020f70ecbf115b842360afb127ea2fda57" +checksum = "c9efc1aba077437943f7515666aa2b882dfabfbfdf89c819ea75a8d6e9eaba5e" dependencies = [ "proc-macro2", "quote", @@ -1747,11 +1633,11 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.5" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5143d049e85af7fbc36f5454d990e62c2df705b3589f123b71f441b6b59f443f" +checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" dependencies = [ - "bytes 1.0.1", + "bytes", "futures-core", "futures-sink", "log", @@ -1770,26 +1656,26 @@ dependencies = [ [[package]] name = "tower-service" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" +checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.22" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f47026cdc4080c07e49b37087de021820269d996f581aac150ef9e5583eefe3" +checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "pin-project-lite", "tracing-core", ] [[package]] name = "tracing-core" -version = "0.1.17" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" +checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" dependencies = [ "lazy_static", ] @@ -1800,47 +1686,38 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" -[[package]] -name = "ucd-trie" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" - [[package]] name = "unicode-bidi" -version = "0.3.4" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" -dependencies = [ - "matches", -] +checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" [[package]] name = "unicode-normalization" -version = "0.1.16" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a13e63ab62dbe32aeee58d1c5408d35c36c392bba5d9d3142287219721afe606" +checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" dependencies = [ "tinyvec", ] [[package]] name = "unicode-segmentation" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" +checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" [[package]] name = "unicode-width" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" [[package]] name = "unicode-xid" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" +checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" [[package]] name = "untrusted" @@ -1850,9 +1727,9 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.2.0" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" dependencies = [ "form_urlencoded", "idna", @@ -1862,9 +1739,9 @@ dependencies = [ [[package]] name = "vcpkg" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b00bca6106a5e23f3eee943593759b7fcddb00554332e856d990c893966879fb" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vec_map" @@ -1874,9 +1751,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" +checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" [[package]] name = "want" @@ -1890,33 +1767,25 @@ dependencies = [ [[package]] name = "wasi" -version = "0.9.0+wasi-snapshot-preview1" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" - -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasm-bindgen" -version = "0.2.69" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cd364751395ca0f68cafb17666eee36b63077fb5ecd972bbcd74c90c4bf736e" +checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" dependencies = [ - "cfg-if 1.0.0", - "serde", - "serde_json", + "cfg-if", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.69" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1114f89ab1f4106e5b55e688b828c0ab0ea593a1ea7c094b141b14cbaaec2d62" +checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" dependencies = [ "bumpalo", "lazy_static", @@ -1929,11 +1798,11 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.19" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fe9756085a84584ee9457a002b7cdfe0bfff169f45d2591d8be1345a6780e35" +checksum = "8e8d7523cb1f2a4c96c1317ca690031b714a51cc14e05f712446691f413f5d39" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -1941,9 +1810,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.69" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6ac8995ead1f084a8dea1e65f194d0973800c7f571f6edd70adf06ecf77084" +checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1951,9 +1820,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.69" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5a48c72f299d80557c7c62e37e7225369ecc0c963964059509fbafe917c7549" +checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" dependencies = [ "proc-macro2", "quote", @@ -1964,15 +1833,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.69" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e7811dd7f9398f14cc76efd356f98f03aa30419dea46aa810d71e819fc97158" +checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" [[package]] name = "web-sys" -version = "0.3.46" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222b1ef9334f92a21d3fb53dc3fd80f30836959a90f9274a626d7e06315ba3c3" +checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" dependencies = [ "js-sys", "wasm-bindgen", @@ -2057,9 +1926,9 @@ dependencies = [ [[package]] name = "zip" -version = "0.5.11" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8264fcea9b7a036a4a5103d7153e988dbc2ebbafb34f68a3c2d404b6b82d74b6" +checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815" dependencies = [ "byteorder", "bzip2", diff --git a/Cargo.toml b/Cargo.toml index a47b295b..32b0b15f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,28 +19,28 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -crates_io_api = "0.7.0" -cargo_metadata = "0.12.2" -tinytemplate = "1.2.0" -tokio = { version = "1.4.0", features = [ "full" ] } +crates_io_api = "0.7.3" +cargo_metadata = "0.14.1" +tinytemplate = "1.2.1" +tokio = { version = "1.14.0", features = [ "full" ] } log = "0.4.14" -structopt = "0.3.21" -simplelog = "0.9.0" +structopt = "0.3.25" +simplelog = "0.11.0" anyhow = "1.0.40" -reqwest = { version = "0.11.2", features = [ "rustls-tls" ], default-features = false } +reqwest = { version = "0.11.6", features = [ "rustls-tls" ], default-features = false } tempdir = "0.3.7" -flate2 = "1.0.14" -tar = "0.4.30" -cargo_toml = "0.8.1" -serde = { version = "1.0.119", features = [ "derive" ] } -strum_macros = "0.20.1" -strum = "0.20.0" -dirs = "3.0.1" +flate2 = "1.0.22" +tar = "0.4.37" +cargo_toml = "0.10.1" +serde = { version = "1.0.130", features = [ "derive" ] } +strum_macros = "0.23.0" +strum = "0.23.0" +dirs = "4.0.0" serde_derive = "1.0.118" -crates-index = "0.16.2" -semver = "0.11.0" +crates-index = "0.18.1" +semver = "1.0.4" xz2 = "0.1.6" -zip = "0.5.11" +zip = "0.5.13" [dev-dependencies] -env_logger = "0.8.2" +env_logger = "0.9.0" diff --git a/src/drivers.rs b/src/drivers.rs index 9270de59..f10b1448 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -57,8 +57,8 @@ pub async fn fetch_crate_cratesio(name: &str, version_req: &str, temp_dir: &Path // Fetch / update index debug!("Updating crates.io index"); - let index = crates_index::Index::new_cargo_default(); - index.retrieve_or_update()?; + let mut index = crates_index::Index::new_cargo_default()?; + index.update()?; // Lookup crate in index debug!("Looking up crate information"); diff --git a/src/main.rs b/src/main.rs index 88e4dd75..6f7cf72e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,7 @@ use std::path::{PathBuf}; use log::{debug, info, warn, error, LevelFilter}; -use simplelog::{TermLogger, ConfigBuilder, TerminalMode}; +use simplelog::{TermLogger, ConfigBuilder, TerminalMode, ColorChoice}; use structopt::StructOpt; @@ -78,7 +78,7 @@ async fn main() -> Result<(), anyhow::Error> { log_config.add_filter_ignore("hyper".to_string()); log_config.add_filter_ignore("reqwest".to_string()); log_config.set_location_level(LevelFilter::Off); - TermLogger::init(opts.log_level, log_config.build(), TerminalMode::Mixed).unwrap(); + TermLogger::init(opts.log_level, log_config.build(), TerminalMode::Mixed, ColorChoice::Auto).unwrap(); // Create a temporary directory for downloads etc. let temp_dir = TempDir::new("cargo-binstall")?; From cdb2f8ccdd863dbca195367a8960a975bdd5cc1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 17 Nov 2021 21:57:09 +1300 Subject: [PATCH 0006/2020] Fix test --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 682e60c5..b8564f38 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -193,7 +193,7 @@ mod test { assert_eq!( &meta.pkg_url, - "{ repo }/releases/download/v{ version }/{ name }-{ target }.tgz" + "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ format }" ); assert_eq!( From 912dc56c95e5079961370c6a7c672f0d33aa3c8b Mon Sep 17 00:00:00 2001 From: ryan kurte Date: Fri, 19 Nov 2021 09:37:35 +1300 Subject: [PATCH 0007/2020] (cargo-release) version 0.5.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dc739054..f60e4585 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -111,7 +111,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.4.1" +version = "0.5.0" dependencies = [ "anyhow", "cargo_metadata", diff --git a/Cargo.toml b/Cargo.toml index 32b0b15f..e485215a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/ryankurte/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.4.1" +version = "0.5.0" authors = ["ryan "] edition = "2018" license = "GPL-3.0" From c46eda2b54be6b848f9c9fa3978e4c48db109a7c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Nov 2021 01:14:07 +0000 Subject: [PATCH 0008/2020] Bump strum_macros from 0.23.0 to 0.23.1 Bumps [strum_macros](https://github.com/Peternator7/strum) from 0.23.0 to 0.23.1. - [Release notes](https://github.com/Peternator7/strum/releases) - [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md) - [Commits](https://github.com/Peternator7/strum/commits) --- updated-dependencies: - dependency-name: strum_macros dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f60e4585..b9aa9e80 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1449,9 +1449,9 @@ checksum = "cae14b91c7d11c9a851d3fbc80a963198998c2a64eec840477fa92d8ce9b70bb" [[package]] name = "strum_macros" -version = "0.23.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00ad150e9d51e33e8142984f577662c1324d49f3be45ed37bac8645fdcbe0fe5" +checksum = "5bb0dc7ee9c15cea6199cde9a127fa16a4c5819af85395457ad72d68edc85a38" dependencies = [ "heck", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index e485215a..16e86db6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,7 +33,7 @@ flate2 = "1.0.22" tar = "0.4.37" cargo_toml = "0.10.1" serde = { version = "1.0.130", features = [ "derive" ] } -strum_macros = "0.23.0" +strum_macros = "0.23.1" strum = "0.23.0" dirs = "4.0.0" serde_derive = "1.0.118" From 9b092b9f9e636dbe9f0fe70a75c8f6f08f4fc941 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Dec 2021 01:14:41 +0000 Subject: [PATCH 0009/2020] Bump cargo_toml from 0.10.1 to 0.10.2 Bumps [cargo_toml](https://gitlab.com/crates.rs/cargo_toml) from 0.10.1 to 0.10.2. - [Release notes](https://gitlab.com/crates.rs/cargo_toml/tags) - [Commits](https://gitlab.com/crates.rs/cargo_toml/commits/master) --- updated-dependencies: - dependency-name: cargo_toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f60e4585..a9a94aa5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -162,9 +162,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6d613611c914a7db07f28526941ce1e956d2f977b0c5e2014fbfa42230d420f" +checksum = "67110a7844b75a4dda12f4dca5a731c961750d6c8fa3cb6a41ab67411be05d3a" dependencies = [ "serde", "serde_derive", diff --git a/Cargo.toml b/Cargo.toml index e485215a..1f8e5c2f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,7 +31,7 @@ reqwest = { version = "0.11.6", features = [ "rustls-tls" ], default-features = tempdir = "0.3.7" flate2 = "1.0.22" tar = "0.4.37" -cargo_toml = "0.10.1" +cargo_toml = "0.10.2" serde = { version = "1.0.130", features = [ "derive" ] } strum_macros = "0.23.0" strum = "0.23.0" From f7528b7004e42d687a6044e24a32a920c5c7b6f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Dec 2021 01:14:45 +0000 Subject: [PATCH 0010/2020] Bump reqwest from 0.11.6 to 0.11.7 Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.6 to 0.11.7. - [Release notes](https://github.com/seanmonstar/reqwest/releases) - [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md) - [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.6...v0.11.7) --- updated-dependencies: - dependency-name: reqwest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 51 ++++++++++++++++++++++++++++++++++----------------- Cargo.toml | 2 +- 2 files changed, 35 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f60e4585..47d5737f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -624,17 +624,15 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.22.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f7a97316d44c0af9b0301e65010573a853a9fc97046d7331d7f6bc0fd5a64" +checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" dependencies = [ - "futures-util", + "http", "hyper", - "log", "rustls", "tokio", "tokio-rustls", - "webpki", ] [[package]] @@ -1169,9 +1167,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.6" +version = "0.11.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d2927ca2f685faf0fc620ac4834690d29e7abb153add10f5812eef20b5e280" +checksum = "07bea77bc708afa10e59905c3d4af7c8fd43c9214251673095ff8b14345fcbc5" dependencies = [ "base64", "bytes", @@ -1192,6 +1190,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", @@ -1223,15 +1222,23 @@ dependencies = [ [[package]] name = "rustls" -version = "0.19.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" +checksum = "d37e5e2290f3e040b594b1a9e04377c2c671f1a1cfd9bfdef82106ac1c113f84" dependencies = [ - "base64", "log", "ring", "sct", - "webpki", + "webpki 0.22.0", +] + +[[package]] +name = "rustls-pemfile" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" +dependencies = [ + "base64", ] [[package]] @@ -1264,9 +1271,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "sct" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" +checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" dependencies = [ "ring", "untrusted", @@ -1622,13 +1629,13 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.22.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" +checksum = "4baa378e417d780beff82bf54ceb0d195193ea6a00c14e22359e7f39456b5689" dependencies = [ "rustls", "tokio", - "webpki", + "webpki 0.22.0", ] [[package]] @@ -1857,13 +1864,23 @@ dependencies = [ "untrusted", ] +[[package]] +name = "webpki" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "webpki-roots" version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" dependencies = [ - "webpki", + "webpki 0.21.4", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index e485215a..9f2890da 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ log = "0.4.14" structopt = "0.3.25" simplelog = "0.11.0" anyhow = "1.0.40" -reqwest = { version = "0.11.6", features = [ "rustls-tls" ], default-features = false } +reqwest = { version = "0.11.7", features = [ "rustls-tls" ], default-features = false } tempdir = "0.3.7" flate2 = "1.0.22" tar = "0.4.37" From 712a63fc8457f5281db07ce87b2817bd9e84437a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Dec 2021 01:14:55 +0000 Subject: [PATCH 0011/2020] Bump anyhow from 1.0.45 to 1.0.51 Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.45 to 1.0.51. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](https://github.com/dtolnay/anyhow/compare/1.0.45...1.0.51) --- updated-dependencies: - dependency-name: anyhow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f60e4585..28b2de92 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,9 +28,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.45" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee10e43ae4a853c0a3591d4e2ada1719e553be18199d9da9d4a83f5927c2f5c7" +checksum = "8b26702f315f53b6071259e15dd9d64528213b44d61de1ec926eca7715d62203" [[package]] name = "atty" diff --git a/Cargo.toml b/Cargo.toml index e485215a..fbc098b4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ tokio = { version = "1.14.0", features = [ "full" ] } log = "0.4.14" structopt = "0.3.25" simplelog = "0.11.0" -anyhow = "1.0.40" +anyhow = "1.0.51" reqwest = { version = "0.11.6", features = [ "rustls-tls" ], default-features = false } tempdir = "0.3.7" flate2 = "1.0.22" From e691255650d8051f716da9e754cfcb0b38265cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 15 Feb 2022 19:19:41 +1300 Subject: [PATCH 0012/2020] Update deps --- Cargo.lock | 476 ++++++++++++++++++++++++++++------------------------- Cargo.toml | 23 ++- 2 files changed, 263 insertions(+), 236 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2af949be..c3c5a710 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,18 +19,18 @@ dependencies = [ [[package]] name = "ansi_term" -version = "0.11.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" dependencies = [ "winapi", ] [[package]] name = "anyhow" -version = "1.0.51" +version = "1.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b26702f315f53b6071259e15dd9d64528213b44d61de1ec926eca7715d62203" +checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" [[package]] name = "atty" @@ -45,9 +45,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" @@ -63,9 +63,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bumpalo" -version = "3.8.0" +version = "3.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" +checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" [[package]] name = "byteorder" @@ -102,9 +102,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.0.5" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52d74260d9bf6944e2208aa46841b4b8f0d7ffc0849a06837b2f510337f86b2b" +checksum = "6f3132262930b0522068049f5870a856ab8affc80c70d08b6ecb785771a6fc23" dependencies = [ "serde", ] @@ -125,7 +125,6 @@ dependencies = [ "reqwest", "semver", "serde", - "serde_derive", "simplelog", "structopt", "strum", @@ -162,9 +161,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.10.2" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67110a7844b75a4dda12f4dca5a731c961750d6c8fa3cb6a41ab67411be05d3a" +checksum = "4e270ef0cd868745878982f7ce470aa898d0d4bb248af67f0cf66f54617913ef" dependencies = [ "serde", "serde_derive", @@ -202,9 +201,9 @@ dependencies = [ [[package]] name = "clap" -version = "2.33.3" +version = "2.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" +checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" dependencies = [ "ansi_term", "atty", @@ -217,9 +216,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ "core-foundation-sys", "libc", @@ -233,14 +232,17 @@ checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "crates-index" -version = "0.18.1" +version = "0.18.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87c1041763543466e437ad3212f1dbfd73c0ae4f7323e44ff584c5273d1b39c8" +checksum = "00c338c128681bf06772e2a188f7937293620478bb7781e453e996266686e806" dependencies = [ "git2", "hex", "home", "memchr", + "num_cpus", + "rayon", + "rustc-hash", "semver", "serde", "serde_derive", @@ -250,9 +252,9 @@ dependencies = [ [[package]] name = "crates_io_api" -version = "0.7.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0ab4553806e9495b7e78a66454c16c5021cd3816d7b8e7e8fe28aa5474346bb" +checksum = "86f8072e3f4581325ee6c8e3c900099b303924a9c592ab4d23bb87ee5bdc6f7b" dependencies = [ "chrono", "futures", @@ -267,13 +269,57 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" dependencies = [ "cfg-if", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c00d6d2ea26e8b151d99093005cb442fb9a37aeaca582a03ec70946f49ab5ed9" +dependencies = [ + "cfg-if", + "crossbeam-utils", + "lazy_static", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6" +dependencies = [ + "cfg-if", + "lazy_static", +] + [[package]] name = "dirs" version = "4.0.0" @@ -295,10 +341,16 @@ dependencies = [ ] [[package]] -name = "encoding_rs" -version = "0.8.29" +name = "either" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a74ea89a0a1b98f6332de42c95baff457ada66d1cb4030f9ff151b2041a1c746" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + +[[package]] +name = "encoding_rs" +version = "0.8.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dc8abb250ffdda33912550faa54c88ec8b998dec0b2c55ab224921ce11df" dependencies = [ "cfg-if", ] @@ -316,6 +368,15 @@ dependencies = [ "termcolor", ] +[[package]] +name = "fastrand" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +dependencies = [ + "instant", +] + [[package]] name = "filetime" version = "0.2.15" @@ -379,9 +440,9 @@ checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" [[package]] name = "futures" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12aa0eb539080d55c3f2d45a67c3b58b6b0773c1a3ca2dfec66d58c97fd66ca" +checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" dependencies = [ "futures-channel", "futures-core", @@ -394,9 +455,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5da6ba8c3bb3c165d3c7319fc1cc8304facf1fb8db99c5de877183c08a273888" +checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" dependencies = [ "futures-core", "futures-sink", @@ -404,15 +465,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" +checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" [[package]] name = "futures-executor" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45025be030969d763025784f7f355043dc6bc74093e4ecc5000ca4dc50d8745c" +checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" dependencies = [ "futures-core", "futures-task", @@ -421,18 +482,16 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377" +checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" [[package]] name = "futures-macro" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18e4a4b95cea4b4ccbcf1c5675ca7c4ee4e9e75eb79944d07defde18068f79bb" +checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" dependencies = [ - "autocfg", - "proc-macro-hack", "proc-macro2", "quote", "syn", @@ -440,23 +499,22 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36ea153c13024fe480590b3e3d4cad89a0cfacecc24577b68f86c6ced9c2bc11" +checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" [[package]] name = "futures-task" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d3d00f4eddb73e498a54394f228cd55853bdf059259e8e7bc6e69d408892e99" +checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" [[package]] name = "futures-util" -version = "0.3.17" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36568465210a3a6ee45e1f165136d68671471a501e632e9a98d96872222b5481" +checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" dependencies = [ - "autocfg", "futures-channel", "futures-core", "futures-io", @@ -466,16 +524,14 @@ dependencies = [ "memchr", "pin-project-lite", "pin-utils", - "proc-macro-hack", - "proc-macro-nested", "slab", ] [[package]] name = "getrandom" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" dependencies = [ "cfg-if", "libc", @@ -484,9 +540,9 @@ dependencies = [ [[package]] name = "git2" -version = "0.13.24" +version = "0.13.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "845e007a28f1fcac035715988a234e8ec5458fd825b20a20c7dec74237ef341f" +checksum = "f29229cc1b24c0e6062f6e742aa3e256492a5323365e5ed3413599f8a5eff7d6" dependencies = [ "bitflags", "libc", @@ -499,9 +555,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.7" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fd819562fcebdac5afc5c113c3ec36f902840b70fd4fc458799c8ce4607ae55" +checksum = "d9f1f717ddc7b2ba36df7e871fd88db79326551d3d6f1fc406fbfd28b582ff8e" dependencies = [ "bytes", "fnv", @@ -560,9 +616,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1323096b05d41827dadeaee54c9981958c0f94e670bc94ed80037d1a7b8b186b" +checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" dependencies = [ "bytes", "fnv", @@ -582,15 +638,15 @@ dependencies = [ [[package]] name = "httparse" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acd94fdbe1d4ff688b67b04eee2e17bd50995534a61539e45adfefb45e5e5503" +checksum = "9100414882e15fb7feccb4897e5f0ff0ff1ca7d1a86a23208ada4d7a18e6c6c4" [[package]] name = "httpdate" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6456b8a6c8f33fee7d958fcd1b60d55b11940a79e63ae87013e6d22e26034440" +checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "humantime" @@ -600,9 +656,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.15" +version = "0.14.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436ec0091e4f20e655156a30a0df3770fe2900aa301e548e08446ec794b6953c" +checksum = "043f0e083e9901b6cc658a77d1eb86f4fc650bbb977a4337dd63192826aa85dd" dependencies = [ "bytes", "futures-channel", @@ -661,9 +717,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" dependencies = [ "autocfg", "hashbrown", @@ -686,9 +742,9 @@ checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" [[package]] name = "itoa" -version = "0.4.8" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" [[package]] name = "jobserver" @@ -701,9 +757,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.55" +version = "0.3.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" +checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" dependencies = [ "wasm-bindgen", ] @@ -716,15 +772,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.107" +version = "0.2.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbe5e23404da5b4f555ef85ebed98fb4083e55a00c317800bc2a50ede9f3d219" +checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" [[package]] name = "libgit2-sys" -version = "0.12.25+1.3.0" +version = "0.12.26+1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68169ef08d6519b2fe133ecc637408d933c0174b23b80bb2f79828966fbaab" +checksum = "19e1c899248e606fbfe68dcb31d8b0176ebab833b103824af31bddf4b7457494" dependencies = [ "cc", "libc", @@ -762,9 +818,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" +checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" dependencies = [ "scopeguard", ] @@ -801,6 +857,15 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +[[package]] +name = "memoffset" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +dependencies = [ + "autocfg", +] + [[package]] name = "mime" version = "0.3.16" @@ -859,9 +924,9 @@ dependencies = [ [[package]] name = "ntapi" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" dependencies = [ "winapi", ] @@ -887,9 +952,9 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" +checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ "hermit-abi", "libc", @@ -897,9 +962,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" [[package]] name = "openssl" @@ -917,15 +982,15 @@ dependencies = [ [[package]] name = "openssl-probe" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.71" +version = "0.9.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7df13d165e607909b363a4757a6f133f8a818a74e9d3a98d09c6128e15fa4c73" +checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb" dependencies = [ "autocfg", "cc", @@ -967,9 +1032,9 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pin-project-lite" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" +checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" [[package]] name = "pin-utils" @@ -979,15 +1044,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.22" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12295df4f294471248581bc09bef3c38a5e46f1e36d6a37353621a0c6c357e1f" - -[[package]] -name = "ppv-lite86" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed0cfbc8191465bed66e1718596ee0b0b35d5ee1f41c5df2189d0fe8bde535ba" +checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" [[package]] name = "proc-macro-error" @@ -1013,32 +1072,20 @@ dependencies = [ "version_check", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" - -[[package]] -name = "proc-macro-nested" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" - [[package]] name = "proc-macro2" -version = "1.0.32" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" +checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" dependencies = [ "unicode-xid", ] [[package]] name = "quote" -version = "1.0.10" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" +checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" dependencies = [ "proc-macro2", ] @@ -1056,28 +1103,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "rand" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" -dependencies = [ - "libc", - "rand_chacha", - "rand_core 0.6.3", - "rand_hc", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.3", -] - [[package]] name = "rand_core" version = "0.3.1" @@ -1094,21 +1119,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" [[package]] -name = "rand_core" -version = "0.6.3" +name = "rayon" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" dependencies = [ - "getrandom", + "autocfg", + "crossbeam-deque", + "either", + "rayon-core", ] [[package]] -name = "rand_hc" -version = "0.3.1" +name = "rayon-core" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" dependencies = [ - "rand_core 0.6.3", + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "lazy_static", + "num_cpus", ] [[package]] @@ -1167,15 +1199,16 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.7" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bea77bc708afa10e59905c3d4af7c8fd43c9214251673095ff8b14345fcbc5" +checksum = "87f242f1488a539a79bac6dbe7c8609ae43b7914b7736210f239a37cccb32525" dependencies = [ "base64", "bytes", "encoding_rs", "futures-core", "futures-util", + "h2", "http", "http-body", "hyper", @@ -1221,15 +1254,21 @@ dependencies = [ ] [[package]] -name = "rustls" -version = "0.20.2" +name = "rustc-hash" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d37e5e2290f3e040b594b1a9e04377c2c671f1a1cfd9bfdef82106ac1c113f84" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustls" +version = "0.20.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b323592e3164322f5b193dc4302e4e36cd8d37158a712d664efae1a5c2791700" dependencies = [ "log", "ring", "sct", - "webpki 0.22.0", + "webpki", ] [[package]] @@ -1243,15 +1282,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b3909d758bb75c79f23d4736fac9433868679d3ad2ea7a61e3c25cfda9a088" +checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" [[package]] name = "schannel" @@ -1281,9 +1320,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.4.2" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525bc1abfda2e1998d152c45cf13e696f76d0a4972310b22fac1658b05df7c87" +checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" dependencies = [ "bitflags", "core-foundation", @@ -1294,9 +1333,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.4.2" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9dd14d83160b528b7bfd66439110573efcfbe281b17fc2ca9f39f550d619c7e" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" dependencies = [ "core-foundation-sys", "libc", @@ -1304,27 +1343,27 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "568a8e6258aa33c13358f81fd834adb854c6f7c9468520910a9b1e8fac068012" +checksum = "0486718e92ec9a68fbed73bb5ef687d71103b142595b406835649bebd33f72c7" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.130" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" +checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.130" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" +checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" dependencies = [ "proc-macro2", "quote", @@ -1333,9 +1372,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.70" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e277c495ac6cd1a01a58d0a0c574568b4d1ddf14f59965c6a58b8d96400b54f3" +checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" dependencies = [ "itoa", "ryu", @@ -1344,9 +1383,9 @@ dependencies = [ [[package]] name = "serde_urlencoded" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ "form_urlencoded", "itoa", @@ -1365,9 +1404,9 @@ dependencies = [ [[package]] name = "simplelog" -version = "0.11.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8baa24de25f3092d9697c76f94cf09f67fca13db2ea11ce80c2f055c1aaf0795" +checksum = "c1348164456f72ca0116e4538bdaabb0ddb622c7d9f16387c725af3e96d6001c" dependencies = [ "chrono", "log", @@ -1382,9 +1421,9 @@ checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "smallvec" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" +checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "smartstring" @@ -1398,9 +1437,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.2" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dc90fe6c7be1a323296982db1836d1ea9e47b6839496dde9a541bc496df3516" +checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" dependencies = [ "libc", "winapi", @@ -1426,9 +1465,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "structopt" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40b9788f4202aa75c240ecc9c15c65185e6a39ccdeb0fd5d008b98825464c87c" +checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10" dependencies = [ "clap", "lazy_static", @@ -1469,9 +1508,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.81" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" +checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" dependencies = [ "proc-macro2", "quote", @@ -1480,9 +1519,9 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6f5515d3add52e0bbdcad7b83c388bb36ba7b754dda3b5f5bc2d38640cdba5c" +checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" dependencies = [ "filetime", "libc", @@ -1495,19 +1534,19 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" dependencies = [ - "rand 0.4.6", + "rand", "remove_dir_all", ] [[package]] name = "tempfile" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ "cfg-if", + "fastrand", "libc", - "rand 0.8.4", "redox_syscall", "remove_dir_all", "winapi", @@ -1588,11 +1627,10 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.14.0" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70e992e41e0d2fb9f755b37446f20900f64446ef54874f40a60c78f021ac6144" +checksum = "0c27a64b625de6d309e8c57716ba93021dccf1b3b5c97edd6d3dd2d2135afc0a" dependencies = [ - "autocfg", "bytes", "libc", "memchr", @@ -1608,9 +1646,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9efc1aba077437943f7515666aa2b882dfabfbfdf89c819ea75a8d6e9eaba5e" +checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" dependencies = [ "proc-macro2", "quote", @@ -1629,13 +1667,13 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.23.1" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4baa378e417d780beff82bf54ceb0d195193ea6a00c14e22359e7f39456b5689" +checksum = "a27d5f2b839802bd8267fa19b0530f5a08b9c08cd417976be2a65d130fe1c11b" dependencies = [ "rustls", "tokio", - "webpki 0.22.0", + "webpki", ] [[package]] @@ -1669,9 +1707,9 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" +checksum = "2d8d93354fe2a8e50d5953f5ae2e47a3fc2ef03292e7ea46e3cc38f549525fb9" dependencies = [ "cfg-if", "pin-project-lite", @@ -1680,9 +1718,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" +checksum = "03cfcb51380632a72d3111cb8d3447a8d908e577d31beeac006f836383d29a23" dependencies = [ "lazy_static", ] @@ -1710,9 +1748,9 @@ dependencies = [ [[package]] name = "unicode-segmentation" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" +checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" [[package]] name = "unicode-width" @@ -1758,9 +1796,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version_check" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "want" @@ -1780,9 +1818,9 @@ checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasm-bindgen" -version = "0.2.78" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" +checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1790,9 +1828,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.78" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" +checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" dependencies = [ "bumpalo", "lazy_static", @@ -1805,9 +1843,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.28" +version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8d7523cb1f2a4c96c1317ca690031b714a51cc14e05f712446691f413f5d39" +checksum = "2eb6ec270a31b1d3c7e266b999739109abce8b6c87e4b31fcfcd788b65267395" dependencies = [ "cfg-if", "js-sys", @@ -1817,9 +1855,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.78" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" +checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1827,9 +1865,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.78" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" +checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" dependencies = [ "proc-macro2", "quote", @@ -1840,30 +1878,20 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.78" +version = "0.2.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" +checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" [[package]] name = "web-sys" -version = "0.3.55" +version = "0.3.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" +checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb" dependencies = [ "js-sys", "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "webpki" version = "0.22.0" @@ -1876,11 +1904,11 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.21.1" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" +checksum = "552ceb903e957524388c4d3475725ff2c8b7960922063af6ce53c9a43da07449" dependencies = [ - "webpki 0.21.4", + "webpki", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 8e3cafd4..2e5bd883 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,26 +19,25 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -crates_io_api = "0.7.3" +crates_io_api = "0.8.0" cargo_metadata = "0.14.1" tinytemplate = "1.2.1" -tokio = { version = "1.14.0", features = [ "full" ] } +tokio = { version = "1.16.1", features = [ "full" ] } log = "0.4.14" -structopt = "0.3.25" -simplelog = "0.11.0" -anyhow = "1.0.51" -reqwest = { version = "0.11.7", features = [ "rustls-tls" ], default-features = false } +structopt = "0.3.26" +simplelog = "0.11.2" +anyhow = "1.0.53" +reqwest = { version = "0.11.9", features = [ "rustls-tls" ], default-features = false } tempdir = "0.3.7" flate2 = "1.0.22" -tar = "0.4.37" -cargo_toml = "0.10.2" -serde = { version = "1.0.130", features = [ "derive" ] } +tar = "0.4.38" +cargo_toml = "0.11.4" +serde = { version = "1.0.136", features = [ "derive" ] } strum_macros = "0.23.1" strum = "0.23.0" dirs = "4.0.0" -serde_derive = "1.0.118" -crates-index = "0.18.1" -semver = "1.0.4" +crates-index = "0.18.5" +semver = "1.0.5" xz2 = "0.1.6" zip = "0.5.13" From 370ae05620493a3c6b14473a9e1784934904679c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Wed, 16 Feb 2022 14:49:07 +1300 Subject: [PATCH 0013/2020] QuickInstall support (#94) See this issue: https://github.com/alsuren/cargo-quickinstall/issues/27 Quick Install is a hosted repo of built crates, essentially. The approach I've taken here is a list of strategies: 1. First, we check the crate meta or default and build the URL to the repo. Once we have that, we perform a `HEAD` request to the URL to see if it's available. 2. If it's not, we build the URL to the quickinstall repo, and perform a `HEAD` to there. As soon as we've got a hit, we use that. I've built it so it's extensible with more strategies. This could be useful for #4. This also adds a prompt before downloading from third-party sources, and logs a short name for a source, which is easier to glance than a full URL, and includes a quick refactor of the install/link machinery. --- Cargo.lock | 13 +++ Cargo.toml | 2 + README.md | 8 +- build.rs | 1 - src/bins.rs | 125 +++++++++++++++++++++ src/drivers.rs | 95 +++++++++------- src/fetchers.rs | 63 +++++++++++ src/fetchers/gh_crate_meta.rs | 74 +++++++++++++ src/fetchers/quickinstall.rs | 80 ++++++++++++++ src/helpers.rs | 89 +++++++++++---- src/lib.rs | 62 +++-------- src/main.rs | 197 ++++++++++++++++------------------ 12 files changed, 600 insertions(+), 209 deletions(-) create mode 100644 src/bins.rs create mode 100644 src/fetchers.rs create mode 100644 src/fetchers/gh_crate_meta.rs create mode 100644 src/fetchers/quickinstall.rs diff --git a/Cargo.lock b/Cargo.lock index c3c5a710..d98280ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -32,6 +32,17 @@ version = "1.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" +[[package]] +name = "async-trait" +version = "0.1.52" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "atty" version = "0.2.14" @@ -114,6 +125,7 @@ name = "cargo-binstall" version = "0.5.0" dependencies = [ "anyhow", + "async-trait", "cargo_metadata", "cargo_toml", "crates-index", @@ -133,6 +145,7 @@ dependencies = [ "tempdir", "tinytemplate", "tokio", + "url", "xz2", "zip", ] diff --git a/Cargo.toml b/Cargo.toml index 2e5bd883..6a4e3d5b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,6 +40,8 @@ crates-index = "0.18.5" semver = "1.0.5" xz2 = "0.1.6" zip = "0.5.13" +async-trait = "0.1.52" +url = "2.2.2" [dev-dependencies] env_logger = "0.9.0" diff --git a/README.md b/README.md index f2464ea6..7c804a92 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ yes - [x] Fetch crate / manifest via crates.io - [ ] Fetch crate / manifest via git (/ github / gitlab) - [x] Use local crate / manifest (`--manifest-path`) + - [x] Fetch build from the [quickinstall](https://github.com/alsuren/cargo-quickinstall) repository - [ ] Unofficial packaging - Package formats - [x] Tgz @@ -126,6 +127,10 @@ By default `binstall` is setup to work with github releases, and expects to find If your package already uses this approach, you shouldn't need to set anything. +### QuickInstall + +[QuickInstall](https://github.com/alsuren/cargo-quickinstall) is an unofficial repository of prebuilt binaries for Crates, and `binstall` has built-in support for it! If your crate is built by QuickInstall, it will already work with `binstall`. However, binaries as configured above take precedence when they exist. + ### Examples For example, the default configuration (as shown above) for a crate called `radio-sx128x` (version: `v0.14.1-alpha.5` on x86_64 linux) would be interpolated to: @@ -166,9 +171,6 @@ Which provides a binary path of: `sx128x-util-x86_64-unknown-linux-gnu[.exe]`. I - Why use the cargo manifest? - Crates already have these, and they already contain a significant portion of the required information. Also there's this great and woefully underused (imo) `[package.metadata]` field. -- Why not use a binary repository instead? - - Then we'd need to _host_ a binary repository, and worry about publishing and all the other fun things that come with releasing software. - This way we can use existing CI infrastructure and build artifacts, and maintainers can choose how to distribute their packages. - Is this secure? - Yes and also no? We're not (yet? #1) doing anything to verify the CI binaries are produced by the right person / organisation. However, we're pulling data from crates.io and the cargo manifest, both of which are _already_ trusted entities, and this is diff --git a/build.rs b/build.rs index a77a878b..a6f29869 100644 --- a/build.rs +++ b/build.rs @@ -1,4 +1,3 @@ - // Fetch build target and define this for the compiler fn main() { println!( diff --git a/src/bins.rs b/src/bins.rs new file mode 100644 index 00000000..d443e9a3 --- /dev/null +++ b/src/bins.rs @@ -0,0 +1,125 @@ +use std::path::PathBuf; + +use cargo_toml::Product; +use serde::Serialize; + +use crate::{PkgFmt, PkgMeta, Template}; + +pub struct BinFile { + pub base_name: String, + pub source: PathBuf, + pub dest: PathBuf, + pub link: PathBuf, +} + +impl BinFile { + pub fn from_product(data: &Data, product: &Product) -> Result { + let base_name = product.name.clone().unwrap(); + + // Generate binary path via interpolation + let ctx = Context { + name: &data.name, + repo: data.repo.as_ref().map(|s| &s[..]), + target: &data.target, + version: &data.version, + format: if data.target.contains("windows") { + ".exe" + } else { + "" + }, + bin: &base_name, + }; + + // Generate install paths + // Source path is the download dir + the generated binary path + let source_file_path = ctx.render(&data.meta.bin_dir)?; + let source = if data.meta.pkg_fmt == PkgFmt::Bin { + data.bin_path.clone() + } else { + data.bin_path.join(&source_file_path) + }; + + // Destination path is the install dir + base-name-version{.format} + let dest_file_path = ctx.render("{ bin }-v{ version }{ format }")?; + let dest = data.install_path.join(dest_file_path); + + // Link at install dir + base name + let link = data.install_path.join(&base_name); + + Ok(Self { + base_name, + source, + dest, + link, + }) + } + + pub fn preview_bin(&self) -> String { + format!( + "{} ({} -> {})", + self.base_name, + self.source.file_name().unwrap().to_string_lossy(), + self.dest.display() + ) + } + + pub fn preview_link(&self) -> String { + format!( + "{} ({} -> {})", + self.base_name, + self.dest.display(), + self.link.display() + ) + } + + pub fn install_bin(&self) -> Result<(), anyhow::Error> { + // TODO: check if file already exists + std::fs::copy(&self.source, &self.dest)?; + + #[cfg(target_family = "unix")] + { + use std::os::unix::fs::PermissionsExt; + std::fs::set_permissions(&self.dest, std::fs::Permissions::from_mode(0o755))?; + } + + Ok(()) + } + + pub fn install_link(&self) -> Result<(), anyhow::Error> { + // Remove existing symlink + // TODO: check if existing symlink is correct + if self.link.exists() { + std::fs::remove_file(&self.link)?; + } + + #[cfg(target_family = "unix")] + std::os::unix::fs::symlink(&self.dest, &self.link)?; + #[cfg(target_family = "windows")] + std::os::windows::fs::symlink_file(&self.dest, &self.link)?; + + Ok(()) + } +} + +/// Data required to get bin paths +pub struct Data { + pub name: String, + pub target: String, + pub version: String, + pub repo: Option, + pub meta: PkgMeta, + pub bin_path: PathBuf, + pub install_path: PathBuf, +} + +#[derive(Clone, Debug, Serialize)] +struct Context<'c> { + pub name: &'c str, + pub repo: Option<&'c str>, + pub target: &'c str, + pub version: &'c str, + pub format: &'c str, + pub bin: &'c str, +} + +impl<'c> Template for Context<'c> {} diff --git a/src/drivers.rs b/src/drivers.rs index f10b1448..a1f55bd2 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -1,39 +1,43 @@ - -use std::time::Duration; use std::path::{Path, PathBuf}; +use std::time::Duration; -use log::{debug}; -use anyhow::{Context, anyhow}; +use anyhow::{anyhow, Context}; +use log::debug; use semver::{Version, VersionReq}; use crates_io_api::AsyncClient; -use crate::PkgFmt; use crate::helpers::*; +use crate::PkgFmt; -fn find_version<'a, V: Iterator>(requirement: &str, version_iter: V) -> Result { +fn find_version<'a, V: Iterator>( + requirement: &str, + version_iter: V, +) -> Result { // Parse version requirement let version_req = VersionReq::parse(requirement)?; // Filter for matching versions - let mut filtered: Vec<_> = version_iter.filter(|v| { - // Remove leading `v` for git tags - let ver_str = match v.strip_prefix("s") { - Some(v) => v, - None => v, - }; + let mut filtered: Vec<_> = version_iter + .filter(|v| { + // Remove leading `v` for git tags + let ver_str = match v.strip_prefix("s") { + Some(v) => v, + None => v, + }; - // Parse out version - let ver = match Version::parse(ver_str) { - Ok(sv) => sv, - Err(_) => return false, - }; + // Parse out version + let ver = match Version::parse(ver_str) { + Ok(sv) => sv, + Err(_) => return false, + }; - debug!("Version: {:?}", ver); + debug!("Version: {:?}", ver); - // Filter by version match - version_req.matches(&ver) - }).collect(); + // Filter by version match + version_req.matches(&ver) + }) + .collect(); // Sort by highest matching version filtered.sort_by(|a, b| { @@ -48,13 +52,19 @@ fn find_version<'a, V: Iterator>(requirement: &str, version_iter: // Return highest version match filtered.get(0) { Some(v) => Ok(v.to_string()), - None => Err(anyhow!("No matching version for requirement: '{}'", version_req)) + None => Err(anyhow!( + "No matching version for requirement: '{}'", + version_req + )), } } /// Fetch a crate by name and version from crates.io -pub async fn fetch_crate_cratesio(name: &str, version_req: &str, temp_dir: &Path) -> Result { - +pub async fn fetch_crate_cratesio( + name: &str, + version_req: &str, + temp_dir: &Path, +) -> Result { // Fetch / update index debug!("Updating crates.io index"); let mut index = crates_index::Index::new_cargo_default()?; @@ -65,37 +75,48 @@ pub async fn fetch_crate_cratesio(name: &str, version_req: &str, temp_dir: &Path let base_info = match index.crate_(name) { Some(i) => i, None => { - return Err(anyhow::anyhow!("Error fetching information for crate {}", name)); + return Err(anyhow::anyhow!( + "Error fetching information for crate {}", + name + )); } }; // Locate matching version - let version_iter = base_info.versions().iter().map(|v| v.version() ); + let version_iter = base_info.versions().iter().map(|v| v.version()); let version_name = find_version(version_req, version_iter)?; - + // Build crates.io api client - let api_client = AsyncClient::new("cargo-binstall (https://github.com/ryankurte/cargo-binstall)", Duration::from_millis(100))?; + let api_client = AsyncClient::new( + "cargo-binstall (https://github.com/ryankurte/cargo-binstall)", + Duration::from_millis(100), + )?; // Fetch online crate information - let crate_info = api_client.get_crate(name.as_ref()).await + let crate_info = api_client + .get_crate(name.as_ref()) + .await .context("Error fetching crate information")?; // Fetch information for the filtered version let version = match crate_info.versions.iter().find(|v| v.num == version_name) { Some(v) => v, None => { - return Err(anyhow::anyhow!("No information found for crate: '{}' version: '{}'", - name, version_name)); + return Err(anyhow::anyhow!( + "No information found for crate: '{}' version: '{}'", + name, + version_name + )); } }; debug!("Found information for crate version: '{}'", version.num); - + // Download crate to temporary dir (crates.io or git?) let crate_url = format!("https://crates.io/{}", version.dl_path); let tgz_path = temp_dir.join(format!("{}.tgz", name)); - debug!("Fetching crate from: {}", crate_url); + debug!("Fetching crate from: {}", crate_url); // Download crate download(&crate_url, &tgz_path).await?; @@ -111,8 +132,10 @@ pub async fn fetch_crate_cratesio(name: &str, version_req: &str, temp_dir: &Path /// Fetch a crate by name and version from github /// TODO: implement this -pub async fn fetch_crate_gh_releases(_name: &str, _version: Option<&str>, _temp_dir: &Path) -> Result { - +pub async fn fetch_crate_gh_releases( + _name: &str, + _version: Option<&str>, + _temp_dir: &Path, +) -> Result { unimplemented!(); } - diff --git a/src/fetchers.rs b/src/fetchers.rs new file mode 100644 index 00000000..eedd920b --- /dev/null +++ b/src/fetchers.rs @@ -0,0 +1,63 @@ +use std::path::Path; + +pub use gh_crate_meta::*; +pub use quickinstall::*; + +use crate::{PkgFmt, PkgMeta}; + +mod gh_crate_meta; +mod quickinstall; + +#[async_trait::async_trait] +pub trait Fetcher { + /// Create a new fetcher from some data + async fn new(data: &Data) -> Result, anyhow::Error> + where + Self: Sized; + + /// Fetch a package + async fn fetch(&self, dst: &Path) -> Result<(), anyhow::Error>; + + /// Check if a package is available for download + async fn check(&self) -> Result; + + /// Return the package format + fn pkg_fmt(&self) -> PkgFmt; + + /// A short human-readable name or descriptor for the package source + fn source_name(&self) -> String; + + /// Should return true if the remote is from a third-party source + fn is_third_party(&self) -> bool; +} + +/// Data required to fetch a package +#[derive(Debug)] +pub struct Data { + pub name: String, + pub target: String, + pub version: String, + pub repo: Option, + pub meta: PkgMeta, +} + +#[derive(Default)] +pub struct MultiFetcher { + fetchers: Vec>, +} + +impl MultiFetcher { + pub fn add(&mut self, fetcher: Box) { + self.fetchers.push(fetcher); + } + + pub async fn first_available(&self) -> Option<&dyn Fetcher> { + for fetcher in &self.fetchers { + if fetcher.check().await.unwrap_or(false) { + return Some(&**fetcher); + } + } + + None + } +} diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs new file mode 100644 index 00000000..8ee3ad0f --- /dev/null +++ b/src/fetchers/gh_crate_meta.rs @@ -0,0 +1,74 @@ +use std::path::Path; + +use log::{debug, info}; +use reqwest::Method; +use serde::Serialize; +use url::Url; + +use super::Data; +use crate::{download, remote_exists, PkgFmt, Template}; + +pub struct GhCrateMeta { + url: Url, + pkg_fmt: PkgFmt, +} + +#[async_trait::async_trait] +impl super::Fetcher for GhCrateMeta { + async fn new(data: &Data) -> Result, anyhow::Error> { + // Generate context for URL interpolation + let ctx = Context { + name: &data.name, + repo: data.repo.as_ref().map(|s| &s[..]), + target: &data.target, + version: &data.version, + format: data.meta.pkg_fmt.to_string(), + }; + debug!("Using context: {:?}", ctx); + + Ok(Box::new(Self { + url: Url::parse(&ctx.render(&data.meta.pkg_url)?)?, + pkg_fmt: data.meta.pkg_fmt, + })) + } + + async fn check(&self) -> Result { + info!("Checking for package at: '{}'", self.url); + remote_exists(self.url.as_str(), Method::HEAD).await + } + + async fn fetch(&self, dst: &Path) -> Result<(), anyhow::Error> { + info!("Downloading package from: '{}'", self.url); + download(self.url.as_str(), dst).await + } + + fn pkg_fmt(&self) -> PkgFmt { + self.pkg_fmt + } + + fn source_name(&self) -> String { + if let Some(domain) = self.url.domain() { + domain.to_string() + } else if let Some(host) = self.url.host_str() { + host.to_string() + } else { + self.url.to_string() + } + } + + fn is_third_party(&self) -> bool { + false + } +} + +/// Template for constructing download paths +#[derive(Clone, Debug, Serialize)] +struct Context<'c> { + pub name: &'c str, + pub repo: Option<&'c str>, + pub target: &'c str, + pub version: &'c str, + pub format: String, +} + +impl<'c> Template for Context<'c> {} diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs new file mode 100644 index 00000000..cbea5f9d --- /dev/null +++ b/src/fetchers/quickinstall.rs @@ -0,0 +1,80 @@ +use std::path::Path; + +use log::info; +use reqwest::Method; + +use super::Data; +use crate::{download, remote_exists, PkgFmt}; + +const BASE_URL: &str = "https://github.com/alsuren/cargo-quickinstall/releases/download"; +const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; +const USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")); + +pub struct QuickInstall { + package: String, +} + +#[async_trait::async_trait] +impl super::Fetcher for QuickInstall { + async fn new(data: &Data) -> Result, anyhow::Error> { + let crate_name = &data.name; + let version = &data.version; + let target = &data.target; + Ok(Box::new(Self { + package: format!("{crate_name}-{version}-{target}"), + })) + } + + async fn check(&self) -> Result { + let url = self.package_url(); + self.report().await?; + info!("Checking for package at: '{url}'"); + remote_exists(&url, Method::HEAD).await + } + + async fn fetch(&self, dst: &Path) -> Result<(), anyhow::Error> { + let url = self.package_url(); + info!("Downloading package from: '{url}'"); + download(&url, dst).await + } + + fn pkg_fmt(&self) -> PkgFmt { + PkgFmt::Tgz + } + + fn source_name(&self) -> String { + String::from("QuickInstall") + } + fn is_third_party(&self) -> bool { + true + } +} + +impl QuickInstall { + fn package_url(&self) -> String { + format!( + "{base_url}/{package}/{package}.tar.gz", + base_url = BASE_URL, + package = self.package + ) + } + + fn stats_url(&self) -> String { + format!( + "{stats_url}/{package}.tar.gz", + stats_url = STATS_URL, + package = self.package + ) + } + + pub async fn report(&self) -> Result<(), anyhow::Error> { + info!("Sending installation report to quickinstall (anonymous)"); + reqwest::Client::builder() + .user_agent(USER_AGENT) + .build()? + .request(Method::HEAD, &self.stats_url()) + .send() + .await?; + Ok(()) + } +} diff --git a/src/helpers.rs b/src/helpers.rs index dce5c9f3..a94437a6 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,20 +1,23 @@ - use std::path::{Path, PathBuf}; -use log::{debug, info, error}; +use log::{debug, error, info}; -use cargo_toml::{Manifest}; +use cargo_toml::Manifest; use flate2::read::GzDecoder; +use serde::Serialize; use tar::Archive; +use tinytemplate::TinyTemplate; use xz2::read::XzDecoder; use zip::read::ZipArchive; -use crate::{Meta}; +use crate::Meta; use super::PkgFmt; /// Load binstall metadata from the crate `Cargo.toml` at the provided path -pub fn load_manifest_path>(manifest_path: P) -> Result, anyhow::Error> { +pub fn load_manifest_path>( + manifest_path: P, +) -> Result, anyhow::Error> { debug!("Reading manifest: {}", manifest_path.as_ref().display()); // Load and parse manifest (this checks file system for binary output names) @@ -24,9 +27,13 @@ pub fn load_manifest_path>(manifest_path: P) -> Result Result { + let req = reqwest::Client::new().request(method, url).send().await?; + Ok(req.status().is_success()) +} + /// Download a file from the provided URL to the provided path pub async fn download>(url: &str, path: P) -> Result<(), anyhow::Error> { - debug!("Downloading from: '{}'", url); let resp = reqwest::get(url).await?; @@ -46,51 +53,75 @@ pub async fn download>(url: &str, path: P) -> Result<(), anyhow:: } /// Extract files from the specified source onto the specified path -pub fn extract, P: AsRef>(source: S, fmt: PkgFmt, path: P) -> Result<(), anyhow::Error> { +pub fn extract, P: AsRef>( + source: S, + fmt: PkgFmt, + path: P, +) -> Result<(), anyhow::Error> { match fmt { PkgFmt::Tar => { // Extract to install dir - debug!("Extracting from tar archive '{:?}' to `{:?}`", source.as_ref(), path.as_ref()); + debug!( + "Extracting from tar archive '{:?}' to `{:?}`", + source.as_ref(), + path.as_ref() + ); let dat = std::fs::File::open(source)?; let mut tar = Archive::new(dat); tar.unpack(path)?; - }, + } PkgFmt::Tgz => { // Extract to install dir - debug!("Decompressing from tgz archive '{:?}' to `{:?}`", source.as_ref(), path.as_ref()); + debug!( + "Decompressing from tgz archive '{:?}' to `{:?}`", + source.as_ref(), + path.as_ref() + ); let dat = std::fs::File::open(source)?; let tar = GzDecoder::new(dat); let mut tgz = Archive::new(tar); tgz.unpack(path)?; - }, + } PkgFmt::Txz => { // Extract to install dir - debug!("Decompressing from txz archive '{:?}' to `{:?}`", source.as_ref(), path.as_ref()); + debug!( + "Decompressing from txz archive '{:?}' to `{:?}`", + source.as_ref(), + path.as_ref() + ); let dat = std::fs::File::open(source)?; let tar = XzDecoder::new(dat); let mut txz = Archive::new(tar); txz.unpack(path)?; - }, + } PkgFmt::Zip => { // Extract to install dir - debug!("Decompressing from zip archive '{:?}' to `{:?}`", source.as_ref(), path.as_ref()); + debug!( + "Decompressing from zip archive '{:?}' to `{:?}`", + source.as_ref(), + path.as_ref() + ); let dat = std::fs::File::open(source)?; let mut zip = ZipArchive::new(dat)?; zip.extract(path)?; - }, + } PkgFmt::Bin => { - debug!("Copying binary '{:?}' to `{:?}`", source.as_ref(), path.as_ref()); + debug!( + "Copying binary '{:?}' to `{:?}`", + source.as_ref(), + path.as_ref() + ); // Copy to install dir std::fs::copy(source, path)?; - }, + } }; Ok(()) @@ -101,7 +132,7 @@ pub fn extract, P: AsRef>(source: S, fmt: PkgFmt, path: P) pub fn get_install_path>(install_path: Option

) -> Option { // Command line override first first if let Some(p) = install_path { - return Some(PathBuf::from(p.as_ref())) + return Some(PathBuf::from(p.as_ref())); } // Environmental variables @@ -144,8 +175,24 @@ pub fn confirm() -> Result { match input.as_str().trim() { "yes" => Ok(true), "no" => Ok(false), - _ => { - Err(anyhow::anyhow!("Valid options are 'yes', 'no', please try again")) - } + _ => Err(anyhow::anyhow!( + "Valid options are 'yes', 'no', please try again" + )), + } +} + +pub trait Template: Serialize { + fn render(&self, template: &str) -> Result + where + Self: Sized, + { + // Create template instance + let mut tt = TinyTemplate::new(); + + // Add template to instance + tt.add_template("path", &template)?; + + // Render output + Ok(tt.render("path", self)?) } } diff --git a/src/lib.rs b/src/lib.rs index b8564f38..cf32973b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,10 +1,7 @@ - use std::collections::HashMap; -use serde::{Serialize, Deserialize}; +use serde::{Deserialize, Serialize}; use strum_macros::{Display, EnumString, EnumVariantNames}; -use tinytemplate::TinyTemplate; - pub mod helpers; pub use helpers::*; @@ -12,20 +9,23 @@ pub use helpers::*; pub mod drivers; pub use drivers::*; +pub mod bins; +pub mod fetchers; /// Compiled target triple, used as default for binary fetching pub const TARGET: &'static str = env!("TARGET"); /// Default package path template (may be overridden in package Cargo.toml) -pub const DEFAULT_PKG_URL: &'static str = "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ format }"; +pub const DEFAULT_PKG_URL: &'static str = + "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ format }"; /// Default binary name template (may be overridden in package Cargo.toml) pub const DEFAULT_BIN_PATH: &'static str = "{ name }-{ target }-v{ version }/{ bin }{ format }"; - /// Binary format enumeration -#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)] -#[derive(Display, EnumString, EnumVariantNames)] +#[derive( + Debug, Copy, Clone, PartialEq, Serialize, Deserialize, Display, EnumString, EnumVariantNames, +)] #[strum(serialize_all = "snake_case")] #[serde(rename_all = "snake_case")] pub enum PkgFmt { @@ -131,7 +131,6 @@ impl Default for PkgOverride { } } - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "kebab-case")] pub struct BinMeta { @@ -141,36 +140,9 @@ pub struct BinMeta { pub path: String, } -/// Template for constructing download paths -#[derive(Clone, Debug, Serialize)] -pub struct Context { - pub name: String, - pub repo: Option, - pub target: String, - pub version: String, - pub format: String, - pub bin: Option, -} - -impl Context { - /// Render the context into the provided template - pub fn render(&self, template: &str) -> Result { - // Create template instance - let mut tt = TinyTemplate::new(); - - // Add template to instance - tt.add_template("path", &template)?; - - // Render output - let rendered = tt.render("path", self)?; - - Ok(rendered) - } -} - #[cfg(test)] mod test { - use crate::{load_manifest_path}; + use crate::load_manifest_path; use cargo_toml::Product; @@ -187,7 +159,7 @@ mod test { let manifest = load_manifest_path(&manifest_dir).expect("Error parsing metadata"); let package = manifest.package.unwrap(); - let meta = package.metadata.map(|m| m.binstall ).flatten().unwrap(); + let meta = package.metadata.map(|m| m.binstall).flatten().unwrap(); assert_eq!(&package.name, "cargo-binstall"); @@ -198,14 +170,12 @@ mod test { assert_eq!( manifest.bin.as_slice(), - &[ - Product{ - name: Some("cargo-binstall".to_string()), - path: Some("src/main.rs".to_string()), - edition: Some(cargo_toml::Edition::E2018), - ..Default::default() - }, - ], + &[Product { + name: Some("cargo-binstall".to_string()), + path: Some("src/main.rs".to_string()), + edition: Some(cargo_toml::Edition::E2018), + ..Default::default() + },], ); } } diff --git a/src/main.rs b/src/main.rs index 6f7cf72e..9aed9e0c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,14 +1,17 @@ -use std::path::{PathBuf}; +use std::path::PathBuf; -use log::{debug, info, warn, error, LevelFilter}; -use simplelog::{TermLogger, ConfigBuilder, TerminalMode, ColorChoice}; +use log::{debug, error, info, warn, LevelFilter}; +use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; use structopt::StructOpt; use tempdir::TempDir; -use cargo_binstall::*; - +use cargo_binstall::{ + bins, + fetchers::{Data, Fetcher, GhCrateMeta, MultiFetcher, QuickInstall}, + *, +}; #[derive(Debug, StructOpt)] struct Options { @@ -48,7 +51,7 @@ struct Options { /// Override manifest source. /// This skips searching crates.io for a manifest and uses - /// the specified path directly, useful for debugging and + /// the specified path directly, useful for debugging and /// when adding `binstall` support. #[structopt(long)] manifest_path: Option, @@ -58,10 +61,8 @@ struct Options { log_level: LevelFilter, } - #[tokio::main] async fn main() -> Result<(), anyhow::Error> { - // Filter extraneous arg when invoked by cargo // `cargo run -- --help` gives ["target/debug/cargo-binstall", "--help"] // `cargo binstall --help` gives ["/home/ryan/.cargo/bin/cargo-binstall", "binstall", "--help"] @@ -78,7 +79,13 @@ async fn main() -> Result<(), anyhow::Error> { log_config.add_filter_ignore("hyper".to_string()); log_config.add_filter_ignore("reqwest".to_string()); log_config.set_location_level(LevelFilter::Off); - TermLogger::init(opts.log_level, log_config.build(), TerminalMode::Mixed, ColorChoice::Auto).unwrap(); + TermLogger::init( + opts.log_level, + log_config.build(), + TerminalMode::Mixed, + ColorChoice::Auto, + ) + .unwrap(); // Create a temporary directory for downloads etc. let temp_dir = TempDir::new("cargo-binstall")?; @@ -92,13 +99,17 @@ async fn main() -> Result<(), anyhow::Error> { Some(p) => p, None => fetch_crate_cratesio(&opts.name, &opts.version, temp_dir.path()).await?, }; - + debug!("Reading manifest: {}", manifest_path.display()); let manifest = load_manifest_path(manifest_path.join("Cargo.toml"))?; let package = manifest.package.unwrap(); let (mut meta, binaries) = ( - package.metadata.map(|m| m.binstall ).flatten().unwrap_or(PkgMeta::default()), + package + .metadata + .map(|m| m.binstall) + .flatten() + .unwrap_or(PkgMeta::default()), manifest.bin, ); @@ -109,42 +120,61 @@ async fn main() -> Result<(), anyhow::Error> { debug!("Found metadata: {:?}", meta); - // Generate context for URL interpolation - let ctx = Context { - name: opts.name.clone(), - repo: package.repository, - target: opts.target.clone(), - version: package.version.clone(), - format: meta.pkg_fmt.to_string(), - bin: None, - }; - - debug!("Using context: {:?}", ctx); - - // Interpolate version / target / etc. - let rendered = ctx.render(&meta.pkg_url)?; - // Compute install directory - let install_path = match get_install_path(opts.install_path.as_deref()) { - Some(p) => p, - None => { - error!("No viable install path found of specified, try `--install-path`"); - return Err(anyhow::anyhow!("No install path found or specified")); - } - }; - + let install_path = get_install_path(opts.install_path.as_deref()).ok_or_else(|| { + error!("No viable install path found of specified, try `--install-path`"); + anyhow::anyhow!("No install path found or specified") + })?; debug!("Using install path: {}", install_path.display()); - info!("Downloading package from: '{}'", rendered); + // Compute temporary directory for downloads + let pkg_path = temp_dir + .path() + .join(format!("pkg-{}.{}", opts.name, meta.pkg_fmt)); + debug!("Using temporary download path: {}", pkg_path.display()); + + let fetcher_data = Data { + name: package.name.clone(), + target: opts.target.clone(), + version: package.version.clone(), + repo: package.repository.clone(), + meta: meta.clone(), + }; + + // Try github releases, then quickinstall + let mut fetchers = MultiFetcher::default(); + fetchers.add(GhCrateMeta::new(&fetcher_data).await?); + fetchers.add(QuickInstall::new(&fetcher_data).await?); + + let fetcher = fetchers.first_available().await.ok_or_else(|| { + error!("File does not exist remotely, cannot proceed"); + anyhow::anyhow!("No viable remote package found") + })?; + + // Prompt user for third-party source + if fetcher.is_third_party() { + warn!( + "The package will be downloaded from third-party source {}", + fetcher.source_name() + ); + if !opts.no_confirm && !confirm()? { + warn!("Installation cancelled"); + return Ok(()); + } + } else { + info!( + "The package will be downloaded from {}", + fetcher.source_name() + ); + } // Download package - let pkg_path = temp_dir.path().join(format!("pkg-{}.{}", opts.name, meta.pkg_fmt)); - download(&rendered, pkg_path.to_str().unwrap()).await?; + fetcher.fetch(&pkg_path).await?; #[cfg(incomplete)] { // Fetch and check package signature if available - if let Some(pub_key) = meta.as_ref().map(|m| m.pub_key.clone() ).flatten() { + if let Some(pub_key) = meta.as_ref().map(|m| m.pub_key.clone()).flatten() { debug!("Found public key: {}", pub_key); // Generate signature file URL @@ -160,7 +190,6 @@ async fn main() -> Result<(), anyhow::Error> { // TODO: do the signature check unimplemented!() - } else { warn!("No public key found, package signature could not be validated"); } @@ -168,7 +197,7 @@ async fn main() -> Result<(), anyhow::Error> { // Extract files let bin_path = temp_dir.path().join(format!("bin-{}", opts.name)); - extract(&pkg_path, meta.pkg_fmt, &bin_path)?; + extract(&pkg_path, fetcher.pkg_fmt(), &bin_path)?; // Bypass cleanup if disabled if opts.no_cleanup { @@ -177,94 +206,58 @@ async fn main() -> Result<(), anyhow::Error> { if binaries.len() == 0 { error!("No binaries specified (or inferred from file system)"); - return Err(anyhow::anyhow!("No binaries specified (or inferred from file system)")); + return Err(anyhow::anyhow!( + "No binaries specified (or inferred from file system)" + )); } // List files to be installed // based on those found via Cargo.toml - let bin_files = binaries.iter().map(|p| { - // Fetch binary base name - let base_name = p.name.clone().unwrap(); + let bin_data = bins::Data { + name: package.name.clone(), + target: opts.target.clone(), + version: package.version.clone(), + repo: package.repository.clone(), + meta, + bin_path, + install_path, + }; - // Generate binary path via interpolation - let mut bin_ctx = ctx.clone(); - bin_ctx.bin = Some(base_name.clone()); - - // Append .exe to windows binaries - bin_ctx.format = match &opts.target.clone().contains("windows") { - true => ".exe".to_string(), - false => "".to_string(), - }; - - // Generate install paths - // Source path is the download dir + the generated binary path - let source_file_path = bin_ctx.render(&meta.bin_dir)?; - let source = if meta.pkg_fmt == PkgFmt::Bin { - bin_path.clone() - } else { - bin_path.join(&source_file_path) - }; - - // Destination path is the install dir + base-name-version{.format} - let dest_file_path = bin_ctx.render("{ bin }-v{ version }{ format }")?; - let dest = install_path.join(dest_file_path); - - // Link at install dir + base name - let link = install_path.join(&base_name); - - Ok((base_name, source, dest, link)) - }).collect::, anyhow::Error>>()?; + let bin_files = binaries + .iter() + .map(|p| bins::BinFile::from_product(&bin_data, p)) + .collect::, anyhow::Error>>()?; // Prompt user for confirmation info!("This will install the following binaries:"); - for (name, source, dest, _link) in &bin_files { - info!(" - {} ({} -> {})", name, source.file_name().unwrap().to_string_lossy(), dest.display()); + for file in &bin_files { + info!(" - {}", file.preview_bin()); } if !opts.no_symlinks { info!("And create (or update) the following symlinks:"); - for (name, _source, dest, link) in &bin_files { - info!(" - {} ({} -> {})", name, dest.display(), link.display()); + for file in &bin_files { + info!(" - {}", file.preview_link()); } } if !opts.no_confirm && !confirm()? { warn!("Installation cancelled"); - return Ok(()) + return Ok(()); } info!("Installing binaries..."); - - // Install binaries - for (_name, source, dest, _link) in &bin_files { - // TODO: check if file already exists - std::fs::copy(source, dest)?; - - #[cfg(target_family = "unix")] - { - use std::os::unix::fs::PermissionsExt; - std::fs::set_permissions(dest, std::fs::Permissions::from_mode(0o755))?; - } + for file in &bin_files { + file.install_bin()?; } // Generate symlinks if !opts.no_symlinks { - for (_name, _source, dest, link) in &bin_files { - // Remove existing symlink - // TODO: check if existing symlink is correct - if link.exists() { - std::fs::remove_file(&link)?; - } - - #[cfg(target_family = "unix")] - std::os::unix::fs::symlink(dest, link)?; - #[cfg(target_family = "windows")] - std::os::windows::fs::symlink_file(dest, link)?; + for file in &bin_files { + file.install_link()?; } } - - info!("Installation complete!"); + info!("Installation complete!"); Ok(()) } - From 6dcb1dd1b4228d4dc636d9bd3e61a4e96b9eb61f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Wed, 16 Feb 2022 16:18:35 +1300 Subject: [PATCH 0014/2020] Split {format} and allow use of {binary-ext} in pkg-url (#95) This from feedback in #19: > wrt. bin-dir and bin-path, this appears to be a typo / should all be called bin-dir This is only a readme fix afaict, I changed all occurences of `bin-path` in there to `bin-dir`. > wrt. format, those are actually two (unfortunately named) different concepts, the first refers to the archive format (eg. .tgz), the second to the binary format (which needs a .exe appended for windows). This introduces two new substitutions: - `binary-ext` is the old "`format` in `bin-dir`" - `archive-format` is the old "`format` in `pkg-url`" Contents are unchanged: `binary-ext` includes the dot, `archive-format` doesn't. That makes it easy to upgrade and also personally I slightly prefer it that way. The old contextual `format` is still available, "soft deprecated": it will be accepted silently so everything will work, but all documentation will use the new syntax. In the future we could move to a "hard deprecated" model where installing a package that uses `format` will warn the user / tell them to report that to the maintainer. I don't think we'll ever really be able to remove it but that should be good enough. A cool new feature is that `binary-ext` is now usable in `pkg-url`, which will be useful for raw binary downloads: ```toml pkg_url = "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }{ binary-ext }" ``` I've also added a bunch of tests to GhCrateMeta around the templating for `pkg-url`. --- Cargo.toml | 4 +- README.md | 23 +++-- src/bins.rs | 26 +++-- src/fetchers/gh_crate_meta.rs | 188 ++++++++++++++++++++++++++++++++-- src/lib.rs | 8 +- 5 files changed, 215 insertions(+), 34 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6a4e3d5b..af946957 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,8 +10,8 @@ license = "GPL-3.0" [package.metadata.binstall] -pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ format }" -bin-dir = "{ bin }{ format }" +pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }" +bin-dir = "{ bin }{ binary-ext }" [package.metadata.binstall.overrides.x86_64-pc-windows-msvc] pkg-fmt = "zip" diff --git a/README.md b/README.md index 7c804a92..95a023df 100644 --- a/README.md +++ b/README.md @@ -86,27 +86,30 @@ To get started, add a `[package.metadata.binstall]` section to your `Cargo.toml` ```toml [package.metadata.binstall] -pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ format }" -bin-dir = "{ name }-{ target }-v{ version }/{ bin }{ format }" +pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }" +bin-dir = "{ name }-{ target }-v{ version }/{ bin }{ binary-ext }" pkg-fmt = "tgz" ``` With the following configuration keys: - `pkg-url` specifies the package download URL for a given target/version, templated -- `bin-path` specifies the binary path within the package, templated (with an `.exe` suffix on windows) +- `bin-dir` specifies the binary path within the package, templated (with an `.exe` suffix on windows) - `pkg-fmt` overrides the package format for download/extraction (defaults to: `tgz`) -`pkg-url` and `bin-path` are templated to support different names for different versions / architectures / etc. +`pkg-url` and `bin-dir` are templated to support different names for different versions / architectures / etc. Template variables use the format `{ VAR }` where `VAR` is the name of the variable, with the following variables available: - `name` is the name of the crate / package - `version` is the crate version (per `--version` and the crate manifest) - `repo` is the repository linked in `Cargo.toml` - `bin` is the name of a specific binary, inferred from the crate configuration -- `target` is the rust target name (defaults to your architecture, but can be overridden using the `--target` command line option if required(). +- `target` is the rust target name (defaults to your architecture, but can be overridden using the `--target` command line option if required() +- `archive-format` is the filename extension of the package archive format +- `binary-ext` is the string `.exe` if the `target` is for Windows, or the empty string otherwise +- `format` is a soft-deprecated alias for `archive-format` in `pkg-url`, and for `binary-ext` in `bin-dir`; in the future this may warn at install time. -`pkg-url`, `pkg-fmt` and `bin-path` can be overridden on a per-target basis if required, for example, if your `x86_64-pc-windows-msvc` builds use `zip` archives this could be set via: +`pkg-url`, `pkg-fmt` and `bin-dir` can be overridden on a per-target basis if required, for example, if your `x86_64-pc-windows-msvc` builds use `zip` archives this could be set via: ``` [package.metadata.binstall.overrides.x86_64-pc-windows-msvc] @@ -117,13 +120,13 @@ pkg-fmt = "zip" By default `binstall` is setup to work with github releases, and expects to find: -- an archive named `{ name }-{ target }-v{ version }.{ format }` +- an archive named `{ name }-{ target }-v{ version }.{ archive-format }` - so that this does not overwrite different targets or versions when manually downloaded - located at `{ repo }/releases/download/v{ version }/` - compatible with github tags / releases - containing a folder named `{ name }-{ target }-v{ version }` - so that prior binary files are not overwritten when manually executing `tar -xvf ...` -- containing binary files in the form `{ bin }{ format }` (where `bin` is the cargo binary name and `format` is `.exe` on windows and empty on other platforms) +- containing binary files in the form `{ bin }{ binary-ext }` (where `bin` is the cargo binary name and `binary-ext` is `.exe` on windows and empty on other platforms) If your package already uses this approach, you shouldn't need to set anything. @@ -146,7 +149,7 @@ As is common with libraries / utilities (and the `radio-sx128x` example), this c ```toml [package.metadata.binstall] -pkg-url = "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ format }" +pkg-url = "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ archive-format }" ``` Which provides a download URL of: `https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz` @@ -158,7 +161,7 @@ Were the package to contain binaries in the form `name-target[.exe]`, this could ```toml [package.metadata.binstall] -bin-dir = "{ bin }-{ target }{ format }" +bin-dir = "{ bin }-{ target }{ binary-ext }" ``` Which provides a binary path of: `sx128x-util-x86_64-unknown-linux-gnu[.exe]`. It is worth noting that binary names are inferred from the crate, so long as cargo builds them this _should_ just work. diff --git a/src/bins.rs b/src/bins.rs index d443e9a3..e91d09bb 100644 --- a/src/bins.rs +++ b/src/bins.rs @@ -16,18 +16,20 @@ impl BinFile { pub fn from_product(data: &Data, product: &Product) -> Result { let base_name = product.name.clone().unwrap(); - // Generate binary path via interpolation + let binary_ext = if data.target.contains("windows") { + ".exe" + } else { + "" + }; + let ctx = Context { name: &data.name, repo: data.repo.as_ref().map(|s| &s[..]), target: &data.target, version: &data.version, - format: if data.target.contains("windows") { - ".exe" - } else { - "" - }, bin: &base_name, + format: binary_ext, + binary_ext, }; // Generate install paths @@ -39,8 +41,8 @@ impl BinFile { data.bin_path.join(&source_file_path) }; - // Destination path is the install dir + base-name-version{.format} - let dest_file_path = ctx.render("{ bin }-v{ version }{ format }")?; + // Destination path is the install dir + base-name-version{.extension} + let dest_file_path = ctx.render("{ bin }-v{ version }{ binary-ext }")?; let dest = data.install_path.join(dest_file_path); // Link at install dir + base name @@ -118,8 +120,14 @@ struct Context<'c> { pub repo: Option<&'c str>, pub target: &'c str, pub version: &'c str, - pub format: &'c str, pub bin: &'c str, + + /// Soft-deprecated alias for binary-ext + pub format: &'c str, + + /// Filename extension on the binary, i.e. .exe on Windows, nothing otherwise + #[serde(rename = "binary-ext")] + pub binary_ext: &'c str, } impl<'c> Template for Context<'c> {} diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index 8ee3ad0f..83e3da8d 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -16,18 +16,11 @@ pub struct GhCrateMeta { #[async_trait::async_trait] impl super::Fetcher for GhCrateMeta { async fn new(data: &Data) -> Result, anyhow::Error> { - // Generate context for URL interpolation - let ctx = Context { - name: &data.name, - repo: data.repo.as_ref().map(|s| &s[..]), - target: &data.target, - version: &data.version, - format: data.meta.pkg_fmt.to_string(), - }; + let ctx = Context::from_data(data); debug!("Using context: {:?}", ctx); Ok(Box::new(Self { - url: Url::parse(&ctx.render(&data.meta.pkg_url)?)?, + url: ctx.render_url(&data.meta.pkg_url)?, pkg_fmt: data.meta.pkg_fmt, })) } @@ -68,7 +61,184 @@ struct Context<'c> { pub repo: Option<&'c str>, pub target: &'c str, pub version: &'c str, + + /// Soft-deprecated alias for archive-format pub format: String, + + /// Archive format e.g. tar.gz, zip + #[serde(rename = "archive-format")] + pub archive_format: String, + + /// Filename extension on the binary, i.e. .exe on Windows, nothing otherwise + #[serde(rename = "binary-ext")] + pub binary_ext: &'c str, } impl<'c> Template for Context<'c> {} + +impl<'c> Context<'c> { + pub(self) fn from_data(data: &'c Data) -> Self { + let pkg_fmt = data.meta.pkg_fmt.to_string(); + Self { + name: &data.name, + repo: data.repo.as_ref().map(|s| &s[..]), + target: &data.target, + version: &data.version, + format: pkg_fmt.clone(), + archive_format: pkg_fmt, + binary_ext: if data.target.contains("windows") { + ".exe" + } else { + "" + }, + } + } + + pub(self) fn render_url(&self, template: &str) -> Result { + Ok(Url::parse(&self.render(template)?)?) + } +} + +#[cfg(test)] +mod test { + use super::{super::Data, Context}; + use crate::{PkgFmt, PkgMeta}; + use url::Url; + + fn url(s: &str) -> Url { + Url::parse(s).unwrap() + } + + #[test] + fn defaults() { + let meta = PkgMeta::default(); + let data = Data { + name: "cargo-binstall".to_string(), + target: "x86_64-unknown-linux-gnu".to_string(), + version: "1.2.3".to_string(), + repo: Some("https://github.com/ryankurte/cargo-binstall".to_string()), + meta, + }; + + let ctx = Context::from_data(&data); + assert_eq!( + ctx.render_url(&data.meta.pkg_url).unwrap(), + url("https://github.com/ryankurte/cargo-binstall/releases/download/v1.2.3/cargo-binstall-x86_64-unknown-linux-gnu-v1.2.3.tgz") + ); + } + + #[test] + #[should_panic] + fn no_repo() { + let meta = PkgMeta::default(); + let data = Data { + name: "cargo-binstall".to_string(), + target: "x86_64-unknown-linux-gnu".to_string(), + version: "1.2.3".to_string(), + repo: None, + meta, + }; + + let ctx = Context::from_data(&data); + ctx.render_url(&data.meta.pkg_url).unwrap(); + } + + #[test] + fn no_repo_but_full_url() { + let mut meta = PkgMeta::default(); + meta.pkg_url = format!("https://example.com{}", meta.pkg_url); + let data = Data { + name: "cargo-binstall".to_string(), + target: "x86_64-unknown-linux-gnu".to_string(), + version: "1.2.3".to_string(), + repo: None, + meta, + }; + + let ctx = Context::from_data(&data); + assert_eq!( + ctx.render_url(&data.meta.pkg_url).unwrap(), + url("https://example.com/releases/download/v1.2.3/cargo-binstall-x86_64-unknown-linux-gnu-v1.2.3.tgz") + ); + } + + #[test] + fn different_url() { + let mut meta = PkgMeta::default(); + meta.pkg_url = "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ archive-format }".to_string(); + let data = Data { + name: "radio-sx128x".to_string(), + target: "x86_64-unknown-linux-gnu".to_string(), + version: "0.14.1-alpha.5".to_string(), + repo: Some("https://github.com/rust-iot/rust-radio-sx128x".to_string()), + meta, + }; + + let ctx = Context::from_data(&data); + assert_eq!( + ctx.render_url(&data.meta.pkg_url).unwrap(), + url("https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz") + ); + } + + #[test] + fn deprecated_format() { + let mut meta = PkgMeta::default(); + meta.pkg_url = "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ format }".to_string(); + let data = Data { + name: "radio-sx128x".to_string(), + target: "x86_64-unknown-linux-gnu".to_string(), + version: "0.14.1-alpha.5".to_string(), + repo: Some("https://github.com/rust-iot/rust-radio-sx128x".to_string()), + meta, + }; + + let ctx = Context::from_data(&data); + assert_eq!( + ctx.render_url(&data.meta.pkg_url).unwrap(), + url("https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz") + ); + } + + #[test] + fn different_ext() { + let mut meta = PkgMeta::default(); + meta.pkg_url = + "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }.tar.xz" + .to_string(); + meta.pkg_fmt = PkgFmt::Txz; + let data = Data { + name: "cargo-watch".to_string(), + target: "aarch64-apple-darwin".to_string(), + version: "9.0.0".to_string(), + repo: Some("https://github.com/watchexec/cargo-watch".to_string()), + meta, + }; + + let ctx = Context::from_data(&data); + assert_eq!( + ctx.render_url(&data.meta.pkg_url).unwrap(), + url("https://github.com/watchexec/cargo-watch/releases/download/v9.0.0/cargo-watch-v9.0.0-aarch64-apple-darwin.tar.xz") + ); + } + + #[test] + fn no_archive() { + let mut meta = PkgMeta::default(); + meta.pkg_url = "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }{ binary-ext }".to_string(); + meta.pkg_fmt = PkgFmt::Bin; + let data = Data { + name: "cargo-watch".to_string(), + target: "aarch64-pc-windows-msvc".to_string(), + version: "9.0.0".to_string(), + repo: Some("https://github.com/watchexec/cargo-watch".to_string()), + meta, + }; + + let ctx = Context::from_data(&data); + assert_eq!( + ctx.render_url(&data.meta.pkg_url).unwrap(), + url("https://github.com/watchexec/cargo-watch/releases/download/v9.0.0/cargo-watch-v9.0.0-aarch64-pc-windows-msvc.exe") + ); + } +} diff --git a/src/lib.rs b/src/lib.rs index cf32973b..9fb67710 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,10 +17,10 @@ pub const TARGET: &'static str = env!("TARGET"); /// Default package path template (may be overridden in package Cargo.toml) pub const DEFAULT_PKG_URL: &'static str = - "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ format }"; + "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }"; /// Default binary name template (may be overridden in package Cargo.toml) -pub const DEFAULT_BIN_PATH: &'static str = "{ name }-{ target }-v{ version }/{ bin }{ format }"; +pub const DEFAULT_BIN_DIR: &'static str = "{ name }-{ target }-v{ version }/{ bin }{ binary-ext }"; /// Binary format enumeration #[derive( @@ -83,7 +83,7 @@ impl Default for PkgMeta { Self { pkg_url: DEFAULT_PKG_URL.to_string(), pkg_fmt: PkgFmt::default(), - bin_dir: DEFAULT_BIN_PATH.to_string(), + bin_dir: DEFAULT_BIN_DIR.to_string(), pub_key: None, overrides: HashMap::new(), } @@ -165,7 +165,7 @@ mod test { assert_eq!( &meta.pkg_url, - "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ format }" + "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }" ); assert_eq!( From 5ef8abda3a5cb262dfe35bfd3240724e20c55bb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 16 Feb 2022 16:29:18 +1300 Subject: [PATCH 0015/2020] Actually implement --dry-run --- src/main.rs | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9aed9e0c..dbc482b5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -157,7 +157,7 @@ async fn main() -> Result<(), anyhow::Error> { "The package will be downloaded from third-party source {}", fetcher.source_name() ); - if !opts.no_confirm && !confirm()? { + if !opts.no_confirm && !opts.dry_run && !confirm()? { warn!("Installation cancelled"); return Ok(()); } @@ -169,7 +169,11 @@ async fn main() -> Result<(), anyhow::Error> { } // Download package - fetcher.fetch(&pkg_path).await?; + if opts.dry_run { + info!("Dry run, not downloading package"); + } else { + fetcher.fetch(&pkg_path).await?; + } #[cfg(incomplete)] { @@ -195,20 +199,24 @@ async fn main() -> Result<(), anyhow::Error> { } } - // Extract files let bin_path = temp_dir.path().join(format!("bin-{}", opts.name)); - extract(&pkg_path, fetcher.pkg_fmt(), &bin_path)?; + debug!("Using temporary binary path: {}", bin_path.display()); - // Bypass cleanup if disabled - if opts.no_cleanup { - let _ = temp_dir.into_path(); - } + if !opts.dry_run { + // Extract files + extract(&pkg_path, fetcher.pkg_fmt(), &bin_path)?; - if binaries.len() == 0 { - error!("No binaries specified (or inferred from file system)"); - return Err(anyhow::anyhow!( - "No binaries specified (or inferred from file system)" - )); + // Bypass cleanup if disabled + if opts.no_cleanup { + let _ = temp_dir.into_path(); + } + + if binaries.is_empty() { + error!("No binaries specified (or inferred from file system)"); + return Err(anyhow::anyhow!( + "No binaries specified (or inferred from file system)" + )); + } } // List files to be installed @@ -241,6 +249,11 @@ async fn main() -> Result<(), anyhow::Error> { } } + if opts.dry_run { + info!("Dry run, not proceeding"); + return Ok(()); + } + if !opts.no_confirm && !confirm()? { warn!("Installation cancelled"); return Ok(()); From 232a4c06a9fe2fc1b84bf0f8ae19ab571df217ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 16 Feb 2022 21:46:48 +1300 Subject: [PATCH 0016/2020] (cargo-release) version 0.6.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d98280ca..c11f78cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -122,7 +122,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.5.0" +version = "0.6.0" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index af946957..4132de55 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/ryankurte/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.5.0" +version = "0.6.0" authors = ["ryan "] edition = "2018" license = "GPL-3.0" From 7a1d8b42dd635f29578a99a496fd9bb34f736db2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 16 Feb 2022 22:06:03 +1300 Subject: [PATCH 0017/2020] Revert Cargo.toml to {format} to allow self-upgrade --- Cargo.toml | 4 ++-- src/lib.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4132de55..5e40e85b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,8 +10,8 @@ license = "GPL-3.0" [package.metadata.binstall] -pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }" -bin-dir = "{ bin }{ binary-ext }" +pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ format }" +bin-dir = "{ bin }{ format }" [package.metadata.binstall.overrides.x86_64-pc-windows-msvc] pkg-fmt = "zip" diff --git a/src/lib.rs b/src/lib.rs index 9fb67710..a5389054 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -165,7 +165,7 @@ mod test { assert_eq!( &meta.pkg_url, - "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }" + "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ format }" ); assert_eq!( From 49f3489398d56336692919a1ebc24a8b15a9002f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 16 Feb 2022 22:11:55 +1300 Subject: [PATCH 0018/2020] (cargo-release) version 0.6.1 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c11f78cf..cd125f33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -122,7 +122,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.6.0" +version = "0.6.1" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 5e40e85b..a07a0f83 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/ryankurte/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.6.0" +version = "0.6.1" authors = ["ryan "] edition = "2018" license = "GPL-3.0" From b5d6d68d6d528848d35a27ffede50025108af70e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 16 Feb 2022 22:42:37 +1300 Subject: [PATCH 0019/2020] Fix quickinstall failing when packages are not wrapped in a folder --- src/bins.rs | 13 +++++++++++++ src/fetchers/quickinstall.rs | 3 ++- src/helpers.rs | 4 +++- src/main.rs | 5 +++++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/src/bins.rs b/src/bins.rs index e91d09bb..c5ded440 100644 --- a/src/bins.rs +++ b/src/bins.rs @@ -1,6 +1,7 @@ use std::path::PathBuf; use cargo_toml::Product; +use log::debug; use serde::Serialize; use crate::{PkgFmt, PkgMeta, Template}; @@ -76,11 +77,17 @@ impl BinFile { pub fn install_bin(&self) -> Result<(), anyhow::Error> { // TODO: check if file already exists + debug!( + "Copy file from '{}' to '{}'", + self.source.display(), + self.dest.display() + ); std::fs::copy(&self.source, &self.dest)?; #[cfg(target_family = "unix")] { use std::os::unix::fs::PermissionsExt; + debug!("Set permissions 755 on '{}'", self.dest.display()); std::fs::set_permissions(&self.dest, std::fs::Permissions::from_mode(0o755))?; } @@ -91,9 +98,15 @@ impl BinFile { // Remove existing symlink // TODO: check if existing symlink is correct if self.link.exists() { + debug!("Remove link '{}'", self.link.display()); std::fs::remove_file(&self.link)?; } + debug!( + "Create link '{}' pointing to '{}'", + self.link.display(), + self.dest.display() + ); #[cfg(target_family = "unix")] std::os::unix::fs::symlink(&self.dest, &self.link)?; #[cfg(target_family = "windows")] diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index cbea5f9d..ab26424f 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -35,7 +35,7 @@ impl super::Fetcher for QuickInstall { async fn fetch(&self, dst: &Path) -> Result<(), anyhow::Error> { let url = self.package_url(); info!("Downloading package from: '{url}'"); - download(&url, dst).await + download(&url, &dst).await } fn pkg_fmt(&self) -> PkgFmt { @@ -45,6 +45,7 @@ impl super::Fetcher for QuickInstall { fn source_name(&self) -> String { String::from("QuickInstall") } + fn is_third_party(&self) -> bool { true } diff --git a/src/helpers.rs b/src/helpers.rs index a94437a6..3b6c7505 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -45,8 +45,10 @@ pub async fn download>(url: &str, path: P) -> Result<(), anyhow:: let bytes = resp.bytes().await?; - debug!("Download OK, writing to file: '{:?}'", path.as_ref()); + let path = path.as_ref(); + debug!("Download OK, writing to file: '{}'", path.display()); + std::fs::create_dir_all(path.parent().unwrap())?; std::fs::write(&path, bytes)?; Ok(()) diff --git a/src/main.rs b/src/main.rs index dbc482b5..fdbd0bdf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -168,6 +168,11 @@ async fn main() -> Result<(), anyhow::Error> { ); } + if fetcher.source_name() == "QuickInstall" { + // TODO: less of a hack? + meta.bin_dir = "{ bin }{ binary-ext }".to_string(); + } + // Download package if opts.dry_run { info!("Dry run, not downloading package"); From 5506ffb5d0ae3ea5680acc6b17a7de0a7e64cd49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 16 Feb 2022 22:44:10 +1300 Subject: [PATCH 0020/2020] (cargo-release) version 0.6.2 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cd125f33..f03ea259 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -122,7 +122,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.6.1" +version = "0.6.2" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index a07a0f83..b081f017 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/ryankurte/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.6.1" +version = "0.6.2" authors = ["ryan "] edition = "2018" license = "GPL-3.0" From 5b4909f9eb951ed9e103dda6f6f919a458f2e357 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sun, 13 Mar 2022 16:23:12 +0100 Subject: [PATCH 0021/2020] Link to basename instead of absolute path on unix This renders the link (a) more likely to fit in an ext4 inode and more importantly (b) makes the bindir impervious to being moved around --- src/bins.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/bins.rs b/src/bins.rs index c5ded440..beb74587 100644 --- a/src/bins.rs +++ b/src/bins.rs @@ -1,4 +1,6 @@ use std::path::PathBuf; +#[cfg(target_family = "unix")] +use std::path::Path; use cargo_toml::Product; use log::debug; @@ -102,15 +104,19 @@ impl BinFile { std::fs::remove_file(&self.link)?; } + #[cfg(target_family = "unix")] + let dest = &Path::new(self.dest.file_name().unwrap()); + #[cfg(target_family = "windows")] + let dest = &self.dest; debug!( "Create link '{}' pointing to '{}'", self.link.display(), - self.dest.display() + dest.display() ); #[cfg(target_family = "unix")] - std::os::unix::fs::symlink(&self.dest, &self.link)?; + std::os::unix::fs::symlink(dest, &self.link)?; #[cfg(target_family = "windows")] - std::os::windows::fs::symlink_file(&self.dest, &self.link)?; + std::os::windows::fs::symlink_file(dest, &self.link)?; Ok(()) } From f76791b9b93c65cd77fa08975813197ac80026bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Sun, 13 Mar 2022 16:29:15 +0100 Subject: [PATCH 0022/2020] Direct the symlink the right way in symlink info!(), point at actual destination --- src/bins.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/bins.rs b/src/bins.rs index beb74587..ce51dffe 100644 --- a/src/bins.rs +++ b/src/bins.rs @@ -1,6 +1,4 @@ -use std::path::PathBuf; -#[cfg(target_family = "unix")] -use std::path::Path; +use std::path::{PathBuf, Path}; use cargo_toml::Product; use log::debug; @@ -72,8 +70,8 @@ impl BinFile { format!( "{} ({} -> {})", self.base_name, - self.dest.display(), - self.link.display() + self.link.display(), + self.link_dest().display() ) } @@ -104,10 +102,7 @@ impl BinFile { std::fs::remove_file(&self.link)?; } - #[cfg(target_family = "unix")] - let dest = &Path::new(self.dest.file_name().unwrap()); - #[cfg(target_family = "windows")] - let dest = &self.dest; + let dest = self.link_dest(); debug!( "Create link '{}' pointing to '{}'", self.link.display(), @@ -120,6 +115,13 @@ impl BinFile { Ok(()) } + + fn link_dest(&self) -> &Path { + #[cfg(target_family = "unix")] + { Path::new(self.dest.file_name().unwrap()) } + #[cfg(target_family = "windows")] + { &self.dest } + } } /// Data required to get bin paths From 62ec23e6f47e2faddf07f4926a687853dabc580c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Fri, 29 Apr 2022 09:24:19 +1200 Subject: [PATCH 0023/2020] Use the correct link name (#117) On windows, but also use templating to render it correctly everywhere. Fixes #106 Fixes #111 --- src/bins.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bins.rs b/src/bins.rs index ce51dffe..68180e04 100644 --- a/src/bins.rs +++ b/src/bins.rs @@ -46,8 +46,8 @@ impl BinFile { let dest_file_path = ctx.render("{ bin }-v{ version }{ binary-ext }")?; let dest = data.install_path.join(dest_file_path); - // Link at install dir + base name - let link = data.install_path.join(&base_name); + // Link at install dir + base-name{.extension} + let link = data.install_path.join(&ctx.render("{ bin }{ binary-ext }")?); Ok(Self { base_name, From 1757dc53442d67d530180d9e15e7ccd7bc1009ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Fri, 29 Apr 2022 09:24:46 +1200 Subject: [PATCH 0024/2020] Make fetcher creating infallible (#118) Fixes #109 --- src/bins.rs | 10 ++++--- src/fetchers.rs | 14 +++++++--- src/fetchers/gh_crate_meta.rs | 51 ++++++++++++++++++++--------------- src/fetchers/quickinstall.rs | 6 ++--- src/main.rs | 4 +-- 5 files changed, 52 insertions(+), 33 deletions(-) diff --git a/src/bins.rs b/src/bins.rs index 68180e04..d3b6468b 100644 --- a/src/bins.rs +++ b/src/bins.rs @@ -1,4 +1,4 @@ -use std::path::{PathBuf, Path}; +use std::path::{Path, PathBuf}; use cargo_toml::Product; use log::debug; @@ -118,9 +118,13 @@ impl BinFile { fn link_dest(&self) -> &Path { #[cfg(target_family = "unix")] - { Path::new(self.dest.file_name().unwrap()) } + { + Path::new(self.dest.file_name().unwrap()) + } #[cfg(target_family = "windows")] - { &self.dest } + { + &self.dest + } } } diff --git a/src/fetchers.rs b/src/fetchers.rs index eedd920b..e4474f12 100644 --- a/src/fetchers.rs +++ b/src/fetchers.rs @@ -1,6 +1,7 @@ use std::path::Path; pub use gh_crate_meta::*; +pub use log::debug; pub use quickinstall::*; use crate::{PkgFmt, PkgMeta}; @@ -11,7 +12,7 @@ mod quickinstall; #[async_trait::async_trait] pub trait Fetcher { /// Create a new fetcher from some data - async fn new(data: &Data) -> Result, anyhow::Error> + async fn new(data: &Data) -> Box where Self: Sized; @@ -32,7 +33,7 @@ pub trait Fetcher { } /// Data required to fetch a package -#[derive(Debug)] +#[derive(Clone, Debug)] pub struct Data { pub name: String, pub target: String, @@ -53,7 +54,14 @@ impl MultiFetcher { pub async fn first_available(&self) -> Option<&dyn Fetcher> { for fetcher in &self.fetchers { - if fetcher.check().await.unwrap_or(false) { + if fetcher.check().await.unwrap_or_else(|err| { + debug!( + "Error while checking fetcher {}: {}", + fetcher.source_name(), + err + ); + false + }) { return Some(&**fetcher); } } diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index 83e3da8d..d4e1150b 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -9,44 +9,51 @@ use super::Data; use crate::{download, remote_exists, PkgFmt, Template}; pub struct GhCrateMeta { - url: Url, - pkg_fmt: PkgFmt, + data: Data, +} + +impl GhCrateMeta { + fn url(&self) -> Result { + let ctx = Context::from_data(&self.data); + debug!("Using context: {:?}", ctx); + Ok(ctx.render_url(&self.data.meta.pkg_url)?) + } } #[async_trait::async_trait] impl super::Fetcher for GhCrateMeta { - async fn new(data: &Data) -> Result, anyhow::Error> { - let ctx = Context::from_data(data); - debug!("Using context: {:?}", ctx); - - Ok(Box::new(Self { - url: ctx.render_url(&data.meta.pkg_url)?, - pkg_fmt: data.meta.pkg_fmt, - })) + async fn new(data: &Data) -> Box { + Box::new(Self { data: data.clone() }) } async fn check(&self) -> Result { - info!("Checking for package at: '{}'", self.url); - remote_exists(self.url.as_str(), Method::HEAD).await + let url = self.url()?; + info!("Checking for package at: '{url}'"); + remote_exists(url.as_str(), Method::HEAD).await } async fn fetch(&self, dst: &Path) -> Result<(), anyhow::Error> { - info!("Downloading package from: '{}'", self.url); - download(self.url.as_str(), dst).await + let url = self.url()?; + info!("Downloading package from: '{url}'"); + download(url.as_str(), dst).await } fn pkg_fmt(&self) -> PkgFmt { - self.pkg_fmt + self.data.meta.pkg_fmt } fn source_name(&self) -> String { - if let Some(domain) = self.url.domain() { - domain.to_string() - } else if let Some(host) = self.url.host_str() { - host.to_string() - } else { - self.url.to_string() - } + self.url() + .map(|url| { + if let Some(domain) = url.domain() { + domain.to_string() + } else if let Some(host) = url.host_str() { + host.to_string() + } else { + url.to_string() + } + }) + .unwrap_or_else(|_| "invalid url template".to_string()) } fn is_third_party(&self) -> bool { diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index ab26424f..b04a8ec2 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -16,13 +16,13 @@ pub struct QuickInstall { #[async_trait::async_trait] impl super::Fetcher for QuickInstall { - async fn new(data: &Data) -> Result, anyhow::Error> { + async fn new(data: &Data) -> Box { let crate_name = &data.name; let version = &data.version; let target = &data.target; - Ok(Box::new(Self { + Box::new(Self { package: format!("{crate_name}-{version}-{target}"), - })) + }) } async fn check(&self) -> Result { diff --git a/src/main.rs b/src/main.rs index fdbd0bdf..3a2db66b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -143,8 +143,8 @@ async fn main() -> Result<(), anyhow::Error> { // Try github releases, then quickinstall let mut fetchers = MultiFetcher::default(); - fetchers.add(GhCrateMeta::new(&fetcher_data).await?); - fetchers.add(QuickInstall::new(&fetcher_data).await?); + fetchers.add(GhCrateMeta::new(&fetcher_data).await); + fetchers.add(QuickInstall::new(&fetcher_data).await); let fetcher = fetchers.first_available().await.ok_or_else(|| { error!("File does not exist remotely, cannot proceed"); From d68b0a209a9045b1b80dc585f5cd0e670a4b9c8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Fri, 29 Apr 2022 09:33:54 +1200 Subject: [PATCH 0025/2020] Clarify --version usage and add a warning at runtime (#116) Fixes #113 --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- src/main.rs | 18 ++++++++++++++++-- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f03ea259..ad2838b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1186,9 +1186,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.4" +version = "1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" dependencies = [ "aho-corasick", "memchr", @@ -1356,9 +1356,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.5" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0486718e92ec9a68fbed73bb5ef687d71103b142595b406835649bebd33f72c7" +checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" dependencies = [ "serde", ] diff --git a/Cargo.toml b/Cargo.toml index b081f017..a6e21780 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ strum_macros = "0.23.1" strum = "0.23.0" dirs = "4.0.0" crates-index = "0.18.5" -semver = "1.0.5" +semver = "1.0.7" xz2 = "0.1.6" zip = "0.5.13" async-trait = "0.1.52" diff --git a/src/main.rs b/src/main.rs index 3a2db66b..d32a45be 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -use std::path::PathBuf; +use std::{path::PathBuf, str::FromStr}; use log::{debug, error, info, warn, LevelFilter}; use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; @@ -20,7 +20,8 @@ struct Options { #[structopt()] name: String, - /// Filter for package version to install + /// Filter for package version to install, in Cargo.toml format. + /// Use `=1.2.3` to install a specific version. #[structopt(long, default_value = "*")] version: String, @@ -104,6 +105,19 @@ async fn main() -> Result<(), anyhow::Error> { let manifest = load_manifest_path(manifest_path.join("Cargo.toml"))?; let package = manifest.package.unwrap(); + let is_plain_version = semver::Version::from_str(&opts.version).is_ok(); + if is_plain_version && package.version != opts.version { + warn!( + "You specified `--version {o}` but the package resolved that to '{p}', use `={o}` if you want an exact match", + o=opts.version, p=package.version + ); + + if !opts.no_confirm && !opts.dry_run && !confirm()? { + warn!("Installation cancelled"); + return Ok(()); + } + } + let (mut meta, binaries) = ( package .metadata From eeaba76b5f0ea4713caedaa24300bf689188e45b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Fri, 29 Apr 2022 10:15:43 +1200 Subject: [PATCH 0026/2020] Fallback to installing from source (#114) Closes #108 --- Cargo.lock | 607 ++++++++++++++++++++++++++++++++++++++-------------- Cargo.toml | 42 ++-- src/main.rs | 78 ++++++- 3 files changed, 535 insertions(+), 192 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ad2838b0..c5a6af7a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,6 +8,18 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if", + "cipher", + "cpufeatures", + "opaque-debug", +] + [[package]] name = "aho-corasick" version = "0.7.18" @@ -28,15 +40,15 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.53" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94a45b455c14666b85fc40a019e8ab9eb75e3a124e05494f5397122bc9eb06e0" +checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" [[package]] name = "async-trait" -version = "0.1.52" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "061a7acccaa286c011ddc30970520b98fa40e00c9d644633fb26b5fc63a265e3" +checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600" dependencies = [ "proc-macro2", "quote", @@ -66,12 +78,27 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "base64ct" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a32fd6af2b5827bce66c29053ba0e7c42b9dcab01835835058558c10851a46b" + [[package]] name = "bitflags" version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "block-buffer" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +dependencies = [ + "generic-array", +] + [[package]] name = "bumpalo" version = "3.9.1" @@ -161,9 +188,9 @@ dependencies = [ [[package]] name = "cargo_metadata" -version = "0.14.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba2ae6de944143141f6155a473a6b02f66c7c3f9f47316f802f80204ebfe6e12" +checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" dependencies = [ "camino", "cargo-platform", @@ -174,9 +201,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.11.4" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e270ef0cd868745878982f7ce470aa898d0d4bb248af67f0cf66f54617913ef" +checksum = "5809dd3e6444651fd1cdd3dbec71eca438c439a0fcc8081674a14da0afe50185" dependencies = [ "serde", "serde_derive", @@ -185,9 +212,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.72" +version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a9137b95ea06864e018375b72adfb7db6e6f68cfc8df5a04d00288050485ee" +checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" dependencies = [ "jobserver", ] @@ -204,12 +231,18 @@ version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" dependencies = [ - "libc", "num-integer", "num-traits", "serde", - "time", - "winapi", +] + +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array", ] [[package]] @@ -227,6 +260,12 @@ dependencies = [ "vec_map", ] +[[package]] +name = "constant_time_eq" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" + [[package]] name = "core-foundation" version = "0.9.3" @@ -244,10 +283,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] -name = "crates-index" -version = "0.18.5" +name = "cpufeatures" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00c338c128681bf06772e2a188f7937293620478bb7781e453e996266686e806" +checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +dependencies = [ + "libc", +] + +[[package]] +name = "crates-index" +version = "0.18.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0044896374c388ccbf1497dad6384bf6111dbcad9d7069506df7450ce9b62ea3" dependencies = [ "git2", "hex", @@ -291,9 +339,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e54ea8bc3fb1ee042f5aace6e3c6e025d3874866da222930f70ce62aceba0bfa" +checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" dependencies = [ "cfg-if", "crossbeam-utils", @@ -312,10 +360,11 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.7" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c00d6d2ea26e8b151d99093005cb442fb9a37aeaca582a03ec70946f49ab5ed9" +checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" dependencies = [ + "autocfg", "cfg-if", "crossbeam-utils", "lazy_static", @@ -325,14 +374,35 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e5bed1f1c269533fa816a0a5492b3545209a205ca1a54842be180eb63a16a6" +checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" dependencies = [ "cfg-if", "lazy_static", ] +[[package]] +name = "crypto-common" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "digest" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +dependencies = [ + "block-buffer", + "crypto-common", + "subtle", +] + [[package]] name = "dirs" version = "4.0.0" @@ -344,9 +414,9 @@ dependencies = [ [[package]] name = "dirs-sys" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" +checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" dependencies = [ "libc", "redox_users", @@ -361,9 +431,9 @@ checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" [[package]] name = "encoding_rs" -version = "0.8.30" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dc8abb250ffdda33912550faa54c88ec8b998dec0b2c55ab224921ce11df" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" dependencies = [ "cfg-if", ] @@ -392,9 +462,9 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98" +checksum = "c0408e2626025178a6a7f7ffc05a25bc47103229f19c113755de7bf63816290c" dependencies = [ "cfg-if", "libc", @@ -404,9 +474,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f" +checksum = "b39522e96686d38f4bc984b9198e3a0613264abaebaff2c5c918bfa6b6da09af" dependencies = [ "cfg-if", "crc32fast", @@ -541,21 +611,31 @@ dependencies = [ ] [[package]] -name = "getrandom" -version = "0.2.4" +name = "generic-array" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418d37c8b1d42553c93648be529cb70f920d3baf8ef469b74b9638df426e0b4c" +checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.10.2+wasi-snapshot-preview1", ] [[package]] name = "git2" -version = "0.13.25" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29229cc1b24c0e6062f6e742aa3e256492a5323365e5ed3413599f8a5eff7d6" +checksum = "3826a6e0e2215d7a41c2bfc7c9244123969273f3476b939a226aac0ab56e9e3c" dependencies = [ "bitflags", "libc", @@ -568,9 +648,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.11" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9f1f717ddc7b2ba36df7e871fd88db79326551d3d6f1fc406fbfd28b582ff8e" +checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" dependencies = [ "bytes", "fnv", @@ -600,6 +680,12 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "heck" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + [[package]] name = "hermit-abi" version = "0.1.19" @@ -618,6 +704,15 @@ dependencies = [ "serde", ] +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + [[package]] name = "home" version = "0.5.3" @@ -629,9 +724,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f4c6746584866f0feabcc69893c5b51beef3831656a968ed7ae254cdc4fd03" +checksum = "ff8670570af52249509a86f5e3e18a08c60b177071826898fde8997cf5f6bfbb" dependencies = [ "bytes", "fnv", @@ -651,9 +746,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.6.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9100414882e15fb7feccb4897e5f0ff0ff1ca7d1a86a23208ada4d7a18e6c6c4" +checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" [[package]] name = "httpdate" @@ -669,9 +764,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.17" +version = "0.14.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043f0e083e9901b6cc658a77d1eb86f4fc650bbb977a4337dd63192826aa85dd" +checksum = "b26ae0a80afebe130861d90abf98e3814a4f28a4c6ffeb5ab8ebb2be311e0ef2" dependencies = [ "bytes", "futures-channel", @@ -730,9 +825,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" +checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" dependencies = [ "autocfg", "hashbrown", @@ -749,9 +844,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.3.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f2d64f2edebec4ce84ad108148e67e1064789bee435edc5b60ad398714a3a9" +checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" [[package]] name = "itoa" @@ -770,9 +865,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.56" +version = "0.3.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38fc24e30fd564ce974c02bf1d337caddff65be6cc4735a1f7eab22a7440f04" +checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" dependencies = [ "wasm-bindgen", ] @@ -785,15 +880,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.117" +version = "0.2.124" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e74d72e0f9b65b5b4ca49a346af3976df0f9c61d550727f349ecd559f251a26c" +checksum = "21a41fed9d98f27ab1c6d161da622a4fa35e8a54a8adc24bbf3ddd0ef70b0e50" [[package]] name = "libgit2-sys" -version = "0.12.26+1.3.0" +version = "0.13.2+1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e1c899248e606fbfe68dcb31d8b0176ebab833b103824af31bddf4b7457494" +checksum = "3a42de9a51a5c12e00fc0e4ca6bc2ea43582fc6418488e8f615e905d886f258b" dependencies = [ "cc", "libc", @@ -819,9 +914,9 @@ dependencies = [ [[package]] name = "libz-sys" -version = "1.1.3" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de5435b8549c16d423ed0c03dbaafe57cf6c3344744f1242520d59c9d8ecec66" +checksum = "92e7e15d7610cce1d9752e137625f14e61a28cd45929b6e12e47b50fe154ee2e" dependencies = [ "cc", "libc", @@ -831,18 +926,19 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" dependencies = [ + "autocfg", "scopeguard", ] [[package]] name = "log" -version = "0.4.14" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" +checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" dependencies = [ "cfg-if", ] @@ -887,24 +983,24 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "miniz_oxide" -version = "0.4.4" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a92518e98c078586bc6c934028adcca4c92a53d6a958196de835170a01d84e4b" +checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" dependencies = [ "adler", - "autocfg", ] [[package]] name = "mio" -version = "0.7.14" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" +checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" dependencies = [ "libc", "log", "miow", "ntapi", + "wasi 0.11.0+wasi-snapshot-preview1", "winapi", ] @@ -919,9 +1015,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d" +checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" dependencies = [ "lazy_static", "libc", @@ -974,10 +1070,25 @@ dependencies = [ ] [[package]] -name = "once_cell" -version = "1.9.0" +name = "num_threads" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da32515d9f6e6e489d7bc9d84c71b060db7247dc035bbe44eac88cf87486d8d5" +checksum = "aba1801fb138d8e85e11d0fc70baf4fe1cdfffda7c6cd34a854905df588e5ed0" +dependencies = [ + "libc", +] + +[[package]] +name = "once_cell" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "openssl" @@ -1014,27 +1125,48 @@ dependencies = [ [[package]] name = "parking_lot" -version = "0.11.2" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" dependencies = [ - "instant", "lock_api", "parking_lot_core", ] [[package]] name = "parking_lot_core" -version = "0.8.5" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" +checksum = "995f667a6c822200b0433ac218e05582f0e2efa1b922a3fd2fbaadc5f87bab37" dependencies = [ "cfg-if", - "instant", "libc", "redox_syscall", "smallvec", - "winapi", + "windows-sys", +] + +[[package]] +name = "password-hash" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d791538a6dcc1e7cb7fe6f6b58aca40e7f79403c45b2bc274008b5e647af1d8" +dependencies = [ + "base64ct", + "rand_core 0.6.3", + "subtle", +] + +[[package]] +name = "pbkdf2" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271779f35b581956db91a3e55737327a03aa051e90b1c47aeb189508533adfd7" +dependencies = [ + "digest", + "hmac", + "password-hash", + "sha2", ] [[package]] @@ -1045,9 +1177,9 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "pin-project-lite" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" [[package]] name = "pin-utils" @@ -1057,9 +1189,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" +checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" [[package]] name = "proc-macro-error" @@ -1087,18 +1219,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" +checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" dependencies = [ "unicode-xid", ] [[package]] name = "quote" -version = "1.0.15" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" +checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" dependencies = [ "proc-macro2", ] @@ -1132,10 +1264,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" [[package]] -name = "rayon" -version = "1.5.1" +name = "rand_core" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06aca804d41dbc8ba42dfd964f0d01334eceb64314b9ecf7c5fad5188a06d90" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" + +[[package]] +name = "rayon" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd249e82c21598a9a426a4e00dd7adc1d640b22445ec8545feef801d1a74c221" dependencies = [ "autocfg", "crossbeam-deque", @@ -1145,14 +1283,13 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.9.1" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78120e2c850279833f1dd3582f730c4ab53ed95aeaaaa862a2a5c71b1656d8e" +checksum = "9f51245e1e62e1f1629cbfec37b5793bbabcaeb90f30e94d2ba03564687353e4" dependencies = [ "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "lazy_static", "num_cpus", ] @@ -1167,21 +1304,22 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.10" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" +checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" dependencies = [ "bitflags", ] [[package]] name = "redox_users" -version = "0.4.0" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom", "redox_syscall", + "thiserror", ] [[package]] @@ -1212,9 +1350,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.9" +version = "0.11.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f242f1488a539a79bac6dbe7c8609ae43b7914b7736210f239a37cccb32525" +checksum = "46a1f7aa4f35e5e8b4160449f51afc758f0ce6454315a9fa7d0d113e958c41eb" dependencies = [ "base64", "bytes", @@ -1274,9 +1412,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustls" -version = "0.20.3" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b323592e3164322f5b193dc4302e4e36cd8d37158a712d664efae1a5c2791700" +checksum = "4fbfeb8d0ddb84706bc597a5574ab8912817c52a397f819e5b614e2265206921" dependencies = [ "log", "ring", @@ -1286,9 +1424,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" +checksum = "1ee86d63972a7c661d1536fefe8c3c8407321c3df668891286de28abcd087360" dependencies = [ "base64", ] @@ -1406,6 +1544,28 @@ dependencies = [ "serde", ] +[[package]] +name = "sha1" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77f4e7f65455545c2153c1253d25056825e77ee2533f0e41deb65a93a34852f" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha2" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "signal-hook-registry" version = "1.4.0" @@ -1417,20 +1577,20 @@ dependencies = [ [[package]] name = "simplelog" -version = "0.11.2" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1348164456f72ca0116e4538bdaabb0ddb622c7d9f16387c725af3e96d6001c" +checksum = "48dfff04aade74dd495b007c831cd6f4e0cee19c344dd9dc0884c0289b70a786" dependencies = [ - "chrono", "log", "termcolor", + "time", ] [[package]] name = "slab" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" +checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" [[package]] name = "smallvec" @@ -1440,12 +1600,14 @@ checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" [[package]] name = "smartstring" -version = "0.2.9" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31aa6a31c0c2b21327ce875f7e8952322acfcfd0c27569a6e18a647281352c9b" +checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" dependencies = [ + "autocfg", "serde", "static_assertions", + "version_check", ] [[package]] @@ -1493,7 +1655,7 @@ version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" dependencies = [ - "heck", + "heck 0.3.3", "proc-macro-error", "proc-macro2", "quote", @@ -1502,17 +1664,17 @@ dependencies = [ [[package]] name = "strum" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cae14b91c7d11c9a851d3fbc80a963198998c2a64eec840477fa92d8ce9b70bb" +checksum = "e96acfc1b70604b8b2f1ffa4c57e59176c7dbb05d556c71ecd2f5498a1dee7f8" [[package]] name = "strum_macros" -version = "0.23.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb0dc7ee9c15cea6199cde9a127fa16a4c5819af85395457ad72d68edc85a38" +checksum = "6878079b17446e4d3eba6192bb0a2950d5b14f0ed8424b852310e5a94345d0ef" dependencies = [ - "heck", + "heck 0.4.0", "proc-macro2", "quote", "rustversion", @@ -1520,10 +1682,16 @@ dependencies = [ ] [[package]] -name = "syn" -version = "1.0.86" +name = "subtle" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "syn" +version = "1.0.91" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d" dependencies = [ "proc-macro2", "quote", @@ -1567,9 +1735,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" +checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" dependencies = [ "winapi-util", ] @@ -1605,14 +1773,22 @@ dependencies = [ [[package]] name = "time" -version = "0.1.43" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" +checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" dependencies = [ + "itoa", "libc", - "winapi", + "num_threads", + "time-macros", ] +[[package]] +name = "time-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" + [[package]] name = "tinytemplate" version = "1.2.1" @@ -1625,9 +1801,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1c1d5a42b6245520c249549ec267180beaffcc0615401ac8e31853d4b6d8d2" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" dependencies = [ "tinyvec_macros", ] @@ -1640,9 +1816,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.16.1" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c27a64b625de6d309e8c57716ba93021dccf1b3b5c97edd6d3dd2d2135afc0a" +checksum = "0f48b6d60512a392e34dbf7fd456249fd2de3c83669ab642e021903f4015185b" dependencies = [ "bytes", "libc", @@ -1653,6 +1829,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", + "socket2", "tokio-macros", "winapi", ] @@ -1680,9 +1857,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.23.2" +version = "0.23.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27d5f2b839802bd8267fa19b0530f5a08b9c08cd417976be2a65d130fe1c11b" +checksum = "4151fda0cf2798550ad0b34bcfc9b9dcc2a9d2471c895c68f3a8818e54f2389e" dependencies = [ "rustls", "tokio", @@ -1691,23 +1868,23 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.6.9" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e99e1983e5d376cd8eb4b66604d2e99e79f5bd988c3055891dcd8c9e2604cc0" +checksum = "0edfdeb067411dba2044da6d1cb2df793dd35add7888d73c16e3381ded401764" dependencies = [ "bytes", "futures-core", "futures-sink", - "log", "pin-project-lite", "tokio", + "tracing", ] [[package]] name = "toml" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" dependencies = [ "serde", ] @@ -1720,20 +1897,32 @@ checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" [[package]] name = "tracing" -version = "0.1.30" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d8d93354fe2a8e50d5953f5ae2e47a3fc2ef03292e7ea46e3cc38f549525fb9" +checksum = "5d0ecdcb44a79f0fe9844f0c4f33a342cbcbb5117de8001e6ba0dc2351327d09" dependencies = [ "cfg-if", "pin-project-lite", + "tracing-attributes", "tracing-core", ] [[package]] -name = "tracing-core" -version = "0.1.22" +name = "tracing-attributes" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03cfcb51380632a72d3111cb8d3447a8d908e577d31beeac006f836383d29a23" +checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f54c8ca710e81886d498c2fd3331b56c93aa248d49de2222ad2742247c60072f" dependencies = [ "lazy_static", ] @@ -1745,10 +1934,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] -name = "unicode-bidi" -version = "0.3.7" +name = "typenum" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a01404663e3db436ed2746d9fefef640d868edae3cceb81c3b8d5732fda678f" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + +[[package]] +name = "unicode-bidi" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-normalization" @@ -1830,10 +2025,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] -name = "wasm-bindgen" -version = "0.2.79" +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25f1af7423d8588a3d840681122e72e6a24ddbcb3f0ec385cac0d12d24256c06" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.80" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1841,9 +2042,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.79" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b21c0df030f5a177f3cba22e9bc4322695ec43e7257d865302900290bcdedca" +checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" dependencies = [ "bumpalo", "lazy_static", @@ -1856,9 +2057,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.29" +version = "0.4.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eb6ec270a31b1d3c7e266b999739109abce8b6c87e4b31fcfcd788b65267395" +checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" dependencies = [ "cfg-if", "js-sys", @@ -1868,9 +2069,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.79" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f4203d69e40a52ee523b2529a773d5ffc1dc0071801c87b3d270b471b80ed01" +checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1878,9 +2079,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.79" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa8a30d46208db204854cadbb5d4baf5fcf8071ba5bf48190c3e59937962ebc" +checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" dependencies = [ "proc-macro2", "quote", @@ -1891,15 +2092,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.79" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d958d035c4438e28c70e4321a2911302f10135ce78a9c7834c0cab4123d06a2" +checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" [[package]] name = "web-sys" -version = "0.3.56" +version = "0.3.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c060b319f29dd25724f09a2ba1418f142f539b2be99fbf4d2d5a8f7330afb8eb" +checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" dependencies = [ "js-sys", "wasm-bindgen", @@ -1917,9 +2118,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552ceb903e957524388c4d3475725ff2c8b7960922063af6ce53c9a43da07449" +checksum = "44d8de8415c823c8abd270ad483c6feeac771fad964890779f9a8cb24fbbc1bf" dependencies = [ "webpki", ] @@ -1956,10 +2157,53 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] -name = "winreg" -version = "0.7.0" +name = "windows-sys" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" +checksum = "5acdd78cb4ba54c0045ac14f62d8f94a03d10047904ae2a40afa1e99d8f70825" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" + +[[package]] +name = "windows_i686_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" + +[[package]] +name = "windows_i686_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" + +[[package]] +name = "winreg" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" dependencies = [ "winapi", ] @@ -1984,14 +2228,49 @@ dependencies = [ [[package]] name = "zip" -version = "0.5.13" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ab48844d61251bb3835145c521d88aa4031d7139e8485990f60ca911fa0815" +checksum = "bf225bcf73bb52cbb496e70475c7bd7a3f769df699c0020f6c7bd9a96dcf0b8d" dependencies = [ + "aes", "byteorder", "bzip2", + "constant_time_eq", "crc32fast", + "crossbeam-utils", "flate2", - "thiserror", + "hmac", + "pbkdf2", + "sha1", "time", + "zstd", +] + +[[package]] +name = "zstd" +version = "0.10.0+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b1365becbe415f3f0fcd024e2f7b45bacfb5bdd055f0dc113571394114e7bdd" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "4.1.4+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f7cd17c9af1a4d6c24beb1cc54b17e2ef7b593dc92f19e9d9acad8b182bbaee" +dependencies = [ + "libc", + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "1.6.3+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc49afa5c8d634e75761feda8c592051e7eeb4683ba827211eb0d731d3402ea8" +dependencies = [ + "cc", + "libc", ] diff --git a/Cargo.toml b/Cargo.toml index a6e21780..8a23bdfd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,29 +19,29 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -crates_io_api = "0.8.0" -cargo_metadata = "0.14.1" -tinytemplate = "1.2.1" -tokio = { version = "1.16.1", features = [ "full" ] } -log = "0.4.14" -structopt = "0.3.26" -simplelog = "0.11.2" -anyhow = "1.0.53" -reqwest = { version = "0.11.9", features = [ "rustls-tls" ], default-features = false } -tempdir = "0.3.7" -flate2 = "1.0.22" -tar = "0.4.38" -cargo_toml = "0.11.4" -serde = { version = "1.0.136", features = [ "derive" ] } -strum_macros = "0.23.1" -strum = "0.23.0" -dirs = "4.0.0" -crates-index = "0.18.5" -semver = "1.0.7" -xz2 = "0.1.6" -zip = "0.5.13" +anyhow = "1.0.57" async-trait = "0.1.52" +cargo_metadata = "0.14.2" +cargo_toml = "0.11.4" +crates-index = "0.18.7" +crates_io_api = "0.8.0" +dirs = "4.0.0" +flate2 = "1.0.22" +log = "0.4.14" +reqwest = { version = "0.11.10", features = [ "rustls-tls" ], default-features = false } +semver = "1.0.7" +serde = { version = "1.0.136", features = [ "derive" ] } +simplelog = "0.12.0" +structopt = "0.3.26" +strum = "0.24.0" +strum_macros = "0.24.0" +tar = "0.4.38" +tempdir = "0.3.7" +tinytemplate = "1.2.1" +tokio = { version = "1.18.0", features = [ "full" ] } url = "2.2.2" +xz2 = "0.1.6" +zip = "0.6.2" [dev-dependencies] env_logger = "0.9.0" diff --git a/src/main.rs b/src/main.rs index d32a45be..a8233a3f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,11 @@ use std::{path::PathBuf, str::FromStr}; +use cargo_toml::{Package, Product}; use log::{debug, error, info, warn, LevelFilter}; use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; - use structopt::StructOpt; - use tempdir::TempDir; +use tokio::process::Command; use cargo_binstall::{ bins, @@ -121,7 +121,8 @@ async fn main() -> Result<(), anyhow::Error> { let (mut meta, binaries) = ( package .metadata - .map(|m| m.binstall) + .as_ref() + .map(|m| m.binstall.clone()) .flatten() .unwrap_or(PkgMeta::default()), manifest.bin, @@ -160,11 +161,34 @@ async fn main() -> Result<(), anyhow::Error> { fetchers.add(GhCrateMeta::new(&fetcher_data).await); fetchers.add(QuickInstall::new(&fetcher_data).await); - let fetcher = fetchers.first_available().await.ok_or_else(|| { - error!("File does not exist remotely, cannot proceed"); - anyhow::anyhow!("No viable remote package found") - })?; + match fetchers.first_available().await { + Some(fetcher) => { + install_from_package( + binaries, + fetcher, + install_path, + meta, + opts, + package, + pkg_path, + temp_dir, + ) + .await + } + None => install_from_source(opts, package).await, + } +} +async fn install_from_package( + binaries: Vec, + fetcher: &dyn Fetcher, + install_path: PathBuf, + mut meta: PkgMeta, + opts: Options, + package: Package, + pkg_path: PathBuf, + temp_dir: TempDir, +) -> Result<(), anyhow::Error> { // Prompt user for third-party source if fetcher.is_third_party() { warn!( @@ -293,3 +317,43 @@ async fn main() -> Result<(), anyhow::Error> { info!("Installation complete!"); Ok(()) } + +async fn install_from_source(opts: Options, package: Package) -> Result<(), anyhow::Error> { + // Prompt user for source install + warn!("The package will be installed from source (with cargo)",); + if !opts.no_confirm && !opts.dry_run && !confirm()? { + warn!("Installation cancelled"); + return Ok(()); + } + + if opts.dry_run { + info!( + "Dry-run: running `cargo install {} --version {} --target {}`", + package.name, package.version, opts.target + ); + Ok(()) + } else { + debug!( + "Running `cargo install {} --version {} --target {}`", + package.name, package.version, opts.target + ); + let mut child = Command::new("cargo") + .arg("install") + .arg(package.name) + .arg("--version") + .arg(package.version) + .arg("--target") + .arg(opts.target) + .spawn()?; + debug!("Spawned command pid={:?}", child.id()); + + let status = child.wait().await?; + if status.success() { + info!("Cargo finished successfully"); + Ok(()) + } else { + error!("Cargo errored! {:?}", status); + Err(anyhow::anyhow!("Cargo install error")) + } + } +} From dd33a1d66ed66d8eaa9287cdc70689cbd279ea15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Fri, 29 Apr 2022 10:21:09 +1200 Subject: [PATCH 0027/2020] Mention source fallback in readme --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 95a023df..c28d105e 100644 --- a/README.md +++ b/README.md @@ -62,10 +62,10 @@ yes - [ ] Fetch crate / manifest via git (/ github / gitlab) - [x] Use local crate / manifest (`--manifest-path`) - [x] Fetch build from the [quickinstall](https://github.com/alsuren/cargo-quickinstall) repository - - [ ] Unofficial packaging - Package formats - [x] Tgz - [x] Txz + - [ ] Tar.zst - [x] Tar - [x] Zip - [x] Bin @@ -75,6 +75,7 @@ yes - Security - [ ] Package signing - [ ] Package verification +- [x] Fallback to installing from source ## Supporting Binary Installation From 77f51aff84e270c4f76b4d8bdce1573b85b53302 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Fri, 29 Apr 2022 10:23:52 +1200 Subject: [PATCH 0028/2020] (cargo-release) version 0.7.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c5a6af7a..47959f6f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -149,7 +149,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.6.2" +version = "0.7.0" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index 8a23bdfd..281ca28c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/ryankurte/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.6.2" +version = "0.7.0" authors = ["ryan "] edition = "2018" license = "GPL-3.0" From 5f9c673ea52b7c0790c1cdfd003b8a7c9fb9eaa3 Mon Sep 17 00:00:00 2001 From: Christof Weickhardt Date: Fri, 29 Apr 2022 11:10:05 +0000 Subject: [PATCH 0029/2020] fix: ignore crate version if yanked --- src/drivers.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/drivers.rs b/src/drivers.rs index a1f55bd2..d39525d1 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -83,7 +83,13 @@ pub async fn fetch_crate_cratesio( }; // Locate matching version - let version_iter = base_info.versions().iter().map(|v| v.version()); + let version_iter = base_info.versions().iter().filter_map(|v| { + if !v.is_yanked() { + Some(v.version()) + } else { + None + } + }); let version_name = find_version(version_req, version_iter)?; // Build crates.io api client From 42e327477bcc7db203b7040cb5dff07b09e61e25 Mon Sep 17 00:00:00 2001 From: Christof Weickhardt Date: Sat, 30 Apr 2022 09:18:46 +0000 Subject: [PATCH 0030/2020] fix: abort install for specific version if not confirmed --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index a8233a3f..3ec69068 100644 --- a/src/main.rs +++ b/src/main.rs @@ -112,7 +112,7 @@ async fn main() -> Result<(), anyhow::Error> { o=opts.version, p=package.version ); - if !opts.no_confirm && !opts.dry_run && !confirm()? { + if opts.no_confirm || opts.dry_run || !confirm()? { warn!("Installation cancelled"); return Ok(()); } From 62577a72f3af28c427d037f6baafd319e398ebf3 Mon Sep 17 00:00:00 2001 From: Christof Weickhardt Date: Sat, 30 Apr 2022 09:24:32 +0000 Subject: [PATCH 0031/2020] feat: use rustls for crates_io_api --- Cargo.lock | 154 ----------------------------------------------------- Cargo.toml | 2 +- 2 files changed, 1 insertion(+), 155 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 47959f6f..e1fffb57 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -266,22 +266,6 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" -[[package]] -name = "core-foundation" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" - [[package]] name = "cpufeatures" version = "0.2.2" @@ -451,15 +435,6 @@ dependencies = [ "termcolor", ] -[[package]] -name = "fastrand" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" -dependencies = [ - "instant", -] - [[package]] name = "filetime" version = "0.2.16" @@ -490,21 +465,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - [[package]] name = "form_urlencoded" version = "1.0.1" @@ -799,19 +759,6 @@ dependencies = [ "tokio-rustls", ] -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper", - "native-tls", - "tokio", - "tokio-native-tls", -] - [[package]] name = "idna" version = "0.2.3" @@ -833,15 +780,6 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - [[package]] name = "ipnet" version = "2.5.0" @@ -1013,24 +951,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "native-tls" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - [[package]] name = "ntapi" version = "0.3.7" @@ -1090,20 +1010,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" -[[package]] -name = "openssl" -version = "0.10.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7ae222234c30df141154f159066c5093ff73b63204dcda7121eb082fc56a95" -dependencies = [ - "bitflags", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-sys", -] - [[package]] name = "openssl-probe" version = "0.1.5" @@ -1364,13 +1270,11 @@ dependencies = [ "http-body", "hyper", "hyper-rustls", - "hyper-tls", "ipnet", "js-sys", "lazy_static", "log", "mime", - "native-tls", "percent-encoding", "pin-project-lite", "rustls", @@ -1379,7 +1283,6 @@ dependencies = [ "serde_json", "serde_urlencoded", "tokio", - "tokio-native-tls", "tokio-rustls", "url", "wasm-bindgen", @@ -1443,16 +1346,6 @@ version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" -[[package]] -name = "schannel" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" -dependencies = [ - "lazy_static", - "winapi", -] - [[package]] name = "scopeguard" version = "1.1.0" @@ -1469,29 +1362,6 @@ dependencies = [ "untrusted", ] -[[package]] -name = "security-framework" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" -dependencies = [ - "bitflags", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "semver" version = "1.0.7" @@ -1719,20 +1589,6 @@ dependencies = [ "remove_dir_all", ] -[[package]] -name = "tempfile" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" -dependencies = [ - "cfg-if", - "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", -] - [[package]] name = "termcolor" version = "1.1.3" @@ -1845,16 +1701,6 @@ dependencies = [ "syn", ] -[[package]] -name = "tokio-native-tls" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" -dependencies = [ - "native-tls", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.23.3" diff --git a/Cargo.toml b/Cargo.toml index 281ca28c..70bd46b5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ async-trait = "0.1.52" cargo_metadata = "0.14.2" cargo_toml = "0.11.4" crates-index = "0.18.7" -crates_io_api = "0.8.0" +crates_io_api = { version = "0.8.0", default-features = false, features = ["rustls"] } dirs = "4.0.0" flate2 = "1.0.22" log = "0.4.14" From 256e695aa51c7fb8306d56877ccd11880e5d1cec Mon Sep 17 00:00:00 2001 From: Christof Weickhardt Date: Sat, 30 Apr 2022 12:06:37 +0000 Subject: [PATCH 0032/2020] feat: remove crates-index dependency --- Cargo.lock | 217 ------------------------------------------------- Cargo.toml | 1 - src/drivers.rs | 50 ++++++------ 3 files changed, 23 insertions(+), 245 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e1fffb57..9079c750 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -155,7 +155,6 @@ dependencies = [ "async-trait", "cargo_metadata", "cargo_toml", - "crates-index", "crates_io_api", "dirs", "env_logger", @@ -275,26 +274,6 @@ dependencies = [ "libc", ] -[[package]] -name = "crates-index" -version = "0.18.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0044896374c388ccbf1497dad6384bf6111dbcad9d7069506df7450ce9b62ea3" -dependencies = [ - "git2", - "hex", - "home", - "memchr", - "num_cpus", - "rayon", - "rustc-hash", - "semver", - "serde", - "serde_derive", - "serde_json", - "smartstring", -] - [[package]] name = "crates_io_api" version = "0.8.0" @@ -321,41 +300,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-deque" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" -dependencies = [ - "cfg-if", - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" -dependencies = [ - "autocfg", - "cfg-if", - "crossbeam-utils", - "lazy_static", - "memoffset", - "scopeguard", -] - [[package]] name = "crossbeam-utils" version = "0.8.8" @@ -407,12 +351,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - [[package]] name = "encoding_rs" version = "0.8.31" @@ -591,21 +529,6 @@ dependencies = [ "wasi 0.10.2+wasi-snapshot-preview1", ] -[[package]] -name = "git2" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3826a6e0e2215d7a41c2bfc7c9244123969273f3476b939a226aac0ab56e9e3c" -dependencies = [ - "bitflags", - "libc", - "libgit2-sys", - "log", - "openssl-probe", - "openssl-sys", - "url", -] - [[package]] name = "h2" version = "0.3.13" @@ -655,15 +578,6 @@ dependencies = [ "libc", ] -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -dependencies = [ - "serde", -] - [[package]] name = "hmac" version = "0.12.1" @@ -673,15 +587,6 @@ dependencies = [ "digest", ] -[[package]] -name = "home" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654" -dependencies = [ - "winapi", -] - [[package]] name = "http" version = "0.2.7" @@ -822,46 +727,6 @@ version = "0.2.124" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21a41fed9d98f27ab1c6d161da622a4fa35e8a54a8adc24bbf3ddd0ef70b0e50" -[[package]] -name = "libgit2-sys" -version = "0.13.2+1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a42de9a51a5c12e00fc0e4ca6bc2ea43582fc6418488e8f615e905d886f258b" -dependencies = [ - "cc", - "libc", - "libssh2-sys", - "libz-sys", - "openssl-sys", - "pkg-config", -] - -[[package]] -name = "libssh2-sys" -version = "0.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b094a36eb4b8b8c8a7b4b8ae43b2944502be3e59cd87687595cf6b0a71b3f4ca" -dependencies = [ - "cc", - "libc", - "libz-sys", - "openssl-sys", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "libz-sys" -version = "1.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92e7e15d7610cce1d9752e137625f14e61a28cd45929b6e12e47b50fe154ee2e" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "lock_api" version = "0.4.7" @@ -904,15 +769,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - [[package]] name = "mime" version = "0.3.16" @@ -1010,25 +866,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.72" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e46109c383602735fa0a2e48dd2b7c892b048e1bf69e5c3b1d804b7d9c203cb" -dependencies = [ - "autocfg", - "cc", - "libc", - "pkg-config", - "vcpkg", -] - [[package]] name = "parking_lot" version = "0.12.0" @@ -1175,30 +1012,6 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" -[[package]] -name = "rayon" -version = "1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd249e82c21598a9a426a4e00dd7adc1d640b22445ec8545feef801d1a74c221" -dependencies = [ - "autocfg", - "crossbeam-deque", - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f51245e1e62e1f1629cbfec37b5793bbabcaeb90f30e94d2ba03564687353e4" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-utils", - "num_cpus", -] - [[package]] name = "rdrand" version = "0.4.0" @@ -1307,12 +1120,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustls" version = "0.20.4" @@ -1468,18 +1275,6 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" -[[package]] -name = "smartstring" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb72c633efbaa2dd666986505016c32c3044395ceaf881518399d2f4127ee29" -dependencies = [ - "autocfg", - "serde", - "static_assertions", - "version_check", -] - [[package]] name = "socket2" version = "0.4.4" @@ -1496,12 +1291,6 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "strsim" version = "0.8.0" @@ -1836,12 +1625,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "vcpkg" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" - [[package]] name = "vec_map" version = "0.8.2" diff --git a/Cargo.toml b/Cargo.toml index 70bd46b5..fccf0208 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,6 @@ anyhow = "1.0.57" async-trait = "0.1.52" cargo_metadata = "0.14.2" cargo_toml = "0.11.4" -crates-index = "0.18.7" crates_io_api = { version = "0.8.0", default-features = false, features = ["rustls"] } dirs = "4.0.0" flate2 = "1.0.22" diff --git a/src/drivers.rs b/src/drivers.rs index d39525d1..781d17a8 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -10,7 +10,7 @@ use crates_io_api::AsyncClient; use crate::helpers::*; use crate::PkgFmt; -fn find_version<'a, V: Iterator>( +fn find_version<'a, V: Iterator>( requirement: &str, version_iter: V, ) -> Result { @@ -66,31 +66,7 @@ pub async fn fetch_crate_cratesio( temp_dir: &Path, ) -> Result { // Fetch / update index - debug!("Updating crates.io index"); - let mut index = crates_index::Index::new_cargo_default()?; - index.update()?; - - // Lookup crate in index debug!("Looking up crate information"); - let base_info = match index.crate_(name) { - Some(i) => i, - None => { - return Err(anyhow::anyhow!( - "Error fetching information for crate {}", - name - )); - } - }; - - // Locate matching version - let version_iter = base_info.versions().iter().filter_map(|v| { - if !v.is_yanked() { - Some(v.version()) - } else { - None - } - }); - let version_name = find_version(version_req, version_iter)?; // Build crates.io api client let api_client = AsyncClient::new( @@ -102,10 +78,30 @@ pub async fn fetch_crate_cratesio( let crate_info = api_client .get_crate(name.as_ref()) .await - .context("Error fetching crate information")?; + .context("Error fetching crate information"); + + let base_info = match crate_info { + Ok(i) => i, + Err(_) => { + return Err(anyhow::anyhow!( + "Error fetching information for crate {}", + name + )); + } + }; + + // Locate matching version + let version_iter = base_info.versions.iter().filter_map(|v| { + if !v.yanked { + Some(&v.num) + } else { + None + } + }); + let version_name = find_version(version_req, version_iter)?; // Fetch information for the filtered version - let version = match crate_info.versions.iter().find(|v| v.num == version_name) { + let version = match base_info.versions.iter().find(|v| v.num == version_name) { Some(v) => v, None => { return Err(anyhow::anyhow!( From 4e1cb0fdcf7b4c223a4bfb2da134e25ac2fd79c4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 30 May 2022 17:13:57 +1000 Subject: [PATCH 0033/2020] Compile prebuilt binaries using musl target So that it is statically linked and does not depend on any dynamic library and can be run anywhere. Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e9188a6b..baac949a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: include: - - target: x86_64-unknown-linux-gnu + - target: x86_64-unknown-linux-musl os: ubuntu-latest output: cargo-binstall archive: tgz @@ -27,7 +27,7 @@ jobs: os: macos-latest output: cargo-binstall archive: zip - - target: armv7-unknown-linux-gnueabihf + - target: armv7-unknown-linux-musleabihf os: ubuntu-20.04 output: cargo-binstall archive: tgz @@ -48,7 +48,7 @@ jobs: override: true - name: Install openssl (apt armv7) - if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }} + if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} uses: ryankurte/action-apt@v0.3.0 with: arch: armhf @@ -65,15 +65,23 @@ jobs: target - name: Install cross toolchain (armv7) - if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }} - run: sudo apt install gcc-arm-linux-gnueabihf + if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} + run: sudo apt install gcc-arm-linux-musleabihf - name: Enable cross compilation (armv7) - if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }} + if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} run: | echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV echo "LZMA_API_STATIC=1" >> $GITHUB_ENV + - name: Install musl-tools + if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} + run: sudo apt-get install -y musl-tools + + - name: Install musl-tools + if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} + run: sudo apt-get install -y musl-tools + - name: Build release uses: actions-rs/cargo@v1 with: From cba8a05c822163900c0aec93ec2fda62fdb6edbc Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 30 May 2022 17:18:42 +1000 Subject: [PATCH 0034/2020] Fix job "Install cross toolchain (armv7)" Install "gcc-arm-linux-gnueabihf" as "gcc-arm-linux-musleabihf" does not exist. Also use `apt-get` instead of `apt`. Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index baac949a..250798ef 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -66,7 +66,7 @@ jobs: - name: Install cross toolchain (armv7) if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} - run: sudo apt install gcc-arm-linux-musleabihf + run: sudo apt-get install gcc-arm-linux-gnueabihf - name: Enable cross compilation (armv7) if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} From bcc8057705c09ab8ce3da9b54e96fd22ab90f8bb Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 00:35:03 +1000 Subject: [PATCH 0035/2020] Add back `{x86_64, armv7}unknown-linux-gnu{eabihf}` targets Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 250798ef..99cd5039 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -19,7 +19,7 @@ jobs: fail-fast: false matrix: include: - - target: x86_64-unknown-linux-musl + - target: x86_64-unknown-linux-gnu os: ubuntu-latest output: cargo-binstall archive: tgz @@ -27,7 +27,7 @@ jobs: os: macos-latest output: cargo-binstall archive: zip - - target: armv7-unknown-linux-musleabihf + - target: armv7-unknown-linux-gnueabihf os: ubuntu-20.04 output: cargo-binstall archive: tgz @@ -35,6 +35,14 @@ jobs: os: windows-latest output: cargo-binstall.exe archive: zip + - target: x86_64-unknown-linux-musl + os: ubuntu-latest + output: cargo-binstall + archive: tgz + - target: armv7-unknown-linux-musleabihf + os: ubuntu-20.04 + output: cargo-binstall + archive: tgz steps: - uses: actions/checkout@v2 @@ -47,6 +55,13 @@ jobs: target: ${{ matrix.target }} override: true + - name: Install openssl (apt armv7) + if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }} + uses: ryankurte/action-apt@v0.3.0 + with: + arch: armhf + packages: libssl-dev:armhf libssl1.1:armhf zlib1g-dev:armhf zlib1g:armhf libc-dev:armhf + - name: Install openssl (apt armv7) if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} uses: ryankurte/action-apt@v0.3.0 @@ -64,10 +79,20 @@ jobs: ${{ env.HOME }}/.cargo" target + - name: Install cross toolchain (armv7) + if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }} + run: sudo apt-get install gcc-arm-linux-gnueabihf + - name: Install cross toolchain (armv7) if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} run: sudo apt-get install gcc-arm-linux-gnueabihf + - name: Enable cross compilation (armv7) + if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }} + run: | + echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV + echo "LZMA_API_STATIC=1" >> $GITHUB_ENV + - name: Enable cross compilation (armv7) if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} run: | From 74550371901b2913245c2b18b117a8bbc1031cd5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 00:36:36 +1000 Subject: [PATCH 0036/2020] Add `x86_64-unknown-linux-musl` as target to job `test` Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 99cd5039..165be219 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -164,6 +164,10 @@ jobs: os: windows-latest output: cargo-binstall.exe archive: zip + - target: x86_64-unknown-linux-musl + os: ubuntu-latest + output: cargo-binstall + archive: tgz steps: - uses: actions/checkout@v2 From 38849734b211896fda91d3bc5b857739180ce69e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 12:36:22 +1000 Subject: [PATCH 0037/2020] Remove steps to install libssl in job `build` Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 165be219..f4d85ef2 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -54,20 +54,6 @@ jobs: toolchain: nightly target: ${{ matrix.target }} override: true - - - name: Install openssl (apt armv7) - if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }} - uses: ryankurte/action-apt@v0.3.0 - with: - arch: armhf - packages: libssl-dev:armhf libssl1.1:armhf zlib1g-dev:armhf zlib1g:armhf libc-dev:armhf - - - name: Install openssl (apt armv7) - if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} - uses: ryankurte/action-apt@v0.3.0 - with: - arch: armhf - packages: libssl-dev:armhf libssl1.1:armhf zlib1g-dev:armhf zlib1g:armhf libc-dev:armhf - name: Configure caching uses: actions/cache@v2 From 37ddf3c435083bc1afd99af4219fcca40fd3c715 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 12:37:49 +1000 Subject: [PATCH 0038/2020] Merge duplicate steps with different `if` using `||` Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f4d85ef2..59962d71 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -66,31 +66,17 @@ jobs: target - name: Install cross toolchain (armv7) - if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }} - run: sudo apt-get install gcc-arm-linux-gnueabihf - - - name: Install cross toolchain (armv7) - if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} + if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }} || ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} run: sudo apt-get install gcc-arm-linux-gnueabihf - name: Enable cross compilation (armv7) - if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }} - run: | - echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV - echo "LZMA_API_STATIC=1" >> $GITHUB_ENV - - - name: Enable cross compilation (armv7) - if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} + if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }} || ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} run: | echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV echo "LZMA_API_STATIC=1" >> $GITHUB_ENV - name: Install musl-tools - if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} - run: sudo apt-get install -y musl-tools - - - name: Install musl-tools - if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} + if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} || ${{ matrix.target == 'x86_64-unknown-linux-musl' }} run: sudo apt-get install -y musl-tools - name: Build release From 7796f8760a4713013ca5ebca5e863fe5cacc74f6 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 12:40:48 +1000 Subject: [PATCH 0039/2020] Enable `use-cross` for job "Build release for arm musl target" Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 59962d71..674f6e96 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -80,11 +80,20 @@ jobs: run: sudo apt-get install -y musl-tools - name: Build release + if: ${{ matrix.target != 'armv7-unknown-linux-musleabihf' }} uses: actions-rs/cargo@v1 with: command: build args: --target ${{ matrix.target }} --release + - name: Build release for armv7 musl target + if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} + uses: actions-rs/cargo@v1 + with: + command: build + args: --target ${{ matrix.target }} --release + use-cross: true + - name: Copy and rename utility run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} From ec5ab955b32d2b5f24f2c4fe4c2a2017c692d874 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 12:44:18 +1000 Subject: [PATCH 0040/2020] Fix use of `||` in `if` in steps Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 674f6e96..5ea16613 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -66,17 +66,17 @@ jobs: target - name: Install cross toolchain (armv7) - if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }} || ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} + if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' || matrix.target == 'armv7-unknown-linux-musleabihf' }} run: sudo apt-get install gcc-arm-linux-gnueabihf - name: Enable cross compilation (armv7) - if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' }} || ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} + if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' || matrix.target == 'armv7-unknown-linux-musleabihf' }} run: | echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV echo "LZMA_API_STATIC=1" >> $GITHUB_ENV - name: Install musl-tools - if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} || ${{ matrix.target == 'x86_64-unknown-linux-musl' }} + if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' || matrix.target == 'x86_64-unknown-linux-musl' }} run: sudo apt-get install -y musl-tools - name: Build release From d1c6a07a4840b605fabc927a1a3c88f6da311be8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 12:47:02 +1000 Subject: [PATCH 0041/2020] Fix typo in path of step "Configure caching" Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 5ea16613..d5da7aa9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -62,7 +62,7 @@ jobs: with: key: ${{ matrix.os }}-${{ matrix.target }} path: | - ${{ env.HOME }}/.cargo" + ${{ env.HOME }}/.cargo target - name: Install cross toolchain (armv7) From feb03e37d2a9039e3d26bebbc1d3b2c8470274af Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 12:58:35 +1000 Subject: [PATCH 0042/2020] Fix job `test` for `x86_64-unknown-linux-musl` Install corresponding rustup target and musl-tools Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d5da7aa9..79970b88 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -154,6 +154,16 @@ jobs: - uses: actions/checkout@v2 - uses: FranzDiebold/github-env-vars-action@v1.2.1 + - name: Configure toolchain + if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} + uses: actions-rs/toolchain@v1 + with: + target: ${{ matrix.target }} + + - name: Install musl-tools + if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} + run: sudo apt-get install -y musl-tools + - uses: actions/download-artifact@v2 with: name: cargo-binstall-${{ matrix.target }}.${{ matrix.archive }} From 6172bcb126c18dab01e6907d8212cc88ebb07977 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 13:08:13 +1000 Subject: [PATCH 0043/2020] Fix step "Configure toolchain" in job test Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 79970b88..7bbdeec8 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -158,7 +158,9 @@ jobs: if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} uses: actions-rs/toolchain@v1 with: + toolchain: stable target: ${{ matrix.target }} + override: true - name: Install musl-tools if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} From 187ac2d20ebbf646528d6cbbb05012ebadb84e9f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 13:53:03 +1000 Subject: [PATCH 0044/2020] Refactor: Avoid duplicate job for building release Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7bbdeec8..a94ddd50 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -23,26 +23,32 @@ jobs: os: ubuntu-latest output: cargo-binstall archive: tgz + use-cross: false - target: x86_64-apple-darwin os: macos-latest output: cargo-binstall archive: zip + use-cross: false - target: armv7-unknown-linux-gnueabihf os: ubuntu-20.04 output: cargo-binstall archive: tgz + use-cross: false - target: x86_64-pc-windows-msvc os: windows-latest output: cargo-binstall.exe archive: zip + use-cross: false - target: x86_64-unknown-linux-musl os: ubuntu-latest output: cargo-binstall archive: tgz + use-cross: false - target: armv7-unknown-linux-musleabihf os: ubuntu-20.04 output: cargo-binstall archive: tgz + use-cross: true steps: - uses: actions/checkout@v2 @@ -80,19 +86,11 @@ jobs: run: sudo apt-get install -y musl-tools - name: Build release - if: ${{ matrix.target != 'armv7-unknown-linux-musleabihf' }} uses: actions-rs/cargo@v1 with: command: build args: --target ${{ matrix.target }} --release - - - name: Build release for armv7 musl target - if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }} - uses: actions-rs/cargo@v1 - with: - command: build - args: --target ${{ matrix.target }} --release - use-cross: true + use-cross: ${{ matrix.use-cross }} - name: Copy and rename utility run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} From 9c9b8e55b3090b81e9380bfd254b49fe82a3c172 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 14:08:51 +1000 Subject: [PATCH 0045/2020] Use `cross` to for target `armv7-unknown-linux-gnueabihf` in job `build` Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index a94ddd50..32fae3e7 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -33,7 +33,7 @@ jobs: os: ubuntu-20.04 output: cargo-binstall archive: tgz - use-cross: false + use-cross: true - target: x86_64-pc-windows-msvc os: windows-latest output: cargo-binstall.exe @@ -71,18 +71,8 @@ jobs: ${{ env.HOME }}/.cargo target - - name: Install cross toolchain (armv7) - if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' || matrix.target == 'armv7-unknown-linux-musleabihf' }} - run: sudo apt-get install gcc-arm-linux-gnueabihf - - - name: Enable cross compilation (armv7) - if: ${{ matrix.target == 'armv7-unknown-linux-gnueabihf' || matrix.target == 'armv7-unknown-linux-musleabihf' }} - run: | - echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV - echo "LZMA_API_STATIC=1" >> $GITHUB_ENV - - name: Install musl-tools - if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' || matrix.target == 'x86_64-unknown-linux-musl' }} + if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} run: sudo apt-get install -y musl-tools - name: Build release From aabf5c75a2709278148c12340ac07408221c9dbd Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 14:24:08 +1000 Subject: [PATCH 0046/2020] Add target `aarch64` to job `build` Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 32fae3e7..cccb90c5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -49,6 +49,16 @@ jobs: output: cargo-binstall archive: tgz use-cross: true + - target: aarch64-unknown-linux-gnu + os: ubuntu-latest + output: cargo-binstall + archive: tgz + use-cross: true + - target: aarch64-unknown-linux-musl + os: ubuntu-latest + output: cargo-binstall + archive: tgz + use-cross: true steps: - uses: actions/checkout@v2 From 9ed7dc69706c590f95c4c59bbe2feb4f98a013f8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 14:40:45 +1000 Subject: [PATCH 0047/2020] Rm step for installing `musl-tool` in job `test` The job `test` for target `x86_64-unknown-linux-musl` requires `musl-tool` since there is no pre-built binary present for that target and thus `cargo-binstall` automatically fall back to `cargo-build`. Currently, the test for it also failed because `libssl-1.1` is not present. However, since this will be fixed once a new release of `cargo-binstall` is published, this step should not be present. Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index cccb90c5..2cbb0324 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -160,10 +160,6 @@ jobs: target: ${{ matrix.target }} override: true - - name: Install musl-tools - if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} - run: sudo apt-get install -y musl-tools - - uses: actions/download-artifact@v2 with: name: cargo-binstall-${{ matrix.target }}.${{ matrix.archive }} From 832c51f0258aed2c97b88f6a622da6f3c0ac026e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 17:17:04 +1200 Subject: [PATCH 0048/2020] Add apple m1 builds --- .github/workflows/rust.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 2cbb0324..e31acbbf 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -29,6 +29,11 @@ jobs: output: cargo-binstall archive: zip use-cross: false + - target: aarch64-apple-darwin + os: macos-latest + output: cargo-binstall + archive: zip + use-cross: false - target: armv7-unknown-linux-gnueabihf os: ubuntu-20.04 output: cargo-binstall From 3a1d42fd6b065e42cc32c5419e084c0a4975cc9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 17:19:56 +1200 Subject: [PATCH 0049/2020] Default to musl builds on the readme --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c28d105e..7ccd6a1c 100644 --- a/README.md +++ b/README.md @@ -7,14 +7,14 @@ To support `binstall` maintainers must add configuration values to `Cargo.toml` To get started _using_ `cargo-binstall`, first install the binary (either via `cargo install cargo-binstall` or by downloading a pre-compiled [release](https://github.com/ryankurte/cargo-binstall/releases). -linux x86_64: +linux x86\_64: ``` -wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-gnu.tgz +wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz ``` linux armv7: ``` -wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-armv7-unknown-linux-gnueabihf.tgz +wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-armv7-unknown-linux-musleabihf.tgz ``` macos x86_64: From c1fd2398f06c09094296adfeaa5521d8d7c81061 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 17:24:04 +1200 Subject: [PATCH 0050/2020] Add linux arm64 to readme --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 7ccd6a1c..20dc92d7 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,11 @@ linux armv7: wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-armv7-unknown-linux-musleabihf.tgz ``` +linux arm64: +``` +wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-unknown-linux-musleabihf.tgz +``` + macos x86_64: ``` wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-apple-darwin.zip From 22f509fb72826d172e5c624c89371416fd03daaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 17:24:42 +1200 Subject: [PATCH 0051/2020] Add macos arm64 to readme --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 20dc92d7..dcbd14b1 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,11 @@ macos x86_64: wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-apple-darwin.zip ``` +macos M1: +``` +wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-apple-darwin.zip +``` + windows x86_64: ``` wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-pc-windows-msvc.zip From bee95cdb2759bbaa2aa300cbdc827704188e7fa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 17:24:52 +1200 Subject: [PATCH 0052/2020] Fix markdown --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index dcbd14b1..11c58489 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,7 @@ linux arm64: wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-unknown-linux-musleabihf.tgz ``` -macos x86_64: +macos x86\_64: ``` wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-apple-darwin.zip ``` @@ -32,7 +32,7 @@ macos M1: wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-apple-darwin.zip ``` -windows x86_64: +windows x86\_64: ``` wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-pc-windows-msvc.zip ``` From 151998a1ebb55b452d544a300a45baa2055cf631 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 17:25:34 +1200 Subject: [PATCH 0053/2020] Cleanup yaml --- .github/workflows/rust.yml | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e31acbbf..9ff74d56 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -103,7 +103,7 @@ jobs: - name: Create archive (tgz, linux) if: ${{ matrix.os != 'macos-latest' && matrix.os != 'windows-latest' }} run: tar -czvf cargo-binstall-${{ matrix.target }}.tgz ${{ matrix.output }} - + - name: Create archive (zip, windows) if: ${{ matrix.os == 'windows-latest' }} run: tar.exe -a -c -f cargo-binstall-${{ matrix.target }}.zip ${{ matrix.output }} @@ -157,14 +157,6 @@ jobs: - uses: actions/checkout@v2 - uses: FranzDiebold/github-env-vars-action@v1.2.1 - - name: Configure toolchain - if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - target: ${{ matrix.target }} - override: true - - uses: actions/download-artifact@v2 with: name: cargo-binstall-${{ matrix.target }}.${{ matrix.archive }} @@ -176,7 +168,7 @@ jobs: - name: "Extract build artifact (zip, windows)" if: ${{ matrix.os == 'windows-latest' }} run: tar.exe -xvf cargo-binstall-${{ matrix.target }}.zip - + - name: "Extract build artifact (zip, macos)" if: ${{ matrix.os == 'macos-latest' }} run: unzip cargo-binstall-${{ matrix.target }}.zip From e8464aba3d23de8392726607e7f28ab3c153598d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 17:37:34 +1200 Subject: [PATCH 0054/2020] Use tempfile over tempdir Closes #135 --- Cargo.lock | 281 ++++++++++++++++++++++------------------------------ Cargo.toml | 2 +- src/main.rs | 25 +++-- 3 files changed, 137 insertions(+), 171 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9079c750..232f4789 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -140,9 +140,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.0.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f3132262930b0522068049f5870a856ab8affc80c70d08b6ecb785771a6fc23" +checksum = "869119e97797867fd90f5e22af7d0bd274bd4635ebb9eb68c04f3f513ae6c412" dependencies = [ "serde", ] @@ -168,7 +168,7 @@ dependencies = [ "strum", "strum_macros", "tar", - "tempdir", + "tempfile", "tinytemplate", "tokio", "url", @@ -373,6 +373,15 @@ dependencies = [ "termcolor", ] +[[package]] +name = "fastrand" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +dependencies = [ + "instant", +] + [[package]] name = "filetime" version = "0.2.16" @@ -387,13 +396,11 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b39522e96686d38f4bc984b9198e3a0613264abaebaff2c5c918bfa6b6da09af" +checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" dependencies = [ - "cfg-if", "crc32fast", - "libc", "miniz_oxide", ] @@ -413,12 +420,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fuchsia-cprng" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" - [[package]] name = "futures" version = "0.3.21" @@ -600,9 +601,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ff4f84919677303da5f147645dbea6b1881f368d03ac84e1dc09031ebd7b2c6" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ "bytes", "http", @@ -629,9 +630,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.18" +version = "0.14.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b26ae0a80afebe130861d90abf98e3814a4f28a4c6ffeb5ab8ebb2be311e0ef2" +checksum = "42dc3c131584288d375f2d07f822b0cb012d8c6fb899a5b9fdb3cb7eb9b6004f" dependencies = [ "bytes", "futures-channel", @@ -677,14 +678,23 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f647032dfaa1f8b6dc29bd3edb7bbef4861b8b8007ebb118d6db284fd59f6ee" +checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a" dependencies = [ "autocfg", "hashbrown", ] +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + [[package]] name = "ipnet" version = "2.5.0" @@ -693,9 +703,9 @@ checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" [[package]] name = "itoa" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aab8fc367588b89dcee83ab0fd66b72b50b72fa1904d7095045ace2b0c81c35" +checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" [[package]] name = "jobserver" @@ -723,9 +733,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.124" +version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21a41fed9d98f27ab1c6d161da622a4fa35e8a54a8adc24bbf3ddd0ef70b0e50" +checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" [[package]] name = "lock_api" @@ -739,9 +749,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.16" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6389c490849ff5bc16be905ae24bc913a9c8892e19b2341dbc175e14c341c2b8" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" dependencies = [ "cfg-if", ] @@ -765,9 +775,9 @@ checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "memchr" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "mime" @@ -777,50 +787,30 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "miniz_oxide" -version = "0.5.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b29bd4bc3f33391105ebee3589c19197c4271e3e5a9ec9bfe8127eeff8f082" +checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" dependencies = [ "adler", ] [[package]] name = "mio" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" +checksum = "713d550d9b44d89174e066b7a6217ae06234c10cb47819a88290d2b353c31799" dependencies = [ "libc", "log", - "miow", - "ntapi", "wasi 0.11.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi", -] - -[[package]] -name = "ntapi" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" -dependencies = [ - "winapi", + "windows-sys", ] [[package]] name = "num-integer" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ "autocfg", "num-traits", @@ -828,9 +818,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ "autocfg", ] @@ -847,18 +837,18 @@ dependencies = [ [[package]] name = "num_threads" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aba1801fb138d8e85e11d0fc70baf4fe1cdfffda7c6cd34a854905df588e5ed0" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" dependencies = [ "libc", ] [[package]] name = "once_cell" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f3e037eac156d1775da914196f0f37741a274155e34a0b7e427c35d2a2ecb9" +checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" [[package]] name = "opaque-debug" @@ -868,9 +858,9 @@ checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] name = "parking_lot" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f5ec2493a61ac0506c0f4199f99070cbe83857b0337006a30f3e6719b8ef58" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", "parking_lot_core", @@ -878,9 +868,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "995f667a6c822200b0433ac218e05582f0e2efa1b922a3fd2fbaadc5f87bab37" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" dependencies = [ "cfg-if", "libc", @@ -896,7 +886,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d791538a6dcc1e7cb7fe6f6b58aca40e7f79403c45b2bc274008b5e647af1d8" dependencies = [ "base64ct", - "rand_core 0.6.3", + "rand_core", "subtle", ] @@ -962,11 +952,11 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.37" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec757218438d5fda206afc041538b2f6d889286160d649a86a24d37e1235afd1" +checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -978,49 +968,12 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552840b97013b1a26992c11eac34bdd778e464601a4c2054b5f0bff7c6761293" -dependencies = [ - "fuchsia-cprng", - "libc", - "rand_core 0.3.1", - "rdrand", - "winapi", -] - -[[package]] -name = "rand_core" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" -dependencies = [ - "rand_core 0.4.2", -] - -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - [[package]] name = "rand_core" version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "redox_syscall" version = "0.2.13" @@ -1043,9 +996,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.5" +version = "1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a11647b6b25ff05a515cb92c365cec08801e83423a235b51e231e1808747286" +checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" dependencies = [ "aho-corasick", "memchr", @@ -1054,9 +1007,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.6.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" [[package]] name = "remove_dir_all" @@ -1122,9 +1075,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.4" +version = "0.20.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fbfeb8d0ddb84706bc597a5574ab8912817c52a397f819e5b614e2265206921" +checksum = "5aab8ee6c7097ed6057f43c187a62418d0c05a4bd5f18b3571db50ee0f9ce033" dependencies = [ "log", "ring", @@ -1149,9 +1102,9 @@ checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" [[package]] name = "ryu" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73b4b750c782965c211b42f022f59af1fbceabdd026623714f104152f1ec149f" +checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" [[package]] name = "scopeguard" @@ -1171,27 +1124,27 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d65bd28f48be7196d222d95b9243287f48d27aca604e08497513019ff0502cc4" +checksum = "8cb243bdfdb5936c8dc3c45762a19d12ab4550cdc753bc247637d4ec35a040fd" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.136" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" +checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.136" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" +checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" dependencies = [ "proc-macro2", "quote", @@ -1200,9 +1153,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.79" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8d9fa5c3b304765ce1fd9c4c8a3de2c8db365a5b91be52f186efc675681d95" +checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" dependencies = [ "itoa", "ryu", @@ -1348,13 +1301,13 @@ checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" [[package]] name = "syn" -version = "1.0.91" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b683b2b825c8eef438b77c36a06dc262294da3d5a5813fac20da149241dcd44d" +checksum = "fbaf6116ab8924f39d52792136fb74fd60a80194cf1b1c6ffa6453eef1c3f942" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] @@ -1369,13 +1322,17 @@ dependencies = [ ] [[package]] -name = "tempdir" -version = "0.3.7" +name = "tempfile" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f2b5fb00ccdf689e0149d1b1b3c03fead81c2b37735d812fa8bddbbf41b6d8" +checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" dependencies = [ - "rand", + "cfg-if", + "fastrand", + "libc", + "redox_syscall", "remove_dir_all", + "winapi", ] [[package]] @@ -1398,18 +1355,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.30" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" +checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.30" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" +checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" dependencies = [ "proc-macro2", "quote", @@ -1461,9 +1418,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.18.0" +version = "1.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f48b6d60512a392e34dbf7fd456249fd2de3c83669ab642e021903f4015185b" +checksum = "4903bf0427cf68dddd5aa6a93220756f8be0c34fcfa9f5e6191e103e15a31395" dependencies = [ "bytes", "libc", @@ -1492,9 +1449,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.23.3" +version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4151fda0cf2798550ad0b34bcfc9b9dcc2a9d2471c895c68f3a8818e54f2389e" +checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ "rustls", "tokio", @@ -1503,9 +1460,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0edfdeb067411dba2044da6d1cb2df793dd35add7888d73c16e3381ded401764" +checksum = "f988a1a1adc2fb21f9c12aa96441da33a1728193ae0b95d2be22dbd17fcb4e5c" dependencies = [ "bytes", "futures-core", @@ -1580,6 +1537,12 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +[[package]] +name = "unicode-ident" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" + [[package]] name = "unicode-normalization" version = "0.1.19" @@ -1601,12 +1564,6 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" -[[package]] -name = "unicode-xid" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" - [[package]] name = "untrusted" version = "0.7.1" @@ -1787,9 +1744,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5acdd78cb4ba54c0045ac14f62d8f94a03d10047904ae2a40afa1e99d8f70825" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ "windows_aarch64_msvc", "windows_i686_gnu", @@ -1800,33 +1757,33 @@ dependencies = [ [[package]] name = "windows_aarch64_msvc" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cffbe740121affb56fad0fc0e421804adf0ae00891205213b5cecd30db881d" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" [[package]] name = "windows_i686_gnu" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2564fde759adb79129d9b4f54be42b32c89970c18ebf93124ca8870a498688ed" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" [[package]] name = "windows_i686_msvc" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cd9d32ba70453522332c14d38814bceeb747d80b3958676007acadd7e166956" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" [[package]] name = "windows_x86_64_gnu" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfce6deae227ee8d356d19effc141a509cc503dfd1f850622ec4b0f84428e1f4" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" [[package]] name = "windows_x86_64_msvc" -version = "0.34.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19538ccc21819d01deaf88d6a17eae6596a12e9aafdbb97916fb49896d89de9" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "winreg" @@ -1839,9 +1796,9 @@ dependencies = [ [[package]] name = "xattr" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c" +checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" dependencies = [ "libc", ] @@ -1877,18 +1834,18 @@ dependencies = [ [[package]] name = "zstd" -version = "0.10.0+zstd.1.5.2" +version = "0.10.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b1365becbe415f3f0fcd024e2f7b45bacfb5bdd055f0dc113571394114e7bdd" +checksum = "5f4a6bd64f22b5e3e94b4e238669ff9f10815c27a5180108b849d24174a83847" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "4.1.4+zstd.1.5.2" +version = "4.1.6+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7cd17c9af1a4d6c24beb1cc54b17e2ef7b593dc92f19e9d9acad8b182bbaee" +checksum = "94b61c51bb270702d6167b8ce67340d2754b088d0c091b06e593aa772c3ee9bb" dependencies = [ "libc", "zstd-sys", diff --git a/Cargo.toml b/Cargo.toml index fccf0208..4db7ace7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,7 @@ structopt = "0.3.26" strum = "0.24.0" strum_macros = "0.24.0" tar = "0.4.38" -tempdir = "0.3.7" +tempfile = "3.3.0" tinytemplate = "1.2.1" tokio = { version = "1.18.0", features = [ "full" ] } url = "2.2.2" diff --git a/src/main.rs b/src/main.rs index 3ec69068..f35064c0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,7 +4,7 @@ use cargo_toml::{Package, Product}; use log::{debug, error, info, warn, LevelFilter}; use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; use structopt::StructOpt; -use tempdir::TempDir; +use tempfile::TempDir; use tokio::process::Command; use cargo_binstall::{ @@ -89,7 +89,7 @@ async fn main() -> Result<(), anyhow::Error> { .unwrap(); // Create a temporary directory for downloads etc. - let temp_dir = TempDir::new("cargo-binstall")?; + let temp_dir = TempDir::new()?; info!("Installing package: '{}'", opts.name); @@ -175,7 +175,12 @@ async fn main() -> Result<(), anyhow::Error> { ) .await } - None => install_from_source(opts, package).await, + None => { + temp_dir.close().unwrap_or_else(|err| { + warn!("Failed to clean up some resources: {err}"); + }); + install_from_source(opts, package).await + } } } @@ -249,11 +254,6 @@ async fn install_from_package( // Extract files extract(&pkg_path, fetcher.pkg_fmt(), &bin_path)?; - // Bypass cleanup if disabled - if opts.no_cleanup { - let _ = temp_dir.into_path(); - } - if binaries.is_empty() { error!("No binaries specified (or inferred from file system)"); return Err(anyhow::anyhow!( @@ -315,6 +315,15 @@ async fn install_from_package( } info!("Installation complete!"); + + if opts.no_cleanup { + let _ = temp_dir.into_path(); + } else { + temp_dir.close().unwrap_or_else(|err| { + warn!("Failed to clean up some resources: {err}"); + }); + } + Ok(()) } From fbf26634c92d7c09c19e89d2324fc6fee4540cba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 17:37:40 +1200 Subject: [PATCH 0055/2020] Formatting --- src/bins.rs | 4 +++- src/drivers.rs | 12 +++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/bins.rs b/src/bins.rs index d3b6468b..3000df5e 100644 --- a/src/bins.rs +++ b/src/bins.rs @@ -47,7 +47,9 @@ impl BinFile { let dest = data.install_path.join(dest_file_path); // Link at install dir + base-name{.extension} - let link = data.install_path.join(&ctx.render("{ bin }{ binary-ext }")?); + let link = data + .install_path + .join(&ctx.render("{ bin }{ binary-ext }")?); Ok(Self { base_name, diff --git a/src/drivers.rs b/src/drivers.rs index 781d17a8..38568db8 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -91,13 +91,11 @@ pub async fn fetch_crate_cratesio( }; // Locate matching version - let version_iter = base_info.versions.iter().filter_map(|v| { - if !v.yanked { - Some(&v.num) - } else { - None - } - }); + let version_iter = + base_info + .versions + .iter() + .filter_map(|v| if !v.yanked { Some(&v.num) } else { None }); let version_name = find_version(version_req, version_iter)?; // Fetch information for the filtered version From 19d06163246513621373113e603a01a970214ff2 Mon Sep 17 00:00:00 2001 From: Lea Fairbanks Date: Tue, 31 May 2022 17:57:05 +1200 Subject: [PATCH 0056/2020] Add cli overrides --- README.md | 10 ++++++++++ src/main.rs | 20 +++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 11c58489..357651c0 100644 --- a/README.md +++ b/README.md @@ -57,6 +57,16 @@ yes 21:15:30 [INFO] Installation complete! ``` +### Unsupported crates + +To install an unsupported crate, you may specify the Cargo.toml metadata entries for `pkg-url`, `bin-dir`, and `pkg-fmt` at the command line, with values [as documented below](#supporting-binary-installation). + +For example: +``` +$ binstall \ + --pkg-url="{ repo }/releases/download/{ version }/{ name }-{ version }-{ target }.{ format }" \ + --pkg-fmt="txz" crate_name +``` ## Status diff --git a/src/main.rs b/src/main.rs index f35064c0..f0a0c5e6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -60,6 +60,18 @@ struct Options { /// Utility log level #[structopt(long, default_value = "info")] log_level: LevelFilter, + + /// Override Cargo.toml package manifest bin-dir. + #[structopt(long)] + bin_dir: Option, + + /// Override Cargo.toml package manifest pkg-fmt. + #[structopt(long)] + pkg_fmt: Option, + + /// Override Cargo.toml package manifest pkg-url. + #[structopt(long)] + pkg_url: Option, } #[tokio::main] @@ -73,7 +85,12 @@ async fn main() -> Result<(), anyhow::Error> { } // Load options - let opts = Options::from_iter(args.iter()); + let mut opts = Options::from_iter(args.iter()); + let cli_overrides = PkgOverride { + pkg_url: opts.pkg_url.take(), + pkg_fmt: opts.pkg_fmt.take(), + bin_dir: opts.bin_dir.take(), + }; // Setup logging let mut log_config = ConfigBuilder::new(); @@ -133,6 +150,7 @@ async fn main() -> Result<(), anyhow::Error> { meta.merge(&o); } + meta.merge(&cli_overrides); debug!("Found metadata: {:?}", meta); // Compute install directory From 2f9be15c30c641eaa0825b303bb8b4f8fb7a2d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 18:01:29 +1200 Subject: [PATCH 0057/2020] Fix old template specifier in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 357651c0..b72a5d56 100644 --- a/README.md +++ b/README.md @@ -64,7 +64,7 @@ To install an unsupported crate, you may specify the Cargo.toml metadata entries For example: ``` $ binstall \ - --pkg-url="{ repo }/releases/download/{ version }/{ name }-{ version }-{ target }.{ format }" \ + --pkg-url="{ repo }/releases/download/{ version }/{ name }-{ version }-{ target }.{ archive-format }" \ --pkg-fmt="txz" crate_name ``` From 9e35efbd10a49a396b1304bd70386ac77025235e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 16:42:28 +1000 Subject: [PATCH 0058/2020] Add new dep zstd v0.10.0 Signed-off-by: Jiahao XU --- Cargo.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 4db7ace7..6b4d83f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,6 +41,13 @@ tokio = { version = "1.18.0", features = [ "full" ] } url = "2.2.2" xz2 = "0.1.6" zip = "0.6.2" +# zstd is also depended by zip. +# Since zip 0.6.2 depends on zstd 0.10.0, we also have to use 0.10.0 here, +# otherwise there will be a link conflict. +# +# Enable feature bindgen to generate C bindings. +# Enable feature zstdmt to enable multithreading in libzstd. +zstd = { version = "0.10.0", features = [ "bindgen", "zstdmt" ], default-features = false } [dev-dependencies] env_logger = "0.9.0" From f555c75e23d03bc0d38564b18f8ab8e2e2e0929c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 16:50:36 +1000 Subject: [PATCH 0059/2020] Update Cargo.lock Signed-off-by: Jiahao XU --- Cargo.lock | 118 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 232f4789..389cf211 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -84,6 +84,29 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a32fd6af2b5827bce66c29053ba0e7c42b9dcab01835835058558c10851a46b" +[[package]] +name = "bindgen" +version = "0.59.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "clap", + "env_logger", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "which", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -174,6 +197,7 @@ dependencies = [ "url", "xz2", "zip", + "zstd", ] [[package]] @@ -218,6 +242,15 @@ dependencies = [ "jobserver", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -244,6 +277,17 @@ dependencies = [ "generic-array", ] +[[package]] +name = "clang-sys" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a050e2153c5be08febd6734e29298e844fdb0fa21aeddd63b4eb7baa106c69b" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "clap" version = "2.34.0" @@ -351,6 +395,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "either" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" + [[package]] name = "encoding_rs" version = "0.8.31" @@ -530,6 +580,12 @@ dependencies = [ "wasi 0.10.2+wasi-snapshot-preview1", ] +[[package]] +name = "glob" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" + [[package]] name = "h2" version = "0.3.13" @@ -731,12 +787,28 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + [[package]] name = "libc" version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +[[package]] +name = "libloading" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" +dependencies = [ + "cfg-if", + "winapi", +] + [[package]] name = "lock_api" version = "0.4.7" @@ -785,6 +857,12 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.5.3" @@ -806,6 +884,16 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "nom" +version = "7.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "num-integer" version = "0.1.45" @@ -902,6 +990,12 @@ dependencies = [ "sha2", ] +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + [[package]] name = "percent-encoding" version = "2.1.0" @@ -1073,6 +1167,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustls" version = "0.20.6" @@ -1196,6 +1296,12 @@ dependencies = [ "digest", ] +[[package]] +name = "shlex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" + [[package]] name = "signal-hook-registry" version = "1.4.0" @@ -1711,6 +1817,17 @@ dependencies = [ "webpki", ] +[[package]] +name = "which" +version = "4.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" +dependencies = [ + "either", + "lazy_static", + "libc", +] + [[package]] name = "winapi" version = "0.3.9" @@ -1857,6 +1974,7 @@ version = "1.6.3+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc49afa5c8d634e75761feda8c592051e7eeb4683ba827211eb0d731d3402ea8" dependencies = [ + "bindgen", "cc", "libc", ] From 5b6634def6d53f2f439cefcb9bd0005fc474ba32 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 16:50:55 +1000 Subject: [PATCH 0060/2020] Add new variant `PkgFmt::Tzstd` and update `helpers::extract` Signed-off-by: Jiahao XU --- src/helpers.rs | 20 ++++++++++++++++++++ src/lib.rs | 2 ++ 2 files changed, 22 insertions(+) diff --git a/src/helpers.rs b/src/helpers.rs index 3b6c7505..64647f18 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -9,6 +9,7 @@ use tar::Archive; use tinytemplate::TinyTemplate; use xz2::read::XzDecoder; use zip::read::ZipArchive; +use zstd::stream::Decoder as ZstdDecoder; use crate::Meta; @@ -102,6 +103,25 @@ pub fn extract, P: AsRef>( txz.unpack(path)?; } + PkgFmt::Tzstd => { + // Extract to install dir + debug!( + "Decompressing from tzstd archive '{:?}' to `{:?}`", + source.as_ref(), + path.as_ref() + ); + + let dat = std::fs::File::open(source)?; + + // The error can only come from raw::Decoder::with_dictionary + // as of zstd 0.10.2 and 0.11.2, which is specified + // as &[] by ZstdDecoder::new, thus ZstdDecoder::new + // should not return any error. + let tar = ZstdDecoder::new(dat)?; + let mut txz = Archive::new(tar); + + txz.unpack(path)?; + } PkgFmt::Zip => { // Extract to install dir debug!( diff --git a/src/lib.rs b/src/lib.rs index a5389054..dc7e4569 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -35,6 +35,8 @@ pub enum PkgFmt { Tgz, /// Download format is TAR + XZ Txz, + /// Download format is TAR + Zstd + Tzstd, /// Download format is Zip Zip, /// Download format is raw / binary From a59057b9321ab331c467ea830d1d5070b0e9815e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 16:59:00 +1000 Subject: [PATCH 0061/2020] Update `README.md`: `Tar.zst` is now supported by `cargo-binstall` Signed-off-by: Jiahao XU --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index b72a5d56..57b337df 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ $ binstall \ - Package formats - [x] Tgz - [x] Txz - - [ ] Tar.zst + - [x] Tar.zst - [x] Tar - [x] Zip - [x] Bin From c989ed08232baf413b99ccdcabefbc42e2f97baf Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 17:12:15 +1000 Subject: [PATCH 0062/2020] Optimize release build by enabling lto, setting `codegen-units` to 1 and setting panic behavior to `abort`. On my `aarch64-apple-darwin` with `rustc 1.61.0`, this reduces the size of binary from 7.8M to 4.9M Signed-off-by: Jiahao XU --- Cargo.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 4db7ace7..eb13f15f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,3 +44,8 @@ zip = "0.6.2" [dev-dependencies] env_logger = "0.9.0" + +[profile.release] +lto = true +codegen-units = 1 +panic = "abort" From 62b5ecbe8373a9d75dea00c62746b0cb1305f5d3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 17:18:51 +1000 Subject: [PATCH 0063/2020] Set `RUSTFLAGS` to `-Zstrip=symbols` in job `build` Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9ff74d56..56541de6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -96,6 +96,8 @@ jobs: command: build args: --target ${{ matrix.target }} --release use-cross: ${{ matrix.use-cross }} + env: + RUSTFLAGS: -Zstrip=symbols - name: Copy and rename utility run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} From 3411812ee5a300843bfe0f0de73680b9045d02e9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 17:22:17 +1000 Subject: [PATCH 0064/2020] Revert "Set `RUSTFLAGS` to `-Zstrip=symbols` in job `build`" This reverts commit 62b5ecbe8373a9d75dea00c62746b0cb1305f5d3. --- .github/workflows/rust.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 56541de6..9ff74d56 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -96,8 +96,6 @@ jobs: command: build args: --target ${{ matrix.target }} --release use-cross: ${{ matrix.use-cross }} - env: - RUSTFLAGS: -Zstrip=symbols - name: Copy and rename utility run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} From 8bdd089775409bc1f0bde482e7e7cd87bcf5b650 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 17:23:17 +1000 Subject: [PATCH 0065/2020] Run `strip` as a separate step in job `build` except on windows. Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9ff74d56..1070e785 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -100,6 +100,10 @@ jobs: - name: Copy and rename utility run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} + - name: Strip the executable + if: ${{ matrix.os != 'windows-latest' }} + run: strip ${{ matrix.output }} + - name: Create archive (tgz, linux) if: ${{ matrix.os != 'macos-latest' && matrix.os != 'windows-latest' }} run: tar -czvf cargo-binstall-${{ matrix.target }}.tgz ${{ matrix.output }} From a378be8bc6deb5e6849ed3872d46b4222f378d45 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 17:30:50 +1000 Subject: [PATCH 0066/2020] Revert "Run `strip` as a separate step in job `build`" This reverts commit 8bdd089775409bc1f0bde482e7e7cd87bcf5b650. --- .github/workflows/rust.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1070e785..9ff74d56 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -100,10 +100,6 @@ jobs: - name: Copy and rename utility run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} - - name: Strip the executable - if: ${{ matrix.os != 'windows-latest' }} - run: strip ${{ matrix.output }} - - name: Create archive (tgz, linux) if: ${{ matrix.os != 'macos-latest' && matrix.os != 'windows-latest' }} run: tar -czvf cargo-binstall-${{ matrix.target }}.tgz ${{ matrix.output }} From c3c1c97dd394c788fa8d5acf1325385fc444dbca Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 17:31:59 +1000 Subject: [PATCH 0067/2020] Set `RUSTFLAGS` to `-Cstrip=symbols` in job `build` Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9ff74d56..d80cdd3c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -96,6 +96,8 @@ jobs: command: build args: --target ${{ matrix.target }} --release use-cross: ${{ matrix.use-cross }} + env: + RUSTFLAGS: -Cstrip=symbols - name: Copy and rename utility run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} From 7b3923972904da59dbfc0546f9054a4eb1cd5945 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 17:39:19 +1000 Subject: [PATCH 0068/2020] Revert "Set `RUSTFLAGS` to `-Cstrip=symbols` in job `build`" This reverts commit c3c1c97dd394c788fa8d5acf1325385fc444dbca. --- .github/workflows/rust.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d80cdd3c..9ff74d56 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -96,8 +96,6 @@ jobs: command: build args: --target ${{ matrix.target }} --release use-cross: ${{ matrix.use-cross }} - env: - RUSTFLAGS: -Cstrip=symbols - name: Copy and rename utility run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} From 84d8b9295f327e8f36d23c222d585c851e999ec0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 17:39:33 +1000 Subject: [PATCH 0069/2020] Set `profile.release.strip` to `symbols` in `Cargo.toml` Signed-off-by: Jiahao XU --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index eb13f15f..943d7ce6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,3 +49,4 @@ env_logger = "0.9.0" lto = true codegen-units = 1 panic = "abort" +strip = "symbols" From 69a23e477a945615d05e860f90c912b56b309a0e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 18:19:09 +1000 Subject: [PATCH 0070/2020] Add workaround `libclang.so` not found error when cross bulding Signed-off-by: Jiahao XU --- Cross.toml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 Cross.toml diff --git a/Cross.toml b/Cross.toml new file mode 100644 index 00000000..21e128e9 --- /dev/null +++ b/Cross.toml @@ -0,0 +1,11 @@ +[target.armv7-unknown-linux-gnueabihf] +image = "ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf:edge" + +[target.armv7-unknown-linux-musleabihf] +image = "ghcr.io/cross-rs/armv7-unknown-linux-musleabihf:edge" + +[target.aarch64-unknown-linux-gnu] +image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:edge" + +[target.aarch64-unknown-linux-musl] +image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl:edge" From ba5a81d7923b50da6d79d60290da37f2d2fa4560 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 19:09:26 +1000 Subject: [PATCH 0071/2020] Pin image version in `Cross.toml` Signed-off-by: Jiahao XU --- Cross.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cross.toml b/Cross.toml index 21e128e9..58846039 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,11 +1,11 @@ [target.armv7-unknown-linux-gnueabihf] -image = "ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf:edge" +image = "ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf:sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" [target.armv7-unknown-linux-musleabihf] -image = "ghcr.io/cross-rs/armv7-unknown-linux-musleabihf:edge" +image = "ghcr.io/cross-rs/armv7-unknown-linux-musleabihf:sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" [target.aarch64-unknown-linux-gnu] -image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:edge" +image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" [target.aarch64-unknown-linux-musl] -image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl:edge" +image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl:sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" From ca6469ca666e553555990724aa2526f7d6fe9352 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 19:23:20 +1000 Subject: [PATCH 0072/2020] Fix image ver format in `Cross.toml` Signed-off-by: Jiahao XU --- Cross.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cross.toml b/Cross.toml index 58846039..0587881a 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,11 +1,11 @@ [target.armv7-unknown-linux-gnueabihf] -image = "ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf:sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" +image = "ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf@sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" [target.armv7-unknown-linux-musleabihf] -image = "ghcr.io/cross-rs/armv7-unknown-linux-musleabihf:sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" +image = "ghcr.io/cross-rs/armv7-unknown-linux-musleabihf@sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" [target.aarch64-unknown-linux-gnu] -image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu:sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" +image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu@sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" [target.aarch64-unknown-linux-musl] -image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl:sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" +image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl@sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" From 5f3396a886da70e73186bac4112f7ea0257b908a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 19:25:44 +1000 Subject: [PATCH 0073/2020] Rm image specification for musl targets in `Cross.toml` musl targets work fine, no workaound is required. Signed-off-by: Jiahao XU --- Cross.toml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/Cross.toml b/Cross.toml index 0587881a..e220ab60 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,11 +1,5 @@ [target.armv7-unknown-linux-gnueabihf] image = "ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf@sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" -[target.armv7-unknown-linux-musleabihf] -image = "ghcr.io/cross-rs/armv7-unknown-linux-musleabihf@sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" - [target.aarch64-unknown-linux-gnu] image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu@sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" - -[target.aarch64-unknown-linux-musl] -image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl@sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" From e0f67973ae7f924c1f08331e85e5ae0e72448f6c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 19:31:20 +1000 Subject: [PATCH 0074/2020] Update Cross.toml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Emil Gardström --- Cross.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cross.toml b/Cross.toml index e220ab60..876285aa 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,5 +1,5 @@ [target.armv7-unknown-linux-gnueabihf] -image = "ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf@sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" +image = "ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf@sha256:379eee7aa254912a803b558fe0742450dd32ca9749bc8b931927dafa2ce6e8d3" [target.aarch64-unknown-linux-gnu] image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu@sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" From 66a3e9f416954dc84001a450a60e6e8c5607efa4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 19:32:02 +1000 Subject: [PATCH 0075/2020] Add back workaround for musl targets Signed-off-by: Jiahao XU --- Cross.toml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Cross.toml b/Cross.toml index 876285aa..4bebaaaf 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,5 +1,11 @@ [target.armv7-unknown-linux-gnueabihf] image = "ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf@sha256:379eee7aa254912a803b558fe0742450dd32ca9749bc8b931927dafa2ce6e8d3" +[target.armv7-unknown-linux-musleabihf] +image = "ghcr.io/cross-rs/armv7-unknown-linux-musleabihf@sha256:379eee7aa254912a803b558fe0742450dd32ca9749bc8b931927dafa2ce6e8d3" + [target.aarch64-unknown-linux-gnu] image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu@sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" + +[target.aarch64-unknown-linux-musl] +image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl@sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" From 393e808951553082032b82f77ba9d9268210c91d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 19:36:39 +1000 Subject: [PATCH 0076/2020] Update Cross.toml MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Emil Gardström --- Cross.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cross.toml b/Cross.toml index 4bebaaaf..a384d49c 100644 --- a/Cross.toml +++ b/Cross.toml @@ -2,10 +2,10 @@ image = "ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf@sha256:379eee7aa254912a803b558fe0742450dd32ca9749bc8b931927dafa2ce6e8d3" [target.armv7-unknown-linux-musleabihf] -image = "ghcr.io/cross-rs/armv7-unknown-linux-musleabihf@sha256:379eee7aa254912a803b558fe0742450dd32ca9749bc8b931927dafa2ce6e8d3" +image = "ghcr.io/cross-rs/armv7-unknown-linux-musleabihf@sha256:00088ebbb98f5d9895c2b6e7f713cd3028331185fe82f60d93efc03bdff8ea65" [target.aarch64-unknown-linux-gnu] image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu@sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" [target.aarch64-unknown-linux-musl] -image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl@sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" +image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl@sha256:341256c185132fff9265ee7c8d94ba9b4fde3e8cfa8b39047c0e64ba4c1faf9a" From 5d62f7f61511c16186a70d88d8dab4ea0521fcd9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 20:40:39 +1000 Subject: [PATCH 0077/2020] Rm target aarch64-unknown-linux-gnu & armv7-unknown-linux-gnueabihf Since they are the only two targets that crate `zstd-sys` failed to build. Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9ff74d56..3b26bb66 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -34,11 +34,6 @@ jobs: output: cargo-binstall archive: zip use-cross: false - - target: armv7-unknown-linux-gnueabihf - os: ubuntu-20.04 - output: cargo-binstall - archive: tgz - use-cross: true - target: x86_64-pc-windows-msvc os: windows-latest output: cargo-binstall.exe @@ -54,11 +49,6 @@ jobs: output: cargo-binstall archive: tgz use-cross: true - - target: aarch64-unknown-linux-gnu - os: ubuntu-latest - output: cargo-binstall - archive: tgz - use-cross: true - target: aarch64-unknown-linux-musl os: ubuntu-latest output: cargo-binstall From 91bb84d5a8bab87226be0c832d274d11e67c7fd0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 18:33:19 +1000 Subject: [PATCH 0078/2020] Optimize dep tokio: Disable all feature except rt-multi-thread, macros and process Signed-off-by: Jiahao XU --- Cargo.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index ddbe4f9c..c5d3ac9e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,10 @@ strum_macros = "0.24.0" tar = "0.4.38" tempfile = "3.3.0" tinytemplate = "1.2.1" -tokio = { version = "1.18.0", features = [ "full" ] } + +# This crate uses features rt-multi-thread and macros in `#[tokio::main]` and +# uses feature process to create process. +tokio = { version = "1.18.0", features = [ "rt-multi-thread", "macros", "process" ], default-features = false } url = "2.2.2" xz2 = "0.1.6" zip = "0.6.2" From 355895d8b669e9a183d0ae39ba97ab650b530c8f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 18:37:49 +1000 Subject: [PATCH 0079/2020] Disable all features of `zip` except deflate, bzip2 and zstd Signed-off-by: Jiahao XU --- Cargo.toml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index c5d3ac9e..7cb56f33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,7 +43,13 @@ tinytemplate = "1.2.1" tokio = { version = "1.18.0", features = [ "rt-multi-thread", "macros", "process" ], default-features = false } url = "2.2.2" xz2 = "0.1.6" -zip = "0.6.2" +# Disable all features of zip except for features of compression algorithms: +# Disable features include: +# - aes-crypto: Enables decryption of files which were encrypted with AES, absolutely zero use for +# this crate. +# - time: Enables features using the [time](https://github.com/time-rs/time) crate, +# which is not used by this crate. +zip = { version = "0.6.2", default-features = false, features = [ "deflate", "bzip2", "zstd" ] } # zstd is also depended by zip. # Since zip 0.6.2 depends on zstd 0.10.0, we also have to use 0.10.0 here, # otherwise there will be a link conflict. From 20b2c37ffbdd5bf897da3c6cdd79233173622d2f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 18:45:05 +1000 Subject: [PATCH 0080/2020] Bump dep flate2 to v1.0.24 Signed-off-by: Jiahao XU --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 7cb56f33..72bbf125 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ cargo_metadata = "0.14.2" cargo_toml = "0.11.4" crates_io_api = { version = "0.8.0", default-features = false, features = ["rustls"] } dirs = "4.0.0" -flate2 = "1.0.22" +flate2 = { version = "1.0.24" } log = "0.4.14" reqwest = { version = "0.11.10", features = [ "rustls-tls" ], default-features = false } semver = "1.0.7" From fff4b7225613351a9bbf17c3077d704384c58047 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 18:47:57 +1000 Subject: [PATCH 0081/2020] Enable feature zlib-ng of flate2 so that zlib-ng is used which is the fastest implementation flate2 supports. Signed-off-by: Jiahao XU --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 72bbf125..f2009264 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,7 +25,7 @@ cargo_metadata = "0.14.2" cargo_toml = "0.11.4" crates_io_api = { version = "0.8.0", default-features = false, features = ["rustls"] } dirs = "4.0.0" -flate2 = { version = "1.0.24" } +flate2 = { version = "1.0.24", features = ["zlib-ng"], default-features = false } log = "0.4.14" reqwest = { version = "0.11.10", features = [ "rustls-tls" ], default-features = false } semver = "1.0.7" From 39580cdc51911b1940bbdbe8ea63fb5f57e374a8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 31 May 2022 18:49:15 +1000 Subject: [PATCH 0082/2020] Update `Cargo.lock` Signed-off-by: Jiahao XU --- Cargo.lock | 212 +++-------------------------------------------------- 1 file changed, 10 insertions(+), 202 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 389cf211..feb71914 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,18 +8,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "aes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", - "opaque-debug", -] - [[package]] name = "aho-corasick" version = "0.7.18" @@ -78,12 +66,6 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" -[[package]] -name = "base64ct" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a32fd6af2b5827bce66c29053ba0e7c42b9dcab01835835058558c10851a46b" - [[package]] name = "bindgen" version = "0.59.2" @@ -113,15 +95,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "block-buffer" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" -dependencies = [ - "generic-array", -] - [[package]] name = "bumpalo" version = "3.9.1" @@ -268,15 +241,6 @@ dependencies = [ "serde", ] -[[package]] -name = "cipher" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" -dependencies = [ - "generic-array", -] - [[package]] name = "clang-sys" version = "1.3.3" @@ -304,18 +268,12 @@ dependencies = [ ] [[package]] -name = "constant_time_eq" -version = "0.1.5" +name = "cmake" +version = "0.1.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc" - -[[package]] -name = "cpufeatures" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59a6001667ab124aebae2a495118e11d30984c3a653e99d86d58971708cf5e4b" +checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" dependencies = [ - "libc", + "cc", ] [[package]] @@ -354,27 +312,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "crypto-common" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57952ca27b5e3606ff4dd79b0020231aaf9d6aa76dc05fd30137538c50bd3ce8" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "digest" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" -dependencies = [ - "block-buffer", - "crypto-common", - "subtle", -] - [[package]] name = "dirs" version = "4.0.0" @@ -451,6 +388,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" dependencies = [ "crc32fast", + "libz-ng-sys", "miniz_oxide", ] @@ -559,16 +497,6 @@ dependencies = [ "slab", ] -[[package]] -name = "generic-array" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd48d33ec7f05fbfa152300fdad764757cbded343c1aa1cff2fbaf4134851803" -dependencies = [ - "typenum", - "version_check", -] - [[package]] name = "getrandom" version = "0.2.6" @@ -635,15 +563,6 @@ dependencies = [ "libc", ] -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest", -] - [[package]] name = "http" version = "0.2.7" @@ -810,13 +729,13 @@ dependencies = [ ] [[package]] -name = "lock_api" -version = "0.4.7" +name = "libz-ng-sys" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +checksum = "4399ae96a9966bf581e726de86969f803a81b7ce795fcd5480e640589457e0f2" dependencies = [ - "autocfg", - "scopeguard", + "cmake", + "libc", ] [[package]] @@ -938,58 +857,6 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-sys", -] - -[[package]] -name = "password-hash" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d791538a6dcc1e7cb7fe6f6b58aca40e7f79403c45b2bc274008b5e647af1d8" -dependencies = [ - "base64ct", - "rand_core", - "subtle", -] - -[[package]] -name = "pbkdf2" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271779f35b581956db91a3e55737327a03aa051e90b1c47aeb189508533adfd7" -dependencies = [ - "digest", - "hmac", - "password-hash", - "sha2", -] - [[package]] name = "peeking_take_while" version = "0.1.2" @@ -1062,12 +929,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand_core" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" - [[package]] name = "redox_syscall" version = "0.2.13" @@ -1206,12 +1067,6 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - [[package]] name = "sct" version = "0.7.0" @@ -1274,28 +1129,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha1" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77f4e7f65455545c2153c1253d25056825e77ee2533f0e41deb65a93a34852f" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - -[[package]] -name = "sha2" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55deaec60f81eefe3cce0dc50bda92d6d8e88f2a27df7c5033b42afeb1ed2676" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", -] - [[package]] name = "shlex" version = "1.1.0" @@ -1328,12 +1161,6 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" -[[package]] -name = "smallvec" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" - [[package]] name = "socket2" version = "0.4.4" @@ -1399,12 +1226,6 @@ dependencies = [ "syn", ] -[[package]] -name = "subtle" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" - [[package]] name = "syn" version = "1.0.95" @@ -1534,7 +1355,6 @@ dependencies = [ "mio", "num_cpus", "once_cell", - "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", @@ -1631,12 +1451,6 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" -[[package]] -name = "typenum" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" - [[package]] name = "unicode-bidi" version = "0.3.8" @@ -1935,17 +1749,11 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bf225bcf73bb52cbb496e70475c7bd7a3f769df699c0020f6c7bd9a96dcf0b8d" dependencies = [ - "aes", "byteorder", "bzip2", - "constant_time_eq", "crc32fast", "crossbeam-utils", "flate2", - "hmac", - "pbkdf2", - "sha1", - "time", "zstd", ] From c0eaffb05d96f25a3a7bcde901ef4d2640ab28b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 20:51:32 +1200 Subject: [PATCH 0083/2020] Refactor for rich errors, split user abort and genuine error --- Cargo.lock | 117 +++++++++++++++++++++++++++++++--- Cargo.toml | 3 +- src/bins.rs | 8 +-- src/drivers.rs | 98 ++++++++++++---------------- src/errors.rs | 77 ++++++++++++++++++++++ src/fetchers.rs | 6 +- src/fetchers/gh_crate_meta.rs | 10 +-- src/fetchers/quickinstall.rs | 19 ++++-- src/helpers.rs | 53 +++++++-------- src/lib.rs | 7 +- src/main.rs | 80 +++++++++++++++-------- 11 files changed, 340 insertions(+), 138 deletions(-) create mode 100644 src/errors.rs diff --git a/Cargo.lock b/Cargo.lock index feb71914..c67c8f1d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,12 +26,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "anyhow" -version = "1.0.57" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f9b8508dccb7687a1d6c4ce66b2b0ecef467c94667de27d8d7fe1f8d2a9cdc" - [[package]] name = "async-trait" version = "0.1.53" @@ -147,7 +141,6 @@ dependencies = [ name = "cargo-binstall" version = "0.7.0" dependencies = [ - "anyhow", "async-trait", "cargo_metadata", "cargo_toml", @@ -156,6 +149,7 @@ dependencies = [ "env_logger", "flate2", "log", + "miette", "reqwest", "semver", "serde", @@ -165,6 +159,7 @@ dependencies = [ "strum_macros", "tar", "tempfile", + "thiserror", "tinytemplate", "tokio", "url", @@ -262,7 +257,7 @@ dependencies = [ "atty", "bitflags", "strsim", - "textwrap", + "textwrap 0.11.0", "unicode-width", "vec_map", ] @@ -676,6 +671,12 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" +[[package]] +name = "is_ci" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" + [[package]] name = "itoa" version = "1.0.2" @@ -770,6 +771,36 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +[[package]] +name = "miette" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c90329e44f9208b55f45711f9558cec15d7ef8295cc65ecd6d4188ae8edc58c" +dependencies = [ + "atty", + "miette-derive", + "once_cell", + "owo-colors", + "supports-color", + "supports-hyperlinks", + "supports-unicode", + "terminal_size", + "textwrap 0.15.0", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette-derive" +version = "4.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b5bc45b761bcf1b5e6e6c4128cd93b84c218721a8d9b894aa0aff4ed180174c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "mime" version = "0.3.16" @@ -857,6 +888,12 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" +[[package]] +name = "owo-colors" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "decf7381921fea4dcb2549c5667eda59b3ec297ab7e2b5fc33eac69d2e7da87b" + [[package]] name = "peeking_take_while" version = "0.1.2" @@ -1161,6 +1198,12 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" +[[package]] +name = "smawk" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" + [[package]] name = "socket2" version = "0.4.4" @@ -1226,6 +1269,34 @@ dependencies = [ "syn", ] +[[package]] +name = "supports-color" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4872ced36b91d47bae8a214a683fe54e7078875b399dfa251df346c9b547d1f9" +dependencies = [ + "atty", + "is_ci", +] + +[[package]] +name = "supports-hyperlinks" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "590b34f7c5f01ecc9d78dba4b3f445f31df750a67621cf31626f3b7441ce6406" +dependencies = [ + "atty", +] + +[[package]] +name = "supports-unicode" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8b945e45b417b125a8ec51f1b7df2f8df7920367700d1f98aedd21e5735f8b2" +dependencies = [ + "atty", +] + [[package]] name = "syn" version = "1.0.95" @@ -1271,6 +1342,16 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "terminal_size" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "textwrap" version = "0.11.0" @@ -1280,6 +1361,17 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "textwrap" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" +dependencies = [ + "smawk", + "unicode-linebreak", + "unicode-width", +] + [[package]] name = "thiserror" version = "1.0.31" @@ -1463,6 +1555,15 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" +[[package]] +name = "unicode-linebreak" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a52dcaab0c48d931f7cc8ef826fa51690a08e1ea55117ef26f89864f532383f" +dependencies = [ + "regex", +] + [[package]] name = "unicode-normalization" version = "0.1.19" diff --git a/Cargo.toml b/Cargo.toml index f2009264..60265956 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,6 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -anyhow = "1.0.57" async-trait = "0.1.52" cargo_metadata = "0.14.2" cargo_toml = "0.11.4" @@ -27,6 +26,7 @@ crates_io_api = { version = "0.8.0", default-features = false, features = ["rust dirs = "4.0.0" flate2 = { version = "1.0.24", features = ["zlib-ng"], default-features = false } log = "0.4.14" +miette = { version = "4.7.1", features = ["fancy-no-backtrace"] } reqwest = { version = "0.11.10", features = [ "rustls-tls" ], default-features = false } semver = "1.0.7" serde = { version = "1.0.136", features = [ "derive" ] } @@ -36,6 +36,7 @@ strum = "0.24.0" strum_macros = "0.24.0" tar = "0.4.38" tempfile = "3.3.0" +thiserror = "1.0.31" tinytemplate = "1.2.1" # This crate uses features rt-multi-thread and macros in `#[tokio::main]` and diff --git a/src/bins.rs b/src/bins.rs index 3000df5e..76dfc9fc 100644 --- a/src/bins.rs +++ b/src/bins.rs @@ -4,7 +4,7 @@ use cargo_toml::Product; use log::debug; use serde::Serialize; -use crate::{PkgFmt, PkgMeta, Template}; +use crate::{BinstallError, PkgFmt, PkgMeta, Template}; pub struct BinFile { pub base_name: String, @@ -14,7 +14,7 @@ pub struct BinFile { } impl BinFile { - pub fn from_product(data: &Data, product: &Product) -> Result { + pub fn from_product(data: &Data, product: &Product) -> Result { let base_name = product.name.clone().unwrap(); let binary_ext = if data.target.contains("windows") { @@ -77,7 +77,7 @@ impl BinFile { ) } - pub fn install_bin(&self) -> Result<(), anyhow::Error> { + pub fn install_bin(&self) -> Result<(), BinstallError> { // TODO: check if file already exists debug!( "Copy file from '{}' to '{}'", @@ -96,7 +96,7 @@ impl BinFile { Ok(()) } - pub fn install_link(&self) -> Result<(), anyhow::Error> { + pub fn install_link(&self) -> Result<(), BinstallError> { // Remove existing symlink // TODO: check if existing symlink is correct if self.link.exists() { diff --git a/src/drivers.rs b/src/drivers.rs index 38568db8..7b39bd10 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -1,25 +1,26 @@ +use std::collections::BTreeSet; use std::path::{Path, PathBuf}; use std::time::Duration; -use anyhow::{anyhow, Context}; +use crates_io_api::AsyncClient; use log::debug; use semver::{Version, VersionReq}; -use crates_io_api::AsyncClient; - -use crate::helpers::*; -use crate::PkgFmt; +use crate::{helpers::*, BinstallError, PkgFmt}; fn find_version<'a, V: Iterator>( requirement: &str, version_iter: V, -) -> Result { +) -> Result { // Parse version requirement - let version_req = VersionReq::parse(requirement)?; + let version_req = VersionReq::parse(requirement).map_err(|err| BinstallError::VersionReq { + req: requirement.into(), + err, + })?; // Filter for matching versions - let mut filtered: Vec<_> = version_iter - .filter(|v| { + let filtered: BTreeSet<_> = version_iter + .filter_map(|v| { // Remove leading `v` for git tags let ver_str = match v.strip_prefix("s") { Some(v) => v, @@ -27,36 +28,26 @@ fn find_version<'a, V: Iterator>( }; // Parse out version - let ver = match Version::parse(ver_str) { - Ok(sv) => sv, - Err(_) => return false, - }; - + let ver = Version::parse(ver_str).ok()?; debug!("Version: {:?}", ver); // Filter by version match - version_req.matches(&ver) + if version_req.matches(&ver) { + Some(ver) + } else { + None + } }) .collect(); - // Sort by highest matching version - filtered.sort_by(|a, b| { - let a = Version::parse(a).unwrap(); - let b = Version::parse(b).unwrap(); - - b.partial_cmp(&a).unwrap() - }); - debug!("Filtered: {:?}", filtered); // Return highest version - match filtered.get(0) { - Some(v) => Ok(v.to_string()), - None => Err(anyhow!( - "No matching version for requirement: '{}'", - version_req - )), - } + filtered + .iter() + .max() + .cloned() + .ok_or_else(|| BinstallError::VersionMismatch { req: version_req }) } /// Fetch a crate by name and version from crates.io @@ -64,7 +55,7 @@ pub async fn fetch_crate_cratesio( name: &str, version_req: &str, temp_dir: &Path, -) -> Result { +) -> Result { // Fetch / update index debug!("Looking up crate information"); @@ -72,23 +63,18 @@ pub async fn fetch_crate_cratesio( let api_client = AsyncClient::new( "cargo-binstall (https://github.com/ryankurte/cargo-binstall)", Duration::from_millis(100), - )?; + ) + .expect("bug: invalid user agent"); // Fetch online crate information - let crate_info = api_client - .get_crate(name.as_ref()) - .await - .context("Error fetching crate information"); - - let base_info = match crate_info { - Ok(i) => i, - Err(_) => { - return Err(anyhow::anyhow!( - "Error fetching information for crate {}", - name - )); - } - }; + let base_info = + api_client + .get_crate(name.as_ref()) + .await + .map_err(|err| BinstallError::CratesIoApi { + crate_name: name.into(), + err, + })?; // Locate matching version let version_iter = @@ -99,16 +85,14 @@ pub async fn fetch_crate_cratesio( let version_name = find_version(version_req, version_iter)?; // Fetch information for the filtered version - let version = match base_info.versions.iter().find(|v| v.num == version_name) { - Some(v) => v, - None => { - return Err(anyhow::anyhow!( - "No information found for crate: '{}' version: '{}'", - name, - version_name - )); - } - }; + let version = base_info + .versions + .iter() + .find(|v| v.num == version_name.to_string()) + .ok_or_else(|| BinstallError::VersionUnavailable { + crate_name: name.into(), + v: version_name.clone(), + })?; debug!("Found information for crate version: '{}'", version.num); @@ -136,6 +120,6 @@ pub async fn fetch_crate_gh_releases( _name: &str, _version: Option<&str>, _temp_dir: &Path, -) -> Result { +) -> Result { unimplemented!(); } diff --git a/src/errors.rs b/src/errors.rs new file mode 100644 index 00000000..97705be4 --- /dev/null +++ b/src/errors.rs @@ -0,0 +1,77 @@ +use miette::Diagnostic; +use thiserror::Error; + +#[derive(Error, Diagnostic, Debug)] +pub enum BinstallError { + #[error("installation cancelled by user")] + #[diagnostic(code(binstall::user_abort))] + UserAbort, + + #[error(transparent)] + #[diagnostic(code(binstall::io))] + Io(#[from] std::io::Error), + + #[error(transparent)] + #[diagnostic(code(binstall::url_parse))] + UrlParse(#[from] url::ParseError), + + #[error(transparent)] + #[diagnostic(code(binstall::reqwest))] + Reqwest(#[from] reqwest::Error), + + #[error(transparent)] + #[diagnostic(code(binstall::template))] + Template(#[from] tinytemplate::error::Error), + + #[error(transparent)] + #[diagnostic(code(binstall::unzip))] + Unzip(#[from] zip::result::ZipError), + + #[error(transparent)] + #[diagnostic(code(binstall::cargo_manifest))] + CargoManifest(#[from] cargo_toml::Error), + + #[error("crates.io api error fetching crate information for '{crate_name}': {err}")] + #[diagnostic(code(binstall::crates_io_api))] + CratesIoApi { + crate_name: String, + #[source] + err: crates_io_api::Error, + }, + + #[error("version string '{v}' is not semver: {err}")] + #[diagnostic(code(binstall::version::parse))] + VersionParse { + v: String, + #[source] + err: semver::Error, + }, + + #[error("version requirement '{req}' is not semver: {err}")] + #[diagnostic(code(binstall::version::requirement))] + VersionReq { + req: String, + #[source] + err: semver::Error, + }, + + #[error("no version matching requirement '{req}'")] + #[diagnostic(code(binstall::version::mismatch))] + VersionMismatch { req: semver::VersionReq }, + + #[error("no crate information available for '{crate_name}' version '{v}'")] + #[diagnostic(code(binstall::version::unavailable))] + VersionUnavailable { + crate_name: String, + v: semver::Version, + }, + + #[error("could not {method} {url}: {err}")] + #[diagnostic(code(binstall::http))] + Http { + method: reqwest::Method, + url: url::Url, + #[source] + err: reqwest::Error, + }, +} diff --git a/src/fetchers.rs b/src/fetchers.rs index e4474f12..44fdf57e 100644 --- a/src/fetchers.rs +++ b/src/fetchers.rs @@ -4,7 +4,7 @@ pub use gh_crate_meta::*; pub use log::debug; pub use quickinstall::*; -use crate::{PkgFmt, PkgMeta}; +use crate::{BinstallError, PkgFmt, PkgMeta}; mod gh_crate_meta; mod quickinstall; @@ -17,10 +17,10 @@ pub trait Fetcher { Self: Sized; /// Fetch a package - async fn fetch(&self, dst: &Path) -> Result<(), anyhow::Error>; + async fn fetch(&self, dst: &Path) -> Result<(), BinstallError>; /// Check if a package is available for download - async fn check(&self) -> Result; + async fn check(&self) -> Result; /// Return the package format fn pkg_fmt(&self) -> PkgFmt; diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index d4e1150b..c0f4035a 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -6,14 +6,14 @@ use serde::Serialize; use url::Url; use super::Data; -use crate::{download, remote_exists, PkgFmt, Template}; +use crate::{download, remote_exists, BinstallError, PkgFmt, Template}; pub struct GhCrateMeta { data: Data, } impl GhCrateMeta { - fn url(&self) -> Result { + fn url(&self) -> Result { let ctx = Context::from_data(&self.data); debug!("Using context: {:?}", ctx); Ok(ctx.render_url(&self.data.meta.pkg_url)?) @@ -26,13 +26,13 @@ impl super::Fetcher for GhCrateMeta { Box::new(Self { data: data.clone() }) } - async fn check(&self) -> Result { + async fn check(&self) -> Result { let url = self.url()?; info!("Checking for package at: '{url}'"); remote_exists(url.as_str(), Method::HEAD).await } - async fn fetch(&self, dst: &Path) -> Result<(), anyhow::Error> { + async fn fetch(&self, dst: &Path) -> Result<(), BinstallError> { let url = self.url()?; info!("Downloading package from: '{url}'"); download(url.as_str(), dst).await @@ -101,7 +101,7 @@ impl<'c> Context<'c> { } } - pub(self) fn render_url(&self, template: &str) -> Result { + pub(self) fn render_url(&self, template: &str) -> Result { Ok(Url::parse(&self.render(template)?)?) } } diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index b04a8ec2..61871e5c 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -2,9 +2,10 @@ use std::path::Path; use log::info; use reqwest::Method; +use url::Url; use super::Data; -use crate::{download, remote_exists, PkgFmt}; +use crate::{download, remote_exists, BinstallError, PkgFmt}; const BASE_URL: &str = "https://github.com/alsuren/cargo-quickinstall/releases/download"; const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; @@ -25,14 +26,14 @@ impl super::Fetcher for QuickInstall { }) } - async fn check(&self) -> Result { + async fn check(&self) -> Result { let url = self.package_url(); self.report().await?; info!("Checking for package at: '{url}'"); remote_exists(&url, Method::HEAD).await } - async fn fetch(&self, dst: &Path) -> Result<(), anyhow::Error> { + async fn fetch(&self, dst: &Path) -> Result<(), BinstallError> { let url = self.package_url(); info!("Downloading package from: '{url}'"); download(&url, &dst).await @@ -68,14 +69,20 @@ impl QuickInstall { ) } - pub async fn report(&self) -> Result<(), anyhow::Error> { + pub async fn report(&self) -> Result<(), BinstallError> { info!("Sending installation report to quickinstall (anonymous)"); + let url = Url::parse(&self.stats_url())?; reqwest::Client::builder() .user_agent(USER_AGENT) .build()? - .request(Method::HEAD, &self.stats_url()) + .request(Method::HEAD, url.clone()) .send() - .await?; + .await + .map_err(|err| BinstallError::Http { + method: Method::HEAD, + url, + err, + })?; Ok(()) } } diff --git a/src/helpers.rs b/src/helpers.rs index 64647f18..327f9240 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,24 +1,24 @@ use std::path::{Path, PathBuf}; -use log::{debug, error, info}; +use log::{debug, info}; use cargo_toml::Manifest; use flate2::read::GzDecoder; +use reqwest::Method; use serde::Serialize; use tar::Archive; use tinytemplate::TinyTemplate; +use url::Url; use xz2::read::XzDecoder; use zip::read::ZipArchive; use zstd::stream::Decoder as ZstdDecoder; -use crate::Meta; - -use super::PkgFmt; +use crate::{BinstallError, Meta, PkgFmt}; /// Load binstall metadata from the crate `Cargo.toml` at the provided path pub fn load_manifest_path>( manifest_path: P, -) -> Result, anyhow::Error> { +) -> Result, BinstallError> { debug!("Reading manifest: {}", manifest_path.as_ref().display()); // Load and parse manifest (this checks file system for binary output names) @@ -28,21 +28,24 @@ pub fn load_manifest_path>( Ok(manifest) } -pub async fn remote_exists(url: &str, method: reqwest::Method) -> Result { +pub async fn remote_exists(url: &str, method: reqwest::Method) -> Result { let req = reqwest::Client::new().request(method, url).send().await?; Ok(req.status().is_success()) } /// Download a file from the provided URL to the provided path -pub async fn download>(url: &str, path: P) -> Result<(), anyhow::Error> { +pub async fn download>(url: &str, path: P) -> Result<(), BinstallError> { + let url = Url::parse(url)?; debug!("Downloading from: '{}'", url); - let resp = reqwest::get(url).await?; - - if !resp.status().is_success() { - error!("Download error: {}", resp.status()); - return Err(anyhow::anyhow!(resp.status())); - } + let resp = reqwest::get(url.clone()) + .await + .and_then(|r| r.error_for_status()) + .map_err(|err| BinstallError::Http { + method: Method::GET, + url, + err, + })?; let bytes = resp.bytes().await?; @@ -60,7 +63,7 @@ pub fn extract, P: AsRef>( source: S, fmt: PkgFmt, path: P, -) -> Result<(), anyhow::Error> { +) -> Result<(), BinstallError> { match fmt { PkgFmt::Tar => { // Extract to install dir @@ -188,23 +191,23 @@ pub fn get_install_path>(install_path: Option

) -> Option Result { - info!("Do you wish to continue? yes/no"); +pub fn confirm() -> Result<(), BinstallError> { + loop { + info!("Do you wish to continue? yes/no"); - let mut input = String::new(); - std::io::stdin().read_line(&mut input)?; + let mut input = String::new(); + std::io::stdin().read_line(&mut input).unwrap(); - match input.as_str().trim() { - "yes" => Ok(true), - "no" => Ok(false), - _ => Err(anyhow::anyhow!( - "Valid options are 'yes', 'no', please try again" - )), + match input.as_str().trim() { + "yes" | "y" | "YES" | "Y" => break Ok(()), + "no" | "n" | "NO" | "N" => break Err(BinstallError::UserAbort), + _ => continue, + } } } pub trait Template: Serialize { - fn render(&self, template: &str) -> Result + fn render(&self, template: &str) -> Result where Self: Sized, { diff --git a/src/lib.rs b/src/lib.rs index dc7e4569..06f84c45 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,11 +3,14 @@ use std::collections::HashMap; use serde::{Deserialize, Serialize}; use strum_macros::{Display, EnumString, EnumVariantNames}; +pub mod drivers; +pub use drivers::*; + pub mod helpers; pub use helpers::*; -pub mod drivers; -pub use drivers::*; +mod errors; +pub use errors::BinstallError; pub mod bins; pub mod fetchers; diff --git a/src/main.rs b/src/main.rs index f0a0c5e6..514ef287 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,12 @@ -use std::{path::PathBuf, str::FromStr}; +use std::{path::PathBuf, str::FromStr, time::Instant}; use cargo_toml::{Package, Product}; use log::{debug, error, info, warn, LevelFilter}; +use miette::{miette, IntoDiagnostic, Result, WrapErr}; use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; use structopt::StructOpt; use tempfile::TempDir; -use tokio::process::Command; +use tokio::{process::Command, runtime::Runtime}; use cargo_binstall::{ bins, @@ -74,8 +75,31 @@ struct Options { pkg_url: Option, } -#[tokio::main] -async fn main() -> Result<(), anyhow::Error> { +fn main() -> Result<()> { + let start = Instant::now(); + + let rt = Runtime::new().unwrap(); + let result = rt.block_on(entry()); + drop(rt); + + let done = start.elapsed(); + + if let Err(err) = result { + debug!("run time: {done:?}"); + + if let Some(BinstallError::UserAbort) = err.downcast_ref::() { + warn!("Installation cancelled"); + Ok(()) + } else { + Err(err) + } + } else { + info!("Installation complete! [{done:?}]"); + Ok(()) + } +} + +async fn entry() -> Result<()> { // Filter extraneous arg when invoked by cargo // `cargo run -- --help` gives ["target/debug/cargo-binstall", "--help"] // `cargo binstall --help` gives ["/home/ryan/.cargo/bin/cargo-binstall", "binstall", "--help"] @@ -106,7 +130,9 @@ async fn main() -> Result<(), anyhow::Error> { .unwrap(); // Create a temporary directory for downloads etc. - let temp_dir = TempDir::new()?; + let temp_dir = TempDir::new() + .map_err(BinstallError::from) + .wrap_err("Creating a temporary directory failed.")?; info!("Installing package: '{}'", opts.name); @@ -129,9 +155,8 @@ async fn main() -> Result<(), anyhow::Error> { o=opts.version, p=package.version ); - if opts.no_confirm || opts.dry_run || !confirm()? { - warn!("Installation cancelled"); - return Ok(()); + if !opts.no_confirm && !opts.dry_run { + confirm()?; } } @@ -156,7 +181,7 @@ async fn main() -> Result<(), anyhow::Error> { // Compute install directory let install_path = get_install_path(opts.install_path.as_deref()).ok_or_else(|| { error!("No viable install path found of specified, try `--install-path`"); - anyhow::anyhow!("No install path found or specified") + miette!("No install path found or specified") })?; debug!("Using install path: {}", install_path.display()); @@ -211,16 +236,15 @@ async fn install_from_package( package: Package, pkg_path: PathBuf, temp_dir: TempDir, -) -> Result<(), anyhow::Error> { +) -> Result<()> { // Prompt user for third-party source if fetcher.is_third_party() { warn!( "The package will be downloaded from third-party source {}", fetcher.source_name() ); - if !opts.no_confirm && !opts.dry_run && !confirm()? { - warn!("Installation cancelled"); - return Ok(()); + if !opts.no_confirm && !opts.dry_run { + confirm()?; } } else { info!( @@ -274,7 +298,7 @@ async fn install_from_package( if binaries.is_empty() { error!("No binaries specified (or inferred from file system)"); - return Err(anyhow::anyhow!( + return Err(miette!( "No binaries specified (or inferred from file system)" )); } @@ -295,7 +319,7 @@ async fn install_from_package( let bin_files = binaries .iter() .map(|p| bins::BinFile::from_product(&bin_data, p)) - .collect::, anyhow::Error>>()?; + .collect::, BinstallError>>()?; // Prompt user for confirmation info!("This will install the following binaries:"); @@ -315,9 +339,8 @@ async fn install_from_package( return Ok(()); } - if !opts.no_confirm && !confirm()? { - warn!("Installation cancelled"); - return Ok(()); + if !opts.no_confirm { + confirm()?; } info!("Installing binaries..."); @@ -332,8 +355,6 @@ async fn install_from_package( } } - info!("Installation complete!"); - if opts.no_cleanup { let _ = temp_dir.into_path(); } else { @@ -345,12 +366,11 @@ async fn install_from_package( Ok(()) } -async fn install_from_source(opts: Options, package: Package) -> Result<(), anyhow::Error> { +async fn install_from_source(opts: Options, package: Package) -> Result<()> { // Prompt user for source install warn!("The package will be installed from source (with cargo)",); - if !opts.no_confirm && !opts.dry_run && !confirm()? { - warn!("Installation cancelled"); - return Ok(()); + if !opts.no_confirm && !opts.dry_run { + confirm()?; } if opts.dry_run { @@ -371,16 +391,22 @@ async fn install_from_source(opts: Options, package: Package) -> Result<() .arg(package.version) .arg("--target") .arg(opts.target) - .spawn()?; + .spawn() + .into_diagnostic() + .wrap_err("Spawning cargo install failed.")?; debug!("Spawned command pid={:?}", child.id()); - let status = child.wait().await?; + let status = child + .wait() + .await + .into_diagnostic() + .wrap_err("Running cargo install failed.")?; if status.success() { info!("Cargo finished successfully"); Ok(()) } else { error!("Cargo errored! {:?}", status); - Err(anyhow::anyhow!("Cargo install error")) + Err(miette!("Cargo install error")) } } } From f9e69503b05439eb7557a5ac94db376ac82cfc71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 21:15:52 +1200 Subject: [PATCH 0084/2020] Document the library error types --- src/errors.rs | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/errors.rs b/src/errors.rs index 97705be4..b369a537 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -2,35 +2,54 @@ use miette::Diagnostic; use thiserror::Error; #[derive(Error, Diagnostic, Debug)] +#[diagnostic(url(docsrs))] pub enum BinstallError { + /// The installation was cancelled by a user at a confirmation prompt. #[error("installation cancelled by user")] #[diagnostic(code(binstall::user_abort))] UserAbort, + /// A generic I/O error. #[error(transparent)] #[diagnostic(code(binstall::io))] Io(#[from] std::io::Error), + /// A URL is invalid. + /// + /// This may be the result of a template in a Cargo manifest. #[error(transparent)] #[diagnostic(code(binstall::url_parse))] UrlParse(#[from] url::ParseError), + /// A generic error from our HTTP client, reqwest. + /// + /// Errors resulting from HTTP fetches are handled with [`BinstallError::Http`] instead. #[error(transparent)] #[diagnostic(code(binstall::reqwest))] Reqwest(#[from] reqwest::Error), + /// A rendering error in a template. #[error(transparent)] #[diagnostic(code(binstall::template))] Template(#[from] tinytemplate::error::Error), + /// An error while unzipping a file. #[error(transparent)] #[diagnostic(code(binstall::unzip))] Unzip(#[from] zip::result::ZipError), + /// A parsing or validation error in a cargo manifest. + /// + /// This should be rare, as manifests are generally fetched from crates.io, which does its own + /// validation upstream. The most common failure will therefore be for direct repository access + /// and with the `--manifest-path` option. #[error(transparent)] #[diagnostic(code(binstall::cargo_manifest))] CargoManifest(#[from] cargo_toml::Error), + /// An error interacting with the crates.io API. + /// + /// This could either be a "not found" or a server/transport error. #[error("crates.io api error fetching crate information for '{crate_name}': {err}")] #[diagnostic(code(binstall::crates_io_api))] CratesIoApi { @@ -39,6 +58,10 @@ pub enum BinstallError { err: crates_io_api::Error, }, + /// A version is not valid semver. + /// + /// Note that we use the [`semver`] crate, which parses Cargo version syntax; this may be + /// somewhat stricter or very slightly different from other semver implementations. #[error("version string '{v}' is not semver: {err}")] #[diagnostic(code(binstall::version::parse))] VersionParse { @@ -47,6 +70,12 @@ pub enum BinstallError { err: semver::Error, }, + /// A version requirement is not valid. + /// + /// This is usually provided via the `--version` option. + /// + /// Note that we use the [`semver`] crate, which parses Cargo version requirement syntax; they + /// may be slightly different from other semver requirements expressions implementations. #[error("version requirement '{req}' is not semver: {err}")] #[diagnostic(code(binstall::version::requirement))] VersionReq { @@ -55,10 +84,17 @@ pub enum BinstallError { err: semver::Error, }, + /// No available version matches the requirements. + /// + /// This may be the case when using the `--version` option. + /// + /// Note that using `--version 1.2.3` is interpreted as the requirement `^1.2.3` as per + /// Cargo.toml rules. If you want the exact version 1.2.3, use `--version '=1.2.3'`. #[error("no version matching requirement '{req}'")] #[diagnostic(code(binstall::version::mismatch))] VersionMismatch { req: semver::VersionReq }, + /// The crates.io API doesn't have manifest metadata for the given version. #[error("no crate information available for '{crate_name}' version '{v}'")] #[diagnostic(code(binstall::version::unavailable))] VersionUnavailable { @@ -66,6 +102,10 @@ pub enum BinstallError { v: semver::Version, }, + /// An HTTP request failed. + /// + /// This includes both connection/transport failures and when the HTTP status of the response + /// is not as expected. #[error("could not {method} {url}: {err}")] #[diagnostic(code(binstall::http))] Http { From f56ed6fc4c3a87c2fe4499854fec77e606506e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 22:00:24 +1200 Subject: [PATCH 0085/2020] Add per-error exit codes --- src/errors.rs | 133 ++++++++++++++++++++++++++++++++++++-------------- src/main.rs | 24 ++++++--- 2 files changed, 113 insertions(+), 44 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index b369a537..bdf2841f 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,55 +1,77 @@ use miette::Diagnostic; use thiserror::Error; +/// Errors emitted by the library portion of cargo-binstall. #[derive(Error, Diagnostic, Debug)] #[diagnostic(url(docsrs))] +#[non_exhaustive] pub enum BinstallError { /// The installation was cancelled by a user at a confirmation prompt. + /// + /// - Exit code: 32 #[error("installation cancelled by user")] #[diagnostic(code(binstall::user_abort))] UserAbort, - /// A generic I/O error. - #[error(transparent)] - #[diagnostic(code(binstall::io))] - Io(#[from] std::io::Error), - /// A URL is invalid. /// /// This may be the result of a template in a Cargo manifest. + /// + /// - Exit code: 65 #[error(transparent)] #[diagnostic(code(binstall::url_parse))] UrlParse(#[from] url::ParseError), - /// A generic error from our HTTP client, reqwest. - /// - /// Errors resulting from HTTP fetches are handled with [`BinstallError::Http`] instead. - #[error(transparent)] - #[diagnostic(code(binstall::reqwest))] - Reqwest(#[from] reqwest::Error), - - /// A rendering error in a template. - #[error(transparent)] - #[diagnostic(code(binstall::template))] - Template(#[from] tinytemplate::error::Error), - /// An error while unzipping a file. + /// + /// - Exit code: 66 #[error(transparent)] #[diagnostic(code(binstall::unzip))] Unzip(#[from] zip::result::ZipError), - /// A parsing or validation error in a cargo manifest. + /// A rendering error in a template. /// - /// This should be rare, as manifests are generally fetched from crates.io, which does its own - /// validation upstream. The most common failure will therefore be for direct repository access - /// and with the `--manifest-path` option. + /// - Exit code: 67 #[error(transparent)] - #[diagnostic(code(binstall::cargo_manifest))] - CargoManifest(#[from] cargo_toml::Error), + #[diagnostic(code(binstall::template))] + Template(#[from] tinytemplate::error::Error), + + /// A generic error from our HTTP client, reqwest. + /// + /// Errors resulting from HTTP fetches are handled with [`BinstallError::Http`] instead. + /// + /// - Exit code: 68 + #[error(transparent)] + #[diagnostic(code(binstall::reqwest))] + Reqwest(#[from] reqwest::Error), + + /// An HTTP request failed. + /// + /// This includes both connection/transport failures and when the HTTP status of the response + /// is not as expected. + /// + /// - Exit code: 69 + #[error("could not {method} {url}: {err}")] + #[diagnostic(code(binstall::http))] + Http { + method: reqwest::Method, + url: url::Url, + #[source] + err: reqwest::Error, + }, + + /// A generic I/O error. + /// + /// - Exit code: 74 + #[error(transparent)] + #[diagnostic(code(binstall::io))] + Io(#[from] std::io::Error), /// An error interacting with the crates.io API. /// /// This could either be a "not found" or a server/transport error. + /// + /// - Exit code: 76 #[error("crates.io api error fetching crate information for '{crate_name}': {err}")] #[diagnostic(code(binstall::crates_io_api))] CratesIoApi { @@ -58,10 +80,23 @@ pub enum BinstallError { err: crates_io_api::Error, }, + /// A parsing or validation error in a cargo manifest. + /// + /// This should be rare, as manifests are generally fetched from crates.io, which does its own + /// validation upstream. The most common failure will therefore be for direct repository access + /// and with the `--manifest-path` option. + /// + /// - Exit code: 78 + #[error(transparent)] + #[diagnostic(code(binstall::cargo_manifest))] + CargoManifest(#[from] cargo_toml::Error), + /// A version is not valid semver. /// /// Note that we use the [`semver`] crate, which parses Cargo version syntax; this may be /// somewhat stricter or very slightly different from other semver implementations. + /// + /// - Exit code: 80 #[error("version string '{v}' is not semver: {err}")] #[diagnostic(code(binstall::version::parse))] VersionParse { @@ -76,6 +111,8 @@ pub enum BinstallError { /// /// Note that we use the [`semver`] crate, which parses Cargo version requirement syntax; they /// may be slightly different from other semver requirements expressions implementations. + /// + /// - Exit code: 81 #[error("version requirement '{req}' is not semver: {err}")] #[diagnostic(code(binstall::version::requirement))] VersionReq { @@ -90,28 +127,52 @@ pub enum BinstallError { /// /// Note that using `--version 1.2.3` is interpreted as the requirement `^1.2.3` as per /// Cargo.toml rules. If you want the exact version 1.2.3, use `--version '=1.2.3'`. + /// + /// - Exit code: 82 #[error("no version matching requirement '{req}'")] #[diagnostic(code(binstall::version::mismatch))] VersionMismatch { req: semver::VersionReq }, /// The crates.io API doesn't have manifest metadata for the given version. + /// + /// - Exit code: 83 #[error("no crate information available for '{crate_name}' version '{v}'")] #[diagnostic(code(binstall::version::unavailable))] VersionUnavailable { crate_name: String, v: semver::Version, }, - - /// An HTTP request failed. - /// - /// This includes both connection/transport failures and when the HTTP status of the response - /// is not as expected. - #[error("could not {method} {url}: {err}")] - #[diagnostic(code(binstall::http))] - Http { - method: reqwest::Method, - url: url::Url, - #[source] - err: reqwest::Error, - }, +} + +impl BinstallError { + /// The recommended exit code for this error. + /// + /// This will never output: + /// - 0 (success) + /// - 1 and 2 (catchall and shell) + /// - 16 (binstall errors not handled here) + /// - 64 (generic error) + pub fn exit_code(&self) -> u8 { + use BinstallError::*; + let code = match self { + UserAbort => 32, + UrlParse(_) => 65, + Unzip(_) => 66, + Template(_) => 67, + Reqwest(_) => 68, + Http { .. } => 69, + Io(_) => 74, + CratesIoApi { .. } => 76, + CargoManifest { .. } => 78, + VersionParse { .. } => 80, + VersionReq { .. } => 81, + VersionMismatch { .. } => 82, + VersionUnavailable { .. } => 83, + }; + + // reserved codes + debug_assert!(code != 64 && code != 16 && code != 1 && code != 2 && code != 0); + + code + } } diff --git a/src/main.rs b/src/main.rs index 514ef287..1b842388 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,4 @@ -use std::{path::PathBuf, str::FromStr, time::Instant}; +use std::{path::PathBuf, process::exit, str::FromStr, time::Instant}; use cargo_toml::{Package, Product}; use log::{debug, error, info, warn, LevelFilter}; @@ -75,7 +75,7 @@ struct Options { pkg_url: Option, } -fn main() -> Result<()> { +fn main() -> ! { let start = Instant::now(); let rt = Runtime::new().unwrap(); @@ -87,15 +87,23 @@ fn main() -> Result<()> { if let Err(err) = result { debug!("run time: {done:?}"); - if let Some(BinstallError::UserAbort) = err.downcast_ref::() { - warn!("Installation cancelled"); - Ok(()) - } else { - Err(err) + match err.downcast::() { + Ok(liberr @ BinstallError::UserAbort) => { + warn!("Installation cancelled"); + exit(liberr.exit_code() as _); + } + Ok(liberr) => { + eprintln!("{liberr:?}"); + exit(liberr.exit_code() as _); + } + Err(binerr) => { + eprintln!("{binerr:?}"); + exit(16); + } } } else { info!("Installation complete! [{done:?}]"); - Ok(()) + exit(0); } } From bd35c473a934d9040b88dfbddfb99c8f573dce41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 22:15:20 +1200 Subject: [PATCH 0086/2020] Use new Termination trait --- src/errors.rs | 21 ++++++++++++++++++--- src/main.rs | 51 +++++++++++++++++++++++++++++++++------------------ 2 files changed, 51 insertions(+), 21 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index bdf2841f..544272dc 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,3 +1,6 @@ +use std::process::{ExitCode, Termination}; + +use log::warn; use miette::Diagnostic; use thiserror::Error; @@ -152,9 +155,9 @@ impl BinstallError { /// - 1 and 2 (catchall and shell) /// - 16 (binstall errors not handled here) /// - 64 (generic error) - pub fn exit_code(&self) -> u8 { + pub fn exit_code(&self) -> ExitCode { use BinstallError::*; - let code = match self { + let code: u8 = match self { UserAbort => 32, UrlParse(_) => 65, Unzip(_) => 66, @@ -173,6 +176,18 @@ impl BinstallError { // reserved codes debug_assert!(code != 64 && code != 16 && code != 1 && code != 2 && code != 0); - code + code.into() + } +} + +impl Termination for BinstallError { + fn report(self) -> ExitCode { + if let BinstallError::UserAbort = self { + warn!("Installation cancelled"); + } else { + eprintln!("{self:?}"); + } + + self.exit_code() } } diff --git a/src/main.rs b/src/main.rs index 1b842388..2fe56c1b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,9 @@ -use std::{path::PathBuf, process::exit, str::FromStr, time::Instant}; +use std::{ + path::PathBuf, + process::{ExitCode, Termination}, + str::FromStr, + time::{Duration, Instant}, +}; use cargo_toml::{Package, Product}; use log::{debug, error, info, warn, LevelFilter}; @@ -75,7 +80,29 @@ struct Options { pkg_url: Option, } -fn main() -> ! { +enum MainExit { + Success(Duration), + Error(BinstallError), + Report(miette::Report), +} + +impl Termination for MainExit { + fn report(self) -> ExitCode { + match self { + Self::Success(spent) => { + info!("Installation complete! [{spent:?}]"); + ExitCode::SUCCESS + } + Self::Error(err) => err.report(), + Self::Report(err) => { + eprintln!("{err:?}"); + ExitCode::from(16) + } + } + } +} + +fn main() -> MainExit { let start = Instant::now(); let rt = Runtime::new().unwrap(); @@ -83,27 +110,15 @@ fn main() -> ! { drop(rt); let done = start.elapsed(); + debug!("run time: {done:?}"); if let Err(err) = result { - debug!("run time: {done:?}"); - match err.downcast::() { - Ok(liberr @ BinstallError::UserAbort) => { - warn!("Installation cancelled"); - exit(liberr.exit_code() as _); - } - Ok(liberr) => { - eprintln!("{liberr:?}"); - exit(liberr.exit_code() as _); - } - Err(binerr) => { - eprintln!("{binerr:?}"); - exit(16); - } + Ok(liberr) => MainExit::Error(liberr), + Err(binerr) => MainExit::Report(binerr), } } else { - info!("Installation complete! [{done:?}]"); - exit(0); + MainExit::Success(done) } } From 02c8c0af00f7cde2b466e639b2182228beb48d05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 22:17:27 +1200 Subject: [PATCH 0087/2020] Avoid bare url --- src/helpers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers.rs b/src/helpers.rs index 327f9240..1f90ac69 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -153,7 +153,7 @@ pub fn extract, P: AsRef>( } /// Fetch install path from environment -/// roughly follows https://doc.rust-lang.org/cargo/commands/cargo-install.html#description +/// roughly follows pub fn get_install_path>(install_path: Option

) -> Option { // Command line override first first if let Some(p) = install_path { From 84ebc0039e82ec63a8fb2536ad4999cf8fd1f72f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 23:01:12 +1200 Subject: [PATCH 0088/2020] Pretty-print errors --- src/errors.rs | 7 ++++--- src/main.rs | 23 +++++++++++++---------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index 544272dc..e6e4ab94 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,7 +1,7 @@ use std::process::{ExitCode, Termination}; use log::warn; -use miette::Diagnostic; +use miette::{Report, Diagnostic}; use thiserror::Error; /// Errors emitted by the library portion of cargo-binstall. @@ -182,12 +182,13 @@ impl BinstallError { impl Termination for BinstallError { fn report(self) -> ExitCode { + let code = self.exit_code(); if let BinstallError::UserAbort = self { warn!("Installation cancelled"); } else { - eprintln!("{self:?}"); + eprintln!("{:?}", Report::new(self)); } - self.exit_code() + code } } diff --git a/src/main.rs b/src/main.rs index 2fe56c1b..fa70206d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -90,11 +90,15 @@ impl Termination for MainExit { fn report(self) -> ExitCode { match self { Self::Success(spent) => { - info!("Installation complete! [{spent:?}]"); + info!("Installation completed in {spent:?}"); ExitCode::SUCCESS } - Self::Error(err) => err.report(), + Self::Error(err) => { + error!("Fatal error:"); + err.report() + } Self::Report(err) => { + error!("Fatal error:"); eprintln!("{err:?}"); ExitCode::from(16) } @@ -112,14 +116,13 @@ fn main() -> MainExit { let done = start.elapsed(); debug!("run time: {done:?}"); - if let Err(err) = result { - match err.downcast::() { - Ok(liberr) => MainExit::Error(liberr), - Err(binerr) => MainExit::Report(binerr), - } - } else { - MainExit::Success(done) - } + result + .map(|_| MainExit::Success(done)) + .unwrap_or_else(|err| { + err.downcast::() + .map(MainExit::Error) + .unwrap_or_else(MainExit::Report) + }) } async fn entry() -> Result<()> { From 33f4c76826cbd9b9f4094effb78943fb52da5574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 23:01:45 +1200 Subject: [PATCH 0089/2020] Add help text for when a crate is not found --- src/errors.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index e6e4ab94..16f7233d 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,7 +1,7 @@ use std::process::{ExitCode, Termination}; use log::warn; -use miette::{Report, Diagnostic}; +use miette::{Diagnostic, Report}; use thiserror::Error; /// Errors emitted by the library portion of cargo-binstall. @@ -76,7 +76,10 @@ pub enum BinstallError { /// /// - Exit code: 76 #[error("crates.io api error fetching crate information for '{crate_name}': {err}")] - #[diagnostic(code(binstall::crates_io_api))] + #[diagnostic( + code(binstall::crates_io_api), + help("Check that the crate name you provided is correct.\nYou can also search for a matching crate at: https://lib.rs/search?q={crate_name}") + )] CratesIoApi { crate_name: String, #[source] From d21c4a08752709e59f4fb55cd920f52b3960feff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 23:05:35 +1200 Subject: [PATCH 0090/2020] Add link to error code descriptions --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 57b337df..6cf74ca3 100644 --- a/README.md +++ b/README.md @@ -157,7 +157,7 @@ If your package already uses this approach, you shouldn't need to set anything. ### Examples -For example, the default configuration (as shown above) for a crate called `radio-sx128x` (version: `v0.14.1-alpha.5` on x86_64 linux) would be interpolated to: +For example, the default configuration (as shown above) for a crate called `radio-sx128x` (version: `v0.14.1-alpha.5` on x86\_64 linux) would be interpolated to: - A download URL of `https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/rust-radio-sx128x-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz` - Containing a single binary file `rust-radio-sx128x-x86_64-unknown-linux-gnu-v0.14.1-alpha.5/rust-radio-x86_64-unknown-linux-gnu` @@ -199,6 +199,8 @@ Which provides a binary path of: `sx128x-util-x86_64-unknown-linux-gnu[.exe]`. I - Yes and also no? We're not (yet? #1) doing anything to verify the CI binaries are produced by the right person / organisation. However, we're pulling data from crates.io and the cargo manifest, both of which are _already_ trusted entities, and this is functionally a replacement for `curl ... | bash` or `wget`-ing the same files, so, things can be improved but it's also sorta moot +- What do the error codes mean? + - You can find a full description of errors including exit codes here: --- From 7f0c818313131a7a7502fadf8ee51e6314f542af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 23:16:55 +1200 Subject: [PATCH 0091/2020] =?UTF-8?q?Don=E2=80=99t=20print=20"Fatal=20erro?= =?UTF-8?q?r"=20for=20UserAbort?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/errors.rs | 3 ++- src/main.rs | 5 +---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index 16f7233d..cb3a2bd1 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,6 +1,6 @@ use std::process::{ExitCode, Termination}; -use log::warn; +use log::{error, warn}; use miette::{Diagnostic, Report}; use thiserror::Error; @@ -189,6 +189,7 @@ impl Termination for BinstallError { if let BinstallError::UserAbort = self { warn!("Installation cancelled"); } else { + error!("Fatal error:"); eprintln!("{:?}", Report::new(self)); } diff --git a/src/main.rs b/src/main.rs index fa70206d..5af8b851 100644 --- a/src/main.rs +++ b/src/main.rs @@ -93,10 +93,7 @@ impl Termination for MainExit { info!("Installation completed in {spent:?}"); ExitCode::SUCCESS } - Self::Error(err) => { - error!("Fatal error:"); - err.report() - } + Self::Error(err) => err.report(), Self::Report(err) => { error!("Fatal error:"); eprintln!("{err:?}"); From 52c0213d98a9f262c2dbfbc42eec4e5b96b3a37b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 23:17:57 +1200 Subject: [PATCH 0092/2020] Show prompt for confirm --- src/helpers.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/helpers.rs b/src/helpers.rs index 1f90ac69..6c412b6d 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,3 +1,4 @@ +use std::io::{stderr, stdin, Write}; use std::path::{Path, PathBuf}; use log::{debug, info}; @@ -194,9 +195,11 @@ pub fn get_install_path>(install_path: Option

) -> Option Result<(), BinstallError> { loop { info!("Do you wish to continue? yes/no"); + eprint!("? "); + stderr().flush().ok(); let mut input = String::new(); - std::io::stdin().read_line(&mut input).unwrap(); + stdin().read_line(&mut input).unwrap(); match input.as_str().trim() { "yes" | "y" | "YES" | "Y" => break Ok(()), From c83c184983e3b0517fa10d733960cd4cfadbca2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 23:18:22 +1200 Subject: [PATCH 0093/2020] Default to no if nothing is entered on confirm --- src/helpers.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 6c412b6d..d6be62de 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -194,7 +194,7 @@ pub fn get_install_path>(install_path: Option

) -> Option Result<(), BinstallError> { loop { - info!("Do you wish to continue? yes/no"); + info!("Do you wish to continue? yes/[no]"); eprint!("? "); stderr().flush().ok(); @@ -203,7 +203,7 @@ pub fn confirm() -> Result<(), BinstallError> { match input.as_str().trim() { "yes" | "y" | "YES" | "Y" => break Ok(()), - "no" | "n" | "NO" | "N" => break Err(BinstallError::UserAbort), + "no" | "n" | "NO" | "N" | "" => break Err(BinstallError::UserAbort), _ => continue, } } From dee45f4b81de8b092d8ae75be32845d6789347f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 23:18:45 +1200 Subject: [PATCH 0094/2020] Correct HTTP error for remote_exists() helper --- src/helpers.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index d6be62de..3501532c 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -29,8 +29,13 @@ pub fn load_manifest_path>( Ok(manifest) } -pub async fn remote_exists(url: &str, method: reqwest::Method) -> Result { - let req = reqwest::Client::new().request(method, url).send().await?; +pub async fn remote_exists(url: &str, method: Method) -> Result { + let url = Url::parse(url)?; + let req = reqwest::Client::new() + .request(method.clone(), url.clone()) + .send() + .await + .map_err(|err| BinstallError::Http { method, url, err })?; Ok(req.status().is_success()) } From 1cac046ffd2916d9498e7fe26597e3946fba3210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 23:19:56 +1200 Subject: [PATCH 0095/2020] Formatting --- src/helpers.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 3501532c..c1ffcec0 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,5 +1,8 @@ -use std::io::{stderr, stdin, Write}; -use std::path::{Path, PathBuf}; +use std::{ + fs, + io::{stderr, stdin, Write}, + path::{Path, PathBuf}, +}; use log::{debug, info}; @@ -58,8 +61,8 @@ pub async fn download>(url: &str, path: P) -> Result<(), Binstall let path = path.as_ref(); debug!("Download OK, writing to file: '{}'", path.display()); - std::fs::create_dir_all(path.parent().unwrap())?; - std::fs::write(&path, bytes)?; + fs::create_dir_all(path.parent().unwrap())?; + fs::write(&path, bytes)?; Ok(()) } @@ -79,7 +82,7 @@ pub fn extract, P: AsRef>( path.as_ref() ); - let dat = std::fs::File::open(source)?; + let dat = fs::File::open(source)?; let mut tar = Archive::new(dat); tar.unpack(path)?; @@ -92,7 +95,7 @@ pub fn extract, P: AsRef>( path.as_ref() ); - let dat = std::fs::File::open(source)?; + let dat = fs::File::open(source)?; let tar = GzDecoder::new(dat); let mut tgz = Archive::new(tar); @@ -106,7 +109,7 @@ pub fn extract, P: AsRef>( path.as_ref() ); - let dat = std::fs::File::open(source)?; + let dat = fs::File::open(source)?; let tar = XzDecoder::new(dat); let mut txz = Archive::new(tar); @@ -139,7 +142,7 @@ pub fn extract, P: AsRef>( path.as_ref() ); - let dat = std::fs::File::open(source)?; + let dat = fs::File::open(source)?; let mut zip = ZipArchive::new(dat)?; zip.extract(path)?; @@ -151,7 +154,7 @@ pub fn extract, P: AsRef>( path.as_ref() ); // Copy to install dir - std::fs::copy(source, path)?; + fs::copy(source, path)?; } }; From aa4339e07df3123ab30bd2fd57900e0725a90f12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 23:24:40 +1200 Subject: [PATCH 0096/2020] Expose crate::errors module --- README.md | 2 +- src/lib.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 6cf74ca3..ce95831d 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,7 @@ Which provides a binary path of: `sx128x-util-x86_64-unknown-linux-gnu[.exe]`. I However, we're pulling data from crates.io and the cargo manifest, both of which are _already_ trusted entities, and this is functionally a replacement for `curl ... | bash` or `wget`-ing the same files, so, things can be improved but it's also sorta moot - What do the error codes mean? - - You can find a full description of errors including exit codes here: + - You can find a full description of errors including exit codes here: --- diff --git a/src/lib.rs b/src/lib.rs index 06f84c45..1fa840b1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -6,12 +6,12 @@ use strum_macros::{Display, EnumString, EnumVariantNames}; pub mod drivers; pub use drivers::*; +pub mod errors; +pub use errors::*; + pub mod helpers; pub use helpers::*; -mod errors; -pub use errors::BinstallError; - pub mod bins; pub mod fetchers; From 529781a9a9ddb260a374268f2a59ffcd55669849 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 31 May 2022 23:51:01 +1200 Subject: [PATCH 0097/2020] Format and link version mismatch warning --- src/errors.rs | 45 +++++++++++++++++++++++++++++++++------------ src/main.rs | 10 +++++++--- 2 files changed, 40 insertions(+), 15 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index cb3a2bd1..6e3dc263 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -13,7 +13,7 @@ pub enum BinstallError { /// /// - Exit code: 32 #[error("installation cancelled by user")] - #[diagnostic(code(binstall::user_abort))] + #[diagnostic(severity(info), code(binstall::user_abort))] UserAbort, /// A URL is invalid. @@ -22,21 +22,21 @@ pub enum BinstallError { /// /// - Exit code: 65 #[error(transparent)] - #[diagnostic(code(binstall::url_parse))] + #[diagnostic(severity(error), code(binstall::url_parse))] UrlParse(#[from] url::ParseError), /// An error while unzipping a file. /// /// - Exit code: 66 #[error(transparent)] - #[diagnostic(code(binstall::unzip))] + #[diagnostic(severity(error), code(binstall::unzip))] Unzip(#[from] zip::result::ZipError), /// A rendering error in a template. /// /// - Exit code: 67 #[error(transparent)] - #[diagnostic(code(binstall::template))] + #[diagnostic(severity(error), code(binstall::template))] Template(#[from] tinytemplate::error::Error), /// A generic error from our HTTP client, reqwest. @@ -45,7 +45,7 @@ pub enum BinstallError { /// /// - Exit code: 68 #[error(transparent)] - #[diagnostic(code(binstall::reqwest))] + #[diagnostic(severity(error), code(binstall::reqwest))] Reqwest(#[from] reqwest::Error), /// An HTTP request failed. @@ -55,7 +55,7 @@ pub enum BinstallError { /// /// - Exit code: 69 #[error("could not {method} {url}: {err}")] - #[diagnostic(code(binstall::http))] + #[diagnostic(severity(error), code(binstall::http))] Http { method: reqwest::Method, url: url::Url, @@ -67,7 +67,7 @@ pub enum BinstallError { /// /// - Exit code: 74 #[error(transparent)] - #[diagnostic(code(binstall::io))] + #[diagnostic(severity(error), code(binstall::io))] Io(#[from] std::io::Error), /// An error interacting with the crates.io API. @@ -77,6 +77,7 @@ pub enum BinstallError { /// - Exit code: 76 #[error("crates.io api error fetching crate information for '{crate_name}': {err}")] #[diagnostic( + severity(error), code(binstall::crates_io_api), help("Check that the crate name you provided is correct.\nYou can also search for a matching crate at: https://lib.rs/search?q={crate_name}") )] @@ -94,7 +95,11 @@ pub enum BinstallError { /// /// - Exit code: 78 #[error(transparent)] - #[diagnostic(code(binstall::cargo_manifest))] + #[diagnostic( + severity(error), + code(binstall::cargo_manifest), + help("If you used --manifest-path, check the Cargo.toml syntax.") + )] CargoManifest(#[from] cargo_toml::Error), /// A version is not valid semver. @@ -104,7 +109,7 @@ pub enum BinstallError { /// /// - Exit code: 80 #[error("version string '{v}' is not semver: {err}")] - #[diagnostic(code(binstall::version::parse))] + #[diagnostic(severity(error), code(binstall::version::parse))] VersionParse { v: String, #[source] @@ -120,7 +125,7 @@ pub enum BinstallError { /// /// - Exit code: 81 #[error("version requirement '{req}' is not semver: {err}")] - #[diagnostic(code(binstall::version::requirement))] + #[diagnostic(severity(error), code(binstall::version::requirement))] VersionReq { req: String, #[source] @@ -136,18 +141,33 @@ pub enum BinstallError { /// /// - Exit code: 82 #[error("no version matching requirement '{req}'")] - #[diagnostic(code(binstall::version::mismatch))] + #[diagnostic(severity(error), code(binstall::version::mismatch))] VersionMismatch { req: semver::VersionReq }, /// The crates.io API doesn't have manifest metadata for the given version. /// /// - Exit code: 83 #[error("no crate information available for '{crate_name}' version '{v}'")] - #[diagnostic(code(binstall::version::unavailable))] + #[diagnostic(severity(error), code(binstall::version::unavailable))] VersionUnavailable { crate_name: String, v: semver::Version, }, + + /// Warning: The resolved version may not be what was meant. + /// + /// This occurs when using the `--version` option with a bare version, like `--version 1.2.3`. + /// That is parsed as the semver requirement `^1.2.3`, but the user may have expected that to + /// be an exact version (which should be specified with `--version '=1.2.3'`. + /// + /// - Exit code: none (runtime warning only) + #[error("version semantic mismatch: {ver} <> {req}")] + #[diagnostic( + severity(warning), + code(binstall::version::warning), + help("You specified `--version {req}` but the package resolved that to '{ver}'.\nUse `--version '={req}'` if you want an exact match.") + )] + VersionWarning { ver: String, req: String }, } impl BinstallError { @@ -174,6 +194,7 @@ impl BinstallError { VersionReq { .. } => 81, VersionMismatch { .. } => 82, VersionUnavailable { .. } => 83, + VersionWarning { .. } => unimplemented!("BUG: warnings do not terminate"), }; // reserved codes diff --git a/src/main.rs b/src/main.rs index 5af8b851..000ae381 100644 --- a/src/main.rs +++ b/src/main.rs @@ -173,9 +173,13 @@ async fn entry() -> Result<()> { let is_plain_version = semver::Version::from_str(&opts.version).is_ok(); if is_plain_version && package.version != opts.version { - warn!( - "You specified `--version {o}` but the package resolved that to '{p}', use `={o}` if you want an exact match", - o=opts.version, p=package.version + warn!("Warning!"); + eprintln!( + "{:?}", + miette::Report::new(BinstallError::VersionWarning { + ver: package.version.clone(), + req: opts.version.clone() + }) ); if !opts.no_confirm && !opts.dry_run { From 77b331f97cbde4bd47f4dc132aeb9a54152557d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 1 Jun 2022 00:05:26 +1200 Subject: [PATCH 0098/2020] Add error codes to documentation --- src/errors.rs | 42 ++++++++++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index 6e3dc263..070c91ce 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -11,7 +11,8 @@ use thiserror::Error; pub enum BinstallError { /// The installation was cancelled by a user at a confirmation prompt. /// - /// - Exit code: 32 + /// - Code: `binstall::user_abort` + /// - Exit: 32 #[error("installation cancelled by user")] #[diagnostic(severity(info), code(binstall::user_abort))] UserAbort, @@ -20,21 +21,24 @@ pub enum BinstallError { /// /// This may be the result of a template in a Cargo manifest. /// - /// - Exit code: 65 + /// - Code: `binstall::url_parse` + /// - Exit: 65 #[error(transparent)] #[diagnostic(severity(error), code(binstall::url_parse))] UrlParse(#[from] url::ParseError), /// An error while unzipping a file. /// - /// - Exit code: 66 + /// - Code: `binstall::unzip` + /// - Exit: 66 #[error(transparent)] #[diagnostic(severity(error), code(binstall::unzip))] Unzip(#[from] zip::result::ZipError), /// A rendering error in a template. /// - /// - Exit code: 67 + /// - Code: `binstall::template` + /// - Exit: 67 #[error(transparent)] #[diagnostic(severity(error), code(binstall::template))] Template(#[from] tinytemplate::error::Error), @@ -43,7 +47,8 @@ pub enum BinstallError { /// /// Errors resulting from HTTP fetches are handled with [`BinstallError::Http`] instead. /// - /// - Exit code: 68 + /// - Code: `binstall::reqwest` + /// - Exit: 68 #[error(transparent)] #[diagnostic(severity(error), code(binstall::reqwest))] Reqwest(#[from] reqwest::Error), @@ -53,7 +58,8 @@ pub enum BinstallError { /// This includes both connection/transport failures and when the HTTP status of the response /// is not as expected. /// - /// - Exit code: 69 + /// - Code: `binstall::http` + /// - Exit: 69 #[error("could not {method} {url}: {err}")] #[diagnostic(severity(error), code(binstall::http))] Http { @@ -65,7 +71,8 @@ pub enum BinstallError { /// A generic I/O error. /// - /// - Exit code: 74 + /// - Code: `binstall::io` + /// - Exit: 74 #[error(transparent)] #[diagnostic(severity(error), code(binstall::io))] Io(#[from] std::io::Error), @@ -74,7 +81,8 @@ pub enum BinstallError { /// /// This could either be a "not found" or a server/transport error. /// - /// - Exit code: 76 + /// - Code: `binstall::crates_io_api` + /// - Exit: 76 #[error("crates.io api error fetching crate information for '{crate_name}': {err}")] #[diagnostic( severity(error), @@ -93,7 +101,8 @@ pub enum BinstallError { /// validation upstream. The most common failure will therefore be for direct repository access /// and with the `--manifest-path` option. /// - /// - Exit code: 78 + /// - Code: `binstall::cargo_manifest` + /// - Exit: 78 #[error(transparent)] #[diagnostic( severity(error), @@ -107,7 +116,8 @@ pub enum BinstallError { /// Note that we use the [`semver`] crate, which parses Cargo version syntax; this may be /// somewhat stricter or very slightly different from other semver implementations. /// - /// - Exit code: 80 + /// - Code: `binstall::version::parse` + /// - Exit: 80 #[error("version string '{v}' is not semver: {err}")] #[diagnostic(severity(error), code(binstall::version::parse))] VersionParse { @@ -123,7 +133,8 @@ pub enum BinstallError { /// Note that we use the [`semver`] crate, which parses Cargo version requirement syntax; they /// may be slightly different from other semver requirements expressions implementations. /// - /// - Exit code: 81 + /// - Code: `binstall::version::requirement` + /// - Exit: 81 #[error("version requirement '{req}' is not semver: {err}")] #[diagnostic(severity(error), code(binstall::version::requirement))] VersionReq { @@ -139,14 +150,16 @@ pub enum BinstallError { /// Note that using `--version 1.2.3` is interpreted as the requirement `^1.2.3` as per /// Cargo.toml rules. If you want the exact version 1.2.3, use `--version '=1.2.3'`. /// - /// - Exit code: 82 + /// - Code: `binstall::version::mismatch` + /// - Exit: 82 #[error("no version matching requirement '{req}'")] #[diagnostic(severity(error), code(binstall::version::mismatch))] VersionMismatch { req: semver::VersionReq }, /// The crates.io API doesn't have manifest metadata for the given version. /// - /// - Exit code: 83 + /// - Code: `binstall::version::unavailable` + /// - Exit: 83 #[error("no crate information available for '{crate_name}' version '{v}'")] #[diagnostic(severity(error), code(binstall::version::unavailable))] VersionUnavailable { @@ -160,7 +173,8 @@ pub enum BinstallError { /// That is parsed as the semver requirement `^1.2.3`, but the user may have expected that to /// be an exact version (which should be specified with `--version '=1.2.3'`. /// - /// - Exit code: none (runtime warning only) + /// - Code: `binstall::version::warning` + /// - Exit: none (runtime warning only) #[error("version semantic mismatch: {ver} <> {req}")] #[diagnostic( severity(warning), From 73b3ac1adb2c245c30b0d0884114c25f1eb47cb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 1 Jun 2022 00:30:28 +1200 Subject: [PATCH 0099/2020] Drop tokio macros --- Cargo.lock | 12 ------------ Cargo.toml | 5 ++++- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c67c8f1d..b430ff06 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1450,21 +1450,9 @@ dependencies = [ "pin-project-lite", "signal-hook-registry", "socket2", - "tokio-macros", "winapi", ] -[[package]] -name = "tokio-macros" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b557f72f448c511a979e2564e55d74e6c4432fc96ff4f6241bc6bded342643b7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "tokio-rustls" version = "0.23.4" diff --git a/Cargo.toml b/Cargo.toml index 60265956..dc1cee79 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,9 +41,11 @@ tinytemplate = "1.2.1" # This crate uses features rt-multi-thread and macros in `#[tokio::main]` and # uses feature process to create process. -tokio = { version = "1.18.0", features = [ "rt-multi-thread", "macros", "process" ], default-features = false } +tokio = { version = "1.18.0", features = [ "rt-multi-thread", "process" ], default-features = false } + url = "2.2.2" xz2 = "0.1.6" + # Disable all features of zip except for features of compression algorithms: # Disable features include: # - aes-crypto: Enables decryption of files which were encrypted with AES, absolutely zero use for @@ -51,6 +53,7 @@ xz2 = "0.1.6" # - time: Enables features using the [time](https://github.com/time-rs/time) crate, # which is not used by this crate. zip = { version = "0.6.2", default-features = false, features = [ "deflate", "bzip2", "zstd" ] } + # zstd is also depended by zip. # Since zip 0.6.2 depends on zstd 0.10.0, we also have to use 0.10.0 here, # otherwise there will be a link conflict. From b79d8d7fec31a2111f664a20a2f85d0a7b75874f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 1 Jun 2022 00:36:18 +1200 Subject: [PATCH 0100/2020] Warn on non-HTTPS url --- src/fetchers/gh_crate_meta.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index c0f4035a..c8b4e60d 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -1,6 +1,6 @@ use std::path::Path; -use log::{debug, info}; +use log::{debug, info, warn}; use reqwest::Method; use serde::Serialize; use url::Url; @@ -28,6 +28,11 @@ impl super::Fetcher for GhCrateMeta { async fn check(&self) -> Result { let url = self.url()?; + + if url.scheme() != "https" { + warn!("URL is not HTTPS! This may become a hard error in the future, tell the upstream!"); + } + info!("Checking for package at: '{url}'"); remote_exists(url.as_str(), Method::HEAD).await } From ac74da4a27e090a6077b7f2487e792737aa5eda4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 1 Jun 2022 00:47:32 +1200 Subject: [PATCH 0101/2020] Clippy suggestions --- src/drivers.rs | 4 ++-- src/fetchers.rs | 6 ++++-- src/fetchers/gh_crate_meta.rs | 2 +- src/helpers.rs | 4 ++-- src/lib.rs | 20 +++++--------------- src/main.rs | 6 +++--- 6 files changed, 17 insertions(+), 25 deletions(-) diff --git a/src/drivers.rs b/src/drivers.rs index 7b39bd10..1ca2ed3f 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -22,7 +22,7 @@ fn find_version<'a, V: Iterator>( let filtered: BTreeSet<_> = version_iter .filter_map(|v| { // Remove leading `v` for git tags - let ver_str = match v.strip_prefix("s") { + let ver_str = match v.strip_prefix('s') { Some(v) => v, None => v, }; @@ -47,7 +47,7 @@ fn find_version<'a, V: Iterator>( .iter() .max() .cloned() - .ok_or_else(|| BinstallError::VersionMismatch { req: version_req }) + .ok_or(BinstallError::VersionMismatch { req: version_req }) } /// Fetch a crate by name and version from crates.io diff --git a/src/fetchers.rs b/src/fetchers.rs index 44fdf57e..b7b25795 100644 --- a/src/fetchers.rs +++ b/src/fetchers.rs @@ -54,14 +54,16 @@ impl MultiFetcher { pub async fn first_available(&self) -> Option<&dyn Fetcher> { for fetcher in &self.fetchers { - if fetcher.check().await.unwrap_or_else(|err| { + let available = fetcher.check().await.unwrap_or_else(|err| { debug!( "Error while checking fetcher {}: {}", fetcher.source_name(), err ); false - }) { + }); + + if available { return Some(&**fetcher); } } diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index c8b4e60d..e9a7634a 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -16,7 +16,7 @@ impl GhCrateMeta { fn url(&self) -> Result { let ctx = Context::from_data(&self.data); debug!("Using context: {:?}", ctx); - Ok(ctx.render_url(&self.data.meta.pkg_url)?) + ctx.render_url(&self.data.meta.pkg_url) } } diff --git a/src/helpers.rs b/src/helpers.rs index c1ffcec0..6f160391 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -194,7 +194,7 @@ pub fn get_install_path>(install_path: Option

) -> Option, } -impl Default for PkgOverride { - fn default() -> Self { - Self { - pkg_url: None, - pkg_fmt: None, - bin_dir: None, - } - } -} - #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "kebab-case")] pub struct BinMeta { @@ -164,7 +154,7 @@ mod test { let manifest = load_manifest_path(&manifest_dir).expect("Error parsing metadata"); let package = manifest.package.unwrap(); - let meta = package.metadata.map(|m| m.binstall).flatten().unwrap(); + let meta = package.metadata.and_then(|m| m.binstall).unwrap(); assert_eq!(&package.name, "cargo-binstall"); diff --git a/src/main.rs b/src/main.rs index 000ae381..a9479a2d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -191,9 +191,8 @@ async fn entry() -> Result<()> { package .metadata .as_ref() - .map(|m| m.binstall.clone()) - .flatten() - .unwrap_or(PkgMeta::default()), + .and_then(|m| m.binstall.clone()) + .unwrap_or_default(), manifest.bin, ); @@ -254,6 +253,7 @@ async fn entry() -> Result<()> { } } +#[allow(clippy::too_many_arguments)] async fn install_from_package( binaries: Vec, fetcher: &dyn Fetcher, From f2905dd46e68f41675f3d7fe777d4b02588eab14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Wed, 1 Jun 2022 00:59:00 +1200 Subject: [PATCH 0102/2020] Update src/helpers.rs Co-authored-by: Jiahao XU --- src/helpers.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/helpers.rs b/src/helpers.rs index 6f160391..a9795ffe 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -192,7 +192,13 @@ pub fn get_install_path>(install_path: Option

) -> Option Date: Wed, 1 Jun 2022 01:00:33 +1200 Subject: [PATCH 0103/2020] Fix syntax --- src/helpers.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index a9795ffe..e0d85b99 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -193,17 +193,12 @@ pub fn get_install_path>(install_path: Option

) -> Option Result<(), BinstallError> { From 23f05f39855430b7c775d116cbd472f25d332760 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 1 Jun 2022 01:03:52 +1200 Subject: [PATCH 0104/2020] Clippy in tests --- src/fetchers/gh_crate_meta.rs | 45 ++++++++++++++++++++++++----------- 1 file changed, 31 insertions(+), 14 deletions(-) diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index e9a7634a..fdf655e7 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -157,8 +157,11 @@ mod test { #[test] fn no_repo_but_full_url() { - let mut meta = PkgMeta::default(); - meta.pkg_url = format!("https://example.com{}", meta.pkg_url); + let meta = PkgMeta { + pkg_url: format!("https://example.com{}", PkgMeta::default().pkg_url), + ..Default::default() + }; + let data = Data { name: "cargo-binstall".to_string(), target: "x86_64-unknown-linux-gnu".to_string(), @@ -176,8 +179,13 @@ mod test { #[test] fn different_url() { - let mut meta = PkgMeta::default(); - meta.pkg_url = "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ archive-format }".to_string(); + let meta = PkgMeta { + pkg_url: + "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ archive-format }" + .into(), + ..Default::default() + }; + let data = Data { name: "radio-sx128x".to_string(), target: "x86_64-unknown-linux-gnu".to_string(), @@ -195,8 +203,11 @@ mod test { #[test] fn deprecated_format() { - let mut meta = PkgMeta::default(); - meta.pkg_url = "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ format }".to_string(); + let meta = PkgMeta { + pkg_url: "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ format }".into(), + ..Default::default() + }; + let data = Data { name: "radio-sx128x".to_string(), target: "x86_64-unknown-linux-gnu".to_string(), @@ -214,11 +225,14 @@ mod test { #[test] fn different_ext() { - let mut meta = PkgMeta::default(); - meta.pkg_url = - "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }.tar.xz" - .to_string(); - meta.pkg_fmt = PkgFmt::Txz; + let meta = PkgMeta { + pkg_url: + "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }.tar.xz" + .into(), + pkg_fmt: PkgFmt::Txz, + ..Default::default() + }; + let data = Data { name: "cargo-watch".to_string(), target: "aarch64-apple-darwin".to_string(), @@ -236,9 +250,12 @@ mod test { #[test] fn no_archive() { - let mut meta = PkgMeta::default(); - meta.pkg_url = "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }{ binary-ext }".to_string(); - meta.pkg_fmt = PkgFmt::Bin; + let meta = PkgMeta { + pkg_url: "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }{ binary-ext }".into(), + pkg_fmt: PkgFmt::Bin, + ..Default::default() + }; + let data = Data { name: "cargo-watch".to_string(), target: "aarch64-pc-windows-msvc".to_string(), From e3754de7f72399dac0d187701ac0d2a42f850ccb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 1 Jun 2022 01:11:53 +1200 Subject: [PATCH 0105/2020] Formatting --- src/fetchers/gh_crate_meta.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index fdf655e7..f048bb87 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -30,7 +30,9 @@ impl super::Fetcher for GhCrateMeta { let url = self.url()?; if url.scheme() != "https" { - warn!("URL is not HTTPS! This may become a hard error in the future, tell the upstream!"); + warn!( + "URL is not HTTPS! This may become a hard error in the future, tell the upstream!" + ); } info!("Checking for package at: '{url}'"); From 6457ab9b640533482eac0c6f39116493d008caf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 1 Jun 2022 01:30:48 +1200 Subject: [PATCH 0106/2020] (cargo-release) version 0.8.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b430ff06..56719108 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -139,7 +139,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.7.0" +version = "0.8.0" dependencies = [ "async-trait", "cargo_metadata", diff --git a/Cargo.toml b/Cargo.toml index dc1cee79..e4888364 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/ryankurte/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.7.0" +version = "0.8.0" authors = ["ryan "] edition = "2018" license = "GPL-3.0" From 6ab55d9ddae3fda83a8457b7c5ea48097be54d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 1 Jun 2022 01:46:28 +1200 Subject: [PATCH 0107/2020] Fix arm64 linux URL --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ce95831d..943130fe 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo- linux arm64: ``` -wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-unknown-linux-musleabihf.tgz +wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-unknown-linux-musl.tgz ``` macos x86\_64: From 962e68f78676bd6504c5f43ea72147c87fab7286 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jun 2022 01:25:38 +0000 Subject: [PATCH 0108/2020] Bump tokio from 1.18.2 to 1.19.1 Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.18.2 to 1.19.1. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.18.2...tokio-1.19.1) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 56719108..4279b987 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1437,9 +1437,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.18.2" +version = "1.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4903bf0427cf68dddd5aa6a93220756f8be0c34fcfa9f5e6191e103e15a31395" +checksum = "95eec79ea28c00a365f539f1961e9278fbcaf81c0ff6aaf0e93c181352446948" dependencies = [ "bytes", "libc", diff --git a/Cargo.toml b/Cargo.toml index e4888364..27ebd560 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,7 @@ tinytemplate = "1.2.1" # This crate uses features rt-multi-thread and macros in `#[tokio::main]` and # uses feature process to create process. -tokio = { version = "1.18.0", features = [ "rt-multi-thread", "process" ], default-features = false } +tokio = { version = "1.19.1", features = [ "rt-multi-thread", "process" ], default-features = false } url = "2.2.2" xz2 = "0.1.6" From fe551438a0d54c90c45d8be1ddbdb64ea5349680 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Jun 2022 01:25:44 +0000 Subject: [PATCH 0109/2020] Bump async-trait from 0.1.53 to 0.1.56 Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.53 to 0.1.56. - [Release notes](https://github.com/dtolnay/async-trait/releases) - [Commits](https://github.com/dtolnay/async-trait/compare/0.1.53...0.1.56) --- updated-dependencies: - dependency-name: async-trait dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 56719108..fc38cece 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,9 +28,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.53" +version = "0.1.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6aa3524a2dfcf9fe180c51eae2b58738348d819517ceadf95789c51fff7600" +checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" dependencies = [ "proc-macro2", "quote", @@ -1299,9 +1299,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbaf6116ab8924f39d52792136fb74fd60a80194cf1b1c6ffa6453eef1c3f942" +checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index e4888364..017bcb29 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -async-trait = "0.1.52" +async-trait = "0.1.56" cargo_metadata = "0.14.2" cargo_toml = "0.11.4" crates_io_api = { version = "0.8.0", default-features = false, features = ["rustls"] } From 69f2a56595ab7b3d7b083ec11f90b511fd583d0c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 6 Jun 2022 22:00:01 +1000 Subject: [PATCH 0110/2020] Move `TARGET` in `lib.rs` into new mod `target.rs` Signed-off-by: Jiahao XU --- src/lib.rs | 4 ++-- src/target.rs | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 src/target.rs diff --git a/src/lib.rs b/src/lib.rs index 2a823625..ef3cfbaf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,8 +15,8 @@ pub use helpers::*; pub mod bins; pub mod fetchers; -/// Compiled target triple, used as default for binary fetching -pub const TARGET: &str = env!("TARGET"); +mod target; +pub use target::TARGET; /// Default package path template (may be overridden in package Cargo.toml) pub const DEFAULT_PKG_URL: &str = diff --git a/src/target.rs b/src/target.rs new file mode 100644 index 00000000..94bfe775 --- /dev/null +++ b/src/target.rs @@ -0,0 +1,2 @@ +/// Compiled target triple, used as default for binary fetching +pub const TARGET: &str = env!("TARGET"); From 8bd4b9b6a1362f53d48be1ee58bf751b1ac34e55 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 6 Jun 2022 22:32:15 +1000 Subject: [PATCH 0111/2020] Impl `detect_targets` for linux Signed-off-by: Jiahao XU --- src/lib.rs | 2 +- src/target.rs | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 96 insertions(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index ef3cfbaf..0a6c1437 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,7 +16,7 @@ pub mod bins; pub mod fetchers; mod target; -pub use target::TARGET; +pub use target::{detect_targets, TARGET}; /// Default package path template (may be overridden in package Cargo.toml) pub const DEFAULT_PKG_URL: &str = diff --git a/src/target.rs b/src/target.rs index 94bfe775..4c6f8f57 100644 --- a/src/target.rs +++ b/src/target.rs @@ -1,2 +1,97 @@ /// Compiled target triple, used as default for binary fetching pub const TARGET: &str = env!("TARGET"); + +/// Detect the targets supported at runtime, +/// which might be different from `TARGET` which is detected +/// at compile-time. +/// +/// Return targets supported in the order of preference. +/// If target_os is linux and it support gnu, then it is preferred +/// to musl. +/// +/// If target_os is mac and it is aarch64, then aarch64 is preferred +/// to x86_64. +/// +/// Check [this issue](https://github.com/ryankurte/cargo-binstall/issues/155) +/// for more information. +pub async fn detect_targets() -> Vec> { + #[cfg(target_os = "linux")] + { + return linux::detect_targets_linux().await; + } + + todo!() +} + +#[cfg(target_os = "linux")] +mod linux { + use super::TARGET; + use std::process::Output; + use tokio::process::Command; + + async fn detect_targets_linux() -> Vec> { + let abi = parse_abi(); + + if let Ok(Output { + status: _, + stdout, + stderr, + }) = Command::new("ldd").arg("--version").output().await + { + let libc_version = if let Some(libc_version) = parse_libc_version(stdout) { + libc_version + } else if let Some(libc_version) = parse_libc_version(stderr) { + libc_version + } else { + return vec![create_target_str("musl", abi)]; + }; + + if libc_version == "gnu" { + return vec![ + create_target_str("gnu", abi), + create_target_str("musl", abi), + ]; + } + } + + // Fallback to using musl + vec![create_target_str("musl", abi)] + } + + fn parse_libc_version(output: &[u8]) -> Option<&'static str> { + let s = String::from_utf8_lossy(output); + if s.contains("musl libc") { + Some("musl") + } else if s.contains("GLIBC") { + Some("gnu") + } else { + None + } + } + + const fn parse_abi() -> &'static str { + if TARGET.endswith("abi64") { + "abi64" + } else if TARGET.endswith("eabi") { + "eabi" + } else if TARGET.endswith("eabihf") { + "eabihf" + } else if TARGET.endswith("gnu") || TARGET.endswith("musl") { + "" + } else { + panic!("Unknown abi") + } + } + + fn create_target_str(libc_version: &str, abi: &str) -> Box { + let prefix = TARGET.rsplit_once('-').unwrap().0; + + let mut target = String::with_capacity(prefix.len() + 1 + libc_version.len() + abi.len()); + target.push_str(prefix); + target.push('-'); + target.push_str(libc_version); + target.push_str(abi); + + target.into_boxed_str() + } +} From ca5c9b7c239f067443e6de51c86af478a1f2b176 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 6 Jun 2022 22:35:51 +1000 Subject: [PATCH 0112/2020] Add dep `guess_host_triple` for target_os `macos` Signed-off-by: Jiahao XU --- Cargo.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index e4888364..9532caf5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,6 +62,9 @@ zip = { version = "0.6.2", default-features = false, features = [ "deflate", "bz # Enable feature zstdmt to enable multithreading in libzstd. zstd = { version = "0.10.0", features = [ "bindgen", "zstdmt" ], default-features = false } +[target.'cfg(target_os = "macos")'.dependencies] +guess_host_triple = "0.1.3" + [dev-dependencies] env_logger = "0.9.0" From 4157f20b99c29681531f25a2c161b76bf4103366 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 6 Jun 2022 22:40:52 +1000 Subject: [PATCH 0113/2020] Support for macos in `detect_targets` Signed-off-by: Jiahao XU --- src/target.rs | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/src/target.rs b/src/target.rs index 4c6f8f57..24b0e3e9 100644 --- a/src/target.rs +++ b/src/target.rs @@ -19,8 +19,10 @@ pub async fn detect_targets() -> Vec> { { return linux::detect_targets_linux().await; } - - todo!() + #[cfg(target_os = "macos")] + { + macos::detect_targets_macos() + } } #[cfg(target_os = "linux")] @@ -95,3 +97,19 @@ mod linux { target.into_boxed_str() } } + +#[cfg(target_os = "macos")] +mod macos { + use guess_host_triple::guess_host_triple; + + const AARCH64: &str = "aarch64-apple-darwin"; + const X86: &str = "x86_64-apple-darwin"; + + pub(super) fn detect_targets_macos() -> Vec> { + if guess_host_triple() == Some(AARCH64) { + vec![AARCH64.into(), X86.into()] + } else { + vec![X86.into()] + } + } +} From 9a8b28afcfe80e9dce7f64537e3752829e0eeeed Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 6 Jun 2022 22:41:15 +1000 Subject: [PATCH 0114/2020] Fix invocation of `linux::detect_targets_linux` in `detect_targets` Signed-off-by: Jiahao XU --- src/target.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/target.rs b/src/target.rs index 24b0e3e9..03c02a56 100644 --- a/src/target.rs +++ b/src/target.rs @@ -17,7 +17,7 @@ pub const TARGET: &str = env!("TARGET"); pub async fn detect_targets() -> Vec> { #[cfg(target_os = "linux")] { - return linux::detect_targets_linux().await; + linux::detect_targets_linux().await } #[cfg(target_os = "macos")] { @@ -31,7 +31,7 @@ mod linux { use std::process::Output; use tokio::process::Command; - async fn detect_targets_linux() -> Vec> { + pub(super) async fn detect_targets_linux() -> Vec> { let abi = parse_abi(); if let Ok(Output { From b74139f457b5eb135d1e3c84f369b141a4f7bed2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 6 Jun 2022 22:42:43 +1000 Subject: [PATCH 0115/2020] Support for other platforms in `detect_targets` Signed-off-by: Jiahao XU --- src/target.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/target.rs b/src/target.rs index 03c02a56..79eb32ab 100644 --- a/src/target.rs +++ b/src/target.rs @@ -23,6 +23,10 @@ pub async fn detect_targets() -> Vec> { { macos::detect_targets_macos() } + #[cfg(not(any(target_os = "linux", target_os = "macos")))] + { + vec![TARGET.into()] + } } #[cfg(target_os = "linux")] From 1ebc759b17352458cfc5f65ff07882cda095b079 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 6 Jun 2022 22:45:06 +1000 Subject: [PATCH 0116/2020] Add dep `arrayvec` v0.7.2 Signed-off-by: Jiahao XU --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 9532caf5..d98eadd0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,6 +62,8 @@ zip = { version = "0.6.2", default-features = false, features = [ "deflate", "bz # Enable feature zstdmt to enable multithreading in libzstd. zstd = { version = "0.10.0", features = [ "bindgen", "zstdmt" ], default-features = false } +arrayvec = "0.7.2" + [target.'cfg(target_os = "macos")'.dependencies] guess_host_triple = "0.1.3" From c50e9491701555e4bf4a11f56ccd6227f7b7a738 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 6 Jun 2022 22:45:21 +1000 Subject: [PATCH 0117/2020] Update `Cargo.lock` Signed-off-by: Jiahao XU --- Cargo.lock | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 56719108..3bfbedd2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,6 +26,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "arrayvec" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" + [[package]] name = "async-trait" version = "0.1.53" @@ -141,6 +147,7 @@ dependencies = [ name = "cargo-binstall" version = "0.8.0" dependencies = [ + "arrayvec", "async-trait", "cargo_metadata", "cargo_toml", @@ -148,6 +155,7 @@ dependencies = [ "dirs", "env_logger", "flate2", + "guess_host_triple", "log", "miette", "reqwest", @@ -355,6 +363,27 @@ dependencies = [ "termcolor", ] +[[package]] +name = "errno" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f639046355ee4f37944e44f60642c6f3a7efa3cf6b78c78a0d989a8ce6c396a1" +dependencies = [ + "errno-dragonfly", + "libc", + "winapi", +] + +[[package]] +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "fastrand" version = "1.7.0" @@ -509,6 +538,18 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" +[[package]] +name = "guess_host_triple" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b35a8ce923c7490629d84e12fa2f75e1733f1ec692a47c264f9b7fd632855afc" +dependencies = [ + "errno", + "libc", + "log", + "winapi", +] + [[package]] name = "h2" version = "0.3.13" From 7232f32428b95a73ec66d586845f0b4a89a224e7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 6 Jun 2022 22:52:11 +1000 Subject: [PATCH 0118/2020] Use `ArrayVec` to avoid heap alloc in `detect_targets` Signed-off-by: Jiahao XU --- src/target.rs | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/src/target.rs b/src/target.rs index 79eb32ab..da0f3794 100644 --- a/src/target.rs +++ b/src/target.rs @@ -1,3 +1,5 @@ +use arrayvec::ArrayVec; + /// Compiled target triple, used as default for binary fetching pub const TARGET: &str = env!("TARGET"); @@ -14,7 +16,7 @@ pub const TARGET: &str = env!("TARGET"); /// /// Check [this issue](https://github.com/ryankurte/cargo-binstall/issues/155) /// for more information. -pub async fn detect_targets() -> Vec> { +pub async fn detect_targets() -> ArrayVec, 2> { #[cfg(target_os = "linux")] { linux::detect_targets_linux().await @@ -29,13 +31,23 @@ pub async fn detect_targets() -> Vec> { } } +fn from_array(arr: [T; LEN]) -> ArrayVec { + let mut v = ArrayVec::new(); + + for elem in arr { + v.push(elem); + } + + v +} + #[cfg(target_os = "linux")] mod linux { - use super::TARGET; + use super::{from_array, ArrayVec, TARGET}; use std::process::Output; use tokio::process::Command; - pub(super) async fn detect_targets_linux() -> Vec> { + pub(super) async fn detect_targets_linux() -> ArrayVec, 2> { let abi = parse_abi(); if let Ok(Output { @@ -49,19 +61,19 @@ mod linux { } else if let Some(libc_version) = parse_libc_version(stderr) { libc_version } else { - return vec![create_target_str("musl", abi)]; + return from_array([create_target_str("musl", abi)]); }; if libc_version == "gnu" { - return vec![ + return from_array([ create_target_str("gnu", abi), create_target_str("musl", abi), - ]; + ]); } } // Fallback to using musl - vec![create_target_str("musl", abi)] + from_array([create_target_str("musl", abi)]) } fn parse_libc_version(output: &[u8]) -> Option<&'static str> { @@ -104,16 +116,17 @@ mod linux { #[cfg(target_os = "macos")] mod macos { + use super::{from_array, ArrayVec}; use guess_host_triple::guess_host_triple; const AARCH64: &str = "aarch64-apple-darwin"; const X86: &str = "x86_64-apple-darwin"; - pub(super) fn detect_targets_macos() -> Vec> { + pub(super) fn detect_targets_macos() -> ArrayVec, 2> { if guess_host_triple() == Some(AARCH64) { - vec![AARCH64.into(), X86.into()] + from_array([AARCH64.into(), X86.into()]) } else { - vec![X86.into()] + from_array([X86.into()]) } } } From 8bf4d187eee77caa0217ebb88d532970fa6a5178 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 6 Jun 2022 22:53:12 +1000 Subject: [PATCH 0119/2020] Rename `parse_libc_version` to `parse_libc_version_from_ldd_output` Signed-off-by: Jiahao XU --- src/target.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/target.rs b/src/target.rs index da0f3794..17cbc185 100644 --- a/src/target.rs +++ b/src/target.rs @@ -56,13 +56,14 @@ mod linux { stderr, }) = Command::new("ldd").arg("--version").output().await { - let libc_version = if let Some(libc_version) = parse_libc_version(stdout) { - libc_version - } else if let Some(libc_version) = parse_libc_version(stderr) { - libc_version - } else { - return from_array([create_target_str("musl", abi)]); - }; + let libc_version = + if let Some(libc_version) = parse_libc_version_from_ldd_output(stdout) { + libc_version + } else if let Some(libc_version) = parse_libc_version(stderr) { + libc_version + } else { + return from_array([create_target_str("musl", abi)]); + }; if libc_version == "gnu" { return from_array([ @@ -76,7 +77,7 @@ mod linux { from_array([create_target_str("musl", abi)]) } - fn parse_libc_version(output: &[u8]) -> Option<&'static str> { + fn parse_libc_version_from_ldd_output(output: &[u8]) -> Option<&'static str> { let s = String::from_utf8_lossy(output); if s.contains("musl libc") { Some("musl") From cce378e2c5f0a442c0b9af04c1bd7a578b0ac6fa Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 6 Jun 2022 23:00:33 +1000 Subject: [PATCH 0120/2020] Add `get_targets_from_rustc` to `detect_targets` Signed-off-by: Jiahao XU --- src/target.rs | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/target.rs b/src/target.rs index 17cbc185..acaccf6d 100644 --- a/src/target.rs +++ b/src/target.rs @@ -1,4 +1,7 @@ use arrayvec::ArrayVec; +use std::io::{BufRead, Cursor}; +use std::process::Output; +use tokio::process::Command; /// Compiled target triple, used as default for binary fetching pub const TARGET: &str = env!("TARGET"); @@ -17,6 +20,10 @@ pub const TARGET: &str = env!("TARGET"); /// Check [this issue](https://github.com/ryankurte/cargo-binstall/issues/155) /// for more information. pub async fn detect_targets() -> ArrayVec, 2> { + if let Some(target) = get_targets_from_rustc().await { + return from_array([target]); + } + #[cfg(target_os = "linux")] { linux::detect_targets_linux().await @@ -31,6 +38,20 @@ pub async fn detect_targets() -> ArrayVec, 2> { } } +// Figure out what the host target is, from rustc or from this program's own build target +async fn get_targets_from_rustc() -> Option> { + match Command::new("rustc").arg("-vV").output().await { + Ok(Output { status, stdout, .. }) if status.success() => Cursor::new(stdout) + .lines() + .filter_map(|line| line.ok()) + .find_map(|line| { + line.strip_prefix("host: ") + .map(|host| host.to_owned().into_boxed_str()) + }), + _ => None, + } +} + fn from_array(arr: [T; LEN]) -> ArrayVec { let mut v = ArrayVec::new(); @@ -43,9 +64,7 @@ fn from_array(arr: [T; LEN]) -> ArrayVec< #[cfg(target_os = "linux")] mod linux { - use super::{from_array, ArrayVec, TARGET}; - use std::process::Output; - use tokio::process::Command; + use super::{from_array, ArrayVec, Command, Output, TARGET}; pub(super) async fn detect_targets_linux() -> ArrayVec, 2> { let abi = parse_abi(); From 6b764b0b3fe2c3ea75fa84044ea951a307522630 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 6 Jun 2022 23:07:25 +1000 Subject: [PATCH 0121/2020] Add fallbacks for `get_targets_from_rustc` Signed-off-by: Jiahao XU --- src/target.rs | 42 +++++++++++++++++++++++++++--------------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/src/target.rs b/src/target.rs index acaccf6d..66b4504c 100644 --- a/src/target.rs +++ b/src/target.rs @@ -21,20 +21,32 @@ pub const TARGET: &str = env!("TARGET"); /// for more information. pub async fn detect_targets() -> ArrayVec, 2> { if let Some(target) = get_targets_from_rustc().await { - return from_array([target]); - } + let mut v = from_array([target]); - #[cfg(target_os = "linux")] - { - linux::detect_targets_linux().await - } - #[cfg(target_os = "macos")] - { - macos::detect_targets_macos() - } - #[cfg(not(any(target_os = "linux", target_os = "macos")))] - { - vec![TARGET.into()] + #[cfg(target_os = "linux")] + if v[0].contains("gnu") { + v.push(target.replace("gnu", "musl").into_boxed_str()); + } + + #[cfg(target_os = "macos")] + if &*v[0] == macos::AARCH64 { + v.push(macos::X86.into()); + } + + v + } else { + #[cfg(target_os = "linux")] + { + linux::detect_targets_linux().await + } + #[cfg(target_os = "macos")] + { + macos::detect_targets_macos() + } + #[cfg(not(any(target_os = "linux", target_os = "macos")))] + { + vec![TARGET.into()] + } } } @@ -139,8 +151,8 @@ mod macos { use super::{from_array, ArrayVec}; use guess_host_triple::guess_host_triple; - const AARCH64: &str = "aarch64-apple-darwin"; - const X86: &str = "x86_64-apple-darwin"; + pub(super) const AARCH64: &str = "aarch64-apple-darwin"; + pub(super) const X86: &str = "x86_64-apple-darwin"; pub(super) fn detect_targets_macos() -> ArrayVec, 2> { if guess_host_triple() == Some(AARCH64) { From c9c3cffb25494ae7c161f64d766dde5ec4cf86b8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 6 Jun 2022 23:08:00 +1000 Subject: [PATCH 0122/2020] Fix `detect_targets` for win and other targets Signed-off-by: Jiahao XU --- src/target.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target.rs b/src/target.rs index 66b4504c..bfd715ba 100644 --- a/src/target.rs +++ b/src/target.rs @@ -45,7 +45,7 @@ pub async fn detect_targets() -> ArrayVec, 2> { } #[cfg(not(any(target_os = "linux", target_os = "macos")))] { - vec![TARGET.into()] + from_array([TARGET.into()]) } } } From 3f7f293b789582dfa4e00c68643538c6cafc1e18 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 6 Jun 2022 23:17:07 +1000 Subject: [PATCH 0123/2020] Fix bugs Signed-off-by: Jiahao XU --- src/target.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/target.rs b/src/target.rs index bfd715ba..6a24d98f 100644 --- a/src/target.rs +++ b/src/target.rs @@ -25,7 +25,7 @@ pub async fn detect_targets() -> ArrayVec, 2> { #[cfg(target_os = "linux")] if v[0].contains("gnu") { - v.push(target.replace("gnu", "musl").into_boxed_str()); + v.push(v[0].replace("gnu", "musl").into_boxed_str()); } #[cfg(target_os = "macos")] @@ -88,9 +88,9 @@ mod linux { }) = Command::new("ldd").arg("--version").output().await { let libc_version = - if let Some(libc_version) = parse_libc_version_from_ldd_output(stdout) { + if let Some(libc_version) = parse_libc_version_from_ldd_output(&stdout) { libc_version - } else if let Some(libc_version) = parse_libc_version(stderr) { + } else if let Some(libc_version) = parse_libc_version_from_ldd_output(&stderr) { libc_version } else { return from_array([create_target_str("musl", abi)]); From 44b1bdbfe57ef8caa795c9bc5d966305638cafe8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 6 Jun 2022 23:20:09 +1000 Subject: [PATCH 0124/2020] Fix use of `ends_with` Signed-off-by: Jiahao XU --- src/target.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/target.rs b/src/target.rs index 6a24d98f..0794546f 100644 --- a/src/target.rs +++ b/src/target.rs @@ -120,13 +120,13 @@ mod linux { } const fn parse_abi() -> &'static str { - if TARGET.endswith("abi64") { + if TARGET.ends_with("abi64") { "abi64" - } else if TARGET.endswith("eabi") { + } else if TARGET.ends_with("eabi") { "eabi" - } else if TARGET.endswith("eabihf") { + } else if TARGET.ends_with("eabihf") { "eabihf" - } else if TARGET.endswith("gnu") || TARGET.endswith("musl") { + } else if TARGET.ends_with("gnu") || TARGET.ends_with("musl") { "" } else { panic!("Unknown abi") From 1df135f4c0b1de0f755e99e01994f68ca8c95f0c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 00:20:52 +1000 Subject: [PATCH 0125/2020] Fix `target::linux::parse_abi`: Remove `const` Signed-off-by: Jiahao XU --- src/target.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target.rs b/src/target.rs index 0794546f..d4456244 100644 --- a/src/target.rs +++ b/src/target.rs @@ -119,7 +119,7 @@ mod linux { } } - const fn parse_abi() -> &'static str { + fn parse_abi() -> &'static str { if TARGET.ends_with("abi64") { "abi64" } else if TARGET.ends_with("eabi") { From 11fe943a11a2752b3fc743416777bb26f24a8a86 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 11:30:00 +1000 Subject: [PATCH 0126/2020] Fix `parse_abi` for `gnu_ilp32` and `gnuspe` Signed-off-by: Jiahao XU --- src/target.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/target.rs b/src/target.rs index d4456244..af3f02d2 100644 --- a/src/target.rs +++ b/src/target.rs @@ -120,16 +120,14 @@ mod linux { } fn parse_abi() -> &'static str { - if TARGET.ends_with("abi64") { - "abi64" - } else if TARGET.ends_with("eabi") { - "eabi" - } else if TARGET.ends_with("eabihf") { - "eabihf" - } else if TARGET.ends_with("gnu") || TARGET.ends_with("musl") { - "" + let last = TARGET.rsplit_once('-').unwrap().1; + + if let Some(libc_version) = last.strip_prefix("musl") { + libc_version + } else if let Some(libc_version) = last.strip_prefix("gnu") { + libc_version } else { - panic!("Unknown abi") + panic!("Unrecognized libc") } } From efc8119c45875c4d3cce7fd1f0b3ae79da81b1c6 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 11:45:53 +1000 Subject: [PATCH 0127/2020] Add opaque newtype `Targets` over `ArrayVec, 2>` Signed-off-by: Jiahao XU --- src/target.rs | 72 +++++++++++++++++++++++++++++++++++---------------- 1 file changed, 50 insertions(+), 22 deletions(-) diff --git a/src/target.rs b/src/target.rs index af3f02d2..6c8d9f09 100644 --- a/src/target.rs +++ b/src/target.rs @@ -1,11 +1,49 @@ use arrayvec::ArrayVec; use std::io::{BufRead, Cursor}; +use std::iter::IntoIterator; +use std::ops::Deref; use std::process::Output; use tokio::process::Command; /// Compiled target triple, used as default for binary fetching pub const TARGET: &str = env!("TARGET"); +#[derive(Debug, Clone)] +pub struct Targets(ArrayVec, 2>); + +impl Targets { + fn from_array(arr: [Box; LEN]) -> Self { + let mut v = ArrayVec::new(); + + for elem in arr { + v.push(elem); + } + + Self(v) + } + + fn push(&mut self, s: Box) { + self.0.push(s) + } +} + +impl Deref for Targets { + type Target = [Box]; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl IntoIterator for Targets { + type Item = Box; + type IntoIter = arrayvec::IntoIter, 2>; + + fn into_iter(self) -> Self::IntoIter { + self.0.into_iter() + } +} + /// Detect the targets supported at runtime, /// which might be different from `TARGET` which is detected /// at compile-time. @@ -19,9 +57,9 @@ pub const TARGET: &str = env!("TARGET"); /// /// Check [this issue](https://github.com/ryankurte/cargo-binstall/issues/155) /// for more information. -pub async fn detect_targets() -> ArrayVec, 2> { +pub async fn detect_targets() -> Targets { if let Some(target) = get_targets_from_rustc().await { - let mut v = from_array([target]); + let mut v = Targets::from_array([target]); #[cfg(target_os = "linux")] if v[0].contains("gnu") { @@ -45,7 +83,7 @@ pub async fn detect_targets() -> ArrayVec, 2> { } #[cfg(not(any(target_os = "linux", target_os = "macos")))] { - from_array([TARGET.into()]) + Targets::from_array([TARGET.into()]) } } } @@ -64,21 +102,11 @@ async fn get_targets_from_rustc() -> Option> { } } -fn from_array(arr: [T; LEN]) -> ArrayVec { - let mut v = ArrayVec::new(); - - for elem in arr { - v.push(elem); - } - - v -} - #[cfg(target_os = "linux")] mod linux { - use super::{from_array, ArrayVec, Command, Output, TARGET}; + use super::{Command, Output, Targets, TARGET}; - pub(super) async fn detect_targets_linux() -> ArrayVec, 2> { + pub(super) async fn detect_targets_linux() -> Targets { let abi = parse_abi(); if let Ok(Output { @@ -93,11 +121,11 @@ mod linux { } else if let Some(libc_version) = parse_libc_version_from_ldd_output(&stderr) { libc_version } else { - return from_array([create_target_str("musl", abi)]); + return Targets::from_array([create_target_str("musl", abi)]); }; if libc_version == "gnu" { - return from_array([ + return Targets::from_array([ create_target_str("gnu", abi), create_target_str("musl", abi), ]); @@ -105,7 +133,7 @@ mod linux { } // Fallback to using musl - from_array([create_target_str("musl", abi)]) + Targets::from_array([create_target_str("musl", abi)]) } fn parse_libc_version_from_ldd_output(output: &[u8]) -> Option<&'static str> { @@ -146,17 +174,17 @@ mod linux { #[cfg(target_os = "macos")] mod macos { - use super::{from_array, ArrayVec}; + use super::Targets; use guess_host_triple::guess_host_triple; pub(super) const AARCH64: &str = "aarch64-apple-darwin"; pub(super) const X86: &str = "x86_64-apple-darwin"; - pub(super) fn detect_targets_macos() -> ArrayVec, 2> { + pub(super) fn detect_targets_macos() -> Targets { if guess_host_triple() == Some(AARCH64) { - from_array([AARCH64.into(), X86.into()]) + Targets::from_array([AARCH64.into(), X86.into()]) } else { - from_array([X86.into()]) + Targets::from_array([X86.into()]) } } } From 7a244176b4f7abfc566a49818415fec1c1cb16f0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 11:48:19 +1000 Subject: [PATCH 0128/2020] Reorder dep in `Cargo.toml` Signed-off-by: Jiahao XU --- Cargo.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d98eadd0..b3dc9387 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,6 +19,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] +arrayvec = "0.7.2" async-trait = "0.1.52" cargo_metadata = "0.14.2" cargo_toml = "0.11.4" @@ -62,8 +63,6 @@ zip = { version = "0.6.2", default-features = false, features = [ "deflate", "bz # Enable feature zstdmt to enable multithreading in libzstd. zstd = { version = "0.10.0", features = [ "bindgen", "zstdmt" ], default-features = false } -arrayvec = "0.7.2" - [target.'cfg(target_os = "macos")'.dependencies] guess_host_triple = "0.1.3" From bd224f7186f62dc84c49898cb5d25e66a4fd9476 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 11:49:02 +1000 Subject: [PATCH 0129/2020] Use star re-export for mod `targets` Signed-off-by: Jiahao XU --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index 0a6c1437..d83d7887 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -16,7 +16,7 @@ pub mod bins; pub mod fetchers; mod target; -pub use target::{detect_targets, TARGET}; +pub use target::*; /// Default package path template (may be overridden in package Cargo.toml) pub const DEFAULT_PKG_URL: &str = From 1d71f92ee6e9d436b96cfda57b886adc4e8a6492 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 12:10:05 +1000 Subject: [PATCH 0130/2020] Impl `IntoIterator` for `&Targets` Signed-off-by: Jiahao XU --- src/target.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/target.rs b/src/target.rs index 6c8d9f09..2bd52a6e 100644 --- a/src/target.rs +++ b/src/target.rs @@ -3,6 +3,7 @@ use std::io::{BufRead, Cursor}; use std::iter::IntoIterator; use std::ops::Deref; use std::process::Output; +use std::slice; use tokio::process::Command; /// Compiled target triple, used as default for binary fetching @@ -44,6 +45,15 @@ impl IntoIterator for Targets { } } +impl<'a> IntoIterator for &'a Targets { + type Item = &'a Box; + type IntoIter = slice::Iter<'a, Box>; + + fn into_iter(self) -> Self::IntoIter { + (&self.0).into_iter() + } +} + /// Detect the targets supported at runtime, /// which might be different from `TARGET` which is detected /// at compile-time. From 95b7c4f771dfd546c8c6e5dd37631e8d196f01d0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 12:11:04 +1000 Subject: [PATCH 0131/2020] Rename `get_targets_from_rustc` to `get_target_from_rustc` Signed-off-by: Jiahao XU --- src/target.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/target.rs b/src/target.rs index 2bd52a6e..ad91ffc5 100644 --- a/src/target.rs +++ b/src/target.rs @@ -68,7 +68,7 @@ impl<'a> IntoIterator for &'a Targets { /// Check [this issue](https://github.com/ryankurte/cargo-binstall/issues/155) /// for more information. pub async fn detect_targets() -> Targets { - if let Some(target) = get_targets_from_rustc().await { + if let Some(target) = get_target_from_rustc().await { let mut v = Targets::from_array([target]); #[cfg(target_os = "linux")] @@ -99,7 +99,7 @@ pub async fn detect_targets() -> Targets { } // Figure out what the host target is, from rustc or from this program's own build target -async fn get_targets_from_rustc() -> Option> { +async fn get_target_from_rustc() -> Option> { match Command::new("rustc").arg("-vV").output().await { Ok(Output { status, stdout, .. }) if status.success() => Cursor::new(stdout) .lines() From 96336e4dd903880cd251cb9ff6689f0ef5f29458 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 12:11:49 +1000 Subject: [PATCH 0132/2020] Update doc of `get_target_from_rustc` Signed-off-by: Jiahao XU --- src/target.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/target.rs b/src/target.rs index ad91ffc5..f64175eb 100644 --- a/src/target.rs +++ b/src/target.rs @@ -98,7 +98,8 @@ pub async fn detect_targets() -> Targets { } } -// Figure out what the host target is, from rustc or from this program's own build target +/// Figure out what the host target is using `rustc`. +/// If `rustc` is absent, then it would return `None`. async fn get_target_from_rustc() -> Option> { match Command::new("rustc").arg("-vV").output().await { Ok(Output { status, stdout, .. }) if status.success() => Cursor::new(stdout) From 9ee2609b2541000b117ddef1b2a1bdeba19b1c3e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 12:14:27 +1000 Subject: [PATCH 0133/2020] Refactor `get_target_from_rustc` impl Signed-off-by: Jiahao XU --- src/target.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/target.rs b/src/target.rs index f64175eb..cb274ec3 100644 --- a/src/target.rs +++ b/src/target.rs @@ -101,16 +101,18 @@ pub async fn detect_targets() -> Targets { /// Figure out what the host target is using `rustc`. /// If `rustc` is absent, then it would return `None`. async fn get_target_from_rustc() -> Option> { - match Command::new("rustc").arg("-vV").output().await { - Ok(Output { status, stdout, .. }) if status.success() => Cursor::new(stdout) - .lines() - .filter_map(|line| line.ok()) - .find_map(|line| { - line.strip_prefix("host: ") - .map(|host| host.to_owned().into_boxed_str()) - }), - _ => None, + let Output { status, stdout, .. } = Command::new("rustc").arg("-vV").output().await.ok()?; + if !status.success() { + return None; } + + Cursor::new(stdout) + .lines() + .filter_map(|line| line.ok()) + .find_map(|line| { + line.strip_prefix("host: ") + .map(|host| host.to_owned().into_boxed_str()) + }) } #[cfg(target_os = "linux")] From ecf6fdbab58cc1549a65cb4ddb4ec6cb9993882a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 12:20:46 +1000 Subject: [PATCH 0134/2020] Revert back to using `Vec>` for targets Signed-off-by: Jiahao XU --- src/target.rs | 74 +++++++++------------------------------------------ 1 file changed, 12 insertions(+), 62 deletions(-) diff --git a/src/target.rs b/src/target.rs index cb274ec3..7f5e4f7b 100644 --- a/src/target.rs +++ b/src/target.rs @@ -1,59 +1,10 @@ -use arrayvec::ArrayVec; use std::io::{BufRead, Cursor}; -use std::iter::IntoIterator; -use std::ops::Deref; use std::process::Output; -use std::slice; use tokio::process::Command; /// Compiled target triple, used as default for binary fetching pub const TARGET: &str = env!("TARGET"); -#[derive(Debug, Clone)] -pub struct Targets(ArrayVec, 2>); - -impl Targets { - fn from_array(arr: [Box; LEN]) -> Self { - let mut v = ArrayVec::new(); - - for elem in arr { - v.push(elem); - } - - Self(v) - } - - fn push(&mut self, s: Box) { - self.0.push(s) - } -} - -impl Deref for Targets { - type Target = [Box]; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl IntoIterator for Targets { - type Item = Box; - type IntoIter = arrayvec::IntoIter, 2>; - - fn into_iter(self) -> Self::IntoIter { - self.0.into_iter() - } -} - -impl<'a> IntoIterator for &'a Targets { - type Item = &'a Box; - type IntoIter = slice::Iter<'a, Box>; - - fn into_iter(self) -> Self::IntoIter { - (&self.0).into_iter() - } -} - /// Detect the targets supported at runtime, /// which might be different from `TARGET` which is detected /// at compile-time. @@ -67,9 +18,9 @@ impl<'a> IntoIterator for &'a Targets { /// /// Check [this issue](https://github.com/ryankurte/cargo-binstall/issues/155) /// for more information. -pub async fn detect_targets() -> Targets { +pub async fn detect_targets() -> Vec> { if let Some(target) = get_target_from_rustc().await { - let mut v = Targets::from_array([target]); + let mut v = vec![target]; #[cfg(target_os = "linux")] if v[0].contains("gnu") { @@ -93,7 +44,7 @@ pub async fn detect_targets() -> Targets { } #[cfg(not(any(target_os = "linux", target_os = "macos")))] { - Targets::from_array([TARGET.into()]) + vec![TARGET.into()] } } } @@ -117,9 +68,9 @@ async fn get_target_from_rustc() -> Option> { #[cfg(target_os = "linux")] mod linux { - use super::{Command, Output, Targets, TARGET}; + use super::{Command, Output, TARGET}; - pub(super) async fn detect_targets_linux() -> Targets { + pub(super) async fn detect_targets_linux() -> Vec> { let abi = parse_abi(); if let Ok(Output { @@ -134,19 +85,19 @@ mod linux { } else if let Some(libc_version) = parse_libc_version_from_ldd_output(&stderr) { libc_version } else { - return Targets::from_array([create_target_str("musl", abi)]); + return vec![create_target_str("musl", abi)]; }; if libc_version == "gnu" { - return Targets::from_array([ + return vec![ create_target_str("gnu", abi), create_target_str("musl", abi), - ]); + ]; } } // Fallback to using musl - Targets::from_array([create_target_str("musl", abi)]) + vec![create_target_str("musl", abi)] } fn parse_libc_version_from_ldd_output(output: &[u8]) -> Option<&'static str> { @@ -187,17 +138,16 @@ mod linux { #[cfg(target_os = "macos")] mod macos { - use super::Targets; use guess_host_triple::guess_host_triple; pub(super) const AARCH64: &str = "aarch64-apple-darwin"; pub(super) const X86: &str = "x86_64-apple-darwin"; - pub(super) fn detect_targets_macos() -> Targets { + pub(super) fn detect_targets_macos() -> Vec> { if guess_host_triple() == Some(AARCH64) { - Targets::from_array([AARCH64.into(), X86.into()]) + vec![AARCH64.into(), X86.into()] } else { - Targets::from_array([X86.into()]) + vec![X86.into()] } } } From 9c818e0e9553ad1964e2465a991ce1ff324b035c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 12:21:03 +1000 Subject: [PATCH 0135/2020] Remove dep `arrayvec` Signed-off-by: Jiahao XU --- Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index b3dc9387..9532caf5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,6 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -arrayvec = "0.7.2" async-trait = "0.1.52" cargo_metadata = "0.14.2" cargo_toml = "0.11.4" From 0819b653089b4640b619b38fb2fb91fbb49bf671 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 12:21:50 +1000 Subject: [PATCH 0136/2020] Update `Cargo.lock` Signed-off-by: Jiahao XU --- Cargo.lock | 7 ------- 1 file changed, 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3bfbedd2..429675c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,12 +26,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - [[package]] name = "async-trait" version = "0.1.53" @@ -147,7 +141,6 @@ dependencies = [ name = "cargo-binstall" version = "0.8.0" dependencies = [ - "arrayvec", "async-trait", "cargo_metadata", "cargo_toml", From 603955b84833ea20236f57c38755e68468da2002 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 15:11:04 +1000 Subject: [PATCH 0137/2020] Support for checking multi-targets Signed-off-by: Jiahao XU --- src/main.rs | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/main.rs b/src/main.rs index a9479a2d..8cdf4e72 100644 --- a/src/main.rs +++ b/src/main.rs @@ -217,18 +217,24 @@ async fn entry() -> Result<()> { .join(format!("pkg-{}.{}", opts.name, meta.pkg_fmt)); debug!("Using temporary download path: {}", pkg_path.display()); - let fetcher_data = Data { - name: package.name.clone(), - target: opts.target.clone(), - version: package.version.clone(), - repo: package.repository.clone(), - meta: meta.clone(), - }; + let fetcher_data: Vec<_> = detect_targets() + .await + .into_iter() + .map(|target| Data { + name: package.name.clone(), + target: target.into(), + version: package.version.clone(), + repo: package.repository.clone(), + meta: meta.clone(), + }) + .collect(); // Try github releases, then quickinstall let mut fetchers = MultiFetcher::default(); - fetchers.add(GhCrateMeta::new(&fetcher_data).await); - fetchers.add(QuickInstall::new(&fetcher_data).await); + for data in &fetcher_data { + fetchers.add(GhCrateMeta::new(data).await); + fetchers.add(QuickInstall::new(data).await); + } match fetchers.first_available().await { Some(fetcher) => { From 31b7439a69a2ff550e060e2e2c1a5ce7f57d516e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 15:16:10 +1000 Subject: [PATCH 0138/2020] Mod trait `Fetcher::new` to return `Arc` Signed-off-by: Jiahao XU --- src/fetchers.rs | 7 ++++--- src/fetchers/gh_crate_meta.rs | 5 +++-- src/fetchers/quickinstall.rs | 5 +++-- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/fetchers.rs b/src/fetchers.rs index b7b25795..77daaf68 100644 --- a/src/fetchers.rs +++ b/src/fetchers.rs @@ -1,4 +1,5 @@ use std::path::Path; +use std::sync::Arc; pub use gh_crate_meta::*; pub use log::debug; @@ -12,7 +13,7 @@ mod quickinstall; #[async_trait::async_trait] pub trait Fetcher { /// Create a new fetcher from some data - async fn new(data: &Data) -> Box + async fn new(data: &Data) -> Arc where Self: Sized; @@ -44,11 +45,11 @@ pub struct Data { #[derive(Default)] pub struct MultiFetcher { - fetchers: Vec>, + fetchers: Vec>, } impl MultiFetcher { - pub fn add(&mut self, fetcher: Box) { + pub fn add(&mut self, fetcher: Arc) { self.fetchers.push(fetcher); } diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index f048bb87..12bb22ab 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -1,4 +1,5 @@ use std::path::Path; +use std::sync::Arc; use log::{debug, info, warn}; use reqwest::Method; @@ -22,8 +23,8 @@ impl GhCrateMeta { #[async_trait::async_trait] impl super::Fetcher for GhCrateMeta { - async fn new(data: &Data) -> Box { - Box::new(Self { data: data.clone() }) + async fn new(data: &Data) -> Arc { + Arc::new(Self { data: data.clone() }) } async fn check(&self) -> Result { diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index 61871e5c..96487851 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -1,4 +1,5 @@ use std::path::Path; +use std::sync::Arc; use log::info; use reqwest::Method; @@ -17,11 +18,11 @@ pub struct QuickInstall { #[async_trait::async_trait] impl super::Fetcher for QuickInstall { - async fn new(data: &Data) -> Box { + async fn new(data: &Data) -> Arc { let crate_name = &data.name; let version = &data.version; let target = &data.target; - Box::new(Self { + Arc::new(Self { package: format!("{crate_name}-{version}-{target}"), }) } From d373ad5145ed72bac402b9f71987856739414c9a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 15:28:48 +1000 Subject: [PATCH 0139/2020] Require `Send` and `Sync` for trait `Fetcher` Signed-off-by: Jiahao XU --- src/fetchers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fetchers.rs b/src/fetchers.rs index 77daaf68..08b43d1e 100644 --- a/src/fetchers.rs +++ b/src/fetchers.rs @@ -11,7 +11,7 @@ mod gh_crate_meta; mod quickinstall; #[async_trait::async_trait] -pub trait Fetcher { +pub trait Fetcher: Send + Sync { /// Create a new fetcher from some data async fn new(data: &Data) -> Arc where From c393270899f90eb2862d2293fc577f09bc0feb7c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 15:29:09 +1000 Subject: [PATCH 0140/2020] Run fetchers in parallel in `MultiFetcher.first_available` Signed-off-by: Jiahao XU --- src/fetchers.rs | 56 ++++++++++++++++++++++++++++++++++++++----------- src/main.rs | 2 +- 2 files changed, 45 insertions(+), 13 deletions(-) diff --git a/src/fetchers.rs b/src/fetchers.rs index 08b43d1e..a7384985 100644 --- a/src/fetchers.rs +++ b/src/fetchers.rs @@ -4,6 +4,7 @@ use std::sync::Arc; pub use gh_crate_meta::*; pub use log::debug; pub use quickinstall::*; +use tokio::task::JoinHandle; use crate::{BinstallError, PkgFmt, PkgMeta}; @@ -53,22 +54,53 @@ impl MultiFetcher { self.fetchers.push(fetcher); } - pub async fn first_available(&self) -> Option<&dyn Fetcher> { - for fetcher in &self.fetchers { - let available = fetcher.check().await.unwrap_or_else(|err| { - debug!( - "Error while checking fetcher {}: {}", - fetcher.source_name(), - err - ); - false - }); + pub async fn first_available(&self) -> Option> { + let handles: Vec<_> = self + .fetchers + .iter() + .cloned() + .map(|fetcher| { + let fetcher_cloned = fetcher.clone(); - if available { - return Some(&**fetcher); + ( + AutoAbortJoinHandle(tokio::spawn(async move { + fetcher.check().await.unwrap_or_else(|err| { + debug!( + "Error while checking fetcher {}: {}", + fetcher.source_name(), + err + ); + false + }) + })), + fetcher_cloned, + ) + }) + .collect(); + + for (mut handle, fetcher) in handles { + match (&mut handle.0).await { + Ok(true) => return Some(fetcher), + Err(join_err) => { + debug!( + "Error while checking fetcher {}: {}", + fetcher.source_name(), + join_err + ); + } + _ => (), } } None } } + +#[derive(Debug)] +struct AutoAbortJoinHandle(JoinHandle); + +impl Drop for AutoAbortJoinHandle { + fn drop(&mut self) { + self.0.abort(); + } +} diff --git a/src/main.rs b/src/main.rs index a9479a2d..5c913dc5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -234,7 +234,7 @@ async fn entry() -> Result<()> { Some(fetcher) => { install_from_package( binaries, - fetcher, + &*fetcher, install_path, meta, opts, From 3d6679fd7d8fe801ec23e47400f51db648139b64 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 15:35:21 +1000 Subject: [PATCH 0141/2020] Refactor `MultiFetcher.first_available` Signed-off-by: Jiahao XU --- src/fetchers.rs | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/fetchers.rs b/src/fetchers.rs index a7384985..b532d1e3 100644 --- a/src/fetchers.rs +++ b/src/fetchers.rs @@ -63,16 +63,7 @@ impl MultiFetcher { let fetcher_cloned = fetcher.clone(); ( - AutoAbortJoinHandle(tokio::spawn(async move { - fetcher.check().await.unwrap_or_else(|err| { - debug!( - "Error while checking fetcher {}: {}", - fetcher.source_name(), - err - ); - false - }) - })), + AutoAbortJoinHandle(tokio::spawn(async move { fetcher.check().await })), fetcher_cloned, ) }) @@ -80,7 +71,15 @@ impl MultiFetcher { for (mut handle, fetcher) in handles { match (&mut handle.0).await { - Ok(true) => return Some(fetcher), + Ok(Ok(true)) => return Some(fetcher), + Ok(Ok(false)) => (), + Ok(Err(err)) => { + debug!( + "Error while checking fetcher {}: {}", + fetcher.source_name(), + err + ); + } Err(join_err) => { debug!( "Error while checking fetcher {}: {}", @@ -88,7 +87,6 @@ impl MultiFetcher { join_err ); } - _ => (), } } @@ -97,7 +95,7 @@ impl MultiFetcher { } #[derive(Debug)] -struct AutoAbortJoinHandle(JoinHandle); +struct AutoAbortJoinHandle(JoinHandle>); impl Drop for AutoAbortJoinHandle { fn drop(&mut self) { From b2a533dbdbf2c7aaf8f56b4c6ec05672d33f5530 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 15:40:55 +1000 Subject: [PATCH 0142/2020] Optimize `GhCrateMeta::check`: Avoid converting url to str Only to convert it back to `Url` in `helpers::remote_exists` Signed-off-by: Jiahao XU --- src/fetchers/gh_crate_meta.rs | 2 +- src/fetchers/quickinstall.rs | 2 +- src/helpers.rs | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index f048bb87..d55109a6 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -36,7 +36,7 @@ impl super::Fetcher for GhCrateMeta { } info!("Checking for package at: '{url}'"); - remote_exists(url.as_str(), Method::HEAD).await + remote_exists(url, Method::HEAD).await } async fn fetch(&self, dst: &Path) -> Result<(), BinstallError> { diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index 61871e5c..4611e5f5 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -30,7 +30,7 @@ impl super::Fetcher for QuickInstall { let url = self.package_url(); self.report().await?; info!("Checking for package at: '{url}'"); - remote_exists(&url, Method::HEAD).await + remote_exists(Url::parse(&url)?, Method::HEAD).await } async fn fetch(&self, dst: &Path) -> Result<(), BinstallError> { diff --git a/src/helpers.rs b/src/helpers.rs index e0d85b99..9471eb4f 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -32,8 +32,7 @@ pub fn load_manifest_path>( Ok(manifest) } -pub async fn remote_exists(url: &str, method: Method) -> Result { - let url = Url::parse(url)?; +pub async fn remote_exists(url: Url, method: Method) -> Result { let req = reqwest::Client::new() .request(method.clone(), url.clone()) .send() From b6245bcf4be9e78fe04a784667faa679961fff6e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 16:13:38 +1000 Subject: [PATCH 0143/2020] Spawn `entry()` in `main` to improve parallelism Using `rt.block_on`, the future returned by `entry` can only be run on the main thread. Buf if we use `tokio::spawn`, then it can be run on any thread. Signed-off-by: Jiahao XU --- src/main.rs | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5c913dc5..87f63063 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,7 @@ use miette::{miette, IntoDiagnostic, Result, WrapErr}; use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; use structopt::StructOpt; use tempfile::TempDir; -use tokio::{process::Command, runtime::Runtime}; +use tokio::{process::Command, runtime::Runtime, task::JoinError}; use cargo_binstall::{ bins, @@ -84,6 +84,7 @@ enum MainExit { Success(Duration), Error(BinstallError), Report(miette::Report), + JoinErr(JoinError), } impl Termination for MainExit { @@ -99,6 +100,11 @@ impl Termination for MainExit { eprintln!("{err:?}"); ExitCode::from(16) } + Self::JoinErr(err) => { + error!("Fatal error:"); + eprintln!("{err:?}"); + ExitCode::from(16) + } } } } @@ -107,19 +113,22 @@ fn main() -> MainExit { let start = Instant::now(); let rt = Runtime::new().unwrap(); - let result = rt.block_on(entry()); + let handle = rt.spawn(entry()); + let result = rt.block_on(handle); drop(rt); let done = start.elapsed(); debug!("run time: {done:?}"); result - .map(|_| MainExit::Success(done)) - .unwrap_or_else(|err| { - err.downcast::() - .map(MainExit::Error) - .unwrap_or_else(MainExit::Report) + .map(|res| { + res.map(|_| MainExit::Success(done)).unwrap_or_else(|err| { + err.downcast::() + .map(MainExit::Error) + .unwrap_or_else(MainExit::Report) + }) }) + .unwrap_or_else(MainExit::JoinErr) } async fn entry() -> Result<()> { From 903c9f559171ecd5fe07f36a59da325c2a270066 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 16:19:07 +1000 Subject: [PATCH 0144/2020] Refactor: Use `Result::map_or_else` in `main` Signed-off-by: Jiahao XU --- src/main.rs | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 87f63063..5d578545 100644 --- a/src/main.rs +++ b/src/main.rs @@ -120,15 +120,13 @@ fn main() -> MainExit { let done = start.elapsed(); debug!("run time: {done:?}"); - result - .map(|res| { - res.map(|_| MainExit::Success(done)).unwrap_or_else(|err| { - err.downcast::() - .map(MainExit::Error) - .unwrap_or_else(MainExit::Report) - }) + result.map_or_else(MainExit::JoinErr, |res| { + res.map(|_| MainExit::Success(done)).unwrap_or_else(|err| { + err.downcast::() + .map(MainExit::Error) + .unwrap_or_else(MainExit::Report) }) - .unwrap_or_else(MainExit::JoinErr) + }) } async fn entry() -> Result<()> { From 456e8964833f31bd62a15cd3e98afb6d5e8cc2b9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 16:22:01 +1000 Subject: [PATCH 0145/2020] Use code 17 for `MainExit::JoinErr` Signed-off-by: Jiahao XU --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 5d578545..0a6a10e3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -103,7 +103,7 @@ impl Termination for MainExit { Self::JoinErr(err) => { error!("Fatal error:"); eprintln!("{err:?}"); - ExitCode::from(16) + ExitCode::from(17) } } } From 3f2e03893a5159057764087ad15881113c98b519 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 16:35:47 +1000 Subject: [PATCH 0146/2020] Add `Fetcher::target` to trait `Fetcher` Signed-off-by: Jiahao XU --- src/fetchers.rs | 3 +++ src/fetchers/gh_crate_meta.rs | 4 ++++ src/fetchers/quickinstall.rs | 8 +++++++- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/fetchers.rs b/src/fetchers.rs index b7b25795..9b6df316 100644 --- a/src/fetchers.rs +++ b/src/fetchers.rs @@ -30,6 +30,9 @@ pub trait Fetcher { /// Should return true if the remote is from a third-party source fn is_third_party(&self) -> bool; + + /// Return the target for this fetcher + fn target(&self) -> &str; } /// Data required to fetch a package diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index f048bb87..1c096189 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -66,6 +66,10 @@ impl super::Fetcher for GhCrateMeta { fn is_third_party(&self) -> bool { false } + + fn target(&self) -> &str { + &self.data.target + } } /// Template for constructing download paths diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index 61871e5c..1d500647 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -13,6 +13,7 @@ const USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VE pub struct QuickInstall { package: String, + target: String, } #[async_trait::async_trait] @@ -20,9 +21,10 @@ impl super::Fetcher for QuickInstall { async fn new(data: &Data) -> Box { let crate_name = &data.name; let version = &data.version; - let target = &data.target; + let target = data.target.clone(); Box::new(Self { package: format!("{crate_name}-{version}-{target}"), + target, }) } @@ -50,6 +52,10 @@ impl super::Fetcher for QuickInstall { fn is_third_party(&self) -> bool { true } + + fn target(&self) -> &str { + &self.target + } } impl QuickInstall { From ad3e707aa36f4d8f9e05af199f299d400ebd5242 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 16:37:04 +1000 Subject: [PATCH 0147/2020] Fix `install_from_package`: Rm use of `opts.target` Signed-off-by: Jiahao XU --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 8cdf4e72..e282004a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -341,7 +341,7 @@ async fn install_from_package( // based on those found via Cargo.toml let bin_data = bins::Data { name: package.name.clone(), - target: opts.target.clone(), + target: fetcher.target().to_string(), version: package.version.clone(), repo: package.repository.clone(), meta, From 2ea341381dfbea346a7b4735cd1ee16721d30452 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Jun 2022 17:07:17 +1000 Subject: [PATCH 0148/2020] Fix parsing in `entry`: Use `std::env::args_os` Signed-off-by: Jiahao XU --- src/main.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 0a6a10e3..e8ca8554 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ use std::{ + ffi::OsString, path::PathBuf, process::{ExitCode, Termination}, str::FromStr, @@ -133,7 +134,7 @@ async fn entry() -> Result<()> { // Filter extraneous arg when invoked by cargo // `cargo run -- --help` gives ["target/debug/cargo-binstall", "--help"] // `cargo binstall --help` gives ["/home/ryan/.cargo/bin/cargo-binstall", "binstall", "--help"] - let mut args: Vec = std::env::args().collect(); + let mut args: Vec = std::env::args_os().collect(); if args.len() > 1 && args[1] == "binstall" { args.remove(1); } From d58ce3892a43f72313f306d90cad6d3d98d0dd5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Thu, 2 Jun 2022 22:25:13 +1200 Subject: [PATCH 0149/2020] Use clap3 --- Cargo.lock | 92 ++++++++++++++++++++++++++++++----------------------- Cargo.toml | 2 +- src/main.rs | 33 +++++++++---------- 3 files changed, 70 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8c985cad..11499219 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -69,7 +69,7 @@ dependencies = [ "bitflags", "cexpr", "clang-sys", - "clap", + "clap 2.34.0", "env_logger", "lazy_static", "lazycell", @@ -144,6 +144,7 @@ dependencies = [ "async-trait", "cargo_metadata", "cargo_toml", + "clap 3.1.18", "crates_io_api", "dirs", "env_logger", @@ -155,7 +156,6 @@ dependencies = [ "semver", "serde", "simplelog", - "structopt", "strum", "strum_macros", "tar", @@ -257,12 +257,51 @@ dependencies = [ "ansi_term", "atty", "bitflags", - "strsim", + "strsim 0.8.0", "textwrap 0.11.0", "unicode-width", "vec_map", ] +[[package]] +name = "clap" +version = "3.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2dbdf4bdacb33466e854ce889eee8dfd5729abf7ccd7664d0a2d60cd384440b" +dependencies = [ + "atty", + "bitflags", + "clap_derive", + "clap_lex", + "indexmap", + "lazy_static", + "strsim 0.10.0", + "termcolor", + "textwrap 0.15.0", +] + +[[package]] +name = "clap_derive" +version = "3.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25320346e922cffe59c0bbc5410c8d8784509efb321488971081313cb1e1a33c" +dependencies = [ + "heck", + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "clap_lex" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a37c35f1112dad5e6e0b1adaff798507497a18fceeb30cceb3bae7d1427b9213" +dependencies = [ + "os_str_bytes", +] + [[package]] name = "cmake" version = "0.1.48" @@ -568,15 +607,6 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -[[package]] -name = "heck" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] - [[package]] name = "heck" version = "0.4.0" @@ -922,6 +952,12 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" +[[package]] +name = "os_str_bytes" +version = "6.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afa" + [[package]] name = "owo-colors" version = "3.4.0" @@ -1261,28 +1297,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] -name = "structopt" -version = "0.3.26" +name = "strsim" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c6b5c64445ba8094a6ab0c3cd2ad323e07171012d9c98b0b15651daf1787a10" -dependencies = [ - "clap", - "lazy_static", - "structopt-derive", -] - -[[package]] -name = "structopt-derive" -version = "0.4.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcb5ae327f9cc13b68763b5749770cb9e048a99bd9dfdfa58d0cf05d5f64afe0" -dependencies = [ - "heck 0.3.3", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strum" @@ -1296,7 +1314,7 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6878079b17446e4d3eba6192bb0a2950d5b14f0ed8424b852310e5a94345d0ef" dependencies = [ - "heck 0.4.0", + "heck", "proc-macro2", "quote", "rustversion", @@ -1595,12 +1613,6 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-segmentation" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8820f5d777f6224dc4be3632222971ac30164d4a258d595640799554ebfd99" - [[package]] name = "unicode-width" version = "0.1.9" diff --git a/Cargo.toml b/Cargo.toml index 1a4cfe4d..9f1f5f1f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,6 +22,7 @@ pkg-fmt = "zip" async-trait = "0.1.56" cargo_metadata = "0.14.2" cargo_toml = "0.11.4" +clap = { version = "3.1.18", features = ["derive"] } crates_io_api = { version = "0.8.0", default-features = false, features = ["rustls"] } dirs = "4.0.0" flate2 = { version = "1.0.24", features = ["zlib-ng"], default-features = false } @@ -31,7 +32,6 @@ reqwest = { version = "0.11.10", features = [ "rustls-tls" ], default-features = semver = "1.0.7" serde = { version = "1.0.136", features = [ "derive" ] } simplelog = "0.12.0" -structopt = "0.3.26" strum = "0.24.0" strum_macros = "0.24.0" tar = "0.4.38" diff --git a/src/main.rs b/src/main.rs index 3d04fd3d..f4ebbcc8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,10 +7,10 @@ use std::{ }; use cargo_toml::{Package, Product}; +use clap::Parser; use log::{debug, error, info, warn, LevelFilter}; use miette::{miette, IntoDiagnostic, Result, WrapErr}; use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; -use structopt::StructOpt; use tempfile::TempDir; use tokio::{process::Command, runtime::Runtime, task::JoinError}; @@ -20,64 +20,65 @@ use cargo_binstall::{ *, }; -#[derive(Debug, StructOpt)] +#[derive(Debug, Parser)] +#[clap(version, about = "Install a Rust binary... from binaries!")] struct Options { /// Package name or URL for installation /// This must be either a crates.io package name or github or gitlab url - #[structopt()] + #[clap(value_name = "crate")] name: String, /// Filter for package version to install, in Cargo.toml format. /// Use `=1.2.3` to install a specific version. - #[structopt(long, default_value = "*")] + #[clap(long, default_value = "*")] version: String, /// Override binary target, ignoring compiled version - #[structopt(long, default_value = TARGET)] + #[clap(help_heading = "OVERRIDES", long, default_value = TARGET)] target: String, /// Override install path for downloaded binary. /// Defaults to `$HOME/.cargo/bin` - #[structopt(long)] + #[clap(help_heading = "OVERRIDES", long)] install_path: Option, /// Disable symlinking / versioned updates - #[structopt(long)] + #[clap(long)] no_symlinks: bool, /// Dry run, fetch and show changes without installing binaries - #[structopt(long)] + #[clap(long)] dry_run: bool, /// Disable interactive mode / confirmation - #[structopt(long)] + #[clap(long)] no_confirm: bool, /// Do not cleanup temporary files on success - #[structopt(long)] + #[clap(long)] no_cleanup: bool, /// Override manifest source. /// This skips searching crates.io for a manifest and uses /// the specified path directly, useful for debugging and /// when adding `binstall` support. - #[structopt(long)] + #[clap(help_heading = "OVERRIDES", long)] manifest_path: Option, /// Utility log level - #[structopt(long, default_value = "info")] + #[clap(long, default_value = "info")] log_level: LevelFilter, /// Override Cargo.toml package manifest bin-dir. - #[structopt(long)] + #[clap(help_heading = "OVERRIDES", long)] bin_dir: Option, /// Override Cargo.toml package manifest pkg-fmt. - #[structopt(long)] + #[clap(help_heading = "OVERRIDES", long)] pkg_fmt: Option, /// Override Cargo.toml package manifest pkg-url. - #[structopt(long)] + #[clap(help_heading = "OVERRIDES", long)] pkg_url: Option, } @@ -140,7 +141,7 @@ async fn entry() -> Result<()> { } // Load options - let mut opts = Options::from_iter(args.iter()); + let mut opts = Options::parse_from(args.iter()); let cli_overrides = PkgOverride { pkg_url: opts.pkg_url.take(), pkg_fmt: opts.pkg_fmt.take(), From f2582b9cf205a811d490d89985aca81cc33b5ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 8 Jun 2022 00:11:39 +1200 Subject: [PATCH 0150/2020] Expand help text --- src/main.rs | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/src/main.rs b/src/main.rs index f4ebbcc8..0bb49476 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,49 +23,62 @@ use cargo_binstall::{ #[derive(Debug, Parser)] #[clap(version, about = "Install a Rust binary... from binaries!")] struct Options { - /// Package name or URL for installation - /// This must be either a crates.io package name or github or gitlab url + /// Package name or URL for installation. + /// + /// This must be either a crates.io package name or github or gitlab URL. #[clap(value_name = "crate")] name: String, - /// Filter for package version to install, in Cargo.toml format. - /// Use `=1.2.3` to install a specific version. + /// Semver filter to select the package version to install. + /// + /// This is in Cargo.toml dependencies format: `--version 1.2.3` is equivalent to + /// `--version "^1.2.3"`. Use `=1.2.3` to install a specific version. #[clap(long, default_value = "*")] version: String, - /// Override binary target, ignoring compiled version - #[clap(help_heading = "OVERRIDES", long, default_value = TARGET)] - target: String, + /// Override binary target set. Defaults to a set of targets based on the current platform. + #[clap(help_heading = "OVERRIDES", long)] + target: Option, /// Override install path for downloaded binary. + /// /// Defaults to `$HOME/.cargo/bin` #[clap(help_heading = "OVERRIDES", long)] install_path: Option, - /// Disable symlinking / versioned updates + /// Disable symlinking / versioned updates. + /// + /// By default, Binstall will install a binary named `-` in the install path, and + /// either symlink or copy it to (depending on platform) the plain binary name. This makes it + /// possible to have multiple versions of the same binary, for example for testing or rollback. + /// + /// Pass this flag to disable this behavior. #[clap(long)] no_symlinks: bool, - /// Dry run, fetch and show changes without installing binaries + /// Dry run, fetch and show changes without installing binaries. #[clap(long)] dry_run: bool, - /// Disable interactive mode / confirmation + /// Disable interactive mode / confirmation prompts. #[clap(long)] no_confirm: bool, - /// Do not cleanup temporary files on success + /// Do not cleanup temporary files. #[clap(long)] no_cleanup: bool, /// Override manifest source. - /// This skips searching crates.io for a manifest and uses - /// the specified path directly, useful for debugging and - /// when adding `binstall` support. + /// + /// This skips searching crates.io for a manifest and uses the specified path directly, useful + /// for debugging and when adding Binstall support. This must be the path to the folder + /// containing a Cargo.toml file, not the Cargo.toml file itself. #[clap(help_heading = "OVERRIDES", long)] manifest_path: Option, /// Utility log level + /// + /// Set to `debug` when submitting a bug report. #[clap(long, default_value = "info")] log_level: LevelFilter, From 15d828b55bec95e5047d0d33fcf773e0e3d6753d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 8 Jun 2022 00:54:30 +1200 Subject: [PATCH 0151/2020] Stop lying about url support --- src/main.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0bb49476..93ed76f0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -23,14 +23,14 @@ use cargo_binstall::{ #[derive(Debug, Parser)] #[clap(version, about = "Install a Rust binary... from binaries!")] struct Options { - /// Package name or URL for installation. - /// - /// This must be either a crates.io package name or github or gitlab URL. + /// Package name for installation. + /// + /// This must be a crates.io package name. #[clap(value_name = "crate")] name: String, /// Semver filter to select the package version to install. - /// + /// /// This is in Cargo.toml dependencies format: `--version 1.2.3` is equivalent to /// `--version "^1.2.3"`. Use `=1.2.3` to install a specific version. #[clap(long, default_value = "*")] @@ -41,17 +41,17 @@ struct Options { target: Option, /// Override install path for downloaded binary. - /// + /// /// Defaults to `$HOME/.cargo/bin` #[clap(help_heading = "OVERRIDES", long)] install_path: Option, /// Disable symlinking / versioned updates. - /// + /// /// By default, Binstall will install a binary named `-` in the install path, and /// either symlink or copy it to (depending on platform) the plain binary name. This makes it /// possible to have multiple versions of the same binary, for example for testing or rollback. - /// + /// /// Pass this flag to disable this behavior. #[clap(long)] no_symlinks: bool, @@ -69,7 +69,7 @@ struct Options { no_cleanup: bool, /// Override manifest source. - /// + /// /// This skips searching crates.io for a manifest and uses the specified path directly, useful /// for debugging and when adding Binstall support. This must be the path to the folder /// containing a Cargo.toml file, not the Cargo.toml file itself. @@ -77,7 +77,7 @@ struct Options { manifest_path: Option, /// Utility log level - /// + /// /// Set to `debug` when submitting a bug report. #[clap(long, default_value = "info")] log_level: LevelFilter, From fcf5728ddeeb471a89da201de3194ed822c0522b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 8 Jun 2022 00:54:49 +1200 Subject: [PATCH 0152/2020] Replace Box with String --- src/target.rs | 30 ++++++++++++------------------ 1 file changed, 12 insertions(+), 18 deletions(-) diff --git a/src/target.rs b/src/target.rs index 7f5e4f7b..43b26ccb 100644 --- a/src/target.rs +++ b/src/target.rs @@ -18,13 +18,13 @@ pub const TARGET: &str = env!("TARGET"); /// /// Check [this issue](https://github.com/ryankurte/cargo-binstall/issues/155) /// for more information. -pub async fn detect_targets() -> Vec> { +pub async fn detect_targets() -> Vec { if let Some(target) = get_target_from_rustc().await { let mut v = vec![target]; #[cfg(target_os = "linux")] if v[0].contains("gnu") { - v.push(v[0].replace("gnu", "musl").into_boxed_str()); + v.push(v[0].replace("gnu", "musl")); } #[cfg(target_os = "macos")] @@ -51,7 +51,7 @@ pub async fn detect_targets() -> Vec> { /// Figure out what the host target is using `rustc`. /// If `rustc` is absent, then it would return `None`. -async fn get_target_from_rustc() -> Option> { +async fn get_target_from_rustc() -> Option { let Output { status, stdout, .. } = Command::new("rustc").arg("-vV").output().await.ok()?; if !status.success() { return None; @@ -60,17 +60,14 @@ async fn get_target_from_rustc() -> Option> { Cursor::new(stdout) .lines() .filter_map(|line| line.ok()) - .find_map(|line| { - line.strip_prefix("host: ") - .map(|host| host.to_owned().into_boxed_str()) - }) + .find_map(|line| line.strip_prefix("host: ").map(|host| host.to_owned())) } #[cfg(target_os = "linux")] mod linux { use super::{Command, Output, TARGET}; - pub(super) async fn detect_targets_linux() -> Vec> { + pub(super) async fn detect_targets_linux() -> Vec { let abi = parse_abi(); if let Ok(Output { @@ -123,16 +120,13 @@ mod linux { } } - fn create_target_str(libc_version: &str, abi: &str) -> Box { - let prefix = TARGET.rsplit_once('-').unwrap().0; + fn create_target_str(libc_version: &str, abi: &str) -> String { + let prefix = TARGET + .rsplit_once('-') + .map(|s| format!("{}-", s.0)) + .unwrap_or_default(); - let mut target = String::with_capacity(prefix.len() + 1 + libc_version.len() + abi.len()); - target.push_str(prefix); - target.push('-'); - target.push_str(libc_version); - target.push_str(abi); - - target.into_boxed_str() + format!("{prefix}{libc_version}{abi}") } } @@ -143,7 +137,7 @@ mod macos { pub(super) const AARCH64: &str = "aarch64-apple-darwin"; pub(super) const X86: &str = "x86_64-apple-darwin"; - pub(super) fn detect_targets_macos() -> Vec> { + pub(super) fn detect_targets_macos() -> Vec { if guess_host_triple() == Some(AARCH64) { vec![AARCH64.into(), X86.into()] } else { From 235bcac300b8608c79f0e04aa7668ac242f0e601 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 8 Jun 2022 00:56:18 +1200 Subject: [PATCH 0153/2020] Properly support multiple targets --- src/main.rs | 134 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 90 insertions(+), 44 deletions(-) diff --git a/src/main.rs b/src/main.rs index 93ed76f0..d6ccab0c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -37,8 +37,23 @@ struct Options { version: String, /// Override binary target set. Defaults to a set of targets based on the current platform. - #[clap(help_heading = "OVERRIDES", long)] - target: Option, + /// + /// Binstall is able to look for binaries for several targets, installing the first one it finds + /// in the order the targets were given. For example, on a 64-bit glibc Linux distribution, the + /// default is to look first for a `x86_64-unknown-linux-gnu` binary, then for a + /// `x86_64-unknown-linux-musl` binary. However, on a musl system, the gnu version will not be + /// considered. + /// + /// This option takes a comma-separated list of target triples, which will be tried in order. + /// + /// If falling back to installing from source, the first target will be used. + #[clap( + help_heading = "OVERRIDES", + alias = "target", + long, + value_name = "triple" + )] + targets: Option, /// Override install path for downloaded binary. /// @@ -154,7 +169,7 @@ async fn entry() -> Result<()> { } // Load options - let mut opts = Options::parse_from(args.iter()); + let mut opts = Options::parse_from(args); let cli_overrides = PkgOverride { pkg_url: opts.pkg_url.take(), pkg_fmt: opts.pkg_fmt.take(), @@ -174,6 +189,13 @@ async fn entry() -> Result<()> { ) .unwrap(); + // Compute install directory + let install_path = get_install_path(opts.install_path.as_deref()).ok_or_else(|| { + error!("No viable install path found of specified, try `--install-path`"); + miette!("No install path found or specified") + })?; + debug!("Using install path: {}", install_path.display()); + // Create a temporary directory for downloads etc. let temp_dir = TempDir::new() .map_err(BinstallError::from) @@ -218,51 +240,68 @@ async fn entry() -> Result<()> { manifest.bin, ); - // Merge any overrides - if let Some(o) = meta.overrides.remove(&opts.target) { - meta.merge(&o); - } + let desired_targets = { + let from_opts = opts + .targets + .as_ref() + .map(|ts| ts.split(',').map(|t| t.to_string()).collect()); - meta.merge(&cli_overrides); - debug!("Found metadata: {:?}", meta); + if let Some(ts) = from_opts { + ts + } else { + detect_targets().await + } + }; - // Compute install directory - let install_path = get_install_path(opts.install_path.as_deref()).ok_or_else(|| { - error!("No viable install path found of specified, try `--install-path`"); - miette!("No install path found or specified") - })?; - debug!("Using install path: {}", install_path.display()); + let mut fetchers = MultiFetcher::default(); - // Compute temporary directory for downloads - let pkg_path = temp_dir - .path() - .join(format!("pkg-{}.{}", opts.name, meta.pkg_fmt)); - debug!("Using temporary download path: {}", pkg_path.display()); + for target in &desired_targets { + debug!("Building metadata for target: {target}"); + let mut target_meta = meta.clone(); - let fetcher_data: Vec<_> = detect_targets() - .await - .into_iter() - .map(|target| Data { + // Merge any overrides + if let Some(o) = target_meta.overrides.get(target).cloned() { + target_meta.merge(&o); + } + + target_meta.merge(&cli_overrides); + debug!("Found metadata: {target_meta:?}"); + + let fetcher_data = Data { name: package.name.clone(), - target: target.into(), + target: target.clone(), version: package.version.clone(), repo: package.repository.clone(), - meta: meta.clone(), - }) - .collect(); + meta: target_meta, + }; - // Try github releases, then quickinstall - let mut fetchers = MultiFetcher::default(); - for data in &fetcher_data { - fetchers.add(GhCrateMeta::new(data).await); - fetchers.add(QuickInstall::new(data).await); + fetchers.add(GhCrateMeta::new(&fetcher_data).await); + fetchers.add(QuickInstall::new(&fetcher_data).await); } match fetchers.first_available().await { Some(fetcher) => { + // Build final metadata + let fetcher_target = fetcher.target(); + if let Some(o) = meta.overrides.get(&fetcher_target.to_owned()).cloned() { + meta.merge(&o); + } + meta.merge(&cli_overrides); + + debug!( + "Found a binary install source: {} ({fetcher_target})", + fetcher.source_name() + ); + + // Compute temporary directory for downloads + let pkg_path = temp_dir + .path() + .join(format!("pkg-{}.{}", opts.name, meta.pkg_fmt)); + debug!("Using temporary download path: {}", pkg_path.display()); + install_from_package( binaries, - &*fetcher, + fetcher.as_ref(), install_path, meta, opts, @@ -273,10 +312,17 @@ async fn entry() -> Result<()> { .await } None => { - temp_dir.close().unwrap_or_else(|err| { - warn!("Failed to clean up some resources: {err}"); - }); - install_from_source(opts, package).await + if !opts.no_cleanup { + temp_dir.close().unwrap_or_else(|err| { + warn!("Failed to clean up some resources: {err}"); + }); + } + + let target = desired_targets + .first() + .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; + + install_from_source(opts, package, target).await } } } @@ -421,7 +467,7 @@ async fn install_from_package( Ok(()) } -async fn install_from_source(opts: Options, package: Package) -> Result<()> { +async fn install_from_source(opts: Options, package: Package, target: &str) -> Result<()> { // Prompt user for source install warn!("The package will be installed from source (with cargo)",); if !opts.no_confirm && !opts.dry_run { @@ -430,14 +476,14 @@ async fn install_from_source(opts: Options, package: Package) -> Result<() if opts.dry_run { info!( - "Dry-run: running `cargo install {} --version {} --target {}`", - package.name, package.version, opts.target + "Dry-run: running `cargo install {} --version {} --target {target}`", + package.name, package.version ); Ok(()) } else { debug!( - "Running `cargo install {} --version {} --target {}`", - package.name, package.version, opts.target + "Running `cargo install {} --version {} --target {target}`", + package.name, package.version ); let mut child = Command::new("cargo") .arg("install") @@ -445,7 +491,7 @@ async fn install_from_source(opts: Options, package: Package) -> Result<() .arg("--version") .arg(package.version) .arg("--target") - .arg(opts.target) + .arg(target) .spawn() .into_diagnostic() .wrap_err("Spawning cargo install failed.")?; From 0abfcbd1fbd5df329fdfd9bc5fbde1a3378f0327 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 8 Jun 2022 01:04:46 +1200 Subject: [PATCH 0154/2020] Simplify short help output --- src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index d6ccab0c..564a9c65 100644 --- a/src/main.rs +++ b/src/main.rs @@ -36,7 +36,7 @@ struct Options { #[clap(long, default_value = "*")] version: String, - /// Override binary target set. Defaults to a set of targets based on the current platform. + /// Override binary target set. /// /// Binstall is able to look for binaries for several targets, installing the first one it finds /// in the order the targets were given. For example, on a 64-bit glibc Linux distribution, the @@ -45,13 +45,14 @@ struct Options { /// considered. /// /// This option takes a comma-separated list of target triples, which will be tried in order. + /// They override the default list, which is detected automatically from the current platform. /// /// If falling back to installing from source, the first target will be used. #[clap( help_heading = "OVERRIDES", alias = "target", long, - value_name = "triple" + value_name = "TRIPLE" )] targets: Option, @@ -94,7 +95,7 @@ struct Options { /// Utility log level /// /// Set to `debug` when submitting a bug report. - #[clap(long, default_value = "info")] + #[clap(long, default_value = "info", value_name = "LEVEL")] log_level: LevelFilter, /// Override Cargo.toml package manifest bin-dir. From d0a292e1736fcb94a6690962ea290b42ada42dfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 8 Jun 2022 01:22:46 +1200 Subject: [PATCH 0155/2020] Ignore rustls log output --- src/main.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main.rs b/src/main.rs index 564a9c65..256ff987 100644 --- a/src/main.rs +++ b/src/main.rs @@ -181,6 +181,7 @@ async fn entry() -> Result<()> { let mut log_config = ConfigBuilder::new(); log_config.add_filter_ignore("hyper".to_string()); log_config.add_filter_ignore("reqwest".to_string()); + log_config.add_filter_ignore("rustls".to_string()); log_config.set_location_level(LevelFilter::Off); TermLogger::init( opts.log_level, From 148d34e98021d9525dc833ab462c7b652398f54b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 8 Jun 2022 01:26:06 +1200 Subject: [PATCH 0156/2020] Log exact URL for qi report --- src/fetchers/quickinstall.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index e433194c..8f131c0d 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -1,7 +1,7 @@ use std::path::Path; use std::sync::Arc; -use log::info; +use log::{debug, info}; use reqwest::Method; use url::Url; @@ -77,8 +77,9 @@ impl QuickInstall { } pub async fn report(&self) -> Result<(), BinstallError> { - info!("Sending installation report to quickinstall (anonymous)"); let url = Url::parse(&self.stats_url())?; + debug!("Sending installation report to quickinstall ({url})"); + reqwest::Client::builder() .user_agent(USER_AGENT) .build()? From ea10736e134b59aa35fc116a735f12f0b671f088 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 8 Jun 2022 01:28:00 +1200 Subject: [PATCH 0157/2020] Don't send qi reports in dev --- src/fetchers/quickinstall.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index 8f131c0d..ec83493c 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -77,6 +77,11 @@ impl QuickInstall { } pub async fn report(&self) -> Result<(), BinstallError> { + if cfg!(debug_assertions) { + debug!("Not sending quickinstall report in debug mode"); + return Ok(()); + } + let url = Url::parse(&self.stats_url())?; debug!("Sending installation report to quickinstall ({url})"); From fa56a729b0140dc62d04c2bd6362a325ceeca2a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 8 Jun 2022 01:42:25 +1200 Subject: [PATCH 0158/2020] Just unwrap it --- src/target.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/target.rs b/src/target.rs index 43b26ccb..bdb44080 100644 --- a/src/target.rs +++ b/src/target.rs @@ -123,8 +123,8 @@ mod linux { fn create_target_str(libc_version: &str, abi: &str) -> String { let prefix = TARGET .rsplit_once('-') - .map(|s| format!("{}-", s.0)) - .unwrap_or_default(); + .expect("unwrap: TARGET always has a -") + .0; format!("{prefix}{libc_version}{abi}") } From 0b5d3ec1a60acb05d4ea312796d3b55def97e142 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Wed, 8 Jun 2022 01:44:11 +1200 Subject: [PATCH 0159/2020] Fix format now Co-authored-by: Jiahao XU --- src/target.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target.rs b/src/target.rs index bdb44080..ac6b6be9 100644 --- a/src/target.rs +++ b/src/target.rs @@ -126,7 +126,7 @@ mod linux { .expect("unwrap: TARGET always has a -") .0; - format!("{prefix}{libc_version}{abi}") + format!("{prefix}-{libc_version}{abi}") } } From bd562924a2b23c41e375c4c9a1f09a53dd7faa58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 1 Jun 2022 01:54:00 +1200 Subject: [PATCH 0160/2020] Switch to edition 2021 --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 9f1f5f1f..4ae17a5c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,7 +5,7 @@ repository = "https://github.com/ryankurte/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" version = "0.8.0" authors = ["ryan "] -edition = "2018" +edition = "2021" license = "GPL-3.0" From 6333fb0bd36635d331a7e9ccab0fa6f15f40c14e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 1 Jun 2022 02:02:30 +1200 Subject: [PATCH 0161/2020] Use newer format! syntax --- src/drivers.rs | 6 +++--- src/helpers.rs | 48 +++++++++++++----------------------------------- src/main.rs | 8 ++++---- 3 files changed, 20 insertions(+), 42 deletions(-) diff --git a/src/drivers.rs b/src/drivers.rs index 1ca2ed3f..49b615c1 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -98,9 +98,9 @@ pub async fn fetch_crate_cratesio( // Download crate to temporary dir (crates.io or git?) let crate_url = format!("https://crates.io/{}", version.dl_path); - let tgz_path = temp_dir.join(format!("{}.tgz", name)); + let tgz_path = temp_dir.join(format!("{name}.tgz")); - debug!("Fetching crate from: {}", crate_url); + debug!("Fetching crate from: {crate_url}"); // Download crate download(&crate_url, &tgz_path).await?; @@ -108,7 +108,7 @@ pub async fn fetch_crate_cratesio( // Decompress downloaded tgz debug!("Decompressing crate archive"); extract(&tgz_path, PkgFmt::Tgz, &temp_dir)?; - let crate_path = temp_dir.join(format!("{}-{}", name, version_name)); + let crate_path = temp_dir.join(format!("{name}-{version_name}")); // Return crate directory Ok(crate_path) diff --git a/src/helpers.rs b/src/helpers.rs index 9471eb4f..27b22551 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -4,10 +4,9 @@ use std::{ path::{Path, PathBuf}, }; -use log::{debug, info}; - use cargo_toml::Manifest; use flate2::read::GzDecoder; +use log::{debug, info}; use reqwest::Method; use serde::Serialize; use tar::Archive; @@ -44,7 +43,7 @@ pub async fn remote_exists(url: Url, method: Method) -> Result>(url: &str, path: P) -> Result<(), BinstallError> { let url = Url::parse(url)?; - debug!("Downloading from: '{}'", url); + debug!("Downloading from: '{url}'"); let resp = reqwest::get(url.clone()) .await @@ -72,14 +71,13 @@ pub fn extract, P: AsRef>( fmt: PkgFmt, path: P, ) -> Result<(), BinstallError> { + let source = source.as_ref(); + let path = path.as_ref(); + match fmt { PkgFmt::Tar => { // Extract to install dir - debug!( - "Extracting from tar archive '{:?}' to `{:?}`", - source.as_ref(), - path.as_ref() - ); + debug!("Extracting from tar archive '{source:?}' to `{path:?}`"); let dat = fs::File::open(source)?; let mut tar = Archive::new(dat); @@ -88,11 +86,7 @@ pub fn extract, P: AsRef>( } PkgFmt::Tgz => { // Extract to install dir - debug!( - "Decompressing from tgz archive '{:?}' to `{:?}`", - source.as_ref(), - path.as_ref() - ); + debug!("Decompressing from tgz archive '{source:?}' to `{path:?}`"); let dat = fs::File::open(source)?; let tar = GzDecoder::new(dat); @@ -102,11 +96,7 @@ pub fn extract, P: AsRef>( } PkgFmt::Txz => { // Extract to install dir - debug!( - "Decompressing from txz archive '{:?}' to `{:?}`", - source.as_ref(), - path.as_ref() - ); + debug!("Decompressing from txz archive '{source:?}' to `{path:?}`"); let dat = fs::File::open(source)?; let tar = XzDecoder::new(dat); @@ -116,11 +106,7 @@ pub fn extract, P: AsRef>( } PkgFmt::Tzstd => { // Extract to install dir - debug!( - "Decompressing from tzstd archive '{:?}' to `{:?}`", - source.as_ref(), - path.as_ref() - ); + debug!("Decompressing from tzstd archive '{source:?}' to `{path:?}`"); let dat = std::fs::File::open(source)?; @@ -135,11 +121,7 @@ pub fn extract, P: AsRef>( } PkgFmt::Zip => { // Extract to install dir - debug!( - "Decompressing from zip archive '{:?}' to `{:?}`", - source.as_ref(), - path.as_ref() - ); + debug!("Decompressing from zip archive '{source:?}' to `{path:?}`"); let dat = fs::File::open(source)?; let mut zip = ZipArchive::new(dat)?; @@ -147,11 +129,7 @@ pub fn extract, P: AsRef>( zip.extract(path)?; } PkgFmt::Bin => { - debug!( - "Copying binary '{:?}' to `{:?}`", - source.as_ref(), - path.as_ref() - ); + debug!("Copying binary '{source:?}' to `{path:?}`"); // Copy to install dir fs::copy(source, path)?; } @@ -170,12 +148,12 @@ pub fn get_install_path>(install_path: Option

) -> Option, target: &str info!("Cargo finished successfully"); Ok(()) } else { - error!("Cargo errored! {:?}", status); + error!("Cargo errored! {status:?}"); Err(miette!("Cargo install error")) } } From d59fd60e8a4b85d2696e301c66fe3965fc729daf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 1 Jun 2022 02:07:18 +1200 Subject: [PATCH 0162/2020] Set MSRV Not as policy, just because we use 1.61.0 features --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 4ae17a5c..27f51f45 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,11 +4,11 @@ description = "Rust binary package installer for CI integration" repository = "https://github.com/ryankurte/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" version = "0.8.0" +rust-version = "1.61.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0" - [package.metadata.binstall] pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ format }" bin-dir = "{ bin }{ format }" From aad708a0357f9ddc69496d083ad321ea73a4ce3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 8 Jun 2022 16:43:18 +1200 Subject: [PATCH 0163/2020] Slightly more ergo clone by ordering --- src/fetchers.rs | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/fetchers.rs b/src/fetchers.rs index 24fbf502..2e7b6d02 100644 --- a/src/fetchers.rs +++ b/src/fetchers.rs @@ -62,17 +62,13 @@ impl MultiFetcher { .fetchers .iter() .cloned() - .map(|fetcher| { - let fetcher_cloned = fetcher.clone(); - - ( - AutoAbortJoinHandle(tokio::spawn(async move { fetcher.check().await })), - fetcher_cloned, - ) - }) + .map(|fetcher| ( + fetcher.clone(), + AutoAbortJoinHandle(tokio::spawn(async move { fetcher.check().await })), + )) .collect(); - for (mut handle, fetcher) in handles { + for (fetcher, mut handle) in handles { match (&mut handle.0).await { Ok(Ok(true)) => return Some(fetcher), Ok(Ok(false)) => (), From b4df4d0de30c9a7dda2e246df1e6e6475cc4029e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 8 Jun 2022 16:54:42 +1200 Subject: [PATCH 0164/2020] Update deps --- Cargo.lock | 42 +++++++++++++++--------------------------- Cargo.toml | 6 +----- 2 files changed, 16 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 11499219..503bb80c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -91,9 +91,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bumpalo" -version = "3.9.1" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" +checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" [[package]] name = "byteorder" @@ -624,9 +624,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8670570af52249509a86f5e3e18a08c60b177071826898fde8997cf5f6bfbb" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", @@ -814,9 +814,9 @@ dependencies = [ [[package]] name = "lzma-sys" -version = "0.1.17" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb4b7c3eddad11d3af9e86c487607d2d2442d185d848575365c4856ba96d619" +checksum = "e06754c4acf47d49c727d5665ca9fb828851cda315ed3bd51edd148ef78a8772" dependencies = [ "cc", "libc", @@ -1489,9 +1489,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.19.1" +version = "1.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95eec79ea28c00a365f539f1961e9278fbcaf81c0ff6aaf0e93c181352446948" +checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" dependencies = [ "bytes", "libc", @@ -1518,9 +1518,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f988a1a1adc2fb21f9c12aa96441da33a1728193ae0b95d2be22dbd17fcb4e5c" +checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" dependencies = [ "bytes", "futures-core", @@ -1553,28 +1553,16 @@ checksum = "5d0ecdcb44a79f0fe9844f0c4f33a342cbcbb5117de8001e6ba0dc2351327d09" dependencies = [ "cfg-if", "pin-project-lite", - "tracing-attributes", "tracing-core", ] -[[package]] -name = "tracing-attributes" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6b8ad3567499f98a1db7a752b07a7c8c7c7c34c332ec00effb2b0027974b7c" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "tracing-core" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f54c8ca710e81886d498c2fd3331b56c93aa248d49de2222ad2742247c60072f" +checksum = "7709595b8878a4965ce5e87ebf880a7d39c9afc6837721b21a5a816a8117d921" dependencies = [ - "lazy_static", + "once_cell", ] [[package]] @@ -1871,9 +1859,9 @@ dependencies = [ [[package]] name = "xz2" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c179869f34fc7c01830d3ce7ea2086bc3a07e0d35289b667d0a8bf910258926c" +checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" dependencies = [ "lzma-sys", ] diff --git a/Cargo.toml b/Cargo.toml index 27f51f45..51c3e6d3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,16 +38,12 @@ tar = "0.4.38" tempfile = "3.3.0" thiserror = "1.0.31" tinytemplate = "1.2.1" - -# This crate uses features rt-multi-thread and macros in `#[tokio::main]` and -# uses feature process to create process. tokio = { version = "1.19.1", features = [ "rt-multi-thread", "process" ], default-features = false } - url = "2.2.2" xz2 = "0.1.6" # Disable all features of zip except for features of compression algorithms: -# Disable features include: +# Disabled features include: # - aes-crypto: Enables decryption of files which were encrypted with AES, absolutely zero use for # this crate. # - time: Enables features using the [time](https://github.com/time-rs/time) crate, From fdbf186561b40a954651e6a1ac4ee21384c522ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 8 Jun 2022 17:14:07 +1200 Subject: [PATCH 0165/2020] (cargo-release) version 0.9.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 503bb80c..985b18fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -139,7 +139,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.8.0" +version = "0.9.0" dependencies = [ "async-trait", "cargo_metadata", diff --git a/Cargo.toml b/Cargo.toml index 51c3e6d3..b6c5aa3a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/ryankurte/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.8.0" +version = "0.9.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From 43d5a6bdb196de7abfeaf0da52fce49f2bc23cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 8 Jun 2022 17:17:00 +1200 Subject: [PATCH 0166/2020] (cargo-release) version 0.9.1 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 985b18fc..c4fe15c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -139,7 +139,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.9.0" +version = "0.9.1" dependencies = [ "async-trait", "cargo_metadata", diff --git a/Cargo.toml b/Cargo.toml index b6c5aa3a..7f015855 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/ryankurte/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.9.0" +version = "0.9.1" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From cf87abba16f69fc1dc9003d461e53a0826ac7736 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 19:13:10 +1000 Subject: [PATCH 0167/2020] Run QuickInstall reporting using `tokio::spawn` So that it is run in concurrent or even in parallel with the `remote_exists`. Signed-off-by: Jiahao XU --- src/fetchers/quickinstall.rs | 46 ++++++++++++++++++++---------------- 1 file changed, 26 insertions(+), 20 deletions(-) diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index ec83493c..e8ca052f 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -3,6 +3,7 @@ use std::sync::Arc; use log::{debug, info}; use reqwest::Method; +use tokio::task::JoinHandle; use url::Url; use super::Data; @@ -31,7 +32,7 @@ impl super::Fetcher for QuickInstall { async fn check(&self) -> Result { let url = self.package_url(); - self.report().await?; + self.report(); info!("Checking for package at: '{url}'"); remote_exists(Url::parse(&url)?, Method::HEAD).await } @@ -76,26 +77,31 @@ impl QuickInstall { ) } - pub async fn report(&self) -> Result<(), BinstallError> { - if cfg!(debug_assertions) { - debug!("Not sending quickinstall report in debug mode"); - return Ok(()); - } + pub fn report(&self) -> JoinHandle> { + let stats_url = self.stats_url(); - let url = Url::parse(&self.stats_url())?; - debug!("Sending installation report to quickinstall ({url})"); + tokio::spawn(async move { + if cfg!(debug_assertions) { + debug!("Not sending quickinstall report in debug mode"); + return Ok(()); + } - reqwest::Client::builder() - .user_agent(USER_AGENT) - .build()? - .request(Method::HEAD, url.clone()) - .send() - .await - .map_err(|err| BinstallError::Http { - method: Method::HEAD, - url, - err, - })?; - Ok(()) + let url = Url::parse(&stats_url)?; + debug!("Sending installation report to quickinstall ({url})"); + + reqwest::Client::builder() + .user_agent(USER_AGENT) + .build()? + .request(Method::HEAD, url.clone()) + .send() + .await + .map_err(|err| BinstallError::Http { + method: Method::HEAD, + url, + err, + })?; + + Ok(()) + }) } } From dab790deaf37479289fd491944313876137bc3e1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 19:33:56 +1000 Subject: [PATCH 0168/2020] Enable feature "stream" of dep reqwest Signed-off-by: Jiahao XU --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 7f015855..3f953a96 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,7 @@ dirs = "4.0.0" flate2 = { version = "1.0.24", features = ["zlib-ng"], default-features = false } log = "0.4.14" miette = { version = "4.7.1", features = ["fancy-no-backtrace"] } -reqwest = { version = "0.11.10", features = [ "rustls-tls" ], default-features = false } +reqwest = { version = "0.11.10", features = [ "rustls-tls", "stream" ], default-features = false } semver = "1.0.7" serde = { version = "1.0.136", features = [ "derive" ] } simplelog = "0.12.0" From 3b889130138197ce2fc5aa00f05b70d46d5e690d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 19:37:52 +1000 Subject: [PATCH 0169/2020] Add new dep futures-util v0.3.21 without default feature Signed-off-by: Jiahao XU --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 3f953a96..188267e1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,6 +26,7 @@ clap = { version = "3.1.18", features = ["derive"] } crates_io_api = { version = "0.8.0", default-features = false, features = ["rustls"] } dirs = "4.0.0" flate2 = { version = "1.0.24", features = ["zlib-ng"], default-features = false } +futures-util = { version = "0.3.21", default-features = false } log = "0.4.14" miette = { version = "4.7.1", features = ["fancy-no-backtrace"] } reqwest = { version = "0.11.10", features = [ "rustls-tls", "stream" ], default-features = false } From 2e25360e8221c21c01a446dac826f08e4e319c6c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 19:38:26 +1000 Subject: [PATCH 0170/2020] Enable feature "sync" of dep tokio Signed-off-by: Jiahao XU --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 188267e1..c64e0b41 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,7 @@ tar = "0.4.38" tempfile = "3.3.0" thiserror = "1.0.31" tinytemplate = "1.2.1" -tokio = { version = "1.19.1", features = [ "rt-multi-thread", "process" ], default-features = false } +tokio = { version = "1.19.1", features = [ "rt-multi-thread", "process", "sync" ], default-features = false } url = "2.2.2" xz2 = "0.1.6" From 6988264e99758c201a382afe341dd326ef2d24f4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 19:38:45 +1000 Subject: [PATCH 0171/2020] Update `Cargo.lock` Signed-off-by: Jiahao XU --- Cargo.lock | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index c4fe15c3..837f4ac3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -149,6 +149,7 @@ dependencies = [ "dirs", "env_logger", "flate2", + "futures-util", "guess_host_triple", "log", "miette", @@ -597,7 +598,7 @@ dependencies = [ "indexmap", "slab", "tokio", - "tokio-util", + "tokio-util 0.7.3", "tracing", ] @@ -1112,6 +1113,7 @@ dependencies = [ "serde_urlencoded", "tokio", "tokio-rustls", + "tokio-util 0.6.10", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -1516,6 +1518,20 @@ dependencies = [ "webpki", ] +[[package]] +name = "tokio-util" +version = "0.6.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "log", + "pin-project-lite", + "tokio", +] + [[package]] name = "tokio-util" version = "0.7.3" From 33e61f544a3c8ba347ad6c9a8f6b515fd3c9955c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 19:43:41 +1000 Subject: [PATCH 0172/2020] Add new dep bytes v1.1.0 Signed-off-by: Jiahao XU --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index c64e0b41..94d772b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,6 +20,7 @@ pkg-fmt = "zip" [dependencies] async-trait = "0.1.56" +bytes = "1.1.0" cargo_metadata = "0.14.2" cargo_toml = "0.11.4" clap = { version = "3.1.18", features = ["derive"] } From 570febdaadbc8807e353f3eda620d54522270991 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 19:43:56 +1000 Subject: [PATCH 0173/2020] Update `Cargo.lock` Signed-off-by: Jiahao XU --- Cargo.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.lock b/Cargo.lock index 837f4ac3..b4295f60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -142,6 +142,7 @@ name = "cargo-binstall" version = "0.9.1" dependencies = [ "async-trait", + "bytes", "cargo_metadata", "cargo_toml", "clap 3.1.18", From 5fdeea86ad45477d7470a23520b96e02b4b6c679 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 20:03:58 +1000 Subject: [PATCH 0174/2020] Impl `helpers::AsyncFileWriter` Signed-off-by: Jiahao XU --- src/helpers.rs | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 49 insertions(+), 1 deletion(-) diff --git a/src/helpers.rs b/src/helpers.rs index 27b22551..55e7a8df 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,9 +1,10 @@ use std::{ fs, - io::{stderr, stdin, Write}, + io::{self, stderr, stdin, Write}, path::{Path, PathBuf}, }; +use bytes::Bytes; use cargo_toml::Manifest; use flate2::read::GzDecoder; use log::{debug, info}; @@ -11,6 +12,7 @@ use reqwest::Method; use serde::Serialize; use tar::Archive; use tinytemplate::TinyTemplate; +use tokio::{sync::mpsc, task}; use url::Url; use xz2::read::XzDecoder; use zip::read::ZipArchive; @@ -210,3 +212,49 @@ pub trait Template: Serialize { Ok(tt.render("path", self)?) } } + +#[derive(Debug)] +pub struct AsyncFileWriter { + handle: task::JoinHandle>, + tx: mpsc::Sender, +} + +impl AsyncFileWriter { + pub fn new(path: &Path) -> io::Result { + fs::create_dir_all(path.parent().unwrap())?; + + let mut file = fs::File::create(path)?; + let (tx, mut rx) = mpsc::channel::(100); + + let handle = task::spawn_blocking(move || { + while let Some(bytes) = rx.blocking_recv() { + file.write_all(&*bytes)?; + } + + rx.close(); + file.flush()?; + + Ok(()) + }); + + Ok(Self { handle, tx }) + } + + pub async fn write(&self, bytes: Bytes) { + self.tx + .send(bytes) + .await + .expect("Implementation bug: rx is closed before tx is dropped") + } + + pub async fn done(self) -> io::Result<()> { + // Drop tx as soon as possible so that the task would wrap up what it + // was doing and flush out all the pending data. + drop(self.tx); + + match self.handle.await { + Ok(res) => res, + Err(join_err) => Err(io::Error::new(io::ErrorKind::Other, join_err)), + } + } +} From 191fd6e981f83f6f3358c9089f2df4887ccfa04d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 20:11:01 +1000 Subject: [PATCH 0175/2020] Use `AsyncFileWriter` in `helpers::download` so that writing to file will not block the download. Signed-off-by: Jiahao XU --- src/helpers.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 55e7a8df..e37cf89e 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -7,6 +7,7 @@ use std::{ use bytes::Bytes; use cargo_toml::Manifest; use flate2::read::GzDecoder; +use futures_util::stream::StreamExt; use log::{debug, info}; use reqwest::Method; use serde::Serialize; @@ -56,13 +57,19 @@ pub async fn download>(url: &str, path: P) -> Result<(), Binstall err, })?; - let bytes = resp.bytes().await?; - let path = path.as_ref(); - debug!("Download OK, writing to file: '{}'", path.display()); + debug!("Downloading to file: '{}'", path.display()); - fs::create_dir_all(path.parent().unwrap())?; - fs::write(&path, bytes)?; + let mut bytes_stream = resp.bytes_stream(); + let writer = AsyncFileWriter::new(path)?; + + while let Some(res) = bytes_stream.next().await { + writer.write(res?).await; + } + + writer.done().await?; + + debug!("Download OK, written to file: '{}'", path.display()); Ok(()) } From ba21372134d8f9e8582afc6c78dc19a98e883f1b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 20:12:37 +1000 Subject: [PATCH 0176/2020] Add new dep scopeguard v1.1.0 Signed-off-by: Jiahao XU --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 94d772b0..7cdbcc48 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,7 @@ futures-util = { version = "0.3.21", default-features = false } log = "0.4.14" miette = { version = "4.7.1", features = ["fancy-no-backtrace"] } reqwest = { version = "0.11.10", features = [ "rustls-tls", "stream" ], default-features = false } +scopeguard = "1.1.0" semver = "1.0.7" serde = { version = "1.0.136", features = [ "derive" ] } simplelog = "0.12.0" From 80706dc3c4849a1b50811327191e8245f60d8254 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 20:12:53 +1000 Subject: [PATCH 0177/2020] Update `Cargo.lock` Signed-off-by: Jiahao XU --- Cargo.lock | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index b4295f60..21877876 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -155,6 +155,7 @@ dependencies = [ "log", "miette", "reqwest", + "scopeguard", "semver", "serde", "simplelog", @@ -1177,6 +1178,12 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" + [[package]] name = "sct" version = "0.7.0" From c7965ceb4f01681814307ef72936eb00135de7e1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 20:23:03 +1000 Subject: [PATCH 0178/2020] Use `ScopeGuard` to auto remove file on failure Signed-off-by: Jiahao XU --- src/helpers.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/helpers.rs b/src/helpers.rs index e37cf89e..e735c2d0 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -10,6 +10,7 @@ use flate2::read::GzDecoder; use futures_util::stream::StreamExt; use log::{debug, info}; use reqwest::Method; +use scopeguard::ScopeGuard; use serde::Serialize; use tar::Archive; use tinytemplate::TinyTemplate; @@ -63,11 +64,17 @@ pub async fn download>(url: &str, path: P) -> Result<(), Binstall let mut bytes_stream = resp.bytes_stream(); let writer = AsyncFileWriter::new(path)?; + let guard = scopeguard::guard(path, |path| { + fs::remove_file(path).ok(); + }); + while let Some(res) = bytes_stream.next().await { writer.write(res?).await; } writer.done().await?; + // Disarm as it is successfully downloaded and written to file. + ScopeGuard::into_inner(guard); debug!("Download OK, written to file: '{}'", path.display()); From 24d3a2af2b424c728c249de63fc8f7143838e631 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 20:39:39 +1000 Subject: [PATCH 0179/2020] Enable feature "macros" on dep tokio Signed-off-by: Jiahao XU --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 7cdbcc48..bd76fd13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,7 @@ tar = "0.4.38" tempfile = "3.3.0" thiserror = "1.0.31" tinytemplate = "1.2.1" -tokio = { version = "1.19.1", features = [ "rt-multi-thread", "process", "sync" ], default-features = false } +tokio = { version = "1.19.1", features = [ "rt-multi-thread", "process", "sync", "macros" ], default-features = false } url = "2.2.2" xz2 = "0.1.6" From 90186f0b1560648584327fbe9304508ce84910cb Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 20:40:02 +1000 Subject: [PATCH 0180/2020] Update `Cargo.lock` Signed-off-by: Jiahao XU --- Cargo.lock | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 21877876..e6e26b1a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1512,9 +1512,21 @@ dependencies = [ "pin-project-lite", "signal-hook-registry", "socket2", + "tokio-macros", "winapi", ] +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tokio-rustls" version = "0.23.4" From 6367bfc1e3860d3a195e9866823f6f30881953fa Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 20:42:22 +1000 Subject: [PATCH 0181/2020] Fix infinite block in `AsyncFileWriter::write` Signed-off-by: Jiahao XU --- src/helpers.rs | 46 +++++++++++++++++++++++++++++++++++++--------- 1 file changed, 37 insertions(+), 9 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index e735c2d0..ae7a432d 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -62,14 +62,14 @@ pub async fn download>(url: &str, path: P) -> Result<(), Binstall debug!("Downloading to file: '{}'", path.display()); let mut bytes_stream = resp.bytes_stream(); - let writer = AsyncFileWriter::new(path)?; + let mut writer = AsyncFileWriter::new(path)?; let guard = scopeguard::guard(path, |path| { fs::remove_file(path).ok(); }); while let Some(res) = bytes_stream.next().await { - writer.write(res?).await; + writer.write(res?).await?; } writer.done().await?; @@ -254,19 +254,47 @@ impl AsyncFileWriter { Ok(Self { handle, tx }) } - pub async fn write(&self, bytes: Bytes) { - self.tx - .send(bytes) - .await - .expect("Implementation bug: rx is closed before tx is dropped") + /// Upon error, this writer shall not be reused. + /// Otherwise, `Self::done` would panic. + pub async fn write(&mut self, bytes: Bytes) -> io::Result<()> { + let send_future = async { + self.tx + .send(bytes) + .await + .expect("Implementation bug: rx is closed before tx is dropped") + }; + tokio::pin!(send_future); + + let task_future = async { + Self::wait(&mut self.handle).await.map(|_| { + panic!("Implementation bug: write task finished before all writes are done") + }) + }; + tokio::pin!(task_future); + + // Use select to run them in parallel, so that if the send blocks + // the current future and the task failed with some error, the future + // returned by this function would not block forever. + tokio::select! { + // It isn't completely safe to cancel the send_future as it would + // cause us to lose our place in the queue, but if the send_future + // is cancelled, it means that the task has failed and the mpsc + // won't matter anyway. + _ = send_future => Ok(()), + res = task_future => res, + } } - pub async fn done(self) -> io::Result<()> { + pub async fn done(mut self) -> io::Result<()> { // Drop tx as soon as possible so that the task would wrap up what it // was doing and flush out all the pending data. drop(self.tx); - match self.handle.await { + Self::wait(&mut self.handle).await + } + + async fn wait(handle: &mut task::JoinHandle>) -> io::Result<()> { + match handle.await { Ok(res) => res, Err(join_err) => Err(io::Error::new(io::ErrorKind::Other, join_err)), } From 12931fc0242f09ff34dd9f97a14507e2122c8bc3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 20:44:20 +1000 Subject: [PATCH 0182/2020] Refactor: Mv `AutoAbortJoinHandle` into `helpers` Signed-off-by: Jiahao XU --- src/fetchers.rs | 22 +++++++--------------- src/helpers.rs | 9 +++++++++ 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/fetchers.rs b/src/fetchers.rs index 2e7b6d02..69905c8a 100644 --- a/src/fetchers.rs +++ b/src/fetchers.rs @@ -4,9 +4,8 @@ use std::sync::Arc; pub use gh_crate_meta::*; pub use log::debug; pub use quickinstall::*; -use tokio::task::JoinHandle; -use crate::{BinstallError, PkgFmt, PkgMeta}; +use crate::{AutoAbortJoinHandle, BinstallError, PkgFmt, PkgMeta}; mod gh_crate_meta; mod quickinstall; @@ -62,10 +61,12 @@ impl MultiFetcher { .fetchers .iter() .cloned() - .map(|fetcher| ( - fetcher.clone(), - AutoAbortJoinHandle(tokio::spawn(async move { fetcher.check().await })), - )) + .map(|fetcher| { + ( + fetcher.clone(), + AutoAbortJoinHandle(tokio::spawn(async move { fetcher.check().await })), + ) + }) .collect(); for (fetcher, mut handle) in handles { @@ -92,12 +93,3 @@ impl MultiFetcher { None } } - -#[derive(Debug)] -struct AutoAbortJoinHandle(JoinHandle>); - -impl Drop for AutoAbortJoinHandle { - fn drop(&mut self) { - self.0.abort(); - } -} diff --git a/src/helpers.rs b/src/helpers.rs index ae7a432d..869bfedc 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -300,3 +300,12 @@ impl AsyncFileWriter { } } } + +#[derive(Debug)] +pub struct AutoAbortJoinHandle(pub task::JoinHandle); + +impl Drop for AutoAbortJoinHandle { + fn drop(&mut self) { + self.0.abort(); + } +} From d6a372a1605b68d2c692b3560c999f11f7589447 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 20:46:00 +1000 Subject: [PATCH 0183/2020] Use `AutoAbortJoinHandle` in `AsyncFileWriter` to cancel the task on failure. Signed-off-by: Jiahao XU --- src/helpers.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 869bfedc..736cb74a 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -229,7 +229,9 @@ pub trait Template: Serialize { #[derive(Debug)] pub struct AsyncFileWriter { - handle: task::JoinHandle>, + /// Use AutoAbortJoinHandle so that the task + /// will be cancelled on failure. + handle: AutoAbortJoinHandle>, tx: mpsc::Sender, } @@ -240,7 +242,7 @@ impl AsyncFileWriter { let mut file = fs::File::create(path)?; let (tx, mut rx) = mpsc::channel::(100); - let handle = task::spawn_blocking(move || { + let handle = AutoAbortJoinHandle(task::spawn_blocking(move || { while let Some(bytes) = rx.blocking_recv() { file.write_all(&*bytes)?; } @@ -249,7 +251,7 @@ impl AsyncFileWriter { file.flush()?; Ok(()) - }); + })); Ok(Self { handle, tx }) } @@ -293,8 +295,8 @@ impl AsyncFileWriter { Self::wait(&mut self.handle).await } - async fn wait(handle: &mut task::JoinHandle>) -> io::Result<()> { - match handle.await { + async fn wait(handle: &mut AutoAbortJoinHandle>) -> io::Result<()> { + match (&mut handle.0).await { Ok(res) => res, Err(join_err) => Err(io::Error::new(io::ErrorKind::Other, join_err)), } From 52210d1a8c2ab2668a6be5e04f19e3cb1f1a7aea Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 20:48:31 +1000 Subject: [PATCH 0184/2020] Impl `Deref{Mut}` for `AutoAbortJoinHandle` Signed-off-by: Jiahao XU --- src/helpers.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/helpers.rs b/src/helpers.rs index 736cb74a..9cea2ef2 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,6 +1,7 @@ use std::{ fs, io::{self, stderr, stdin, Write}, + ops::{Deref, DerefMut}, path::{Path, PathBuf}, }; @@ -311,3 +312,17 @@ impl Drop for AutoAbortJoinHandle { self.0.abort(); } } + +impl Deref for AutoAbortJoinHandle { + type Target = task::JoinHandle; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl DerefMut for AutoAbortJoinHandle { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} From f41391a53c975ea69bad96de28f28907777a0f34 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 20:51:59 +1000 Subject: [PATCH 0185/2020] Impl `Future` for `AutoAbortJoinHandle` Signed-off-by: Jiahao XU --- src/helpers.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/helpers.rs b/src/helpers.rs index 9cea2ef2..5a694381 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,8 +1,11 @@ use std::{ fs, + future::Future, io::{self, stderr, stdin, Write}, ops::{Deref, DerefMut}, path::{Path, PathBuf}, + pin::Pin, + task::{Context, Poll}, }; use bytes::Bytes; @@ -326,3 +329,11 @@ impl DerefMut for AutoAbortJoinHandle { &mut self.0 } } + +impl Future for AutoAbortJoinHandle { + type Output = Result; + + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + Pin::new(&mut Pin::into_inner(self).0).poll(cx) + } +} From d9bcca8b78a7bb1e9fe6692cb98b7e2bb2a6ecec Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 20:53:49 +1000 Subject: [PATCH 0186/2020] Impl `AutoAbortJoinHandle::new` & make its field private plus change all its users to use its new APIs. Signed-off-by: Jiahao XU --- src/fetchers.rs | 6 +++--- src/helpers.rs | 12 +++++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/src/fetchers.rs b/src/fetchers.rs index 69905c8a..e0b95063 100644 --- a/src/fetchers.rs +++ b/src/fetchers.rs @@ -64,13 +64,13 @@ impl MultiFetcher { .map(|fetcher| { ( fetcher.clone(), - AutoAbortJoinHandle(tokio::spawn(async move { fetcher.check().await })), + AutoAbortJoinHandle::new(tokio::spawn(async move { fetcher.check().await })), ) }) .collect(); - for (fetcher, mut handle) in handles { - match (&mut handle.0).await { + for (fetcher, handle) in handles { + match handle.await { Ok(Ok(true)) => return Some(fetcher), Ok(Ok(false)) => (), Ok(Err(err)) => { diff --git a/src/helpers.rs b/src/helpers.rs index 5a694381..4fbc12c7 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -246,7 +246,7 @@ impl AsyncFileWriter { let mut file = fs::File::create(path)?; let (tx, mut rx) = mpsc::channel::(100); - let handle = AutoAbortJoinHandle(task::spawn_blocking(move || { + let handle = AutoAbortJoinHandle::new(task::spawn_blocking(move || { while let Some(bytes) = rx.blocking_recv() { file.write_all(&*bytes)?; } @@ -300,7 +300,7 @@ impl AsyncFileWriter { } async fn wait(handle: &mut AutoAbortJoinHandle>) -> io::Result<()> { - match (&mut handle.0).await { + match handle.await { Ok(res) => res, Err(join_err) => Err(io::Error::new(io::ErrorKind::Other, join_err)), } @@ -308,7 +308,13 @@ impl AsyncFileWriter { } #[derive(Debug)] -pub struct AutoAbortJoinHandle(pub task::JoinHandle); +pub struct AutoAbortJoinHandle(task::JoinHandle); + +impl AutoAbortJoinHandle { + pub fn new(handle: task::JoinHandle) -> Self { + Self(handle) + } +} impl Drop for AutoAbortJoinHandle { fn drop(&mut self) { From e584b99240c30c77cfc8c409fafec98ed5157096 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 21:38:05 +1000 Subject: [PATCH 0187/2020] Simplify `AsyncFileWriter::write` by closing rx on err Signed-off-by: Jiahao XU --- src/helpers.rs | 40 +++++++++++++--------------------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 4fbc12c7..9e51f319 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -244,14 +244,18 @@ impl AsyncFileWriter { fs::create_dir_all(path.parent().unwrap())?; let mut file = fs::File::create(path)?; - let (tx, mut rx) = mpsc::channel::(100); + let (tx, rx) = mpsc::channel::(100); let handle = AutoAbortJoinHandle::new(task::spawn_blocking(move || { + // close rx on error so that tx.send will return an error + let mut rx = scopeguard::guard(rx, |mut rx| { + rx.close(); + }); + while let Some(bytes) = rx.blocking_recv() { file.write_all(&*bytes)?; } - rx.close(); file.flush()?; Ok(()) @@ -263,31 +267,13 @@ impl AsyncFileWriter { /// Upon error, this writer shall not be reused. /// Otherwise, `Self::done` would panic. pub async fn write(&mut self, bytes: Bytes) -> io::Result<()> { - let send_future = async { - self.tx - .send(bytes) - .await - .expect("Implementation bug: rx is closed before tx is dropped") - }; - tokio::pin!(send_future); - - let task_future = async { - Self::wait(&mut self.handle).await.map(|_| { - panic!("Implementation bug: write task finished before all writes are done") - }) - }; - tokio::pin!(task_future); - - // Use select to run them in parallel, so that if the send blocks - // the current future and the task failed with some error, the future - // returned by this function would not block forever. - tokio::select! { - // It isn't completely safe to cancel the send_future as it would - // cause us to lose our place in the queue, but if the send_future - // is cancelled, it means that the task has failed and the mpsc - // won't matter anyway. - _ = send_future => Ok(()), - res = task_future => res, + if self.tx.send(bytes).await.is_err() { + // task failed + Err(Self::wait(&mut self.handle).await.expect_err( + "Implementation bug: write task finished successfully before all writes are done", + )) + } else { + Ok(()) } } From 6aced2ca9bee82361d822de8d7381f69211a628f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 21:38:44 +1000 Subject: [PATCH 0188/2020] Disable feature "macros" of dep tokio Signed-off-by: Jiahao XU --- Cargo.lock | 12 ------------ Cargo.toml | 2 +- 2 files changed, 1 insertion(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e6e26b1a..21877876 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1512,21 +1512,9 @@ dependencies = [ "pin-project-lite", "signal-hook-registry", "socket2", - "tokio-macros", "winapi", ] -[[package]] -name = "tokio-macros" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "tokio-rustls" version = "0.23.4" diff --git a/Cargo.toml b/Cargo.toml index bd76fd13..7cdbcc48 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,7 @@ tar = "0.4.38" tempfile = "3.3.0" thiserror = "1.0.31" tinytemplate = "1.2.1" -tokio = { version = "1.19.1", features = [ "rt-multi-thread", "process", "sync", "macros" ], default-features = false } +tokio = { version = "1.19.1", features = [ "rt-multi-thread", "process", "sync" ], default-features = false } url = "2.2.2" xz2 = "0.1.6" From 358bea5c6df4c1f03c85f56c06f7494c66898277 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 21:43:09 +1000 Subject: [PATCH 0189/2020] Refactor: Extract `AsyncFileWriter` Signed-off-by: Jiahao XU --- src/helpers.rs | 65 ++--------------------------- src/helpers/async_file_writer.rs | 70 ++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+), 62 deletions(-) create mode 100644 src/helpers/async_file_writer.rs diff --git a/src/helpers.rs b/src/helpers.rs index 9e51f319..c31884f1 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -26,6 +26,9 @@ use zstd::stream::Decoder as ZstdDecoder; use crate::{BinstallError, Meta, PkgFmt}; +mod async_file_writer; +pub use async_file_writer::AsyncFileWriter; + /// Load binstall metadata from the crate `Cargo.toml` at the provided path pub fn load_manifest_path>( manifest_path: P, @@ -231,68 +234,6 @@ pub trait Template: Serialize { } } -#[derive(Debug)] -pub struct AsyncFileWriter { - /// Use AutoAbortJoinHandle so that the task - /// will be cancelled on failure. - handle: AutoAbortJoinHandle>, - tx: mpsc::Sender, -} - -impl AsyncFileWriter { - pub fn new(path: &Path) -> io::Result { - fs::create_dir_all(path.parent().unwrap())?; - - let mut file = fs::File::create(path)?; - let (tx, rx) = mpsc::channel::(100); - - let handle = AutoAbortJoinHandle::new(task::spawn_blocking(move || { - // close rx on error so that tx.send will return an error - let mut rx = scopeguard::guard(rx, |mut rx| { - rx.close(); - }); - - while let Some(bytes) = rx.blocking_recv() { - file.write_all(&*bytes)?; - } - - file.flush()?; - - Ok(()) - })); - - Ok(Self { handle, tx }) - } - - /// Upon error, this writer shall not be reused. - /// Otherwise, `Self::done` would panic. - pub async fn write(&mut self, bytes: Bytes) -> io::Result<()> { - if self.tx.send(bytes).await.is_err() { - // task failed - Err(Self::wait(&mut self.handle).await.expect_err( - "Implementation bug: write task finished successfully before all writes are done", - )) - } else { - Ok(()) - } - } - - pub async fn done(mut self) -> io::Result<()> { - // Drop tx as soon as possible so that the task would wrap up what it - // was doing and flush out all the pending data. - drop(self.tx); - - Self::wait(&mut self.handle).await - } - - async fn wait(handle: &mut AutoAbortJoinHandle>) -> io::Result<()> { - match handle.await { - Ok(res) => res, - Err(join_err) => Err(io::Error::new(io::ErrorKind::Other, join_err)), - } - } -} - #[derive(Debug)] pub struct AutoAbortJoinHandle(task::JoinHandle); diff --git a/src/helpers/async_file_writer.rs b/src/helpers/async_file_writer.rs new file mode 100644 index 00000000..21a577c7 --- /dev/null +++ b/src/helpers/async_file_writer.rs @@ -0,0 +1,70 @@ +use std::fs; +use std::io::{self, Write}; +use std::path::Path; + +use bytes::Bytes; +use tokio::{sync::mpsc, task::spawn_blocking}; + +use super::AutoAbortJoinHandle; + +#[derive(Debug)] +pub struct AsyncFileWriter { + /// Use AutoAbortJoinHandle so that the task + /// will be cancelled on failure. + handle: AutoAbortJoinHandle>, + tx: mpsc::Sender, +} + +impl AsyncFileWriter { + pub fn new(path: &Path) -> io::Result { + fs::create_dir_all(path.parent().unwrap())?; + + let mut file = fs::File::create(path)?; + let (tx, rx) = mpsc::channel::(100); + + let handle = AutoAbortJoinHandle::new(spawn_blocking(move || { + // close rx on error so that tx.send will return an error + let mut rx = scopeguard::guard(rx, |mut rx| { + rx.close(); + }); + + while let Some(bytes) = rx.blocking_recv() { + file.write_all(&*bytes)?; + } + + file.flush()?; + + Ok(()) + })); + + Ok(Self { handle, tx }) + } + + /// Upon error, this writer shall not be reused. + /// Otherwise, `Self::done` would panic. + pub async fn write(&mut self, bytes: Bytes) -> io::Result<()> { + if self.tx.send(bytes).await.is_err() { + // task failed + Err(Self::wait(&mut self.handle).await.expect_err( + "Implementation bug: write task finished successfully before all writes are done", + )) + } else { + Ok(()) + } + } + + pub async fn done(mut self) -> io::Result<()> { + // Drop tx as soon as possible so that the task would wrap up what it + // was doing and flush out all the pending data. + drop(self.tx); + + Self::wait(&mut self.handle).await + } + + async fn wait(handle: &mut AutoAbortJoinHandle>) -> io::Result<()> { + match handle.await { + Ok(res) => res, + Err(join_err) => Err(io::Error::new(io::ErrorKind::Other, join_err)), + } + } +} From 5d70f6131733a674697be0ca83dbc96cc168b864 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 21:46:32 +1000 Subject: [PATCH 0190/2020] Refactor: Extract `AutoAbortJoinHandle` Signed-off-by: Jiahao XU --- src/helpers.rs | 48 +++------------------------ src/helpers/auto_abort_join_handle.rs | 45 +++++++++++++++++++++++++ 2 files changed, 49 insertions(+), 44 deletions(-) create mode 100644 src/helpers/auto_abort_join_handle.rs diff --git a/src/helpers.rs b/src/helpers.rs index c31884f1..fd014acb 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,14 +1,9 @@ use std::{ fs, - future::Future, - io::{self, stderr, stdin, Write}, - ops::{Deref, DerefMut}, + io::{stderr, stdin, Write}, path::{Path, PathBuf}, - pin::Pin, - task::{Context, Poll}, }; -use bytes::Bytes; use cargo_toml::Manifest; use flate2::read::GzDecoder; use futures_util::stream::StreamExt; @@ -18,7 +13,6 @@ use scopeguard::ScopeGuard; use serde::Serialize; use tar::Archive; use tinytemplate::TinyTemplate; -use tokio::{sync::mpsc, task}; use url::Url; use xz2::read::XzDecoder; use zip::read::ZipArchive; @@ -29,6 +23,9 @@ use crate::{BinstallError, Meta, PkgFmt}; mod async_file_writer; pub use async_file_writer::AsyncFileWriter; +mod auto_abort_join_handle; +pub use auto_abort_join_handle::AutoAbortJoinHandle; + /// Load binstall metadata from the crate `Cargo.toml` at the provided path pub fn load_manifest_path>( manifest_path: P, @@ -233,40 +230,3 @@ pub trait Template: Serialize { Ok(tt.render("path", self)?) } } - -#[derive(Debug)] -pub struct AutoAbortJoinHandle(task::JoinHandle); - -impl AutoAbortJoinHandle { - pub fn new(handle: task::JoinHandle) -> Self { - Self(handle) - } -} - -impl Drop for AutoAbortJoinHandle { - fn drop(&mut self) { - self.0.abort(); - } -} - -impl Deref for AutoAbortJoinHandle { - type Target = task::JoinHandle; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - -impl DerefMut for AutoAbortJoinHandle { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl Future for AutoAbortJoinHandle { - type Output = Result; - - fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - Pin::new(&mut Pin::into_inner(self).0).poll(cx) - } -} diff --git a/src/helpers/auto_abort_join_handle.rs b/src/helpers/auto_abort_join_handle.rs new file mode 100644 index 00000000..fa476a8b --- /dev/null +++ b/src/helpers/auto_abort_join_handle.rs @@ -0,0 +1,45 @@ +use std::{ + future::Future, + ops::{Deref, DerefMut}, + pin::Pin, + task::{Context, Poll}, +}; + +use tokio::task::{JoinError, JoinHandle}; + +#[derive(Debug)] +pub struct AutoAbortJoinHandle(JoinHandle); + +impl AutoAbortJoinHandle { + pub fn new(handle: JoinHandle) -> Self { + Self(handle) + } +} + +impl Drop for AutoAbortJoinHandle { + fn drop(&mut self) { + self.0.abort(); + } +} + +impl Deref for AutoAbortJoinHandle { + type Target = JoinHandle; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +impl DerefMut for AutoAbortJoinHandle { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + +impl Future for AutoAbortJoinHandle { + type Output = Result; + + fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { + Pin::new(&mut Pin::into_inner(self).0).poll(cx) + } +} From 911c52d8e1b56f64eab019558771ad36753913ab Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 22:27:19 +1000 Subject: [PATCH 0191/2020] Auto remove file in `AsyncFileWriter` unless done is called. Also moves creation of the dir/file into the blocking thread to avoid blocking. Signed-off-by: Jiahao XU --- src/helpers.rs | 7 --- src/helpers/async_file_writer.rs | 84 ++++++++++++++++++++++++++------ 2 files changed, 70 insertions(+), 21 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index fd014acb..f60df2d8 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -9,7 +9,6 @@ use flate2::read::GzDecoder; use futures_util::stream::StreamExt; use log::{debug, info}; use reqwest::Method; -use scopeguard::ScopeGuard; use serde::Serialize; use tar::Archive; use tinytemplate::TinyTemplate; @@ -68,17 +67,11 @@ pub async fn download>(url: &str, path: P) -> Result<(), Binstall let mut bytes_stream = resp.bytes_stream(); let mut writer = AsyncFileWriter::new(path)?; - let guard = scopeguard::guard(path, |path| { - fs::remove_file(path).ok(); - }); - while let Some(res) = bytes_stream.next().await { writer.write(res?).await?; } writer.done().await?; - // Disarm as it is successfully downloaded and written to file. - ScopeGuard::into_inner(guard); debug!("Download OK, written to file: '{}'", path.display()); diff --git a/src/helpers/async_file_writer.rs b/src/helpers/async_file_writer.rs index 21a577c7..6405c777 100644 --- a/src/helpers/async_file_writer.rs +++ b/src/helpers/async_file_writer.rs @@ -3,37 +3,60 @@ use std::io::{self, Write}; use std::path::Path; use bytes::Bytes; +use scopeguard::{guard, Always, ScopeGuard}; use tokio::{sync::mpsc, task::spawn_blocking}; use super::AutoAbortJoinHandle; +enum Content { + /// Data to write to file + Data(Bytes), + + /// Abort the writing and remove the file. + Abort, +} + #[derive(Debug)] -pub struct AsyncFileWriter { +struct AsyncFileWriterInner { /// Use AutoAbortJoinHandle so that the task /// will be cancelled on failure. handle: AutoAbortJoinHandle>, - tx: mpsc::Sender, + tx: mpsc::Sender, } -impl AsyncFileWriter { - pub fn new(path: &Path) -> io::Result { - fs::create_dir_all(path.parent().unwrap())?; - - let mut file = fs::File::create(path)?; - let (tx, rx) = mpsc::channel::(100); +impl AsyncFileWriterInner { + fn new(path: &Path) -> io::Result { + let path = path.to_owned(); + let (tx, rx) = mpsc::channel::(100); let handle = AutoAbortJoinHandle::new(spawn_blocking(move || { // close rx on error so that tx.send will return an error - let mut rx = scopeguard::guard(rx, |mut rx| { + let mut rx = guard(rx, |mut rx| { rx.close(); }); - while let Some(bytes) = rx.blocking_recv() { - file.write_all(&*bytes)?; + fs::create_dir_all(path.parent().unwrap())?; + let mut file = fs::File::create(&path)?; + + // remove it unless the operation isn't aborted and no write + // fails. + let remove_guard = guard(path, |path| { + fs::remove_file(path).ok(); + }); + + while let Some(content) = rx.blocking_recv() { + match content { + Content::Data(bytes) => file.write_all(&*bytes)?, + Content::Abort => return Err(io::Error::new(io::ErrorKind::Other, "Aborted")), + } } file.flush()?; + // Operation isn't aborted and all writes succeed, + // disarm the remove_guard. + ScopeGuard::into_inner(remove_guard); + Ok(()) })); @@ -42,8 +65,8 @@ impl AsyncFileWriter { /// Upon error, this writer shall not be reused. /// Otherwise, `Self::done` would panic. - pub async fn write(&mut self, bytes: Bytes) -> io::Result<()> { - if self.tx.send(bytes).await.is_err() { + async fn write(&mut self, bytes: Bytes) -> io::Result<()> { + if self.tx.send(Content::Data(bytes)).await.is_err() { // task failed Err(Self::wait(&mut self.handle).await.expect_err( "Implementation bug: write task finished successfully before all writes are done", @@ -53,7 +76,7 @@ impl AsyncFileWriter { } } - pub async fn done(mut self) -> io::Result<()> { + async fn done(mut self) -> io::Result<()> { // Drop tx as soon as possible so that the task would wrap up what it // was doing and flush out all the pending data. drop(self.tx); @@ -67,4 +90,37 @@ impl AsyncFileWriter { Err(join_err) => Err(io::Error::new(io::ErrorKind::Other, join_err)), } } + + fn abort(self) { + let tx = self.tx; + // If Self::write fail, then the task is already tear down, + // tx closed and no need to abort. + if !tx.is_closed() { + // Use send here because blocking_send would panic if used + // in async threads. + tokio::spawn(async move { + tx.send(Content::Abort).await.ok(); + }); + } + } +} + +/// AsyncFileWriter removes the file if `done` isn't called. +#[derive(Debug)] +pub struct AsyncFileWriter(ScopeGuard); + +impl AsyncFileWriter { + pub fn new(path: &Path) -> io::Result { + AsyncFileWriterInner::new(path).map(|inner| Self(guard(inner, AsyncFileWriterInner::abort))) + } + + /// Upon error, this writer shall not be reused. + /// Otherwise, `Self::done` would panic. + pub async fn write(&mut self, bytes: Bytes) -> io::Result<()> { + self.0.write(bytes).await + } + + pub async fn done(self) -> io::Result<()> { + ScopeGuard::into_inner(self.0).done().await + } } From 894f9b49f9ecd861d0e734b442c6be8d8042a773 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 22:29:04 +1000 Subject: [PATCH 0192/2020] Simplify `AsyncFileWriter::new`: Ret `Self` instead of `io::Result` Signed-off-by: Jiahao XU --- src/helpers.rs | 2 +- src/helpers/async_file_writer.rs | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index f60df2d8..8ee87f9a 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -65,7 +65,7 @@ pub async fn download>(url: &str, path: P) -> Result<(), Binstall debug!("Downloading to file: '{}'", path.display()); let mut bytes_stream = resp.bytes_stream(); - let mut writer = AsyncFileWriter::new(path)?; + let mut writer = AsyncFileWriter::new(path); while let Some(res) = bytes_stream.next().await { writer.write(res?).await?; diff --git a/src/helpers/async_file_writer.rs b/src/helpers/async_file_writer.rs index 6405c777..12f69133 100644 --- a/src/helpers/async_file_writer.rs +++ b/src/helpers/async_file_writer.rs @@ -25,7 +25,7 @@ struct AsyncFileWriterInner { } impl AsyncFileWriterInner { - fn new(path: &Path) -> io::Result { + fn new(path: &Path) -> Self { let path = path.to_owned(); let (tx, rx) = mpsc::channel::(100); @@ -60,7 +60,7 @@ impl AsyncFileWriterInner { Ok(()) })); - Ok(Self { handle, tx }) + Self { handle, tx } } /// Upon error, this writer shall not be reused. @@ -110,8 +110,9 @@ impl AsyncFileWriterInner { pub struct AsyncFileWriter(ScopeGuard); impl AsyncFileWriter { - pub fn new(path: &Path) -> io::Result { - AsyncFileWriterInner::new(path).map(|inner| Self(guard(inner, AsyncFileWriterInner::abort))) + pub fn new(path: &Path) -> Self { + let inner = AsyncFileWriterInner::new(path); + Self(guard(inner, AsyncFileWriterInner::abort)) } /// Upon error, this writer shall not be reused. From 6bc04340b64587346d78f7c7422ac3f666e69ed1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 22:44:29 +1000 Subject: [PATCH 0193/2020] Impl `extract_compressed_from_readable` and `unzip` in new mod `extracter` Signed-off-by: Jiahao XU --- src/helpers.rs | 2 ++ src/helpers/extracter.rs | 76 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) create mode 100644 src/helpers/extracter.rs diff --git a/src/helpers.rs b/src/helpers.rs index 8ee87f9a..9ec2bcb7 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -25,6 +25,8 @@ pub use async_file_writer::AsyncFileWriter; mod auto_abort_join_handle; pub use auto_abort_join_handle::AutoAbortJoinHandle; +mod extracter; + /// Load binstall metadata from the crate `Cargo.toml` at the provided path pub fn load_manifest_path>( manifest_path: P, diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs new file mode 100644 index 00000000..77ad3665 --- /dev/null +++ b/src/helpers/extracter.rs @@ -0,0 +1,76 @@ +use std::fs::File; +use std::io::Read; +use std::path::Path; + +use flate2::read::GzDecoder; +use log::debug; +use tar::Archive; +use xz2::read::XzDecoder; +use zip::read::ZipArchive; +use zstd::stream::Decoder as ZstdDecoder; + +use crate::{BinstallError, PkgFmt}; + +/// Extract files from the specified source onto the specified path. +/// +/// * `fmt` - must not be `PkgFmt::Bin` or `PkgFmt::Zip`. +pub fn extract_compressed_from_readable( + dat: impl Read, + fmt: PkgFmt, + path: &Path, +) -> Result<(), BinstallError> { + match fmt { + PkgFmt::Tar => { + // Extract to install dir + debug!("Extracting from tar archive to `{path:?}`"); + + let mut tar = Archive::new(dat); + + tar.unpack(path)?; + } + PkgFmt::Tgz => { + // Extract to install dir + debug!("Decompressing from tgz archive to `{path:?}`"); + + let tar = GzDecoder::new(dat); + let mut tgz = Archive::new(tar); + + tgz.unpack(path)?; + } + PkgFmt::Txz => { + // Extract to install dir + debug!("Decompressing from txz archive to `{path:?}`"); + + let tar = XzDecoder::new(dat); + let mut txz = Archive::new(tar); + + txz.unpack(path)?; + } + PkgFmt::Tzstd => { + // Extract to install dir + debug!("Decompressing from tzstd archive to `{path:?}`"); + + // The error can only come from raw::Decoder::with_dictionary + // as of zstd 0.10.2 and 0.11.2, which is specified + // as &[] by ZstdDecoder::new, thus ZstdDecoder::new + // should not return any error. + let tar = ZstdDecoder::new(dat)?; + let mut txz = Archive::new(tar); + + txz.unpack(path)?; + } + PkgFmt::Zip => panic!("Unexpected PkgFmt::Zip!"), + PkgFmt::Bin => panic!("Unexpected PkgFmt::Bin!"), + }; + + Ok(()) +} + +pub fn unzip(dat: File, dst: &Path) -> Result<(), BinstallError> { + debug!("Decompressing from zip archive to `{dst:?}`"); + + let mut zip = ZipArchive::new(dat)?; + zip.extract(dst)?; + + Ok(()) +} From f211788052675e1c8efd976304f93229c9a0c8c9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 8 Jun 2022 23:04:14 +1000 Subject: [PATCH 0194/2020] Impl `ReadableRx` in mod `receiver_as_readable` Signed-off-by: Jiahao XU --- src/helpers.rs | 1 + src/helpers/async_file_writer.rs | 2 +- src/helpers/receiver_as_readable.rs | 49 +++++++++++++++++++++++++++++ 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 src/helpers/receiver_as_readable.rs diff --git a/src/helpers.rs b/src/helpers.rs index 9ec2bcb7..e9351147 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -26,6 +26,7 @@ mod auto_abort_join_handle; pub use auto_abort_join_handle::AutoAbortJoinHandle; mod extracter; +mod receiver_as_readable; /// Load binstall metadata from the crate `Cargo.toml` at the provided path pub fn load_manifest_path>( diff --git a/src/helpers/async_file_writer.rs b/src/helpers/async_file_writer.rs index 12f69133..a6bc1fc8 100644 --- a/src/helpers/async_file_writer.rs +++ b/src/helpers/async_file_writer.rs @@ -8,7 +8,7 @@ use tokio::{sync::mpsc, task::spawn_blocking}; use super::AutoAbortJoinHandle; -enum Content { +pub enum Content { /// Data to write to file Data(Bytes), diff --git a/src/helpers/receiver_as_readable.rs b/src/helpers/receiver_as_readable.rs new file mode 100644 index 00000000..02ccc344 --- /dev/null +++ b/src/helpers/receiver_as_readable.rs @@ -0,0 +1,49 @@ +use std::cmp::min; +use std::io::{self, Read}; + +use bytes::{Buf, Bytes}; +use tokio::sync::mpsc::Receiver; + +use super::async_file_writer::Content; + +#[derive(Debug)] +pub struct ReadableRx<'a> { + rx: &'a mut Receiver, + bytes: Bytes, +} + +impl<'a> ReadableRx<'a> { + pub fn new(rx: &'a mut Receiver) -> Self { + Self { + rx, + bytes: Bytes::new(), + } + } +} + +impl Read for ReadableRx<'_> { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + if buf.is_empty() { + return Ok(0); + } + + let bytes = &mut self.bytes; + if !bytes.has_remaining() { + match self.rx.blocking_recv() { + Some(Content::Data(new_bytes)) => *bytes = new_bytes, + Some(Content::Abort) => { + return Err(io::Error::new(io::ErrorKind::Other, "Aborted")) + } + None => return Ok(0), + } + } + + // copy_to_slice requires the bytes to have enough remaining bytes + // to fill buf. + let n = min(buf.len(), bytes.remaining()); + + bytes.copy_to_slice(&mut buf[..n]); + + Ok(n) + } +} From 59544e8b555c7f56a94b022600dbf7d9a7b04059 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 01:01:37 +1000 Subject: [PATCH 0195/2020] Use `BinstallError` in `AsyncFileWriter` Signed-off-by: Jiahao XU --- src/helpers/async_file_writer.rs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/helpers/async_file_writer.rs b/src/helpers/async_file_writer.rs index a6bc1fc8..ad549558 100644 --- a/src/helpers/async_file_writer.rs +++ b/src/helpers/async_file_writer.rs @@ -7,6 +7,7 @@ use scopeguard::{guard, Always, ScopeGuard}; use tokio::{sync::mpsc, task::spawn_blocking}; use super::AutoAbortJoinHandle; +use crate::{BinstallError, PkgFmt}; pub enum Content { /// Data to write to file @@ -20,7 +21,7 @@ pub enum Content { struct AsyncFileWriterInner { /// Use AutoAbortJoinHandle so that the task /// will be cancelled on failure. - handle: AutoAbortJoinHandle>, + handle: AutoAbortJoinHandle>, tx: mpsc::Sender, } @@ -47,7 +48,9 @@ impl AsyncFileWriterInner { while let Some(content) = rx.blocking_recv() { match content { Content::Data(bytes) => file.write_all(&*bytes)?, - Content::Abort => return Err(io::Error::new(io::ErrorKind::Other, "Aborted")), + Content::Abort => { + return Err(io::Error::new(io::ErrorKind::Other, "Aborted").into()) + } } } @@ -65,7 +68,7 @@ impl AsyncFileWriterInner { /// Upon error, this writer shall not be reused. /// Otherwise, `Self::done` would panic. - async fn write(&mut self, bytes: Bytes) -> io::Result<()> { + async fn write(&mut self, bytes: Bytes) -> Result<(), BinstallError> { if self.tx.send(Content::Data(bytes)).await.is_err() { // task failed Err(Self::wait(&mut self.handle).await.expect_err( @@ -76,7 +79,7 @@ impl AsyncFileWriterInner { } } - async fn done(mut self) -> io::Result<()> { + async fn done(mut self) -> Result<(), BinstallError> { // Drop tx as soon as possible so that the task would wrap up what it // was doing and flush out all the pending data. drop(self.tx); @@ -84,10 +87,12 @@ impl AsyncFileWriterInner { Self::wait(&mut self.handle).await } - async fn wait(handle: &mut AutoAbortJoinHandle>) -> io::Result<()> { + async fn wait( + handle: &mut AutoAbortJoinHandle>, + ) -> Result<(), BinstallError> { match handle.await { Ok(res) => res, - Err(join_err) => Err(io::Error::new(io::ErrorKind::Other, join_err)), + Err(join_err) => Err(io::Error::new(io::ErrorKind::Other, join_err).into()), } } @@ -117,11 +122,11 @@ impl AsyncFileWriter { /// Upon error, this writer shall not be reused. /// Otherwise, `Self::done` would panic. - pub async fn write(&mut self, bytes: Bytes) -> io::Result<()> { + pub async fn write(&mut self, bytes: Bytes) -> Result<(), BinstallError> { self.0.write(bytes).await } - pub async fn done(self) -> io::Result<()> { + pub async fn done(self) -> Result<(), BinstallError> { ScopeGuard::into_inner(self.0).done().await } } From 58c775a6485c7a2b83802e88c73c0ac1290a50a7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 01:02:53 +1000 Subject: [PATCH 0196/2020] Rename mod `receiver_as_readable` to `readable_rx` Signed-off-by: Jiahao XU --- src/helpers.rs | 2 +- src/helpers/{receiver_as_readable.rs => readable_rx.rs} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename src/helpers/{receiver_as_readable.rs => readable_rx.rs} (100%) diff --git a/src/helpers.rs b/src/helpers.rs index e9351147..9e981189 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -26,7 +26,7 @@ mod auto_abort_join_handle; pub use auto_abort_join_handle::AutoAbortJoinHandle; mod extracter; -mod receiver_as_readable; +mod readable_rx; /// Load binstall metadata from the crate `Cargo.toml` at the provided path pub fn load_manifest_path>( diff --git a/src/helpers/receiver_as_readable.rs b/src/helpers/readable_rx.rs similarity index 100% rename from src/helpers/receiver_as_readable.rs rename to src/helpers/readable_rx.rs From c3b5cb11c292d12ea714131077e6b6d9b9032949 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 01:20:37 +1000 Subject: [PATCH 0197/2020] Support for any `PkgFmt` in `AsyncFileWriter` Signed-off-by: Jiahao XU --- src/helpers.rs | 2 +- src/helpers/async_file_writer.rs | 72 ++++++++++++++++++++++---------- 2 files changed, 50 insertions(+), 24 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 9e981189..8473cfe3 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -68,7 +68,7 @@ pub async fn download>(url: &str, path: P) -> Result<(), Binstall debug!("Downloading to file: '{}'", path.display()); let mut bytes_stream = resp.bytes_stream(); - let mut writer = AsyncFileWriter::new(path); + let mut writer = AsyncFileWriter::new(path, PkgFmt::Bin); while let Some(res) = bytes_stream.next().await { writer.write(res?).await?; diff --git a/src/helpers/async_file_writer.rs b/src/helpers/async_file_writer.rs index ad549558..eacb20bf 100644 --- a/src/helpers/async_file_writer.rs +++ b/src/helpers/async_file_writer.rs @@ -1,12 +1,13 @@ use std::fs; -use std::io::{self, Write}; +use std::io::{self, Seek, Write}; use std::path::Path; use bytes::Bytes; use scopeguard::{guard, Always, ScopeGuard}; +use tempfile::tempfile; use tokio::{sync::mpsc, task::spawn_blocking}; -use super::AutoAbortJoinHandle; +use super::{extracter::*, readable_rx::*, AutoAbortJoinHandle}; use crate::{BinstallError, PkgFmt}; pub enum Content { @@ -26,7 +27,7 @@ struct AsyncFileWriterInner { } impl AsyncFileWriterInner { - fn new(path: &Path) -> Self { + fn new(path: &Path, fmt: PkgFmt) -> Self { let path = path.to_owned(); let (tx, rx) = mpsc::channel::(100); @@ -37,35 +38,60 @@ impl AsyncFileWriterInner { }); fs::create_dir_all(path.parent().unwrap())?; - let mut file = fs::File::create(&path)?; - // remove it unless the operation isn't aborted and no write - // fails. - let remove_guard = guard(path, |path| { - fs::remove_file(path).ok(); - }); + match fmt { + PkgFmt::Bin => { + let mut file = fs::File::create(&path)?; - while let Some(content) = rx.blocking_recv() { - match content { - Content::Data(bytes) => file.write_all(&*bytes)?, - Content::Abort => { - return Err(io::Error::new(io::ErrorKind::Other, "Aborted").into()) - } + // remove it unless the operation isn't aborted and no write + // fails. + let remove_guard = guard(&path, |path| { + fs::remove_file(path).ok(); + }); + + Self::read_into_file(&mut file, &mut rx)?; + + // Operation isn't aborted and all writes succeed, + // disarm the remove_guard. + ScopeGuard::into_inner(remove_guard); } + PkgFmt::Zip => { + let mut file = tempfile()?; + + Self::read_into_file(&mut file, &mut rx)?; + + // rewind it so that we can pass it to unzip + file.rewind()?; + + unzip(file, &path)?; + } + _ => extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt, &path)?, } - file.flush()?; - - // Operation isn't aborted and all writes succeed, - // disarm the remove_guard. - ScopeGuard::into_inner(remove_guard); - Ok(()) })); Self { handle, tx } } + fn read_into_file( + file: &mut fs::File, + rx: &mut mpsc::Receiver, + ) -> Result<(), BinstallError> { + while let Some(content) = rx.blocking_recv() { + match content { + Content::Data(bytes) => file.write_all(&*bytes)?, + Content::Abort => { + return Err(io::Error::new(io::ErrorKind::Other, "Aborted").into()) + } + } + } + + file.flush()?; + + Ok(()) + } + /// Upon error, this writer shall not be reused. /// Otherwise, `Self::done` would panic. async fn write(&mut self, bytes: Bytes) -> Result<(), BinstallError> { @@ -115,8 +141,8 @@ impl AsyncFileWriterInner { pub struct AsyncFileWriter(ScopeGuard); impl AsyncFileWriter { - pub fn new(path: &Path) -> Self { - let inner = AsyncFileWriterInner::new(path); + pub fn new(path: &Path, fmt: PkgFmt) -> Self { + let inner = AsyncFileWriterInner::new(path, fmt); Self(guard(inner, AsyncFileWriterInner::abort)) } From 784d1f0bf6ce11a989fbf9f6321ca01a4a46082c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 01:32:38 +1000 Subject: [PATCH 0198/2020] Impl new fn `helpers::download_and_extract` Signed-off-by: Jiahao XU --- src/helpers.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/helpers.rs b/src/helpers.rs index 8473cfe3..3eac6bc6 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -53,6 +53,15 @@ pub async fn remote_exists(url: Url, method: Method) -> Result>(url: &str, path: P) -> Result<(), BinstallError> { let url = Url::parse(url)?; + download_and_extract(url, PkgFmt::Bin, path.as_ref()).await +} + +/// Download a file from the provided URL and extract it to the provided path +pub async fn download_and_extract>( + url: Url, + fmt: PkgFmt, + path: P, +) -> Result<(), BinstallError> { debug!("Downloading from: '{url}'"); let resp = reqwest::get(url.clone()) @@ -68,7 +77,7 @@ pub async fn download>(url: &str, path: P) -> Result<(), Binstall debug!("Downloading to file: '{}'", path.display()); let mut bytes_stream = resp.bytes_stream(); - let mut writer = AsyncFileWriter::new(path, PkgFmt::Bin); + let mut writer = AsyncFileWriter::new(path, fmt); while let Some(res) = bytes_stream.next().await { writer.write(res?).await?; From 441e004ef19148cc8e0643779448b885248b8ddb Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 01:42:13 +1000 Subject: [PATCH 0199/2020] Fix `test::parse_meta` in `lib.rs` Signed-off-by: Jiahao XU --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index d83d7887..0ad83f42 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -168,7 +168,7 @@ mod test { &[Product { name: Some("cargo-binstall".to_string()), path: Some("src/main.rs".to_string()), - edition: Some(cargo_toml::Edition::E2018), + edition: Some(cargo_toml::Edition::E2021), ..Default::default() },], ); From 2ea03f6b29a5a0e9945704b027495cdde22b503f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 01:44:31 +1000 Subject: [PATCH 0200/2020] Add new workflow "ci" to run `cargo-test` Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..13143e9c --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,32 @@ +name: Rust + +on: + push: + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: test + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Configure toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Configure caching + uses: actions/cache@v2 + with: + key: ${{ matrix.os }}-${{ matrix.target }}-testing + path: | + ${{ env.HOME }}/.cargo + target + - name: test + uses: actions-rs/cargo@v1 + with: + command: test From 4b6b3e667c8225e4d50d37da42f1d22d8756670d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 01:48:42 +1000 Subject: [PATCH 0201/2020] Fix syntax err in workflow "ci" Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 13143e9c..7d8ae7d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,22 +11,21 @@ jobs: test: name: test runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Configure toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - name: Configure caching - uses: actions/cache@v2 - with: - key: ${{ matrix.os }}-${{ matrix.target }}-testing - path: | - ${{ env.HOME }}/.cargo - target - - name: test - uses: actions-rs/cargo@v1 - with: - command: test + steps: + - uses: actions/checkout@v2 + - name: Configure toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Configure caching + uses: actions/cache@v2 + with: + key: ${{ matrix.os }}-${{ matrix.target }}-testing + path: | + ${{ env.HOME }}/.cargo + target + - name: test + uses: actions-rs/cargo@v1 + with: + command: test From 1c40848f5115b5423f5811c423154c214ed7f528 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 01:52:30 +1000 Subject: [PATCH 0202/2020] Rm `ci.yml` Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 7d8ae7d0..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Rust - -on: - push: - pull_request: - -env: - CARGO_TERM_COLOR: always - -jobs: - test: - name: test - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Configure toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true - - name: Configure caching - uses: actions/cache@v2 - with: - key: ${{ matrix.os }}-${{ matrix.target }}-testing - path: | - ${{ env.HOME }}/.cargo - target - - name: test - uses: actions-rs/cargo@v1 - with: - command: test From c9bd741c9b20fb72916d36be7d49ce3b458debc7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 01:53:10 +1000 Subject: [PATCH 0203/2020] Add new workflow ci Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..7d8ae7d0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,31 @@ +name: Rust + +on: + push: + pull_request: + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: test + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Configure toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Configure caching + uses: actions/cache@v2 + with: + key: ${{ matrix.os }}-${{ matrix.target }}-testing + path: | + ${{ env.HOME }}/.cargo + target + - name: test + uses: actions-rs/cargo@v1 + with: + command: test From 14823fbae73ed67199d848a67587e38492c57fd8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 01:53:24 +1000 Subject: [PATCH 0204/2020] Fix `test::parse_meta` in `lib.rs` Signed-off-by: Jiahao XU --- src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib.rs b/src/lib.rs index d83d7887..0ad83f42 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -168,7 +168,7 @@ mod test { &[Product { name: Some("cargo-binstall".to_string()), path: Some("src/main.rs".to_string()), - edition: Some(cargo_toml::Edition::E2018), + edition: Some(cargo_toml::Edition::E2021), ..Default::default() },], ); From 951dacd03d4fdeb8b0731c7909bd0425d5aff0d0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 02:00:38 +1000 Subject: [PATCH 0205/2020] Fix cache key used in workflow "ci" Signed-off-by: Jiahao XU --- .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 7d8ae7d0..a74ae2c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: - name: Configure caching uses: actions/cache@v2 with: - key: ${{ matrix.os }}-${{ matrix.target }}-testing + key: ubuntu-latest-stable-testing path: | ${{ env.HOME }}/.cargo target From cc13a23b076ec10fbe3c07a6a7d5955c3d1021c0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 12:58:39 +1000 Subject: [PATCH 0206/2020] Mark all internal types & fn as `pub(crate)` Signed-off-by: Jiahao XU --- src/helpers/async_file_writer.rs | 2 +- src/helpers/extracter.rs | 4 ++-- src/helpers/readable_rx.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/helpers/async_file_writer.rs b/src/helpers/async_file_writer.rs index eacb20bf..ab90f8a3 100644 --- a/src/helpers/async_file_writer.rs +++ b/src/helpers/async_file_writer.rs @@ -10,7 +10,7 @@ use tokio::{sync::mpsc, task::spawn_blocking}; use super::{extracter::*, readable_rx::*, AutoAbortJoinHandle}; use crate::{BinstallError, PkgFmt}; -pub enum Content { +pub(crate) enum Content { /// Data to write to file Data(Bytes), diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index 77ad3665..c851b0c8 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -14,7 +14,7 @@ use crate::{BinstallError, PkgFmt}; /// Extract files from the specified source onto the specified path. /// /// * `fmt` - must not be `PkgFmt::Bin` or `PkgFmt::Zip`. -pub fn extract_compressed_from_readable( +pub(crate) fn extract_compressed_from_readable( dat: impl Read, fmt: PkgFmt, path: &Path, @@ -66,7 +66,7 @@ pub fn extract_compressed_from_readable( Ok(()) } -pub fn unzip(dat: File, dst: &Path) -> Result<(), BinstallError> { +pub(crate) fn unzip(dat: File, dst: &Path) -> Result<(), BinstallError> { debug!("Decompressing from zip archive to `{dst:?}`"); let mut zip = ZipArchive::new(dat)?; diff --git a/src/helpers/readable_rx.rs b/src/helpers/readable_rx.rs index 02ccc344..8b387ab6 100644 --- a/src/helpers/readable_rx.rs +++ b/src/helpers/readable_rx.rs @@ -7,13 +7,13 @@ use tokio::sync::mpsc::Receiver; use super::async_file_writer::Content; #[derive(Debug)] -pub struct ReadableRx<'a> { +pub(crate) struct ReadableRx<'a> { rx: &'a mut Receiver, bytes: Bytes, } impl<'a> ReadableRx<'a> { - pub fn new(rx: &'a mut Receiver) -> Self { + pub(crate) fn new(rx: &'a mut Receiver) -> Self { Self { rx, bytes: Bytes::new(), From be5e8616a230038f6d0c360d17bcd31702344a34 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 13:15:23 +1000 Subject: [PATCH 0207/2020] Impl new fn `helpers::extracter::untar` Signed-off-by: Jiahao XU --- src/helpers/extracter.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index c851b0c8..d0e2ea6e 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -1,3 +1,4 @@ +use std::borrow::Cow; use std::fs::File; use std::io::Read; use std::path::Path; @@ -11,6 +12,31 @@ use zstd::stream::Decoder as ZstdDecoder; use crate::{BinstallError, PkgFmt}; +fn untar( + dat: impl Read, + path: &Path, + desired_outputs: Option<&[Cow<'_, Path>]>, +) -> Result<(), BinstallError> { + let mut tar = Archive::new(dat); + + if let Some(desired_outputs) = desired_outputs { + for res in tar.entries()? { + let mut entry = res?; + let entry_path = entry.path()?; + + if desired_outputs.contains(&entry_path) { + let dst = path.join(entry_path); + + entry.unpack(dst)?; + } + } + } else { + tar.unpack(path)?; + } + + Ok(()) +} + /// Extract files from the specified source onto the specified path. /// /// * `fmt` - must not be `PkgFmt::Bin` or `PkgFmt::Zip`. From 72983e41138426755c1e4500319440995ce9996c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 13:26:47 +1000 Subject: [PATCH 0208/2020] Use `untar` in `extract_compressed_from_readable` So that we can specify the files we want to extract to avoid io and save disk usage. Signed-off-by: Jiahao XU --- src/helpers.rs | 12 +++++++++--- src/helpers/async_file_writer.rs | 27 +++++++++++++++++++++++---- src/helpers/extracter.rs | 21 +++++++++------------ 3 files changed, 41 insertions(+), 19 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 3eac6bc6..614819ab 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,4 +1,5 @@ use std::{ + borrow::Cow, fs, io::{stderr, stdin, Write}, path::{Path, PathBuf}, @@ -53,14 +54,19 @@ pub async fn remote_exists(url: Url, method: Method) -> Result>(url: &str, path: P) -> Result<(), BinstallError> { let url = Url::parse(url)?; - download_and_extract(url, PkgFmt::Bin, path.as_ref()).await + download_and_extract::<_, 0>(url, PkgFmt::Bin, path.as_ref(), None).await } /// Download a file from the provided URL and extract it to the provided path -pub async fn download_and_extract>( +/// +/// * `desired_outputs - If Some(_) and `fmt` is not `PkgFmt::Bin` or +/// `PkgFmt::Zip`, then it will filter the tar and only extract files +/// specified in it. +pub async fn download_and_extract, const N: usize>( url: Url, fmt: PkgFmt, path: P, + desired_outputs: Option<[Cow<'static, Path>; N]>, ) -> Result<(), BinstallError> { debug!("Downloading from: '{url}'"); @@ -77,7 +83,7 @@ pub async fn download_and_extract>( debug!("Downloading to file: '{}'", path.display()); let mut bytes_stream = resp.bytes_stream(); - let mut writer = AsyncFileWriter::new(path, fmt); + let mut writer = AsyncFileWriter::new(path, fmt, desired_outputs); while let Some(res) = bytes_stream.next().await { writer.write(res?).await?; diff --git a/src/helpers/async_file_writer.rs b/src/helpers/async_file_writer.rs index ab90f8a3..755cde72 100644 --- a/src/helpers/async_file_writer.rs +++ b/src/helpers/async_file_writer.rs @@ -1,3 +1,4 @@ +use std::borrow::Cow; use std::fs; use std::io::{self, Seek, Write}; use std::path::Path; @@ -27,7 +28,13 @@ struct AsyncFileWriterInner { } impl AsyncFileWriterInner { - fn new(path: &Path, fmt: PkgFmt) -> Self { + /// * `desired_outputs - If Some(_), then it will filter the tar + /// and only extract files specified in it. + fn new( + path: &Path, + fmt: PkgFmt, + desired_outputs: Option<[Cow<'static, Path>; N]>, + ) -> Self { let path = path.to_owned(); let (tx, rx) = mpsc::channel::(100); @@ -65,7 +72,12 @@ impl AsyncFileWriterInner { unzip(file, &path)?; } - _ => extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt, &path)?, + _ => extract_compressed_from_readable( + ReadableRx::new(&mut rx), + fmt, + &path, + desired_outputs.as_ref().map(|arr| &arr[..]), + )?, } Ok(()) @@ -141,8 +153,15 @@ impl AsyncFileWriterInner { pub struct AsyncFileWriter(ScopeGuard); impl AsyncFileWriter { - pub fn new(path: &Path, fmt: PkgFmt) -> Self { - let inner = AsyncFileWriterInner::new(path, fmt); + /// * `desired_outputs - If Some(_) and `fmt` is not `PkgFmt::Bin` or + /// `PkgFmt::Zip`, then it will filter the tar and only extract files + /// specified in it. + pub fn new( + path: &Path, + fmt: PkgFmt, + desired_outputs: Option<[Cow<'static, Path>; N]>, + ) -> Self { + let inner = AsyncFileWriterInner::new(path, fmt, desired_outputs); Self(guard(inner, AsyncFileWriterInner::abort)) } diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index d0e2ea6e..41797210 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -12,6 +12,8 @@ use zstd::stream::Decoder as ZstdDecoder; use crate::{BinstallError, PkgFmt}; +/// * `desired_outputs - If Some(_), then it will filter the tar +/// and only extract files specified in it. fn untar( dat: impl Read, path: &Path, @@ -40,37 +42,34 @@ fn untar( /// Extract files from the specified source onto the specified path. /// /// * `fmt` - must not be `PkgFmt::Bin` or `PkgFmt::Zip`. +/// * `desired_outputs - If Some(_), then it will filter the tar +/// and only extract files specified in it. pub(crate) fn extract_compressed_from_readable( dat: impl Read, fmt: PkgFmt, path: &Path, + desired_outputs: Option<&[Cow<'_, Path>]>, ) -> Result<(), BinstallError> { match fmt { PkgFmt::Tar => { // Extract to install dir debug!("Extracting from tar archive to `{path:?}`"); - let mut tar = Archive::new(dat); - - tar.unpack(path)?; + untar(dat, path, desired_outputs)? } PkgFmt::Tgz => { // Extract to install dir debug!("Decompressing from tgz archive to `{path:?}`"); let tar = GzDecoder::new(dat); - let mut tgz = Archive::new(tar); - - tgz.unpack(path)?; + untar(tar, path, desired_outputs)?; } PkgFmt::Txz => { // Extract to install dir debug!("Decompressing from txz archive to `{path:?}`"); let tar = XzDecoder::new(dat); - let mut txz = Archive::new(tar); - - txz.unpack(path)?; + untar(tar, path, desired_outputs)?; } PkgFmt::Tzstd => { // Extract to install dir @@ -81,9 +80,7 @@ pub(crate) fn extract_compressed_from_readable( // as &[] by ZstdDecoder::new, thus ZstdDecoder::new // should not return any error. let tar = ZstdDecoder::new(dat)?; - let mut txz = Archive::new(tar); - - txz.unpack(path)?; + untar(tar, path, desired_outputs)?; } PkgFmt::Zip => panic!("Unexpected PkgFmt::Zip!"), PkgFmt::Bin => panic!("Unexpected PkgFmt::Bin!"), From b6bfd40c3a682fec1c1ece3f51d492e34513ffe0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 14:12:44 +1000 Subject: [PATCH 0209/2020] Use `download_and_extract` in `fetch_crate_cratesio` Signed-off-by: Jiahao XU --- src/drivers.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/drivers.rs b/src/drivers.rs index 49b615c1..3ddf654d 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -5,6 +5,7 @@ use std::time::Duration; use crates_io_api::AsyncClient; use log::debug; use semver::{Version, VersionReq}; +use url::Url; use crate::{helpers::*, BinstallError, PkgFmt}; @@ -50,7 +51,7 @@ fn find_version<'a, V: Iterator>( .ok_or(BinstallError::VersionMismatch { req: version_req }) } -/// Fetch a crate by name and version from crates.io +/// Fetch a crate Cargo.toml by name and version from crates.io pub async fn fetch_crate_cratesio( name: &str, version_req: &str, @@ -98,16 +99,17 @@ pub async fn fetch_crate_cratesio( // Download crate to temporary dir (crates.io or git?) let crate_url = format!("https://crates.io/{}", version.dl_path); - let tgz_path = temp_dir.join(format!("{name}.tgz")); - debug!("Fetching crate from: {crate_url}"); + debug!("Fetching crate from: {crate_url} and extracting Cargo.toml from it"); - // Download crate - download(&crate_url, &tgz_path).await?; + download_and_extract( + Url::parse(&crate_url)?, + PkgFmt::Tgz, + &temp_dir, + Some([Path::new("Cargo.toml").into()]), + ) + .await?; - // Decompress downloaded tgz - debug!("Decompressing crate archive"); - extract(&tgz_path, PkgFmt::Tgz, &temp_dir)?; let crate_path = temp_dir.join(format!("{name}-{version_name}")); // Return crate directory From c9b0d45a24c107d6bf2260b11c437d3fb241ae36 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 14:46:00 +1000 Subject: [PATCH 0210/2020] Use `download_and_extract` in fetchers to improve efficiency by avoiding disk io (except for `PkgFmt::Zip` and `PkgFmt::Bin`) and run the compresser in parallel to the downloader. Signed-off-by: Jiahao XU --- src/fetchers.rs | 4 ++-- src/fetchers/gh_crate_meta.rs | 6 +++--- src/fetchers/quickinstall.rs | 6 +++--- src/main.rs | 27 +++++++++++---------------- 4 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/fetchers.rs b/src/fetchers.rs index e0b95063..a39a0e9a 100644 --- a/src/fetchers.rs +++ b/src/fetchers.rs @@ -17,8 +17,8 @@ pub trait Fetcher: Send + Sync { where Self: Sized; - /// Fetch a package - async fn fetch(&self, dst: &Path) -> Result<(), BinstallError>; + /// Fetch a package and extract + async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError>; /// Check if a package is available for download async fn check(&self) -> Result; diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index e38d7ae1..c6ed669b 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -7,7 +7,7 @@ use serde::Serialize; use url::Url; use super::Data; -use crate::{download, remote_exists, BinstallError, PkgFmt, Template}; +use crate::{download_and_extract, remote_exists, BinstallError, PkgFmt, Template}; pub struct GhCrateMeta { data: Data, @@ -40,10 +40,10 @@ impl super::Fetcher for GhCrateMeta { remote_exists(url, Method::HEAD).await } - async fn fetch(&self, dst: &Path) -> Result<(), BinstallError> { + async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { let url = self.url()?; info!("Downloading package from: '{url}'"); - download(url.as_str(), dst).await + download_and_extract::<_, 0>(url, self.pkg_fmt(), dst, None).await } fn pkg_fmt(&self) -> PkgFmt { diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index ec83493c..b934302e 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -6,7 +6,7 @@ use reqwest::Method; use url::Url; use super::Data; -use crate::{download, remote_exists, BinstallError, PkgFmt}; +use crate::{download_and_extract, remote_exists, BinstallError, PkgFmt}; const BASE_URL: &str = "https://github.com/alsuren/cargo-quickinstall/releases/download"; const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; @@ -36,10 +36,10 @@ impl super::Fetcher for QuickInstall { remote_exists(Url::parse(&url)?, Method::HEAD).await } - async fn fetch(&self, dst: &Path) -> Result<(), BinstallError> { + async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { let url = self.package_url(); info!("Downloading package from: '{url}'"); - download(&url, &dst).await + download_and_extract::<_, 0>(Url::parse(&url)?, self.pkg_fmt(), dst, None).await } fn pkg_fmt(&self) -> PkgFmt { diff --git a/src/main.rs b/src/main.rs index 9b3dafb0..58460ebb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -361,11 +361,21 @@ async fn install_from_package( meta.bin_dir = "{ bin }{ binary-ext }".to_string(); } + let bin_path = temp_dir.path().join(format!("bin-{}", opts.name)); + debug!("Using temporary binary path: {}", bin_path.display()); + // Download package if opts.dry_run { info!("Dry run, not downloading package"); } else { - fetcher.fetch(&pkg_path).await?; + fetcher.fetch_and_extract(&bin_path).await?; + + if binaries.is_empty() { + error!("No binaries specified (or inferred from file system)"); + return Err(miette!( + "No binaries specified (or inferred from file system)" + )); + } } #[cfg(incomplete)] @@ -392,21 +402,6 @@ async fn install_from_package( } } - let bin_path = temp_dir.path().join(format!("bin-{}", opts.name)); - debug!("Using temporary binary path: {}", bin_path.display()); - - if !opts.dry_run { - // Extract files - extract(&pkg_path, fetcher.pkg_fmt(), &bin_path)?; - - if binaries.is_empty() { - error!("No binaries specified (or inferred from file system)"); - return Err(miette!( - "No binaries specified (or inferred from file system)" - )); - } - } - // List files to be installed // based on those found via Cargo.toml let bin_data = bins::Data { From 1879a719e4a2abb20ba913349e067cce7c6c0050 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 14:47:15 +1000 Subject: [PATCH 0211/2020] Rm fn `helpers::download` Signed-off-by: Jiahao XU --- src/helpers.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 614819ab..b0451295 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -51,12 +51,6 @@ pub async fn remote_exists(url: Url, method: Method) -> Result>(url: &str, path: P) -> Result<(), BinstallError> { - let url = Url::parse(url)?; - download_and_extract::<_, 0>(url, PkgFmt::Bin, path.as_ref(), None).await -} - /// Download a file from the provided URL and extract it to the provided path /// /// * `desired_outputs - If Some(_) and `fmt` is not `PkgFmt::Bin` or From 728d1fd6dd4790eb0ed9e9068760fa9dc2f9a39d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 14:47:43 +1000 Subject: [PATCH 0212/2020] Rm unused param `pkg_path` in `install_from_package` Signed-off-by: Jiahao XU --- src/main.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/main.rs b/src/main.rs index 58460ebb..55ce22bb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -295,12 +295,6 @@ async fn entry() -> Result<()> { fetcher.source_name() ); - // Compute temporary directory for downloads - let pkg_path = temp_dir - .path() - .join(format!("pkg-{}.{}", opts.name, meta.pkg_fmt)); - debug!("Using temporary download path: {}", pkg_path.display()); - install_from_package( binaries, fetcher.as_ref(), @@ -308,7 +302,6 @@ async fn entry() -> Result<()> { meta, opts, package, - pkg_path, temp_dir, ) .await @@ -337,7 +330,6 @@ async fn install_from_package( mut meta: PkgMeta, opts: Options, package: Package, - pkg_path: PathBuf, temp_dir: TempDir, ) -> Result<()> { // Prompt user for third-party source From 5ba8b07bcba69cbb7285f4969cdb070872b9da3e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 14:52:14 +1000 Subject: [PATCH 0213/2020] Rm `helpers::extract` Signed-off-by: Jiahao XU --- src/helpers.rs | 79 -------------------------------------------------- 1 file changed, 79 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index b0451295..6d84bb3c 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,22 +1,16 @@ use std::{ borrow::Cow, - fs, io::{stderr, stdin, Write}, path::{Path, PathBuf}, }; use cargo_toml::Manifest; -use flate2::read::GzDecoder; use futures_util::stream::StreamExt; use log::{debug, info}; use reqwest::Method; use serde::Serialize; -use tar::Archive; use tinytemplate::TinyTemplate; use url::Url; -use xz2::read::XzDecoder; -use zip::read::ZipArchive; -use zstd::stream::Decoder as ZstdDecoder; use crate::{BinstallError, Meta, PkgFmt}; @@ -90,79 +84,6 @@ pub async fn download_and_extract, const N: usize>( Ok(()) } -/// Extract files from the specified source onto the specified path -pub fn extract, P: AsRef>( - source: S, - fmt: PkgFmt, - path: P, -) -> Result<(), BinstallError> { - let source = source.as_ref(); - let path = path.as_ref(); - - match fmt { - PkgFmt::Tar => { - // Extract to install dir - debug!("Extracting from tar archive '{source:?}' to `{path:?}`"); - - let dat = fs::File::open(source)?; - let mut tar = Archive::new(dat); - - tar.unpack(path)?; - } - PkgFmt::Tgz => { - // Extract to install dir - debug!("Decompressing from tgz archive '{source:?}' to `{path:?}`"); - - let dat = fs::File::open(source)?; - let tar = GzDecoder::new(dat); - let mut tgz = Archive::new(tar); - - tgz.unpack(path)?; - } - PkgFmt::Txz => { - // Extract to install dir - debug!("Decompressing from txz archive '{source:?}' to `{path:?}`"); - - let dat = fs::File::open(source)?; - let tar = XzDecoder::new(dat); - let mut txz = Archive::new(tar); - - txz.unpack(path)?; - } - PkgFmt::Tzstd => { - // Extract to install dir - debug!("Decompressing from tzstd archive '{source:?}' to `{path:?}`"); - - let dat = std::fs::File::open(source)?; - - // The error can only come from raw::Decoder::with_dictionary - // as of zstd 0.10.2 and 0.11.2, which is specified - // as &[] by ZstdDecoder::new, thus ZstdDecoder::new - // should not return any error. - let tar = ZstdDecoder::new(dat)?; - let mut txz = Archive::new(tar); - - txz.unpack(path)?; - } - PkgFmt::Zip => { - // Extract to install dir - debug!("Decompressing from zip archive '{source:?}' to `{path:?}`"); - - let dat = fs::File::open(source)?; - let mut zip = ZipArchive::new(dat)?; - - zip.extract(path)?; - } - PkgFmt::Bin => { - debug!("Copying binary '{source:?}' to `{path:?}`"); - // Copy to install dir - fs::copy(source, path)?; - } - }; - - Ok(()) -} - /// Fetch install path from environment /// roughly follows pub fn get_install_path>(install_path: Option

) -> Option { From e62775a9ecb31fa8f7b8cfb687198864617ddc69 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 21:34:07 +1000 Subject: [PATCH 0214/2020] Add more doc for `AsyncFileWriter` Signed-off-by: Jiahao XU --- src/helpers/async_file_writer.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/helpers/async_file_writer.rs b/src/helpers/async_file_writer.rs index 755cde72..53a61ceb 100644 --- a/src/helpers/async_file_writer.rs +++ b/src/helpers/async_file_writer.rs @@ -148,6 +148,11 @@ impl AsyncFileWriterInner { } } +/// AsyncFileWriter will pass the `Bytes` you give to another thread via +/// a `mpsc` and decompress and unpack it if needed. +/// +/// # Cancellation +/// /// AsyncFileWriter removes the file if `done` isn't called. #[derive(Debug)] pub struct AsyncFileWriter(ScopeGuard); From 945687c281616c1bc9216db0e370cdf08327c503 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 21:58:51 +1000 Subject: [PATCH 0215/2020] Rename `AsyncFileWriter` to `AsyncExtracter` Signed-off-by: Jiahao XU --- src/helpers.rs | 10 +++++----- .../{async_file_writer.rs => async_extracter.rs} | 16 ++++++++-------- src/helpers/readable_rx.rs | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) rename src/helpers/{async_file_writer.rs => async_extracter.rs} (92%) diff --git a/src/helpers.rs b/src/helpers.rs index 6d84bb3c..bc7ce7c8 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -14,8 +14,8 @@ use url::Url; use crate::{BinstallError, Meta, PkgFmt}; -mod async_file_writer; -pub use async_file_writer::AsyncFileWriter; +mod async_extracter; +pub use async_extracter::AsyncExtracter; mod auto_abort_join_handle; pub use auto_abort_join_handle::AutoAbortJoinHandle; @@ -71,13 +71,13 @@ pub async fn download_and_extract, const N: usize>( debug!("Downloading to file: '{}'", path.display()); let mut bytes_stream = resp.bytes_stream(); - let mut writer = AsyncFileWriter::new(path, fmt, desired_outputs); + let mut extracter = AsyncExtracter::new(path, fmt, desired_outputs); while let Some(res) = bytes_stream.next().await { - writer.write(res?).await?; + extracter.write(res?).await?; } - writer.done().await?; + extracter.done().await?; debug!("Download OK, written to file: '{}'", path.display()); diff --git a/src/helpers/async_file_writer.rs b/src/helpers/async_extracter.rs similarity index 92% rename from src/helpers/async_file_writer.rs rename to src/helpers/async_extracter.rs index 53a61ceb..ea581ebb 100644 --- a/src/helpers/async_file_writer.rs +++ b/src/helpers/async_extracter.rs @@ -20,14 +20,14 @@ pub(crate) enum Content { } #[derive(Debug)] -struct AsyncFileWriterInner { +struct AsyncExtracterInner { /// Use AutoAbortJoinHandle so that the task /// will be cancelled on failure. handle: AutoAbortJoinHandle>, tx: mpsc::Sender, } -impl AsyncFileWriterInner { +impl AsyncExtracterInner { /// * `desired_outputs - If Some(_), then it will filter the tar /// and only extract files specified in it. fn new( @@ -148,16 +148,16 @@ impl AsyncFileWriterInner { } } -/// AsyncFileWriter will pass the `Bytes` you give to another thread via +/// AsyncExtracter will pass the `Bytes` you give to another thread via /// a `mpsc` and decompress and unpack it if needed. /// /// # Cancellation /// -/// AsyncFileWriter removes the file if `done` isn't called. +/// AsyncExtracter removes the file if `done` isn't called. #[derive(Debug)] -pub struct AsyncFileWriter(ScopeGuard); +pub struct AsyncExtracter(ScopeGuard); -impl AsyncFileWriter { +impl AsyncExtracter { /// * `desired_outputs - If Some(_) and `fmt` is not `PkgFmt::Bin` or /// `PkgFmt::Zip`, then it will filter the tar and only extract files /// specified in it. @@ -166,8 +166,8 @@ impl AsyncFileWriter { fmt: PkgFmt, desired_outputs: Option<[Cow<'static, Path>; N]>, ) -> Self { - let inner = AsyncFileWriterInner::new(path, fmt, desired_outputs); - Self(guard(inner, AsyncFileWriterInner::abort)) + let inner = AsyncExtracterInner::new(path, fmt, desired_outputs); + Self(guard(inner, AsyncExtracterInner::abort)) } /// Upon error, this writer shall not be reused. diff --git a/src/helpers/readable_rx.rs b/src/helpers/readable_rx.rs index 8b387ab6..15aa1300 100644 --- a/src/helpers/readable_rx.rs +++ b/src/helpers/readable_rx.rs @@ -4,7 +4,7 @@ use std::io::{self, Read}; use bytes::{Buf, Bytes}; use tokio::sync::mpsc::Receiver; -use super::async_file_writer::Content; +use super::async_extracter::Content; #[derive(Debug)] pub(crate) struct ReadableRx<'a> { From 432376224f93ea89c254384975f7c4e63fdb2e0d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 22:01:51 +1000 Subject: [PATCH 0216/2020] Update doc of `AsyncExtracter` Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index ea581ebb..8f0b2e5e 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -151,16 +151,39 @@ impl AsyncExtracterInner { /// AsyncExtracter will pass the `Bytes` you give to another thread via /// a `mpsc` and decompress and unpack it if needed. /// -/// # Cancellation +/// After all write is done, you must call `AsyncExtracter::done`, +/// otherwise the extracted content will be removed on drop. /// -/// AsyncExtracter removes the file if `done` isn't called. +/// # Advantages +/// +/// `download_and_extract` has the following advantages over downloading +/// plus extracting in on the same thread: +/// +/// - The code is pipelined instead of storing the downloaded file in memory +/// and extract it, except for `PkgFmt::Zip`, since `ZipArchiver::new` +/// requires `std::io::Seek`, so it fallbacks to writing the a file then +/// unzip it. +/// - The async part (downloading) and the extracting part runs in parallel +/// using `tokio::spawn_nonblocking`. +/// - Compressing/writing which takes a lot of CPU time will not block +/// the runtime anymore. +/// - For any PkgFmt except for `PkgFmt::Zip` and `PkgFmt::Bin` (basically +/// all `tar` based formats), it can extract only specified files. +/// This means that `super::drivers::fetch_crate_cratesio` no longer need to +/// extract the whole crate and write them to disk, it now only extract the +/// relevant part (`Cargo.toml`) out to disk and open it. #[derive(Debug)] pub struct AsyncExtracter(ScopeGuard); impl AsyncExtracter { - /// * `desired_outputs - If Some(_) and `fmt` is not `PkgFmt::Bin` or - /// `PkgFmt::Zip`, then it will filter the tar and only extract files - /// specified in it. + /// * `path` - If `fmt` is `PkgFmt::Bin`, then this is the filename + /// for the bin. + /// Otherwise, it is the directory where the extracted content will be put. + /// * `fmt` - The format of the archive to feed in. + /// * `desired_outputs - If Some(_), then it will filter the tar and + /// only extract files specified in it. + /// Note that it only works when `fmt` is not `PkgFmt::Bin` or + /// `PkgFmt::Zip`. pub fn new( path: &Path, fmt: PkgFmt, From 8a812c8d220c6ccbe324b12e98c221649083e7df Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 22:09:46 +1000 Subject: [PATCH 0217/2020] Rename `AsyncExtracter::write` to `feed` Signed-off-by: Jiahao XU --- src/helpers.rs | 2 +- src/helpers/async_extracter.rs | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index bc7ce7c8..600b5755 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -74,7 +74,7 @@ pub async fn download_and_extract, const N: usize>( let mut extracter = AsyncExtracter::new(path, fmt, desired_outputs); while let Some(res) = bytes_stream.next().await { - extracter.write(res?).await?; + extracter.feed(res?).await?; } extracter.done().await?; diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 8f0b2e5e..066304c8 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -104,9 +104,9 @@ impl AsyncExtracterInner { Ok(()) } - /// Upon error, this writer shall not be reused. + /// Upon error, this extracter shall not be reused. /// Otherwise, `Self::done` would panic. - async fn write(&mut self, bytes: Bytes) -> Result<(), BinstallError> { + async fn feed(&mut self, bytes: Bytes) -> Result<(), BinstallError> { if self.tx.send(Content::Data(bytes)).await.is_err() { // task failed Err(Self::wait(&mut self.handle).await.expect_err( @@ -193,10 +193,10 @@ impl AsyncExtracter { Self(guard(inner, AsyncExtracterInner::abort)) } - /// Upon error, this writer shall not be reused. + /// Upon error, this extracter shall not be reused. /// Otherwise, `Self::done` would panic. - pub async fn write(&mut self, bytes: Bytes) -> Result<(), BinstallError> { - self.0.write(bytes).await + pub async fn feed(&mut self, bytes: Bytes) -> Result<(), BinstallError> { + self.0.feed(bytes).await } pub async fn done(self) -> Result<(), BinstallError> { From 00242a40c61bc6854c9501188dc06f4e96f0e429 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 22:22:39 +1000 Subject: [PATCH 0218/2020] Update doc for `AsyncExtracter::new` Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 066304c8..49594c3d 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -182,8 +182,8 @@ impl AsyncExtracter { /// * `fmt` - The format of the archive to feed in. /// * `desired_outputs - If Some(_), then it will filter the tar and /// only extract files specified in it. - /// Note that it only works when `fmt` is not `PkgFmt::Bin` or - /// `PkgFmt::Zip`. + /// Note that this is a best-effort and it only works when `fmt` + /// is not `PkgFmt::Bin` or `PkgFmt::Zip`. pub fn new( path: &Path, fmt: PkgFmt, From cadf045d0a12c493000b8d3f2a8c8ca326a1a00d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Jun 2022 22:28:48 +1000 Subject: [PATCH 0219/2020] Refactor: Abstract away `AsyncExtracter` by new fn `extract_archive_stream` Signed-off-by: Jiahao XU --- src/helpers.rs | 12 ++---------- src/helpers/async_extracter.rs | 35 ++++++++++++++++++++++++++++++---- 2 files changed, 33 insertions(+), 14 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 600b5755..da0a54c0 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -5,7 +5,6 @@ use std::{ }; use cargo_toml::Manifest; -use futures_util::stream::StreamExt; use log::{debug, info}; use reqwest::Method; use serde::Serialize; @@ -15,7 +14,7 @@ use url::Url; use crate::{BinstallError, Meta, PkgFmt}; mod async_extracter; -pub use async_extracter::AsyncExtracter; +pub use async_extracter::extract_archive_stream; mod auto_abort_join_handle; pub use auto_abort_join_handle::AutoAbortJoinHandle; @@ -70,14 +69,7 @@ pub async fn download_and_extract, const N: usize>( let path = path.as_ref(); debug!("Downloading to file: '{}'", path.display()); - let mut bytes_stream = resp.bytes_stream(); - let mut extracter = AsyncExtracter::new(path, fmt, desired_outputs); - - while let Some(res) = bytes_stream.next().await { - extracter.feed(res?).await?; - } - - extracter.done().await?; + extract_archive_stream(resp.bytes_stream(), path, fmt, desired_outputs).await?; debug!("Download OK, written to file: '{}'", path.display()); diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 49594c3d..4eed3276 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -4,6 +4,7 @@ use std::io::{self, Seek, Write}; use std::path::Path; use bytes::Bytes; +use futures_util::stream::{Stream, StreamExt}; use scopeguard::{guard, Always, ScopeGuard}; use tempfile::tempfile; use tokio::{sync::mpsc, task::spawn_blocking}; @@ -173,7 +174,7 @@ impl AsyncExtracterInner { /// extract the whole crate and write them to disk, it now only extract the /// relevant part (`Cargo.toml`) out to disk and open it. #[derive(Debug)] -pub struct AsyncExtracter(ScopeGuard); +struct AsyncExtracter(ScopeGuard); impl AsyncExtracter { /// * `path` - If `fmt` is `PkgFmt::Bin`, then this is the filename @@ -184,7 +185,7 @@ impl AsyncExtracter { /// only extract files specified in it. /// Note that this is a best-effort and it only works when `fmt` /// is not `PkgFmt::Bin` or `PkgFmt::Zip`. - pub fn new( + fn new( path: &Path, fmt: PkgFmt, desired_outputs: Option<[Cow<'static, Path>; N]>, @@ -195,11 +196,37 @@ impl AsyncExtracter { /// Upon error, this extracter shall not be reused. /// Otherwise, `Self::done` would panic. - pub async fn feed(&mut self, bytes: Bytes) -> Result<(), BinstallError> { + async fn feed(&mut self, bytes: Bytes) -> Result<(), BinstallError> { self.0.feed(bytes).await } - pub async fn done(self) -> Result<(), BinstallError> { + async fn done(self) -> Result<(), BinstallError> { ScopeGuard::into_inner(self.0).done().await } } + +/// * `output` - If `fmt` is `PkgFmt::Bin`, then this is the filename +/// for the bin. +/// Otherwise, it is the directory where the extracted content will be put. +/// * `fmt` - The format of the archive to feed in. +/// * `desired_outputs - If Some(_), then it will filter the tar and +/// only extract files specified in it. +/// Note that this is a best-effort and it only works when `fmt` +/// is not `PkgFmt::Bin` or `PkgFmt::Zip`. +pub async fn extract_archive_stream( + mut stream: impl Stream> + Unpin, + output: &Path, + fmt: PkgFmt, + desired_outputs: Option<[Cow<'static, Path>; N]>, +) -> Result<(), BinstallError> +where + BinstallError: From, +{ + let mut extracter = AsyncExtracter::new(output, fmt, desired_outputs); + + while let Some(res) = stream.next().await { + extracter.feed(res?).await?; + } + + extracter.done().await +} From 1c3a67210846c9cc17a3493661a113778f8f19ab Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 13:52:11 +1000 Subject: [PATCH 0220/2020] Rm `scopeguard` creatd for `mpsc::Receiver` Since `Receiver` always closes on drop, there is no need to call `Receiver::close`, which is there so that you can close the mpsc channel without dropping `Receiver`. Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 4eed3276..a35dec91 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -37,14 +37,9 @@ impl AsyncExtracterInner { desired_outputs: Option<[Cow<'static, Path>; N]>, ) -> Self { let path = path.to_owned(); - let (tx, rx) = mpsc::channel::(100); + let (tx, mut rx) = mpsc::channel::(100); let handle = AutoAbortJoinHandle::new(spawn_blocking(move || { - // close rx on error so that tx.send will return an error - let mut rx = guard(rx, |mut rx| { - rx.close(); - }); - fs::create_dir_all(path.parent().unwrap())?; match fmt { From 32ad530329e57e71fa86be2387cd39938aec1f0b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 13:54:43 +1000 Subject: [PATCH 0221/2020] Rm use of `AutoAbortJoinHandle` in `AsyncExtracter` Since there is no way to abort a blocking thread, using `AutoAbortJoinHandle` does not add any value. Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index a35dec91..a6a139b9 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -7,9 +7,12 @@ use bytes::Bytes; use futures_util::stream::{Stream, StreamExt}; use scopeguard::{guard, Always, ScopeGuard}; use tempfile::tempfile; -use tokio::{sync::mpsc, task::spawn_blocking}; +use tokio::{ + sync::mpsc, + task::{spawn_blocking, JoinHandle}, +}; -use super::{extracter::*, readable_rx::*, AutoAbortJoinHandle}; +use super::{extracter::*, readable_rx::*}; use crate::{BinstallError, PkgFmt}; pub(crate) enum Content { @@ -24,7 +27,7 @@ pub(crate) enum Content { struct AsyncExtracterInner { /// Use AutoAbortJoinHandle so that the task /// will be cancelled on failure. - handle: AutoAbortJoinHandle>, + handle: JoinHandle>, tx: mpsc::Sender, } @@ -39,7 +42,7 @@ impl AsyncExtracterInner { let path = path.to_owned(); let (tx, mut rx) = mpsc::channel::(100); - let handle = AutoAbortJoinHandle::new(spawn_blocking(move || { + let handle = spawn_blocking(move || { fs::create_dir_all(path.parent().unwrap())?; match fmt { @@ -77,7 +80,7 @@ impl AsyncExtracterInner { } Ok(()) - })); + }); Self { handle, tx } } @@ -121,9 +124,7 @@ impl AsyncExtracterInner { Self::wait(&mut self.handle).await } - async fn wait( - handle: &mut AutoAbortJoinHandle>, - ) -> Result<(), BinstallError> { + async fn wait(handle: &mut JoinHandle>) -> Result<(), BinstallError> { match handle.await { Ok(res) => res, Err(join_err) => Err(io::Error::new(io::ErrorKind::Other, join_err).into()), From d2e688c4c27e08e76e580b2925dac7de2a132e59 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 15:49:54 +1000 Subject: [PATCH 0222/2020] Fix `untar` when `desired_outputs` is not `None` Signed-off-by: Jiahao XU --- src/helpers/extracter.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index 41797210..cc2fa495 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -1,5 +1,5 @@ use std::borrow::Cow; -use std::fs::File; +use std::fs::{self, File}; use std::io::Read; use std::path::Path; @@ -29,6 +29,8 @@ fn untar( if desired_outputs.contains(&entry_path) { let dst = path.join(entry_path); + fs::create_dir_all(dst.parent().unwrap())?; + entry.unpack(dst)?; } } From fb5f61559b9b7c1449b3758329b923f28dc195df Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 15:50:56 +1000 Subject: [PATCH 0223/2020] Fix use of `download_and_extract` in `find_crate_cratesio` Signed-off-by: Jiahao XU --- src/drivers.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/drivers.rs b/src/drivers.rs index 3ddf654d..355ce3f7 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -102,16 +102,17 @@ pub async fn fetch_crate_cratesio( debug!("Fetching crate from: {crate_url} and extracting Cargo.toml from it"); + let crate_dir = format!("{name}-{version_name}"); + let crate_path = temp_dir.join(&crate_dir); + download_and_extract( Url::parse(&crate_url)?, PkgFmt::Tgz, &temp_dir, - Some([Path::new("Cargo.toml").into()]), + Some([Path::new(&crate_dir).join("Cargo.toml").into()]), ) .await?; - let crate_path = temp_dir.join(format!("{name}-{version_name}")); - // Return crate directory Ok(crate_path) } From a681f3a156728651e221c15396a2ee0898577f3c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 16:18:01 +1000 Subject: [PATCH 0224/2020] Add `debug!` logging to `untar` Signed-off-by: Jiahao XU --- src/helpers/extracter.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index cc2fa495..dd5831f4 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -22,11 +22,15 @@ fn untar( let mut tar = Archive::new(dat); if let Some(desired_outputs) = desired_outputs { + debug!("Untaring only {desired_outputs:#?}"); + for res in tar.entries()? { let mut entry = res?; let entry_path = entry.path()?; if desired_outputs.contains(&entry_path) { + debug!("Extracting {entry_path:#?}"); + let dst = path.join(entry_path); fs::create_dir_all(dst.parent().unwrap())?; @@ -35,6 +39,7 @@ fn untar( } } } else { + debug!("Untaring entire tar"); tar.unpack(path)?; } From 1d139324c7a1f5a4a43c80821c20186b9951f6c0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 16:35:51 +1000 Subject: [PATCH 0225/2020] Rewrite `untar`: Takes a `filter` fn instead of array Signed-off-by: Jiahao XU --- src/drivers.rs | 9 ++++++-- src/fetchers/gh_crate_meta.rs | 2 +- src/fetchers/quickinstall.rs | 3 ++- src/helpers.rs | 14 ++++++------ src/helpers/async_extracter.rs | 40 ++++++++++++++++------------------ src/helpers/extracter.rs | 35 +++++++++++++++-------------- 6 files changed, 55 insertions(+), 48 deletions(-) diff --git a/src/drivers.rs b/src/drivers.rs index 355ce3f7..9c36b051 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -102,14 +102,19 @@ pub async fn fetch_crate_cratesio( debug!("Fetching crate from: {crate_url} and extracting Cargo.toml from it"); - let crate_dir = format!("{name}-{version_name}"); + let crate_dir: PathBuf = format!("{name}-{version_name}").into(); let crate_path = temp_dir.join(&crate_dir); + let cargo_toml = crate_dir.join("Cargo.toml"); + let src = crate_dir.join("src"); + let main = src.join("main.rs"); + let bin = src.join("bin"); + download_and_extract( Url::parse(&crate_url)?, PkgFmt::Tgz, &temp_dir, - Some([Path::new(&crate_dir).join("Cargo.toml").into()]), + Some(move |path: &Path| path == cargo_toml || path == main || path.starts_with(&bin)), ) .await?; diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index c6ed669b..bc4575e6 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -43,7 +43,7 @@ impl super::Fetcher for GhCrateMeta { async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { let url = self.url()?; info!("Downloading package from: '{url}'"); - download_and_extract::<_, 0>(url, self.pkg_fmt(), dst, None).await + download_and_extract:: bool, _>(url, self.pkg_fmt(), dst, None).await } fn pkg_fmt(&self) -> PkgFmt { diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index f048de03..7d597d15 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -40,7 +40,8 @@ impl super::Fetcher for QuickInstall { async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { let url = self.package_url(); info!("Downloading package from: '{url}'"); - download_and_extract::<_, 0>(Url::parse(&url)?, self.pkg_fmt(), dst, None).await + download_and_extract:: bool, _>(Url::parse(&url)?, self.pkg_fmt(), dst, None) + .await } fn pkg_fmt(&self) -> PkgFmt { diff --git a/src/helpers.rs b/src/helpers.rs index da0a54c0..d81bb775 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,5 +1,4 @@ use std::{ - borrow::Cow, io::{stderr, stdin, Write}, path::{Path, PathBuf}, }; @@ -46,14 +45,15 @@ pub async fn remote_exists(url: Url, method: Method) -> Result, const N: usize>( +/// * `filter` - If Some, then it will pass the path of the file to it +/// and only extract ones which filter returns `true`. +/// Note that this is a best-effort and it only works when `fmt` +/// is not `PkgFmt::Bin` or `PkgFmt::Zip`. +pub async fn download_and_extract bool + Send + 'static, P: AsRef>( url: Url, fmt: PkgFmt, path: P, - desired_outputs: Option<[Cow<'static, Path>; N]>, + filter: Option, ) -> Result<(), BinstallError> { debug!("Downloading from: '{url}'"); @@ -69,7 +69,7 @@ pub async fn download_and_extract, const N: usize>( let path = path.as_ref(); debug!("Downloading to file: '{}'", path.display()); - extract_archive_stream(resp.bytes_stream(), path, fmt, desired_outputs).await?; + extract_archive_stream(resp.bytes_stream(), path, fmt, filter).await?; debug!("Download OK, written to file: '{}'", path.display()); diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 4eed3276..0b399ab4 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -1,4 +1,3 @@ -use std::borrow::Cow; use std::fs; use std::io::{self, Seek, Write}; use std::path::Path; @@ -29,12 +28,14 @@ struct AsyncExtracterInner { } impl AsyncExtracterInner { - /// * `desired_outputs - If Some(_), then it will filter the tar - /// and only extract files specified in it. - fn new( + /// * `filter` - If Some, then it will pass the path of the file to it + /// and only extract ones which filter returns `true`. + /// Note that this is a best-effort and it only works when `fmt` + /// is not `PkgFmt::Bin` or `PkgFmt::Zip`. + fn new bool + Send + 'static>( path: &Path, fmt: PkgFmt, - desired_outputs: Option<[Cow<'static, Path>; N]>, + filter: Option, ) -> Self { let path = path.to_owned(); let (tx, rx) = mpsc::channel::(100); @@ -73,12 +74,9 @@ impl AsyncExtracterInner { unzip(file, &path)?; } - _ => extract_compressed_from_readable( - ReadableRx::new(&mut rx), - fmt, - &path, - desired_outputs.as_ref().map(|arr| &arr[..]), - )?, + _ => { + extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt, &path, filter)? + } } Ok(()) @@ -181,16 +179,16 @@ impl AsyncExtracter { /// for the bin. /// Otherwise, it is the directory where the extracted content will be put. /// * `fmt` - The format of the archive to feed in. - /// * `desired_outputs - If Some(_), then it will filter the tar and - /// only extract files specified in it. + /// * `filter` - If Some, then it will pass the path of the file to it + /// and only extract ones which filter returns `true`. /// Note that this is a best-effort and it only works when `fmt` /// is not `PkgFmt::Bin` or `PkgFmt::Zip`. - fn new( + fn new bool + Send + 'static>( path: &Path, fmt: PkgFmt, - desired_outputs: Option<[Cow<'static, Path>; N]>, + filter: Option, ) -> Self { - let inner = AsyncExtracterInner::new(path, fmt, desired_outputs); + let inner = AsyncExtracterInner::new(path, fmt, filter); Self(guard(inner, AsyncExtracterInner::abort)) } @@ -209,20 +207,20 @@ impl AsyncExtracter { /// for the bin. /// Otherwise, it is the directory where the extracted content will be put. /// * `fmt` - The format of the archive to feed in. -/// * `desired_outputs - If Some(_), then it will filter the tar and -/// only extract files specified in it. +/// * `filter` - If Some, then it will pass the path of the file to it +/// and only extract ones which filter returns `true`. /// Note that this is a best-effort and it only works when `fmt` /// is not `PkgFmt::Bin` or `PkgFmt::Zip`. -pub async fn extract_archive_stream( +pub async fn extract_archive_stream bool + Send + 'static, E>( mut stream: impl Stream> + Unpin, output: &Path, fmt: PkgFmt, - desired_outputs: Option<[Cow<'static, Path>; N]>, + filter: Option, ) -> Result<(), BinstallError> where BinstallError: From, { - let mut extracter = AsyncExtracter::new(output, fmt, desired_outputs); + let mut extracter = AsyncExtracter::new(output, fmt, filter); while let Some(res) = stream.next().await { extracter.feed(res?).await?; diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index dd5831f4..fbb9d5c0 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -1,4 +1,3 @@ -use std::borrow::Cow; use std::fs::{self, File}; use std::io::Read; use std::path::Path; @@ -12,23 +11,25 @@ use zstd::stream::Decoder as ZstdDecoder; use crate::{BinstallError, PkgFmt}; -/// * `desired_outputs - If Some(_), then it will filter the tar -/// and only extract files specified in it. -fn untar( +/// * `filter` - If Some, then it will pass the path of the file to it +/// and only extract ones which filter returns `true`. +/// Note that this is a best-effort and it only works when `fmt` +/// is not `PkgFmt::Bin` or `PkgFmt::Zip`. +fn untar bool>( dat: impl Read, path: &Path, - desired_outputs: Option<&[Cow<'_, Path>]>, + filter: Option, ) -> Result<(), BinstallError> { let mut tar = Archive::new(dat); - if let Some(desired_outputs) = desired_outputs { - debug!("Untaring only {desired_outputs:#?}"); + if let Some(mut filter) = filter { + debug!("Untaring with filter"); for res in tar.entries()? { let mut entry = res?; let entry_path = entry.path()?; - if desired_outputs.contains(&entry_path) { + if filter(&entry_path) { debug!("Extracting {entry_path:#?}"); let dst = path.join(entry_path); @@ -49,34 +50,36 @@ fn untar( /// Extract files from the specified source onto the specified path. /// /// * `fmt` - must not be `PkgFmt::Bin` or `PkgFmt::Zip`. -/// * `desired_outputs - If Some(_), then it will filter the tar -/// and only extract files specified in it. -pub(crate) fn extract_compressed_from_readable( +/// * `filter` - If Some, then it will pass the path of the file to it +/// and only extract ones which filter returns `true`. +/// Note that this is a best-effort and it only works when `fmt` +/// is not `PkgFmt::Bin` or `PkgFmt::Zip`. +pub(crate) fn extract_compressed_from_readable bool>( dat: impl Read, fmt: PkgFmt, path: &Path, - desired_outputs: Option<&[Cow<'_, Path>]>, + filter: Option, ) -> Result<(), BinstallError> { match fmt { PkgFmt::Tar => { // Extract to install dir debug!("Extracting from tar archive to `{path:?}`"); - untar(dat, path, desired_outputs)? + untar(dat, path, filter)? } PkgFmt::Tgz => { // Extract to install dir debug!("Decompressing from tgz archive to `{path:?}`"); let tar = GzDecoder::new(dat); - untar(tar, path, desired_outputs)?; + untar(tar, path, filter)?; } PkgFmt::Txz => { // Extract to install dir debug!("Decompressing from txz archive to `{path:?}`"); let tar = XzDecoder::new(dat); - untar(tar, path, desired_outputs)?; + untar(tar, path, filter)?; } PkgFmt::Tzstd => { // Extract to install dir @@ -87,7 +90,7 @@ pub(crate) fn extract_compressed_from_readable( // as &[] by ZstdDecoder::new, thus ZstdDecoder::new // should not return any error. let tar = ZstdDecoder::new(dat)?; - untar(tar, path, desired_outputs)?; + untar(tar, path, filter)?; } PkgFmt::Zip => panic!("Unexpected PkgFmt::Zip!"), PkgFmt::Bin => panic!("Unexpected PkgFmt::Bin!"), From 62be22256b73ca15437d3bf5b7066a08b1b4ea72 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 16:37:48 +1000 Subject: [PATCH 0226/2020] Refactor: Extract `download_and_extract_with_filter` Signed-off-by: Jiahao XU --- src/drivers.rs | 2 +- src/fetchers/gh_crate_meta.rs | 2 +- src/fetchers/quickinstall.rs | 3 +-- src/helpers.rs | 17 +++++++++++++++-- 4 files changed, 18 insertions(+), 6 deletions(-) diff --git a/src/drivers.rs b/src/drivers.rs index 9c36b051..b16513d9 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -110,7 +110,7 @@ pub async fn fetch_crate_cratesio( let main = src.join("main.rs"); let bin = src.join("bin"); - download_and_extract( + download_and_extract_with_filter( Url::parse(&crate_url)?, PkgFmt::Tgz, &temp_dir, diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index bc4575e6..82bdf3bc 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -43,7 +43,7 @@ impl super::Fetcher for GhCrateMeta { async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { let url = self.url()?; info!("Downloading package from: '{url}'"); - download_and_extract:: bool, _>(url, self.pkg_fmt(), dst, None).await + download_and_extract(url, self.pkg_fmt(), dst).await } fn pkg_fmt(&self) -> PkgFmt { diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index 7d597d15..7d6ed14a 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -40,8 +40,7 @@ impl super::Fetcher for QuickInstall { async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { let url = self.package_url(); info!("Downloading package from: '{url}'"); - download_and_extract:: bool, _>(Url::parse(&url)?, self.pkg_fmt(), dst, None) - .await + download_and_extract(Url::parse(&url)?, self.pkg_fmt(), dst).await } fn pkg_fmt(&self) -> PkgFmt { diff --git a/src/helpers.rs b/src/helpers.rs index d81bb775..679328cd 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -43,13 +43,26 @@ pub async fn remote_exists(url: Url, method: Method) -> Result>( + url: Url, + fmt: PkgFmt, + path: P, +) -> Result<(), BinstallError> { + download_and_extract_with_filter:: bool, _>(url, fmt, path.as_ref(), None).await +} + +/// Download a file from the provided URL and extract part of it to +/// the provided path. /// /// * `filter` - If Some, then it will pass the path of the file to it /// and only extract ones which filter returns `true`. /// Note that this is a best-effort and it only works when `fmt` /// is not `PkgFmt::Bin` or `PkgFmt::Zip`. -pub async fn download_and_extract bool + Send + 'static, P: AsRef>( +pub async fn download_and_extract_with_filter< + Filter: FnMut(&Path) -> bool + Send + 'static, + P: AsRef, +>( url: Url, fmt: PkgFmt, path: P, From b0598a1fad8cb02a103f17ff152a561f4875f07b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 16:38:45 +1000 Subject: [PATCH 0227/2020] Update workflow rust: Test `find_crate_cratesio` by removing `--manifest-path` Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 3b26bb66..7b0ed8af 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -164,4 +164,4 @@ jobs: run: unzip cargo-binstall-${{ matrix.target }}.zip - name: "Run binstall" - run: ./${{ matrix.output }} cargo-binstall --manifest-path . --no-confirm + run: ./${{ matrix.output }} cargo-binstall --no-confirm From 3e5c7ec43fcfadcb4da9ebcb272570c66839ebf9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 16:49:09 +1000 Subject: [PATCH 0228/2020] Add back testing of `--manifest-path` in workflow `rust` Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7b0ed8af..abe55e7b 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -165,3 +165,6 @@ jobs: - name: "Run binstall" run: ./${{ matrix.output }} cargo-binstall --no-confirm + + - name: "Run binstall with manifest" + run: ./${{ matrix.output }} cargo-binstall --manifest-path . --no-confirm From d4495cc3bb128703b38ebc122dd209d716d1df59 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 16:52:24 +1000 Subject: [PATCH 0229/2020] Merge job test into job build to speedup workflow so that testing does not have to wait for all build jobs with different configurations to finish before starting. Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 61 ++++++-------------------------------- 1 file changed, 9 insertions(+), 52 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index abe55e7b..e0067ac1 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -12,7 +12,7 @@ env: jobs: build: - name: Build + name: Build and Test runs-on: ${{ matrix.os }} strategy: @@ -90,6 +90,14 @@ jobs: - name: Copy and rename utility run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} + - name: Test + run: for bin in $bins; do ./${{ matrix.output }} cargo-binstall --no-confirm $bin; $done + env: + bins: cargo-binstall + + - name: "Test binstall with manifest" + run: ./${{ matrix.output }} cargo-binstall --manifest-path . --no-confirm + - name: Create archive (tgz, linux) if: ${{ matrix.os != 'macos-latest' && matrix.os != 'windows-latest' }} run: tar -czvf cargo-binstall-${{ matrix.target }}.tgz ${{ matrix.output }} @@ -117,54 +125,3 @@ jobs: asset_name: cargo-binstall-${{ matrix.target }}.${{ matrix.archive }} tag: ${{ github.ref }} overwrite: true - - test: - name: Test - runs-on: ${{ matrix.os }} - needs: build - strategy: - fail-fast: false - matrix: - include: - - target: x86_64-unknown-linux-gnu - os: ubuntu-latest - output: cargo-binstall - archive: tgz - - target: x86_64-apple-darwin - os: macos-latest - output: cargo-binstall - archive: zip - - target: x86_64-pc-windows-msvc - os: windows-latest - output: cargo-binstall.exe - archive: zip - - target: x86_64-unknown-linux-musl - os: ubuntu-latest - output: cargo-binstall - archive: tgz - - steps: - - uses: actions/checkout@v2 - - uses: FranzDiebold/github-env-vars-action@v1.2.1 - - - uses: actions/download-artifact@v2 - with: - name: cargo-binstall-${{ matrix.target }}.${{ matrix.archive }} - - - name: "Extract build artifact (tgz, linux)" - if: ${{ matrix.os != 'windows-latest' && matrix.os != 'macos-latest' }} - run: tar -xvf cargo-binstall-${{ matrix.target }}.tgz - - - name: "Extract build artifact (zip, windows)" - if: ${{ matrix.os == 'windows-latest' }} - run: tar.exe -xvf cargo-binstall-${{ matrix.target }}.zip - - - name: "Extract build artifact (zip, macos)" - if: ${{ matrix.os == 'macos-latest' }} - run: unzip cargo-binstall-${{ matrix.target }}.zip - - - name: "Run binstall" - run: ./${{ matrix.output }} cargo-binstall --no-confirm - - - name: "Run binstall with manifest" - run: ./${{ matrix.output }} cargo-binstall --manifest-path . --no-confirm From 4ff64dee34abe9e8882a09aeb70dcf7f4baad5f1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 16:53:34 +1000 Subject: [PATCH 0230/2020] Fix caching: Only cache `.cargo/{git, registry}` Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index e0067ac1..fc05a41e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -73,7 +73,8 @@ jobs: with: key: ${{ matrix.os }}-${{ matrix.target }} path: | - ${{ env.HOME }}/.cargo + ${{ env.HOME }}/.cargo/git + ${{ env.HOME }}/.cargo/registry target - name: Install musl-tools From 665564420ac79138920876aafbae45d6a4316e6c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 16:54:55 +1000 Subject: [PATCH 0231/2020] Add more bins to test in job "Test installing bins" Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index fc05a41e..df27f99e 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -91,12 +91,12 @@ jobs: - name: Copy and rename utility run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} - - name: Test + - name: Test installing bins run: for bin in $bins; do ./${{ matrix.output }} cargo-binstall --no-confirm $bin; $done env: - bins: cargo-binstall + bins: cargo-bindgen cbindgen cargo-deb cargo-llvm-cov cargo-binstall - - name: "Test binstall with manifest" + - name: Test binstall with manifest run: ./${{ matrix.output }} cargo-binstall --manifest-path . --no-confirm - name: Create archive (tgz, linux) From 53c9d667ce08d7494f0c1f1b9f6fc91c27a85623 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 16:55:21 +1000 Subject: [PATCH 0232/2020] Enable caching on macos as issue has been fixed Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index df27f99e..cf525e4a 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -68,8 +68,6 @@ jobs: - name: Configure caching uses: actions/cache@v2 - # Caching disabled on macos due to https://github.com/actions/cache/issues/403 - if: ${{ matrix.os != 'macos-latest' }} with: key: ${{ matrix.os }}-${{ matrix.target }} path: | From d038e77978f40a8d73d73ce35072dae0b7dedf97 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 17:02:18 +1000 Subject: [PATCH 0233/2020] Fix typo in step "Test installing bins" Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index cf525e4a..be604263 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -90,7 +90,7 @@ jobs: run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} - name: Test installing bins - run: for bin in $bins; do ./${{ matrix.output }} cargo-binstall --no-confirm $bin; $done + run: for bin in $bins; do ./${{ matrix.output }} cargo-binstall --no-confirm $bin; done env: bins: cargo-bindgen cbindgen cargo-deb cargo-llvm-cov cargo-binstall From 57d2b4c3b4d5a2960b0545e0402673c104fdd2b3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 17:07:59 +1000 Subject: [PATCH 0234/2020] Run job "Test binstall" only natively Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index be604263..f31346a8 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -24,36 +24,43 @@ jobs: output: cargo-binstall archive: tgz use-cross: false + test: true - target: x86_64-apple-darwin os: macos-latest output: cargo-binstall archive: zip use-cross: false + test: true - target: aarch64-apple-darwin os: macos-latest output: cargo-binstall archive: zip use-cross: false + test: false - target: x86_64-pc-windows-msvc os: windows-latest output: cargo-binstall.exe archive: zip use-cross: false + test: true - target: x86_64-unknown-linux-musl os: ubuntu-latest output: cargo-binstall archive: tgz use-cross: false + test: true - target: armv7-unknown-linux-musleabihf os: ubuntu-20.04 output: cargo-binstall archive: tgz use-cross: true + test: false - target: aarch64-unknown-linux-musl os: ubuntu-latest output: cargo-binstall archive: tgz use-cross: true + test: false steps: - uses: actions/checkout@v2 @@ -90,11 +97,13 @@ jobs: run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} - name: Test installing bins + if: ${{ matrix.test == 'true' }} run: for bin in $bins; do ./${{ matrix.output }} cargo-binstall --no-confirm $bin; done env: bins: cargo-bindgen cbindgen cargo-deb cargo-llvm-cov cargo-binstall - name: Test binstall with manifest + if: ${{ matrix.test == 'true' }} run: ./${{ matrix.output }} cargo-binstall --manifest-path . --no-confirm - name: Create archive (tgz, linux) From 68942f56e48ca59e4234745d2095c773f4fd777d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 17:08:54 +1000 Subject: [PATCH 0235/2020] Merge two testing step into one in workflow `rust` Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f31346a8..246485ff 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -96,16 +96,14 @@ jobs: - name: Copy and rename utility run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} - - name: Test installing bins + - name: Test if: ${{ matrix.test == 'true' }} - run: for bin in $bins; do ./${{ matrix.output }} cargo-binstall --no-confirm $bin; done + run: | + for bin in $bins; do ./${{ matrix.output }} cargo-binstall --no-confirm $bin; done + ./${{ matrix.output }} cargo-binstall --manifest-path . --no-confirm env: bins: cargo-bindgen cbindgen cargo-deb cargo-llvm-cov cargo-binstall - - name: Test binstall with manifest - if: ${{ matrix.test == 'true' }} - run: ./${{ matrix.output }} cargo-binstall --manifest-path . --no-confirm - - name: Create archive (tgz, linux) if: ${{ matrix.os != 'macos-latest' && matrix.os != 'windows-latest' }} run: tar -czvf cargo-binstall-${{ matrix.target }}.tgz ${{ matrix.output }} From dc5978e73737e94ddbbc713e466d89422d41bb19 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 17:12:35 +1000 Subject: [PATCH 0236/2020] Fix step "Test": Fix invoking `cargo-binstall` directly Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 246485ff..72ad6eee 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -99,8 +99,8 @@ jobs: - name: Test if: ${{ matrix.test == 'true' }} run: | - for bin in $bins; do ./${{ matrix.output }} cargo-binstall --no-confirm $bin; done - ./${{ matrix.output }} cargo-binstall --manifest-path . --no-confirm + for bin in $bins; do ./${{ matrix.output }} binstall --no-confirm $bin; done + ./${{ matrix.output }} binstall --manifest-path . --no-confirm cargo-binstall env: bins: cargo-bindgen cbindgen cargo-deb cargo-llvm-cov cargo-binstall From e312a22ba200fbf99a48ae819a512acb52dea2e6 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 17:19:21 +1000 Subject: [PATCH 0237/2020] `set -euxo pipefail` in step "Test" Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 72ad6eee..294df150 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -99,6 +99,7 @@ jobs: - name: Test if: ${{ matrix.test == 'true' }} run: | + set -euxo pipefail for bin in $bins; do ./${{ matrix.output }} binstall --no-confirm $bin; done ./${{ matrix.output }} binstall --manifest-path . --no-confirm cargo-binstall env: From ea71cede42337a08311c3003d86b3220c88521af Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 17:28:23 +1000 Subject: [PATCH 0238/2020] Fix `if` cond for step "Test" Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 294df150..926d6bd6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -97,7 +97,7 @@ jobs: run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} - name: Test - if: ${{ matrix.test == 'true' }} + if: ${{ matrix.test }} run: | set -euxo pipefail for bin in $bins; do ./${{ matrix.output }} binstall --no-confirm $bin; done From cfa6090e6e71f21c437c6e4174bfee6cbb163c87 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 17:32:38 +1000 Subject: [PATCH 0239/2020] Rm non-existent crate in step "Test" Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 926d6bd6..4efb2cd7 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -103,7 +103,7 @@ jobs: for bin in $bins; do ./${{ matrix.output }} binstall --no-confirm $bin; done ./${{ matrix.output }} binstall --manifest-path . --no-confirm cargo-binstall env: - bins: cargo-bindgen cbindgen cargo-deb cargo-llvm-cov cargo-binstall + bins: cbindgen cargo-deb cargo-llvm-cov cargo-binstall - name: Create archive (tgz, linux) if: ${{ matrix.os != 'macos-latest' && matrix.os != 'windows-latest' }} From fbcfe369da4386a40e187ffa934d2ae05ed21370 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 18:16:28 +1000 Subject: [PATCH 0240/2020] Rm cbindgen from `bins` in step "Test" Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4efb2cd7..0ab5c628 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -103,7 +103,7 @@ jobs: for bin in $bins; do ./${{ matrix.output }} binstall --no-confirm $bin; done ./${{ matrix.output }} binstall --manifest-path . --no-confirm cargo-binstall env: - bins: cbindgen cargo-deb cargo-llvm-cov cargo-binstall + bins: cargo-deb cargo-llvm-cov cargo-binstall - name: Create archive (tgz, linux) if: ${{ matrix.os != 'macos-latest' && matrix.os != 'windows-latest' }} From 4297b13ed95be042a6c34bf0ec8e1d877787b433 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 18:20:59 +1000 Subject: [PATCH 0241/2020] Fix testing on Windows Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 0ab5c628..ad99d9a5 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -42,7 +42,7 @@ jobs: output: cargo-binstall.exe archive: zip use-cross: false - test: true + test: false - target: x86_64-unknown-linux-musl os: ubuntu-latest output: cargo-binstall @@ -96,8 +96,8 @@ jobs: - name: Copy and rename utility run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} - - name: Test - if: ${{ matrix.test }} + - name: Test (Unix) + if: ${{ matrix.test && matrix.os != 'windows-latest' }} run: | set -euxo pipefail for bin in $bins; do ./${{ matrix.output }} binstall --no-confirm $bin; done @@ -105,6 +105,12 @@ jobs: env: bins: cargo-deb cargo-llvm-cov cargo-binstall + - name: Test (Windows) + if: ${{ matrix.os == 'windows-latest' }} + run: | + ./${{ matrix.output }} binstall --no-confirm cargo-binstall + ./${{ matrix.output }} binstall --manifest-path . --no-confirm cargo-binstall + - name: Create archive (tgz, linux) if: ${{ matrix.os != 'macos-latest' && matrix.os != 'windows-latest' }} run: tar -czvf cargo-binstall-${{ matrix.target }}.tgz ${{ matrix.output }} From c1809d41fa9e17204871405fce4471ae674bb175 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 12:43:01 +1000 Subject: [PATCH 0242/2020] Refactor: Extract `confirm` into a new mod Signed-off-by: Jiahao XU --- src/helpers.rs | 23 +++++------------------ src/helpers/confirm.rs | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+), 18 deletions(-) create mode 100644 src/helpers/confirm.rs diff --git a/src/helpers.rs b/src/helpers.rs index 679328cd..9b71d3e1 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,10 +1,11 @@ use std::{ + borrow::Cow, io::{stderr, stdin, Write}, path::{Path, PathBuf}, }; use cargo_toml::Manifest; -use log::{debug, info}; +use log::debug; use reqwest::Method; use serde::Serialize; use tinytemplate::TinyTemplate; @@ -18,6 +19,9 @@ pub use async_extracter::extract_archive_stream; mod auto_abort_join_handle; pub use auto_abort_join_handle::AutoAbortJoinHandle; +mod confirm; +pub use confirm::confirm; + mod extracter; mod readable_rx; @@ -129,23 +133,6 @@ pub fn get_install_path>(install_path: Option

) -> Option Result<(), BinstallError> { - loop { - info!("Do you wish to continue? yes/[no]"); - eprint!("? "); - stderr().flush().ok(); - - let mut input = String::new(); - stdin().read_line(&mut input).unwrap(); - - match input.as_str().trim() { - "yes" | "y" | "YES" | "Y" => break Ok(()), - "no" | "n" | "NO" | "N" | "" => break Err(BinstallError::UserAbort), - _ => continue, - } - } -} - pub trait Template: Serialize { fn render(&self, template: &str) -> Result where diff --git a/src/helpers/confirm.rs b/src/helpers/confirm.rs new file mode 100644 index 00000000..8872bc2b --- /dev/null +++ b/src/helpers/confirm.rs @@ -0,0 +1,21 @@ +use log::info; +use std::io::{stderr, stdin, Write}; + +use crate::BinstallError; + +pub fn confirm() -> Result<(), BinstallError> { + loop { + info!("Do you wish to continue? yes/[no]"); + eprint!("? "); + stderr().flush().ok(); + + let mut input = String::new(); + stdin().read_line(&mut input).unwrap(); + + match input.as_str().trim() { + "yes" | "y" | "YES" | "Y" => break Ok(()), + "no" | "n" | "NO" | "N" | "" => break Err(BinstallError::UserAbort), + _ => continue, + } + } +} From dd2fa2de3313d164f5f4c14bb67934eb0ef445eb Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 13:27:28 +1000 Subject: [PATCH 0243/2020] Impl `helpers::confirm::Confirmer` Signed-off-by: Jiahao XU --- src/helpers.rs | 2 +- src/helpers/confirm.rs | 102 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 100 insertions(+), 4 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 9b71d3e1..a55b6a37 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -20,7 +20,7 @@ mod auto_abort_join_handle; pub use auto_abort_join_handle::AutoAbortJoinHandle; mod confirm; -pub use confirm::confirm; +pub use confirm::{confirm, Confirmer}; mod extracter; mod readable_rx; diff --git a/src/helpers/confirm.rs b/src/helpers/confirm.rs index 8872bc2b..30102aa4 100644 --- a/src/helpers/confirm.rs +++ b/src/helpers/confirm.rs @@ -1,5 +1,8 @@ +use std::io::{self, BufRead, Write}; + use log::info; -use std::io::{stderr, stdin, Write}; +use tokio::sync::mpsc; +use tokio::task::spawn_blocking; use crate::BinstallError; @@ -7,10 +10,10 @@ pub fn confirm() -> Result<(), BinstallError> { loop { info!("Do you wish to continue? yes/[no]"); eprint!("? "); - stderr().flush().ok(); + io::stderr().flush().ok(); let mut input = String::new(); - stdin().read_line(&mut input).unwrap(); + io::stdin().read_line(&mut input).unwrap(); match input.as_str().trim() { "yes" | "y" | "YES" | "Y" => break Ok(()), @@ -19,3 +22,96 @@ pub fn confirm() -> Result<(), BinstallError> { } } } + +#[derive(Debug)] +struct ConfirmerInner { + /// Request for confirmation + request_tx: mpsc::Sender<()>, + + /// Confirmation + confirm_rx: mpsc::Receiver>, +} + +impl ConfirmerInner { + fn new() -> Self { + let (request_tx, mut request_rx) = mpsc::channel(1); + let (confirm_tx, confirm_rx) = mpsc::channel(10); + + spawn_blocking(move || { + // This task should be the only one able to + // access stdin + let mut stdin = io::stdin().lock(); + let mut input = String::with_capacity(16); + + loop { + if request_rx.blocking_recv().is_none() { + break; + } + + // Lock stdout so that nobody can interfere + // with confirmation. + let mut stdout = io::stdout().lock(); + + let res = loop { + writeln!(&mut stdout, "Do you wish to continue? yes/[no]").unwrap(); + write!(&mut stdout, "? ").unwrap(); + stdout.flush().unwrap(); + + input.clear(); + if stdin.read_line(&mut input).is_err() { + break Err(BinstallError::UserAbort); + } + + match input.as_str().trim() { + "yes" | "y" | "YES" | "Y" => break Ok(()), + "no" | "n" | "NO" | "N" | "" => break Err(BinstallError::UserAbort), + _ => continue, + } + }; + + confirm_tx + .blocking_send(res) + .expect("entry exits when confirming request"); + } + }); + + Self { + request_tx, + confirm_rx, + } + } + + async fn confirm(&mut self) -> Result<(), BinstallError> { + self.request_tx + .send(()) + .await + .map_err(|_| BinstallError::UserAbort)?; + + self.confirm_rx + .recv() + .await + .unwrap_or(Err(BinstallError::UserAbort)) + } +} + +#[derive(Debug)] +pub struct Confirmer(Option); + +impl Confirmer { + /// * `enable` - `true` to enable confirmation, `false` to disable it. + pub fn new(enable: bool) -> Self { + Self(if enable { + Some(ConfirmerInner::new()) + } else { + None + }) + } + + pub async fn confirm(&mut self) -> Result<(), BinstallError> { + if let Some(inner) = self.0.as_mut() { + inner.confirm().await + } else { + Ok(()) + } + } +} From 47ed7ce27befd8d45e965bd9d7e3f1816591f4d6 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 13:31:50 +1000 Subject: [PATCH 0244/2020] Use `Confirmer` instead of `confirm` in `main.rs` Signed-off-by: Jiahao XU --- src/main.rs | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/src/main.rs b/src/main.rs index 55ce22bb..62d71439 100644 --- a/src/main.rs +++ b/src/main.rs @@ -191,6 +191,8 @@ async fn entry() -> Result<()> { ) .unwrap(); + let mut confirmer = Confirmer::new(!opts.no_confirm); + // Compute install directory let install_path = get_install_path(opts.install_path.as_deref()).ok_or_else(|| { error!("No viable install path found of specified, try `--install-path`"); @@ -228,8 +230,8 @@ async fn entry() -> Result<()> { }) ); - if !opts.no_confirm && !opts.dry_run { - confirm()?; + if !opts.dry_run { + confirmer.confirm().await?; } } @@ -303,6 +305,7 @@ async fn entry() -> Result<()> { opts, package, temp_dir, + &mut confirmer, ) .await } @@ -317,7 +320,7 @@ async fn entry() -> Result<()> { .first() .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; - install_from_source(opts, package, target).await + install_from_source(opts, package, target, &mut confirmer).await } } } @@ -331,6 +334,7 @@ async fn install_from_package( opts: Options, package: Package, temp_dir: TempDir, + confirmer: &mut Confirmer, ) -> Result<()> { // Prompt user for third-party source if fetcher.is_third_party() { @@ -338,8 +342,8 @@ async fn install_from_package( "The package will be downloaded from third-party source {}", fetcher.source_name() ); - if !opts.no_confirm && !opts.dry_run { - confirm()?; + if !opts.dry_run { + confirmer.confirm().await?; } } else { info!( @@ -429,9 +433,7 @@ async fn install_from_package( return Ok(()); } - if !opts.no_confirm { - confirm()?; - } + confirmer.confirm().await?; info!("Installing binaries..."); for file in &bin_files { @@ -456,11 +458,16 @@ async fn install_from_package( Ok(()) } -async fn install_from_source(opts: Options, package: Package, target: &str) -> Result<()> { +async fn install_from_source( + opts: Options, + package: Package, + target: &str, + confirmer: &mut Confirmer, +) -> Result<()> { // Prompt user for source install warn!("The package will be installed from source (with cargo)",); - if !opts.no_confirm && !opts.dry_run { - confirm()?; + if !opts.dry_run { + confirmer.confirm().await?; } if opts.dry_run { From b2bf065a2b959d8ccc7b9e76a43038d81bf45514 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 13:32:28 +1000 Subject: [PATCH 0245/2020] Rm unused fn `helpers::confirm::confirm` Signed-off-by: Jiahao XU --- src/helpers.rs | 2 +- src/helpers/confirm.rs | 18 ------------------ 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index a55b6a37..0266b89a 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -20,7 +20,7 @@ mod auto_abort_join_handle; pub use auto_abort_join_handle::AutoAbortJoinHandle; mod confirm; -pub use confirm::{confirm, Confirmer}; +pub use confirm::Confirmer; mod extracter; mod readable_rx; diff --git a/src/helpers/confirm.rs b/src/helpers/confirm.rs index 30102aa4..568be460 100644 --- a/src/helpers/confirm.rs +++ b/src/helpers/confirm.rs @@ -1,28 +1,10 @@ use std::io::{self, BufRead, Write}; -use log::info; use tokio::sync::mpsc; use tokio::task::spawn_blocking; use crate::BinstallError; -pub fn confirm() -> Result<(), BinstallError> { - loop { - info!("Do you wish to continue? yes/[no]"); - eprint!("? "); - io::stderr().flush().ok(); - - let mut input = String::new(); - io::stdin().read_line(&mut input).unwrap(); - - match input.as_str().trim() { - "yes" | "y" | "YES" | "Y" => break Ok(()), - "no" | "n" | "NO" | "N" | "" => break Err(BinstallError::UserAbort), - _ => continue, - } - } -} - #[derive(Debug)] struct ConfirmerInner { /// Request for confirmation From 9349fbabdcbeb30d1eaf3b5cf172a3cdffc6a853 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 13:38:35 +1000 Subject: [PATCH 0246/2020] `Unwrap` in `Confirmer` task if failed to read Signed-off-by: Jiahao XU --- src/helpers/confirm.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/helpers/confirm.rs b/src/helpers/confirm.rs index 568be460..088a2aa7 100644 --- a/src/helpers/confirm.rs +++ b/src/helpers/confirm.rs @@ -40,9 +40,7 @@ impl ConfirmerInner { stdout.flush().unwrap(); input.clear(); - if stdin.read_line(&mut input).is_err() { - break Err(BinstallError::UserAbort); - } + stdin.read_line(&mut input).unwrap(); match input.as_str().trim() { "yes" | "y" | "YES" | "Y" => break Ok(()), From 88c3f15b3f48c2dd56f2c5498df5b5eed8f718f9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 13:45:20 +1000 Subject: [PATCH 0247/2020] Rename `Confirmer` to `UIThread` Signed-off-by: Jiahao XU --- src/helpers.rs | 4 ++-- src/helpers/{confirm.rs => ui_thread.rs} | 10 +++++----- src/main.rs | 18 +++++++++--------- 3 files changed, 16 insertions(+), 16 deletions(-) rename src/helpers/{confirm.rs => ui_thread.rs} (94%) diff --git a/src/helpers.rs b/src/helpers.rs index 0266b89a..5ae86896 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -19,8 +19,8 @@ pub use async_extracter::extract_archive_stream; mod auto_abort_join_handle; pub use auto_abort_join_handle::AutoAbortJoinHandle; -mod confirm; -pub use confirm::Confirmer; +mod ui_thread; +pub use ui_thread::UIThread; mod extracter; mod readable_rx; diff --git a/src/helpers/confirm.rs b/src/helpers/ui_thread.rs similarity index 94% rename from src/helpers/confirm.rs rename to src/helpers/ui_thread.rs index 088a2aa7..8daf945c 100644 --- a/src/helpers/confirm.rs +++ b/src/helpers/ui_thread.rs @@ -6,7 +6,7 @@ use tokio::task::spawn_blocking; use crate::BinstallError; #[derive(Debug)] -struct ConfirmerInner { +struct UIThreadInner { /// Request for confirmation request_tx: mpsc::Sender<()>, @@ -14,7 +14,7 @@ struct ConfirmerInner { confirm_rx: mpsc::Receiver>, } -impl ConfirmerInner { +impl UIThreadInner { fn new() -> Self { let (request_tx, mut request_rx) = mpsc::channel(1); let (confirm_tx, confirm_rx) = mpsc::channel(10); @@ -75,13 +75,13 @@ impl ConfirmerInner { } #[derive(Debug)] -pub struct Confirmer(Option); +pub struct UIThread(Option); -impl Confirmer { +impl UIThread { /// * `enable` - `true` to enable confirmation, `false` to disable it. pub fn new(enable: bool) -> Self { Self(if enable { - Some(ConfirmerInner::new()) + Some(UIThreadInner::new()) } else { None }) diff --git a/src/main.rs b/src/main.rs index 62d71439..5b89353c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -191,7 +191,7 @@ async fn entry() -> Result<()> { ) .unwrap(); - let mut confirmer = Confirmer::new(!opts.no_confirm); + let mut uithread = UIThread::new(!opts.no_confirm); // Compute install directory let install_path = get_install_path(opts.install_path.as_deref()).ok_or_else(|| { @@ -231,7 +231,7 @@ async fn entry() -> Result<()> { ); if !opts.dry_run { - confirmer.confirm().await?; + uithread.confirm().await?; } } @@ -305,7 +305,7 @@ async fn entry() -> Result<()> { opts, package, temp_dir, - &mut confirmer, + &mut uithread, ) .await } @@ -320,7 +320,7 @@ async fn entry() -> Result<()> { .first() .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; - install_from_source(opts, package, target, &mut confirmer).await + install_from_source(opts, package, target, &mut uithread).await } } } @@ -334,7 +334,7 @@ async fn install_from_package( opts: Options, package: Package, temp_dir: TempDir, - confirmer: &mut Confirmer, + uithread: &mut UIThread, ) -> Result<()> { // Prompt user for third-party source if fetcher.is_third_party() { @@ -343,7 +343,7 @@ async fn install_from_package( fetcher.source_name() ); if !opts.dry_run { - confirmer.confirm().await?; + uithread.confirm().await?; } } else { info!( @@ -433,7 +433,7 @@ async fn install_from_package( return Ok(()); } - confirmer.confirm().await?; + uithread.confirm().await?; info!("Installing binaries..."); for file in &bin_files { @@ -462,12 +462,12 @@ async fn install_from_source( opts: Options, package: Package, target: &str, - confirmer: &mut Confirmer, + uithread: &mut UIThread, ) -> Result<()> { // Prompt user for source install warn!("The package will be installed from source (with cargo)",); if !opts.dry_run { - confirmer.confirm().await?; + uithread.confirm().await?; } if opts.dry_run { From 4c210fd2c3ca73a54a27355b2ebe448c663f9a1b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 12:59:41 +1000 Subject: [PATCH 0248/2020] Rm unused imports in mod `helpers` Signed-off-by: Jiahao XU --- src/helpers.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 5ae86896..5d6d350a 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,6 +1,4 @@ use std::{ - borrow::Cow, - io::{stderr, stdin, Write}, path::{Path, PathBuf}, }; From ac22db5e79f1d4fbdea2da5c45c5c08621fb19be Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 14:37:14 +1000 Subject: [PATCH 0249/2020] Set log level to debug in step "Test" Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index ad99d9a5..4b2b58e6 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -100,8 +100,8 @@ jobs: if: ${{ matrix.test && matrix.os != 'windows-latest' }} run: | set -euxo pipefail - for bin in $bins; do ./${{ matrix.output }} binstall --no-confirm $bin; done - ./${{ matrix.output }} binstall --manifest-path . --no-confirm cargo-binstall + for bin in $bins; do ./${{ matrix.output }} binstall --log-level debug --no-confirm $bin; done + ./${{ matrix.output }} binstall --log-level debug --manifest-path . --no-confirm cargo-binstall env: bins: cargo-deb cargo-llvm-cov cargo-binstall From e753c9ec305db4b324962253db9d179aec9f118c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Jun 2022 19:49:09 +1000 Subject: [PATCH 0250/2020] Impl `BufRead` for `ReadableRx` Signed-off-by: Jiahao XU --- src/helpers/readable_rx.rs | 35 +++++++++++++++++++++++++---------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/src/helpers/readable_rx.rs b/src/helpers/readable_rx.rs index 15aa1300..545bc176 100644 --- a/src/helpers/readable_rx.rs +++ b/src/helpers/readable_rx.rs @@ -1,5 +1,5 @@ use std::cmp::min; -use std::io::{self, Read}; +use std::io::{self, BufRead, Read}; use bytes::{Buf, Bytes}; use tokio::sync::mpsc::Receiver; @@ -27,17 +27,12 @@ impl Read for ReadableRx<'_> { return Ok(0); } - let bytes = &mut self.bytes; - if !bytes.has_remaining() { - match self.rx.blocking_recv() { - Some(Content::Data(new_bytes)) => *bytes = new_bytes, - Some(Content::Abort) => { - return Err(io::Error::new(io::ErrorKind::Other, "Aborted")) - } - None => return Ok(0), - } + if self.fill_buf()?.is_empty() { + return Ok(0); } + let bytes = &mut self.bytes; + // copy_to_slice requires the bytes to have enough remaining bytes // to fill buf. let n = min(buf.len(), bytes.remaining()); @@ -47,3 +42,23 @@ impl Read for ReadableRx<'_> { Ok(n) } } + +impl BufRead for ReadableRx<'_> { + fn fill_buf(&mut self) -> io::Result<&[u8]> { + let bytes = &mut self.bytes; + if !bytes.has_remaining() { + match self.rx.blocking_recv() { + Some(Content::Data(new_bytes)) => *bytes = new_bytes, + Some(Content::Abort) => { + return Err(io::Error::new(io::ErrorKind::Other, "Aborted")) + } + None => (), + } + } + Ok(&*bytes) + } + + fn consume(&mut self, amt: usize) { + self.bytes.advance(amt); + } +} From 4a882dc2cbaf58d49aebd3d38271f6134e14a84f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 15:44:16 +1000 Subject: [PATCH 0251/2020] Use `BufRead` in`extract_compressed_from_readable` Use `BufRead` instead of `Read` to avoid copying of data and improve efficiency. `GzDecoder` and `XzDecoder` both have their `BufRead` counterpart in mod `bufread` and their `read` counterpart merely wraps the input in a `std::io::BufReader`. `ZstdDecoder::new` also wraps it in a `BufReader` and pass it to `ZstdDecoder::with_buffer`. Signed-off-by: Jiahao XU --- src/helpers/extracter.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index fbb9d5c0..e1c91cef 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -1,11 +1,11 @@ use std::fs::{self, File}; -use std::io::Read; +use std::io::{BufRead, Read}; use std::path::Path; -use flate2::read::GzDecoder; +use flate2::bufread::GzDecoder; use log::debug; use tar::Archive; -use xz2::read::XzDecoder; +use xz2::bufread::XzDecoder; use zip::read::ZipArchive; use zstd::stream::Decoder as ZstdDecoder; @@ -55,7 +55,7 @@ fn untar bool>( /// Note that this is a best-effort and it only works when `fmt` /// is not `PkgFmt::Bin` or `PkgFmt::Zip`. pub(crate) fn extract_compressed_from_readable bool>( - dat: impl Read, + dat: impl BufRead, fmt: PkgFmt, path: &Path, filter: Option, @@ -89,7 +89,7 @@ pub(crate) fn extract_compressed_from_readable bool>( // as of zstd 0.10.2 and 0.11.2, which is specified // as &[] by ZstdDecoder::new, thus ZstdDecoder::new // should not return any error. - let tar = ZstdDecoder::new(dat)?; + let tar = ZstdDecoder::with_buffer(dat)?; untar(tar, path, filter)?; } PkgFmt::Zip => panic!("Unexpected PkgFmt::Zip!"), From 868f6c2759439dc0b256ec5d30109a9c83ddcdc0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 16:13:33 +1000 Subject: [PATCH 0252/2020] Add more `debug!` to `untar` Signed-off-by: Jiahao XU --- src/helpers/extracter.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index fbb9d5c0..c773e21e 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -44,6 +44,8 @@ fn untar bool>( tar.unpack(path)?; } + debug!("Untaring completed"); + Ok(()) } From 58f0d5f12dfe2f97de404b5a9c3f5132c311c75b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 16:43:11 +1000 Subject: [PATCH 0253/2020] Run bins after installation in step "Test" Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 4b2b58e6..826545d9 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -101,7 +101,9 @@ jobs: run: | set -euxo pipefail for bin in $bins; do ./${{ matrix.output }} binstall --log-level debug --no-confirm $bin; done + for bin in $bins; do $HOME/.cargo/bin/${{ matrix.output }} --version; done ./${{ matrix.output }} binstall --log-level debug --manifest-path . --no-confirm cargo-binstall + cargo binstall --version env: bins: cargo-deb cargo-llvm-cov cargo-binstall From 4b78d4eb4d67f351e8358e15368c6fcdf277baeb Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 16:52:51 +1000 Subject: [PATCH 0254/2020] Fix step Test: Run `cargo binstall --help` instead of `cargo binstall --version` since `--version` does not print the version of `cargo-binstall` Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 826545d9..7a4ede55 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -101,11 +101,13 @@ jobs: run: | set -euxo pipefail for bin in $bins; do ./${{ matrix.output }} binstall --log-level debug --no-confirm $bin; done - for bin in $bins; do $HOME/.cargo/bin/${{ matrix.output }} --version; done + for bin in $test_bins; do $HOME/.cargo/bin/${{ matrix.output }} --version; done + cargo binstall --help >dev/null ./${{ matrix.output }} binstall --log-level debug --manifest-path . --no-confirm cargo-binstall - cargo binstall --version + cargo binstall --help >dev/null env: bins: cargo-deb cargo-llvm-cov cargo-binstall + test_bins: cargo-deb cargo-llvm-cov - name: Test (Windows) if: ${{ matrix.os == 'windows-latest' }} From 19656b6f45291fef00701f1122b99da8f8396d9a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 17:02:31 +1000 Subject: [PATCH 0255/2020] Fix typo in step "Test" Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 7a4ede55..9e39daa1 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -101,7 +101,7 @@ jobs: run: | set -euxo pipefail for bin in $bins; do ./${{ matrix.output }} binstall --log-level debug --no-confirm $bin; done - for bin in $test_bins; do $HOME/.cargo/bin/${{ matrix.output }} --version; done + for bin in $test_bins; do $HOME/.cargo/bin/$bin --version; done cargo binstall --help >dev/null ./${{ matrix.output }} binstall --log-level debug --manifest-path . --no-confirm cargo-binstall cargo binstall --help >dev/null From dd24661091e69758b07c6fa826cd997fe26e0efe Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 17:02:53 +1000 Subject: [PATCH 0256/2020] Test installed bin in step "Test (Windows)" Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 9e39daa1..d16bff08 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -113,7 +113,9 @@ jobs: if: ${{ matrix.os == 'windows-latest' }} run: | ./${{ matrix.output }} binstall --no-confirm cargo-binstall + cargo binstall --help ./${{ matrix.output }} binstall --manifest-path . --no-confirm cargo-binstall + cargo binstall --help - name: Create archive (tgz, linux) if: ${{ matrix.os != 'macos-latest' && matrix.os != 'windows-latest' }} From 9bf1ce30005d847e8bd5fef20fe76f9678e320bc Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 17:11:52 +1000 Subject: [PATCH 0257/2020] Fix typo in step "Test (Unix)" Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index d16bff08..f3c01116 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -102,9 +102,9 @@ jobs: set -euxo pipefail for bin in $bins; do ./${{ matrix.output }} binstall --log-level debug --no-confirm $bin; done for bin in $test_bins; do $HOME/.cargo/bin/$bin --version; done - cargo binstall --help >dev/null + cargo binstall --help >/dev/null ./${{ matrix.output }} binstall --log-level debug --manifest-path . --no-confirm cargo-binstall - cargo binstall --help >dev/null + cargo binstall --help >/dev/null env: bins: cargo-deb cargo-llvm-cov cargo-binstall test_bins: cargo-deb cargo-llvm-cov From 5302240829d90aa4f048db8462589a6ad533e867 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 18:20:58 +1000 Subject: [PATCH 0258/2020] Refactor workflow rust: Extract test into script Signed-off-by: Jiahao XU --- .github/workflows/rust.yml | 11 +---------- ci-scripts/run_tests_unix.sh | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 10 deletions(-) create mode 100755 ci-scripts/run_tests_unix.sh diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index f3c01116..1c84c5c3 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -98,16 +98,7 @@ jobs: - name: Test (Unix) if: ${{ matrix.test && matrix.os != 'windows-latest' }} - run: | - set -euxo pipefail - for bin in $bins; do ./${{ matrix.output }} binstall --log-level debug --no-confirm $bin; done - for bin in $test_bins; do $HOME/.cargo/bin/$bin --version; done - cargo binstall --help >/dev/null - ./${{ matrix.output }} binstall --log-level debug --manifest-path . --no-confirm cargo-binstall - cargo binstall --help >/dev/null - env: - bins: cargo-deb cargo-llvm-cov cargo-binstall - test_bins: cargo-deb cargo-llvm-cov + run: ./ci-scripts/run_tests_unix.sh ${{ matrix.output }} - name: Test (Windows) if: ${{ matrix.os == 'windows-latest' }} diff --git a/ci-scripts/run_tests_unix.sh b/ci-scripts/run_tests_unix.sh new file mode 100755 index 00000000..dbc25abd --- /dev/null +++ b/ci-scripts/run_tests_unix.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +set -euxo pipefail + +bins="cargo-deb cargo-llvm-cov cargo-binstall" +test_bins="cargo-deb cargo-llvm-cov" + +# Install binaries using cargo-binstall +for bin in $bins; do + "./$1" binstall --log-level debug --no-confirm "$bin" +done + +# Test that the installed binaries can be run +for bin in $test_bins; do + "$HOME/.cargo/bin/$bin" --version +done +cargo binstall --help >/dev/null + +# Install binaries using `--manifest-path` +"./$1" binstall --log-level debug --manifest-path . --no-confirm cargo-binstall +# Test that the installed binaries can be run +cargo binstall --help >/dev/null From bd686134484069d9b1dedaa997217f3e032746bc Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 18:40:21 +1000 Subject: [PATCH 0259/2020] Refactor and add new enum `PkgFmtDecomposed` Signed-off-by: Jiahao XU --- src/fmt.rs | 74 ++++++++++++++++++++++++++++++++++ src/helpers/async_extracter.rs | 2 +- src/lib.rs | 31 ++------------ 3 files changed, 78 insertions(+), 29 deletions(-) create mode 100644 src/fmt.rs diff --git a/src/fmt.rs b/src/fmt.rs new file mode 100644 index 00000000..34a9dc1e --- /dev/null +++ b/src/fmt.rs @@ -0,0 +1,74 @@ +use serde::{Deserialize, Serialize}; +use strum_macros::{Display, EnumString, EnumVariantNames}; + +/// Binary format enumeration +#[derive( + Debug, Copy, Clone, PartialEq, Serialize, Deserialize, Display, EnumString, EnumVariantNames, +)] +#[strum(serialize_all = "snake_case")] +#[serde(rename_all = "snake_case")] +pub enum PkgFmt { + /// Download format is TAR (uncompressed) + Tar, + /// Download format is TGZ (TAR + GZip) + Tgz, + /// Download format is TAR + XZ + Txz, + /// Download format is TAR + Zstd + Tzstd, + /// Download format is Zip + Zip, + /// Download format is raw / binary + Bin, +} + +impl Default for PkgFmt { + fn default() -> Self { + Self::Tgz + } +} + +impl PkgFmt { + /// If self is one of the tar based formats, + /// return Some. + pub fn decompose(self) -> PkgFmtDecomposed { + match self { + PkgFmt::Tar => PkgFmtDecomposed::Tar(TarBasedFmt::Tar), + PkgFmt::Tgz => PkgFmtDecomposed::Tar(TarBasedFmt::Tgz), + PkgFmt::Txz => PkgFmtDecomposed::Tar(TarBasedFmt::Txz), + PkgFmt::Tzstd => PkgFmtDecomposed::Tar(TarBasedFmt::Tzstd), + PkgFmt::Bin => PkgFmtDecomposed::Bin, + PkgFmt::Zip => PkgFmtDecomposed::Zip, + } + } +} + +#[derive(Debug, Copy, Clone, PartialEq)] +pub enum PkgFmtDecomposed { + Tar(TarBasedFmt), + Bin, + Zip, +} + +#[derive(Debug, Copy, Clone, PartialEq)] +pub enum TarBasedFmt { + /// Download format is TAR (uncompressed) + Tar, + /// Download format is TGZ (TAR + GZip) + Tgz, + /// Download format is TAR + XZ + Txz, + /// Download format is TAR + Zstd + Tzstd, +} + +impl From for PkgFmt { + fn from(fmt: TarBasedFmt) -> Self { + match fmt { + TarBasedFmt::Tar => PkgFmt::Tar, + TarBasedFmt::Tgz => PkgFmt::Tgz, + TarBasedFmt::Txz => PkgFmt::Txz, + TarBasedFmt::Tzstd => PkgFmt::Tzstd, + } + } +} diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 7f858a1b..6286eddd 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -12,7 +12,7 @@ use tokio::{ }; use super::{extracter::*, readable_rx::*}; -use crate::{BinstallError, PkgFmt}; +use crate::{BinstallError, PkgFmt, TarBasedFmt}; pub(crate) enum Content { /// Data to write to file diff --git a/src/lib.rs b/src/lib.rs index 0ad83f42..ca2b019a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,7 +1,6 @@ use std::collections::HashMap; use serde::{Deserialize, Serialize}; -use strum_macros::{Display, EnumString, EnumVariantNames}; pub mod drivers; pub use drivers::*; @@ -18,6 +17,9 @@ pub mod fetchers; mod target; pub use target::*; +mod fmt; +pub use fmt::*; + /// Default package path template (may be overridden in package Cargo.toml) pub const DEFAULT_PKG_URL: &str = "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }"; @@ -25,33 +27,6 @@ pub const DEFAULT_PKG_URL: &str = /// Default binary name template (may be overridden in package Cargo.toml) pub const DEFAULT_BIN_DIR: &str = "{ name }-{ target }-v{ version }/{ bin }{ binary-ext }"; -/// Binary format enumeration -#[derive( - Debug, Copy, Clone, PartialEq, Serialize, Deserialize, Display, EnumString, EnumVariantNames, -)] -#[strum(serialize_all = "snake_case")] -#[serde(rename_all = "snake_case")] -pub enum PkgFmt { - /// Download format is TAR (uncompressed) - Tar, - /// Download format is TGZ (TAR + GZip) - Tgz, - /// Download format is TAR + XZ - Txz, - /// Download format is TAR + Zstd - Tzstd, - /// Download format is Zip - Zip, - /// Download format is raw / binary - Bin, -} - -impl Default for PkgFmt { - fn default() -> Self { - Self::Tgz - } -} - /// `binstall` metadata container /// /// Required to nest metadata under `package.metadata.binstall` From cbd57a1bcea75016f12b44f13eb4cef7a38cde68 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 19:28:22 +1000 Subject: [PATCH 0260/2020] Refactor `async_extracter`: Create multi extracters dedicated to different tasks Signed-off-by: Jiahao XU --- src/helpers.rs | 59 ++++++++++++++++++++-------- src/helpers/async_extracter.rs | 70 ++++++++++++++++++++++++++++------ 2 files changed, 101 insertions(+), 28 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 5d6d350a..55089076 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,18 +1,16 @@ -use std::{ - path::{Path, PathBuf}, -}; +use std::path::{Path, PathBuf}; use cargo_toml::Manifest; use log::debug; -use reqwest::Method; +use reqwest::{Method, Response}; use serde::Serialize; use tinytemplate::TinyTemplate; use url::Url; -use crate::{BinstallError, Meta, PkgFmt}; +use crate::{BinstallError, Meta, PkgFmt, PkgFmtDecomposed}; mod async_extracter; -pub use async_extracter::extract_archive_stream; +pub use async_extracter::*; mod auto_abort_join_handle; pub use auto_abort_join_handle::AutoAbortJoinHandle; @@ -45,13 +43,41 @@ pub async fn remote_exists(url: Url, method: Method) -> Result Result { + reqwest::get(url.clone()) + .await + .and_then(|r| r.error_for_status()) + .map_err(|err| BinstallError::Http { + method: Method::GET, + url, + err, + }) +} + /// Download a file from the provided URL and extract it to the provided path. pub async fn download_and_extract>( url: Url, fmt: PkgFmt, path: P, ) -> Result<(), BinstallError> { - download_and_extract_with_filter:: bool, _>(url, fmt, path.as_ref(), None).await + debug!("Downloading from: '{url}'"); + + let resp = create_request(url).await?; + + let path = path.as_ref(); + debug!("Downloading to file: '{}'", path.display()); + + let stream = resp.bytes_stream(); + + match fmt.decompose() { + PkgFmtDecomposed::Tar(fmt) => extract_tar_based_stream(stream, path, fmt).await?, + PkgFmtDecomposed::Bin => extract_bin(stream, path).await?, + PkgFmtDecomposed::Zip => extract_zip(stream, path).await?, + } + + debug!("Download OK, written to file: '{}'", path.display()); + + Ok(()) } /// Download a file from the provided URL and extract part of it to @@ -72,19 +98,20 @@ pub async fn download_and_extract_with_filter< ) -> Result<(), BinstallError> { debug!("Downloading from: '{url}'"); - let resp = reqwest::get(url.clone()) - .await - .and_then(|r| r.error_for_status()) - .map_err(|err| BinstallError::Http { - method: Method::GET, - url, - err, - })?; + let resp = create_request(url).await?; let path = path.as_ref(); debug!("Downloading to file: '{}'", path.display()); - extract_archive_stream(resp.bytes_stream(), path, fmt, filter).await?; + let stream = resp.bytes_stream(); + + match fmt.decompose() { + PkgFmtDecomposed::Tar(fmt) => { + extract_tar_based_stream_with_filter(stream, path, fmt, filter).await? + } + PkgFmtDecomposed::Bin => extract_bin(stream, path).await?, + PkgFmtDecomposed::Zip => extract_zip(stream, path).await?, + } debug!("Download OK, written to file: '{}'", path.display()); diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 6286eddd..7d0b4542 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -199,24 +199,70 @@ impl AsyncExtracter { } } -/// * `output` - If `fmt` is `PkgFmt::Bin`, then this is the filename -/// for the bin. -/// Otherwise, it is the directory where the extracted content will be put. -/// * `fmt` - The format of the archive to feed in. -/// * `filter` - If Some, then it will pass the path of the file to it -/// and only extract ones which filter returns `true`. -/// Note that this is a best-effort and it only works when `fmt` -/// is not `PkgFmt::Bin` or `PkgFmt::Zip`. -pub async fn extract_archive_stream bool + Send + 'static, E>( +pub async fn extract_bin( mut stream: impl Stream> + Unpin, output: &Path, - fmt: PkgFmt, - filter: Option, ) -> Result<(), BinstallError> where BinstallError: From, { - let mut extracter = AsyncExtracter::new(output, fmt, filter); + let mut extracter = AsyncExtracter::new:: bool>(output, PkgFmt::Bin, None); + + while let Some(res) = stream.next().await { + extracter.feed(res?).await?; + } + + extracter.done().await +} + +pub async fn extract_zip( + mut stream: impl Stream> + Unpin, + output: &Path, +) -> Result<(), BinstallError> +where + BinstallError: From, +{ + let mut extracter = AsyncExtracter::new:: bool>(output, PkgFmt::Zip, None); + + while let Some(res) = stream.next().await { + extracter.feed(res?).await?; + } + + extracter.done().await +} + +/// * `filter` - If Some, then it will pass the path of the file to it +/// and only extract ones which filter returns `true`. +pub async fn extract_tar_based_stream_with_filter< + Filter: FnMut(&Path) -> bool + Send + 'static, + E, +>( + mut stream: impl Stream> + Unpin, + output: &Path, + fmt: TarBasedFmt, + filter: Option, +) -> Result<(), BinstallError> +where + BinstallError: From, +{ + let mut extracter = AsyncExtracter::new(output, fmt.into(), filter); + + while let Some(res) = stream.next().await { + extracter.feed(res?).await?; + } + + extracter.done().await +} + +pub async fn extract_tar_based_stream( + mut stream: impl Stream> + Unpin, + output: &Path, + fmt: TarBasedFmt, +) -> Result<(), BinstallError> +where + BinstallError: From, +{ + let mut extracter = AsyncExtracter::new:: bool>(output, fmt.into(), None); while let Some(res) = stream.next().await { extracter.feed(res?).await?; From b1b79921b2818930ee4088ff87e0fc3cf3db828e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 19:30:06 +1000 Subject: [PATCH 0261/2020] Simplify `download_and_extract_with_filter`: Take `TarBasedFmt` instead of `PkgFmt` Signed-off-by: Jiahao XU --- src/drivers.rs | 4 ++-- src/helpers.rs | 12 +++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/src/drivers.rs b/src/drivers.rs index b16513d9..db520d4e 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -7,7 +7,7 @@ use log::debug; use semver::{Version, VersionReq}; use url::Url; -use crate::{helpers::*, BinstallError, PkgFmt}; +use crate::{helpers::*, BinstallError, TarBasedFmt}; fn find_version<'a, V: Iterator>( requirement: &str, @@ -112,7 +112,7 @@ pub async fn fetch_crate_cratesio( download_and_extract_with_filter( Url::parse(&crate_url)?, - PkgFmt::Tgz, + TarBasedFmt::Tgz, &temp_dir, Some(move |path: &Path| path == cargo_toml || path == main || path.starts_with(&bin)), ) diff --git a/src/helpers.rs b/src/helpers.rs index 55089076..210cb00c 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -7,7 +7,7 @@ use serde::Serialize; use tinytemplate::TinyTemplate; use url::Url; -use crate::{BinstallError, Meta, PkgFmt, PkgFmtDecomposed}; +use crate::{BinstallError, Meta, PkgFmt, PkgFmtDecomposed, TarBasedFmt}; mod async_extracter; pub use async_extracter::*; @@ -92,7 +92,7 @@ pub async fn download_and_extract_with_filter< P: AsRef, >( url: Url, - fmt: PkgFmt, + fmt: TarBasedFmt, path: P, filter: Option, ) -> Result<(), BinstallError> { @@ -105,13 +105,7 @@ pub async fn download_and_extract_with_filter< let stream = resp.bytes_stream(); - match fmt.decompose() { - PkgFmtDecomposed::Tar(fmt) => { - extract_tar_based_stream_with_filter(stream, path, fmt, filter).await? - } - PkgFmtDecomposed::Bin => extract_bin(stream, path).await?, - PkgFmtDecomposed::Zip => extract_zip(stream, path).await?, - } + extract_tar_based_stream_with_filter(stream, path, fmt, filter).await?; debug!("Download OK, written to file: '{}'", path.display()); From d1033758a774d3a820eb6b1fba6270b5417cc0b0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 19:30:31 +1000 Subject: [PATCH 0262/2020] Update doc of `download_and_extract_with_filter` Signed-off-by: Jiahao XU --- src/helpers.rs | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 210cb00c..12cf35c7 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -85,8 +85,6 @@ pub async fn download_and_extract>( /// /// * `filter` - If Some, then it will pass the path of the file to it /// and only extract ones which filter returns `true`. -/// Note that this is a best-effort and it only works when `fmt` -/// is not `PkgFmt::Bin` or `PkgFmt::Zip`. pub async fn download_and_extract_with_filter< Filter: FnMut(&Path) -> bool + Send + 'static, P: AsRef, From 7b52eaad5b3be1b143fe686bf4f3190fed73183c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 20:10:46 +1000 Subject: [PATCH 0263/2020] Rewrite `AsyncExtracter`: Extract fmt logic as callback fn Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 232 ++++++++++++++++++--------------- src/helpers/extracter.rs | 4 +- 2 files changed, 128 insertions(+), 108 deletions(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 7d0b4542..26274d65 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -1,3 +1,4 @@ +use std::fmt::Debug; use std::fs; use std::io::{self, Seek, Write}; use std::path::Path; @@ -22,28 +23,47 @@ pub(crate) enum Content { Abort, } +/// AsyncExtracter will pass the `Bytes` you give to another thread via +/// a `mpsc` and decompress and unpack it if needed. +/// +/// After all write is done, you must call `AsyncExtracter::done`, +/// otherwise the extracted content will be removed on drop. +/// +/// # Advantages +/// +/// `download_and_extract` has the following advantages over downloading +/// plus extracting in on the same thread: +/// +/// - The code is pipelined instead of storing the downloaded file in memory +/// and extract it, except for `PkgFmt::Zip`, since `ZipArchiver::new` +/// requires `std::io::Seek`, so it fallbacks to writing the a file then +/// unzip it. +/// - The async part (downloading) and the extracting part runs in parallel +/// using `tokio::spawn_nonblocking`. +/// - Compressing/writing which takes a lot of CPU time will not block +/// the runtime anymore. +/// - For any PkgFmt except for `PkgFmt::Zip` and `PkgFmt::Bin` (basically +/// all `tar` based formats), it can extract only specified files. +/// This means that `super::drivers::fetch_crate_cratesio` no longer need to +/// extract the whole crate and write them to disk, it now only extract the +/// relevant part (`Cargo.toml`) out to disk and open it. #[derive(Debug)] -struct AsyncExtracterInner { +struct AsyncExtracterInner { /// Use AutoAbortJoinHandle so that the task /// will be cancelled on failure. - handle: JoinHandle>, + handle: JoinHandle>, tx: mpsc::Sender, } -impl AsyncExtracterInner { - /// * `filter` - If Some, then it will pass the path of the file to it - /// and only extract ones which filter returns `true`. - /// Note that this is a best-effort and it only works when `fmt` - /// is not `PkgFmt::Bin` or `PkgFmt::Zip`. - fn new bool + Send + 'static>( - path: &Path, - fmt: PkgFmt, - filter: Option, +impl AsyncExtracterInner { + fn new) -> Result + Send + 'static>( + f: F, ) -> Self { - let path = path.to_owned(); - let (tx, mut rx) = mpsc::channel::(100); + let (tx, rx) = mpsc::channel::(100); let handle = spawn_blocking(move || { + f(rx) + /* fs::create_dir_all(path.parent().unwrap())?; match fmt { @@ -78,29 +98,12 @@ impl AsyncExtracterInner { } Ok(()) + */ }); Self { handle, tx } } - fn read_into_file( - file: &mut fs::File, - rx: &mut mpsc::Receiver, - ) -> Result<(), BinstallError> { - while let Some(content) = rx.blocking_recv() { - match content { - Content::Data(bytes) => file.write_all(&*bytes)?, - Content::Abort => { - return Err(io::Error::new(io::ErrorKind::Other, "Aborted").into()) - } - } - } - - file.flush()?; - - Ok(()) - } - /// Upon error, this extracter shall not be reused. /// Otherwise, `Self::done` would panic. async fn feed(&mut self, bytes: Bytes) -> Result<(), BinstallError> { @@ -114,7 +117,7 @@ impl AsyncExtracterInner { } } - async fn done(mut self) -> Result<(), BinstallError> { + async fn done(mut self) -> Result { // Drop tx as soon as possible so that the task would wrap up what it // was doing and flush out all the pending data. drop(self.tx); @@ -122,7 +125,7 @@ impl AsyncExtracterInner { Self::wait(&mut self.handle).await } - async fn wait(handle: &mut JoinHandle>) -> Result<(), BinstallError> { + async fn wait(handle: &mut JoinHandle>) -> Result { match handle.await { Ok(res) => res, Err(join_err) => Err(io::Error::new(io::ErrorKind::Other, join_err).into()), @@ -143,92 +146,98 @@ impl AsyncExtracterInner { } } -/// AsyncExtracter will pass the `Bytes` you give to another thread via -/// a `mpsc` and decompress and unpack it if needed. -/// -/// After all write is done, you must call `AsyncExtracter::done`, -/// otherwise the extracted content will be removed on drop. -/// -/// # Advantages -/// -/// `download_and_extract` has the following advantages over downloading -/// plus extracting in on the same thread: -/// -/// - The code is pipelined instead of storing the downloaded file in memory -/// and extract it, except for `PkgFmt::Zip`, since `ZipArchiver::new` -/// requires `std::io::Seek`, so it fallbacks to writing the a file then -/// unzip it. -/// - The async part (downloading) and the extracting part runs in parallel -/// using `tokio::spawn_nonblocking`. -/// - Compressing/writing which takes a lot of CPU time will not block -/// the runtime anymore. -/// - For any PkgFmt except for `PkgFmt::Zip` and `PkgFmt::Bin` (basically -/// all `tar` based formats), it can extract only specified files. -/// This means that `super::drivers::fetch_crate_cratesio` no longer need to -/// extract the whole crate and write them to disk, it now only extract the -/// relevant part (`Cargo.toml`) out to disk and open it. -#[derive(Debug)] -struct AsyncExtracter(ScopeGuard); +async fn extract_impl< + F: FnOnce(mpsc::Receiver) -> Result + Send + 'static, + T: Debug + Send + 'static, + S: Stream> + Unpin, + E, +>( + mut stream: S, + f: F, +) -> Result +where + BinstallError: From, +{ + let mut extracter = guard(AsyncExtracterInner::new(f), AsyncExtracterInner::abort); -impl AsyncExtracter { - /// * `path` - If `fmt` is `PkgFmt::Bin`, then this is the filename - /// for the bin. - /// Otherwise, it is the directory where the extracted content will be put. - /// * `fmt` - The format of the archive to feed in. - /// * `filter` - If Some, then it will pass the path of the file to it - /// and only extract ones which filter returns `true`. - /// Note that this is a best-effort and it only works when `fmt` - /// is not `PkgFmt::Bin` or `PkgFmt::Zip`. - fn new bool + Send + 'static>( - path: &Path, - fmt: PkgFmt, - filter: Option, - ) -> Self { - let inner = AsyncExtracterInner::new(path, fmt, filter); - Self(guard(inner, AsyncExtracterInner::abort)) + while let Some(res) = stream.next().await { + extracter.feed(res?).await?; } - /// Upon error, this extracter shall not be reused. - /// Otherwise, `Self::done` would panic. - async fn feed(&mut self, bytes: Bytes) -> Result<(), BinstallError> { - self.0.feed(bytes).await + ScopeGuard::into_inner(extracter).done().await +} + +fn read_into_file( + file: &mut fs::File, + rx: &mut mpsc::Receiver, +) -> Result<(), BinstallError> { + while let Some(content) = rx.blocking_recv() { + match content { + Content::Data(bytes) => file.write_all(&*bytes)?, + Content::Abort => return Err(io::Error::new(io::ErrorKind::Other, "Aborted").into()), + } } - async fn done(self) -> Result<(), BinstallError> { - ScopeGuard::into_inner(self.0).done().await - } + file.flush()?; + + Ok(()) } pub async fn extract_bin( - mut stream: impl Stream> + Unpin, + stream: impl Stream> + Unpin, output: &Path, ) -> Result<(), BinstallError> where BinstallError: From, { - let mut extracter = AsyncExtracter::new:: bool>(output, PkgFmt::Bin, None); + let path = output.to_owned(); - while let Some(res) = stream.next().await { - extracter.feed(res?).await?; - } + extract_impl(stream, move |mut rx| { + fs::create_dir_all(path.parent().unwrap())?; - extracter.done().await + let mut file = fs::File::create(&path)?; + + // remove it unless the operation isn't aborted and no write + // fails. + let remove_guard = guard(&path, |path| { + fs::remove_file(path).ok(); + }); + + read_into_file(&mut file, &mut rx)?; + + // Operation isn't aborted and all writes succeed, + // disarm the remove_guard. + ScopeGuard::into_inner(remove_guard); + + Ok(()) + }) + .await } pub async fn extract_zip( - mut stream: impl Stream> + Unpin, + stream: impl Stream> + Unpin, output: &Path, ) -> Result<(), BinstallError> where BinstallError: From, { - let mut extracter = AsyncExtracter::new:: bool>(output, PkgFmt::Zip, None); + let path = output.to_owned(); - while let Some(res) = stream.next().await { - extracter.feed(res?).await?; - } + extract_impl(stream, move |mut rx| { + fs::create_dir_all(path.parent().unwrap())?; - extracter.done().await + let mut file = tempfile()?; + + read_into_file(&mut file, &mut rx)?; + + // rewind it so that we can pass it to unzip + file.rewind()?; + + unzip(file, &path)?; + + Ok(()) + }) + .await } /// * `filter` - If Some, then it will pass the path of the file to it @@ -237,7 +246,7 @@ pub async fn extract_tar_based_stream_with_filter< Filter: FnMut(&Path) -> bool + Send + 'static, E, >( - mut stream: impl Stream> + Unpin, + stream: impl Stream> + Unpin, output: &Path, fmt: TarBasedFmt, filter: Option, @@ -245,28 +254,39 @@ pub async fn extract_tar_based_stream_with_filter< where BinstallError: From, { - let mut extracter = AsyncExtracter::new(output, fmt.into(), filter); + let path = output.to_owned(); - while let Some(res) = stream.next().await { - extracter.feed(res?).await?; - } + extract_impl(stream, move |mut rx| { + fs::create_dir_all(path.parent().unwrap())?; - extracter.done().await + extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt.into(), &path, filter)?; + + Ok(()) + }) + .await } pub async fn extract_tar_based_stream( - mut stream: impl Stream> + Unpin, + stream: impl Stream> + Unpin, output: &Path, fmt: TarBasedFmt, ) -> Result<(), BinstallError> where BinstallError: From, { - let mut extracter = AsyncExtracter::new:: bool>(output, fmt.into(), None); + let path = output.to_owned(); - while let Some(res) = stream.next().await { - extracter.feed(res?).await?; - } + extract_impl(stream, move |mut rx| { + fs::create_dir_all(path.parent().unwrap())?; - extracter.done().await + extract_compressed_from_readable:: bool, _>( + ReadableRx::new(&mut rx), + fmt.into(), + &path, + None, + )?; + + Ok(()) + }) + .await } diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index 42426693..a393c935 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -56,8 +56,8 @@ fn untar bool>( /// and only extract ones which filter returns `true`. /// Note that this is a best-effort and it only works when `fmt` /// is not `PkgFmt::Bin` or `PkgFmt::Zip`. -pub(crate) fn extract_compressed_from_readable bool>( - dat: impl BufRead, +pub(crate) fn extract_compressed_from_readable bool, R: BufRead>( + dat: R, fmt: PkgFmt, path: &Path, filter: Option, From 57b40d809eb6ee8682b2b5554ab6214fad0f76cc Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 20:13:10 +1000 Subject: [PATCH 0264/2020] Cleanup mod `async_extracter` Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 56 ++++------------------------------ 1 file changed, 6 insertions(+), 50 deletions(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 26274d65..b592db02 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -5,7 +5,7 @@ use std::path::Path; use bytes::Bytes; use futures_util::stream::{Stream, StreamExt}; -use scopeguard::{guard, Always, ScopeGuard}; +use scopeguard::{guard, ScopeGuard}; use tempfile::tempfile; use tokio::{ sync::mpsc, @@ -13,7 +13,7 @@ use tokio::{ }; use super::{extracter::*, readable_rx::*}; -use crate::{BinstallError, PkgFmt, TarBasedFmt}; +use crate::{BinstallError, TarBasedFmt}; pub(crate) enum Content { /// Data to write to file @@ -61,45 +61,7 @@ impl AsyncExtracterInner { ) -> Self { let (tx, rx) = mpsc::channel::(100); - let handle = spawn_blocking(move || { - f(rx) - /* - fs::create_dir_all(path.parent().unwrap())?; - - match fmt { - PkgFmt::Bin => { - let mut file = fs::File::create(&path)?; - - // remove it unless the operation isn't aborted and no write - // fails. - let remove_guard = guard(&path, |path| { - fs::remove_file(path).ok(); - }); - - Self::read_into_file(&mut file, &mut rx)?; - - // Operation isn't aborted and all writes succeed, - // disarm the remove_guard. - ScopeGuard::into_inner(remove_guard); - } - PkgFmt::Zip => { - let mut file = tempfile()?; - - Self::read_into_file(&mut file, &mut rx)?; - - // rewind it so that we can pass it to unzip - file.rewind()?; - - unzip(file, &path)?; - } - _ => { - extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt, &path, filter)? - } - } - - Ok(()) - */ - }); + let handle = spawn_blocking(move || f(rx)); Self { handle, tx } } @@ -233,9 +195,7 @@ where // rewind it so that we can pass it to unzip file.rewind()?; - unzip(file, &path)?; - - Ok(()) + unzip(file, &path) }) .await } @@ -259,9 +219,7 @@ where extract_impl(stream, move |mut rx| { fs::create_dir_all(path.parent().unwrap())?; - extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt.into(), &path, filter)?; - - Ok(()) + extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt.into(), &path, filter) }) .await } @@ -284,9 +242,7 @@ where fmt.into(), &path, None, - )?; - - Ok(()) + ) }) .await } From 5a43ee2681ea1df7457bdd046eb9169f4ef320f0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 20:16:41 +1000 Subject: [PATCH 0265/2020] Simplify `extract_compressed_from_readable` impl Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 4 ++-- src/helpers/extracter.rs | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index b592db02..ac84ab16 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -219,7 +219,7 @@ where extract_impl(stream, move |mut rx| { fs::create_dir_all(path.parent().unwrap())?; - extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt.into(), &path, filter) + extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt, &path, filter) }) .await } @@ -239,7 +239,7 @@ where extract_compressed_from_readable:: bool, _>( ReadableRx::new(&mut rx), - fmt.into(), + fmt, &path, None, ) diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index a393c935..cda13ef8 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -9,7 +9,7 @@ use xz2::bufread::XzDecoder; use zip::read::ZipArchive; use zstd::stream::Decoder as ZstdDecoder; -use crate::{BinstallError, PkgFmt}; +use crate::{BinstallError, TarBasedFmt}; /// * `filter` - If Some, then it will pass the path of the file to it /// and only extract ones which filter returns `true`. @@ -58,32 +58,34 @@ fn untar bool>( /// is not `PkgFmt::Bin` or `PkgFmt::Zip`. pub(crate) fn extract_compressed_from_readable bool, R: BufRead>( dat: R, - fmt: PkgFmt, + fmt: TarBasedFmt, path: &Path, filter: Option, ) -> Result<(), BinstallError> { + use TarBasedFmt::*; + match fmt { - PkgFmt::Tar => { + Tar => { // Extract to install dir debug!("Extracting from tar archive to `{path:?}`"); untar(dat, path, filter)? } - PkgFmt::Tgz => { + Tgz => { // Extract to install dir debug!("Decompressing from tgz archive to `{path:?}`"); let tar = GzDecoder::new(dat); untar(tar, path, filter)?; } - PkgFmt::Txz => { + Txz => { // Extract to install dir debug!("Decompressing from txz archive to `{path:?}`"); let tar = XzDecoder::new(dat); untar(tar, path, filter)?; } - PkgFmt::Tzstd => { + Tzstd => { // Extract to install dir debug!("Decompressing from tzstd archive to `{path:?}`"); @@ -94,8 +96,6 @@ pub(crate) fn extract_compressed_from_readable bool, R: let tar = ZstdDecoder::with_buffer(dat)?; untar(tar, path, filter)?; } - PkgFmt::Zip => panic!("Unexpected PkgFmt::Zip!"), - PkgFmt::Bin => panic!("Unexpected PkgFmt::Bin!"), }; Ok(()) From 90a96cabc98cea1ba539164987cad65051b0ec3b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 20:31:46 +1000 Subject: [PATCH 0266/2020] Rewrite `untar` to take a visitor & simplify signature of `download_and_extract_with_filter` Signed-off-by: Jiahao XU --- src/drivers.rs | 2 +- src/helpers.rs | 2 +- src/helpers/async_extracter.rs | 48 ++++++++++++++++++++++++++++---- src/helpers/extracter.rs | 50 ++++++++++++++-------------------- 4 files changed, 64 insertions(+), 38 deletions(-) diff --git a/src/drivers.rs b/src/drivers.rs index db520d4e..1c6a5eba 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -114,7 +114,7 @@ pub async fn fetch_crate_cratesio( Url::parse(&crate_url)?, TarBasedFmt::Tgz, &temp_dir, - Some(move |path: &Path| path == cargo_toml || path == main || path.starts_with(&bin)), + move |path: &Path| path == cargo_toml || path == main || path.starts_with(&bin), ) .await?; diff --git a/src/helpers.rs b/src/helpers.rs index 12cf35c7..bd2d904f 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -92,7 +92,7 @@ pub async fn download_and_extract_with_filter< url: Url, fmt: TarBasedFmt, path: P, - filter: Option, + filter: Filter, ) -> Result<(), BinstallError> { debug!("Downloading from: '{url}'"); diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index ac84ab16..5a4051ac 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -1,11 +1,14 @@ use std::fmt::Debug; use std::fs; -use std::io::{self, Seek, Write}; -use std::path::Path; +use std::io::{self, Read, Seek, Write}; +use std::path::{Path, PathBuf}; +use std::sync::Arc; use bytes::Bytes; use futures_util::stream::{Stream, StreamExt}; +use log::debug; use scopeguard::{guard, ScopeGuard}; +use tar::Entries; use tempfile::tempfile; use tokio::{ sync::mpsc, @@ -209,17 +212,42 @@ pub async fn extract_tar_based_stream_with_filter< stream: impl Stream> + Unpin, output: &Path, fmt: TarBasedFmt, - filter: Option, + filter: Filter, ) -> Result<(), BinstallError> where BinstallError: From, { - let path = output.to_owned(); + struct Visitor(F, Arc); + + impl bool + Send + 'static> TarEntriesVisitor for Visitor { + fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), BinstallError> { + for res in entries { + let mut entry = res?; + let entry_path = entry.path()?; + + if self.0(&entry_path) { + debug!("Extracting {entry_path:#?}"); + + let dst = self.1.join(entry_path); + + fs::create_dir_all(dst.parent().unwrap())?; + + entry.unpack(dst)?; + } + } + + Ok(()) + } + } + + let path = Arc::new(output.to_owned()); + + let visitor = Visitor(filter, path.clone()); extract_impl(stream, move |mut rx| { fs::create_dir_all(path.parent().unwrap())?; - extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt, &path, filter) + extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt, &*path, Some(visitor)) }) .await } @@ -232,12 +260,20 @@ pub async fn extract_tar_based_stream( where BinstallError: From, { + struct DummyVisitor; + + impl TarEntriesVisitor for DummyVisitor { + fn visit(&mut self, _entries: Entries<'_, R>) -> Result<(), BinstallError> { + unimplemented!() + } + } + let path = output.to_owned(); extract_impl(stream, move |mut rx| { fs::create_dir_all(path.parent().unwrap())?; - extract_compressed_from_readable:: bool, _>( + extract_compressed_from_readable::( ReadableRx::new(&mut rx), fmt, &path, diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index cda13ef8..969a1556 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -1,44 +1,34 @@ -use std::fs::{self, File}; +use std::fs::File; use std::io::{BufRead, Read}; use std::path::Path; use flate2::bufread::GzDecoder; use log::debug; -use tar::Archive; +use tar::{Archive, Entries}; use xz2::bufread::XzDecoder; use zip::read::ZipArchive; use zstd::stream::Decoder as ZstdDecoder; use crate::{BinstallError, TarBasedFmt}; -/// * `filter` - If Some, then it will pass the path of the file to it -/// and only extract ones which filter returns `true`. -/// Note that this is a best-effort and it only works when `fmt` -/// is not `PkgFmt::Bin` or `PkgFmt::Zip`. -fn untar bool>( - dat: impl Read, +pub trait TarEntriesVisitor { + fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), BinstallError>; +} + +/// * `f` - If Some, then this function will pass +/// the entries of the `dat` to it and let it decides +/// what to do with the tar. +fn untar( + dat: R, path: &Path, - filter: Option, + visitor: Option, ) -> Result<(), BinstallError> { let mut tar = Archive::new(dat); - if let Some(mut filter) = filter { + if let Some(mut visitor) = visitor { debug!("Untaring with filter"); - for res in tar.entries()? { - let mut entry = res?; - let entry_path = entry.path()?; - - if filter(&entry_path) { - debug!("Extracting {entry_path:#?}"); - - let dst = path.join(entry_path); - - fs::create_dir_all(dst.parent().unwrap())?; - - entry.unpack(dst)?; - } - } + visitor.visit(tar.entries()?)?; } else { debug!("Untaring entire tar"); tar.unpack(path)?; @@ -56,11 +46,11 @@ fn untar bool>( /// and only extract ones which filter returns `true`. /// Note that this is a best-effort and it only works when `fmt` /// is not `PkgFmt::Bin` or `PkgFmt::Zip`. -pub(crate) fn extract_compressed_from_readable bool, R: BufRead>( +pub(crate) fn extract_compressed_from_readable( dat: R, fmt: TarBasedFmt, path: &Path, - filter: Option, + visitor: Option, ) -> Result<(), BinstallError> { use TarBasedFmt::*; @@ -69,21 +59,21 @@ pub(crate) fn extract_compressed_from_readable bool, R: // Extract to install dir debug!("Extracting from tar archive to `{path:?}`"); - untar(dat, path, filter)? + untar(dat, path, visitor)? } Tgz => { // Extract to install dir debug!("Decompressing from tgz archive to `{path:?}`"); let tar = GzDecoder::new(dat); - untar(tar, path, filter)?; + untar(tar, path, visitor)?; } Txz => { // Extract to install dir debug!("Decompressing from txz archive to `{path:?}`"); let tar = XzDecoder::new(dat); - untar(tar, path, filter)?; + untar(tar, path, visitor)?; } Tzstd => { // Extract to install dir @@ -94,7 +84,7 @@ pub(crate) fn extract_compressed_from_readable bool, R: // as &[] by ZstdDecoder::new, thus ZstdDecoder::new // should not return any error. let tar = ZstdDecoder::with_buffer(dat)?; - untar(tar, path, filter)?; + untar(tar, path, visitor)?; } }; From 4892d8bf3a5d35a88aed6d65d2d9b0de22b64aaf Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 20:35:02 +1000 Subject: [PATCH 0267/2020] Impl forward of `&mut T` to `T` for `TarEntriesVisitor` Signed-off-by: Jiahao XU --- src/helpers/extracter.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index 969a1556..1175da8a 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -15,6 +15,12 @@ pub trait TarEntriesVisitor { fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), BinstallError>; } +impl TarEntriesVisitor for &mut V { + fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), BinstallError> { + (*self).visit(entries) + } +} + /// * `f` - If Some, then this function will pass /// the entries of the `dat` to it and let it decides /// what to do with the tar. From f8c8c66f57f4c1f718becd19d6f788538bfb050e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 20:38:11 +1000 Subject: [PATCH 0268/2020] Impl new fn `helpers::download_tar_based_and_visit` Signed-off-by: Jiahao XU --- src/helpers.rs | 35 +++++++++++++++++++++++++++++++++- src/helpers/async_extracter.rs | 26 +++++++++++++++++++++++++ 2 files changed, 60 insertions(+), 1 deletion(-) diff --git a/src/helpers.rs b/src/helpers.rs index bd2d904f..7670b15b 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,3 +1,4 @@ +use std::fmt::Debug; use std::path::{Path, PathBuf}; use cargo_toml::Manifest; @@ -19,6 +20,8 @@ mod ui_thread; pub use ui_thread::UIThread; mod extracter; +pub use extracter::TarEntriesVisitor; + mod readable_rx; /// Load binstall metadata from the crate `Cargo.toml` at the provided path @@ -83,7 +86,7 @@ pub async fn download_and_extract>( /// Download a file from the provided URL and extract part of it to /// the provided path. /// -/// * `filter` - If Some, then it will pass the path of the file to it +/// * `filter` - It will pass the path of the file to it /// and only extract ones which filter returns `true`. pub async fn download_and_extract_with_filter< Filter: FnMut(&Path) -> bool + Send + 'static, @@ -110,6 +113,36 @@ pub async fn download_and_extract_with_filter< Ok(()) } +/// Download a file from the provided URL and extract part of it to +/// the provided path. +/// +/// * `filter` - If Some, then it will pass the path of the file to it +/// and only extract ones which filter returns `true`. +pub async fn download_tar_based_and_visit< + V: TarEntriesVisitor + Debug + Send + 'static, + P: AsRef, +>( + url: Url, + fmt: TarBasedFmt, + path: P, + visitor: V, +) -> Result { + debug!("Downloading from: '{url}'"); + + let resp = create_request(url).await?; + + let path = path.as_ref(); + debug!("Downloading to file: '{}'", path.display()); + + let stream = resp.bytes_stream(); + + let visitor = extract_tar_based_stream_and_visit(stream, path, fmt, visitor).await?; + + debug!("Download OK, written to file: '{}'", path.display()); + + Ok(visitor) +} + /// Fetch install path from environment /// roughly follows pub fn get_install_path>(install_path: Option

) -> Option { diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 5a4051ac..cdf8ffea 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -282,3 +282,29 @@ where }) .await } + +pub async fn extract_tar_based_stream_and_visit( + stream: impl Stream> + Unpin, + output: &Path, + fmt: TarBasedFmt, + mut visitor: V, +) -> Result +where + BinstallError: From, +{ + let path = output.to_owned(); + + extract_impl(stream, move |mut rx| { + fs::create_dir_all(path.parent().unwrap())?; + + extract_compressed_from_readable( + ReadableRx::new(&mut rx), + fmt, + &*path, + Some(&mut visitor), + )?; + + Ok(visitor) + }) + .await +} From 6c6055da69875625a33a9cdd38c0f2542295ef22 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 22:43:45 +1000 Subject: [PATCH 0269/2020] Refactor mod `drivers`: Extract out sub mods Signed-off-by: Jiahao XU --- src/drivers.rs | 124 ++-------------------------------------- src/drivers/cratesio.rs | 80 ++++++++++++++++++++++++++ src/drivers/version.rs | 48 ++++++++++++++++ 3 files changed, 133 insertions(+), 119 deletions(-) create mode 100644 src/drivers/cratesio.rs create mode 100644 src/drivers/version.rs diff --git a/src/drivers.rs b/src/drivers.rs index 1c6a5eba..c63d3044 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -1,126 +1,12 @@ -use std::collections::BTreeSet; use std::path::{Path, PathBuf}; -use std::time::Duration; -use crates_io_api::AsyncClient; -use log::debug; -use semver::{Version, VersionReq}; -use url::Url; +use crate::BinstallError; -use crate::{helpers::*, BinstallError, TarBasedFmt}; +mod cratesio; +pub use cratesio::*; -fn find_version<'a, V: Iterator>( - requirement: &str, - version_iter: V, -) -> Result { - // Parse version requirement - let version_req = VersionReq::parse(requirement).map_err(|err| BinstallError::VersionReq { - req: requirement.into(), - err, - })?; - - // Filter for matching versions - let filtered: BTreeSet<_> = version_iter - .filter_map(|v| { - // Remove leading `v` for git tags - let ver_str = match v.strip_prefix('s') { - Some(v) => v, - None => v, - }; - - // Parse out version - let ver = Version::parse(ver_str).ok()?; - debug!("Version: {:?}", ver); - - // Filter by version match - if version_req.matches(&ver) { - Some(ver) - } else { - None - } - }) - .collect(); - - debug!("Filtered: {:?}", filtered); - - // Return highest version - filtered - .iter() - .max() - .cloned() - .ok_or(BinstallError::VersionMismatch { req: version_req }) -} - -/// Fetch a crate Cargo.toml by name and version from crates.io -pub async fn fetch_crate_cratesio( - name: &str, - version_req: &str, - temp_dir: &Path, -) -> Result { - // Fetch / update index - debug!("Looking up crate information"); - - // Build crates.io api client - let api_client = AsyncClient::new( - "cargo-binstall (https://github.com/ryankurte/cargo-binstall)", - Duration::from_millis(100), - ) - .expect("bug: invalid user agent"); - - // Fetch online crate information - let base_info = - api_client - .get_crate(name.as_ref()) - .await - .map_err(|err| BinstallError::CratesIoApi { - crate_name: name.into(), - err, - })?; - - // Locate matching version - let version_iter = - base_info - .versions - .iter() - .filter_map(|v| if !v.yanked { Some(&v.num) } else { None }); - let version_name = find_version(version_req, version_iter)?; - - // Fetch information for the filtered version - let version = base_info - .versions - .iter() - .find(|v| v.num == version_name.to_string()) - .ok_or_else(|| BinstallError::VersionUnavailable { - crate_name: name.into(), - v: version_name.clone(), - })?; - - debug!("Found information for crate version: '{}'", version.num); - - // Download crate to temporary dir (crates.io or git?) - let crate_url = format!("https://crates.io/{}", version.dl_path); - - debug!("Fetching crate from: {crate_url} and extracting Cargo.toml from it"); - - let crate_dir: PathBuf = format!("{name}-{version_name}").into(); - let crate_path = temp_dir.join(&crate_dir); - - let cargo_toml = crate_dir.join("Cargo.toml"); - let src = crate_dir.join("src"); - let main = src.join("main.rs"); - let bin = src.join("bin"); - - download_and_extract_with_filter( - Url::parse(&crate_url)?, - TarBasedFmt::Tgz, - &temp_dir, - move |path: &Path| path == cargo_toml || path == main || path.starts_with(&bin), - ) - .await?; - - // Return crate directory - Ok(crate_path) -} +mod version; +use version::find_version; /// Fetch a crate by name and version from github /// TODO: implement this diff --git a/src/drivers/cratesio.rs b/src/drivers/cratesio.rs new file mode 100644 index 00000000..82b5044d --- /dev/null +++ b/src/drivers/cratesio.rs @@ -0,0 +1,80 @@ +use std::path::{Path, PathBuf}; +use std::time::Duration; + +use crates_io_api::AsyncClient; +use log::debug; +use url::Url; + +use super::find_version; +use crate::{helpers::*, BinstallError, TarBasedFmt}; + +/// Fetch a crate Cargo.toml by name and version from crates.io +pub async fn fetch_crate_cratesio( + name: &str, + version_req: &str, + temp_dir: &Path, +) -> Result { + // Fetch / update index + debug!("Looking up crate information"); + + // Build crates.io api client + let api_client = AsyncClient::new( + "cargo-binstall (https://github.com/ryankurte/cargo-binstall)", + Duration::from_millis(100), + ) + .expect("bug: invalid user agent"); + + // Fetch online crate information + let base_info = + api_client + .get_crate(name.as_ref()) + .await + .map_err(|err| BinstallError::CratesIoApi { + crate_name: name.into(), + err, + })?; + + // Locate matching version + let version_iter = + base_info + .versions + .iter() + .filter_map(|v| if !v.yanked { Some(&v.num) } else { None }); + let version_name = find_version(version_req, version_iter)?; + + // Fetch information for the filtered version + let version = base_info + .versions + .iter() + .find(|v| v.num == version_name.to_string()) + .ok_or_else(|| BinstallError::VersionUnavailable { + crate_name: name.into(), + v: version_name.clone(), + })?; + + debug!("Found information for crate version: '{}'", version.num); + + // Download crate to temporary dir (crates.io or git?) + let crate_url = format!("https://crates.io/{}", version.dl_path); + + debug!("Fetching crate from: {crate_url} and extracting Cargo.toml from it"); + + let crate_dir: PathBuf = format!("{name}-{version_name}").into(); + let crate_path = temp_dir.join(&crate_dir); + + let cargo_toml = crate_dir.join("Cargo.toml"); + let src = crate_dir.join("src"); + let main = src.join("main.rs"); + let bin = src.join("bin"); + + download_and_extract_with_filter( + Url::parse(&crate_url)?, + TarBasedFmt::Tgz, + &temp_dir, + move |path: &Path| path == cargo_toml || path == main || path.starts_with(&bin), + ) + .await?; + + // Return crate directory + Ok(crate_path) +} diff --git a/src/drivers/version.rs b/src/drivers/version.rs new file mode 100644 index 00000000..d1d9fdf8 --- /dev/null +++ b/src/drivers/version.rs @@ -0,0 +1,48 @@ +use std::collections::BTreeSet; + +use log::debug; +use semver::{Version, VersionReq}; + +use crate::BinstallError; + +pub(crate) fn find_version<'a, V: Iterator>( + requirement: &str, + version_iter: V, +) -> Result { + // Parse version requirement + let version_req = VersionReq::parse(requirement).map_err(|err| BinstallError::VersionReq { + req: requirement.into(), + err, + })?; + + // Filter for matching versions + let filtered: BTreeSet<_> = version_iter + .filter_map(|v| { + // Remove leading `v` for git tags + let ver_str = match v.strip_prefix('s') { + Some(v) => v, + None => v, + }; + + // Parse out version + let ver = Version::parse(ver_str).ok()?; + debug!("Version: {:?}", ver); + + // Filter by version match + if version_req.matches(&ver) { + Some(ver) + } else { + None + } + }) + .collect(); + + debug!("Filtered: {:?}", filtered); + + // Return highest version + filtered + .iter() + .max() + .cloned() + .ok_or(BinstallError::VersionMismatch { req: version_req }) +} From 0eb9424f1774c6f22e7bce16cef5d0c0306de35e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 22:47:47 +1000 Subject: [PATCH 0270/2020] Set vis of `find_version` to `pub(super)` Signed-off-by: Jiahao XU --- src/drivers/version.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/version.rs b/src/drivers/version.rs index d1d9fdf8..7d5f4a74 100644 --- a/src/drivers/version.rs +++ b/src/drivers/version.rs @@ -5,7 +5,7 @@ use semver::{Version, VersionReq}; use crate::BinstallError; -pub(crate) fn find_version<'a, V: Iterator>( +pub(super) fn find_version<'a, V: Iterator>( requirement: &str, version_iter: V, ) -> Result { From 0162f5f462789aa613f1b8edce202531d492b055 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Jun 2022 22:53:34 +1000 Subject: [PATCH 0271/2020] Add doc for `TarEntriesVisitor` Signed-off-by: Jiahao XU --- src/helpers/extracter.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index 1175da8a..78d858c3 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -11,6 +11,8 @@ use zstd::stream::Decoder as ZstdDecoder; use crate::{BinstallError, TarBasedFmt}; +/// Visitor must iterate over all entries. +/// Entires can be in arbitary order. pub trait TarEntriesVisitor { fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), BinstallError>; } From cb2be5a882018c10bcd90b9045ab8b2c48e0678e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 01:46:10 +1000 Subject: [PATCH 0272/2020] Add new trait `PathExt` & impl for `Path` Signed-off-by: Jiahao XU --- src/helpers.rs | 3 +++ src/helpers/path_ext.rs | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 src/helpers/path_ext.rs diff --git a/src/helpers.rs b/src/helpers.rs index 7670b15b..643eda60 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -24,6 +24,9 @@ pub use extracter::TarEntriesVisitor; mod readable_rx; +mod path_ext; +pub use path_ext::*; + /// Load binstall metadata from the crate `Cargo.toml` at the provided path pub fn load_manifest_path>( manifest_path: P, diff --git a/src/helpers/path_ext.rs b/src/helpers/path_ext.rs new file mode 100644 index 00000000..d11c0e7e --- /dev/null +++ b/src/helpers/path_ext.rs @@ -0,0 +1,34 @@ +use std::path::{Component, Path, PathBuf}; + +trait PathExt { + fn normalize_path(&self) -> PathBuf; +} + +impl PathExt for Path { + fn normalize_path(&self) -> PathBuf { + let mut components = self.components().peekable(); + let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek().cloned() { + components.next(); + PathBuf::from(c.as_os_str()) + } else { + PathBuf::new() + }; + + for component in components { + match component { + Component::Prefix(..) => unreachable!(), + Component::RootDir => { + ret.push(component.as_os_str()); + } + Component::CurDir => {} + Component::ParentDir => { + ret.pop(); + } + Component::Normal(c) => { + ret.push(c); + } + } + } + ret + } +} From c6687edf481eb0c7186805aa7752a2e1e6bda8ce Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 01:54:15 +1000 Subject: [PATCH 0273/2020] Fix visbility of `PathExt`: Mark it as `pub` Signed-off-by: Jiahao XU --- src/helpers/path_ext.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/path_ext.rs b/src/helpers/path_ext.rs index d11c0e7e..c1261f96 100644 --- a/src/helpers/path_ext.rs +++ b/src/helpers/path_ext.rs @@ -1,6 +1,6 @@ use std::path::{Component, Path, PathBuf}; -trait PathExt { +pub trait PathExt { fn normalize_path(&self) -> PathBuf; } From 3c30722a06d60c35c40b46634cb2b52fb8ee0d2e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 01:57:34 +1000 Subject: [PATCH 0274/2020] Impl new type `Vfs` which impl `AbstractFilesystem` Signed-off-by: Jiahao XU --- src/drivers.rs | 2 ++ src/drivers/vfs.rs | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 src/drivers/vfs.rs diff --git a/src/drivers.rs b/src/drivers.rs index c63d3044..5b053f25 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -8,6 +8,8 @@ pub use cratesio::*; mod version; use version::find_version; +mod vfs; + /// Fetch a crate by name and version from github /// TODO: implement this pub async fn fetch_crate_gh_releases( diff --git a/src/drivers/vfs.rs b/src/drivers/vfs.rs new file mode 100644 index 00000000..0051c44e --- /dev/null +++ b/src/drivers/vfs.rs @@ -0,0 +1,39 @@ +use std::collections::{hash_map::HashMap, hash_set::HashSet}; +use std::io; +use std::path::Path; + +use cargo_toml::AbstractFilesystem; + +use crate::helpers::PathExt; + +#[derive(Debug)] +pub(super) struct Vfs(HashMap, HashSet>>); + +impl Vfs { + pub(super) fn new() -> Self { + Self(HashMap::with_capacity(16)) + } + + /// * `path` - must be canonical, must not be empty and must + /// start with a prefix. + pub(super) fn add_path(&mut self, mut path: &Path) { + while let Some(parent) = path.parent() { + if let Some(path_str) = path.to_str() { + self.0 + .entry(parent.into()) + .or_insert_with(|| HashSet::with_capacity(4)) + .insert(path_str.into()); + } + + path = parent; + } + } +} + +impl AbstractFilesystem for Vfs { + fn file_names_in(&self, rel_path: &str) -> io::Result>> { + let rel_path = Path::new(rel_path).normalize_path(); + + Ok(self.0.get(&*rel_path).map(Clone::clone).unwrap_or_default()) + } +} From 44d43113f4eae01ea77a143fbf451f4dd088dbf8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 16:08:41 +1000 Subject: [PATCH 0275/2020] Forward impl `AbstractFilesystem` for `&Vfs` Signed-off-by: Jiahao XU --- src/drivers/vfs.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/drivers/vfs.rs b/src/drivers/vfs.rs index 0051c44e..56aa5f54 100644 --- a/src/drivers/vfs.rs +++ b/src/drivers/vfs.rs @@ -37,3 +37,9 @@ impl AbstractFilesystem for Vfs { Ok(self.0.get(&*rel_path).map(Clone::clone).unwrap_or_default()) } } + +impl AbstractFilesystem for &Vfs { + fn file_names_in(&self, rel_path: &str) -> io::Result>> { + (*self).file_names_in(rel_path) + } +} From f3d3c488e31ff92957e2a3d814b105ee4a226920 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 16:31:47 +1000 Subject: [PATCH 0276/2020] Impl new type `ManifestVisitor Signed-off-by: Jiahao XU --- src/drivers.rs | 3 ++ src/drivers/visitor.rs | 80 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 src/drivers/visitor.rs diff --git a/src/drivers.rs b/src/drivers.rs index 5b053f25..8c5a9724 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -10,6 +10,9 @@ use version::find_version; mod vfs; +mod visitor; +pub use visitor::*; + /// Fetch a crate by name and version from github /// TODO: implement this pub async fn fetch_crate_gh_releases( diff --git a/src/drivers/visitor.rs b/src/drivers/visitor.rs new file mode 100644 index 00000000..005dbace --- /dev/null +++ b/src/drivers/visitor.rs @@ -0,0 +1,80 @@ +use std::io::Read; +use std::path::{Path, PathBuf}; + +use cargo_toml::Manifest; +use log::debug; +use tar::Entries; + +use super::vfs::Vfs; +use crate::{ + helpers::{PathExt, TarEntriesVisitor}, + BinstallError, Meta, +}; + +#[derive(Debug)] +pub struct ManifestVisitor { + cargo_toml_content: Vec, + /// manifest_dir_path is treated as the current dir. + manifest_dir_path: PathBuf, + + vfs: Vfs, +} + +impl ManifestVisitor { + pub(super) fn new(manifest_dir_path: PathBuf) -> Self { + Self { + // Cargo.toml is quite large usually. + cargo_toml_content: Vec::with_capacity(2000), + manifest_dir_path, + vfs: Vfs::new(), + } + } + + /// Load binstall metadata using the extracted information stored in memory. + pub fn load_manifest(&self) -> Result, BinstallError> { + debug!("Loading manifest directly from extracted file"); + + // Load and parse manifest + let mut manifest = Manifest::::from_slice_with_metadata(&self.cargo_toml_content)?; + + // Checks vfs for binary output names + manifest.complete_from_abstract_filesystem(&self.vfs)?; + + // Return metadata + Ok(manifest) + } +} + +impl TarEntriesVisitor for ManifestVisitor { + fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), BinstallError> { + for res in entries { + let mut entry = res?; + let path = entry.path()?.normalize_path(); + + let path = if let Ok(path) = path.strip_prefix(&self.manifest_dir_path) { + path + } else { + // The path is outside of the curr dir (manifest dir), + // ignore it. + continue; + }; + + if path == Path::new("Cargo.toml") + || path == Path::new("src/main.rs") + || path.starts_with("src/bin") + { + self.vfs.add_path(path); + } + + if path == Path::new("Cargo.toml") { + // Since it is possible for the same Cargo.toml to appear + // multiple times using `tar --keep-old-files`, here we + // clear the buffer first before reading into it. + self.cargo_toml_content.clear(); + entry.read_to_end(&mut self.cargo_toml_content)?; + } + } + + Ok(()) + } +} From 5bb5d12949ef6b73448e849cc5ae1e0f2aa11159 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 16:37:53 +1000 Subject: [PATCH 0277/2020] Optimize `fetch_crate_cratesio` using `ManifestVisitor` and `download_tar_based_and_visit`. By using these two items, we avoid any I/O altogether. Everything happens in memory, thus there will be no i/o related errors or cost. This commit does not regress anything because `helpers::load_manifest_path` calls `Manifest::from_path_with_metadata`, which read in the whole `Cargo.toml` file at once. Thus this commit would not cause any OOM when the the original code would not. Signed-off-by: Jiahao XU --- src/drivers/cratesio.rs | 25 +++++++++---------------- src/main.rs | 9 +++++---- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/src/drivers/cratesio.rs b/src/drivers/cratesio.rs index 82b5044d..861b49cd 100644 --- a/src/drivers/cratesio.rs +++ b/src/drivers/cratesio.rs @@ -1,19 +1,20 @@ use std::path::{Path, PathBuf}; use std::time::Duration; +use cargo_toml::Manifest; use crates_io_api::AsyncClient; use log::debug; use url::Url; -use super::find_version; -use crate::{helpers::*, BinstallError, TarBasedFmt}; +use super::{find_version, ManifestVisitor}; +use crate::{helpers::*, BinstallError, Meta, TarBasedFmt}; /// Fetch a crate Cargo.toml by name and version from crates.io pub async fn fetch_crate_cratesio( name: &str, version_req: &str, temp_dir: &Path, -) -> Result { +) -> Result, BinstallError> { // Fetch / update index debug!("Looking up crate information"); @@ -59,22 +60,14 @@ pub async fn fetch_crate_cratesio( debug!("Fetching crate from: {crate_url} and extracting Cargo.toml from it"); - let crate_dir: PathBuf = format!("{name}-{version_name}").into(); - let crate_path = temp_dir.join(&crate_dir); + let manifest_dir_path: PathBuf = format!("{name}-{version_name}").into(); - let cargo_toml = crate_dir.join("Cargo.toml"); - let src = crate_dir.join("src"); - let main = src.join("main.rs"); - let bin = src.join("bin"); - - download_and_extract_with_filter( + download_tar_based_and_visit( Url::parse(&crate_url)?, TarBasedFmt::Tgz, &temp_dir, - move |path: &Path| path == cargo_toml || path == main || path.starts_with(&bin), + ManifestVisitor::new(manifest_dir_path), ) - .await?; - - // Return crate directory - Ok(crate_path) + .await? + .load_manifest() } diff --git a/src/main.rs b/src/main.rs index 5b89353c..b95a7111 100644 --- a/src/main.rs +++ b/src/main.rs @@ -210,13 +210,14 @@ async fn entry() -> Result<()> { // Fetch crate via crates.io, git, or use a local manifest path // TODO: work out which of these to do based on `opts.name` // TODO: support git-based fetches (whole repo name rather than just crate name) - let manifest_path = match opts.manifest_path.clone() { - Some(p) => p, + let manifest = match opts.manifest_path.clone() { + Some(manifest_path) => { + debug!("Reading manifest: {}", manifest_path.display()); + load_manifest_path(manifest_path.join("Cargo.toml"))? + } None => fetch_crate_cratesio(&opts.name, &opts.version, temp_dir.path()).await?, }; - debug!("Reading manifest: {}", manifest_path.display()); - let manifest = load_manifest_path(manifest_path.join("Cargo.toml"))?; let package = manifest.package.unwrap(); let is_plain_version = semver::Version::from_str(&opts.version).is_ok(); From e68eea35fec6597cc8e000d0fcfdc031283a335c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 16:40:51 +1000 Subject: [PATCH 0278/2020] Mark type `ManifestVisitor` as `pub(super)` Since mod `cretesio` is the only one need to have access to it. Signed-off-by: Jiahao XU --- src/drivers.rs | 1 - src/drivers/cratesio.rs | 2 +- src/drivers/visitor.rs | 4 ++-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/drivers.rs b/src/drivers.rs index 8c5a9724..8b8f362f 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -11,7 +11,6 @@ use version::find_version; mod vfs; mod visitor; -pub use visitor::*; /// Fetch a crate by name and version from github /// TODO: implement this diff --git a/src/drivers/cratesio.rs b/src/drivers/cratesio.rs index 861b49cd..28a157ca 100644 --- a/src/drivers/cratesio.rs +++ b/src/drivers/cratesio.rs @@ -6,7 +6,7 @@ use crates_io_api::AsyncClient; use log::debug; use url::Url; -use super::{find_version, ManifestVisitor}; +use super::{find_version, visitor::ManifestVisitor}; use crate::{helpers::*, BinstallError, Meta, TarBasedFmt}; /// Fetch a crate Cargo.toml by name and version from crates.io diff --git a/src/drivers/visitor.rs b/src/drivers/visitor.rs index 005dbace..850d7c39 100644 --- a/src/drivers/visitor.rs +++ b/src/drivers/visitor.rs @@ -12,7 +12,7 @@ use crate::{ }; #[derive(Debug)] -pub struct ManifestVisitor { +pub(super) struct ManifestVisitor { cargo_toml_content: Vec, /// manifest_dir_path is treated as the current dir. manifest_dir_path: PathBuf, @@ -31,7 +31,7 @@ impl ManifestVisitor { } /// Load binstall metadata using the extracted information stored in memory. - pub fn load_manifest(&self) -> Result, BinstallError> { + pub(super) fn load_manifest(&self) -> Result, BinstallError> { debug!("Loading manifest directly from extracted file"); // Load and parse manifest From f82890cba396a1f0eb696ae1cf51089e96a7c403 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 16:42:32 +1000 Subject: [PATCH 0279/2020] Rm `download_and_extract_with_filter` Signed-off-by: Jiahao XU --- src/helpers.rs | 30 ------------------- src/helpers/async_extracter.rs | 53 +--------------------------------- 2 files changed, 1 insertion(+), 82 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 643eda60..7a222d3f 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -86,36 +86,6 @@ pub async fn download_and_extract>( Ok(()) } -/// Download a file from the provided URL and extract part of it to -/// the provided path. -/// -/// * `filter` - It will pass the path of the file to it -/// and only extract ones which filter returns `true`. -pub async fn download_and_extract_with_filter< - Filter: FnMut(&Path) -> bool + Send + 'static, - P: AsRef, ->( - url: Url, - fmt: TarBasedFmt, - path: P, - filter: Filter, -) -> Result<(), BinstallError> { - debug!("Downloading from: '{url}'"); - - let resp = create_request(url).await?; - - let path = path.as_ref(); - debug!("Downloading to file: '{}'", path.display()); - - let stream = resp.bytes_stream(); - - extract_tar_based_stream_with_filter(stream, path, fmt, filter).await?; - - debug!("Download OK, written to file: '{}'", path.display()); - - Ok(()) -} - /// Download a file from the provided URL and extract part of it to /// the provided path. /// diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index cdf8ffea..8564d19e 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -1,12 +1,10 @@ use std::fmt::Debug; use std::fs; use std::io::{self, Read, Seek, Write}; -use std::path::{Path, PathBuf}; -use std::sync::Arc; +use std::path::Path; use bytes::Bytes; use futures_util::stream::{Stream, StreamExt}; -use log::debug; use scopeguard::{guard, ScopeGuard}; use tar::Entries; use tempfile::tempfile; @@ -203,55 +201,6 @@ where .await } -/// * `filter` - If Some, then it will pass the path of the file to it -/// and only extract ones which filter returns `true`. -pub async fn extract_tar_based_stream_with_filter< - Filter: FnMut(&Path) -> bool + Send + 'static, - E, ->( - stream: impl Stream> + Unpin, - output: &Path, - fmt: TarBasedFmt, - filter: Filter, -) -> Result<(), BinstallError> -where - BinstallError: From, -{ - struct Visitor(F, Arc); - - impl bool + Send + 'static> TarEntriesVisitor for Visitor { - fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), BinstallError> { - for res in entries { - let mut entry = res?; - let entry_path = entry.path()?; - - if self.0(&entry_path) { - debug!("Extracting {entry_path:#?}"); - - let dst = self.1.join(entry_path); - - fs::create_dir_all(dst.parent().unwrap())?; - - entry.unpack(dst)?; - } - } - - Ok(()) - } - } - - let path = Arc::new(output.to_owned()); - - let visitor = Visitor(filter, path.clone()); - - extract_impl(stream, move |mut rx| { - fs::create_dir_all(path.parent().unwrap())?; - - extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt, &*path, Some(visitor)) - }) - .await -} - pub async fn extract_tar_based_stream( stream: impl Stream> + Unpin, output: &Path, From b2c34137ccc70b9c2ea1bebf1161fff852996ec9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 16:56:41 +1000 Subject: [PATCH 0280/2020] Mark `extract_compressed_from_readable` & `unzip` to be `pub(super)` Signed-off-by: Jiahao XU --- src/helpers/extracter.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index 78d858c3..c24634cf 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -54,7 +54,7 @@ fn untar( /// and only extract ones which filter returns `true`. /// Note that this is a best-effort and it only works when `fmt` /// is not `PkgFmt::Bin` or `PkgFmt::Zip`. -pub(crate) fn extract_compressed_from_readable( +pub(super) fn extract_compressed_from_readable( dat: R, fmt: TarBasedFmt, path: &Path, @@ -99,7 +99,7 @@ pub(crate) fn extract_compressed_from_readable Ok(()) } -pub(crate) fn unzip(dat: File, dst: &Path) -> Result<(), BinstallError> { +pub(super) fn unzip(dat: File, dst: &Path) -> Result<(), BinstallError> { debug!("Decompressing from zip archive to `{dst:?}`"); let mut zip = ZipArchive::new(dat)?; From 17fcac7e63828195728238c368fd6c547ed9059d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 17:03:39 +1000 Subject: [PATCH 0281/2020] Refactor: Simplify `untar` with new enum `Op` Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 10 ++----- src/helpers/extracter.rs | 52 ++++++++++++++++++++-------------- 2 files changed, 33 insertions(+), 29 deletions(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 8564d19e..80ed397c 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -225,8 +225,7 @@ where extract_compressed_from_readable::( ReadableRx::new(&mut rx), fmt, - &path, - None, + Op::UnpackToPath(&path), ) }) .await @@ -246,12 +245,7 @@ where extract_impl(stream, move |mut rx| { fs::create_dir_all(path.parent().unwrap())?; - extract_compressed_from_readable( - ReadableRx::new(&mut rx), - fmt, - &*path, - Some(&mut visitor), - )?; + extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt, Op::Visit(&mut visitor))?; Ok(visitor) }) diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index c24634cf..12133da2 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -23,23 +23,28 @@ impl TarEntriesVisitor for &mut V { } } +#[derive(Debug)] +pub(super) enum Op<'a, V: TarEntriesVisitor> { + UnpackToPath(&'a Path), + Visit(V), +} + /// * `f` - If Some, then this function will pass /// the entries of the `dat` to it and let it decides /// what to do with the tar. -fn untar( - dat: R, - path: &Path, - visitor: Option, -) -> Result<(), BinstallError> { +fn untar(dat: R, op: Op<'_, V>) -> Result<(), BinstallError> { let mut tar = Archive::new(dat); - if let Some(mut visitor) = visitor { - debug!("Untaring with filter"); + match op { + Op::Visit(mut visitor) => { + debug!("Untaring with callback"); - visitor.visit(tar.entries()?)?; - } else { - debug!("Untaring entire tar"); - tar.unpack(path)?; + visitor.visit(tar.entries()?)?; + } + Op::UnpackToPath(path) => { + debug!("Untaring entire tar"); + tar.unpack(path)?; + } } debug!("Untaring completed"); @@ -57,42 +62,47 @@ fn untar( pub(super) fn extract_compressed_from_readable( dat: R, fmt: TarBasedFmt, - path: &Path, - visitor: Option, + op: Op<'_, V>, ) -> Result<(), BinstallError> { use TarBasedFmt::*; + let msg = if let Op::UnpackToPath(path) = op { + format!("destination: {path:#?}") + } else { + "process in-memory".to_string() + }; + match fmt { Tar => { // Extract to install dir - debug!("Extracting from tar archive to `{path:?}`"); + debug!("Extracting from tar archive: {msg}"); - untar(dat, path, visitor)? + untar(dat, op)? } Tgz => { // Extract to install dir - debug!("Decompressing from tgz archive to `{path:?}`"); + debug!("Decompressing from tgz archive {msg}"); let tar = GzDecoder::new(dat); - untar(tar, path, visitor)?; + untar(tar, op)?; } Txz => { // Extract to install dir - debug!("Decompressing from txz archive to `{path:?}`"); + debug!("Decompressing from txz archive {msg}"); let tar = XzDecoder::new(dat); - untar(tar, path, visitor)?; + untar(tar, op)?; } Tzstd => { // Extract to install dir - debug!("Decompressing from tzstd archive to `{path:?}`"); + debug!("Decompressing from tzstd archive {msg}"); // The error can only come from raw::Decoder::with_dictionary // as of zstd 0.10.2 and 0.11.2, which is specified // as &[] by ZstdDecoder::new, thus ZstdDecoder::new // should not return any error. let tar = ZstdDecoder::with_buffer(dat)?; - untar(tar, path, visitor)?; + untar(tar, op)?; } }; From e376b71cf4d5f916be716096884b6a46ff006c0b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 17:05:21 +1000 Subject: [PATCH 0282/2020] Simplify `extract_tar_based_stream_and_visit` Rm unused param `path` and the unnecessary `fs::create_dir_all` since the tar will not be extracted to disk. Signed-off-by: Jiahao XU --- src/helpers.rs | 2 +- src/helpers/async_extracter.rs | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 7a222d3f..a4899bf9 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -109,7 +109,7 @@ pub async fn download_tar_based_and_visit< let stream = resp.bytes_stream(); - let visitor = extract_tar_based_stream_and_visit(stream, path, fmt, visitor).await?; + let visitor = extract_tar_based_stream_and_visit(stream, fmt, visitor).await?; debug!("Download OK, written to file: '{}'", path.display()); diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 80ed397c..3d948de3 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -233,21 +233,15 @@ where pub async fn extract_tar_based_stream_and_visit( stream: impl Stream> + Unpin, - output: &Path, fmt: TarBasedFmt, mut visitor: V, ) -> Result where BinstallError: From, { - let path = output.to_owned(); - extract_impl(stream, move |mut rx| { - fs::create_dir_all(path.parent().unwrap())?; - - extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt, Op::Visit(&mut visitor))?; - - Ok(visitor) + extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt, Op::Visit(&mut visitor)) + .map(|_| visitor) }) .await } From f25306ff97de8320a9ba3a1835b57f6ca00aa695 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 17:07:29 +1000 Subject: [PATCH 0283/2020] Simplify `download_tar_based_and_visit`: Rm unused param `path` Signed-off-by: Jiahao XU --- src/drivers/cratesio.rs | 1 - src/helpers.rs | 11 +++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/drivers/cratesio.rs b/src/drivers/cratesio.rs index 28a157ca..eb47a6b0 100644 --- a/src/drivers/cratesio.rs +++ b/src/drivers/cratesio.rs @@ -65,7 +65,6 @@ pub async fn fetch_crate_cratesio( download_tar_based_and_visit( Url::parse(&crate_url)?, TarBasedFmt::Tgz, - &temp_dir, ManifestVisitor::new(manifest_dir_path), ) .await? diff --git a/src/helpers.rs b/src/helpers.rs index a4899bf9..0667383c 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -91,27 +91,22 @@ pub async fn download_and_extract>( /// /// * `filter` - If Some, then it will pass the path of the file to it /// and only extract ones which filter returns `true`. -pub async fn download_tar_based_and_visit< - V: TarEntriesVisitor + Debug + Send + 'static, - P: AsRef, ->( +pub async fn download_tar_based_and_visit( url: Url, fmt: TarBasedFmt, - path: P, visitor: V, ) -> Result { debug!("Downloading from: '{url}'"); let resp = create_request(url).await?; - let path = path.as_ref(); - debug!("Downloading to file: '{}'", path.display()); + debug!("Downloading and extracting then in-memory processing"); let stream = resp.bytes_stream(); let visitor = extract_tar_based_stream_and_visit(stream, fmt, visitor).await?; - debug!("Download OK, written to file: '{}'", path.display()); + debug!("Download, extraction and in-memory procession OK"); Ok(visitor) } From e39549f470fd6ef7d968a9e4cc26581f57f37acf Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 17:08:22 +1000 Subject: [PATCH 0284/2020] Improve `debug!` logging in `download_and_extract` Signed-off-by: Jiahao XU --- src/helpers.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 0667383c..a088b99e 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -71,7 +71,7 @@ pub async fn download_and_extract>( let resp = create_request(url).await?; let path = path.as_ref(); - debug!("Downloading to file: '{}'", path.display()); + debug!("Downloading and extracting to: '{}'", path.display()); let stream = resp.bytes_stream(); @@ -81,7 +81,7 @@ pub async fn download_and_extract>( PkgFmtDecomposed::Zip => extract_zip(stream, path).await?, } - debug!("Download OK, written to file: '{}'", path.display()); + debug!("Download OK, extracted to: '{}'", path.display()); Ok(()) } From 24b1941c1a79eb29d00d9b19b5c9a971fc437c32 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 17:09:17 +1000 Subject: [PATCH 0285/2020] Simplify `fetch_crate_cratesio`: Rm unused param `temp_dir` Signed-off-by: Jiahao XU --- src/drivers/cratesio.rs | 3 +-- src/main.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/drivers/cratesio.rs b/src/drivers/cratesio.rs index eb47a6b0..0bc6027b 100644 --- a/src/drivers/cratesio.rs +++ b/src/drivers/cratesio.rs @@ -1,4 +1,4 @@ -use std::path::{Path, PathBuf}; +use std::path::PathBuf; use std::time::Duration; use cargo_toml::Manifest; @@ -13,7 +13,6 @@ use crate::{helpers::*, BinstallError, Meta, TarBasedFmt}; pub async fn fetch_crate_cratesio( name: &str, version_req: &str, - temp_dir: &Path, ) -> Result, BinstallError> { // Fetch / update index debug!("Looking up crate information"); diff --git a/src/main.rs b/src/main.rs index b95a7111..f9136157 100644 --- a/src/main.rs +++ b/src/main.rs @@ -215,7 +215,7 @@ async fn entry() -> Result<()> { debug!("Reading manifest: {}", manifest_path.display()); load_manifest_path(manifest_path.join("Cargo.toml"))? } - None => fetch_crate_cratesio(&opts.name, &opts.version, temp_dir.path()).await?, + None => fetch_crate_cratesio(&opts.name, &opts.version).await?, }; let package = manifest.package.unwrap(); From 989be49cb0faa620b6b6c56e1e30e5514fcfc590 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 17:13:48 +1000 Subject: [PATCH 0286/2020] Fix confusing doc of `Vfs::add_path` Signed-off-by: Jiahao XU --- src/drivers/vfs.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/drivers/vfs.rs b/src/drivers/vfs.rs index 56aa5f54..08178b06 100644 --- a/src/drivers/vfs.rs +++ b/src/drivers/vfs.rs @@ -14,8 +14,7 @@ impl Vfs { Self(HashMap::with_capacity(16)) } - /// * `path` - must be canonical, must not be empty and must - /// start with a prefix. + /// * `path` - must be canonical, must not be empty. pub(super) fn add_path(&mut self, mut path: &Path) { while let Some(parent) = path.parent() { if let Some(path_str) = path.to_str() { From b879c15c702acc817d6be7a9536b6afa6a764967 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 17:22:20 +1000 Subject: [PATCH 0287/2020] Update doc of `PathExt::normalize_path` Signed-off-by: Jiahao XU --- src/helpers/path_ext.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/helpers/path_ext.rs b/src/helpers/path_ext.rs index c1261f96..c4958539 100644 --- a/src/helpers/path_ext.rs +++ b/src/helpers/path_ext.rs @@ -1,6 +1,8 @@ use std::path::{Component, Path, PathBuf}; pub trait PathExt { + /// Similiar to `os.path.normpath`: It does not perform + /// any fs operation. fn normalize_path(&self) -> PathBuf; } From b88e384f9535f84ca782fe0eace1359542c4cca3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 19:17:06 +1000 Subject: [PATCH 0288/2020] Fix `Vfs::add_path`: Add insert `filename` instead of `path` into the `HashSet>` Signed-off-by: Jiahao XU --- src/drivers/vfs.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/drivers/vfs.rs b/src/drivers/vfs.rs index 08178b06..d43b3a8a 100644 --- a/src/drivers/vfs.rs +++ b/src/drivers/vfs.rs @@ -17,11 +17,14 @@ impl Vfs { /// * `path` - must be canonical, must not be empty. pub(super) fn add_path(&mut self, mut path: &Path) { while let Some(parent) = path.parent() { - if let Some(path_str) = path.to_str() { + // Since path has parent, it must have a filename + let filename = path.file_name().unwrap(); + + if let Some(filename) = filename.to_str() { self.0 .entry(parent.into()) .or_insert_with(|| HashSet::with_capacity(4)) - .insert(path_str.into()); + .insert(filename.into()); } path = parent; From bd39ce754fa2c0a225d5634efa7943c527874f91 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 19:23:03 +1000 Subject: [PATCH 0289/2020] Fix `Vfs::add_path`: Use `to_string_lossy` instead of `to_str` to be compatible with the implementation in `cargo_toml`: https://docs.rs/cargo_toml/0.11.5/src/cargo_toml/afs.rs.html#24 Signed-off-by: Jiahao XU --- src/drivers/vfs.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/drivers/vfs.rs b/src/drivers/vfs.rs index d43b3a8a..18c422de 100644 --- a/src/drivers/vfs.rs +++ b/src/drivers/vfs.rs @@ -20,12 +20,14 @@ impl Vfs { // Since path has parent, it must have a filename let filename = path.file_name().unwrap(); - if let Some(filename) = filename.to_str() { - self.0 - .entry(parent.into()) - .or_insert_with(|| HashSet::with_capacity(4)) - .insert(filename.into()); - } + // `cargo_toml`'s implementation does the same thing. + // https://docs.rs/cargo_toml/0.11.5/src/cargo_toml/afs.rs.html#24 + let filename = filename.to_string_lossy(); + + self.0 + .entry(parent.into()) + .or_insert_with(|| HashSet::with_capacity(4)) + .insert(filename.into()); path = parent; } From 3a1038c80b0f69564d00ebd2cb6c57854c714f41 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 19:44:59 +1000 Subject: [PATCH 0290/2020] Optimize binary size/compilation time by reducing generics monomorphization using `Box`. Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 89 ++++++++++++++++++---------------- 1 file changed, 48 insertions(+), 41 deletions(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 3d948de3..7073d824 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -109,14 +109,9 @@ impl AsyncExtracterInner { } } -async fn extract_impl< - F: FnOnce(mpsc::Receiver) -> Result + Send + 'static, - T: Debug + Send + 'static, - S: Stream> + Unpin, - E, ->( +async fn extract_impl> + Unpin, E>( mut stream: S, - f: F, + f: Box) -> Result + Send>, ) -> Result where BinstallError: From, @@ -155,25 +150,28 @@ where { let path = output.to_owned(); - extract_impl(stream, move |mut rx| { - fs::create_dir_all(path.parent().unwrap())?; + extract_impl( + stream, + Box::new(move |mut rx| { + fs::create_dir_all(path.parent().unwrap())?; - let mut file = fs::File::create(&path)?; + let mut file = fs::File::create(&path)?; - // remove it unless the operation isn't aborted and no write - // fails. - let remove_guard = guard(&path, |path| { - fs::remove_file(path).ok(); - }); + // remove it unless the operation isn't aborted and no write + // fails. + let remove_guard = guard(&path, |path| { + fs::remove_file(path).ok(); + }); - read_into_file(&mut file, &mut rx)?; + read_into_file(&mut file, &mut rx)?; - // Operation isn't aborted and all writes succeed, - // disarm the remove_guard. - ScopeGuard::into_inner(remove_guard); + // Operation isn't aborted and all writes succeed, + // disarm the remove_guard. + ScopeGuard::into_inner(remove_guard); - Ok(()) - }) + Ok(()) + }), + ) .await } @@ -186,18 +184,21 @@ where { let path = output.to_owned(); - extract_impl(stream, move |mut rx| { - fs::create_dir_all(path.parent().unwrap())?; + extract_impl( + stream, + Box::new(move |mut rx| { + fs::create_dir_all(path.parent().unwrap())?; - let mut file = tempfile()?; + let mut file = tempfile()?; - read_into_file(&mut file, &mut rx)?; + read_into_file(&mut file, &mut rx)?; - // rewind it so that we can pass it to unzip - file.rewind()?; + // rewind it so that we can pass it to unzip + file.rewind()?; - unzip(file, &path) - }) + unzip(file, &path) + }), + ) .await } @@ -219,15 +220,18 @@ where let path = output.to_owned(); - extract_impl(stream, move |mut rx| { - fs::create_dir_all(path.parent().unwrap())?; + extract_impl( + stream, + Box::new(move |mut rx| { + fs::create_dir_all(path.parent().unwrap())?; - extract_compressed_from_readable::( - ReadableRx::new(&mut rx), - fmt, - Op::UnpackToPath(&path), - ) - }) + extract_compressed_from_readable::( + ReadableRx::new(&mut rx), + fmt, + Op::UnpackToPath(&path), + ) + }), + ) .await } @@ -239,9 +243,12 @@ pub async fn extract_tar_based_stream_and_visit, { - extract_impl(stream, move |mut rx| { - extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt, Op::Visit(&mut visitor)) - .map(|_| visitor) - }) + extract_impl( + stream, + Box::new(move |mut rx| { + extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt, Op::Visit(&mut visitor)) + .map(|_| visitor) + }), + ) .await } From baf9784b82344e4349c27d252e0c0c88aa922125 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 19:52:03 +1000 Subject: [PATCH 0291/2020] Update doc of mod `async_extracter` Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 35 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 7073d824..16cf6c03 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -1,3 +1,19 @@ +//! # Advantages +//! +//! Using this mod has the following advantages over downloading +//! and extracting in on the async thread: +//! +//! - The code is pipelined instead of storing the downloaded file in memory +//! and extract it, except for `PkgFmt::Zip`, since `ZipArchiver::new` +//! requires `std::io::Seek`, so it fallbacks to writing the a file then +//! unzip it. +//! - The async part (downloading) and the extracting part runs in parallel +//! using `tokio::spawn_nonblocking`. +//! - Compressing/writing which takes a lot of CPU time will not block +//! the runtime anymore. +//! - For all `tar` based formats, it can extract only specified files and +//! process them in memory, without any disk I/O. + use std::fmt::Debug; use std::fs; use std::io::{self, Read, Seek, Write}; @@ -29,25 +45,6 @@ pub(crate) enum Content { /// /// After all write is done, you must call `AsyncExtracter::done`, /// otherwise the extracted content will be removed on drop. -/// -/// # Advantages -/// -/// `download_and_extract` has the following advantages over downloading -/// plus extracting in on the same thread: -/// -/// - The code is pipelined instead of storing the downloaded file in memory -/// and extract it, except for `PkgFmt::Zip`, since `ZipArchiver::new` -/// requires `std::io::Seek`, so it fallbacks to writing the a file then -/// unzip it. -/// - The async part (downloading) and the extracting part runs in parallel -/// using `tokio::spawn_nonblocking`. -/// - Compressing/writing which takes a lot of CPU time will not block -/// the runtime anymore. -/// - For any PkgFmt except for `PkgFmt::Zip` and `PkgFmt::Bin` (basically -/// all `tar` based formats), it can extract only specified files. -/// This means that `super::drivers::fetch_crate_cratesio` no longer need to -/// extract the whole crate and write them to disk, it now only extract the -/// relevant part (`Cargo.toml`) out to disk and open it. #[derive(Debug)] struct AsyncExtracterInner { /// Use AutoAbortJoinHandle so that the task From 225cf74cd9601ee5829bf89de24eacf801787f93 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 20:01:43 +1000 Subject: [PATCH 0292/2020] Refactor: Ret `impl Stream` in `create_request` Since both `download*` function takes a `impl Stream` and the `Response::bytes_stream` takes `Response` by value, thus there is no lifetime issue and we can return `impl Stream` instead of `Response` Signed-off-by: Jiahao XU --- src/helpers.rs | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index a088b99e..721716bb 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,7 +1,9 @@ use std::fmt::Debug; use std::path::{Path, PathBuf}; +use bytes::Bytes; use cargo_toml::Manifest; +use futures_util::stream::Stream; use log::debug; use reqwest::{Method, Response}; use serde::Serialize; @@ -49,7 +51,9 @@ pub async fn remote_exists(url: Url, method: Method) -> Result Result { +async fn create_request( + url: Url, +) -> Result>, BinstallError> { reqwest::get(url.clone()) .await .and_then(|r| r.error_for_status()) @@ -58,6 +62,7 @@ async fn create_request(url: Url) -> Result { url, err, }) + .map(Response::bytes_stream) } /// Download a file from the provided URL and extract it to the provided path. @@ -68,13 +73,11 @@ pub async fn download_and_extract>( ) -> Result<(), BinstallError> { debug!("Downloading from: '{url}'"); - let resp = create_request(url).await?; + let stream = create_request(url).await?; let path = path.as_ref(); debug!("Downloading and extracting to: '{}'", path.display()); - let stream = resp.bytes_stream(); - match fmt.decompose() { PkgFmtDecomposed::Tar(fmt) => extract_tar_based_stream(stream, path, fmt).await?, PkgFmtDecomposed::Bin => extract_bin(stream, path).await?, @@ -98,12 +101,10 @@ pub async fn download_tar_based_and_visit Result { debug!("Downloading from: '{url}'"); - let resp = create_request(url).await?; + let stream = create_request(url).await?; debug!("Downloading and extracting then in-memory processing"); - let stream = resp.bytes_stream(); - let visitor = extract_tar_based_stream_and_visit(stream, fmt, visitor).await?; debug!("Download, extraction and in-memory procession OK"); From 94c77c32b4946f256cc45edfc8672846122835fd Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 22:38:00 +1000 Subject: [PATCH 0293/2020] Make `debug!` message more consistent in `extract_compressed_from_readable` Signed-off-by: Jiahao XU --- src/helpers/extracter.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index 12133da2..cbf65802 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -81,21 +81,21 @@ pub(super) fn extract_compressed_from_readable } Tgz => { // Extract to install dir - debug!("Decompressing from tgz archive {msg}"); + debug!("Decompressing from tgz archive: {msg}"); let tar = GzDecoder::new(dat); untar(tar, op)?; } Txz => { // Extract to install dir - debug!("Decompressing from txz archive {msg}"); + debug!("Decompressing from txz archive: {msg}"); let tar = XzDecoder::new(dat); untar(tar, op)?; } Tzstd => { // Extract to install dir - debug!("Decompressing from tzstd archive {msg}"); + debug!("Decompressing from tzstd archive: {msg}"); // The error can only come from raw::Decoder::with_dictionary // as of zstd 0.10.2 and 0.11.2, which is specified From c9b0c0c59c45b40065d7928b053dcec70f0203eb Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Jun 2022 22:38:34 +1000 Subject: [PATCH 0294/2020] Add `.DS_Store` to `.gitignore` Signed-off-by: Jiahao XU --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index ea8c4bf7..05923927 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ /target +.DS_Store From b4e61161f2f5f650fa6e84cf018c639304de6778 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 13 Jun 2022 00:53:08 +1000 Subject: [PATCH 0295/2020] Derive `strum_macros::Display` on `TarBasedFmt` sp that it can be printed. Signed-off-by: Jiahao XU --- src/fmt.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fmt.rs b/src/fmt.rs index 34a9dc1e..840ffc6a 100644 --- a/src/fmt.rs +++ b/src/fmt.rs @@ -50,7 +50,7 @@ pub enum PkgFmtDecomposed { Zip, } -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Display, Copy, Clone, PartialEq)] pub enum TarBasedFmt { /// Download format is TAR (uncompressed) Tar, From 8ef1e56fcceba6adaec43826fa4a490b16ab1eb9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 13 Jun 2022 01:05:07 +1000 Subject: [PATCH 0296/2020] Take `Receiver` by value in `ReadableRx::new` It would remove the lifetime and make reasoning the code much easier. It would also unblock the next commit I am going to make. Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 8 ++++---- src/helpers/readable_rx.rs | 12 ++++++------ 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 16cf6c03..04a6117b 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -219,11 +219,11 @@ where extract_impl( stream, - Box::new(move |mut rx| { + Box::new(move |rx| { fs::create_dir_all(path.parent().unwrap())?; extract_compressed_from_readable::( - ReadableRx::new(&mut rx), + ReadableRx::new(rx), fmt, Op::UnpackToPath(&path), ) @@ -242,8 +242,8 @@ where { extract_impl( stream, - Box::new(move |mut rx| { - extract_compressed_from_readable(ReadableRx::new(&mut rx), fmt, Op::Visit(&mut visitor)) + Box::new(move |rx| { + extract_compressed_from_readable(ReadableRx::new(rx), fmt, Op::Visit(&mut visitor)) .map(|_| visitor) }), ) diff --git a/src/helpers/readable_rx.rs b/src/helpers/readable_rx.rs index 545bc176..e2597aae 100644 --- a/src/helpers/readable_rx.rs +++ b/src/helpers/readable_rx.rs @@ -7,13 +7,13 @@ use tokio::sync::mpsc::Receiver; use super::async_extracter::Content; #[derive(Debug)] -pub(crate) struct ReadableRx<'a> { - rx: &'a mut Receiver, +pub(crate) struct ReadableRx { + rx: Receiver, bytes: Bytes, } -impl<'a> ReadableRx<'a> { - pub(crate) fn new(rx: &'a mut Receiver) -> Self { +impl ReadableRx { + pub(crate) fn new(rx: Receiver) -> Self { Self { rx, bytes: Bytes::new(), @@ -21,7 +21,7 @@ impl<'a> ReadableRx<'a> { } } -impl Read for ReadableRx<'_> { +impl Read for ReadableRx { fn read(&mut self, buf: &mut [u8]) -> io::Result { if buf.is_empty() { return Ok(0); @@ -43,7 +43,7 @@ impl Read for ReadableRx<'_> { } } -impl BufRead for ReadableRx<'_> { +impl BufRead for ReadableRx { fn fill_buf(&mut self) -> io::Result<&[u8]> { let bytes = &mut self.bytes; if !bytes.has_remaining() { From 9584c8d35e7c69939935b7b11e3befe0a50e5a86 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 13 Jun 2022 01:06:12 +1000 Subject: [PATCH 0297/2020] Refactor: Extract `create_tar_decoder` from `extract_compressed_from_readable`. Signed-off-by: Jiahao XU --- src/helpers/extracter.rs | 70 +++++++++++++++++----------------------- 1 file changed, 30 insertions(+), 40 deletions(-) diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index cbf65802..5994882f 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -32,9 +32,10 @@ pub(super) enum Op<'a, V: TarEntriesVisitor> { /// * `f` - If Some, then this function will pass /// the entries of the `dat` to it and let it decides /// what to do with the tar. -fn untar(dat: R, op: Op<'_, V>) -> Result<(), BinstallError> { - let mut tar = Archive::new(dat); - +fn untar( + mut tar: Archive, + op: Op<'_, V>, +) -> Result<(), BinstallError> { match op { Op::Visit(mut visitor) => { debug!("Untaring with callback"); @@ -52,6 +53,28 @@ fn untar(dat: R, op: Op<'_, V>) -> Result<(), Bin Ok(()) } +pub(super) fn create_tar_decoder( + dat: impl BufRead + 'static, + fmt: TarBasedFmt, +) -> Result>, BinstallError> { + use TarBasedFmt::*; + + let r: Box = match fmt { + Tar => Box::new(dat), + Tgz => Box::new(GzDecoder::new(dat)), + Txz => Box::new(XzDecoder::new(dat)), + Tzstd => { + // The error can only come from raw::Decoder::with_dictionary + // as of zstd 0.10.2 and 0.11.2, which is specified + // as &[] by ZstdDecoder::new, thus ZstdDecoder::new + // should not return any error. + Box::new(ZstdDecoder::with_buffer(dat)?) + } + }; + + Ok(Archive::new(r)) +} + /// Extract files from the specified source onto the specified path. /// /// * `fmt` - must not be `PkgFmt::Bin` or `PkgFmt::Zip`. @@ -59,54 +82,21 @@ fn untar(dat: R, op: Op<'_, V>) -> Result<(), Bin /// and only extract ones which filter returns `true`. /// Note that this is a best-effort and it only works when `fmt` /// is not `PkgFmt::Bin` or `PkgFmt::Zip`. -pub(super) fn extract_compressed_from_readable( +pub(super) fn extract_compressed_from_readable( dat: R, fmt: TarBasedFmt, op: Op<'_, V>, ) -> Result<(), BinstallError> { - use TarBasedFmt::*; - let msg = if let Op::UnpackToPath(path) = op { format!("destination: {path:#?}") } else { "process in-memory".to_string() }; - match fmt { - Tar => { - // Extract to install dir - debug!("Extracting from tar archive: {msg}"); + debug!("Extracting from {fmt} archive: {msg}"); - untar(dat, op)? - } - Tgz => { - // Extract to install dir - debug!("Decompressing from tgz archive: {msg}"); - - let tar = GzDecoder::new(dat); - untar(tar, op)?; - } - Txz => { - // Extract to install dir - debug!("Decompressing from txz archive: {msg}"); - - let tar = XzDecoder::new(dat); - untar(tar, op)?; - } - Tzstd => { - // Extract to install dir - debug!("Decompressing from tzstd archive: {msg}"); - - // The error can only come from raw::Decoder::with_dictionary - // as of zstd 0.10.2 and 0.11.2, which is specified - // as &[] by ZstdDecoder::new, thus ZstdDecoder::new - // should not return any error. - let tar = ZstdDecoder::with_buffer(dat)?; - untar(tar, op)?; - } - }; - - Ok(()) + let tar = create_tar_decoder(dat, fmt)?; + untar(tar, op) } pub(super) fn unzip(dat: File, dst: &Path) -> Result<(), BinstallError> { From 467f7f68341245f56bcfda85568928c430b7bfc9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 13 Jun 2022 01:12:21 +1000 Subject: [PATCH 0298/2020] Refactor: Call `create_tar_decoder` directly in `extract_tar_based_stream*`. Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 17 ++++++----- src/helpers/extracter.rs | 54 ---------------------------------- 2 files changed, 10 insertions(+), 61 deletions(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 04a6117b..2ae31a23 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -21,6 +21,7 @@ use std::path::Path; use bytes::Bytes; use futures_util::stream::{Stream, StreamExt}; +use log::debug; use scopeguard::{guard, ScopeGuard}; use tar::Entries; use tempfile::tempfile; @@ -222,11 +223,10 @@ where Box::new(move |rx| { fs::create_dir_all(path.parent().unwrap())?; - extract_compressed_from_readable::( - ReadableRx::new(rx), - fmt, - Op::UnpackToPath(&path), - ) + debug!("Extracting from {fmt} archive to {path:#?}"); + create_tar_decoder(ReadableRx::new(rx), fmt)?.unpack(path)?; + + Ok(()) }), ) .await @@ -243,8 +243,11 @@ where extract_impl( stream, Box::new(move |rx| { - extract_compressed_from_readable(ReadableRx::new(rx), fmt, Op::Visit(&mut visitor)) - .map(|_| visitor) + debug!("Extracting from {fmt} archive to process it in memory"); + + let mut tar = create_tar_decoder(ReadableRx::new(rx), fmt)?; + visitor.visit(tar.entries()?)?; + Ok(visitor) }), ) .await diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index 5994882f..ee5129b3 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -23,36 +23,6 @@ impl TarEntriesVisitor for &mut V { } } -#[derive(Debug)] -pub(super) enum Op<'a, V: TarEntriesVisitor> { - UnpackToPath(&'a Path), - Visit(V), -} - -/// * `f` - If Some, then this function will pass -/// the entries of the `dat` to it and let it decides -/// what to do with the tar. -fn untar( - mut tar: Archive, - op: Op<'_, V>, -) -> Result<(), BinstallError> { - match op { - Op::Visit(mut visitor) => { - debug!("Untaring with callback"); - - visitor.visit(tar.entries()?)?; - } - Op::UnpackToPath(path) => { - debug!("Untaring entire tar"); - tar.unpack(path)?; - } - } - - debug!("Untaring completed"); - - Ok(()) -} - pub(super) fn create_tar_decoder( dat: impl BufRead + 'static, fmt: TarBasedFmt, @@ -75,30 +45,6 @@ pub(super) fn create_tar_decoder( Ok(Archive::new(r)) } -/// Extract files from the specified source onto the specified path. -/// -/// * `fmt` - must not be `PkgFmt::Bin` or `PkgFmt::Zip`. -/// * `filter` - If Some, then it will pass the path of the file to it -/// and only extract ones which filter returns `true`. -/// Note that this is a best-effort and it only works when `fmt` -/// is not `PkgFmt::Bin` or `PkgFmt::Zip`. -pub(super) fn extract_compressed_from_readable( - dat: R, - fmt: TarBasedFmt, - op: Op<'_, V>, -) -> Result<(), BinstallError> { - let msg = if let Op::UnpackToPath(path) = op { - format!("destination: {path:#?}") - } else { - "process in-memory".to_string() - }; - - debug!("Extracting from {fmt} archive: {msg}"); - - let tar = create_tar_decoder(dat, fmt)?; - untar(tar, op) -} - pub(super) fn unzip(dat: File, dst: &Path) -> Result<(), BinstallError> { debug!("Decompressing from zip archive to `{dst:?}`"); From 2091345ce029ecae1843c8ba0de7a35bb0960dae Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 13 Jun 2022 01:14:22 +1000 Subject: [PATCH 0299/2020] Refactor: Mv `TarEntriesVisitor` to mod `async_extracter` Signed-off-by: Jiahao XU --- src/helpers.rs | 1 - src/helpers/async_extracter.rs | 12 ++++++++++++ src/helpers/extracter.rs | 14 +------------- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 721716bb..060aad8c 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -22,7 +22,6 @@ mod ui_thread; pub use ui_thread::UIThread; mod extracter; -pub use extracter::TarEntriesVisitor; mod readable_rx; diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 2ae31a23..2b1298bf 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -232,6 +232,18 @@ where .await } +/// Visitor must iterate over all entries. +/// Entires can be in arbitary order. +pub trait TarEntriesVisitor { + fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), BinstallError>; +} + +impl TarEntriesVisitor for &mut V { + fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), BinstallError> { + (*self).visit(entries) + } +} + pub async fn extract_tar_based_stream_and_visit( stream: impl Stream> + Unpin, fmt: TarBasedFmt, diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index ee5129b3..b1737528 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -4,25 +4,13 @@ use std::path::Path; use flate2::bufread::GzDecoder; use log::debug; -use tar::{Archive, Entries}; +use tar::Archive; use xz2::bufread::XzDecoder; use zip::read::ZipArchive; use zstd::stream::Decoder as ZstdDecoder; use crate::{BinstallError, TarBasedFmt}; -/// Visitor must iterate over all entries. -/// Entires can be in arbitary order. -pub trait TarEntriesVisitor { - fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), BinstallError>; -} - -impl TarEntriesVisitor for &mut V { - fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), BinstallError> { - (*self).visit(entries) - } -} - pub(super) fn create_tar_decoder( dat: impl BufRead + 'static, fmt: TarBasedFmt, From 6578b672256ede070b9c65a30340244f6cc5e2c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jun 2022 01:29:47 +0000 Subject: [PATCH 0300/2020] Bump strum from 0.24.0 to 0.24.1 Bumps [strum](https://github.com/Peternator7/strum) from 0.24.0 to 0.24.1. - [Release notes](https://github.com/Peternator7/strum/releases) - [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md) - [Commits](https://github.com/Peternator7/strum/commits) --- updated-dependencies: - dependency-name: strum dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 21877876..4a16ba1e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1314,9 +1314,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strum" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96acfc1b70604b8b2f1ffa4c57e59176c7dbb05d556c71ecd2f5498a1dee7f8" +checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" [[package]] name = "strum_macros" diff --git a/Cargo.toml b/Cargo.toml index 7cdbcc48..5135e607 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,7 @@ scopeguard = "1.1.0" semver = "1.0.7" serde = { version = "1.0.136", features = [ "derive" ] } simplelog = "0.12.0" -strum = "0.24.0" +strum = "0.24.1" strum_macros = "0.24.0" tar = "0.4.38" tempfile = "3.3.0" From 9eb1128f9fab6e90bf5e592a3b6966682a0b8cce Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 13 Jun 2022 19:32:55 +1000 Subject: [PATCH 0301/2020] Rm unused `DummyVisitor` in `extract_tar_based_stream` Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 8 -------- 1 file changed, 8 deletions(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 2b1298bf..334812aa 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -208,14 +208,6 @@ pub async fn extract_tar_based_stream( where BinstallError: From, { - struct DummyVisitor; - - impl TarEntriesVisitor for DummyVisitor { - fn visit(&mut self, _entries: Entries<'_, R>) -> Result<(), BinstallError> { - unimplemented!() - } - } - let path = output.to_owned(); extract_impl( From 282805c3ac7677dd7506b30b346bcbe1bbb2eff5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 15 Jun 2022 17:23:00 +1000 Subject: [PATCH 0302/2020] Add reference to the src of `path_ext` Signed-off-by: Jiahao XU --- src/helpers/path_ext.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/helpers/path_ext.rs b/src/helpers/path_ext.rs index c4958539..1e5d2cc7 100644 --- a/src/helpers/path_ext.rs +++ b/src/helpers/path_ext.rs @@ -1,3 +1,6 @@ +//! Shamelessly taken from: +//! https://github.com/rust-lang/cargo/blob/fede83ccf973457de319ba6fa0e36ead454d2e20/src/cargo/util/paths.rs#L61 + use std::path::{Component, Path, PathBuf}; pub trait PathExt { From 30b9a7852092f7201de5f764ecf5af9c78fff8a0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 15 Jun 2022 17:45:50 +1000 Subject: [PATCH 0303/2020] Optimize `normalize_path`: Avoid copy if possible Signed-off-by: Jiahao XU --- src/drivers/visitor.rs | 3 ++- src/helpers/path_ext.rs | 26 ++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/drivers/visitor.rs b/src/drivers/visitor.rs index 850d7c39..3f354771 100644 --- a/src/drivers/visitor.rs +++ b/src/drivers/visitor.rs @@ -49,7 +49,8 @@ impl TarEntriesVisitor for ManifestVisitor { fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), BinstallError> { for res in entries { let mut entry = res?; - let path = entry.path()?.normalize_path(); + let path = entry.path()?; + let path = path.normalize_path(); let path = if let Ok(path) = path.strip_prefix(&self.manifest_dir_path) { path diff --git a/src/helpers/path_ext.rs b/src/helpers/path_ext.rs index 1e5d2cc7..bf223280 100644 --- a/src/helpers/path_ext.rs +++ b/src/helpers/path_ext.rs @@ -1,16 +1,34 @@ -//! Shamelessly taken from: +//! Shamelessly adapted from: //! https://github.com/rust-lang/cargo/blob/fede83ccf973457de319ba6fa0e36ead454d2e20/src/cargo/util/paths.rs#L61 +use std::borrow::Cow; use std::path::{Component, Path, PathBuf}; pub trait PathExt { /// Similiar to `os.path.normpath`: It does not perform /// any fs operation. - fn normalize_path(&self) -> PathBuf; + fn normalize_path(&self) -> Cow<'_, Path>; +} + +fn is_normalized(path: &Path) -> bool { + for component in path.components() { + match component { + Component::CurDir | Component::ParentDir => { + return false; + } + _ => continue, + } + } + + true } impl PathExt for Path { - fn normalize_path(&self) -> PathBuf { + fn normalize_path(&self) -> Cow<'_, Path> { + if is_normalized(self) { + return Cow::Borrowed(self); + } + let mut components = self.components().peekable(); let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek().cloned() { components.next(); @@ -34,6 +52,6 @@ impl PathExt for Path { } } } - ret + Cow::Owned(ret) } } From 39ab334da5e7b82c15ae160c38907a02964f15f3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 15 Jun 2022 17:52:49 +1000 Subject: [PATCH 0304/2020] Add a simple optimization to `normalize_path` Signed-off-by: Jiahao XU --- src/helpers/path_ext.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/helpers/path_ext.rs b/src/helpers/path_ext.rs index bf223280..78f26687 100644 --- a/src/helpers/path_ext.rs +++ b/src/helpers/path_ext.rs @@ -30,9 +30,10 @@ impl PathExt for Path { } let mut components = self.components().peekable(); - let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek().cloned() { + let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { + let buf = PathBuf::from(c.as_os_str()); components.next(); - PathBuf::from(c.as_os_str()) + buf } else { PathBuf::new() }; From 0480e9946015ad4ceddbb5ecf492a2a15c2fc099 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 18 Jun 2022 17:29:50 +1000 Subject: [PATCH 0305/2020] Impl newtype `StreamReadable` It wraps a `Stream>` and implements `Read` and `BufRead` on it so that it can be used on sync context. Signed-off-by: Jiahao XU --- src/helpers.rs | 1 + src/helpers/stream_readable.rs | 81 ++++++++++++++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 src/helpers/stream_readable.rs diff --git a/src/helpers.rs b/src/helpers.rs index 060aad8c..4a30d986 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -22,6 +22,7 @@ mod ui_thread; pub use ui_thread::UIThread; mod extracter; +mod stream_readable; mod readable_rx; diff --git a/src/helpers/stream_readable.rs b/src/helpers/stream_readable.rs new file mode 100644 index 00000000..17113591 --- /dev/null +++ b/src/helpers/stream_readable.rs @@ -0,0 +1,81 @@ +use std::cmp::min; +use std::io::{self, BufRead, Read}; + +use bytes::{Buf, Bytes}; +use futures_util::stream::{Stream, StreamExt}; +use tokio::runtime::Handle; + +use super::BinstallError; + +/// This wraps an AsyncIterator as a `Read`able. +/// It must be used in non-async context only, +/// meaning you have to use it with +/// `tokio::task::{block_in_place, spawn_blocking}` or +/// `std::thread::spawn`. +#[derive(Debug)] +pub(super) struct StreamReadable { + stream: S, + handle: Handle, + bytes: Bytes, +} + +impl StreamReadable { + pub(super) async fn new(stream: S) -> Self { + Self { + stream, + handle: Handle::current(), + bytes: Bytes::new(), + } + } +} + +impl Read for StreamReadable +where + S: Stream> + Unpin, + BinstallError: From, +{ + fn read(&mut self, buf: &mut [u8]) -> io::Result { + if buf.is_empty() { + return Ok(0); + } + + if self.fill_buf()?.is_empty() { + return Ok(0); + } + + let bytes = &mut self.bytes; + + // copy_to_slice requires the bytes to have enough remaining bytes + // to fill buf. + let n = min(buf.len(), bytes.remaining()); + + bytes.copy_to_slice(&mut buf[..n]); + + Ok(n) + } +} +impl BufRead for StreamReadable +where + S: Stream> + Unpin, + BinstallError: From, +{ + fn fill_buf(&mut self) -> io::Result<&[u8]> { + let bytes = &mut self.bytes; + + if !bytes.has_remaining() { + match self.handle.block_on(async { self.stream.next().await }) { + Some(Ok(new_bytes)) => *bytes = new_bytes, + Some(Err(e)) => { + let e: BinstallError = e.into(); + return Err(io::Error::new(io::ErrorKind::Other, e)); + } + None => (), + } + } + Ok(&*bytes) + } + + fn consume(&mut self, amt: usize) { + self.bytes.advance(amt); + } +} From 1161a60968b85ab19987c88f6671f843995a05b0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 18 Jun 2022 17:56:17 +1000 Subject: [PATCH 0306/2020] Simplify `create_tar_decoder`: Ret `io::Result` instead of `Result` Signed-off-by: Jiahao XU --- src/helpers/extracter.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index b1737528..13f018b6 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -1,5 +1,5 @@ use std::fs::File; -use std::io::{BufRead, Read}; +use std::io::{self, BufRead, Read}; use std::path::Path; use flate2::bufread::GzDecoder; @@ -14,7 +14,7 @@ use crate::{BinstallError, TarBasedFmt}; pub(super) fn create_tar_decoder( dat: impl BufRead + 'static, fmt: TarBasedFmt, -) -> Result>, BinstallError> { +) -> io::Result>> { use TarBasedFmt::*; let r: Box = match fmt { From aba1ba7b6d9f46121df4301b1601dd827f8c654d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 18 Jun 2022 18:02:42 +1000 Subject: [PATCH 0307/2020] Manually impl `From for BinstallError` so that if the `io::Error` wraps a `BinstallError`, we would just unwrap it and return the inner `BinstallError`. Otherwise, just wrap the `io::Error` in a `BinstallError`. Signed-off-by: Jiahao XU --- src/errors.rs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/errors.rs b/src/errors.rs index 070c91ce..7ffc20e3 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -75,7 +75,7 @@ pub enum BinstallError { /// - Exit: 74 #[error(transparent)] #[diagnostic(severity(error), code(binstall::io))] - Io(#[from] std::io::Error), + Io(std::io::Error), /// An error interacting with the crates.io API. /// @@ -231,3 +231,23 @@ impl Termination for BinstallError { code } } + +impl From for BinstallError { + fn from(err: std::io::Error) -> Self { + let is_inner_binstall_err = err + .get_ref() + .map(|e| e.is::()) + .unwrap_or_default(); + + if is_inner_binstall_err { + let inner = err + .into_inner() + .expect("err.get_ref() returns Some, so err.into_inner() should als return Some"); + *inner + .downcast() + .expect("The inner err is tested to be BinstallError") + } else { + BinstallError::Io(err) + } + } +} From c15d99c6f0a2a399c14f648212b5f9e371d5334a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 18 Jun 2022 18:07:46 +1000 Subject: [PATCH 0308/2020] Run downloader & extracter on the same thread This have the following advantage: - Remove the mpsc channel, which: - Remove synchronization required for mpsc. - Remove the internal buffering of the mpsc channel, which avoid potentially OOM situation. - Improve data locality since it no longer needs to be sent over thread. - It uses `block_in_place` to avoid creating an additional blocking thread. The disadvantages would be that the downloader can no longer be run in parallel to the extracter. If the bottleneck is the decompressor, then the downloader should also pause and wait for the decompressor to consume the data. But if the bottleneck is the network, then that might be an issue. Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 108 ++++++++++++++------------------- 1 file changed, 46 insertions(+), 62 deletions(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 334812aa..d37d1db0 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -16,7 +16,7 @@ use std::fmt::Debug; use std::fs; -use std::io::{self, Read, Seek, Write}; +use std::io::{self, copy, Read, Seek, Write}; use std::path::Path; use bytes::Bytes; @@ -27,10 +27,10 @@ use tar::Entries; use tempfile::tempfile; use tokio::{ sync::mpsc, - task::{spawn_blocking, JoinHandle}, + task::{block_in_place, spawn_blocking, JoinHandle}, }; -use super::{extracter::*, readable_rx::*}; +use super::{extracter::*, readable_rx::*, stream_readable::StreamReadable}; use crate::{BinstallError, TarBasedFmt}; pub(crate) enum Content { @@ -107,20 +107,15 @@ impl AsyncExtracterInner { } } -async fn extract_impl> + Unpin, E>( - mut stream: S, - f: Box) -> Result + Send>, -) -> Result +async fn extract_impl(stream: S, f: F) -> Result where + T: Debug + Send + 'static, + S: Stream> + Unpin, + F: FnOnce(StreamReadable) -> Result, BinstallError: From, { - let mut extracter = guard(AsyncExtracterInner::new(f), AsyncExtracterInner::abort); - - while let Some(res) = stream.next().await { - extracter.feed(res?).await?; - } - - ScopeGuard::into_inner(extracter).done().await + let readable = StreamReadable::new(stream).await; + block_in_place(move || f(readable)) } fn read_into_file( @@ -148,28 +143,25 @@ where { let path = output.to_owned(); - extract_impl( - stream, - Box::new(move |mut rx| { - fs::create_dir_all(path.parent().unwrap())?; + extract_impl(stream, move |mut reader| { + fs::create_dir_all(path.parent().unwrap())?; - let mut file = fs::File::create(&path)?; + let mut file = fs::File::create(&path)?; - // remove it unless the operation isn't aborted and no write - // fails. - let remove_guard = guard(&path, |path| { - fs::remove_file(path).ok(); - }); + // remove it unless the operation isn't aborted and no write + // fails. + let remove_guard = guard(&path, |path| { + fs::remove_file(path).ok(); + }); - read_into_file(&mut file, &mut rx)?; + copy(&mut reader, &mut file)?; - // Operation isn't aborted and all writes succeed, - // disarm the remove_guard. - ScopeGuard::into_inner(remove_guard); + // Operation isn't aborted and all writes succeed, + // disarm the remove_guard. + ScopeGuard::into_inner(remove_guard); - Ok(()) - }), - ) + Ok(()) + }) .await } @@ -182,26 +174,23 @@ where { let path = output.to_owned(); - extract_impl( - stream, - Box::new(move |mut rx| { - fs::create_dir_all(path.parent().unwrap())?; + extract_impl(stream, move |mut reader| { + fs::create_dir_all(path.parent().unwrap())?; - let mut file = tempfile()?; + let mut file = tempfile()?; - read_into_file(&mut file, &mut rx)?; + copy(&mut reader, &mut file)?; - // rewind it so that we can pass it to unzip - file.rewind()?; + // rewind it so that we can pass it to unzip + file.rewind()?; - unzip(file, &path) - }), - ) + unzip(file, &path) + }) .await } pub async fn extract_tar_based_stream( - stream: impl Stream> + Unpin, + stream: impl Stream> + Unpin + 'static, output: &Path, fmt: TarBasedFmt, ) -> Result<(), BinstallError> @@ -210,17 +199,15 @@ where { let path = output.to_owned(); - extract_impl( - stream, - Box::new(move |rx| { - fs::create_dir_all(path.parent().unwrap())?; + extract_impl(stream, move |reader| { + fs::create_dir_all(path.parent().unwrap())?; - debug!("Extracting from {fmt} archive to {path:#?}"); - create_tar_decoder(ReadableRx::new(rx), fmt)?.unpack(path)?; + debug!("Extracting from {fmt} archive to {path:#?}"); - Ok(()) - }), - ) + create_tar_decoder(reader, fmt)?.unpack(path)?; + + Ok(()) + }) .await } @@ -237,22 +224,19 @@ impl TarEntriesVisitor for &mut V { } pub async fn extract_tar_based_stream_and_visit( - stream: impl Stream> + Unpin, + stream: impl Stream> + Unpin + 'static, fmt: TarBasedFmt, mut visitor: V, ) -> Result where BinstallError: From, { - extract_impl( - stream, - Box::new(move |rx| { - debug!("Extracting from {fmt} archive to process it in memory"); + extract_impl(stream, move |reader| { + debug!("Extracting from {fmt} archive to process it in memory"); - let mut tar = create_tar_decoder(ReadableRx::new(rx), fmt)?; - visitor.visit(tar.entries()?)?; - Ok(visitor) - }), - ) + let mut tar = create_tar_decoder(reader, fmt)?; + visitor.visit(tar.entries()?)?; + Ok(visitor) + }) .await } From 621a64152971061e39eadb9832d9bfd43e5b0043 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 18 Jun 2022 18:10:22 +1000 Subject: [PATCH 0309/2020] Rm unused items in mod `helpers` Signed-off-by: Jiahao XU --- src/helpers.rs | 2 - src/helpers/async_extracter.rs | 101 ++------------------------------- src/helpers/readable_rx.rs | 64 --------------------- 3 files changed, 4 insertions(+), 163 deletions(-) delete mode 100644 src/helpers/readable_rx.rs diff --git a/src/helpers.rs b/src/helpers.rs index 4a30d986..b2d252e9 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -24,8 +24,6 @@ pub use ui_thread::UIThread; mod extracter; mod stream_readable; -mod readable_rx; - mod path_ext; pub use path_ext::*; diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index d37d1db0..feec5d06 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -16,97 +16,20 @@ use std::fmt::Debug; use std::fs; -use std::io::{self, copy, Read, Seek, Write}; +use std::io::{copy, Read, Seek}; use std::path::Path; use bytes::Bytes; -use futures_util::stream::{Stream, StreamExt}; +use futures_util::stream::Stream; use log::debug; use scopeguard::{guard, ScopeGuard}; use tar::Entries; use tempfile::tempfile; -use tokio::{ - sync::mpsc, - task::{block_in_place, spawn_blocking, JoinHandle}, -}; +use tokio::task::block_in_place; -use super::{extracter::*, readable_rx::*, stream_readable::StreamReadable}; +use super::{extracter::*, stream_readable::StreamReadable}; use crate::{BinstallError, TarBasedFmt}; -pub(crate) enum Content { - /// Data to write to file - Data(Bytes), - - /// Abort the writing and remove the file. - Abort, -} - -/// AsyncExtracter will pass the `Bytes` you give to another thread via -/// a `mpsc` and decompress and unpack it if needed. -/// -/// After all write is done, you must call `AsyncExtracter::done`, -/// otherwise the extracted content will be removed on drop. -#[derive(Debug)] -struct AsyncExtracterInner { - /// Use AutoAbortJoinHandle so that the task - /// will be cancelled on failure. - handle: JoinHandle>, - tx: mpsc::Sender, -} - -impl AsyncExtracterInner { - fn new) -> Result + Send + 'static>( - f: F, - ) -> Self { - let (tx, rx) = mpsc::channel::(100); - - let handle = spawn_blocking(move || f(rx)); - - Self { handle, tx } - } - - /// Upon error, this extracter shall not be reused. - /// Otherwise, `Self::done` would panic. - async fn feed(&mut self, bytes: Bytes) -> Result<(), BinstallError> { - if self.tx.send(Content::Data(bytes)).await.is_err() { - // task failed - Err(Self::wait(&mut self.handle).await.expect_err( - "Implementation bug: write task finished successfully before all writes are done", - )) - } else { - Ok(()) - } - } - - async fn done(mut self) -> Result { - // Drop tx as soon as possible so that the task would wrap up what it - // was doing and flush out all the pending data. - drop(self.tx); - - Self::wait(&mut self.handle).await - } - - async fn wait(handle: &mut JoinHandle>) -> Result { - match handle.await { - Ok(res) => res, - Err(join_err) => Err(io::Error::new(io::ErrorKind::Other, join_err).into()), - } - } - - fn abort(self) { - let tx = self.tx; - // If Self::write fail, then the task is already tear down, - // tx closed and no need to abort. - if !tx.is_closed() { - // Use send here because blocking_send would panic if used - // in async threads. - tokio::spawn(async move { - tx.send(Content::Abort).await.ok(); - }); - } - } -} - async fn extract_impl(stream: S, f: F) -> Result where T: Debug + Send + 'static, @@ -118,22 +41,6 @@ where block_in_place(move || f(readable)) } -fn read_into_file( - file: &mut fs::File, - rx: &mut mpsc::Receiver, -) -> Result<(), BinstallError> { - while let Some(content) = rx.blocking_recv() { - match content { - Content::Data(bytes) => file.write_all(&*bytes)?, - Content::Abort => return Err(io::Error::new(io::ErrorKind::Other, "Aborted").into()), - } - } - - file.flush()?; - - Ok(()) -} - pub async fn extract_bin( stream: impl Stream> + Unpin, output: &Path, diff --git a/src/helpers/readable_rx.rs b/src/helpers/readable_rx.rs deleted file mode 100644 index e2597aae..00000000 --- a/src/helpers/readable_rx.rs +++ /dev/null @@ -1,64 +0,0 @@ -use std::cmp::min; -use std::io::{self, BufRead, Read}; - -use bytes::{Buf, Bytes}; -use tokio::sync::mpsc::Receiver; - -use super::async_extracter::Content; - -#[derive(Debug)] -pub(crate) struct ReadableRx { - rx: Receiver, - bytes: Bytes, -} - -impl ReadableRx { - pub(crate) fn new(rx: Receiver) -> Self { - Self { - rx, - bytes: Bytes::new(), - } - } -} - -impl Read for ReadableRx { - fn read(&mut self, buf: &mut [u8]) -> io::Result { - if buf.is_empty() { - return Ok(0); - } - - if self.fill_buf()?.is_empty() { - return Ok(0); - } - - let bytes = &mut self.bytes; - - // copy_to_slice requires the bytes to have enough remaining bytes - // to fill buf. - let n = min(buf.len(), bytes.remaining()); - - bytes.copy_to_slice(&mut buf[..n]); - - Ok(n) - } -} - -impl BufRead for ReadableRx { - fn fill_buf(&mut self) -> io::Result<&[u8]> { - let bytes = &mut self.bytes; - if !bytes.has_remaining() { - match self.rx.blocking_recv() { - Some(Content::Data(new_bytes)) => *bytes = new_bytes, - Some(Content::Abort) => { - return Err(io::Error::new(io::ErrorKind::Other, "Aborted")) - } - None => (), - } - } - Ok(&*bytes) - } - - fn consume(&mut self, amt: usize) { - self.bytes.advance(amt); - } -} From b1523581751adf676bc01814f92507423c401d02 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 18 Jun 2022 18:12:13 +1000 Subject: [PATCH 0310/2020] Rm unused trait bound in `extract_impl` Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index feec5d06..c2ff7800 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -32,7 +32,6 @@ use crate::{BinstallError, TarBasedFmt}; async fn extract_impl(stream: S, f: F) -> Result where - T: Debug + Send + 'static, S: Stream> + Unpin, F: FnOnce(StreamReadable) -> Result, BinstallError: From, From 9de8a4841f92352c23bf6dda247753808a65e6de Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 18 Jun 2022 18:12:48 +1000 Subject: [PATCH 0311/2020] Update doc of mod `async_extracter` Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index c2ff7800..634df7e0 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -1,14 +1,12 @@ //! # Advantages //! //! Using this mod has the following advantages over downloading -//! and extracting in on the async thread: +//! to file then extracting: //! //! - The code is pipelined instead of storing the downloaded file in memory //! and extract it, except for `PkgFmt::Zip`, since `ZipArchiver::new` //! requires `std::io::Seek`, so it fallbacks to writing the a file then //! unzip it. -//! - The async part (downloading) and the extracting part runs in parallel -//! using `tokio::spawn_nonblocking`. //! - Compressing/writing which takes a lot of CPU time will not block //! the runtime anymore. //! - For all `tar` based formats, it can extract only specified files and From a5879e3d6537edaa4439fdfe951003ec5d321201 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 18 Jun 2022 18:24:01 +1000 Subject: [PATCH 0312/2020] Rm unnecessary `to_owned` call in `extract_*` It was called before because `spawn_blocking` requires that, but we now switches to `block_in_place` which no longer needs this. Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 634df7e0..e1448776 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -40,13 +40,11 @@ where pub async fn extract_bin( stream: impl Stream> + Unpin, - output: &Path, + path: &Path, ) -> Result<(), BinstallError> where BinstallError: From, { - let path = output.to_owned(); - extract_impl(stream, move |mut reader| { fs::create_dir_all(path.parent().unwrap())?; @@ -71,13 +69,11 @@ where pub async fn extract_zip( stream: impl Stream> + Unpin, - output: &Path, + path: &Path, ) -> Result<(), BinstallError> where BinstallError: From, { - let path = output.to_owned(); - extract_impl(stream, move |mut reader| { fs::create_dir_all(path.parent().unwrap())?; @@ -88,21 +84,19 @@ where // rewind it so that we can pass it to unzip file.rewind()?; - unzip(file, &path) + unzip(file, path) }) .await } pub async fn extract_tar_based_stream( stream: impl Stream> + Unpin + 'static, - output: &Path, + path: &Path, fmt: TarBasedFmt, ) -> Result<(), BinstallError> where BinstallError: From, { - let path = output.to_owned(); - extract_impl(stream, move |reader| { fs::create_dir_all(path.parent().unwrap())?; From b14b71135ec116bc50817cab469677da7ec9c8b5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 18 Jun 2022 18:25:50 +1000 Subject: [PATCH 0313/2020] Revert refactor: Put `find_version` back to `drivers` Signed-off-by: Jiahao XU --- src/drivers.rs | 49 +++++++++++++++++++++++++++++++++++++++--- src/drivers/version.rs | 48 ----------------------------------------- 2 files changed, 46 insertions(+), 51 deletions(-) delete mode 100644 src/drivers/version.rs diff --git a/src/drivers.rs b/src/drivers.rs index 8b8f362f..cab8a6d6 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -1,17 +1,60 @@ +use std::collections::BTreeSet; use std::path::{Path, PathBuf}; +use log::debug; +use semver::{Version, VersionReq}; + use crate::BinstallError; mod cratesio; pub use cratesio::*; -mod version; -use version::find_version; - mod vfs; mod visitor; +fn find_version<'a, V: Iterator>( + requirement: &str, + version_iter: V, +) -> Result { + // Parse version requirement + let version_req = VersionReq::parse(requirement).map_err(|err| BinstallError::VersionReq { + req: requirement.into(), + err, + })?; + + // Filter for matching versions + let filtered: BTreeSet<_> = version_iter + .filter_map(|v| { + // Remove leading `v` for git tags + let ver_str = match v.strip_prefix('s') { + Some(v) => v, + None => v, + }; + + // Parse out version + let ver = Version::parse(ver_str).ok()?; + debug!("Version: {:?}", ver); + + // Filter by version match + if version_req.matches(&ver) { + Some(ver) + } else { + None + } + }) + .collect(); + + debug!("Filtered: {:?}", filtered); + + // Return highest version + filtered + .iter() + .max() + .cloned() + .ok_or(BinstallError::VersionMismatch { req: version_req }) +} + /// Fetch a crate by name and version from github /// TODO: implement this pub async fn fetch_crate_gh_releases( diff --git a/src/drivers/version.rs b/src/drivers/version.rs deleted file mode 100644 index 7d5f4a74..00000000 --- a/src/drivers/version.rs +++ /dev/null @@ -1,48 +0,0 @@ -use std::collections::BTreeSet; - -use log::debug; -use semver::{Version, VersionReq}; - -use crate::BinstallError; - -pub(super) fn find_version<'a, V: Iterator>( - requirement: &str, - version_iter: V, -) -> Result { - // Parse version requirement - let version_req = VersionReq::parse(requirement).map_err(|err| BinstallError::VersionReq { - req: requirement.into(), - err, - })?; - - // Filter for matching versions - let filtered: BTreeSet<_> = version_iter - .filter_map(|v| { - // Remove leading `v` for git tags - let ver_str = match v.strip_prefix('s') { - Some(v) => v, - None => v, - }; - - // Parse out version - let ver = Version::parse(ver_str).ok()?; - debug!("Version: {:?}", ver); - - // Filter by version match - if version_req.matches(&ver) { - Some(ver) - } else { - None - } - }) - .collect(); - - debug!("Filtered: {:?}", filtered); - - // Return highest version - filtered - .iter() - .max() - .cloned() - .ok_or(BinstallError::VersionMismatch { req: version_req }) -} From 53bf76104b7163ab7be7f139b5b047db36deb0b4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 18 Jun 2022 18:27:08 +1000 Subject: [PATCH 0314/2020] Revert refactor: Put `fetch_crate_cratesio` back to `drivers` Signed-off-by: Jiahao XU --- src/drivers.rs | 71 ++++++++++++++++++++++++++++++++++++++--- src/drivers/cratesio.rs | 71 ----------------------------------------- 2 files changed, 67 insertions(+), 75 deletions(-) delete mode 100644 src/drivers/cratesio.rs diff --git a/src/drivers.rs b/src/drivers.rs index cab8a6d6..b5dff09a 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -1,17 +1,19 @@ use std::collections::BTreeSet; use std::path::{Path, PathBuf}; +use std::time::Duration; +use cargo_toml::Manifest; +use crates_io_api::AsyncClient; use log::debug; use semver::{Version, VersionReq}; +use url::Url; -use crate::BinstallError; - -mod cratesio; -pub use cratesio::*; +use crate::{helpers::*, BinstallError, Meta, TarBasedFmt}; mod vfs; mod visitor; +use visitor::ManifestVisitor; fn find_version<'a, V: Iterator>( requirement: &str, @@ -55,6 +57,67 @@ fn find_version<'a, V: Iterator>( .ok_or(BinstallError::VersionMismatch { req: version_req }) } +/// Fetch a crate Cargo.toml by name and version from crates.io +pub async fn fetch_crate_cratesio( + name: &str, + version_req: &str, +) -> Result, BinstallError> { + // Fetch / update index + debug!("Looking up crate information"); + + // Build crates.io api client + let api_client = AsyncClient::new( + "cargo-binstall (https://github.com/ryankurte/cargo-binstall)", + Duration::from_millis(100), + ) + .expect("bug: invalid user agent"); + + // Fetch online crate information + let base_info = + api_client + .get_crate(name.as_ref()) + .await + .map_err(|err| BinstallError::CratesIoApi { + crate_name: name.into(), + err, + })?; + + // Locate matching version + let version_iter = + base_info + .versions + .iter() + .filter_map(|v| if !v.yanked { Some(&v.num) } else { None }); + let version_name = find_version(version_req, version_iter)?; + + // Fetch information for the filtered version + let version = base_info + .versions + .iter() + .find(|v| v.num == version_name.to_string()) + .ok_or_else(|| BinstallError::VersionUnavailable { + crate_name: name.into(), + v: version_name.clone(), + })?; + + debug!("Found information for crate version: '{}'", version.num); + + // Download crate to temporary dir (crates.io or git?) + let crate_url = format!("https://crates.io/{}", version.dl_path); + + debug!("Fetching crate from: {crate_url} and extracting Cargo.toml from it"); + + let manifest_dir_path: PathBuf = format!("{name}-{version_name}").into(); + + download_tar_based_and_visit( + Url::parse(&crate_url)?, + TarBasedFmt::Tgz, + ManifestVisitor::new(manifest_dir_path), + ) + .await? + .load_manifest() +} + /// Fetch a crate by name and version from github /// TODO: implement this pub async fn fetch_crate_gh_releases( diff --git a/src/drivers/cratesio.rs b/src/drivers/cratesio.rs deleted file mode 100644 index 0bc6027b..00000000 --- a/src/drivers/cratesio.rs +++ /dev/null @@ -1,71 +0,0 @@ -use std::path::PathBuf; -use std::time::Duration; - -use cargo_toml::Manifest; -use crates_io_api::AsyncClient; -use log::debug; -use url::Url; - -use super::{find_version, visitor::ManifestVisitor}; -use crate::{helpers::*, BinstallError, Meta, TarBasedFmt}; - -/// Fetch a crate Cargo.toml by name and version from crates.io -pub async fn fetch_crate_cratesio( - name: &str, - version_req: &str, -) -> Result, BinstallError> { - // Fetch / update index - debug!("Looking up crate information"); - - // Build crates.io api client - let api_client = AsyncClient::new( - "cargo-binstall (https://github.com/ryankurte/cargo-binstall)", - Duration::from_millis(100), - ) - .expect("bug: invalid user agent"); - - // Fetch online crate information - let base_info = - api_client - .get_crate(name.as_ref()) - .await - .map_err(|err| BinstallError::CratesIoApi { - crate_name: name.into(), - err, - })?; - - // Locate matching version - let version_iter = - base_info - .versions - .iter() - .filter_map(|v| if !v.yanked { Some(&v.num) } else { None }); - let version_name = find_version(version_req, version_iter)?; - - // Fetch information for the filtered version - let version = base_info - .versions - .iter() - .find(|v| v.num == version_name.to_string()) - .ok_or_else(|| BinstallError::VersionUnavailable { - crate_name: name.into(), - v: version_name.clone(), - })?; - - debug!("Found information for crate version: '{}'", version.num); - - // Download crate to temporary dir (crates.io or git?) - let crate_url = format!("https://crates.io/{}", version.dl_path); - - debug!("Fetching crate from: {crate_url} and extracting Cargo.toml from it"); - - let manifest_dir_path: PathBuf = format!("{name}-{version_name}").into(); - - download_tar_based_and_visit( - Url::parse(&crate_url)?, - TarBasedFmt::Tgz, - ManifestVisitor::new(manifest_dir_path), - ) - .await? - .load_manifest() -} From db22d7d0419f86d44942dcf1b89526429d868566 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 18 Jun 2022 18:35:01 +1000 Subject: [PATCH 0315/2020] Fix codestyle in `async_extracter` Use consistent codestyle for specifing trait bounds. Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index e1448776..2a2a42dd 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -38,11 +38,9 @@ where block_in_place(move || f(readable)) } -pub async fn extract_bin( - stream: impl Stream> + Unpin, - path: &Path, -) -> Result<(), BinstallError> +pub async fn extract_bin(stream: S, path: &Path) -> Result<(), BinstallError> where + S: Stream> + Unpin + 'static, BinstallError: From, { extract_impl(stream, move |mut reader| { @@ -67,11 +65,9 @@ where .await } -pub async fn extract_zip( - stream: impl Stream> + Unpin, - path: &Path, -) -> Result<(), BinstallError> +pub async fn extract_zip(stream: S, path: &Path) -> Result<(), BinstallError> where + S: Stream> + Unpin + 'static, BinstallError: From, { extract_impl(stream, move |mut reader| { @@ -89,12 +85,13 @@ where .await } -pub async fn extract_tar_based_stream( - stream: impl Stream> + Unpin + 'static, +pub async fn extract_tar_based_stream( + stream: S, path: &Path, fmt: TarBasedFmt, ) -> Result<(), BinstallError> where + S: Stream> + Unpin + 'static, BinstallError: From, { extract_impl(stream, move |reader| { @@ -121,12 +118,14 @@ impl TarEntriesVisitor for &mut V { } } -pub async fn extract_tar_based_stream_and_visit( - stream: impl Stream> + Unpin + 'static, +pub async fn extract_tar_based_stream_and_visit( + stream: S, fmt: TarBasedFmt, mut visitor: V, ) -> Result where + S: Stream> + Unpin + 'static, + V: TarEntriesVisitor + Debug + Send + 'static, BinstallError: From, { extract_impl(stream, move |reader| { From 784a24577b349af01ac82717d253a620d1cddb8b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 18 Jun 2022 18:37:50 +1000 Subject: [PATCH 0316/2020] Refactor: Rm `extract_impl` Signed-off-by: Jiahao XU --- src/helpers/async_extracter.rs | 26 ++++++++------------------ 1 file changed, 8 insertions(+), 18 deletions(-) diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 2a2a42dd..5a7ef9c1 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -28,22 +28,13 @@ use tokio::task::block_in_place; use super::{extracter::*, stream_readable::StreamReadable}; use crate::{BinstallError, TarBasedFmt}; -async fn extract_impl(stream: S, f: F) -> Result -where - S: Stream> + Unpin, - F: FnOnce(StreamReadable) -> Result, - BinstallError: From, -{ - let readable = StreamReadable::new(stream).await; - block_in_place(move || f(readable)) -} - pub async fn extract_bin(stream: S, path: &Path) -> Result<(), BinstallError> where S: Stream> + Unpin + 'static, BinstallError: From, { - extract_impl(stream, move |mut reader| { + let mut reader = StreamReadable::new(stream).await; + block_in_place(move || { fs::create_dir_all(path.parent().unwrap())?; let mut file = fs::File::create(&path)?; @@ -62,7 +53,6 @@ where Ok(()) }) - .await } pub async fn extract_zip(stream: S, path: &Path) -> Result<(), BinstallError> @@ -70,7 +60,8 @@ where S: Stream> + Unpin + 'static, BinstallError: From, { - extract_impl(stream, move |mut reader| { + let mut reader = StreamReadable::new(stream).await; + block_in_place(move || { fs::create_dir_all(path.parent().unwrap())?; let mut file = tempfile()?; @@ -82,7 +73,6 @@ where unzip(file, path) }) - .await } pub async fn extract_tar_based_stream( @@ -94,7 +84,8 @@ where S: Stream> + Unpin + 'static, BinstallError: From, { - extract_impl(stream, move |reader| { + let reader = StreamReadable::new(stream).await; + block_in_place(move || { fs::create_dir_all(path.parent().unwrap())?; debug!("Extracting from {fmt} archive to {path:#?}"); @@ -103,7 +94,6 @@ where Ok(()) }) - .await } /// Visitor must iterate over all entries. @@ -128,12 +118,12 @@ where V: TarEntriesVisitor + Debug + Send + 'static, BinstallError: From, { - extract_impl(stream, move |reader| { + let reader = StreamReadable::new(stream).await; + block_in_place(move || { debug!("Extracting from {fmt} archive to process it in memory"); let mut tar = create_tar_decoder(reader, fmt)?; visitor.visit(tar.entries()?)?; Ok(visitor) }) - .await } From 1c9ec8d25cf232cda6a1a1a50ba7c05513091750 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Jun 2022 01:25:13 +0000 Subject: [PATCH 0317/2020] Bump reqwest from 0.11.10 to 0.11.11 Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.10 to 0.11.11. - [Release notes](https://github.com/seanmonstar/reqwest/releases) - [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md) - [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.10...v0.11.11) --- updated-dependencies: - dependency-name: reqwest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 27 +++++++-------------------- Cargo.toml | 2 +- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 21877876..23837ea2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -600,7 +600,7 @@ dependencies = [ "indexmap", "slab", "tokio", - "tokio-util 0.7.3", + "tokio-util", "tracing", ] @@ -1087,9 +1087,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.10" +version = "0.11.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a1f7aa4f35e5e8b4160449f51afc758f0ce6454315a9fa7d0d113e958c41eb" +checksum = "b75aa69a3f06bbcc66ede33af2af253c6f7a86b1ca0033f60c580a27074fbf92" dependencies = [ "base64", "bytes", @@ -1115,7 +1115,8 @@ dependencies = [ "serde_urlencoded", "tokio", "tokio-rustls", - "tokio-util 0.6.10", + "tokio-util", + "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -1159,9 +1160,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "0.3.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee86d63972a7c661d1536fefe8c3c8407321c3df668891286de28abcd087360" +checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9" dependencies = [ "base64", ] @@ -1526,20 +1527,6 @@ dependencies = [ "webpki", ] -[[package]] -name = "tokio-util" -version = "0.6.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "log", - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-util" version = "0.7.3" diff --git a/Cargo.toml b/Cargo.toml index 7cdbcc48..09de64c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ flate2 = { version = "1.0.24", features = ["zlib-ng"], default-features = false futures-util = { version = "0.3.21", default-features = false } log = "0.4.14" miette = { version = "4.7.1", features = ["fancy-no-backtrace"] } -reqwest = { version = "0.11.10", features = [ "rustls-tls", "stream" ], default-features = false } +reqwest = { version = "0.11.11", features = [ "rustls-tls", "stream" ], default-features = false } scopeguard = "1.1.0" semver = "1.0.7" serde = { version = "1.0.136", features = [ "derive" ] } From 5d79af545bfe72f455ee05e23f1dccbac1559e45 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 21 Jun 2022 13:38:24 +1000 Subject: [PATCH 0318/2020] Add doc for `Vfs` Signed-off-by: Jiahao XU --- src/drivers/vfs.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/drivers/vfs.rs b/src/drivers/vfs.rs index 18c422de..66e4875e 100644 --- a/src/drivers/vfs.rs +++ b/src/drivers/vfs.rs @@ -6,6 +6,9 @@ use cargo_toml::AbstractFilesystem; use crate::helpers::PathExt; +/// This type stores the filesystem structure for the crate tarball +/// extracted in memory and can be passed to +/// `cargo_toml::Manifest::complete_from_abstract_filesystem`. #[derive(Debug)] pub(super) struct Vfs(HashMap, HashSet>>); From c916814e7ed8f2fa3e56ef0d2f0454a93f724186 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 21 Jun 2022 13:40:36 +1000 Subject: [PATCH 0319/2020] Refactor: Extract `find_version` into mod Signed-off-by: Jiahao XU --- src/drivers.rs | 45 ++------------------------------------- src/drivers/version.rs | 48 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 50 insertions(+), 43 deletions(-) create mode 100644 src/drivers/version.rs diff --git a/src/drivers.rs b/src/drivers.rs index b5dff09a..9a56a7d3 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -1,11 +1,9 @@ -use std::collections::BTreeSet; use std::path::{Path, PathBuf}; use std::time::Duration; use cargo_toml::Manifest; use crates_io_api::AsyncClient; use log::debug; -use semver::{Version, VersionReq}; use url::Url; use crate::{helpers::*, BinstallError, Meta, TarBasedFmt}; @@ -15,47 +13,8 @@ mod vfs; mod visitor; use visitor::ManifestVisitor; -fn find_version<'a, V: Iterator>( - requirement: &str, - version_iter: V, -) -> Result { - // Parse version requirement - let version_req = VersionReq::parse(requirement).map_err(|err| BinstallError::VersionReq { - req: requirement.into(), - err, - })?; - - // Filter for matching versions - let filtered: BTreeSet<_> = version_iter - .filter_map(|v| { - // Remove leading `v` for git tags - let ver_str = match v.strip_prefix('s') { - Some(v) => v, - None => v, - }; - - // Parse out version - let ver = Version::parse(ver_str).ok()?; - debug!("Version: {:?}", ver); - - // Filter by version match - if version_req.matches(&ver) { - Some(ver) - } else { - None - } - }) - .collect(); - - debug!("Filtered: {:?}", filtered); - - // Return highest version - filtered - .iter() - .max() - .cloned() - .ok_or(BinstallError::VersionMismatch { req: version_req }) -} +mod version; +use version::find_version; /// Fetch a crate Cargo.toml by name and version from crates.io pub async fn fetch_crate_cratesio( diff --git a/src/drivers/version.rs b/src/drivers/version.rs new file mode 100644 index 00000000..7d5f4a74 --- /dev/null +++ b/src/drivers/version.rs @@ -0,0 +1,48 @@ +use std::collections::BTreeSet; + +use log::debug; +use semver::{Version, VersionReq}; + +use crate::BinstallError; + +pub(super) fn find_version<'a, V: Iterator>( + requirement: &str, + version_iter: V, +) -> Result { + // Parse version requirement + let version_req = VersionReq::parse(requirement).map_err(|err| BinstallError::VersionReq { + req: requirement.into(), + err, + })?; + + // Filter for matching versions + let filtered: BTreeSet<_> = version_iter + .filter_map(|v| { + // Remove leading `v` for git tags + let ver_str = match v.strip_prefix('s') { + Some(v) => v, + None => v, + }; + + // Parse out version + let ver = Version::parse(ver_str).ok()?; + debug!("Version: {:?}", ver); + + // Filter by version match + if version_req.matches(&ver) { + Some(ver) + } else { + None + } + }) + .collect(); + + debug!("Filtered: {:?}", filtered); + + // Return highest version + filtered + .iter() + .max() + .cloned() + .ok_or(BinstallError::VersionMismatch { req: version_req }) +} From b6f15f2e5e4045c2d8f82f2a6cb7a30701d0a0c1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 21 Jun 2022 13:42:39 +1000 Subject: [PATCH 0320/2020] Refactor: Extract `fetch_crate_cratesio` out into mod Signed-off-by: Jiahao XU --- src/drivers.rs | 70 ++------------------------------------- src/drivers/crates_io.rs | 71 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+), 67 deletions(-) create mode 100644 src/drivers/crates_io.rs diff --git a/src/drivers.rs b/src/drivers.rs index 9a56a7d3..18752554 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -1,12 +1,6 @@ use std::path::{Path, PathBuf}; -use std::time::Duration; -use cargo_toml::Manifest; -use crates_io_api::AsyncClient; -use log::debug; -use url::Url; - -use crate::{helpers::*, BinstallError, Meta, TarBasedFmt}; +use crate::BinstallError; mod vfs; @@ -16,66 +10,8 @@ use visitor::ManifestVisitor; mod version; use version::find_version; -/// Fetch a crate Cargo.toml by name and version from crates.io -pub async fn fetch_crate_cratesio( - name: &str, - version_req: &str, -) -> Result, BinstallError> { - // Fetch / update index - debug!("Looking up crate information"); - - // Build crates.io api client - let api_client = AsyncClient::new( - "cargo-binstall (https://github.com/ryankurte/cargo-binstall)", - Duration::from_millis(100), - ) - .expect("bug: invalid user agent"); - - // Fetch online crate information - let base_info = - api_client - .get_crate(name.as_ref()) - .await - .map_err(|err| BinstallError::CratesIoApi { - crate_name: name.into(), - err, - })?; - - // Locate matching version - let version_iter = - base_info - .versions - .iter() - .filter_map(|v| if !v.yanked { Some(&v.num) } else { None }); - let version_name = find_version(version_req, version_iter)?; - - // Fetch information for the filtered version - let version = base_info - .versions - .iter() - .find(|v| v.num == version_name.to_string()) - .ok_or_else(|| BinstallError::VersionUnavailable { - crate_name: name.into(), - v: version_name.clone(), - })?; - - debug!("Found information for crate version: '{}'", version.num); - - // Download crate to temporary dir (crates.io or git?) - let crate_url = format!("https://crates.io/{}", version.dl_path); - - debug!("Fetching crate from: {crate_url} and extracting Cargo.toml from it"); - - let manifest_dir_path: PathBuf = format!("{name}-{version_name}").into(); - - download_tar_based_and_visit( - Url::parse(&crate_url)?, - TarBasedFmt::Tgz, - ManifestVisitor::new(manifest_dir_path), - ) - .await? - .load_manifest() -} +mod crates_io; +pub use crates_io::fetch_crate_cratesio; /// Fetch a crate by name and version from github /// TODO: implement this diff --git a/src/drivers/crates_io.rs b/src/drivers/crates_io.rs new file mode 100644 index 00000000..94cdccce --- /dev/null +++ b/src/drivers/crates_io.rs @@ -0,0 +1,71 @@ +use std::path::PathBuf; +use std::time::Duration; + +use cargo_toml::Manifest; +use crates_io_api::AsyncClient; +use log::debug; +use url::Url; + +use super::{find_version, ManifestVisitor}; +use crate::{helpers::*, BinstallError, Meta, TarBasedFmt}; + +/// Fetch a crate Cargo.toml by name and version from crates.io +pub async fn fetch_crate_cratesio( + name: &str, + version_req: &str, +) -> Result, BinstallError> { + // Fetch / update index + debug!("Looking up crate information"); + + // Build crates.io api client + let api_client = AsyncClient::new( + "cargo-binstall (https://github.com/ryankurte/cargo-binstall)", + Duration::from_millis(100), + ) + .expect("bug: invalid user agent"); + + // Fetch online crate information + let base_info = + api_client + .get_crate(name.as_ref()) + .await + .map_err(|err| BinstallError::CratesIoApi { + crate_name: name.into(), + err, + })?; + + // Locate matching version + let version_iter = + base_info + .versions + .iter() + .filter_map(|v| if !v.yanked { Some(&v.num) } else { None }); + let version_name = find_version(version_req, version_iter)?; + + // Fetch information for the filtered version + let version = base_info + .versions + .iter() + .find(|v| v.num == version_name.to_string()) + .ok_or_else(|| BinstallError::VersionUnavailable { + crate_name: name.into(), + v: version_name.clone(), + })?; + + debug!("Found information for crate version: '{}'", version.num); + + // Download crate to temporary dir (crates.io or git?) + let crate_url = format!("https://crates.io/{}", version.dl_path); + + debug!("Fetching crate from: {crate_url} and extracting Cargo.toml from it"); + + let manifest_dir_path: PathBuf = format!("{name}-{version_name}").into(); + + download_tar_based_and_visit( + Url::parse(&crate_url)?, + TarBasedFmt::Tgz, + ManifestVisitor::new(manifest_dir_path), + ) + .await? + .load_manifest() +} From 23bad39ba8901c80fe230256dd973d3bfbfc56ab Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 21 Jun 2022 13:44:12 +1000 Subject: [PATCH 0321/2020] Refactor:Mv mod `visitor` `vfs` under `crates_io` Signed-off-by: Jiahao XU --- src/drivers.rs | 5 ----- src/drivers/crates_io.rs | 7 ++++++- src/drivers/{ => crates_io}/vfs.rs | 0 src/drivers/{ => crates_io}/visitor.rs | 0 4 files changed, 6 insertions(+), 6 deletions(-) rename src/drivers/{ => crates_io}/vfs.rs (100%) rename src/drivers/{ => crates_io}/visitor.rs (100%) diff --git a/src/drivers.rs b/src/drivers.rs index 18752554..933a6d2f 100644 --- a/src/drivers.rs +++ b/src/drivers.rs @@ -2,11 +2,6 @@ use std::path::{Path, PathBuf}; use crate::BinstallError; -mod vfs; - -mod visitor; -use visitor::ManifestVisitor; - mod version; use version::find_version; diff --git a/src/drivers/crates_io.rs b/src/drivers/crates_io.rs index 94cdccce..68f04e82 100644 --- a/src/drivers/crates_io.rs +++ b/src/drivers/crates_io.rs @@ -6,9 +6,14 @@ use crates_io_api::AsyncClient; use log::debug; use url::Url; -use super::{find_version, ManifestVisitor}; +use super::find_version; use crate::{helpers::*, BinstallError, Meta, TarBasedFmt}; +mod vfs; + +mod visitor; +use visitor::ManifestVisitor; + /// Fetch a crate Cargo.toml by name and version from crates.io pub async fn fetch_crate_cratesio( name: &str, diff --git a/src/drivers/vfs.rs b/src/drivers/crates_io/vfs.rs similarity index 100% rename from src/drivers/vfs.rs rename to src/drivers/crates_io/vfs.rs diff --git a/src/drivers/visitor.rs b/src/drivers/crates_io/visitor.rs similarity index 100% rename from src/drivers/visitor.rs rename to src/drivers/crates_io/visitor.rs From ad41756daab0120e9ad38ead7b6ac10bd0688a00 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 21 Jun 2022 13:45:56 +1000 Subject: [PATCH 0322/2020] Rename `fmt.rs` to `format.rs` Signed-off-by: Jiahao XU --- src/{fmt.rs => format.rs} | 0 src/lib.rs | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename src/{fmt.rs => format.rs} (100%) diff --git a/src/fmt.rs b/src/format.rs similarity index 100% rename from src/fmt.rs rename to src/format.rs diff --git a/src/lib.rs b/src/lib.rs index ca2b019a..5725995d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,8 +17,8 @@ pub mod fetchers; mod target; pub use target::*; -mod fmt; -pub use fmt::*; +mod format; +pub use format::*; /// Default package path template (may be overridden in package Cargo.toml) pub const DEFAULT_PKG_URL: &str = From 74a6e137bed7f566ee5afef82be584a187f31680 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 21 Jun 2022 13:47:00 +1000 Subject: [PATCH 0323/2020] Refactor: Mv `debug!` into `create_request` Signed-off-by: Jiahao XU --- src/helpers.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index b2d252e9..55aee08c 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -52,6 +52,8 @@ pub async fn remote_exists(url: Url, method: Method) -> Result Result>, BinstallError> { + debug!("Downloading from: '{url}'"); + reqwest::get(url.clone()) .await .and_then(|r| r.error_for_status()) @@ -69,8 +71,6 @@ pub async fn download_and_extract>( fmt: PkgFmt, path: P, ) -> Result<(), BinstallError> { - debug!("Downloading from: '{url}'"); - let stream = create_request(url).await?; let path = path.as_ref(); @@ -97,8 +97,6 @@ pub async fn download_tar_based_and_visit Result { - debug!("Downloading from: '{url}'"); - let stream = create_request(url).await?; debug!("Downloading and extracting then in-memory processing"); From c5a2a8936133ddfff72a4c263e0431f86ef342ef Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 21 Jun 2022 13:52:27 +1000 Subject: [PATCH 0324/2020] Rm the duplicate `debug!` in `main.rs:214` Signed-off-by: Jiahao XU --- src/main.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index f9136157..0d8748cc 100644 --- a/src/main.rs +++ b/src/main.rs @@ -211,10 +211,7 @@ async fn entry() -> Result<()> { // TODO: work out which of these to do based on `opts.name` // TODO: support git-based fetches (whole repo name rather than just crate name) let manifest = match opts.manifest_path.clone() { - Some(manifest_path) => { - debug!("Reading manifest: {}", manifest_path.display()); - load_manifest_path(manifest_path.join("Cargo.toml"))? - } + Some(manifest_path) => load_manifest_path(manifest_path.join("Cargo.toml"))?, None => fetch_crate_cratesio(&opts.name, &opts.version).await?, }; From 2f38925ee43b945a93f76066e9473b9fd9c816e4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 21 Jun 2022 14:10:27 +1000 Subject: [PATCH 0325/2020] Refactor `From for BinstallError` Avoid one `expect`. Signed-off-by: Jiahao XU --- src/errors.rs | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index 7ffc20e3..4c7e5cad 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -234,18 +234,17 @@ impl Termination for BinstallError { impl From for BinstallError { fn from(err: std::io::Error) -> Self { - let is_inner_binstall_err = err - .get_ref() - .map(|e| e.is::()) - .unwrap_or_default(); + if err.get_ref().is_some() { + let kind = err.kind(); - if is_inner_binstall_err { let inner = err .into_inner() - .expect("err.get_ref() returns Some, so err.into_inner() should als return Some"); - *inner + .expect("err.get_ref() returns Some, so err.into_inner() should also return Some"); + + inner .downcast() - .expect("The inner err is tested to be BinstallError") + .map(|b| *b) + .unwrap_or_else(|err| BinstallError::Io(std::io::Error::new(kind, err))) } else { BinstallError::Io(err) } From 127d7045d59c2f12bca6599235fa03ad3d074f00 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 22 Jun 2022 15:12:01 +1000 Subject: [PATCH 0326/2020] Rm unused dep `cargo_metadata` Signed-off-by: Jiahao XU --- Cargo.lock | 35 ----------------------------------- Cargo.toml | 1 - 2 files changed, 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 21877876..2271f684 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -128,22 +128,12 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "camino" -version = "1.0.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "869119e97797867fd90f5e22af7d0bd274bd4635ebb9eb68c04f3f513ae6c412" -dependencies = [ - "serde", -] - [[package]] name = "cargo-binstall" version = "0.9.1" dependencies = [ "async-trait", "bytes", - "cargo_metadata", "cargo_toml", "clap 3.1.18", "crates_io_api", @@ -172,28 +162,6 @@ dependencies = [ "zstd", ] -[[package]] -name = "cargo-platform" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4acbb09d9ee8e23699b9634375c72795d095bf268439da88562cf9b501f181fa" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", -] - [[package]] name = "cargo_toml" version = "0.11.5" @@ -1199,9 +1167,6 @@ name = "semver" version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8cb243bdfdb5936c8dc3c45762a19d12ab4550cdc753bc247637d4ec35a040fd" -dependencies = [ - "serde", -] [[package]] name = "serde" diff --git a/Cargo.toml b/Cargo.toml index 7cdbcc48..d5aca865 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,6 @@ pkg-fmt = "zip" [dependencies] async-trait = "0.1.56" bytes = "1.1.0" -cargo_metadata = "0.14.2" cargo_toml = "0.11.4" clap = { version = "3.1.18", features = ["derive"] } crates_io_api = { version = "0.8.0", default-features = false, features = ["rustls"] } From 1b9f8c0ffcc3600bf4686daafa2c567c73b959bf Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Sun, 12 Jun 2022 23:37:19 +0900 Subject: [PATCH 0327/2020] Add `PkgFmt::Tbz2` --- Cargo.lock | 1 + Cargo.toml | 1 + src/format.rs | 6 ++++++ src/helpers/extracter.rs | 2 ++ 4 files changed, 10 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 21877876..5854229f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -143,6 +143,7 @@ version = "0.9.1" dependencies = [ "async-trait", "bytes", + "bzip2", "cargo_metadata", "cargo_toml", "clap 3.1.18", diff --git a/Cargo.toml b/Cargo.toml index 7cdbcc48..ccbee202 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,6 +21,7 @@ pkg-fmt = "zip" [dependencies] async-trait = "0.1.56" bytes = "1.1.0" +bzip2 = "0.4.3" cargo_metadata = "0.14.2" cargo_toml = "0.11.4" clap = { version = "3.1.18", features = ["derive"] } diff --git a/src/format.rs b/src/format.rs index 840ffc6a..1cb1d2ed 100644 --- a/src/format.rs +++ b/src/format.rs @@ -10,6 +10,8 @@ use strum_macros::{Display, EnumString, EnumVariantNames}; pub enum PkgFmt { /// Download format is TAR (uncompressed) Tar, + /// Download format is TAR + Bzip2 + Tbz2, /// Download format is TGZ (TAR + GZip) Tgz, /// Download format is TAR + XZ @@ -34,6 +36,7 @@ impl PkgFmt { pub fn decompose(self) -> PkgFmtDecomposed { match self { PkgFmt::Tar => PkgFmtDecomposed::Tar(TarBasedFmt::Tar), + PkgFmt::Tbz2 => PkgFmtDecomposed::Tar(TarBasedFmt::Tbz2), PkgFmt::Tgz => PkgFmtDecomposed::Tar(TarBasedFmt::Tgz), PkgFmt::Txz => PkgFmtDecomposed::Tar(TarBasedFmt::Txz), PkgFmt::Tzstd => PkgFmtDecomposed::Tar(TarBasedFmt::Tzstd), @@ -54,6 +57,8 @@ pub enum PkgFmtDecomposed { pub enum TarBasedFmt { /// Download format is TAR (uncompressed) Tar, + /// Download format is TAR + Bzip2 + Tbz2, /// Download format is TGZ (TAR + GZip) Tgz, /// Download format is TAR + XZ @@ -66,6 +71,7 @@ impl From for PkgFmt { fn from(fmt: TarBasedFmt) -> Self { match fmt { TarBasedFmt::Tar => PkgFmt::Tar, + TarBasedFmt::Tbz2 => PkgFmt::Tbz2, TarBasedFmt::Tgz => PkgFmt::Tgz, TarBasedFmt::Txz => PkgFmt::Txz, TarBasedFmt::Tzstd => PkgFmt::Tzstd, diff --git a/src/helpers/extracter.rs b/src/helpers/extracter.rs index 13f018b6..211f628e 100644 --- a/src/helpers/extracter.rs +++ b/src/helpers/extracter.rs @@ -2,6 +2,7 @@ use std::fs::File; use std::io::{self, BufRead, Read}; use std::path::Path; +use bzip2::bufread::BzDecoder; use flate2::bufread::GzDecoder; use log::debug; use tar::Archive; @@ -19,6 +20,7 @@ pub(super) fn create_tar_decoder( let r: Box = match fmt { Tar => Box::new(dat), + Tbz2 => Box::new(BzDecoder::new(dat)), Tgz => Box::new(GzDecoder::new(dat)), Txz => Box::new(XzDecoder::new(dat)), Tzstd => { From 27c0a379d4738c2e9ee9a9443282ff6c882f022d Mon Sep 17 00:00:00 2001 From: Ryo Yamashita Date: Mon, 13 Jun 2022 00:30:29 +0900 Subject: [PATCH 0328/2020] Enable `bzip2/static` Co-authored-by: Jiahao XU --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index ccbee202..ef33274b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ pkg-fmt = "zip" [dependencies] async-trait = "0.1.56" bytes = "1.1.0" -bzip2 = "0.4.3" +bzip2 = { version = "0.4.3", features = ["static"] } cargo_metadata = "0.14.2" cargo_toml = "0.11.4" clap = { version = "3.1.18", features = ["derive"] } From 43511690f4e0bd780354fc9339843f23e580d369 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Thu, 23 Jun 2022 06:37:43 +1200 Subject: [PATCH 0329/2020] Add tbz2 to readme --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 943130fe..bf580b0e 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ $ binstall \ - Package formats - [x] Tgz - [x] Txz + - [x] Tbz2 - [x] Tar.zst - [x] Tar - [x] Zip From d8ad0058007d7a09f192a340560d12ec20fd9a6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jun 2022 18:42:49 +0000 Subject: [PATCH 0330/2020] Bump clap from 3.1.18 to 3.2.6 Bumps [clap](https://github.com/clap-rs/clap) from 3.1.18 to 3.2.6. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v3.1.18...v3.2.6) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 16 ++++++++-------- Cargo.toml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2d871819..e23e8155 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -136,7 +136,7 @@ dependencies = [ "bytes", "bzip2", "cargo_toml", - "clap 3.1.18", + "clap 3.2.6", "crates_io_api", "dirs", "env_logger", @@ -237,16 +237,16 @@ dependencies = [ [[package]] name = "clap" -version = "3.1.18" +version = "3.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2dbdf4bdacb33466e854ce889eee8dfd5729abf7ccd7664d0a2d60cd384440b" +checksum = "9f1fe12880bae935d142c8702d500c63a4e8634b6c3c57ad72bf978fc7b6249a" dependencies = [ "atty", "bitflags", "clap_derive", "clap_lex", "indexmap", - "lazy_static", + "once_cell", "strsim 0.10.0", "termcolor", "textwrap 0.15.0", @@ -254,9 +254,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.1.18" +version = "3.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25320346e922cffe59c0bbc5410c8d8784509efb321488971081313cb1e1a33c" +checksum = "ed6db9e867166a43a53f7199b5e4d1f522a1e5bd626654be263c999ce59df39a" dependencies = [ "heck", "proc-macro-error", @@ -267,9 +267,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.2.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a37c35f1112dad5e6e0b1adaff798507497a18fceeb30cceb3bae7d1427b9213" +checksum = "87eba3c8c7f42ef17f6c659fc7416d0f4758cd3e58861ee63c5fa4a4dde649e4" dependencies = [ "os_str_bytes", ] diff --git a/Cargo.toml b/Cargo.toml index 6b2a7b01..a6f28a33 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ async-trait = "0.1.56" bytes = "1.1.0" bzip2 = { version = "0.4.3", features = ["static"] } cargo_toml = "0.11.4" -clap = { version = "3.1.18", features = ["derive"] } +clap = { version = "3.2.6", features = ["derive"] } crates_io_api = { version = "0.8.0", default-features = false, features = ["rustls"] } dirs = "4.0.0" flate2 = { version = "1.0.24", features = ["zlib-ng"], default-features = false } From ba114fceaecbf0b51ceb7f41b6b4c7dd79ce3bd3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Jun 2022 18:46:13 +0000 Subject: [PATCH 0331/2020] Bump semver from 1.0.9 to 1.0.10 Bumps [semver](https://github.com/dtolnay/semver) from 1.0.9 to 1.0.10. - [Release notes](https://github.com/dtolnay/semver/releases) - [Commits](https://github.com/dtolnay/semver/compare/1.0.9...1.0.10) --- updated-dependencies: - dependency-name: semver dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2d871819..3d9a7781 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1166,9 +1166,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cb243bdfdb5936c8dc3c45762a19d12ab4550cdc753bc247637d4ec35a040fd" +checksum = "a41d061efea015927ac527063765e73601444cdc344ba855bc7bd44578b25e1c" [[package]] name = "serde" diff --git a/Cargo.toml b/Cargo.toml index 6b2a7b01..ea8568a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ log = "0.4.14" miette = { version = "4.7.1", features = ["fancy-no-backtrace"] } reqwest = { version = "0.11.11", features = [ "rustls-tls", "stream" ], default-features = false } scopeguard = "1.1.0" -semver = "1.0.7" +semver = "1.0.10" serde = { version = "1.0.136", features = [ "derive" ] } simplelog = "0.12.0" strum = "0.24.1" From 8e92db3dc61e2270173831b86b8d003f7150bee3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 22 Jun 2022 16:01:05 +1000 Subject: [PATCH 0332/2020] Refactor: Extract `new_reqwest_client(_builder)` Signed-off-by: Jiahao XU --- src/fetchers/quickinstall.rs | 6 ++++-- src/helpers.rs | 16 +++++++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index 7d6ed14a..120dd6cb 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -7,7 +7,9 @@ use tokio::task::JoinHandle; use url::Url; use super::Data; -use crate::{download_and_extract, remote_exists, BinstallError, PkgFmt}; +use crate::{ + download_and_extract, new_reqwest_client_builder, remote_exists, BinstallError, PkgFmt, +}; const BASE_URL: &str = "https://github.com/alsuren/cargo-quickinstall/releases/download"; const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; @@ -89,7 +91,7 @@ impl QuickInstall { let url = Url::parse(&stats_url)?; debug!("Sending installation report to quickinstall ({url})"); - reqwest::Client::builder() + new_reqwest_client_builder() .user_agent(USER_AGENT) .build()? .request(Method::HEAD, url.clone()) diff --git a/src/helpers.rs b/src/helpers.rs index 55aee08c..806cc7cd 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -5,7 +5,7 @@ use bytes::Bytes; use cargo_toml::Manifest; use futures_util::stream::Stream; use log::debug; -use reqwest::{Method, Response}; +use reqwest::{Client, ClientBuilder, Method, Response}; use serde::Serialize; use tinytemplate::TinyTemplate; use url::Url; @@ -40,8 +40,16 @@ pub fn load_manifest_path>( Ok(manifest) } +pub fn new_reqwest_client_builder() -> ClientBuilder { + ClientBuilder::new() +} + +pub fn new_reqwest_client() -> reqwest::Result { + new_reqwest_client_builder().build() +} + pub async fn remote_exists(url: Url, method: Method) -> Result { - let req = reqwest::Client::new() + let req = new_reqwest_client()? .request(method.clone(), url.clone()) .send() .await @@ -54,7 +62,9 @@ async fn create_request( ) -> Result>, BinstallError> { debug!("Downloading from: '{url}'"); - reqwest::get(url.clone()) + new_reqwest_client()? + .get(url.clone()) + .send() .await .and_then(|r| r.error_for_status()) .map_err(|err| BinstallError::Http { From eb7d460a9af6c2226a43434f7c904f5111e4f3bc Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 22 Jun 2022 19:00:02 +1000 Subject: [PATCH 0333/2020] Add new enum `TLSVersion` which impl `ArgEnum` and can be converted to `reqwest::tls::Version` Signed-off-by: Jiahao XU --- src/helpers.rs | 3 +++ src/helpers/tls_version.rs | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 src/helpers/tls_version.rs diff --git a/src/helpers.rs b/src/helpers.rs index 806cc7cd..9e37c73e 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -27,6 +27,9 @@ mod stream_readable; mod path_ext; pub use path_ext::*; +mod tls_version; +pub use tls_version::TLSVersion; + /// Load binstall metadata from the crate `Cargo.toml` at the provided path pub fn load_manifest_path>( manifest_path: P, diff --git a/src/helpers/tls_version.rs b/src/helpers/tls_version.rs new file mode 100644 index 00000000..1f0ad5dc --- /dev/null +++ b/src/helpers/tls_version.rs @@ -0,0 +1,17 @@ +use clap::ArgEnum; +use reqwest::tls::Version; + +#[derive(Debug, Copy, Clone, ArgEnum)] +pub enum TLSVersion { + Tls1_2, + Tls1_3, +} + +impl From for Version { + fn from(ver: TLSVersion) -> Self { + match ver { + TLSVersion::Tls1_2 => Version::TLS_1_2, + TLSVersion::Tls1_3 => Version::TLS_1_3, + } + } +} From 64f468acd61f2691474cefc77ce6e6344c76110f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 22 Jun 2022 19:01:40 +1000 Subject: [PATCH 0334/2020] Add new opt `https_only_mode` & `min_tls_version` Signed-off-by: Jiahao XU --- src/main.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main.rs b/src/main.rs index 0d8748cc..4250a653 100644 --- a/src/main.rs +++ b/src/main.rs @@ -84,6 +84,14 @@ struct Options { #[clap(long)] no_cleanup: bool, + /// Enable https only mode + #[clap(long)] + https_only_mode: bool, + + /// Decide which TLS version to use. + #[clap(long, arg_enum)] + min_tls_version: Option, + /// Override manifest source. /// /// This skips searching crates.io for a manifest and uses the specified path directly, useful From 0423f54b53fd12781b50e654e1d287d221963968 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 22 Jun 2022 19:03:32 +1000 Subject: [PATCH 0335/2020] Add new dep once_cell v1.12.0 Signed-off-by: Jiahao XU --- Cargo.lock | 1 + Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 3ff44ae8..9b3b74b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -145,6 +145,7 @@ dependencies = [ "guess_host_triple", "log", "miette", + "once_cell", "reqwest", "scopeguard", "semver", diff --git a/Cargo.toml b/Cargo.toml index 379e649b..42968b54 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,6 +30,7 @@ flate2 = { version = "1.0.24", features = ["zlib-ng"], default-features = false futures-util = { version = "0.3.21", default-features = false } log = "0.4.14" miette = { version = "4.7.1", features = ["fancy-no-backtrace"] } +once_cell = "1.12.0" reqwest = { version = "0.11.11", features = [ "rustls-tls", "stream" ], default-features = false } scopeguard = "1.1.0" semver = "1.0.10" From a3ab3ec502406fb851049f27529c32e6da93ab80 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 22 Jun 2022 19:12:32 +1000 Subject: [PATCH 0336/2020] Add new static var `REQWESTGLOBALCONFIG` Signed-off-by: Jiahao XU --- src/helpers.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/helpers.rs b/src/helpers.rs index 9e37c73e..5ae9744f 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -5,6 +5,7 @@ use bytes::Bytes; use cargo_toml::Manifest; use futures_util::stream::Stream; use log::debug; +use once_cell::sync::OnceCell; use reqwest::{Client, ClientBuilder, Method, Response}; use serde::Serialize; use tinytemplate::TinyTemplate; @@ -30,6 +31,9 @@ pub use path_ext::*; mod tls_version; pub use tls_version::TLSVersion; +/// (enable https only mode, min TLS version_option) +pub static REQWESTGLOBALCONFIG: OnceCell<(bool, Option)> = OnceCell::new(); + /// Load binstall metadata from the crate `Cargo.toml` at the provided path pub fn load_manifest_path>( manifest_path: P, @@ -44,7 +48,19 @@ pub fn load_manifest_path>( } pub fn new_reqwest_client_builder() -> ClientBuilder { - ClientBuilder::new() + let mut builder = ClientBuilder::new(); + + if let Some((https_only, min_tls_ver_opt)) = REQWESTGLOBALCONFIG.get() { + if *https_only { + builder = builder.http2_prior_knowledge(); + } + + if let Some(min_tls_ver) = *min_tls_ver_opt { + builder = builder.min_tls_version(min_tls_ver.into()); + } + } + + builder } pub fn new_reqwest_client() -> reqwest::Result { From 087d544331367cb67acc7224a0a593557fc0ee19 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 22 Jun 2022 19:14:32 +1000 Subject: [PATCH 0337/2020] Initialize `REQWESTGLOBALCONFIG` in `main::entry` Signed-off-by: Jiahao XU --- src/main.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/main.rs b/src/main.rs index 4250a653..10b9f034 100644 --- a/src/main.rs +++ b/src/main.rs @@ -185,6 +185,11 @@ async fn entry() -> Result<()> { bin_dir: opts.bin_dir.take(), }; + // Initialize REQWESTGLOBALCONFIG + REQWESTGLOBALCONFIG + .set((opts.https_only_mode, opts.min_tls_version)) + .unwrap(); + // Setup logging let mut log_config = ConfigBuilder::new(); log_config.add_filter_ignore("hyper".to_string()); From 423fb0e373f07e70ccc5c9062478886393fb2427 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 22 Jun 2022 19:16:39 +1000 Subject: [PATCH 0338/2020] Test https-only-mode & min-tls-ver in `run_tests_unix.sh` Signed-off-by: Jiahao XU --- ci-scripts/run_tests_unix.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ci-scripts/run_tests_unix.sh b/ci-scripts/run_tests_unix.sh index dbc25abd..87bf9784 100755 --- a/ci-scripts/run_tests_unix.sh +++ b/ci-scripts/run_tests_unix.sh @@ -20,3 +20,8 @@ cargo binstall --help >/dev/null "./$1" binstall --log-level debug --manifest-path . --no-confirm cargo-binstall # Test that the installed binaries can be run cargo binstall --help >/dev/null + +# Install binaries using https-only-mode and specify min tls ver +"./$1" binstall --https-only-mode --min-tls-version tls1-3 cargo-binstall +# Test that the installed binaries can be run +cargo binstall --help >/dev/null From b03ec6fb933b0d3ffaf1743fe6f4cb0b5384508b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 22 Jun 2022 19:27:35 +1000 Subject: [PATCH 0339/2020] Fix `run_tests_unix.sh`: Add `--no-confirm` Signed-off-by: Jiahao XU --- ci-scripts/run_tests_unix.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ci-scripts/run_tests_unix.sh b/ci-scripts/run_tests_unix.sh index 87bf9784..135d4765 100755 --- a/ci-scripts/run_tests_unix.sh +++ b/ci-scripts/run_tests_unix.sh @@ -22,6 +22,11 @@ cargo binstall --help >/dev/null cargo binstall --help >/dev/null # Install binaries using https-only-mode and specify min tls ver -"./$1" binstall --https-only-mode --min-tls-version tls1-3 cargo-binstall +"./$1" binstall \ + --log-level debug \ + --https-only-mode \ + --min-tls-version tls1-3 \ + --no-confirm \ + cargo-binstall # Test that the installed binaries can be run cargo binstall --help >/dev/null From 9b62ebdae185de8fcae196750bd1e2ebabf0ed32 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 22 Jun 2022 19:28:34 +1000 Subject: [PATCH 0340/2020] Fix https only mode: It should not be http2 only Signed-off-by: Jiahao XU --- src/helpers.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 5ae9744f..6be1df71 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -51,9 +51,7 @@ pub fn new_reqwest_client_builder() -> ClientBuilder { let mut builder = ClientBuilder::new(); if let Some((https_only, min_tls_ver_opt)) = REQWESTGLOBALCONFIG.get() { - if *https_only { - builder = builder.http2_prior_knowledge(); - } + builder = builder.https_only(*https_only); if let Some(min_tls_ver) = *min_tls_ver_opt { builder = builder.min_tls_version(min_tls_ver.into()); From 691bc18dd0481fabd8b21e62b095eae6ff4babe1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 23 Jun 2022 13:03:50 +1000 Subject: [PATCH 0341/2020] Set min TLS ver to 1.2 for https only mode Signed-off-by: Jiahao XU --- src/helpers.rs | 4 ++++ src/main.rs | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/helpers.rs b/src/helpers.rs index 6be1df71..03bf97c9 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -53,6 +53,10 @@ pub fn new_reqwest_client_builder() -> ClientBuilder { if let Some((https_only, min_tls_ver_opt)) = REQWESTGLOBALCONFIG.get() { builder = builder.https_only(*https_only); + if *https_only { + builder = builder.min_tls_version(reqwest::tls::Version::TLS_1_2); + } + if let Some(min_tls_ver) = *min_tls_ver_opt { builder = builder.min_tls_version(min_tls_ver.into()); } diff --git a/src/main.rs b/src/main.rs index 10b9f034..5b2294ac 100644 --- a/src/main.rs +++ b/src/main.rs @@ -84,7 +84,10 @@ struct Options { #[clap(long)] no_cleanup: bool, - /// Enable https only mode + /// Enable https only mode. + /// + /// When https only mode is enabled, it will also set + /// minimum TLS version to tls1_2. #[clap(long)] https_only_mode: bool, From c36f1fe08a47900b0bbcea313a1db031bf0562c7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 23 Jun 2022 13:43:13 +1000 Subject: [PATCH 0342/2020] Add dep guess_host_triple v0.1.3 for windows Signed-off-by: Jiahao XU --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 379e649b..31da1137 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,7 +61,7 @@ zip = { version = "0.6.2", default-features = false, features = [ "deflate", "bz # Enable feature zstdmt to enable multithreading in libzstd. zstd = { version = "0.10.0", features = [ "bindgen", "zstdmt" ], default-features = false } -[target.'cfg(target_os = "macos")'.dependencies] +[target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] guess_host_triple = "0.1.3" [dev-dependencies] From 8bc0f1156959c2acfd9b1f5ae1eee2fbec07fc5a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 23 Jun 2022 13:59:53 +1000 Subject: [PATCH 0343/2020] Detect `*-pc-windows-gnu` targets in `targets` And add fallback `*-pc-windows-msvc` to the returned targets. Signed-off-by: Jiahao XU --- src/target.rs | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/target.rs b/src/target.rs index ac6b6be9..1ce8d308 100644 --- a/src/target.rs +++ b/src/target.rs @@ -32,6 +32,11 @@ pub async fn detect_targets() -> Vec { v.push(macos::X86.into()); } + #[cfg(target_os = "windows")] + if v[0].contains("gnu") { + v.push(v[0].replace("gnu", "msvc")); + } + v } else { #[cfg(target_os = "linux")] @@ -42,7 +47,11 @@ pub async fn detect_targets() -> Vec { { macos::detect_targets_macos() } - #[cfg(not(any(target_os = "linux", target_os = "macos")))] + #[cfg(target_os = "windows")] + { + windows::detect_targets_windows() + } + #[cfg(not(any(target_os = "linux", target_os = "macos", target_os = "windows")))] { vec![TARGET.into()] } @@ -145,3 +154,19 @@ mod macos { } } } + +#[cfg(target_os = "windows")] +mod windows { + use super::TARGET; + use guess_host_triple::guess_host_triple; + + pub(super) fn detect_targets_windows() -> Vec { + let mut targets = vec![guess_host_triple().unwrap_or(TARGET).to_string()]; + + if targets[0].contains("gnu") { + targets.push(targets[0].replace("gnu", "msvc")); + } + + targets + } +} From be4b3ead9704f28c1e7e327f1f081716a73a4bf1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 23 Jun 2022 14:46:53 +1000 Subject: [PATCH 0344/2020] Add new fn `get_desired_targets` & newtype `DesiredTargets` so that if `opts.targets` is `None`, the future returned by `detect_targets` can be run in parallel by using `tokio::spawn` with other async code in `entry`, such as `fetch_crate_cratesio`. Signed-off-by: Jiahao XU --- src/target.rs | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/src/target.rs b/src/target.rs index ac6b6be9..4c3eb5e6 100644 --- a/src/target.rs +++ b/src/target.rs @@ -1,10 +1,68 @@ use std::io::{BufRead, Cursor}; use std::process::Output; +use std::sync::Arc; + use tokio::process::Command; +use tokio::sync::OnceCell; /// Compiled target triple, used as default for binary fetching pub const TARGET: &str = env!("TARGET"); +#[derive(Debug)] +enum DesiredTargetsInner { + AutoDetect(Arc>>), + Initialized(Vec), +} + +#[derive(Debug)] +pub struct DesiredTargets(DesiredTargetsInner); + +impl DesiredTargets { + fn initialized(targets: Vec) -> Self { + Self(DesiredTargetsInner::Initialized(targets)) + } + + fn auto_detect() -> Self { + let arc = Arc::new(OnceCell::new()); + + let once_cell = arc.clone(); + tokio::spawn(async move { + once_cell.get_or_init(detect_targets).await; + }); + + Self(DesiredTargetsInner::AutoDetect(arc)) + } + + pub async fn get(&self) -> &[String] { + use DesiredTargetsInner::*; + + match &self.0 { + Initialized(targets) => targets, + + // This will mostly just wait for the spawned task, + // on rare occausion though, it will poll the future + // returned by `detect_targets`. + AutoDetect(once_cell) => once_cell.get_or_init(detect_targets).await, + } + } +} + +/// If opts_targets is `Some`, then it will be used. +/// Otherwise, call `detect_targets` using `tokio::spawn` to detect targets. +/// +/// Since `detect_targets` internally spawns a process and wait for it, +/// it's pretty costy. +/// +/// Calling it through `tokio::spawn` would enable other tasks, such as +/// fetching the crate tarballs, to be executed concurrently. +pub fn get_desired_targets(opts_targets: &Option) -> DesiredTargets { + if let Some(targets) = opts_targets.as_ref() { + DesiredTargets::initialized(targets.split(',').map(|t| t.to_string()).collect()) + } else { + DesiredTargets::auto_detect() + } +} + /// Detect the targets supported at runtime, /// which might be different from `TARGET` which is detected /// at compile-time. From 68d111f946972378489531f0632cec6bfd985de0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 23 Jun 2022 14:47:59 +1000 Subject: [PATCH 0345/2020] Use `get_desired_targets` in `entry` instead of `detect_targets`, so that if `opts.targets` is `None`, the future returned by `detect_targets` can be run in parallel by using `tokio::spawn` with other async code in `entry`, such as `fetch_crate_cratesio`. Signed-off-by: Jiahao XU --- src/main.rs | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/main.rs b/src/main.rs index 0d8748cc..35804af7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -193,6 +193,8 @@ async fn entry() -> Result<()> { let mut uithread = UIThread::new(!opts.no_confirm); + let desired_targets = get_desired_targets(&opts.targets); + // Compute install directory let install_path = get_install_path(opts.install_path.as_deref()).ok_or_else(|| { error!("No viable install path found of specified, try `--install-path`"); @@ -242,22 +244,11 @@ async fn entry() -> Result<()> { manifest.bin, ); - let desired_targets = { - let from_opts = opts - .targets - .as_ref() - .map(|ts| ts.split(',').map(|t| t.to_string()).collect()); - - if let Some(ts) = from_opts { - ts - } else { - detect_targets().await - } - }; - let mut fetchers = MultiFetcher::default(); - for target in &desired_targets { + let desired_targets = desired_targets.get().await; + + for target in desired_targets { debug!("Building metadata for target: {target}"); let mut target_meta = meta.clone(); From 536f3b2c6f435fff0fee210ae1ae44e108154812 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 23 Jun 2022 19:39:36 +1000 Subject: [PATCH 0346/2020] Fix macos detection: Use `super::TARGET` as fallback When `guess_host_triple` failed to detect the target. Signed-off-by: Jiahao XU --- src/target.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/target.rs b/src/target.rs index 1ce8d308..7f65209c 100644 --- a/src/target.rs +++ b/src/target.rs @@ -141,17 +141,20 @@ mod linux { #[cfg(target_os = "macos")] mod macos { + use super::TARGET; use guess_host_triple::guess_host_triple; pub(super) const AARCH64: &str = "aarch64-apple-darwin"; pub(super) const X86: &str = "x86_64-apple-darwin"; pub(super) fn detect_targets_macos() -> Vec { - if guess_host_triple() == Some(AARCH64) { - vec![AARCH64.into(), X86.into()] - } else { - vec![X86.into()] + let mut targets = vec![guess_host_triple().unwrap_or(TARGET).to_string()]; + + if targets[0] == AARCH64 { + targets.push(X86.into()); } + + targets } } From a35db557eaf2e80014265483b3f6fe701a6e2632 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 23 Jun 2022 19:48:03 +1000 Subject: [PATCH 0347/2020] Run "Install binaries" step in `block_in_place` mode Since they execute a lot of blocking fs operations. Signed-off-by: Jiahao XU --- src/main.rs | 40 +++++++++++++++++++++++----------------- 1 file changed, 23 insertions(+), 17 deletions(-) diff --git a/src/main.rs b/src/main.rs index 39e832e0..169e74d7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,11 @@ use log::{debug, error, info, warn, LevelFilter}; use miette::{miette, IntoDiagnostic, Result, WrapErr}; use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; use tempfile::TempDir; -use tokio::{process::Command, runtime::Runtime, task::JoinError}; +use tokio::{ + process::Command, + runtime::Runtime, + task::{block_in_place, JoinError}, +}; use cargo_binstall::{ bins, @@ -441,26 +445,28 @@ async fn install_from_package( uithread.confirm().await?; info!("Installing binaries..."); - for file in &bin_files { - file.install_bin()?; - } - - // Generate symlinks - if !opts.no_symlinks { + block_in_place(|| { for file in &bin_files { - file.install_link()?; + file.install_bin()?; } - } - if opts.no_cleanup { - let _ = temp_dir.into_path(); - } else { - temp_dir.close().unwrap_or_else(|err| { - warn!("Failed to clean up some resources: {err}"); - }); - } + // Generate symlinks + if !opts.no_symlinks { + for file in &bin_files { + file.install_link()?; + } + } - Ok(()) + if opts.no_cleanup { + let _ = temp_dir.into_path(); + } else { + temp_dir.close().unwrap_or_else(|err| { + warn!("Failed to clean up some resources: {err}"); + }); + } + + Ok(()) + }) } async fn install_from_source( From 60caa9ee177574236b975767e767b7889e7da7d0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 23 Jun 2022 19:50:25 +1000 Subject: [PATCH 0348/2020] Run `load_manifest_path` in `block_in_place` mode Signed-off-by: Jiahao XU --- src/helpers.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 03bf97c9..55edc19a 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -9,6 +9,7 @@ use once_cell::sync::OnceCell; use reqwest::{Client, ClientBuilder, Method, Response}; use serde::Serialize; use tinytemplate::TinyTemplate; +use tokio::task::block_in_place; use url::Url; use crate::{BinstallError, Meta, PkgFmt, PkgFmtDecomposed, TarBasedFmt}; @@ -38,13 +39,15 @@ pub static REQWESTGLOBALCONFIG: OnceCell<(bool, Option)> = OnceCell: pub fn load_manifest_path>( manifest_path: P, ) -> Result, BinstallError> { - debug!("Reading manifest: {}", manifest_path.as_ref().display()); + block_in_place(|| { + debug!("Reading manifest: {}", manifest_path.as_ref().display()); - // Load and parse manifest (this checks file system for binary output names) - let manifest = Manifest::::from_path_with_metadata(manifest_path)?; + // Load and parse manifest (this checks file system for binary output names) + let manifest = Manifest::::from_path_with_metadata(manifest_path)?; - // Return metadata - Ok(manifest) + // Return metadata + Ok(manifest) + }) } pub fn new_reqwest_client_builder() -> ClientBuilder { From e18ac6e117e95524046bc46b709775cdc1280d38 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 23 Jun 2022 19:55:09 +1000 Subject: [PATCH 0349/2020] Run `Manifest` parsing in `block_in_place` mode Signed-off-by: Jiahao XU --- src/drivers/crates_io.rs | 3 +-- src/drivers/crates_io/visitor.rs | 30 ++++++++++++++++-------------- src/helpers.rs | 6 +++--- src/helpers/async_extracter.rs | 13 +++++-------- 4 files changed, 25 insertions(+), 27 deletions(-) diff --git a/src/drivers/crates_io.rs b/src/drivers/crates_io.rs index 68f04e82..fa1a8063 100644 --- a/src/drivers/crates_io.rs +++ b/src/drivers/crates_io.rs @@ -71,6 +71,5 @@ pub async fn fetch_crate_cratesio( TarBasedFmt::Tgz, ManifestVisitor::new(manifest_dir_path), ) - .await? - .load_manifest() + .await } diff --git a/src/drivers/crates_io/visitor.rs b/src/drivers/crates_io/visitor.rs index 3f354771..0eb7bd6c 100644 --- a/src/drivers/crates_io/visitor.rs +++ b/src/drivers/crates_io/visitor.rs @@ -29,23 +29,11 @@ impl ManifestVisitor { vfs: Vfs::new(), } } - - /// Load binstall metadata using the extracted information stored in memory. - pub(super) fn load_manifest(&self) -> Result, BinstallError> { - debug!("Loading manifest directly from extracted file"); - - // Load and parse manifest - let mut manifest = Manifest::::from_slice_with_metadata(&self.cargo_toml_content)?; - - // Checks vfs for binary output names - manifest.complete_from_abstract_filesystem(&self.vfs)?; - - // Return metadata - Ok(manifest) - } } impl TarEntriesVisitor for ManifestVisitor { + type Target = Manifest; + fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), BinstallError> { for res in entries { let mut entry = res?; @@ -78,4 +66,18 @@ impl TarEntriesVisitor for ManifestVisitor { Ok(()) } + + /// Load binstall metadata using the extracted information stored in memory. + fn finish(self) -> Result { + debug!("Loading manifest directly from extracted file"); + + // Load and parse manifest + let mut manifest = Manifest::from_slice_with_metadata(&self.cargo_toml_content)?; + + // Checks vfs for binary output names + manifest.complete_from_abstract_filesystem(&self.vfs)?; + + // Return metadata + Ok(manifest) + } } diff --git a/src/helpers.rs b/src/helpers.rs index 55edc19a..18794acb 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -130,16 +130,16 @@ pub async fn download_tar_based_and_visit Result { +) -> Result { let stream = create_request(url).await?; debug!("Downloading and extracting then in-memory processing"); - let visitor = extract_tar_based_stream_and_visit(stream, fmt, visitor).await?; + let ret = extract_tar_based_stream_and_visit(stream, fmt, visitor).await?; debug!("Download, extraction and in-memory procession OK"); - Ok(visitor) + Ok(ret) } /// Fetch install path from environment diff --git a/src/helpers/async_extracter.rs b/src/helpers/async_extracter.rs index 5a7ef9c1..9986c48a 100644 --- a/src/helpers/async_extracter.rs +++ b/src/helpers/async_extracter.rs @@ -99,20 +99,17 @@ where /// Visitor must iterate over all entries. /// Entires can be in arbitary order. pub trait TarEntriesVisitor { - fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), BinstallError>; -} + type Target; -impl TarEntriesVisitor for &mut V { - fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), BinstallError> { - (*self).visit(entries) - } + fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), BinstallError>; + fn finish(self) -> Result; } pub async fn extract_tar_based_stream_and_visit( stream: S, fmt: TarBasedFmt, mut visitor: V, -) -> Result +) -> Result where S: Stream> + Unpin + 'static, V: TarEntriesVisitor + Debug + Send + 'static, @@ -124,6 +121,6 @@ where let mut tar = create_tar_decoder(reader, fmt)?; visitor.visit(tar.entries()?)?; - Ok(visitor) + visitor.finish() }) } From 7616546a6161061832f718bc4bc8e72e30f0a2f7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 23 Jun 2022 21:27:15 +1000 Subject: [PATCH 0350/2020] Impl new fn `atomic_install` for atommically installing a file Signed-off-by: Jiahao XU --- src/helpers.rs | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/helpers.rs b/src/helpers.rs index 03bf97c9..a13574c0 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,4 +1,6 @@ use std::fmt::Debug; +use std::fs; +use std::io; use std::path::{Path, PathBuf}; use bytes::Bytes; @@ -8,6 +10,7 @@ use log::debug; use once_cell::sync::OnceCell; use reqwest::{Client, ClientBuilder, Method, Response}; use serde::Serialize; +use tempfile::NamedTempFile; use tinytemplate::TinyTemplate; use url::Url; @@ -179,6 +182,48 @@ pub fn get_install_path>(install_path: Option

) -> Option io::Result<()> { + debug!( + "Attempting to atomically rename from '{}' to '{}'", + src.display(), + dst.display() + ); + + if fs::rename(src, dst).is_err() { + debug!("Attempting at atomically failed, fallback to creating tempfile."); + // src and dst is not on the same filesystem/mountpoint. + // Fallback to creating NamedTempFile on the parent dir of + // dst. + + let mut src_file = fs::File::open(src)?; + + let parent = dst.parent().unwrap(); + debug!("Creating named tempfile at '{}'", parent.display()); + let mut tempfile = NamedTempFile::new_in(parent)?; + + debug!( + "Copying from '{}' to '{}'", + src.display(), + tempfile.path().display() + ); + io::copy(&mut src_file, tempfile.as_file_mut())?; + + debug!( + "Persisting '{}' to '{}'", + tempfile.path().display(), + dst.display() + ); + tempfile.persist(dst).map_err(io::Error::from)?; + } else { + debug!("Attempting at atomically succeeded."); + } + + Ok(()) +} + pub trait Template: Serialize { fn render(&self, template: &str) -> Result where From 97bfeb7bd8093b42d4cd745f9f45af0c48a70098 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 23 Jun 2022 21:27:30 +1000 Subject: [PATCH 0351/2020] Use `atomic_install` in `install_bin` Signed-off-by: Jiahao XU --- src/bins.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bins.rs b/src/bins.rs index 76dfc9fc..18134f70 100644 --- a/src/bins.rs +++ b/src/bins.rs @@ -4,7 +4,7 @@ use cargo_toml::Product; use log::debug; use serde::Serialize; -use crate::{BinstallError, PkgFmt, PkgMeta, Template}; +use crate::{atomic_install, BinstallError, PkgFmt, PkgMeta, Template}; pub struct BinFile { pub base_name: String, @@ -80,11 +80,11 @@ impl BinFile { pub fn install_bin(&self) -> Result<(), BinstallError> { // TODO: check if file already exists debug!( - "Copy file from '{}' to '{}'", + "Atomically install file from '{}' to '{}'", self.source.display(), self.dest.display() ); - std::fs::copy(&self.source, &self.dest)?; + atomic_install(&self.source, &self.dest)?; #[cfg(target_family = "unix")] { From d4105585db3cf3d90f30b4fb10cedadfc4546f7c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 23 Jun 2022 22:50:30 +1000 Subject: [PATCH 0352/2020] Fix `atomic_install`: Copy permissions of src Signed-off-by: Jiahao XU --- src/helpers.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/helpers.rs b/src/helpers.rs index a13574c0..361dc60e 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -211,6 +211,15 @@ pub fn atomic_install(src: &Path, dst: &Path) -> io::Result<()> { ); io::copy(&mut src_file, tempfile.as_file_mut())?; + debug!("Retrieving permissions of '{}'", src.display()); + let permissions = src_file.metadata()?.permissions(); + + debug!( + "Setting permissions of '{}' to '{permissions:#?}'", + tempfile.path().display() + ); + tempfile.as_file().set_permissions(permissions)?; + debug!( "Persisting '{}' to '{}'", tempfile.path().display(), From e9c86dfad4713da5de25b9296fa0a7cc774f7570 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 23 Jun 2022 22:51:50 +1000 Subject: [PATCH 0353/2020] Rm `set_permissions` in `BinFile::install_bin` Signed-off-by: Jiahao XU --- src/bins.rs | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/bins.rs b/src/bins.rs index 18134f70..56ff66e5 100644 --- a/src/bins.rs +++ b/src/bins.rs @@ -86,13 +86,6 @@ impl BinFile { ); atomic_install(&self.source, &self.dest)?; - #[cfg(target_family = "unix")] - { - use std::os::unix::fs::PermissionsExt; - debug!("Set permissions 755 on '{}'", self.dest.display()); - std::fs::set_permissions(&self.dest, std::fs::Permissions::from_mode(0o755))?; - } - Ok(()) } From 77ce57815ce2674e7fcb3d0be7352de90e33578a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 23 Jun 2022 23:26:30 +1000 Subject: [PATCH 0354/2020] Impl new fn `helpers::symlink_file` Signed-off-by: Jiahao XU --- src/helpers.rs | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/src/helpers.rs b/src/helpers.rs index 361dc60e..0fbe2256 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -233,6 +233,40 @@ pub fn atomic_install(src: &Path, dst: &Path) -> io::Result<()> { Ok(()) } +fn symlink_file, Q: AsRef>(original: P, link: Q) -> io::Result<()> { + #[cfg(target_family = "unix")] + let f = std::os::unix::fs::symlink; + #[cfg(target_family = "windows")] + let f = std::os::windows::fs::symlink_file; + + f(original, link) +} + +/// Atomically install symlink "link" to a file "dst". +/// +/// This is a blocking function, must be called in `block_in_place` mode. +pub fn atomic_symlink_file(dest: &Path, link: &Path) -> io::Result<()> { + let parent = link.parent().unwrap(); + + debug!("Creating tempPath at '{}'", parent.display()); + let temp_path = NamedTempFile::new_in(parent)?.into_temp_path(); + fs::remove_file(&temp_path)?; + + debug!( + "Creating symlink '{}' to file '{}'", + temp_path.display(), + dest.display() + ); + symlink_file(dest, &temp_path)?; + + debug!( + "Persisting '{}' to '{}'", + temp_path.display(), + link.display() + ); + temp_path.persist(link).map_err(io::Error::from) +} + pub trait Template: Serialize { fn render(&self, template: &str) -> Result where From 43238e39a30c836bef02a6b57dd2444af9b25218 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 23 Jun 2022 23:26:46 +1000 Subject: [PATCH 0355/2020] Use `atomic_symlink_file` in `install_link` Signed-off-by: Jiahao XU --- src/bins.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/bins.rs b/src/bins.rs index 56ff66e5..ce427dd1 100644 --- a/src/bins.rs +++ b/src/bins.rs @@ -4,7 +4,7 @@ use cargo_toml::Product; use log::debug; use serde::Serialize; -use crate::{atomic_install, BinstallError, PkgFmt, PkgMeta, Template}; +use crate::{atomic_install, atomic_symlink_file, BinstallError, PkgFmt, PkgMeta, Template}; pub struct BinFile { pub base_name: String, @@ -103,10 +103,7 @@ impl BinFile { self.link.display(), dest.display() ); - #[cfg(target_family = "unix")] - std::os::unix::fs::symlink(dest, &self.link)?; - #[cfg(target_family = "windows")] - std::os::windows::fs::symlink_file(dest, &self.link)?; + atomic_symlink_file(dest, &self.link)?; Ok(()) } From 14c606d72b5e3c6b10d4143f2293befd22a8f367 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 23 Jun 2022 23:27:16 +1000 Subject: [PATCH 0356/2020] Simplify `BinFile::link_dest` Signed-off-by: Jiahao XU --- src/bins.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/bins.rs b/src/bins.rs index ce427dd1..d08cf15a 100644 --- a/src/bins.rs +++ b/src/bins.rs @@ -109,12 +109,9 @@ impl BinFile { } fn link_dest(&self) -> &Path { - #[cfg(target_family = "unix")] - { + if cfg!(target_family = "unix") { Path::new(self.dest.file_name().unwrap()) - } - #[cfg(target_family = "windows")] - { + } else { &self.dest } } From 4bc16863e06fee00fdcf3be8ac97e8db907e02fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 28 Jun 2022 02:40:16 +1200 Subject: [PATCH 0357/2020] Format -> formats --- src/{format.rs => formats.rs} | 0 src/lib.rs | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename src/{format.rs => formats.rs} (100%) diff --git a/src/format.rs b/src/formats.rs similarity index 100% rename from src/format.rs rename to src/formats.rs diff --git a/src/lib.rs b/src/lib.rs index 5725995d..2ec0eb1b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -17,8 +17,8 @@ pub mod fetchers; mod target; pub use target::*; -mod format; -pub use format::*; +mod formats; +pub use formats::*; /// Default package path template (may be overridden in package Cargo.toml) pub const DEFAULT_PKG_URL: &str = From 66a14d0c7c1297fcb0431aea8e52fa40d6a16de3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 28 Jun 2022 03:09:04 +1200 Subject: [PATCH 0358/2020] Polish up new secure options --- src/helpers.rs | 26 ++++++++++++++++---------- src/helpers/tls_version.rs | 2 ++ src/main.rs | 21 ++++++++++++++------- 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 18794acb..e476464c 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -6,7 +6,7 @@ use cargo_toml::Manifest; use futures_util::stream::Stream; use log::debug; use once_cell::sync::OnceCell; -use reqwest::{Client, ClientBuilder, Method, Response}; +use reqwest::{Client, ClientBuilder, Method, Response, tls}; use serde::Serialize; use tinytemplate::TinyTemplate; use tokio::task::block_in_place; @@ -32,8 +32,14 @@ pub use path_ext::*; mod tls_version; pub use tls_version::TLSVersion; -/// (enable https only mode, min TLS version_option) -pub static REQWESTGLOBALCONFIG: OnceCell<(bool, Option)> = OnceCell::new(); +#[derive(Debug)] +pub struct ReqwestConfig { + pub secure: bool, + pub min_tls: Option, +} + +/// (secure mode, min TLS version) +pub static REQWESTGLOBALCONFIG: OnceCell = OnceCell::new(); /// Load binstall metadata from the crate `Cargo.toml` at the provided path pub fn load_manifest_path>( @@ -53,15 +59,15 @@ pub fn load_manifest_path>( pub fn new_reqwest_client_builder() -> ClientBuilder { let mut builder = ClientBuilder::new(); - if let Some((https_only, min_tls_ver_opt)) = REQWESTGLOBALCONFIG.get() { - builder = builder.https_only(*https_only); - - if *https_only { - builder = builder.min_tls_version(reqwest::tls::Version::TLS_1_2); + if let Some(ReqwestConfig { secure, min_tls }) = REQWESTGLOBALCONFIG.get() { + if *secure { + builder = builder + .https_only(true) + .min_tls_version(tls::Version::TLS_1_2) } - if let Some(min_tls_ver) = *min_tls_ver_opt { - builder = builder.min_tls_version(min_tls_ver.into()); + if let Some(ver) = *min_tls { + builder = builder.min_tls_version(ver); } } diff --git a/src/helpers/tls_version.rs b/src/helpers/tls_version.rs index 1f0ad5dc..35f86123 100644 --- a/src/helpers/tls_version.rs +++ b/src/helpers/tls_version.rs @@ -3,7 +3,9 @@ use reqwest::tls::Version; #[derive(Debug, Copy, Clone, ArgEnum)] pub enum TLSVersion { + #[clap(name = "1.2")] Tls1_2, + #[clap(name = "1.3")] Tls1_3, } diff --git a/src/main.rs b/src/main.rs index 169e74d7..f5684031 100644 --- a/src/main.rs +++ b/src/main.rs @@ -88,15 +88,22 @@ struct Options { #[clap(long)] no_cleanup: bool, - /// Enable https only mode. + /// Enforce downloads over secure transports only. /// - /// When https only mode is enabled, it will also set - /// minimum TLS version to tls1_2. + /// Insecure HTTP downloads will be removed completely in the future; in the meantime this + /// option forces a fail when the remote endpoint uses plaintext HTTP or insecure TLS suites. + /// + /// Without this option, plain HTTP will warn. + /// + /// Implies `--min-tls-version=1.2`. #[clap(long)] - https_only_mode: bool, + secure: bool, - /// Decide which TLS version to use. - #[clap(long, arg_enum)] + /// Require a minimum TLS version from remote endpoints. + /// + /// The default is not to require any minimum TLS version, and use the negotiated highest + /// version available to both this client and the remote server. + #[clap(long, arg_enum, value_name = "VERSION")] min_tls_version: Option, /// Override manifest source. @@ -194,7 +201,7 @@ async fn entry() -> Result<()> { // Initialize REQWESTGLOBALCONFIG REQWESTGLOBALCONFIG - .set((opts.https_only_mode, opts.min_tls_version)) + .set(ReqwestConfig { secure: opts.secure, min_tls: opts.min_tls_version.map(|v| v.into()) }) .unwrap(); // Setup logging From 72148ec57288d09ce5775f6e1e723c4e5f09ed03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 28 Jun 2022 03:11:53 +1200 Subject: [PATCH 0359/2020] Update deps --- Cargo.lock | 116 +++++++++++++++++++++++++---------------------------- Cargo.toml | 14 +++---- 2 files changed, 62 insertions(+), 68 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9b3b74b5..624a1d32 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -312,12 +312,12 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.8" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "7d82ee10ce34d7bc12c2122495e7593a9c41347ecdd64185af4ecf72cb1a7f83" dependencies = [ "cfg-if", - "lazy_static", + "once_cell", ] [[package]] @@ -528,13 +528,13 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9be70c98951c83b8d2f8f60d7065fa6d5146873094452a1008da8c2f1e4205ad" +checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ "cfg-if", "libc", - "wasi 0.10.2+wasi-snapshot-preview1", + "wasi", ] [[package]] @@ -576,9 +576,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" [[package]] name = "heck" @@ -685,9 +685,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.8.2" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", "hashbrown", @@ -731,9 +731,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.57" +version = "0.3.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671a26f820db17c2a2750743f1dd03bafd15b98c9f30c7c2628c024c05d73397" +checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" dependencies = [ "wasm-bindgen", ] @@ -810,9 +810,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "miette" -version = "4.7.1" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c90329e44f9208b55f45711f9558cec15d7ef8295cc65ecd6d4188ae8edc58c" +checksum = "6ec753a43fd71bb5f28751c9ec17fbe89d6d26ca8282d1e1f82f5ac3dbd5581e" dependencies = [ "atty", "miette-derive", @@ -829,9 +829,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "4.7.1" +version = "5.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b5bc45b761bcf1b5e6e6c4128cd93b84c218721a8d9b894aa0aff4ed180174c" +checksum = "fdfc33ea15c5446600f91d319299dd40301614afff7143cdfa9bf4c09da3ca64" dependencies = [ "proc-macro2", "quote", @@ -861,13 +861,13 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713d550d9b44d89174e066b7a6217ae06234c10cb47819a88290d2b353c31799" +checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys", ] @@ -993,18 +993,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" +checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" dependencies = [ "proc-macro2", ] @@ -1139,9 +1139,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2cc38e8fa666e2de3c4aba7edeb5ffc5246c1c2ed0e3d17e560aeeba736b23f" +checksum = "a0a5f7c728f5d284929a1cccb5bc19884422bfe6ef4d6c409da2c41838983fcf" [[package]] name = "ryu" @@ -1288,9 +1288,9 @@ checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" [[package]] name = "strum_macros" -version = "0.24.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6878079b17446e4d3eba6192bb0a2950d5b14f0ed8424b852310e5a94345d0ef" +checksum = "4faebde00e8ff94316c01800f9054fd2ba77d30d9e922541913051d1d978918b" dependencies = [ "heck", "proc-macro2", @@ -1329,9 +1329,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.96" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf" +checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" dependencies = [ "proc-macro2", "quote", @@ -1424,9 +1424,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.9" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2702e08a7a860f005826c6815dcac101b19b5eb330c27fe4a5928fec1d20ddd" +checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217" dependencies = [ "itoa", "libc", @@ -1519,15 +1519,15 @@ dependencies = [ [[package]] name = "tower-service" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "360dfd1d6d30e05fda32ace2c8c70e9c0a9da713275777f5a4dbb8a1893930c6" +checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.34" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0ecdcb44a79f0fe9844f0c4f33a342cbcbb5117de8001e6ba0dc2351327d09" +checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" dependencies = [ "cfg-if", "pin-project-lite", @@ -1536,9 +1536,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7709595b8878a4965ce5e87ebf880a7d39c9afc6837721b21a5a816a8117d921" +checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7" dependencies = [ "once_cell", ] @@ -1557,9 +1557,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d22af068fba1eb5edcb4aea19d382b2a3deb4c8f9d475c589b6ada9e0fd493ee" +checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" [[package]] name = "unicode-linebreak" @@ -1572,9 +1572,9 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54590932941a9e9266f0832deed84ebe1bf2e4c9e4a3554d393d18f5e854bf9" +checksum = "81dee68f85cab8cf68dec42158baf3a79a1cdc065a8b103025965d6ccb7f6cbd" dependencies = [ "tinyvec", ] @@ -1625,12 +1625,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -1639,9 +1633,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27370197c907c55e3f1a9fbe26f44e937fe6451368324e009cba39e139dc08ad" +checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1649,9 +1643,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e04185bfa3a779273da532f5025e33398409573f348985af9a1cbf3774d3f4" +checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" dependencies = [ "bumpalo", "lazy_static", @@ -1664,9 +1658,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.30" +version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f741de44b75e14c35df886aff5f1eb73aa114fa5d4d00dcd37b5e01259bf3b2" +checksum = "de9a9cec1733468a8c657e57fa2413d2ae2c0129b95e87c5b72b8ace4d13f31f" dependencies = [ "cfg-if", "js-sys", @@ -1676,9 +1670,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17cae7ff784d7e83a2fe7611cfe766ecf034111b49deb850a3dc7699c08251f5" +checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1686,9 +1680,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ec0dc7a4756fffc231aab1b9f2f578d23cd391390ab27f952ae0c9b3ece20b" +checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" dependencies = [ "proc-macro2", "quote", @@ -1699,15 +1693,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.80" +version = "0.2.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d554b7f530dee5964d9a9468d95c1f8b8acae4f282807e7d27d4b03099a46744" +checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" [[package]] name = "web-sys" -version = "0.3.57" +version = "0.3.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b17e741662c70c8bd24ac5c5b18de314a2c26c32bf8346ee1e6f53de919c283" +checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/Cargo.toml b/Cargo.toml index 556ee462..f05e87b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,20 +29,20 @@ dirs = "4.0.0" flate2 = { version = "1.0.24", features = ["zlib-ng"], default-features = false } futures-util = { version = "0.3.21", default-features = false } log = "0.4.14" -miette = { version = "4.7.1", features = ["fancy-no-backtrace"] } +miette = { version = "5.1.0", features = ["fancy-no-backtrace"] } once_cell = "1.12.0" -reqwest = { version = "0.11.11", features = [ "rustls-tls", "stream" ], default-features = false } +reqwest = { version = "0.11.11", features = ["rustls-tls", "stream"], default-features = false } scopeguard = "1.1.0" semver = "1.0.10" -serde = { version = "1.0.136", features = [ "derive" ] } +serde = { version = "1.0.136", features = ["derive"] } simplelog = "0.12.0" strum = "0.24.1" -strum_macros = "0.24.0" +strum_macros = "0.24.2" tar = "0.4.38" tempfile = "3.3.0" thiserror = "1.0.31" tinytemplate = "1.2.1" -tokio = { version = "1.19.1", features = [ "rt-multi-thread", "process", "sync" ], default-features = false } +tokio = { version = "1.19.1", features = ["rt-multi-thread", "process", "sync"], default-features = false } url = "2.2.2" xz2 = "0.1.6" @@ -52,7 +52,7 @@ xz2 = "0.1.6" # this crate. # - time: Enables features using the [time](https://github.com/time-rs/time) crate, # which is not used by this crate. -zip = { version = "0.6.2", default-features = false, features = [ "deflate", "bzip2", "zstd" ] } +zip = { version = "0.6.2", default-features = false, features = ["deflate", "bzip2", "zstd"] } # zstd is also depended by zip. # Since zip 0.6.2 depends on zstd 0.10.0, we also have to use 0.10.0 here, @@ -60,7 +60,7 @@ zip = { version = "0.6.2", default-features = false, features = [ "deflate", "bz # # Enable feature bindgen to generate C bindings. # Enable feature zstdmt to enable multithreading in libzstd. -zstd = { version = "0.10.0", features = [ "bindgen", "zstdmt" ], default-features = false } +zstd = { version = "0.10.0", features = ["bindgen", "zstdmt"], default-features = false } [target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] guess_host_triple = "0.1.3" From 43e4e17e84f545db3417b9441a707b967df51c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 29 Jun 2022 01:48:59 +1200 Subject: [PATCH 0360/2020] Fix test --- ci-scripts/run_tests_unix.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci-scripts/run_tests_unix.sh b/ci-scripts/run_tests_unix.sh index 135d4765..9c3ca0b7 100755 --- a/ci-scripts/run_tests_unix.sh +++ b/ci-scripts/run_tests_unix.sh @@ -21,11 +21,11 @@ cargo binstall --help >/dev/null # Test that the installed binaries can be run cargo binstall --help >/dev/null -# Install binaries using https-only-mode and specify min tls ver +# Install binaries using secure mode "./$1" binstall \ --log-level debug \ - --https-only-mode \ - --min-tls-version tls1-3 \ + --secure \ + --min-tls-version 1.3 \ --no-confirm \ cargo-binstall # Test that the installed binaries can be run From caf6f3930b50c66d036fc1b2e8e3d305bfa9338a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 29 Jun 2022 02:05:27 +1200 Subject: [PATCH 0361/2020] (cargo-release) version 0.9.2 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 624a1d32..e03717bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -130,7 +130,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.9.1" +version = "0.9.2" dependencies = [ "async-trait", "bytes", diff --git a/Cargo.toml b/Cargo.toml index f05e87b1..f121f595 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/ryankurte/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.9.1" +version = "0.9.2" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From ec6f81935c044b83eafef4181029a034849e906c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 1 Jul 2022 19:30:31 +1000 Subject: [PATCH 0362/2020] Refactor: Extract `detect_alternative_targets` Signed-off-by: Jiahao XU --- src/target.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/target.rs b/src/target.rs index fc5292f9..6fe51f0e 100644 --- a/src/target.rs +++ b/src/target.rs @@ -91,9 +91,7 @@ pub async fn detect_targets() -> Vec { } #[cfg(target_os = "windows")] - if v[0].contains("gnu") { - v.push(v[0].replace("gnu", "msvc")); - } + v.extend(windows::detect_alternative_targets(&v[0])); v } else { @@ -221,12 +219,16 @@ mod windows { use super::TARGET; use guess_host_triple::guess_host_triple; + pub(super) fn detect_alternative_targets(target: &str) -> Option { + target + .contains("gnu") + .then(|| target.replace("gnu", "msvc")) + } + pub(super) fn detect_targets_windows() -> Vec { let mut targets = vec![guess_host_triple().unwrap_or(TARGET).to_string()]; - if targets[0].contains("gnu") { - targets.push(targets[0].replace("gnu", "msvc")); - } + targets.extend(windows::detect_alternative_targets(&targets[0])); targets } From 8e58398f5781346c134e488952091aa8145dc470 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 1 Jul 2022 19:34:52 +1000 Subject: [PATCH 0363/2020] Fix windows target detection for abi `gnullvm` Signed-off-by: Jiahao XU --- src/target.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/target.rs b/src/target.rs index 6fe51f0e..cfe042a0 100644 --- a/src/target.rs +++ b/src/target.rs @@ -220,9 +220,10 @@ mod windows { use guess_host_triple::guess_host_triple; pub(super) fn detect_alternative_targets(target: &str) -> Option { - target - .contains("gnu") - .then(|| target.replace("gnu", "msvc")) + let (prefix, abi) = target.rsplit_once('-').expect("Invalid target triple"); + + // detect abi in ["gnu", "gnullvm", ...] + (abi != "msvc").then(|| format!("{prefix}-msvc")) } pub(super) fn detect_targets_windows() -> Vec { From 1ec1f972b7d170dee71299dff648bde2b65c85bd Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 1 Jul 2022 19:46:30 +1000 Subject: [PATCH 0364/2020] Fix copy-paste error in `detect_targets_windows` Signed-off-by: Jiahao XU --- src/target.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target.rs b/src/target.rs index cfe042a0..8dfb75b6 100644 --- a/src/target.rs +++ b/src/target.rs @@ -229,7 +229,7 @@ mod windows { pub(super) fn detect_targets_windows() -> Vec { let mut targets = vec![guess_host_triple().unwrap_or(TARGET).to_string()]; - targets.extend(windows::detect_alternative_targets(&targets[0])); + targets.extend(detect_alternative_targets(&targets[0])); targets } From 267307fa2898cdb33cd83aa30d65e95a33fff635 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 3 Jul 2022 18:12:37 +1000 Subject: [PATCH 0365/2020] Set `opt-level` for release to `s` O3 mostly enables float optimization, more aggressive loop unrolling and function inline. O2 is probably OK, but I want to reduce the binary size a bit by using opt level "s". Signed-off-by: Jiahao XU --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index f121f595..c90656f7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,6 +69,7 @@ guess_host_triple = "0.1.3" env_logger = "0.9.0" [profile.release] +opt-level = "s" lto = true codegen-units = 1 panic = "abort" From d8a3375bc39e026770cb9453c5b1a1af22201409 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 4 Jul 2022 01:26:34 +0000 Subject: [PATCH 0366/2020] Bump clap from 3.2.6 to 3.2.8 Bumps [clap](https://github.com/clap-rs/clap) from 3.2.6 to 3.2.8. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v3.2.6...v3.2.8) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 10 +++++----- Cargo.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e03717bb..a42ecb41 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -136,7 +136,7 @@ dependencies = [ "bytes", "bzip2", "cargo_toml", - "clap 3.2.6", + "clap 3.2.8", "crates_io_api", "dirs", "env_logger", @@ -238,9 +238,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.6" +version = "3.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f1fe12880bae935d142c8702d500c63a4e8634b6c3c57ad72bf978fc7b6249a" +checksum = "190814073e85d238f31ff738fcb0bf6910cedeb73376c87cd69291028966fd83" dependencies = [ "atty", "bitflags", @@ -255,9 +255,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.2.6" +version = "3.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6db9e867166a43a53f7199b5e4d1f522a1e5bd626654be263c999ce59df39a" +checksum = "759bf187376e1afa7b85b959e6a664a3e7a95203415dba952ad19139e798f902" dependencies = [ "heck", "proc-macro-error", diff --git a/Cargo.toml b/Cargo.toml index f121f595..e56a53f0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ async-trait = "0.1.56" bytes = "1.1.0" bzip2 = { version = "0.4.3", features = ["static"] } cargo_toml = "0.11.4" -clap = { version = "3.2.6", features = ["derive"] } +clap = { version = "3.2.8", features = ["derive"] } crates_io_api = { version = "0.8.0", default-features = false, features = ["rustls"] } dirs = "4.0.0" flate2 = { version = "1.0.24", features = ["zlib-ng"], default-features = false } From 1c2d005fd42c6425a0f589b562613063eb096613 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Mon, 4 Jul 2022 23:53:47 +1200 Subject: [PATCH 0367/2020] Write to .crates.toml --- Cargo.lock | 11 +++ Cargo.toml | 2 + src/helpers.rs | 2 +- src/lib.rs | 1 + src/main.rs | 20 +++++- src/metafiles.rs | 173 +++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 207 insertions(+), 2 deletions(-) create mode 100644 src/metafiles.rs diff --git a/Cargo.lock b/Cargo.lock index e03717bb..3a5a3bc7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -143,6 +143,7 @@ dependencies = [ "flate2", "futures-util", "guess_host_triple", + "home", "log", "miette", "once_cell", @@ -158,6 +159,7 @@ dependencies = [ "thiserror", "tinytemplate", "tokio", + "toml", "url", "xz2", "zip", @@ -595,6 +597,15 @@ dependencies = [ "libc", ] +[[package]] +name = "home" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654" +dependencies = [ + "winapi", +] + [[package]] name = "http" version = "0.2.8" diff --git a/Cargo.toml b/Cargo.toml index f121f595..aa0ee739 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,6 +28,7 @@ crates_io_api = { version = "0.8.0", default-features = false, features = ["rust dirs = "4.0.0" flate2 = { version = "1.0.24", features = ["zlib-ng"], default-features = false } futures-util = { version = "0.3.21", default-features = false } +home = "0.5.3" log = "0.4.14" miette = { version = "5.1.0", features = ["fancy-no-backtrace"] } once_cell = "1.12.0" @@ -43,6 +44,7 @@ tempfile = "3.3.0" thiserror = "1.0.31" tinytemplate = "1.2.1" tokio = { version = "1.19.1", features = ["rt-multi-thread", "process", "sync"], default-features = false } +toml = "0.5.9" url = "2.2.2" xz2 = "0.1.6" diff --git a/src/helpers.rs b/src/helpers.rs index e476464c..4be08709 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -6,7 +6,7 @@ use cargo_toml::Manifest; use futures_util::stream::Stream; use log::debug; use once_cell::sync::OnceCell; -use reqwest::{Client, ClientBuilder, Method, Response, tls}; +use reqwest::{tls, Client, ClientBuilder, Method, Response}; use serde::Serialize; use tinytemplate::TinyTemplate; use tokio::task::block_in_place; diff --git a/src/lib.rs b/src/lib.rs index 2ec0eb1b..eb475ac4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -13,6 +13,7 @@ pub use helpers::*; pub mod bins; pub mod fetchers; +pub mod metafiles; mod target; pub use target::*; diff --git a/src/main.rs b/src/main.rs index f5684031..fffdccd0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -201,7 +201,10 @@ async fn entry() -> Result<()> { // Initialize REQWESTGLOBALCONFIG REQWESTGLOBALCONFIG - .set(ReqwestConfig { secure: opts.secure, min_tls: opts.min_tls_version.map(|v| v.into()) }) + .set(ReqwestConfig { + secure: opts.secure, + min_tls: opts.min_tls_version.map(|v| v.into()), + }) .unwrap(); // Setup logging @@ -451,6 +454,21 @@ async fn install_from_package( uithread.confirm().await?; + debug!("Writing .crates.toml"); + if let Ok(mut ctoml) = metafiles::CratesToml::load().await { + ctoml.insert( + metafiles::CrateVersionSource { + name: opts.name.into(), + version: package.version.parse().into_diagnostic()?, + source: metafiles::Source::Registry( + url::Url::parse("https://github.com/rust-lang/crates.io-index").unwrap(), + ), + }, + bin_files.iter().map(|bin| bin.base_name.clone()), + ); + ctoml.write().await?; + } + info!("Installing binaries..."); block_in_place(|| { for file in &bin_files { diff --git a/src/metafiles.rs b/src/metafiles.rs new file mode 100644 index 00000000..013d31be --- /dev/null +++ b/src/metafiles.rs @@ -0,0 +1,173 @@ +use std::{ + collections::{BTreeMap, BTreeSet}, + fmt, + path::{Path, PathBuf}, + str::FromStr, +}; + +use miette::Diagnostic; +use semver::Version; +use serde::{Deserialize, Serialize}; +use thiserror::Error; +use tokio::fs; +use url::Url; + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CratesTomlRaw { + #[serde(default)] + pub v1: BTreeMap>, +} + +#[derive(Clone, Debug, Default)] +pub struct CratesToml(BTreeMap>); + +impl CratesToml { + pub fn default_path() -> Result { + Ok(home::cargo_home()?.join(".crates.toml")) + } + + pub async fn load() -> Result { + Self::load_from_path(Self::default_path()?).await + } + + pub async fn load_from_path(path: impl AsRef) -> Result { + let file = fs::read_to_string(path).await?; + Self::from_str(&file) + } + + pub fn insert(&mut self, cvs: CrateVersionSource, bins: impl Iterator) { + self.0.insert(cvs, bins.collect()); + } + + pub async fn write(&self) -> Result<(), CratesTomlParseError> { + self.write_to_path(Self::default_path()?).await + } + + pub async fn write_to_path(&self, path: impl AsRef) -> Result<(), CratesTomlParseError> { + let raw = CratesTomlRaw { + v1: self + .0 + .iter() + .map(|(cvs, bins)| (cvs.to_string(), bins.clone())) + .collect(), + }; + + fs::write(path, &toml::to_vec(&raw)?).await?; + Ok(()) + } +} + +impl FromStr for CratesToml { + type Err = CratesTomlParseError; + fn from_str(s: &str) -> Result { + let raw: CratesTomlRaw = toml::from_str(s).unwrap(); + + Ok(Self( + raw.v1 + .into_iter() + .map(|(name, bins)| CrateVersionSource::from_str(&name).map(|cvs| (cvs, bins))) + .collect::>()?, + )) + } +} + +#[derive(Debug, Diagnostic, Error)] +pub enum CratesTomlParseError { + #[error(transparent)] + Io(#[from] std::io::Error), + + #[error(transparent)] + TomlParse(#[from] toml::de::Error), + + #[error(transparent)] + TomlWrite(#[from] toml::ser::Error), + + #[error(transparent)] + CvsParse(#[from] CvsParseError), +} + +#[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq)] +pub struct CrateVersionSource { + pub name: String, + pub version: Version, + pub source: Source, +} + +#[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq)] +pub enum Source { + Git(Url), + Path(Url), + Registry(Url), +} + +impl FromStr for CrateVersionSource { + type Err = CvsParseError; + fn from_str(s: &str) -> Result { + match s.splitn(3, ' ').collect::>()[..] { + [name, version, source] => { + let version = version.parse()?; + let source = match source + .trim_matches(&['(', ')'][..]) + .splitn(2, '+') + .collect::>()[..] + { + ["git", url] => Source::Git(Url::parse(url)?), + ["path", url] => Source::Path(Url::parse(url)?), + ["registry", url] => Source::Registry(Url::parse(url)?), + [kind, arg] => { + return Err(CvsParseError::UnknownSourceType { + kind: kind.to_string(), + arg: arg.to_string(), + }) + } + _ => return Err(CvsParseError::BadSource), + }; + Ok(Self { + name: name.to_string(), + version, + source, + }) + } + _ => Err(CvsParseError::BadFormat), + } + } +} + +#[derive(Debug, Diagnostic, Error)] +pub enum CvsParseError { + #[error(transparent)] + UrlParse(#[from] url::ParseError), + + #[error(transparent)] + VersionParse(#[from] semver::Error), + + #[error("unknown source type {kind}+{arg}")] + UnknownSourceType { kind: String, arg: String }, + + #[error("bad source format")] + BadSource, + + #[error("bad CVS format")] + BadFormat, +} + +impl fmt::Display for CrateVersionSource { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let Self { + name, + version, + source, + } = &self; + write!(f, "{name} {version} ({source})") + } +} + +impl fmt::Display for Source { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Source::Git(url) => write!(f, "git+{url}"), + Source::Path(url) => write!(f, "path+{url}"), + Source::Registry(url) => write!(f, "registry+{url}"), + } + } +} From 17cf6f5dc5817489bbd9d0055511ebc274657fa8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 5 Jul 2022 00:32:08 +1200 Subject: [PATCH 0368/2020] Write to .crates2.json --- Cargo.lock | 5 +- Cargo.toml | 1 + src/main.rs | 46 +++++++---- src/metafiles.rs | 176 +------------------------------------------ src/metafiles/cvs.rs | 111 +++++++++++++++++++++++++++ src/metafiles/v1.rs | 67 ++++++++++++++++ src/metafiles/v2.rs | 78 +++++++++++++++++++ 7 files changed, 296 insertions(+), 188 deletions(-) create mode 100644 src/metafiles/cvs.rs create mode 100644 src/metafiles/v1.rs create mode 100644 src/metafiles/v2.rs diff --git a/Cargo.lock b/Cargo.lock index 3a5a3bc7..9fad27a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -151,6 +151,7 @@ dependencies = [ "scopeguard", "semver", "serde", + "serde_json", "simplelog", "strum", "strum_macros", @@ -1204,9 +1205,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7ce2b32a1aed03c558dc61a5cd328f15aff2dbc17daad8fb8af04d2100e15c" +checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" dependencies = [ "itoa", "ryu", diff --git a/Cargo.toml b/Cargo.toml index aa0ee739..453e0d2d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -36,6 +36,7 @@ reqwest = { version = "0.11.11", features = ["rustls-tls", "stream"], default-fe scopeguard = "1.1.0" semver = "1.0.10" serde = { version = "1.0.136", features = ["derive"] } +serde_json = "1.0.82" simplelog = "0.12.0" strum = "0.24.1" strum_macros = "0.24.2" diff --git a/src/main.rs b/src/main.rs index fffdccd0..4b331aa4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,4 +1,5 @@ use std::{ + collections::BTreeSet, ffi::OsString, path::PathBuf, process::{ExitCode, Termination}, @@ -454,20 +455,13 @@ async fn install_from_package( uithread.confirm().await?; - debug!("Writing .crates.toml"); - if let Ok(mut ctoml) = metafiles::CratesToml::load().await { - ctoml.insert( - metafiles::CrateVersionSource { - name: opts.name.into(), - version: package.version.parse().into_diagnostic()?, - source: metafiles::Source::Registry( - url::Url::parse("https://github.com/rust-lang/crates.io-index").unwrap(), - ), - }, - bin_files.iter().map(|bin| bin.base_name.clone()), - ); - ctoml.write().await?; - } + let cvs = metafiles::CrateVersionSource { + name: opts.name, + version: package.version.parse().into_diagnostic()?, + source: metafiles::Source::Registry( + url::Url::parse("https://github.com/rust-lang/crates.io-index").unwrap(), + ), + }; info!("Installing binaries..."); block_in_place(|| { @@ -490,6 +484,30 @@ async fn install_from_package( }); } + let bins: BTreeSet = bin_files.iter().map(|bin| bin.base_name.clone()).collect(); + + debug!("Writing .crates.toml"); + if let Ok(mut c1) = metafiles::v1::CratesToml::load() { + c1.insert(cvs.clone(), bins.clone()); + c1.write()?; + } + + debug!("Writing .crates2.json"); + if let Ok(mut c2) = metafiles::v2::Crates2Json::load() { + c2.insert( + cvs.clone(), + metafiles::v2::CrateInfo { + version_req: Some(opts.version), + bins, + profile: "release".into(), + target: fetcher.target().to_string(), + rustc: format!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")), + ..Default::default() + }, + ); + c2.write()?; + } + Ok(()) }) } diff --git a/src/metafiles.rs b/src/metafiles.rs index 013d31be..06323a52 100644 --- a/src/metafiles.rs +++ b/src/metafiles.rs @@ -1,173 +1,5 @@ -use std::{ - collections::{BTreeMap, BTreeSet}, - fmt, - path::{Path, PathBuf}, - str::FromStr, -}; +mod cvs; +pub use cvs::*; -use miette::Diagnostic; -use semver::Version; -use serde::{Deserialize, Serialize}; -use thiserror::Error; -use tokio::fs; -use url::Url; - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CratesTomlRaw { - #[serde(default)] - pub v1: BTreeMap>, -} - -#[derive(Clone, Debug, Default)] -pub struct CratesToml(BTreeMap>); - -impl CratesToml { - pub fn default_path() -> Result { - Ok(home::cargo_home()?.join(".crates.toml")) - } - - pub async fn load() -> Result { - Self::load_from_path(Self::default_path()?).await - } - - pub async fn load_from_path(path: impl AsRef) -> Result { - let file = fs::read_to_string(path).await?; - Self::from_str(&file) - } - - pub fn insert(&mut self, cvs: CrateVersionSource, bins: impl Iterator) { - self.0.insert(cvs, bins.collect()); - } - - pub async fn write(&self) -> Result<(), CratesTomlParseError> { - self.write_to_path(Self::default_path()?).await - } - - pub async fn write_to_path(&self, path: impl AsRef) -> Result<(), CratesTomlParseError> { - let raw = CratesTomlRaw { - v1: self - .0 - .iter() - .map(|(cvs, bins)| (cvs.to_string(), bins.clone())) - .collect(), - }; - - fs::write(path, &toml::to_vec(&raw)?).await?; - Ok(()) - } -} - -impl FromStr for CratesToml { - type Err = CratesTomlParseError; - fn from_str(s: &str) -> Result { - let raw: CratesTomlRaw = toml::from_str(s).unwrap(); - - Ok(Self( - raw.v1 - .into_iter() - .map(|(name, bins)| CrateVersionSource::from_str(&name).map(|cvs| (cvs, bins))) - .collect::>()?, - )) - } -} - -#[derive(Debug, Diagnostic, Error)] -pub enum CratesTomlParseError { - #[error(transparent)] - Io(#[from] std::io::Error), - - #[error(transparent)] - TomlParse(#[from] toml::de::Error), - - #[error(transparent)] - TomlWrite(#[from] toml::ser::Error), - - #[error(transparent)] - CvsParse(#[from] CvsParseError), -} - -#[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq)] -pub struct CrateVersionSource { - pub name: String, - pub version: Version, - pub source: Source, -} - -#[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq)] -pub enum Source { - Git(Url), - Path(Url), - Registry(Url), -} - -impl FromStr for CrateVersionSource { - type Err = CvsParseError; - fn from_str(s: &str) -> Result { - match s.splitn(3, ' ').collect::>()[..] { - [name, version, source] => { - let version = version.parse()?; - let source = match source - .trim_matches(&['(', ')'][..]) - .splitn(2, '+') - .collect::>()[..] - { - ["git", url] => Source::Git(Url::parse(url)?), - ["path", url] => Source::Path(Url::parse(url)?), - ["registry", url] => Source::Registry(Url::parse(url)?), - [kind, arg] => { - return Err(CvsParseError::UnknownSourceType { - kind: kind.to_string(), - arg: arg.to_string(), - }) - } - _ => return Err(CvsParseError::BadSource), - }; - Ok(Self { - name: name.to_string(), - version, - source, - }) - } - _ => Err(CvsParseError::BadFormat), - } - } -} - -#[derive(Debug, Diagnostic, Error)] -pub enum CvsParseError { - #[error(transparent)] - UrlParse(#[from] url::ParseError), - - #[error(transparent)] - VersionParse(#[from] semver::Error), - - #[error("unknown source type {kind}+{arg}")] - UnknownSourceType { kind: String, arg: String }, - - #[error("bad source format")] - BadSource, - - #[error("bad CVS format")] - BadFormat, -} - -impl fmt::Display for CrateVersionSource { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let Self { - name, - version, - source, - } = &self; - write!(f, "{name} {version} ({source})") - } -} - -impl fmt::Display for Source { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - Source::Git(url) => write!(f, "git+{url}"), - Source::Path(url) => write!(f, "path+{url}"), - Source::Registry(url) => write!(f, "registry+{url}"), - } - } -} +pub mod v1; +pub mod v2; diff --git a/src/metafiles/cvs.rs b/src/metafiles/cvs.rs new file mode 100644 index 00000000..a111d02f --- /dev/null +++ b/src/metafiles/cvs.rs @@ -0,0 +1,111 @@ +use std::{fmt, str::FromStr}; + +use miette::Diagnostic; +use semver::Version; +use serde::{Deserialize, Deserializer, Serialize, Serializer}; +use thiserror::Error; +use url::Url; + +#[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq)] +pub struct CrateVersionSource { + pub name: String, + pub version: Version, + pub source: Source, +} + +#[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq)] +pub enum Source { + Git(Url), + Path(Url), + Registry(Url), +} + +impl FromStr for CrateVersionSource { + type Err = CvsParseError; + fn from_str(s: &str) -> Result { + match s.splitn(3, ' ').collect::>()[..] { + [name, version, source] => { + let version = version.parse()?; + let source = match source + .trim_matches(&['(', ')'][..]) + .splitn(2, '+') + .collect::>()[..] + { + ["git", url] => Source::Git(Url::parse(url)?), + ["path", url] => Source::Path(Url::parse(url)?), + ["registry", url] => Source::Registry(Url::parse(url)?), + [kind, arg] => { + return Err(CvsParseError::UnknownSourceType { + kind: kind.to_string(), + arg: arg.to_string(), + }) + } + _ => return Err(CvsParseError::BadSource), + }; + Ok(Self { + name: name.to_string(), + version, + source, + }) + } + _ => Err(CvsParseError::BadFormat), + } + } +} + +#[derive(Debug, Diagnostic, Error)] +pub enum CvsParseError { + #[error(transparent)] + UrlParse(#[from] url::ParseError), + + #[error(transparent)] + VersionParse(#[from] semver::Error), + + #[error("unknown source type {kind}+{arg}")] + UnknownSourceType { kind: String, arg: String }, + + #[error("bad source format")] + BadSource, + + #[error("bad CVS format")] + BadFormat, +} + +impl fmt::Display for CrateVersionSource { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let Self { + name, + version, + source, + } = &self; + write!(f, "{name} {version} ({source})") + } +} + +impl fmt::Display for Source { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + Source::Git(url) => write!(f, "git+{url}"), + Source::Path(url) => write!(f, "path+{url}"), + Source::Registry(url) => write!(f, "registry+{url}"), + } + } +} + +impl Serialize for CrateVersionSource { + fn serialize(&self, serializer: S) -> Result + where + S: Serializer, + { + serializer.serialize_str(&self.to_string()) + } +} + +impl<'de> Deserialize<'de> for CrateVersionSource { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + Self::from_str(&String::deserialize(deserializer)?).map_err(serde::de::Error::custom) + } +} diff --git a/src/metafiles/v1.rs b/src/metafiles/v1.rs new file mode 100644 index 00000000..1180814a --- /dev/null +++ b/src/metafiles/v1.rs @@ -0,0 +1,67 @@ +use std::{ + collections::{BTreeMap, BTreeSet}, + fs, + path::{Path, PathBuf}, + str::FromStr, +}; + +use miette::Diagnostic; +use serde::{Deserialize, Serialize}; +use thiserror::Error; + +use super::CrateVersionSource; + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CratesToml { + v1: BTreeMap>, +} + +impl CratesToml { + pub fn default_path() -> Result { + Ok(home::cargo_home()?.join(".crates.toml")) + } + + pub fn load() -> Result { + Self::load_from_path(Self::default_path()?) + } + + pub fn load_from_path(path: impl AsRef) -> Result { + let file = fs::read_to_string(path)?; + Self::from_str(&file) + } + + pub fn insert(&mut self, cvs: CrateVersionSource, bins: BTreeSet) { + self.v1.insert(cvs, bins); + } + + pub fn write(&self) -> Result<(), CratesTomlParseError> { + self.write_to_path(Self::default_path()?) + } + + pub fn write_to_path(&self, path: impl AsRef) -> Result<(), CratesTomlParseError> { + fs::write(path, &toml::to_vec(&self)?)?; + Ok(()) + } +} + +impl FromStr for CratesToml { + type Err = CratesTomlParseError; + fn from_str(s: &str) -> Result { + Ok(toml::from_str(s)?) + } +} + +#[derive(Debug, Diagnostic, Error)] +pub enum CratesTomlParseError { + #[error(transparent)] + Io(#[from] std::io::Error), + + #[error(transparent)] + TomlParse(#[from] toml::de::Error), + + #[error(transparent)] + TomlWrite(#[from] toml::ser::Error), + + #[error(transparent)] + CvsParse(#[from] super::CvsParseError), +} diff --git a/src/metafiles/v2.rs b/src/metafiles/v2.rs new file mode 100644 index 00000000..70c4e46e --- /dev/null +++ b/src/metafiles/v2.rs @@ -0,0 +1,78 @@ +use std::{ + collections::{BTreeMap, BTreeSet}, + fs, + path::{Path, PathBuf}, +}; + +use miette::Diagnostic; +use serde::{Deserialize, Serialize}; +use thiserror::Error; + +use super::CrateVersionSource; + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct Crates2Json { + pub installs: BTreeMap, +} + +#[derive(Clone, Debug, Default, Deserialize, Serialize)] +pub struct CrateInfo { + #[serde(default)] + pub version_req: Option, + + #[serde(default)] + pub bins: BTreeSet, + + #[serde(default)] + pub features: BTreeSet, + + #[serde(default)] + pub all_features: bool, + + #[serde(default)] + pub no_default_features: bool, + + pub profile: String, + pub target: String, + pub rustc: String, +} + +impl Crates2Json { + pub fn default_path() -> Result { + Ok(home::cargo_home()?.join(".crates2.json")) + } + + pub fn load() -> Result { + Self::load_from_path(Self::default_path()?) + } + + pub fn load_from_path(path: impl AsRef) -> Result { + let file = fs::read_to_string(path)?; + Ok(serde_json::from_str(&file)?) + } + + pub fn insert(&mut self, cvs: CrateVersionSource, info: CrateInfo) { + self.installs.insert(cvs, info); + } + + pub fn write(&self) -> Result<(), Crates2JsonParseError> { + self.write_to_path(Self::default_path()?) + } + + pub fn write_to_path(&self, path: impl AsRef) -> Result<(), Crates2JsonParseError> { + fs::write(path, &serde_json::to_vec(&self)?)?; + Ok(()) + } +} + +#[derive(Debug, Diagnostic, Error)] +pub enum Crates2JsonParseError { + #[error(transparent)] + Io(#[from] std::io::Error), + + #[error(transparent)] + Json(#[from] serde_json::Error), + + #[error(transparent)] + CvsParse(#[from] super::CvsParseError), +} From 68ba9b06f5252d4baabd7a8a7cf326af4e5fb3f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 5 Jul 2022 21:46:58 +1200 Subject: [PATCH 0369/2020] Create meta files if not present --- src/main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 4b331aa4..5a155bad 100644 --- a/src/main.rs +++ b/src/main.rs @@ -486,14 +486,16 @@ async fn install_from_package( let bins: BTreeSet = bin_files.iter().map(|bin| bin.base_name.clone()).collect(); - debug!("Writing .crates.toml"); - if let Ok(mut c1) = metafiles::v1::CratesToml::load() { + { + debug!("Writing .crates.toml"); + let mut c1 = metafiles::v1::CratesToml::load().unwrap_or_default(); c1.insert(cvs.clone(), bins.clone()); c1.write()?; } - debug!("Writing .crates2.json"); - if let Ok(mut c2) = metafiles::v2::Crates2Json::load() { + { + debug!("Writing .crates2.json"); + let mut c2 = metafiles::v2::Crates2Json::load().unwrap_or_default(); c2.insert( cvs.clone(), metafiles::v2::CrateInfo { From a4663f46ee673dce98b85056d834abb378948b7a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Jul 2022 09:53:24 +0000 Subject: [PATCH 0370/2020] Bump semver from 1.0.10 to 1.0.12 Bumps [semver](https://github.com/dtolnay/semver) from 1.0.10 to 1.0.12. - [Release notes](https://github.com/dtolnay/semver/releases) - [Commits](https://github.com/dtolnay/semver/compare/1.0.10...1.0.12) --- updated-dependencies: - dependency-name: semver dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9fad27a6..3733c777 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1179,9 +1179,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.10" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41d061efea015927ac527063765e73601444cdc344ba855bc7bd44578b25e1c" +checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" [[package]] name = "serde" diff --git a/Cargo.toml b/Cargo.toml index 3edf878c..c5da703e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ miette = { version = "5.1.0", features = ["fancy-no-backtrace"] } once_cell = "1.12.0" reqwest = { version = "0.11.11", features = ["rustls-tls", "stream"], default-features = false } scopeguard = "1.1.0" -semver = "1.0.10" +semver = "1.0.12" serde = { version = "1.0.136", features = ["derive"] } serde_json = "1.0.82" simplelog = "0.12.0" From 50b436100e2a1e1a16f64727f82b85da54085d2d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 1 Jul 2022 00:03:43 +1000 Subject: [PATCH 0371/2020] Reuse `Client` everywhere instead of recreate one which pools the connection to the same site (github.com). This commit also sets `USER_AGENT` so that quickinstall can reuse it. Signed-off-by: Jiahao XU --- src/fetchers/quickinstall.rs | 9 ++------- src/helpers.rs | 11 +++++++---- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index 120dd6cb..50076394 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -7,13 +7,10 @@ use tokio::task::JoinHandle; use url::Url; use super::Data; -use crate::{ - download_and_extract, new_reqwest_client_builder, remote_exists, BinstallError, PkgFmt, -}; +use crate::{download_and_extract, new_reqwest_client, remote_exists, BinstallError, PkgFmt}; const BASE_URL: &str = "https://github.com/alsuren/cargo-quickinstall/releases/download"; const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; -const USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")); pub struct QuickInstall { package: String, @@ -91,9 +88,7 @@ impl QuickInstall { let url = Url::parse(&stats_url)?; debug!("Sending installation report to quickinstall ({url})"); - new_reqwest_client_builder() - .user_agent(USER_AGENT) - .build()? + new_reqwest_client()? .request(Method::HEAD, url.clone()) .send() .await diff --git a/src/helpers.rs b/src/helpers.rs index d48e97b6..04a8473b 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -59,8 +59,10 @@ pub fn load_manifest_path>( }) } -pub fn new_reqwest_client_builder() -> ClientBuilder { - let mut builder = ClientBuilder::new(); +fn new_reqwest_client_builder() -> ClientBuilder { + const USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")); + + let mut builder = ClientBuilder::new().user_agent(USER_AGENT); if let Some(ReqwestConfig { secure, min_tls }) = REQWESTGLOBALCONFIG.get() { if *secure { @@ -77,8 +79,9 @@ pub fn new_reqwest_client_builder() -> ClientBuilder { builder } -pub fn new_reqwest_client() -> reqwest::Result { - new_reqwest_client_builder().build() +pub fn new_reqwest_client() -> reqwest::Result<&'static Client> { + static CLIENT: OnceCell = OnceCell::new(); + CLIENT.get_or_try_init(|| new_reqwest_client_builder().build()) } pub async fn remote_exists(url: Url, method: Method) -> Result { From 6582eefd25865aa15fb2b65e98764c2c9ed3df62 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 1 Jul 2022 00:14:50 +1000 Subject: [PATCH 0372/2020] Refactor: Replace `REQWESTCONFIG` with `initialize_reqwest_client` so that we don't need two `OnceCell`s. Signed-off-by: Jiahao XU --- src/fetchers/quickinstall.rs | 2 +- src/helpers.rs | 52 ++++++++++++++++++------------------ src/main.rs | 9 ++----- 3 files changed, 29 insertions(+), 34 deletions(-) diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index 50076394..3cb07fd8 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -88,7 +88,7 @@ impl QuickInstall { let url = Url::parse(&stats_url)?; debug!("Sending installation report to quickinstall ({url})"); - new_reqwest_client()? + new_reqwest_client() .request(Method::HEAD, url.clone()) .send() .await diff --git a/src/helpers.rs b/src/helpers.rs index 04a8473b..57091807 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -35,15 +35,6 @@ pub use path_ext::*; mod tls_version; pub use tls_version::TLSVersion; -#[derive(Debug)] -pub struct ReqwestConfig { - pub secure: bool, - pub min_tls: Option, -} - -/// (secure mode, min TLS version) -pub static REQWESTGLOBALCONFIG: OnceCell = OnceCell::new(); - /// Load binstall metadata from the crate `Cargo.toml` at the provided path pub fn load_manifest_path>( manifest_path: P, @@ -59,33 +50,42 @@ pub fn load_manifest_path>( }) } -fn new_reqwest_client_builder() -> ClientBuilder { +static CLIENT: OnceCell = OnceCell::new(); + +/// Should only be called once in main::entry. +pub fn initialize_reqwest_client( + secure: bool, + min_tls: Option, +) -> Result<(), BinstallError> { const USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")); let mut builder = ClientBuilder::new().user_agent(USER_AGENT); - if let Some(ReqwestConfig { secure, min_tls }) = REQWESTGLOBALCONFIG.get() { - if *secure { - builder = builder - .https_only(true) - .min_tls_version(tls::Version::TLS_1_2) - } - - if let Some(ver) = *min_tls { - builder = builder.min_tls_version(ver); - } + if secure { + builder = builder + .https_only(true) + .min_tls_version(tls::Version::TLS_1_2); } - builder + if let Some(ver) = min_tls { + builder = builder.min_tls_version(ver); + } + + let client = builder.build()?; + + CLIENT + .set(client) + .expect("Reqwest client already initialized"); + + Ok(()) } -pub fn new_reqwest_client() -> reqwest::Result<&'static Client> { - static CLIENT: OnceCell = OnceCell::new(); - CLIENT.get_or_try_init(|| new_reqwest_client_builder().build()) +pub fn new_reqwest_client() -> &'static Client { + CLIENT.get().expect("Reqwest client is not initialized") } pub async fn remote_exists(url: Url, method: Method) -> Result { - let req = new_reqwest_client()? + let req = new_reqwest_client() .request(method.clone(), url.clone()) .send() .await @@ -98,7 +98,7 @@ async fn create_request( ) -> Result>, BinstallError> { debug!("Downloading from: '{url}'"); - new_reqwest_client()? + new_reqwest_client() .get(url.clone()) .send() .await diff --git a/src/main.rs b/src/main.rs index 5a155bad..506cc478 100644 --- a/src/main.rs +++ b/src/main.rs @@ -200,13 +200,8 @@ async fn entry() -> Result<()> { bin_dir: opts.bin_dir.take(), }; - // Initialize REQWESTGLOBALCONFIG - REQWESTGLOBALCONFIG - .set(ReqwestConfig { - secure: opts.secure, - min_tls: opts.min_tls_version.map(|v| v.into()), - }) - .unwrap(); + // Initialize reqwest client + initialize_reqwest_client(opts.secure, opts.min_tls_version.map(|v| v.into()))?; // Setup logging let mut log_config = ConfigBuilder::new(); From 5ad572fa422d52396b030163096dda89df7ed261 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 1 Jul 2022 00:15:54 +1000 Subject: [PATCH 0373/2020] Rename `new_reqwest_client` > `get_reqwest_client` Signed-off-by: Jiahao XU --- src/fetchers/quickinstall.rs | 4 ++-- src/helpers.rs | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index 3cb07fd8..591bb6dc 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -7,7 +7,7 @@ use tokio::task::JoinHandle; use url::Url; use super::Data; -use crate::{download_and_extract, new_reqwest_client, remote_exists, BinstallError, PkgFmt}; +use crate::{download_and_extract, get_reqwest_client, remote_exists, BinstallError, PkgFmt}; const BASE_URL: &str = "https://github.com/alsuren/cargo-quickinstall/releases/download"; const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; @@ -88,7 +88,7 @@ impl QuickInstall { let url = Url::parse(&stats_url)?; debug!("Sending installation report to quickinstall ({url})"); - new_reqwest_client() + get_reqwest_client() .request(Method::HEAD, url.clone()) .send() .await diff --git a/src/helpers.rs b/src/helpers.rs index 57091807..73a553bd 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -80,12 +80,12 @@ pub fn initialize_reqwest_client( Ok(()) } -pub fn new_reqwest_client() -> &'static Client { +pub fn get_reqwest_client() -> &'static Client { CLIENT.get().expect("Reqwest client is not initialized") } pub async fn remote_exists(url: Url, method: Method) -> Result { - let req = new_reqwest_client() + let req = get_reqwest_client() .request(method.clone(), url.clone()) .send() .await @@ -98,7 +98,7 @@ async fn create_request( ) -> Result>, BinstallError> { debug!("Downloading from: '{url}'"); - new_reqwest_client() + get_reqwest_client() .get(url.clone()) .send() .await From 38ce26d0c4b5ff4fb87e58b8c18f9c8a68bb1821 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 5 Jul 2022 22:17:10 +1200 Subject: [PATCH 0374/2020] Remame workflows for clarity --- .github/workflows/{rust.yml => build-and-integration-tests.yml} | 2 +- .github/workflows/{ci.yml => unit-tests.yml} | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename .github/workflows/{rust.yml => build-and-integration-tests.yml} (99%) rename .github/workflows/{ci.yml => unit-tests.yml} (97%) diff --git a/.github/workflows/rust.yml b/.github/workflows/build-and-integration-tests.yml similarity index 99% rename from .github/workflows/rust.yml rename to .github/workflows/build-and-integration-tests.yml index 1c84c5c3..394fc546 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -1,4 +1,4 @@ -name: Rust +name: Build and integration tests on: push: diff --git a/.github/workflows/ci.yml b/.github/workflows/unit-tests.yml similarity index 97% rename from .github/workflows/ci.yml rename to .github/workflows/unit-tests.yml index a74ae2c7..51930365 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/unit-tests.yml @@ -1,4 +1,4 @@ -name: Rust +name: Unit tests on: push: From 6a127bab86d5569c7c463a49d40af84c36fa4ee7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 5 Jul 2022 22:18:50 +1200 Subject: [PATCH 0375/2020] =?UTF-8?q?Don=E2=80=99t=20double=20up=20unit=20?= =?UTF-8?q?tests=20on=20PRs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/unit-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 51930365..b8bad484 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -2,6 +2,7 @@ name: Unit tests on: push: + branches: [ main ] pull_request: env: From efe04be5a5d2de6ca246a019420bdb753f10d30d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Jul 2022 10:29:38 +0000 Subject: [PATCH 0376/2020] Bump serde from 1.0.137 to 1.0.138 Bumps [serde](https://github.com/serde-rs/serde) from 1.0.137 to 1.0.138. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.137...v1.0.138) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 57cd98ed..81285366 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1185,18 +1185,18 @@ checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" [[package]] name = "serde" -version = "1.0.137" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" +checksum = "1578c6245786b9d168c5447eeacfb96856573ca56c9d68fdcf394be134882a47" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.137" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" +checksum = "023e9b1467aef8a10fb88f25611870ada9800ef7e22afce356bb0d2387b6f27c" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index c2c75e80..adf70b3f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,7 @@ once_cell = "1.12.0" reqwest = { version = "0.11.11", features = ["rustls-tls", "stream"], default-features = false } scopeguard = "1.1.0" semver = "1.0.12" -serde = { version = "1.0.136", features = ["derive"] } +serde = { version = "1.0.138", features = ["derive"] } serde_json = "1.0.82" simplelog = "0.12.0" strum = "0.24.1" From 3348d3d7a26084bf2b5df66a15dea04bff69c3e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 5 Jul 2022 22:46:43 +1200 Subject: [PATCH 0377/2020] (cargo-release) version 0.10.0 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81285366..2ac84473 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -130,7 +130,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.9.2" +version = "0.10.0" dependencies = [ "async-trait", "bytes", diff --git a/Cargo.toml b/Cargo.toml index adf70b3f..a4fe8f59 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/ryankurte/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.9.2" +version = "0.10.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From fe724585ae01abb2f83cdf912b181d562a916bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Tue, 5 Jul 2022 23:10:57 +1200 Subject: [PATCH 0378/2020] Use mimalloc on windows --- Cargo.toml | 3 +++ src/main.rs | 4 ++++ 2 files changed, 7 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index a4fe8f59..09282d9c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,6 +68,9 @@ zstd = { version = "0.10.0", features = ["bindgen", "zstdmt"], default-features [target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] guess_host_triple = "0.1.3" +[target.'cfg(windows)'.dependencies] +mimalloc = "0.1.29" + [dev-dependencies] env_logger = "0.9.0" diff --git a/src/main.rs b/src/main.rs index 506cc478..7a02617e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,6 +25,10 @@ use cargo_binstall::{ *, }; +#[cfg(windows)] +#[global_allocator] +static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; + #[derive(Debug, Parser)] #[clap(version, about = "Install a Rust binary... from binaries!")] struct Options { From 57c6125fc1008b6fe516ca9ab0de8bb465d3b127 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Tue, 5 Jul 2022 23:56:30 +1200 Subject: [PATCH 0379/2020] Update Cargo.toml Co-authored-by: Jiahao XU --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 09282d9c..89e2e47b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,7 +69,7 @@ zstd = { version = "0.10.0", features = ["bindgen", "zstdmt"], default-features guess_host_triple = "0.1.3" [target.'cfg(windows)'.dependencies] -mimalloc = "0.1.29" +mimalloc = { version = "0.1.29", default-features = false} [dev-dependencies] env_logger = "0.9.0" From e66dc60867758bc7468a9baa001f56b0b663be04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 6 Jul 2022 00:32:13 +1200 Subject: [PATCH 0380/2020] Also use mimalloc on musl --- Cargo.lock | 19 +++++++++++++++++++ Cargo.toml | 8 ++++++-- src/main.rs | 2 +- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2ac84473..7dfe4034 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -146,6 +146,7 @@ dependencies = [ "home", "log", "miette", + "mimalloc", "once_cell", "reqwest", "scopeguard", @@ -778,6 +779,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "libmimalloc-sys" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11ca136052550448f55df7898c6dbe651c6b574fe38a0d9ea687a9f8088a2e2c" +dependencies = [ + "cc", +] + [[package]] name = "libz-ng-sys" version = "1.1.8" @@ -850,6 +860,15 @@ dependencies = [ "syn", ] +[[package]] +name = "mimalloc" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f64ad83c969af2e732e907564deb0d0ed393cec4af80776f77dd77a1a427698" +dependencies = [ + "libmimalloc-sys", +] + [[package]] name = "mime" version = "0.3.16" diff --git a/Cargo.toml b/Cargo.toml index 89e2e47b..66fb5592 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,8 +68,12 @@ zstd = { version = "0.10.0", features = ["bindgen", "zstdmt"], default-features [target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] guess_host_triple = "0.1.3" -[target.'cfg(windows)'.dependencies] -mimalloc = { version = "0.1.29", default-features = false} +[target.'cfg(any(windows, target_env = "musl"))'.dependencies] +mimalloc = { version = "0.1.29", default-features = false, optional = true } + +[features] +default = [] +mimalloc = ["dep:mimalloc"] [dev-dependencies] env_logger = "0.9.0" diff --git a/src/main.rs b/src/main.rs index 7a02617e..882e90f4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,7 +25,7 @@ use cargo_binstall::{ *, }; -#[cfg(windows)] +#[cfg(all(feature = "mimalloc", any(windows, target_env = "musl")))] #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; From 63afa5b7911bbd178e62bc6f2258048ea8087bfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fe=CC=81lix=20Saparelli?= Date: Wed, 6 Jul 2022 23:33:51 +1200 Subject: [PATCH 0381/2020] Just hide mimalloc behind a feature, available for all platforms --- Cargo.toml | 4 +--- src/main.rs | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 66fb5592..3a063dce 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,7 @@ futures-util = { version = "0.3.21", default-features = false } home = "0.5.3" log = "0.4.14" miette = { version = "5.1.0", features = ["fancy-no-backtrace"] } +mimalloc = { version = "0.1.29", default-features = false, optional = true } once_cell = "1.12.0" reqwest = { version = "0.11.11", features = ["rustls-tls", "stream"], default-features = false } scopeguard = "1.1.0" @@ -68,9 +69,6 @@ zstd = { version = "0.10.0", features = ["bindgen", "zstdmt"], default-features [target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] guess_host_triple = "0.1.3" -[target.'cfg(any(windows, target_env = "musl"))'.dependencies] -mimalloc = { version = "0.1.29", default-features = false, optional = true } - [features] default = [] mimalloc = ["dep:mimalloc"] diff --git a/src/main.rs b/src/main.rs index 882e90f4..75bfc1be 100644 --- a/src/main.rs +++ b/src/main.rs @@ -25,7 +25,7 @@ use cargo_binstall::{ *, }; -#[cfg(all(feature = "mimalloc", any(windows, target_env = "musl")))] +#[cfg(feature = "mimalloc")] #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; From fa63dbe5cf67ff4f2a7fca0e6bac4ccef09db135 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 10 Jul 2022 18:07:07 +1000 Subject: [PATCH 0382/2020] Refactor: Rm global var `helpers::CLIENT` Signed-off-by: Jiahao XU --- src/drivers/crates_io.rs | 3 +++ src/fetchers.rs | 3 ++- src/fetchers/gh_crate_meta.rs | 13 ++++++++---- src/fetchers/quickinstall.rs | 14 ++++++++----- src/helpers.rs | 37 ++++++++++++++--------------------- src/main.rs | 8 ++++---- 6 files changed, 42 insertions(+), 36 deletions(-) diff --git a/src/drivers/crates_io.rs b/src/drivers/crates_io.rs index fa1a8063..a389f5d1 100644 --- a/src/drivers/crates_io.rs +++ b/src/drivers/crates_io.rs @@ -4,6 +4,7 @@ use std::time::Duration; use cargo_toml::Manifest; use crates_io_api::AsyncClient; use log::debug; +use reqwest::Client; use url::Url; use super::find_version; @@ -16,6 +17,7 @@ use visitor::ManifestVisitor; /// Fetch a crate Cargo.toml by name and version from crates.io pub async fn fetch_crate_cratesio( + client: &Client, name: &str, version_req: &str, ) -> Result, BinstallError> { @@ -67,6 +69,7 @@ pub async fn fetch_crate_cratesio( let manifest_dir_path: PathBuf = format!("{name}-{version_name}").into(); download_tar_based_and_visit( + client, Url::parse(&crate_url)?, TarBasedFmt::Tgz, ManifestVisitor::new(manifest_dir_path), diff --git a/src/fetchers.rs b/src/fetchers.rs index a39a0e9a..237a2b85 100644 --- a/src/fetchers.rs +++ b/src/fetchers.rs @@ -4,6 +4,7 @@ use std::sync::Arc; pub use gh_crate_meta::*; pub use log::debug; pub use quickinstall::*; +use reqwest::Client; use crate::{AutoAbortJoinHandle, BinstallError, PkgFmt, PkgMeta}; @@ -13,7 +14,7 @@ mod quickinstall; #[async_trait::async_trait] pub trait Fetcher: Send + Sync { /// Create a new fetcher from some data - async fn new(data: &Data) -> Arc + async fn new(client: &Client, data: &Data) -> Arc where Self: Sized; diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index 82bdf3bc..f2d96c2e 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -2,6 +2,7 @@ use std::path::Path; use std::sync::Arc; use log::{debug, info, warn}; +use reqwest::Client; use reqwest::Method; use serde::Serialize; use url::Url; @@ -10,6 +11,7 @@ use super::Data; use crate::{download_and_extract, remote_exists, BinstallError, PkgFmt, Template}; pub struct GhCrateMeta { + client: Client, data: Data, } @@ -23,8 +25,11 @@ impl GhCrateMeta { #[async_trait::async_trait] impl super::Fetcher for GhCrateMeta { - async fn new(data: &Data) -> Arc { - Arc::new(Self { data: data.clone() }) + async fn new(client: &Client, data: &Data) -> Arc { + Arc::new(Self { + client: client.clone(), + data: data.clone(), + }) } async fn check(&self) -> Result { @@ -37,13 +42,13 @@ impl super::Fetcher for GhCrateMeta { } info!("Checking for package at: '{url}'"); - remote_exists(url, Method::HEAD).await + remote_exists(&self.client, url, Method::HEAD).await } async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { let url = self.url()?; info!("Downloading package from: '{url}'"); - download_and_extract(url, self.pkg_fmt(), dst).await + download_and_extract(&self.client, url, self.pkg_fmt(), dst).await } fn pkg_fmt(&self) -> PkgFmt { diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index 591bb6dc..23c520b9 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -2,28 +2,31 @@ use std::path::Path; use std::sync::Arc; use log::{debug, info}; +use reqwest::Client; use reqwest::Method; use tokio::task::JoinHandle; use url::Url; use super::Data; -use crate::{download_and_extract, get_reqwest_client, remote_exists, BinstallError, PkgFmt}; +use crate::{download_and_extract, remote_exists, BinstallError, PkgFmt}; const BASE_URL: &str = "https://github.com/alsuren/cargo-quickinstall/releases/download"; const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; pub struct QuickInstall { + client: Client, package: String, target: String, } #[async_trait::async_trait] impl super::Fetcher for QuickInstall { - async fn new(data: &Data) -> Arc { + async fn new(client: &Client, data: &Data) -> Arc { let crate_name = &data.name; let version = &data.version; let target = data.target.clone(); Arc::new(Self { + client: client.clone(), package: format!("{crate_name}-{version}-{target}"), target, }) @@ -33,13 +36,13 @@ impl super::Fetcher for QuickInstall { let url = self.package_url(); self.report(); info!("Checking for package at: '{url}'"); - remote_exists(Url::parse(&url)?, Method::HEAD).await + remote_exists(&self.client, Url::parse(&url)?, Method::HEAD).await } async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { let url = self.package_url(); info!("Downloading package from: '{url}'"); - download_and_extract(Url::parse(&url)?, self.pkg_fmt(), dst).await + download_and_extract(&self.client, Url::parse(&url)?, self.pkg_fmt(), dst).await } fn pkg_fmt(&self) -> PkgFmt { @@ -78,6 +81,7 @@ impl QuickInstall { pub fn report(&self) -> JoinHandle> { let stats_url = self.stats_url(); + let client = self.client.clone(); tokio::spawn(async move { if cfg!(debug_assertions) { @@ -88,7 +92,7 @@ impl QuickInstall { let url = Url::parse(&stats_url)?; debug!("Sending installation report to quickinstall ({url})"); - get_reqwest_client() + client .request(Method::HEAD, url.clone()) .send() .await diff --git a/src/helpers.rs b/src/helpers.rs index 73a553bd..b7614e2f 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -7,7 +7,6 @@ use bytes::Bytes; use cargo_toml::Manifest; use futures_util::stream::Stream; use log::debug; -use once_cell::sync::OnceCell; use reqwest::{tls, Client, ClientBuilder, Method, Response}; use serde::Serialize; use tempfile::NamedTempFile; @@ -50,13 +49,10 @@ pub fn load_manifest_path>( }) } -static CLIENT: OnceCell = OnceCell::new(); - -/// Should only be called once in main::entry. -pub fn initialize_reqwest_client( +pub fn create_reqwest_client( secure: bool, min_tls: Option, -) -> Result<(), BinstallError> { +) -> Result { const USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")); let mut builder = ClientBuilder::new().user_agent(USER_AGENT); @@ -71,21 +67,15 @@ pub fn initialize_reqwest_client( builder = builder.min_tls_version(ver); } - let client = builder.build()?; - - CLIENT - .set(client) - .expect("Reqwest client already initialized"); - - Ok(()) + Ok(builder.build()?) } -pub fn get_reqwest_client() -> &'static Client { - CLIENT.get().expect("Reqwest client is not initialized") -} - -pub async fn remote_exists(url: Url, method: Method) -> Result { - let req = get_reqwest_client() +pub async fn remote_exists( + client: &Client, + url: Url, + method: Method, +) -> Result { + let req = client .request(method.clone(), url.clone()) .send() .await @@ -94,11 +84,12 @@ pub async fn remote_exists(url: Url, method: Method) -> Result Result>, BinstallError> { debug!("Downloading from: '{url}'"); - get_reqwest_client() + client .get(url.clone()) .send() .await @@ -113,11 +104,12 @@ async fn create_request( /// Download a file from the provided URL and extract it to the provided path. pub async fn download_and_extract>( + client: &Client, url: Url, fmt: PkgFmt, path: P, ) -> Result<(), BinstallError> { - let stream = create_request(url).await?; + let stream = create_request(client, url).await?; let path = path.as_ref(); debug!("Downloading and extracting to: '{}'", path.display()); @@ -139,11 +131,12 @@ pub async fn download_and_extract>( /// * `filter` - If Some, then it will pass the path of the file to it /// and only extract ones which filter returns `true`. pub async fn download_tar_based_and_visit( + client: &Client, url: Url, fmt: TarBasedFmt, visitor: V, ) -> Result { - let stream = create_request(url).await?; + let stream = create_request(client, url).await?; debug!("Downloading and extracting then in-memory processing"); diff --git a/src/main.rs b/src/main.rs index 75bfc1be..2da123a4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -205,7 +205,7 @@ async fn entry() -> Result<()> { }; // Initialize reqwest client - initialize_reqwest_client(opts.secure, opts.min_tls_version.map(|v| v.into()))?; + let client = create_reqwest_client(opts.secure, opts.min_tls_version.map(|v| v.into()))?; // Setup logging let mut log_config = ConfigBuilder::new(); @@ -244,7 +244,7 @@ async fn entry() -> Result<()> { // TODO: support git-based fetches (whole repo name rather than just crate name) let manifest = match opts.manifest_path.clone() { Some(manifest_path) => load_manifest_path(manifest_path.join("Cargo.toml"))?, - None => fetch_crate_cratesio(&opts.name, &opts.version).await?, + None => fetch_crate_cratesio(&client, &opts.name, &opts.version).await?, }; let package = manifest.package.unwrap(); @@ -298,8 +298,8 @@ async fn entry() -> Result<()> { meta: target_meta, }; - fetchers.add(GhCrateMeta::new(&fetcher_data).await); - fetchers.add(QuickInstall::new(&fetcher_data).await); + fetchers.add(GhCrateMeta::new(&client, &fetcher_data).await); + fetchers.add(QuickInstall::new(&client, &fetcher_data).await); } match fetchers.first_available().await { From aa466750b7afbafad018178b4b7f232364e08511 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 10 Jul 2022 18:08:07 +1000 Subject: [PATCH 0383/2020] Rm unused dep `once_cell` Signed-off-by: Jiahao XU --- Cargo.lock | 1 - Cargo.toml | 1 - 2 files changed, 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7dfe4034..dbd4f5db 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -147,7 +147,6 @@ dependencies = [ "log", "miette", "mimalloc", - "once_cell", "reqwest", "scopeguard", "semver", diff --git a/Cargo.toml b/Cargo.toml index 3a063dce..b8ca6578 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,6 @@ home = "0.5.3" log = "0.4.14" miette = { version = "5.1.0", features = ["fancy-no-backtrace"] } mimalloc = { version = "0.1.29", default-features = false, optional = true } -once_cell = "1.12.0" reqwest = { version = "0.11.11", features = ["rustls-tls", "stream"], default-features = false } scopeguard = "1.1.0" semver = "1.0.12" From d1fe2acfdd0ce54d4b11a2990c2834837fe8510d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 11 Jul 2022 01:44:00 +0000 Subject: [PATCH 0384/2020] Bump miette from 5.1.0 to 5.1.1 Bumps [miette](https://github.com/zkat/miette) from 5.1.0 to 5.1.1. - [Release notes](https://github.com/zkat/miette/releases) - [Changelog](https://github.com/zkat/miette/blob/main/CHANGELOG.md) - [Commits](https://github.com/zkat/miette/compare/miette-derive-v5.1.0...miette-derive-v5.1.1) --- updated-dependencies: - dependency-name: miette dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dbd4f5db..97d840dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -831,9 +831,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "miette" -version = "5.1.0" +version = "5.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ec753a43fd71bb5f28751c9ec17fbe89d6d26ca8282d1e1f82f5ac3dbd5581e" +checksum = "89d67f6972a70e33dbb5551875c6a3e46ae0a7cddd4661a2811ee48be51054e9" dependencies = [ "atty", "miette-derive", @@ -850,9 +850,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.1.0" +version = "5.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdfc33ea15c5446600f91d319299dd40301614afff7143cdfa9bf4c09da3ca64" +checksum = "426594bc7266dedee4d687cdaebc121c74c52a667e4ce933c83694ad035990a6" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index b8ca6578..d332d408 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -30,7 +30,7 @@ flate2 = { version = "1.0.24", features = ["zlib-ng"], default-features = false futures-util = { version = "0.3.21", default-features = false } home = "0.5.3" log = "0.4.14" -miette = { version = "5.1.0", features = ["fancy-no-backtrace"] } +miette = { version = "5.1.1", features = ["fancy-no-backtrace"] } mimalloc = { version = "0.1.29", default-features = false, optional = true } reqwest = { version = "0.11.11", features = ["rustls-tls", "stream"], default-features = false } scopeguard = "1.1.0" From 7a85cae859c9d935abf34ddea14c023cea557598 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 11 Jul 2022 21:49:28 +1000 Subject: [PATCH 0385/2020] Refactor: Mv confirm into `entry` and remove unncessary confirm Signed-off-by: Jiahao XU --- src/main.rs | 150 ++++++++++++++++++++++++++-------------------------- 1 file changed, 74 insertions(+), 76 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2da123a4..645fcfb2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,13 +1,13 @@ use std::{ collections::BTreeSet, ffi::OsString, - path::PathBuf, + path::{Path, PathBuf}, process::{ExitCode, Termination}, str::FromStr, time::{Duration, Instant}, }; -use cargo_toml::{Package, Product}; +use cargo_toml::Package; use clap::Parser; use log::{debug, error, info, warn, LevelFilter}; use miette::{miette, IntoDiagnostic, Result, WrapErr}; @@ -311,20 +311,83 @@ async fn entry() -> Result<()> { } meta.merge(&cli_overrides); + // Update meta + if fetcher.source_name() == "QuickInstall" { + // TODO: less of a hack? + meta.bin_dir = "{ bin }{ binary-ext }".to_string(); + } + + // Check binaries + if binaries.is_empty() { + error!("No binaries specified (or inferred from file system)"); + return Err(miette!( + "No binaries specified (or inferred from file system)" + )); + } + + // Generate temporary binary path + let bin_path = temp_dir.path().join(format!("bin-{}", opts.name)); + debug!("Using temporary binary path: {}", bin_path.display()); + + // List files to be installed + // based on those found via Cargo.toml + let bin_data = bins::Data { + name: package.name.clone(), + target: fetcher.target().to_string(), + version: package.version.clone(), + repo: package.repository.clone(), + meta, + bin_path, + install_path, + }; + + // Create bin_files + let bin_files = binaries + .iter() + .map(|p| bins::BinFile::from_product(&bin_data, p)) + .collect::, BinstallError>>()?; + + // Prompt user for confirmation debug!( "Found a binary install source: {} ({fetcher_target})", fetcher.source_name() ); + if fetcher.is_third_party() { + warn!( + "The package will be downloaded from third-party source {}", + fetcher.source_name() + ); + } else { + info!( + "The package will be downloaded from {}", + fetcher.source_name() + ); + } + + info!("This will install the following binaries:"); + for file in &bin_files { + info!(" - {}", file.preview_bin()); + } + + if !opts.no_symlinks { + info!("And create (or update) the following symlinks:"); + for file in &bin_files { + info!(" - {}", file.preview_link()); + } + } + + if !opts.dry_run { + uithread.confirm().await?; + } + install_from_package( - binaries, fetcher.as_ref(), - install_path, - meta, opts, package, temp_dir, - &mut uithread, + &bin_data.bin_path, + &bin_files, ) .await } @@ -346,51 +409,18 @@ async fn entry() -> Result<()> { #[allow(clippy::too_many_arguments)] async fn install_from_package( - binaries: Vec, fetcher: &dyn Fetcher, - install_path: PathBuf, - mut meta: PkgMeta, opts: Options, package: Package, temp_dir: TempDir, - uithread: &mut UIThread, + bin_path: &Path, + bin_files: &[bins::BinFile], ) -> Result<()> { - // Prompt user for third-party source - if fetcher.is_third_party() { - warn!( - "The package will be downloaded from third-party source {}", - fetcher.source_name() - ); - if !opts.dry_run { - uithread.confirm().await?; - } - } else { - info!( - "The package will be downloaded from {}", - fetcher.source_name() - ); - } - - if fetcher.source_name() == "QuickInstall" { - // TODO: less of a hack? - meta.bin_dir = "{ bin }{ binary-ext }".to_string(); - } - - let bin_path = temp_dir.path().join(format!("bin-{}", opts.name)); - debug!("Using temporary binary path: {}", bin_path.display()); - // Download package if opts.dry_run { info!("Dry run, not downloading package"); } else { - fetcher.fetch_and_extract(&bin_path).await?; - - if binaries.is_empty() { - error!("No binaries specified (or inferred from file system)"); - return Err(miette!( - "No binaries specified (or inferred from file system)" - )); - } + fetcher.fetch_and_extract(bin_path).await?; } #[cfg(incomplete)] @@ -417,43 +447,11 @@ async fn install_from_package( } } - // List files to be installed - // based on those found via Cargo.toml - let bin_data = bins::Data { - name: package.name.clone(), - target: fetcher.target().to_string(), - version: package.version.clone(), - repo: package.repository.clone(), - meta, - bin_path, - install_path, - }; - - let bin_files = binaries - .iter() - .map(|p| bins::BinFile::from_product(&bin_data, p)) - .collect::, BinstallError>>()?; - - // Prompt user for confirmation - info!("This will install the following binaries:"); - for file in &bin_files { - info!(" - {}", file.preview_bin()); - } - - if !opts.no_symlinks { - info!("And create (or update) the following symlinks:"); - for file in &bin_files { - info!(" - {}", file.preview_link()); - } - } - if opts.dry_run { info!("Dry run, not proceeding"); return Ok(()); } - uithread.confirm().await?; - let cvs = metafiles::CrateVersionSource { name: opts.name, version: package.version.parse().into_diagnostic()?, @@ -464,13 +462,13 @@ async fn install_from_package( info!("Installing binaries..."); block_in_place(|| { - for file in &bin_files { + for file in bin_files { file.install_bin()?; } // Generate symlinks if !opts.no_symlinks { - for file in &bin_files { + for file in bin_files { file.install_link()?; } } From 2d0c4a8c4ef0c725232bb2f08e413b81ac6f3517 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 11 Jul 2022 22:18:45 +1000 Subject: [PATCH 0386/2020] Refactor: Extract fn `collect_bin_files` Signed-off-by: Jiahao XU --- src/main.rs | 82 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 51 insertions(+), 31 deletions(-) diff --git a/src/main.rs b/src/main.rs index 645fcfb2..441c1d84 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,7 @@ use std::{ time::{Duration, Instant}, }; -use cargo_toml::Package; +use cargo_toml::{Package, Product}; use clap::Parser; use log::{debug, error, info, warn, LevelFilter}; use miette::{miette, IntoDiagnostic, Result, WrapErr}; @@ -311,41 +311,18 @@ async fn entry() -> Result<()> { } meta.merge(&cli_overrides); - // Update meta - if fetcher.source_name() == "QuickInstall" { - // TODO: less of a hack? - meta.bin_dir = "{ bin }{ binary-ext }".to_string(); - } - - // Check binaries - if binaries.is_empty() { - error!("No binaries specified (or inferred from file system)"); - return Err(miette!( - "No binaries specified (or inferred from file system)" - )); - } - // Generate temporary binary path let bin_path = temp_dir.path().join(format!("bin-{}", opts.name)); debug!("Using temporary binary path: {}", bin_path.display()); - // List files to be installed - // based on those found via Cargo.toml - let bin_data = bins::Data { - name: package.name.clone(), - target: fetcher.target().to_string(), - version: package.version.clone(), - repo: package.repository.clone(), + let bin_files = collect_bin_files( + fetcher.as_ref(), + &package, meta, - bin_path, + binaries, + bin_path.clone(), install_path, - }; - - // Create bin_files - let bin_files = binaries - .iter() - .map(|p| bins::BinFile::from_product(&bin_data, p)) - .collect::, BinstallError>>()?; + )?; // Prompt user for confirmation debug!( @@ -386,7 +363,7 @@ async fn entry() -> Result<()> { opts, package, temp_dir, - &bin_data.bin_path, + &bin_path, &bin_files, ) .await @@ -407,6 +384,49 @@ async fn entry() -> Result<()> { } } +fn collect_bin_files( + fetcher: &dyn Fetcher, + package: &Package, + mut meta: PkgMeta, + binaries: Vec, + bin_path: PathBuf, + install_path: PathBuf, +) -> Result> { + // Update meta + if fetcher.source_name() == "QuickInstall" { + // TODO: less of a hack? + meta.bin_dir = "{ bin }{ binary-ext }".to_string(); + } + + // Check binaries + if binaries.is_empty() { + error!("No binaries specified (or inferred from file system)"); + return Err(miette!( + "No binaries specified (or inferred from file system)" + )); + } + + // List files to be installed + // based on those found via Cargo.toml + let bin_data = bins::Data { + name: package.name.clone(), + target: fetcher.target().to_string(), + version: package.version.clone(), + repo: package.repository.clone(), + meta, + bin_path, + install_path, + }; + + // Create bin_files + let bin_files = binaries + .iter() + .map(|p| bins::BinFile::from_product(&bin_data, p)) + .collect::, BinstallError>>()?; + + Ok(bin_files) +} + #[allow(clippy::too_many_arguments)] async fn install_from_package( fetcher: &dyn Fetcher, From 8bbc6d0171d30f2cdf574413e4b2b1f577563801 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 11 Jul 2022 22:19:21 +1000 Subject: [PATCH 0387/2020] Rm unused lint `allow(clippy::too_many_arguments)` Signed-off-by: Jiahao XU --- src/main.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 441c1d84..038a5f76 100644 --- a/src/main.rs +++ b/src/main.rs @@ -427,7 +427,6 @@ fn collect_bin_files( Ok(bin_files) } -#[allow(clippy::too_many_arguments)] async fn install_from_package( fetcher: &dyn Fetcher, opts: Options, From 4a9e04967c4ce0a755c862b1435dd7009a88ebe2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 11 Jul 2022 22:21:11 +1000 Subject: [PATCH 0388/2020] Refactor: Mv confirmation from `install_from_source` to `entry` Signed-off-by: Jiahao XU --- src/main.rs | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) diff --git a/src/main.rs b/src/main.rs index 038a5f76..24cf6964 100644 --- a/src/main.rs +++ b/src/main.rs @@ -379,7 +379,13 @@ async fn entry() -> Result<()> { .first() .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; - install_from_source(opts, package, target, &mut uithread).await + // Prompt user for source install + warn!("The package will be installed from source (with cargo)",); + if !opts.dry_run { + uithread.confirm().await?; + } + + install_from_source(opts, package, target).await } } } @@ -530,18 +536,7 @@ async fn install_from_package( }) } -async fn install_from_source( - opts: Options, - package: Package, - target: &str, - uithread: &mut UIThread, -) -> Result<()> { - // Prompt user for source install - warn!("The package will be installed from source (with cargo)",); - if !opts.dry_run { - uithread.confirm().await?; - } - +async fn install_from_source(opts: Options, package: Package, target: &str) -> Result<()> { if opts.dry_run { info!( "Dry-run: running `cargo install {} --version {} --target {target}`", From 38c8bc8cf297640a27a39eb1501af871f04f234c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 12 Jul 2022 16:47:44 +1000 Subject: [PATCH 0389/2020] Impl new type `helpes::CrateName` Signed-off-by: Jiahao XU --- src/helpers.rs | 3 +++ src/helpers/crate_name.rs | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/helpers/crate_name.rs diff --git a/src/helpers.rs b/src/helpers.rs index b7614e2f..254119b8 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -34,6 +34,9 @@ pub use path_ext::*; mod tls_version; pub use tls_version::TLSVersion; +mod crate_name; +pub use crate_name::CrateName; + /// Load binstall metadata from the crate `Cargo.toml` at the provided path pub fn load_manifest_path>( manifest_path: P, diff --git a/src/helpers/crate_name.rs b/src/helpers/crate_name.rs new file mode 100644 index 00000000..b7eb1077 --- /dev/null +++ b/src/helpers/crate_name.rs @@ -0,0 +1,39 @@ +use std::convert::Infallible; +use std::fmt; +use std::str::FromStr; + +#[derive(Debug)] +pub struct CrateName { + pub name: String, + pub version: Option, +} + +impl fmt::Display for CrateName { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}", self.name)?; + + if let Some(version) = &self.version { + write!(f, "@{version}")?; + } + + Ok(()) + } +} + +impl FromStr for CrateName { + type Err = Infallible; + + fn from_str(s: &str) -> Result { + Ok(if let Some((name, version)) = s.split_once('@') { + CrateName { + name: name.to_string(), + version: Some(version.to_string()), + } + } else { + CrateName { + name: s.to_string(), + version: None, + } + }) + } +} From 41961ce218748ed6efe6c9103c5917c2dfc76de1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 12 Jul 2022 17:03:12 +1000 Subject: [PATCH 0390/2020] Add new variant `BinstallError::DuplicateVersionReq` Signed-off-by: Jiahao XU --- src/errors.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/errors.rs b/src/errors.rs index 4c7e5cad..4db5cdd1 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -182,6 +182,12 @@ pub enum BinstallError { help("You specified `--version {req}` but the package resolved that to '{ver}'.\nUse `--version '={req}'` if you want an exact match.") )] VersionWarning { ver: String, req: String }, + + /// This occurs when you specified `--version` while also using + /// form `$crate_name@$ver` tp specify version requirements. + #[error("duplicate version requirements")] + #[diagnostic(severity(error), code(binstall::version::requirement))] + DuplicateVersionReq, } impl BinstallError { @@ -209,6 +215,7 @@ impl BinstallError { VersionMismatch { .. } => 82, VersionUnavailable { .. } => 83, VersionWarning { .. } => unimplemented!("BUG: warnings do not terminate"), + DuplicateVersionReq => 84, }; // reserved codes From ff0bd4d9484a9671c9aa93be4baaf79f02a41a97 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 12 Jul 2022 17:08:54 +1000 Subject: [PATCH 0391/2020] Support specifing ver via `crate_name@version` Signed-off-by: Jiahao XU --- src/main.rs | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-) diff --git a/src/main.rs b/src/main.rs index 24cf6964..73512c34 100644 --- a/src/main.rs +++ b/src/main.rs @@ -36,14 +36,14 @@ struct Options { /// /// This must be a crates.io package name. #[clap(value_name = "crate")] - name: String, + crate_name: CrateName, /// Semver filter to select the package version to install. /// /// This is in Cargo.toml dependencies format: `--version 1.2.3` is equivalent to /// `--version "^1.2.3"`. Use `=1.2.3` to install a specific version. - #[clap(long, default_value = "*")] - version: String, + #[clap(long)] + version: Option, /// Override binary target set. /// @@ -237,26 +237,33 @@ async fn entry() -> Result<()> { .map_err(BinstallError::from) .wrap_err("Creating a temporary directory failed.")?; - info!("Installing package: '{}'", opts.name); + info!("Installing package: '{}'", opts.crate_name); + + let version = match (&opts.crate_name.version, &opts.version) { + (Some(version), None) => version.to_string(), + (None, Some(version)) => version.to_string(), + (Some(_), Some(_)) => Err(BinstallError::DuplicateVersionReq)?, + (None, None) => "*".to_string(), + }; // Fetch crate via crates.io, git, or use a local manifest path // TODO: work out which of these to do based on `opts.name` // TODO: support git-based fetches (whole repo name rather than just crate name) let manifest = match opts.manifest_path.clone() { Some(manifest_path) => load_manifest_path(manifest_path.join("Cargo.toml"))?, - None => fetch_crate_cratesio(&client, &opts.name, &opts.version).await?, + None => fetch_crate_cratesio(&client, &opts.crate_name.name, &version).await?, }; let package = manifest.package.unwrap(); - let is_plain_version = semver::Version::from_str(&opts.version).is_ok(); - if is_plain_version && package.version != opts.version { + let is_plain_version = semver::Version::from_str(&version).is_ok(); + if is_plain_version && package.version != version { warn!("Warning!"); eprintln!( "{:?}", miette::Report::new(BinstallError::VersionWarning { ver: package.version.clone(), - req: opts.version.clone() + req: version.clone(), }) ); @@ -312,7 +319,9 @@ async fn entry() -> Result<()> { meta.merge(&cli_overrides); // Generate temporary binary path - let bin_path = temp_dir.path().join(format!("bin-{}", opts.name)); + let bin_path = temp_dir + .path() + .join(format!("bin-{}", opts.crate_name.name)); debug!("Using temporary binary path: {}", bin_path.display()); let bin_files = collect_bin_files( @@ -363,6 +372,7 @@ async fn entry() -> Result<()> { opts, package, temp_dir, + version, &bin_path, &bin_files, ) @@ -438,6 +448,7 @@ async fn install_from_package( opts: Options, package: Package, temp_dir: TempDir, + version: String, bin_path: &Path, bin_files: &[bins::BinFile], ) -> Result<()> { @@ -478,7 +489,7 @@ async fn install_from_package( } let cvs = metafiles::CrateVersionSource { - name: opts.name, + name: opts.crate_name.name, version: package.version.parse().into_diagnostic()?, source: metafiles::Source::Registry( url::Url::parse("https://github.com/rust-lang/crates.io-index").unwrap(), @@ -521,7 +532,7 @@ async fn install_from_package( c2.insert( cvs.clone(), metafiles::v2::CrateInfo { - version_req: Some(opts.version), + version_req: Some(version), bins, profile: "release".into(), target: fetcher.target().to_string(), From e2207f7b59b98a4e608319cb3096f51f5ab81904 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 12 Jul 2022 17:12:01 +1000 Subject: [PATCH 0392/2020] Add `diagnostic(help)` to `DuplicateVersionReq` Signed-off-by: Jiahao XU --- src/errors.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/errors.rs b/src/errors.rs index 4db5cdd1..286a3c9a 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -186,7 +186,11 @@ pub enum BinstallError { /// This occurs when you specified `--version` while also using /// form `$crate_name@$ver` tp specify version requirements. #[error("duplicate version requirements")] - #[diagnostic(severity(error), code(binstall::version::requirement))] + #[diagnostic( + severity(error), + code(binstall::version::requirement), + help("Remove the `--version req` or simply use `$crate_name`") + )] DuplicateVersionReq, } From c87941211cc782660e737b491dbbc9f08898cbce Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 12 Jul 2022 18:33:31 +1000 Subject: [PATCH 0393/2020] Treat `1.2.3` as `=1.2.3` to match `cargo-install` Signed-off-by: Jiahao XU --- src/errors.rs | 3 +-- src/main.rs | 28 ++++++++++------------------ 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index 286a3c9a..855a23b5 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -147,8 +147,7 @@ pub enum BinstallError { /// /// This may be the case when using the `--version` option. /// - /// Note that using `--version 1.2.3` is interpreted as the requirement `^1.2.3` as per - /// Cargo.toml rules. If you want the exact version 1.2.3, use `--version '=1.2.3'`. + /// Note that using `--version 1.2.3` is interpreted as the requirement `=1.2.3`. /// /// - Code: `binstall::version::mismatch` /// - Exit: 82 diff --git a/src/main.rs b/src/main.rs index 73512c34..b5a8af31 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,6 @@ use std::{ ffi::OsString, path::{Path, PathBuf}, process::{ExitCode, Termination}, - str::FromStr, time::{Duration, Instant}, }; @@ -239,13 +238,22 @@ async fn entry() -> Result<()> { info!("Installing package: '{}'", opts.crate_name); - let version = match (&opts.crate_name.version, &opts.version) { + let mut version = match (&opts.crate_name.version, &opts.version) { (Some(version), None) => version.to_string(), (None, Some(version)) => version.to_string(), (Some(_), Some(_)) => Err(BinstallError::DuplicateVersionReq)?, (None, None) => "*".to_string(), }; + if version + .chars() + .next() + .map(|ch| ch.is_ascii_digit()) + .unwrap_or(false) + { + version.insert(0, '='); + } + // Fetch crate via crates.io, git, or use a local manifest path // TODO: work out which of these to do based on `opts.name` // TODO: support git-based fetches (whole repo name rather than just crate name) @@ -256,22 +264,6 @@ async fn entry() -> Result<()> { let package = manifest.package.unwrap(); - let is_plain_version = semver::Version::from_str(&version).is_ok(); - if is_plain_version && package.version != version { - warn!("Warning!"); - eprintln!( - "{:?}", - miette::Report::new(BinstallError::VersionWarning { - ver: package.version.clone(), - req: version.clone(), - }) - ); - - if !opts.dry_run { - uithread.confirm().await?; - } - } - let (mut meta, binaries) = ( package .metadata From aecc474f291b0a2cbc4ff4a9363f276632ae1847 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 12 Jul 2022 18:34:20 +1000 Subject: [PATCH 0394/2020] Rm unused `BinstallError::VersionWarning` Signed-off-by: Jiahao XU --- src/errors.rs | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/errors.rs b/src/errors.rs index 855a23b5..ec19f29a 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -166,22 +166,6 @@ pub enum BinstallError { v: semver::Version, }, - /// Warning: The resolved version may not be what was meant. - /// - /// This occurs when using the `--version` option with a bare version, like `--version 1.2.3`. - /// That is parsed as the semver requirement `^1.2.3`, but the user may have expected that to - /// be an exact version (which should be specified with `--version '=1.2.3'`. - /// - /// - Code: `binstall::version::warning` - /// - Exit: none (runtime warning only) - #[error("version semantic mismatch: {ver} <> {req}")] - #[diagnostic( - severity(warning), - code(binstall::version::warning), - help("You specified `--version {req}` but the package resolved that to '{ver}'.\nUse `--version '={req}'` if you want an exact match.") - )] - VersionWarning { ver: String, req: String }, - /// This occurs when you specified `--version` while also using /// form `$crate_name@$ver` tp specify version requirements. #[error("duplicate version requirements")] @@ -217,7 +201,6 @@ impl BinstallError { VersionReq { .. } => 81, VersionMismatch { .. } => 82, VersionUnavailable { .. } => 83, - VersionWarning { .. } => unimplemented!("BUG: warnings do not terminate"), DuplicateVersionReq => 84, }; From 2936f2c3f1332b7288046312a7f30e0c3511896d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 14 Jul 2022 21:32:59 +1000 Subject: [PATCH 0395/2020] Build cargo-binstall in debug mode for PR Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index 394fc546..3121a336 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -88,11 +88,20 @@ jobs: - name: Build release uses: actions-rs/cargo@v1 + if: ${{ startsWith(github.ref, 'refs/tags/v') }} with: command: build args: --target ${{ matrix.target }} --release use-cross: ${{ matrix.use-cross }} + - name: Build debug + uses: actions-rs/cargo@v1 + if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} + with: + command: build + args: --target ${{ matrix.target }} + use-cross: ${{ matrix.use-cross }} + - name: Copy and rename utility run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} From 9f914a3c8411ed7b3b8ae846add166402e2e31ca Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 14 Jul 2022 21:41:32 +1000 Subject: [PATCH 0396/2020] Fix integration test: Copy from `debug` for PR Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index 3121a336..e94bd47c 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -103,8 +103,13 @@ jobs: use-cross: ${{ matrix.use-cross }} - name: Copy and rename utility + if: ${{ startsWith(github.ref, 'refs/tags/v') }} run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} + - name: Copy and rename utility + if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} + run: cp target/${{ matrix.target }}/debug/${{ matrix.output }} ${{ matrix.output }} + - name: Test (Unix) if: ${{ matrix.test && matrix.os != 'windows-latest' }} run: ./ci-scripts/run_tests_unix.sh ${{ matrix.output }} From 4ae7f31de4a814bba934c42dbcc65a5128a5db3c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Jul 2022 01:30:13 +0000 Subject: [PATCH 0397/2020] Bump tokio from 1.19.2 to 1.20.0 Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.19.2 to 1.20.0. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.19.2...tokio-1.20.0) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 5 +++-- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 97d840dd..c1a69feb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1497,10 +1497,11 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.19.2" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" +checksum = "57aec3cfa4c296db7255446efb4928a6be304b431a806216105542a67b6ca82e" dependencies = [ + "autocfg", "bytes", "libc", "memchr", diff --git a/Cargo.toml b/Cargo.toml index d332d408..20427bd7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -44,7 +44,7 @@ tar = "0.4.38" tempfile = "3.3.0" thiserror = "1.0.31" tinytemplate = "1.2.1" -tokio = { version = "1.19.1", features = ["rt-multi-thread", "process", "sync"], default-features = false } +tokio = { version = "1.20.0", features = ["rt-multi-thread", "process", "sync"], default-features = false } toml = "0.5.9" url = "2.2.2" xz2 = "0.1.6" From d9b30705dca36ffdf663a0a44c34bd45cef174b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Jul 2022 01:30:24 +0000 Subject: [PATCH 0398/2020] Bump serde from 1.0.138 to 1.0.139 Bumps [serde](https://github.com/serde-rs/serde) from 1.0.138 to 1.0.139. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.138...v1.0.139) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 97d840dd..bc177233 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1203,18 +1203,18 @@ checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" [[package]] name = "serde" -version = "1.0.138" +version = "1.0.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1578c6245786b9d168c5447eeacfb96856573ca56c9d68fdcf394be134882a47" +checksum = "0171ebb889e45aa68b44aee0859b3eede84c6f5f5c228e6f140c0b2a0a46cad6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.138" +version = "1.0.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "023e9b1467aef8a10fb88f25611870ada9800ef7e22afce356bb0d2387b6f27c" +checksum = "dc1d3230c1de7932af58ad8ffbe1d784bd55efd5a9d84ac24f69c72d83543dfb" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index d332d408..acc604f2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,7 @@ mimalloc = { version = "0.1.29", default-features = false, optional = true } reqwest = { version = "0.11.11", features = ["rustls-tls", "stream"], default-features = false } scopeguard = "1.1.0" semver = "1.0.12" -serde = { version = "1.0.138", features = ["derive"] } +serde = { version = "1.0.139", features = ["derive"] } serde_json = "1.0.82" simplelog = "0.12.0" strum = "0.24.1" From ee855264f7e2ca989da3f16082d0e5f108a0a09f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 18 Jul 2022 01:30:33 +0000 Subject: [PATCH 0399/2020] Bump clap from 3.2.8 to 3.2.12 Bumps [clap](https://github.com/clap-rs/clap) from 3.2.8 to 3.2.12. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v3.2.8...v3.2.12) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 6 +++--- Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 97d840dd..8cbaa22d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -136,7 +136,7 @@ dependencies = [ "bytes", "bzip2", "cargo_toml", - "clap 3.2.8", + "clap 3.2.12", "crates_io_api", "dirs", "env_logger", @@ -241,9 +241,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.8" +version = "3.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190814073e85d238f31ff738fcb0bf6910cedeb73376c87cd69291028966fd83" +checksum = "ab8b79fe3946ceb4a0b1c080b4018992b8d27e9ff363644c1c9b6387c854614d" dependencies = [ "atty", "bitflags", diff --git a/Cargo.toml b/Cargo.toml index d332d408..0221afd6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ async-trait = "0.1.56" bytes = "1.1.0" bzip2 = { version = "0.4.3", features = ["static"] } cargo_toml = "0.11.4" -clap = { version = "3.2.8", features = ["derive"] } +clap = { version = "3.2.12", features = ["derive"] } crates_io_api = { version = "0.8.0", default-features = false, features = ["rustls"] } dirs = "4.0.0" flate2 = { version = "1.0.24", features = ["zlib-ng"], default-features = false } From 9e1f873bb52a07c0f69307396aa59ca4f588dbb8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 16:01:52 +1000 Subject: [PATCH 0400/2020] `derive(Clone)` for `DesiredTargets` Signed-off-by: Jiahao XU --- src/target.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/target.rs b/src/target.rs index 8dfb75b6..fdca606f 100644 --- a/src/target.rs +++ b/src/target.rs @@ -8,13 +8,13 @@ use tokio::sync::OnceCell; /// Compiled target triple, used as default for binary fetching pub const TARGET: &str = env!("TARGET"); -#[derive(Debug)] +#[derive(Debug, Clone)] enum DesiredTargetsInner { AutoDetect(Arc>>), Initialized(Vec), } -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct DesiredTargets(DesiredTargetsInner); impl DesiredTargets { From 409f31f0bf5d5dd0e7c734834a5a37734af26cd0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 16:07:47 +1000 Subject: [PATCH 0401/2020] `derive(Clone)` for `CrateName` Signed-off-by: Jiahao XU --- src/helpers/crate_name.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers/crate_name.rs b/src/helpers/crate_name.rs index b7eb1077..58ef59c0 100644 --- a/src/helpers/crate_name.rs +++ b/src/helpers/crate_name.rs @@ -2,7 +2,7 @@ use std::convert::Infallible; use std::fmt; use std::str::FromStr; -#[derive(Debug)] +#[derive(Debug, Clone)] pub struct CrateName { pub name: String, pub version: Option, From d6db552db1643ea2dd9cb987cdd979e97b98ef82 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 16:16:50 +1000 Subject: [PATCH 0402/2020] Refactor `main.rs`: Extract new fn `resolve` prepare for the new feature batch installation. Signed-off-by: Jiahao XU --- src/main.rs | 204 +++++++++++++++++++++++++++++++++------------------- 1 file changed, 132 insertions(+), 72 deletions(-) diff --git a/src/main.rs b/src/main.rs index b5a8af31..56800774 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,7 @@ use std::{ ffi::OsString, path::{Path, PathBuf}, process::{ExitCode, Termination}, + sync::Arc, time::{Duration, Instant}, }; @@ -10,6 +11,7 @@ use cargo_toml::{Package, Product}; use clap::Parser; use log::{debug, error, info, warn, LevelFilter}; use miette::{miette, IntoDiagnostic, Result, WrapErr}; +use reqwest::Client; use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; use tempfile::TempDir; use tokio::{ @@ -197,11 +199,12 @@ async fn entry() -> Result<()> { // Load options let mut opts = Options::parse_from(args); - let cli_overrides = PkgOverride { + let cli_overrides = Arc::new(PkgOverride { pkg_url: opts.pkg_url.take(), pkg_fmt: opts.pkg_fmt.take(), bin_dir: opts.bin_dir.take(), - }; + }); + let opts = Arc::new(opts); // Initialize reqwest client let client = create_reqwest_client(opts.secure, opts.min_tls_version.map(|v| v.into()))?; @@ -236,9 +239,119 @@ async fn entry() -> Result<()> { .map_err(BinstallError::from) .wrap_err("Creating a temporary directory failed.")?; - info!("Installing package: '{}'", opts.crate_name); + let resolution = resolve( + opts.clone(), + opts.crate_name.clone(), + desired_targets.clone(), + cli_overrides.clone(), + temp_dir.path().to_path_buf(), + install_path.clone(), + client.clone(), + ) + .await?; - let mut version = match (&opts.crate_name.version, &opts.version) { + match resolution { + Resolution::Fetch { + fetcher, + package, + version, + bin_path, + bin_files, + } => { + let fetcher_target = fetcher.target(); + // Prompt user for confirmation + debug!( + "Found a binary install source: {} ({fetcher_target})", + fetcher.source_name() + ); + + if fetcher.is_third_party() { + warn!( + "The package will be downloaded from third-party source {}", + fetcher.source_name() + ); + } else { + info!( + "The package will be downloaded from {}", + fetcher.source_name() + ); + } + + info!("This will install the following binaries:"); + for file in &bin_files { + info!(" - {}", file.preview_bin()); + } + + if !opts.no_symlinks { + info!("And create (or update) the following symlinks:"); + for file in &bin_files { + info!(" - {}", file.preview_link()); + } + } + + if !opts.dry_run { + uithread.confirm().await?; + } + + install_from_package( + fetcher.as_ref(), + opts, + package, + temp_dir, + version, + &bin_path, + &bin_files, + ) + .await + } + Resolution::InstallFromSource { package } => { + if !opts.no_cleanup { + temp_dir.close().unwrap_or_else(|err| { + warn!("Failed to clean up some resources: {err}"); + }); + } + + let desired_targets = desired_targets.get().await; + let target = desired_targets + .first() + .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; + + // Prompt user for source install + warn!("The package will be installed from source (with cargo)",); + if !opts.dry_run { + uithread.confirm().await?; + } + + install_from_source(opts, package, target).await + } + } +} + +enum Resolution { + Fetch { + fetcher: Arc, + package: Package, + version: String, + bin_path: PathBuf, + bin_files: Vec, + }, + InstallFromSource { + package: Package, + }, +} + +async fn resolve( + opts: Arc, + crate_name: CrateName, + desired_targets: DesiredTargets, + cli_overrides: Arc, + temp_dir: PathBuf, + install_path: PathBuf, + client: Client, +) -> Result { + info!("Installing package: '{}'", crate_name); + + let mut version = match (&crate_name.version, &opts.version) { (Some(version), None) => version.to_string(), (None, Some(version)) => version.to_string(), (Some(_), Some(_)) => Err(BinstallError::DuplicateVersionReq)?, @@ -259,7 +372,7 @@ async fn entry() -> Result<()> { // TODO: support git-based fetches (whole repo name rather than just crate name) let manifest = match opts.manifest_path.clone() { Some(manifest_path) => load_manifest_path(manifest_path.join("Cargo.toml"))?, - None => fetch_crate_cratesio(&client, &opts.crate_name.name, &version).await?, + None => fetch_crate_cratesio(&client, &crate_name.name, &version).await?, }; let package = manifest.package.unwrap(); @@ -311,9 +424,7 @@ async fn entry() -> Result<()> { meta.merge(&cli_overrides); // Generate temporary binary path - let bin_path = temp_dir - .path() - .join(format!("bin-{}", opts.crate_name.name)); + let bin_path = temp_dir.join(format!("bin-{}", crate_name.name)); debug!("Using temporary binary path: {}", bin_path.display()); let bin_files = collect_bin_files( @@ -325,70 +436,15 @@ async fn entry() -> Result<()> { install_path, )?; - // Prompt user for confirmation - debug!( - "Found a binary install source: {} ({fetcher_target})", - fetcher.source_name() - ); - - if fetcher.is_third_party() { - warn!( - "The package will be downloaded from third-party source {}", - fetcher.source_name() - ); - } else { - info!( - "The package will be downloaded from {}", - fetcher.source_name() - ); - } - - info!("This will install the following binaries:"); - for file in &bin_files { - info!(" - {}", file.preview_bin()); - } - - if !opts.no_symlinks { - info!("And create (or update) the following symlinks:"); - for file in &bin_files { - info!(" - {}", file.preview_link()); - } - } - - if !opts.dry_run { - uithread.confirm().await?; - } - - install_from_package( - fetcher.as_ref(), - opts, + Ok(Resolution::Fetch { + fetcher, package, - temp_dir, version, - &bin_path, - &bin_files, - ) - .await - } - None => { - if !opts.no_cleanup { - temp_dir.close().unwrap_or_else(|err| { - warn!("Failed to clean up some resources: {err}"); - }); - } - - let target = desired_targets - .first() - .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; - - // Prompt user for source install - warn!("The package will be installed from source (with cargo)",); - if !opts.dry_run { - uithread.confirm().await?; - } - - install_from_source(opts, package, target).await + bin_path, + bin_files, + }) } + None => Ok(Resolution::InstallFromSource { package }), } } @@ -437,7 +493,7 @@ fn collect_bin_files( async fn install_from_package( fetcher: &dyn Fetcher, - opts: Options, + opts: Arc, package: Package, temp_dir: TempDir, version: String, @@ -481,7 +537,7 @@ async fn install_from_package( } let cvs = metafiles::CrateVersionSource { - name: opts.crate_name.name, + name: opts.crate_name.name.clone(), version: package.version.parse().into_diagnostic()?, source: metafiles::Source::Registry( url::Url::parse("https://github.com/rust-lang/crates.io-index").unwrap(), @@ -539,7 +595,11 @@ async fn install_from_package( }) } -async fn install_from_source(opts: Options, package: Package, target: &str) -> Result<()> { +async fn install_from_source( + opts: Arc, + package: Package, + target: &str, +) -> Result<()> { if opts.dry_run { info!( "Dry-run: running `cargo install {} --version {} --target {target}`", From 730f7d6c15825f07f6e79a46e200525a27f65ea5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 16:21:03 +1000 Subject: [PATCH 0403/2020] Refactor `main.rs`: Simplify `install_from_source` Rm arg `opts` Signed-off-by: Jiahao XU --- src/main.rs | 75 +++++++++++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 40 deletions(-) diff --git a/src/main.rs b/src/main.rs index 56800774..55ba5b42 100644 --- a/src/main.rs +++ b/src/main.rs @@ -320,9 +320,16 @@ async fn entry() -> Result<()> { warn!("The package will be installed from source (with cargo)",); if !opts.dry_run { uithread.confirm().await?; - } - install_from_source(opts, package, target).await + install_from_source(package, target).await + } else { + info!( + "Dry-run: running `cargo install {} --version {} --target {target}`", + package.name, package.version + ); + + Ok(()) + } } } } @@ -595,45 +602,33 @@ async fn install_from_package( }) } -async fn install_from_source( - opts: Arc, - package: Package, - target: &str, -) -> Result<()> { - if opts.dry_run { - info!( - "Dry-run: running `cargo install {} --version {} --target {target}`", - package.name, package.version - ); +async fn install_from_source(package: Package, target: &str) -> Result<()> { + debug!( + "Running `cargo install {} --version {} --target {target}`", + package.name, package.version + ); + let mut child = Command::new("cargo") + .arg("install") + .arg(package.name) + .arg("--version") + .arg(package.version) + .arg("--target") + .arg(target) + .spawn() + .into_diagnostic() + .wrap_err("Spawning cargo install failed.")?; + debug!("Spawned command pid={:?}", child.id()); + + let status = child + .wait() + .await + .into_diagnostic() + .wrap_err("Running cargo install failed.")?; + if status.success() { + info!("Cargo finished successfully"); Ok(()) } else { - debug!( - "Running `cargo install {} --version {} --target {target}`", - package.name, package.version - ); - let mut child = Command::new("cargo") - .arg("install") - .arg(package.name) - .arg("--version") - .arg(package.version) - .arg("--target") - .arg(target) - .spawn() - .into_diagnostic() - .wrap_err("Spawning cargo install failed.")?; - debug!("Spawned command pid={:?}", child.id()); - - let status = child - .wait() - .await - .into_diagnostic() - .wrap_err("Running cargo install failed.")?; - if status.success() { - info!("Cargo finished successfully"); - Ok(()) - } else { - error!("Cargo errored! {status:?}"); - Err(miette!("Cargo install error")) - } + error!("Cargo errored! {status:?}"); + Err(miette!("Cargo install error")) } } From 5e7aab7373686268ca52a8e75f119ea7cd49bdb9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 16:46:21 +1000 Subject: [PATCH 0404/2020] Impl `helpers::await_task`: Handle `JoinError` Signed-off-by: Jiahao XU --- src/helpers.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/helpers.rs b/src/helpers.rs index 254119b8..2732f1e7 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -37,6 +37,11 @@ pub use tls_version::TLSVersion; mod crate_name; pub use crate_name::CrateName; +pub async fn await_task(task: tokio::task::JoinHandle) -> miette::Result { + task.await + .map_err(|join_err| miette::miette!("Task failed to join: {}", join_err)) +} + /// Load binstall metadata from the crate `Cargo.toml` at the provided path pub fn load_manifest_path>( manifest_path: P, From 7f11b74f5ef0354d2aa8773e3e5046274cccc8b6 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 16:46:51 +1000 Subject: [PATCH 0405/2020] Support new feature batch installation! Signed-off-by: Jiahao XU --- src/main.rs | 225 ++++++++++++++++++++++++++++------------------------ 1 file changed, 123 insertions(+), 102 deletions(-) diff --git a/src/main.rs b/src/main.rs index 55ba5b42..33f750b2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,8 @@ use std::{ collections::BTreeSet, ffi::OsString, - path::{Path, PathBuf}, + mem::take, + path::PathBuf, process::{ExitCode, Termination}, sync::Arc, time::{Duration, Instant}, @@ -37,7 +38,7 @@ struct Options { /// /// This must be a crates.io package name. #[clap(value_name = "crate")] - crate_name: CrateName, + crate_names: Vec, /// Semver filter to select the package version to install. /// @@ -204,6 +205,7 @@ async fn entry() -> Result<()> { pkg_fmt: opts.pkg_fmt.take(), bin_dir: opts.bin_dir.take(), }); + let crate_names = take(&mut opts.crate_names); let opts = Arc::new(opts); // Initialize reqwest client @@ -239,105 +241,129 @@ async fn entry() -> Result<()> { .map_err(BinstallError::from) .wrap_err("Creating a temporary directory failed.")?; - let resolution = resolve( - opts.clone(), - opts.crate_name.clone(), - desired_targets.clone(), - cli_overrides.clone(), - temp_dir.path().to_path_buf(), - install_path.clone(), - client.clone(), - ) - .await?; + let tasks: Vec<_> = crate_names + .into_iter() + .map(|crate_name| { + tokio::spawn(resolve( + opts.clone(), + crate_name, + desired_targets.clone(), + cli_overrides.clone(), + temp_dir.path().to_path_buf(), + install_path.clone(), + client.clone(), + )) + }) + .collect(); - match resolution { - Resolution::Fetch { - fetcher, - package, - version, - bin_path, - bin_files, - } => { - let fetcher_target = fetcher.target(); - // Prompt user for confirmation - debug!( - "Found a binary install source: {} ({fetcher_target})", - fetcher.source_name() - ); + let mut resolutions = Vec::with_capacity(tasks.len()); + for task in tasks { + resolutions.push(await_task(task).await??); + } - if fetcher.is_third_party() { - warn!( - "The package will be downloaded from third-party source {}", + for resolution in &resolutions { + match resolution { + Resolution::Fetch { + fetcher, bin_files, .. + } => { + let fetcher_target = fetcher.target(); + // Prompt user for confirmation + debug!( + "Found a binary install source: {} ({fetcher_target})", fetcher.source_name() ); - } else { - info!( - "The package will be downloaded from {}", - fetcher.source_name() - ); - } - info!("This will install the following binaries:"); - for file in &bin_files { - info!(" - {}", file.preview_bin()); - } + if fetcher.is_third_party() { + warn!( + "The package will be downloaded from third-party source {}", + fetcher.source_name() + ); + } else { + info!( + "The package will be downloaded from {}", + fetcher.source_name() + ); + } - if !opts.no_symlinks { - info!("And create (or update) the following symlinks:"); - for file in &bin_files { - info!(" - {}", file.preview_link()); + info!("This will install the following binaries:"); + for file in bin_files { + info!(" - {}", file.preview_bin()); + } + + if !opts.no_symlinks { + info!("And create (or update) the following symlinks:"); + for file in bin_files { + info!(" - {}", file.preview_link()); + } } } - - if !opts.dry_run { - uithread.confirm().await?; - } - - install_from_package( - fetcher.as_ref(), - opts, - package, - temp_dir, - version, - &bin_path, - &bin_files, - ) - .await - } - Resolution::InstallFromSource { package } => { - if !opts.no_cleanup { - temp_dir.close().unwrap_or_else(|err| { - warn!("Failed to clean up some resources: {err}"); - }); - } - - let desired_targets = desired_targets.get().await; - let target = desired_targets - .first() - .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; - - // Prompt user for source install - warn!("The package will be installed from source (with cargo)",); - if !opts.dry_run { - uithread.confirm().await?; - - install_from_source(package, target).await - } else { - info!( - "Dry-run: running `cargo install {} --version {} --target {target}`", - package.name, package.version - ); - - Ok(()) + Resolution::InstallFromSource { .. } => { + warn!("The package will be installed from source (with cargo)",) } } } + + if !opts.dry_run { + uithread.confirm().await?; + } + + let desired_targets = desired_targets.get().await; + let target = desired_targets + .first() + .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; + + let tasks: Vec<_> = resolutions + .into_iter() + .map(|resolution| match resolution { + Resolution::Fetch { + fetcher, + package, + crate_name, + version, + bin_path, + bin_files, + } => tokio::spawn(install_from_package( + fetcher, + opts.clone(), + package, + crate_name, + temp_dir.path().to_path_buf(), + version, + bin_path, + bin_files, + )), + Resolution::InstallFromSource { package } => { + if !opts.dry_run { + tokio::spawn(install_from_source(package, target.clone())) + } else { + info!( + "Dry-run: running `cargo install {} --version {} --target {target}`", + package.name, package.version + ); + tokio::spawn(async { Ok(()) }) + } + } + }) + .collect(); + + for task in tasks { + await_task(task).await??; + } + + if !opts.no_cleanup { + temp_dir.close().unwrap_or_else(|err| { + warn!("Failed to clean up some resources: {err}"); + }); + } + + Ok(()) } enum Resolution { Fetch { fetcher: Arc, package: Package, + crate_name: CrateName, version: String, bin_path: PathBuf, bin_files: Vec, @@ -446,6 +472,7 @@ async fn resolve( Ok(Resolution::Fetch { fetcher, package, + crate_name, version, bin_path, bin_files, @@ -498,20 +525,22 @@ fn collect_bin_files( Ok(bin_files) } +#[allow(unused, clippy::too_many_arguments)] async fn install_from_package( - fetcher: &dyn Fetcher, + fetcher: Arc, opts: Arc, package: Package, - temp_dir: TempDir, + crate_name: CrateName, + temp_dir: PathBuf, version: String, - bin_path: &Path, - bin_files: &[bins::BinFile], + bin_path: PathBuf, + bin_files: Vec, ) -> Result<()> { // Download package if opts.dry_run { info!("Dry run, not downloading package"); } else { - fetcher.fetch_and_extract(bin_path).await?; + fetcher.fetch_and_extract(&bin_path).await?; } #[cfg(incomplete)] @@ -528,7 +557,7 @@ async fn install_from_package( debug!("Fetching signature file: {sig_url}"); // Download signature file - let sig_path = temp_dir.path().join(format!("{pkg_name}.sig")); + let sig_path = temp_dir.join(format!("{pkg_name}.sig")); download(&sig_url, &sig_path).await?; // TODO: do the signature check @@ -544,7 +573,7 @@ async fn install_from_package( } let cvs = metafiles::CrateVersionSource { - name: opts.crate_name.name.clone(), + name: crate_name.name.clone(), version: package.version.parse().into_diagnostic()?, source: metafiles::Source::Registry( url::Url::parse("https://github.com/rust-lang/crates.io-index").unwrap(), @@ -553,25 +582,17 @@ async fn install_from_package( info!("Installing binaries..."); block_in_place(|| { - for file in bin_files { + for file in &bin_files { file.install_bin()?; } // Generate symlinks if !opts.no_symlinks { - for file in bin_files { + for file in &bin_files { file.install_link()?; } } - if opts.no_cleanup { - let _ = temp_dir.into_path(); - } else { - temp_dir.close().unwrap_or_else(|err| { - warn!("Failed to clean up some resources: {err}"); - }); - } - let bins: BTreeSet = bin_files.iter().map(|bin| bin.base_name.clone()).collect(); { @@ -602,7 +623,7 @@ async fn install_from_package( }) } -async fn install_from_source(package: Package, target: &str) -> Result<()> { +async fn install_from_source(package: Package, target: String) -> Result<()> { debug!( "Running `cargo install {} --version {} --target {target}`", package.name, package.version From 40a872dbe3d49715d1547ae69ce1fa8e2d0b10cb Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 16:54:45 +1000 Subject: [PATCH 0406/2020] Avoid `Box::clone` for `targets` Signed-off-by: Jiahao XU --- src/main.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 33f750b2..d74c4fb4 100644 --- a/src/main.rs +++ b/src/main.rs @@ -308,9 +308,12 @@ async fn entry() -> Result<()> { } let desired_targets = desired_targets.get().await; - let target = desired_targets - .first() - .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; + let target = Arc::from( + desired_targets + .first() + .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))? + .as_str(), + ); let tasks: Vec<_> = resolutions .into_iter() @@ -334,7 +337,7 @@ async fn entry() -> Result<()> { )), Resolution::InstallFromSource { package } => { if !opts.dry_run { - tokio::spawn(install_from_source(package, target.clone())) + tokio::spawn(install_from_source(package, Arc::clone(&target))) } else { info!( "Dry-run: running `cargo install {} --version {} --target {target}`", @@ -623,7 +626,7 @@ async fn install_from_package( }) } -async fn install_from_source(package: Package, target: String) -> Result<()> { +async fn install_from_source(package: Package, target: Arc) -> Result<()> { debug!( "Running `cargo install {} --version {} --target {target}`", package.name, package.version @@ -634,7 +637,7 @@ async fn install_from_source(package: Package, target: String) -> Result<( .arg("--version") .arg(package.version) .arg("--target") - .arg(target) + .arg(&*target) .spawn() .into_diagnostic() .wrap_err("Spawning cargo install failed.")?; From d514219ee405ed292083c385743b7de7a394bd68 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 16:58:04 +1000 Subject: [PATCH 0407/2020] Refactor `main.rs`: Extract new fn `install` Signed-off-by: Jiahao XU --- src/main.rs | 71 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/src/main.rs b/src/main.rs index d74c4fb4..de2f5d39 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,7 @@ use std::{ collections::BTreeSet, ffi::OsString, mem::take, - path::PathBuf, + path::{Path, PathBuf}, process::{ExitCode, Termination}, sync::Arc, time::{Duration, Instant}, @@ -317,36 +317,7 @@ async fn entry() -> Result<()> { let tasks: Vec<_> = resolutions .into_iter() - .map(|resolution| match resolution { - Resolution::Fetch { - fetcher, - package, - crate_name, - version, - bin_path, - bin_files, - } => tokio::spawn(install_from_package( - fetcher, - opts.clone(), - package, - crate_name, - temp_dir.path().to_path_buf(), - version, - bin_path, - bin_files, - )), - Resolution::InstallFromSource { package } => { - if !opts.dry_run { - tokio::spawn(install_from_source(package, Arc::clone(&target))) - } else { - info!( - "Dry-run: running `cargo install {} --version {} --target {target}`", - package.name, package.version - ); - tokio::spawn(async { Ok(()) }) - } - } - }) + .map(|resolution| install(resolution, &opts, temp_dir.path(), &target)) .collect(); for task in tasks { @@ -528,6 +499,44 @@ fn collect_bin_files( Ok(bin_files) } +fn install( + resolution: Resolution, + opts: &Arc, + temp_dir: &Path, + target: &Arc, +) -> tokio::task::JoinHandle> { + match resolution { + Resolution::Fetch { + fetcher, + package, + crate_name, + version, + bin_path, + bin_files, + } => tokio::spawn(install_from_package( + fetcher, + opts.clone(), + package, + crate_name, + temp_dir.to_path_buf(), + version, + bin_path, + bin_files, + )), + Resolution::InstallFromSource { package } => { + if !opts.dry_run { + tokio::spawn(install_from_source(package, Arc::clone(target))) + } else { + info!( + "Dry-run: running `cargo install {} --version {} --target {target}`", + package.name, package.version + ); + tokio::spawn(async { Ok(()) }) + } + } + } +} + #[allow(unused, clippy::too_many_arguments)] async fn install_from_package( fetcher: Arc, From 8ca85382afe349d7ebdb4e4e7370bfa454c0542f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 17:00:18 +1000 Subject: [PATCH 0408/2020] Refactor: Avoid repeated heap alloc of `temp_dir` Signed-off-by: Jiahao XU --- src/main.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index de2f5d39..f813467c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -315,9 +315,11 @@ async fn entry() -> Result<()> { .as_str(), ); + let temp_dir_path = Arc::from(temp_dir.path()); + let tasks: Vec<_> = resolutions .into_iter() - .map(|resolution| install(resolution, &opts, temp_dir.path(), &target)) + .map(|resolution| install(resolution, &opts, &temp_dir_path, &target)) .collect(); for task in tasks { @@ -502,7 +504,7 @@ fn collect_bin_files( fn install( resolution: Resolution, opts: &Arc, - temp_dir: &Path, + temp_dir: &Arc, target: &Arc, ) -> tokio::task::JoinHandle> { match resolution { @@ -518,7 +520,7 @@ fn install( opts.clone(), package, crate_name, - temp_dir.to_path_buf(), + Arc::clone(temp_dir), version, bin_path, bin_files, @@ -543,7 +545,7 @@ async fn install_from_package( opts: Arc, package: Package, crate_name: CrateName, - temp_dir: PathBuf, + temp_dir: Arc, version: String, bin_path: PathBuf, bin_files: Vec, From 90059c11cf1ce62e13235fb21f515120414b846b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 17:09:29 +1000 Subject: [PATCH 0409/2020] Optimize: Launch `install` immediately if confirmation is not required Signed-off-by: Jiahao XU --- src/main.rs | 161 +++++++++++++++++++++++++++++----------------------- 1 file changed, 89 insertions(+), 72 deletions(-) diff --git a/src/main.rs b/src/main.rs index f813467c..ceada477 100644 --- a/src/main.rs +++ b/src/main.rs @@ -256,57 +256,6 @@ async fn entry() -> Result<()> { }) .collect(); - let mut resolutions = Vec::with_capacity(tasks.len()); - for task in tasks { - resolutions.push(await_task(task).await??); - } - - for resolution in &resolutions { - match resolution { - Resolution::Fetch { - fetcher, bin_files, .. - } => { - let fetcher_target = fetcher.target(); - // Prompt user for confirmation - debug!( - "Found a binary install source: {} ({fetcher_target})", - fetcher.source_name() - ); - - if fetcher.is_third_party() { - warn!( - "The package will be downloaded from third-party source {}", - fetcher.source_name() - ); - } else { - info!( - "The package will be downloaded from {}", - fetcher.source_name() - ); - } - - info!("This will install the following binaries:"); - for file in bin_files { - info!(" - {}", file.preview_bin()); - } - - if !opts.no_symlinks { - info!("And create (or update) the following symlinks:"); - for file in bin_files { - info!(" - {}", file.preview_link()); - } - } - } - Resolution::InstallFromSource { .. } => { - warn!("The package will be installed from source (with cargo)",) - } - } - } - - if !opts.dry_run { - uithread.confirm().await?; - } - let desired_targets = desired_targets.get().await; let target = Arc::from( desired_targets @@ -317,10 +266,82 @@ async fn entry() -> Result<()> { let temp_dir_path = Arc::from(temp_dir.path()); - let tasks: Vec<_> = resolutions - .into_iter() - .map(|resolution| install(resolution, &opts, &temp_dir_path, &target)) - .collect(); + let tasks: Vec<_> = if !opts.dry_run && !opts.no_confirm { + let mut resolutions = Vec::with_capacity(tasks.len()); + for task in tasks { + resolutions.push(await_task(task).await??); + } + + for resolution in &resolutions { + match resolution { + Resolution::Fetch { + fetcher, bin_files, .. + } => { + let fetcher_target = fetcher.target(); + // Prompt user for confirmation + debug!( + "Found a binary install source: {} ({fetcher_target})", + fetcher.source_name() + ); + + if fetcher.is_third_party() { + warn!( + "The package will be downloaded from third-party source {}", + fetcher.source_name() + ); + } else { + info!( + "The package will be downloaded from {}", + fetcher.source_name() + ); + } + + info!("This will install the following binaries:"); + for file in bin_files { + info!(" - {}", file.preview_bin()); + } + + if !opts.no_symlinks { + info!("And create (or update) the following symlinks:"); + for file in bin_files { + info!(" - {}", file.preview_link()); + } + } + } + Resolution::InstallFromSource { .. } => { + warn!("The package will be installed from source (with cargo)",) + } + } + } + + uithread.confirm().await?; + + resolutions + .into_iter() + .map(|resolution| { + tokio::spawn(install( + resolution, + Arc::clone(&opts), + Arc::clone(&temp_dir_path), + Arc::clone(&target), + )) + }) + .collect() + } else { + tasks + .into_iter() + .map(|task| { + let opts = Arc::clone(&opts); + let temp_dir_path = Arc::clone(&temp_dir_path); + let target = Arc::clone(&target); + + tokio::spawn(async move { + let resolution = await_task(task).await??; + install(resolution, opts, temp_dir_path, target).await + }) + }) + .collect() + }; for task in tasks { await_task(task).await??; @@ -501,12 +522,12 @@ fn collect_bin_files( Ok(bin_files) } -fn install( +async fn install( resolution: Resolution, - opts: &Arc, - temp_dir: &Arc, - target: &Arc, -) -> tokio::task::JoinHandle> { + opts: Arc, + temp_dir: Arc, + target: Arc, +) -> Result<()> { match resolution { Resolution::Fetch { fetcher, @@ -515,25 +536,21 @@ fn install( version, bin_path, bin_files, - } => tokio::spawn(install_from_package( - fetcher, - opts.clone(), - package, - crate_name, - Arc::clone(temp_dir), - version, - bin_path, - bin_files, - )), + } => { + install_from_package( + fetcher, opts, package, crate_name, temp_dir, version, bin_path, bin_files, + ) + .await + } Resolution::InstallFromSource { package } => { if !opts.dry_run { - tokio::spawn(install_from_source(package, Arc::clone(target))) + install_from_source(package, target).await } else { info!( "Dry-run: running `cargo install {} --version {} --target {target}`", package.name, package.version ); - tokio::spawn(async { Ok(()) }) + Ok(()) } } } From f0fb7da99b5b4e5c66cb107efac0371895e108e0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 17:11:27 +1000 Subject: [PATCH 0410/2020] Refactor `main.rs`: Extract fn `Resolution::print` Signed-off-by: Jiahao XU --- src/main.rs | 83 ++++++++++++++++++++++++++++------------------------- 1 file changed, 44 insertions(+), 39 deletions(-) diff --git a/src/main.rs b/src/main.rs index ceada477..98573bc2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -273,45 +273,7 @@ async fn entry() -> Result<()> { } for resolution in &resolutions { - match resolution { - Resolution::Fetch { - fetcher, bin_files, .. - } => { - let fetcher_target = fetcher.target(); - // Prompt user for confirmation - debug!( - "Found a binary install source: {} ({fetcher_target})", - fetcher.source_name() - ); - - if fetcher.is_third_party() { - warn!( - "The package will be downloaded from third-party source {}", - fetcher.source_name() - ); - } else { - info!( - "The package will be downloaded from {}", - fetcher.source_name() - ); - } - - info!("This will install the following binaries:"); - for file in bin_files { - info!(" - {}", file.preview_bin()); - } - - if !opts.no_symlinks { - info!("And create (or update) the following symlinks:"); - for file in bin_files { - info!(" - {}", file.preview_link()); - } - } - } - Resolution::InstallFromSource { .. } => { - warn!("The package will be installed from source (with cargo)",) - } - } + resolution.print(&opts); } uithread.confirm().await?; @@ -369,6 +331,49 @@ enum Resolution { package: Package, }, } +impl Resolution { + fn print(&self, opts: &Options) { + match self { + Resolution::Fetch { + fetcher, bin_files, .. + } => { + let fetcher_target = fetcher.target(); + // Prompt user for confirmation + debug!( + "Found a binary install source: {} ({fetcher_target})", + fetcher.source_name() + ); + + if fetcher.is_third_party() { + warn!( + "The package will be downloaded from third-party source {}", + fetcher.source_name() + ); + } else { + info!( + "The package will be downloaded from {}", + fetcher.source_name() + ); + } + + info!("This will install the following binaries:"); + for file in bin_files { + info!(" - {}", file.preview_bin()); + } + + if !opts.no_symlinks { + info!("And create (or update) the following symlinks:"); + for file in bin_files { + info!(" - {}", file.preview_link()); + } + } + } + Resolution::InstallFromSource { .. } => { + warn!("The package will be installed from source (with cargo)",) + } + } + } +} async fn resolve( opts: Arc, From c66d8154eb89c7dd26778bd834a9c0739682d4df Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 17:13:06 +1000 Subject: [PATCH 0411/2020] Print out `resolution` in optimized path where confirmation isn't required. Signed-off-by: Jiahao XU --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.rs b/src/main.rs index 98573bc2..d3f28c11 100644 --- a/src/main.rs +++ b/src/main.rs @@ -299,6 +299,9 @@ async fn entry() -> Result<()> { tokio::spawn(async move { let resolution = await_task(task).await??; + + resolution.print(&opts); + install(resolution, opts, temp_dir_path, target).await }) }) From bcb46cd73692e86ad07e918f2ea3dd9da79a5d19 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 17:17:56 +1000 Subject: [PATCH 0412/2020] Optimize `main.rs`: Avoid frequent `Box::clone` Signed-off-by: Jiahao XU --- src/main.rs | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/main.rs b/src/main.rs index d3f28c11..54582586 100644 --- a/src/main.rs +++ b/src/main.rs @@ -230,10 +230,12 @@ async fn entry() -> Result<()> { let desired_targets = get_desired_targets(&opts.targets); // Compute install directory - let install_path = get_install_path(opts.install_path.as_deref()).ok_or_else(|| { - error!("No viable install path found of specified, try `--install-path`"); - miette!("No install path found or specified") - })?; + let install_path: Arc = Arc::from( + get_install_path(opts.install_path.as_deref()).ok_or_else(|| { + error!("No viable install path found of specified, try `--install-path`"); + miette!("No install path found or specified") + })?, + ); debug!("Using install path: {}", install_path.display()); // Create a temporary directory for downloads etc. @@ -241,6 +243,8 @@ async fn entry() -> Result<()> { .map_err(BinstallError::from) .wrap_err("Creating a temporary directory failed.")?; + let temp_dir_path: Arc = Arc::from(temp_dir.path()); + let tasks: Vec<_> = crate_names .into_iter() .map(|crate_name| { @@ -249,7 +253,7 @@ async fn entry() -> Result<()> { crate_name, desired_targets.clone(), cli_overrides.clone(), - temp_dir.path().to_path_buf(), + temp_dir_path.clone(), install_path.clone(), client.clone(), )) @@ -264,8 +268,6 @@ async fn entry() -> Result<()> { .as_str(), ); - let temp_dir_path = Arc::from(temp_dir.path()); - let tasks: Vec<_> = if !opts.dry_run && !opts.no_confirm { let mut resolutions = Vec::with_capacity(tasks.len()); for task in tasks { @@ -383,8 +385,8 @@ async fn resolve( crate_name: CrateName, desired_targets: DesiredTargets, cli_overrides: Arc, - temp_dir: PathBuf, - install_path: PathBuf, + temp_dir: Arc, + install_path: Arc, client: Client, ) -> Result { info!("Installing package: '{}'", crate_name); @@ -471,7 +473,7 @@ async fn resolve( meta, binaries, bin_path.clone(), - install_path, + install_path.to_path_buf(), )?; Ok(Resolution::Fetch { From 119192f8eea1d1fae801d8c3761bb1172ee55edf Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 17:21:35 +1000 Subject: [PATCH 0413/2020] Refactor `main.rs`: Print resolution in `resolve` This simplified `entry`. Signed-off-by: Jiahao XU --- src/main.rs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index 54582586..738985ae 100644 --- a/src/main.rs +++ b/src/main.rs @@ -274,10 +274,6 @@ async fn entry() -> Result<()> { resolutions.push(await_task(task).await??); } - for resolution in &resolutions { - resolution.print(&opts); - } - uithread.confirm().await?; resolutions @@ -301,9 +297,6 @@ async fn entry() -> Result<()> { tokio::spawn(async move { let resolution = await_task(task).await??; - - resolution.print(&opts); - install(resolution, opts, temp_dir_path, target).await }) }) @@ -454,7 +447,7 @@ async fn resolve( fetchers.add(QuickInstall::new(&client, &fetcher_data).await); } - match fetchers.first_available().await { + let resolution = match fetchers.first_available().await { Some(fetcher) => { // Build final metadata let fetcher_target = fetcher.target(); @@ -476,17 +469,21 @@ async fn resolve( install_path.to_path_buf(), )?; - Ok(Resolution::Fetch { + Resolution::Fetch { fetcher, package, crate_name, version, bin_path, bin_files, - }) + } } - None => Ok(Resolution::InstallFromSource { package }), - } + None => Resolution::InstallFromSource { package }, + }; + + resolution.print(&opts); + + Ok(resolution) } fn collect_bin_files( From 79ec12264700685d63ca8c055417c807ad58d44f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 17:25:35 +1000 Subject: [PATCH 0414/2020] Refactor `entry`: Avoid `Arc::clone` Signed-off-by: Jiahao XU --- src/main.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 738985ae..a324108a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -261,7 +261,7 @@ async fn entry() -> Result<()> { .collect(); let desired_targets = desired_targets.get().await; - let target = Arc::from( + let target: Arc = Arc::from( desired_targets .first() .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))? @@ -281,9 +281,9 @@ async fn entry() -> Result<()> { .map(|resolution| { tokio::spawn(install( resolution, - Arc::clone(&opts), - Arc::clone(&temp_dir_path), - Arc::clone(&target), + opts.clone(), + temp_dir_path.clone(), + target.clone(), )) }) .collect() @@ -291,9 +291,9 @@ async fn entry() -> Result<()> { tasks .into_iter() .map(|task| { - let opts = Arc::clone(&opts); - let temp_dir_path = Arc::clone(&temp_dir_path); - let target = Arc::clone(&target); + let opts = opts.clone(); + let temp_dir_path = temp_dir_path.clone(); + let target = target.clone(); tokio::spawn(async move { let resolution = await_task(task).await??; From 9552e0e8eddaec767b3cf61e54c0c5e502995311 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 17:31:29 +1000 Subject: [PATCH 0415/2020] Add comment to `entry` to improve readbility Signed-off-by: Jiahao XU --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index a324108a..7ed9199b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -225,8 +225,10 @@ async fn entry() -> Result<()> { ) .unwrap(); + // Initialize UI thread let mut uithread = UIThread::new(!opts.no_confirm); + // Launch target detection let desired_targets = get_desired_targets(&opts.targets); // Compute install directory @@ -245,6 +247,7 @@ async fn entry() -> Result<()> { let temp_dir_path: Arc = Arc::from(temp_dir.path()); + // Resolve crates let tasks: Vec<_> = crate_names .into_iter() .map(|crate_name| { @@ -269,6 +272,7 @@ async fn entry() -> Result<()> { ); let tasks: Vec<_> = if !opts.dry_run && !opts.no_confirm { + // Confirm let mut resolutions = Vec::with_capacity(tasks.len()); for task in tasks { resolutions.push(await_task(task).await??); @@ -276,6 +280,7 @@ async fn entry() -> Result<()> { uithread.confirm().await?; + // Install resolutions .into_iter() .map(|resolution| { @@ -288,6 +293,7 @@ async fn entry() -> Result<()> { }) .collect() } else { + // Install without confirm tasks .into_iter() .map(|task| { From 8cc085b1b6371f8ff031a1b2e521ccd21136fd96 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 20:46:44 +1000 Subject: [PATCH 0416/2020] Add new dep jobserver v0.1.24 Signed-off-by: Jiahao XU --- Cargo.lock | 1 + Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 34d280f4..0ab1f24e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -144,6 +144,7 @@ dependencies = [ "futures-util", "guess_host_triple", "home", + "jobserver", "log", "miette", "mimalloc", diff --git a/Cargo.toml b/Cargo.toml index 334e39d0..7fa926ff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,7 @@ dirs = "4.0.0" flate2 = { version = "1.0.24", features = ["zlib-ng"], default-features = false } futures-util = { version = "0.3.21", default-features = false } home = "0.5.3" +jobserver = "0.1.24" log = "0.4.14" miette = { version = "5.1.1", features = ["fancy-no-backtrace"] } mimalloc = { version = "0.1.29", default-features = false, optional = true } From c67c59b3ca577e0da02b9f38dce852eefca01eff Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 21:04:36 +1000 Subject: [PATCH 0417/2020] Impl new fn `helpers::create_jobserver_client` Signed-off-by: Jiahao XU --- src/helpers.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/helpers.rs b/src/helpers.rs index 2732f1e7..c442e478 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,7 +1,9 @@ use std::fmt::Debug; use std::fs; use std::io; +use std::num::NonZeroUsize; use std::path::{Path, PathBuf}; +use std::thread::available_parallelism; use bytes::Bytes; use cargo_toml::Manifest; @@ -42,6 +44,20 @@ pub async fn await_task(task: tokio::task::JoinHandle) -> miette::Result Result { + use jobserver::Client; + + // Safety: + // + // Client::from_env is unsafe because from_raw_fd is unsafe. + if let Some(client) = unsafe { Client::from_env() } { + Ok(client) + } else { + let ncore = available_parallelism().map(NonZeroUsize::get).unwrap_or(1); + Ok(Client::new(ncore)?) + } +} + /// Load binstall metadata from the crate `Cargo.toml` at the provided path pub fn load_manifest_path>( manifest_path: P, From fb0a6a551405810f502e806b59f396a9b7dda4aa Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 21:12:58 +1000 Subject: [PATCH 0418/2020] Use jobserver to limit parallism of `cargo-install` Since we execute multiple `cargo-install` concurrently, we must use jobserver to limit the parallism so that they won't spawn too much processes/threads to overload the system. Signed-off-by: Jiahao XU --- src/main.rs | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 7ed9199b..ae327319 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,6 +3,7 @@ use std::{ ffi::OsString, mem::take, path::{Path, PathBuf}, + process, process::{ExitCode, Termination}, sync::Arc, time::{Duration, Instant}, @@ -208,6 +209,9 @@ async fn entry() -> Result<()> { let crate_names = take(&mut opts.crate_names); let opts = Arc::new(opts); + // Create jobserver client + let jobserver_client = create_jobserver_client()?; + // Initialize reqwest client let client = create_reqwest_client(opts.secure, opts.min_tls_version.map(|v| v.into()))?; @@ -289,6 +293,7 @@ async fn entry() -> Result<()> { opts.clone(), temp_dir_path.clone(), target.clone(), + jobserver_client.clone(), )) }) .collect() @@ -300,10 +305,11 @@ async fn entry() -> Result<()> { let opts = opts.clone(); let temp_dir_path = temp_dir_path.clone(); let target = target.clone(); + let jobserver_client = jobserver_client.clone(); tokio::spawn(async move { let resolution = await_task(task).await??; - install(resolution, opts, temp_dir_path, target).await + install(resolution, opts, temp_dir_path, target, jobserver_client).await }) }) .collect() @@ -540,6 +546,7 @@ async fn install( opts: Arc, temp_dir: Arc, target: Arc, + jobserver_client: jobserver::Client, ) -> Result<()> { match resolution { Resolution::Fetch { @@ -557,7 +564,7 @@ async fn install( } Resolution::InstallFromSource { package } => { if !opts.dry_run { - install_from_source(package, target).await + install_from_source(package, target, jobserver_client).await } else { info!( "Dry-run: running `cargo install {} --version {} --target {target}`", @@ -667,12 +674,19 @@ async fn install_from_package( }) } -async fn install_from_source(package: Package, target: Arc) -> Result<()> { +async fn install_from_source( + package: Package, + target: Arc, + jobserver_client: jobserver::Client, +) -> Result<()> { debug!( "Running `cargo install {} --version {} --target {target}`", package.name, package.version ); - let mut child = Command::new("cargo") + let mut command = process::Command::new("cargo"); + jobserver_client.configure(&mut command); + + let mut child = Command::from(command) .arg("install") .arg(package.name) .arg("--version") From 072253ebaede3ea8e2c9522ad03d20762ca731ff Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 19 Jul 2022 00:32:56 +1000 Subject: [PATCH 0419/2020] Improve comment in `create_jobserver_client` Signed-off-by: Jiahao XU --- src/helpers.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/helpers.rs b/src/helpers.rs index c442e478..3e714c45 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -50,6 +50,8 @@ pub fn create_jobserver_client() -> Result { // Safety: // // Client::from_env is unsafe because from_raw_fd is unsafe. + // It doesn't do anything that is actually unsafe, like + // dereferencing pointer. if let Some(client) = unsafe { Client::from_env() } { Ok(client) } else { From b223990bb1fde7e8fcf6c716eaaba80ea55bb30e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 19 Jul 2022 00:35:48 +1000 Subject: [PATCH 0420/2020] Simplify `helpers::await_task` API Signed-off-by: Jiahao XU --- src/helpers.rs | 8 +++++--- src/main.rs | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 3e714c45..5ad0e7d6 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -39,9 +39,11 @@ pub use tls_version::TLSVersion; mod crate_name; pub use crate_name::CrateName; -pub async fn await_task(task: tokio::task::JoinHandle) -> miette::Result { - task.await - .map_err(|join_err| miette::miette!("Task failed to join: {}", join_err)) +pub async fn await_task(task: tokio::task::JoinHandle>) -> miette::Result { + match task.await { + Ok(res) => res, + Err(join_err) => Err(miette::miette!("Task failed to join: {}", join_err)), + } } pub fn create_jobserver_client() -> Result { diff --git a/src/main.rs b/src/main.rs index ae327319..62071031 100644 --- a/src/main.rs +++ b/src/main.rs @@ -279,7 +279,7 @@ async fn entry() -> Result<()> { // Confirm let mut resolutions = Vec::with_capacity(tasks.len()); for task in tasks { - resolutions.push(await_task(task).await??); + resolutions.push(await_task(task).await?); } uithread.confirm().await?; @@ -308,7 +308,7 @@ async fn entry() -> Result<()> { let jobserver_client = jobserver_client.clone(); tokio::spawn(async move { - let resolution = await_task(task).await??; + let resolution = await_task(task).await?; install(resolution, opts, temp_dir_path, target, jobserver_client).await }) }) @@ -316,7 +316,7 @@ async fn entry() -> Result<()> { }; for task in tasks { - await_task(task).await??; + await_task(task).await?; } if !opts.no_cleanup { From c6281d8ea0e7203d3ea2b1f22bad27562bbcb171 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 19 Jul 2022 00:39:27 +1000 Subject: [PATCH 0421/2020] Fix `opts.no_cleanup` behavior Signed-off-by: Jiahao XU --- src/main.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 62071031..d5d3c0d2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -319,7 +319,10 @@ async fn entry() -> Result<()> { await_task(task).await?; } - if !opts.no_cleanup { + if opts.no_cleanup { + // Consume temp_dir without removing it from fs. + temp_dir.into_path(); + } else { temp_dir.close().unwrap_or_else(|err| { warn!("Failed to clean up some resources: {err}"); }); From b026462018d905aedd5399e2b22438d8c3c4da89 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 19 Jul 2022 00:43:17 +1000 Subject: [PATCH 0422/2020] Refactor: Simplify struct `Resolution` Signed-off-by: Jiahao XU --- src/main.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index d5d3c0d2..9302f17c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -335,7 +335,7 @@ enum Resolution { Fetch { fetcher: Arc, package: Package, - crate_name: CrateName, + name: String, version: String, bin_path: PathBuf, bin_files: Vec, @@ -487,7 +487,7 @@ async fn resolve( Resolution::Fetch { fetcher, package, - crate_name, + name: crate_name.name, version, bin_path, bin_files, @@ -555,13 +555,13 @@ async fn install( Resolution::Fetch { fetcher, package, - crate_name, + name, version, bin_path, bin_files, } => { install_from_package( - fetcher, opts, package, crate_name, temp_dir, version, bin_path, bin_files, + fetcher, opts, package, name, temp_dir, version, bin_path, bin_files, ) .await } @@ -584,7 +584,7 @@ async fn install_from_package( fetcher: Arc, opts: Arc, package: Package, - crate_name: CrateName, + name: String, temp_dir: Arc, version: String, bin_path: PathBuf, @@ -627,7 +627,7 @@ async fn install_from_package( } let cvs = metafiles::CrateVersionSource { - name: crate_name.name.clone(), + name: name.clone(), version: package.version.parse().into_diagnostic()?, source: metafiles::Source::Registry( url::Url::parse("https://github.com/rust-lang/crates.io-index").unwrap(), From d58f340a45fcd167343460994717b01a420bb1d4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 19 Jul 2022 00:45:15 +1000 Subject: [PATCH 0423/2020] Test batch installtion in `run_tests_unix.sh` Signed-off-by: Jiahao XU --- ci-scripts/run_tests_unix.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ci-scripts/run_tests_unix.sh b/ci-scripts/run_tests_unix.sh index 9c3ca0b7..f07f89f7 100755 --- a/ci-scripts/run_tests_unix.sh +++ b/ci-scripts/run_tests_unix.sh @@ -6,9 +6,8 @@ bins="cargo-deb cargo-llvm-cov cargo-binstall" test_bins="cargo-deb cargo-llvm-cov" # Install binaries using cargo-binstall -for bin in $bins; do - "./$1" binstall --log-level debug --no-confirm "$bin" -done +# shellcheck disable=SC2086 +"./$1" binstall --log-level debug --no-confirm $bins # Test that the installed binaries can be run for bin in $test_bins; do From 758dab7d4f6990a72d9f5794e3d6ca7989174848 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 19 Jul 2022 11:59:10 +1000 Subject: [PATCH 0424/2020] Optimize `DesiredTargets`: Avoid mem alloc on `clone` Signed-off-by: Jiahao XU --- src/target.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/target.rs b/src/target.rs index fdca606f..c6bf8dd9 100644 --- a/src/target.rs +++ b/src/target.rs @@ -11,7 +11,7 @@ pub const TARGET: &str = env!("TARGET"); #[derive(Debug, Clone)] enum DesiredTargetsInner { AutoDetect(Arc>>), - Initialized(Vec), + Initialized(Arc>), } #[derive(Debug, Clone)] @@ -19,7 +19,7 @@ pub struct DesiredTargets(DesiredTargetsInner); impl DesiredTargets { fn initialized(targets: Vec) -> Self { - Self(DesiredTargetsInner::Initialized(targets)) + Self(DesiredTargetsInner::Initialized(Arc::new(targets))) } fn auto_detect() -> Self { From de7ecad32c5b2843fa78f3b5f920207963b2b6d7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 19 Jul 2022 12:02:09 +1000 Subject: [PATCH 0425/2020] Optimize: Avoid creation of `Arc` for target in `entry` Signed-off-by: Jiahao XU --- src/main.rs | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9302f17c..1493729a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -267,14 +267,6 @@ async fn entry() -> Result<()> { }) .collect(); - let desired_targets = desired_targets.get().await; - let target: Arc = Arc::from( - desired_targets - .first() - .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))? - .as_str(), - ); - let tasks: Vec<_> = if !opts.dry_run && !opts.no_confirm { // Confirm let mut resolutions = Vec::with_capacity(tasks.len()); @@ -292,7 +284,7 @@ async fn entry() -> Result<()> { resolution, opts.clone(), temp_dir_path.clone(), - target.clone(), + desired_targets.clone(), jobserver_client.clone(), )) }) @@ -304,12 +296,19 @@ async fn entry() -> Result<()> { .map(|task| { let opts = opts.clone(); let temp_dir_path = temp_dir_path.clone(); - let target = target.clone(); + let desired_target = desired_targets.clone(); let jobserver_client = jobserver_client.clone(); tokio::spawn(async move { let resolution = await_task(task).await?; - install(resolution, opts, temp_dir_path, target, jobserver_client).await + install( + resolution, + opts, + temp_dir_path, + desired_target, + jobserver_client, + ) + .await }) }) .collect() @@ -548,7 +547,7 @@ async fn install( resolution: Resolution, opts: Arc, temp_dir: Arc, - target: Arc, + desired_targets: DesiredTargets, jobserver_client: jobserver::Client, ) -> Result<()> { match resolution { @@ -566,6 +565,11 @@ async fn install( .await } Resolution::InstallFromSource { package } => { + let desired_targets = desired_targets.get().await; + let target = desired_targets + .first() + .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; + if !opts.dry_run { install_from_source(package, target, jobserver_client).await } else { @@ -679,7 +683,7 @@ async fn install_from_package( async fn install_from_source( package: Package, - target: Arc, + target: &str, jobserver_client: jobserver::Client, ) -> Result<()> { debug!( From 2bf7640729fe525a536acea2a28754106203ad7a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 19 Jul 2022 12:06:16 +1000 Subject: [PATCH 0426/2020] Optimize: Avoid double `spawn` if `no_confirm` Signed-off-by: Jiahao XU --- src/main.rs | 54 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 34 insertions(+), 20 deletions(-) diff --git a/src/main.rs b/src/main.rs index 1493729a..d2cf94b6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -251,23 +251,23 @@ async fn entry() -> Result<()> { let temp_dir_path: Arc = Arc::from(temp_dir.path()); - // Resolve crates - let tasks: Vec<_> = crate_names - .into_iter() - .map(|crate_name| { - tokio::spawn(resolve( - opts.clone(), - crate_name, - desired_targets.clone(), - cli_overrides.clone(), - temp_dir_path.clone(), - install_path.clone(), - client.clone(), - )) - }) - .collect(); - let tasks: Vec<_> = if !opts.dry_run && !opts.no_confirm { + // Resolve crates + let tasks: Vec<_> = crate_names + .into_iter() + .map(|crate_name| { + tokio::spawn(resolve( + opts.clone(), + crate_name, + desired_targets.clone(), + cli_overrides.clone(), + temp_dir_path.clone(), + install_path.clone(), + client.clone(), + )) + }) + .collect(); + // Confirm let mut resolutions = Vec::with_capacity(tasks.len()); for task in tasks { @@ -290,17 +290,31 @@ async fn entry() -> Result<()> { }) .collect() } else { - // Install without confirm - tasks + // Resolve crates and install without confirmation + crate_names .into_iter() - .map(|task| { + .map(|crate_name| { let opts = opts.clone(); let temp_dir_path = temp_dir_path.clone(); let desired_target = desired_targets.clone(); let jobserver_client = jobserver_client.clone(); + let desired_targets = desired_targets.clone(); + let client = client.clone(); + let cli_overrides = cli_overrides.clone(); + let install_path = install_path.clone(); tokio::spawn(async move { - let resolution = await_task(task).await?; + let resolution = resolve( + opts.clone(), + crate_name, + desired_targets.clone(), + cli_overrides, + temp_dir_path.clone(), + install_path, + client, + ) + .await?; + install( resolution, opts, From 67ca36a0b55d1b04ca078faecc7b4a6a52706ed6 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 19 Jul 2022 12:15:00 +1000 Subject: [PATCH 0427/2020] Fix `jobserver_client`: Create it as early as possible Signed-off-by: Jiahao XU --- src/main.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index d2cf94b6..cea320ce 100644 --- a/src/main.rs +++ b/src/main.rs @@ -171,10 +171,16 @@ impl Termination for MainExit { } fn main() -> MainExit { + // Create jobserver client + let jobserver_client = match create_jobserver_client() { + Ok(jobserver_client) => jobserver_client, + Err(binstall_err) => return MainExit::Error(binstall_err), + }; + let start = Instant::now(); let rt = Runtime::new().unwrap(); - let handle = rt.spawn(entry()); + let handle = rt.spawn(entry(jobserver_client)); let result = rt.block_on(handle); drop(rt); @@ -190,7 +196,7 @@ fn main() -> MainExit { }) } -async fn entry() -> Result<()> { +async fn entry(jobserver_client: jobserver::Client) -> Result<()> { // Filter extraneous arg when invoked by cargo // `cargo run -- --help` gives ["target/debug/cargo-binstall", "--help"] // `cargo binstall --help` gives ["/home/ryan/.cargo/bin/cargo-binstall", "binstall", "--help"] @@ -209,9 +215,6 @@ async fn entry() -> Result<()> { let crate_names = take(&mut opts.crate_names); let opts = Arc::new(opts); - // Create jobserver client - let jobserver_client = create_jobserver_client()?; - // Initialize reqwest client let client = create_reqwest_client(opts.secure, opts.min_tls_version.map(|v| v.into()))?; From 3961dbb84a34cea827b1eb40839e95df23d1fe16 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 20 Jul 2022 16:43:02 +1000 Subject: [PATCH 0428/2020] Add new dep `once_cell` v1.13.0 Signed-off-by: Jiahao XU --- Cargo.lock | 5 +++-- Cargo.toml | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0ab1f24e..f181cfcd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -148,6 +148,7 @@ dependencies = [ "log", "miette", "mimalloc", + "once_cell", "reqwest", "scopeguard", "semver", @@ -952,9 +953,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" +checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" [[package]] name = "os_str_bytes" diff --git a/Cargo.toml b/Cargo.toml index 7fa926ff..1a4699a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,6 +33,7 @@ jobserver = "0.1.24" log = "0.4.14" miette = { version = "5.1.1", features = ["fancy-no-backtrace"] } mimalloc = { version = "0.1.29", default-features = false, optional = true } +once_cell = "1.13.0" reqwest = { version = "0.11.11", features = ["rustls-tls", "stream"], default-features = false } scopeguard = "1.1.0" semver = "1.0.12" From 5bdffd9178805899c8d06a6d060778f32d8abec7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 20 Jul 2022 16:48:34 +1000 Subject: [PATCH 0429/2020] Refactor: Impl `Source::cratesio_registry` Makes initializing `metafiles::CrateVersionSource` more readable and improves performance since the parsing is now cached. Signed-off-by: Jiahao XU --- src/main.rs | 4 +--- src/metafiles/cvs.rs | 10 ++++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index cea320ce..9ed8f67f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -650,9 +650,7 @@ async fn install_from_package( let cvs = metafiles::CrateVersionSource { name: name.clone(), version: package.version.parse().into_diagnostic()?, - source: metafiles::Source::Registry( - url::Url::parse("https://github.com/rust-lang/crates.io-index").unwrap(), - ), + source: metafiles::Source::cratesio_registry(), }; info!("Installing binaries..."); diff --git a/src/metafiles/cvs.rs b/src/metafiles/cvs.rs index a111d02f..2b8f2214 100644 --- a/src/metafiles/cvs.rs +++ b/src/metafiles/cvs.rs @@ -1,6 +1,7 @@ use std::{fmt, str::FromStr}; use miette::Diagnostic; +use once_cell::sync::Lazy; use semver::Version; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use thiserror::Error; @@ -20,6 +21,15 @@ pub enum Source { Registry(Url), } +impl Source { + pub fn cratesio_registry() -> Source { + static CRATESIO: Lazy Url> = + Lazy::new(|| url::Url::parse("https://github.com/rust-lang/crates.io-index").unwrap()); + + Self::Registry(CRATESIO.clone()) + } +} + impl FromStr for CrateVersionSource { type Err = CvsParseError; fn from_str(s: &str) -> Result { From 1ebd4bdb75f268034d1c6a4e7529846a104158a8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 20 Jul 2022 16:58:12 +1000 Subject: [PATCH 0430/2020] Refactor: Reduce params of `install_from_package` Signed-off-by: Jiahao XU --- src/main.rs | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9ed8f67f..24d2f411 100644 --- a/src/main.rs +++ b/src/main.rs @@ -576,10 +576,13 @@ async fn install( bin_path, bin_files, } => { - install_from_package( - fetcher, opts, package, name, temp_dir, version, bin_path, bin_files, - ) - .await + let cvs = metafiles::CrateVersionSource { + name, + version: package.version.parse().into_diagnostic()?, + source: metafiles::Source::cratesio_registry(), + }; + + install_from_package(fetcher, opts, cvs, temp_dir, version, bin_path, bin_files).await } Resolution::InstallFromSource { package } => { let desired_targets = desired_targets.get().await; @@ -604,8 +607,7 @@ async fn install( async fn install_from_package( fetcher: Arc, opts: Arc, - package: Package, - name: String, + cvs: metafiles::CrateVersionSource, temp_dir: Arc, version: String, bin_path: PathBuf, @@ -647,12 +649,6 @@ async fn install_from_package( return Ok(()); } - let cvs = metafiles::CrateVersionSource { - name: name.clone(), - version: package.version.parse().into_diagnostic()?, - source: metafiles::Source::cratesio_registry(), - }; - info!("Installing binaries..."); block_in_place(|| { for file in &bin_files { From 1eedae1ee2ee575b9e1eee0bd0c6cfd591d2c677 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 20 Jul 2022 16:59:23 +1000 Subject: [PATCH 0431/2020] Rm unused param `temp_dir` from `install_from_package` Signed-off-by: Jiahao XU --- src/main.rs | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/main.rs b/src/main.rs index 24d2f411..2441f57a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -286,7 +286,6 @@ async fn entry(jobserver_client: jobserver::Client) -> Result<()> { tokio::spawn(install( resolution, opts.clone(), - temp_dir_path.clone(), desired_targets.clone(), jobserver_client.clone(), )) @@ -312,20 +311,13 @@ async fn entry(jobserver_client: jobserver::Client) -> Result<()> { crate_name, desired_targets.clone(), cli_overrides, - temp_dir_path.clone(), + temp_dir_path, install_path, client, ) .await?; - install( - resolution, - opts, - temp_dir_path, - desired_target, - jobserver_client, - ) - .await + install(resolution, opts, desired_target, jobserver_client).await }) }) .collect() @@ -563,7 +555,6 @@ fn collect_bin_files( async fn install( resolution: Resolution, opts: Arc, - temp_dir: Arc, desired_targets: DesiredTargets, jobserver_client: jobserver::Client, ) -> Result<()> { @@ -582,7 +573,7 @@ async fn install( source: metafiles::Source::cratesio_registry(), }; - install_from_package(fetcher, opts, cvs, temp_dir, version, bin_path, bin_files).await + install_from_package(fetcher, opts, cvs, version, bin_path, bin_files).await } Resolution::InstallFromSource { package } => { let desired_targets = desired_targets.get().await; @@ -603,12 +594,10 @@ async fn install( } } -#[allow(unused, clippy::too_many_arguments)] async fn install_from_package( fetcher: Arc, opts: Arc, cvs: metafiles::CrateVersionSource, - temp_dir: Arc, version: String, bin_path: PathBuf, bin_files: Vec, From 3b82e9e37595d6a7f93ea7ffaabeeda66f7a00d7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 20 Jul 2022 17:02:20 +1000 Subject: [PATCH 0432/2020] Rm unnecessary `clone` in `install_from_package` Signed-off-by: Jiahao XU --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2441f57a..e017db8d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -651,7 +651,7 @@ async fn install_from_package( } } - let bins: BTreeSet = bin_files.iter().map(|bin| bin.base_name.clone()).collect(); + let bins: BTreeSet = bin_files.into_iter().map(|bin| bin.base_name).collect(); { debug!("Writing .crates.toml"); @@ -664,7 +664,7 @@ async fn install_from_package( debug!("Writing .crates2.json"); let mut c2 = metafiles::v2::Crates2Json::load().unwrap_or_default(); c2.insert( - cvs.clone(), + cvs, metafiles::v2::CrateInfo { version_req: Some(version), bins, From 921774b8f90443d1a4a28a843615cc266a0a5b2f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 20 Jul 2022 17:26:24 +1000 Subject: [PATCH 0433/2020] Refactor: Extract new mod `binstall` Signed-off-by: Jiahao XU --- src/binstall.rs | 405 ++++++++++++++++++++++++++++++++++++++++++++++ src/lib.rs | 1 + src/main.rs | 421 +++--------------------------------------------- 3 files changed, 424 insertions(+), 403 deletions(-) create mode 100644 src/binstall.rs diff --git a/src/binstall.rs b/src/binstall.rs new file mode 100644 index 00000000..7ef832ed --- /dev/null +++ b/src/binstall.rs @@ -0,0 +1,405 @@ +use std::{ + collections::BTreeSet, + path::{Path, PathBuf}, + process, + sync::Arc, +}; + +use cargo_toml::{Package, Product}; +use log::{debug, error, info, warn}; +use miette::{miette, IntoDiagnostic, Result, WrapErr}; +use reqwest::Client; +use tokio::{process::Command, task::block_in_place}; + +use super::{ + bins, + fetchers::{Data, Fetcher, GhCrateMeta, MultiFetcher, QuickInstall}, + *, +}; + +pub struct Options { + pub no_symlinks: bool, + pub dry_run: bool, + pub version: Option, + pub manifest_path: Option, +} + +pub enum Resolution { + Fetch { + fetcher: Arc, + package: Package, + name: String, + version: String, + bin_path: PathBuf, + bin_files: Vec, + }, + InstallFromSource { + package: Package, + }, +} +impl Resolution { + fn print(&self, opts: &Options) { + match self { + Resolution::Fetch { + fetcher, bin_files, .. + } => { + let fetcher_target = fetcher.target(); + // Prompt user for confirmation + debug!( + "Found a binary install source: {} ({fetcher_target})", + fetcher.source_name() + ); + + if fetcher.is_third_party() { + warn!( + "The package will be downloaded from third-party source {}", + fetcher.source_name() + ); + } else { + info!( + "The package will be downloaded from {}", + fetcher.source_name() + ); + } + + info!("This will install the following binaries:"); + for file in bin_files { + info!(" - {}", file.preview_bin()); + } + + if !opts.no_symlinks { + info!("And create (or update) the following symlinks:"); + for file in bin_files { + info!(" - {}", file.preview_link()); + } + } + } + Resolution::InstallFromSource { .. } => { + warn!("The package will be installed from source (with cargo)",) + } + } + } +} + +pub async fn resolve( + opts: Arc, + crate_name: CrateName, + desired_targets: DesiredTargets, + cli_overrides: Arc, + temp_dir: Arc, + install_path: Arc, + client: Client, +) -> Result { + info!("Installing package: '{}'", crate_name); + + let mut version = match (&crate_name.version, &opts.version) { + (Some(version), None) => version.to_string(), + (None, Some(version)) => version.to_string(), + (Some(_), Some(_)) => Err(BinstallError::DuplicateVersionReq)?, + (None, None) => "*".to_string(), + }; + + if version + .chars() + .next() + .map(|ch| ch.is_ascii_digit()) + .unwrap_or(false) + { + version.insert(0, '='); + } + + // Fetch crate via crates.io, git, or use a local manifest path + // TODO: work out which of these to do based on `opts.name` + // TODO: support git-based fetches (whole repo name rather than just crate name) + let manifest = match opts.manifest_path.clone() { + Some(manifest_path) => load_manifest_path(manifest_path.join("Cargo.toml"))?, + None => fetch_crate_cratesio(&client, &crate_name.name, &version).await?, + }; + + let package = manifest.package.unwrap(); + + let (mut meta, binaries) = ( + package + .metadata + .as_ref() + .and_then(|m| m.binstall.clone()) + .unwrap_or_default(), + manifest.bin, + ); + + let mut fetchers = MultiFetcher::default(); + + let desired_targets = desired_targets.get().await; + + for target in desired_targets { + debug!("Building metadata for target: {target}"); + let mut target_meta = meta.clone(); + + // Merge any overrides + if let Some(o) = target_meta.overrides.get(target).cloned() { + target_meta.merge(&o); + } + + target_meta.merge(&cli_overrides); + debug!("Found metadata: {target_meta:?}"); + + let fetcher_data = Data { + name: package.name.clone(), + target: target.clone(), + version: package.version.clone(), + repo: package.repository.clone(), + meta: target_meta, + }; + + fetchers.add(GhCrateMeta::new(&client, &fetcher_data).await); + fetchers.add(QuickInstall::new(&client, &fetcher_data).await); + } + + let resolution = match fetchers.first_available().await { + Some(fetcher) => { + // Build final metadata + let fetcher_target = fetcher.target(); + if let Some(o) = meta.overrides.get(&fetcher_target.to_owned()).cloned() { + meta.merge(&o); + } + meta.merge(&cli_overrides); + + // Generate temporary binary path + let bin_path = temp_dir.join(format!("bin-{}", crate_name.name)); + debug!("Using temporary binary path: {}", bin_path.display()); + + let bin_files = collect_bin_files( + fetcher.as_ref(), + &package, + meta, + binaries, + bin_path.clone(), + install_path.to_path_buf(), + )?; + + Resolution::Fetch { + fetcher, + package, + name: crate_name.name, + version, + bin_path, + bin_files, + } + } + None => Resolution::InstallFromSource { package }, + }; + + resolution.print(&opts); + + Ok(resolution) +} + +fn collect_bin_files( + fetcher: &dyn Fetcher, + package: &Package, + mut meta: PkgMeta, + binaries: Vec, + bin_path: PathBuf, + install_path: PathBuf, +) -> Result> { + // Update meta + if fetcher.source_name() == "QuickInstall" { + // TODO: less of a hack? + meta.bin_dir = "{ bin }{ binary-ext }".to_string(); + } + + // Check binaries + if binaries.is_empty() { + error!("No binaries specified (or inferred from file system)"); + return Err(miette!( + "No binaries specified (or inferred from file system)" + )); + } + + // List files to be installed + // based on those found via Cargo.toml + let bin_data = bins::Data { + name: package.name.clone(), + target: fetcher.target().to_string(), + version: package.version.clone(), + repo: package.repository.clone(), + meta, + bin_path, + install_path, + }; + + // Create bin_files + let bin_files = binaries + .iter() + .map(|p| bins::BinFile::from_product(&bin_data, p)) + .collect::, BinstallError>>()?; + + Ok(bin_files) +} + +pub async fn install( + resolution: Resolution, + opts: Arc, + desired_targets: DesiredTargets, + jobserver_client: jobserver::Client, +) -> Result<()> { + match resolution { + Resolution::Fetch { + fetcher, + package, + name, + version, + bin_path, + bin_files, + } => { + let cvs = metafiles::CrateVersionSource { + name, + version: package.version.parse().into_diagnostic()?, + source: metafiles::Source::cratesio_registry(), + }; + + install_from_package(fetcher, opts, cvs, version, bin_path, bin_files).await + } + Resolution::InstallFromSource { package } => { + let desired_targets = desired_targets.get().await; + let target = desired_targets + .first() + .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; + + if !opts.dry_run { + install_from_source(package, target, jobserver_client).await + } else { + info!( + "Dry-run: running `cargo install {} --version {} --target {target}`", + package.name, package.version + ); + Ok(()) + } + } + } +} + +async fn install_from_package( + fetcher: Arc, + opts: Arc, + cvs: metafiles::CrateVersionSource, + version: String, + bin_path: PathBuf, + bin_files: Vec, +) -> Result<()> { + // Download package + if opts.dry_run { + info!("Dry run, not downloading package"); + } else { + fetcher.fetch_and_extract(&bin_path).await?; + } + + #[cfg(incomplete)] + { + // Fetch and check package signature if available + if let Some(pub_key) = meta.as_ref().map(|m| m.pub_key.clone()).flatten() { + debug!("Found public key: {pub_key}"); + + // Generate signature file URL + let mut sig_ctx = ctx.clone(); + sig_ctx.format = "sig".to_string(); + let sig_url = sig_ctx.render(&pkg_url)?; + + debug!("Fetching signature file: {sig_url}"); + + // Download signature file + let sig_path = temp_dir.join(format!("{pkg_name}.sig")); + download(&sig_url, &sig_path).await?; + + // TODO: do the signature check + unimplemented!() + } else { + warn!("No public key found, package signature could not be validated"); + } + } + + if opts.dry_run { + info!("Dry run, not proceeding"); + return Ok(()); + } + + info!("Installing binaries..."); + block_in_place(|| { + for file in &bin_files { + file.install_bin()?; + } + + // Generate symlinks + if !opts.no_symlinks { + for file in &bin_files { + file.install_link()?; + } + } + + let bins: BTreeSet = bin_files.into_iter().map(|bin| bin.base_name).collect(); + + { + debug!("Writing .crates.toml"); + let mut c1 = metafiles::v1::CratesToml::load().unwrap_or_default(); + c1.insert(cvs.clone(), bins.clone()); + c1.write()?; + } + + { + debug!("Writing .crates2.json"); + let mut c2 = metafiles::v2::Crates2Json::load().unwrap_or_default(); + c2.insert( + cvs, + metafiles::v2::CrateInfo { + version_req: Some(version), + bins, + profile: "release".into(), + target: fetcher.target().to_string(), + rustc: format!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")), + ..Default::default() + }, + ); + c2.write()?; + } + + Ok(()) + }) +} + +async fn install_from_source( + package: Package, + target: &str, + jobserver_client: jobserver::Client, +) -> Result<()> { + debug!( + "Running `cargo install {} --version {} --target {target}`", + package.name, package.version + ); + let mut command = process::Command::new("cargo"); + jobserver_client.configure(&mut command); + + let mut child = Command::from(command) + .arg("install") + .arg(package.name) + .arg("--version") + .arg(package.version) + .arg("--target") + .arg(&*target) + .spawn() + .into_diagnostic() + .wrap_err("Spawning cargo install failed.")?; + debug!("Spawned command pid={:?}", child.id()); + + let status = child + .wait() + .await + .into_diagnostic() + .wrap_err("Running cargo install failed.")?; + if status.success() { + info!("Cargo finished successfully"); + Ok(()) + } else { + error!("Cargo errored! {status:?}"); + Err(miette!("Cargo install error")) + } +} diff --git a/src/lib.rs b/src/lib.rs index eb475ac4..8738dc31 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -12,6 +12,7 @@ pub mod helpers; pub use helpers::*; pub mod bins; +pub mod binstall; pub mod fetchers; pub mod metafiles; diff --git a/src/main.rs b/src/main.rs index e017db8d..fb64bf41 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,32 +1,20 @@ use std::{ - collections::BTreeSet, ffi::OsString, mem::take, path::{Path, PathBuf}, - process, process::{ExitCode, Termination}, sync::Arc, time::{Duration, Instant}, }; -use cargo_toml::{Package, Product}; use clap::Parser; use log::{debug, error, info, warn, LevelFilter}; -use miette::{miette, IntoDiagnostic, Result, WrapErr}; -use reqwest::Client; +use miette::{miette, Result, WrapErr}; use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; use tempfile::TempDir; -use tokio::{ - process::Command, - runtime::Runtime, - task::{block_in_place, JoinError}, -}; +use tokio::{runtime::Runtime, task::JoinError}; -use cargo_binstall::{ - bins, - fetchers::{Data, Fetcher, GhCrateMeta, MultiFetcher, QuickInstall}, - *, -}; +use cargo_binstall::{binstall, *}; #[cfg(feature = "mimalloc")] #[global_allocator] @@ -213,7 +201,6 @@ async fn entry(jobserver_client: jobserver::Client) -> Result<()> { bin_dir: opts.bin_dir.take(), }); let crate_names = take(&mut opts.crate_names); - let opts = Arc::new(opts); // Initialize reqwest client let client = create_reqwest_client(opts.secure, opts.min_tls_version.map(|v| v.into()))?; @@ -254,13 +241,21 @@ async fn entry(jobserver_client: jobserver::Client) -> Result<()> { let temp_dir_path: Arc = Arc::from(temp_dir.path()); + // Create binstall_opts + let binstall_opts = Arc::new(binstall::Options { + no_symlinks: opts.no_symlinks, + dry_run: opts.dry_run, + version: opts.version.take(), + manifest_path: opts.manifest_path.take(), + }); + let tasks: Vec<_> = if !opts.dry_run && !opts.no_confirm { // Resolve crates let tasks: Vec<_> = crate_names .into_iter() .map(|crate_name| { - tokio::spawn(resolve( - opts.clone(), + tokio::spawn(binstall::resolve( + binstall_opts.clone(), crate_name, desired_targets.clone(), cli_overrides.clone(), @@ -283,9 +278,9 @@ async fn entry(jobserver_client: jobserver::Client) -> Result<()> { resolutions .into_iter() .map(|resolution| { - tokio::spawn(install( + tokio::spawn(binstall::install( resolution, - opts.clone(), + binstall_opts.clone(), desired_targets.clone(), jobserver_client.clone(), )) @@ -296,7 +291,7 @@ async fn entry(jobserver_client: jobserver::Client) -> Result<()> { crate_names .into_iter() .map(|crate_name| { - let opts = opts.clone(); + let opts = binstall_opts.clone(); let temp_dir_path = temp_dir_path.clone(); let desired_target = desired_targets.clone(); let jobserver_client = jobserver_client.clone(); @@ -306,7 +301,7 @@ async fn entry(jobserver_client: jobserver::Client) -> Result<()> { let install_path = install_path.clone(); tokio::spawn(async move { - let resolution = resolve( + let resolution = binstall::resolve( opts.clone(), crate_name, desired_targets.clone(), @@ -317,7 +312,7 @@ async fn entry(jobserver_client: jobserver::Client) -> Result<()> { ) .await?; - install(resolution, opts, desired_target, jobserver_client).await + binstall::install(resolution, opts, desired_target, jobserver_client).await }) }) .collect() @@ -338,383 +333,3 @@ async fn entry(jobserver_client: jobserver::Client) -> Result<()> { Ok(()) } - -enum Resolution { - Fetch { - fetcher: Arc, - package: Package, - name: String, - version: String, - bin_path: PathBuf, - bin_files: Vec, - }, - InstallFromSource { - package: Package, - }, -} -impl Resolution { - fn print(&self, opts: &Options) { - match self { - Resolution::Fetch { - fetcher, bin_files, .. - } => { - let fetcher_target = fetcher.target(); - // Prompt user for confirmation - debug!( - "Found a binary install source: {} ({fetcher_target})", - fetcher.source_name() - ); - - if fetcher.is_third_party() { - warn!( - "The package will be downloaded from third-party source {}", - fetcher.source_name() - ); - } else { - info!( - "The package will be downloaded from {}", - fetcher.source_name() - ); - } - - info!("This will install the following binaries:"); - for file in bin_files { - info!(" - {}", file.preview_bin()); - } - - if !opts.no_symlinks { - info!("And create (or update) the following symlinks:"); - for file in bin_files { - info!(" - {}", file.preview_link()); - } - } - } - Resolution::InstallFromSource { .. } => { - warn!("The package will be installed from source (with cargo)",) - } - } - } -} - -async fn resolve( - opts: Arc, - crate_name: CrateName, - desired_targets: DesiredTargets, - cli_overrides: Arc, - temp_dir: Arc, - install_path: Arc, - client: Client, -) -> Result { - info!("Installing package: '{}'", crate_name); - - let mut version = match (&crate_name.version, &opts.version) { - (Some(version), None) => version.to_string(), - (None, Some(version)) => version.to_string(), - (Some(_), Some(_)) => Err(BinstallError::DuplicateVersionReq)?, - (None, None) => "*".to_string(), - }; - - if version - .chars() - .next() - .map(|ch| ch.is_ascii_digit()) - .unwrap_or(false) - { - version.insert(0, '='); - } - - // Fetch crate via crates.io, git, or use a local manifest path - // TODO: work out which of these to do based on `opts.name` - // TODO: support git-based fetches (whole repo name rather than just crate name) - let manifest = match opts.manifest_path.clone() { - Some(manifest_path) => load_manifest_path(manifest_path.join("Cargo.toml"))?, - None => fetch_crate_cratesio(&client, &crate_name.name, &version).await?, - }; - - let package = manifest.package.unwrap(); - - let (mut meta, binaries) = ( - package - .metadata - .as_ref() - .and_then(|m| m.binstall.clone()) - .unwrap_or_default(), - manifest.bin, - ); - - let mut fetchers = MultiFetcher::default(); - - let desired_targets = desired_targets.get().await; - - for target in desired_targets { - debug!("Building metadata for target: {target}"); - let mut target_meta = meta.clone(); - - // Merge any overrides - if let Some(o) = target_meta.overrides.get(target).cloned() { - target_meta.merge(&o); - } - - target_meta.merge(&cli_overrides); - debug!("Found metadata: {target_meta:?}"); - - let fetcher_data = Data { - name: package.name.clone(), - target: target.clone(), - version: package.version.clone(), - repo: package.repository.clone(), - meta: target_meta, - }; - - fetchers.add(GhCrateMeta::new(&client, &fetcher_data).await); - fetchers.add(QuickInstall::new(&client, &fetcher_data).await); - } - - let resolution = match fetchers.first_available().await { - Some(fetcher) => { - // Build final metadata - let fetcher_target = fetcher.target(); - if let Some(o) = meta.overrides.get(&fetcher_target.to_owned()).cloned() { - meta.merge(&o); - } - meta.merge(&cli_overrides); - - // Generate temporary binary path - let bin_path = temp_dir.join(format!("bin-{}", crate_name.name)); - debug!("Using temporary binary path: {}", bin_path.display()); - - let bin_files = collect_bin_files( - fetcher.as_ref(), - &package, - meta, - binaries, - bin_path.clone(), - install_path.to_path_buf(), - )?; - - Resolution::Fetch { - fetcher, - package, - name: crate_name.name, - version, - bin_path, - bin_files, - } - } - None => Resolution::InstallFromSource { package }, - }; - - resolution.print(&opts); - - Ok(resolution) -} - -fn collect_bin_files( - fetcher: &dyn Fetcher, - package: &Package, - mut meta: PkgMeta, - binaries: Vec, - bin_path: PathBuf, - install_path: PathBuf, -) -> Result> { - // Update meta - if fetcher.source_name() == "QuickInstall" { - // TODO: less of a hack? - meta.bin_dir = "{ bin }{ binary-ext }".to_string(); - } - - // Check binaries - if binaries.is_empty() { - error!("No binaries specified (or inferred from file system)"); - return Err(miette!( - "No binaries specified (or inferred from file system)" - )); - } - - // List files to be installed - // based on those found via Cargo.toml - let bin_data = bins::Data { - name: package.name.clone(), - target: fetcher.target().to_string(), - version: package.version.clone(), - repo: package.repository.clone(), - meta, - bin_path, - install_path, - }; - - // Create bin_files - let bin_files = binaries - .iter() - .map(|p| bins::BinFile::from_product(&bin_data, p)) - .collect::, BinstallError>>()?; - - Ok(bin_files) -} - -async fn install( - resolution: Resolution, - opts: Arc, - desired_targets: DesiredTargets, - jobserver_client: jobserver::Client, -) -> Result<()> { - match resolution { - Resolution::Fetch { - fetcher, - package, - name, - version, - bin_path, - bin_files, - } => { - let cvs = metafiles::CrateVersionSource { - name, - version: package.version.parse().into_diagnostic()?, - source: metafiles::Source::cratesio_registry(), - }; - - install_from_package(fetcher, opts, cvs, version, bin_path, bin_files).await - } - Resolution::InstallFromSource { package } => { - let desired_targets = desired_targets.get().await; - let target = desired_targets - .first() - .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; - - if !opts.dry_run { - install_from_source(package, target, jobserver_client).await - } else { - info!( - "Dry-run: running `cargo install {} --version {} --target {target}`", - package.name, package.version - ); - Ok(()) - } - } - } -} - -async fn install_from_package( - fetcher: Arc, - opts: Arc, - cvs: metafiles::CrateVersionSource, - version: String, - bin_path: PathBuf, - bin_files: Vec, -) -> Result<()> { - // Download package - if opts.dry_run { - info!("Dry run, not downloading package"); - } else { - fetcher.fetch_and_extract(&bin_path).await?; - } - - #[cfg(incomplete)] - { - // Fetch and check package signature if available - if let Some(pub_key) = meta.as_ref().map(|m| m.pub_key.clone()).flatten() { - debug!("Found public key: {pub_key}"); - - // Generate signature file URL - let mut sig_ctx = ctx.clone(); - sig_ctx.format = "sig".to_string(); - let sig_url = sig_ctx.render(&pkg_url)?; - - debug!("Fetching signature file: {sig_url}"); - - // Download signature file - let sig_path = temp_dir.join(format!("{pkg_name}.sig")); - download(&sig_url, &sig_path).await?; - - // TODO: do the signature check - unimplemented!() - } else { - warn!("No public key found, package signature could not be validated"); - } - } - - if opts.dry_run { - info!("Dry run, not proceeding"); - return Ok(()); - } - - info!("Installing binaries..."); - block_in_place(|| { - for file in &bin_files { - file.install_bin()?; - } - - // Generate symlinks - if !opts.no_symlinks { - for file in &bin_files { - file.install_link()?; - } - } - - let bins: BTreeSet = bin_files.into_iter().map(|bin| bin.base_name).collect(); - - { - debug!("Writing .crates.toml"); - let mut c1 = metafiles::v1::CratesToml::load().unwrap_or_default(); - c1.insert(cvs.clone(), bins.clone()); - c1.write()?; - } - - { - debug!("Writing .crates2.json"); - let mut c2 = metafiles::v2::Crates2Json::load().unwrap_or_default(); - c2.insert( - cvs, - metafiles::v2::CrateInfo { - version_req: Some(version), - bins, - profile: "release".into(), - target: fetcher.target().to_string(), - rustc: format!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")), - ..Default::default() - }, - ); - c2.write()?; - } - - Ok(()) - }) -} - -async fn install_from_source( - package: Package, - target: &str, - jobserver_client: jobserver::Client, -) -> Result<()> { - debug!( - "Running `cargo install {} --version {} --target {target}`", - package.name, package.version - ); - let mut command = process::Command::new("cargo"); - jobserver_client.configure(&mut command); - - let mut child = Command::from(command) - .arg("install") - .arg(package.name) - .arg("--version") - .arg(package.version) - .arg("--target") - .arg(&*target) - .spawn() - .into_diagnostic() - .wrap_err("Spawning cargo install failed.")?; - debug!("Spawned command pid={:?}", child.id()); - - let status = child - .wait() - .await - .into_diagnostic() - .wrap_err("Running cargo install failed.")?; - if status.success() { - info!("Cargo finished successfully"); - Ok(()) - } else { - error!("Cargo errored! {status:?}"); - Err(miette!("Cargo install error")) - } -} From 5e356040124da62315b4aeec482f99fb2f1357fa Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 20 Jul 2022 17:28:53 +1000 Subject: [PATCH 0434/2020] Refactor: Extract new mod `binstall/resolve.rs` Signed-off-by: Jiahao XU --- src/binstall.rs | 234 ++-------------------------------------- src/binstall/resolve.rs | 229 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 236 insertions(+), 227 deletions(-) create mode 100644 src/binstall/resolve.rs diff --git a/src/binstall.rs b/src/binstall.rs index 7ef832ed..20c5d808 100644 --- a/src/binstall.rs +++ b/src/binstall.rs @@ -1,21 +1,14 @@ -use std::{ - collections::BTreeSet, - path::{Path, PathBuf}, - process, - sync::Arc, -}; +use std::{collections::BTreeSet, path::PathBuf, process, sync::Arc}; -use cargo_toml::{Package, Product}; -use log::{debug, error, info, warn}; +use cargo_toml::Package; +use log::{debug, error, info}; use miette::{miette, IntoDiagnostic, Result, WrapErr}; -use reqwest::Client; use tokio::{process::Command, task::block_in_place}; -use super::{ - bins, - fetchers::{Data, Fetcher, GhCrateMeta, MultiFetcher, QuickInstall}, - *, -}; +use super::{bins, fetchers::Fetcher, *}; + +mod resolve; +pub use resolve::*; pub struct Options { pub no_symlinks: bool, @@ -24,219 +17,6 @@ pub struct Options { pub manifest_path: Option, } -pub enum Resolution { - Fetch { - fetcher: Arc, - package: Package, - name: String, - version: String, - bin_path: PathBuf, - bin_files: Vec, - }, - InstallFromSource { - package: Package, - }, -} -impl Resolution { - fn print(&self, opts: &Options) { - match self { - Resolution::Fetch { - fetcher, bin_files, .. - } => { - let fetcher_target = fetcher.target(); - // Prompt user for confirmation - debug!( - "Found a binary install source: {} ({fetcher_target})", - fetcher.source_name() - ); - - if fetcher.is_third_party() { - warn!( - "The package will be downloaded from third-party source {}", - fetcher.source_name() - ); - } else { - info!( - "The package will be downloaded from {}", - fetcher.source_name() - ); - } - - info!("This will install the following binaries:"); - for file in bin_files { - info!(" - {}", file.preview_bin()); - } - - if !opts.no_symlinks { - info!("And create (or update) the following symlinks:"); - for file in bin_files { - info!(" - {}", file.preview_link()); - } - } - } - Resolution::InstallFromSource { .. } => { - warn!("The package will be installed from source (with cargo)",) - } - } - } -} - -pub async fn resolve( - opts: Arc, - crate_name: CrateName, - desired_targets: DesiredTargets, - cli_overrides: Arc, - temp_dir: Arc, - install_path: Arc, - client: Client, -) -> Result { - info!("Installing package: '{}'", crate_name); - - let mut version = match (&crate_name.version, &opts.version) { - (Some(version), None) => version.to_string(), - (None, Some(version)) => version.to_string(), - (Some(_), Some(_)) => Err(BinstallError::DuplicateVersionReq)?, - (None, None) => "*".to_string(), - }; - - if version - .chars() - .next() - .map(|ch| ch.is_ascii_digit()) - .unwrap_or(false) - { - version.insert(0, '='); - } - - // Fetch crate via crates.io, git, or use a local manifest path - // TODO: work out which of these to do based on `opts.name` - // TODO: support git-based fetches (whole repo name rather than just crate name) - let manifest = match opts.manifest_path.clone() { - Some(manifest_path) => load_manifest_path(manifest_path.join("Cargo.toml"))?, - None => fetch_crate_cratesio(&client, &crate_name.name, &version).await?, - }; - - let package = manifest.package.unwrap(); - - let (mut meta, binaries) = ( - package - .metadata - .as_ref() - .and_then(|m| m.binstall.clone()) - .unwrap_or_default(), - manifest.bin, - ); - - let mut fetchers = MultiFetcher::default(); - - let desired_targets = desired_targets.get().await; - - for target in desired_targets { - debug!("Building metadata for target: {target}"); - let mut target_meta = meta.clone(); - - // Merge any overrides - if let Some(o) = target_meta.overrides.get(target).cloned() { - target_meta.merge(&o); - } - - target_meta.merge(&cli_overrides); - debug!("Found metadata: {target_meta:?}"); - - let fetcher_data = Data { - name: package.name.clone(), - target: target.clone(), - version: package.version.clone(), - repo: package.repository.clone(), - meta: target_meta, - }; - - fetchers.add(GhCrateMeta::new(&client, &fetcher_data).await); - fetchers.add(QuickInstall::new(&client, &fetcher_data).await); - } - - let resolution = match fetchers.first_available().await { - Some(fetcher) => { - // Build final metadata - let fetcher_target = fetcher.target(); - if let Some(o) = meta.overrides.get(&fetcher_target.to_owned()).cloned() { - meta.merge(&o); - } - meta.merge(&cli_overrides); - - // Generate temporary binary path - let bin_path = temp_dir.join(format!("bin-{}", crate_name.name)); - debug!("Using temporary binary path: {}", bin_path.display()); - - let bin_files = collect_bin_files( - fetcher.as_ref(), - &package, - meta, - binaries, - bin_path.clone(), - install_path.to_path_buf(), - )?; - - Resolution::Fetch { - fetcher, - package, - name: crate_name.name, - version, - bin_path, - bin_files, - } - } - None => Resolution::InstallFromSource { package }, - }; - - resolution.print(&opts); - - Ok(resolution) -} - -fn collect_bin_files( - fetcher: &dyn Fetcher, - package: &Package, - mut meta: PkgMeta, - binaries: Vec, - bin_path: PathBuf, - install_path: PathBuf, -) -> Result> { - // Update meta - if fetcher.source_name() == "QuickInstall" { - // TODO: less of a hack? - meta.bin_dir = "{ bin }{ binary-ext }".to_string(); - } - - // Check binaries - if binaries.is_empty() { - error!("No binaries specified (or inferred from file system)"); - return Err(miette!( - "No binaries specified (or inferred from file system)" - )); - } - - // List files to be installed - // based on those found via Cargo.toml - let bin_data = bins::Data { - name: package.name.clone(), - target: fetcher.target().to_string(), - version: package.version.clone(), - repo: package.repository.clone(), - meta, - bin_path, - install_path, - }; - - // Create bin_files - let bin_files = binaries - .iter() - .map(|p| bins::BinFile::from_product(&bin_data, p)) - .collect::, BinstallError>>()?; - - Ok(bin_files) -} - pub async fn install( resolution: Resolution, opts: Arc, diff --git a/src/binstall/resolve.rs b/src/binstall/resolve.rs new file mode 100644 index 00000000..33592e60 --- /dev/null +++ b/src/binstall/resolve.rs @@ -0,0 +1,229 @@ +use std::{ + path::{Path, PathBuf}, + sync::Arc, +}; + +use cargo_toml::{Package, Product}; +use log::{debug, error, info, warn}; +use miette::{miette, Result}; +use reqwest::Client; + +use super::Options; +use crate::{ + bins, + fetchers::{Data, Fetcher, GhCrateMeta, MultiFetcher, QuickInstall}, + *, +}; + +pub enum Resolution { + Fetch { + fetcher: Arc, + package: Package, + name: String, + version: String, + bin_path: PathBuf, + bin_files: Vec, + }, + InstallFromSource { + package: Package, + }, +} +impl Resolution { + fn print(&self, opts: &Options) { + match self { + Resolution::Fetch { + fetcher, bin_files, .. + } => { + let fetcher_target = fetcher.target(); + // Prompt user for confirmation + debug!( + "Found a binary install source: {} ({fetcher_target})", + fetcher.source_name() + ); + + if fetcher.is_third_party() { + warn!( + "The package will be downloaded from third-party source {}", + fetcher.source_name() + ); + } else { + info!( + "The package will be downloaded from {}", + fetcher.source_name() + ); + } + + info!("This will install the following binaries:"); + for file in bin_files { + info!(" - {}", file.preview_bin()); + } + + if !opts.no_symlinks { + info!("And create (or update) the following symlinks:"); + for file in bin_files { + info!(" - {}", file.preview_link()); + } + } + } + Resolution::InstallFromSource { .. } => { + warn!("The package will be installed from source (with cargo)",) + } + } + } +} + +pub async fn resolve( + opts: Arc, + crate_name: CrateName, + desired_targets: DesiredTargets, + cli_overrides: Arc, + temp_dir: Arc, + install_path: Arc, + client: Client, +) -> Result { + info!("Installing package: '{}'", crate_name); + + let mut version = match (&crate_name.version, &opts.version) { + (Some(version), None) => version.to_string(), + (None, Some(version)) => version.to_string(), + (Some(_), Some(_)) => Err(BinstallError::DuplicateVersionReq)?, + (None, None) => "*".to_string(), + }; + + if version + .chars() + .next() + .map(|ch| ch.is_ascii_digit()) + .unwrap_or(false) + { + version.insert(0, '='); + } + + // Fetch crate via crates.io, git, or use a local manifest path + // TODO: work out which of these to do based on `opts.name` + // TODO: support git-based fetches (whole repo name rather than just crate name) + let manifest = match opts.manifest_path.clone() { + Some(manifest_path) => load_manifest_path(manifest_path.join("Cargo.toml"))?, + None => fetch_crate_cratesio(&client, &crate_name.name, &version).await?, + }; + + let package = manifest.package.unwrap(); + + let (mut meta, binaries) = ( + package + .metadata + .as_ref() + .and_then(|m| m.binstall.clone()) + .unwrap_or_default(), + manifest.bin, + ); + + let mut fetchers = MultiFetcher::default(); + + let desired_targets = desired_targets.get().await; + + for target in desired_targets { + debug!("Building metadata for target: {target}"); + let mut target_meta = meta.clone(); + + // Merge any overrides + if let Some(o) = target_meta.overrides.get(target).cloned() { + target_meta.merge(&o); + } + + target_meta.merge(&cli_overrides); + debug!("Found metadata: {target_meta:?}"); + + let fetcher_data = Data { + name: package.name.clone(), + target: target.clone(), + version: package.version.clone(), + repo: package.repository.clone(), + meta: target_meta, + }; + + fetchers.add(GhCrateMeta::new(&client, &fetcher_data).await); + fetchers.add(QuickInstall::new(&client, &fetcher_data).await); + } + + let resolution = match fetchers.first_available().await { + Some(fetcher) => { + // Build final metadata + let fetcher_target = fetcher.target(); + if let Some(o) = meta.overrides.get(&fetcher_target.to_owned()).cloned() { + meta.merge(&o); + } + meta.merge(&cli_overrides); + + // Generate temporary binary path + let bin_path = temp_dir.join(format!("bin-{}", crate_name.name)); + debug!("Using temporary binary path: {}", bin_path.display()); + + let bin_files = collect_bin_files( + fetcher.as_ref(), + &package, + meta, + binaries, + bin_path.clone(), + install_path.to_path_buf(), + )?; + + Resolution::Fetch { + fetcher, + package, + name: crate_name.name, + version, + bin_path, + bin_files, + } + } + None => Resolution::InstallFromSource { package }, + }; + + resolution.print(&opts); + + Ok(resolution) +} + +fn collect_bin_files( + fetcher: &dyn Fetcher, + package: &Package, + mut meta: PkgMeta, + binaries: Vec, + bin_path: PathBuf, + install_path: PathBuf, +) -> Result> { + // Update meta + if fetcher.source_name() == "QuickInstall" { + // TODO: less of a hack? + meta.bin_dir = "{ bin }{ binary-ext }".to_string(); + } + + // Check binaries + if binaries.is_empty() { + error!("No binaries specified (or inferred from file system)"); + return Err(miette!( + "No binaries specified (or inferred from file system)" + )); + } + + // List files to be installed + // based on those found via Cargo.toml + let bin_data = bins::Data { + name: package.name.clone(), + target: fetcher.target().to_string(), + version: package.version.clone(), + repo: package.repository.clone(), + meta, + bin_path, + install_path, + }; + + // Create bin_files + let bin_files = binaries + .iter() + .map(|p| bins::BinFile::from_product(&bin_data, p)) + .collect::, BinstallError>>()?; + + Ok(bin_files) +} From 2490cd5a847bcf165ce58227db2ad8bc4d40373c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 20 Jul 2022 17:30:34 +1000 Subject: [PATCH 0435/2020] Refactor: Extract new mod `binstall/install.rs` Signed-off-by: Jiahao XU --- src/binstall.rs | 179 +--------------------------------------- src/binstall/install.rs | 176 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 180 insertions(+), 175 deletions(-) create mode 100644 src/binstall/install.rs diff --git a/src/binstall.rs b/src/binstall.rs index 20c5d808..5de574bb 100644 --- a/src/binstall.rs +++ b/src/binstall.rs @@ -1,185 +1,14 @@ -use std::{collections::BTreeSet, path::PathBuf, process, sync::Arc}; - -use cargo_toml::Package; -use log::{debug, error, info}; -use miette::{miette, IntoDiagnostic, Result, WrapErr}; -use tokio::{process::Command, task::block_in_place}; - -use super::{bins, fetchers::Fetcher, *}; +use std::path::PathBuf; mod resolve; pub use resolve::*; +mod install; +pub use install::*; + pub struct Options { pub no_symlinks: bool, pub dry_run: bool, pub version: Option, pub manifest_path: Option, } - -pub async fn install( - resolution: Resolution, - opts: Arc, - desired_targets: DesiredTargets, - jobserver_client: jobserver::Client, -) -> Result<()> { - match resolution { - Resolution::Fetch { - fetcher, - package, - name, - version, - bin_path, - bin_files, - } => { - let cvs = metafiles::CrateVersionSource { - name, - version: package.version.parse().into_diagnostic()?, - source: metafiles::Source::cratesio_registry(), - }; - - install_from_package(fetcher, opts, cvs, version, bin_path, bin_files).await - } - Resolution::InstallFromSource { package } => { - let desired_targets = desired_targets.get().await; - let target = desired_targets - .first() - .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; - - if !opts.dry_run { - install_from_source(package, target, jobserver_client).await - } else { - info!( - "Dry-run: running `cargo install {} --version {} --target {target}`", - package.name, package.version - ); - Ok(()) - } - } - } -} - -async fn install_from_package( - fetcher: Arc, - opts: Arc, - cvs: metafiles::CrateVersionSource, - version: String, - bin_path: PathBuf, - bin_files: Vec, -) -> Result<()> { - // Download package - if opts.dry_run { - info!("Dry run, not downloading package"); - } else { - fetcher.fetch_and_extract(&bin_path).await?; - } - - #[cfg(incomplete)] - { - // Fetch and check package signature if available - if let Some(pub_key) = meta.as_ref().map(|m| m.pub_key.clone()).flatten() { - debug!("Found public key: {pub_key}"); - - // Generate signature file URL - let mut sig_ctx = ctx.clone(); - sig_ctx.format = "sig".to_string(); - let sig_url = sig_ctx.render(&pkg_url)?; - - debug!("Fetching signature file: {sig_url}"); - - // Download signature file - let sig_path = temp_dir.join(format!("{pkg_name}.sig")); - download(&sig_url, &sig_path).await?; - - // TODO: do the signature check - unimplemented!() - } else { - warn!("No public key found, package signature could not be validated"); - } - } - - if opts.dry_run { - info!("Dry run, not proceeding"); - return Ok(()); - } - - info!("Installing binaries..."); - block_in_place(|| { - for file in &bin_files { - file.install_bin()?; - } - - // Generate symlinks - if !opts.no_symlinks { - for file in &bin_files { - file.install_link()?; - } - } - - let bins: BTreeSet = bin_files.into_iter().map(|bin| bin.base_name).collect(); - - { - debug!("Writing .crates.toml"); - let mut c1 = metafiles::v1::CratesToml::load().unwrap_or_default(); - c1.insert(cvs.clone(), bins.clone()); - c1.write()?; - } - - { - debug!("Writing .crates2.json"); - let mut c2 = metafiles::v2::Crates2Json::load().unwrap_or_default(); - c2.insert( - cvs, - metafiles::v2::CrateInfo { - version_req: Some(version), - bins, - profile: "release".into(), - target: fetcher.target().to_string(), - rustc: format!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")), - ..Default::default() - }, - ); - c2.write()?; - } - - Ok(()) - }) -} - -async fn install_from_source( - package: Package, - target: &str, - jobserver_client: jobserver::Client, -) -> Result<()> { - debug!( - "Running `cargo install {} --version {} --target {target}`", - package.name, package.version - ); - let mut command = process::Command::new("cargo"); - jobserver_client.configure(&mut command); - - let mut child = Command::from(command) - .arg("install") - .arg(package.name) - .arg("--version") - .arg(package.version) - .arg("--target") - .arg(&*target) - .spawn() - .into_diagnostic() - .wrap_err("Spawning cargo install failed.")?; - debug!("Spawned command pid={:?}", child.id()); - - let status = child - .wait() - .await - .into_diagnostic() - .wrap_err("Running cargo install failed.")?; - if status.success() { - info!("Cargo finished successfully"); - Ok(()) - } else { - error!("Cargo errored! {status:?}"); - Err(miette!("Cargo install error")) - } -} diff --git a/src/binstall/install.rs b/src/binstall/install.rs new file mode 100644 index 00000000..777ebd53 --- /dev/null +++ b/src/binstall/install.rs @@ -0,0 +1,176 @@ +use std::{collections::BTreeSet, path::PathBuf, process, sync::Arc}; + +use cargo_toml::Package; +use log::{debug, error, info}; +use miette::{miette, IntoDiagnostic, Result, WrapErr}; +use tokio::{process::Command, task::block_in_place}; + +use super::{Options, Resolution}; +use crate::{bins, fetchers::Fetcher, *}; + +pub async fn install( + resolution: Resolution, + opts: Arc, + desired_targets: DesiredTargets, + jobserver_client: jobserver::Client, +) -> Result<()> { + match resolution { + Resolution::Fetch { + fetcher, + package, + name, + version, + bin_path, + bin_files, + } => { + let cvs = metafiles::CrateVersionSource { + name, + version: package.version.parse().into_diagnostic()?, + source: metafiles::Source::cratesio_registry(), + }; + + install_from_package(fetcher, opts, cvs, version, bin_path, bin_files).await + } + Resolution::InstallFromSource { package } => { + let desired_targets = desired_targets.get().await; + let target = desired_targets + .first() + .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; + + if !opts.dry_run { + install_from_source(package, target, jobserver_client).await + } else { + info!( + "Dry-run: running `cargo install {} --version {} --target {target}`", + package.name, package.version + ); + Ok(()) + } + } + } +} + +async fn install_from_package( + fetcher: Arc, + opts: Arc, + cvs: metafiles::CrateVersionSource, + version: String, + bin_path: PathBuf, + bin_files: Vec, +) -> Result<()> { + // Download package + if opts.dry_run { + info!("Dry run, not downloading package"); + } else { + fetcher.fetch_and_extract(&bin_path).await?; + } + + #[cfg(incomplete)] + { + // Fetch and check package signature if available + if let Some(pub_key) = meta.as_ref().map(|m| m.pub_key.clone()).flatten() { + debug!("Found public key: {pub_key}"); + + // Generate signature file URL + let mut sig_ctx = ctx.clone(); + sig_ctx.format = "sig".to_string(); + let sig_url = sig_ctx.render(&pkg_url)?; + + debug!("Fetching signature file: {sig_url}"); + + // Download signature file + let sig_path = temp_dir.join(format!("{pkg_name}.sig")); + download(&sig_url, &sig_path).await?; + + // TODO: do the signature check + unimplemented!() + } else { + warn!("No public key found, package signature could not be validated"); + } + } + + if opts.dry_run { + info!("Dry run, not proceeding"); + return Ok(()); + } + + info!("Installing binaries..."); + block_in_place(|| { + for file in &bin_files { + file.install_bin()?; + } + + // Generate symlinks + if !opts.no_symlinks { + for file in &bin_files { + file.install_link()?; + } + } + + let bins: BTreeSet = bin_files.into_iter().map(|bin| bin.base_name).collect(); + + { + debug!("Writing .crates.toml"); + let mut c1 = metafiles::v1::CratesToml::load().unwrap_or_default(); + c1.insert(cvs.clone(), bins.clone()); + c1.write()?; + } + + { + debug!("Writing .crates2.json"); + let mut c2 = metafiles::v2::Crates2Json::load().unwrap_or_default(); + c2.insert( + cvs, + metafiles::v2::CrateInfo { + version_req: Some(version), + bins, + profile: "release".into(), + target: fetcher.target().to_string(), + rustc: format!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")), + ..Default::default() + }, + ); + c2.write()?; + } + + Ok(()) + }) +} + +async fn install_from_source( + package: Package, + target: &str, + jobserver_client: jobserver::Client, +) -> Result<()> { + debug!( + "Running `cargo install {} --version {} --target {target}`", + package.name, package.version + ); + let mut command = process::Command::new("cargo"); + jobserver_client.configure(&mut command); + + let mut child = Command::from(command) + .arg("install") + .arg(package.name) + .arg("--version") + .arg(package.version) + .arg("--target") + .arg(&*target) + .spawn() + .into_diagnostic() + .wrap_err("Spawning cargo install failed.")?; + debug!("Spawned command pid={:?}", child.id()); + + let status = child + .wait() + .await + .into_diagnostic() + .wrap_err("Running cargo install failed.")?; + if status.success() { + info!("Cargo finished successfully"); + Ok(()) + } else { + error!("Cargo errored! {status:?}"); + Err(miette!("Cargo install error")) + } +} From a1d7a7c1172ec95baeff81a72eeab63c6e883ca3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 20 Jul 2022 17:37:02 +1000 Subject: [PATCH 0436/2020] Refactor: Extract new mod `jobserver_client.rs` Signed-off-by: Jiahao XU --- src/helpers.rs | 21 +++------------------ src/helpers/jobserver_client.rs | 20 ++++++++++++++++++++ 2 files changed, 23 insertions(+), 18 deletions(-) create mode 100644 src/helpers/jobserver_client.rs diff --git a/src/helpers.rs b/src/helpers.rs index 5ad0e7d6..3dc2de96 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,9 +1,7 @@ use std::fmt::Debug; use std::fs; use std::io; -use std::num::NonZeroUsize; use std::path::{Path, PathBuf}; -use std::thread::available_parallelism; use bytes::Bytes; use cargo_toml::Manifest; @@ -30,6 +28,9 @@ pub use ui_thread::UIThread; mod extracter; mod stream_readable; +mod jobserver_client; +pub use jobserver_client::*; + mod path_ext; pub use path_ext::*; @@ -46,22 +47,6 @@ pub async fn await_task(task: tokio::task::JoinHandle>) -> } } -pub fn create_jobserver_client() -> Result { - use jobserver::Client; - - // Safety: - // - // Client::from_env is unsafe because from_raw_fd is unsafe. - // It doesn't do anything that is actually unsafe, like - // dereferencing pointer. - if let Some(client) = unsafe { Client::from_env() } { - Ok(client) - } else { - let ncore = available_parallelism().map(NonZeroUsize::get).unwrap_or(1); - Ok(Client::new(ncore)?) - } -} - /// Load binstall metadata from the crate `Cargo.toml` at the provided path pub fn load_manifest_path>( manifest_path: P, diff --git a/src/helpers/jobserver_client.rs b/src/helpers/jobserver_client.rs new file mode 100644 index 00000000..740fcc38 --- /dev/null +++ b/src/helpers/jobserver_client.rs @@ -0,0 +1,20 @@ +use std::num::NonZeroUsize; +use std::thread::available_parallelism; + +use crate::BinstallError; + +pub fn create_jobserver_client() -> Result { + use jobserver::Client; + + // Safety: + // + // Client::from_env is unsafe because from_raw_fd is unsafe. + // It doesn't do anything that is actually unsafe, like + // dereferencing pointer. + if let Some(client) = unsafe { Client::from_env() } { + Ok(client) + } else { + let ncore = available_parallelism().map(NonZeroUsize::get).unwrap_or(1); + Ok(Client::new(ncore)?) + } +} From 3981400ebb2e5891c946ad24bd3ca23f2c88942e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 20 Jul 2022 17:54:17 +1000 Subject: [PATCH 0437/2020] Create new type `LazyJobserverClient` and use it to replace `jobserver::Client`. Signed-off-by: Jiahao XU --- src/binstall/install.rs | 6 +++-- src/helpers/jobserver_client.rs | 39 +++++++++++++++++++++++---------- src/main.rs | 7 ++---- 3 files changed, 33 insertions(+), 19 deletions(-) diff --git a/src/binstall/install.rs b/src/binstall/install.rs index 777ebd53..6c1830ea 100644 --- a/src/binstall/install.rs +++ b/src/binstall/install.rs @@ -12,7 +12,7 @@ pub async fn install( resolution: Resolution, opts: Arc, desired_targets: DesiredTargets, - jobserver_client: jobserver::Client, + jobserver_client: LazyJobserverClient, ) -> Result<()> { match resolution { Resolution::Fetch { @@ -140,8 +140,10 @@ async fn install_from_package( async fn install_from_source( package: Package, target: &str, - jobserver_client: jobserver::Client, + lazy_jobserver_client: LazyJobserverClient, ) -> Result<()> { + let jobserver_client = lazy_jobserver_client.get().await?; + debug!( "Running `cargo install {} --version {} --target {target}`", package.name, package.version diff --git a/src/helpers/jobserver_client.rs b/src/helpers/jobserver_client.rs index 740fcc38..14a6c5f2 100644 --- a/src/helpers/jobserver_client.rs +++ b/src/helpers/jobserver_client.rs @@ -1,20 +1,35 @@ use std::num::NonZeroUsize; +use std::sync::Arc; use std::thread::available_parallelism; +use jobserver::Client; +use tokio::sync::OnceCell; + use crate::BinstallError; -pub fn create_jobserver_client() -> Result { - use jobserver::Client; +#[derive(Clone)] +pub struct LazyJobserverClient(Arc>); - // Safety: - // - // Client::from_env is unsafe because from_raw_fd is unsafe. - // It doesn't do anything that is actually unsafe, like - // dereferencing pointer. - if let Some(client) = unsafe { Client::from_env() } { - Ok(client) - } else { - let ncore = available_parallelism().map(NonZeroUsize::get).unwrap_or(1); - Ok(Client::new(ncore)?) +impl LazyJobserverClient { + /// This must be called at the start of the program since + /// `Client::from_env` requires that. + #[allow(clippy::new_without_default)] + pub fn new() -> Self { + // Safety: + // + // Client::from_env is unsafe because from_raw_fd is unsafe. + // It doesn't do anything that is actually unsafe, like + // dereferencing pointer. + let opt = unsafe { Client::from_env() }; + Self(Arc::new(OnceCell::new_with(opt))) + } + + pub async fn get(&self) -> Result<&Client, BinstallError> { + self.0 + .get_or_try_init(|| async { + let ncore = available_parallelism().map(NonZeroUsize::get).unwrap_or(1); + Ok(Client::new(ncore)?) + }) + .await } } diff --git a/src/main.rs b/src/main.rs index fb64bf41..50bd5a48 100644 --- a/src/main.rs +++ b/src/main.rs @@ -160,10 +160,7 @@ impl Termination for MainExit { fn main() -> MainExit { // Create jobserver client - let jobserver_client = match create_jobserver_client() { - Ok(jobserver_client) => jobserver_client, - Err(binstall_err) => return MainExit::Error(binstall_err), - }; + let jobserver_client = LazyJobserverClient::new(); let start = Instant::now(); @@ -184,7 +181,7 @@ fn main() -> MainExit { }) } -async fn entry(jobserver_client: jobserver::Client) -> Result<()> { +async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { // Filter extraneous arg when invoked by cargo // `cargo run -- --help` gives ["target/debug/cargo-binstall", "--help"] // `cargo binstall --help` gives ["/home/ryan/.cargo/bin/cargo-binstall", "binstall", "--help"] From 6324f9a7ca05caa79fd8d88543b631fb7b906949 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 20 Jul 2022 18:00:22 +1000 Subject: [PATCH 0438/2020] Use `opt-level = "z"` for release On M1 MacOS Darwin 21.5, this produces binary that is 0.3M smaller while taking 10s less to build. Signed-off-by: Jiahao XU --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 1a4699a9..85363916 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -78,7 +78,7 @@ mimalloc = ["dep:mimalloc"] env_logger = "0.9.0" [profile.release] -opt-level = "s" +opt-level = "z" lto = true codegen-units = 1 panic = "abort" From 1e81babea8ab402d21ae04960ffff32e8bcff1f4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 20 Jul 2022 18:14:17 +1000 Subject: [PATCH 0439/2020] Enable feature "static" of dep xz2 Signed-off-by: Jiahao XU --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 85363916..d3449ba5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,7 @@ tinytemplate = "1.2.1" tokio = { version = "1.20.0", features = ["rt-multi-thread", "process", "sync"], default-features = false } toml = "0.5.9" url = "2.2.2" -xz2 = "0.1.6" +xz2 = { version = "0.1.6", features = ["static"] } # Disable all features of zip except for features of compression algorithms: # Disabled features include: From f59d0817330f26eb3ec4649db92f70ab0c89f7c7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 20 Jul 2022 18:18:39 +1000 Subject: [PATCH 0440/2020] Only enable feature "thin" of dep zstd Disable "bindgen" that creates a bindgen at build time, which takes quite some time and pulls in dep "bindgen" at bulid time. Also disable feature "zstdmt" as we don't need multithreading here. Signed-off-by: Jiahao XU --- Cargo.lock | 170 ++--------------------------------------------------- Cargo.toml | 5 +- 2 files changed, 6 insertions(+), 169 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f181cfcd..4ddc98b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,15 +17,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "ansi_term" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d52a9bb7ec0cf484c551830a7ce27bd20d67eac647e1befb56b0be4ee39a55d2" -dependencies = [ - "winapi", -] - [[package]] name = "async-trait" version = "0.1.56" @@ -60,29 +51,6 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" -[[package]] -name = "bindgen" -version = "0.59.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bd2a9a458e8f4304c52c43ebb0cfbd520289f8379a52e329a38afda99bf8eb8" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "clap 2.34.0", - "env_logger", - "lazy_static", - "lazycell", - "log", - "peeking_take_while", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "which", -] - [[package]] name = "bitflags" version = "1.3.2" @@ -136,7 +104,7 @@ dependencies = [ "bytes", "bzip2", "cargo_toml", - "clap 3.2.12", + "clap", "crates_io_api", "dirs", "env_logger", @@ -189,15 +157,6 @@ dependencies = [ "jobserver", ] -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - [[package]] name = "cfg-if" version = "1.0.0" @@ -215,32 +174,6 @@ dependencies = [ "serde", ] -[[package]] -name = "clang-sys" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a050e2153c5be08febd6734e29298e844fdb0fa21aeddd63b4eb7baa106c69b" -dependencies = [ - "glob", - "libc", - "libloading", -] - -[[package]] -name = "clap" -version = "2.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "ansi_term", - "atty", - "bitflags", - "strsim 0.8.0", - "textwrap 0.11.0", - "unicode-width", - "vec_map", -] - [[package]] name = "clap" version = "3.2.12" @@ -253,9 +186,9 @@ dependencies = [ "clap_lex", "indexmap", "once_cell", - "strsim 0.10.0", + "strsim", "termcolor", - "textwrap 0.15.0", + "textwrap", ] [[package]] @@ -345,12 +278,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" - [[package]] name = "encoding_rs" version = "0.8.31" @@ -542,12 +469,6 @@ dependencies = [ "wasi", ] -[[package]] -name = "glob" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" - [[package]] name = "guess_host_triple" version = "0.1.3" @@ -758,28 +679,12 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "libc" version = "0.2.126" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" -[[package]] -name = "libloading" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" -dependencies = [ - "cfg-if", - "winapi", -] - [[package]] name = "libmimalloc-sys" version = "0.1.25" @@ -845,7 +750,7 @@ dependencies = [ "supports-hyperlinks", "supports-unicode", "terminal_size", - "textwrap 0.15.0", + "textwrap", "thiserror", "unicode-width", ] @@ -876,12 +781,6 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - [[package]] name = "miniz_oxide" version = "0.5.3" @@ -903,16 +802,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "nom" -version = "7.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8903e5a29a317527874d0402f867152a3d21c908bb0b933e416c65e301d4c36" -dependencies = [ - "memchr", - "minimal-lexical", -] - [[package]] name = "num-integer" version = "0.1.45" @@ -969,12 +858,6 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "decf7381921fea4dcb2549c5667eda59b3ec297ab7e2b5fc33eac69d2e7da87b" -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - [[package]] name = "percent-encoding" version = "2.1.0" @@ -1142,12 +1025,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustls" version = "0.20.6" @@ -1246,12 +1123,6 @@ dependencies = [ "serde", ] -[[package]] -name = "shlex" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" - [[package]] name = "signal-hook-registry" version = "1.4.0" @@ -1300,12 +1171,6 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - [[package]] name = "strsim" version = "0.10.0" @@ -1414,15 +1279,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - [[package]] name = "textwrap" version = "0.15.0" @@ -1636,12 +1492,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "version_check" version = "0.9.4" @@ -1759,17 +1609,6 @@ dependencies = [ "webpki", ] -[[package]] -name = "which" -version = "4.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c4fb54e6113b6a8772ee41c3404fb0301ac79604489467e0a9ce1f3e97c24ae" -dependencies = [ - "either", - "lazy_static", - "libc", -] - [[package]] name = "winapi" version = "0.3.9" @@ -1910,7 +1749,6 @@ version = "1.6.3+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc49afa5c8d634e75761feda8c592051e7eeb4683ba827211eb0d731d3402ea8" dependencies = [ - "bindgen", "cc", "libc", ] diff --git a/Cargo.toml b/Cargo.toml index d3449ba5..13beab1a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -63,9 +63,8 @@ zip = { version = "0.6.2", default-features = false, features = ["deflate", "bzi # Since zip 0.6.2 depends on zstd 0.10.0, we also have to use 0.10.0 here, # otherwise there will be a link conflict. # -# Enable feature bindgen to generate C bindings. -# Enable feature zstdmt to enable multithreading in libzstd. -zstd = { version = "0.10.0", features = ["bindgen", "zstdmt"], default-features = false } +# Enable feature thin to optimize zstd by size. +zstd = { version = "0.10.0", features = ["thin"], default-features = false } [target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] guess_host_triple = "0.1.3" From f7af4efa220ecfde354686fb54b0e3b0017d57ea Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 20 Jul 2022 18:26:45 +1000 Subject: [PATCH 0441/2020] Disable feature flag "thin" of dep zstd attempt to fix the CI Signed-off-by: Jiahao XU --- Cargo.toml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 13beab1a..883a9e72 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -62,9 +62,7 @@ zip = { version = "0.6.2", default-features = false, features = ["deflate", "bzi # zstd is also depended by zip. # Since zip 0.6.2 depends on zstd 0.10.0, we also have to use 0.10.0 here, # otherwise there will be a link conflict. -# -# Enable feature thin to optimize zstd by size. -zstd = { version = "0.10.0", features = ["thin"], default-features = false } +zstd = { version = "0.10.0", default-features = false } [target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] guess_host_triple = "0.1.3" From 08190ac179d73f656500fc12ad8a4ffe4b07c08a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 20 Jul 2022 19:09:59 +1000 Subject: [PATCH 0442/2020] Add `ManifestPathConflictedWithBatchInstallation` to error `BinstallError` Signed-off-by: Jiahao XU --- src/errors.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/errors.rs b/src/errors.rs index ec19f29a..6be71942 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -175,6 +175,16 @@ pub enum BinstallError { help("Remove the `--version req` or simply use `$crate_name`") )] DuplicateVersionReq, + + /// This occurs when you specified `--manifest-path` while also + /// specifing multiple crates to install. + #[error("If you use --manifest-path, then you can only specify one crate to install")] + #[diagnostic( + severity(error), + code(binstall::manifest_path), + help("Remove the `--manifest-path` or only specify one `$crate_name`") + )] + ManifestPathConflictedWithBatchInstallation, } impl BinstallError { @@ -202,6 +212,7 @@ impl BinstallError { VersionMismatch { .. } => 82, VersionUnavailable { .. } => 83, DuplicateVersionReq => 84, + ManifestPathConflictedWithBatchInstallation => 85, }; // reserved codes From cfe7703af955c8e2248f8d69382b639794503698 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 20 Jul 2022 19:11:02 +1000 Subject: [PATCH 0443/2020] Forbid `--manifest-path` to used with batch installation Signed-off-by: Jiahao XU --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.rs b/src/main.rs index 50bd5a48..51847dcb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -198,6 +198,9 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { bin_dir: opts.bin_dir.take(), }); let crate_names = take(&mut opts.crate_names); + if crate_names.len() > 1 && opts.manifest_path.is_some() { + return Err(BinstallError::ManifestPathConflictedWithBatchInstallation.into()); + } // Initialize reqwest client let client = create_reqwest_client(opts.secure, opts.min_tls_version.map(|v| v.into()))?; From c418c2dbbebfbdca5ee0ef484c300281cdeaeece Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 12:44:54 +1000 Subject: [PATCH 0444/2020] Optimize arg parsing: Avoid O(n) `Vec::remove` Signed-off-by: Jiahao XU --- src/main.rs | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 51847dcb..a11e72f0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -186,9 +186,20 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { // `cargo run -- --help` gives ["target/debug/cargo-binstall", "--help"] // `cargo binstall --help` gives ["/home/ryan/.cargo/bin/cargo-binstall", "binstall", "--help"] let mut args: Vec = std::env::args_os().collect(); - if args.len() > 1 && args[1] == "binstall" { - args.remove(1); - } + let args = if args.len() > 1 && args[1] == "binstall" { + // Equivalent to + // + // args.remove(1); + // + // But is O(1) + args.swap(0, 1); + let mut args = args.into_iter(); + drop(args.next().unwrap()); + + args + } else { + args.into_iter() + }; // Load options let mut opts = Options::parse_from(args); From 6180e9ec3e8d9f2263a40b119ed6b94453d15ba7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 13:00:58 +1000 Subject: [PATCH 0445/2020] Add comment in fn `resolve` Signed-off-by: Jiahao XU --- src/binstall/resolve.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/binstall/resolve.rs b/src/binstall/resolve.rs index 33592e60..91ad1f57 100644 --- a/src/binstall/resolve.rs +++ b/src/binstall/resolve.rs @@ -90,6 +90,7 @@ pub async fn resolve( (None, None) => "*".to_string(), }; + // Treat 0.1.2 as =0.1.2 if version .chars() .next() From dc8d8ccd8850566276e00d9f7fddf31d54c9c378 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 13:06:34 +1000 Subject: [PATCH 0446/2020] Optimize `MultiFetcher`: Start `check`ing ASAP Signed-off-by: Jiahao XU --- src/fetchers.rs | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/fetchers.rs b/src/fetchers.rs index 237a2b85..dc60dfc6 100644 --- a/src/fetchers.rs +++ b/src/fetchers.rs @@ -47,30 +47,21 @@ pub struct Data { pub meta: PkgMeta, } +type FetcherJoinHandle = AutoAbortJoinHandle>; + #[derive(Default)] -pub struct MultiFetcher { - fetchers: Vec>, -} +pub struct MultiFetcher(Vec<(Arc, FetcherJoinHandle)>); impl MultiFetcher { pub fn add(&mut self, fetcher: Arc) { - self.fetchers.push(fetcher); + self.0.push(( + fetcher.clone(), + AutoAbortJoinHandle::new(tokio::spawn(async move { fetcher.check().await })), + )); } - pub async fn first_available(&self) -> Option> { - let handles: Vec<_> = self - .fetchers - .iter() - .cloned() - .map(|fetcher| { - ( - fetcher.clone(), - AutoAbortJoinHandle::new(tokio::spawn(async move { fetcher.check().await })), - ) - }) - .collect(); - - for (fetcher, handle) in handles { + pub async fn first_available(self) -> Option> { + for (fetcher, handle) in self.0 { match handle.await { Ok(Ok(true)) => return Some(fetcher), Ok(Ok(false)) => (), From 305a4e4c306c1e665c4d7b76635e2a6043709bc8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 13:07:20 +1000 Subject: [PATCH 0447/2020] Improve err msg in `MultiFetcher::first_available` Signed-off-by: Jiahao XU --- src/fetchers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fetchers.rs b/src/fetchers.rs index dc60dfc6..46917e0f 100644 --- a/src/fetchers.rs +++ b/src/fetchers.rs @@ -74,7 +74,7 @@ impl MultiFetcher { } Err(join_err) => { debug!( - "Error while checking fetcher {}: {}", + "Error while joining the task that checks the fetcher {}: {}", fetcher.source_name(), join_err ); From 21eac33e1f6f7b3c205d3be8c707160125e28ec3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 13:13:07 +1000 Subject: [PATCH 0448/2020] Optimize: Create new fn `helpers::cargo_home` that caches return value of `home::cargo_home` Signed-off-by: Jiahao XU --- src/helpers.rs | 10 ++++++++++ src/metafiles/v1.rs | 3 ++- src/metafiles/v2.rs | 3 ++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 3dc2de96..3381c839 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,12 +1,14 @@ use std::fmt::Debug; use std::fs; use std::io; +use std::ops; use std::path::{Path, PathBuf}; use bytes::Bytes; use cargo_toml::Manifest; use futures_util::stream::Stream; use log::debug; +use once_cell::sync::OnceCell; use reqwest::{tls, Client, ClientBuilder, Method, Response}; use serde::Serialize; use tempfile::NamedTempFile; @@ -40,6 +42,14 @@ pub use tls_version::TLSVersion; mod crate_name; pub use crate_name::CrateName; +pub fn cargo_home() -> Result<&'static Path, io::Error> { + static CARGO_HOME: OnceCell = OnceCell::new(); + + CARGO_HOME + .get_or_try_init(home::cargo_home) + .map(ops::Deref::deref) +} + pub async fn await_task(task: tokio::task::JoinHandle>) -> miette::Result { match task.await { Ok(res) => res, diff --git a/src/metafiles/v1.rs b/src/metafiles/v1.rs index 1180814a..19f0ab8f 100644 --- a/src/metafiles/v1.rs +++ b/src/metafiles/v1.rs @@ -10,6 +10,7 @@ use serde::{Deserialize, Serialize}; use thiserror::Error; use super::CrateVersionSource; +use crate::cargo_home; #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CratesToml { @@ -18,7 +19,7 @@ pub struct CratesToml { impl CratesToml { pub fn default_path() -> Result { - Ok(home::cargo_home()?.join(".crates.toml")) + Ok(cargo_home()?.join(".crates.toml")) } pub fn load() -> Result { diff --git a/src/metafiles/v2.rs b/src/metafiles/v2.rs index 70c4e46e..4724b1e8 100644 --- a/src/metafiles/v2.rs +++ b/src/metafiles/v2.rs @@ -9,6 +9,7 @@ use serde::{Deserialize, Serialize}; use thiserror::Error; use super::CrateVersionSource; +use crate::cargo_home; #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct Crates2Json { @@ -39,7 +40,7 @@ pub struct CrateInfo { impl Crates2Json { pub fn default_path() -> Result { - Ok(home::cargo_home()?.join(".crates2.json")) + Ok(cargo_home()?.join(".crates2.json")) } pub fn load() -> Result { From f09004b5b7f40933465d876f2e51d48f926222ae Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 14:50:51 +1000 Subject: [PATCH 0449/2020] Optimize: Share `crates_io_api::AsyncClient` So that the connection pool and the rate limit will be shared. Signed-off-by: Jiahao XU --- src/binstall/resolve.rs | 6 +++++- src/drivers/crates_io.rs | 24 ++++++++---------------- src/main.rs | 10 ++++++++++ 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/src/binstall/resolve.rs b/src/binstall/resolve.rs index 91ad1f57..31b885bd 100644 --- a/src/binstall/resolve.rs +++ b/src/binstall/resolve.rs @@ -72,6 +72,7 @@ impl Resolution { } } +#[allow(clippy::too_many_arguments)] pub async fn resolve( opts: Arc, crate_name: CrateName, @@ -80,6 +81,7 @@ pub async fn resolve( temp_dir: Arc, install_path: Arc, client: Client, + crates_io_api_client: crates_io_api::AsyncClient, ) -> Result { info!("Installing package: '{}'", crate_name); @@ -105,7 +107,9 @@ pub async fn resolve( // TODO: support git-based fetches (whole repo name rather than just crate name) let manifest = match opts.manifest_path.clone() { Some(manifest_path) => load_manifest_path(manifest_path.join("Cargo.toml"))?, - None => fetch_crate_cratesio(&client, &crate_name.name, &version).await?, + None => { + fetch_crate_cratesio(&client, &crates_io_api_client, &crate_name.name, &version).await? + } }; let package = manifest.package.unwrap(); diff --git a/src/drivers/crates_io.rs b/src/drivers/crates_io.rs index a389f5d1..b7e96086 100644 --- a/src/drivers/crates_io.rs +++ b/src/drivers/crates_io.rs @@ -1,5 +1,4 @@ use std::path::PathBuf; -use std::time::Duration; use cargo_toml::Manifest; use crates_io_api::AsyncClient; @@ -18,28 +17,21 @@ use visitor::ManifestVisitor; /// Fetch a crate Cargo.toml by name and version from crates.io pub async fn fetch_crate_cratesio( client: &Client, + crates_io_api_client: &AsyncClient, name: &str, version_req: &str, ) -> Result, BinstallError> { // Fetch / update index debug!("Looking up crate information"); - // Build crates.io api client - let api_client = AsyncClient::new( - "cargo-binstall (https://github.com/ryankurte/cargo-binstall)", - Duration::from_millis(100), - ) - .expect("bug: invalid user agent"); - // Fetch online crate information - let base_info = - api_client - .get_crate(name.as_ref()) - .await - .map_err(|err| BinstallError::CratesIoApi { - crate_name: name.into(), - err, - })?; + let base_info = crates_io_api_client + .get_crate(name.as_ref()) + .await + .map_err(|err| BinstallError::CratesIoApi { + crate_name: name.into(), + err, + })?; // Locate matching version let version_iter = diff --git a/src/main.rs b/src/main.rs index a11e72f0..df166c41 100644 --- a/src/main.rs +++ b/src/main.rs @@ -216,6 +216,13 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { // Initialize reqwest client let client = create_reqwest_client(opts.secure, opts.min_tls_version.map(|v| v.into()))?; + // Build crates.io api client + let crates_io_api_client = crates_io_api::AsyncClient::new( + "cargo-binstall (https://github.com/ryankurte/cargo-binstall)", + Duration::from_millis(100), + ) + .expect("bug: invalid user agent"); + // Setup logging let mut log_config = ConfigBuilder::new(); log_config.add_filter_ignore("hyper".to_string()); @@ -273,6 +280,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { temp_dir_path.clone(), install_path.clone(), client.clone(), + crates_io_api_client.clone(), )) }) .collect(); @@ -308,6 +316,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { let jobserver_client = jobserver_client.clone(); let desired_targets = desired_targets.clone(); let client = client.clone(); + let crates_io_api_client = crates_io_api_client.clone(); let cli_overrides = cli_overrides.clone(); let install_path = install_path.clone(); @@ -320,6 +329,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { temp_dir_path, install_path, client, + crates_io_api_client, ) .await?; From aa88dce21530cf26b0dbbfc9bc2d5195cdef3b77 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 15:00:01 +1000 Subject: [PATCH 0450/2020] Add field `cli_overrides` to `binstall::Options` Signed-off-by: Jiahao XU --- src/binstall.rs | 3 +++ src/binstall/resolve.rs | 6 ++---- src/main.rs | 8 +++----- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/binstall.rs b/src/binstall.rs index 5de574bb..57a83e13 100644 --- a/src/binstall.rs +++ b/src/binstall.rs @@ -1,5 +1,7 @@ use std::path::PathBuf; +use crate::PkgOverride; + mod resolve; pub use resolve::*; @@ -11,4 +13,5 @@ pub struct Options { pub dry_run: bool, pub version: Option, pub manifest_path: Option, + pub cli_overrides: PkgOverride, } diff --git a/src/binstall/resolve.rs b/src/binstall/resolve.rs index 31b885bd..9e77490e 100644 --- a/src/binstall/resolve.rs +++ b/src/binstall/resolve.rs @@ -72,12 +72,10 @@ impl Resolution { } } -#[allow(clippy::too_many_arguments)] pub async fn resolve( opts: Arc, crate_name: CrateName, desired_targets: DesiredTargets, - cli_overrides: Arc, temp_dir: Arc, install_path: Arc, client: Client, @@ -136,7 +134,7 @@ pub async fn resolve( target_meta.merge(&o); } - target_meta.merge(&cli_overrides); + target_meta.merge(&opts.cli_overrides); debug!("Found metadata: {target_meta:?}"); let fetcher_data = Data { @@ -158,7 +156,7 @@ pub async fn resolve( if let Some(o) = meta.overrides.get(&fetcher_target.to_owned()).cloned() { meta.merge(&o); } - meta.merge(&cli_overrides); + meta.merge(&opts.cli_overrides); // Generate temporary binary path let bin_path = temp_dir.join(format!("bin-{}", crate_name.name)); diff --git a/src/main.rs b/src/main.rs index df166c41..4f90b51c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -203,11 +203,11 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { // Load options let mut opts = Options::parse_from(args); - let cli_overrides = Arc::new(PkgOverride { + let cli_overrides = PkgOverride { pkg_url: opts.pkg_url.take(), pkg_fmt: opts.pkg_fmt.take(), bin_dir: opts.bin_dir.take(), - }); + }; let crate_names = take(&mut opts.crate_names); if crate_names.len() > 1 && opts.manifest_path.is_some() { return Err(BinstallError::ManifestPathConflictedWithBatchInstallation.into()); @@ -265,6 +265,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { dry_run: opts.dry_run, version: opts.version.take(), manifest_path: opts.manifest_path.take(), + cli_overrides, }); let tasks: Vec<_> = if !opts.dry_run && !opts.no_confirm { @@ -276,7 +277,6 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { binstall_opts.clone(), crate_name, desired_targets.clone(), - cli_overrides.clone(), temp_dir_path.clone(), install_path.clone(), client.clone(), @@ -317,7 +317,6 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { let desired_targets = desired_targets.clone(); let client = client.clone(); let crates_io_api_client = crates_io_api_client.clone(); - let cli_overrides = cli_overrides.clone(); let install_path = install_path.clone(); tokio::spawn(async move { @@ -325,7 +324,6 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { opts.clone(), crate_name, desired_targets.clone(), - cli_overrides, temp_dir_path, install_path, client, From 6a95bb07e0781fa84fe2ef314f9a641b0b90f837 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 15:05:12 +1000 Subject: [PATCH 0451/2020] Add field `desired_targets` to `binstall::Options` Signed-off-by: Jiahao XU --- src/binstall.rs | 3 ++- src/binstall/install.rs | 3 +-- src/binstall/resolve.rs | 3 +-- src/main.rs | 8 ++------ 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/binstall.rs b/src/binstall.rs index 57a83e13..02e608c8 100644 --- a/src/binstall.rs +++ b/src/binstall.rs @@ -1,6 +1,6 @@ use std::path::PathBuf; -use crate::PkgOverride; +use crate::{DesiredTargets, PkgOverride}; mod resolve; pub use resolve::*; @@ -14,4 +14,5 @@ pub struct Options { pub version: Option, pub manifest_path: Option, pub cli_overrides: PkgOverride, + pub desired_targets: DesiredTargets, } diff --git a/src/binstall/install.rs b/src/binstall/install.rs index 6c1830ea..c1b78fc3 100644 --- a/src/binstall/install.rs +++ b/src/binstall/install.rs @@ -11,7 +11,6 @@ use crate::{bins, fetchers::Fetcher, *}; pub async fn install( resolution: Resolution, opts: Arc, - desired_targets: DesiredTargets, jobserver_client: LazyJobserverClient, ) -> Result<()> { match resolution { @@ -32,7 +31,7 @@ pub async fn install( install_from_package(fetcher, opts, cvs, version, bin_path, bin_files).await } Resolution::InstallFromSource { package } => { - let desired_targets = desired_targets.get().await; + let desired_targets = opts.desired_targets.get().await; let target = desired_targets .first() .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; diff --git a/src/binstall/resolve.rs b/src/binstall/resolve.rs index 9e77490e..f2b4f8c6 100644 --- a/src/binstall/resolve.rs +++ b/src/binstall/resolve.rs @@ -75,7 +75,6 @@ impl Resolution { pub async fn resolve( opts: Arc, crate_name: CrateName, - desired_targets: DesiredTargets, temp_dir: Arc, install_path: Arc, client: Client, @@ -123,7 +122,7 @@ pub async fn resolve( let mut fetchers = MultiFetcher::default(); - let desired_targets = desired_targets.get().await; + let desired_targets = opts.desired_targets.get().await; for target in desired_targets { debug!("Building metadata for target: {target}"); diff --git a/src/main.rs b/src/main.rs index 4f90b51c..31daa6fa 100644 --- a/src/main.rs +++ b/src/main.rs @@ -266,6 +266,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { version: opts.version.take(), manifest_path: opts.manifest_path.take(), cli_overrides, + desired_targets, }); let tasks: Vec<_> = if !opts.dry_run && !opts.no_confirm { @@ -276,7 +277,6 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { tokio::spawn(binstall::resolve( binstall_opts.clone(), crate_name, - desired_targets.clone(), temp_dir_path.clone(), install_path.clone(), client.clone(), @@ -300,7 +300,6 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { tokio::spawn(binstall::install( resolution, binstall_opts.clone(), - desired_targets.clone(), jobserver_client.clone(), )) }) @@ -312,9 +311,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { .map(|crate_name| { let opts = binstall_opts.clone(); let temp_dir_path = temp_dir_path.clone(); - let desired_target = desired_targets.clone(); let jobserver_client = jobserver_client.clone(); - let desired_targets = desired_targets.clone(); let client = client.clone(); let crates_io_api_client = crates_io_api_client.clone(); let install_path = install_path.clone(); @@ -323,7 +320,6 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { let resolution = binstall::resolve( opts.clone(), crate_name, - desired_targets.clone(), temp_dir_path, install_path, client, @@ -331,7 +327,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { ) .await?; - binstall::install(resolution, opts, desired_target, jobserver_client).await + binstall::install(resolution, opts, jobserver_client).await }) }) .collect() From eda7b9445a1c7d7a1797574f7696c39af1dba63b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 15:06:00 +1000 Subject: [PATCH 0452/2020] Rm unnecessary `Arc` inside` DesiredTargetsInner` Since `DesiredTargets` is now stored in `binstall::Options`, which itself is wrapped in an `Arc`, `DesiredTargetsInner::Initialized` no longer needs an `Arc` for O(1) `clone`. Signed-off-by: Jiahao XU --- src/target.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/target.rs b/src/target.rs index c6bf8dd9..fdca606f 100644 --- a/src/target.rs +++ b/src/target.rs @@ -11,7 +11,7 @@ pub const TARGET: &str = env!("TARGET"); #[derive(Debug, Clone)] enum DesiredTargetsInner { AutoDetect(Arc>>), - Initialized(Arc>), + Initialized(Vec), } #[derive(Debug, Clone)] @@ -19,7 +19,7 @@ pub struct DesiredTargets(DesiredTargetsInner); impl DesiredTargets { fn initialized(targets: Vec) -> Self { - Self(DesiredTargetsInner::Initialized(Arc::new(targets))) + Self(DesiredTargetsInner::Initialized(targets)) } fn auto_detect() -> Self { From b2d09e2b139d7157e5e6aedba1fbf149e64f192d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 15:07:09 +1000 Subject: [PATCH 0453/2020] Rm unused `derive(Clone)` for `DesiredTargets` Signed-off-by: Jiahao XU --- src/target.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/target.rs b/src/target.rs index fdca606f..8dfb75b6 100644 --- a/src/target.rs +++ b/src/target.rs @@ -8,13 +8,13 @@ use tokio::sync::OnceCell; /// Compiled target triple, used as default for binary fetching pub const TARGET: &str = env!("TARGET"); -#[derive(Debug, Clone)] +#[derive(Debug)] enum DesiredTargetsInner { AutoDetect(Arc>>), Initialized(Vec), } -#[derive(Debug, Clone)] +#[derive(Debug)] pub struct DesiredTargets(DesiredTargetsInner); impl DesiredTargets { From e308b275d517739e7085055d55b16210cbbf59c6 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 19:18:43 +1000 Subject: [PATCH 0454/2020] Optimize and generalize `find_version` - Rm the process of collecting into `BTreeMap` in `find_version`. - Accept any type that implements trait `Version` Signed-off-by: Jiahao XU --- src/drivers/crates_io.rs | 18 ++--------- src/drivers/version.rs | 64 ++++++++++++++++++++++------------------ 2 files changed, 38 insertions(+), 44 deletions(-) diff --git a/src/drivers/crates_io.rs b/src/drivers/crates_io.rs index b7e96086..5d297d40 100644 --- a/src/drivers/crates_io.rs +++ b/src/drivers/crates_io.rs @@ -34,22 +34,8 @@ pub async fn fetch_crate_cratesio( })?; // Locate matching version - let version_iter = - base_info - .versions - .iter() - .filter_map(|v| if !v.yanked { Some(&v.num) } else { None }); - let version_name = find_version(version_req, version_iter)?; - - // Fetch information for the filtered version - let version = base_info - .versions - .iter() - .find(|v| v.num == version_name.to_string()) - .ok_or_else(|| BinstallError::VersionUnavailable { - crate_name: name.into(), - v: version_name.clone(), - })?; + let version_iter = base_info.versions.iter().filter(|v| !v.yanked); + let (version, version_name) = find_version(version_req, version_iter)?; debug!("Found information for crate version: '{}'", version.num); diff --git a/src/drivers/version.rs b/src/drivers/version.rs index 7d5f4a74..6ef364d5 100644 --- a/src/drivers/version.rs +++ b/src/drivers/version.rs @@ -1,48 +1,56 @@ -use std::collections::BTreeSet; - use log::debug; -use semver::{Version, VersionReq}; +use semver::VersionReq; use crate::BinstallError; -pub(super) fn find_version<'a, V: Iterator>( +pub(super) trait Version { + /// Return `None` on error. + fn get_version(&self) -> Option; +} + +impl Version for &T { + fn get_version(&self) -> Option { + (*self).get_version() + } +} + +impl Version for crates_io_api::Version { + fn get_version(&self) -> Option { + // Remove leading `v` for git tags + let ver_str = match self.num.strip_prefix('s') { + Some(v) => v, + None => &self.num, + }; + + // Parse out version + semver::Version::parse(ver_str).ok() + } +} + +pub(super) fn find_version>( requirement: &str, - version_iter: V, -) -> Result { + version_iter: VersionIter, +) -> Result<(Item, semver::Version), BinstallError> { // Parse version requirement let version_req = VersionReq::parse(requirement).map_err(|err| BinstallError::VersionReq { req: requirement.into(), err, })?; - // Filter for matching versions - let filtered: BTreeSet<_> = version_iter - .filter_map(|v| { - // Remove leading `v` for git tags - let ver_str = match v.strip_prefix('s') { - Some(v) => v, - None => v, - }; - - // Parse out version - let ver = Version::parse(ver_str).ok()?; - debug!("Version: {:?}", ver); + version_iter + // Filter for matching versions + .filter_map(|item| { + let ver = item.get_version()?; // Filter by version match if version_req.matches(&ver) { - Some(ver) + debug!("Version: {:?}", ver); + Some((item, ver)) } else { None } }) - .collect(); - - debug!("Filtered: {:?}", filtered); - - // Return highest version - filtered - .iter() - .max() - .cloned() + // Return highest version + .max_by_key(|(_item, ver)| ver.clone()) .ok_or(BinstallError::VersionMismatch { req: version_req }) } From 4f0f01b75c10a755fa238145a5984b745eff981d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 19:20:21 +1000 Subject: [PATCH 0455/2020] Fix typo in `impl Version for crates_io_api::Version` Signed-off-by: Jiahao XU --- src/drivers/version.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/drivers/version.rs b/src/drivers/version.rs index 6ef364d5..35e11299 100644 --- a/src/drivers/version.rs +++ b/src/drivers/version.rs @@ -17,7 +17,7 @@ impl Version for &T { impl Version for crates_io_api::Version { fn get_version(&self) -> Option { // Remove leading `v` for git tags - let ver_str = match self.num.strip_prefix('s') { + let ver_str = match self.num.strip_prefix('v') { Some(v) => v, None => &self.num, }; From 31d9716d28582eaa4c3a19d35504cf485406c625 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 19:50:23 +1000 Subject: [PATCH 0456/2020] Refactor: Extract `CratesToml::append{_to_path}` Signed-off-by: Jiahao XU --- src/binstall/install.rs | 8 ++------ src/metafiles/v1.rs | 19 +++++++++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/binstall/install.rs b/src/binstall/install.rs index 6c1830ea..9df6013a 100644 --- a/src/binstall/install.rs +++ b/src/binstall/install.rs @@ -109,12 +109,8 @@ async fn install_from_package( let bins: BTreeSet = bin_files.into_iter().map(|bin| bin.base_name).collect(); - { - debug!("Writing .crates.toml"); - let mut c1 = metafiles::v1::CratesToml::load().unwrap_or_default(); - c1.insert(cvs.clone(), bins.clone()); - c1.write()?; - } + debug!("Writing .crates.toml"); + metafiles::v1::CratesToml::append(cvs.clone(), bins.clone())?; { debug!("Writing .crates2.json"); diff --git a/src/metafiles/v1.rs b/src/metafiles/v1.rs index 1180814a..12e34641 100644 --- a/src/metafiles/v1.rs +++ b/src/metafiles/v1.rs @@ -42,6 +42,25 @@ impl CratesToml { fs::write(path, &toml::to_vec(&self)?)?; Ok(()) } + + pub fn append_to_path( + path: impl AsRef, + cvs: CrateVersionSource, + bins: BTreeSet, + ) -> Result<(), CratesTomlParseError> { + let mut c1 = Self::load_from_path(path.as_ref()).unwrap_or_default(); + c1.insert(cvs, bins); + c1.write_to_path(path.as_ref())?; + + Ok(()) + } + + pub fn append( + cvs: CrateVersionSource, + bins: BTreeSet, + ) -> Result<(), CratesTomlParseError> { + Self::append_to_path(Self::default_path()?, cvs, bins) + } } impl FromStr for CratesToml { From 0157a594e6f117316e777e84aee9d2dc7973c751 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 19:54:45 +1000 Subject: [PATCH 0457/2020] Fix err handling in `CratesToml::append_to_path` Make it more robust to `io::Error`: Only create a `Self::default()` if fails to open the file. Signed-off-by: Jiahao XU --- src/metafiles/v1.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/metafiles/v1.rs b/src/metafiles/v1.rs index 12e34641..e0dbcb1e 100644 --- a/src/metafiles/v1.rs +++ b/src/metafiles/v1.rs @@ -1,6 +1,6 @@ use std::{ collections::{BTreeMap, BTreeSet}, - fs, + fs, io, path::{Path, PathBuf}, str::FromStr, }; @@ -48,7 +48,13 @@ impl CratesToml { cvs: CrateVersionSource, bins: BTreeSet, ) -> Result<(), CratesTomlParseError> { - let mut c1 = Self::load_from_path(path.as_ref()).unwrap_or_default(); + let mut c1 = match Self::load_from_path(path.as_ref()) { + Ok(c1) => c1, + Err(CratesTomlParseError::Io(io_err)) if io_err.kind() == io::ErrorKind::NotFound => { + Self::default() + } + Err(err) => return Err(err), + }; c1.insert(cvs, bins); c1.write_to_path(path.as_ref())?; @@ -73,7 +79,7 @@ impl FromStr for CratesToml { #[derive(Debug, Diagnostic, Error)] pub enum CratesTomlParseError { #[error(transparent)] - Io(#[from] std::io::Error), + Io(#[from] io::Error), #[error(transparent)] TomlParse(#[from] toml::de::Error), From 1e725a9ffeaf4bfbba79a19b251f435570b132f8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 19:58:23 +1000 Subject: [PATCH 0458/2020] Refactor: Extract `Crates2Json::append{_to_path}` Signed-off-by: Jiahao XU --- src/binstall/install.rs | 28 ++++++++++++---------------- src/metafiles/v2.rs | 16 ++++++++++++++++ 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/binstall/install.rs b/src/binstall/install.rs index 9df6013a..677423c9 100644 --- a/src/binstall/install.rs +++ b/src/binstall/install.rs @@ -112,22 +112,18 @@ async fn install_from_package( debug!("Writing .crates.toml"); metafiles::v1::CratesToml::append(cvs.clone(), bins.clone())?; - { - debug!("Writing .crates2.json"); - let mut c2 = metafiles::v2::Crates2Json::load().unwrap_or_default(); - c2.insert( - cvs, - metafiles::v2::CrateInfo { - version_req: Some(version), - bins, - profile: "release".into(), - target: fetcher.target().to_string(), - rustc: format!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")), - ..Default::default() - }, - ); - c2.write()?; - } + debug!("Writing .crates2.json"); + metafiles::v2::Crates2Json::append( + cvs, + metafiles::v2::CrateInfo { + version_req: Some(version), + bins, + profile: "release".into(), + target: fetcher.target().to_string(), + rustc: format!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")), + ..Default::default() + }, + )?; Ok(()) }) diff --git a/src/metafiles/v2.rs b/src/metafiles/v2.rs index 70c4e46e..1501e238 100644 --- a/src/metafiles/v2.rs +++ b/src/metafiles/v2.rs @@ -63,6 +63,22 @@ impl Crates2Json { fs::write(path, &serde_json::to_vec(&self)?)?; Ok(()) } + + pub fn append_to_path( + path: impl AsRef, + cvs: CrateVersionSource, + info: CrateInfo, + ) -> Result<(), Crates2JsonParseError> { + let mut c2 = Self::load_from_path(path.as_ref()).unwrap_or_default(); + c2.insert(cvs, info); + c2.write_to_path(path.as_ref())?; + + Ok(()) + } + + pub fn append(cvs: CrateVersionSource, info: CrateInfo) -> Result<(), Crates2JsonParseError> { + Self::append_to_path(Self::default_path()?, cvs, info) + } } #[derive(Debug, Diagnostic, Error)] From fb3e35624b30d9380bd24b339495efccee00688c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 19:59:36 +1000 Subject: [PATCH 0459/2020] Fix err handling in `Crates2Json::append_to_path` Only uses `Self::default()` if the file is not found. Signed-off-by: Jiahao XU --- src/metafiles/v2.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/metafiles/v2.rs b/src/metafiles/v2.rs index 1501e238..3be0ead6 100644 --- a/src/metafiles/v2.rs +++ b/src/metafiles/v2.rs @@ -1,6 +1,6 @@ use std::{ collections::{BTreeMap, BTreeSet}, - fs, + fs, io, path::{Path, PathBuf}, }; @@ -69,7 +69,13 @@ impl Crates2Json { cvs: CrateVersionSource, info: CrateInfo, ) -> Result<(), Crates2JsonParseError> { - let mut c2 = Self::load_from_path(path.as_ref()).unwrap_or_default(); + let mut c2 = match Self::load_from_path(path.as_ref()) { + Ok(c2) => c2, + Err(Crates2JsonParseError::Io(io_err)) if io_err.kind() == io::ErrorKind::NotFound => { + Self::default() + } + Err(err) => return Err(err), + }; c2.insert(cvs, info); c2.write_to_path(path.as_ref())?; @@ -84,7 +90,7 @@ impl Crates2Json { #[derive(Debug, Diagnostic, Error)] pub enum Crates2JsonParseError { #[error(transparent)] - Io(#[from] std::io::Error), + Io(#[from] io::Error), #[error(transparent)] Json(#[from] serde_json::Error), From 46cf20a3f74923a79c4667f6f9becaec9305bc9f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 20:40:31 +1000 Subject: [PATCH 0460/2020] Add new variant `BinstallError::TaskJoinError` Signed-off-by: Jiahao XU --- src/errors.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/errors.rs b/src/errors.rs index 6be71942..f8451ee3 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -3,6 +3,7 @@ use std::process::{ExitCode, Termination}; use log::{error, warn}; use miette::{Diagnostic, Report}; use thiserror::Error; +use tokio::task; /// Errors emitted by the library portion of cargo-binstall. #[derive(Error, Diagnostic, Debug)] @@ -185,6 +186,10 @@ pub enum BinstallError { help("Remove the `--manifest-path` or only specify one `$crate_name`") )] ManifestPathConflictedWithBatchInstallation, + + #[error("Failed to join tokio::task::JoinHandle")] + #[diagnostic(severity(error), code(binstall::join_error))] + TaskJoinError(#[from] task::JoinError), } impl BinstallError { @@ -213,6 +218,7 @@ impl BinstallError { VersionUnavailable { .. } => 83, DuplicateVersionReq => 84, ManifestPathConflictedWithBatchInstallation => 85, + TaskJoinError(_) => 17, }; // reserved codes From 6e5ecc46cf1280a381f4f690feda5e9f09e208e3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 20:41:16 +1000 Subject: [PATCH 0461/2020] Construct `BinstallError` from `JoinError` in `await_task` Signed-off-by: Jiahao XU --- src/helpers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers.rs b/src/helpers.rs index 3dc2de96..c5e828bd 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -43,7 +43,7 @@ pub use crate_name::CrateName; pub async fn await_task(task: tokio::task::JoinHandle>) -> miette::Result { match task.await { Ok(res) => res, - Err(join_err) => Err(miette::miette!("Task failed to join: {}", join_err)), + Err(join_err) => Err(BinstallError::from(join_err).into()), } } From d39bc0acabcf3e8a721314e8446947092ceac45e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 20:43:47 +1000 Subject: [PATCH 0462/2020] Construct `BinstallError` from `JoinError` in `main` Signed-off-by: Jiahao XU --- src/main.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/main.rs b/src/main.rs index 51847dcb..12ec5126 100644 --- a/src/main.rs +++ b/src/main.rs @@ -172,13 +172,16 @@ fn main() -> MainExit { let done = start.elapsed(); debug!("run time: {done:?}"); - result.map_or_else(MainExit::JoinErr, |res| { - res.map(|_| MainExit::Success(done)).unwrap_or_else(|err| { - err.downcast::() - .map(MainExit::Error) - .unwrap_or_else(MainExit::Report) - }) - }) + result.map_or_else( + |join_err| MainExit::Error(BinstallError::from(join_err)), + |res| { + res.map(|_| MainExit::Success(done)).unwrap_or_else(|err| { + err.downcast::() + .map(MainExit::Error) + .unwrap_or_else(MainExit::Report) + }) + }, + ) } async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { From adc0a22a50e1983abed44dd8cb0fba1a05a34e78 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 20:44:13 +1000 Subject: [PATCH 0463/2020] Rm unused variant `MainExit::JoinErr` Signed-off-by: Jiahao XU --- src/main.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/main.rs b/src/main.rs index 12ec5126..9ae6d0f6 100644 --- a/src/main.rs +++ b/src/main.rs @@ -133,7 +133,6 @@ enum MainExit { Success(Duration), Error(BinstallError), Report(miette::Report), - JoinErr(JoinError), } impl Termination for MainExit { @@ -149,11 +148,6 @@ impl Termination for MainExit { eprintln!("{err:?}"); ExitCode::from(16) } - Self::JoinErr(err) => { - error!("Fatal error:"); - eprintln!("{err:?}"); - ExitCode::from(17) - } } } } From d7ae1f242b2394e91961c448443c92edcc30c0d3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 22:14:20 +1000 Subject: [PATCH 0464/2020] Optimize `Crates2Json::load_from_path`: Use `from_reader` which avoids reading the entire file into string at once. Signed-off-by: Jiahao XU --- src/metafiles/v2.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/metafiles/v2.rs b/src/metafiles/v2.rs index 3be0ead6..f4ea5573 100644 --- a/src/metafiles/v2.rs +++ b/src/metafiles/v2.rs @@ -47,8 +47,8 @@ impl Crates2Json { } pub fn load_from_path(path: impl AsRef) -> Result { - let file = fs::read_to_string(path)?; - Ok(serde_json::from_str(&file)?) + let file = fs::File::open(path.as_ref())?; + Ok(serde_json::from_reader(file)?) } pub fn insert(&mut self, cvs: CrateVersionSource, info: CrateInfo) { From c2ce265afacc416af86918377298d76b53cde79b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 21 Jul 2022 22:18:08 +1000 Subject: [PATCH 0465/2020] Optimize `Crates2Json::write_to_path`: Use `to_writer` which avoids allocating a `Vec` just to hold serialized data. Signed-off-by: Jiahao XU --- src/metafiles/v2.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/metafiles/v2.rs b/src/metafiles/v2.rs index f4ea5573..c7d0f337 100644 --- a/src/metafiles/v2.rs +++ b/src/metafiles/v2.rs @@ -60,7 +60,8 @@ impl Crates2Json { } pub fn write_to_path(&self, path: impl AsRef) -> Result<(), Crates2JsonParseError> { - fs::write(path, &serde_json::to_vec(&self)?)?; + let file = fs::File::create(path.as_ref())?; + serde_json::to_writer(file, &self)?; Ok(()) } From 9d9a31bef3fc888e7a0745e6e685d5f2232aab12 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 01:23:58 +1000 Subject: [PATCH 0466/2020] Optimize `Deserialize` impl for `CrateVersionSource` Use `<&str>::deserialize` instead of `String::deserialize` to avoid intermediate `String`. Signed-off-by: Jiahao XU --- src/metafiles/cvs.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/metafiles/cvs.rs b/src/metafiles/cvs.rs index 2b8f2214..d63d35cf 100644 --- a/src/metafiles/cvs.rs +++ b/src/metafiles/cvs.rs @@ -116,6 +116,7 @@ impl<'de> Deserialize<'de> for CrateVersionSource { where D: Deserializer<'de>, { - Self::from_str(&String::deserialize(deserializer)?).map_err(serde::de::Error::custom) + let s = <&str>::deserialize(deserializer)?; + Self::from_str(s).map_err(serde::de::Error::custom) } } From 96aaca1cc67ad5bda2701171620bdbf9a778dbf0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 01:36:22 +1000 Subject: [PATCH 0467/2020] Optimize `CratesToml`: Use `String` as key to avoid cost of deserializing (`CrateVersionSource::from_str`). Signed-off-by: Jiahao XU --- src/metafiles/v1.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/metafiles/v1.rs b/src/metafiles/v1.rs index e0dbcb1e..414155a9 100644 --- a/src/metafiles/v1.rs +++ b/src/metafiles/v1.rs @@ -13,7 +13,7 @@ use super::CrateVersionSource; #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CratesToml { - v1: BTreeMap>, + v1: BTreeMap>, } impl CratesToml { @@ -31,7 +31,7 @@ impl CratesToml { } pub fn insert(&mut self, cvs: CrateVersionSource, bins: BTreeSet) { - self.v1.insert(cvs, bins); + self.v1.insert(cvs.to_string(), bins); } pub fn write(&self) -> Result<(), CratesTomlParseError> { From de9404feda611d4f093fbbcc398bd56e54add8ea Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 01:37:27 +1000 Subject: [PATCH 0468/2020] Optimize `Crates2Json`: Use `String` as key to avoid cost of deserializing (`CrateVersionSource::from_str`). Signed-off-by: Jiahao XU --- src/metafiles/v2.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/metafiles/v2.rs b/src/metafiles/v2.rs index c7d0f337..0db24f14 100644 --- a/src/metafiles/v2.rs +++ b/src/metafiles/v2.rs @@ -12,7 +12,7 @@ use super::CrateVersionSource; #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct Crates2Json { - pub installs: BTreeMap, + pub installs: BTreeMap, } #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -52,7 +52,7 @@ impl Crates2Json { } pub fn insert(&mut self, cvs: CrateVersionSource, info: CrateInfo) { - self.installs.insert(cvs, info); + self.installs.insert(cvs.to_string(), info); } pub fn write(&self) -> Result<(), Crates2JsonParseError> { From a3fcc298abfd13dcbf58cbf075d7bdac0b2b1d9d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 01:38:44 +1000 Subject: [PATCH 0469/2020] Avoid `CrateVersionSource::clone` for insertion in `metafiles` Signed-off-by: Jiahao XU --- src/binstall/install.rs | 4 ++-- src/metafiles/v1.rs | 6 +++--- src/metafiles/v2.rs | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/binstall/install.rs b/src/binstall/install.rs index 677423c9..2efeef4b 100644 --- a/src/binstall/install.rs +++ b/src/binstall/install.rs @@ -110,11 +110,11 @@ async fn install_from_package( let bins: BTreeSet = bin_files.into_iter().map(|bin| bin.base_name).collect(); debug!("Writing .crates.toml"); - metafiles::v1::CratesToml::append(cvs.clone(), bins.clone())?; + metafiles::v1::CratesToml::append(&cvs, bins.clone())?; debug!("Writing .crates2.json"); metafiles::v2::Crates2Json::append( - cvs, + &cvs, metafiles::v2::CrateInfo { version_req: Some(version), bins, diff --git a/src/metafiles/v1.rs b/src/metafiles/v1.rs index 414155a9..7e0d9a2f 100644 --- a/src/metafiles/v1.rs +++ b/src/metafiles/v1.rs @@ -30,7 +30,7 @@ impl CratesToml { Self::from_str(&file) } - pub fn insert(&mut self, cvs: CrateVersionSource, bins: BTreeSet) { + pub fn insert(&mut self, cvs: &CrateVersionSource, bins: BTreeSet) { self.v1.insert(cvs.to_string(), bins); } @@ -45,7 +45,7 @@ impl CratesToml { pub fn append_to_path( path: impl AsRef, - cvs: CrateVersionSource, + cvs: &CrateVersionSource, bins: BTreeSet, ) -> Result<(), CratesTomlParseError> { let mut c1 = match Self::load_from_path(path.as_ref()) { @@ -62,7 +62,7 @@ impl CratesToml { } pub fn append( - cvs: CrateVersionSource, + cvs: &CrateVersionSource, bins: BTreeSet, ) -> Result<(), CratesTomlParseError> { Self::append_to_path(Self::default_path()?, cvs, bins) diff --git a/src/metafiles/v2.rs b/src/metafiles/v2.rs index 0db24f14..9f77af2d 100644 --- a/src/metafiles/v2.rs +++ b/src/metafiles/v2.rs @@ -51,7 +51,7 @@ impl Crates2Json { Ok(serde_json::from_reader(file)?) } - pub fn insert(&mut self, cvs: CrateVersionSource, info: CrateInfo) { + pub fn insert(&mut self, cvs: &CrateVersionSource, info: CrateInfo) { self.installs.insert(cvs.to_string(), info); } @@ -67,7 +67,7 @@ impl Crates2Json { pub fn append_to_path( path: impl AsRef, - cvs: CrateVersionSource, + cvs: &CrateVersionSource, info: CrateInfo, ) -> Result<(), Crates2JsonParseError> { let mut c2 = match Self::load_from_path(path.as_ref()) { @@ -83,7 +83,7 @@ impl Crates2Json { Ok(()) } - pub fn append(cvs: CrateVersionSource, info: CrateInfo) -> Result<(), Crates2JsonParseError> { + pub fn append(cvs: &CrateVersionSource, info: CrateInfo) -> Result<(), Crates2JsonParseError> { Self::append_to_path(Self::default_path()?, cvs, info) } } From 32b98f0c5a417b280f184dd3c5859495aa2ee9f0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 01:43:40 +1000 Subject: [PATCH 0470/2020] Fix `Deserialize` for `CrateVersionSource` Use `Cow::<'_, str>::deserialize` to ensure that it would still work even if it contains escaped characters. Signed-off-by: Jiahao XU --- src/metafiles/cvs.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/metafiles/cvs.rs b/src/metafiles/cvs.rs index d63d35cf..b56ab5fc 100644 --- a/src/metafiles/cvs.rs +++ b/src/metafiles/cvs.rs @@ -1,4 +1,4 @@ -use std::{fmt, str::FromStr}; +use std::{borrow::Cow, fmt, str::FromStr}; use miette::Diagnostic; use once_cell::sync::Lazy; @@ -116,7 +116,7 @@ impl<'de> Deserialize<'de> for CrateVersionSource { where D: Deserializer<'de>, { - let s = <&str>::deserialize(deserializer)?; - Self::from_str(s).map_err(serde::de::Error::custom) + let s = Cow::<'_, str>::deserialize(deserializer)?; + Self::from_str(&s).map_err(serde::de::Error::custom) } } From 739b3ee2472d48246985d24b62b2e44ec7ff7348 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 17:57:25 +1000 Subject: [PATCH 0471/2020] Update `Crates2Json::append` to accept iter instead of one single pair of value. Signed-off-by: Jiahao XU --- src/metafiles/v2.rs | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/metafiles/v2.rs b/src/metafiles/v2.rs index f9ea6a68..b6c8cc58 100644 --- a/src/metafiles/v2.rs +++ b/src/metafiles/v2.rs @@ -1,6 +1,7 @@ use std::{ collections::{BTreeMap, BTreeSet}, fs, io, + iter::IntoIterator, path::{Path, PathBuf}, }; @@ -66,11 +67,13 @@ impl Crates2Json { Ok(()) } - pub fn append_to_path( + pub fn append_to_path( path: impl AsRef, - cvs: &CrateVersionSource, - info: CrateInfo, - ) -> Result<(), Crates2JsonParseError> { + iter: Iter, + ) -> Result<(), Crates2JsonParseError> + where + Iter: IntoIterator, + { let mut c2 = match Self::load_from_path(path.as_ref()) { Ok(c2) => c2, Err(Crates2JsonParseError::Io(io_err)) if io_err.kind() == io::ErrorKind::NotFound => { @@ -78,14 +81,19 @@ impl Crates2Json { } Err(err) => return Err(err), }; - c2.insert(cvs, info); + for (cvs, info) in iter { + c2.insert(&cvs, info); + } c2.write_to_path(path.as_ref())?; Ok(()) } - pub fn append(cvs: &CrateVersionSource, info: CrateInfo) -> Result<(), Crates2JsonParseError> { - Self::append_to_path(Self::default_path()?, cvs, info) + pub fn append(iter: Iter) -> Result<(), Crates2JsonParseError> + where + Iter: IntoIterator, + { + Self::append_to_path(Self::default_path()?, iter) } } From 488e7b849202cc4df93d11f6b2e82a298b993eaa Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 17:57:51 +1000 Subject: [PATCH 0472/2020] Update `CratesToml::append` to accept iter intead of one single pair of value. Signed-off-by: Jiahao XU --- src/metafiles/v1.rs | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/metafiles/v1.rs b/src/metafiles/v1.rs index 3b98568d..e356ec60 100644 --- a/src/metafiles/v1.rs +++ b/src/metafiles/v1.rs @@ -1,6 +1,7 @@ use std::{ collections::{BTreeMap, BTreeSet}, fs, io, + iter::IntoIterator, path::{Path, PathBuf}, str::FromStr, }; @@ -44,11 +45,13 @@ impl CratesToml { Ok(()) } - pub fn append_to_path( + pub fn append_to_path<'a, Iter>( path: impl AsRef, - cvs: &CrateVersionSource, - bins: BTreeSet, - ) -> Result<(), CratesTomlParseError> { + iter: Iter, + ) -> Result<(), CratesTomlParseError> + where + Iter: IntoIterator)>, + { let mut c1 = match Self::load_from_path(path.as_ref()) { Ok(c1) => c1, Err(CratesTomlParseError::Io(io_err)) if io_err.kind() == io::ErrorKind::NotFound => { @@ -56,17 +59,19 @@ impl CratesToml { } Err(err) => return Err(err), }; - c1.insert(cvs, bins); + for (cvs, bins) in iter { + c1.insert(cvs, bins); + } c1.write_to_path(path.as_ref())?; Ok(()) } - pub fn append( - cvs: &CrateVersionSource, - bins: BTreeSet, - ) -> Result<(), CratesTomlParseError> { - Self::append_to_path(Self::default_path()?, cvs, bins) + pub fn append<'a, Iter>(iter: Iter) -> Result<(), CratesTomlParseError> + where + Iter: IntoIterator)>, + { + Self::append_to_path(Self::default_path()?, iter) } } From 92f4d0af954487e6b62c588656f0ff67f70a1c77 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 17:58:29 +1000 Subject: [PATCH 0473/2020] Fix metafile updating: Update them in `entry` only to avoid race condition. Signed-off-by: Jiahao XU --- src/binstall.rs | 11 ++++++++- src/binstall/install.rs | 41 +++++++++++++--------------------- src/main.rs | 49 ++++++++++++++++++++++++++++++++--------- 3 files changed, 63 insertions(+), 38 deletions(-) diff --git a/src/binstall.rs b/src/binstall.rs index 02e608c8..63eb70b8 100644 --- a/src/binstall.rs +++ b/src/binstall.rs @@ -1,6 +1,7 @@ +use std::collections::BTreeSet; use std::path::PathBuf; -use crate::{DesiredTargets, PkgOverride}; +use crate::{metafiles, DesiredTargets, PkgOverride}; mod resolve; pub use resolve::*; @@ -16,3 +17,11 @@ pub struct Options { pub cli_overrides: PkgOverride, pub desired_targets: DesiredTargets, } + +/// MetaData required to update MetaFiles. +pub struct MetaData { + pub bins: BTreeSet, + pub cvs: metafiles::CrateVersionSource, + pub version_req: String, + pub target: String, +} diff --git a/src/binstall/install.rs b/src/binstall/install.rs index 875344af..e7f12a36 100644 --- a/src/binstall/install.rs +++ b/src/binstall/install.rs @@ -1,18 +1,18 @@ -use std::{collections::BTreeSet, path::PathBuf, process, sync::Arc}; +use std::{path::PathBuf, process, sync::Arc}; use cargo_toml::Package; use log::{debug, error, info}; use miette::{miette, IntoDiagnostic, Result, WrapErr}; use tokio::{process::Command, task::block_in_place}; -use super::{Options, Resolution}; +use super::{MetaData, Options, Resolution}; use crate::{bins, fetchers::Fetcher, *}; pub async fn install( resolution: Resolution, opts: Arc, jobserver_client: LazyJobserverClient, -) -> Result<()> { +) -> Result> { match resolution { Resolution::Fetch { fetcher, @@ -37,13 +37,15 @@ pub async fn install( .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; if !opts.dry_run { - install_from_source(package, target, jobserver_client).await + install_from_source(package, target, jobserver_client) + .await + .map(|_| None) } else { info!( "Dry-run: running `cargo install {} --version {} --target {target}`", package.name, package.version ); - Ok(()) + Ok(None) } } } @@ -56,7 +58,7 @@ async fn install_from_package( version: String, bin_path: PathBuf, bin_files: Vec, -) -> Result<()> { +) -> Result> { // Download package if opts.dry_run { info!("Dry run, not downloading package"); @@ -90,7 +92,7 @@ async fn install_from_package( if opts.dry_run { info!("Dry run, not proceeding"); - return Ok(()); + return Ok(None); } info!("Installing binaries..."); @@ -106,25 +108,12 @@ async fn install_from_package( } } - let bins: BTreeSet = bin_files.into_iter().map(|bin| bin.base_name).collect(); - - debug!("Writing .crates.toml"); - metafiles::v1::CratesToml::append(&cvs, bins.clone())?; - - debug!("Writing .crates2.json"); - metafiles::v2::Crates2Json::append( - &cvs, - metafiles::v2::CrateInfo { - version_req: Some(version), - bins, - profile: "release".into(), - target: fetcher.target().to_string(), - rustc: format!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")), - ..Default::default() - }, - )?; - - Ok(()) + Ok(Some(MetaData { + bins: bin_files.into_iter().map(|bin| bin.base_name).collect(), + cvs, + version_req: version, + target: fetcher.target().to_string(), + })) }) } diff --git a/src/main.rs b/src/main.rs index f6759f6a..2061ee8d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -12,7 +12,7 @@ use log::{debug, error, info, warn, LevelFilter}; use miette::{miette, Result, WrapErr}; use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; use tempfile::TempDir; -use tokio::{runtime::Runtime, task::JoinError}; +use tokio::{runtime::Runtime, task::block_in_place}; use cargo_binstall::{binstall, *}; @@ -330,18 +330,45 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { .collect() }; + let mut metadata_vec = Vec::with_capacity(tasks.len()); for task in tasks { - await_task(task).await?; + if let Some(metadata) = await_task(task).await? { + metadata_vec.push(metadata); + } } - if opts.no_cleanup { - // Consume temp_dir without removing it from fs. - temp_dir.into_path(); - } else { - temp_dir.close().unwrap_or_else(|err| { - warn!("Failed to clean up some resources: {err}"); - }); - } + block_in_place(|| { + debug!("Writing .crates.toml"); + metafiles::v1::CratesToml::append( + metadata_vec + .iter() + .map(|metadata| (&metadata.cvs, metadata.bins.clone())), + )?; - Ok(()) + debug!("Writing .crates2.json"); + metafiles::v2::Crates2Json::append(metadata_vec.into_iter().map(|metadata| { + ( + metadata.cvs, + metafiles::v2::CrateInfo { + version_req: Some(metadata.version_req), + bins: metadata.bins, + profile: "release".into(), + target: metadata.target, + rustc: format!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")), + ..Default::default() + }, + ) + }))?; + + if opts.no_cleanup { + // Consume temp_dir without removing it from fs. + temp_dir.into_path(); + } else { + temp_dir.close().unwrap_or_else(|err| { + warn!("Failed to clean up some resources: {err}"); + }); + } + + Ok(()) + }) } From fb35863faa7aa7d8ce7efba478fffb5aa5d844ac Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 17:08:02 +1000 Subject: [PATCH 0474/2020] Create `temp_dir` in `install_path` Signed-off-by: Jiahao XU --- src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 2061ee8d..c759de50 100644 --- a/src/main.rs +++ b/src/main.rs @@ -250,7 +250,13 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { debug!("Using install path: {}", install_path.display()); // Create a temporary directory for downloads etc. - let temp_dir = TempDir::new() + // + // Put all binaries to a temporary directory under `dst` first, catching + // some failure modes (e.g., out of space) before touching the existing + // binaries. This directory will get cleaned up via RAII. + let temp_dir = tempfile::Builder::new() + .prefix("cargo-binstall") + .tempdir_in(&install_path) .map_err(BinstallError::from) .wrap_err("Creating a temporary directory failed.")?; From 95c30122e971b78723f999b349b4e0c3a04a9125 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 19:17:23 +1000 Subject: [PATCH 0475/2020] Rm unused import `tempfile::TempDir` in `main.rs` Signed-off-by: Jiahao XU --- src/main.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index c759de50..08a0c59d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -11,7 +11,6 @@ use clap::Parser; use log::{debug, error, info, warn, LevelFilter}; use miette::{miette, Result, WrapErr}; use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; -use tempfile::TempDir; use tokio::{runtime::Runtime, task::block_in_place}; use cargo_binstall::{binstall, *}; From 751cf47716b254be8ea032055259f99fae6c099c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 19:42:33 +1000 Subject: [PATCH 0476/2020] Add new dep fs4 v0.6.2 Signed-off-by: Jiahao XU --- Cargo.lock | 38 ++++++++++++++++++++++++++++++++++++++ Cargo.toml | 1 + 2 files changed, 39 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 4ddc98b4..439ec66f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -109,6 +109,7 @@ dependencies = [ "dirs", "env_logger", "flate2", + "fs4", "futures-util", "guess_host_triple", "home", @@ -369,6 +370,17 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs4" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9813c3dc174931eff4bd78609debba56465b7c1da888576d21636b601a46790" +dependencies = [ + "libc", + "rustix", + "winapi", +] + [[package]] name = "futures" version = "0.3.21" @@ -637,6 +649,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "io-lifetimes" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24c3f4eff5495aee4c0399d7b6a0dc2b6e81be84242ffbfcf253ebacccc1d0cb" + [[package]] name = "ipnet" version = "2.5.0" @@ -704,6 +722,12 @@ dependencies = [ "libc", ] +[[package]] +name = "linux-raw-sys" +version = "0.0.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" + [[package]] name = "log" version = "0.4.17" @@ -1025,6 +1049,20 @@ dependencies = [ "winapi", ] +[[package]] +name = "rustix" +version = "0.35.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d51cc38aa10f6bbb377ed28197aa052aa4e2b762c22be9d3153d01822587e787" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes", + "libc", + "linux-raw-sys", + "windows-sys", +] + [[package]] name = "rustls" version = "0.20.6" diff --git a/Cargo.toml b/Cargo.toml index 883a9e72..5706941e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,6 +27,7 @@ clap = { version = "3.2.12", features = ["derive"] } crates_io_api = { version = "0.8.0", default-features = false, features = ["rustls"] } dirs = "4.0.0" flate2 = { version = "1.0.24", features = ["zlib-ng"], default-features = false } +fs4 = "0.6.2" futures-util = { version = "0.3.21", default-features = false } home = "0.5.3" jobserver = "0.1.24" From 9e45ba103224554b757c77cc0b2dc93823ed62b7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 19:48:37 +1000 Subject: [PATCH 0477/2020] Impl new RAII type `helpers::flock::FileLock` that locks a file exclusive or shared Signed-off-by: Jiahao XU --- src/helpers.rs | 3 +++ src/helpers/flock.rs | 45 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 src/helpers/flock.rs diff --git a/src/helpers.rs b/src/helpers.rs index a1ef3c5f..55593da3 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -42,6 +42,9 @@ pub use tls_version::TLSVersion; mod crate_name; pub use crate_name::CrateName; +mod flock; +pub use flock::FileLock; + pub fn cargo_home() -> Result<&'static Path, io::Error> { static CARGO_HOME: OnceCell = OnceCell::new(); diff --git a/src/helpers/flock.rs b/src/helpers/flock.rs new file mode 100644 index 00000000..2c0707b5 --- /dev/null +++ b/src/helpers/flock.rs @@ -0,0 +1,45 @@ +use std::fs::File; +use std::io; +use std::ops; + +use fs4::FileExt; + +#[derive(Debug)] +pub struct FileLock(File); + +impl FileLock { + /// NOTE that this function blocks, so it cannot + /// be called in async context. + pub fn new_exclusive(file: File) -> io::Result { + file.lock_exclusive()?; + + Ok(Self(file)) + } + + /// NOTE that this function blocks, so it cannot + /// be called in async context. + pub fn new_shared(file: File) -> io::Result { + file.lock_shared()?; + + Ok(Self(file)) + } +} + +impl Drop for FileLock { + fn drop(&mut self) { + let _ = self.unlock(); + } +} + +impl ops::Deref for FileLock { + type Target = File; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl ops::DerefMut for FileLock { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} From 565b404dcee055e692a3ab0045731b652f99f377 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 20:15:03 +1000 Subject: [PATCH 0478/2020] Impl fn `CratesToml::load_from_reader` Signed-off-by: Jiahao XU --- src/metafiles/v1.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/metafiles/v1.rs b/src/metafiles/v1.rs index e356ec60..5ef58a34 100644 --- a/src/metafiles/v1.rs +++ b/src/metafiles/v1.rs @@ -27,6 +27,12 @@ impl CratesToml { Self::load_from_path(Self::default_path()?) } + pub fn load_from_reader(mut reader: R) -> Result { + let mut vec = Vec::new(); + reader.read_to_end(&mut vec)?; + Ok(toml::from_slice(&vec)?) + } + pub fn load_from_path(path: impl AsRef) -> Result { let file = fs::read_to_string(path)?; Self::from_str(&file) From 7311f77f29e5a404b791db9514169d13a255f92b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 20:19:04 +1000 Subject: [PATCH 0479/2020] Impl new fn `CratesToml::write_to_writer` Signed-off-by: Jiahao XU --- src/metafiles/v1.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/metafiles/v1.rs b/src/metafiles/v1.rs index 5ef58a34..0401a82a 100644 --- a/src/metafiles/v1.rs +++ b/src/metafiles/v1.rs @@ -46,6 +46,15 @@ impl CratesToml { self.write_to_path(Self::default_path()?) } + pub fn write_to_writer( + &self, + mut writer: W, + ) -> Result { + let data = toml::to_vec(&self)?; + writer.write_all(&data)?; + Ok(data.len().try_into().unwrap()) + } + pub fn write_to_path(&self, path: impl AsRef) -> Result<(), CratesTomlParseError> { fs::write(path, &toml::to_vec(&self)?)?; Ok(()) From 05115641ff668be4268cd06541a8e5c23efa893b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 22:12:16 +1000 Subject: [PATCH 0480/2020] Add new fn `helpers::create_if_not_exist` Signed-off-by: Jiahao XU --- src/helpers.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/helpers.rs b/src/helpers.rs index 55593da3..6c209738 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -53,6 +53,30 @@ pub fn cargo_home() -> Result<&'static Path, io::Error> { .map(ops::Deref::deref) } +pub fn create_if_not_exist(path: impl AsRef) -> io::Result { + let mut options = fs::File::options(); + options.create_new(true); + + for _ in 0..3 { + match options.open(path.as_ref()) { + Ok(file) => return Ok(file), + Err(io_err) if io_err.kind() == io::ErrorKind::AlreadyExists => { + match fs::File::open(path.as_ref()) { + Ok(file) => return Ok(file), + Err(io_err) if io_err.kind() == io::ErrorKind::NotFound => (), + Err(err) => return Err(err), + } + } + Err(err) => return Err(err), + } + } + + let errmsg = "We tried to open this file three times but all attempts have failed + with creation returns AlreadyExists and opening returns NotFound"; + + Err(io::Error::new(io::ErrorKind::TimedOut, errmsg)) +} + pub async fn await_task(task: tokio::task::JoinHandle>) -> miette::Result { match task.await { Ok(res) => res, From e1b6fb85aa963532fa2b2fc1dbf7364033cb17ba Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 22:22:18 +1000 Subject: [PATCH 0481/2020] Add new fn `CratesToml::write_to_file` Signed-off-by: Jiahao XU --- src/metafiles/v1.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/metafiles/v1.rs b/src/metafiles/v1.rs index 0401a82a..596b9591 100644 --- a/src/metafiles/v1.rs +++ b/src/metafiles/v1.rs @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize}; use thiserror::Error; use super::CrateVersionSource; -use crate::cargo_home; +use crate::{cargo_home, create_if_not_exist, FileLock}; #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CratesToml { @@ -55,6 +55,13 @@ impl CratesToml { Ok(data.len().try_into().unwrap()) } + pub fn write_to_file(&self, file: &mut fs::File) -> Result<(), CratesTomlParseError> { + let cnt = self.write_to_writer(&mut *file)?; + file.set_len(cnt)?; + + Ok(()) + } + pub fn write_to_path(&self, path: impl AsRef) -> Result<(), CratesTomlParseError> { fs::write(path, &toml::to_vec(&self)?)?; Ok(()) From d7bd96660e3fe2cd31765d380887237135698822 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 22:22:31 +1000 Subject: [PATCH 0482/2020] Fix `CratesToml::append_to_path`: Lock file to avoid race condition Signed-off-by: Jiahao XU --- src/metafiles/v1.rs | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/src/metafiles/v1.rs b/src/metafiles/v1.rs index 596b9591..79126091 100644 --- a/src/metafiles/v1.rs +++ b/src/metafiles/v1.rs @@ -1,6 +1,7 @@ use std::{ collections::{BTreeMap, BTreeSet}, - fs, io, + fs, + io::{self, Seek}, iter::IntoIterator, path::{Path, PathBuf}, str::FromStr, @@ -74,17 +75,15 @@ impl CratesToml { where Iter: IntoIterator)>, { - let mut c1 = match Self::load_from_path(path.as_ref()) { - Ok(c1) => c1, - Err(CratesTomlParseError::Io(io_err)) if io_err.kind() == io::ErrorKind::NotFound => { - Self::default() - } - Err(err) => return Err(err), - }; + let mut file = FileLock::new_exclusive(create_if_not_exist(path.as_ref())?)?; + let mut c1 = Self::load_from_reader(&mut *file)?; + for (cvs, bins) in iter { c1.insert(cvs, bins); } - c1.write_to_path(path.as_ref())?; + + file.rewind()?; + c1.write_to_file(&mut *file)?; Ok(()) } From 09d210bf6261bddb25e23c7aff9630cd4a718541 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 22:32:45 +1000 Subject: [PATCH 0483/2020] Simplify `helpers::create_if_not_exist` implementation Signed-off-by: Jiahao XU --- src/helpers.rs | 25 +++++-------------------- 1 file changed, 5 insertions(+), 20 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 6c209738..d240772e 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -54,27 +54,12 @@ pub fn cargo_home() -> Result<&'static Path, io::Error> { } pub fn create_if_not_exist(path: impl AsRef) -> io::Result { - let mut options = fs::File::options(); - options.create_new(true); + let path = path.as_ref(); - for _ in 0..3 { - match options.open(path.as_ref()) { - Ok(file) => return Ok(file), - Err(io_err) if io_err.kind() == io::ErrorKind::AlreadyExists => { - match fs::File::open(path.as_ref()) { - Ok(file) => return Ok(file), - Err(io_err) if io_err.kind() == io::ErrorKind::NotFound => (), - Err(err) => return Err(err), - } - } - Err(err) => return Err(err), - } - } - - let errmsg = "We tried to open this file three times but all attempts have failed - with creation returns AlreadyExists and opening returns NotFound"; - - Err(io::Error::new(io::ErrorKind::TimedOut, errmsg)) + fs::File::options() + .create_new(true) + .open(path) + .or_else(|_| fs::File::open(path)) } pub async fn await_task(task: tokio::task::JoinHandle>) -> miette::Result { From d9fe7bfaf42453e3f083aaae0bbf3b96c1ea695b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 22:38:10 +1000 Subject: [PATCH 0484/2020] Fix bug in `helpers::create_if_not_exist` Returned `File` must be both readable and writable. Signed-off-by: Jiahao XU --- src/helpers.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index d240772e..5118722a 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -53,13 +53,18 @@ pub fn cargo_home() -> Result<&'static Path, io::Error> { .map(ops::Deref::deref) } +/// Returned file is readable and writable. pub fn create_if_not_exist(path: impl AsRef) -> io::Result { let path = path.as_ref(); - fs::File::options() + let mut options = fs::File::options(); + options.read(true).write(true); + + options + .clone() .create_new(true) .open(path) - .or_else(|_| fs::File::open(path)) + .or_else(|_| options.open(path)) } pub async fn await_task(task: tokio::task::JoinHandle>) -> miette::Result { From 15e2213225975280c32db9720e08a8fe45cd46f7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 22:44:28 +1000 Subject: [PATCH 0485/2020] Add new fn `Crates2Json::load_from_reader` Signed-off-by: Jiahao XU --- src/metafiles/v2.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/metafiles/v2.rs b/src/metafiles/v2.rs index b6c8cc58..6e7bbd09 100644 --- a/src/metafiles/v2.rs +++ b/src/metafiles/v2.rs @@ -48,9 +48,13 @@ impl Crates2Json { Self::load_from_path(Self::default_path()?) } + pub fn load_from_reader(reader: R) -> Result { + Ok(serde_json::from_reader(reader)?) + } + pub fn load_from_path(path: impl AsRef) -> Result { let file = fs::File::open(path.as_ref())?; - Ok(serde_json::from_reader(file)?) + Self::load_from_reader(file) } pub fn insert(&mut self, cvs: &CrateVersionSource, info: CrateInfo) { From 1766b925474e2960fe79274214405aba8865dec4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 22:45:55 +1000 Subject: [PATCH 0486/2020] Add new fn `Crates2Json::write_to_writer` Signed-off-by: Jiahao XU --- src/metafiles/v2.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/metafiles/v2.rs b/src/metafiles/v2.rs index 6e7bbd09..3b8d681a 100644 --- a/src/metafiles/v2.rs +++ b/src/metafiles/v2.rs @@ -65,10 +65,14 @@ impl Crates2Json { self.write_to_path(Self::default_path()?) } + pub fn write_to_writer(&self, writer: W) -> Result<(), Crates2JsonParseError> { + serde_json::to_writer(writer, &self)?; + Ok(()) + } + pub fn write_to_path(&self, path: impl AsRef) -> Result<(), Crates2JsonParseError> { let file = fs::File::create(path.as_ref())?; - serde_json::to_writer(file, &self)?; - Ok(()) + self.write_to_writer(file) } pub fn append_to_path( From d432d54c28c759e04c6acc7d92a1e691e9194dd4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 22:48:54 +1000 Subject: [PATCH 0487/2020] Add new fn `Crates2Json::write_to_file` Signed-off-by: Jiahao XU --- src/metafiles/v2.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/metafiles/v2.rs b/src/metafiles/v2.rs index 3b8d681a..213461c3 100644 --- a/src/metafiles/v2.rs +++ b/src/metafiles/v2.rs @@ -1,6 +1,7 @@ use std::{ collections::{BTreeMap, BTreeSet}, - fs, io, + fs, + io::{self, Seek}, iter::IntoIterator, path::{Path, PathBuf}, }; @@ -70,6 +71,14 @@ impl Crates2Json { Ok(()) } + pub fn write_to_file(&self, file: &mut fs::File) -> Result<(), Crates2JsonParseError> { + self.write_to_writer(&mut *file)?; + let pos = file.stream_position()?; + file.set_len(pos)?; + + Ok(()) + } + pub fn write_to_path(&self, path: impl AsRef) -> Result<(), Crates2JsonParseError> { let file = fs::File::create(path.as_ref())?; self.write_to_writer(file) From 0a753f3e4bad0aba4d7b7b351382eda5e54f1022 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 22:50:58 +1000 Subject: [PATCH 0488/2020] Fix `Crates2Json::append_to_path`: Use file lock to fix race condition. Signed-off-by: Jiahao XU --- src/metafiles/v2.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/metafiles/v2.rs b/src/metafiles/v2.rs index 213461c3..1db6fb42 100644 --- a/src/metafiles/v2.rs +++ b/src/metafiles/v2.rs @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize}; use thiserror::Error; use super::CrateVersionSource; -use crate::cargo_home; +use crate::{cargo_home, create_if_not_exist, FileLock}; #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct Crates2Json { @@ -91,17 +91,15 @@ impl Crates2Json { where Iter: IntoIterator, { - let mut c2 = match Self::load_from_path(path.as_ref()) { - Ok(c2) => c2, - Err(Crates2JsonParseError::Io(io_err)) if io_err.kind() == io::ErrorKind::NotFound => { - Self::default() - } - Err(err) => return Err(err), - }; + let mut file = FileLock::new_exclusive(create_if_not_exist(path.as_ref())?)?; + let mut c2 = Self::load_from_reader(&mut *file)?; + for (cvs, info) in iter { c2.insert(&cvs, info); } - c2.write_to_path(path.as_ref())?; + + file.rewind()?; + c2.write_to_file(&mut *file)?; Ok(()) } From 6ce48419b6e09d32c39410fffb3d532251ff5867 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 22:55:44 +1000 Subject: [PATCH 0489/2020] Fix `CratesToml::write_to_{writer, file}` Make them consistent with `Crates2Json::write_to_{writer, file}` Signed-off-by: Jiahao XU --- src/metafiles/v1.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/metafiles/v1.rs b/src/metafiles/v1.rs index 79126091..def69db6 100644 --- a/src/metafiles/v1.rs +++ b/src/metafiles/v1.rs @@ -47,18 +47,16 @@ impl CratesToml { self.write_to_path(Self::default_path()?) } - pub fn write_to_writer( - &self, - mut writer: W, - ) -> Result { + pub fn write_to_writer(&self, mut writer: W) -> Result<(), CratesTomlParseError> { let data = toml::to_vec(&self)?; writer.write_all(&data)?; - Ok(data.len().try_into().unwrap()) + Ok(()) } pub fn write_to_file(&self, file: &mut fs::File) -> Result<(), CratesTomlParseError> { - let cnt = self.write_to_writer(&mut *file)?; - file.set_len(cnt)?; + self.write_to_writer(&mut *file)?; + let pos = file.stream_position()?; + file.set_len(pos)?; Ok(()) } From 7bdc720a9a84bfead498ae7a64868cd67506eae4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 22 Jul 2022 22:59:02 +1000 Subject: [PATCH 0490/2020] Fix updating metafiles: Skip on custom install path Signed-off-by: Jiahao XU --- src/main.rs | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2061ee8d..22659542 100644 --- a/src/main.rs +++ b/src/main.rs @@ -241,6 +241,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { let desired_targets = get_desired_targets(&opts.targets); // Compute install directory + let custom_install_path = opts.install_path.is_some(); let install_path: Arc = Arc::from( get_install_path(opts.install_path.as_deref()).ok_or_else(|| { error!("No viable install path found of specified, try `--install-path`"); @@ -338,27 +339,29 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { } block_in_place(|| { - debug!("Writing .crates.toml"); - metafiles::v1::CratesToml::append( - metadata_vec - .iter() - .map(|metadata| (&metadata.cvs, metadata.bins.clone())), - )?; + if !custom_install_path { + debug!("Writing .crates.toml"); + metafiles::v1::CratesToml::append( + metadata_vec + .iter() + .map(|metadata| (&metadata.cvs, metadata.bins.clone())), + )?; - debug!("Writing .crates2.json"); - metafiles::v2::Crates2Json::append(metadata_vec.into_iter().map(|metadata| { - ( - metadata.cvs, - metafiles::v2::CrateInfo { - version_req: Some(metadata.version_req), - bins: metadata.bins, - profile: "release".into(), - target: metadata.target, - rustc: format!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")), - ..Default::default() - }, - ) - }))?; + debug!("Writing .crates2.json"); + metafiles::v2::Crates2Json::append(metadata_vec.into_iter().map(|metadata| { + ( + metadata.cvs, + metafiles::v2::CrateInfo { + version_req: Some(metadata.version_req), + bins: metadata.bins, + profile: "release".into(), + target: metadata.target, + rustc: format!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")), + ..Default::default() + }, + ) + }))?; + } if opts.no_cleanup { // Consume temp_dir without removing it from fs. From 79476e490bf7f927d09b7264a5ecac0e5a832eae Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 18:33:30 +1000 Subject: [PATCH 0491/2020] Fix `custom_install_path` detection Installing to `CARGO_INSTALL_ROOT` or the local executable dir should be considered a custom installation path. Signed-off-by: Jiahao XU --- src/helpers.rs | 15 +++++++++------ src/main.rs | 12 +++++------- 2 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index a1ef3c5f..570b243e 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -172,22 +172,25 @@ pub async fn download_tar_based_and_visit -pub fn get_install_path>(install_path: Option

) -> Option { +/// +/// Return (install_path, is_custom_install_path) +pub fn get_install_path>(install_path: Option

) -> (Option, bool) { // Command line override first first if let Some(p) = install_path { - return Some(PathBuf::from(p.as_ref())); + return (Some(PathBuf::from(p.as_ref())), true); } // Environmental variables if let Ok(p) = std::env::var("CARGO_INSTALL_ROOT") { debug!("using CARGO_INSTALL_ROOT ({p})"); let b = PathBuf::from(p); - return Some(b.join("bin")); + return (Some(b.join("bin")), true); } + if let Ok(p) = std::env::var("CARGO_HOME") { debug!("using CARGO_HOME ({p})"); let b = PathBuf::from(p); - return Some(b.join("bin")); + return (Some(b.join("bin")), false); } // Standard $HOME/.cargo/bin @@ -196,7 +199,7 @@ pub fn get_install_path>(install_path: Option

) -> Option>(install_path: Option

) -> Option Result<()> { let desired_targets = get_desired_targets(&opts.targets); // Compute install directory - let custom_install_path = opts.install_path.is_some(); - let install_path: Arc = Arc::from( - get_install_path(opts.install_path.as_deref()).ok_or_else(|| { - error!("No viable install path found of specified, try `--install-path`"); - miette!("No install path found or specified") - })?, - ); + let (install_path, custom_install_path) = get_install_path(opts.install_path.as_deref()); + let install_path: Arc = Arc::from(install_path.ok_or_else(|| { + error!("No viable install path found of specified, try `--install-path`"); + miette!("No install path found or specified") + })?); debug!("Using install path: {}", install_path.display()); // Create a temporary directory for downloads etc. From 5620810c55ea7e4d440f4eb6b5019a280c3eac76 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 18:36:01 +1000 Subject: [PATCH 0492/2020] Simplify `get_install_path` using `cargo_home` Signed-off-by: Jiahao XU --- src/helpers.rs | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 570b243e..d70df19b 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -187,20 +187,9 @@ pub fn get_install_path>(install_path: Option

) -> (Option Date: Sat, 23 Jul 2022 18:37:59 +1000 Subject: [PATCH 0493/2020] Mod `get_install_path` to ret `Arc` instead of `PathBuf` Signed-off-by: Jiahao XU --- src/helpers.rs | 9 +++++---- src/main.rs | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index d70df19b..26031bc8 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -3,6 +3,7 @@ use std::fs; use std::io; use std::ops; use std::path::{Path, PathBuf}; +use std::sync::Arc; use bytes::Bytes; use cargo_toml::Manifest; @@ -174,17 +175,17 @@ pub async fn download_tar_based_and_visit /// /// Return (install_path, is_custom_install_path) -pub fn get_install_path>(install_path: Option

) -> (Option, bool) { +pub fn get_install_path>(install_path: Option

) -> (Option>, bool) { // Command line override first first if let Some(p) = install_path { - return (Some(PathBuf::from(p.as_ref())), true); + return (Some(Arc::from(p.as_ref())), true); } // Environmental variables if let Ok(p) = std::env::var("CARGO_INSTALL_ROOT") { debug!("using CARGO_INSTALL_ROOT ({p})"); let b = PathBuf::from(p); - return (Some(b.join("bin")), true); + return (Some(Arc::from(b.join("bin"))), true); } if let Ok(p) = cargo_home() { @@ -199,7 +200,7 @@ pub fn get_install_path>(install_path: Option

) -> (Option Result<()> { // Compute install directory let (install_path, custom_install_path) = get_install_path(opts.install_path.as_deref()); - let install_path: Arc = Arc::from(install_path.ok_or_else(|| { + let install_path = install_path.ok_or_else(|| { error!("No viable install path found of specified, try `--install-path`"); miette!("No install path found or specified") - })?); + })?; debug!("Using install path: {}", install_path.display()); // Create a temporary directory for downloads etc. From 3c09cfb196b506e7345241e1c974f71b3f1ac688 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 18:51:50 +1000 Subject: [PATCH 0494/2020] Fix `ci-scripts/run_tests_unix.sh`: unset `CARGO_HOME` and `CARGO_INSTALL_ROOT` Signed-off-by: Jiahao XU --- ci-scripts/run_tests_unix.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ci-scripts/run_tests_unix.sh b/ci-scripts/run_tests_unix.sh index f07f89f7..e49b81a0 100755 --- a/ci-scripts/run_tests_unix.sh +++ b/ci-scripts/run_tests_unix.sh @@ -5,6 +5,9 @@ set -euxo pipefail bins="cargo-deb cargo-llvm-cov cargo-binstall" test_bins="cargo-deb cargo-llvm-cov" +unset CARGO_INSTALL_ROOT +unset CARGO_HOME + # Install binaries using cargo-binstall # shellcheck disable=SC2086 "./$1" binstall --log-level debug --no-confirm $bins From 5bf2b4e45d245d63bafa4280835cafe06fc1f35b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 19:08:29 +1000 Subject: [PATCH 0495/2020] Fix `helpers::cargo_home`: `home::cargo_home` is buggy Signed-off-by: Jiahao XU --- src/helpers.rs | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/helpers.rs b/src/helpers.rs index 26031bc8..52d26f0d 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -1,3 +1,4 @@ +use std::env; use std::fmt::Debug; use std::fs; use std::io; @@ -44,10 +45,34 @@ mod crate_name; pub use crate_name::CrateName; pub fn cargo_home() -> Result<&'static Path, io::Error> { + fn cargo_home_inner() -> Result { + if let Some(p) = env::var_os("CARGO_HOME") { + let p = PathBuf::from(p); + debug!("using CARGO_HOME ({})", p.display()); + return Ok(p); + } + + // Standard $HOME/.cargo/bin + if let Some(mut d) = dirs::home_dir() { + d.push(".cargo"); + + if d.exists() { + debug!("using $HOME/.cargo: {}", d.display()); + + return Ok(d); + } + } + + Err(io::Error::new( + io::ErrorKind::NotFound, + "Failed to detect cargo home", + )) + } + static CARGO_HOME: OnceCell = OnceCell::new(); CARGO_HOME - .get_or_try_init(home::cargo_home) + .get_or_try_init(cargo_home_inner) .map(ops::Deref::deref) } From 3838219d89ac821bb97070fb9c90def25cb1adba Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 19:09:06 +1000 Subject: [PATCH 0496/2020] Rm dep `home` Signed-off-by: Jiahao XU --- Cargo.lock | 10 ---------- Cargo.toml | 1 - 2 files changed, 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4ddc98b4..a476fa6b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -111,7 +111,6 @@ dependencies = [ "flate2", "futures-util", "guess_host_triple", - "home", "jobserver", "log", "miette", @@ -521,15 +520,6 @@ dependencies = [ "libc", ] -[[package]] -name = "home" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654" -dependencies = [ - "winapi", -] - [[package]] name = "http" version = "0.2.8" diff --git a/Cargo.toml b/Cargo.toml index 883a9e72..85be70fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,7 +28,6 @@ crates_io_api = { version = "0.8.0", default-features = false, features = ["rust dirs = "4.0.0" flate2 = { version = "1.0.24", features = ["zlib-ng"], default-features = false } futures-util = { version = "0.3.21", default-features = false } -home = "0.5.3" jobserver = "0.1.24" log = "0.4.14" miette = { version = "5.1.1", features = ["fancy-no-backtrace"] } From 49f665d680b8bc90b592975b416b3947d187d31a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 19:10:15 +1000 Subject: [PATCH 0497/2020] Fix confusing comment in `helpers::cargo_home` Signed-off-by: Jiahao XU --- src/helpers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers.rs b/src/helpers.rs index 52d26f0d..d5c18ffa 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -52,7 +52,7 @@ pub fn cargo_home() -> Result<&'static Path, io::Error> { return Ok(p); } - // Standard $HOME/.cargo/bin + // Standard $HOME/.cargo if let Some(mut d) = dirs::home_dir() { d.push(".cargo"); From b4d2e9b99c693d5177824e649c48b26167baa2a1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 19:16:23 +1000 Subject: [PATCH 0498/2020] Fix `get_install_path` where `cargo_home` succeeds The returned path must join with `"bin"`. Signed-off-by: Jiahao XU --- src/helpers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/helpers.rs b/src/helpers.rs index d5c18ffa..b2ed7b3e 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -215,7 +215,7 @@ pub fn get_install_path>(install_path: Option

) -> (Option Date: Sat, 23 Jul 2022 19:17:26 +1000 Subject: [PATCH 0499/2020] Add back dep home v0.5.3 Signed-off-by: Jiahao XU --- Cargo.lock | 10 ++++++++++ Cargo.toml | 1 + 2 files changed, 11 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index a476fa6b..4ddc98b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -111,6 +111,7 @@ dependencies = [ "flate2", "futures-util", "guess_host_triple", + "home", "jobserver", "log", "miette", @@ -520,6 +521,15 @@ dependencies = [ "libc", ] +[[package]] +name = "home" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654" +dependencies = [ + "winapi", +] + [[package]] name = "http" version = "0.2.8" diff --git a/Cargo.toml b/Cargo.toml index 85be70fd..883a9e72 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,6 +28,7 @@ crates_io_api = { version = "0.8.0", default-features = false, features = ["rust dirs = "4.0.0" flate2 = { version = "1.0.24", features = ["zlib-ng"], default-features = false } futures-util = { version = "0.3.21", default-features = false } +home = "0.5.3" jobserver = "0.1.24" log = "0.4.14" miette = { version = "5.1.1", features = ["fancy-no-backtrace"] } From 5367b366d1cf9e39994e0b735d84c60fdf64b04c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 19:17:47 +1000 Subject: [PATCH 0500/2020] Use `home::cargo_home` in `helpers::cargo_home` Signed-off-by: Jiahao XU --- src/helpers.rs | 26 +------------------------- 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index b2ed7b3e..e6bf8b40 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -45,34 +45,10 @@ mod crate_name; pub use crate_name::CrateName; pub fn cargo_home() -> Result<&'static Path, io::Error> { - fn cargo_home_inner() -> Result { - if let Some(p) = env::var_os("CARGO_HOME") { - let p = PathBuf::from(p); - debug!("using CARGO_HOME ({})", p.display()); - return Ok(p); - } - - // Standard $HOME/.cargo - if let Some(mut d) = dirs::home_dir() { - d.push(".cargo"); - - if d.exists() { - debug!("using $HOME/.cargo: {}", d.display()); - - return Ok(d); - } - } - - Err(io::Error::new( - io::ErrorKind::NotFound, - "Failed to detect cargo home", - )) - } - static CARGO_HOME: OnceCell = OnceCell::new(); CARGO_HOME - .get_or_try_init(cargo_home_inner) + .get_or_try_init(home::cargo_home) .map(ops::Deref::deref) } From 3889d122a771423b0fd42a929f599c99e0473500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 24 Jul 2022 00:39:54 +1200 Subject: [PATCH 0501/2020] Releng improvements (#224) --- .../workflows/build-and-integration-tests.yml | 101 ++++++++++++------ .github/workflows/release-pr.yml | 74 +++++++++++++ .github/workflows/release-tag.yml | 32 ++++++ Cargo.toml | 3 + build.rs | 4 +- manifest.rc | 2 + release.toml | 16 +++ windows.manifest | 41 +++++++ 8 files changed, 240 insertions(+), 33 deletions(-) create mode 100644 .github/workflows/release-pr.yml create mode 100644 .github/workflows/release-tag.yml create mode 100644 manifest.rc create mode 100644 release.toml create mode 100644 windows.manifest diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index e94bd47c..280efa7e 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -13,7 +13,6 @@ env: jobs: build: name: Build and Test - runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -22,45 +21,39 @@ jobs: - target: x86_64-unknown-linux-gnu os: ubuntu-latest output: cargo-binstall - archive: tgz use-cross: false test: true - target: x86_64-apple-darwin os: macos-latest output: cargo-binstall - archive: zip use-cross: false test: true - target: aarch64-apple-darwin os: macos-latest output: cargo-binstall - archive: zip use-cross: false test: false - target: x86_64-pc-windows-msvc os: windows-latest output: cargo-binstall.exe - archive: zip use-cross: false test: false - target: x86_64-unknown-linux-musl os: ubuntu-latest output: cargo-binstall - archive: tgz use-cross: false test: true - target: armv7-unknown-linux-musleabihf os: ubuntu-20.04 output: cargo-binstall - archive: tgz use-cross: true test: false - target: aarch64-unknown-linux-musl os: ubuntu-latest output: cargo-binstall - archive: tgz use-cross: true test: false + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -122,30 +115,74 @@ jobs: ./${{ matrix.output }} binstall --manifest-path . --no-confirm cargo-binstall cargo binstall --help - - name: Create archive (tgz, linux) - if: ${{ matrix.os != 'macos-latest' && matrix.os != 'windows-latest' }} - run: tar -czvf cargo-binstall-${{ matrix.target }}.tgz ${{ matrix.output }} - - - name: Create archive (zip, windows) - if: ${{ matrix.os == 'windows-latest' }} - run: tar.exe -a -c -f cargo-binstall-${{ matrix.target }}.zip ${{ matrix.output }} - - - name: Create archive (zip, macos) - if: ${{ matrix.os == 'macos-latest' }} - run: zip cargo-binstall-${{ matrix.target }}.zip ${{ matrix.output }} - - - name: Upload artifacts - uses: actions/upload-artifact@v1 + - name: Upload output + uses: actions/upload-artifact@v3 with: - name: cargo-binstall-${{ matrix.target }}.${{ matrix.archive }} - path: cargo-binstall-${{ matrix.target }}.${{ matrix.archive }} + retention-days: 1 + name: "${{ matrix.target }}.${{ matrix.output }}" + path: "${{ matrix.output }}" - - name: Upload binary to release - if: ${{ startsWith(github.ref, 'refs/tags/v') }} - uses: svenstaro/upload-release-action@v2 + release: + name: Package and release + needs: build + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Get outputs + uses: actions/download-artifact@v3 with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - file: cargo-binstall-${{ matrix.target }}.${{ matrix.archive }} - asset_name: cargo-binstall-${{ matrix.target }}.${{ matrix.archive }} - tag: ${{ github.ref }} - overwrite: true + path: outputs/ + + - name: Create archives + shell: bash + run: | + set -euxo pipefail + for o in outputs/*; do + pushd "$o" + + cp ../../LICENSE.txt ../../README.md . + + target=$(basename "$o" | cut -d. -f1) + if grep -qE '(apple|windows)' <<< "$target"; then + zip "../cargo-binstall-${target}.zip" * + else + tar cvf "../cargo-binstall-${target}.tgz" * + fi + + popd + done + + - name: Extract release notes + id: notes + shell: bash + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_REPO: ${{ github.repository }} + release_commit: ${{ github.event.head_commit.message }} + run: | + set -euxo pipefail + release_pr=$(head -n1 <<< "${release_commit:-}" | jq -Rr 'split("[()]"; "")[1] // ""') + if [[ -z "$release_pr" ]]; then + echo "::set-output name=notes_json::null" + exit + fi + + gh \ + pr --repo "$GITHUB_REPO" \ + view "$release_pr" \ + --json body \ + --jq '"::set-output name=notes_json::\((.body | split("### Release notes")[1] // "") | tojson)"' + + - name: Publish release + uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa + with: + tag_name: ${{ github.ref }} + name: ${{ github.ref }} + body: ${{ fromJSON(steps.notes.outputs.notes_json) }} + append_body: true + files: | + outputs/cargo-binstall-*.zip + outputs/cargo-binstall-*.tgz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml new file mode 100644 index 00000000..cf7e3305 --- /dev/null +++ b/.github/workflows/release-pr.yml @@ -0,0 +1,74 @@ +name: Open a release PR +on: + workflow_dispatch: + inputs: + version: + description: Version to release + required: true + type: string + +jobs: + make-release-pr: + runs-on: ubuntu-latest + steps: + - name: Install cargo-release + uses: taiki-e/install-action@v1 + with: + tool: cargo-release + + - uses: actions/checkout@v2 + with: + ref: main + + - name: Extract info + run: | + set -euxo pipefail + + branch_name="release-${{ inputs.version }}" + echo "branch_name=${branch_name}" >> $GITHUB_ENV + + - name: Make release branch + run: git switch -c "${{ env.branch_name }}" + + - name: Do release + run: | + set -euxo pipefail + git config user.name github-actions + git config user.email github-actions@github.com + cargo release \ + --execute \ + --no-push \ + --no-tag \ + --no-publish \ + --no-confirm \ + --verbose \ + --config release.toml \ + --allow-branch "${{ env.branch_name }}" \ + --dependent-version upgrade \ + "${{ inputs.version }}" + + - name: Push new branch + run: | + set -euxo pipefail + git push origin "${{ env.branch_name }}" + + - name: Create PR + run: | + set -euxo pipefail + + nl=$'\n' + br=$'\n\n' + fence=$'```\n' + ecnef=$'\n```' + + title="release: v${{ inputs.version }}" + body_intro="This is a release PR for version **${{ inputs.version }}**." + body_merge="**Use squash merge.** Upon merging, this will automatically build the CLI and create a GitHub release. You still need to manually publish the cargo crate." + body_pub="${fence}$ cd ${{ env.crate_path }}${nl}$ cargo publish${ecnef}" + body_notes="---${br}_Edit release notes into the section below:_${br}${nl}### Release notes" + + body="${body_intro}${br}${body_merge}${br}${body_pub}${br}${body_notes}${br}" + + gh pr create --title "$title" --body "$body" --base main --head "${{ env.branch_name }}" --label "release" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml new file mode 100644 index 00000000..14aa604a --- /dev/null +++ b/.github/workflows/release-tag.yml @@ -0,0 +1,32 @@ +name: Tag a release +on: + push: + branches: + - main + tags-ignore: + - "*" + +jobs: + make-tag: + runs-on: ubuntu-latest + # the commit message will look like: `release: v{version} (#{pr-number})` + if: "startsWith(github.event.head_commit.message, 'release: v')" + steps: + - name: Extract tag from commit message + env: + COMMIT_MESSAGE: ${{ github.event.head_commit.message }} + run: | + set -euxo pipefail + + message="$(head -n1 <<< "$COMMIT_MESSAGE")" + version="$(cut -d ' ' -f 2 <<< "${message}")" + echo "CUSTOM_TAG=${version}" >> $GITHUB_ENV + + - uses: actions/checkout@v2 + - name: Push release tag + id: tag_version + uses: mathieudutour/github-tag-action@v6.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + custom_tag: ${{ env.CUSTOM_TAG }} + tag_prefix: '' diff --git a/Cargo.toml b/Cargo.toml index 5706941e..2656b7ff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,6 +75,9 @@ mimalloc = ["dep:mimalloc"] [dev-dependencies] env_logger = "0.9.0" +[build-dependencies] +embed-resource = "1.6.1" + [profile.release] opt-level = "z" lto = true diff --git a/build.rs b/build.rs index a6f29869..961d0241 100644 --- a/build.rs +++ b/build.rs @@ -1,5 +1,7 @@ -// Fetch build target and define this for the compiler fn main() { + embed_resource::compile("manifest.rc"); + + // Fetch build target and define this for the compiler println!( "cargo:rustc-env=TARGET={}", std::env::var("TARGET").unwrap() diff --git a/manifest.rc b/manifest.rc new file mode 100644 index 00000000..d648a5c7 --- /dev/null +++ b/manifest.rc @@ -0,0 +1,2 @@ +#define RT_MANIFEST 24 +1 RT_MANIFEST "windows.manifest" diff --git a/release.toml b/release.toml new file mode 100644 index 00000000..4c308c4a --- /dev/null +++ b/release.toml @@ -0,0 +1,16 @@ +pre-release-commit-message = "release: v{{version}}" +tag-prefix = "cli-" +tag-message = "cargo-binstall {{version}}" + +# We wait until the release CI is done before publishing, +# because publishing is irreversible, but a release can be +# reverted a lot more easily. +publish = false + +[[pre-release-replacements]] +file = "windows.manifest" +search = "^ version=\"[\\d.]+[.]0\"" +replace = " version=\"{{version}}.0\"" +prerelease = false +max = 1 + diff --git a/windows.manifest b/windows.manifest new file mode 100644 index 00000000..d72ab3ca --- /dev/null +++ b/windows.manifest @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + true + UTF-8 + SegmentHeap + + + From 818f4da5778aa42ca13a3e7807ac1d5b9393be58 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 19:21:45 +1000 Subject: [PATCH 0502/2020] Add new feature `static` that is enabled by default Signed-off-by: Jiahao XU --- Cargo.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2656b7ff..21bcb282 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -21,7 +21,7 @@ pkg-fmt = "zip" [dependencies] async-trait = "0.1.56" bytes = "1.1.0" -bzip2 = { version = "0.4.3", features = ["static"] } +bzip2 = "0.4.3" cargo_toml = "0.11.4" clap = { version = "3.2.12", features = ["derive"] } crates_io_api = { version = "0.8.0", default-features = false, features = ["rustls"] } @@ -50,7 +50,7 @@ tinytemplate = "1.2.1" tokio = { version = "1.20.0", features = ["rt-multi-thread", "process", "sync"], default-features = false } toml = "0.5.9" url = "2.2.2" -xz2 = { version = "0.1.6", features = ["static"] } +xz2 = "0.1.6" # Disable all features of zip except for features of compression algorithms: # Disabled features include: @@ -69,8 +69,9 @@ zstd = { version = "0.10.0", default-features = false } guess_host_triple = "0.1.3" [features] -default = [] +default = ["static"] mimalloc = ["dep:mimalloc"] +static = ["bzip2/static", "xz2/static"] [dev-dependencies] env_logger = "0.9.0" From 6c09cb05c9f633086a3f3af27bac613168fc15dd Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 19:26:12 +1000 Subject: [PATCH 0503/2020] Add new feature `pkg-config`: Enable linking with sys packages Signed-off-by: Jiahao XU --- Cargo.lock | 1 + Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 439ec66f..69cca037 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1789,4 +1789,5 @@ checksum = "fc49afa5c8d634e75761feda8c592051e7eeb4683ba827211eb0d731d3402ea8" dependencies = [ "cc", "libc", + "pkg-config", ] diff --git a/Cargo.toml b/Cargo.toml index 21bcb282..d4888739 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -72,6 +72,7 @@ guess_host_triple = "0.1.3" default = ["static"] mimalloc = ["dep:mimalloc"] static = ["bzip2/static", "xz2/static"] +pkg-config = ["zstd/pkg-config"] [dev-dependencies] env_logger = "0.9.0" From 997d4e4e9d50ac8ddb84b972deb1a0a0e5826a50 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 19:27:37 +1000 Subject: [PATCH 0504/2020] Run workflow unit-tests with feature pkg-config Signed-off-by: Jiahao XU --- .github/workflows/unit-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index b8bad484..122864c1 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -30,3 +30,4 @@ jobs: uses: actions-rs/cargo@v1 with: command: test + args: --no-default-features --features pkg-config From b22a55f08fb85630244a53ce010a11415da55f60 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 19:37:30 +1000 Subject: [PATCH 0505/2020] Install lzma, bzip and zstd lib in workflow unit-tests Signed-off-by: Jiahao XU --- .github/workflows/unit-tests.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 122864c1..3ffcaad1 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -26,6 +26,10 @@ jobs: path: | ${{ env.HOME }}/.cargo target + - name: Insall dependencies + run: | + apt update + apt install -y --no-install-recommends liblzma-dev libzip-dev libzstd-dev - name: test uses: actions-rs/cargo@v1 with: From 1499f5c2018f42aaaa1e7483e3944f1f1723e25d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 19:40:22 +1000 Subject: [PATCH 0506/2020] Install lzma, bzip & zstd in integration test CI Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index 280efa7e..09244ba1 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -79,6 +79,12 @@ jobs: if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} run: sudo apt-get install -y musl-tools + - name: Install liblzma-dev, libzip-dev and libzstd-dev + if: ${{ startsWith(matrix.target, 'x86_64-unknown-linux-') }} + run: | + sudo apt update + sudo apt install -y --no-install-recommends liblzma-dev libzip-dev libzstd-dev + - name: Build release uses: actions-rs/cargo@v1 if: ${{ startsWith(github.ref, 'refs/tags/v') }} From 3dbec7718d3a115e7da68a654f2869ef5bdbe52f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 19:40:56 +1000 Subject: [PATCH 0507/2020] Fix dep installation in workflow "unit-tests" Signed-off-by: Jiahao XU --- .github/workflows/unit-tests.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 3ffcaad1..3a9b97b8 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -26,10 +26,10 @@ jobs: path: | ${{ env.HOME }}/.cargo target - - name: Insall dependencies + - name: Install liblzma-dev, libzip-dev and libzstd-dev run: | - apt update - apt install -y --no-install-recommends liblzma-dev libzip-dev libzstd-dev + sudo apt update + sudo apt install -y --no-install-recommends liblzma-dev libzip-dev libzstd-dev - name: test uses: actions-rs/cargo@v1 with: From c2349a15cbcc00f537eee65d6937adaf07c08081 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 19:42:18 +1000 Subject: [PATCH 0508/2020] Install lzma, bzip & zstd only on debug build in integration test CI Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index 09244ba1..33689ba3 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -80,7 +80,7 @@ jobs: run: sudo apt-get install -y musl-tools - name: Install liblzma-dev, libzip-dev and libzstd-dev - if: ${{ startsWith(matrix.target, 'x86_64-unknown-linux-') }} + if: ${{ startsWith(matrix.target, 'x86_64-unknown-linux-') && !startsWith(github.ref, 'refs/tags/v') }} run: | sudo apt update sudo apt install -y --no-install-recommends liblzma-dev libzip-dev libzstd-dev From 74dd3b6c70911370eb30aea35bddb70918d294fc Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 19:42:50 +1000 Subject: [PATCH 0509/2020] Build debug with feature pkg-config in integration test CI Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index 33689ba3..2ec73789 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -98,7 +98,7 @@ jobs: if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} with: command: build - args: --target ${{ matrix.target }} + args: --target ${{ matrix.target }} --no-default-features --features pkg-config use-cross: ${{ matrix.use-cross }} - name: Copy and rename utility From 8a32ab5dd3d5c5013eb0145ba307198fe10da2f2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 19:47:02 +1000 Subject: [PATCH 0510/2020] Refactor: Extract `ci-scripts/install-deps.sh` Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 6 ++---- .github/workflows/unit-tests.yml | 6 ++---- ci-scripts/install-deps.sh | 6 ++++++ 3 files changed, 10 insertions(+), 8 deletions(-) create mode 100755 ci-scripts/install-deps.sh diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index 2ec73789..9dc8f91b 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -79,11 +79,9 @@ jobs: if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} run: sudo apt-get install -y musl-tools - - name: Install liblzma-dev, libzip-dev and libzstd-dev + - name: Install deps if: ${{ startsWith(matrix.target, 'x86_64-unknown-linux-') && !startsWith(github.ref, 'refs/tags/v') }} - run: | - sudo apt update - sudo apt install -y --no-install-recommends liblzma-dev libzip-dev libzstd-dev + run: sudo ./ci-scripts/install-deps.sh - name: Build release uses: actions-rs/cargo@v1 diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 3a9b97b8..5b9a86b4 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -26,10 +26,8 @@ jobs: path: | ${{ env.HOME }}/.cargo target - - name: Install liblzma-dev, libzip-dev and libzstd-dev - run: | - sudo apt update - sudo apt install -y --no-install-recommends liblzma-dev libzip-dev libzstd-dev + - name: Install deps + run: sudo ./ci-scripts/install-deps.sh - name: test uses: actions-rs/cargo@v1 with: diff --git a/ci-scripts/install-deps.sh b/ci-scripts/install-deps.sh new file mode 100755 index 00000000..085c3286 --- /dev/null +++ b/ci-scripts/install-deps.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +set -euxo pipefail + +apt update +exec apt install -y --no-install-recommends liblzma-dev libzip-dev libzstd-dev From adbc2d4a110cba4d6030db031ce897bab2d0fc00 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 19:56:42 +1000 Subject: [PATCH 0511/2020] Disable feature `pkg-config` for cross compilation. Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index 9dc8f91b..b450f0ef 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -91,13 +91,20 @@ jobs: args: --target ${{ matrix.target }} --release use-cross: ${{ matrix.use-cross }} + - name: Build debug with cross compilation + uses: actions-rs/cargo@v1 + if: ${{ ! startsWith(github.ref, 'refs/tags/v') && matrix.use-cross == 'true' }} + with: + command: build + args: --target ${{ matrix.target }} --no-default-features + use-cross: true + - name: Build debug uses: actions-rs/cargo@v1 if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} with: command: build args: --target ${{ matrix.target }} --no-default-features --features pkg-config - use-cross: ${{ matrix.use-cross }} - name: Copy and rename utility if: ${{ startsWith(github.ref, 'refs/tags/v') }} From f2d5d0291b38379948e4398f12a827073f9afeef Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 20:01:09 +1000 Subject: [PATCH 0512/2020] Always disable feature pkg-config in integration test CI Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index b450f0ef..b570a8eb 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -91,20 +91,13 @@ jobs: args: --target ${{ matrix.target }} --release use-cross: ${{ matrix.use-cross }} - - name: Build debug with cross compilation - uses: actions-rs/cargo@v1 - if: ${{ ! startsWith(github.ref, 'refs/tags/v') && matrix.use-cross == 'true' }} - with: - command: build - args: --target ${{ matrix.target }} --no-default-features - use-cross: true - - name: Build debug uses: actions-rs/cargo@v1 if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} with: command: build - args: --target ${{ matrix.target }} --no-default-features --features pkg-config + args: --target ${{ matrix.target }} --no-default-features + use-cross: ${{ matrix.use-cross }} - name: Copy and rename utility if: ${{ startsWith(github.ref, 'refs/tags/v') }} From 6fe2762f115ca591f8daa7d9d86dfc2c4cf1b599 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 20:26:28 +1000 Subject: [PATCH 0513/2020] Add new feature zlib-ng (enabeld by default) Signed-off-by: Jiahao XU --- Cargo.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index d4888739..84e93bd5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ cargo_toml = "0.11.4" clap = { version = "3.2.12", features = ["derive"] } crates_io_api = { version = "0.8.0", default-features = false, features = ["rustls"] } dirs = "4.0.0" -flate2 = { version = "1.0.24", features = ["zlib-ng"], default-features = false } +flate2 = { version = "1.0.24", default-features = false } fs4 = "0.6.2" futures-util = { version = "0.3.21", default-features = false } home = "0.5.3" @@ -69,10 +69,11 @@ zstd = { version = "0.10.0", default-features = false } guess_host_triple = "0.1.3" [features] -default = ["static"] +default = ["static", "zlib-ng"] mimalloc = ["dep:mimalloc"] static = ["bzip2/static", "xz2/static"] pkg-config = ["zstd/pkg-config"] +zlib-ng = ["flate2/zlib-ng"] [dev-dependencies] env_logger = "0.9.0" From 162e4838d8f1877382a1894308d96bd61bdfa22f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 20:32:12 +1000 Subject: [PATCH 0514/2020] Add new feature rustls (enabled by default) Signed-off-by: Jiahao XU --- Cargo.toml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 84e93bd5..8df059e2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ bytes = "1.1.0" bzip2 = "0.4.3" cargo_toml = "0.11.4" clap = { version = "3.2.12", features = ["derive"] } -crates_io_api = { version = "0.8.0", default-features = false, features = ["rustls"] } +crates_io_api = { version = "0.8.0", default-features = false } dirs = "4.0.0" flate2 = { version = "1.0.24", default-features = false } fs4 = "0.6.2" @@ -35,7 +35,7 @@ log = "0.4.14" miette = { version = "5.1.1", features = ["fancy-no-backtrace"] } mimalloc = { version = "0.1.29", default-features = false, optional = true } once_cell = "1.13.0" -reqwest = { version = "0.11.11", features = ["rustls-tls", "stream"], default-features = false } +reqwest = { version = "0.11.11", features = ["stream"], default-features = false } scopeguard = "1.1.0" semver = "1.0.12" serde = { version = "1.0.139", features = ["derive"] } @@ -69,11 +69,12 @@ zstd = { version = "0.10.0", default-features = false } guess_host_triple = "0.1.3" [features] -default = ["static", "zlib-ng"] +default = ["static", "zlib-ng", "rustls"] mimalloc = ["dep:mimalloc"] static = ["bzip2/static", "xz2/static"] pkg-config = ["zstd/pkg-config"] zlib-ng = ["flate2/zlib-ng"] +rustls = ["crates_io_api/rustls", "reqwest/rustls-tls"] [dev-dependencies] env_logger = "0.9.0" From 0150e229aa6de27eda50692c78e2b68fc5b81da6 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 20:33:41 +1000 Subject: [PATCH 0515/2020] Add new feature native-tls Signed-off-by: Jiahao XU --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 8df059e2..352a5278 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -75,6 +75,7 @@ static = ["bzip2/static", "xz2/static"] pkg-config = ["zstd/pkg-config"] zlib-ng = ["flate2/zlib-ng"] rustls = ["crates_io_api/rustls", "reqwest/rustls-tls"] +native-tls = ["reqwest/native-tls"] [dev-dependencies] env_logger = "0.9.0" From f7caeea0e66892bfc003521885e026016b38886b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 20:34:13 +1000 Subject: [PATCH 0516/2020] Enable feature native-tls in unit-tests Signed-off-by: Jiahao XU --- .github/workflows/unit-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 5b9a86b4..f385c1a4 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -32,4 +32,4 @@ jobs: uses: actions-rs/cargo@v1 with: command: test - args: --no-default-features --features pkg-config + args: --no-default-features --features pkg-config,native-tls From 8e10c0d3561fb4a9ee181d6900a66e661324e252 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 20:35:46 +1000 Subject: [PATCH 0517/2020] Enable feature `native-tls` in debug build in integration CI when not doing cross compilation Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index b570a8eb..2541c8d7 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -93,11 +93,18 @@ jobs: - name: Build debug uses: actions-rs/cargo@v1 - if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} + if: ${{ ! startsWith(github.ref, 'refs/tags/v') && use-cross == 'false' }} with: command: build - args: --target ${{ matrix.target }} --no-default-features - use-cross: ${{ matrix.use-cross }} + args: --target ${{ matrix.target }} --no-default-features --features native-tls + + - name: Build debug with cross compilation + uses: actions-rs/cargo@v1 + if: ${{ ! startsWith(github.ref, 'refs/tags/v') && use-cross == 'true' }} + with: + command: build + args: --target ${{ matrix.target }} --no-default-features --features rustls + use-cross: true - name: Copy and rename utility if: ${{ startsWith(github.ref, 'refs/tags/v') }} From 00f60c18b4bb70b9047432a4d2c1ffbb71116e89 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 20:36:23 +1000 Subject: [PATCH 0518/2020] Enable feature pkg-config in debug build of integration CI when not doing cross compilation. Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index 2541c8d7..dd50ca78 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -96,7 +96,7 @@ jobs: if: ${{ ! startsWith(github.ref, 'refs/tags/v') && use-cross == 'false' }} with: command: build - args: --target ${{ matrix.target }} --no-default-features --features native-tls + args: --target ${{ matrix.target }} --no-default-features --features pkg-config,native-tls - name: Build debug with cross compilation uses: actions-rs/cargo@v1 From d3bd11c1823b89c8389dc6754c432281918d4d7b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 20:36:46 +1000 Subject: [PATCH 0519/2020] Improve readability of features in `Cargo.toml` Signed-off-by: Jiahao XU --- Cargo.toml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 352a5278..b69d3385 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -70,10 +70,14 @@ guess_host_triple = "0.1.3" [features] default = ["static", "zlib-ng", "rustls"] + mimalloc = ["dep:mimalloc"] + static = ["bzip2/static", "xz2/static"] pkg-config = ["zstd/pkg-config"] + zlib-ng = ["flate2/zlib-ng"] + rustls = ["crates_io_api/rustls", "reqwest/rustls-tls"] native-tls = ["reqwest/native-tls"] From bdef2169a30129d6fb155917e1ad6acfa7258e6f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 20:38:18 +1000 Subject: [PATCH 0520/2020] Fix typo in integration test CI Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index dd50ca78..e8cdd5c0 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -93,14 +93,14 @@ jobs: - name: Build debug uses: actions-rs/cargo@v1 - if: ${{ ! startsWith(github.ref, 'refs/tags/v') && use-cross == 'false' }} + if: ${{ ! startsWith(github.ref, 'refs/tags/v') && matrix.use-cross == 'false' }} with: command: build args: --target ${{ matrix.target }} --no-default-features --features pkg-config,native-tls - name: Build debug with cross compilation uses: actions-rs/cargo@v1 - if: ${{ ! startsWith(github.ref, 'refs/tags/v') && use-cross == 'true' }} + if: ${{ ! startsWith(github.ref, 'refs/tags/v') && matrix.use-cross == 'true' }} with: command: build args: --target ${{ matrix.target }} --no-default-features --features rustls From 272d049cf6c269a87e0619f24fd19b6574dcfeaf Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 20:40:24 +1000 Subject: [PATCH 0521/2020] Fix cond in integration test CI Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index e8cdd5c0..54c6d37d 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -93,14 +93,14 @@ jobs: - name: Build debug uses: actions-rs/cargo@v1 - if: ${{ ! startsWith(github.ref, 'refs/tags/v') && matrix.use-cross == 'false' }} + if: ${{ ! startsWith(github.ref, 'refs/tags/v') && matrix.use-cross }} with: command: build args: --target ${{ matrix.target }} --no-default-features --features pkg-config,native-tls - name: Build debug with cross compilation uses: actions-rs/cargo@v1 - if: ${{ ! startsWith(github.ref, 'refs/tags/v') && matrix.use-cross == 'true' }} + if: ${{ ! startsWith(github.ref, 'refs/tags/v') && matrix.use-cross }} with: command: build args: --target ${{ matrix.target }} --no-default-features --features rustls From 1df00e5ba873289d3b66e13cc5a41161b7534cbd Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 21:29:41 +1000 Subject: [PATCH 0522/2020] Enable native-tls on non-cross build & pkg-config on x86_64 linux gnu Signed-off-by: Jiahao XU --- .../workflows/build-and-integration-tests.yml | 16 +- Cargo.lock | 159 ++++++++++++++++++ 2 files changed, 165 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index 54c6d37d..ffa44bad 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -23,21 +23,25 @@ jobs: output: cargo-binstall use-cross: false test: true + debug_build_args: --features pkg-config,native-tls - target: x86_64-apple-darwin os: macos-latest output: cargo-binstall use-cross: false test: true + debug_build_args: --features native-tls - target: aarch64-apple-darwin os: macos-latest output: cargo-binstall use-cross: false test: false + debug_build_args: --features native-tls - target: x86_64-pc-windows-msvc os: windows-latest output: cargo-binstall.exe use-cross: false test: false + debug_build_args: --features native-tls - target: x86_64-unknown-linux-musl os: ubuntu-latest output: cargo-binstall @@ -93,18 +97,10 @@ jobs: - name: Build debug uses: actions-rs/cargo@v1 - if: ${{ ! startsWith(github.ref, 'refs/tags/v') && matrix.use-cross }} + if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} with: command: build - args: --target ${{ matrix.target }} --no-default-features --features pkg-config,native-tls - - - name: Build debug with cross compilation - uses: actions-rs/cargo@v1 - if: ${{ ! startsWith(github.ref, 'refs/tags/v') && matrix.use-cross }} - with: - command: build - args: --target ${{ matrix.target }} --no-default-features --features rustls - use-cross: true + args: --target ${{ matrix.target }} --no-default-features ${{ matrix.debug_build_args }} - name: Copy and rename utility if: ${{ startsWith(github.ref, 'refs/tags/v') }} diff --git a/Cargo.lock b/Cargo.lock index 69cca037..410ea2e0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -223,6 +223,22 @@ dependencies = [ "cc", ] +[[package]] +name = "core-foundation" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" + [[package]] name = "crates_io_api" version = "0.8.0" @@ -360,6 +376,21 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +dependencies = [ + "foreign-types-shared", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" + [[package]] name = "form_urlencoded" version = "1.0.1" @@ -619,6 +650,19 @@ dependencies = [ "tokio-rustls", ] +[[package]] +name = "hyper-tls" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" +dependencies = [ + "bytes", + "hyper", + "native-tls", + "tokio", + "tokio-native-tls", +] + [[package]] name = "idna" version = "0.2.3" @@ -826,6 +870,24 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "native-tls" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" +dependencies = [ + "lazy_static", + "libc", + "log", + "openssl", + "openssl-probe", + "openssl-sys", + "schannel", + "security-framework", + "security-framework-sys", + "tempfile", +] + [[package]] name = "num-integer" version = "0.1.45" @@ -870,6 +932,51 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" +[[package]] +name = "openssl" +version = "0.10.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "618febf65336490dfcf20b73f885f5651a0c89c64c2d4a8c3662585a70bf5bd0" +dependencies = [ + "bitflags", + "cfg-if", + "foreign-types", + "libc", + "once_cell", + "openssl-macros", + "openssl-sys", +] + +[[package]] +name = "openssl-macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "openssl-probe" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" + +[[package]] +name = "openssl-sys" +version = "0.9.75" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5f9bd0c2710541a3cda73d6f9ac4f1b240de4ae261065d309dbe73d9dceb42f" +dependencies = [ + "autocfg", + "cc", + "libc", + "pkg-config", + "vcpkg", +] + [[package]] name = "os_str_bytes" version = "6.1.0" @@ -1010,11 +1117,13 @@ dependencies = [ "http-body", "hyper", "hyper-rustls", + "hyper-tls", "ipnet", "js-sys", "lazy_static", "log", "mime", + "native-tls", "percent-encoding", "pin-project-lite", "rustls", @@ -1023,6 +1132,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "tokio", + "tokio-native-tls", "tokio-rustls", "tokio-util", "tower-service", @@ -1096,6 +1206,16 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" +[[package]] +name = "schannel" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +dependencies = [ + "lazy_static", + "windows-sys", +] + [[package]] name = "scopeguard" version = "1.1.0" @@ -1112,6 +1232,29 @@ dependencies = [ "untrusted", ] +[[package]] +name = "security-framework" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "semver" version = "1.0.12" @@ -1410,6 +1553,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "tokio-native-tls" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +dependencies = [ + "native-tls", + "tokio", +] + [[package]] name = "tokio-rustls" version = "0.23.4" @@ -1530,6 +1683,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "vcpkg" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" + [[package]] name = "version_check" version = "0.9.4" From 450facd260c2441ce272aabd94350b35063f0718 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 21:31:19 +1000 Subject: [PATCH 0523/2020] Install deps only on x86_64 linux gnu Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index ffa44bad..d084adbf 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -84,7 +84,7 @@ jobs: run: sudo apt-get install -y musl-tools - name: Install deps - if: ${{ startsWith(matrix.target, 'x86_64-unknown-linux-') && !startsWith(github.ref, 'refs/tags/v') }} + if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' && !startsWith(github.ref, 'refs/tags/v') }} run: sudo ./ci-scripts/install-deps.sh - name: Build release From 6e1f930c8eab39bbc134ef5598a2e4755ef449ff Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 21:38:58 +1000 Subject: [PATCH 0524/2020] Disable native-tls for x86_64 linux-gnu and apple-darwin Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index d084adbf..0da06e02 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -23,13 +23,12 @@ jobs: output: cargo-binstall use-cross: false test: true - debug_build_args: --features pkg-config,native-tls + debug_build_args: --features pkg-config - target: x86_64-apple-darwin os: macos-latest output: cargo-binstall use-cross: false test: true - debug_build_args: --features native-tls - target: aarch64-apple-darwin os: macos-latest output: cargo-binstall From 018196de453b72d67548145ca4121c5d571b8292 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 21:40:16 +1000 Subject: [PATCH 0525/2020] Disable default features only when debug_build_args is overriden Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index 0da06e02..30a0a7c8 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -23,7 +23,7 @@ jobs: output: cargo-binstall use-cross: false test: true - debug_build_args: --features pkg-config + debug_build_args: --no-default-features --features pkg-config - target: x86_64-apple-darwin os: macos-latest output: cargo-binstall @@ -34,13 +34,13 @@ jobs: output: cargo-binstall use-cross: false test: false - debug_build_args: --features native-tls + debug_build_args: --no-default-features --features native-tls - target: x86_64-pc-windows-msvc os: windows-latest output: cargo-binstall.exe use-cross: false test: false - debug_build_args: --features native-tls + debug_build_args: --no-default-features --features native-tls - target: x86_64-unknown-linux-musl os: ubuntu-latest output: cargo-binstall @@ -99,7 +99,7 @@ jobs: if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} with: command: build - args: --target ${{ matrix.target }} --no-default-features ${{ matrix.debug_build_args }} + args: --target ${{ matrix.target }} ${{ matrix.debug_build_args }} - name: Copy and rename utility if: ${{ startsWith(github.ref, 'refs/tags/v') }} From 026aefb5a7410ab62a8677401052b074ce3d3138 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 21:40:38 +1000 Subject: [PATCH 0526/2020] Enable rustls for x86_64-unknown-linux-gnu Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index 30a0a7c8..6c5b2842 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -23,7 +23,7 @@ jobs: output: cargo-binstall use-cross: false test: true - debug_build_args: --no-default-features --features pkg-config + debug_build_args: --no-default-features --features rustls,pkg-config - target: x86_64-apple-darwin os: macos-latest output: cargo-binstall From 291269f50f0ba27b86361d4cadbc79b096208e98 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 21:52:22 +1000 Subject: [PATCH 0527/2020] Fix "Build debug": Add back `use-cross` Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index 6c5b2842..27044909 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -100,6 +100,7 @@ jobs: with: command: build args: --target ${{ matrix.target }} ${{ matrix.debug_build_args }} + use-cross: ${{ matrix.use-cross }} - name: Copy and rename utility if: ${{ startsWith(github.ref, 'refs/tags/v') }} From 82aa893306587999d9711e6c8861f8e14b0423c9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 22:00:53 +1000 Subject: [PATCH 0528/2020] Disable feature static & zlib-ng on x86_64-apple-darwin Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index 27044909..ad1a01e6 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -29,6 +29,7 @@ jobs: output: cargo-binstall use-cross: false test: true + debug_build_args: --no-default-features --features rustls - target: aarch64-apple-darwin os: macos-latest output: cargo-binstall From 23139e9db5a7d8cfda525f4de79e59a16f0cea2e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 22:02:19 +1000 Subject: [PATCH 0529/2020] Use rustls on debug for aarch64-apple-darwin Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index ad1a01e6..1af3cfa0 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -35,7 +35,7 @@ jobs: output: cargo-binstall use-cross: false test: false - debug_build_args: --no-default-features --features native-tls + debug_build_args: --no-default-features --features rustls - target: x86_64-pc-windows-msvc os: windows-latest output: cargo-binstall.exe From b33a606109bf3dbe60be5bb43f785440f6f704ec Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 22:03:39 +1000 Subject: [PATCH 0530/2020] Use native-tls for x86_64-pc-windows-msvc on release Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index 1af3cfa0..ab8a90dd 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -42,6 +42,7 @@ jobs: use-cross: false test: false debug_build_args: --no-default-features --features native-tls + release_build_args: --no-default-features --features static,zlib-ng,native-tls - target: x86_64-unknown-linux-musl os: ubuntu-latest output: cargo-binstall @@ -92,7 +93,7 @@ jobs: if: ${{ startsWith(github.ref, 'refs/tags/v') }} with: command: build - args: --target ${{ matrix.target }} --release + args: --target ${{ matrix.target }} --release ${{ matrix.release_build_args }} use-cross: ${{ matrix.use-cross }} - name: Build debug From 18e0730afbf5689f0a0be193dab90da4a0363da6 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 22:12:00 +1000 Subject: [PATCH 0531/2020] Disable static and zlib-ng on cross compilation Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index ab8a90dd..fb4ef2e9 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -48,18 +48,21 @@ jobs: output: cargo-binstall use-cross: false test: true + debug_build_args: --no-default-features --features rustls - target: armv7-unknown-linux-musleabihf os: ubuntu-20.04 output: cargo-binstall use-cross: true test: false + debug_build_args: --no-default-features --features rustls - target: aarch64-unknown-linux-musl os: ubuntu-latest output: cargo-binstall use-cross: true test: false - runs-on: ${{ matrix.os }} + debug_build_args: --no-default-features --features rustls + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - uses: FranzDiebold/github-env-vars-action@v1.2.1 From 788bb85b8f54540861b28f71fc4dfb22b1a238bf Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 22:26:05 +1000 Subject: [PATCH 0532/2020] Use zig-cc for `cross` Signed-off-by: Jiahao XU --- Cross.toml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cross.toml b/Cross.toml index a384d49c..7b36bf82 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,11 +1,11 @@ [target.armv7-unknown-linux-gnueabihf] -image = "ghcr.io/cross-rs/armv7-unknown-linux-gnueabihf@sha256:379eee7aa254912a803b558fe0742450dd32ca9749bc8b931927dafa2ce6e8d3" +zig = true [target.armv7-unknown-linux-musleabihf] -image = "ghcr.io/cross-rs/armv7-unknown-linux-musleabihf@sha256:00088ebbb98f5d9895c2b6e7f713cd3028331185fe82f60d93efc03bdff8ea65" +zig = true [target.aarch64-unknown-linux-gnu] -image = "ghcr.io/cross-rs/aarch64-unknown-linux-gnu@sha256:5db2a92c73d1251c5fb9de895928ef2551c08d0ec30b969cf7340ca3dd62ea81" +zig = true [target.aarch64-unknown-linux-musl] -image = "ghcr.io/cross-rs/aarch64-unknown-linux-musl@sha256:341256c185132fff9265ee7c8d94ba9b4fde3e8cfa8b39047c0e64ba4c1faf9a" +zig = true From e3a5ca29917f76216fb35c7dbdd6d9a8ee230db9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 22:50:57 +1000 Subject: [PATCH 0533/2020] Add back target `armv7-unknown-linux-gnueabihf` Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index fb4ef2e9..e667df9b 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -55,6 +55,12 @@ jobs: use-cross: true test: false debug_build_args: --no-default-features --features rustls + - target: armv7-unknown-linux-gnueabihf + os: ubuntu-20.04 + output: cargo-binstall + use-cross: true + test: false + debug_build_args: --no-default-features --features rustls - target: aarch64-unknown-linux-musl os: ubuntu-latest output: cargo-binstall From e857a88426fe0b6a7652f13fe0fd3652646a8707 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 22:51:46 +1000 Subject: [PATCH 0534/2020] Add back target `aarch64-unknown-linux-gnu` Signed-off-by: Jiahao XU --- .github/workflows/build-and-integration-tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index e667df9b..c06931ab 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -67,6 +67,12 @@ jobs: use-cross: true test: false debug_build_args: --no-default-features --features rustls + - target: aarch64-unknown-linux-gnu + os: ubuntu-latest + output: cargo-binstall + use-cross: true + test: false + debug_build_args: --no-default-features --features rustls runs-on: ${{ matrix.os }} steps: From db0ae7cde5ead6043538388b914f3067490ece14 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Jul 2022 23:22:01 +1000 Subject: [PATCH 0535/2020] Enable zig for all cross targets Signed-off-by: Jiahao XU --- Cross.toml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/Cross.toml b/Cross.toml index 7b36bf82..7679dc71 100644 --- a/Cross.toml +++ b/Cross.toml @@ -1,11 +1,2 @@ -[target.armv7-unknown-linux-gnueabihf] -zig = true - -[target.armv7-unknown-linux-musleabihf] -zig = true - -[target.aarch64-unknown-linux-gnu] -zig = true - -[target.aarch64-unknown-linux-musl] +[build] zig = true From 7603267e336296a283dfdaf5d9c9c315c18ea025 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 24 Jul 2022 01:33:34 +1200 Subject: [PATCH 0536/2020] Update dependencies (#232) --- Cargo.lock | 124 ++++++++++++++++++++++++++++++++++++----------------- Cargo.toml | 16 +++---- 2 files changed, 93 insertions(+), 47 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 410ea2e0..0f4033d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -71,9 +71,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "f0b3de4a0c5e67e16066a0715723abd91edc2f9001d09c46e1dca929351e130e" [[package]] name = "bzip2" @@ -107,6 +107,7 @@ dependencies = [ "clap", "crates_io_api", "dirs", + "embed-resource", "env_logger", "flate2", "fs4", @@ -177,9 +178,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.12" +version = "3.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8b79fe3946ceb4a0b1c080b4018992b8d27e9ff363644c1c9b6387c854614d" +checksum = "54635806b078b7925d6e36810b1755f2a4b5b4d57560432c1ecf60bcbe10602b" dependencies = [ "atty", "bitflags", @@ -207,9 +208,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87eba3c8c7f42ef17f6c659fc7416d0f4758cd3e58861ee63c5fa4a4dde649e4" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" dependencies = [ "os_str_bytes", ] @@ -267,9 +268,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d82ee10ce34d7bc12c2122495e7593a9c41347ecdd64185af4ecf72cb1a7f83" +checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" dependencies = [ "cfg-if", "once_cell", @@ -295,6 +296,19 @@ dependencies = [ "winapi", ] +[[package]] +name = "embed-resource" +version = "1.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "936c1354206a875581696369aef920e12396e93bbd251c43a7a3f3fa85023a7d" +dependencies = [ + "cc", + "rustc_version", + "toml", + "vswhom", + "winreg", +] + [[package]] name = "encoding_rs" version = "0.8.31" @@ -349,14 +363,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0408e2626025178a6a7f7ffc05a25bc47103229f19c113755de7bf63816290c" +checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" dependencies = [ "cfg-if", "libc", "redox_syscall", - "winapi", + "windows-sys", ] [[package]] @@ -545,9 +559,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db0d4cf898abf0081f964436dc980e96670a0f36863e4b83aaacdb65c9d7ccc3" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "heck" @@ -615,9 +629,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.19" +version = "0.14.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42dc3c131584288d375f2d07f822b0cb012d8c6fb899a5b9fdb3cb7eb9b6004f" +checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" dependencies = [ "bytes", "futures-channel", @@ -979,9 +993,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.1.0" +version = "6.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afa" +checksum = "648001efe5d5c0102d8cea768e348da85d90af8ba91f0bea908f157951493cd4" [[package]] name = "owo-colors" @@ -1057,9 +1071,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.13" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +checksum = "534cfe58d6a18cc17120fbf4635d53d14691c1fe4d951064df9bd326178d7d5a" dependencies = [ "bitflags", ] @@ -1077,9 +1091,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.5.6" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ "aho-corasick", "memchr", @@ -1088,9 +1102,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.26" +version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "remove_dir_all" @@ -1159,6 +1173,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "rustc_version" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +dependencies = [ + "semver", +] + [[package]] name = "rustix" version = "0.35.7" @@ -1196,9 +1219,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0a5f7c728f5d284929a1cccb5bc19884422bfe6ef4d6c409da2c41838983fcf" +checksum = "24c8ad4f0c00e1eb5bc7614d236a7f1300e3dbd76b68cac8e06fb00b015ad8d8" [[package]] name = "ryu" @@ -1263,18 +1286,18 @@ checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" [[package]] name = "serde" -version = "1.0.139" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0171ebb889e45aa68b44aee0859b3eede84c6f5f5c228e6f140c0b2a0a46cad6" +checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.139" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc1d3230c1de7932af58ad8ffbe1d784bd55efd5a9d84ac24f69c72d83543dfb" +checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" dependencies = [ "proc-macro2", "quote", @@ -1326,9 +1349,12 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] [[package]] name = "smawk" @@ -1590,9 +1616,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.9" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82e1a7758622a465f8cee077614c73484dac5b836c02ff6a40d5d1010324d7" +checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" dependencies = [ "serde", ] @@ -1637,9 +1663,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" +checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" [[package]] name = "unicode-linebreak" @@ -1652,9 +1678,9 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81dee68f85cab8cf68dec42158baf3a79a1cdc065a8b103025965d6ccb7f6cbd" +checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" dependencies = [ "tinyvec", ] @@ -1695,6 +1721,26 @@ version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "vswhom" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be979b7f07507105799e854203b470ff7c78a1639e330a58f183b5fea574608b" +dependencies = [ + "libc", + "vswhom-sys", +] + +[[package]] +name = "vswhom-sys" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22025f6d8eb903ebf920ea6933b70b1e495be37e2cb4099e62c80454aaf57c39" +dependencies = [ + "cc", + "libc", +] + [[package]] name = "want" version = "0.3.0" @@ -1799,9 +1845,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d8de8415c823c8abd270ad483c6feeac771fad964890779f9a8cb24fbbc1bf" +checksum = "f1c760f0d366a6c24a02ed7816e23e691f5d92291f94d15e836006fd11b04daf" dependencies = [ "webpki", ] diff --git a/Cargo.toml b/Cargo.toml index b69d3385..5ef85eb5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,10 +20,10 @@ pkg-fmt = "zip" [dependencies] async-trait = "0.1.56" -bytes = "1.1.0" +bytes = "1.2.0" bzip2 = "0.4.3" -cargo_toml = "0.11.4" -clap = { version = "3.2.12", features = ["derive"] } +cargo_toml = "0.11.5" +clap = { version = "3.2.14", features = ["derive"] } crates_io_api = { version = "0.8.0", default-features = false } dirs = "4.0.0" flate2 = { version = "1.0.24", default-features = false } @@ -31,14 +31,14 @@ fs4 = "0.6.2" futures-util = { version = "0.3.21", default-features = false } home = "0.5.3" jobserver = "0.1.24" -log = "0.4.14" +log = "0.4.17" miette = { version = "5.1.1", features = ["fancy-no-backtrace"] } mimalloc = { version = "0.1.29", default-features = false, optional = true } once_cell = "1.13.0" reqwest = { version = "0.11.11", features = ["stream"], default-features = false } scopeguard = "1.1.0" semver = "1.0.12" -serde = { version = "1.0.139", features = ["derive"] } +serde = { version = "1.0.140", features = ["derive"] } serde_json = "1.0.82" simplelog = "0.12.0" strum = "0.24.1" @@ -48,9 +48,9 @@ tempfile = "3.3.0" thiserror = "1.0.31" tinytemplate = "1.2.1" tokio = { version = "1.20.0", features = ["rt-multi-thread", "process", "sync"], default-features = false } -toml = "0.5.9" +toml = "0.5.8" url = "2.2.2" -xz2 = "0.1.6" +xz2 = "0.1.7" # Disable all features of zip except for features of compression algorithms: # Disabled features include: @@ -85,7 +85,7 @@ native-tls = ["reqwest/native-tls"] env_logger = "0.9.0" [build-dependencies] -embed-resource = "1.6.1" +embed-resource = "1.7.3" [profile.release] opt-level = "z" From e93f0beb4bf96b8a93974b3770cb69ace748fe89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 24 Jul 2022 03:33:31 +1200 Subject: [PATCH 0537/2020] Remove support for .crates2.json (#235) --- Cargo.lock | 1 - Cargo.toml | 1 - src/main.rs | 15 ------ src/metafiles.rs | 1 - src/metafiles/v2.rs | 125 -------------------------------------------- 5 files changed, 143 deletions(-) delete mode 100644 src/metafiles/v2.rs diff --git a/Cargo.lock b/Cargo.lock index 0f4033d7..411b72c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -123,7 +123,6 @@ dependencies = [ "scopeguard", "semver", "serde", - "serde_json", "simplelog", "strum", "strum_macros", diff --git a/Cargo.toml b/Cargo.toml index 5ef85eb5..26541c2a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,6 @@ reqwest = { version = "0.11.11", features = ["stream"], default-features = false scopeguard = "1.1.0" semver = "1.0.12" serde = { version = "1.0.140", features = ["derive"] } -serde_json = "1.0.82" simplelog = "0.12.0" strum = "0.24.1" strum_macros = "0.24.2" diff --git a/src/main.rs b/src/main.rs index b5a79ad0..8e250165 100644 --- a/src/main.rs +++ b/src/main.rs @@ -349,21 +349,6 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { .iter() .map(|metadata| (&metadata.cvs, metadata.bins.clone())), )?; - - debug!("Writing .crates2.json"); - metafiles::v2::Crates2Json::append(metadata_vec.into_iter().map(|metadata| { - ( - metadata.cvs, - metafiles::v2::CrateInfo { - version_req: Some(metadata.version_req), - bins: metadata.bins, - profile: "release".into(), - target: metadata.target, - rustc: format!("{} {}", env!("CARGO_PKG_NAME"), env!("CARGO_PKG_VERSION")), - ..Default::default() - }, - ) - }))?; } if opts.no_cleanup { diff --git a/src/metafiles.rs b/src/metafiles.rs index 06323a52..75ad0250 100644 --- a/src/metafiles.rs +++ b/src/metafiles.rs @@ -2,4 +2,3 @@ mod cvs; pub use cvs::*; pub mod v1; -pub mod v2; diff --git a/src/metafiles/v2.rs b/src/metafiles/v2.rs deleted file mode 100644 index 1db6fb42..00000000 --- a/src/metafiles/v2.rs +++ /dev/null @@ -1,125 +0,0 @@ -use std::{ - collections::{BTreeMap, BTreeSet}, - fs, - io::{self, Seek}, - iter::IntoIterator, - path::{Path, PathBuf}, -}; - -use miette::Diagnostic; -use serde::{Deserialize, Serialize}; -use thiserror::Error; - -use super::CrateVersionSource; -use crate::{cargo_home, create_if_not_exist, FileLock}; - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct Crates2Json { - pub installs: BTreeMap, -} - -#[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CrateInfo { - #[serde(default)] - pub version_req: Option, - - #[serde(default)] - pub bins: BTreeSet, - - #[serde(default)] - pub features: BTreeSet, - - #[serde(default)] - pub all_features: bool, - - #[serde(default)] - pub no_default_features: bool, - - pub profile: String, - pub target: String, - pub rustc: String, -} - -impl Crates2Json { - pub fn default_path() -> Result { - Ok(cargo_home()?.join(".crates2.json")) - } - - pub fn load() -> Result { - Self::load_from_path(Self::default_path()?) - } - - pub fn load_from_reader(reader: R) -> Result { - Ok(serde_json::from_reader(reader)?) - } - - pub fn load_from_path(path: impl AsRef) -> Result { - let file = fs::File::open(path.as_ref())?; - Self::load_from_reader(file) - } - - pub fn insert(&mut self, cvs: &CrateVersionSource, info: CrateInfo) { - self.installs.insert(cvs.to_string(), info); - } - - pub fn write(&self) -> Result<(), Crates2JsonParseError> { - self.write_to_path(Self::default_path()?) - } - - pub fn write_to_writer(&self, writer: W) -> Result<(), Crates2JsonParseError> { - serde_json::to_writer(writer, &self)?; - Ok(()) - } - - pub fn write_to_file(&self, file: &mut fs::File) -> Result<(), Crates2JsonParseError> { - self.write_to_writer(&mut *file)?; - let pos = file.stream_position()?; - file.set_len(pos)?; - - Ok(()) - } - - pub fn write_to_path(&self, path: impl AsRef) -> Result<(), Crates2JsonParseError> { - let file = fs::File::create(path.as_ref())?; - self.write_to_writer(file) - } - - pub fn append_to_path( - path: impl AsRef, - iter: Iter, - ) -> Result<(), Crates2JsonParseError> - where - Iter: IntoIterator, - { - let mut file = FileLock::new_exclusive(create_if_not_exist(path.as_ref())?)?; - let mut c2 = Self::load_from_reader(&mut *file)?; - - for (cvs, info) in iter { - c2.insert(&cvs, info); - } - - file.rewind()?; - c2.write_to_file(&mut *file)?; - - Ok(()) - } - - pub fn append(iter: Iter) -> Result<(), Crates2JsonParseError> - where - Iter: IntoIterator, - { - Self::append_to_path(Self::default_path()?, iter) - } -} - -#[derive(Debug, Diagnostic, Error)] -pub enum Crates2JsonParseError { - #[error(transparent)] - Io(#[from] io::Error), - - #[error(transparent)] - Json(#[from] serde_json::Error), - - #[error(transparent)] - CvsParse(#[from] super::CvsParseError), -} From 6401f2bfa02affd9ef5fed7a624e7b0dbca80a99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 24 Jul 2022 03:33:55 +1200 Subject: [PATCH 0538/2020] Replace toml with toml_edit (#233) --- Cargo.lock | 39 ++++++++++++++++++++++++++++++++++++++- Cargo.toml | 2 +- src/metafiles/v1.rs | 28 ++++++++++------------------ 3 files changed, 49 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 411b72c6..fab7b3cc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -131,7 +131,7 @@ dependencies = [ "thiserror", "tinytemplate", "tokio", - "toml", + "toml_edit", "url", "xz2", "zip", @@ -223,6 +223,16 @@ dependencies = [ "cc", ] +[[package]] +name = "combine" +version = "4.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a604e93b79d1808327a6fca85a6f2d69de66461e7620f5a4cbf5fb4d1d7c948" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "core-foundation" version = "0.9.3" @@ -295,6 +305,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "either" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" + [[package]] name = "embed-resource" version = "1.7.3" @@ -724,6 +740,15 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" +[[package]] +name = "itertools" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.2" @@ -1622,6 +1647,18 @@ dependencies = [ "serde", ] +[[package]] +name = "toml_edit" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5376256e44f2443f8896ac012507c19a012df0fe8758b55246ae51a2279db51f" +dependencies = [ + "combine", + "indexmap", + "itertools", + "serde", +] + [[package]] name = "tower-service" version = "0.3.2" diff --git a/Cargo.toml b/Cargo.toml index 26541c2a..e033ca74 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -47,7 +47,7 @@ tempfile = "3.3.0" thiserror = "1.0.31" tinytemplate = "1.2.1" tokio = { version = "1.20.0", features = ["rt-multi-thread", "process", "sync"], default-features = false } -toml = "0.5.8" +toml_edit = { version = "0.14.4", features = ["easy"] } url = "2.2.2" xz2 = "0.1.7" diff --git a/src/metafiles/v1.rs b/src/metafiles/v1.rs index def69db6..b91f715a 100644 --- a/src/metafiles/v1.rs +++ b/src/metafiles/v1.rs @@ -1,10 +1,9 @@ use std::{ collections::{BTreeMap, BTreeSet}, - fs, + fs::File, io::{self, Seek}, iter::IntoIterator, path::{Path, PathBuf}, - str::FromStr, }; use miette::Diagnostic; @@ -31,12 +30,12 @@ impl CratesToml { pub fn load_from_reader(mut reader: R) -> Result { let mut vec = Vec::new(); reader.read_to_end(&mut vec)?; - Ok(toml::from_slice(&vec)?) + Ok(toml_edit::easy::from_slice(&vec)?) } pub fn load_from_path(path: impl AsRef) -> Result { - let file = fs::read_to_string(path)?; - Self::from_str(&file) + let file = File::open(path)?; + Self::load_from_reader(file) } pub fn insert(&mut self, cvs: &CrateVersionSource, bins: BTreeSet) { @@ -48,12 +47,12 @@ impl CratesToml { } pub fn write_to_writer(&self, mut writer: W) -> Result<(), CratesTomlParseError> { - let data = toml::to_vec(&self)?; + let data = toml_edit::easy::to_vec(&self)?; writer.write_all(&data)?; Ok(()) } - pub fn write_to_file(&self, file: &mut fs::File) -> Result<(), CratesTomlParseError> { + pub fn write_to_file(&self, file: &mut File) -> Result<(), CratesTomlParseError> { self.write_to_writer(&mut *file)?; let pos = file.stream_position()?; file.set_len(pos)?; @@ -62,8 +61,8 @@ impl CratesToml { } pub fn write_to_path(&self, path: impl AsRef) -> Result<(), CratesTomlParseError> { - fs::write(path, &toml::to_vec(&self)?)?; - Ok(()) + let mut file = File::create(path)?; + self.write_to_file(&mut file) } pub fn append_to_path<'a, Iter>( @@ -94,23 +93,16 @@ impl CratesToml { } } -impl FromStr for CratesToml { - type Err = CratesTomlParseError; - fn from_str(s: &str) -> Result { - Ok(toml::from_str(s)?) - } -} - #[derive(Debug, Diagnostic, Error)] pub enum CratesTomlParseError { #[error(transparent)] Io(#[from] io::Error), #[error(transparent)] - TomlParse(#[from] toml::de::Error), + TomlParse(#[from] toml_edit::easy::de::Error), #[error(transparent)] - TomlWrite(#[from] toml::ser::Error), + TomlWrite(#[from] toml_edit::easy::ser::Error), #[error(transparent)] CvsParse(#[from] super::CvsParseError), From 19266a4fb682856b68d07ebf7645118e35950b41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 24 Jul 2022 13:41:58 +1200 Subject: [PATCH 0539/2020] Disable zig for now (#238) --- Cross.toml | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 Cross.toml diff --git a/Cross.toml b/Cross.toml deleted file mode 100644 index 7679dc71..00000000 --- a/Cross.toml +++ /dev/null @@ -1,2 +0,0 @@ -[build] -zig = true From adef01f3ddae6956fa19cedf0c9c8af40614afc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 24 Jul 2022 14:32:23 +1200 Subject: [PATCH 0540/2020] Find best download source out of alternatives (format extension) (#236) --- Cargo.toml | 4 +- src/fetchers.rs | 13 +++-- src/fetchers/gh_crate_meta.rs | 91 ++++++++++++++++++++++------------- src/fetchers/quickinstall.rs | 6 +-- src/formats.rs | 23 ++++++--- src/helpers.rs | 6 +-- src/lib.rs | 2 +- 7 files changed, 93 insertions(+), 52 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e033ca74..e5d048cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,8 +10,8 @@ edition = "2021" license = "GPL-3.0" [package.metadata.binstall] -pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ format }" -bin-dir = "{ bin }{ format }" +pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }" +bin-dir = "{ bin }{ binary-ext }" [package.metadata.binstall.overrides.x86_64-pc-windows-msvc] pkg-fmt = "zip" diff --git a/src/fetchers.rs b/src/fetchers.rs index 46917e0f..16691707 100644 --- a/src/fetchers.rs +++ b/src/fetchers.rs @@ -21,8 +21,15 @@ pub trait Fetcher: Send + Sync { /// Fetch a package and extract async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError>; - /// Check if a package is available for download - async fn check(&self) -> Result; + /// Find the package, if it is available for download + /// + /// This may look for multiple remote targets, but must write (using some form of interior + /// mutability) the best one to the implementing struct in some way so `fetch_and_extract` can + /// proceed without additional work. + /// + /// Must return `true` if a package is available, `false` if none is, and reserve errors to + /// fatal conditions only. + async fn find(&self) -> Result; /// Return the package format fn pkg_fmt(&self) -> PkgFmt; @@ -56,7 +63,7 @@ impl MultiFetcher { pub fn add(&mut self, fetcher: Arc) { self.0.push(( fetcher.clone(), - AutoAbortJoinHandle::new(tokio::spawn(async move { fetcher.check().await })), + AutoAbortJoinHandle::new(tokio::spawn(async move { fetcher.find().await })), )); } diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index f2d96c2e..7a4381db 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -2,25 +2,21 @@ use std::path::Path; use std::sync::Arc; use log::{debug, info, warn}; +use once_cell::sync::OnceCell; use reqwest::Client; use reqwest::Method; use serde::Serialize; use url::Url; use super::Data; -use crate::{download_and_extract, remote_exists, BinstallError, PkgFmt, Template}; +use crate::{ + download_and_extract, remote_exists, AutoAbortJoinHandle, BinstallError, PkgFmt, Template, +}; pub struct GhCrateMeta { client: Client, data: Data, -} - -impl GhCrateMeta { - fn url(&self) -> Result { - let ctx = Context::from_data(&self.data); - debug!("Using context: {:?}", ctx); - ctx.render_url(&self.data.meta.pkg_url) - } + url: OnceCell, } #[async_trait::async_trait] @@ -29,24 +25,52 @@ impl super::Fetcher for GhCrateMeta { Arc::new(Self { client: client.clone(), data: data.clone(), + url: OnceCell::new(), }) } - async fn check(&self) -> Result { - let url = self.url()?; + async fn find(&self) -> Result { + // build up list of potential URLs + let urls = self.data.meta.pkg_fmt.extensions().iter().map(|ext| { + let ctx = Context::from_data(&self.data, ext); + ctx.render_url(&self.data.meta.pkg_url) + }); - if url.scheme() != "https" { - warn!( - "URL is not HTTPS! This may become a hard error in the future, tell the upstream!" - ); + // go check all potential URLs at once + let checks = urls + .map(|url| { + let client = self.client.clone(); + AutoAbortJoinHandle::new(tokio::spawn(async move { + let url = url?; + info!("Checking for package at: '{url}'"); + remote_exists(client, url.clone(), Method::HEAD) + .await + .map(|exists| (url.clone(), exists)) + })) + }) + .collect::>(); + + // get the first URL that exists + for check in checks { + let (url, exists) = check.await??; + if exists { + if url.scheme() != "https" { + warn!( + "URL is not HTTPS! This may become a hard error in the future, tell the upstream!" + ); + } + + info!("Winning URL is {url}"); + self.url.set(url).unwrap(); // find() is called first + return Ok(true); + } } - info!("Checking for package at: '{url}'"); - remote_exists(&self.client, url, Method::HEAD).await + Ok(false) } async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { - let url = self.url()?; + let url = self.url.get().unwrap(); // find() is called first info!("Downloading package from: '{url}'"); download_and_extract(&self.client, url, self.pkg_fmt(), dst).await } @@ -56,7 +80,8 @@ impl super::Fetcher for GhCrateMeta { } fn source_name(&self) -> String { - self.url() + self.url + .get() .map(|url| { if let Some(domain) = url.domain() { domain.to_string() @@ -66,7 +91,7 @@ impl super::Fetcher for GhCrateMeta { url.to_string() } }) - .unwrap_or_else(|_| "invalid url template".to_string()) + .unwrap_or_else(|| "invalid url".to_string()) } fn is_third_party(&self) -> bool { @@ -87,11 +112,11 @@ struct Context<'c> { pub version: &'c str, /// Soft-deprecated alias for archive-format - pub format: String, + pub format: &'c str, /// Archive format e.g. tar.gz, zip #[serde(rename = "archive-format")] - pub archive_format: String, + pub archive_format: &'c str, /// Filename extension on the binary, i.e. .exe on Windows, nothing otherwise #[serde(rename = "binary-ext")] @@ -101,15 +126,14 @@ struct Context<'c> { impl<'c> Template for Context<'c> {} impl<'c> Context<'c> { - pub(self) fn from_data(data: &'c Data) -> Self { - let pkg_fmt = data.meta.pkg_fmt.to_string(); + pub(self) fn from_data(data: &'c Data, archive_format: &'c str) -> Self { Self { name: &data.name, repo: data.repo.as_ref().map(|s| &s[..]), target: &data.target, version: &data.version, - format: pkg_fmt.clone(), - archive_format: pkg_fmt, + format: archive_format, + archive_format, binary_ext: if data.target.contains("windows") { ".exe" } else { @@ -119,6 +143,7 @@ impl<'c> Context<'c> { } pub(self) fn render_url(&self, template: &str) -> Result { + debug!("Render {template:?} using context: {:?}", self); Ok(Url::parse(&self.render(template)?)?) } } @@ -144,7 +169,7 @@ mod test { meta, }; - let ctx = Context::from_data(&data); + let ctx = Context::from_data(&data, "tgz"); assert_eq!( ctx.render_url(&data.meta.pkg_url).unwrap(), url("https://github.com/ryankurte/cargo-binstall/releases/download/v1.2.3/cargo-binstall-x86_64-unknown-linux-gnu-v1.2.3.tgz") @@ -163,7 +188,7 @@ mod test { meta, }; - let ctx = Context::from_data(&data); + let ctx = Context::from_data(&data, "tgz"); ctx.render_url(&data.meta.pkg_url).unwrap(); } @@ -182,7 +207,7 @@ mod test { meta, }; - let ctx = Context::from_data(&data); + let ctx = Context::from_data(&data, "tgz"); assert_eq!( ctx.render_url(&data.meta.pkg_url).unwrap(), url("https://example.com/releases/download/v1.2.3/cargo-binstall-x86_64-unknown-linux-gnu-v1.2.3.tgz") @@ -206,7 +231,7 @@ mod test { meta, }; - let ctx = Context::from_data(&data); + let ctx = Context::from_data(&data, "tgz"); assert_eq!( ctx.render_url(&data.meta.pkg_url).unwrap(), url("https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz") @@ -228,7 +253,7 @@ mod test { meta, }; - let ctx = Context::from_data(&data); + let ctx = Context::from_data(&data, "tgz"); assert_eq!( ctx.render_url(&data.meta.pkg_url).unwrap(), url("https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz") @@ -253,7 +278,7 @@ mod test { meta, }; - let ctx = Context::from_data(&data); + let ctx = Context::from_data(&data, "txz"); assert_eq!( ctx.render_url(&data.meta.pkg_url).unwrap(), url("https://github.com/watchexec/cargo-watch/releases/download/v9.0.0/cargo-watch-v9.0.0-aarch64-apple-darwin.tar.xz") @@ -276,7 +301,7 @@ mod test { meta, }; - let ctx = Context::from_data(&data); + let ctx = Context::from_data(&data, "bin"); assert_eq!( ctx.render_url(&data.meta.pkg_url).unwrap(), url("https://github.com/watchexec/cargo-watch/releases/download/v9.0.0/cargo-watch-v9.0.0-aarch64-pc-windows-msvc.exe") diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index 23c520b9..bdca2762 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -32,17 +32,17 @@ impl super::Fetcher for QuickInstall { }) } - async fn check(&self) -> Result { + async fn find(&self) -> Result { let url = self.package_url(); self.report(); info!("Checking for package at: '{url}'"); - remote_exists(&self.client, Url::parse(&url)?, Method::HEAD).await + remote_exists(self.client.clone(), Url::parse(&url)?, Method::HEAD).await } async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { let url = self.package_url(); info!("Downloading package from: '{url}'"); - download_and_extract(&self.client, Url::parse(&url)?, self.pkg_fmt(), dst).await + download_and_extract(&self.client, &Url::parse(&url)?, self.pkg_fmt(), dst).await } fn pkg_fmt(&self) -> PkgFmt { diff --git a/src/formats.rs b/src/formats.rs index 1cb1d2ed..4368638e 100644 --- a/src/formats.rs +++ b/src/formats.rs @@ -1,11 +1,8 @@ use serde::{Deserialize, Serialize}; -use strum_macros::{Display, EnumString, EnumVariantNames}; +use strum_macros::{Display, EnumString}; /// Binary format enumeration -#[derive( - Debug, Copy, Clone, PartialEq, Serialize, Deserialize, Display, EnumString, EnumVariantNames, -)] -#[strum(serialize_all = "snake_case")] +#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize, EnumString)] #[serde(rename_all = "snake_case")] pub enum PkgFmt { /// Download format is TAR (uncompressed) @@ -31,8 +28,7 @@ impl Default for PkgFmt { } impl PkgFmt { - /// If self is one of the tar based formats, - /// return Some. + /// If self is one of the tar based formats, return Some. pub fn decompose(self) -> PkgFmtDecomposed { match self { PkgFmt::Tar => PkgFmtDecomposed::Tar(TarBasedFmt::Tar), @@ -44,6 +40,19 @@ impl PkgFmt { PkgFmt::Zip => PkgFmtDecomposed::Zip, } } + + /// List of possible file extensions for the format. + pub fn extensions(self) -> &'static [&'static str] { + match self { + PkgFmt::Tar => &["tar"], + PkgFmt::Tbz2 => &["tbz2", "tar.bz2"], + PkgFmt::Tgz => &["tgz", "tar.gz"], + PkgFmt::Txz => &["txz", "tar.xz"], + PkgFmt::Tzstd => &["tzstd", "tzst", "tar.zst"], + PkgFmt::Bin => &["bin", "exe"], + PkgFmt::Zip => &["zip"], + } + } } #[derive(Debug, Copy, Clone, PartialEq)] diff --git a/src/helpers.rs b/src/helpers.rs index 768a37a8..269557fc 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -113,7 +113,7 @@ pub fn create_reqwest_client( } pub async fn remote_exists( - client: &Client, + client: Client, url: Url, method: Method, ) -> Result { @@ -147,11 +147,11 @@ async fn create_request( /// Download a file from the provided URL and extract it to the provided path. pub async fn download_and_extract>( client: &Client, - url: Url, + url: &Url, fmt: PkgFmt, path: P, ) -> Result<(), BinstallError> { - let stream = create_request(client, url).await?; + let stream = create_request(client, url.clone()).await?; let path = path.as_ref(); debug!("Downloading and extracting to: '{}'", path.display()); diff --git a/src/lib.rs b/src/lib.rs index 8738dc31..29ccb8f4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -137,7 +137,7 @@ mod test { assert_eq!( &meta.pkg_url, - "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ format }" + "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }" ); assert_eq!( From 88b9aceb01270d75918f97f19e0bdc74dd124572 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 24 Jul 2022 14:32:37 +1200 Subject: [PATCH 0541/2020] Fix the instructions for publish on the release PR (#237) --- .github/workflows/release-pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index cf7e3305..1b245801 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -63,8 +63,8 @@ jobs: title="release: v${{ inputs.version }}" body_intro="This is a release PR for version **${{ inputs.version }}**." - body_merge="**Use squash merge.** Upon merging, this will automatically build the CLI and create a GitHub release. You still need to manually publish the cargo crate." - body_pub="${fence}$ cd ${{ env.crate_path }}${nl}$ cargo publish${ecnef}" + body_merge="**Use squash merge.**${nl}Upon merging, this will automatically build the CLI and create a GitHub release. You still need to manually publish the cargo crate." + body_pub="${fence}$ git switch main${nl}$ git pull${nl}$ git checkout v${{ inputs.version }}${nl}$ cargo publish${ecnef}" body_notes="---${br}_Edit release notes into the section below:_${br}${nl}### Release notes" body="${body_intro}${br}${body_merge}${br}${body_pub}${br}${body_notes}${br}" From ef2752cd426f5e869d8f36d0fc00d6d718ca3f56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 24 Jul 2022 15:37:41 +1200 Subject: [PATCH 0542/2020] Stop using actions-rs (#239) --- .../workflows/build-and-integration-tests.yml | 50 +++++++++---------- .github/workflows/unit-tests.yml | 12 ++--- ci-scripts/compile-settings.jq | 17 +++++++ 3 files changed, 44 insertions(+), 35 deletions(-) create mode 100644 ci-scripts/compile-settings.jq diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index c06931ab..b814a19b 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -77,14 +77,30 @@ jobs: runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - - uses: FranzDiebold/github-env-vars-action@v1.2.1 - name: Configure toolchain - uses: actions-rs/toolchain@v1 + run: | + rustup toolchain install --profile minimal nightly + rustup default nightly + + - name: Install cross + if: matrix.use-cross + uses: taiki-e/install-action@v1 with: - toolchain: nightly - target: ${{ matrix.target }} - override: true + tool: cross + + - name: Install host target + if: "!matrix.use-cross" + run: rustup target add ${{ matrix.target }} + + - name: Select compile settings + shell: bash + run: | + jq \ + --arg ref '${{ github.ref }}' \ + --argjson matrix '${{ toJSON(matrix) }}' \ + -nrf ci-scripts/compile-settings.jq \ + | tee -a $GITHUB_ENV - name: Configure caching uses: actions/cache@v2 @@ -103,29 +119,11 @@ jobs: if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' && !startsWith(github.ref, 'refs/tags/v') }} run: sudo ./ci-scripts/install-deps.sh - - name: Build release - uses: actions-rs/cargo@v1 - if: ${{ startsWith(github.ref, 'refs/tags/v') }} - with: - command: build - args: --target ${{ matrix.target }} --release ${{ matrix.release_build_args }} - use-cross: ${{ matrix.use-cross }} - - - name: Build debug - uses: actions-rs/cargo@v1 - if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} - with: - command: build - args: --target ${{ matrix.target }} ${{ matrix.debug_build_args }} - use-cross: ${{ matrix.use-cross }} + - name: Build + run: ${{ env.CTOOL }} build ${{ env.CARGS }} - name: Copy and rename utility - if: ${{ startsWith(github.ref, 'refs/tags/v') }} - run: cp target/${{ matrix.target }}/release/${{ matrix.output }} ${{ matrix.output }} - - - name: Copy and rename utility - if: ${{ ! startsWith(github.ref, 'refs/tags/v') }} - run: cp target/${{ matrix.target }}/debug/${{ matrix.output }} ${{ matrix.output }} + run: cp target/${{ matrix.target }}/${{ env.COUTPUT }}/${{ matrix.output }} ${{ matrix.output }} - name: Test (Unix) if: ${{ matrix.test && matrix.os != 'windows-latest' }} diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index f385c1a4..7300234e 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -15,10 +15,7 @@ jobs: steps: - uses: actions/checkout@v2 - name: Configure toolchain - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - override: true + run: rustup default stable - name: Configure caching uses: actions/cache@v2 with: @@ -26,10 +23,7 @@ jobs: path: | ${{ env.HOME }}/.cargo target - - name: Install deps + - name: Install deps run: sudo ./ci-scripts/install-deps.sh - name: test - uses: actions-rs/cargo@v1 - with: - command: test - args: --no-default-features --features pkg-config,native-tls + run: cargo test --no-default-features --features pkg-config,native-tls diff --git a/ci-scripts/compile-settings.jq b/ci-scripts/compile-settings.jq new file mode 100644 index 00000000..933d1d6e --- /dev/null +++ b/ci-scripts/compile-settings.jq @@ -0,0 +1,17 @@ +if ($ref | startswith("refs/tags/v")) then { + output: "release", + profile: "release", + args: ($matrix.release_build_args // ""), +} else { + output: "debug", + profile: "dev", + args: ($matrix.debug_build_args // ""), +} end +| +{ + CTOOL: (if $matrix."use-cross" then "cross" else "cargo" end), + COUTPUT: .output, + CARGS: "--target \($matrix.target) --profile \(.profile) \(.args)", +} +| +to_entries[] | "\(.key)=\(.value)" From 310c07d9c887a2e43b640e7c9d5b696b790c44f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 24 Jul 2022 16:10:43 +1200 Subject: [PATCH 0543/2020] Reconfigure CI cache with fallbacks (#240) --- .../workflows/build-and-integration-tests.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml index b814a19b..3b7c78db 100644 --- a/.github/workflows/build-and-integration-tests.yml +++ b/.github/workflows/build-and-integration-tests.yml @@ -80,7 +80,7 @@ jobs: - name: Configure toolchain run: | - rustup toolchain install --profile minimal nightly + rustup toolchain install --profile minimal --no-self-update nightly rustup default nightly - name: Install cross @@ -103,13 +103,18 @@ jobs: | tee -a $GITHUB_ENV - name: Configure caching - uses: actions/cache@v2 + uses: actions/cache@v3 with: - key: ${{ matrix.os }}-${{ matrix.target }} path: | - ${{ env.HOME }}/.cargo/git - ${{ env.HOME }}/.cargo/registry - target + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}-${{ env.COUTPUT }} + restore-keys: | + ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} + ${{ runner.os }}-cargo-${{ matrix.target }}- + ${{ runner.os }}-cargo- - name: Install musl-tools if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} From 450e29d9cc049574cb9ad7a17928304af7bccf12 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 24 Jul 2022 16:16:27 +1200 Subject: [PATCH 0544/2020] release: v0.11.0 (#234) Co-authored-by: github-actions --- Cargo.lock | 2 +- Cargo.toml | 2 +- windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fab7b3cc..6ed17956 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -98,7 +98,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.10.0" +version = "0.11.0" dependencies = [ "async-trait", "bytes", diff --git a/Cargo.toml b/Cargo.toml index e5d048cf..de2756f1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/ryankurte/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.10.0" +version = "0.11.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/windows.manifest b/windows.manifest index d72ab3ca..fd159c47 100644 --- a/windows.manifest +++ b/windows.manifest @@ -3,7 +3,7 @@ From 51b300d29eeeace203590cce44dc43b172f2ed15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 24 Jul 2022 20:33:56 +1200 Subject: [PATCH 0545/2020] Fixes for the CI (#242) --- .../workflows/build-and-integration-tests.yml | 215 ------------------ .github/workflows/build.yml | 123 ++++++++++ .github/workflows/integration.yml | 54 +++++ .github/workflows/release-pr.yml | 9 +- .github/workflows/release-tag.yml | 32 --- .github/workflows/release.yml | 77 +++++++ .github/workflows/unit-tests.yml | 61 +++-- ci-scripts/compile-settings.jq | 7 +- ci-scripts/extract-release-notes.sh | 16 ++ ci-scripts/extract-tag-from-release-commit.sh | 6 + ci-scripts/pack-release-archives.sh | 18 ++ ci-scripts/release-pr.txt | 28 +++ ci-scripts/{run_tests_unix.sh => tests.sh} | 5 +- 13 files changed, 375 insertions(+), 276 deletions(-) delete mode 100644 .github/workflows/build-and-integration-tests.yml create mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/integration.yml delete mode 100644 .github/workflows/release-tag.yml create mode 100644 .github/workflows/release.yml create mode 100755 ci-scripts/extract-release-notes.sh create mode 100755 ci-scripts/extract-tag-from-release-commit.sh create mode 100755 ci-scripts/pack-release-archives.sh create mode 100644 ci-scripts/release-pr.txt rename ci-scripts/{run_tests_unix.sh => tests.sh} (86%) diff --git a/.github/workflows/build-and-integration-tests.yml b/.github/workflows/build-and-integration-tests.yml deleted file mode 100644 index 3b7c78db..00000000 --- a/.github/workflows/build-and-integration-tests.yml +++ /dev/null @@ -1,215 +0,0 @@ -name: Build and integration tests - -on: - push: - branches: [ main ] - tags: [ 'v*' ] - pull_request: - branches: [ main ] - -env: - CARGO_TERM_COLOR: always - -jobs: - build: - name: Build and Test - - strategy: - fail-fast: false - matrix: - include: - - target: x86_64-unknown-linux-gnu - os: ubuntu-latest - output: cargo-binstall - use-cross: false - test: true - debug_build_args: --no-default-features --features rustls,pkg-config - - target: x86_64-apple-darwin - os: macos-latest - output: cargo-binstall - use-cross: false - test: true - debug_build_args: --no-default-features --features rustls - - target: aarch64-apple-darwin - os: macos-latest - output: cargo-binstall - use-cross: false - test: false - debug_build_args: --no-default-features --features rustls - - target: x86_64-pc-windows-msvc - os: windows-latest - output: cargo-binstall.exe - use-cross: false - test: false - debug_build_args: --no-default-features --features native-tls - release_build_args: --no-default-features --features static,zlib-ng,native-tls - - target: x86_64-unknown-linux-musl - os: ubuntu-latest - output: cargo-binstall - use-cross: false - test: true - debug_build_args: --no-default-features --features rustls - - target: armv7-unknown-linux-musleabihf - os: ubuntu-20.04 - output: cargo-binstall - use-cross: true - test: false - debug_build_args: --no-default-features --features rustls - - target: armv7-unknown-linux-gnueabihf - os: ubuntu-20.04 - output: cargo-binstall - use-cross: true - test: false - debug_build_args: --no-default-features --features rustls - - target: aarch64-unknown-linux-musl - os: ubuntu-latest - output: cargo-binstall - use-cross: true - test: false - debug_build_args: --no-default-features --features rustls - - target: aarch64-unknown-linux-gnu - os: ubuntu-latest - output: cargo-binstall - use-cross: true - test: false - debug_build_args: --no-default-features --features rustls - - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - - - name: Configure toolchain - run: | - rustup toolchain install --profile minimal --no-self-update nightly - rustup default nightly - - - name: Install cross - if: matrix.use-cross - uses: taiki-e/install-action@v1 - with: - tool: cross - - - name: Install host target - if: "!matrix.use-cross" - run: rustup target add ${{ matrix.target }} - - - name: Select compile settings - shell: bash - run: | - jq \ - --arg ref '${{ github.ref }}' \ - --argjson matrix '${{ toJSON(matrix) }}' \ - -nrf ci-scripts/compile-settings.jq \ - | tee -a $GITHUB_ENV - - - name: Configure caching - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}-${{ env.COUTPUT }} - restore-keys: | - ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} - ${{ runner.os }}-cargo-${{ matrix.target }}- - ${{ runner.os }}-cargo- - - - name: Install musl-tools - if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} - run: sudo apt-get install -y musl-tools - - - name: Install deps - if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' && !startsWith(github.ref, 'refs/tags/v') }} - run: sudo ./ci-scripts/install-deps.sh - - - name: Build - run: ${{ env.CTOOL }} build ${{ env.CARGS }} - - - name: Copy and rename utility - run: cp target/${{ matrix.target }}/${{ env.COUTPUT }}/${{ matrix.output }} ${{ matrix.output }} - - - name: Test (Unix) - if: ${{ matrix.test && matrix.os != 'windows-latest' }} - run: ./ci-scripts/run_tests_unix.sh ${{ matrix.output }} - - - name: Test (Windows) - if: ${{ matrix.os == 'windows-latest' }} - run: | - ./${{ matrix.output }} binstall --no-confirm cargo-binstall - cargo binstall --help - ./${{ matrix.output }} binstall --manifest-path . --no-confirm cargo-binstall - cargo binstall --help - - - name: Upload output - uses: actions/upload-artifact@v3 - with: - retention-days: 1 - name: "${{ matrix.target }}.${{ matrix.output }}" - path: "${{ matrix.output }}" - - release: - name: Package and release - needs: build - if: ${{ startsWith(github.ref, 'refs/tags/v') }} - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 - - name: Get outputs - uses: actions/download-artifact@v3 - with: - path: outputs/ - - - name: Create archives - shell: bash - run: | - set -euxo pipefail - for o in outputs/*; do - pushd "$o" - - cp ../../LICENSE.txt ../../README.md . - - target=$(basename "$o" | cut -d. -f1) - if grep -qE '(apple|windows)' <<< "$target"; then - zip "../cargo-binstall-${target}.zip" * - else - tar cvf "../cargo-binstall-${target}.tgz" * - fi - - popd - done - - - name: Extract release notes - id: notes - shell: bash - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_REPO: ${{ github.repository }} - release_commit: ${{ github.event.head_commit.message }} - run: | - set -euxo pipefail - release_pr=$(head -n1 <<< "${release_commit:-}" | jq -Rr 'split("[()]"; "")[1] // ""') - if [[ -z "$release_pr" ]]; then - echo "::set-output name=notes_json::null" - exit - fi - - gh \ - pr --repo "$GITHUB_REPO" \ - view "$release_pr" \ - --json body \ - --jq '"::set-output name=notes_json::\((.body | split("### Release notes")[1] // "") | tojson)"' - - - name: Publish release - uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa - with: - tag_name: ${{ github.ref }} - name: ${{ github.ref }} - body: ${{ fromJSON(steps.notes.outputs.notes_json) }} - append_body: true - files: | - outputs/cargo-binstall-*.zip - outputs/cargo-binstall-*.tgz - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..1d84bc12 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,123 @@ +name: Build + +on: + workflow_call: + inputs: + for_release: + description: "True if the build is for a release" + required: true + default: false + type: boolean + + workflow_dispatch: + inputs: + for_release: + description: "True if the build is for a release" + required: true + default: false + type: boolean + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + debug_build_args: --no-default-features --features rustls,pkg-config + - target: x86_64-apple-darwin + os: macos-latest + - target: aarch64-apple-darwin + os: macos-latest + - target: x86_64-pc-windows-msvc + os: windows-latest + debug_build_args: --no-default-features --features native-tls + release_build_args: --no-default-features --features static,zlib-ng,native-tls + - target: x86_64-unknown-linux-musl + os: ubuntu-latest + - target: armv7-unknown-linux-musleabihf + os: ubuntu-20.04 + use-cross: true + - target: armv7-unknown-linux-gnueabihf + os: ubuntu-20.04 + use-cross: true + - target: aarch64-unknown-linux-musl + os: ubuntu-latest + use-cross: true + - target: aarch64-unknown-linux-gnu + os: ubuntu-latest + use-cross: true + + runs-on: ${{ matrix.os }} + name: ${{ matrix.target }} + + steps: + - uses: actions/checkout@v2 + + - name: Configure toolchain + run: | + rustup toolchain install --profile minimal --no-self-update nightly + rustup default nightly + + - name: Install cross + if: matrix.use-cross + uses: taiki-e/install-action@v1 + with: + tool: cross + + - name: Install host target + if: "!matrix.use-cross" + run: rustup target add ${{ matrix.target }} + + - name: Select compile settings + shell: bash + run: | + jq \ + --argjson for_release '${{ toJSON(inputs.for_release) }}' \ + --argjson matrix '${{ toJSON(matrix) }}' \ + -nrf ci-scripts/compile-settings.jq \ + | tee -a $GITHUB_ENV + + - name: Configure caching + uses: actions/cache@v3 + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}-${{ env.COUTPUT }} + restore-keys: | + ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} + ${{ runner.os }}-cargo-${{ matrix.target }}- + ${{ runner.os }}-cargo- + + - name: Install musl-tools + if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} + run: sudo apt-get install -y musl-tools + + - name: Install deps + if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' && !startsWith(github.ref, 'refs/tags/v') }} + run: sudo ./ci-scripts/install-deps.sh + + - name: Build + run: ${{ env.CTOOL }} build ${{ env.CARGS }} + + - name: Get output + shell: bash + run: | + cp target/${{ matrix.target }}/${{ env.COUTPUT }}/${{ env.CBIN }} ${{ env.CBIN }} + chmod +x ${{ env.CBIN }} || true + ls -l ${{ env.CBIN }} + + - name: Upload output + uses: actions/upload-artifact@v3 + with: + retention-days: 1 + name: "${{ matrix.target }}.${{ env.CBIN }}" + path: "${{ env.CBIN }}" + diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml new file mode 100644 index 00000000..2e0caf2b --- /dev/null +++ b/.github/workflows/integration.yml @@ -0,0 +1,54 @@ +name: Integration + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + +env: + CARGO_TERM_COLOR: always + +jobs: + build: + uses: ./.github/workflows/build.yml + with: + for_release: false + + test: + needs: build + + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-apple-darwin + os: macos-latest + bin: cargo-binstall + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + bin: cargo-binstall + - target: x86_64-unknown-linux-musl + os: ubuntu-latest + bin: cargo-binstall + - target: x86_64-pc-windows-msvc + os: windows-latest + bin: cargo-binstall.exe + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v2 + + - name: Download build + uses: actions/download-artifact@v3 + with: + name: "${{ matrix.target }}.${{ matrix.bin }}" + + - run: chmod +x ${{ matrix.bin }} + if: matrix.os != 'windows-latest' + + - name: Test + shell: bash + run: ./ci-scripts/tests.sh ${{ matrix.bin }} ${{ runner.os }} + diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 1b245801..fb6cc115 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -61,13 +61,8 @@ jobs: fence=$'```\n' ecnef=$'\n```' - title="release: v${{ inputs.version }}" - body_intro="This is a release PR for version **${{ inputs.version }}**." - body_merge="**Use squash merge.**${nl}Upon merging, this will automatically build the CLI and create a GitHub release. You still need to manually publish the cargo crate." - body_pub="${fence}$ git switch main${nl}$ git pull${nl}$ git checkout v${{ inputs.version }}${nl}$ cargo publish${ecnef}" - body_notes="---${br}_Edit release notes into the section below:_${br}${nl}### Release notes" - - body="${body_intro}${br}${body_merge}${br}${body_pub}${br}${body_notes}${br}" + title='release: v${{ inputs.version }}' + body=$(sed 's/%version%/${{ inputs.version }}/g' ci-scripts/release-pr.txt) gh pr create --title "$title" --body "$body" --base main --head "${{ env.branch_name }}" --label "release" env: diff --git a/.github/workflows/release-tag.yml b/.github/workflows/release-tag.yml deleted file mode 100644 index 14aa604a..00000000 --- a/.github/workflows/release-tag.yml +++ /dev/null @@ -1,32 +0,0 @@ -name: Tag a release -on: - push: - branches: - - main - tags-ignore: - - "*" - -jobs: - make-tag: - runs-on: ubuntu-latest - # the commit message will look like: `release: v{version} (#{pr-number})` - if: "startsWith(github.event.head_commit.message, 'release: v')" - steps: - - name: Extract tag from commit message - env: - COMMIT_MESSAGE: ${{ github.event.head_commit.message }} - run: | - set -euxo pipefail - - message="$(head -n1 <<< "$COMMIT_MESSAGE")" - version="$(cut -d ' ' -f 2 <<< "${message}")" - echo "CUSTOM_TAG=${version}" >> $GITHUB_ENV - - - uses: actions/checkout@v2 - - name: Push release tag - id: tag_version - uses: mathieudutour/github-tag-action@v6.0 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - custom_tag: ${{ env.CUSTOM_TAG }} - tag_prefix: '' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..fb7c3417 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,77 @@ +name: Release +on: + push: + branches: + - main + tags-ignore: + - "*" + +jobs: + info: + runs-on: ubuntu-latest + # the commit message will look like: `release: v{version} (#{pr-number})` + if: "startsWith(github.event.head_commit.message, 'release: v')" + outputs: + version: ${{ steps.version.outputs.version }} + notes: ${{ fromJSON(steps.notes.outputs.notes_json) }} + env: + COMMIT_MESSAGE: ${{ github.event.head_commit.message }} + steps: + - uses: actions/checkout@v2 + - name: Extract tag from commit message + id: version + run: ./ci-scripts/extract-tag-from-release-commit.sh + - name: Extract release notes + id: notes + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_REPO: ${{ github.repository }} + run: ./ci-scripts/extract-release-notes.sh + + tag: + needs: info + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Push release tag + uses: mathieudutour/github-tag-action@v6.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + custom_tag: ${{ needs.info.outputs.version }} + tag_prefix: '' + + build: + needs: info # not really, but just so it fails fast + uses: ./.github/workflows/build.yml + with: + for_release: true + + release: + needs: + - info + - tag + - build + name: Package and release + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Get outputs + uses: actions/download-artifact@v3 + with: + path: outputs/ + + - name: Pack archives + run: ./ci-scripts/pack-release-archives.sh + + - name: Publish release + uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa + with: + tag_name: ${{ needs.info.outputs.version }} + name: ${{ needs.info.outputs.version }} + body: ${{ needs.info.outputs.notes }} + append_body: true + files: | + outputs/cargo-binstall-*.zip + outputs/cargo-binstall-*.tgz + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 7300234e..1b86a22a 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -1,29 +1,54 @@ name: Unit tests on: - push: - branches: [ main ] pull_request: + push: + branches: + - main env: CARGO_TERM_COLOR: always jobs: test: - name: test - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: + - macos + - ubuntu + - windows + + runs-on: ${{ matrix.os }}-latest + name: on ${{ matrix.os }} + steps: - - uses: actions/checkout@v2 - - name: Configure toolchain - run: rustup default stable - - name: Configure caching - uses: actions/cache@v2 - with: - key: ubuntu-latest-stable-testing - path: | - ${{ env.HOME }}/.cargo - target - - name: Install deps - run: sudo ./ci-scripts/install-deps.sh - - name: test - run: cargo test --no-default-features --features pkg-config,native-tls + - uses: actions/checkout@v2 + - name: Configure toolchain + run: | + rustup toolchain install --profile minimal --no-self-update nightly + rustup default nightly + + - name: Configure caching + uses: actions/cache@v3 + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-unit-tests-${{ hashFiles('**/Cargo.lock') }} + restore-keys: | + ${{ runner.os }}-unit-tests + + - name: Install deps + if: matrix.os == 'ubuntu' + run: sudo ./ci-scripts/install-deps.sh + + - name: Test (Unix) + if: matrix.os != 'windows' + run: cargo test --no-default-features --features pkg-config,native-tls + + - name: Test (Windows) + if: matrix.os == 'windows' + run: cargo test --no-default-features --features native-tls diff --git a/ci-scripts/compile-settings.jq b/ci-scripts/compile-settings.jq index 933d1d6e..7c739643 100644 --- a/ci-scripts/compile-settings.jq +++ b/ci-scripts/compile-settings.jq @@ -1,15 +1,16 @@ -if ($ref | startswith("refs/tags/v")) then { +if $for_release then { output: "release", profile: "release", args: ($matrix.release_build_args // ""), } else { output: "debug", profile: "dev", - args: ($matrix.debug_build_args // ""), + args: ($matrix.debug_build_args // "--no-default-features --features rustls"), } end | { - CTOOL: (if $matrix."use-cross" then "cross" else "cargo" end), + CBIN: (if ($matrix.target | test("windows")) then "cargo-binstall.exe" else "cargo-binstall" end), + CTOOL: (if ($matrix."use-cross" // false) then "cross" else "cargo" end), COUTPUT: .output, CARGS: "--target \($matrix.target) --profile \(.profile) \(.args)", } diff --git a/ci-scripts/extract-release-notes.sh b/ci-scripts/extract-release-notes.sh new file mode 100755 index 00000000..3bf70165 --- /dev/null +++ b/ci-scripts/extract-release-notes.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -euxo pipefail + +release_pr=$(head -n1 <<< "${COMMIT_MESSAGE:-}" | jq -Rr 'split("[()]"; "")[1] // ""') +if [[ -z "$release_pr" ]]; then + echo "::set-output name=notes_json::null" + exit +fi + +gh \ + pr --repo "$GITHUB_REPO" \ + view "$release_pr" \ + --json body \ + --jq '"::set-output name=notes_json::\((.body | split("### Release notes")[1] // "") | tojson)"' + + diff --git a/ci-scripts/extract-tag-from-release-commit.sh b/ci-scripts/extract-tag-from-release-commit.sh new file mode 100755 index 00000000..a9b11818 --- /dev/null +++ b/ci-scripts/extract-tag-from-release-commit.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -euxo pipefail + +message="$(head -n1 <<< "$COMMIT_MESSAGE")" +version="$(cut -d ' ' -f 2 <<< "${message}")" +echo "::set-output name=version::${version}" diff --git a/ci-scripts/pack-release-archives.sh b/ci-scripts/pack-release-archives.sh new file mode 100755 index 00000000..d7d322bf --- /dev/null +++ b/ci-scripts/pack-release-archives.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -euxo pipefail + +for o in outputs/*; do + pushd "$o" + + chmod +x cargo-binstall* + cp ../../LICENSE.txt ../../README.md . + + target=$(basename "$o" | cut -d. -f1) + if grep -qE '(apple|windows)' <<< "$target"; then + zip "../cargo-binstall-${target}.zip" * + else + tar cv * | gzip -9 > "../cargo-binstall-${target}.tgz" + fi + + popd +done diff --git a/ci-scripts/release-pr.txt b/ci-scripts/release-pr.txt new file mode 100644 index 00000000..e8fe3f7d --- /dev/null +++ b/ci-scripts/release-pr.txt @@ -0,0 +1,28 @@ +This is a release PR for version **%version%**. + +**Use squash merge.** +Upon merging, this will automatically build the CLI and create a GitHub release. +You still need to manually publish the cargo crate. + +``` +$ git pull +$ git checkout v%version% +$ cargo publish +``` + +--- + +_Edit release notes into the section below:_ + + +### Release notes + +_Binstall is a tool to fetch and install Rust-based executables as binaries. It aims to be a drop-in replacement for `cargo install` in most cases. Install it today with `cargo install cargo-binstall`, from the binaries below, or if you already have it, upgrade with `cargo binstall cargo-binstall`._ + +#### In this release: + +- + +#### Other changes: + +- diff --git a/ci-scripts/run_tests_unix.sh b/ci-scripts/tests.sh similarity index 86% rename from ci-scripts/run_tests_unix.sh rename to ci-scripts/tests.sh index e49b81a0..8bb7bd3c 100755 --- a/ci-scripts/run_tests_unix.sh +++ b/ci-scripts/tests.sh @@ -24,10 +24,13 @@ cargo binstall --help >/dev/null cargo binstall --help >/dev/null # Install binaries using secure mode +min_tls=1.3 +[[ "${2:-}" == "Windows" ]] && min_tls=1.2 # WinTLS on GHA doesn't support 1.3 yet + "./$1" binstall \ --log-level debug \ --secure \ - --min-tls-version 1.3 \ + --min-tls-version $min_tls \ --no-confirm \ cargo-binstall # Test that the installed binaries can be run From faf4c5e16aadc1c4fdb1492e6b3b55490a89b1d8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 24 Jul 2022 20:38:25 +1200 Subject: [PATCH 0546/2020] release: v0.11.1 (#243) Co-authored-by: github-actions --- Cargo.lock | 2 +- Cargo.toml | 2 +- windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6ed17956..ff2c415d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -98,7 +98,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.11.0" +version = "0.11.1" dependencies = [ "async-trait", "bytes", diff --git a/Cargo.toml b/Cargo.toml index de2756f1..585dcc63 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/ryankurte/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.11.0" +version = "0.11.1" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/windows.manifest b/windows.manifest index fd159c47..7e0bc5f6 100644 --- a/windows.manifest +++ b/windows.manifest @@ -3,7 +3,7 @@ From 48f1825c98f3f2be2c5daf5f781fe009a47158b2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 24 Jul 2022 19:03:55 +1000 Subject: [PATCH 0547/2020] Print out help when `crate_names` is empty Signed-off-by: Jiahao XU --- src/main.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 8e250165..ab652f26 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,7 @@ use std::{ time::{Duration, Instant}, }; -use clap::Parser; +use clap::{AppSettings, Parser}; use log::{debug, error, info, warn, LevelFilter}; use miette::{miette, Result, WrapErr}; use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; @@ -20,7 +20,7 @@ use cargo_binstall::{binstall, *}; static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; #[derive(Debug, Parser)] -#[clap(version, about = "Install a Rust binary... from binaries!")] +#[clap(version, about = "Install a Rust binary... from binaries!", setting = AppSettings::ArgRequiredElseHelp)] struct Options { /// Package name for installation. /// From 8b8925e949a5c7a35a0b7d50cfad4b36ba5033cb Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 25 Jul 2022 17:42:42 +1000 Subject: [PATCH 0548/2020] Add new feature fancy-no-backtrace (enabled by default) Signed-off-by: Jiahao XU --- Cargo.toml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 585dcc63..19946ec9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,7 +32,7 @@ futures-util = { version = "0.3.21", default-features = false } home = "0.5.3" jobserver = "0.1.24" log = "0.4.17" -miette = { version = "5.1.1", features = ["fancy-no-backtrace"] } +miette = "5.1.1" mimalloc = { version = "0.1.29", default-features = false, optional = true } once_cell = "1.13.0" reqwest = { version = "0.11.11", features = ["stream"], default-features = false } @@ -68,7 +68,7 @@ zstd = { version = "0.10.0", default-features = false } guess_host_triple = "0.1.3" [features] -default = ["static", "zlib-ng", "rustls"] +default = ["static", "zlib-ng", "rustls", "fancy-no-backtrace"] mimalloc = ["dep:mimalloc"] @@ -80,6 +80,8 @@ zlib-ng = ["flate2/zlib-ng"] rustls = ["crates_io_api/rustls", "reqwest/rustls-tls"] native-tls = ["reqwest/native-tls"] +fancy-no-backtrace = ["miette/fancy-no-backtrace"] + [dev-dependencies] env_logger = "0.9.0" From df77ad9bba0bf2a062f625f30e5a3f6249944ca3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 25 Jul 2022 17:44:10 +1000 Subject: [PATCH 0549/2020] Add new feature fancy-with-backtrace Signed-off-by: Jiahao XU --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index 19946ec9..1411f0c5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -81,6 +81,7 @@ rustls = ["crates_io_api/rustls", "reqwest/rustls-tls"] native-tls = ["reqwest/native-tls"] fancy-no-backtrace = ["miette/fancy-no-backtrace"] +fancy-with-backtrace = ["fancy-no-backtrace", "miette/fancy"] [dev-dependencies] env_logger = "0.9.0" From aca4528273dc5070fee420d2bdcf94a072580481 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 25 Jul 2022 17:45:19 +1000 Subject: [PATCH 0550/2020] Enable fancy-with-backtrace on debug build Signed-off-by: Jiahao XU --- ci-scripts/compile-settings.jq | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci-scripts/compile-settings.jq b/ci-scripts/compile-settings.jq index 7c739643..d5231c09 100644 --- a/ci-scripts/compile-settings.jq +++ b/ci-scripts/compile-settings.jq @@ -5,7 +5,7 @@ if $for_release then { } else { output: "debug", profile: "dev", - args: ($matrix.debug_build_args // "--no-default-features --features rustls"), + args: ($matrix.debug_build_args // "--no-default-features --features rustls,fancy-with-backtrace"), } end | { From daae462e590a9edeaa74a84a61b155176663b0d3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 25 Jul 2022 17:45:34 +1000 Subject: [PATCH 0551/2020] Update `Cargo.lock` Signed-off-by: Jiahao XU --- Cargo.lock | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index ff2c415d..565442da 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.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +dependencies = [ + "gimli", +] + [[package]] name = "adler" version = "1.0.2" @@ -45,6 +54,21 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +[[package]] +name = "backtrace" +version = "0.3.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", +] + [[package]] name = "base64" version = "0.13.0" @@ -541,6 +565,12 @@ dependencies = [ "wasi", ] +[[package]] +name = "gimli" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" + [[package]] name = "guess_host_triple" version = "0.1.3" @@ -849,6 +879,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89d67f6972a70e33dbb5551875c6a3e46ae0a7cddd4661a2811ee48be51054e9" dependencies = [ "atty", + "backtrace", "miette-derive", "once_cell", "owo-colors", @@ -964,6 +995,15 @@ dependencies = [ "libc", ] +[[package]] +name = "object" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.13.0" @@ -1197,6 +1237,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "rustc-demangle" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" + [[package]] name = "rustc_version" version = "0.4.0" From 77396d45bd748d3ea2279378c1e6fe3b778b2130 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 25 Jul 2022 17:46:59 +1000 Subject: [PATCH 0552/2020] Fix release build for win: Enable fancy-no-backtrace Signed-off-by: Jiahao XU --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1d84bc12..b81714f9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -36,7 +36,7 @@ jobs: - target: x86_64-pc-windows-msvc os: windows-latest debug_build_args: --no-default-features --features native-tls - release_build_args: --no-default-features --features static,zlib-ng,native-tls + release_build_args: --no-default-features --features static,zlib-ng,native-tls,fancy-no-backtrace - target: x86_64-unknown-linux-musl os: ubuntu-latest - target: armv7-unknown-linux-musleabihf From c52a7b2c3b004476bab378e48b524a70442c2acd Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 25 Jul 2022 17:57:54 +1000 Subject: [PATCH 0553/2020] Add new feature log_release_max_level_info Signed-off-by: Jiahao XU --- Cargo.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 1411f0c5..7b8df205 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -83,6 +83,8 @@ native-tls = ["reqwest/native-tls"] fancy-no-backtrace = ["miette/fancy-no-backtrace"] fancy-with-backtrace = ["fancy-no-backtrace", "miette/fancy"] +log_release_max_level_info = ["log/release_max_level_info"] + [dev-dependencies] env_logger = "0.9.0" From 03c8295cd884b777ebc4be6f16a7494f41671709 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 26 Jul 2022 13:43:30 +1000 Subject: [PATCH 0554/2020] Optimize `CratesToml`: Use `Vec` instead of `BTreeSet` for storing bins. Signed-off-by: Jiahao XU --- src/binstall.rs | 3 +-- src/metafiles/v1.rs | 10 +++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/binstall.rs b/src/binstall.rs index 63eb70b8..d763611d 100644 --- a/src/binstall.rs +++ b/src/binstall.rs @@ -1,4 +1,3 @@ -use std::collections::BTreeSet; use std::path::PathBuf; use crate::{metafiles, DesiredTargets, PkgOverride}; @@ -20,7 +19,7 @@ pub struct Options { /// MetaData required to update MetaFiles. pub struct MetaData { - pub bins: BTreeSet, + pub bins: Vec, pub cvs: metafiles::CrateVersionSource, pub version_req: String, pub target: String, diff --git a/src/metafiles/v1.rs b/src/metafiles/v1.rs index b91f715a..713c167d 100644 --- a/src/metafiles/v1.rs +++ b/src/metafiles/v1.rs @@ -1,5 +1,5 @@ use std::{ - collections::{BTreeMap, BTreeSet}, + collections::BTreeMap, fs::File, io::{self, Seek}, iter::IntoIterator, @@ -15,7 +15,7 @@ use crate::{cargo_home, create_if_not_exist, FileLock}; #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CratesToml { - v1: BTreeMap>, + v1: BTreeMap>, } impl CratesToml { @@ -38,7 +38,7 @@ impl CratesToml { Self::load_from_reader(file) } - pub fn insert(&mut self, cvs: &CrateVersionSource, bins: BTreeSet) { + pub fn insert(&mut self, cvs: &CrateVersionSource, bins: Vec) { self.v1.insert(cvs.to_string(), bins); } @@ -70,7 +70,7 @@ impl CratesToml { iter: Iter, ) -> Result<(), CratesTomlParseError> where - Iter: IntoIterator)>, + Iter: IntoIterator)>, { let mut file = FileLock::new_exclusive(create_if_not_exist(path.as_ref())?)?; let mut c1 = Self::load_from_reader(&mut *file)?; @@ -87,7 +87,7 @@ impl CratesToml { pub fn append<'a, Iter>(iter: Iter) -> Result<(), CratesTomlParseError> where - Iter: IntoIterator)>, + Iter: IntoIterator)>, { Self::append_to_path(Self::default_path()?, iter) } From 928cc657781317c23ab33eae9519a56b2bd13f1e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 26 Jul 2022 13:44:50 +1000 Subject: [PATCH 0555/2020] Add new dep compact_str v0.5.2 Signed-off-by: Jiahao XU --- Cargo.lock | 21 +++++++++++++++++++++ Cargo.toml | 1 + 2 files changed, 22 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 565442da..a2ad1f05 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -129,6 +129,7 @@ dependencies = [ "bzip2", "cargo_toml", "clap", + "compact_str", "crates_io_api", "dirs", "embed-resource", @@ -173,6 +174,15 @@ dependencies = [ "toml", ] +[[package]] +name = "castaway" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a17ed5635fc8536268e5d4de1e22e81ac34419e5f052d4d51f4e01dcc263fcc" +dependencies = [ + "rustversion", +] + [[package]] name = "cc" version = "1.0.73" @@ -257,6 +267,17 @@ dependencies = [ "memchr", ] +[[package]] +name = "compact_str" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5857fc4f27cd0fa2cd7c4a4fa780c0da3d898ae27e66bf6a719343e219e9a559" +dependencies = [ + "castaway", + "itoa", + "ryu", +] + [[package]] name = "core-foundation" version = "0.9.3" diff --git a/Cargo.toml b/Cargo.toml index 7b8df205..cc6307f0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,6 +24,7 @@ bytes = "1.2.0" bzip2 = "0.4.3" cargo_toml = "0.11.5" clap = { version = "3.2.14", features = ["derive"] } +compact_str = "0.5.2" crates_io_api = { version = "0.8.0", default-features = false } dirs = "4.0.0" flate2 = { version = "1.0.24", default-features = false } From 834b8bb9c5b7098b9de1690cfa510a793a30a68a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 26 Jul 2022 13:45:53 +1000 Subject: [PATCH 0556/2020] Enable feature serde of dep compact_str Signed-off-by: Jiahao XU --- Cargo.lock | 1 + Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index a2ad1f05..ba311b77 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -276,6 +276,7 @@ dependencies = [ "castaway", "itoa", "ryu", + "serde", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index cc6307f0..410d4a13 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ bytes = "1.2.0" bzip2 = "0.4.3" cargo_toml = "0.11.5" clap = { version = "3.2.14", features = ["derive"] } -compact_str = "0.5.2" +compact_str = { version = "0.5.2", features = ["serde"] } crates_io_api = { version = "0.8.0", default-features = false } dirs = "4.0.0" flate2 = { version = "1.0.24", default-features = false } From 2dc246c392f013525771398a1bd65d31dd994be2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 26 Jul 2022 13:48:04 +1000 Subject: [PATCH 0557/2020] Optimize `CratesToml`: Use `CompactString` for bins Signed-off-by: Jiahao XU --- src/bins.rs | 5 +++-- src/binstall.rs | 4 +++- src/metafiles/v1.rs | 9 +++++---- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/bins.rs b/src/bins.rs index d08cf15a..7240707a 100644 --- a/src/bins.rs +++ b/src/bins.rs @@ -1,13 +1,14 @@ use std::path::{Path, PathBuf}; use cargo_toml::Product; +use compact_str::CompactString; use log::debug; use serde::Serialize; use crate::{atomic_install, atomic_symlink_file, BinstallError, PkgFmt, PkgMeta, Template}; pub struct BinFile { - pub base_name: String, + pub base_name: CompactString, pub source: PathBuf, pub dest: PathBuf, pub link: PathBuf, @@ -15,7 +16,7 @@ pub struct BinFile { impl BinFile { pub fn from_product(data: &Data, product: &Product) -> Result { - let base_name = product.name.clone().unwrap(); + let base_name = CompactString::from(product.name.clone().unwrap()); let binary_ext = if data.target.contains("windows") { ".exe" diff --git a/src/binstall.rs b/src/binstall.rs index d763611d..f28c0e5d 100644 --- a/src/binstall.rs +++ b/src/binstall.rs @@ -1,5 +1,7 @@ use std::path::PathBuf; +use compact_str::CompactString; + use crate::{metafiles, DesiredTargets, PkgOverride}; mod resolve; @@ -19,7 +21,7 @@ pub struct Options { /// MetaData required to update MetaFiles. pub struct MetaData { - pub bins: Vec, + pub bins: Vec, pub cvs: metafiles::CrateVersionSource, pub version_req: String, pub target: String, diff --git a/src/metafiles/v1.rs b/src/metafiles/v1.rs index 713c167d..374188ba 100644 --- a/src/metafiles/v1.rs +++ b/src/metafiles/v1.rs @@ -6,6 +6,7 @@ use std::{ path::{Path, PathBuf}, }; +use compact_str::CompactString; use miette::Diagnostic; use serde::{Deserialize, Serialize}; use thiserror::Error; @@ -15,7 +16,7 @@ use crate::{cargo_home, create_if_not_exist, FileLock}; #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CratesToml { - v1: BTreeMap>, + v1: BTreeMap>, } impl CratesToml { @@ -38,7 +39,7 @@ impl CratesToml { Self::load_from_reader(file) } - pub fn insert(&mut self, cvs: &CrateVersionSource, bins: Vec) { + pub fn insert(&mut self, cvs: &CrateVersionSource, bins: Vec) { self.v1.insert(cvs.to_string(), bins); } @@ -70,7 +71,7 @@ impl CratesToml { iter: Iter, ) -> Result<(), CratesTomlParseError> where - Iter: IntoIterator)>, + Iter: IntoIterator)>, { let mut file = FileLock::new_exclusive(create_if_not_exist(path.as_ref())?)?; let mut c1 = Self::load_from_reader(&mut *file)?; @@ -87,7 +88,7 @@ impl CratesToml { pub fn append<'a, Iter>(iter: Iter) -> Result<(), CratesTomlParseError> where - Iter: IntoIterator)>, + Iter: IntoIterator)>, { Self::append_to_path(Self::default_path()?, iter) } From 9d99bfb81f140fb0c61ce1c525c6aa38c770858e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Tue, 26 Jul 2022 23:28:17 +1200 Subject: [PATCH 0558/2020] Add function and example program detecting WASI runability (#250) --- examples/detect-wasi.rs | 13 +++++++++++++ src/lib.rs | 1 + src/miniwasi.wasm | Bin 0 -> 97 bytes src/miniwasi.wast | 10 ++++++++++ src/wasi.rs | 40 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 64 insertions(+) create mode 100644 examples/detect-wasi.rs create mode 100755 src/miniwasi.wasm create mode 100644 src/miniwasi.wast create mode 100644 src/wasi.rs diff --git a/examples/detect-wasi.rs b/examples/detect-wasi.rs new file mode 100644 index 00000000..d3224fce --- /dev/null +++ b/examples/detect-wasi.rs @@ -0,0 +1,13 @@ +use std::process::exit; + +use cargo_binstall::wasi::detect_wasi_runability; + +fn main() { + if detect_wasi_runability().unwrap() { + println!("WASI is runnable!"); + exit(0); + } else { + println!("WASI is not runnable"); + exit(1); + } +} diff --git a/src/lib.rs b/src/lib.rs index 29ccb8f4..60691853 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -15,6 +15,7 @@ pub mod bins; pub mod binstall; pub mod fetchers; pub mod metafiles; +pub mod wasi; mod target; pub use target::*; diff --git a/src/miniwasi.wasm b/src/miniwasi.wasm new file mode 100755 index 0000000000000000000000000000000000000000..56dcdc6a2625727e16fa6b3ecbd0107de4f4bd4d GIT binary patch literal 97 zcmWN|O$vY@5C+h1Ci>q5K_}<}9ifw$gpdnU9LZXB^?LgUEsg+C!yCQW0G?^eTC9>& t2RVFFA)3pYytEe^dE6!6^;M^ literal 0 HcmV?d00001 diff --git a/src/miniwasi.wast b/src/miniwasi.wast new file mode 100644 index 00000000..93655cfd --- /dev/null +++ b/src/miniwasi.wast @@ -0,0 +1,10 @@ +(module + (memory $0 0) + (export "memory" (memory $0)) + (export "_start" (func $0)) + (import "wasi_snapshot_preview1" "proc_exit" (func $exit (param i32))) + (func $0 + (call $exit (i32.const 0)) + (unreachable) + ) +) diff --git a/src/wasi.rs b/src/wasi.rs new file mode 100644 index 00000000..c1c1340f --- /dev/null +++ b/src/wasi.rs @@ -0,0 +1,40 @@ +use std::{fs::File, io::Write, process::Command}; +#[cfg(unix)] +use std::{fs::Permissions, os::unix::fs::PermissionsExt}; + +use tempfile::tempdir; + +use crate::errors::BinstallError; + +const WASI_PROGRAM: &[u8] = include_bytes!("miniwasi.wasm"); + +/// Detect the ability to run WASI +/// +/// This attempts to run a small embedded WASI program, and returns true if no errors happened. +/// Errors returned by the `Result` are I/O errors from the establishment of the context, not +/// errors from the run attempt. +/// +/// On Linux, you can configure your system to run WASI programs using a binfmt directive. Under +/// systemd, write the below to `/etc/binfmt.d/wasi.conf`, with `/usr/bin/wasmtime` optionally +/// replaced with the path to your WASI runtime of choice: +/// +/// ```plain +/// :wasi:M::\x00asm::/usr/bin/wasmtime: +/// ``` +pub fn detect_wasi_runability() -> Result { + let progdir = tempdir()?; + let prog = progdir.path().join("miniwasi.wasm"); + + { + let mut progfile = File::create(&prog)?; + progfile.write_all(WASI_PROGRAM)?; + + #[cfg(unix)] + progfile.set_permissions(Permissions::from_mode(0o777))?; + } + + match Command::new(prog).output() { + Ok(out) => Ok(out.status.success() && out.stdout.is_empty() && out.stderr.is_empty()), + Err(_) => Ok(false), + } +} From e9901519190403c72269cfa5211425a69258e93d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 26 Jul 2022 21:31:58 +1000 Subject: [PATCH 0559/2020] Add new dep serde_json v1.0.82 Signed-off-by: Jiahao XU --- Cargo.lock | 1 + Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index ba311b77..2477b9e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -148,6 +148,7 @@ dependencies = [ "scopeguard", "semver", "serde", + "serde_json", "simplelog", "strum", "strum_macros", diff --git a/Cargo.toml b/Cargo.toml index 410d4a13..da5d0c18 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,6 +40,7 @@ reqwest = { version = "0.11.11", features = ["stream"], default-features = false scopeguard = "1.1.0" semver = "1.0.12" serde = { version = "1.0.140", features = ["derive"] } +serde_json = "1.0.82" simplelog = "0.12.0" strum = "0.24.1" strum_macros = "0.24.2" From f7c798352aa379331b0ad3ef53a7d06389b08e0b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 26 Jul 2022 21:57:57 +1000 Subject: [PATCH 0560/2020] Enable feature serde of semver Signed-off-by: Jiahao XU --- Cargo.lock | 3 +++ Cargo.toml | 2 +- src/metafiles/binstall_v1.rs | 15 +++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 src/metafiles/binstall_v1.rs diff --git a/Cargo.lock b/Cargo.lock index 2477b9e2..1879a402 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1376,6 +1376,9 @@ name = "semver" version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" +dependencies = [ + "serde", +] [[package]] name = "serde" diff --git a/Cargo.toml b/Cargo.toml index da5d0c18..913a1fd7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,7 @@ mimalloc = { version = "0.1.29", default-features = false, optional = true } once_cell = "1.13.0" reqwest = { version = "0.11.11", features = ["stream"], default-features = false } scopeguard = "1.1.0" -semver = "1.0.12" +semver = { version = "1.0.12", features = ["serde"] } serde = { version = "1.0.140", features = ["derive"] } serde_json = "1.0.82" simplelog = "0.12.0" diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs new file mode 100644 index 00000000..e3f059f7 --- /dev/null +++ b/src/metafiles/binstall_v1.rs @@ -0,0 +1,15 @@ +/* +{ + "name": "cargo-binstall", + "version_req": none, + "current_version": "0.10.0" + "source": { + "type": "Registry", + "url": "https://crates.io", + }, + "target": none, + "bins": [ + "cargo-binstall", + ], +} + */ From 93d4dbcd1ab715ea01285f81986f295cd9a468d8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 26 Jul 2022 22:12:04 +1000 Subject: [PATCH 0561/2020] Enable feature serde of dep url Signed-off-by: Jiahao XU --- Cargo.lock | 1 + Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 1879a402..55b7e882 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1815,6 +1815,7 @@ dependencies = [ "idna", "matches", "percent-encoding", + "serde", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 913a1fd7..8907e68f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,7 @@ thiserror = "1.0.31" tinytemplate = "1.2.1" tokio = { version = "1.20.0", features = ["rt-multi-thread", "process", "sync"], default-features = false } toml_edit = { version = "0.14.4", features = ["easy"] } -url = "2.2.2" +url = { version = "2.2.2", features = ["serde"] } xz2 = "0.1.7" # Disable all features of zip except for features of compression algorithms: From 172af54cd8ae0e39df978eb780aafbb0ceb0613d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 26 Jul 2022 22:29:10 +1000 Subject: [PATCH 0562/2020] Impl `metafiles::binstall_v1::{Entry, Source}` Signed-off-by: Jiahao XU --- src/metafiles.rs | 2 + src/metafiles/binstall_v1.rs | 80 +++++++++++++++++++++++++++++------- 2 files changed, 68 insertions(+), 14 deletions(-) diff --git a/src/metafiles.rs b/src/metafiles.rs index 75ad0250..b8a2b4ee 100644 --- a/src/metafiles.rs +++ b/src/metafiles.rs @@ -2,3 +2,5 @@ mod cvs; pub use cvs::*; pub mod v1; + +pub mod binstall_v1; diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index e3f059f7..35e78ed8 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -1,15 +1,67 @@ -/* -{ - "name": "cargo-binstall", - "version_req": none, - "current_version": "0.10.0" - "source": { - "type": "Registry", - "url": "https://crates.io", - }, - "target": none, - "bins": [ - "cargo-binstall", - ], +use compact_str::CompactString; +use semver::Version; +use serde::{Deserialize, Serialize}; +use url::Url; + +use crate::binstall::MetaData; + +#[derive(Debug, Serialize, Deserialize)] +pub struct Entry { + pub name: CompactString, + pub version_req: CompactString, + pub current_version: Version, + pub source: Source, + pub target: CompactString, + pub bins: Vec, +} +impl Entry { + pub fn new(metadata: MetaData) -> Self { + let MetaData { + bins, + cvs: + super::CrateVersionSource { + name, + version, + source, + }, + version_req, + target, + } = metadata; + + Self { + name: name.into(), + version_req: version_req.into(), + current_version: version, + source: source.into(), + target: target.into(), + bins, + } + } +} + +#[derive(Debug, Serialize, Deserialize)] +pub struct Source { + source_type: CompactString, + url: Url, +} + +impl From for Source { + fn from(src: super::Source) -> Self { + use super::Source::*; + + match src { + Git(url) => Source { + source_type: "Git".into(), + url, + }, + Path(url) => Source { + source_type: "Path".into(), + url, + }, + Registry(url) => Source { + source_type: "Registry".into(), + url, + }, + } + } } - */ From 46c4d6f406efa1994d7cf5841cbaf65b07c61a95 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 26 Jul 2022 22:39:15 +1000 Subject: [PATCH 0563/2020] Impl `io::Write` for `helpers::FileLock` Signed-off-by: Jiahao XU --- src/helpers/flock.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/helpers/flock.rs b/src/helpers/flock.rs index 2c0707b5..285c357d 100644 --- a/src/helpers/flock.rs +++ b/src/helpers/flock.rs @@ -43,3 +43,16 @@ impl ops::DerefMut for FileLock { &mut self.0 } } + +impl io::Write for FileLock { + fn write(&mut self, buf: &[u8]) -> io::Result { + self.0.write(buf) + } + fn flush(&mut self) -> io::Result<()> { + self.0.flush() + } + + fn write_vectored(&mut self, bufs: &[io::IoSlice<'_>]) -> io::Result { + self.0.write_vectored(bufs) + } +} From 461571075dc2ac868e2fba92df6bb8fb1d906d59 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 26 Jul 2022 22:45:48 +1000 Subject: [PATCH 0564/2020] Impl `binstall_v1::Error` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 35e78ed8..3ed2a1bc 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -1,9 +1,19 @@ +use std::{ + fs, + io::{self, Write}, + iter::IntoIterator, + path::Path, +}; + use compact_str::CompactString; +use miette::Diagnostic; use semver::Version; use serde::{Deserialize, Serialize}; +use thiserror::Error; use url::Url; use crate::binstall::MetaData; +use crate::FileLock; #[derive(Debug, Serialize, Deserialize)] pub struct Entry { @@ -65,3 +75,12 @@ impl From for Source { } } } + +#[derive(Debug, Diagnostic, Error)] +pub enum Error { + #[error(transparent)] + Io(#[from] io::Error), + + #[error(transparent)] + SerdeJsonParse(#[from] serde_json::Error), +} From f0b6b7b1afcf43a1018492c4c7a037a990fe4540 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 26 Jul 2022 22:45:59 +1000 Subject: [PATCH 0565/2020] Impl `binstall_v1::append_to_path` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 3ed2a1bc..0089c5bb 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -84,3 +84,27 @@ pub enum Error { #[error(transparent)] SerdeJsonParse(#[from] serde_json::Error), } + +pub fn append_to_path(path: impl AsRef, iter: Iter) -> Result<(), Error> +where + Iter: IntoIterator, +{ + let file = FileLock::new_exclusive( + fs::OpenOptions::new() + .create(true) + .append(true) + .open(path)?, + )?; + + let writer = io::BufWriter::with_capacity(512, file); + + let mut ser = serde_json::Serializer::new(writer); + + for item in iter { + item.serialize(&mut ser)?; + } + + ser.into_inner().flush()?; + + Ok(()) +} From c6c5dcd79fd779c5413927d3ba3fcee1f3445318 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 26 Jul 2022 22:47:57 +1000 Subject: [PATCH 0566/2020] Rename `binstall_v1::Entry` to `Item` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 0089c5bb..f93916ce 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -16,7 +16,7 @@ use crate::binstall::MetaData; use crate::FileLock; #[derive(Debug, Serialize, Deserialize)] -pub struct Entry { +pub struct Item { pub name: CompactString, pub version_req: CompactString, pub current_version: Version, @@ -24,7 +24,7 @@ pub struct Entry { pub target: CompactString, pub bins: Vec, } -impl Entry { +impl Item { pub fn new(metadata: MetaData) -> Self { let MetaData { bins, @@ -87,7 +87,7 @@ pub enum Error { pub fn append_to_path(path: impl AsRef, iter: Iter) -> Result<(), Error> where - Iter: IntoIterator, + Iter: IntoIterator, { let file = FileLock::new_exclusive( fs::OpenOptions::new() From ebb2d5d0c37ea36e6a328d451a1d67424eee15f9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 26 Jul 2022 22:51:20 +1000 Subject: [PATCH 0567/2020] Impl `io::Read` for `FileLock` Signed-off-by: Jiahao XU --- src/helpers/flock.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/helpers/flock.rs b/src/helpers/flock.rs index 285c357d..f0dbb9f2 100644 --- a/src/helpers/flock.rs +++ b/src/helpers/flock.rs @@ -56,3 +56,13 @@ impl io::Write for FileLock { self.0.write_vectored(bufs) } } + +impl io::Read for FileLock { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + self.0.read(buf) + } + + fn read_vectored(&mut self, bufs: &mut [io::IoSliceMut<'_>]) -> io::Result { + self.0.read_vectored(bufs) + } +} From ce50186f4a64304a6f94c108e3efc5408b983efa Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 26 Jul 2022 22:52:25 +1000 Subject: [PATCH 0568/2020] Impl `io::Seek` for `FileLock` Signed-off-by: Jiahao XU --- src/helpers/flock.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/helpers/flock.rs b/src/helpers/flock.rs index f0dbb9f2..f8b4514a 100644 --- a/src/helpers/flock.rs +++ b/src/helpers/flock.rs @@ -66,3 +66,16 @@ impl io::Read for FileLock { self.0.read_vectored(bufs) } } + +impl io::Seek for FileLock { + fn seek(&mut self, pos: io::SeekFrom) -> io::Result { + self.0.seek(pos) + } + + fn rewind(&mut self) -> io::Result<()> { + self.0.rewind() + } + fn stream_position(&mut self) -> io::Result { + self.0.stream_position() + } +} From 951a0f8b9f1be17257b450c1151fc5f4e8f735c4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 18:38:26 +1000 Subject: [PATCH 0569/2020] Impl `binstall_v1::default_path` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index f93916ce..dd0428ba 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -2,7 +2,7 @@ use std::{ fs, io::{self, Write}, iter::IntoIterator, - path::Path, + path::{Path, PathBuf}, }; use compact_str::CompactString; @@ -13,7 +13,7 @@ use thiserror::Error; use url::Url; use crate::binstall::MetaData; -use crate::FileLock; +use crate::{cargo_home, FileLock}; #[derive(Debug, Serialize, Deserialize)] pub struct Item { @@ -108,3 +108,7 @@ where Ok(()) } + +pub fn default_path() -> Result { + Ok(cargo_home()?.join(".binstall-crates.toml")) +} From cbd64b039d6ce9b3575e1b09a75a09e4b5dc4ab3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 18:49:24 +1000 Subject: [PATCH 0570/2020] Rename `binstall_v1::Item` to `MetaData` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index dd0428ba..386b2929 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -12,11 +12,10 @@ use serde::{Deserialize, Serialize}; use thiserror::Error; use url::Url; -use crate::binstall::MetaData; use crate::{cargo_home, FileLock}; #[derive(Debug, Serialize, Deserialize)] -pub struct Item { +pub struct MetaData { pub name: CompactString, pub version_req: CompactString, pub current_version: Version, @@ -24,9 +23,9 @@ pub struct Item { pub target: CompactString, pub bins: Vec, } -impl Item { - pub fn new(metadata: MetaData) -> Self { - let MetaData { +impl MetaData { + pub fn new(metadata: crate::binstall::MetaData) -> Self { + let crate::binstall::MetaData { bins, cvs: super::CrateVersionSource { @@ -87,7 +86,7 @@ pub enum Error { pub fn append_to_path(path: impl AsRef, iter: Iter) -> Result<(), Error> where - Iter: IntoIterator, + Iter: IntoIterator, { let file = FileLock::new_exclusive( fs::OpenOptions::new() From 5ca1278c2228efcee0eb3b879c75fd26abc270a3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 19:18:44 +1000 Subject: [PATCH 0571/2020] Add new enum `binstall_v1::SourceType` Use it to represent source type instead of using `CompactString`. Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 386b2929..9704719f 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -48,9 +48,16 @@ impl MetaData { } } +#[derive(Debug, Copy, Clone, Serialize, Deserialize)] +enum SourceType { + Git, + Path, + Registry, +} + #[derive(Debug, Serialize, Deserialize)] pub struct Source { - source_type: CompactString, + source_type: SourceType, url: Url, } @@ -60,15 +67,15 @@ impl From for Source { match src { Git(url) => Source { - source_type: "Git".into(), + source_type: SourceType::Git, url, }, Path(url) => Source { - source_type: "Path".into(), + source_type: SourceType::Path, url, }, Registry(url) => Source { - source_type: "Registry".into(), + source_type: SourceType::Registry, url, }, } From cc13aa911fee77938e90717078eda4256b53b544 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 19:22:45 +1000 Subject: [PATCH 0572/2020] Refactor: Extract `helpers::cratesio_url` Signed-off-by: Jiahao XU --- src/helpers.rs | 9 ++++++++- src/metafiles/cvs.rs | 8 +++----- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/helpers.rs b/src/helpers.rs index 269557fc..7a7e565d 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -10,7 +10,7 @@ use bytes::Bytes; use cargo_toml::Manifest; use futures_util::stream::Stream; use log::debug; -use once_cell::sync::OnceCell; +use once_cell::sync::{Lazy, OnceCell}; use reqwest::{tls, Client, ClientBuilder, Method, Response}; use serde::Serialize; use tempfile::NamedTempFile; @@ -55,6 +55,13 @@ pub fn cargo_home() -> Result<&'static Path, io::Error> { .map(ops::Deref::deref) } +pub fn cratesio_url() -> &'static Url { + static CRATESIO: Lazy Url> = + Lazy::new(|| url::Url::parse("https://github.com/rust-lang/crates.io-index").unwrap()); + + &*CRATESIO +} + /// Returned file is readable and writable. pub fn create_if_not_exist(path: impl AsRef) -> io::Result { let path = path.as_ref(); diff --git a/src/metafiles/cvs.rs b/src/metafiles/cvs.rs index b56ab5fc..15121c69 100644 --- a/src/metafiles/cvs.rs +++ b/src/metafiles/cvs.rs @@ -1,12 +1,13 @@ use std::{borrow::Cow, fmt, str::FromStr}; use miette::Diagnostic; -use once_cell::sync::Lazy; use semver::Version; use serde::{Deserialize, Deserializer, Serialize, Serializer}; use thiserror::Error; use url::Url; +use crate::cratesio_url; + #[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq)] pub struct CrateVersionSource { pub name: String, @@ -23,10 +24,7 @@ pub enum Source { impl Source { pub fn cratesio_registry() -> Source { - static CRATESIO: Lazy Url> = - Lazy::new(|| url::Url::parse("https://github.com/rust-lang/crates.io-index").unwrap()); - - Self::Registry(CRATESIO.clone()) + Self::Registry(cratesio_url().clone()) } } From 1a8fda1f5ebe1e48f5b3365f4e8cb1ee7fec2fd2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 19:23:15 +1000 Subject: [PATCH 0573/2020] Impl `binstall_v1::Source::cratesio_registry` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 9704719f..4ba95dae 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -12,7 +12,7 @@ use serde::{Deserialize, Serialize}; use thiserror::Error; use url::Url; -use crate::{cargo_home, FileLock}; +use crate::{cargo_home, cratesio_url, FileLock}; #[derive(Debug, Serialize, Deserialize)] pub struct MetaData { @@ -61,6 +61,15 @@ pub struct Source { url: Url, } +impl Source { + pub fn cratesio_registry() -> Source { + Self { + source_type: SourceType::Registry, + url: cratesio_url().clone(), + } + } +} + impl From for Source { fn from(src: super::Source) -> Self { use super::Source::*; From 05c0d5fcae8e54df788cfde2e5a7897d5eabc59f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 19:24:01 +1000 Subject: [PATCH 0574/2020] Mark `binstall_v1::{Source, SourceType}` pub Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 4ba95dae..a99e9d89 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -49,7 +49,7 @@ impl MetaData { } #[derive(Debug, Copy, Clone, Serialize, Deserialize)] -enum SourceType { +pub enum SourceType { Git, Path, Registry, @@ -57,8 +57,8 @@ enum SourceType { #[derive(Debug, Serialize, Deserialize)] pub struct Source { - source_type: SourceType, - url: Url, + pub source_type: SourceType, + pub url: Url, } impl Source { From 2f27a5fd93fe03dee744a8d0f0a879a2d4697a2c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 19:44:16 +1000 Subject: [PATCH 0575/2020] Refactor: Use `binstall_v1::MetaData` in mod `binstall` Signed-off-by: Jiahao XU --- src/binstall.rs | 12 +--------- src/binstall/install.rs | 36 ++++++++++++++++------------- src/main.rs | 6 +---- src/metafiles/binstall_v1.rs | 45 ------------------------------------ src/metafiles/cvs.rs | 24 +++++++++++++++++++ src/metafiles/v1.rs | 10 ++++---- 6 files changed, 51 insertions(+), 82 deletions(-) diff --git a/src/binstall.rs b/src/binstall.rs index f28c0e5d..c6fcc569 100644 --- a/src/binstall.rs +++ b/src/binstall.rs @@ -1,8 +1,6 @@ use std::path::PathBuf; -use compact_str::CompactString; - -use crate::{metafiles, DesiredTargets, PkgOverride}; +use crate::{metafiles::binstall_v1::MetaData, DesiredTargets, PkgOverride}; mod resolve; pub use resolve::*; @@ -18,11 +16,3 @@ pub struct Options { pub cli_overrides: PkgOverride, pub desired_targets: DesiredTargets, } - -/// MetaData required to update MetaFiles. -pub struct MetaData { - pub bins: Vec, - pub cvs: metafiles::CrateVersionSource, - pub version_req: String, - pub target: String, -} diff --git a/src/binstall/install.rs b/src/binstall/install.rs index e7f12a36..21691323 100644 --- a/src/binstall/install.rs +++ b/src/binstall/install.rs @@ -1,12 +1,13 @@ use std::{path::PathBuf, process, sync::Arc}; use cargo_toml::Package; +use compact_str::CompactString; use log::{debug, error, info}; use miette::{miette, IntoDiagnostic, Result, WrapErr}; use tokio::{process::Command, task::block_in_place}; use super::{MetaData, Options, Resolution}; -use crate::{bins, fetchers::Fetcher, *}; +use crate::{bins, fetchers::Fetcher, metafiles::binstall_v1::Source, *}; pub async fn install( resolution: Resolution, @@ -22,13 +23,21 @@ pub async fn install( bin_path, bin_files, } => { - let cvs = metafiles::CrateVersionSource { - name, - version: package.version.parse().into_diagnostic()?, - source: metafiles::Source::cratesio_registry(), - }; + let current_version = package.version.parse().into_diagnostic()?; + let target = fetcher.target().into(); - install_from_package(fetcher, opts, cvs, version, bin_path, bin_files).await + install_from_package(fetcher, opts, bin_path, bin_files) + .await + .map(|option| { + option.map(|bins| MetaData { + name: name.into(), + version_req: version.into(), + current_version, + source: Source::cratesio_registry(), + target, + bins, + }) + }) } Resolution::InstallFromSource { package } => { let desired_targets = opts.desired_targets.get().await; @@ -54,11 +63,9 @@ pub async fn install( async fn install_from_package( fetcher: Arc, opts: Arc, - cvs: metafiles::CrateVersionSource, - version: String, bin_path: PathBuf, bin_files: Vec, -) -> Result> { +) -> Result>> { // Download package if opts.dry_run { info!("Dry run, not downloading package"); @@ -108,12 +115,9 @@ async fn install_from_package( } } - Ok(Some(MetaData { - bins: bin_files.into_iter().map(|bin| bin.base_name).collect(), - cvs, - version_req: version, - target: fetcher.target().to_string(), - })) + Ok(Some( + bin_files.into_iter().map(|bin| bin.base_name).collect(), + )) }) } diff --git a/src/main.rs b/src/main.rs index ab652f26..51d86863 100644 --- a/src/main.rs +++ b/src/main.rs @@ -344,11 +344,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { block_in_place(|| { if !custom_install_path { debug!("Writing .crates.toml"); - metafiles::v1::CratesToml::append( - metadata_vec - .iter() - .map(|metadata| (&metadata.cvs, metadata.bins.clone())), - )?; + metafiles::v1::CratesToml::append(metadata_vec.iter())?; } if opts.no_cleanup { diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index a99e9d89..475e1274 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -23,30 +23,6 @@ pub struct MetaData { pub target: CompactString, pub bins: Vec, } -impl MetaData { - pub fn new(metadata: crate::binstall::MetaData) -> Self { - let crate::binstall::MetaData { - bins, - cvs: - super::CrateVersionSource { - name, - version, - source, - }, - version_req, - target, - } = metadata; - - Self { - name: name.into(), - version_req: version_req.into(), - current_version: version, - source: source.into(), - target: target.into(), - bins, - } - } -} #[derive(Debug, Copy, Clone, Serialize, Deserialize)] pub enum SourceType { @@ -70,27 +46,6 @@ impl Source { } } -impl From for Source { - fn from(src: super::Source) -> Self { - use super::Source::*; - - match src { - Git(url) => Source { - source_type: SourceType::Git, - url, - }, - Path(url) => Source { - source_type: SourceType::Path, - url, - }, - Registry(url) => Source { - source_type: SourceType::Registry, - url, - }, - } - } -} - #[derive(Debug, Diagnostic, Error)] pub enum Error { #[error(transparent)] diff --git a/src/metafiles/cvs.rs b/src/metafiles/cvs.rs index 15121c69..f0068328 100644 --- a/src/metafiles/cvs.rs +++ b/src/metafiles/cvs.rs @@ -15,6 +15,16 @@ pub struct CrateVersionSource { pub source: Source, } +impl From<&super::binstall_v1::MetaData> for CrateVersionSource { + fn from(metadata: &super::binstall_v1::MetaData) -> Self { + super::CrateVersionSource { + name: metadata.name.clone().to_string(), + version: metadata.current_version.clone(), + source: Source::from(&metadata.source), + } + } +} + #[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq)] pub enum Source { Git(Url), @@ -28,6 +38,20 @@ impl Source { } } +impl From<&super::binstall_v1::Source> for Source { + fn from(source: &super::binstall_v1::Source) -> Self { + use super::binstall_v1::SourceType::*; + + let url = source.url.clone(); + + match source.source_type { + Git => Self::Git(url), + Path => Self::Path(url), + Registry => Self::Registry(url), + } + } +} + impl FromStr for CrateVersionSource { type Err = CvsParseError; fn from_str(s: &str) -> Result { diff --git a/src/metafiles/v1.rs b/src/metafiles/v1.rs index 374188ba..25ef6c3f 100644 --- a/src/metafiles/v1.rs +++ b/src/metafiles/v1.rs @@ -11,7 +11,7 @@ use miette::Diagnostic; use serde::{Deserialize, Serialize}; use thiserror::Error; -use super::CrateVersionSource; +use super::{binstall_v1::MetaData, CrateVersionSource}; use crate::{cargo_home, create_if_not_exist, FileLock}; #[derive(Clone, Debug, Default, Deserialize, Serialize)] @@ -71,13 +71,13 @@ impl CratesToml { iter: Iter, ) -> Result<(), CratesTomlParseError> where - Iter: IntoIterator)>, + Iter: IntoIterator, { let mut file = FileLock::new_exclusive(create_if_not_exist(path.as_ref())?)?; let mut c1 = Self::load_from_reader(&mut *file)?; - for (cvs, bins) in iter { - c1.insert(cvs, bins); + for metadata in iter { + c1.insert(&CrateVersionSource::from(metadata), metadata.bins.clone()); } file.rewind()?; @@ -88,7 +88,7 @@ impl CratesToml { pub fn append<'a, Iter>(iter: Iter) -> Result<(), CratesTomlParseError> where - Iter: IntoIterator)>, + Iter: IntoIterator, { Self::append_to_path(Self::default_path()?, iter) } From 4114b6e7c4bc8a05b5db98d0b3cd8d34a9ad2f80 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 20:19:05 +1000 Subject: [PATCH 0576/2020] Impl `PartialEq`, `Eq` and `Hash` fo `MetaData` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 475e1274..a9cb446f 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -1,5 +1,5 @@ use std::{ - fs, + fs, hash, io::{self, Write}, iter::IntoIterator, path::{Path, PathBuf}, @@ -23,6 +23,21 @@ pub struct MetaData { pub target: CompactString, pub bins: Vec, } +impl PartialEq for MetaData { + fn eq(&self, other: &MetaData) -> bool { + self.name == other.name + } +} +impl Eq for MetaData {} + +impl hash::Hash for MetaData { + fn hash(&self, state: &mut H) + where + H: hash::Hasher, + { + self.name.hash(state) + } +} #[derive(Debug, Copy, Clone, Serialize, Deserialize)] pub enum SourceType { From 90203dd4671268c9e4fc09ecafd095d803013a07 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 20:33:40 +1000 Subject: [PATCH 0577/2020] Impl `PartialOrd` and `Ord` for `MetaData` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index a9cb446f..8ce59a4a 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -1,5 +1,5 @@ use std::{ - fs, hash, + cmp, fs, hash, io::{self, Write}, iter::IntoIterator, path::{Path, PathBuf}, @@ -24,12 +24,24 @@ pub struct MetaData { pub bins: Vec, } impl PartialEq for MetaData { - fn eq(&self, other: &MetaData) -> bool { + fn eq(&self, other: &Self) -> bool { self.name == other.name } } impl Eq for MetaData {} +impl PartialOrd for MetaData { + fn partial_cmp(&self, other: &Self) -> Option { + self.name.partial_cmp(&other.name) + } +} + +impl Ord for MetaData { + fn cmp(&self, other: &Self) -> cmp::Ordering { + self.name.cmp(&other.name) + } +} + impl hash::Hash for MetaData { fn hash(&self, state: &mut H) where From 1047a782e5f1a0323f24e132c1b899ba1da0e51f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 20:36:13 +1000 Subject: [PATCH 0578/2020] Impl newtype `Records` and methods `load{_from_path}` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 40 ++++++++++++++++++++++++++++++++++-- 1 file changed, 38 insertions(+), 2 deletions(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 8ce59a4a..e2ecac5d 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -1,5 +1,7 @@ use std::{ - cmp, fs, hash, + cmp, + collections::BTreeSet, + fs, hash, io::{self, Write}, iter::IntoIterator, path::{Path, PathBuf}, @@ -12,7 +14,7 @@ use serde::{Deserialize, Serialize}; use thiserror::Error; use url::Url; -use crate::{cargo_home, cratesio_url, FileLock}; +use crate::{cargo_home, cratesio_url, create_if_not_exist, FileLock}; #[derive(Debug, Serialize, Deserialize)] pub struct MetaData { @@ -109,3 +111,37 @@ where pub fn default_path() -> Result { Ok(cargo_home()?.join(".binstall-crates.toml")) } + +#[derive(Debug)] +pub struct Records { + file: FileLock, + data: BTreeSet, +} + +impl Records { + fn load_impl(&mut self) -> Result<(), Error> { + let reader = io::BufReader::with_capacity(1024, &mut self.file); + let stream_deser = serde_json::Deserializer::from_reader(reader).into_iter(); + + for res in stream_deser { + let item = res?; + + self.data.replace(item); + } + + Ok(()) + } + + pub fn load_from_path(path: impl AsRef) -> Result { + let mut this = Self { + file: FileLock::new_exclusive(create_if_not_exist(path.as_ref())?)?, + data: BTreeSet::default(), + }; + this.load_impl()?; + Ok(this) + } + + pub fn load() -> Result { + Self::load_from_path(default_path()?) + } +} From df3af9727efda5e4e98155a65976896b8ce7dd9c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 22:15:21 +1000 Subject: [PATCH 0579/2020] Impl new fn `Records::overwrite` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index e2ecac5d..ae1c3bc8 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -95,6 +95,10 @@ where .open(path)?, )?; + write_to(file, &mut iter.into_iter()) +} + +pub fn write_to(file: FileLock, iter: &mut dyn Iterator) -> Result<(), Error> { let writer = io::BufWriter::with_capacity(512, file); let mut ser = serde_json::Serializer::new(writer); @@ -115,6 +119,7 @@ pub fn default_path() -> Result { #[derive(Debug)] pub struct Records { file: FileLock, + /// Use BTreeSet to dedup the metadata data: BTreeSet, } @@ -144,4 +149,9 @@ impl Records { pub fn load() -> Result { Self::load_from_path(default_path()?) } + + /// **Warning: This will overwrite all existing records!** + pub fn overwrite(self) -> Result<(), Error> { + write_to(self.file, &mut self.data.into_iter()) + } } From aba2c87d6d8e1271ba47e3b2675113ae4c15fb71 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 22:22:07 +1000 Subject: [PATCH 0580/2020] Impl `IntoIterator` for `&Records` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index ae1c3bc8..5d2d6e06 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -1,9 +1,9 @@ use std::{ cmp, - collections::BTreeSet, + collections::{btree_set, BTreeSet}, fs, hash, io::{self, Write}, - iter::IntoIterator, + iter::{IntoIterator, Iterator}, path::{Path, PathBuf}, }; @@ -155,3 +155,13 @@ impl Records { write_to(self.file, &mut self.data.into_iter()) } } + +impl<'a> IntoIterator for &'a Records { + type Item = &'a MetaData; + + type IntoIter = btree_set::Iter<'a, MetaData>; + + fn into_iter(self) -> Self::IntoIter { + self.data.iter() + } +} From 04f167491aa452bc6d597fe564bfa8e62710eaae Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 22:25:36 +1000 Subject: [PATCH 0581/2020] Impl `Borrow` for `MetaData` for `Records` so that we can use `&str` to query `BTreeSet` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 5d2d6e06..edb9c61c 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -1,5 +1,5 @@ use std::{ - cmp, + borrow, cmp, collections::{btree_set, BTreeSet}, fs, hash, io::{self, Write}, @@ -25,6 +25,13 @@ pub struct MetaData { pub target: CompactString, pub bins: Vec, } + +impl borrow::Borrow for MetaData { + fn borrow(&self) -> &str { + &self.name + } +} + impl PartialEq for MetaData { fn eq(&self, other: &Self) -> bool { self.name == other.name From 8ec33c5b6c058556bbce0a9fb5882c4c31a40581 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 22:30:58 +1000 Subject: [PATCH 0582/2020] Impl get, contains, insert, replace, remove & take for `binstall_v1::Records` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index edb9c61c..02fdf167 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -161,6 +161,34 @@ impl Records { pub fn overwrite(self) -> Result<(), Error> { write_to(self.file, &mut self.data.into_iter()) } + + pub fn get(&self, value: impl AsRef) -> Option<&MetaData> { + self.data.get(value.as_ref()) + } + + pub fn contains(&self, value: impl AsRef) -> bool { + self.data.contains(value.as_ref()) + } + + /// Adds a value to the set. + /// If the set did not have an equal element present, true is returned. + /// + /// If the set did have an equal element present, false is returned, and the entry is not updated. See the module-level documentation for more. + pub fn insert(&mut self, value: MetaData) -> bool { + self.data.insert(value) + } + + pub fn replace(&mut self, value: MetaData) -> Option { + self.data.replace(value) + } + + pub fn remove(&mut self, value: impl AsRef) -> bool { + self.data.remove(value.as_ref()) + } + + pub fn take(&mut self, value: impl AsRef) -> Option { + self.data.take(value.as_ref()) + } } impl<'a> IntoIterator for &'a Records { From e6ee49377151dd62681a48afd9ed99432a4e36e4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 22:31:51 +1000 Subject: [PATCH 0583/2020] Impl `binstall_v1::Records::{len, is_empty}` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 02fdf167..b85cbf41 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -189,6 +189,14 @@ impl Records { pub fn take(&mut self, value: impl AsRef) -> Option { self.data.take(value.as_ref()) } + + pub fn len(&self) -> usize { + self.data.len() + } + + pub fn is_empty(&self) -> bool { + self.data.is_empty() + } } impl<'a> IntoIterator for &'a Records { From cef4dfee5c6b4057b832ca2f5641907f77d16158 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 22:32:20 +1000 Subject: [PATCH 0584/2020] Update doc of `binstall_v1::Records::insert` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index b85cbf41..63a01ad6 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -172,8 +172,8 @@ impl Records { /// Adds a value to the set. /// If the set did not have an equal element present, true is returned. - /// - /// If the set did have an equal element present, false is returned, and the entry is not updated. See the module-level documentation for more. + /// If the set did have an equal element present, false is returned, + /// and the entry is not updated. pub fn insert(&mut self, value: MetaData) -> bool { self.data.insert(value) } From 671b2fb6f0c5a20b04b2406f08fd47a23892f0ae Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 22:54:32 +1000 Subject: [PATCH 0585/2020] Derive `Clone` for `MetaData` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 63a01ad6..0dba0dea 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -16,7 +16,7 @@ use url::Url; use crate::{cargo_home, cratesio_url, create_if_not_exist, FileLock}; -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct MetaData { pub name: CompactString, pub version_req: CompactString, From 5987acbf958d0e14a627afc6a3e56d7e8b19f8f6 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 22:55:16 +1000 Subject: [PATCH 0586/2020] Derive `Clone` for `Source` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 0dba0dea..a2fad509 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -67,7 +67,7 @@ pub enum SourceType { Registry, } -#[derive(Debug, Serialize, Deserialize)] +#[derive(Clone, Debug, Serialize, Deserialize)] pub struct Source { pub source_type: SourceType, pub url: Url, From c9139fec68e486005e4b805ec243df5ad23c1943 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 23:09:52 +1000 Subject: [PATCH 0587/2020] Add unit tests for `metafiles::binstall_v1` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 73 ++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index a2fad509..26d46f57 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -208,3 +208,76 @@ impl<'a> IntoIterator for &'a Records { self.data.iter() } } + +#[cfg(test)] +mod test { + use super::*; + use crate::target::TARGET; + + use miette::Result; + use tempfile::TempDir; + + macro_rules! assert_records_eq { + ($records:expr, $metadata_set:expr) => { + assert_eq!($records.len(), $metadata_set.len()); + for (record, metadata) in $records.into_iter().zip($metadata_set.iter()) { + assert_eq!(record, metadata); + } + }; + } + + #[test] + fn rw_test() -> Result<()> { + let target = CompactString::from(TARGET); + + let tempdir = TempDir::new().unwrap(); + let path = tempdir.path().join("binstall-tests.json"); + + let metadata_vec = [ + MetaData { + name: "a".into(), + version_req: "*".into(), + current_version: Version::new(0, 1, 0), + source: Source::cratesio_registry(), + target: target.clone(), + bins: vec!["1".into(), "2".into()], + }, + MetaData { + name: "b".into(), + version_req: "0.1.0".into(), + current_version: Version::new(0, 1, 0), + source: Source::cratesio_registry(), + target: target.clone(), + bins: vec!["1".into(), "2".into()], + }, + MetaData { + name: "a".into(), + version_req: "*".into(), + current_version: Version::new(0, 2, 0), + source: Source::cratesio_registry(), + target, + bins: vec!["1".into()], + }, + ]; + + append_to_path(&path, metadata_vec.clone())?; + + let mut iter = metadata_vec.into_iter(); + iter.next().unwrap(); + + let mut metadata_set: BTreeSet<_> = iter.collect(); + + let mut records = Records::load_from_path(&path)?; + assert_records_eq!(&records, &metadata_set); + + records.remove("b"); + assert_eq!(records.len(), metadata_set.len() - 1); + records.overwrite()?; + + metadata_set.remove("b"); + let records = Records::load_from_path(&path)?; + assert_records_eq!(&records, &metadata_set); + + Ok(()) + } +} From d796424199b080ba14e8cd5bad545f80f87e1b06 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 23:13:41 +1000 Subject: [PATCH 0588/2020] Fix `Records::overwrite`: Update file len Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 26d46f57..8f95e7a1 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -2,7 +2,7 @@ use std::{ borrow, cmp, collections::{btree_set, BTreeSet}, fs, hash, - io::{self, Write}, + io::{self, Seek, Write}, iter::{IntoIterator, Iterator}, path::{Path, PathBuf}, }; @@ -95,17 +95,20 @@ pub fn append_to_path(path: impl AsRef, iter: Iter) -> Result<(), Er where Iter: IntoIterator, { - let file = FileLock::new_exclusive( + let mut file = FileLock::new_exclusive( fs::OpenOptions::new() .create(true) .append(true) .open(path)?, )?; - write_to(file, &mut iter.into_iter()) + write_to(&mut file, &mut iter.into_iter()) } -pub fn write_to(file: FileLock, iter: &mut dyn Iterator) -> Result<(), Error> { +pub fn write_to( + file: &mut FileLock, + iter: &mut dyn Iterator, +) -> Result<(), Error> { let writer = io::BufWriter::with_capacity(512, file); let mut ser = serde_json::Serializer::new(writer); @@ -158,8 +161,14 @@ impl Records { } /// **Warning: This will overwrite all existing records!** - pub fn overwrite(self) -> Result<(), Error> { - write_to(self.file, &mut self.data.into_iter()) + pub fn overwrite(mut self) -> Result<(), Error> { + self.file.rewind()?; + write_to(&mut self.file, &mut self.data.into_iter())?; + + let len = self.file.stream_position()?; + self.file.set_len(len)?; + + Ok(()) } pub fn get(&self, value: impl AsRef) -> Option<&MetaData> { From 7ccbdb2356e549b77580134edbb8ce686b2efbfc Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 23:15:46 +1000 Subject: [PATCH 0589/2020] Impl `binstall_v1::append` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 8f95e7a1..9a253f83 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -105,6 +105,13 @@ where write_to(&mut file, &mut iter.into_iter()) } +pub fn append(iter: Iter) -> Result<(), Error> +where + Iter: IntoIterator, +{ + append_to_path(default_path()?, iter) +} + pub fn write_to( file: &mut FileLock, iter: &mut dyn Iterator, From 2490c08840b9616fe884c6860ff0604389d4d633 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Jul 2022 23:15:54 +1000 Subject: [PATCH 0590/2020] Write to `.binstall-crates.toml` in `entry` Signed-off-by: Jiahao XU --- src/main.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main.rs b/src/main.rs index 51d86863..7fb17bb1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -345,6 +345,9 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { if !custom_install_path { debug!("Writing .crates.toml"); metafiles::v1::CratesToml::append(metadata_vec.iter())?; + + debug!("Writing .binstall-crates.toml"); + metafiles::binstall_v1::append(metadata_vec)?; } if opts.no_cleanup { From 3cd9866d322554c3661d938fc840e9ccb91096a5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 28 Jul 2022 01:24:16 +1000 Subject: [PATCH 0591/2020] Use `unwrap` in unit test for `binstall_v1` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 9a253f83..2ed1d6c7 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -230,7 +230,6 @@ mod test { use super::*; use crate::target::TARGET; - use miette::Result; use tempfile::TempDir; macro_rules! assert_records_eq { @@ -243,7 +242,7 @@ mod test { } #[test] - fn rw_test() -> Result<()> { + fn rw_test() { let target = CompactString::from(TARGET); let tempdir = TempDir::new().unwrap(); @@ -276,24 +275,22 @@ mod test { }, ]; - append_to_path(&path, metadata_vec.clone())?; + append_to_path(&path, metadata_vec.clone()).unwrap(); let mut iter = metadata_vec.into_iter(); iter.next().unwrap(); let mut metadata_set: BTreeSet<_> = iter.collect(); - let mut records = Records::load_from_path(&path)?; + let mut records = Records::load_from_path(&path).unwrap(); assert_records_eq!(&records, &metadata_set); records.remove("b"); assert_eq!(records.len(), metadata_set.len() - 1); - records.overwrite()?; + records.overwrite().unwrap(); metadata_set.remove("b"); - let records = Records::load_from_path(&path)?; + let records = Records::load_from_path(&path).unwrap(); assert_records_eq!(&records, &metadata_set); - - Ok(()) } } From 3f72e9b81ac1a1dcbe900163957ad28cffcffd81 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 28 Jul 2022 01:45:54 +1000 Subject: [PATCH 0592/2020] Use `tempfile::NamedTempFile` in unit test of `binstall_v1` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 2ed1d6c7..d20ed712 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -230,7 +230,7 @@ mod test { use super::*; use crate::target::TARGET; - use tempfile::TempDir; + use tempfile::NamedTempFile; macro_rules! assert_records_eq { ($records:expr, $metadata_set:expr) => { @@ -245,8 +245,8 @@ mod test { fn rw_test() { let target = CompactString::from(TARGET); - let tempdir = TempDir::new().unwrap(); - let path = tempdir.path().join("binstall-tests.json"); + let named_tempfile = NamedTempFile::new().unwrap(); + let path = named_tempfile.path(); let metadata_vec = [ MetaData { From 96d90c0376aba052b719fd9c2a5d9b7f061f38d5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 28 Jul 2022 18:06:39 +1000 Subject: [PATCH 0593/2020] Fix `append_to_path` on windows: Use `create_if_not_exist` to open the file. Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index d20ed712..5bb0e61c 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -95,12 +95,9 @@ pub fn append_to_path(path: impl AsRef, iter: Iter) -> Result<(), Er where Iter: IntoIterator, { - let mut file = FileLock::new_exclusive( - fs::OpenOptions::new() - .create(true) - .append(true) - .open(path)?, - )?; + let mut file = FileLock::new_exclusive(create_if_not_exist(path.as_ref())?)?; + // Move the cursor to EOF + file.seek(io::SeekFrom::End(0))?; write_to(&mut file, &mut iter.into_iter()) } From 73af5b2824002efdb9245a99304dd3d6a66ba7a1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 28 Jul 2022 18:09:38 +1000 Subject: [PATCH 0594/2020] Test appending behavior of `append_to_path` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 5bb0e61c..4681dd0f 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -267,7 +267,7 @@ mod test { version_req: "*".into(), current_version: Version::new(0, 2, 0), source: Source::cratesio_registry(), - target, + target: target.clone(), bins: vec!["1".into()], }, ]; @@ -289,5 +289,21 @@ mod test { metadata_set.remove("b"); let records = Records::load_from_path(&path).unwrap(); assert_records_eq!(&records, &metadata_set); + // Drop the exclusive file lock + drop(records); + + let new_metadata = MetaData { + name: "b".into(), + version_req: "0.1.0".into(), + current_version: Version::new(0, 1, 1), + source: Source::cratesio_registry(), + target, + bins: vec!["1".into(), "2".into()], + }; + append_to_path(&path, [new_metadata.clone()]).unwrap(); + metadata_set.insert(new_metadata); + + let records = Records::load_from_path(&path).unwrap(); + assert_records_eq!(&records, &metadata_set); } } From 00fb2528af878dfb6a7d83eb8d21359c1a996623 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 28 Jul 2022 18:09:53 +1000 Subject: [PATCH 0595/2020] Rm unused import `std::fs` in `binstall_v1` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 4681dd0f..f76f3ef6 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -1,7 +1,7 @@ use std::{ borrow, cmp, collections::{btree_set, BTreeSet}, - fs, hash, + hash, io::{self, Seek, Write}, iter::{IntoIterator, Iterator}, path::{Path, PathBuf}, From 98556cb2af95665a7dd2b610b0165432513bc456 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 28 Jul 2022 19:21:11 +1000 Subject: [PATCH 0596/2020] Add field `MetaData::other` for forward compatibility Signed-off-by: Jiahao XU --- src/binstall/install.rs | 1 + src/metafiles/binstall_v1.rs | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/binstall/install.rs b/src/binstall/install.rs index 21691323..365dd0de 100644 --- a/src/binstall/install.rs +++ b/src/binstall/install.rs @@ -36,6 +36,7 @@ pub async fn install( source: Source::cratesio_registry(), target, bins, + other: Default::default(), }) }) } diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index f76f3ef6..35c3901a 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -1,6 +1,6 @@ use std::{ borrow, cmp, - collections::{btree_set, BTreeSet}, + collections::{btree_set, BTreeMap, BTreeSet}, hash, io::{self, Seek, Write}, iter::{IntoIterator, Iterator}, @@ -24,6 +24,11 @@ pub struct MetaData { pub source: Source, pub target: CompactString, pub bins: Vec, + + /// Forwards compatibility. Unknown keys from future versions of Cargo + /// will be stored here and retained when the file is saved. + #[serde(flatten)] + pub other: BTreeMap, } impl borrow::Borrow for MetaData { @@ -253,6 +258,7 @@ mod test { source: Source::cratesio_registry(), target: target.clone(), bins: vec!["1".into(), "2".into()], + other: Default::default(), }, MetaData { name: "b".into(), @@ -261,6 +267,7 @@ mod test { source: Source::cratesio_registry(), target: target.clone(), bins: vec!["1".into(), "2".into()], + other: Default::default(), }, MetaData { name: "a".into(), @@ -269,6 +276,7 @@ mod test { source: Source::cratesio_registry(), target: target.clone(), bins: vec!["1".into()], + other: Default::default(), }, ]; @@ -299,6 +307,7 @@ mod test { source: Source::cratesio_registry(), target, bins: vec!["1".into(), "2".into()], + other: Default::default(), }; append_to_path(&path, [new_metadata.clone()]).unwrap(); metadata_set.insert(new_metadata); From 4ad8e4f46e040e914fbf98f09922614973508a79 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 28 Jul 2022 19:43:58 +1000 Subject: [PATCH 0597/2020] Add new dep serde-tuple-vec-map v1.0.1 Signed-off-by: Jiahao XU --- Cargo.lock | 10 ++++++++++ Cargo.toml | 1 + 2 files changed, 11 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 55b7e882..a90b580e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -148,6 +148,7 @@ dependencies = [ "scopeguard", "semver", "serde", + "serde-tuple-vec-map", "serde_json", "simplelog", "strum", @@ -1389,6 +1390,15 @@ dependencies = [ "serde_derive", ] +[[package]] +name = "serde-tuple-vec-map" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a04d0ebe0de77d7d445bb729a895dcb0a288854b267ca85f030ce51cdc578c82" +dependencies = [ + "serde", +] + [[package]] name = "serde_derive" version = "1.0.140" diff --git a/Cargo.toml b/Cargo.toml index 8907e68f..eb99d341 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,6 +40,7 @@ reqwest = { version = "0.11.11", features = ["stream"], default-features = false scopeguard = "1.1.0" semver = { version = "1.0.12", features = ["serde"] } serde = { version = "1.0.140", features = ["derive"] } +serde-tuple-vec-map = "1.0.1" serde_json = "1.0.82" simplelog = "0.12.0" strum = "0.24.1" From c5db0fefb5b2d3b1e872fb00c56186fcb2306f5d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 28 Jul 2022 19:45:47 +1000 Subject: [PATCH 0598/2020] Use `Vec` for field `MetaData::other` by using `tuple_vec_map` to make the `Vec<(CompactString, serde_json::Value)>` appears as a map. This is OK because we don't access that part anyway and only add such field to avoid losing any information when deserialize, modify it and serialize it again to overwrite existing metafile. Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 35c3901a..cebdb722 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -1,6 +1,6 @@ use std::{ borrow, cmp, - collections::{btree_set, BTreeMap, BTreeSet}, + collections::{btree_set, BTreeSet}, hash, io::{self, Seek, Write}, iter::{IntoIterator, Iterator}, @@ -27,8 +27,8 @@ pub struct MetaData { /// Forwards compatibility. Unknown keys from future versions of Cargo /// will be stored here and retained when the file is saved. - #[serde(flatten)] - pub other: BTreeMap, + #[serde(flatten, with = "tuple_vec_map")] + pub other: Vec<(CompactString, serde_json::Value)>, } impl borrow::Borrow for MetaData { From 0d8b865ba4889a5e21e3972e7853858cf3bfcbc2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 28 Jul 2022 19:48:45 +1000 Subject: [PATCH 0599/2020] Update `binstall_v1::default_path` and fix typo in it The postfix should be `.json`, not `.toml`. Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index cebdb722..2cfc58f8 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -1,7 +1,7 @@ use std::{ borrow, cmp, collections::{btree_set, BTreeSet}, - hash, + fs, hash, io::{self, Seek, Write}, iter::{IntoIterator, Iterator}, path::{Path, PathBuf}, @@ -132,7 +132,11 @@ pub fn write_to( } pub fn default_path() -> Result { - Ok(cargo_home()?.join(".binstall-crates.toml")) + let dir = cargo_home()?.join("binstall"); + + fs::create_dir_all(&dir)?; + + Ok(dir.join("crates-v1.json")) } #[derive(Debug)] From cb4cffd0ab227c5f54b94f490942b5e30b2ddac7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 28 Jul 2022 20:33:24 +1000 Subject: [PATCH 0600/2020] Fix confusing comment for field `MetaData::other` Signed-off-by: Jiahao XU --- src/metafiles/binstall_v1.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/metafiles/binstall_v1.rs b/src/metafiles/binstall_v1.rs index 2cfc58f8..2d429ec2 100644 --- a/src/metafiles/binstall_v1.rs +++ b/src/metafiles/binstall_v1.rs @@ -25,8 +25,10 @@ pub struct MetaData { pub target: CompactString, pub bins: Vec, - /// Forwards compatibility. Unknown keys from future versions of Cargo + /// Forwards compatibility. Unknown keys from future versions /// will be stored here and retained when the file is saved. + /// + /// We use an `Vec` here since it is never accessed in Rust. #[serde(flatten, with = "tuple_vec_map")] pub other: Vec<(CompactString, serde_json::Value)>, } From 241b763477a2bf22840ce02abd10b242612559b5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 28 Jul 2022 23:13:47 +1000 Subject: [PATCH 0601/2020] Use `CompactString` for field `CrateVersionSource::name` Signed-off-by: Jiahao XU --- src/metafiles/cvs.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/metafiles/cvs.rs b/src/metafiles/cvs.rs index f0068328..f8bd7777 100644 --- a/src/metafiles/cvs.rs +++ b/src/metafiles/cvs.rs @@ -1,5 +1,6 @@ use std::{borrow::Cow, fmt, str::FromStr}; +use compact_str::CompactString; use miette::Diagnostic; use semver::Version; use serde::{Deserialize, Deserializer, Serialize, Serializer}; @@ -10,7 +11,7 @@ use crate::cratesio_url; #[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq)] pub struct CrateVersionSource { - pub name: String, + pub name: CompactString, pub version: Version, pub source: Source, } @@ -18,7 +19,7 @@ pub struct CrateVersionSource { impl From<&super::binstall_v1::MetaData> for CrateVersionSource { fn from(metadata: &super::binstall_v1::MetaData) -> Self { super::CrateVersionSource { - name: metadata.name.clone().to_string(), + name: metadata.name.clone(), version: metadata.current_version.clone(), source: Source::from(&metadata.source), } @@ -75,7 +76,7 @@ impl FromStr for CrateVersionSource { _ => return Err(CvsParseError::BadSource), }; Ok(Self { - name: name.to_string(), + name: name.into(), version, source, }) From 6c6d0fe9c229e61cb2a087a7a463167b1a35bc9a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 28 Jul 2022 23:15:26 +1000 Subject: [PATCH 0602/2020] Update logging for `binstall_v1::append` Signed-off-by: Jiahao XU --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 7fb17bb1..307e66ee 100644 --- a/src/main.rs +++ b/src/main.rs @@ -346,7 +346,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { debug!("Writing .crates.toml"); metafiles::v1::CratesToml::append(metadata_vec.iter())?; - debug!("Writing .binstall-crates.toml"); + debug!("Writing binstall/crates-v1.json"); metafiles::binstall_v1::append(metadata_vec)?; } From 806f69832ef43ad2f38c0cc3006afa5f773d135c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 30 Jul 2022 10:07:54 +1200 Subject: [PATCH 0603/2020] Place import at the top (#258) --- src/miniwasi.wast | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/miniwasi.wast b/src/miniwasi.wast index 93655cfd..0a2b05fa 100644 --- a/src/miniwasi.wast +++ b/src/miniwasi.wast @@ -1,8 +1,8 @@ (module + (import "wasi_snapshot_preview1" "proc_exit" (func $exit (param i32))) (memory $0 0) (export "memory" (memory $0)) (export "_start" (func $0)) - (import "wasi_snapshot_preview1" "proc_exit" (func $exit (param i32))) (func $0 (call $exit (i32.const 0)) (unreachable) From 47fd7c14a6b0effcdeab46004137a4e19a2bea7d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 30 Jul 2022 17:26:52 +1200 Subject: [PATCH 0604/2020] Add -V, clean up errors and help text (#259) Co-authored-by: Jiahao XU --- src/binstall/resolve.rs | 4 +- src/errors.rs | 69 +++++++++++++++------ src/helpers.rs | 14 ++++- src/main.rs | 131 ++++++++++++++++++++++++++-------------- 4 files changed, 151 insertions(+), 67 deletions(-) diff --git a/src/binstall/resolve.rs b/src/binstall/resolve.rs index f2b4f8c6..a207192e 100644 --- a/src/binstall/resolve.rs +++ b/src/binstall/resolve.rs @@ -85,7 +85,7 @@ pub async fn resolve( let mut version = match (&crate_name.version, &opts.version) { (Some(version), None) => version.to_string(), (None, Some(version)) => version.to_string(), - (Some(_), Some(_)) => Err(BinstallError::DuplicateVersionReq)?, + (Some(_), Some(_)) => Err(BinstallError::SuperfluousVersionOption)?, (None, None) => "*".to_string(), }; @@ -103,7 +103,7 @@ pub async fn resolve( // TODO: work out which of these to do based on `opts.name` // TODO: support git-based fetches (whole repo name rather than just crate name) let manifest = match opts.manifest_path.clone() { - Some(manifest_path) => load_manifest_path(manifest_path.join("Cargo.toml"))?, + Some(manifest_path) => load_manifest_path(manifest_path)?, None => { fetch_crate_cratesio(&client, &crates_io_api_client, &crate_name.name, &version).await? } diff --git a/src/errors.rs b/src/errors.rs index f8451ee3..1fbfa54e 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -5,11 +5,19 @@ use miette::{Diagnostic, Report}; use thiserror::Error; use tokio::task; -/// Errors emitted by the library portion of cargo-binstall. +/// Errors emitted by cargo-binstall. #[derive(Error, Diagnostic, Debug)] #[diagnostic(url(docsrs))] #[non_exhaustive] pub enum BinstallError { + /// Internal: a task could not be joined. + /// + /// - Code: `binstall::internal::task_join` + /// - Exit: 17 + #[error(transparent)] + #[diagnostic(severity(error), code(binstall::internal::task_join))] + TaskJoinError(#[from] task::JoinError), + /// The installation was cancelled by a user at a confirmation prompt. /// /// - Code: `binstall::user_abort` @@ -96,6 +104,14 @@ pub enum BinstallError { err: crates_io_api::Error, }, + /// The override path to the cargo manifest is invalid or cannot be resolved. + /// + /// - Code: `binstall::cargo_manifest_path` + /// - Exit: 77 + #[error("the --manifest-path is invalid or cannot be resolved")] + #[diagnostic(severity(error), code(binstall::cargo_manifest_path))] + CargoManifestPath, + /// A parsing or validation error in a cargo manifest. /// /// This should be rare, as manifests are generally fetched from crates.io, which does its own @@ -167,29 +183,41 @@ pub enum BinstallError { v: semver::Version, }, - /// This occurs when you specified `--version` while also using - /// form `$crate_name@$ver` tp specify version requirements. - #[error("duplicate version requirements")] + /// The crate@version syntax was used at the same time as the --version option. + /// + /// You can't do that as it's ambiguous which should apply. + /// + /// - Code: `binstall::conflict::version` + /// - Exit: 84 + #[error("superfluous version specification")] #[diagnostic( severity(error), - code(binstall::version::requirement), - help("Remove the `--version req` or simply use `$crate_name`") + code(binstall::conflict::version), + help("You cannot use both crate@version and the --version option. Remove one.") )] - DuplicateVersionReq, + SuperfluousVersionOption, - /// This occurs when you specified `--manifest-path` while also - /// specifing multiple crates to install. - #[error("If you use --manifest-path, then you can only specify one crate to install")] + /// An override option is used when multiple packages are to be installed. + /// + /// This is raised when more than one package name is provided and any of: + /// + /// - `--version` + /// - `--manifest-path` + /// - `--bin-dir` + /// - `--pkg-fmt` + /// - `--pkg-url` + /// + /// is provided. + /// + /// - Code: `binstall::conflict::overrides` + /// - Exit: 85 + #[error("override option used with multi package syntax")] #[diagnostic( severity(error), - code(binstall::manifest_path), - help("Remove the `--manifest-path` or only specify one `$crate_name`") + code(binstall::conflict::overrides), + help("You cannot use --{option} and specify multiple packages at the same time. Do one or the other.") )] - ManifestPathConflictedWithBatchInstallation, - - #[error("Failed to join tokio::task::JoinHandle")] - #[diagnostic(severity(error), code(binstall::join_error))] - TaskJoinError(#[from] task::JoinError), + OverrideOptionUsedWithMultiInstall { option: &'static str }, } impl BinstallError { @@ -203,6 +231,7 @@ impl BinstallError { pub fn exit_code(&self) -> ExitCode { use BinstallError::*; let code: u8 = match self { + TaskJoinError(_) => 17, UserAbort => 32, UrlParse(_) => 65, Unzip(_) => 66, @@ -211,14 +240,14 @@ impl BinstallError { Http { .. } => 69, Io(_) => 74, CratesIoApi { .. } => 76, + CargoManifestPath => 77, CargoManifest { .. } => 78, VersionParse { .. } => 80, VersionReq { .. } => 81, VersionMismatch { .. } => 82, VersionUnavailable { .. } => 83, - DuplicateVersionReq => 84, - ManifestPathConflictedWithBatchInstallation => 85, - TaskJoinError(_) => 17, + SuperfluousVersionOption => 84, + OverrideOptionUsedWithMultiInstall { .. } => 85, }; // reserved codes diff --git a/src/helpers.rs b/src/helpers.rs index 7a7e565d..0194ad9b 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -88,7 +88,19 @@ pub fn load_manifest_path>( manifest_path: P, ) -> Result, BinstallError> { block_in_place(|| { - debug!("Reading manifest: {}", manifest_path.as_ref().display()); + let manifest_path = manifest_path.as_ref(); + let manifest_path = if manifest_path.is_dir() { + manifest_path.join("Cargo.toml") + } else if manifest_path.is_file() { + manifest_path.into() + } else { + return Err(BinstallError::CargoManifestPath); + }; + + debug!( + "Reading manifest at local path: {}", + manifest_path.display() + ); // Load and parse manifest (this checks file system for binary output names) let manifest = Manifest::::from_path_with_metadata(manifest_path)?; diff --git a/src/main.rs b/src/main.rs index 307e66ee..ccbc519a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,18 +22,27 @@ static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; #[derive(Debug, Parser)] #[clap(version, about = "Install a Rust binary... from binaries!", setting = AppSettings::ArgRequiredElseHelp)] struct Options { - /// Package name for installation. + /// Packages to install. /// - /// This must be a crates.io package name. - #[clap(value_name = "crate")] + /// Syntax: crate[@version] + /// + /// Each value is either a crate name alone, or a crate name followed by @ and the version to + /// install. The version syntax is as with the --version option. + /// + /// When multiple names are provided, the --version option and any override options are + /// unavailable due to ambiguity. + #[clap(help_heading = "Package selection", value_name = "crate[@version]")] crate_names: Vec, - /// Semver filter to select the package version to install. + /// Package version to install. /// - /// This is in Cargo.toml dependencies format: `--version 1.2.3` is equivalent to - /// `--version "^1.2.3"`. Use `=1.2.3` to install a specific version. - #[clap(long)] - version: Option, + /// Takes either an exact semver version or a semver version requirement expression, which will + /// be resolved to the highest matching version available. + /// + /// Cannot be used when multiple packages are installed at once, use the attached version + /// syntax in that case. + #[clap(help_heading = "Package selection", long = "version")] + version_req: Option, /// Override binary target set. /// @@ -48,18 +57,32 @@ struct Options { /// /// If falling back to installing from source, the first target will be used. #[clap( - help_heading = "OVERRIDES", + help_heading = "Package selection", alias = "target", long, value_name = "TRIPLE" )] targets: Option, - /// Override install path for downloaded binary. + /// Override Cargo.toml package manifest path. /// - /// Defaults to `$HOME/.cargo/bin` - #[clap(help_heading = "OVERRIDES", long)] - install_path: Option, + /// This skips searching crates.io for a manifest and uses the specified path directly, useful + /// for debugging and when adding Binstall support. This may be either the path to the folder + /// containing a Cargo.toml file, or the Cargo.toml file itself. + #[clap(help_heading = "Overrides", long)] + manifest_path: Option, + + /// Override Cargo.toml package manifest bin-dir. + #[clap(help_heading = "Overrides", long)] + bin_dir: Option, + + /// Override Cargo.toml package manifest pkg-fmt. + #[clap(help_heading = "Overrides", long)] + pkg_fmt: Option, + + /// Override Cargo.toml package manifest pkg-url. + #[clap(help_heading = "Overrides", long)] + pkg_url: Option, /// Disable symlinking / versioned updates. /// @@ -68,21 +91,30 @@ struct Options { /// possible to have multiple versions of the same binary, for example for testing or rollback. /// /// Pass this flag to disable this behavior. - #[clap(long)] + #[clap(help_heading = "Options", long)] no_symlinks: bool, /// Dry run, fetch and show changes without installing binaries. - #[clap(long)] + #[clap(help_heading = "Options", long)] dry_run: bool, /// Disable interactive mode / confirmation prompts. - #[clap(long)] + #[clap(help_heading = "Options", long)] no_confirm: bool, /// Do not cleanup temporary files. - #[clap(long)] + #[clap(help_heading = "Options", long)] no_cleanup: bool, + /// Install binaries in a custom location. + /// + /// By default, binaries are installed to the global location `$CARGO_HOME/bin`, and global + /// metadata files are updated with the package information. Specifying another path here + /// switches over to a "local" install, where binaries are installed at the path given, and the + /// global metadata files are not updated. + #[clap(help_heading = "Options", long)] + install_path: Option, + /// Enforce downloads over secure transports only. /// /// Insecure HTTP downloads will be removed completely in the future; in the meantime this @@ -91,41 +123,34 @@ struct Options { /// Without this option, plain HTTP will warn. /// /// Implies `--min-tls-version=1.2`. - #[clap(long)] + #[clap(help_heading = "Options", long)] secure: bool, /// Require a minimum TLS version from remote endpoints. /// /// The default is not to require any minimum TLS version, and use the negotiated highest /// version available to both this client and the remote server. - #[clap(long, arg_enum, value_name = "VERSION")] + #[clap(help_heading = "Options", long, arg_enum, value_name = "VERSION")] min_tls_version: Option, - /// Override manifest source. - /// - /// This skips searching crates.io for a manifest and uses the specified path directly, useful - /// for debugging and when adding Binstall support. This must be the path to the folder - /// containing a Cargo.toml file, not the Cargo.toml file itself. - #[clap(help_heading = "OVERRIDES", long)] - manifest_path: Option, + /// Print help information + #[clap(help_heading = "Meta", short, long)] + help: bool, + + /// Print version information + #[clap(help_heading = "Meta", short = 'V')] + version: bool, /// Utility log level /// /// Set to `debug` when submitting a bug report. - #[clap(long, default_value = "info", value_name = "LEVEL")] + #[clap( + help_heading = "Meta", + long, + default_value = "info", + value_name = "LEVEL" + )] log_level: LevelFilter, - - /// Override Cargo.toml package manifest bin-dir. - #[clap(help_heading = "OVERRIDES", long)] - bin_dir: Option, - - /// Override Cargo.toml package manifest pkg-fmt. - #[clap(help_heading = "OVERRIDES", long)] - pkg_fmt: Option, - - /// Override Cargo.toml package manifest pkg-url. - #[clap(help_heading = "OVERRIDES", long)] - pkg_url: Option, } enum MainExit { @@ -199,15 +224,33 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { // Load options let mut opts = Options::parse_from(args); + + let crate_names = take(&mut opts.crate_names); + if crate_names.len() > 1 { + let option = if opts.version_req.is_some() { + "version" + } else if opts.manifest_path.is_some() { + "manifest-path" + } else if opts.bin_dir.is_some() { + "bin-dir" + } else if opts.pkg_fmt.is_some() { + "pkg-fmt" + } else if opts.pkg_url.is_some() { + "pkg-url" + } else { + "" + }; + + if option != "" { + return Err(BinstallError::OverrideOptionUsedWithMultiInstall { option }.into()); + } + } + let cli_overrides = PkgOverride { pkg_url: opts.pkg_url.take(), pkg_fmt: opts.pkg_fmt.take(), bin_dir: opts.bin_dir.take(), }; - let crate_names = take(&mut opts.crate_names); - if crate_names.len() > 1 && opts.manifest_path.is_some() { - return Err(BinstallError::ManifestPathConflictedWithBatchInstallation.into()); - } // Initialize reqwest client let client = create_reqwest_client(opts.secure, opts.min_tls_version.map(|v| v.into()))?; @@ -264,7 +307,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { let binstall_opts = Arc::new(binstall::Options { no_symlinks: opts.no_symlinks, dry_run: opts.dry_run, - version: opts.version.take(), + version: opts.version_req.take(), manifest_path: opts.manifest_path.take(), cli_overrides, desired_targets, From ac995798ef6fdb59b63b81159197442da3ff4971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 30 Jul 2022 17:27:49 +1200 Subject: [PATCH 0605/2020] Split features and build args handling in build (#257) --- .github/workflows/build.yml | 6 +++--- ci-scripts/compile-settings.jq | 12 ++++++++++-- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b81714f9..67dda4b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,15 +28,15 @@ jobs: include: - target: x86_64-unknown-linux-gnu os: ubuntu-latest - debug_build_args: --no-default-features --features rustls,pkg-config + debug_features: [ rustls, pkg-config ] - target: x86_64-apple-darwin os: macos-latest - target: aarch64-apple-darwin os: macos-latest - target: x86_64-pc-windows-msvc os: windows-latest - debug_build_args: --no-default-features --features native-tls - release_build_args: --no-default-features --features static,zlib-ng,native-tls,fancy-no-backtrace + debug_features: [ native-tls ] + release_features: [ static, zlib-ng, native-tls, fancy-no-backtrace ] - target: x86_64-unknown-linux-musl os: ubuntu-latest - target: armv7-unknown-linux-musleabihf diff --git a/ci-scripts/compile-settings.jq b/ci-scripts/compile-settings.jq index d5231c09..ba1df64a 100644 --- a/ci-scripts/compile-settings.jq +++ b/ci-scripts/compile-settings.jq @@ -2,17 +2,25 @@ if $for_release then { output: "release", profile: "release", args: ($matrix.release_build_args // ""), + features: ($matrix.release_features // []), } else { output: "debug", profile: "dev", - args: ($matrix.debug_build_args // "--no-default-features --features rustls,fancy-with-backtrace"), + args: ($matrix.debug_build_args // ""), + features: ($matrix.debug_features // ["rustls", "fancy-with-backtrace"]), } end | +.features = ( + if (.features | length > 0) + then "--no-default-features --features \(.features | join(","))" + else "" end +) +| { CBIN: (if ($matrix.target | test("windows")) then "cargo-binstall.exe" else "cargo-binstall" end), CTOOL: (if ($matrix."use-cross" // false) then "cross" else "cargo" end), COUTPUT: .output, - CARGS: "--target \($matrix.target) --profile \(.profile) \(.args)", + CARGS: "--target \($matrix.target) --profile \(.profile) \(.features) \(.args)", } | to_entries[] | "\(.key)=\(.value)" From 98d8a96a02f34966bdf64621a2062021ed73ce5f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 29 Jul 2022 19:00:35 +1000 Subject: [PATCH 0606/2020] Use `build-std` feature for release build to reduce binary size Signed-off-by: Jiahao XU --- .github/workflows/build.yml | 2 +- ci-scripts/compile-settings.jq | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67dda4b4..b9f3e2a9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -105,7 +105,7 @@ jobs: run: sudo ./ci-scripts/install-deps.sh - name: Build - run: ${{ env.CTOOL }} build ${{ env.CARGS }} + run: ${{ env.CTOOL }} ${{ env.TOOLCHAIN }} build ${{ env.CARGS }} - name: Get output shell: bash diff --git a/ci-scripts/compile-settings.jq b/ci-scripts/compile-settings.jq index ba1df64a..676bc105 100644 --- a/ci-scripts/compile-settings.jq +++ b/ci-scripts/compile-settings.jq @@ -1,10 +1,14 @@ if $for_release then { output: "release", + toolchain: "+nightly", profile: "release", - args: ($matrix.release_build_args // ""), + # Use build-std to build a std library optimized for size and abort immediately on abort, + # so that format string for `unwrap`/`expect`/`unreachable`/`panic` can be optimized out. + args: ($matrix.release_build_args // "-Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort"), features: ($matrix.release_features // []), } else { output: "debug", + toolchain: "+stable", profile: "dev", args: ($matrix.debug_build_args // ""), features: ($matrix.debug_features // ["rustls", "fancy-with-backtrace"]), @@ -19,6 +23,7 @@ if $for_release then { { CBIN: (if ($matrix.target | test("windows")) then "cargo-binstall.exe" else "cargo-binstall" end), CTOOL: (if ($matrix."use-cross" // false) then "cross" else "cargo" end), + TOOLCHAIN: .toolchain, COUTPUT: .output, CARGS: "--target \($matrix.target) --profile \(.profile) \(.features) \(.args)", } From 7a7220b1a2f07ccfec585cad1ab92517ec448566 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 29 Jul 2022 19:03:18 +1000 Subject: [PATCH 0607/2020] Fix build: Rm unnecessary `env.TOOLCHAIN` Since we build it using +nightly anyway. Signed-off-by: Jiahao XU --- .github/workflows/build.yml | 2 +- ci-scripts/compile-settings.jq | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b9f3e2a9..67dda4b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -105,7 +105,7 @@ jobs: run: sudo ./ci-scripts/install-deps.sh - name: Build - run: ${{ env.CTOOL }} ${{ env.TOOLCHAIN }} build ${{ env.CARGS }} + run: ${{ env.CTOOL }} build ${{ env.CARGS }} - name: Get output shell: bash diff --git a/ci-scripts/compile-settings.jq b/ci-scripts/compile-settings.jq index 676bc105..ae905cf0 100644 --- a/ci-scripts/compile-settings.jq +++ b/ci-scripts/compile-settings.jq @@ -1,6 +1,5 @@ if $for_release then { output: "release", - toolchain: "+nightly", profile: "release", # Use build-std to build a std library optimized for size and abort immediately on abort, # so that format string for `unwrap`/`expect`/`unreachable`/`panic` can be optimized out. @@ -8,7 +7,6 @@ if $for_release then { features: ($matrix.release_features // []), } else { output: "debug", - toolchain: "+stable", profile: "dev", args: ($matrix.debug_build_args // ""), features: ($matrix.debug_features // ["rustls", "fancy-with-backtrace"]), @@ -23,7 +21,6 @@ if $for_release then { { CBIN: (if ($matrix.target | test("windows")) then "cargo-binstall.exe" else "cargo-binstall" end), CTOOL: (if ($matrix."use-cross" // false) then "cross" else "cargo" end), - TOOLCHAIN: .toolchain, COUTPUT: .output, CARGS: "--target \($matrix.target) --profile \(.profile) \(.features) \(.args)", } From af3b87df7af6ef8e723e116ad77ea5e391288482 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 29 Jul 2022 19:11:47 +1000 Subject: [PATCH 0608/2020] Fix releasae build: Install rust-src for release Signed-off-by: Jiahao XU --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 67dda4b4..57d04169 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -73,6 +73,10 @@ jobs: if: "!matrix.use-cross" run: rustup target add ${{ matrix.target }} + - name: Install rust-src + if: inputs.for_release + run: rustup component add rust-src + - name: Select compile settings shell: bash run: | From 9e5ff25be8ff5e2aa581faee804770dca0f29e0d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 31 Jul 2022 13:12:27 +1000 Subject: [PATCH 0609/2020] Fix release build: Set `RUSTFLAGS` to link with libgcc statically Signed-off-by: Jiahao XU --- .github/workflows/build.yml | 2 ++ ci-scripts/compile-settings.jq | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 57d04169..93a7af04 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -110,6 +110,8 @@ jobs: - name: Build run: ${{ env.CTOOL }} build ${{ env.CARGS }} + env: + RUSTFLAGS: ${{ env.RUSTFLAGS }} - name: Get output shell: bash diff --git a/ci-scripts/compile-settings.jq b/ci-scripts/compile-settings.jq index ae905cf0..72f45153 100644 --- a/ci-scripts/compile-settings.jq +++ b/ci-scripts/compile-settings.jq @@ -9,9 +9,16 @@ if $for_release then { output: "debug", profile: "dev", args: ($matrix.debug_build_args // ""), + rustflags: "", features: ($matrix.debug_features // ["rustls", "fancy-with-backtrace"]), } end | +.rustflags = ( + if $for_release and $matrix.target == "aarch64-unknown-linux-musl" or $matrix.target == "armv7-unknown-linux-musleabihf" + then "-C link-arg=-lgcc -Clink-arg=-static-libgcc" + else "" end +) +| .features = ( if (.features | length > 0) then "--no-default-features --features \(.features | join(","))" @@ -23,6 +30,7 @@ if $for_release then { CTOOL: (if ($matrix."use-cross" // false) then "cross" else "cargo" end), COUTPUT: .output, CARGS: "--target \($matrix.target) --profile \(.profile) \(.features) \(.args)", + RUSTFLAGS: .rustflags, } | to_entries[] | "\(.key)=\(.value)" From a6889c678edcf2e2e8cb8df3fd4585c03687fcb7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 31 Jul 2022 16:21:31 +1000 Subject: [PATCH 0610/2020] Rm unused `rustflags` value in `ci-scripts/compile-settings.jq` Signed-off-by: Jiahao XU --- ci-scripts/compile-settings.jq | 1 - 1 file changed, 1 deletion(-) diff --git a/ci-scripts/compile-settings.jq b/ci-scripts/compile-settings.jq index 72f45153..aa0e37f0 100644 --- a/ci-scripts/compile-settings.jq +++ b/ci-scripts/compile-settings.jq @@ -9,7 +9,6 @@ if $for_release then { output: "debug", profile: "dev", args: ($matrix.debug_build_args // ""), - rustflags: "", features: ($matrix.debug_features // ["rustls", "fancy-with-backtrace"]), } end | From 3cdb2aeddd6f94c4081d52911d03c79032605902 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 01:33:36 +0000 Subject: [PATCH 0611/2020] Bump tokio from 1.20.0 to 1.20.1 Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.20.0 to 1.20.1. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.20.0...tokio-1.20.1) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a90b580e..d2b3ca5c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1668,9 +1668,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.20.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57aec3cfa4c296db7255446efb4928a6be304b431a806216105542a67b6ca82e" +checksum = "7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581" dependencies = [ "autocfg", "bytes", diff --git a/Cargo.toml b/Cargo.toml index eb99d341..0fcafeb1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,7 @@ tar = "0.4.38" tempfile = "3.3.0" thiserror = "1.0.31" tinytemplate = "1.2.1" -tokio = { version = "1.20.0", features = ["rt-multi-thread", "process", "sync"], default-features = false } +tokio = { version = "1.20.1", features = ["rt-multi-thread", "process", "sync"], default-features = false } toml_edit = { version = "0.14.4", features = ["easy"] } url = { version = "2.2.2", features = ["serde"] } xz2 = "0.1.7" From c5961ee07fdd4f995a2f8a9c86fa974541fc9318 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 01:33:47 +0000 Subject: [PATCH 0612/2020] Bump clap from 3.2.14 to 3.2.16 Bumps [clap](https://github.com/clap-rs/clap) from 3.2.14 to 3.2.16. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v3.2.14...v3.2.16) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a90b580e..f67cd611 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -213,9 +213,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.14" +version = "3.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54635806b078b7925d6e36810b1755f2a4b5b4d57560432c1ecf60bcbe10602b" +checksum = "a3dbbb6653e7c55cc8595ad3e1f7be8f32aba4eb7ff7f0fd1163d4f3d137c0a9" dependencies = [ "atty", "bitflags", @@ -230,9 +230,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.2.7" +version = "3.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "759bf187376e1afa7b85b959e6a664a3e7a95203415dba952ad19139e798f902" +checksum = "9ba52acd3b0a5c33aeada5cdaa3267cdc7c594a98731d4268cdc1532f4264cb4" dependencies = [ "heck", "proc-macro-error", diff --git a/Cargo.toml b/Cargo.toml index eb99d341..d8494565 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,7 +23,7 @@ async-trait = "0.1.56" bytes = "1.2.0" bzip2 = "0.4.3" cargo_toml = "0.11.5" -clap = { version = "3.2.14", features = ["derive"] } +clap = { version = "3.2.16", features = ["derive"] } compact_str = { version = "0.5.2", features = ["serde"] } crates_io_api = { version = "0.8.0", default-features = false } dirs = "4.0.0" From da19855500bd59dd1c5bdb64b654757b6312521e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 Aug 2022 03:41:34 +0000 Subject: [PATCH 0613/2020] Bump bytes from 1.2.0 to 1.2.1 Bumps [bytes](https://github.com/tokio-rs/bytes) from 1.2.0 to 1.2.1. - [Release notes](https://github.com/tokio-rs/bytes/releases) - [Changelog](https://github.com/tokio-rs/bytes/blob/master/CHANGELOG.md) - [Commits](https://github.com/tokio-rs/bytes/commits) --- updated-dependencies: - dependency-name: bytes dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d8f9de7..ee1f8a61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,9 +95,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b3de4a0c5e67e16066a0715723abd91edc2f9001d09c46e1dca929351e130e" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "bzip2" diff --git a/Cargo.toml b/Cargo.toml index b3b972bf..7892a712 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ pkg-fmt = "zip" [dependencies] async-trait = "0.1.56" -bytes = "1.2.0" +bytes = "1.2.1" bzip2 = "0.4.3" cargo_toml = "0.11.5" clap = { version = "3.2.16", features = ["derive"] } From 9391d22fa28c0e5c194a302ebb4a8f0ce4f4618a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 2 Aug 2022 19:54:01 +1000 Subject: [PATCH 0614/2020] Apply clippy suggestion Signed-off-by: Jiahao XU --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index ccbc519a..052c57e5 100644 --- a/src/main.rs +++ b/src/main.rs @@ -241,7 +241,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { "" }; - if option != "" { + if !option.is_empty() { return Err(BinstallError::OverrideOptionUsedWithMultiInstall { option }.into()); } } From 58c50cbe9186cdb02073ec885eb77828b6bf9e75 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 2 Aug 2022 20:18:44 +1000 Subject: [PATCH 0615/2020] Add new dep itertools v0.10.3 Signed-off-by: Jiahao XU --- Cargo.lock | 1 + Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index ee1f8a61..8e7082fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -139,6 +139,7 @@ dependencies = [ "futures-util", "guess_host_triple", "home", + "itertools", "jobserver", "log", "miette", diff --git a/Cargo.toml b/Cargo.toml index 7892a712..6b714bd1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -31,6 +31,7 @@ flate2 = { version = "1.0.24", default-features = false } fs4 = "0.6.2" futures-util = { version = "0.3.21", default-features = false } home = "0.5.3" +itertools = "0.10.3" jobserver = "0.1.24" log = "0.4.17" miette = "5.1.1" From 09c1afe616a670f7f9c4a300474381fcdb7c5be8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 2 Aug 2022 22:14:05 +1000 Subject: [PATCH 0616/2020] Impl new fn `CrateName::dedup` Signed-off-by: Jiahao XU --- src/helpers/crate_name.rs | 76 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 72 insertions(+), 4 deletions(-) diff --git a/src/helpers/crate_name.rs b/src/helpers/crate_name.rs index 58ef59c0..7c38e8f5 100644 --- a/src/helpers/crate_name.rs +++ b/src/helpers/crate_name.rs @@ -1,8 +1,8 @@ -use std::convert::Infallible; -use std::fmt; -use std::str::FromStr; +use std::{convert::Infallible, fmt, str::FromStr}; -#[derive(Debug, Clone)] +use itertools::Itertools; + +#[derive(Debug, Clone, Eq, PartialEq)] pub struct CrateName { pub name: String, pub version: Option, @@ -37,3 +37,71 @@ impl FromStr for CrateName { }) } } + +impl CrateName { + pub fn dedup(mut crate_names: Vec) -> impl Iterator { + crate_names.sort_by(|x, y| x.name.cmp(&y.name)); + crate_names.into_iter().coalesce(|previous, current| { + if previous.name == current.name { + Ok(current) + } else { + Err((previous, current)) + } + }) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + macro_rules! assert_dedup { + ([ $( ( $input_name:expr, $input_version:expr ) ),* ], [ $( ( $output_name:expr, $output_version:expr ) ),* ]) => { + let input_crate_names = vec![$( CrateName { + name: $input_name.into(), + version: Some($input_version.into()) + }, )*]; + + let mut output_crate_names: Vec = vec![$( CrateName { + name: $output_name.into(), version: Some($output_version.into()) + }, )*]; + output_crate_names.sort_by(|x, y| x.name.cmp(&y.name)); + + let crate_names: Vec<_> = CrateName::dedup(input_crate_names).collect(); + assert_eq!(crate_names, output_crate_names); + }; + } + + #[test] + fn test_dedup() { + // Base case 0: Empty input + assert_dedup!([], []); + + // Base case 1: With only one input + assert_dedup!([("a", "1")], [("a", "1")]); + + // Base Case 2: Only has duplicate names + assert_dedup!([("a", "1"), ("a", "2")], [("a", "2")]); + + // Complex Case 0: Having two crates + assert_dedup!( + [("a", "10"), ("b", "3"), ("a", "0"), ("b", "0"), ("a", "1")], + [("a", "1"), ("b", "0")] + ); + + // Complex Case 1: Having three crates + assert_dedup!( + [ + ("d", "1.1"), + ("a", "10"), + ("b", "3"), + ("d", "230"), + ("a", "0"), + ("b", "0"), + ("a", "1"), + ("d", "23") + ], + [("a", "1"), ("b", "0"), ("d", "23")] + ); + } +} From caeb49ce336633b312758adb3eec3595fec36459 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 2 Aug 2022 22:15:09 +1000 Subject: [PATCH 0617/2020] Rm duplicate `crate_names` specified on cmdline Signed-off-by: Jiahao XU --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index 052c57e5..478fedbb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -31,6 +31,9 @@ struct Options { /// /// When multiple names are provided, the --version option and any override options are /// unavailable due to ambiguity. + /// + /// If duplicate names are provided, the last one (and their version requirement) + /// is kept. #[clap(help_heading = "Package selection", value_name = "crate[@version]")] crate_names: Vec, @@ -246,6 +249,9 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { } } + // Remove duplicate crate_name, keep the last one + let crate_names = CrateName::dedup(crate_names); + let cli_overrides = PkgOverride { pkg_url: opts.pkg_url.take(), pkg_fmt: opts.pkg_fmt.take(), From d430c077d43bad732a24ce2c9df94a9bb5800102 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 2 Aug 2022 22:17:11 +1000 Subject: [PATCH 0618/2020] Use `CompactString` for fields of `CrateName` Since most of the time, they are shorter than 24 bytes. Signed-off-by: Jiahao XU --- src/binstall/resolve.rs | 3 ++- src/helpers/crate_name.rs | 11 ++++++----- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/binstall/resolve.rs b/src/binstall/resolve.rs index a207192e..3279bf14 100644 --- a/src/binstall/resolve.rs +++ b/src/binstall/resolve.rs @@ -4,6 +4,7 @@ use std::{ }; use cargo_toml::{Package, Product}; +use compact_str::CompactString; use log::{debug, error, info, warn}; use miette::{miette, Result}; use reqwest::Client; @@ -19,7 +20,7 @@ pub enum Resolution { Fetch { fetcher: Arc, package: Package, - name: String, + name: CompactString, version: String, bin_path: PathBuf, bin_files: Vec, diff --git a/src/helpers/crate_name.rs b/src/helpers/crate_name.rs index 7c38e8f5..0f9ec2f4 100644 --- a/src/helpers/crate_name.rs +++ b/src/helpers/crate_name.rs @@ -1,11 +1,12 @@ use std::{convert::Infallible, fmt, str::FromStr}; +use compact_str::CompactString; use itertools::Itertools; #[derive(Debug, Clone, Eq, PartialEq)] pub struct CrateName { - pub name: String, - pub version: Option, + pub name: CompactString, + pub version: Option, } impl fmt::Display for CrateName { @@ -26,12 +27,12 @@ impl FromStr for CrateName { fn from_str(s: &str) -> Result { Ok(if let Some((name, version)) = s.split_once('@') { CrateName { - name: name.to_string(), - version: Some(version.to_string()), + name: name.into(), + version: Some(version.into()), } } else { CrateName { - name: s.to_string(), + name: s.into(), version: None, } }) From b7cfa0aa643f2c1cdee951c099e1f1944a556675 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 2 Aug 2022 22:21:45 +1000 Subject: [PATCH 0619/2020] Use `CompactString` for field `Resolution::Fetch::version` Signed-off-by: Jiahao XU --- src/binstall/resolve.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/binstall/resolve.rs b/src/binstall/resolve.rs index 3279bf14..5593ba2c 100644 --- a/src/binstall/resolve.rs +++ b/src/binstall/resolve.rs @@ -4,7 +4,7 @@ use std::{ }; use cargo_toml::{Package, Product}; -use compact_str::CompactString; +use compact_str::{format_compact, CompactString}; use log::{debug, error, info, warn}; use miette::{miette, Result}; use reqwest::Client; @@ -21,7 +21,7 @@ pub enum Resolution { fetcher: Arc, package: Package, name: CompactString, - version: String, + version: CompactString, bin_path: PathBuf, bin_files: Vec, }, @@ -83,11 +83,11 @@ pub async fn resolve( ) -> Result { info!("Installing package: '{}'", crate_name); - let mut version = match (&crate_name.version, &opts.version) { - (Some(version), None) => version.to_string(), - (None, Some(version)) => version.to_string(), + let mut version: CompactString = match (&crate_name.version, &opts.version) { + (Some(version), None) => version.clone(), + (None, Some(version)) => version.into(), (Some(_), Some(_)) => Err(BinstallError::SuperfluousVersionOption)?, - (None, None) => "*".to_string(), + (None, None) => "*".into(), }; // Treat 0.1.2 as =0.1.2 @@ -97,7 +97,7 @@ pub async fn resolve( .map(|ch| ch.is_ascii_digit()) .unwrap_or(false) { - version.insert(0, '='); + version = format_compact!("={version}"); } // Fetch crate via crates.io, git, or use a local manifest path From a52ac3fc7a9cdac53819b80bd9e27664226abaf9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 2 Aug 2022 22:26:24 +1000 Subject: [PATCH 0620/2020] Use `CompactString` for `Options::version_req` which is unlikely to be larger than 24 bytes. Signed-off-by: Jiahao XU --- src/binstall.rs | 4 +++- src/main.rs | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/binstall.rs b/src/binstall.rs index c6fcc569..12a532f7 100644 --- a/src/binstall.rs +++ b/src/binstall.rs @@ -1,5 +1,7 @@ use std::path::PathBuf; +use compact_str::CompactString; + use crate::{metafiles::binstall_v1::MetaData, DesiredTargets, PkgOverride}; mod resolve; @@ -11,7 +13,7 @@ pub use install::*; pub struct Options { pub no_symlinks: bool, pub dry_run: bool, - pub version: Option, + pub version: Option, pub manifest_path: Option, pub cli_overrides: PkgOverride, pub desired_targets: DesiredTargets, diff --git a/src/main.rs b/src/main.rs index ccbc519a..61d9c86f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,6 +8,7 @@ use std::{ }; use clap::{AppSettings, Parser}; +use compact_str::CompactString; use log::{debug, error, info, warn, LevelFilter}; use miette::{miette, Result, WrapErr}; use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; @@ -42,7 +43,7 @@ struct Options { /// Cannot be used when multiple packages are installed at once, use the attached version /// syntax in that case. #[clap(help_heading = "Package selection", long = "version")] - version_req: Option, + version_req: Option, /// Override binary target set. /// From f72eafb049416d0fd9f1f9d2f3fbc90a9a67abae Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 2 Aug 2022 22:28:44 +1000 Subject: [PATCH 0621/2020] Use `PathBuf` for field `Options::install_path` Since it does not require a utf-8 string. Signed-off-by: Jiahao XU --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 61d9c86f..b1fba258 100644 --- a/src/main.rs +++ b/src/main.rs @@ -114,7 +114,7 @@ struct Options { /// switches over to a "local" install, where binaries are installed at the path given, and the /// global metadata files are not updated. #[clap(help_heading = "Options", long)] - install_path: Option, + install_path: Option, /// Enforce downloads over secure transports only. /// From 60d17c7e5654ad6cbd6a55bf4df6f73c4991fd2c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 2 Aug 2022 22:42:05 +1000 Subject: [PATCH 0622/2020] Ret `CompactString` in `Fetcher::source_name` Signed-off-by: Jiahao XU --- src/fetchers.rs | 3 ++- src/fetchers/gh_crate_meta.rs | 11 ++++++----- src/fetchers/quickinstall.rs | 5 +++-- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/fetchers.rs b/src/fetchers.rs index 16691707..952b90fe 100644 --- a/src/fetchers.rs +++ b/src/fetchers.rs @@ -1,6 +1,7 @@ use std::path::Path; use std::sync::Arc; +use compact_str::CompactString; pub use gh_crate_meta::*; pub use log::debug; pub use quickinstall::*; @@ -35,7 +36,7 @@ pub trait Fetcher: Send + Sync { fn pkg_fmt(&self) -> PkgFmt; /// A short human-readable name or descriptor for the package source - fn source_name(&self) -> String; + fn source_name(&self) -> CompactString; /// Should return true if the remote is from a third-party source fn is_third_party(&self) -> bool; diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index 7a4381db..6375d7df 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -1,6 +1,7 @@ use std::path::Path; use std::sync::Arc; +use compact_str::{CompactString, ToCompactString}; use log::{debug, info, warn}; use once_cell::sync::OnceCell; use reqwest::Client; @@ -79,19 +80,19 @@ impl super::Fetcher for GhCrateMeta { self.data.meta.pkg_fmt } - fn source_name(&self) -> String { + fn source_name(&self) -> CompactString { self.url .get() .map(|url| { if let Some(domain) = url.domain() { - domain.to_string() + domain.to_compact_string() } else if let Some(host) = url.host_str() { - host.to_string() + host.to_compact_string() } else { - url.to_string() + url.to_compact_string() } }) - .unwrap_or_else(|| "invalid url".to_string()) + .unwrap_or_else(|| "invalid url".into()) } fn is_third_party(&self) -> bool { diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index bdca2762..f79b9bc1 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -1,6 +1,7 @@ use std::path::Path; use std::sync::Arc; +use compact_str::CompactString; use log::{debug, info}; use reqwest::Client; use reqwest::Method; @@ -49,8 +50,8 @@ impl super::Fetcher for QuickInstall { PkgFmt::Tgz } - fn source_name(&self) -> String { - String::from("QuickInstall") + fn source_name(&self) -> CompactString { + CompactString::from("QuickInstall") } fn is_third_party(&self) -> bool { From 346bb8ee67cdb285c8a79bb2e0657787e91002c1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 09:12:06 +1000 Subject: [PATCH 0623/2020] Fix `binstall::resolve` (#266) --- src/binstall/resolve.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/binstall/resolve.rs b/src/binstall/resolve.rs index 5593ba2c..6290deef 100644 --- a/src/binstall/resolve.rs +++ b/src/binstall/resolve.rs @@ -85,7 +85,7 @@ pub async fn resolve( let mut version: CompactString = match (&crate_name.version, &opts.version) { (Some(version), None) => version.clone(), - (None, Some(version)) => version.into(), + (None, Some(version)) => version.clone(), (Some(_), Some(_)) => Err(BinstallError::SuperfluousVersionOption)?, (None, None) => "*".into(), }; From 28aeae938e392a8449d34f7fdcacfc1f6ab17663 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 13:59:50 +1000 Subject: [PATCH 0624/2020] `fs::create_dir_all(&install_path)` in `main.rs` Signed-off-by: Jiahao XU --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index dc536330..a794c52c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ use std::{ ffi::OsString, + fs, mem::take, path::{Path, PathBuf}, process::{ExitCode, Termination}, @@ -295,6 +296,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { error!("No viable install path found of specified, try `--install-path`"); miette!("No install path found or specified") })?; + fs::create_dir_all(&install_path).map_err(BinstallError::Io)?; debug!("Using install path: {}", install_path.display()); // Create a temporary directory for downloads etc. @@ -393,6 +395,10 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { block_in_place(|| { if !custom_install_path { + // If using standardised install path, + // then create_dir_all(&install_path) would also + // create .cargo. + debug!("Writing .crates.toml"); metafiles::v1::CratesToml::append(metadata_vec.iter())?; From 71566383db36188fb99a158e1feeb4f1792e6fa0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 14:08:06 +1000 Subject: [PATCH 0625/2020] Fix creating `.cargo/.crates.toml` in `metadata::v1` Signed-off-by: Jiahao XU --- src/metafiles/v1.rs | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/src/metafiles/v1.rs b/src/metafiles/v1.rs index 25ef6c3f..a4857530 100644 --- a/src/metafiles/v1.rs +++ b/src/metafiles/v1.rs @@ -74,7 +74,11 @@ impl CratesToml { Iter: IntoIterator, { let mut file = FileLock::new_exclusive(create_if_not_exist(path.as_ref())?)?; - let mut c1 = Self::load_from_reader(&mut *file)?; + let mut c1 = if file.metadata()?.len() != 0 { + Self::load_from_reader(&mut *file)? + } else { + Self::default() + }; for metadata in iter { c1.insert(&CrateVersionSource::from(metadata), metadata.bins.clone()); @@ -108,3 +112,32 @@ pub enum CratesTomlParseError { #[error(transparent)] CvsParse(#[from] super::CvsParseError), } + +#[cfg(test)] +mod tests { + use super::{super::binstall_v1, *}; + use crate::target::TARGET; + + use semver::Version; + use tempfile::TempDir; + + #[test] + fn test_empty() { + let tempdir = TempDir::new().unwrap(); + let path = tempdir.path().join("crates-v1.toml"); + + CratesToml::append_to_path( + &path, + &[MetaData { + name: "cargo-binstall".into(), + version_req: "*".into(), + current_version: Version::new(0, 11, 1), + source: binstall_v1::Source::cratesio_registry(), + target: TARGET.into(), + bins: vec!["cargo-binstall".into()], + other: Default::default(), + }], + ) + .unwrap(); + } +} From 9627b73d6b3ba67a22478af3255c85d6f852a435 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 04:52:56 +0000 Subject: [PATCH 0626/2020] Bump miette from 5.1.1 to 5.2.0 Bumps [miette](https://github.com/zkat/miette) from 5.1.1 to 5.2.0. - [Release notes](https://github.com/zkat/miette/releases) - [Changelog](https://github.com/zkat/miette/blob/main/CHANGELOG.md) - [Commits](https://github.com/zkat/miette/compare/miette-derive-v5.1.1...miette-derive-v5.2.0) --- updated-dependencies: - dependency-name: miette dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e7082fd..fd9066eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -899,9 +899,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "miette" -version = "5.1.1" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d67f6972a70e33dbb5551875c6a3e46ae0a7cddd4661a2811ee48be51054e9" +checksum = "8e2c9d50e919ffdc4d2d83b83972a13e8ba86ba8245a205bee9e314d593c15a8" dependencies = [ "atty", "backtrace", @@ -919,9 +919,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.1.1" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "426594bc7266dedee4d687cdaebc121c74c52a667e4ce933c83694ad035990a6" +checksum = "3c8d10c73bcc9f0ab5c918521dab23d178062a56e6b328eb37106d497280bd94" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 6b714bd1..9f17cd93 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -34,7 +34,7 @@ home = "0.5.3" itertools = "0.10.3" jobserver = "0.1.24" log = "0.4.17" -miette = "5.1.1" +miette = "5.2.0" mimalloc = { version = "0.1.29", default-features = false, optional = true } once_cell = "1.13.0" reqwest = { version = "0.11.11", features = ["stream"], default-features = false } From 2383f817601acaf32a0a68a1ae7b450942ba61b5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 06:11:34 +0000 Subject: [PATCH 0627/2020] Bump serde_json from 1.0.82 to 1.0.83 Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.82 to 1.0.83. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.82...v1.0.83) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fd9066eb..fa32dee0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1413,9 +1413,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c2c1fdcd807d1098552c5b9a36e425e42e9fbd7c6a37a8425f390f781f7fa7" +checksum = "38dd04e3c8279e75b31ef29dbdceebfe5ad89f4d0937213c53f7d49d01b3d5a7" dependencies = [ "itoa", "ryu", diff --git a/Cargo.toml b/Cargo.toml index 9f17cd93..4362f646 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ scopeguard = "1.1.0" semver = { version = "1.0.12", features = ["serde"] } serde = { version = "1.0.140", features = ["derive"] } serde-tuple-vec-map = "1.0.1" -serde_json = "1.0.82" +serde_json = "1.0.83" simplelog = "0.12.0" strum = "0.24.1" strum_macros = "0.24.2" From ec2c11843befdf48bade1b43311a128317b7feff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 06:20:52 +0000 Subject: [PATCH 0628/2020] Bump serde from 1.0.140 to 1.0.142 Bumps [serde](https://github.com/serde-rs/serde) from 1.0.140 to 1.0.142. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.140...v1.0.142) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fa32dee0..b1bd6eaa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1384,9 +1384,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.140" +version = "1.0.142" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc855a42c7967b7c369eb5860f7164ef1f6f81c20c7cc1141f2a604e18723b03" +checksum = "e590c437916fb6b221e1d00df6e3294f3fccd70ca7e92541c475d6ed6ef5fee2" dependencies = [ "serde_derive", ] @@ -1402,9 +1402,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.140" +version = "1.0.142" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2122636b9fe3b81f1cb25099fcf2d3f542cdb1d45940d56c713158884a05da" +checksum = "34b5b8d809babe02f538c2cfec6f2c1ed10804c0e5a6a041a049a4f5588ccc2e" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 4362f646..913bb41a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -40,7 +40,7 @@ once_cell = "1.13.0" reqwest = { version = "0.11.11", features = ["stream"], default-features = false } scopeguard = "1.1.0" semver = { version = "1.0.12", features = ["serde"] } -serde = { version = "1.0.140", features = ["derive"] } +serde = { version = "1.0.142", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.83" simplelog = "0.12.0" From 1aa04a25c671bcee0802f6eec36b3e1dcb3331ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 06:27:58 +0000 Subject: [PATCH 0629/2020] Bump thiserror from 1.0.31 to 1.0.32 Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.31 to 1.0.32. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.31...1.0.32) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b1bd6eaa..5715e426 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1606,18 +1606,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.31" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.31" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 913bb41a..5e51092a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,7 @@ strum = "0.24.1" strum_macros = "0.24.2" tar = "0.4.38" tempfile = "3.3.0" -thiserror = "1.0.31" +thiserror = "1.0.32" tinytemplate = "1.2.1" tokio = { version = "1.20.1", features = ["rt-multi-thread", "process", "sync"], default-features = false } toml_edit = { version = "0.14.4", features = ["easy"] } From 3cc3338ff5617b5fb8cface2637c68dadbaf83d1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 Aug 2022 06:28:22 +0000 Subject: [PATCH 0630/2020] Bump async-trait from 0.1.56 to 0.1.57 Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.56 to 0.1.57. - [Release notes](https://github.com/dtolnay/async-trait/releases) - [Commits](https://github.com/dtolnay/async-trait/compare/0.1.56...0.1.57) --- updated-dependencies: - dependency-name: async-trait dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b1bd6eaa..4555ebd0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,9 +28,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.56" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96cf8829f67d2eab0b2dfa42c5d0ef737e0724e4a82b01b3e292456202b19716" +checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 913bb41a..dcefc8b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -async-trait = "0.1.56" +async-trait = "0.1.57" bytes = "1.2.1" bzip2 = "0.4.3" cargo_toml = "0.11.5" From cc92c2c4b6ff8259300fe212ed9fda5d20e5c4b1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 17:29:19 +1000 Subject: [PATCH 0631/2020] Rm `$HOME/.cargo` to test `cargo-binstall` Signed-off-by: Jiahao XU --- .github/workflows/integration.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 2e0caf2b..58faa4c6 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -50,5 +50,7 @@ jobs: - name: Test shell: bash - run: ./ci-scripts/tests.sh ${{ matrix.bin }} ${{ runner.os }} + run: | + rm -rf "$HOME/.cargo" + ./ci-scripts/tests.sh ${{ matrix.bin }} ${{ runner.os }} From 7997c73cb228716866ac2774b5945d74b69f57ea Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 17:35:24 +1000 Subject: [PATCH 0632/2020] Optimize: Avoid spawning `ldd` if built with Glibc Signed-off-by: Jiahao XU --- src/target.rs | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/target.rs b/src/target.rs index 8dfb75b6..b1cd8f48 100644 --- a/src/target.rs +++ b/src/target.rs @@ -133,7 +133,20 @@ mod linux { use super::{Command, Output, TARGET}; pub(super) async fn detect_targets_linux() -> Vec { - let abi = parse_abi(); + let (abi, libc) = parse_abi_and_libc(); + + match libc { + // Glibc can only be dynamically linked. + // If we can run this binary, then it means that the target + // supports both glibc and musl. + Libc::Glibc => { + return vec![ + create_target_str("gnu", abi), + create_target_str("musl", abi), + ] + } + _ => (), + } if let Ok(Output { status: _, @@ -173,13 +186,18 @@ mod linux { } } - fn parse_abi() -> &'static str { + enum Libc { + Glibc, + Musl, + } + + fn parse_abi_and_libc() -> (&'static str, Libc) { let last = TARGET.rsplit_once('-').unwrap().1; if let Some(libc_version) = last.strip_prefix("musl") { - libc_version + (libc_version, Libc::Musl) } else if let Some(libc_version) = last.strip_prefix("gnu") { - libc_version + (libc_version, Libc::Glibc) } else { panic!("Unrecognized libc") } From a686aca08c93fb8ff33cb9a40658e9b2cae83136 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 17:38:27 +1000 Subject: [PATCH 0633/2020] Refactor: Extract `target::linux::create_targets_str` Signed-off-by: Jiahao XU --- src/target.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/target.rs b/src/target.rs index b1cd8f48..dd83aa5d 100644 --- a/src/target.rs +++ b/src/target.rs @@ -139,12 +139,7 @@ mod linux { // Glibc can only be dynamically linked. // If we can run this binary, then it means that the target // supports both glibc and musl. - Libc::Glibc => { - return vec![ - create_target_str("gnu", abi), - create_target_str("musl", abi), - ] - } + Libc::Glibc => return create_targets_str(&["gnu", "musl"], abi), _ => (), } @@ -164,10 +159,7 @@ mod linux { }; if libc_version == "gnu" { - return vec![ - create_target_str("gnu", abi), - create_target_str("musl", abi), - ]; + return create_targets_str(&["gnu", "musl"], abi); } } @@ -211,6 +203,13 @@ mod linux { format!("{prefix}-{libc_version}{abi}") } + + fn create_targets_str(libc_versions: &[&str], abi: &str) -> Vec { + libc_version + .iter() + .map(|libc_version| create_target_str(libc_version, abi)) + .collect() + } } #[cfg(target_os = "macos")] From 140d3df8bd73833f3a8245bd0d95c681ecce180b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 17:40:58 +1000 Subject: [PATCH 0634/2020] Fix integration test: Set `CARGO_HOME` instead of `rm -rf $HOME/.cargo` The later would also delete the cmd `cargo`. Signed-off-by: Jiahao XU --- .github/workflows/integration.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 58faa4c6..a132dd31 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -50,7 +50,7 @@ jobs: - name: Test shell: bash - run: | - rm -rf "$HOME/.cargo" - ./ci-scripts/tests.sh ${{ matrix.bin }} ${{ runner.os }} + run: ./ci-scripts/tests.sh ${{ matrix.bin }} ${{ runner.os }} + env: + CARGO_HOME: /tmp/cargo-home-for-test/ From d472e8054b8141cdec4ac6bb8183e35a42e7f13d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 17:46:26 +1000 Subject: [PATCH 0635/2020] Fix typo in `target::linux::create_targets_str` Signed-off-by: Jiahao XU --- src/target.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/target.rs b/src/target.rs index dd83aa5d..c6392c23 100644 --- a/src/target.rs +++ b/src/target.rs @@ -205,7 +205,7 @@ mod linux { } fn create_targets_str(libc_versions: &[&str], abi: &str) -> Vec { - libc_version + libc_versions .iter() .map(|libc_version| create_target_str(libc_version, abi)) .collect() From 2103dea3acdf755fba0d5497087852b6b3bc3b7f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 18:30:48 +1000 Subject: [PATCH 0636/2020] Impl new convenient fn `AutoAbortJoinHandle::spawn` As a shortcut to `AutoAbortJoinHandle::new(tokio::spawn(...))` Signed-off-by: Jiahao XU --- src/helpers/auto_abort_join_handle.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/helpers/auto_abort_join_handle.rs b/src/helpers/auto_abort_join_handle.rs index fa476a8b..8faa1f25 100644 --- a/src/helpers/auto_abort_join_handle.rs +++ b/src/helpers/auto_abort_join_handle.rs @@ -16,6 +16,18 @@ impl AutoAbortJoinHandle { } } +impl AutoAbortJoinHandle +where + T: Send + 'static, +{ + pub fn spawn(future: F) -> Self + where + F: Future + Send + 'static, + { + Self(tokio::spawn(future)) + } +} + impl Drop for AutoAbortJoinHandle { fn drop(&mut self) { self.0.abort(); From 5d315ae801f28609cb9953800cf2e64aeecefc20 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 18:31:23 +1000 Subject: [PATCH 0637/2020] Use `AutoAbortJoinHandle::spawn` in `MultiFetcher::add` Signed-off-by: Jiahao XU --- src/fetchers.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fetchers.rs b/src/fetchers.rs index 952b90fe..2d12e13e 100644 --- a/src/fetchers.rs +++ b/src/fetchers.rs @@ -64,7 +64,7 @@ impl MultiFetcher { pub fn add(&mut self, fetcher: Arc) { self.0.push(( fetcher.clone(), - AutoAbortJoinHandle::new(tokio::spawn(async move { fetcher.find().await })), + AutoAbortJoinHandle::spawn(async move { fetcher.find().await }), )); } From 36066fd4df28b84aa2e434c8679bc37a9e26e9fd Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 18:33:35 +1000 Subject: [PATCH 0638/2020] Use `AutoAbortJoinHandle::spawn` in `GhCrateMeta::find` Signed-off-by: Jiahao XU --- src/fetchers/gh_crate_meta.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index 6375d7df..43603760 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -41,13 +41,13 @@ impl super::Fetcher for GhCrateMeta { let checks = urls .map(|url| { let client = self.client.clone(); - AutoAbortJoinHandle::new(tokio::spawn(async move { + AutoAbortJoinHandle::spawn(async move { let url = url?; info!("Checking for package at: '{url}'"); remote_exists(client, url.clone(), Method::HEAD) .await .map(|exists| (url.clone(), exists)) - })) + }) }) .collect::>(); From a13180f79a8cb2c6d011145bbd76eb27b31e728f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 18:37:52 +1000 Subject: [PATCH 0639/2020] Ret `BinstallError` in `::poll` Signed-off-by: Jiahao XU --- src/helpers/auto_abort_join_handle.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/helpers/auto_abort_join_handle.rs b/src/helpers/auto_abort_join_handle.rs index 8faa1f25..669f352a 100644 --- a/src/helpers/auto_abort_join_handle.rs +++ b/src/helpers/auto_abort_join_handle.rs @@ -5,7 +5,9 @@ use std::{ task::{Context, Poll}, }; -use tokio::task::{JoinError, JoinHandle}; +use tokio::task::JoinHandle; + +use super::BinstallError; #[derive(Debug)] pub struct AutoAbortJoinHandle(JoinHandle); @@ -49,9 +51,11 @@ impl DerefMut for AutoAbortJoinHandle { } impl Future for AutoAbortJoinHandle { - type Output = Result; + type Output = Result; fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { - Pin::new(&mut Pin::into_inner(self).0).poll(cx) + Pin::new(&mut Pin::into_inner(self).0) + .poll(cx) + .map(|res| res.map_err(BinstallError::TaskJoinError)) } } From e8301839a98b1d6d77314fe34c2cdd2e742a6621 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 18:39:17 +1000 Subject: [PATCH 0640/2020] Use `AutoAbortJoinHandle` in `main::entry` so that the tasks will be cancelled if future returned by `entry()` is cancelled. Signed-off-by: Jiahao XU --- src/main.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index a794c52c..784f2a86 100644 --- a/src/main.rs +++ b/src/main.rs @@ -327,7 +327,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { let tasks: Vec<_> = crate_names .into_iter() .map(|crate_name| { - tokio::spawn(binstall::resolve( + AutoAbortJoinHandle::spawn(binstall::resolve( binstall_opts.clone(), crate_name, temp_dir_path.clone(), @@ -341,7 +341,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { // Confirm let mut resolutions = Vec::with_capacity(tasks.len()); for task in tasks { - resolutions.push(await_task(task).await?); + resolutions.push(task.await??); } uithread.confirm().await?; @@ -350,7 +350,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { resolutions .into_iter() .map(|resolution| { - tokio::spawn(binstall::install( + AutoAbortJoinHandle::spawn(binstall::install( resolution, binstall_opts.clone(), jobserver_client.clone(), @@ -369,7 +369,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { let crates_io_api_client = crates_io_api_client.clone(); let install_path = install_path.clone(); - tokio::spawn(async move { + AutoAbortJoinHandle::spawn(async move { let resolution = binstall::resolve( opts.clone(), crate_name, @@ -388,7 +388,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { let mut metadata_vec = Vec::with_capacity(tasks.len()); for task in tasks { - if let Some(metadata) = await_task(task).await? { + if let Some(metadata) = task.await?? { metadata_vec.push(metadata); } } From ca3efdf2ebcfbbc4da27297f6c795b995f7a73ab Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 18:45:32 +1000 Subject: [PATCH 0641/2020] Enable feature "signal" of dep "tokio" Signed-off-by: Jiahao XU --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 7f41b3d9..7b393343 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,7 @@ tar = "0.4.38" tempfile = "3.3.0" thiserror = "1.0.32" tinytemplate = "1.2.1" -tokio = { version = "1.20.1", features = ["rt-multi-thread", "process", "sync"], default-features = false } +tokio = { version = "1.20.1", features = ["rt-multi-thread", "process", "sync", "signal"], default-features = false } toml_edit = { version = "0.14.4", features = ["easy"] } url = { version = "2.2.2", features = ["serde"] } xz2 = "0.1.7" From 74051eb478cffd3ee10c6c9e8c60ab2d17b7ef22 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 18:46:41 +1000 Subject: [PATCH 0642/2020] Enable feature "macros" of dep "tokio" Signed-off-by: Jiahao XU --- Cargo.lock | 12 ++++++++++++ Cargo.toml | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 137ca81f..1faf6fbd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1683,9 +1683,21 @@ dependencies = [ "pin-project-lite", "signal-hook-registry", "socket2", + "tokio-macros", "winapi", ] +[[package]] +name = "tokio-macros" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tokio-native-tls" version = "0.3.0" diff --git a/Cargo.toml b/Cargo.toml index 7b393343..a72083c4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -50,7 +50,7 @@ tar = "0.4.38" tempfile = "3.3.0" thiserror = "1.0.32" tinytemplate = "1.2.1" -tokio = { version = "1.20.1", features = ["rt-multi-thread", "process", "sync", "signal"], default-features = false } +tokio = { version = "1.20.1", features = ["macros", "rt-multi-thread", "process", "sync", "signal"], default-features = false } toml_edit = { version = "0.14.4", features = ["easy"] } url = { version = "2.2.2", features = ["serde"] } xz2 = "0.1.7" From 47ab8f55c79d3590faeb3a4541a11e98899fb9ec Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 19:36:15 +1000 Subject: [PATCH 0643/2020] Impl new fn `helpers::cancel_on_user_term` Signed-off-by: Jiahao XU --- src/helpers.rs | 3 ++ src/helpers/signal.rs | 80 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 83 insertions(+) create mode 100644 src/helpers/signal.rs diff --git a/src/helpers.rs b/src/helpers.rs index 0194ad9b..2e010244 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -47,6 +47,9 @@ pub use crate_name::CrateName; mod flock; pub use flock::FileLock; +mod signal; +pub use signal::cancel_on_user_sig_term; + pub fn cargo_home() -> Result<&'static Path, io::Error> { static CARGO_HOME: OnceCell = OnceCell::new(); diff --git a/src/helpers/signal.rs b/src/helpers/signal.rs new file mode 100644 index 00000000..ecfe7c4a --- /dev/null +++ b/src/helpers/signal.rs @@ -0,0 +1,80 @@ +use futures_util::future::pending; +use std::io; +use tokio::signal; + +use super::{AutoAbortJoinHandle, BinstallError}; + +/// This function will poll the handle while listening for ctrl_c, +/// `SIGINT`, `SIGHUP`, `SIGTERM` and `SIGQUIT`. +/// +/// When signal is received, [`BinstallError::UserAbort`] will be returned. +/// +/// It would also ignore `SIGUSER1` and `SIGUSER2` on unix. +/// +/// This function uses [`tokio::signal`] and once exit, does not reset the default +/// signal handler, so be careful when using it. +pub async fn cancel_on_user_sig_term( + handle: AutoAbortJoinHandle, +) -> Result { + #[cfg(unix)] + unix::ignore_signals_on_unix()?; + + tokio::select! { + res = handle => res, + res = wait_on_cancellation_signal() => { + res.map_err(BinstallError::Io).and(Err(BinstallError::UserAbort)) + } + } +} + +async fn wait_on_cancellation_signal() -> Result<(), io::Error> { + #[cfg(unix)] + async fn inner() -> Result<(), io::Error> { + unix::wait_on_cancellation_signal_unix().await + } + + #[cfg(not(unix))] + async fn inner() -> Result<(), io::Error> { + // Use pending here so that tokio::select! would just skip this branch. + pending().await + } + + tokio::select! { + res = signal::ctrl_c() => res, + res = inner() => res, + } +} + +#[cfg(unix)] +mod unix { + use super::*; + use signal::unix::{signal, SignalKind}; + + /// Same as [`wait_on_cancellation_signal`] but is only available on unix. + pub async fn wait_on_cancellation_signal_unix() -> Result<(), io::Error> { + tokio::select! { + res = wait_for_signal_unix(SignalKind::interrupt()) => res, + res = wait_for_signal_unix(SignalKind::hangup()) => res, + res = wait_for_signal_unix(SignalKind::terminate()) => res, + res = wait_for_signal_unix(SignalKind::quit()) => res, + } + } + + /// Wait for first arrival of signal. + pub async fn wait_for_signal_unix(kind: signal::unix::SignalKind) -> Result<(), io::Error> { + let mut sig_listener = signal::unix::signal(kind)?; + if sig_listener.recv().await.is_some() { + Ok(()) + } else { + // Use pending() here for the same reason as above. + pending().await + } + } + + pub fn ignore_signals_on_unix() -> Result<(), BinstallError> { + drop(signal(SignalKind::user_defined1())?); + drop(signal(SignalKind::user_defined2())?); + + Ok(()) + } +} From b921e9dfc8fb2300294ba49cd55917e94a339112 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 19:42:47 +1000 Subject: [PATCH 0644/2020] Use `cancel_on_user_sig_term` in `main` to cancel the execution if users requested termination via signal. Signed-off-by: Jiahao XU --- src/main.rs | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/src/main.rs b/src/main.rs index 784f2a86..75e8ab81 100644 --- a/src/main.rs +++ b/src/main.rs @@ -188,23 +188,20 @@ fn main() -> MainExit { let start = Instant::now(); let rt = Runtime::new().unwrap(); - let handle = rt.spawn(entry(jobserver_client)); - let result = rt.block_on(handle); + let handle = AutoAbortJoinHandle::new(rt.spawn(entry(jobserver_client))); + let result = rt.block_on(cancel_on_user_sig_term(handle)); drop(rt); let done = start.elapsed(); debug!("run time: {done:?}"); - result.map_or_else( - |join_err| MainExit::Error(BinstallError::from(join_err)), - |res| { - res.map(|_| MainExit::Success(done)).unwrap_or_else(|err| { - err.downcast::() - .map(MainExit::Error) - .unwrap_or_else(MainExit::Report) - }) - }, - ) + result.map_or_else(MainExit::Error, |res| { + res.map(|()| MainExit::Success(done)).unwrap_or_else(|err| { + err.downcast::() + .map(MainExit::Error) + .unwrap_or_else(MainExit::Report) + }) + }) } async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { From f4dd75ef9be445b70d1567a58eb873983a647c62 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 19:44:12 +1000 Subject: [PATCH 0645/2020] Update doc on `BinstallError::UserAbort` Signed-off-by: Jiahao XU --- src/errors.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/errors.rs b/src/errors.rs index 1fbfa54e..c1d1de22 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -18,7 +18,9 @@ pub enum BinstallError { #[diagnostic(severity(error), code(binstall::internal::task_join))] TaskJoinError(#[from] task::JoinError), - /// The installation was cancelled by a user at a confirmation prompt. + /// The installation was cancelled by a user at a confirmation prompt, + /// or user send a ctrl_c on all platforms or + /// `SIGINT`, `SIGHUP`, `SIGTERM` or `SIGQUIT` on unix to the program. /// /// - Code: `binstall::user_abort` /// - Exit: 32 From cea67b2e54abbb33e83e95493d9cebdf594e28d7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 23:01:26 +1000 Subject: [PATCH 0646/2020] Use `std::thread::spawn` in `UIThreadInner` instead of `tokio::task::spawn_blocking` so that dropping rt would not block the main thread until the ui thread is exit (which might never exit). Signed-off-by: Jiahao XU --- src/helpers/ui_thread.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/helpers/ui_thread.rs b/src/helpers/ui_thread.rs index 8daf945c..8cc42a6e 100644 --- a/src/helpers/ui_thread.rs +++ b/src/helpers/ui_thread.rs @@ -1,7 +1,9 @@ -use std::io::{self, BufRead, Write}; +use std::{ + io::{self, BufRead, Write}, + thread, +}; use tokio::sync::mpsc; -use tokio::task::spawn_blocking; use crate::BinstallError; @@ -19,7 +21,7 @@ impl UIThreadInner { let (request_tx, mut request_rx) = mpsc::channel(1); let (confirm_tx, confirm_rx) = mpsc::channel(10); - spawn_blocking(move || { + thread::spawn(move || { // This task should be the only one able to // access stdin let mut stdin = io::stdin().lock(); From ede134d8516cdcbf0c5dbb40c8a72ddeb6f46c11 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 23:04:04 +1000 Subject: [PATCH 0647/2020] Fix locking of `stdou` in `UIThreadInner` which blocks the printing in main thread and prevents it from exiting. Signed-off-by: Jiahao XU --- src/helpers/ui_thread.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/helpers/ui_thread.rs b/src/helpers/ui_thread.rs index 8cc42a6e..64a20c55 100644 --- a/src/helpers/ui_thread.rs +++ b/src/helpers/ui_thread.rs @@ -32,14 +32,14 @@ impl UIThreadInner { break; } - // Lock stdout so that nobody can interfere - // with confirmation. - let mut stdout = io::stdout().lock(); - let res = loop { - writeln!(&mut stdout, "Do you wish to continue? yes/[no]").unwrap(); - write!(&mut stdout, "? ").unwrap(); - stdout.flush().unwrap(); + { + let mut stdout = io::stdout().lock(); + + writeln!(&mut stdout, "Do you wish to continue? yes/[no]").unwrap(); + write!(&mut stdout, "? ").unwrap(); + stdout.flush().unwrap(); + } input.clear(); stdin.read_line(&mut input).unwrap(); From 62bce2f52f651cb13c0779b9518ba7f525836181 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 23:15:05 +1000 Subject: [PATCH 0648/2020] Improve doc for `Options::log_level` Signed-off-by: Jiahao XU --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index a794c52c..a725e285 100644 --- a/src/main.rs +++ b/src/main.rs @@ -149,6 +149,12 @@ struct Options { /// Utility log level /// /// Set to `debug` when submitting a bug report. + /// Set to `info` to only print useful information. + /// Set to `Warn` to only print on hazardous situations. + /// Set to `Error` to only print serious errors. + /// + /// Set to `off` to disable logging completely, this will also + /// disable output from `cargo-install`. #[clap( help_heading = "Meta", long, From 6685d5a610b75f97cd51aa926ec6b09e92212c62 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 23:16:45 +1000 Subject: [PATCH 0649/2020] Add new option `Options::quiet` Signed-off-by: Jiahao XU --- src/main.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main.rs b/src/main.rs index a725e285..85f5cc4e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -162,6 +162,12 @@ struct Options { value_name = "LEVEL" )] log_level: LevelFilter, + + /// Equivalent to setting `log_level` to `off`. + /// + /// This would override the `log_level`. + #[clap(help_heading = "Meta", long)] + quiet: bool, } enum MainExit { @@ -235,6 +241,9 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { // Load options let mut opts = Options::parse_from(args); + if opts.quiet { + opts.log_level = LevelFilter::Off; + } let crate_names = take(&mut opts.crate_names); if crate_names.len() > 1 { From 3d28549fd6b5f439a0679d53228b29277a9e32cb Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 23:18:00 +1000 Subject: [PATCH 0650/2020] Apply clippy suggestions in `binstall::install` Signed-off-by: Jiahao XU --- src/binstall/install.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/binstall/install.rs b/src/binstall/install.rs index 365dd0de..e4db9eb8 100644 --- a/src/binstall/install.rs +++ b/src/binstall/install.rs @@ -30,8 +30,8 @@ pub async fn install( .await .map(|option| { option.map(|bins| MetaData { - name: name.into(), - version_req: version.into(), + name, + version_req: version, current_version, source: Source::cratesio_registry(), target, From b6a539735db922173459e27c216a5fa7d85d7677 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 23:21:29 +1000 Subject: [PATCH 0651/2020] Pass `-q` to `cargo-install` if `log_level` is set to off Signed-off-by: Jiahao XU --- src/binstall.rs | 1 + src/binstall/install.rs | 16 ++++++++++++---- src/main.rs | 1 + 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/src/binstall.rs b/src/binstall.rs index 12a532f7..43707c0c 100644 --- a/src/binstall.rs +++ b/src/binstall.rs @@ -17,4 +17,5 @@ pub struct Options { pub manifest_path: Option, pub cli_overrides: PkgOverride, pub desired_targets: DesiredTargets, + pub quiet: bool, } diff --git a/src/binstall/install.rs b/src/binstall/install.rs index e4db9eb8..670c81eb 100644 --- a/src/binstall/install.rs +++ b/src/binstall/install.rs @@ -47,7 +47,7 @@ pub async fn install( .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; if !opts.dry_run { - install_from_source(package, target, jobserver_client) + install_from_source(package, target, jobserver_client, opts.quiet) .await .map(|_| None) } else { @@ -126,6 +126,7 @@ async fn install_from_source( package: Package, target: &str, lazy_jobserver_client: LazyJobserverClient, + quiet: bool, ) -> Result<()> { let jobserver_client = lazy_jobserver_client.get().await?; @@ -136,13 +137,20 @@ async fn install_from_source( let mut command = process::Command::new("cargo"); jobserver_client.configure(&mut command); - let mut child = Command::from(command) - .arg("install") + let mut cmd = Command::from(command); + + cmd.arg("install") .arg(package.name) .arg("--version") .arg(package.version) .arg("--target") - .arg(&*target) + .arg(&*target); + + if quiet { + cmd.arg("quiet"); + } + + let mut child = cmd .spawn() .into_diagnostic() .wrap_err("Spawning cargo install failed.")?; diff --git a/src/main.rs b/src/main.rs index 85f5cc4e..35379458 100644 --- a/src/main.rs +++ b/src/main.rs @@ -335,6 +335,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { manifest_path: opts.manifest_path.take(), cli_overrides, desired_targets, + quiet: opts.log_level == LevelFilter::Off, }); let tasks: Vec<_> = if !opts.dry_run && !opts.no_confirm { From 8d5f55537318906e09304a1cd4414bb3222b0aa2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 5 Aug 2022 15:02:38 +1000 Subject: [PATCH 0652/2020] Add new option `-q` for compatibility with `cargo-install` Signed-off-by: Jiahao XU --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 35379458..6e4bace0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -166,7 +166,7 @@ struct Options { /// Equivalent to setting `log_level` to `off`. /// /// This would override the `log_level`. - #[clap(help_heading = "Meta", long)] + #[clap(help_heading = "Meta", short, long)] quiet: bool, } From 7a90d4d6c6e8759b3a31b560067506751ae31b77 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 5 Aug 2022 15:09:40 +1000 Subject: [PATCH 0653/2020] Improve help page for `Options::log_level` Signed-off-by: Jiahao XU --- src/main.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6e4bace0..dea6024e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -8,7 +8,7 @@ use std::{ time::{Duration, Instant}, }; -use clap::{AppSettings, Parser}; +use clap::{builder::PossibleValue, AppSettings, Parser}; use compact_str::CompactString; use log::{debug, error, info, warn, LevelFilter}; use miette::{miette, Result, WrapErr}; @@ -149,9 +149,12 @@ struct Options { /// Utility log level /// /// Set to `debug` when submitting a bug report. + /// /// Set to `info` to only print useful information. - /// Set to `Warn` to only print on hazardous situations. - /// Set to `Error` to only print serious errors. + /// + /// Set to `warn` to only print on hazardous situations. + /// + /// Set to `error` to only print serious errors. /// /// Set to `off` to disable logging completely, this will also /// disable output from `cargo-install`. @@ -159,7 +162,14 @@ struct Options { help_heading = "Meta", long, default_value = "info", - value_name = "LEVEL" + value_name = "LEVEL", + possible_values = [ + PossibleValue::new("debug").help("Set to debug when submitting a bug report."), + PossibleValue::new("info").help("Set to info to only print useful information."), + PossibleValue::new("warn").help("Set to warn to only print on hazardous situations."), + PossibleValue::new("error").help("Set to error to only print serious errors."), + PossibleValue::new("off").help("Set to off to disable logging completely, this will also disable output from `cargo-install`."), + ] )] log_level: LevelFilter, From c352eb00d1f89d4df7826532d1b55b70870d423b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 5 Aug 2022 15:24:39 +1000 Subject: [PATCH 0654/2020] Add missing doc for `trace` for `Options::log_level` Signed-off-by: Jiahao XU --- src/main.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index dea6024e..35a3d9bf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -148,6 +148,9 @@ struct Options { /// Utility log level /// + /// Set to `trace` to print very low priority, often extremely + /// verbose information. + /// /// Set to `debug` when submitting a bug report. /// /// Set to `info` to only print useful information. @@ -164,11 +167,16 @@ struct Options { default_value = "info", value_name = "LEVEL", possible_values = [ + PossibleValue::new("trace").help( + "Set to `trace` to print very low priority, often extremely verbose information." + ), PossibleValue::new("debug").help("Set to debug when submitting a bug report."), PossibleValue::new("info").help("Set to info to only print useful information."), PossibleValue::new("warn").help("Set to warn to only print on hazardous situations."), PossibleValue::new("error").help("Set to error to only print serious errors."), - PossibleValue::new("off").help("Set to off to disable logging completely, this will also disable output from `cargo-install`."), + PossibleValue::new("off").help( + "Set to off to disable logging completely, this will also disable output from `cargo-install`." + ), ] )] log_level: LevelFilter, From 9cb8df1d482cd498131e12c0a0f5c9313e1af1a9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 5 Aug 2022 15:45:46 +1000 Subject: [PATCH 0655/2020] Fix passing `--quiet` to `cargo-install` Signed-off-by: Jiahao XU --- src/binstall/install.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/binstall/install.rs b/src/binstall/install.rs index 670c81eb..455c3961 100644 --- a/src/binstall/install.rs +++ b/src/binstall/install.rs @@ -147,7 +147,7 @@ async fn install_from_source( .arg(&*target); if quiet { - cmd.arg("quiet"); + cmd.arg("--quiet"); } let mut child = cmd From b3f6eb64ea11728a709d029b2d8403998bf53c5d Mon Sep 17 00:00:00 2001 From: ryan kurte Date: Sat, 6 Aug 2022 09:44:17 +1200 Subject: [PATCH 0656/2020] split docs, first step towards simplifying support instructions --- README.md | 173 +++++++---------------------------------------------- SUPPORT.md | 89 +++++++++++++++++++++++++++ 2 files changed, 112 insertions(+), 150 deletions(-) create mode 100644 SUPPORT.md diff --git a/README.md b/README.md index bf580b0e..a071848d 100644 --- a/README.md +++ b/README.md @@ -1,47 +1,39 @@ # Cargo B(inary)Install `cargo binstall` provides a low-complexity mechanism for installing rust binaries as an alternative to building from source (via `cargo install`) or manually downloading packages. This is intended to work with existing CI artifacts and infrastructure, and with minimal overhead for package maintainers. -To support `binstall` maintainers must add configuration values to `Cargo.toml` to allow the tool to locate the appropriate binary package for a given version and target. See [Supporting Binary Installation](#Supporting-Binary-Installation) for instructions on how to support `binstall` in your projects. -## Installing +`binstall` works by fetching the crate information from `crates.io`, then searching the linked `repository` for matching releases and artifacts. +To support `binstall` maintainers must add configuration values to `Cargo.toml` to allow the tool to locate the appropriate binary package for a given version and target. See [SUPPORT.md](./SUPPORT.md) for more detail. -To get started _using_ `cargo-binstall`, first install the binary (either via `cargo install cargo-binstall` or by downloading a pre-compiled [release](https://github.com/ryankurte/cargo-binstall/releases). -linux x86\_64: -``` -wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz -``` +## Status -linux armv7: -``` -wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-armv7-unknown-linux-musleabihf.tgz -``` +![Build](https://github.com/ryankurte/cargo-binstall/workflows/Rust/badge.svg) +[![GitHub tag](https://img.shields.io/github/tag/ryankurte/cargo-binstall.svg)](https://github.com/ryankurte/cargo-binstall) +[![Crates.io](https://img.shields.io/crates/v/cargo-binstall.svg)](https://crates.io/crates/cargo-binstall) +[![Docs.rs](https://docs.rs/cargo-binstall/badge.svg)](https://docs.rs/cargo-binstall) -linux arm64: -``` -wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-unknown-linux-musl.tgz -``` +## Installation -macos x86\_64: -``` -wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-apple-darwin.zip -``` +To get started _using_ `cargo-binstall` first install the binary (either via `cargo install cargo-binstall` or by downloading a pre-compiled [release](https://github.com/ryankurte/cargo-binstall/releases)). + + +| OS | Arch | URL | +| ------- | ------- | ------------------------------------------------------------ | +| linux | x86\_64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz | +| linux | armv7 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz | +| linux | arm64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-unknown-linux-musl.tgz | +| macos | x86\_64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-apple-darwin.zip | +| macos | m1 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-apple-darwin.zip | +| windows | x86\_64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-pc-windows-msvc.zip | -macos M1: -``` -wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-apple-darwin.zip -``` -windows x86\_64: -``` -wget https://github.com/ryankurte/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-pc-windows-msvc.zip -``` ## Usage -Supported packages can be installed using `cargo binstall NAME` where `NAME` is the crate.io package name. +Supported packages can be installed using `cargo binstall NAME` where `NAME` is the crates.io package name. -Package versions and targets may be specified using the `--version` and `--target` arguments respectively, and install directory with `--install-dir` (this defaults to `$HOME/.cargo/bin`, with fall-backs to `$HOME/.bin` if unavailable). For additional options please see `cargo binstall --help`. +Package versions and targets may be specified using the `--version` and `--target` arguments respectively, and will be installed into `$HOME/.cargo/bin` by default. For additional options please see `cargo binstall --help`. ``` [garry] ➜ ~ cargo binstall radio-sx128x --version 0.14.1-alpha.5 @@ -68,125 +60,6 @@ $ binstall \ --pkg-fmt="txz" crate_name ``` -## Status - -![Build](https://github.com/ryankurte/cargo-binstall/workflows/Rust/badge.svg) -[![GitHub tag](https://img.shields.io/github/tag/ryankurte/cargo-binstall.svg)](https://github.com/ryankurte/cargo-binstall) -[![Crates.io](https://img.shields.io/crates/v/cargo-binstall.svg)](https://crates.io/crates/cargo-binstall) -[![Docs.rs](https://docs.rs/cargo-binstall/badge.svg)](https://docs.rs/cargo-binstall) - -### Features - -- Manifest discovery - - [x] Fetch crate / manifest via crates.io - - [ ] Fetch crate / manifest via git (/ github / gitlab) - - [x] Use local crate / manifest (`--manifest-path`) - - [x] Fetch build from the [quickinstall](https://github.com/alsuren/cargo-quickinstall) repository -- Package formats - - [x] Tgz - - [x] Txz - - [x] Tbz2 - - [x] Tar.zst - - [x] Tar - - [x] Zip - - [x] Bin -- Extraction / Transformation - - [x] Extract from subdirectory in archive (ie. support archives with platform or target subdirectories) - - [x] Extract specific files from archive (ie. support single archive with multiple platform binaries) -- Security - - [ ] Package signing - - [ ] Package verification -- [x] Fallback to installing from source - - -## Supporting Binary Installation - -`binstall` works with existing CI-built binary outputs, with configuration via `[package.metadata.binstall]` keys in the relevant crate manifest. -When configuring `binstall` you can test against a local manifest with `--manifest-path=PATH` argument to use the crate and manifest at the provided `PATH`, skipping crate discovery and download. - -To get started, add a `[package.metadata.binstall]` section to your `Cargo.toml`. As an example, the default configuration would be: - -```toml -[package.metadata.binstall] -pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }" -bin-dir = "{ name }-{ target }-v{ version }/{ bin }{ binary-ext }" -pkg-fmt = "tgz" -``` - -With the following configuration keys: - -- `pkg-url` specifies the package download URL for a given target/version, templated -- `bin-dir` specifies the binary path within the package, templated (with an `.exe` suffix on windows) -- `pkg-fmt` overrides the package format for download/extraction (defaults to: `tgz`) - - -`pkg-url` and `bin-dir` are templated to support different names for different versions / architectures / etc. -Template variables use the format `{ VAR }` where `VAR` is the name of the variable, with the following variables available: -- `name` is the name of the crate / package -- `version` is the crate version (per `--version` and the crate manifest) -- `repo` is the repository linked in `Cargo.toml` -- `bin` is the name of a specific binary, inferred from the crate configuration -- `target` is the rust target name (defaults to your architecture, but can be overridden using the `--target` command line option if required() -- `archive-format` is the filename extension of the package archive format -- `binary-ext` is the string `.exe` if the `target` is for Windows, or the empty string otherwise -- `format` is a soft-deprecated alias for `archive-format` in `pkg-url`, and for `binary-ext` in `bin-dir`; in the future this may warn at install time. - -`pkg-url`, `pkg-fmt` and `bin-dir` can be overridden on a per-target basis if required, for example, if your `x86_64-pc-windows-msvc` builds use `zip` archives this could be set via: - -``` -[package.metadata.binstall.overrides.x86_64-pc-windows-msvc] -pkg-fmt = "zip" -``` - -### Defaults - -By default `binstall` is setup to work with github releases, and expects to find: - -- an archive named `{ name }-{ target }-v{ version }.{ archive-format }` - - so that this does not overwrite different targets or versions when manually downloaded -- located at `{ repo }/releases/download/v{ version }/` - - compatible with github tags / releases -- containing a folder named `{ name }-{ target }-v{ version }` - - so that prior binary files are not overwritten when manually executing `tar -xvf ...` -- containing binary files in the form `{ bin }{ binary-ext }` (where `bin` is the cargo binary name and `binary-ext` is `.exe` on windows and empty on other platforms) - -If your package already uses this approach, you shouldn't need to set anything. - -### QuickInstall - -[QuickInstall](https://github.com/alsuren/cargo-quickinstall) is an unofficial repository of prebuilt binaries for Crates, and `binstall` has built-in support for it! If your crate is built by QuickInstall, it will already work with `binstall`. However, binaries as configured above take precedence when they exist. - -### Examples - -For example, the default configuration (as shown above) for a crate called `radio-sx128x` (version: `v0.14.1-alpha.5` on x86\_64 linux) would be interpolated to: - -- A download URL of `https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/rust-radio-sx128x-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz` -- Containing a single binary file `rust-radio-sx128x-x86_64-unknown-linux-gnu-v0.14.1-alpha.5/rust-radio-x86_64-unknown-linux-gnu` -- Installed to`$HOME/.cargo/bin/rust-radio-sx128x-v0.14.1-alpha.5` -- With a symlink from `$HOME/.cargo/bin/rust-radio-sx128x` - -#### If the package name does not match the crate name - -As is common with libraries / utilities (and the `radio-sx128x` example), this can be overridden by specifying the `pkg-url`: - -```toml -[package.metadata.binstall] -pkg-url = "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ archive-format }" -``` - -Which provides a download URL of: `https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz` - - -#### If the package structure differs from the default - -Were the package to contain binaries in the form `name-target[.exe]`, this could be overridden using the `bin-dir` key: - -```toml -[package.metadata.binstall] -bin-dir = "{ bin }-{ target }{ binary-ext }" -``` - -Which provides a binary path of: `sx128x-util-x86_64-unknown-linux-gnu[.exe]`. It is worth noting that binary names are inferred from the crate, so long as cargo builds them this _should_ just work. ## FAQ @@ -197,9 +70,9 @@ Which provides a binary path of: `sx128x-util-x86_64-unknown-linux-gnu[.exe]`. I - Crates already have these, and they already contain a significant portion of the required information. Also there's this great and woefully underused (imo) `[package.metadata]` field. - Is this secure? - - Yes and also no? We're not (yet? #1) doing anything to verify the CI binaries are produced by the right person / organisation. + - Yes and also no? We're not (yet? [#1](https://github.com/cargo-bins/cargo-binstall/issues/1)) doing anything to verify the CI binaries are produced by the right person / organisation. However, we're pulling data from crates.io and the cargo manifest, both of which are _already_ trusted entities, and this is - functionally a replacement for `curl ... | bash` or `wget`-ing the same files, so, things can be improved but it's also sorta moot + functionally a replacement for `curl ... | bash` or `wget`-ing the same files, so, things can be improved but it's also fairly moot - What do the error codes mean? - You can find a full description of errors including exit codes here: diff --git a/SUPPORT.md b/SUPPORT.md new file mode 100644 index 00000000..7c2c871e --- /dev/null +++ b/SUPPORT.md @@ -0,0 +1,89 @@ +# Support for `cargo binstall` + + +`binstall` works with existing CI-built binary outputs, with configuration via `[package.metadata.binstall]` keys in the relevant crate manifest. +When configuring `binstall` you can test against a local manifest with `--manifest-path=PATH` argument to use the crate and manifest at the provided `PATH`, skipping crate discovery and download. + +To get started, add a `[package.metadata.binstall]` section to your `Cargo.toml`. As an example, the default configuration would be: + +```toml +[package.metadata.binstall] +pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }" +bin-dir = "{ name }-{ target }-v{ version }/{ bin }{ binary-ext }" +pkg-fmt = "tgz" +``` + +With the following configuration keys: + +- `pkg-url` specifies the package download URL for a given target/version, templated +- `bin-dir` specifies the binary path within the package, templated (with an `.exe` suffix on windows) +- `pkg-fmt` overrides the package format for download/extraction (defaults to: `tgz`) + + +`pkg-url` and `bin-dir` are templated to support different names for different versions / architectures / etc. +Template variables use the format `{ VAR }` where `VAR` is the name of the variable, with the following variables available: +- `name` is the name of the crate / package +- `version` is the crate version (per `--version` and the crate manifest) +- `repo` is the repository linked in `Cargo.toml` +- `bin` is the name of a specific binary, inferred from the crate configuration +- `target` is the rust target name (defaults to your architecture, but can be overridden using the `--target` command line option if required() +- `archive-format` is the filename extension of the package archive format +- `binary-ext` is the string `.exe` if the `target` is for Windows, or the empty string otherwise +- `format` is a soft-deprecated alias for `archive-format` in `pkg-url`, and for `binary-ext` in `bin-dir`; in the future this may warn at install time. + +`pkg-url`, `pkg-fmt` and `bin-dir` can be overridden on a per-target basis if required, for example, if your `x86_64-pc-windows-msvc` builds use `zip` archives this could be set via: + +``` +[package.metadata.binstall.overrides.x86_64-pc-windows-msvc] +pkg-fmt = "zip" +``` + +### Defaults + +By default `binstall` is setup to work with github releases, and expects to find: + +- an archive named `{ name }-{ target }-v{ version }.{ archive-format }` + - so that this does not overwrite different targets or versions when manually downloaded +- located at `{ repo }/releases/download/v{ version }/` + - compatible with github tags / releases +- containing a folder named `{ name }-{ target }-v{ version }` + - so that prior binary files are not overwritten when manually executing `tar -xvf ...` +- containing binary files in the form `{ bin }{ binary-ext }` (where `bin` is the cargo binary name and `binary-ext` is `.exe` on windows and empty on other platforms) + +If your package already uses this approach, you shouldn't need to set anything. + +### QuickInstall + +[QuickInstall](https://github.com/alsuren/cargo-quickinstall) is an unofficial repository of prebuilt binaries for Crates, and `binstall` has built-in support for it! If your crate is built by QuickInstall, it will already work with `binstall`. However, binaries as configured above take precedence when they exist. + +### Examples + +For example, the default configuration (as shown above) for a crate called `radio-sx128x` (version: `v0.14.1-alpha.5` on x86\_64 linux) would be interpolated to: + +- A download URL of `https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/rust-radio-sx128x-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz` +- Containing a single binary file `rust-radio-sx128x-x86_64-unknown-linux-gnu-v0.14.1-alpha.5/rust-radio-x86_64-unknown-linux-gnu` +- Installed to`$HOME/.cargo/bin/rust-radio-sx128x-v0.14.1-alpha.5` +- With a symlink from `$HOME/.cargo/bin/rust-radio-sx128x` + +#### If the package name does not match the crate name + +As is common with libraries / utilities (and the `radio-sx128x` example), this can be overridden by specifying the `pkg-url`: + +```toml +[package.metadata.binstall] +pkg-url = "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ archive-format }" +``` + +Which provides a download URL of: `https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz` + + +#### If the package structure differs from the default + +Were the package to contain binaries in the form `name-target[.exe]`, this could be overridden using the `bin-dir` key: + +```toml +[package.metadata.binstall] +bin-dir = "{ bin }-{ target }{ binary-ext }" +``` + +Which provides a binary path of: `sx128x-util-x86_64-unknown-linux-gnu[.exe]`. It is worth noting that binary names are inferred from the crate, so long as cargo builds them this _should_ just work. From 68d3ab56f75d9bcfad895701962d7e30e1a10c5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 6 Aug 2022 22:07:24 +1200 Subject: [PATCH 0657/2020] Enable sparse registry in CI (#285) --- .github/workflows/build.yml | 1 + .github/workflows/unit-tests.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 93a7af04..e8c2eb4d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,6 +19,7 @@ on: env: CARGO_TERM_COLOR: always + CARGO_UNSTABLE_SPARSE_REGISTRY: "true" jobs: build: diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 1b86a22a..73950629 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -8,6 +8,7 @@ on: env: CARGO_TERM_COLOR: always + CARGO_UNSTABLE_SPARSE_REGISTRY: "true" jobs: test: From 5c703f30ca5912c6d753700eb3e56f04d58d4fbb Mon Sep 17 00:00:00 2001 From: ryan kurte Date: Mon, 8 Aug 2022 11:42:06 +1200 Subject: [PATCH 0658/2020] add note about quickinstall / cargo install fallback --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a071848d..e0378c81 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ `cargo binstall` provides a low-complexity mechanism for installing rust binaries as an alternative to building from source (via `cargo install`) or manually downloading packages. This is intended to work with existing CI artifacts and infrastructure, and with minimal overhead for package maintainers. -`binstall` works by fetching the crate information from `crates.io`, then searching the linked `repository` for matching releases and artifacts. +`binstall` works by fetching the crate information from `crates.io`, then searching the linked `repository` for matching releases and artifacts, with fallbacks to [quickinstall](https://github.com/alsuren/cargo-quickinstall) and finally `cargo install` if these are not found. To support `binstall` maintainers must add configuration values to `Cargo.toml` to allow the tool to locate the appropriate binary package for a given version and target. See [SUPPORT.md](./SUPPORT.md) for more detail. From 03291c895a18361bd1a8562892adabd4a5a95fa4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 01:44:44 +0000 Subject: [PATCH 0659/2020] Bump strum_macros from 0.24.2 to 0.24.3 Bumps [strum_macros](https://github.com/Peternator7/strum) from 0.24.2 to 0.24.3. - [Release notes](https://github.com/Peternator7/strum/releases) - [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md) - [Commits](https://github.com/Peternator7/strum/commits) --- updated-dependencies: - dependency-name: strum_macros dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1faf6fbd..c9f9e6fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1499,9 +1499,9 @@ checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" [[package]] name = "strum_macros" -version = "0.24.2" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4faebde00e8ff94316c01800f9054fd2ba77d30d9e922541913051d1d978918b" +checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" dependencies = [ "heck", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index a72083c4..9a8d079c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ serde-tuple-vec-map = "1.0.1" serde_json = "1.0.83" simplelog = "0.12.0" strum = "0.24.1" -strum_macros = "0.24.2" +strum_macros = "0.24.3" tar = "0.4.38" tempfile = "3.3.0" thiserror = "1.0.32" From 5b35beb68b3d5eb69ed30c3d21d0b257ef509004 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 01:44:57 +0000 Subject: [PATCH 0660/2020] Bump semver from 1.0.12 to 1.0.13 Bumps [semver](https://github.com/dtolnay/semver) from 1.0.12 to 1.0.13. - [Release notes](https://github.com/dtolnay/semver/releases) - [Commits](https://github.com/dtolnay/semver/compare/1.0.12...1.0.13) --- updated-dependencies: - dependency-name: semver dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1faf6fbd..97a92371 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1375,9 +1375,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2333e6df6d6598f2b1974829f853c2b4c5f4a6e503c10af918081aa6f8564e1" +checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" dependencies = [ "serde", ] diff --git a/Cargo.toml b/Cargo.toml index a72083c4..460f5d16 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -39,7 +39,7 @@ mimalloc = { version = "0.1.29", default-features = false, optional = true } once_cell = "1.13.0" reqwest = { version = "0.11.11", features = ["stream"], default-features = false } scopeguard = "1.1.0" -semver = { version = "1.0.12", features = ["serde"] } +semver = { version = "1.0.13", features = ["serde"] } serde = { version = "1.0.142", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.83" From 04fee49c225f44bd8346f14519331d99fc05ed82 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 4 Aug 2022 23:45:53 +1000 Subject: [PATCH 0661/2020] Add new option `Options::force` Signed-off-by: Jiahao XU --- src/main.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main.rs b/src/main.rs index 8d74a90a..5d21889e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -131,6 +131,10 @@ struct Options { #[clap(help_heading = "Options", long)] secure: bool, + /// Force a crate to be installed even if it is already installed. + #[clap(help_heading = "Options", long)] + force: bool, + /// Require a minimum TLS version from remote endpoints. /// /// The default is not to require any minimum TLS version, and use the negotiated highest From ac085533cc510dd746b22d1a3c657807f79f55c6 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 5 Aug 2022 00:06:36 +1000 Subject: [PATCH 0662/2020] Skip crates that are already installed. Signed-off-by: Jiahao XU --- src/main.rs | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 5d21889e..9d25c06e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -333,6 +333,25 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { fs::create_dir_all(&install_path).map_err(BinstallError::Io)?; debug!("Using install path: {}", install_path.display()); + // Load metadata + let metadata = if !custom_install_path { + debug!("Reading binstall/crates-v1.json"); + Some(metafiles::binstall_v1::Records::load()?) + } else { + None + }; + + // Filter out installed crate_names + let crate_names = crate_names.filter(|crate_name| { + if opts.force { + true + } else if let Some(records) = &metadata { + !records.contains(&crate_name.name) + } else { + true + } + }); + // Create a temporary directory for downloads etc. // // Put all binaries to a temporary directory under `dst` first, catching @@ -429,7 +448,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { } block_in_place(|| { - if !custom_install_path { + if let Some(mut records) = metadata { // If using standardised install path, // then create_dir_all(&install_path) would also // create .cargo. @@ -438,7 +457,10 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { metafiles::v1::CratesToml::append(metadata_vec.iter())?; debug!("Writing binstall/crates-v1.json"); - metafiles::binstall_v1::append(metadata_vec)?; + for metadata in metadata_vec { + records.replace(metadata); + } + records.overwrite()?; } if opts.no_cleanup { From 6716d75607914e7b6105cf9d1c7c3b7d6790b532 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 5 Aug 2022 00:09:40 +1000 Subject: [PATCH 0663/2020] Minor Refactor: Gather code related to `crate_names` Signed-off-by: Jiahao XU --- src/main.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9d25c06e..5ff11c5f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -285,9 +285,6 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { } } - // Remove duplicate crate_name, keep the last one - let crate_names = CrateName::dedup(crate_names); - let cli_overrides = PkgOverride { pkg_url: opts.pkg_url.take(), pkg_fmt: opts.pkg_fmt.take(), @@ -341,8 +338,8 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { None }; - // Filter out installed crate_names - let crate_names = crate_names.filter(|crate_name| { + // Remove installed crates + let crate_names = CrateName::dedup(crate_names).filter(|crate_name| { if opts.force { true } else if let Some(records) = &metadata { From 4dae214af302d5b0ca39ad910e07b78d6fdff350 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 5 Aug 2022 00:11:59 +1000 Subject: [PATCH 0664/2020] Use `block_in_place` for loading metadata Signed-off-by: Jiahao XU --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 5ff11c5f..cb7bc8de 100644 --- a/src/main.rs +++ b/src/main.rs @@ -333,7 +333,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { // Load metadata let metadata = if !custom_install_path { debug!("Reading binstall/crates-v1.json"); - Some(metafiles::binstall_v1::Records::load()?) + Some(block_in_place(metafiles::binstall_v1::Records::load)?) } else { None }; From b4c6db7cda8fa2b723092ccb26a0a95963ec86e6 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 5 Aug 2022 00:13:35 +1000 Subject: [PATCH 0665/2020] Refactor & Optimize: Launch target detection as soon as possible Signed-off-by: Jiahao XU --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index cb7bc8de..e8cb2191 100644 --- a/src/main.rs +++ b/src/main.rs @@ -291,6 +291,9 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { bin_dir: opts.bin_dir.take(), }; + // Launch target detection + let desired_targets = get_desired_targets(&opts.targets); + // Initialize reqwest client let client = create_reqwest_client(opts.secure, opts.min_tls_version.map(|v| v.into()))?; @@ -318,9 +321,6 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { // Initialize UI thread let mut uithread = UIThread::new(!opts.no_confirm); - // Launch target detection - let desired_targets = get_desired_targets(&opts.targets); - // Compute install directory let (install_path, custom_install_path) = get_install_path(opts.install_path.as_deref()); let install_path = install_path.ok_or_else(|| { From b8c44839c1d470270dc7c983a153a700c97bbc86 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 5 Aug 2022 00:18:21 +1000 Subject: [PATCH 0666/2020] Detect install_path & load metadata in `block_in_place` since they involves blocking fs io. Signed-off-by: Jiahao XU --- src/main.rs | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/main.rs b/src/main.rs index e8cb2191..bf7f4955 100644 --- a/src/main.rs +++ b/src/main.rs @@ -322,21 +322,25 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { let mut uithread = UIThread::new(!opts.no_confirm); // Compute install directory - let (install_path, custom_install_path) = get_install_path(opts.install_path.as_deref()); - let install_path = install_path.ok_or_else(|| { - error!("No viable install path found of specified, try `--install-path`"); - miette!("No install path found or specified") - })?; - fs::create_dir_all(&install_path).map_err(BinstallError::Io)?; - debug!("Using install path: {}", install_path.display()); + let (install_path, metadata) = block_in_place(|| -> Result<_> { + let (install_path, custom_install_path) = get_install_path(opts.install_path.as_deref()); + let install_path = install_path.ok_or_else(|| { + error!("No viable install path found of specified, try `--install-path`"); + miette!("No install path found or specified") + })?; + fs::create_dir_all(&install_path).map_err(BinstallError::Io)?; + debug!("Using install path: {}", install_path.display()); - // Load metadata - let metadata = if !custom_install_path { - debug!("Reading binstall/crates-v1.json"); - Some(block_in_place(metafiles::binstall_v1::Records::load)?) - } else { - None - }; + // Load metadata + let metadata = if !custom_install_path { + debug!("Reading binstall/crates-v1.json"); + Some(metafiles::binstall_v1::Records::load()?) + } else { + None + }; + + Ok((install_path, metadata)) + })?; // Remove installed crates let crate_names = CrateName::dedup(crate_names).filter(|crate_name| { From 4b79abeedc4b5a473fbec6256ba9b84b0e7d5e6f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 5 Aug 2022 00:26:17 +1000 Subject: [PATCH 0667/2020] Refactor: Run `TempDir` creation in `block_in_place` Since it could also issues blocking operations. Signed-off-by: Jiahao XU --- src/main.rs | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/main.rs b/src/main.rs index bf7f4955..750a438d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -321,8 +321,8 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { // Initialize UI thread let mut uithread = UIThread::new(!opts.no_confirm); - // Compute install directory - let (install_path, metadata) = block_in_place(|| -> Result<_> { + let (install_path, metadata, temp_dir) = block_in_place(|| -> Result<_> { + // Compute install directory let (install_path, custom_install_path) = get_install_path(opts.install_path.as_deref()); let install_path = install_path.ok_or_else(|| { error!("No viable install path found of specified, try `--install-path`"); @@ -339,7 +339,18 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { None }; - Ok((install_path, metadata)) + // Create a temporary directory for downloads etc. + // + // Put all binaries to a temporary directory under `dst` first, catching + // some failure modes (e.g., out of space) before touching the existing + // binaries. This directory will get cleaned up via RAII. + let temp_dir = tempfile::Builder::new() + .prefix("cargo-binstall") + .tempdir_in(&install_path) + .map_err(BinstallError::from) + .wrap_err("Creating a temporary directory failed.")?; + + Ok((install_path, metadata, temp_dir)) })?; // Remove installed crates @@ -353,17 +364,6 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { } }); - // Create a temporary directory for downloads etc. - // - // Put all binaries to a temporary directory under `dst` first, catching - // some failure modes (e.g., out of space) before touching the existing - // binaries. This directory will get cleaned up via RAII. - let temp_dir = tempfile::Builder::new() - .prefix("cargo-binstall") - .tempdir_in(&install_path) - .map_err(BinstallError::from) - .wrap_err("Creating a temporary directory failed.")?; - let temp_dir_path: Arc = Arc::from(temp_dir.path()); // Create binstall_opts From 34f714c64f7ca4ae839c210760028154667bd5ee Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 5 Aug 2022 15:42:48 +1000 Subject: [PATCH 0668/2020] Pass `--force` to `cargo-install` Signed-off-by: Jiahao XU --- src/binstall.rs | 1 + src/binstall/install.rs | 7 ++++++- src/main.rs | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/binstall.rs b/src/binstall.rs index 43707c0c..73c474c3 100644 --- a/src/binstall.rs +++ b/src/binstall.rs @@ -13,6 +13,7 @@ pub use install::*; pub struct Options { pub no_symlinks: bool, pub dry_run: bool, + pub force: bool, pub version: Option, pub manifest_path: Option, pub cli_overrides: PkgOverride, diff --git a/src/binstall/install.rs b/src/binstall/install.rs index 455c3961..21015333 100644 --- a/src/binstall/install.rs +++ b/src/binstall/install.rs @@ -47,7 +47,7 @@ pub async fn install( .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; if !opts.dry_run { - install_from_source(package, target, jobserver_client, opts.quiet) + install_from_source(package, target, jobserver_client, opts.quiet, opts.force) .await .map(|_| None) } else { @@ -127,6 +127,7 @@ async fn install_from_source( target: &str, lazy_jobserver_client: LazyJobserverClient, quiet: bool, + force: bool, ) -> Result<()> { let jobserver_client = lazy_jobserver_client.get().await?; @@ -150,6 +151,10 @@ async fn install_from_source( cmd.arg("--quiet"); } + if force { + cmd.arg("--force"); + } + let mut child = cmd .spawn() .into_diagnostic() diff --git a/src/main.rs b/src/main.rs index 750a438d..da87fc49 100644 --- a/src/main.rs +++ b/src/main.rs @@ -370,6 +370,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { let binstall_opts = Arc::new(binstall::Options { no_symlinks: opts.no_symlinks, dry_run: opts.dry_run, + force: opts.force, version: opts.version_req.take(), manifest_path: opts.manifest_path.take(), cli_overrides, From 20c7b61e7a302d51c08429e6e46a3ac31b649048 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 5 Aug 2022 20:30:03 +1000 Subject: [PATCH 0669/2020] FIx `ci-scripts/tests.sh`: Use `--force` to force installation. Signed-off-by: Jiahao XU --- ci-scripts/tests.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci-scripts/tests.sh b/ci-scripts/tests.sh index 8bb7bd3c..41d10b59 100755 --- a/ci-scripts/tests.sh +++ b/ci-scripts/tests.sh @@ -19,7 +19,7 @@ done cargo binstall --help >/dev/null # Install binaries using `--manifest-path` -"./$1" binstall --log-level debug --manifest-path . --no-confirm cargo-binstall +"./$1" binstall --force --log-level debug --manifest-path . --no-confirm cargo-binstall # Test that the installed binaries can be run cargo binstall --help >/dev/null @@ -28,6 +28,7 @@ min_tls=1.3 [[ "${2:-}" == "Windows" ]] && min_tls=1.2 # WinTLS on GHA doesn't support 1.3 yet "./$1" binstall \ + --force \ --log-level debug \ --secure \ --min-tls-version $min_tls \ From 51d6b3039b37cf47346e096bd6a892a4e07927a5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 7 Aug 2022 18:37:45 +1000 Subject: [PATCH 0670/2020] Impl new fn `helpers::parse_version` Signed-off-by: Jiahao XU --- src/helpers.rs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/helpers.rs b/src/helpers.rs index 2e010244..b311f75d 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -8,6 +8,7 @@ use std::sync::Arc; use bytes::Bytes; use cargo_toml::Manifest; +use compact_str::format_compact; use futures_util::stream::Stream; use log::debug; use once_cell::sync::{Lazy, OnceCell}; @@ -86,6 +87,20 @@ pub async fn await_task(task: tokio::task::JoinHandle>) -> } } +pub fn parse_version(version: &str) -> Result { + // Treat 0.1.2 as =0.1.2 + if version + .chars() + .next() + .map(|ch| ch.is_ascii_digit()) + .unwrap_or(false) + { + format_compact!("={version}").parse() + } else { + version.parse() + } +} + /// Load binstall metadata from the crate `Cargo.toml` at the provided path pub fn load_manifest_path>( manifest_path: P, From dd8e6a400d8b33f467d2176d133d49a3d3b27abc Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 7 Aug 2022 18:40:24 +1000 Subject: [PATCH 0671/2020] Rename `CrateName::version` to `version_req` and change its type to `Option` Signed-off-by: Jiahao XU --- src/helpers/crate_name.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/helpers/crate_name.rs b/src/helpers/crate_name.rs index 0f9ec2f4..500f5614 100644 --- a/src/helpers/crate_name.rs +++ b/src/helpers/crate_name.rs @@ -1,19 +1,22 @@ -use std::{convert::Infallible, fmt, str::FromStr}; +use std::{fmt, str::FromStr}; use compact_str::CompactString; use itertools::Itertools; +use semver::{Error, VersionReq}; + +use super::parse_version; #[derive(Debug, Clone, Eq, PartialEq)] pub struct CrateName { pub name: CompactString, - pub version: Option, + pub version_req: Option, } impl fmt::Display for CrateName { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{}", self.name)?; - if let Some(version) = &self.version { + if let Some(version) = &self.version_req { write!(f, "@{version}")?; } @@ -22,18 +25,18 @@ impl fmt::Display for CrateName { } impl FromStr for CrateName { - type Err = Infallible; + type Err = Error; fn from_str(s: &str) -> Result { Ok(if let Some((name, version)) = s.split_once('@') { CrateName { name: name.into(), - version: Some(version.into()), + version_req: Some(parse_version(version)?), } } else { CrateName { name: s.into(), - version: None, + version_req: None, } }) } @@ -60,11 +63,11 @@ mod tests { ([ $( ( $input_name:expr, $input_version:expr ) ),* ], [ $( ( $output_name:expr, $output_version:expr ) ),* ]) => { let input_crate_names = vec![$( CrateName { name: $input_name.into(), - version: Some($input_version.into()) + version_req: Some($input_version.parse().unwrap()) }, )*]; let mut output_crate_names: Vec = vec![$( CrateName { - name: $output_name.into(), version: Some($output_version.into()) + name: $output_name.into(), version_req: Some($output_version.parse().unwrap()) }, )*]; output_crate_names.sort_by(|x, y| x.name.cmp(&y.name)); From 497ef80b27eba895f8701845fdfa319841be61dd Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 7 Aug 2022 18:40:59 +1000 Subject: [PATCH 0672/2020] Take `&VersionReq` for 1st param of `find_version` instead of `&str` Signed-off-by: Jiahao XU --- src/drivers/version.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/drivers/version.rs b/src/drivers/version.rs index 35e11299..abddbc61 100644 --- a/src/drivers/version.rs +++ b/src/drivers/version.rs @@ -28,15 +28,9 @@ impl Version for crates_io_api::Version { } pub(super) fn find_version>( - requirement: &str, + version_req: &VersionReq, version_iter: VersionIter, ) -> Result<(Item, semver::Version), BinstallError> { - // Parse version requirement - let version_req = VersionReq::parse(requirement).map_err(|err| BinstallError::VersionReq { - req: requirement.into(), - err, - })?; - version_iter // Filter for matching versions .filter_map(|item| { @@ -52,5 +46,7 @@ pub(super) fn find_version>( }) // Return highest version .max_by_key(|(_item, ver)| ver.clone()) - .ok_or(BinstallError::VersionMismatch { req: version_req }) + .ok_or(BinstallError::VersionMismatch { + req: version_req.clone(), + }) } From 686cae6ae835567588e96c0cba9a1200b8aed225 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 7 Aug 2022 18:41:23 +1000 Subject: [PATCH 0673/2020] Use `&VersionReq` for param `version_req` of `fetch_crate_cratesio` Signed-off-by: Jiahao XU --- src/drivers/crates_io.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/drivers/crates_io.rs b/src/drivers/crates_io.rs index 5d297d40..7dda6fa6 100644 --- a/src/drivers/crates_io.rs +++ b/src/drivers/crates_io.rs @@ -4,6 +4,7 @@ use cargo_toml::Manifest; use crates_io_api::AsyncClient; use log::debug; use reqwest::Client; +use semver::VersionReq; use url::Url; use super::find_version; @@ -19,7 +20,7 @@ pub async fn fetch_crate_cratesio( client: &Client, crates_io_api_client: &AsyncClient, name: &str, - version_req: &str, + version_req: &VersionReq, ) -> Result, BinstallError> { // Fetch / update index debug!("Looking up crate information"); From 065f62a6255c6119c01eed8de63e000c9e9a94f1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 7 Aug 2022 18:42:59 +1000 Subject: [PATCH 0674/2020] Use `VersionReq` for `Options::version_req` and update usage of `CrateName` in `binstall::install` Signed-off-by: Jiahao XU --- src/binstall.rs | 4 ++-- src/binstall/install.rs | 4 ++-- src/binstall/resolve.rs | 29 +++++++++++++---------------- src/main.rs | 8 ++++---- 4 files changed, 21 insertions(+), 24 deletions(-) diff --git a/src/binstall.rs b/src/binstall.rs index 73c474c3..20b582b7 100644 --- a/src/binstall.rs +++ b/src/binstall.rs @@ -1,6 +1,6 @@ use std::path::PathBuf; -use compact_str::CompactString; +use semver::VersionReq; use crate::{metafiles::binstall_v1::MetaData, DesiredTargets, PkgOverride}; @@ -14,7 +14,7 @@ pub struct Options { pub no_symlinks: bool, pub dry_run: bool, pub force: bool, - pub version: Option, + pub version_req: Option, pub manifest_path: Option, pub cli_overrides: PkgOverride, pub desired_targets: DesiredTargets, diff --git a/src/binstall/install.rs b/src/binstall/install.rs index 21015333..0bf5c0e7 100644 --- a/src/binstall/install.rs +++ b/src/binstall/install.rs @@ -19,7 +19,7 @@ pub async fn install( fetcher, package, name, - version, + version_req, bin_path, bin_files, } => { @@ -31,7 +31,7 @@ pub async fn install( .map(|option| { option.map(|bins| MetaData { name, - version_req: version, + version_req, current_version, source: Source::cratesio_registry(), target, diff --git a/src/binstall/resolve.rs b/src/binstall/resolve.rs index 6290deef..d17747b4 100644 --- a/src/binstall/resolve.rs +++ b/src/binstall/resolve.rs @@ -4,10 +4,11 @@ use std::{ }; use cargo_toml::{Package, Product}; -use compact_str::{format_compact, CompactString}; +use compact_str::{CompactString, ToCompactString}; use log::{debug, error, info, warn}; use miette::{miette, Result}; use reqwest::Client; +use semver::VersionReq; use super::Options; use crate::{ @@ -21,7 +22,7 @@ pub enum Resolution { fetcher: Arc, package: Package, name: CompactString, - version: CompactString, + version_req: CompactString, bin_path: PathBuf, bin_files: Vec, }, @@ -83,30 +84,26 @@ pub async fn resolve( ) -> Result { info!("Installing package: '{}'", crate_name); - let mut version: CompactString = match (&crate_name.version, &opts.version) { + let version_req: VersionReq = match (&crate_name.version_req, &opts.version_req) { (Some(version), None) => version.clone(), (None, Some(version)) => version.clone(), (Some(_), Some(_)) => Err(BinstallError::SuperfluousVersionOption)?, - (None, None) => "*".into(), + (None, None) => VersionReq::STAR, }; - // Treat 0.1.2 as =0.1.2 - if version - .chars() - .next() - .map(|ch| ch.is_ascii_digit()) - .unwrap_or(false) - { - version = format_compact!("={version}"); - } - // Fetch crate via crates.io, git, or use a local manifest path // TODO: work out which of these to do based on `opts.name` // TODO: support git-based fetches (whole repo name rather than just crate name) let manifest = match opts.manifest_path.clone() { Some(manifest_path) => load_manifest_path(manifest_path)?, None => { - fetch_crate_cratesio(&client, &crates_io_api_client, &crate_name.name, &version).await? + fetch_crate_cratesio( + &client, + &crates_io_api_client, + &crate_name.name, + &version_req, + ) + .await? } }; @@ -175,7 +172,7 @@ pub async fn resolve( fetcher, package, name: crate_name.name, - version, + version_req: version_req.to_compact_string(), bin_path, bin_files, } diff --git a/src/main.rs b/src/main.rs index da87fc49..2aa7e58f 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,9 +9,9 @@ use std::{ }; use clap::{builder::PossibleValue, AppSettings, Parser}; -use compact_str::CompactString; use log::{debug, error, info, warn, LevelFilter}; use miette::{miette, Result, WrapErr}; +use semver::VersionReq; use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; use tokio::{runtime::Runtime, task::block_in_place}; @@ -46,8 +46,8 @@ struct Options { /// /// Cannot be used when multiple packages are installed at once, use the attached version /// syntax in that case. - #[clap(help_heading = "Package selection", long = "version")] - version_req: Option, + #[clap(help_heading = "Package selection", long = "version", parse(try_from_str = parse_version))] + version_req: Option, /// Override binary target set. /// @@ -371,7 +371,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { no_symlinks: opts.no_symlinks, dry_run: opts.dry_run, force: opts.force, - version: opts.version_req.take(), + version_req: opts.version_req.take(), manifest_path: opts.manifest_path.take(), cli_overrides, desired_targets, From 431992dab0760034502db105da85ca34e0356290 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 7 Aug 2022 18:45:53 +1000 Subject: [PATCH 0675/2020] Test `--version` and `$crate_name@$version` in `tests.sh` Signed-off-by: Jiahao XU --- ci-scripts/tests.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ci-scripts/tests.sh b/ci-scripts/tests.sh index 41d10b59..64ed0f9a 100755 --- a/ci-scripts/tests.sh +++ b/ci-scripts/tests.sh @@ -36,3 +36,13 @@ min_tls=1.3 cargo-binstall # Test that the installed binaries can be run cargo binstall --help >/dev/null + +# Test --version +"./$1" binstall --force --log-level debug --no-confirm --version 0.11.1 cargo-binstall +# Test that the installed binaries can be run +cargo binstall --help >/dev/null + +# Test "$crate_name@$version" +"./$1" binstall --force --log-level debug --no-confirm cargo-binstall@0.11.1 +# Test that the installed binaries can be run +cargo binstall --help >/dev/null From 2c2b3c070f9f37737c00342c2ee14fc07cef928f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 7 Aug 2022 19:11:25 +1000 Subject: [PATCH 0676/2020] Skip only if `version_req` is satisfied Signed-off-by: Jiahao XU --- src/main.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 2aa7e58f..ae340ce2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -358,7 +358,14 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { if opts.force { true } else if let Some(records) = &metadata { - !records.contains(&crate_name.name) + if let Some(version_req) = &crate_name.version_req { + records + .get(&crate_name.name) + .map(|metadata| !version_req.matches(&metadata.current_version)) + .unwrap_or(true) + } else { + !records.contains(&crate_name.name) + } } else { true } From 7f4edfd9f24fd43ee65776b1aa4ba27f4cb0429b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 7 Aug 2022 19:15:13 +1000 Subject: [PATCH 0677/2020] `log::info!` if a crate is skipped due to already installed Signed-off-by: Jiahao XU --- src/main.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index ae340ce2..ecc92f04 100644 --- a/src/main.rs +++ b/src/main.rs @@ -358,14 +358,20 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { if opts.force { true } else if let Some(records) = &metadata { - if let Some(version_req) = &crate_name.version_req { + let keep = if let Some(version_req) = &crate_name.version_req { records .get(&crate_name.name) .map(|metadata| !version_req.matches(&metadata.current_version)) .unwrap_or(true) } else { !records.contains(&crate_name.name) + }; + + if !keep { + info!("package {crate_name} is already installed, use --force to override") } + + keep } else { true } From 4a174602525de3c5fcd8b5f116f676fb09de9e21 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 7 Aug 2022 19:17:52 +1000 Subject: [PATCH 0678/2020] Test skip when installed in `ci-scripts/tests.sh` Signed-off-by: Jiahao XU --- ci-scripts/tests.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ci-scripts/tests.sh b/ci-scripts/tests.sh index 64ed0f9a..d72c548c 100755 --- a/ci-scripts/tests.sh +++ b/ci-scripts/tests.sh @@ -46,3 +46,9 @@ cargo binstall --help >/dev/null "./$1" binstall --force --log-level debug --no-confirm cargo-binstall@0.11.1 # Test that the installed binaries can be run cargo binstall --help >/dev/null + +# Test skip when installed +"./$1" binstall --no-confirm cargo-binstall | grep -q 'package cargo-binstall is already installed' +"./$1" binstall --no-confirm cargo-binstall@0.11.1 | grep -q 'package cargo-binstall is already installed' + +"./$1" binstall --no-confirm cargo-binstall@0.10.0 | grep -q -v 'package cargo-binstall is already installed' From d932f1c262999f698346fd3f68046a1329a0b9dd Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 7 Aug 2022 19:27:30 +1000 Subject: [PATCH 0679/2020] Fix testing skip if installed in `ci-scripts/tests.sh` Signed-off-by: Jiahao XU --- ci-scripts/tests.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci-scripts/tests.sh b/ci-scripts/tests.sh index d72c548c..a9c478b6 100755 --- a/ci-scripts/tests.sh +++ b/ci-scripts/tests.sh @@ -49,6 +49,6 @@ cargo binstall --help >/dev/null # Test skip when installed "./$1" binstall --no-confirm cargo-binstall | grep -q 'package cargo-binstall is already installed' -"./$1" binstall --no-confirm cargo-binstall@0.11.1 | grep -q 'package cargo-binstall is already installed' +"./$1" binstall --no-confirm cargo-binstall@0.11.1 | grep -q 'package cargo-binstall@=0.11.1 is already installed' -"./$1" binstall --no-confirm cargo-binstall@0.10.0 | grep -q -v 'package cargo-binstall is already installed' +"./$1" binstall --no-confirm cargo-binstall@0.10.0 | grep -q -v 'package cargo-binstall@=0.10.0 is already installed' From b94dc979acc5585bb886cdadd7c7adabf08b5cbe Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 8 Aug 2022 17:59:39 +1000 Subject: [PATCH 0680/2020] Add new trait `VersionReqExt` and impl it for `VersionReq` Signed-off-by: Jiahao XU --- src/helpers.rs | 3 ++ src/helpers/version.rs | 78 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 src/helpers/version.rs diff --git a/src/helpers.rs b/src/helpers.rs index b311f75d..b1b67ddf 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -51,6 +51,9 @@ pub use flock::FileLock; mod signal; pub use signal::cancel_on_user_sig_term; +mod version; +pub use version::VersionReqExt; + pub fn cargo_home() -> Result<&'static Path, io::Error> { static CARGO_HOME: OnceCell = OnceCell::new(); diff --git a/src/helpers/version.rs b/src/helpers/version.rs new file mode 100644 index 00000000..f994dc93 --- /dev/null +++ b/src/helpers/version.rs @@ -0,0 +1,78 @@ +use compact_str::format_compact; +use semver::{Prerelease, Version, VersionReq}; + +/// Extension trait for [`VersionReq`]. +pub trait VersionReqExt { + /// Return `true` if `self.matches(version)` returns `true` + /// and the `version` is the latest one acceptable by `self`. + fn is_latest_compatible(&self, version: &Version) -> bool; +} + +impl VersionReqExt for VersionReq { + fn is_latest_compatible(&self, version: &Version) -> bool { + if !self.matches(version) { + return false; + } + + // Test if bumping patch will be accepted + let bumped_version = Version::new(version.major, version.minor, version.patch + 1); + + if self.matches(&bumped_version) { + return false; + } + + // Test if bumping prerelease will be accepted if version has one. + let pre = &version.pre; + if !pre.is_empty() { + // Bump pre by appending random number to the end. + let bumped_pre = format_compact!("{}.1", pre.as_str()); + + let bumped_version = Version { + major: version.major, + minor: version.minor, + patch: version.patch, + pre: Prerelease::new(&bumped_pre).unwrap(), + build: Default::default(), + }; + + if self.matches(&bumped_version) { + return false; + } + } + + true + } +} + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test() { + // Test star + assert!(!VersionReq::STAR.is_latest_compatible(&Version::parse("0.0.1").unwrap())); + assert!(!VersionReq::STAR.is_latest_compatible(&Version::parse("0.1.1").unwrap())); + assert!(!VersionReq::STAR.is_latest_compatible(&Version::parse("0.1.1-alpha").unwrap())); + + // Test ^x.y.z + assert!(!VersionReq::parse("^0.1") + .unwrap() + .is_latest_compatible(&Version::parse("0.1.99").unwrap())); + + // Test =x.y.z + assert!(VersionReq::parse("=0.1.0") + .unwrap() + .is_latest_compatible(&Version::parse("0.1.0").unwrap())); + + // Test =x.y.z-alpha + assert!(VersionReq::parse("=0.1.0-alpha") + .unwrap() + .is_latest_compatible(&Version::parse("0.1.0-alpha").unwrap())); + + // Test >=x.y.z-alpha + assert!(!VersionReq::parse(">=0.1.0-alpha") + .unwrap() + .is_latest_compatible(&Version::parse("0.1.0-alpha").unwrap())); + } +} From 36926518cfa835a2339e965bb0871ddbf2431712 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 8 Aug 2022 18:01:08 +1000 Subject: [PATCH 0681/2020] Use `VersionReqExt::is_latest_compatible` in `entry:367` Signed-off-by: Jiahao XU --- src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index ecc92f04..687fc906 100644 --- a/src/main.rs +++ b/src/main.rs @@ -361,7 +361,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { let keep = if let Some(version_req) = &crate_name.version_req { records .get(&crate_name.name) - .map(|metadata| !version_req.matches(&metadata.current_version)) + .map(|metadata| !version_req.is_latest_compatible(&metadata.current_version)) .unwrap_or(true) } else { !records.contains(&crate_name.name) From b69d7e7c0664689676ad760834c12f4ac20795a1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 8 Aug 2022 18:03:59 +1000 Subject: [PATCH 0682/2020] Test When 0.11.0 is installed but can be upgraded in `tests.sh` Signed-off-by: Jiahao XU --- ci-scripts/tests.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci-scripts/tests.sh b/ci-scripts/tests.sh index a9c478b6..e38259b6 100755 --- a/ci-scripts/tests.sh +++ b/ci-scripts/tests.sh @@ -52,3 +52,7 @@ cargo binstall --help >/dev/null "./$1" binstall --no-confirm cargo-binstall@0.11.1 | grep -q 'package cargo-binstall@=0.11.1 is already installed' "./$1" binstall --no-confirm cargo-binstall@0.10.0 | grep -q -v 'package cargo-binstall@=0.10.0 is already installed' + +## Test When 0.11.0 is installed but can be upgraded. +"./$1" binstall --force --log-level debug --no-confirm cargo-binstall@0.11.0 +"./$1" binstall --no-confirm cargo-binstall@^0.11.0 | grep -q -v 'package cargo-binstall@^0.11.0 is already installed' From a271e695a560af202c39421818af042afcfb3bfd Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 8 Aug 2022 19:18:30 +1000 Subject: [PATCH 0683/2020] Ignore if package already up-to-date Signed-off-by: Jiahao XU --- src/binstall/install.rs | 1 + src/binstall/resolve.rs | 18 +++++++++++++++++- src/main.rs | 39 ++++++++++++++++++++++----------------- 3 files changed, 40 insertions(+), 18 deletions(-) diff --git a/src/binstall/install.rs b/src/binstall/install.rs index 0bf5c0e7..9e57d6c1 100644 --- a/src/binstall/install.rs +++ b/src/binstall/install.rs @@ -15,6 +15,7 @@ pub async fn install( jobserver_client: LazyJobserverClient, ) -> Result> { match resolution { + Resolution::AlreadyUpToDate => Ok(None), Resolution::Fetch { fetcher, package, diff --git a/src/binstall/resolve.rs b/src/binstall/resolve.rs index d17747b4..0869106a 100644 --- a/src/binstall/resolve.rs +++ b/src/binstall/resolve.rs @@ -8,7 +8,7 @@ use compact_str::{CompactString, ToCompactString}; use log::{debug, error, info, warn}; use miette::{miette, Result}; use reqwest::Client; -use semver::VersionReq; +use semver::{Version, VersionReq}; use super::Options; use crate::{ @@ -29,6 +29,7 @@ pub enum Resolution { InstallFromSource { package: Package, }, + AlreadyUpToDate, } impl Resolution { fn print(&self, opts: &Options) { @@ -70,6 +71,7 @@ impl Resolution { Resolution::InstallFromSource { .. } => { warn!("The package will be installed from source (with cargo)",) } + Resolution::AlreadyUpToDate => (), } } } @@ -77,6 +79,7 @@ impl Resolution { pub async fn resolve( opts: Arc, crate_name: CrateName, + curr_version: Option, temp_dir: Arc, install_path: Arc, client: Client, @@ -109,6 +112,19 @@ pub async fn resolve( let package = manifest.package.unwrap(); + if let Some(curr_version) = curr_version { + let new_version = + Version::parse(&package.version).map_err(|err| BinstallError::VersionParse { + v: package.version.clone(), + err, + })?; + + if new_version == curr_version { + info!("package {crate_name} is already up to date {curr_version}"); + return Ok(Resolution::AlreadyUpToDate); + } + } + let (mut meta, binaries) = ( package .metadata diff --git a/src/main.rs b/src/main.rs index 687fc906..55628a22 100644 --- a/src/main.rs +++ b/src/main.rs @@ -354,26 +354,29 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { })?; // Remove installed crates - let crate_names = CrateName::dedup(crate_names).filter(|crate_name| { + let crate_names = CrateName::dedup(crate_names).filter_map(|crate_name| { if opts.force { - true + Some((crate_name, None)) } else if let Some(records) = &metadata { - let keep = if let Some(version_req) = &crate_name.version_req { - records - .get(&crate_name.name) - .map(|metadata| !version_req.is_latest_compatible(&metadata.current_version)) - .unwrap_or(true) + if let Some(metadata) = records.get(&crate_name.name) { + if let Some(version_req) = &crate_name.version_req { + if version_req.is_latest_compatible(&metadata.current_version) { + info!( + "package {crate_name} is already installed and cannot be upgraded, use --force to override" + ); + None + } else { + Some((crate_name, Some(metadata.current_version.clone()))) + } + } else { + info!("package {crate_name} is already installed, use --force to override"); + None + } } else { - !records.contains(&crate_name.name) - }; - - if !keep { - info!("package {crate_name} is already installed, use --force to override") + Some((crate_name, None)) } - - keep } else { - true + Some((crate_name, None)) } }); @@ -395,10 +398,11 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { // Resolve crates let tasks: Vec<_> = crate_names .into_iter() - .map(|crate_name| { + .map(|(crate_name, current_version)| { AutoAbortJoinHandle::spawn(binstall::resolve( binstall_opts.clone(), crate_name, + current_version, temp_dir_path.clone(), install_path.clone(), client.clone(), @@ -430,7 +434,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { // Resolve crates and install without confirmation crate_names .into_iter() - .map(|crate_name| { + .map(|(crate_name, current_version)| { let opts = binstall_opts.clone(); let temp_dir_path = temp_dir_path.clone(); let jobserver_client = jobserver_client.clone(); @@ -442,6 +446,7 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { let resolution = binstall::resolve( opts.clone(), crate_name, + current_version, temp_dir_path, install_path, client, From 4500e4af633e195c35dfeda66b9947face350585 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 8 Aug 2022 23:28:49 +1200 Subject: [PATCH 0684/2020] release: v0.12.0 (#253) Co-authored-by: github-actions --- Cargo.lock | 2 +- Cargo.toml | 2 +- windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3af16042..6192bc9f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -122,7 +122,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.11.1" +version = "0.12.0" dependencies = [ "async-trait", "bytes", diff --git a/Cargo.toml b/Cargo.toml index 27b0797b..1c45e74e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/ryankurte/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.11.1" +version = "0.12.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/windows.manifest b/windows.manifest index 7e0bc5f6..b7f74dd9 100644 --- a/windows.manifest +++ b/windows.manifest @@ -3,7 +3,7 @@ From 763d4610e56bc7c65e421a27219b219261f90aea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Tue, 9 Aug 2022 21:09:21 +1200 Subject: [PATCH 0685/2020] Don't prompt if there's nothing to do (#293) Fixes #291 --- README.md | 23 +++----- ci-scripts/tests.sh | 11 ++-- src/binstall/install.rs | 38 +++++++------ src/binstall/resolve.rs | 44 +++++++++++---- src/errors.rs | 100 ++++++++++++++++++++++++++++------ src/fetchers/gh_crate_meta.rs | 8 +-- src/fetchers/quickinstall.rs | 6 +- src/main.rs | 70 +++++++++++++++--------- 8 files changed, 205 insertions(+), 95 deletions(-) diff --git a/README.md b/README.md index e0378c81..cfa6930c 100644 --- a/README.md +++ b/README.md @@ -5,18 +5,15 @@ `binstall` works by fetching the crate information from `crates.io`, then searching the linked `repository` for matching releases and artifacts, with fallbacks to [quickinstall](https://github.com/alsuren/cargo-quickinstall) and finally `cargo install` if these are not found. To support `binstall` maintainers must add configuration values to `Cargo.toml` to allow the tool to locate the appropriate binary package for a given version and target. See [SUPPORT.md](./SUPPORT.md) for more detail. - ## Status -![Build](https://github.com/ryankurte/cargo-binstall/workflows/Rust/badge.svg) -[![GitHub tag](https://img.shields.io/github/tag/ryankurte/cargo-binstall.svg)](https://github.com/ryankurte/cargo-binstall) +![Build](https://github.com/cargo-bins/cargo-binstall/workflows/Rust/badge.svg) +[![GitHub tag](https://img.shields.io/github/tag/cargo-bins/cargo-binstall.svg)](https://github.com/cargo-bins/cargo-binstall) [![Crates.io](https://img.shields.io/crates/v/cargo-binstall.svg)](https://crates.io/crates/cargo-binstall) -[![Docs.rs](https://docs.rs/cargo-binstall/badge.svg)](https://docs.rs/cargo-binstall) ## Installation -To get started _using_ `cargo-binstall` first install the binary (either via `cargo install cargo-binstall` or by downloading a pre-compiled [release](https://github.com/ryankurte/cargo-binstall/releases)). - +To get started _using_ `cargo-binstall` first install the binary (either via `cargo install cargo-binstall` or by downloading a pre-compiled [release](https://github.com/cargo-bins/cargo-binstall/releases)). | OS | Arch | URL | | ------- | ------- | ------------------------------------------------------------ | @@ -27,7 +24,7 @@ To get started _using_ `cargo-binstall` first install the binary (either via `ca | macos | m1 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-apple-darwin.zip | | windows | x86\_64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-pc-windows-msvc.zip | - +To upgrade, use `cargo binstall cargo-binstall`! ## Usage @@ -37,16 +34,15 @@ Package versions and targets may be specified using the `--version` and `--targe ``` [garry] ➜ ~ cargo binstall radio-sx128x --version 0.14.1-alpha.5 -21:14:09 [INFO] Installing package: 'radio-sx128x' -21:14:13 [INFO] Downloading package from: 'https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-apple-darwin.tgz' +21:14:15 [INFO] Resolving package: 'radio-sx128x' 21:14:18 [INFO] This will install the following binaries: 21:14:18 [INFO] - sx128x-util (sx128x-util-x86_64-apple-darwin -> /Users/ryankurte/.cargo/bin/sx128x-util-v0.14.1-alpha.5) 21:14:18 [INFO] And create (or update) the following symlinks: 21:14:18 [INFO] - sx128x-util (/Users/ryankurte/.cargo/bin/sx128x-util-v0.14.1-alpha.5 -> /Users/ryankurte/.cargo/bin/sx128x-util) -21:14:18 [INFO] Do you wish to continue? yes/no -yes -21:15:30 [INFO] Installing binaries... -21:15:30 [INFO] Installation complete! +21:14:18 [INFO] Do you wish to continue? yes/[no] +? yes +21:14:20 [INFO] Installing binaries... +21:14:21 [INFO] Done in 6.212736s ``` ### Unsupported crates @@ -60,7 +56,6 @@ $ binstall \ --pkg-fmt="txz" crate_name ``` - ## FAQ - Why use this? diff --git a/ci-scripts/tests.sh b/ci-scripts/tests.sh index e38259b6..29468795 100755 --- a/ci-scripts/tests.sh +++ b/ci-scripts/tests.sh @@ -48,11 +48,12 @@ cargo binstall --help >/dev/null cargo binstall --help >/dev/null # Test skip when installed -"./$1" binstall --no-confirm cargo-binstall | grep -q 'package cargo-binstall is already installed' -"./$1" binstall --no-confirm cargo-binstall@0.11.1 | grep -q 'package cargo-binstall@=0.11.1 is already installed' +"./$1" binstall --no-confirm --force cargo-binstall@0.11.1 +"./$1" binstall --no-confirm cargo-binstall@0.11.1 | grep -q 'cargo-binstall v0.11.1 is already installed' -"./$1" binstall --no-confirm cargo-binstall@0.10.0 | grep -q -v 'package cargo-binstall@=0.10.0 is already installed' +"./$1" binstall --no-confirm cargo-binstall@0.10.0 | grep -q -v 'cargo-binstall v0.10.0 is already installed' ## Test When 0.11.0 is installed but can be upgraded. -"./$1" binstall --force --log-level debug --no-confirm cargo-binstall@0.11.0 -"./$1" binstall --no-confirm cargo-binstall@^0.11.0 | grep -q -v 'package cargo-binstall@^0.11.0 is already installed' +"./$1" binstall --no-confirm cargo-binstall@0.11.0 +"./$1" binstall --no-confirm cargo-binstall@0.11.0 | grep -q 'cargo-binstall v0.11.0 is already installed' +"./$1" binstall --no-confirm cargo-binstall@^0.11.0 | grep -q -v 'cargo-binstall v0.11.0 is already installed' diff --git a/src/binstall/install.rs b/src/binstall/install.rs index 9e57d6c1..8e78b2e3 100644 --- a/src/binstall/install.rs +++ b/src/binstall/install.rs @@ -3,17 +3,16 @@ use std::{path::PathBuf, process, sync::Arc}; use cargo_toml::Package; use compact_str::CompactString; use log::{debug, error, info}; -use miette::{miette, IntoDiagnostic, Result, WrapErr}; use tokio::{process::Command, task::block_in_place}; use super::{MetaData, Options, Resolution}; -use crate::{bins, fetchers::Fetcher, metafiles::binstall_v1::Source, *}; +use crate::{bins, fetchers::Fetcher, metafiles::binstall_v1::Source, BinstallError, *}; pub async fn install( resolution: Resolution, opts: Arc, jobserver_client: LazyJobserverClient, -) -> Result> { +) -> Result, BinstallError> { match resolution { Resolution::AlreadyUpToDate => Ok(None), Resolution::Fetch { @@ -24,7 +23,14 @@ pub async fn install( bin_path, bin_files, } => { - let current_version = package.version.parse().into_diagnostic()?; + let current_version = + package + .version + .parse() + .map_err(|err| BinstallError::VersionParse { + v: package.version, + err, + })?; let target = fetcher.target().into(); install_from_package(fetcher, opts, bin_path, bin_files) @@ -45,7 +51,7 @@ pub async fn install( let desired_targets = opts.desired_targets.get().await; let target = desired_targets .first() - .ok_or_else(|| miette!("No viable targets found, try with `--targets`"))?; + .ok_or(BinstallError::NoViableTargets)?; if !opts.dry_run { install_from_source(package, target, jobserver_client, opts.quiet, opts.force) @@ -67,7 +73,7 @@ async fn install_from_package( opts: Arc, bin_path: PathBuf, bin_files: Vec, -) -> Result>> { +) -> Result>, BinstallError> { // Download package if opts.dry_run { info!("Dry run, not downloading package"); @@ -129,7 +135,7 @@ async fn install_from_source( lazy_jobserver_client: LazyJobserverClient, quiet: bool, force: bool, -) -> Result<()> { +) -> Result<(), BinstallError> { let jobserver_client = lazy_jobserver_client.get().await?; debug!( @@ -156,22 +162,20 @@ async fn install_from_source( cmd.arg("--force"); } - let mut child = cmd - .spawn() - .into_diagnostic() - .wrap_err("Spawning cargo install failed.")?; + let command_string = format!("{:?}", cmd); + + let mut child = cmd.spawn()?; debug!("Spawned command pid={:?}", child.id()); - let status = child - .wait() - .await - .into_diagnostic() - .wrap_err("Running cargo install failed.")?; + let status = child.wait().await?; if status.success() { info!("Cargo finished successfully"); Ok(()) } else { error!("Cargo errored! {status:?}"); - Err(miette!("Cargo install error")) + Err(BinstallError::SubProcess { + command: command_string, + status, + }) } } diff --git a/src/binstall/resolve.rs b/src/binstall/resolve.rs index 0869106a..97cc6cec 100644 --- a/src/binstall/resolve.rs +++ b/src/binstall/resolve.rs @@ -5,8 +5,7 @@ use std::{ use cargo_toml::{Package, Product}; use compact_str::{CompactString, ToCompactString}; -use log::{debug, error, info, warn}; -use miette::{miette, Result}; +use log::{debug, info, warn}; use reqwest::Client; use semver::{Version, VersionReq}; @@ -14,7 +13,7 @@ use super::Options; use crate::{ bins, fetchers::{Data, Fetcher, GhCrateMeta, MultiFetcher, QuickInstall}, - *, + BinstallError, *, }; pub enum Resolution { @@ -84,8 +83,31 @@ pub async fn resolve( install_path: Arc, client: Client, crates_io_api_client: crates_io_api::AsyncClient, -) -> Result { - info!("Installing package: '{}'", crate_name); +) -> Result { + let crate_name_name = crate_name.name.clone(); + resolve_inner( + opts, + crate_name, + curr_version, + temp_dir, + install_path, + client, + crates_io_api_client, + ) + .await + .map_err(|err| err.crate_context(crate_name_name)) +} + +async fn resolve_inner( + opts: Arc, + crate_name: CrateName, + curr_version: Option, + temp_dir: Arc, + install_path: Arc, + client: Client, + crates_io_api_client: crates_io_api::AsyncClient, +) -> Result { + info!("Resolving package: '{}'", crate_name); let version_req: VersionReq = match (&crate_name.version_req, &opts.version_req) { (Some(version), None) => version.clone(), @@ -120,7 +142,10 @@ pub async fn resolve( })?; if new_version == curr_version { - info!("package {crate_name} is already up to date {curr_version}"); + info!( + "{} v{curr_version} is already installed, use --force to override", + crate_name.name + ); return Ok(Resolution::AlreadyUpToDate); } } @@ -208,7 +233,7 @@ fn collect_bin_files( binaries: Vec, bin_path: PathBuf, install_path: PathBuf, -) -> Result> { +) -> Result, BinstallError> { // Update meta if fetcher.source_name() == "QuickInstall" { // TODO: less of a hack? @@ -217,10 +242,7 @@ fn collect_bin_files( // Check binaries if binaries.is_empty() { - error!("No binaries specified (or inferred from file system)"); - return Err(miette!( - "No binaries specified (or inferred from file system)" - )); + return Err(BinstallError::UnspecifiedBinaries); } // List files to be installed diff --git a/src/errors.rs b/src/errors.rs index c1d1de22..8d336dd4 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,13 +1,13 @@ -use std::process::{ExitCode, Termination}; +use std::process::{ExitCode, ExitStatus, Termination}; +use compact_str::CompactString; use log::{error, warn}; use miette::{Diagnostic, Report}; use thiserror::Error; use tokio::task; -/// Errors emitted by cargo-binstall. +/// Error kinds emitted by cargo-binstall. #[derive(Error, Diagnostic, Debug)] -#[diagnostic(url(docsrs))] #[non_exhaustive] pub enum BinstallError { /// Internal: a task could not be joined. @@ -71,7 +71,7 @@ pub enum BinstallError { /// /// - Code: `binstall::http` /// - Exit: 69 - #[error("could not {method} {url}: {err}")] + #[error("could not {method} {url}")] #[diagnostic(severity(error), code(binstall::http))] Http { method: reqwest::Method, @@ -80,6 +80,16 @@ pub enum BinstallError { err: reqwest::Error, }, + /// A subprocess failed. + /// + /// This is often about cargo-install calls. + /// + /// - Code: `binstall::subprocess` + /// - Exit: 70 + #[error("subprocess {command} errored with {status}")] + #[diagnostic(severity(error), code(binstall::subprocess))] + SubProcess { command: String, status: ExitStatus }, + /// A generic I/O error. /// /// - Code: `binstall::io` @@ -94,7 +104,7 @@ pub enum BinstallError { /// /// - Code: `binstall::crates_io_api` /// - Exit: 76 - #[error("crates.io api error fetching crate information for '{crate_name}': {err}")] + #[error("crates.io API error")] #[diagnostic( severity(error), code(binstall::crates_io_api), @@ -137,7 +147,7 @@ pub enum BinstallError { /// /// - Code: `binstall::version::parse` /// - Exit: 80 - #[error("version string '{v}' is not semver: {err}")] + #[error("version string '{v}' is not semver")] #[diagnostic(severity(error), code(binstall::version::parse))] VersionParse { v: String, @@ -154,7 +164,7 @@ pub enum BinstallError { /// /// - Code: `binstall::version::requirement` /// - Exit: 81 - #[error("version requirement '{req}' is not semver: {err}")] + #[error("version requirement '{req}' is not semver")] #[diagnostic(severity(error), code(binstall::version::requirement))] VersionReq { req: String, @@ -220,17 +230,52 @@ pub enum BinstallError { help("You cannot use --{option} and specify multiple packages at the same time. Do one or the other.") )] OverrideOptionUsedWithMultiInstall { option: &'static str }, + + /// No binaries were found for the crate. + /// + /// When installing, either the binaries are specified in the crate's Cargo.toml, or they're + /// inferred from the crate layout (e.g. src/main.rs or src/bins/name.rs). If no binaries are + /// found through these methods, we can't know what to install! + /// + /// - Code: `binstall::resolve::binaries` + /// - Exit: 86 + #[error("no binaries specified nor inferred")] + #[diagnostic( + severity(error), + code(binstall::resolve::binaries), + help("This crate doesn't specify any binaries, so there's nothing to install.") + )] + UnspecifiedBinaries, + + /// No viable targets were found. + /// + /// When installing, we attempt to find which targets the host (your computer) supports, and + /// discover builds for these targets from the remote binary source. This error occurs when we + /// fail to discover the host's target. + /// + /// You should in this case specify --target manually. + /// + /// - Code: `binstall::targets::none_host` + /// - Exit: 87 + #[error("failed to discovered a viable target from the host")] + #[diagnostic( + severity(error), + code(binstall::targets::none_host), + help("Try to specify --target") + )] + NoViableTargets, + + /// A wrapped error providing the context of which crate the error is about. + #[error("for crate {crate_name}")] + CrateContext { + #[source] + error: Box, + crate_name: CompactString, + }, } impl BinstallError { - /// The recommended exit code for this error. - /// - /// This will never output: - /// - 0 (success) - /// - 1 and 2 (catchall and shell) - /// - 16 (binstall errors not handled here) - /// - 64 (generic error) - pub fn exit_code(&self) -> ExitCode { + fn exit_number(&self) -> u8 { use BinstallError::*; let code: u8 = match self { TaskJoinError(_) => 17, @@ -240,6 +285,7 @@ impl BinstallError { Template(_) => 67, Reqwest(_) => 68, Http { .. } => 69, + SubProcess { .. } => 70, Io(_) => 74, CratesIoApi { .. } => 76, CargoManifestPath => 77, @@ -250,12 +296,34 @@ impl BinstallError { VersionUnavailable { .. } => 83, SuperfluousVersionOption => 84, OverrideOptionUsedWithMultiInstall { .. } => 85, + UnspecifiedBinaries => 86, + NoViableTargets => 87, + CrateContext { error, .. } => error.exit_number(), }; // reserved codes debug_assert!(code != 64 && code != 16 && code != 1 && code != 2 && code != 0); - code.into() + code + } + + /// The recommended exit code for this error. + /// + /// This will never output: + /// - 0 (success) + /// - 1 and 2 (catchall and shell) + /// - 16 (binstall errors not handled here) + /// - 64 (generic error) + pub fn exit_code(&self) -> ExitCode { + self.exit_number().into() + } + + /// Add crate context to the error + pub fn crate_context(self, crate_name: impl Into) -> Self { + Self::CrateContext { + error: Box::new(self), + crate_name: crate_name.into(), + } } } diff --git a/src/fetchers/gh_crate_meta.rs b/src/fetchers/gh_crate_meta.rs index 43603760..2c009ff8 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/src/fetchers/gh_crate_meta.rs @@ -2,7 +2,7 @@ use std::path::Path; use std::sync::Arc; use compact_str::{CompactString, ToCompactString}; -use log::{debug, info, warn}; +use log::{debug, warn}; use once_cell::sync::OnceCell; use reqwest::Client; use reqwest::Method; @@ -43,7 +43,7 @@ impl super::Fetcher for GhCrateMeta { let client = self.client.clone(); AutoAbortJoinHandle::spawn(async move { let url = url?; - info!("Checking for package at: '{url}'"); + debug!("Checking for package at: '{url}'"); remote_exists(client, url.clone(), Method::HEAD) .await .map(|exists| (url.clone(), exists)) @@ -61,7 +61,7 @@ impl super::Fetcher for GhCrateMeta { ); } - info!("Winning URL is {url}"); + debug!("Winning URL is {url}"); self.url.set(url).unwrap(); // find() is called first return Ok(true); } @@ -72,7 +72,7 @@ impl super::Fetcher for GhCrateMeta { async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { let url = self.url.get().unwrap(); // find() is called first - info!("Downloading package from: '{url}'"); + debug!("Downloading package from: '{url}'"); download_and_extract(&self.client, url, self.pkg_fmt(), dst).await } diff --git a/src/fetchers/quickinstall.rs b/src/fetchers/quickinstall.rs index f79b9bc1..0bdaa290 100644 --- a/src/fetchers/quickinstall.rs +++ b/src/fetchers/quickinstall.rs @@ -2,7 +2,7 @@ use std::path::Path; use std::sync::Arc; use compact_str::CompactString; -use log::{debug, info}; +use log::debug; use reqwest::Client; use reqwest::Method; use tokio::task::JoinHandle; @@ -36,13 +36,13 @@ impl super::Fetcher for QuickInstall { async fn find(&self) -> Result { let url = self.package_url(); self.report(); - info!("Checking for package at: '{url}'"); + debug!("Checking for package at: '{url}'"); remote_exists(self.client.clone(), Url::parse(&url)?, Method::HEAD).await } async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { let url = self.package_url(); - info!("Downloading package from: '{url}'"); + debug!("Downloading package from: '{url}'"); download_and_extract(&self.client, &Url::parse(&url)?, self.pkg_fmt(), dst).await } diff --git a/src/main.rs b/src/main.rs index 55628a22..77b51ddd 100644 --- a/src/main.rs +++ b/src/main.rs @@ -36,7 +36,11 @@ struct Options { /// /// If duplicate names are provided, the last one (and their version requirement) /// is kept. - #[clap(help_heading = "Package selection", value_name = "crate[@version]")] + #[clap( + help_heading = "Package selection", + value_name = "crate[@version]", + required_unless_present_any = ["version", "help"], + )] crate_names: Vec, /// Package version to install. @@ -202,7 +206,7 @@ impl Termination for MainExit { fn report(self) -> ExitCode { match self { Self::Success(spent) => { - info!("Installation completed in {spent:?}"); + info!("Done in {spent:?}"); ExitCode::SUCCESS } Self::Error(err) => err.report(), @@ -354,31 +358,39 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { })?; // Remove installed crates - let crate_names = CrateName::dedup(crate_names).filter_map(|crate_name| { - if opts.force { - Some((crate_name, None)) - } else if let Some(records) = &metadata { - if let Some(metadata) = records.get(&crate_name.name) { - if let Some(version_req) = &crate_name.version_req { - if version_req.is_latest_compatible(&metadata.current_version) { - info!( - "package {crate_name} is already installed and cannot be upgraded, use --force to override" - ); - None - } else { - Some((crate_name, Some(metadata.current_version.clone()))) - } - } else { - info!("package {crate_name} is already installed, use --force to override"); + let crate_names = CrateName::dedup(crate_names) + .filter_map(|crate_name| { + match ( + opts.force, + metadata.as_ref().and_then(|records| records.get(&crate_name.name)), + &crate_name.version_req, + ) { + (false, Some(metadata), Some(version_req)) + if version_req.is_latest_compatible(&metadata.current_version) => + { + debug!("Bailing out early because we can assume wanted is already installed from metafile"); + info!( + "{} v{} is already installed, use --force to override", + crate_name.name, metadata.current_version + ); None } - } else { - Some((crate_name, None)) + + // we have to assume that the version req could be *, + // and therefore a remote upgraded version could exist + (false, Some(metadata), _) => { + Some((crate_name, Some(metadata.current_version.clone()))) + } + + _ => Some((crate_name, None)), } - } else { - Some((crate_name, None)) - } - }); + }) + .collect::>(); + + if crate_names.is_empty() { + debug!("Nothing to do"); + return Ok(()); + } let temp_dir_path: Arc = Arc::from(temp_dir.path()); @@ -414,7 +426,15 @@ async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { // Confirm let mut resolutions = Vec::with_capacity(tasks.len()); for task in tasks { - resolutions.push(task.await??); + match task.await?? { + binstall::Resolution::AlreadyUpToDate => {} + res => resolutions.push(res), + } + } + + if resolutions.is_empty() { + debug!("Nothing to do"); + return Ok(()); } uithread.confirm().await?; From bf700f9012674839cca3712db808450fe9ed445f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 20 Aug 2022 00:25:51 +1000 Subject: [PATCH 0686/2020] Improve err msg when source is missing in `BinFile::install_bin` (#301) * Improve err msg in `helpers::atomic_install` Signed-off-by: Jiahao XU * Check for missing `source` in `install_bin` Signed-off-by: Jiahao XU * Fix `install_bin`: Use `try_exists` instead of `exists` Signed-off-by: Jiahao XU * Do not test `cargo-deb` in `ci-scripts/tests.sh` Due to the fact that it uses gnu sparse extension which is not supported by crate `tar`. Signed-off-by: Jiahao XU Signed-off-by: Jiahao XU --- ci-scripts/tests.sh | 4 ++-- src/bins.rs | 5 ++++- src/errors.rs | 14 +++++++++++++- src/helpers.rs | 4 ++-- 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ci-scripts/tests.sh b/ci-scripts/tests.sh index 29468795..a83e797e 100755 --- a/ci-scripts/tests.sh +++ b/ci-scripts/tests.sh @@ -2,8 +2,8 @@ set -euxo pipefail -bins="cargo-deb cargo-llvm-cov cargo-binstall" -test_bins="cargo-deb cargo-llvm-cov" +bins="cargo-llvm-cov cargo-binstall" +test_bins="cargo-llvm-cov" unset CARGO_INSTALL_ROOT unset CARGO_HOME diff --git a/src/bins.rs b/src/bins.rs index 7240707a..f7d2041c 100644 --- a/src/bins.rs +++ b/src/bins.rs @@ -79,7 +79,10 @@ impl BinFile { } pub fn install_bin(&self) -> Result<(), BinstallError> { - // TODO: check if file already exists + if !self.source.try_exists()? { + return Err(BinstallError::BinFileNotFound(self.source.clone())); + } + debug!( "Atomically install file from '{}' to '{}'", self.source.display(), diff --git a/src/errors.rs b/src/errors.rs index 8d336dd4..d4a03120 100644 --- a/src/errors.rs +++ b/src/errors.rs @@ -1,4 +1,7 @@ -use std::process::{ExitCode, ExitStatus, Termination}; +use std::{ + path::PathBuf, + process::{ExitCode, ExitStatus, Termination}, +}; use compact_str::CompactString; use log::{error, warn}; @@ -265,6 +268,14 @@ pub enum BinstallError { )] NoViableTargets, + /// Bin file is not found. + /// + /// - Code: `binstall::binfile` + /// - Exit: 88 + #[error("bin file {0} not found")] + #[diagnostic(severity(error), code(binstall::binfile))] + BinFileNotFound(PathBuf), + /// A wrapped error providing the context of which crate the error is about. #[error("for crate {crate_name}")] CrateContext { @@ -298,6 +309,7 @@ impl BinstallError { OverrideOptionUsedWithMultiInstall { .. } => 85, UnspecifiedBinaries => 86, NoViableTargets => 87, + BinFileNotFound(_) => 88, CrateContext { error, .. } => error.exit_number(), }; diff --git a/src/helpers.rs b/src/helpers.rs index b1b67ddf..0742c1f2 100644 --- a/src/helpers.rs +++ b/src/helpers.rs @@ -271,8 +271,8 @@ pub fn atomic_install(src: &Path, dst: &Path) -> io::Result<()> { dst.display() ); - if fs::rename(src, dst).is_err() { - debug!("Attempting at atomically failed, fallback to creating tempfile."); + if let Err(err) = fs::rename(src, dst) { + debug!("Attempting at atomically failed: {err:#?}, fallback to creating tempfile."); // src and dst is not on the same filesystem/mountpoint. // Fallback to creating NamedTempFile on the parent dir of // dst. From 4b00f5f1435988e63c89a950f7026fc54367f16f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 20 Aug 2022 23:24:12 +1200 Subject: [PATCH 0687/2020] Split crates and clean up structure of codebase (#294) Co-authored-by: Jiahao XU --- .editorconfig | 15 + .github/dependabot.yml | 27 +- .../scripts}/compile-settings.jq | 0 .../scripts}/extract-release-notes.sh | 0 .../extract-tag-from-release-commit.sh | 0 .../scripts}/install-deps.sh | 0 .../scripts}/pack-release-archives.sh | 0 .../scripts}/release-pr.txt | 0 {ci-scripts => .github/scripts}/tests.sh | 3 +- .github/workflows/build.yml | 4 +- .github/workflows/integration.yml | 2 +- .github/workflows/release-pr.yml | 2 +- .github/workflows/release.yml | 6 +- .github/workflows/unit-tests.yml | 4 +- Cargo.lock | 90 ++- Cargo.toml | 104 +-- crates/bin/Cargo.toml | 54 ++ LICENSE.txt => crates/bin/LICENSE | 0 crates/bin/build.rs | 3 + manifest.rc => crates/bin/manifest.rc | 0 release.toml => crates/bin/release.toml | 1 - crates/bin/src/args.rs | 252 +++++++ crates/bin/src/entry.rs | 237 ++++++ crates/bin/src/install_path.rs | 39 + crates/bin/src/main.rs | 78 ++ .../ui_thread.rs => crates/bin/src/ui.rs | 22 +- .../bin/windows.manifest | 0 crates/detect-wasi/Cargo.toml | 13 + crates/detect-wasi/LICENSE-APACHE | 176 +++++ crates/detect-wasi/LICENSE-MIT | 23 + .../detect-wasi/src/bin}/detect-wasi.rs | 2 +- src/wasi.rs => crates/detect-wasi/src/lib.rs | 10 +- {src => crates/detect-wasi/src}/miniwasi.wasm | Bin {src => crates/detect-wasi/src}/miniwasi.wast | 0 crates/flock/Cargo.toml | 13 + crates/flock/LICENSE-APACHE | 176 +++++ crates/flock/LICENSE-MIT | 23 + crates/flock/src/lib.rs | 90 +++ crates/lib/Cargo.toml | 75 ++ crates/lib/LICENSE | 674 ++++++++++++++++++ build.rs => crates/lib/build.rs | 2 - {src => crates/lib/src}/bins.rs | 15 +- crates/lib/src/drivers.rs | 5 + {src => crates/lib/src}/drivers/crates_io.rs | 7 +- .../lib/src}/drivers/crates_io/vfs.rs | 13 +- .../lib/src}/drivers/crates_io/visitor.rs | 13 +- {src => crates/lib/src}/drivers/version.rs | 2 +- {src => crates/lib/src}/errors.rs | 0 {src => crates/lib/src}/fetchers.rs | 9 +- .../lib/src}/fetchers/gh_crate_meta.rs | 24 +- .../lib/src}/fetchers/quickinstall.rs | 10 +- crates/lib/src/fs.rs | 103 +++ crates/lib/src/helpers.rs | 9 + .../lib/src}/helpers/async_extracter.rs | 27 +- crates/lib/src/helpers/download.rs | 62 ++ {src => crates/lib/src}/helpers/extracter.rs | 15 +- .../lib/src}/helpers/jobserver_client.rs | 6 +- crates/lib/src/helpers/remote.rs | 62 ++ {src => crates/lib/src}/helpers/signal.rs | 6 +- crates/lib/src/helpers/statics.rs | 23 + .../lib/src}/helpers/stream_readable.rs | 8 +- .../lib/src/helpers/tasks.rs | 2 +- crates/lib/src/lib.rs | 9 + crates/lib/src/manifests.rs | 14 + .../lib/src/manifests/binstall_crates_v1.rs | 132 +--- .../lib/src/manifests/cargo_crates_v1.rs | 32 +- .../cargo_crates_v1/crate_version_source.rs | 15 +- .../lib/src/manifests/cargo_toml_binstall.rs | 66 +- .../cargo_toml_binstall/package_formats.rs | 0 crates/lib/src/manifests/crate_info.rs | 83 +++ src/binstall.rs => crates/lib/src/ops.rs | 11 +- .../lib/src/ops}/install.rs | 19 +- .../lib/src/ops}/resolve.rs | 41 +- .../lib/src/ops/resolve}/crate_name.rs | 11 +- .../lib/src/ops/resolve/version_ext.rs | 21 + src/target.rs => crates/lib/src/targets.rs | 11 +- crates/lib/tests/parse-meta.Cargo.toml | 18 + crates/lib/tests/parse-meta.rs | 31 + crates/normalize-path/Cargo.toml | 10 + crates/normalize-path/LICENSE-APACHE | 176 +++++ crates/normalize-path/LICENSE-MIT | 23 + .../normalize-path/src/lib.rs | 43 +- src/drivers.rs | 19 - src/helpers.rs | 363 ---------- src/helpers/flock.rs | 81 --- src/helpers/tls_version.rs | 19 - src/main.rs | 517 -------------- src/metafiles.rs | 6 - 88 files changed, 2989 insertions(+), 1423 deletions(-) create mode 100644 .editorconfig rename {ci-scripts => .github/scripts}/compile-settings.jq (100%) rename {ci-scripts => .github/scripts}/extract-release-notes.sh (100%) rename {ci-scripts => .github/scripts}/extract-tag-from-release-commit.sh (100%) rename {ci-scripts => .github/scripts}/install-deps.sh (100%) rename {ci-scripts => .github/scripts}/pack-release-archives.sh (100%) rename {ci-scripts => .github/scripts}/release-pr.txt (100%) rename {ci-scripts => .github/scripts}/tests.sh (90%) create mode 100644 crates/bin/Cargo.toml rename LICENSE.txt => crates/bin/LICENSE (100%) create mode 100644 crates/bin/build.rs rename manifest.rc => crates/bin/manifest.rc (100%) rename release.toml => crates/bin/release.toml (99%) create mode 100644 crates/bin/src/args.rs create mode 100644 crates/bin/src/entry.rs create mode 100644 crates/bin/src/install_path.rs create mode 100644 crates/bin/src/main.rs rename src/helpers/ui_thread.rs => crates/bin/src/ui.rs (80%) rename windows.manifest => crates/bin/windows.manifest (100%) create mode 100644 crates/detect-wasi/Cargo.toml create mode 100644 crates/detect-wasi/LICENSE-APACHE create mode 100644 crates/detect-wasi/LICENSE-MIT rename {examples => crates/detect-wasi/src/bin}/detect-wasi.rs (81%) rename src/wasi.rs => crates/detect-wasi/src/lib.rs (88%) rename {src => crates/detect-wasi/src}/miniwasi.wasm (100%) rename {src => crates/detect-wasi/src}/miniwasi.wast (100%) create mode 100644 crates/flock/Cargo.toml create mode 100644 crates/flock/LICENSE-APACHE create mode 100644 crates/flock/LICENSE-MIT create mode 100644 crates/flock/src/lib.rs create mode 100644 crates/lib/Cargo.toml create mode 100644 crates/lib/LICENSE rename build.rs => crates/lib/build.rs (79%) rename {src => crates/lib/src}/bins.rs (90%) create mode 100644 crates/lib/src/drivers.rs rename {src => crates/lib/src}/drivers/crates_io.rs (90%) rename {src => crates/lib/src}/drivers/crates_io/vfs.rs (88%) rename {src => crates/lib/src}/drivers/crates_io/visitor.rs (90%) rename {src => crates/lib/src}/drivers/version.rs (97%) rename {src => crates/lib/src}/errors.rs (100%) rename {src => crates/lib/src}/fetchers.rs (94%) rename {src => crates/lib/src}/fetchers/gh_crate_meta.rs (95%) rename {src => crates/lib/src}/fetchers/quickinstall.rs (93%) create mode 100644 crates/lib/src/fs.rs create mode 100644 crates/lib/src/helpers.rs rename {src => crates/lib/src}/helpers/async_extracter.rs (79%) create mode 100644 crates/lib/src/helpers/download.rs rename {src => crates/lib/src}/helpers/extracter.rs (77%) rename {src => crates/lib/src}/helpers/jobserver_client.rs (88%) create mode 100644 crates/lib/src/helpers/remote.rs rename {src => crates/lib/src}/helpers/signal.rs (97%) create mode 100644 crates/lib/src/helpers/statics.rs rename {src => crates/lib/src}/helpers/stream_readable.rs (95%) rename src/helpers/auto_abort_join_handle.rs => crates/lib/src/helpers/tasks.rs (97%) create mode 100644 crates/lib/src/lib.rs create mode 100644 crates/lib/src/manifests.rs rename src/metafiles/binstall_v1.rs => crates/lib/src/manifests/binstall_crates_v1.rs (68%) rename src/metafiles/v1.rs => crates/lib/src/manifests/cargo_crates_v1.rs (80%) rename src/metafiles/cvs.rs => crates/lib/src/manifests/cargo_crates_v1/crate_version_source.rs (92%) rename src/lib.rs => crates/lib/src/manifests/cargo_toml_binstall.rs (67%) rename src/formats.rs => crates/lib/src/manifests/cargo_toml_binstall/package_formats.rs (100%) create mode 100644 crates/lib/src/manifests/crate_info.rs rename src/binstall.rs => crates/lib/src/ops.rs (68%) rename {src/binstall => crates/lib/src/ops}/install.rs (91%) rename {src/binstall => crates/lib/src/ops}/resolve.rs (86%) rename {src/helpers => crates/lib/src/ops/resolve}/crate_name.rs (88%) rename src/helpers/version.rs => crates/lib/src/ops/resolve/version_ext.rs (81%) rename src/target.rs => crates/lib/src/targets.rs (98%) create mode 100644 crates/lib/tests/parse-meta.Cargo.toml create mode 100644 crates/lib/tests/parse-meta.rs create mode 100644 crates/normalize-path/Cargo.toml create mode 100644 crates/normalize-path/LICENSE-APACHE create mode 100644 crates/normalize-path/LICENSE-MIT rename src/helpers/path_ext.rs => crates/normalize-path/src/lib.rs (54%) delete mode 100644 src/drivers.rs delete mode 100644 src/helpers.rs delete mode 100644 src/helpers/flock.rs delete mode 100644 src/helpers/tls_version.rs delete mode 100644 src/main.rs delete mode 100644 src/metafiles.rs diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..377bc158 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +indent_style = space +indent_size = 4 +end_of_line = lf +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true + +[tests/snapshots/*] +trim_trailing_whitespace = false + +[*.{cff,yml}] +indent_size = 2 diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 5e4980b5..c168124d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,8 +2,29 @@ version: 2 updates: - - package-ecosystem: "cargo" + - package-ecosystem: "github-actions" + # Workflow files stored in the + # default location of `.github/workflows` directory: "/" schedule: - interval: "weekly" - + interval: "daily" + - package-ecosystem: "cargo" + directory: "/crates/bin" + schedule: + interval: "daily" + - package-ecosystem: "cargo" + directory: "/crates/detect-wasi" + schedule: + interval: "daily" + - package-ecosystem: "cargo" + directory: "/crates/flock" + schedule: + interval: "daily" + - package-ecosystem: "cargo" + directory: "/crates/lib" + schedule: + interval: "daily" + - package-ecosystem: "cargo" + directory: "/crates/normalize-path" + schedule: + interval: "daily" diff --git a/ci-scripts/compile-settings.jq b/.github/scripts/compile-settings.jq similarity index 100% rename from ci-scripts/compile-settings.jq rename to .github/scripts/compile-settings.jq diff --git a/ci-scripts/extract-release-notes.sh b/.github/scripts/extract-release-notes.sh similarity index 100% rename from ci-scripts/extract-release-notes.sh rename to .github/scripts/extract-release-notes.sh diff --git a/ci-scripts/extract-tag-from-release-commit.sh b/.github/scripts/extract-tag-from-release-commit.sh similarity index 100% rename from ci-scripts/extract-tag-from-release-commit.sh rename to .github/scripts/extract-tag-from-release-commit.sh diff --git a/ci-scripts/install-deps.sh b/.github/scripts/install-deps.sh similarity index 100% rename from ci-scripts/install-deps.sh rename to .github/scripts/install-deps.sh diff --git a/ci-scripts/pack-release-archives.sh b/.github/scripts/pack-release-archives.sh similarity index 100% rename from ci-scripts/pack-release-archives.sh rename to .github/scripts/pack-release-archives.sh diff --git a/ci-scripts/release-pr.txt b/.github/scripts/release-pr.txt similarity index 100% rename from ci-scripts/release-pr.txt rename to .github/scripts/release-pr.txt diff --git a/ci-scripts/tests.sh b/.github/scripts/tests.sh similarity index 90% rename from ci-scripts/tests.sh rename to .github/scripts/tests.sh index a83e797e..d2ee228d 100755 --- a/ci-scripts/tests.sh +++ b/.github/scripts/tests.sh @@ -19,7 +19,8 @@ done cargo binstall --help >/dev/null # Install binaries using `--manifest-path` -"./$1" binstall --force --log-level debug --manifest-path . --no-confirm cargo-binstall +"./$1" binstall --force --log-level debug --manifest-path crates/bin/Cargo.toml --no-confirm cargo-binstall +"./$1" binstall --force --log-level debug --manifest-path crates/bin --no-confirm cargo-binstall # Test that the installed binaries can be run cargo binstall --help >/dev/null diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e8c2eb4d..d753e358 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -84,7 +84,7 @@ jobs: jq \ --argjson for_release '${{ toJSON(inputs.for_release) }}' \ --argjson matrix '${{ toJSON(matrix) }}' \ - -nrf ci-scripts/compile-settings.jq \ + -nrf .github/scripts/compile-settings.jq \ | tee -a $GITHUB_ENV - name: Configure caching @@ -107,7 +107,7 @@ jobs: - name: Install deps if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' && !startsWith(github.ref, 'refs/tags/v') }} - run: sudo ./ci-scripts/install-deps.sh + run: sudo .github/scripts/install-deps.sh - name: Build run: ${{ env.CTOOL }} build ${{ env.CARGS }} diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index a132dd31..3810c6b8 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -50,7 +50,7 @@ jobs: - name: Test shell: bash - run: ./ci-scripts/tests.sh ${{ matrix.bin }} ${{ runner.os }} + run: .github/scripts/tests.sh ${{ matrix.bin }} ${{ runner.os }} env: CARGO_HOME: /tmp/cargo-home-for-test/ diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index fb6cc115..5e450417 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -62,7 +62,7 @@ jobs: ecnef=$'\n```' title='release: v${{ inputs.version }}' - body=$(sed 's/%version%/${{ inputs.version }}/g' ci-scripts/release-pr.txt) + body=$(sed 's/%version%/${{ inputs.version }}/g' .github/scripts/release-pr.txt) gh pr create --title "$title" --body "$body" --base main --head "${{ env.branch_name }}" --label "release" env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index fb7c3417..9226a7da 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,13 +20,13 @@ jobs: - uses: actions/checkout@v2 - name: Extract tag from commit message id: version - run: ./ci-scripts/extract-tag-from-release-commit.sh + run: .github/scripts/extract-tag-from-release-commit.sh - name: Extract release notes id: notes env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_REPO: ${{ github.repository }} - run: ./ci-scripts/extract-release-notes.sh + run: .github/scripts/extract-release-notes.sh tag: needs: info @@ -61,7 +61,7 @@ jobs: path: outputs/ - name: Pack archives - run: ./ci-scripts/pack-release-archives.sh + run: .github/scripts/pack-release-archives.sh - name: Publish release uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 73950629..d9a8ceaf 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -21,7 +21,7 @@ jobs: - windows runs-on: ${{ matrix.os }}-latest - name: on ${{ matrix.os }} + name: unit tests on ${{ matrix.os }} steps: - uses: actions/checkout@v2 @@ -44,7 +44,7 @@ jobs: - name: Install deps if: matrix.os == 'ubuntu' - run: sudo ./ci-scripts/install-deps.sh + run: sudo .github/scripts/install-deps.sh - name: Test (Unix) if: matrix.os != 'windows' diff --git a/Cargo.lock b/Cargo.lock index 6192bc9f..c19c238c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,6 +75,49 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "binstall" +version = "0.1.0" +dependencies = [ + "async-trait", + "bytes", + "bzip2", + "cargo_toml", + "clap", + "compact_str", + "crates_io_api", + "env_logger", + "flate2", + "flock", + "futures-util", + "guess_host_triple", + "home", + "itertools", + "jobserver", + "log", + "miette", + "normalize-path", + "once_cell", + "reqwest", + "scopeguard", + "semver", + "serde", + "serde-tuple-vec-map", + "serde_json", + "strum", + "strum_macros", + "tar", + "tempfile", + "thiserror", + "tinytemplate", + "tokio", + "toml_edit", + "url", + "xz2", + "zip", + "zstd", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -124,46 +167,19 @@ dependencies = [ name = "cargo-binstall" version = "0.12.0" dependencies = [ - "async-trait", - "bytes", - "bzip2", - "cargo_toml", + "binstall", "clap", - "compact_str", "crates_io_api", "dirs", "embed-resource", - "env_logger", - "flate2", - "fs4", - "futures-util", - "guess_host_triple", - "home", - "itertools", - "jobserver", "log", "miette", "mimalloc", - "once_cell", "reqwest", - "scopeguard", "semver", - "serde", - "serde-tuple-vec-map", - "serde_json", "simplelog", - "strum", - "strum_macros", - "tar", "tempfile", - "thiserror", - "tinytemplate", "tokio", - "toml_edit", - "url", - "xz2", - "zip", - "zstd", ] [[package]] @@ -334,6 +350,13 @@ dependencies = [ "once_cell", ] +[[package]] +name = "detect-wasi" +version = "1.0.0" +dependencies = [ + "tempfile", +] + [[package]] name = "dirs" version = "4.0.0" @@ -448,6 +471,13 @@ dependencies = [ "miniz_oxide", ] +[[package]] +name = "flock" +version = "0.1.0" +dependencies = [ + "fs4", +] + [[package]] name = "fnv" version = "1.0.7" @@ -982,6 +1012,10 @@ dependencies = [ "tempfile", ] +[[package]] +name = "normalize-path" +version = "0.1.0" + [[package]] name = "num-integer" version = "0.1.45" diff --git a/Cargo.toml b/Cargo.toml index 1c45e74e..80872e3a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,99 +1,11 @@ -[package] -name = "cargo-binstall" -description = "Rust binary package installer for CI integration" -repository = "https://github.com/ryankurte/cargo-binstall" -documentation = "https://docs.rs/cargo-binstall" -version = "0.12.0" -rust-version = "1.61.0" -authors = ["ryan "] -edition = "2021" -license = "GPL-3.0" - -[package.metadata.binstall] -pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }" -bin-dir = "{ bin }{ binary-ext }" - -[package.metadata.binstall.overrides.x86_64-pc-windows-msvc] -pkg-fmt = "zip" -[package.metadata.binstall.overrides.x86_64-apple-darwin] -pkg-fmt = "zip" - -[dependencies] -async-trait = "0.1.57" -bytes = "1.2.1" -bzip2 = "0.4.3" -cargo_toml = "0.11.5" -clap = { version = "3.2.16", features = ["derive"] } -compact_str = { version = "0.5.2", features = ["serde"] } -crates_io_api = { version = "0.8.0", default-features = false } -dirs = "4.0.0" -flate2 = { version = "1.0.24", default-features = false } -fs4 = "0.6.2" -futures-util = { version = "0.3.21", default-features = false } -home = "0.5.3" -itertools = "0.10.3" -jobserver = "0.1.24" -log = "0.4.17" -miette = "5.2.0" -mimalloc = { version = "0.1.29", default-features = false, optional = true } -once_cell = "1.13.0" -reqwest = { version = "0.11.11", features = ["stream"], default-features = false } -scopeguard = "1.1.0" -semver = { version = "1.0.13", features = ["serde"] } -serde = { version = "1.0.142", features = ["derive"] } -serde-tuple-vec-map = "1.0.1" -serde_json = "1.0.83" -simplelog = "0.12.0" -strum = "0.24.1" -strum_macros = "0.24.3" -tar = "0.4.38" -tempfile = "3.3.0" -thiserror = "1.0.32" -tinytemplate = "1.2.1" -tokio = { version = "1.20.1", features = ["macros", "rt-multi-thread", "process", "sync", "signal"], default-features = false } -toml_edit = { version = "0.14.4", features = ["easy"] } -url = { version = "2.2.2", features = ["serde"] } -xz2 = "0.1.7" - -# Disable all features of zip except for features of compression algorithms: -# Disabled features include: -# - aes-crypto: Enables decryption of files which were encrypted with AES, absolutely zero use for -# this crate. -# - time: Enables features using the [time](https://github.com/time-rs/time) crate, -# which is not used by this crate. -zip = { version = "0.6.2", default-features = false, features = ["deflate", "bzip2", "zstd"] } - -# zstd is also depended by zip. -# Since zip 0.6.2 depends on zstd 0.10.0, we also have to use 0.10.0 here, -# otherwise there will be a link conflict. -zstd = { version = "0.10.0", default-features = false } - -[target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] -guess_host_triple = "0.1.3" - -[features] -default = ["static", "zlib-ng", "rustls", "fancy-no-backtrace"] - -mimalloc = ["dep:mimalloc"] - -static = ["bzip2/static", "xz2/static"] -pkg-config = ["zstd/pkg-config"] - -zlib-ng = ["flate2/zlib-ng"] - -rustls = ["crates_io_api/rustls", "reqwest/rustls-tls"] -native-tls = ["reqwest/native-tls"] - -fancy-no-backtrace = ["miette/fancy-no-backtrace"] -fancy-with-backtrace = ["fancy-no-backtrace", "miette/fancy"] - -log_release_max_level_info = ["log/release_max_level_info"] - -[dev-dependencies] -env_logger = "0.9.0" - -[build-dependencies] -embed-resource = "1.7.3" +[workspace] +members = [ + "crates/bin", + "crates/lib", + "crates/detect-wasi", + "crates/flock", + "crates/normalize-path", +] [profile.release] opt-level = "z" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml new file mode 100644 index 00000000..d1f36598 --- /dev/null +++ b/crates/bin/Cargo.toml @@ -0,0 +1,54 @@ +[package] +name = "cargo-binstall" +description = "Rust binary package installer for CI integration" +repository = "https://github.com/ryankurte/cargo-binstall" +documentation = "https://docs.rs/cargo-binstall" +version = "0.12.0" +rust-version = "1.61.0" +authors = ["ryan "] +edition = "2021" +license = "GPL-3.0" + +[package.metadata.binstall] +pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }" +bin-dir = "{ bin }{ binary-ext }" + +[package.metadata.binstall.overrides.x86_64-pc-windows-msvc] +pkg-fmt = "zip" +[package.metadata.binstall.overrides.x86_64-apple-darwin] +pkg-fmt = "zip" + +[dependencies] +binstall = { path = "../lib", version = "0.1.0" } +clap = { version = "3.2.16", features = ["derive"] } +crates_io_api = { version = "0.8.0", default-features = false } +dirs = "4.0.0" +log = "0.4.17" +miette = "5.2.0" +mimalloc = { version = "0.1.29", default-features = false, optional = true } +reqwest = { version = "0.11.11", default-features = false } +semver = "1.0.13" +simplelog = "0.12.0" +tempfile = "3.3.0" +tokio = { version = "1.20.1", features = ["rt-multi-thread"], default-features = false } + +[build-dependencies] +embed-resource = "1.7.3" + +[features] +default = ["static", "zlib-ng", "rustls", "fancy-no-backtrace"] + +mimalloc = ["dep:mimalloc"] + +static = ["binstall/static"] +pkg-config = ["binstall/pkg-config"] + +zlib-ng = ["binstall/zlib-ng"] + +rustls = ["binstall/rustls"] +native-tls = ["binstall/native-tls"] + +fancy-no-backtrace = ["miette/fancy-no-backtrace"] +fancy-with-backtrace = ["fancy-no-backtrace", "miette/fancy"] + +log_release_max_level_info = ["log/release_max_level_info"] diff --git a/LICENSE.txt b/crates/bin/LICENSE similarity index 100% rename from LICENSE.txt rename to crates/bin/LICENSE diff --git a/crates/bin/build.rs b/crates/bin/build.rs new file mode 100644 index 00000000..b7db24d6 --- /dev/null +++ b/crates/bin/build.rs @@ -0,0 +1,3 @@ +fn main() { + embed_resource::compile("manifest.rc"); +} diff --git a/manifest.rc b/crates/bin/manifest.rc similarity index 100% rename from manifest.rc rename to crates/bin/manifest.rc diff --git a/release.toml b/crates/bin/release.toml similarity index 99% rename from release.toml rename to crates/bin/release.toml index 4c308c4a..e72abc9c 100644 --- a/release.toml +++ b/crates/bin/release.toml @@ -13,4 +13,3 @@ search = "^ version=\"[\\d.]+[.]0\"" replace = " version=\"{{version}}.0\"" prerelease = false max = 1 - diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs new file mode 100644 index 00000000..bc8403e3 --- /dev/null +++ b/crates/bin/src/args.rs @@ -0,0 +1,252 @@ +use std::{ffi::OsString, path::PathBuf}; + +use binstall::{ + errors::BinstallError, + manifests::cargo_toml_binstall::PkgFmt, + ops::resolve::{CrateName, VersionReqExt}, +}; +use clap::{builder::PossibleValue, AppSettings, ArgEnum, Parser}; +use log::LevelFilter; +use reqwest::tls::Version; +use semver::VersionReq; + +#[derive(Debug, Parser)] +#[clap(version, about = "Install a Rust binary... from binaries!", setting = AppSettings::ArgRequiredElseHelp)] +pub struct Args { + /// Packages to install. + /// + /// Syntax: crate[@version] + /// + /// Each value is either a crate name alone, or a crate name followed by @ and the version to + /// install. The version syntax is as with the --version option. + /// + /// When multiple names are provided, the --version option and any override options are + /// unavailable due to ambiguity. + /// + /// If duplicate names are provided, the last one (and their version requirement) + /// is kept. + #[clap( + help_heading = "Package selection", + value_name = "crate[@version]", + required_unless_present_any = ["version", "help"], +)] + pub crate_names: Vec, + + /// Package version to install. + /// + /// Takes either an exact semver version or a semver version requirement expression, which will + /// be resolved to the highest matching version available. + /// + /// Cannot be used when multiple packages are installed at once, use the attached version + /// syntax in that case. + #[clap(help_heading = "Package selection", long = "version", parse(try_from_str = VersionReq::parse_from_cli))] + pub version_req: Option, + + /// Override binary target set. + /// + /// Binstall is able to look for binaries for several targets, installing the first one it finds + /// in the order the targets were given. For example, on a 64-bit glibc Linux distribution, the + /// default is to look first for a `x86_64-unknown-linux-gnu` binary, then for a + /// `x86_64-unknown-linux-musl` binary. However, on a musl system, the gnu version will not be + /// considered. + /// + /// This option takes a comma-separated list of target triples, which will be tried in order. + /// They override the default list, which is detected automatically from the current platform. + /// + /// If falling back to installing from source, the first target will be used. + #[clap( + help_heading = "Package selection", + alias = "target", + long, + value_name = "TRIPLE" + )] + pub targets: Option, + + /// Override Cargo.toml package manifest path. + /// + /// This skips searching crates.io for a manifest and uses the specified path directly, useful + /// for debugging and when adding Binstall support. This may be either the path to the folder + /// containing a Cargo.toml file, or the Cargo.toml file itself. + #[clap(help_heading = "Overrides", long)] + pub manifest_path: Option, + + /// Override Cargo.toml package manifest bin-dir. + #[clap(help_heading = "Overrides", long)] + pub bin_dir: Option, + + /// Override Cargo.toml package manifest pkg-fmt. + #[clap(help_heading = "Overrides", long)] + pub pkg_fmt: Option, + + /// Override Cargo.toml package manifest pkg-url. + #[clap(help_heading = "Overrides", long)] + pub pkg_url: Option, + + /// Disable symlinking / versioned updates. + /// + /// By default, Binstall will install a binary named `-` in the install path, and + /// either symlink or copy it to (depending on platform) the plain binary name. This makes it + /// possible to have multiple versions of the same binary, for example for testing or rollback. + /// + /// Pass this flag to disable this behavior. + #[clap(help_heading = "Options", long)] + pub no_symlinks: bool, + + /// Dry run, fetch and show changes without installing binaries. + #[clap(help_heading = "Options", long)] + pub dry_run: bool, + + /// Disable interactive mode / confirmation prompts. + #[clap(help_heading = "Options", long)] + pub no_confirm: bool, + + /// Do not cleanup temporary files. + #[clap(help_heading = "Options", long)] + pub no_cleanup: bool, + + /// Install binaries in a custom location. + /// + /// By default, binaries are installed to the global location `$CARGO_HOME/bin`, and global + /// metadata files are updated with the package information. Specifying another path here + /// switches over to a "local" install, where binaries are installed at the path given, and the + /// global metadata files are not updated. + #[clap(help_heading = "Options", long)] + pub install_path: Option, + + /// Enforce downloads over secure transports only. + /// + /// Insecure HTTP downloads will be removed completely in the future; in the meantime this + /// option forces a fail when the remote endpoint uses plaintext HTTP or insecure TLS suites. + /// + /// Without this option, plain HTTP will warn. + /// + /// Implies `--min-tls-version=1.2`. + #[clap(help_heading = "Options", long)] + pub secure: bool, + + /// Force a crate to be installed even if it is already installed. + #[clap(help_heading = "Options", long)] + pub force: bool, + + /// Require a minimum TLS version from remote endpoints. + /// + /// The default is not to require any minimum TLS version, and use the negotiated highest + /// version available to both this client and the remote server. + #[clap(help_heading = "Options", long, arg_enum, value_name = "VERSION")] + pub min_tls_version: Option, + + /// Print help information + #[clap(help_heading = "Meta", short, long)] + pub help: bool, + + /// Print version information + #[clap(help_heading = "Meta", short = 'V')] + pub version: bool, + + /// Utility log level + /// + /// Set to `trace` to print very low priority, often extremely + /// verbose information. + /// + /// Set to `debug` when submitting a bug report. + /// + /// Set to `info` to only print useful information. + /// + /// Set to `warn` to only print on hazardous situations. + /// + /// Set to `error` to only print serious errors. + /// + /// Set to `off` to disable logging completely, this will also + /// disable output from `cargo-install`. + #[clap( + help_heading = "Meta", + long, + default_value = "info", + value_name = "LEVEL", + possible_values = [ + PossibleValue::new("trace").help( + "Set to `trace` to print very low priority, often extremely verbose information." + ), + PossibleValue::new("debug").help("Set to debug when submitting a bug report."), + PossibleValue::new("info").help("Set to info to only print useful information."), + PossibleValue::new("warn").help("Set to warn to only print on hazardous situations."), + PossibleValue::new("error").help("Set to error to only print serious errors."), + PossibleValue::new("off").help( + "Set to off to disable logging completely, this will also disable output from `cargo-install`." + ), + ] + )] + pub log_level: LevelFilter, + + /// Equivalent to setting `log_level` to `off`. + /// + /// This would override the `log_level`. + #[clap(help_heading = "Meta", short, long)] + pub quiet: bool, +} + +#[derive(Debug, Copy, Clone, ArgEnum)] +pub enum TLSVersion { + #[clap(name = "1.2")] + Tls1_2, + #[clap(name = "1.3")] + Tls1_3, +} + +impl From for Version { + fn from(ver: TLSVersion) -> Self { + match ver { + TLSVersion::Tls1_2 => Version::TLS_1_2, + TLSVersion::Tls1_3 => Version::TLS_1_3, + } + } +} + +pub fn parse() -> Result { + // Filter extraneous arg when invoked by cargo + // `cargo run -- --help` gives ["target/debug/cargo-binstall", "--help"] + // `cargo binstall --help` gives ["/home/ryan/.cargo/bin/cargo-binstall", "binstall", "--help"] + let mut args: Vec = std::env::args_os().collect(); + let args = if args.len() > 1 && args[1] == "binstall" { + // Equivalent to + // + // args.remove(1); + // + // But is O(1) + args.swap(0, 1); + let mut args = args.into_iter(); + drop(args.next().unwrap()); + + args + } else { + args.into_iter() + }; + + // Load options + let mut opts = Args::parse_from(args); + if opts.quiet { + opts.log_level = LevelFilter::Off; + } + + if opts.crate_names.len() > 1 { + let option = if opts.version_req.is_some() { + "version" + } else if opts.manifest_path.is_some() { + "manifest-path" + } else if opts.bin_dir.is_some() { + "bin-dir" + } else if opts.pkg_fmt.is_some() { + "pkg-fmt" + } else if opts.pkg_url.is_some() { + "pkg-url" + } else { + "" + }; + + if !option.is_empty() { + return Err(BinstallError::OverrideOptionUsedWithMultiInstall { option }.into()); + } + } + + Ok(opts) +} diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs new file mode 100644 index 00000000..5d23a316 --- /dev/null +++ b/crates/bin/src/entry.rs @@ -0,0 +1,237 @@ +use std::{fs, path::Path, sync::Arc, time::Duration}; + +use binstall::{ + errors::BinstallError, + helpers::{ + jobserver_client::LazyJobserverClient, remote::create_reqwest_client, + tasks::AutoAbortJoinHandle, + }, + manifests::{ + binstall_crates_v1::Records, cargo_crates_v1::CratesToml, cargo_toml_binstall::PkgOverride, + }, + ops::{ + self, + resolve::{CrateName, Resolution, VersionReqExt}, + }, + targets::get_desired_targets, +}; +use log::{debug, error, info, warn, LevelFilter}; +use miette::{miette, Result, WrapErr}; +use tokio::task::block_in_place; + +use crate::{args::Args, install_path, ui::UIThread}; + +pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClient) -> Result<()> { + let cli_overrides = PkgOverride { + pkg_url: args.pkg_url.take(), + pkg_fmt: args.pkg_fmt.take(), + bin_dir: args.bin_dir.take(), + }; + + // Launch target detection + let desired_targets = get_desired_targets(&args.targets); + + // Initialize reqwest client + let client = create_reqwest_client(args.secure, args.min_tls_version.map(|v| v.into()))?; + + // Build crates.io api client + let crates_io_api_client = crates_io_api::AsyncClient::new( + "cargo-binstall (https://github.com/ryankurte/cargo-binstall)", + Duration::from_millis(100), + ) + .expect("bug: invalid user agent"); + + // Initialize UI thread + let mut uithread = UIThread::new(!args.no_confirm); + + let (install_path, metadata, temp_dir) = block_in_place(|| -> Result<_> { + // Compute install directory + let (install_path, custom_install_path) = + install_path::get_install_path(args.install_path.as_deref()); + let install_path = install_path.ok_or_else(|| { + error!("No viable install path found of specified, try `--install-path`"); + miette!("No install path found or specified") + })?; + fs::create_dir_all(&install_path).map_err(BinstallError::Io)?; + debug!("Using install path: {}", install_path.display()); + + // Load metadata + let metadata = if !custom_install_path { + debug!("Reading binstall/crates-v1.json"); + Some(Records::load()?) + } else { + None + }; + + // Create a temporary directory for downloads etc. + // + // Put all binaries to a temporary directory under `dst` first, catching + // some failure modes (e.g., out of space) before touching the existing + // binaries. This directory will get cleaned up via RAII. + let temp_dir = tempfile::Builder::new() + .prefix("cargo-binstall") + .tempdir_in(&install_path) + .map_err(BinstallError::from) + .wrap_err("Creating a temporary directory failed.")?; + + Ok((install_path, metadata, temp_dir)) + })?; + + // Remove installed crates + let crate_names = CrateName::dedup(&args.crate_names) + .filter_map(|crate_name| { + match ( + args.force, + metadata.as_ref().and_then(|records| records.get(&crate_name.name)), + &crate_name.version_req, + ) { + (false, Some(metadata), Some(version_req)) + if version_req.is_latest_compatible(&metadata.current_version) => + { + debug!("Bailing out early because we can assume wanted is already installed from metafile"); + info!( + "{} v{} is already installed, use --force to override", + crate_name.name, metadata.current_version + ); + None + } + + // we have to assume that the version req could be *, + // and therefore a remote upgraded version could exist + (false, Some(metadata), _) => { + Some((crate_name, Some(metadata.current_version.clone()))) + } + + _ => Some((crate_name, None)), + } + }) + .collect::>(); + + if crate_names.is_empty() { + debug!("Nothing to do"); + return Ok(()); + } + + let temp_dir_path: Arc = Arc::from(temp_dir.path()); + + // Create binstall_opts + let binstall_opts = Arc::new(ops::Options { + no_symlinks: args.no_symlinks, + dry_run: args.dry_run, + force: args.force, + version_req: args.version_req.take(), + manifest_path: args.manifest_path.take(), + cli_overrides, + desired_targets, + quiet: args.log_level == LevelFilter::Off, + }); + + let tasks: Vec<_> = if !args.dry_run && !args.no_confirm { + // Resolve crates + let tasks: Vec<_> = crate_names + .into_iter() + .map(|(crate_name, current_version)| { + AutoAbortJoinHandle::spawn(ops::resolve::resolve( + binstall_opts.clone(), + crate_name, + current_version, + temp_dir_path.clone(), + install_path.clone(), + client.clone(), + crates_io_api_client.clone(), + )) + }) + .collect(); + + // Confirm + let mut resolutions = Vec::with_capacity(tasks.len()); + for task in tasks { + match task.await?? { + Resolution::AlreadyUpToDate => {} + res => resolutions.push(res), + } + } + + if resolutions.is_empty() { + debug!("Nothing to do"); + return Ok(()); + } + + uithread.confirm().await?; + + // Install + resolutions + .into_iter() + .map(|resolution| { + AutoAbortJoinHandle::spawn(ops::install::install( + resolution, + binstall_opts.clone(), + jobserver_client.clone(), + )) + }) + .collect() + } else { + // Resolve crates and install without confirmation + crate_names + .into_iter() + .map(|(crate_name, current_version)| { + let opts = binstall_opts.clone(); + let temp_dir_path = temp_dir_path.clone(); + let jobserver_client = jobserver_client.clone(); + let client = client.clone(); + let crates_io_api_client = crates_io_api_client.clone(); + let install_path = install_path.clone(); + + AutoAbortJoinHandle::spawn(async move { + let resolution = ops::resolve::resolve( + opts.clone(), + crate_name, + current_version, + temp_dir_path, + install_path, + client, + crates_io_api_client, + ) + .await?; + + ops::install::install(resolution, opts, jobserver_client).await + }) + }) + .collect() + }; + + let mut metadata_vec = Vec::with_capacity(tasks.len()); + for task in tasks { + if let Some(metadata) = task.await?? { + metadata_vec.push(metadata); + } + } + + block_in_place(|| { + if let Some(mut records) = metadata { + // If using standardised install path, + // then create_dir_all(&install_path) would also + // create .cargo. + + debug!("Writing .crates.toml"); + CratesToml::append(metadata_vec.iter())?; + + debug!("Writing binstall/crates-v1.json"); + for metadata in metadata_vec { + records.replace(metadata); + } + records.overwrite()?; + } + + if args.no_cleanup { + // Consume temp_dir without removing it from fs. + temp_dir.into_path(); + } else { + temp_dir.close().unwrap_or_else(|err| { + warn!("Failed to clean up some resources: {err}"); + }); + } + + Ok(()) + }) +} diff --git a/crates/bin/src/install_path.rs b/crates/bin/src/install_path.rs new file mode 100644 index 00000000..a64f6260 --- /dev/null +++ b/crates/bin/src/install_path.rs @@ -0,0 +1,39 @@ +use std::{ + path::{Path, PathBuf}, + sync::Arc, +}; + +use binstall::helpers::statics::cargo_home; +use log::debug; + +/// Fetch install path from environment +/// roughly follows +/// +/// Return (install_path, is_custom_install_path) +pub fn get_install_path>(install_path: Option

) -> (Option>, bool) { + // Command line override first first + if let Some(p) = install_path { + return (Some(Arc::from(p.as_ref())), true); + } + + // Environmental variables + if let Ok(p) = std::env::var("CARGO_INSTALL_ROOT") { + debug!("using CARGO_INSTALL_ROOT ({p})"); + let b = PathBuf::from(p); + return (Some(Arc::from(b.join("bin"))), true); + } + + if let Ok(p) = cargo_home() { + debug!("using ({}) as cargo home", p.display()); + return (Some(p.join("bin").into()), false); + } + + // Local executable dir if no cargo is found + let dir = dirs::executable_dir(); + + if let Some(d) = &dir { + debug!("Fallback to {}", d.display()); + } + + (dir.map(Arc::from), true) +} diff --git a/crates/bin/src/main.rs b/crates/bin/src/main.rs new file mode 100644 index 00000000..d02828d2 --- /dev/null +++ b/crates/bin/src/main.rs @@ -0,0 +1,78 @@ +use std::{ + process::{ExitCode, Termination}, + time::{Duration, Instant}, +}; + +use binstall::{ + errors::BinstallError, + helpers::{ + jobserver_client::LazyJobserverClient, signal::cancel_on_user_sig_term, + tasks::AutoAbortJoinHandle, + }, +}; +use log::{debug, error, info}; +use tokio::runtime::Runtime; + +mod args; +mod entry; +mod install_path; +mod ui; + +#[cfg(feature = "mimalloc")] +#[global_allocator] +static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; + +fn main() -> MainExit { + // This must be the very first thing to happen + let jobserver_client = LazyJobserverClient::new(); + + let args = match args::parse() { + Ok(args) => args, + Err(err) => return MainExit::Error(err), + }; + + ui::logging(&args); + + let start = Instant::now(); + + let result = { + let rt = Runtime::new().unwrap(); + let handle = + AutoAbortJoinHandle::new(rt.spawn(entry::install_crates(args, jobserver_client))); + rt.block_on(cancel_on_user_sig_term(handle)) + }; + + let done = start.elapsed(); + debug!("run time: {done:?}"); + + result.map_or_else(MainExit::Error, |res| { + res.map(|()| MainExit::Success(done)).unwrap_or_else(|err| { + err.downcast::() + .map(MainExit::Error) + .unwrap_or_else(MainExit::Report) + }) + }) +} + +enum MainExit { + Success(Duration), + Error(BinstallError), + Report(miette::Report), +} + +impl Termination for MainExit { + fn report(self) -> ExitCode { + match self { + Self::Success(spent) => { + info!("Done in {spent:?}"); + ExitCode::SUCCESS + } + Self::Error(err) => err.report(), + Self::Report(err) => { + error!("Fatal error:"); + eprintln!("{err:?}"); + ExitCode::from(16) + } + } + } +} diff --git a/src/helpers/ui_thread.rs b/crates/bin/src/ui.rs similarity index 80% rename from src/helpers/ui_thread.rs rename to crates/bin/src/ui.rs index 64a20c55..e10932da 100644 --- a/src/helpers/ui_thread.rs +++ b/crates/bin/src/ui.rs @@ -3,9 +3,13 @@ use std::{ thread, }; +use log::LevelFilter; +use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; use tokio::sync::mpsc; -use crate::BinstallError; +use binstall::errors::BinstallError; + +use crate::args::Args; #[derive(Debug)] struct UIThreadInner { @@ -97,3 +101,19 @@ impl UIThread { } } } + +pub fn logging(args: &Args) { + // Setup logging + let mut log_config = ConfigBuilder::new(); + log_config.add_filter_ignore("hyper".to_string()); + log_config.add_filter_ignore("reqwest".to_string()); + log_config.add_filter_ignore("rustls".to_string()); + log_config.set_location_level(LevelFilter::Off); + TermLogger::init( + args.log_level, + log_config.build(), + TerminalMode::Mixed, + ColorChoice::Auto, + ) + .unwrap(); +} diff --git a/windows.manifest b/crates/bin/windows.manifest similarity index 100% rename from windows.manifest rename to crates/bin/windows.manifest diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml new file mode 100644 index 00000000..e9d4241c --- /dev/null +++ b/crates/detect-wasi/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "detect-wasi" +description = "Detect if WASI can be run" +repository = "https://github.com/cargo-bins/cargo-binstall" +documentation = "https://docs.rs/detect-wasi" +version = "1.0.0" +rust-version = "1.61.0" +authors = ["Félix Saparelli "] +edition = "2021" +license = "Apache-2.0 OR MIT" + +[dependencies] +tempfile = "3.3.0" diff --git a/crates/detect-wasi/LICENSE-APACHE b/crates/detect-wasi/LICENSE-APACHE new file mode 100644 index 00000000..1b5ec8b7 --- /dev/null +++ b/crates/detect-wasi/LICENSE-APACHE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/crates/detect-wasi/LICENSE-MIT b/crates/detect-wasi/LICENSE-MIT new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/crates/detect-wasi/LICENSE-MIT @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/examples/detect-wasi.rs b/crates/detect-wasi/src/bin/detect-wasi.rs similarity index 81% rename from examples/detect-wasi.rs rename to crates/detect-wasi/src/bin/detect-wasi.rs index d3224fce..c5cc8f99 100644 --- a/examples/detect-wasi.rs +++ b/crates/detect-wasi/src/bin/detect-wasi.rs @@ -1,6 +1,6 @@ use std::process::exit; -use cargo_binstall::wasi::detect_wasi_runability; +use detect_wasi::detect_wasi_runability; fn main() { if detect_wasi_runability().unwrap() { diff --git a/src/wasi.rs b/crates/detect-wasi/src/lib.rs similarity index 88% rename from src/wasi.rs rename to crates/detect-wasi/src/lib.rs index c1c1340f..e780276f 100644 --- a/src/wasi.rs +++ b/crates/detect-wasi/src/lib.rs @@ -1,11 +1,13 @@ -use std::{fs::File, io::Write, process::Command}; +use std::{ + fs::File, + io::{Result, Write}, + process::Command, +}; #[cfg(unix)] use std::{fs::Permissions, os::unix::fs::PermissionsExt}; use tempfile::tempdir; -use crate::errors::BinstallError; - const WASI_PROGRAM: &[u8] = include_bytes!("miniwasi.wasm"); /// Detect the ability to run WASI @@ -21,7 +23,7 @@ const WASI_PROGRAM: &[u8] = include_bytes!("miniwasi.wasm"); /// ```plain /// :wasi:M::\x00asm::/usr/bin/wasmtime: /// ``` -pub fn detect_wasi_runability() -> Result { +pub fn detect_wasi_runability() -> Result { let progdir = tempdir()?; let prog = progdir.path().join("miniwasi.wasm"); diff --git a/src/miniwasi.wasm b/crates/detect-wasi/src/miniwasi.wasm similarity index 100% rename from src/miniwasi.wasm rename to crates/detect-wasi/src/miniwasi.wasm diff --git a/src/miniwasi.wast b/crates/detect-wasi/src/miniwasi.wast similarity index 100% rename from src/miniwasi.wast rename to crates/detect-wasi/src/miniwasi.wast diff --git a/crates/flock/Cargo.toml b/crates/flock/Cargo.toml new file mode 100644 index 00000000..e9ce16b9 --- /dev/null +++ b/crates/flock/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "flock" +description = "Locked files that can be used like normal File" +repository = "https://github.com/cargo-bins/cargo-binstall" +documentation = "https://docs.rs/flock" +version = "0.1.0" +rust-version = "1.61.0" +authors = ["Jiahao XU "] +edition = "2021" +license = "Apache-2.0 OR MIT" + +[dependencies] +fs4 = "0.6.2" diff --git a/crates/flock/LICENSE-APACHE b/crates/flock/LICENSE-APACHE new file mode 100644 index 00000000..1b5ec8b7 --- /dev/null +++ b/crates/flock/LICENSE-APACHE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/crates/flock/LICENSE-MIT b/crates/flock/LICENSE-MIT new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/crates/flock/LICENSE-MIT @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/crates/flock/src/lib.rs b/crates/flock/src/lib.rs new file mode 100644 index 00000000..9adb4927 --- /dev/null +++ b/crates/flock/src/lib.rs @@ -0,0 +1,90 @@ +//! Locked files with the same API as normal [`File`]s. +//! +//! These use the same mechanisms as, and are interoperable with, Cargo. + +use std::{ + fs::File, + io::{self, IoSlice, IoSliceMut, Result, SeekFrom}, + ops, +}; + +use fs4::FileExt; + +/// A locked file. +#[derive(Debug)] +pub struct FileLock(File); + +impl FileLock { + /// Take an exclusive lock on a [`File`]. + /// + /// Note that this operation is blocking, and should not be called in async contexts. + pub fn new_exclusive(file: File) -> Result { + file.lock_exclusive()?; + + Ok(Self(file)) + } + + /// Take a shared lock on a [`File`]. + /// + /// Note that this operation is blocking, and should not be called in async contexts. + pub fn new_shared(file: File) -> Result { + file.lock_shared()?; + + Ok(Self(file)) + } +} + +impl Drop for FileLock { + fn drop(&mut self) { + let _ = self.unlock(); + } +} + +impl ops::Deref for FileLock { + type Target = File; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} +impl ops::DerefMut for FileLock { + fn deref_mut(&mut self) -> &mut Self::Target { + &mut self.0 + } +} + +impl io::Write for FileLock { + fn write(&mut self, buf: &[u8]) -> Result { + self.0.write(buf) + } + fn flush(&mut self) -> Result<()> { + self.0.flush() + } + + fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result { + self.0.write_vectored(bufs) + } +} + +impl io::Read for FileLock { + fn read(&mut self, buf: &mut [u8]) -> Result { + self.0.read(buf) + } + + fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result { + self.0.read_vectored(bufs) + } +} + +impl io::Seek for FileLock { + fn seek(&mut self, pos: SeekFrom) -> Result { + self.0.seek(pos) + } + + fn rewind(&mut self) -> Result<()> { + self.0.rewind() + } + fn stream_position(&mut self) -> Result { + self.0.stream_position() + } +} diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml new file mode 100644 index 00000000..92b088fa --- /dev/null +++ b/crates/lib/Cargo.toml @@ -0,0 +1,75 @@ +[package] +name = "binstall" +description = "Library backend for cargo-binstall" +repository = "https://github.com/cargo-bins/cargo-binstall" +documentation = "https://docs.rs/binstall" +version = "0.1.0" +rust-version = "1.61.0" +authors = ["ryan "] +edition = "2021" +license = "GPL-3.0" + +[dependencies] +async-trait = "0.1.57" +bytes = "1.2.1" +bzip2 = "0.4.3" +cargo_toml = "0.11.5" +clap = { version = "3.2.16", features = ["derive"] } +compact_str = { version = "0.5.2", features = ["serde"] } +crates_io_api = { version = "0.8.0", default-features = false } +flate2 = { version = "1.0.24", default-features = false } +flock = { version = "0.1.0", path = "../flock" } +futures-util = { version = "0.3.21", default-features = false } +home = "0.5.3" +itertools = "0.10.3" +jobserver = "0.1.24" +log = { version = "0.4.17", features = ["std"] } +miette = "5.2.0" +normalize-path = { version = "0.1.0", path = "../normalize-path" } +once_cell = "1.13.0" +reqwest = { version = "0.11.11", features = ["stream"], default-features = false } +scopeguard = "1.1.0" +semver = { version = "1.0.13", features = ["serde"] } +serde = { version = "1.0.142", features = ["derive"] } +serde-tuple-vec-map = "1.0.1" +serde_json = "1.0.83" +strum = "0.24.1" +strum_macros = "0.24.3" +tar = "0.4.38" +tempfile = "3.3.0" +thiserror = "1.0.32" +tinytemplate = "1.2.1" +tokio = { version = "1.20.1", features = ["macros", "rt", "process", "sync", "signal"], default-features = false } +toml_edit = { version = "0.14.4", features = ["easy"] } +url = { version = "2.2.2", features = ["serde"] } +xz2 = "0.1.7" + +# Disable all features of zip except for features of compression algorithms: +# Disabled features include: +# - aes-crypto: Enables decryption of files which were encrypted with AES, absolutely zero use for +# this crate. +# - time: Enables features using the [time](https://github.com/time-rs/time) crate, +# which is not used by this crate. +zip = { version = "0.6.2", default-features = false, features = ["deflate", "bzip2", "zstd"] } + +# zstd is also depended by zip. +# Since zip 0.6.2 depends on zstd 0.10.0, we also have to use 0.10.0 here, +# otherwise there will be a link conflict. +zstd = { version = "0.10.0", default-features = false } + +[target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] +guess_host_triple = "0.1.3" + +[dev-dependencies] +env_logger = "0.9.0" + +[features] +default = ["static", "zlib-ng", "rustls"] + +static = ["bzip2/static", "xz2/static"] +pkg-config = ["zstd/pkg-config"] + +zlib-ng = ["flate2/zlib-ng"] + +rustls = ["crates_io_api/rustls", "reqwest/rustls-tls"] +native-tls = ["reqwest/native-tls"] diff --git a/crates/lib/LICENSE b/crates/lib/LICENSE new file mode 100644 index 00000000..f288702d --- /dev/null +++ b/crates/lib/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/build.rs b/crates/lib/build.rs similarity index 79% rename from build.rs rename to crates/lib/build.rs index 961d0241..729c4c54 100644 --- a/build.rs +++ b/crates/lib/build.rs @@ -1,6 +1,4 @@ fn main() { - embed_resource::compile("manifest.rc"); - // Fetch build target and define this for the compiler println!( "cargo:rustc-env=TARGET={}", diff --git a/src/bins.rs b/crates/lib/src/bins.rs similarity index 90% rename from src/bins.rs rename to crates/lib/src/bins.rs index f7d2041c..c3b330ef 100644 --- a/src/bins.rs +++ b/crates/lib/src/bins.rs @@ -4,8 +4,13 @@ use cargo_toml::Product; use compact_str::CompactString; use log::debug; use serde::Serialize; +use tinytemplate::TinyTemplate; -use crate::{atomic_install, atomic_symlink_file, BinstallError, PkgFmt, PkgMeta, Template}; +use crate::{ + errors::BinstallError, + fs::{atomic_install, atomic_symlink_file}, + manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, +}; pub struct BinFile { pub base_name: CompactString, @@ -148,4 +153,10 @@ struct Context<'c> { pub binary_ext: &'c str, } -impl<'c> Template for Context<'c> {} +impl<'c> Context<'c> { + fn render(&self, template: &str) -> Result { + let mut tt = TinyTemplate::new(); + tt.add_template("path", template)?; + Ok(tt.render("path", self)?) + } +} diff --git a/crates/lib/src/drivers.rs b/crates/lib/src/drivers.rs new file mode 100644 index 00000000..54304a92 --- /dev/null +++ b/crates/lib/src/drivers.rs @@ -0,0 +1,5 @@ +mod version; +use version::find_version; + +mod crates_io; +pub use crates_io::fetch_crate_cratesio; diff --git a/src/drivers/crates_io.rs b/crates/lib/src/drivers/crates_io.rs similarity index 90% rename from src/drivers/crates_io.rs rename to crates/lib/src/drivers/crates_io.rs index 7dda6fa6..0ac81d64 100644 --- a/src/drivers/crates_io.rs +++ b/crates/lib/src/drivers/crates_io.rs @@ -7,8 +7,13 @@ use reqwest::Client; use semver::VersionReq; use url::Url; +use crate::{ + errors::BinstallError, + helpers::download::download_tar_based_and_visit, + manifests::cargo_toml_binstall::{Meta, TarBasedFmt}, +}; + use super::find_version; -use crate::{helpers::*, BinstallError, Meta, TarBasedFmt}; mod vfs; diff --git a/src/drivers/crates_io/vfs.rs b/crates/lib/src/drivers/crates_io/vfs.rs similarity index 88% rename from src/drivers/crates_io/vfs.rs rename to crates/lib/src/drivers/crates_io/vfs.rs index 66e4875e..3cd53627 100644 --- a/src/drivers/crates_io/vfs.rs +++ b/crates/lib/src/drivers/crates_io/vfs.rs @@ -1,10 +1,11 @@ -use std::collections::{hash_map::HashMap, hash_set::HashSet}; -use std::io; -use std::path::Path; +use std::{ + collections::{hash_map::HashMap, hash_set::HashSet}, + io, + path::Path, +}; use cargo_toml::AbstractFilesystem; - -use crate::helpers::PathExt; +use normalize_path::NormalizePath; /// This type stores the filesystem structure for the crate tarball /// extracted in memory and can be passed to @@ -39,7 +40,7 @@ impl Vfs { impl AbstractFilesystem for Vfs { fn file_names_in(&self, rel_path: &str) -> io::Result>> { - let rel_path = Path::new(rel_path).normalize_path(); + let rel_path = Path::new(rel_path).normalize(); Ok(self.0.get(&*rel_path).map(Clone::clone).unwrap_or_default()) } diff --git a/src/drivers/crates_io/visitor.rs b/crates/lib/src/drivers/crates_io/visitor.rs similarity index 90% rename from src/drivers/crates_io/visitor.rs rename to crates/lib/src/drivers/crates_io/visitor.rs index 0eb7bd6c..5efc8012 100644 --- a/src/drivers/crates_io/visitor.rs +++ b/crates/lib/src/drivers/crates_io/visitor.rs @@ -1,14 +1,17 @@ -use std::io::Read; -use std::path::{Path, PathBuf}; +use std::{ + io::Read, + path::{Path, PathBuf}, +}; use cargo_toml::Manifest; use log::debug; +use normalize_path::NormalizePath; use tar::Entries; use super::vfs::Vfs; use crate::{ - helpers::{PathExt, TarEntriesVisitor}, - BinstallError, Meta, + errors::BinstallError, helpers::async_extracter::TarEntriesVisitor, + manifests::cargo_toml_binstall::Meta, }; #[derive(Debug)] @@ -38,7 +41,7 @@ impl TarEntriesVisitor for ManifestVisitor { for res in entries { let mut entry = res?; let path = entry.path()?; - let path = path.normalize_path(); + let path = path.normalize(); let path = if let Ok(path) = path.strip_prefix(&self.manifest_dir_path) { path diff --git a/src/drivers/version.rs b/crates/lib/src/drivers/version.rs similarity index 97% rename from src/drivers/version.rs rename to crates/lib/src/drivers/version.rs index abddbc61..4b8b7413 100644 --- a/src/drivers/version.rs +++ b/crates/lib/src/drivers/version.rs @@ -1,7 +1,7 @@ use log::debug; use semver::VersionReq; -use crate::BinstallError; +use crate::errors::BinstallError; pub(super) trait Version { /// Return `None` on error. diff --git a/src/errors.rs b/crates/lib/src/errors.rs similarity index 100% rename from src/errors.rs rename to crates/lib/src/errors.rs diff --git a/src/fetchers.rs b/crates/lib/src/fetchers.rs similarity index 94% rename from src/fetchers.rs rename to crates/lib/src/fetchers.rs index 2d12e13e..a61742aa 100644 --- a/src/fetchers.rs +++ b/crates/lib/src/fetchers.rs @@ -1,5 +1,4 @@ -use std::path::Path; -use std::sync::Arc; +use std::{path::Path, sync::Arc}; use compact_str::CompactString; pub use gh_crate_meta::*; @@ -7,7 +6,11 @@ pub use log::debug; pub use quickinstall::*; use reqwest::Client; -use crate::{AutoAbortJoinHandle, BinstallError, PkgFmt, PkgMeta}; +use crate::{ + errors::BinstallError, + helpers::tasks::AutoAbortJoinHandle, + manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, +}; mod gh_crate_meta; mod quickinstall; diff --git a/src/fetchers/gh_crate_meta.rs b/crates/lib/src/fetchers/gh_crate_meta.rs similarity index 95% rename from src/fetchers/gh_crate_meta.rs rename to crates/lib/src/fetchers/gh_crate_meta.rs index 2c009ff8..bac96a20 100644 --- a/src/fetchers/gh_crate_meta.rs +++ b/crates/lib/src/fetchers/gh_crate_meta.rs @@ -1,19 +1,21 @@ -use std::path::Path; -use std::sync::Arc; +use std::{path::Path, sync::Arc}; use compact_str::{CompactString, ToCompactString}; use log::{debug, warn}; use once_cell::sync::OnceCell; -use reqwest::Client; -use reqwest::Method; +use reqwest::{Client, Method}; use serde::Serialize; +use tinytemplate::TinyTemplate; use url::Url; -use super::Data; use crate::{ - download_and_extract, remote_exists, AutoAbortJoinHandle, BinstallError, PkgFmt, Template, + errors::BinstallError, + helpers::{download::download_and_extract, remote::remote_exists, tasks::AutoAbortJoinHandle}, + manifests::cargo_toml_binstall::PkgFmt, }; +use super::Data; + pub struct GhCrateMeta { client: Client, data: Data, @@ -124,8 +126,6 @@ struct Context<'c> { pub binary_ext: &'c str, } -impl<'c> Template for Context<'c> {} - impl<'c> Context<'c> { pub(self) fn from_data(data: &'c Data, archive_format: &'c str) -> Self { Self { @@ -145,14 +145,18 @@ impl<'c> Context<'c> { pub(self) fn render_url(&self, template: &str) -> Result { debug!("Render {template:?} using context: {:?}", self); - Ok(Url::parse(&self.render(template)?)?) + + let mut tt = TinyTemplate::new(); + tt.add_template("path", template)?; + Ok(Url::parse(&tt.render("path", self)?)?) } } #[cfg(test)] mod test { + use crate::manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}; + use super::{super::Data, Context}; - use crate::{PkgFmt, PkgMeta}; use url::Url; fn url(s: &str) -> Url { diff --git a/src/fetchers/quickinstall.rs b/crates/lib/src/fetchers/quickinstall.rs similarity index 93% rename from src/fetchers/quickinstall.rs rename to crates/lib/src/fetchers/quickinstall.rs index 0bdaa290..015e6273 100644 --- a/src/fetchers/quickinstall.rs +++ b/crates/lib/src/fetchers/quickinstall.rs @@ -1,5 +1,4 @@ -use std::path::Path; -use std::sync::Arc; +use std::{path::Path, sync::Arc}; use compact_str::CompactString; use log::debug; @@ -8,8 +7,13 @@ use reqwest::Method; use tokio::task::JoinHandle; use url::Url; +use crate::{ + errors::BinstallError, + helpers::{download::download_and_extract, remote::remote_exists}, + manifests::cargo_toml_binstall::PkgFmt, +}; + use super::Data; -use crate::{download_and_extract, remote_exists, BinstallError, PkgFmt}; const BASE_URL: &str = "https://github.com/alsuren/cargo-quickinstall/releases/download"; const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; diff --git a/crates/lib/src/fs.rs b/crates/lib/src/fs.rs new file mode 100644 index 00000000..2e4f09c6 --- /dev/null +++ b/crates/lib/src/fs.rs @@ -0,0 +1,103 @@ +use std::{fs, io, path::Path}; + +use log::debug; +use tempfile::NamedTempFile; + +/// Returned file is readable and writable. +pub fn create_if_not_exist(path: impl AsRef) -> io::Result { + let path = path.as_ref(); + + let mut options = fs::File::options(); + options.read(true).write(true); + + options + .clone() + .create_new(true) + .open(path) + .or_else(|_| options.open(path)) +} + +/// Atomically install a file. +/// +/// This is a blocking function, must be called in `block_in_place` mode. +pub fn atomic_install(src: &Path, dst: &Path) -> io::Result<()> { + debug!( + "Attempting to atomically rename from '{}' to '{}'", + src.display(), + dst.display() + ); + + if let Err(err) = fs::rename(src, dst) { + debug!("Attempting at atomic rename failed: {err:#?}, fallback to creating tempfile."); + // src and dst is not on the same filesystem/mountpoint. + // Fallback to creating NamedTempFile on the parent dir of + // dst. + + let mut src_file = fs::File::open(src)?; + + let parent = dst.parent().unwrap(); + debug!("Creating named tempfile at '{}'", parent.display()); + let mut tempfile = NamedTempFile::new_in(parent)?; + + debug!( + "Copying from '{}' to '{}'", + src.display(), + tempfile.path().display() + ); + io::copy(&mut src_file, tempfile.as_file_mut())?; + + debug!("Retrieving permissions of '{}'", src.display()); + let permissions = src_file.metadata()?.permissions(); + + debug!( + "Setting permissions of '{}' to '{permissions:#?}'", + tempfile.path().display() + ); + tempfile.as_file().set_permissions(permissions)?; + + debug!( + "Persisting '{}' to '{}'", + tempfile.path().display(), + dst.display() + ); + tempfile.persist(dst).map_err(io::Error::from)?; + } else { + debug!("Attempting at atomically succeeded."); + } + + Ok(()) +} + +fn symlink_file, Q: AsRef>(original: P, link: Q) -> io::Result<()> { + #[cfg(target_family = "unix")] + let f = std::os::unix::fs::symlink; + #[cfg(target_family = "windows")] + let f = std::os::windows::fs::symlink_file; + + f(original, link) +} + +/// Atomically install symlink "link" to a file "dst". +/// +/// This is a blocking function, must be called in `block_in_place` mode. +pub fn atomic_symlink_file(dest: &Path, link: &Path) -> io::Result<()> { + let parent = link.parent().unwrap(); + + debug!("Creating tempPath at '{}'", parent.display()); + let temp_path = NamedTempFile::new_in(parent)?.into_temp_path(); + fs::remove_file(&temp_path)?; + + debug!( + "Creating symlink '{}' to file '{}'", + temp_path.display(), + dest.display() + ); + symlink_file(dest, &temp_path)?; + + debug!( + "Persisting '{}' to '{}'", + temp_path.display(), + link.display() + ); + temp_path.persist(link).map_err(io::Error::from) +} diff --git a/crates/lib/src/helpers.rs b/crates/lib/src/helpers.rs new file mode 100644 index 00000000..16ade8b4 --- /dev/null +++ b/crates/lib/src/helpers.rs @@ -0,0 +1,9 @@ +pub mod async_extracter; +pub mod download; +pub mod extracter; +pub mod jobserver_client; +pub mod remote; +pub mod signal; +pub mod statics; +pub mod stream_readable; +pub mod tasks; diff --git a/src/helpers/async_extracter.rs b/crates/lib/src/helpers/async_extracter.rs similarity index 79% rename from src/helpers/async_extracter.rs rename to crates/lib/src/helpers/async_extracter.rs index 9986c48a..844fbc0b 100644 --- a/src/helpers/async_extracter.rs +++ b/crates/lib/src/helpers/async_extracter.rs @@ -1,21 +1,9 @@ -//! # Advantages -//! -//! Using this mod has the following advantages over downloading -//! to file then extracting: -//! -//! - The code is pipelined instead of storing the downloaded file in memory -//! and extract it, except for `PkgFmt::Zip`, since `ZipArchiver::new` -//! requires `std::io::Seek`, so it fallbacks to writing the a file then -//! unzip it. -//! - Compressing/writing which takes a lot of CPU time will not block -//! the runtime anymore. -//! - For all `tar` based formats, it can extract only specified files and -//! process them in memory, without any disk I/O. - -use std::fmt::Debug; -use std::fs; -use std::io::{copy, Read, Seek}; -use std::path::Path; +use std::{ + fmt::Debug, + fs, + io::{copy, Read, Seek}, + path::Path, +}; use bytes::Bytes; use futures_util::stream::Stream; @@ -25,8 +13,9 @@ use tar::Entries; use tempfile::tempfile; use tokio::task::block_in_place; +use crate::{errors::BinstallError, manifests::cargo_toml_binstall::TarBasedFmt}; + use super::{extracter::*, stream_readable::StreamReadable}; -use crate::{BinstallError, TarBasedFmt}; pub async fn extract_bin(stream: S, path: &Path) -> Result<(), BinstallError> where diff --git a/crates/lib/src/helpers/download.rs b/crates/lib/src/helpers/download.rs new file mode 100644 index 00000000..25d94f49 --- /dev/null +++ b/crates/lib/src/helpers/download.rs @@ -0,0 +1,62 @@ +use std::{fmt::Debug, path::Path}; + +use log::debug; +use reqwest::{Client, Url}; + +use crate::{ + errors::BinstallError, + helpers::{ + async_extracter::{ + extract_bin, extract_tar_based_stream, extract_tar_based_stream_and_visit, extract_zip, + }, + remote::create_request, + }, + manifests::cargo_toml_binstall::{PkgFmt, PkgFmtDecomposed, TarBasedFmt}, +}; + +use super::async_extracter::TarEntriesVisitor; + +/// Download a file from the provided URL and extract it to the provided path. +pub async fn download_and_extract>( + client: &Client, + url: &Url, + fmt: PkgFmt, + path: P, +) -> Result<(), BinstallError> { + let stream = create_request(client, url.clone()).await?; + + let path = path.as_ref(); + debug!("Downloading and extracting to: '{}'", path.display()); + + match fmt.decompose() { + PkgFmtDecomposed::Tar(fmt) => extract_tar_based_stream(stream, path, fmt).await?, + PkgFmtDecomposed::Bin => extract_bin(stream, path).await?, + PkgFmtDecomposed::Zip => extract_zip(stream, path).await?, + } + + debug!("Download OK, extracted to: '{}'", path.display()); + + Ok(()) +} + +/// Download a file from the provided URL and extract part of it to +/// the provided path. +/// +/// * `filter` - If Some, then it will pass the path of the file to it +/// and only extract ones which filter returns `true`. +pub async fn download_tar_based_and_visit( + client: &Client, + url: Url, + fmt: TarBasedFmt, + visitor: V, +) -> Result { + let stream = create_request(client, url).await?; + + debug!("Downloading and extracting then in-memory processing"); + + let ret = extract_tar_based_stream_and_visit(stream, fmt, visitor).await?; + + debug!("Download, extraction and in-memory procession OK"); + + Ok(ret) +} diff --git a/src/helpers/extracter.rs b/crates/lib/src/helpers/extracter.rs similarity index 77% rename from src/helpers/extracter.rs rename to crates/lib/src/helpers/extracter.rs index 211f628e..43fa6d3c 100644 --- a/src/helpers/extracter.rs +++ b/crates/lib/src/helpers/extracter.rs @@ -1,6 +1,8 @@ -use std::fs::File; -use std::io::{self, BufRead, Read}; -use std::path::Path; +use std::{ + fs::File, + io::{self, BufRead, Read}, + path::Path, +}; use bzip2::bufread::BzDecoder; use flate2::bufread::GzDecoder; @@ -10,7 +12,7 @@ use xz2::bufread::XzDecoder; use zip::read::ZipArchive; use zstd::stream::Decoder as ZstdDecoder; -use crate::{BinstallError, TarBasedFmt}; +use crate::{errors::BinstallError, manifests::cargo_toml_binstall::TarBasedFmt}; pub(super) fn create_tar_decoder( dat: impl BufRead + 'static, @@ -24,9 +26,8 @@ pub(super) fn create_tar_decoder( Tgz => Box::new(GzDecoder::new(dat)), Txz => Box::new(XzDecoder::new(dat)), Tzstd => { - // The error can only come from raw::Decoder::with_dictionary - // as of zstd 0.10.2 and 0.11.2, which is specified - // as &[] by ZstdDecoder::new, thus ZstdDecoder::new + // The error can only come from raw::Decoder::with_dictionary as of zstd 0.10.2 and + // 0.11.2, which is specified as `&[]` by `ZstdDecoder::new`, thus `ZstdDecoder::new` // should not return any error. Box::new(ZstdDecoder::with_buffer(dat)?) } diff --git a/src/helpers/jobserver_client.rs b/crates/lib/src/helpers/jobserver_client.rs similarity index 88% rename from src/helpers/jobserver_client.rs rename to crates/lib/src/helpers/jobserver_client.rs index 14a6c5f2..acfbc6c5 100644 --- a/src/helpers/jobserver_client.rs +++ b/crates/lib/src/helpers/jobserver_client.rs @@ -1,11 +1,9 @@ -use std::num::NonZeroUsize; -use std::sync::Arc; -use std::thread::available_parallelism; +use std::{num::NonZeroUsize, sync::Arc, thread::available_parallelism}; use jobserver::Client; use tokio::sync::OnceCell; -use crate::BinstallError; +use crate::errors::BinstallError; #[derive(Clone)] pub struct LazyJobserverClient(Arc>); diff --git a/crates/lib/src/helpers/remote.rs b/crates/lib/src/helpers/remote.rs new file mode 100644 index 00000000..042ae7ce --- /dev/null +++ b/crates/lib/src/helpers/remote.rs @@ -0,0 +1,62 @@ +use std::env; + +use bytes::Bytes; +use futures_util::stream::Stream; +use log::debug; +use reqwest::{tls, Client, ClientBuilder, Method, Response}; +use url::Url; + +use crate::errors::BinstallError; + +pub fn create_reqwest_client( + secure: bool, + min_tls: Option, +) -> Result { + const USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")); + + let mut builder = ClientBuilder::new().user_agent(USER_AGENT); + + if secure { + builder = builder + .https_only(true) + .min_tls_version(tls::Version::TLS_1_2); + } + + if let Some(ver) = min_tls { + builder = builder.min_tls_version(ver); + } + + Ok(builder.build()?) +} + +pub async fn remote_exists( + client: Client, + url: Url, + method: Method, +) -> Result { + let req = client + .request(method.clone(), url.clone()) + .send() + .await + .map_err(|err| BinstallError::Http { method, url, err })?; + Ok(req.status().is_success()) +} + +pub(crate) async fn create_request( + client: &Client, + url: Url, +) -> Result>, BinstallError> { + debug!("Downloading from: '{url}'"); + + client + .get(url.clone()) + .send() + .await + .and_then(|r| r.error_for_status()) + .map_err(|err| BinstallError::Http { + method: Method::GET, + url, + err, + }) + .map(Response::bytes_stream) +} diff --git a/src/helpers/signal.rs b/crates/lib/src/helpers/signal.rs similarity index 97% rename from src/helpers/signal.rs rename to crates/lib/src/helpers/signal.rs index ecfe7c4a..e15ed8e1 100644 --- a/src/helpers/signal.rs +++ b/crates/lib/src/helpers/signal.rs @@ -1,8 +1,10 @@ -use futures_util::future::pending; use std::io; + +use futures_util::future::pending; use tokio::signal; -use super::{AutoAbortJoinHandle, BinstallError}; +use super::tasks::AutoAbortJoinHandle; +use crate::errors::BinstallError; /// This function will poll the handle while listening for ctrl_c, /// `SIGINT`, `SIGHUP`, `SIGTERM` and `SIGQUIT`. diff --git a/crates/lib/src/helpers/statics.rs b/crates/lib/src/helpers/statics.rs new file mode 100644 index 00000000..ecc490c8 --- /dev/null +++ b/crates/lib/src/helpers/statics.rs @@ -0,0 +1,23 @@ +use std::{ + io::Error, + ops::Deref, + path::{Path, PathBuf}, +}; + +use once_cell::sync::{Lazy, OnceCell}; +use url::Url; + +pub fn cargo_home() -> Result<&'static Path, Error> { + static CARGO_HOME: OnceCell = OnceCell::new(); + + CARGO_HOME + .get_or_try_init(home::cargo_home) + .map(Deref::deref) +} + +pub fn cratesio_url() -> &'static Url { + static CRATESIO: Lazy Url> = + Lazy::new(|| Url::parse("https://github.com/rust-lang/crates.io-index").unwrap()); + + &*CRATESIO +} diff --git a/src/helpers/stream_readable.rs b/crates/lib/src/helpers/stream_readable.rs similarity index 95% rename from src/helpers/stream_readable.rs rename to crates/lib/src/helpers/stream_readable.rs index 17113591..0f26d0a1 100644 --- a/src/helpers/stream_readable.rs +++ b/crates/lib/src/helpers/stream_readable.rs @@ -1,11 +1,13 @@ -use std::cmp::min; -use std::io::{self, BufRead, Read}; +use std::{ + cmp::min, + io::{self, BufRead, Read}, +}; use bytes::{Buf, Bytes}; use futures_util::stream::{Stream, StreamExt}; use tokio::runtime::Handle; -use super::BinstallError; +use crate::errors::BinstallError; /// This wraps an AsyncIterator as a `Read`able. /// It must be used in non-async context only, diff --git a/src/helpers/auto_abort_join_handle.rs b/crates/lib/src/helpers/tasks.rs similarity index 97% rename from src/helpers/auto_abort_join_handle.rs rename to crates/lib/src/helpers/tasks.rs index 669f352a..f1820be9 100644 --- a/src/helpers/auto_abort_join_handle.rs +++ b/crates/lib/src/helpers/tasks.rs @@ -7,7 +7,7 @@ use std::{ use tokio::task::JoinHandle; -use super::BinstallError; +use crate::errors::BinstallError; #[derive(Debug)] pub struct AutoAbortJoinHandle(JoinHandle); diff --git a/crates/lib/src/lib.rs b/crates/lib/src/lib.rs new file mode 100644 index 00000000..261a008b --- /dev/null +++ b/crates/lib/src/lib.rs @@ -0,0 +1,9 @@ +pub mod bins; +pub mod drivers; +pub mod errors; +pub mod fetchers; +pub mod fs; +pub mod helpers; +pub mod manifests; +pub mod ops; +pub mod targets; diff --git a/crates/lib/src/manifests.rs b/crates/lib/src/manifests.rs new file mode 100644 index 00000000..d5dc2542 --- /dev/null +++ b/crates/lib/src/manifests.rs @@ -0,0 +1,14 @@ +//! Manifest formats and utilities. +//! +//! There are three types of manifests Binstall may deal with: +//! - manifests that define how to fetch and install a package +//! ([Cargo.toml's `[metadata.binstall]`][cargo_toml_binstall]); +//! - manifests that record which packages _are_ installed +//! ([Cargo's `.crates.toml`][cargo_crates_v1] and +//! [Binstall's `.crates-v1.json`][binstall_crates_v1]); +//! - manifests that specify which packages _to_ install (currently none). + +pub mod binstall_crates_v1; +pub mod cargo_crates_v1; +pub mod cargo_toml_binstall; +pub mod crate_info; diff --git a/src/metafiles/binstall_v1.rs b/crates/lib/src/manifests/binstall_crates_v1.rs similarity index 68% rename from src/metafiles/binstall_v1.rs rename to crates/lib/src/manifests/binstall_crates_v1.rs index 2d429ec2..6593b81a 100644 --- a/src/metafiles/binstall_v1.rs +++ b/crates/lib/src/manifests/binstall_crates_v1.rs @@ -1,93 +1,27 @@ +//! Binstall's `crates-v1.json` manifest. +//! +//! This manifest is used by Binstall to record which crates were installed, and may be used by +//! other (third party) tooling to act upon these crates (e.g. upgrade them, list them, etc). +//! +//! The format is a series of JSON object concatenated together. It is _not_ NLJSON, though writing +//! NLJSON to the file will be understood fine. + use std::{ - borrow, cmp, collections::{btree_set, BTreeSet}, - fs, hash, + fs, io::{self, Seek, Write}, iter::{IntoIterator, Iterator}, path::{Path, PathBuf}, }; -use compact_str::CompactString; +use flock::FileLock; use miette::Diagnostic; -use semver::Version; -use serde::{Deserialize, Serialize}; +use serde::Serialize; use thiserror::Error; -use url::Url; -use crate::{cargo_home, cratesio_url, create_if_not_exist, FileLock}; +use crate::{fs::create_if_not_exist, helpers::statics::cargo_home}; -#[derive(Clone, Debug, Serialize, Deserialize)] -pub struct MetaData { - pub name: CompactString, - pub version_req: CompactString, - pub current_version: Version, - pub source: Source, - pub target: CompactString, - pub bins: Vec, - - /// Forwards compatibility. Unknown keys from future versions - /// will be stored here and retained when the file is saved. - /// - /// We use an `Vec` here since it is never accessed in Rust. - #[serde(flatten, with = "tuple_vec_map")] - pub other: Vec<(CompactString, serde_json::Value)>, -} - -impl borrow::Borrow for MetaData { - fn borrow(&self) -> &str { - &self.name - } -} - -impl PartialEq for MetaData { - fn eq(&self, other: &Self) -> bool { - self.name == other.name - } -} -impl Eq for MetaData {} - -impl PartialOrd for MetaData { - fn partial_cmp(&self, other: &Self) -> Option { - self.name.partial_cmp(&other.name) - } -} - -impl Ord for MetaData { - fn cmp(&self, other: &Self) -> cmp::Ordering { - self.name.cmp(&other.name) - } -} - -impl hash::Hash for MetaData { - fn hash(&self, state: &mut H) - where - H: hash::Hasher, - { - self.name.hash(state) - } -} - -#[derive(Debug, Copy, Clone, Serialize, Deserialize)] -pub enum SourceType { - Git, - Path, - Registry, -} - -#[derive(Clone, Debug, Serialize, Deserialize)] -pub struct Source { - pub source_type: SourceType, - pub url: Url, -} - -impl Source { - pub fn cratesio_registry() -> Source { - Self { - source_type: SourceType::Registry, - url: cratesio_url().clone(), - } - } -} +use super::crate_info::CrateInfo; #[derive(Debug, Diagnostic, Error)] pub enum Error { @@ -100,7 +34,7 @@ pub enum Error { pub fn append_to_path(path: impl AsRef, iter: Iter) -> Result<(), Error> where - Iter: IntoIterator, + Iter: IntoIterator, { let mut file = FileLock::new_exclusive(create_if_not_exist(path.as_ref())?)?; // Move the cursor to EOF @@ -111,14 +45,14 @@ where pub fn append(iter: Iter) -> Result<(), Error> where - Iter: IntoIterator, + Iter: IntoIterator, { append_to_path(default_path()?, iter) } pub fn write_to( file: &mut FileLock, - iter: &mut dyn Iterator, + iter: &mut dyn Iterator, ) -> Result<(), Error> { let writer = io::BufWriter::with_capacity(512, file); @@ -145,7 +79,7 @@ pub fn default_path() -> Result { pub struct Records { file: FileLock, /// Use BTreeSet to dedup the metadata - data: BTreeSet, + data: BTreeSet, } impl Records { @@ -186,7 +120,7 @@ impl Records { Ok(()) } - pub fn get(&self, value: impl AsRef) -> Option<&MetaData> { + pub fn get(&self, value: impl AsRef) -> Option<&CrateInfo> { self.data.get(value.as_ref()) } @@ -198,11 +132,11 @@ impl Records { /// If the set did not have an equal element present, true is returned. /// If the set did have an equal element present, false is returned, /// and the entry is not updated. - pub fn insert(&mut self, value: MetaData) -> bool { + pub fn insert(&mut self, value: CrateInfo) -> bool { self.data.insert(value) } - pub fn replace(&mut self, value: MetaData) -> Option { + pub fn replace(&mut self, value: CrateInfo) -> Option { self.data.replace(value) } @@ -210,7 +144,7 @@ impl Records { self.data.remove(value.as_ref()) } - pub fn take(&mut self, value: impl AsRef) -> Option { + pub fn take(&mut self, value: impl AsRef) -> Option { self.data.take(value.as_ref()) } @@ -224,9 +158,9 @@ impl Records { } impl<'a> IntoIterator for &'a Records { - type Item = &'a MetaData; + type Item = &'a CrateInfo; - type IntoIter = btree_set::Iter<'a, MetaData>; + type IntoIter = btree_set::Iter<'a, CrateInfo>; fn into_iter(self) -> Self::IntoIter { self.data.iter() @@ -236,8 +170,10 @@ impl<'a> IntoIterator for &'a Records { #[cfg(test)] mod test { use super::*; - use crate::target::TARGET; + use crate::{manifests::crate_info::CrateSource, targets::TARGET}; + use compact_str::CompactString; + use semver::Version; use tempfile::NamedTempFile; macro_rules! assert_records_eq { @@ -257,29 +193,29 @@ mod test { let path = named_tempfile.path(); let metadata_vec = [ - MetaData { + CrateInfo { name: "a".into(), version_req: "*".into(), current_version: Version::new(0, 1, 0), - source: Source::cratesio_registry(), + source: CrateSource::cratesio_registry(), target: target.clone(), bins: vec!["1".into(), "2".into()], other: Default::default(), }, - MetaData { + CrateInfo { name: "b".into(), version_req: "0.1.0".into(), current_version: Version::new(0, 1, 0), - source: Source::cratesio_registry(), + source: CrateSource::cratesio_registry(), target: target.clone(), bins: vec!["1".into(), "2".into()], other: Default::default(), }, - MetaData { + CrateInfo { name: "a".into(), version_req: "*".into(), current_version: Version::new(0, 2, 0), - source: Source::cratesio_registry(), + source: CrateSource::cratesio_registry(), target: target.clone(), bins: vec!["1".into()], other: Default::default(), @@ -306,11 +242,11 @@ mod test { // Drop the exclusive file lock drop(records); - let new_metadata = MetaData { + let new_metadata = CrateInfo { name: "b".into(), version_req: "0.1.0".into(), current_version: Version::new(0, 1, 1), - source: Source::cratesio_registry(), + source: CrateSource::cratesio_registry(), target, bins: vec!["1".into(), "2".into()], other: Default::default(), diff --git a/src/metafiles/v1.rs b/crates/lib/src/manifests/cargo_crates_v1.rs similarity index 80% rename from src/metafiles/v1.rs rename to crates/lib/src/manifests/cargo_crates_v1.rs index a4857530..a593ad0a 100644 --- a/src/metafiles/v1.rs +++ b/crates/lib/src/manifests/cargo_crates_v1.rs @@ -1,3 +1,12 @@ +//! Cargo's `.crates.toml` manifest. +//! +//! This manifest is used by Cargo to record which crates were installed by `cargo-install` and by +//! other Cargo (first and third party) tooling to act upon these crates (e.g. upgrade them, list +//! them, etc). +//! +//! Binstall writes to this manifest when installing a crate, for interoperability with the Cargo +//! ecosystem. + use std::{ collections::BTreeMap, fs::File, @@ -7,12 +16,17 @@ use std::{ }; use compact_str::CompactString; +use flock::FileLock; use miette::Diagnostic; use serde::{Deserialize, Serialize}; use thiserror::Error; -use super::{binstall_v1::MetaData, CrateVersionSource}; -use crate::{cargo_home, create_if_not_exist, FileLock}; +use crate::{fs::create_if_not_exist, helpers::statics::cargo_home}; + +use super::crate_info::CrateInfo; + +mod crate_version_source; +use crate_version_source::*; #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CratesToml { @@ -71,7 +85,7 @@ impl CratesToml { iter: Iter, ) -> Result<(), CratesTomlParseError> where - Iter: IntoIterator, + Iter: IntoIterator, { let mut file = FileLock::new_exclusive(create_if_not_exist(path.as_ref())?)?; let mut c1 = if file.metadata()?.len() != 0 { @@ -92,7 +106,7 @@ impl CratesToml { pub fn append<'a, Iter>(iter: Iter) -> Result<(), CratesTomlParseError> where - Iter: IntoIterator, + Iter: IntoIterator, { Self::append_to_path(Self::default_path()?, iter) } @@ -110,13 +124,13 @@ pub enum CratesTomlParseError { TomlWrite(#[from] toml_edit::easy::ser::Error), #[error(transparent)] - CvsParse(#[from] super::CvsParseError), + CvsParse(#[from] CvsParseError), } #[cfg(test)] mod tests { - use super::{super::binstall_v1, *}; - use crate::target::TARGET; + use super::*; + use crate::{manifests::crate_info::CrateSource, targets::TARGET}; use semver::Version; use tempfile::TempDir; @@ -128,11 +142,11 @@ mod tests { CratesToml::append_to_path( &path, - &[MetaData { + &[CrateInfo { name: "cargo-binstall".into(), version_req: "*".into(), current_version: Version::new(0, 11, 1), - source: binstall_v1::Source::cratesio_registry(), + source: CrateSource::cratesio_registry(), target: TARGET.into(), bins: vec!["cargo-binstall".into()], other: Default::default(), diff --git a/src/metafiles/cvs.rs b/crates/lib/src/manifests/cargo_crates_v1/crate_version_source.rs similarity index 92% rename from src/metafiles/cvs.rs rename to crates/lib/src/manifests/cargo_crates_v1/crate_version_source.rs index f8bd7777..bf41e808 100644 --- a/src/metafiles/cvs.rs +++ b/crates/lib/src/manifests/cargo_crates_v1/crate_version_source.rs @@ -7,7 +7,10 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; use thiserror::Error; use url::Url; -use crate::cratesio_url; +use crate::{ + helpers::statics::cratesio_url, + manifests::crate_info::{CrateInfo, CrateSource, SourceType}, +}; #[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq)] pub struct CrateVersionSource { @@ -16,8 +19,8 @@ pub struct CrateVersionSource { pub source: Source, } -impl From<&super::binstall_v1::MetaData> for CrateVersionSource { - fn from(metadata: &super::binstall_v1::MetaData) -> Self { +impl From<&CrateInfo> for CrateVersionSource { + fn from(metadata: &CrateInfo) -> Self { super::CrateVersionSource { name: metadata.name.clone(), version: metadata.current_version.clone(), @@ -39,9 +42,9 @@ impl Source { } } -impl From<&super::binstall_v1::Source> for Source { - fn from(source: &super::binstall_v1::Source) -> Self { - use super::binstall_v1::SourceType::*; +impl From<&CrateSource> for Source { + fn from(source: &CrateSource) -> Self { + use SourceType::*; let url = source.url.clone(); diff --git a/src/lib.rs b/crates/lib/src/manifests/cargo_toml_binstall.rs similarity index 67% rename from src/lib.rs rename to crates/lib/src/manifests/cargo_toml_binstall.rs index 60691853..9f1ce933 100644 --- a/src/lib.rs +++ b/crates/lib/src/manifests/cargo_toml_binstall.rs @@ -1,27 +1,15 @@ +//! The format of the `[package.metadata.binstall]` manifest. +//! +//! This manifest defines how a particular binary crate may be installed by Binstall. + use std::collections::HashMap; use serde::{Deserialize, Serialize}; -pub mod drivers; -pub use drivers::*; +#[doc(inline)] +pub use package_formats::*; -pub mod errors; -pub use errors::*; - -pub mod helpers; -pub use helpers::*; - -pub mod bins; -pub mod binstall; -pub mod fetchers; -pub mod metafiles; -pub mod wasi; - -mod target; -pub use target::*; - -mod formats; -pub use formats::*; +mod package_formats; /// Default package path template (may be overridden in package Cargo.toml) pub const DEFAULT_PKG_URL: &str = @@ -112,43 +100,3 @@ pub struct BinMeta { /// Binary template path (within package) pub path: String, } - -#[cfg(test)] -mod test { - use crate::load_manifest_path; - - use cargo_toml::Product; - - fn init() { - let _ = env_logger::builder().is_test(true).try_init(); - } - - #[test] - fn parse_meta() { - init(); - - let mut manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap(); - manifest_dir.push_str("/Cargo.toml"); - - let manifest = load_manifest_path(&manifest_dir).expect("Error parsing metadata"); - let package = manifest.package.unwrap(); - let meta = package.metadata.and_then(|m| m.binstall).unwrap(); - - assert_eq!(&package.name, "cargo-binstall"); - - assert_eq!( - &meta.pkg_url, - "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }" - ); - - assert_eq!( - manifest.bin.as_slice(), - &[Product { - name: Some("cargo-binstall".to_string()), - path: Some("src/main.rs".to_string()), - edition: Some(cargo_toml::Edition::E2021), - ..Default::default() - },], - ); - } -} diff --git a/src/formats.rs b/crates/lib/src/manifests/cargo_toml_binstall/package_formats.rs similarity index 100% rename from src/formats.rs rename to crates/lib/src/manifests/cargo_toml_binstall/package_formats.rs diff --git a/crates/lib/src/manifests/crate_info.rs b/crates/lib/src/manifests/crate_info.rs new file mode 100644 index 00000000..221390a6 --- /dev/null +++ b/crates/lib/src/manifests/crate_info.rs @@ -0,0 +1,83 @@ +//! Common structure for crate information for post-install manifests. + +use std::{borrow, cmp, hash}; + +use compact_str::CompactString; +use semver::Version; +use serde::{Deserialize, Serialize}; +use url::Url; + +use crate::helpers::statics::cratesio_url; + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct CrateInfo { + pub name: CompactString, + pub version_req: CompactString, + pub current_version: Version, + pub source: CrateSource, + pub target: CompactString, + pub bins: Vec, + + /// Forwards compatibility. Unknown keys from future versions + /// will be stored here and retained when the file is saved. + /// + /// We use an `Vec` here since it is never accessed in Rust. + #[serde(flatten, with = "tuple_vec_map")] + pub other: Vec<(CompactString, serde_json::Value)>, +} + +impl borrow::Borrow for CrateInfo { + fn borrow(&self) -> &str { + &self.name + } +} + +impl PartialEq for CrateInfo { + fn eq(&self, other: &Self) -> bool { + self.name == other.name + } +} +impl Eq for CrateInfo {} + +impl PartialOrd for CrateInfo { + fn partial_cmp(&self, other: &Self) -> Option { + self.name.partial_cmp(&other.name) + } +} + +impl Ord for CrateInfo { + fn cmp(&self, other: &Self) -> cmp::Ordering { + self.name.cmp(&other.name) + } +} + +impl hash::Hash for CrateInfo { + fn hash(&self, state: &mut H) + where + H: hash::Hasher, + { + self.name.hash(state) + } +} + +#[derive(Debug, Copy, Clone, Serialize, Deserialize)] +pub enum SourceType { + Git, + Path, + Registry, +} + +#[derive(Clone, Debug, Serialize, Deserialize)] +pub struct CrateSource { + pub source_type: SourceType, + pub url: Url, +} + +impl CrateSource { + pub fn cratesio_registry() -> CrateSource { + Self { + source_type: SourceType::Registry, + url: cratesio_url().clone(), + } + } +} diff --git a/src/binstall.rs b/crates/lib/src/ops.rs similarity index 68% rename from src/binstall.rs rename to crates/lib/src/ops.rs index 20b582b7..4274df96 100644 --- a/src/binstall.rs +++ b/crates/lib/src/ops.rs @@ -1,14 +1,13 @@ +//! Concrete Binstall operations. + use std::path::PathBuf; use semver::VersionReq; -use crate::{metafiles::binstall_v1::MetaData, DesiredTargets, PkgOverride}; +use crate::{manifests::cargo_toml_binstall::PkgOverride, targets::DesiredTargets}; -mod resolve; -pub use resolve::*; - -mod install; -pub use install::*; +pub mod install; +pub mod resolve; pub struct Options { pub no_symlinks: bool, diff --git a/src/binstall/install.rs b/crates/lib/src/ops/install.rs similarity index 91% rename from src/binstall/install.rs rename to crates/lib/src/ops/install.rs index 8e78b2e3..b060b2f4 100644 --- a/src/binstall/install.rs +++ b/crates/lib/src/ops/install.rs @@ -5,14 +5,23 @@ use compact_str::CompactString; use log::{debug, error, info}; use tokio::{process::Command, task::block_in_place}; -use super::{MetaData, Options, Resolution}; -use crate::{bins, fetchers::Fetcher, metafiles::binstall_v1::Source, BinstallError, *}; +use super::{resolve::Resolution, Options}; +use crate::{ + bins, + errors::BinstallError, + fetchers::Fetcher, + helpers::jobserver_client::LazyJobserverClient, + manifests::{ + cargo_toml_binstall::Meta, + crate_info::{CrateInfo, CrateSource}, + }, +}; pub async fn install( resolution: Resolution, opts: Arc, jobserver_client: LazyJobserverClient, -) -> Result, BinstallError> { +) -> Result, BinstallError> { match resolution { Resolution::AlreadyUpToDate => Ok(None), Resolution::Fetch { @@ -36,11 +45,11 @@ pub async fn install( install_from_package(fetcher, opts, bin_path, bin_files) .await .map(|option| { - option.map(|bins| MetaData { + option.map(|bins| CrateInfo { name, version_req, current_version, - source: Source::cratesio_registry(), + source: CrateSource::cratesio_registry(), target, bins, other: Default::default(), diff --git a/src/binstall/resolve.rs b/crates/lib/src/ops/resolve.rs similarity index 86% rename from src/binstall/resolve.rs rename to crates/lib/src/ops/resolve.rs index 97cc6cec..0dbb1e0b 100644 --- a/src/binstall/resolve.rs +++ b/crates/lib/src/ops/resolve.rs @@ -3,19 +3,29 @@ use std::{ sync::Arc, }; -use cargo_toml::{Package, Product}; +use cargo_toml::{Manifest, Package, Product}; use compact_str::{CompactString, ToCompactString}; use log::{debug, info, warn}; use reqwest::Client; use semver::{Version, VersionReq}; +use tokio::task::block_in_place; use super::Options; use crate::{ bins, + drivers::fetch_crate_cratesio, + errors::BinstallError, fetchers::{Data, Fetcher, GhCrateMeta, MultiFetcher, QuickInstall}, - BinstallError, *, + manifests::cargo_toml_binstall::{Meta, PkgMeta}, }; +mod crate_name; +#[doc(inline)] +pub use crate_name::CrateName; +mod version_ext; +#[doc(inline)] +pub use version_ext::VersionReqExt; + pub enum Resolution { Fetch { fetcher: Arc, @@ -265,3 +275,30 @@ fn collect_bin_files( Ok(bin_files) } + +/// Load binstall metadata from the crate `Cargo.toml` at the provided path +pub fn load_manifest_path>( + manifest_path: P, +) -> Result, BinstallError> { + block_in_place(|| { + let manifest_path = manifest_path.as_ref(); + let manifest_path = if manifest_path.is_dir() { + manifest_path.join("Cargo.toml") + } else if manifest_path.is_file() { + manifest_path.into() + } else { + return Err(BinstallError::CargoManifestPath); + }; + + debug!( + "Reading manifest at local path: {}", + manifest_path.display() + ); + + // Load and parse manifest (this checks file system for binary output names) + let manifest = Manifest::::from_path_with_metadata(manifest_path)?; + + // Return metadata + Ok(manifest) + }) +} diff --git a/src/helpers/crate_name.rs b/crates/lib/src/ops/resolve/crate_name.rs similarity index 88% rename from src/helpers/crate_name.rs rename to crates/lib/src/ops/resolve/crate_name.rs index 500f5614..398f9793 100644 --- a/src/helpers/crate_name.rs +++ b/crates/lib/src/ops/resolve/crate_name.rs @@ -4,7 +4,7 @@ use compact_str::CompactString; use itertools::Itertools; use semver::{Error, VersionReq}; -use super::parse_version; +use super::version_ext::VersionReqExt; #[derive(Debug, Clone, Eq, PartialEq)] pub struct CrateName { @@ -31,7 +31,7 @@ impl FromStr for CrateName { Ok(if let Some((name, version)) = s.split_once('@') { CrateName { name: name.into(), - version_req: Some(parse_version(version)?), + version_req: Some(VersionReq::parse_from_cli(version)?), } } else { CrateName { @@ -43,7 +43,8 @@ impl FromStr for CrateName { } impl CrateName { - pub fn dedup(mut crate_names: Vec) -> impl Iterator { + pub fn dedup(crate_names: &[Self]) -> impl Iterator { + let mut crate_names = crate_names.to_vec(); crate_names.sort_by(|x, y| x.name.cmp(&y.name)); crate_names.into_iter().coalesce(|previous, current| { if previous.name == current.name { @@ -61,7 +62,7 @@ mod tests { macro_rules! assert_dedup { ([ $( ( $input_name:expr, $input_version:expr ) ),* ], [ $( ( $output_name:expr, $output_version:expr ) ),* ]) => { - let input_crate_names = vec![$( CrateName { + let input_crate_names = [$( CrateName { name: $input_name.into(), version_req: Some($input_version.parse().unwrap()) }, )*]; @@ -71,7 +72,7 @@ mod tests { }, )*]; output_crate_names.sort_by(|x, y| x.name.cmp(&y.name)); - let crate_names: Vec<_> = CrateName::dedup(input_crate_names).collect(); + let crate_names: Vec<_> = CrateName::dedup(&input_crate_names).collect(); assert_eq!(crate_names, output_crate_names); }; } diff --git a/src/helpers/version.rs b/crates/lib/src/ops/resolve/version_ext.rs similarity index 81% rename from src/helpers/version.rs rename to crates/lib/src/ops/resolve/version_ext.rs index f994dc93..7c83e045 100644 --- a/src/helpers/version.rs +++ b/crates/lib/src/ops/resolve/version_ext.rs @@ -6,6 +6,14 @@ pub trait VersionReqExt { /// Return `true` if `self.matches(version)` returns `true` /// and the `version` is the latest one acceptable by `self`. fn is_latest_compatible(&self, version: &Version) -> bool; + + /// Parse from CLI option. + /// + /// Notably, a bare version is treated as if preceded by `=`, not by `^` as in Cargo.toml + /// dependencies. + fn parse_from_cli(str: &str) -> Result + where + Self: Sized; } impl VersionReqExt for VersionReq { @@ -42,6 +50,19 @@ impl VersionReqExt for VersionReq { true } + + fn parse_from_cli(version: &str) -> Result { + if version + .chars() + .next() + .map(|ch| ch.is_ascii_digit()) + .unwrap_or(false) + { + format_compact!("={version}").parse() + } else { + version.parse() + } + } } #[cfg(test)] diff --git a/src/target.rs b/crates/lib/src/targets.rs similarity index 98% rename from src/target.rs rename to crates/lib/src/targets.rs index c6392c23..dc905383 100644 --- a/src/target.rs +++ b/crates/lib/src/targets.rs @@ -1,9 +1,10 @@ -use std::io::{BufRead, Cursor}; -use std::process::Output; -use std::sync::Arc; +use std::{ + io::{BufRead, Cursor}, + process::Output, + sync::Arc, +}; -use tokio::process::Command; -use tokio::sync::OnceCell; +use tokio::{process::Command, sync::OnceCell}; /// Compiled target triple, used as default for binary fetching pub const TARGET: &str = env!("TARGET"); diff --git a/crates/lib/tests/parse-meta.Cargo.toml b/crates/lib/tests/parse-meta.Cargo.toml new file mode 100644 index 00000000..26d6e052 --- /dev/null +++ b/crates/lib/tests/parse-meta.Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "cargo-binstall-test" +repository = "https://github.com/cargo-bins/cargo-binstall" +version = "1.2.3" + +[[bin]] +name = "cargo-binstall" +path = "src/main.rs" +edition = "2021" + +[package.metadata.binstall] +pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }" +bin-dir = "{ bin }{ binary-ext }" + +[package.metadata.binstall.overrides.x86_64-pc-windows-msvc] +pkg-fmt = "zip" +[package.metadata.binstall.overrides.x86_64-apple-darwin] +pkg-fmt = "zip" diff --git a/crates/lib/tests/parse-meta.rs b/crates/lib/tests/parse-meta.rs new file mode 100644 index 00000000..7433974b --- /dev/null +++ b/crates/lib/tests/parse-meta.rs @@ -0,0 +1,31 @@ +use binstall::ops::resolve::load_manifest_path; +use cargo_toml::Product; + +#[test] +fn parse_meta() { + let _ = env_logger::builder().is_test(true).try_init(); + + let mut manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap(); + manifest_dir.push_str("/tests/parse-meta.Cargo.toml"); + + let manifest = load_manifest_path(&manifest_dir).expect("Error parsing metadata"); + let package = manifest.package.unwrap(); + let meta = package.metadata.and_then(|m| m.binstall).unwrap(); + + assert_eq!(&package.name, "cargo-binstall-test"); + + assert_eq!( + &meta.pkg_url, + "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }" + ); + + assert_eq!( + manifest.bin.as_slice(), + &[Product { + name: Some("cargo-binstall".to_string()), + path: Some("src/main.rs".to_string()), + edition: Some(cargo_toml::Edition::E2021), + ..Default::default() + },], + ); +} diff --git a/crates/normalize-path/Cargo.toml b/crates/normalize-path/Cargo.toml new file mode 100644 index 00000000..d22ad55b --- /dev/null +++ b/crates/normalize-path/Cargo.toml @@ -0,0 +1,10 @@ +[package] +name = "normalize-path" +description = "Like canonicalize, but without performing I/O" +repository = "https://github.com/cargo-bins/cargo-binstall" +documentation = "https://docs.rs/normalize-path" +version = "0.1.0" +rust-version = "1.61.0" +authors = ["Jiahao XU "] +edition = "2021" +license = "Apache-2.0 OR MIT" diff --git a/crates/normalize-path/LICENSE-APACHE b/crates/normalize-path/LICENSE-APACHE new file mode 100644 index 00000000..1b5ec8b7 --- /dev/null +++ b/crates/normalize-path/LICENSE-APACHE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/crates/normalize-path/LICENSE-MIT b/crates/normalize-path/LICENSE-MIT new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/crates/normalize-path/LICENSE-MIT @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/src/helpers/path_ext.rs b/crates/normalize-path/src/lib.rs similarity index 54% rename from src/helpers/path_ext.rs rename to crates/normalize-path/src/lib.rs index 78f26687..20e9ea68 100644 --- a/src/helpers/path_ext.rs +++ b/crates/normalize-path/src/lib.rs @@ -1,13 +1,36 @@ -//! Shamelessly adapted from: -//! https://github.com/rust-lang/cargo/blob/fede83ccf973457de319ba6fa0e36ead454d2e20/src/cargo/util/paths.rs#L61 +//! Normalizes paths similarly to canonicalize, but without performing I/O. +//! +//! This is like Python's `os.path.normpath`. +//! +//! Initially adapted from [Cargo's implementation][cargo-paths]. +//! +//! [cargo-paths]: https://github.com/rust-lang/cargo/blob/fede83ccf973457de319ba6fa0e36ead454d2e20/src/cargo/util/paths.rs#L61 +//! +//! # Example +//! +//! ``` +//! use normalize_path::NormalizePath; +//! use std::path::Path; +//! +//! assert_eq!( +//! Path::new("/A/foo/../B/./").normalize(), +//! Path::new("/A/B") +//! ); +//! ``` -use std::borrow::Cow; -use std::path::{Component, Path, PathBuf}; +use std::{ + borrow::Cow, + path::{Component, Path, PathBuf}, +}; -pub trait PathExt { - /// Similiar to `os.path.normpath`: It does not perform - /// any fs operation. - fn normalize_path(&self) -> Cow<'_, Path>; +/// Extension trait to add `normalize_path` to std's [`Path`]. +pub trait NormalizePath { + /// Normalize a path without performing I/O. + /// + /// All redundant separator and up-level references are collapsed. + /// + /// However, this does not resolve links. + fn normalize(&self) -> Cow<'_, Path>; } fn is_normalized(path: &Path) -> bool { @@ -23,8 +46,8 @@ fn is_normalized(path: &Path) -> bool { true } -impl PathExt for Path { - fn normalize_path(&self) -> Cow<'_, Path> { +impl NormalizePath for Path { + fn normalize(&self) -> Cow<'_, Path> { if is_normalized(self) { return Cow::Borrowed(self); } diff --git a/src/drivers.rs b/src/drivers.rs deleted file mode 100644 index 933a6d2f..00000000 --- a/src/drivers.rs +++ /dev/null @@ -1,19 +0,0 @@ -use std::path::{Path, PathBuf}; - -use crate::BinstallError; - -mod version; -use version::find_version; - -mod crates_io; -pub use crates_io::fetch_crate_cratesio; - -/// Fetch a crate by name and version from github -/// TODO: implement this -pub async fn fetch_crate_gh_releases( - _name: &str, - _version: Option<&str>, - _temp_dir: &Path, -) -> Result { - unimplemented!(); -} diff --git a/src/helpers.rs b/src/helpers.rs deleted file mode 100644 index 0742c1f2..00000000 --- a/src/helpers.rs +++ /dev/null @@ -1,363 +0,0 @@ -use std::env; -use std::fmt::Debug; -use std::fs; -use std::io; -use std::ops; -use std::path::{Path, PathBuf}; -use std::sync::Arc; - -use bytes::Bytes; -use cargo_toml::Manifest; -use compact_str::format_compact; -use futures_util::stream::Stream; -use log::debug; -use once_cell::sync::{Lazy, OnceCell}; -use reqwest::{tls, Client, ClientBuilder, Method, Response}; -use serde::Serialize; -use tempfile::NamedTempFile; -use tinytemplate::TinyTemplate; -use tokio::task::block_in_place; -use url::Url; - -use crate::{BinstallError, Meta, PkgFmt, PkgFmtDecomposed, TarBasedFmt}; - -mod async_extracter; -pub use async_extracter::*; - -mod auto_abort_join_handle; -pub use auto_abort_join_handle::AutoAbortJoinHandle; - -mod ui_thread; -pub use ui_thread::UIThread; - -mod extracter; -mod stream_readable; - -mod jobserver_client; -pub use jobserver_client::*; - -mod path_ext; -pub use path_ext::*; - -mod tls_version; -pub use tls_version::TLSVersion; - -mod crate_name; -pub use crate_name::CrateName; - -mod flock; -pub use flock::FileLock; - -mod signal; -pub use signal::cancel_on_user_sig_term; - -mod version; -pub use version::VersionReqExt; - -pub fn cargo_home() -> Result<&'static Path, io::Error> { - static CARGO_HOME: OnceCell = OnceCell::new(); - - CARGO_HOME - .get_or_try_init(home::cargo_home) - .map(ops::Deref::deref) -} - -pub fn cratesio_url() -> &'static Url { - static CRATESIO: Lazy Url> = - Lazy::new(|| url::Url::parse("https://github.com/rust-lang/crates.io-index").unwrap()); - - &*CRATESIO -} - -/// Returned file is readable and writable. -pub fn create_if_not_exist(path: impl AsRef) -> io::Result { - let path = path.as_ref(); - - let mut options = fs::File::options(); - options.read(true).write(true); - - options - .clone() - .create_new(true) - .open(path) - .or_else(|_| options.open(path)) -} - -pub async fn await_task(task: tokio::task::JoinHandle>) -> miette::Result { - match task.await { - Ok(res) => res, - Err(join_err) => Err(BinstallError::from(join_err).into()), - } -} - -pub fn parse_version(version: &str) -> Result { - // Treat 0.1.2 as =0.1.2 - if version - .chars() - .next() - .map(|ch| ch.is_ascii_digit()) - .unwrap_or(false) - { - format_compact!("={version}").parse() - } else { - version.parse() - } -} - -/// Load binstall metadata from the crate `Cargo.toml` at the provided path -pub fn load_manifest_path>( - manifest_path: P, -) -> Result, BinstallError> { - block_in_place(|| { - let manifest_path = manifest_path.as_ref(); - let manifest_path = if manifest_path.is_dir() { - manifest_path.join("Cargo.toml") - } else if manifest_path.is_file() { - manifest_path.into() - } else { - return Err(BinstallError::CargoManifestPath); - }; - - debug!( - "Reading manifest at local path: {}", - manifest_path.display() - ); - - // Load and parse manifest (this checks file system for binary output names) - let manifest = Manifest::::from_path_with_metadata(manifest_path)?; - - // Return metadata - Ok(manifest) - }) -} - -pub fn create_reqwest_client( - secure: bool, - min_tls: Option, -) -> Result { - const USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")); - - let mut builder = ClientBuilder::new().user_agent(USER_AGENT); - - if secure { - builder = builder - .https_only(true) - .min_tls_version(tls::Version::TLS_1_2); - } - - if let Some(ver) = min_tls { - builder = builder.min_tls_version(ver); - } - - Ok(builder.build()?) -} - -pub async fn remote_exists( - client: Client, - url: Url, - method: Method, -) -> Result { - let req = client - .request(method.clone(), url.clone()) - .send() - .await - .map_err(|err| BinstallError::Http { method, url, err })?; - Ok(req.status().is_success()) -} - -async fn create_request( - client: &Client, - url: Url, -) -> Result>, BinstallError> { - debug!("Downloading from: '{url}'"); - - client - .get(url.clone()) - .send() - .await - .and_then(|r| r.error_for_status()) - .map_err(|err| BinstallError::Http { - method: Method::GET, - url, - err, - }) - .map(Response::bytes_stream) -} - -/// Download a file from the provided URL and extract it to the provided path. -pub async fn download_and_extract>( - client: &Client, - url: &Url, - fmt: PkgFmt, - path: P, -) -> Result<(), BinstallError> { - let stream = create_request(client, url.clone()).await?; - - let path = path.as_ref(); - debug!("Downloading and extracting to: '{}'", path.display()); - - match fmt.decompose() { - PkgFmtDecomposed::Tar(fmt) => extract_tar_based_stream(stream, path, fmt).await?, - PkgFmtDecomposed::Bin => extract_bin(stream, path).await?, - PkgFmtDecomposed::Zip => extract_zip(stream, path).await?, - } - - debug!("Download OK, extracted to: '{}'", path.display()); - - Ok(()) -} - -/// Download a file from the provided URL and extract part of it to -/// the provided path. -/// -/// * `filter` - If Some, then it will pass the path of the file to it -/// and only extract ones which filter returns `true`. -pub async fn download_tar_based_and_visit( - client: &Client, - url: Url, - fmt: TarBasedFmt, - visitor: V, -) -> Result { - let stream = create_request(client, url).await?; - - debug!("Downloading and extracting then in-memory processing"); - - let ret = extract_tar_based_stream_and_visit(stream, fmt, visitor).await?; - - debug!("Download, extraction and in-memory procession OK"); - - Ok(ret) -} - -/// Fetch install path from environment -/// roughly follows -/// -/// Return (install_path, is_custom_install_path) -pub fn get_install_path>(install_path: Option

) -> (Option>, bool) { - // Command line override first first - if let Some(p) = install_path { - return (Some(Arc::from(p.as_ref())), true); - } - - // Environmental variables - if let Ok(p) = std::env::var("CARGO_INSTALL_ROOT") { - debug!("using CARGO_INSTALL_ROOT ({p})"); - let b = PathBuf::from(p); - return (Some(Arc::from(b.join("bin"))), true); - } - - if let Ok(p) = cargo_home() { - debug!("using ({}) as cargo home", p.display()); - return (Some(p.join("bin").into()), false); - } - - // Local executable dir if no cargo is found - let dir = dirs::executable_dir(); - - if let Some(d) = &dir { - debug!("Fallback to {}", d.display()); - } - - (dir.map(Arc::from), true) -} - -/// Atomically install a file. -/// -/// This is a blocking function, must be called in `block_in_place` mode. -pub fn atomic_install(src: &Path, dst: &Path) -> io::Result<()> { - debug!( - "Attempting to atomically rename from '{}' to '{}'", - src.display(), - dst.display() - ); - - if let Err(err) = fs::rename(src, dst) { - debug!("Attempting at atomically failed: {err:#?}, fallback to creating tempfile."); - // src and dst is not on the same filesystem/mountpoint. - // Fallback to creating NamedTempFile on the parent dir of - // dst. - - let mut src_file = fs::File::open(src)?; - - let parent = dst.parent().unwrap(); - debug!("Creating named tempfile at '{}'", parent.display()); - let mut tempfile = NamedTempFile::new_in(parent)?; - - debug!( - "Copying from '{}' to '{}'", - src.display(), - tempfile.path().display() - ); - io::copy(&mut src_file, tempfile.as_file_mut())?; - - debug!("Retrieving permissions of '{}'", src.display()); - let permissions = src_file.metadata()?.permissions(); - - debug!( - "Setting permissions of '{}' to '{permissions:#?}'", - tempfile.path().display() - ); - tempfile.as_file().set_permissions(permissions)?; - - debug!( - "Persisting '{}' to '{}'", - tempfile.path().display(), - dst.display() - ); - tempfile.persist(dst).map_err(io::Error::from)?; - } else { - debug!("Attempting at atomically succeeded."); - } - - Ok(()) -} - -fn symlink_file, Q: AsRef>(original: P, link: Q) -> io::Result<()> { - #[cfg(target_family = "unix")] - let f = std::os::unix::fs::symlink; - #[cfg(target_family = "windows")] - let f = std::os::windows::fs::symlink_file; - - f(original, link) -} - -/// Atomically install symlink "link" to a file "dst". -/// -/// This is a blocking function, must be called in `block_in_place` mode. -pub fn atomic_symlink_file(dest: &Path, link: &Path) -> io::Result<()> { - let parent = link.parent().unwrap(); - - debug!("Creating tempPath at '{}'", parent.display()); - let temp_path = NamedTempFile::new_in(parent)?.into_temp_path(); - fs::remove_file(&temp_path)?; - - debug!( - "Creating symlink '{}' to file '{}'", - temp_path.display(), - dest.display() - ); - symlink_file(dest, &temp_path)?; - - debug!( - "Persisting '{}' to '{}'", - temp_path.display(), - link.display() - ); - temp_path.persist(link).map_err(io::Error::from) -} - -pub trait Template: Serialize { - fn render(&self, template: &str) -> Result - where - Self: Sized, - { - // Create template instance - let mut tt = TinyTemplate::new(); - - // Add template to instance - tt.add_template("path", template)?; - - // Render output - Ok(tt.render("path", self)?) - } -} diff --git a/src/helpers/flock.rs b/src/helpers/flock.rs deleted file mode 100644 index f8b4514a..00000000 --- a/src/helpers/flock.rs +++ /dev/null @@ -1,81 +0,0 @@ -use std::fs::File; -use std::io; -use std::ops; - -use fs4::FileExt; - -#[derive(Debug)] -pub struct FileLock(File); - -impl FileLock { - /// NOTE that this function blocks, so it cannot - /// be called in async context. - pub fn new_exclusive(file: File) -> io::Result { - file.lock_exclusive()?; - - Ok(Self(file)) - } - - /// NOTE that this function blocks, so it cannot - /// be called in async context. - pub fn new_shared(file: File) -> io::Result { - file.lock_shared()?; - - Ok(Self(file)) - } -} - -impl Drop for FileLock { - fn drop(&mut self) { - let _ = self.unlock(); - } -} - -impl ops::Deref for FileLock { - type Target = File; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} -impl ops::DerefMut for FileLock { - fn deref_mut(&mut self) -> &mut Self::Target { - &mut self.0 - } -} - -impl io::Write for FileLock { - fn write(&mut self, buf: &[u8]) -> io::Result { - self.0.write(buf) - } - fn flush(&mut self) -> io::Result<()> { - self.0.flush() - } - - fn write_vectored(&mut self, bufs: &[io::IoSlice<'_>]) -> io::Result { - self.0.write_vectored(bufs) - } -} - -impl io::Read for FileLock { - fn read(&mut self, buf: &mut [u8]) -> io::Result { - self.0.read(buf) - } - - fn read_vectored(&mut self, bufs: &mut [io::IoSliceMut<'_>]) -> io::Result { - self.0.read_vectored(bufs) - } -} - -impl io::Seek for FileLock { - fn seek(&mut self, pos: io::SeekFrom) -> io::Result { - self.0.seek(pos) - } - - fn rewind(&mut self) -> io::Result<()> { - self.0.rewind() - } - fn stream_position(&mut self) -> io::Result { - self.0.stream_position() - } -} diff --git a/src/helpers/tls_version.rs b/src/helpers/tls_version.rs deleted file mode 100644 index 35f86123..00000000 --- a/src/helpers/tls_version.rs +++ /dev/null @@ -1,19 +0,0 @@ -use clap::ArgEnum; -use reqwest::tls::Version; - -#[derive(Debug, Copy, Clone, ArgEnum)] -pub enum TLSVersion { - #[clap(name = "1.2")] - Tls1_2, - #[clap(name = "1.3")] - Tls1_3, -} - -impl From for Version { - fn from(ver: TLSVersion) -> Self { - match ver { - TLSVersion::Tls1_2 => Version::TLS_1_2, - TLSVersion::Tls1_3 => Version::TLS_1_3, - } - } -} diff --git a/src/main.rs b/src/main.rs deleted file mode 100644 index 77b51ddd..00000000 --- a/src/main.rs +++ /dev/null @@ -1,517 +0,0 @@ -use std::{ - ffi::OsString, - fs, - mem::take, - path::{Path, PathBuf}, - process::{ExitCode, Termination}, - sync::Arc, - time::{Duration, Instant}, -}; - -use clap::{builder::PossibleValue, AppSettings, Parser}; -use log::{debug, error, info, warn, LevelFilter}; -use miette::{miette, Result, WrapErr}; -use semver::VersionReq; -use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; -use tokio::{runtime::Runtime, task::block_in_place}; - -use cargo_binstall::{binstall, *}; - -#[cfg(feature = "mimalloc")] -#[global_allocator] -static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; - -#[derive(Debug, Parser)] -#[clap(version, about = "Install a Rust binary... from binaries!", setting = AppSettings::ArgRequiredElseHelp)] -struct Options { - /// Packages to install. - /// - /// Syntax: crate[@version] - /// - /// Each value is either a crate name alone, or a crate name followed by @ and the version to - /// install. The version syntax is as with the --version option. - /// - /// When multiple names are provided, the --version option and any override options are - /// unavailable due to ambiguity. - /// - /// If duplicate names are provided, the last one (and their version requirement) - /// is kept. - #[clap( - help_heading = "Package selection", - value_name = "crate[@version]", - required_unless_present_any = ["version", "help"], - )] - crate_names: Vec, - - /// Package version to install. - /// - /// Takes either an exact semver version or a semver version requirement expression, which will - /// be resolved to the highest matching version available. - /// - /// Cannot be used when multiple packages are installed at once, use the attached version - /// syntax in that case. - #[clap(help_heading = "Package selection", long = "version", parse(try_from_str = parse_version))] - version_req: Option, - - /// Override binary target set. - /// - /// Binstall is able to look for binaries for several targets, installing the first one it finds - /// in the order the targets were given. For example, on a 64-bit glibc Linux distribution, the - /// default is to look first for a `x86_64-unknown-linux-gnu` binary, then for a - /// `x86_64-unknown-linux-musl` binary. However, on a musl system, the gnu version will not be - /// considered. - /// - /// This option takes a comma-separated list of target triples, which will be tried in order. - /// They override the default list, which is detected automatically from the current platform. - /// - /// If falling back to installing from source, the first target will be used. - #[clap( - help_heading = "Package selection", - alias = "target", - long, - value_name = "TRIPLE" - )] - targets: Option, - - /// Override Cargo.toml package manifest path. - /// - /// This skips searching crates.io for a manifest and uses the specified path directly, useful - /// for debugging and when adding Binstall support. This may be either the path to the folder - /// containing a Cargo.toml file, or the Cargo.toml file itself. - #[clap(help_heading = "Overrides", long)] - manifest_path: Option, - - /// Override Cargo.toml package manifest bin-dir. - #[clap(help_heading = "Overrides", long)] - bin_dir: Option, - - /// Override Cargo.toml package manifest pkg-fmt. - #[clap(help_heading = "Overrides", long)] - pkg_fmt: Option, - - /// Override Cargo.toml package manifest pkg-url. - #[clap(help_heading = "Overrides", long)] - pkg_url: Option, - - /// Disable symlinking / versioned updates. - /// - /// By default, Binstall will install a binary named `-` in the install path, and - /// either symlink or copy it to (depending on platform) the plain binary name. This makes it - /// possible to have multiple versions of the same binary, for example for testing or rollback. - /// - /// Pass this flag to disable this behavior. - #[clap(help_heading = "Options", long)] - no_symlinks: bool, - - /// Dry run, fetch and show changes without installing binaries. - #[clap(help_heading = "Options", long)] - dry_run: bool, - - /// Disable interactive mode / confirmation prompts. - #[clap(help_heading = "Options", long)] - no_confirm: bool, - - /// Do not cleanup temporary files. - #[clap(help_heading = "Options", long)] - no_cleanup: bool, - - /// Install binaries in a custom location. - /// - /// By default, binaries are installed to the global location `$CARGO_HOME/bin`, and global - /// metadata files are updated with the package information. Specifying another path here - /// switches over to a "local" install, where binaries are installed at the path given, and the - /// global metadata files are not updated. - #[clap(help_heading = "Options", long)] - install_path: Option, - - /// Enforce downloads over secure transports only. - /// - /// Insecure HTTP downloads will be removed completely in the future; in the meantime this - /// option forces a fail when the remote endpoint uses plaintext HTTP or insecure TLS suites. - /// - /// Without this option, plain HTTP will warn. - /// - /// Implies `--min-tls-version=1.2`. - #[clap(help_heading = "Options", long)] - secure: bool, - - /// Force a crate to be installed even if it is already installed. - #[clap(help_heading = "Options", long)] - force: bool, - - /// Require a minimum TLS version from remote endpoints. - /// - /// The default is not to require any minimum TLS version, and use the negotiated highest - /// version available to both this client and the remote server. - #[clap(help_heading = "Options", long, arg_enum, value_name = "VERSION")] - min_tls_version: Option, - - /// Print help information - #[clap(help_heading = "Meta", short, long)] - help: bool, - - /// Print version information - #[clap(help_heading = "Meta", short = 'V')] - version: bool, - - /// Utility log level - /// - /// Set to `trace` to print very low priority, often extremely - /// verbose information. - /// - /// Set to `debug` when submitting a bug report. - /// - /// Set to `info` to only print useful information. - /// - /// Set to `warn` to only print on hazardous situations. - /// - /// Set to `error` to only print serious errors. - /// - /// Set to `off` to disable logging completely, this will also - /// disable output from `cargo-install`. - #[clap( - help_heading = "Meta", - long, - default_value = "info", - value_name = "LEVEL", - possible_values = [ - PossibleValue::new("trace").help( - "Set to `trace` to print very low priority, often extremely verbose information." - ), - PossibleValue::new("debug").help("Set to debug when submitting a bug report."), - PossibleValue::new("info").help("Set to info to only print useful information."), - PossibleValue::new("warn").help("Set to warn to only print on hazardous situations."), - PossibleValue::new("error").help("Set to error to only print serious errors."), - PossibleValue::new("off").help( - "Set to off to disable logging completely, this will also disable output from `cargo-install`." - ), - ] - )] - log_level: LevelFilter, - - /// Equivalent to setting `log_level` to `off`. - /// - /// This would override the `log_level`. - #[clap(help_heading = "Meta", short, long)] - quiet: bool, -} - -enum MainExit { - Success(Duration), - Error(BinstallError), - Report(miette::Report), -} - -impl Termination for MainExit { - fn report(self) -> ExitCode { - match self { - Self::Success(spent) => { - info!("Done in {spent:?}"); - ExitCode::SUCCESS - } - Self::Error(err) => err.report(), - Self::Report(err) => { - error!("Fatal error:"); - eprintln!("{err:?}"); - ExitCode::from(16) - } - } - } -} - -fn main() -> MainExit { - // Create jobserver client - let jobserver_client = LazyJobserverClient::new(); - - let start = Instant::now(); - - let rt = Runtime::new().unwrap(); - let handle = AutoAbortJoinHandle::new(rt.spawn(entry(jobserver_client))); - let result = rt.block_on(cancel_on_user_sig_term(handle)); - drop(rt); - - let done = start.elapsed(); - debug!("run time: {done:?}"); - - result.map_or_else(MainExit::Error, |res| { - res.map(|()| MainExit::Success(done)).unwrap_or_else(|err| { - err.downcast::() - .map(MainExit::Error) - .unwrap_or_else(MainExit::Report) - }) - }) -} - -async fn entry(jobserver_client: LazyJobserverClient) -> Result<()> { - // Filter extraneous arg when invoked by cargo - // `cargo run -- --help` gives ["target/debug/cargo-binstall", "--help"] - // `cargo binstall --help` gives ["/home/ryan/.cargo/bin/cargo-binstall", "binstall", "--help"] - let mut args: Vec = std::env::args_os().collect(); - let args = if args.len() > 1 && args[1] == "binstall" { - // Equivalent to - // - // args.remove(1); - // - // But is O(1) - args.swap(0, 1); - let mut args = args.into_iter(); - drop(args.next().unwrap()); - - args - } else { - args.into_iter() - }; - - // Load options - let mut opts = Options::parse_from(args); - if opts.quiet { - opts.log_level = LevelFilter::Off; - } - - let crate_names = take(&mut opts.crate_names); - if crate_names.len() > 1 { - let option = if opts.version_req.is_some() { - "version" - } else if opts.manifest_path.is_some() { - "manifest-path" - } else if opts.bin_dir.is_some() { - "bin-dir" - } else if opts.pkg_fmt.is_some() { - "pkg-fmt" - } else if opts.pkg_url.is_some() { - "pkg-url" - } else { - "" - }; - - if !option.is_empty() { - return Err(BinstallError::OverrideOptionUsedWithMultiInstall { option }.into()); - } - } - - let cli_overrides = PkgOverride { - pkg_url: opts.pkg_url.take(), - pkg_fmt: opts.pkg_fmt.take(), - bin_dir: opts.bin_dir.take(), - }; - - // Launch target detection - let desired_targets = get_desired_targets(&opts.targets); - - // Initialize reqwest client - let client = create_reqwest_client(opts.secure, opts.min_tls_version.map(|v| v.into()))?; - - // Build crates.io api client - let crates_io_api_client = crates_io_api::AsyncClient::new( - "cargo-binstall (https://github.com/ryankurte/cargo-binstall)", - Duration::from_millis(100), - ) - .expect("bug: invalid user agent"); - - // Setup logging - let mut log_config = ConfigBuilder::new(); - log_config.add_filter_ignore("hyper".to_string()); - log_config.add_filter_ignore("reqwest".to_string()); - log_config.add_filter_ignore("rustls".to_string()); - log_config.set_location_level(LevelFilter::Off); - TermLogger::init( - opts.log_level, - log_config.build(), - TerminalMode::Mixed, - ColorChoice::Auto, - ) - .unwrap(); - - // Initialize UI thread - let mut uithread = UIThread::new(!opts.no_confirm); - - let (install_path, metadata, temp_dir) = block_in_place(|| -> Result<_> { - // Compute install directory - let (install_path, custom_install_path) = get_install_path(opts.install_path.as_deref()); - let install_path = install_path.ok_or_else(|| { - error!("No viable install path found of specified, try `--install-path`"); - miette!("No install path found or specified") - })?; - fs::create_dir_all(&install_path).map_err(BinstallError::Io)?; - debug!("Using install path: {}", install_path.display()); - - // Load metadata - let metadata = if !custom_install_path { - debug!("Reading binstall/crates-v1.json"); - Some(metafiles::binstall_v1::Records::load()?) - } else { - None - }; - - // Create a temporary directory for downloads etc. - // - // Put all binaries to a temporary directory under `dst` first, catching - // some failure modes (e.g., out of space) before touching the existing - // binaries. This directory will get cleaned up via RAII. - let temp_dir = tempfile::Builder::new() - .prefix("cargo-binstall") - .tempdir_in(&install_path) - .map_err(BinstallError::from) - .wrap_err("Creating a temporary directory failed.")?; - - Ok((install_path, metadata, temp_dir)) - })?; - - // Remove installed crates - let crate_names = CrateName::dedup(crate_names) - .filter_map(|crate_name| { - match ( - opts.force, - metadata.as_ref().and_then(|records| records.get(&crate_name.name)), - &crate_name.version_req, - ) { - (false, Some(metadata), Some(version_req)) - if version_req.is_latest_compatible(&metadata.current_version) => - { - debug!("Bailing out early because we can assume wanted is already installed from metafile"); - info!( - "{} v{} is already installed, use --force to override", - crate_name.name, metadata.current_version - ); - None - } - - // we have to assume that the version req could be *, - // and therefore a remote upgraded version could exist - (false, Some(metadata), _) => { - Some((crate_name, Some(metadata.current_version.clone()))) - } - - _ => Some((crate_name, None)), - } - }) - .collect::>(); - - if crate_names.is_empty() { - debug!("Nothing to do"); - return Ok(()); - } - - let temp_dir_path: Arc = Arc::from(temp_dir.path()); - - // Create binstall_opts - let binstall_opts = Arc::new(binstall::Options { - no_symlinks: opts.no_symlinks, - dry_run: opts.dry_run, - force: opts.force, - version_req: opts.version_req.take(), - manifest_path: opts.manifest_path.take(), - cli_overrides, - desired_targets, - quiet: opts.log_level == LevelFilter::Off, - }); - - let tasks: Vec<_> = if !opts.dry_run && !opts.no_confirm { - // Resolve crates - let tasks: Vec<_> = crate_names - .into_iter() - .map(|(crate_name, current_version)| { - AutoAbortJoinHandle::spawn(binstall::resolve( - binstall_opts.clone(), - crate_name, - current_version, - temp_dir_path.clone(), - install_path.clone(), - client.clone(), - crates_io_api_client.clone(), - )) - }) - .collect(); - - // Confirm - let mut resolutions = Vec::with_capacity(tasks.len()); - for task in tasks { - match task.await?? { - binstall::Resolution::AlreadyUpToDate => {} - res => resolutions.push(res), - } - } - - if resolutions.is_empty() { - debug!("Nothing to do"); - return Ok(()); - } - - uithread.confirm().await?; - - // Install - resolutions - .into_iter() - .map(|resolution| { - AutoAbortJoinHandle::spawn(binstall::install( - resolution, - binstall_opts.clone(), - jobserver_client.clone(), - )) - }) - .collect() - } else { - // Resolve crates and install without confirmation - crate_names - .into_iter() - .map(|(crate_name, current_version)| { - let opts = binstall_opts.clone(); - let temp_dir_path = temp_dir_path.clone(); - let jobserver_client = jobserver_client.clone(); - let client = client.clone(); - let crates_io_api_client = crates_io_api_client.clone(); - let install_path = install_path.clone(); - - AutoAbortJoinHandle::spawn(async move { - let resolution = binstall::resolve( - opts.clone(), - crate_name, - current_version, - temp_dir_path, - install_path, - client, - crates_io_api_client, - ) - .await?; - - binstall::install(resolution, opts, jobserver_client).await - }) - }) - .collect() - }; - - let mut metadata_vec = Vec::with_capacity(tasks.len()); - for task in tasks { - if let Some(metadata) = task.await?? { - metadata_vec.push(metadata); - } - } - - block_in_place(|| { - if let Some(mut records) = metadata { - // If using standardised install path, - // then create_dir_all(&install_path) would also - // create .cargo. - - debug!("Writing .crates.toml"); - metafiles::v1::CratesToml::append(metadata_vec.iter())?; - - debug!("Writing binstall/crates-v1.json"); - for metadata in metadata_vec { - records.replace(metadata); - } - records.overwrite()?; - } - - if opts.no_cleanup { - // Consume temp_dir without removing it from fs. - temp_dir.into_path(); - } else { - temp_dir.close().unwrap_or_else(|err| { - warn!("Failed to clean up some resources: {err}"); - }); - } - - Ok(()) - }) -} diff --git a/src/metafiles.rs b/src/metafiles.rs deleted file mode 100644 index b8a2b4ee..00000000 --- a/src/metafiles.rs +++ /dev/null @@ -1,6 +0,0 @@ -mod cvs; -pub use cvs::*; - -pub mod v1; - -pub mod binstall_v1; From df3a8e21c76f566e31cd0bb0638e290d0b83d66d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 Aug 2022 11:44:52 +0000 Subject: [PATCH 0688/2020] Bump actions/checkout from 2 to 3 (#303) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- .github/workflows/integration.yml | 2 +- .github/workflows/release-pr.yml | 2 +- .github/workflows/release.yml | 6 +++--- .github/workflows/unit-tests.yml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d753e358..f16f5dbb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -57,7 +57,7 @@ jobs: name: ${{ matrix.target }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure toolchain run: | diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 3810c6b8..401e9868 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -38,7 +38,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Download build uses: actions/download-artifact@v3 diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 5e450417..1da166bb 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -16,7 +16,7 @@ jobs: with: tool: cargo-release - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: ref: main diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9226a7da..ab5e47f1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -17,7 +17,7 @@ jobs: env: COMMIT_MESSAGE: ${{ github.event.head_commit.message }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Extract tag from commit message id: version run: .github/scripts/extract-tag-from-release-commit.sh @@ -32,7 +32,7 @@ jobs: needs: info runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Push release tag uses: mathieudutour/github-tag-action@v6.0 with: @@ -54,7 +54,7 @@ jobs: name: Package and release runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Get outputs uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index d9a8ceaf..2ff389b8 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -24,7 +24,7 @@ jobs: name: unit tests on ${{ matrix.os }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Configure toolchain run: | rustup toolchain install --profile minimal --no-self-update nightly From 88ddcf3599d9a5ba8183a83ac3e599c442578251 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 Aug 2022 11:56:29 +0000 Subject: [PATCH 0689/2020] Bump softprops/action-gh-release (#302) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ab5e47f1..e467de94 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -64,7 +64,7 @@ jobs: run: .github/scripts/pack-release-archives.sh - name: Publish release - uses: softprops/action-gh-release@50195ba7f6f93d1ac97ba8332a178e008ad176aa + uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 with: tag_name: ${{ needs.info.outputs.version }} name: ${{ needs.info.outputs.version }} From af59a5908549bf7efb924c74da3581152b16b0ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 Aug 2022 12:04:12 +0000 Subject: [PATCH 0690/2020] Bump clap from 3.2.16 to 3.2.17 (#299) Bumps [clap](https://github.com/clap-rs/clap) from 3.2.16 to 3.2.17. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/v3.2.17/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v3.2.16...v3.2.17) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- crates/lib/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c19c238c..405a923e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -230,9 +230,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.16" +version = "3.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3dbbb6653e7c55cc8595ad3e1f7be8f32aba4eb7ff7f0fd1163d4f3d137c0a9" +checksum = "29e724a68d9319343bb3328c9cc2dfde263f4b3142ee1059a9980580171c954b" dependencies = [ "atty", "bitflags", @@ -247,9 +247,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.2.15" +version = "3.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba52acd3b0a5c33aeada5cdaa3267cdc7c594a98731d4268cdc1532f4264cb4" +checksum = "13547f7012c01ab4a0e8f8967730ada8f9fdf419e8b6c792788f39cf4e46eefa" dependencies = [ "heck", "proc-macro-error", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index d1f36598..4a19c3b2 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -20,7 +20,7 @@ pkg-fmt = "zip" [dependencies] binstall = { path = "../lib", version = "0.1.0" } -clap = { version = "3.2.16", features = ["derive"] } +clap = { version = "3.2.17", features = ["derive"] } crates_io_api = { version = "0.8.0", default-features = false } dirs = "4.0.0" log = "0.4.17" diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index 92b088fa..41977560 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -14,7 +14,7 @@ async-trait = "0.1.57" bytes = "1.2.1" bzip2 = "0.4.3" cargo_toml = "0.11.5" -clap = { version = "3.2.16", features = ["derive"] } +clap = { version = "3.2.17", features = ["derive"] } compact_str = { version = "0.5.2", features = ["serde"] } crates_io_api = { version = "0.8.0", default-features = false } flate2 = { version = "1.0.24", default-features = false } From d9c7bdab55761944e82c63ca1380df72d572d0bb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 Aug 2022 12:16:48 +0000 Subject: [PATCH 0691/2020] Bump miette from 5.2.0 to 5.3.0 (#300) Bumps [miette](https://github.com/zkat/miette) from 5.2.0 to 5.3.0. - [Release notes](https://github.com/zkat/miette/releases) - [Changelog](https://github.com/zkat/miette/blob/main/CHANGELOG.md) - [Commits](https://github.com/zkat/miette/compare/miette-derive-v5.2.0...miette-derive-v5.3.0) --- updated-dependencies: - dependency-name: miette dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- crates/lib/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 405a923e..305c9703 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -929,9 +929,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "miette" -version = "5.2.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2c9d50e919ffdc4d2d83b83972a13e8ba86ba8245a205bee9e314d593c15a8" +checksum = "a28d6092d7e94a90bb9ea8e6c26c99d5d112d49dda2afdb4f7ea8cf09e1a5a6d" dependencies = [ "atty", "backtrace", @@ -949,9 +949,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.2.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c8d10c73bcc9f0ab5c918521dab23d178062a56e6b328eb37106d497280bd94" +checksum = "4f2485ed7d1fe80704928e3eb86387439609bd0c6bb96db8208daa364cfd1e09" dependencies = [ "proc-macro2", "quote", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 4a19c3b2..d6f416ca 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ clap = { version = "3.2.17", features = ["derive"] } crates_io_api = { version = "0.8.0", default-features = false } dirs = "4.0.0" log = "0.4.17" -miette = "5.2.0" +miette = "5.3.0" mimalloc = { version = "0.1.29", default-features = false, optional = true } reqwest = { version = "0.11.11", default-features = false } semver = "1.0.13" diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index 41977560..7d1cb014 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -24,7 +24,7 @@ home = "0.5.3" itertools = "0.10.3" jobserver = "0.1.24" log = { version = "0.4.17", features = ["std"] } -miette = "5.2.0" +miette = "5.3.0" normalize-path = { version = "0.1.0", path = "../normalize-path" } once_cell = "1.13.0" reqwest = { version = "0.11.11", features = ["stream"], default-features = false } From 3e2d272bfd4588f34512a0cdf83d108658ee337c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 Aug 2022 12:26:50 +0000 Subject: [PATCH 0692/2020] Bump serde from 1.0.142 to 1.0.143 (#297) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.142 to 1.0.143. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.142...v1.0.143) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/lib/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 305c9703..b1c626cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1418,9 +1418,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.142" +version = "1.0.143" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e590c437916fb6b221e1d00df6e3294f3fccd70ca7e92541c475d6ed6ef5fee2" +checksum = "53e8e5d5b70924f74ff5c6d64d9a5acd91422117c60f48c4e07855238a254553" dependencies = [ "serde_derive", ] @@ -1436,9 +1436,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.142" +version = "1.0.143" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34b5b8d809babe02f538c2cfec6f2c1ed10804c0e5a6a041a049a4f5588ccc2e" +checksum = "d3d8e8de557aee63c26b85b947f5e59b690d0454c753f3adeb5cd7835ab88391" dependencies = [ "proc-macro2", "quote", diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index 7d1cb014..6df79318 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -30,7 +30,7 @@ once_cell = "1.13.0" reqwest = { version = "0.11.11", features = ["stream"], default-features = false } scopeguard = "1.1.0" semver = { version = "1.0.13", features = ["serde"] } -serde = { version = "1.0.142", features = ["derive"] } +serde = { version = "1.0.143", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.83" strum = "0.24.1" From 4812456357c0796f524b4ec46072eea6b300f296 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 Aug 2022 12:39:37 +0000 Subject: [PATCH 0693/2020] Bump futures-util from 0.3.21 to 0.3.23 (#298) Bumps [futures-util](https://github.com/rust-lang/futures-rs) from 0.3.21 to 0.3.23. - [Release notes](https://github.com/rust-lang/futures-rs/releases) - [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.21...0.3.23) --- updated-dependencies: - dependency-name: futures-util dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 28 ++++++++++++++-------------- crates/lib/Cargo.toml | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b1c626cf..a72e95bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -537,9 +537,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +checksum = "2bfc52cbddcfd745bf1740338492bb0bd83d76c67b445f91c5fb29fae29ecaa1" dependencies = [ "futures-core", "futures-sink", @@ -547,9 +547,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" +checksum = "d2acedae88d38235936c3922476b10fced7b2b68136f5e3c03c2d5be348a1115" [[package]] name = "futures-executor" @@ -564,15 +564,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" +checksum = "93a66fc6d035a26a3ae255a6d2bca35eda63ae4c5512bef54449113f7a1228e5" [[package]] name = "futures-macro" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +checksum = "0db9cce532b0eae2ccf2766ab246f114b56b9cf6d445e00c2549fbc100ca045d" dependencies = [ "proc-macro2", "quote", @@ -581,21 +581,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" +checksum = "ca0bae1fe9752cf7fd9b0064c674ae63f97b37bc714d745cbde0afb7ec4e6765" [[package]] name = "futures-task" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" +checksum = "842fc63b931f4056a24d59de13fb1272134ce261816e063e634ad0c15cdc5306" [[package]] name = "futures-util" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +checksum = "f0828a5471e340229c11c77ca80017937ce3c58cb788a17e5f1c2d5c485a9577" dependencies = [ "futures-channel", "futures-core", diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index 6df79318..977e82b5 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -19,7 +19,7 @@ compact_str = { version = "0.5.2", features = ["serde"] } crates_io_api = { version = "0.8.0", default-features = false } flate2 = { version = "1.0.24", default-features = false } flock = { version = "0.1.0", path = "../flock" } -futures-util = { version = "0.3.21", default-features = false } +futures-util = { version = "0.3.23", default-features = false } home = "0.5.3" itertools = "0.10.3" jobserver = "0.1.24" From 11022846845abd37a372084b8ab32188105bb026 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 21 Aug 2022 00:40:50 +1000 Subject: [PATCH 0694/2020] Fix `clippy` warnings and add new workflow clippy (#306) * Derive `Eq` for `PkgFmt`, `PkgFmtDecomposed` & `TarBasedFmt` * Derive `Eq` for `PkgMeta`, `PkgOverride` & `BinMeta` * Rm unnecessary reborrow in `install_from_source` * Rm unnecessary `into()` in `args::parse` * Fix `clippy` warning in `CratesToml::append_to_path` * Fix clippy warning in `cratesio_url` * Fix clippy warning in `detect_targets_linux` * Add `clippy` and `rustfmt` to workflow `unit-test` Because `clippy` would not check inactive code disabled by `cfg`, so we have to also run `clippy` on multiple targets. Signed-off-by: Jiahao XU --- .github/workflows/unit-tests.yml | 8 +++++++- crates/bin/src/args.rs | 2 +- crates/lib/src/helpers/statics.rs | 2 +- crates/lib/src/manifests/cargo_crates_v1.rs | 2 +- crates/lib/src/manifests/cargo_toml_binstall.rs | 6 +++--- .../src/manifests/cargo_toml_binstall/package_formats.rs | 6 +++--- crates/lib/src/ops/install.rs | 2 +- crates/lib/src/targets.rs | 5 ++--- 8 files changed, 19 insertions(+), 14 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 2ff389b8..57e10fff 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -27,7 +27,7 @@ jobs: - uses: actions/checkout@v3 - name: Configure toolchain run: | - rustup toolchain install --profile minimal --no-self-update nightly + rustup toolchain install nightly --component rustfmt,clippy --no-self-update --profile minimal rustup default nightly - name: Configure caching @@ -53,3 +53,9 @@ jobs: - name: Test (Windows) if: matrix.os == 'windows' run: cargo test --no-default-features --features native-tls + + - name: fmt + run: cargo fmt --all --check + + - name: clippy + run: cargo clippy --no-deps -- -D clippy::all diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index bc8403e3..fcaec52f 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -244,7 +244,7 @@ pub fn parse() -> Result { }; if !option.is_empty() { - return Err(BinstallError::OverrideOptionUsedWithMultiInstall { option }.into()); + return Err(BinstallError::OverrideOptionUsedWithMultiInstall { option }); } } diff --git a/crates/lib/src/helpers/statics.rs b/crates/lib/src/helpers/statics.rs index ecc490c8..d2ff70ad 100644 --- a/crates/lib/src/helpers/statics.rs +++ b/crates/lib/src/helpers/statics.rs @@ -19,5 +19,5 @@ pub fn cratesio_url() -> &'static Url { static CRATESIO: Lazy Url> = Lazy::new(|| Url::parse("https://github.com/rust-lang/crates.io-index").unwrap()); - &*CRATESIO + &CRATESIO } diff --git a/crates/lib/src/manifests/cargo_crates_v1.rs b/crates/lib/src/manifests/cargo_crates_v1.rs index a593ad0a..d197e8b4 100644 --- a/crates/lib/src/manifests/cargo_crates_v1.rs +++ b/crates/lib/src/manifests/cargo_crates_v1.rs @@ -99,7 +99,7 @@ impl CratesToml { } file.rewind()?; - c1.write_to_file(&mut *file)?; + c1.write_to_file(&mut file)?; Ok(()) } diff --git a/crates/lib/src/manifests/cargo_toml_binstall.rs b/crates/lib/src/manifests/cargo_toml_binstall.rs index 9f1ce933..72312ba2 100644 --- a/crates/lib/src/manifests/cargo_toml_binstall.rs +++ b/crates/lib/src/manifests/cargo_toml_binstall.rs @@ -30,7 +30,7 @@ pub struct Meta { /// Metadata for binary installation use. /// /// Exposed via `[package.metadata]` in `Cargo.toml` -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "kebab-case", default)] pub struct PkgMeta { /// URL template for package downloads @@ -79,7 +79,7 @@ impl PkgMeta { /// Target specific overrides for binary installation /// /// Exposed via `[package.metadata.TARGET]` in `Cargo.toml` -#[derive(Clone, Debug, Default, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "kebab-case", default)] pub struct PkgOverride { /// URL template override for package downloads @@ -92,7 +92,7 @@ pub struct PkgOverride { pub bin_dir: Option, } -#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "kebab-case")] pub struct BinMeta { /// Binary name diff --git a/crates/lib/src/manifests/cargo_toml_binstall/package_formats.rs b/crates/lib/src/manifests/cargo_toml_binstall/package_formats.rs index 4368638e..f7caf2c4 100644 --- a/crates/lib/src/manifests/cargo_toml_binstall/package_formats.rs +++ b/crates/lib/src/manifests/cargo_toml_binstall/package_formats.rs @@ -2,7 +2,7 @@ use serde::{Deserialize, Serialize}; use strum_macros::{Display, EnumString}; /// Binary format enumeration -#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize, EnumString)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Serialize, Deserialize, EnumString)] #[serde(rename_all = "snake_case")] pub enum PkgFmt { /// Download format is TAR (uncompressed) @@ -55,14 +55,14 @@ impl PkgFmt { } } -#[derive(Debug, Copy, Clone, PartialEq)] +#[derive(Debug, Copy, Clone, Eq, PartialEq)] pub enum PkgFmtDecomposed { Tar(TarBasedFmt), Bin, Zip, } -#[derive(Debug, Display, Copy, Clone, PartialEq)] +#[derive(Debug, Display, Copy, Clone, Eq, PartialEq)] pub enum TarBasedFmt { /// Download format is TAR (uncompressed) Tar, diff --git a/crates/lib/src/ops/install.rs b/crates/lib/src/ops/install.rs index b060b2f4..6632c50b 100644 --- a/crates/lib/src/ops/install.rs +++ b/crates/lib/src/ops/install.rs @@ -161,7 +161,7 @@ async fn install_from_source( .arg("--version") .arg(package.version) .arg("--target") - .arg(&*target); + .arg(target); if quiet { cmd.arg("--quiet"); diff --git a/crates/lib/src/targets.rs b/crates/lib/src/targets.rs index dc905383..57723bba 100644 --- a/crates/lib/src/targets.rs +++ b/crates/lib/src/targets.rs @@ -136,12 +136,11 @@ mod linux { pub(super) async fn detect_targets_linux() -> Vec { let (abi, libc) = parse_abi_and_libc(); - match libc { + if let Libc::Glibc = libc { // Glibc can only be dynamically linked. // If we can run this binary, then it means that the target // supports both glibc and musl. - Libc::Glibc => return create_targets_str(&["gnu", "musl"], abi), - _ => (), + return create_targets_str(&["gnu", "musl"], abi); } if let Ok(Output { From 62f9450d2d975ebc18b02b79ae3e1e6479001234 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 21 Aug 2022 22:21:33 +1000 Subject: [PATCH 0695/2020] Refactor: Extract new crate `detect-targets` and improve code quality (#307) * Refactor: Extract new crate `detect-targets` Signed-off-by: Jiahao XU * Refactor: Extract new mod `detect` for `detect-targets` Signed-off-by: Jiahao XU * Refactor: Extract `desired_targets` in crate `detect-targets` Signed-off-by: Jiahao XU * Refactor: Extract `detect::linux` in crate `detect-targets` Signed-off-by: Jiahao XU * Refactor: Extract `detect::macos` in crate `detect-targets` Signed-off-by: Jiahao XU * Refactor: Extract `detect::windows` in crate `detect-targets` Signed-off-by: Jiahao XU * Add new dep cfg-if v1.0.0 for `detect-targets` Signed-off-by: Jiahao XU * Refactor: Simplify mod declaration in `detect` using `cfg_if!` Signed-off-by: Jiahao XU * Refactor: Simplify `detect_targets` using `cfg_if!` Signed-off-by: Jiahao XU * Add crate doc for `detect-targets` Signed-off-by: Jiahao XU * Enable feature "macros" of tokio in `detect-targets` Signed-off-by: Jiahao XU * Enable feature "io-util" of dep tokio Signed-off-by: Jiahao XU * Rm unused feature "io-util" & "macros" of dep tokio Signed-off-by: Jiahao XU * Set stdin & stderr to null in `get_target_from_rustc` Signed-off-by: Jiahao XU * Improve doc of `get_desired_targets` Signed-off-by: Jiahao XU * Improve `detect_targets_linux`: Run `ldd` with stdin set to null Signed-off-by: Jiahao XU * Fix potential panic in `windows::detect_alternative_targets` Signed-off-by: Jiahao XU * FIx fmt of `detect_targets_linux` Signed-off-by: Jiahao XU * Do not re-export dep `detect-targets` in `crates/lib` Signed-off-by: Jiahao XU * Fix typo in crate doc for `detect-targets` Signed-off-by: Jiahao XU * Enable feature "macros" of tokio in dev mode Signed-off-by: Jiahao XU * Add example to crate doc of `detect-targets` Signed-off-by: Jiahao XU * Improve API `get_desired_targets`: Take `Option<&str>` instead of `&Option` Signed-off-by: Jiahao XU Signed-off-by: Jiahao XU --- .github/dependabot.yml | 4 + Cargo.lock | 11 +- Cargo.toml | 1 + crates/bin/src/entry.rs | 4 +- crates/detect-targets/Cargo.toml | 20 ++ crates/detect-targets/LICENSE-APACHE | 176 ++++++++++++ crates/detect-targets/LICENSE-MIT | 23 ++ crates/{lib => detect-targets}/build.rs | 0 crates/detect-targets/src/desired_targets.rs | 59 ++++ crates/detect-targets/src/detect.rs | 88 ++++++ crates/detect-targets/src/detect/linux.rs | 86 ++++++ crates/detect-targets/src/detect/macos.rs | 15 ++ crates/detect-targets/src/detect/windows.rs | 17 ++ crates/detect-targets/src/lib.rs | 65 +++++ crates/lib/Cargo.toml | 4 +- crates/lib/src/lib.rs | 3 +- .../lib/src/manifests/binstall_crates_v1.rs | 3 +- crates/lib/src/manifests/cargo_crates_v1.rs | 3 +- crates/lib/src/ops.rs | 2 +- crates/lib/src/targets.rs | 253 ------------------ 20 files changed, 574 insertions(+), 263 deletions(-) create mode 100644 crates/detect-targets/Cargo.toml create mode 100644 crates/detect-targets/LICENSE-APACHE create mode 100644 crates/detect-targets/LICENSE-MIT rename crates/{lib => detect-targets}/build.rs (100%) create mode 100644 crates/detect-targets/src/desired_targets.rs create mode 100644 crates/detect-targets/src/detect.rs create mode 100644 crates/detect-targets/src/detect/linux.rs create mode 100644 crates/detect-targets/src/detect/macos.rs create mode 100644 crates/detect-targets/src/detect/windows.rs create mode 100644 crates/detect-targets/src/lib.rs delete mode 100644 crates/lib/src/targets.rs diff --git a/.github/dependabot.yml b/.github/dependabot.yml index c168124d..f0420247 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -28,3 +28,7 @@ updates: directory: "/crates/normalize-path" schedule: interval: "daily" + - package-ecosystem: "cargo" + directory: "/crates/detect-target" + schedule: + interval: "daily" diff --git a/Cargo.lock b/Cargo.lock index a72e95bd..5d9985a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -86,11 +86,11 @@ dependencies = [ "clap", "compact_str", "crates_io_api", + "detect-targets", "env_logger", "flate2", "flock", "futures-util", - "guess_host_triple", "home", "itertools", "jobserver", @@ -350,6 +350,15 @@ dependencies = [ "once_cell", ] +[[package]] +name = "detect-targets" +version = "0.1.0" +dependencies = [ + "cfg-if", + "guess_host_triple", + "tokio", +] + [[package]] name = "detect-wasi" version = "1.0.0" diff --git a/Cargo.toml b/Cargo.toml index 80872e3a..8cbee532 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,7 @@ members = [ "crates/detect-wasi", "crates/flock", "crates/normalize-path", + "crates/detect-targets", ] [profile.release] diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 5d23a316..0091b017 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -2,6 +2,7 @@ use std::{fs, path::Path, sync::Arc, time::Duration}; use binstall::{ errors::BinstallError, + get_desired_targets, helpers::{ jobserver_client::LazyJobserverClient, remote::create_reqwest_client, tasks::AutoAbortJoinHandle, @@ -13,7 +14,6 @@ use binstall::{ self, resolve::{CrateName, Resolution, VersionReqExt}, }, - targets::get_desired_targets, }; use log::{debug, error, info, warn, LevelFilter}; use miette::{miette, Result, WrapErr}; @@ -29,7 +29,7 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien }; // Launch target detection - let desired_targets = get_desired_targets(&args.targets); + let desired_targets = get_desired_targets(args.targets.as_deref()); // Initialize reqwest client let client = create_reqwest_client(args.secure, args.min_tls_version.map(|v| v.into()))?; diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml new file mode 100644 index 00000000..e389b996 --- /dev/null +++ b/crates/detect-targets/Cargo.toml @@ -0,0 +1,20 @@ +[package] +name = "detect-targets" +description = "Detect the target of the env at runtime" +repository = "https://github.com/cargo-bins/cargo-binstall" +documentation = "https://docs.rs/detect-target" +version = "0.1.0" +rust-version = "1.61.0" +authors = ["Jiahao XU "] +edition = "2021" +license = "Apache-2.0 OR MIT" + +[dependencies] +tokio = { version = "1.20.1", features = ["rt", "process", "sync"], default-features = false } +cfg-if = "1.0.0" + +[target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] +guess_host_triple = "0.1.3" + +[dev-dependencies] +tokio = { version = "1.20.1", features = ["macros"], default-features = false } diff --git a/crates/detect-targets/LICENSE-APACHE b/crates/detect-targets/LICENSE-APACHE new file mode 100644 index 00000000..1b5ec8b7 --- /dev/null +++ b/crates/detect-targets/LICENSE-APACHE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/crates/detect-targets/LICENSE-MIT b/crates/detect-targets/LICENSE-MIT new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/crates/detect-targets/LICENSE-MIT @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/crates/lib/build.rs b/crates/detect-targets/build.rs similarity index 100% rename from crates/lib/build.rs rename to crates/detect-targets/build.rs diff --git a/crates/detect-targets/src/desired_targets.rs b/crates/detect-targets/src/desired_targets.rs new file mode 100644 index 00000000..42acfefd --- /dev/null +++ b/crates/detect-targets/src/desired_targets.rs @@ -0,0 +1,59 @@ +use crate::detect_targets; + +use std::sync::Arc; + +use tokio::sync::OnceCell; + +#[derive(Debug)] +enum DesiredTargetsInner { + AutoDetect(Arc>>), + Initialized(Vec), +} + +#[derive(Debug)] +pub struct DesiredTargets(DesiredTargetsInner); + +impl DesiredTargets { + fn initialized(targets: Vec) -> Self { + Self(DesiredTargetsInner::Initialized(targets)) + } + + fn auto_detect() -> Self { + let arc = Arc::new(OnceCell::new()); + + let once_cell = arc.clone(); + tokio::spawn(async move { + once_cell.get_or_init(detect_targets).await; + }); + + Self(DesiredTargetsInner::AutoDetect(arc)) + } + + pub async fn get(&self) -> &[String] { + use DesiredTargetsInner::*; + + match &self.0 { + Initialized(targets) => targets, + + // This will mostly just wait for the spawned task, + // on rare occausion though, it will poll the future + // returned by `detect_targets`. + AutoDetect(once_cell) => once_cell.get_or_init(detect_targets).await, + } + } +} + +/// If opts_targets is `Some`, then it will be parsed in the format of +/// `$target1,$target2,...`. +/// Otherwise, call `detect_targets` using `tokio::spawn` to detect targets. +/// +/// Since `detect_targets` internally spawns a process and wait for it, +/// it's pretty costy, it is recommended to run this fn ASAP and +/// reuse the result. +pub fn get_desired_targets(opts_targets: Option<&str>) -> DesiredTargets { + if let Some(targets) = opts_targets { + DesiredTargets::initialized(targets.split(',').map(|t| t.to_string()).collect()) + } else { + DesiredTargets::auto_detect() + } +} diff --git a/crates/detect-targets/src/detect.rs b/crates/detect-targets/src/detect.rs new file mode 100644 index 00000000..da023365 --- /dev/null +++ b/crates/detect-targets/src/detect.rs @@ -0,0 +1,88 @@ +use std::{ + io::{BufRead, Cursor}, + process::{Output, Stdio}, +}; + +use cfg_if::cfg_if; +use tokio::process::Command; + +cfg_if! { + if #[cfg(target_os = "linux")] { + mod linux; + } else if #[cfg(target_os = "macos")] { + mod macos; + } else if #[cfg(target_os = "windows")] { + mod windows; + } +} + +/// Detect the targets supported at runtime, +/// which might be different from `TARGET` which is detected +/// at compile-time. +/// +/// Return targets supported in the order of preference. +/// If target_os is linux and it support gnu, then it is preferred +/// to musl. +/// +/// If target_os is mac and it is aarch64, then aarch64 is preferred +/// to x86_64. +/// +/// Check [this issue](https://github.com/ryankurte/cargo-binstall/issues/155) +/// for more information. +pub async fn detect_targets() -> Vec { + if let Some(target) = get_target_from_rustc().await { + let mut v = vec![target]; + + cfg_if! { + if #[cfg(target_os = "linux")] { + if v[0].contains("gnu") { + v.push(v[0].replace("gnu", "musl")); + } + } else if #[cfg(target_os = "macos")] { + if &*v[0] == macos::AARCH64 { + v.push(macos::X86.into()); + } + } else if #[cfg(target_os = "windows")] { + v.extend(windows::detect_alternative_targets(&v[0])); + } + } + + v + } else { + cfg_if! { + if #[cfg(target_os = "linux")] { + linux::detect_targets_linux().await + } else if #[cfg(target_os = "macos")] { + macos::detect_targets_macos() + } else if #[cfg(target_os = "windows")] { + windows::detect_targets_windows() + } else { + vec![TARGET.into()] + } + } + } +} + +/// Figure out what the host target is using `rustc`. +/// If `rustc` is absent, then it would return `None`. +async fn get_target_from_rustc() -> Option { + let Output { status, stdout, .. } = Command::new("rustc") + .arg("-vV") + .stdin(Stdio::null()) + .stdout(Stdio::piped()) + .stderr(Stdio::null()) + .spawn() + .ok()? + .wait_with_output() + .await + .ok()?; + + if !status.success() { + return None; + } + + Cursor::new(stdout) + .lines() + .filter_map(|line| line.ok()) + .find_map(|line| line.strip_prefix("host: ").map(|host| host.to_owned())) +} diff --git a/crates/detect-targets/src/detect/linux.rs b/crates/detect-targets/src/detect/linux.rs new file mode 100644 index 00000000..ebe635a6 --- /dev/null +++ b/crates/detect-targets/src/detect/linux.rs @@ -0,0 +1,86 @@ +use crate::TARGET; + +use std::process::{Output, Stdio}; + +use tokio::process::Command; + +pub(super) async fn detect_targets_linux() -> Vec { + let (abi, libc) = parse_abi_and_libc(); + + if let Libc::Glibc = libc { + // Glibc can only be dynamically linked. + // If we can run this binary, then it means that the target + // supports both glibc and musl. + return create_targets_str(&["gnu", "musl"], abi); + } + + if let Ok(Output { + status: _, + stdout, + stderr, + }) = Command::new("ldd") + .arg("--version") + .stdin(Stdio::null()) + .output() + .await + { + let libc_version = if let Some(libc_version) = parse_libc_version_from_ldd_output(&stdout) { + libc_version + } else if let Some(libc_version) = parse_libc_version_from_ldd_output(&stderr) { + libc_version + } else { + return vec![create_target_str("musl", abi)]; + }; + + if libc_version == "gnu" { + return create_targets_str(&["gnu", "musl"], abi); + } + } + + // Fallback to using musl + vec![create_target_str("musl", abi)] +} + +fn parse_libc_version_from_ldd_output(output: &[u8]) -> Option<&'static str> { + let s = String::from_utf8_lossy(output); + if s.contains("musl libc") { + Some("musl") + } else if s.contains("GLIBC") { + Some("gnu") + } else { + None + } +} + +enum Libc { + Glibc, + Musl, +} + +fn parse_abi_and_libc() -> (&'static str, Libc) { + let last = TARGET.rsplit_once('-').unwrap().1; + + if let Some(libc_version) = last.strip_prefix("musl") { + (libc_version, Libc::Musl) + } else if let Some(libc_version) = last.strip_prefix("gnu") { + (libc_version, Libc::Glibc) + } else { + panic!("Unrecognized libc") + } +} + +fn create_target_str(libc_version: &str, abi: &str) -> String { + let prefix = TARGET + .rsplit_once('-') + .expect("unwrap: TARGET always has a -") + .0; + + format!("{prefix}-{libc_version}{abi}") +} + +fn create_targets_str(libc_versions: &[&str], abi: &str) -> Vec { + libc_versions + .iter() + .map(|libc_version| create_target_str(libc_version, abi)) + .collect() +} diff --git a/crates/detect-targets/src/detect/macos.rs b/crates/detect-targets/src/detect/macos.rs new file mode 100644 index 00000000..67e31ccf --- /dev/null +++ b/crates/detect-targets/src/detect/macos.rs @@ -0,0 +1,15 @@ +use crate::TARGET; +use guess_host_triple::guess_host_triple; + +pub(super) const AARCH64: &str = "aarch64-apple-darwin"; +pub(super) const X86: &str = "x86_64-apple-darwin"; + +pub(super) fn detect_targets_macos() -> Vec { + let mut targets = vec![guess_host_triple().unwrap_or(TARGET).to_string()]; + + if targets[0] == AARCH64 { + targets.push(X86.into()); + } + + targets +} diff --git a/crates/detect-targets/src/detect/windows.rs b/crates/detect-targets/src/detect/windows.rs new file mode 100644 index 00000000..4efd5f2c --- /dev/null +++ b/crates/detect-targets/src/detect/windows.rs @@ -0,0 +1,17 @@ +use crate::TARGET; +use guess_host_triple::guess_host_triple; + +pub(super) fn detect_alternative_targets(target: &str) -> Option { + let (prefix, abi) = target.rsplit_once('-')?; + + // detect abi in ["gnu", "gnullvm", ...] + (abi != "msvc").then(|| format!("{prefix}-msvc")) +} + +pub(super) fn detect_targets_windows() -> Vec { + let mut targets = vec![guess_host_triple().unwrap_or(TARGET).to_string()]; + + targets.extend(detect_alternative_targets(&targets[0])); + + targets +} diff --git a/crates/detect-targets/src/lib.rs b/crates/detect-targets/src/lib.rs new file mode 100644 index 00000000..1ba7831b --- /dev/null +++ b/crates/detect-targets/src/lib.rs @@ -0,0 +1,65 @@ +//! Detect the target at the runtime. +//! +//! Example use cases: +//! - The binary is built with musl libc to run on anywhere, but +//! the runtime supports glibc. +//! - The binary is built for x86_64-apple-darwin, but run on +//! aarch64-apple-darwin. +//! +//! This crate provides two API: +//! - [`detect_targets`] provides the API to get the target +//! at runtime, but the code is run on the current thread. +//! - [`get_desired_targets`] provides the API to either +//! parse `$target1,$target2,...` override provided by the users, +//! or run [`detect_targets`] in the background using [`tokio::spawn`]. +//! +//! # Example +//! +//! `detect_targets`: +//! +//! ```rust +//! use detect_targets::detect_targets; +//! # #[tokio::main(flavor = "current_thread")] +//! # async fn main() { +//! +//! let targets = detect_targets().await; +//! eprintln!("Your platform supports targets: {targets:#?}"); +//! # } +//! ``` +//! +//! `get_desired_targets` with user override: +//! +//! ```rust +//! use detect_targets::get_desired_targets; +//! # #[tokio::main(flavor = "current_thread")] +//! # async fn main() { +//! +//! assert_eq!( +//! get_desired_targets(Some("x86_64-apple-darwin,aarch64-apple-darwin")).get().await, +//! &["x86_64-apple-darwin", "aarch64-apple-darwin"], +//! ); +//! # } +//! ``` +//! +//! `get_desired_targets` without user override: +//! +//! ```rust +//! use detect_targets::get_desired_targets; +//! # #[tokio::main(flavor = "current_thread")] +//! # async fn main() { +//! +//! eprintln!( +//! "Your platform supports targets: {:#?}", +//! get_desired_targets(None).get().await +//! ); +//! # } +//! ``` + +mod detect; +pub use detect::detect_targets; + +mod desired_targets; +pub use desired_targets::{get_desired_targets, DesiredTargets}; + +/// Compiled target triple, used as default for binary fetching +pub const TARGET: &str = env!("TARGET"); diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index 977e82b5..6634a31b 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -17,6 +17,7 @@ cargo_toml = "0.11.5" clap = { version = "3.2.17", features = ["derive"] } compact_str = { version = "0.5.2", features = ["serde"] } crates_io_api = { version = "0.8.0", default-features = false } +detect-targets = { version = "0.1.0", path = "../detect-targets" } flate2 = { version = "1.0.24", default-features = false } flock = { version = "0.1.0", path = "../flock" } futures-util = { version = "0.3.23", default-features = false } @@ -57,9 +58,6 @@ zip = { version = "0.6.2", default-features = false, features = ["deflate", "bzi # otherwise there will be a link conflict. zstd = { version = "0.10.0", default-features = false } -[target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] -guess_host_triple = "0.1.3" - [dev-dependencies] env_logger = "0.9.0" diff --git a/crates/lib/src/lib.rs b/crates/lib/src/lib.rs index 261a008b..273f4d97 100644 --- a/crates/lib/src/lib.rs +++ b/crates/lib/src/lib.rs @@ -6,4 +6,5 @@ pub mod fs; pub mod helpers; pub mod manifests; pub mod ops; -pub mod targets; + +pub use detect_targets::{get_desired_targets, DesiredTargets}; diff --git a/crates/lib/src/manifests/binstall_crates_v1.rs b/crates/lib/src/manifests/binstall_crates_v1.rs index 6593b81a..78b9ab02 100644 --- a/crates/lib/src/manifests/binstall_crates_v1.rs +++ b/crates/lib/src/manifests/binstall_crates_v1.rs @@ -170,9 +170,10 @@ impl<'a> IntoIterator for &'a Records { #[cfg(test)] mod test { use super::*; - use crate::{manifests::crate_info::CrateSource, targets::TARGET}; + use crate::manifests::crate_info::CrateSource; use compact_str::CompactString; + use detect_targets::TARGET; use semver::Version; use tempfile::NamedTempFile; diff --git a/crates/lib/src/manifests/cargo_crates_v1.rs b/crates/lib/src/manifests/cargo_crates_v1.rs index d197e8b4..2f9b8296 100644 --- a/crates/lib/src/manifests/cargo_crates_v1.rs +++ b/crates/lib/src/manifests/cargo_crates_v1.rs @@ -130,8 +130,9 @@ pub enum CratesTomlParseError { #[cfg(test)] mod tests { use super::*; - use crate::{manifests::crate_info::CrateSource, targets::TARGET}; + use crate::manifests::crate_info::CrateSource; + use detect_targets::TARGET; use semver::Version; use tempfile::TempDir; diff --git a/crates/lib/src/ops.rs b/crates/lib/src/ops.rs index 4274df96..b7475750 100644 --- a/crates/lib/src/ops.rs +++ b/crates/lib/src/ops.rs @@ -4,7 +4,7 @@ use std::path::PathBuf; use semver::VersionReq; -use crate::{manifests::cargo_toml_binstall::PkgOverride, targets::DesiredTargets}; +use crate::{manifests::cargo_toml_binstall::PkgOverride, DesiredTargets}; pub mod install; pub mod resolve; diff --git a/crates/lib/src/targets.rs b/crates/lib/src/targets.rs deleted file mode 100644 index 57723bba..00000000 --- a/crates/lib/src/targets.rs +++ /dev/null @@ -1,253 +0,0 @@ -use std::{ - io::{BufRead, Cursor}, - process::Output, - sync::Arc, -}; - -use tokio::{process::Command, sync::OnceCell}; - -/// Compiled target triple, used as default for binary fetching -pub const TARGET: &str = env!("TARGET"); - -#[derive(Debug)] -enum DesiredTargetsInner { - AutoDetect(Arc>>), - Initialized(Vec), -} - -#[derive(Debug)] -pub struct DesiredTargets(DesiredTargetsInner); - -impl DesiredTargets { - fn initialized(targets: Vec) -> Self { - Self(DesiredTargetsInner::Initialized(targets)) - } - - fn auto_detect() -> Self { - let arc = Arc::new(OnceCell::new()); - - let once_cell = arc.clone(); - tokio::spawn(async move { - once_cell.get_or_init(detect_targets).await; - }); - - Self(DesiredTargetsInner::AutoDetect(arc)) - } - - pub async fn get(&self) -> &[String] { - use DesiredTargetsInner::*; - - match &self.0 { - Initialized(targets) => targets, - - // This will mostly just wait for the spawned task, - // on rare occausion though, it will poll the future - // returned by `detect_targets`. - AutoDetect(once_cell) => once_cell.get_or_init(detect_targets).await, - } - } -} - -/// If opts_targets is `Some`, then it will be used. -/// Otherwise, call `detect_targets` using `tokio::spawn` to detect targets. -/// -/// Since `detect_targets` internally spawns a process and wait for it, -/// it's pretty costy. -/// -/// Calling it through `tokio::spawn` would enable other tasks, such as -/// fetching the crate tarballs, to be executed concurrently. -pub fn get_desired_targets(opts_targets: &Option) -> DesiredTargets { - if let Some(targets) = opts_targets.as_ref() { - DesiredTargets::initialized(targets.split(',').map(|t| t.to_string()).collect()) - } else { - DesiredTargets::auto_detect() - } -} - -/// Detect the targets supported at runtime, -/// which might be different from `TARGET` which is detected -/// at compile-time. -/// -/// Return targets supported in the order of preference. -/// If target_os is linux and it support gnu, then it is preferred -/// to musl. -/// -/// If target_os is mac and it is aarch64, then aarch64 is preferred -/// to x86_64. -/// -/// Check [this issue](https://github.com/ryankurte/cargo-binstall/issues/155) -/// for more information. -pub async fn detect_targets() -> Vec { - if let Some(target) = get_target_from_rustc().await { - let mut v = vec![target]; - - #[cfg(target_os = "linux")] - if v[0].contains("gnu") { - v.push(v[0].replace("gnu", "musl")); - } - - #[cfg(target_os = "macos")] - if &*v[0] == macos::AARCH64 { - v.push(macos::X86.into()); - } - - #[cfg(target_os = "windows")] - v.extend(windows::detect_alternative_targets(&v[0])); - - v - } else { - #[cfg(target_os = "linux")] - { - linux::detect_targets_linux().await - } - #[cfg(target_os = "macos")] - { - macos::detect_targets_macos() - } - #[cfg(target_os = "windows")] - { - windows::detect_targets_windows() - } - #[cfg(not(any(target_os = "linux", target_os = "macos", target_os = "windows")))] - { - vec![TARGET.into()] - } - } -} - -/// Figure out what the host target is using `rustc`. -/// If `rustc` is absent, then it would return `None`. -async fn get_target_from_rustc() -> Option { - let Output { status, stdout, .. } = Command::new("rustc").arg("-vV").output().await.ok()?; - if !status.success() { - return None; - } - - Cursor::new(stdout) - .lines() - .filter_map(|line| line.ok()) - .find_map(|line| line.strip_prefix("host: ").map(|host| host.to_owned())) -} - -#[cfg(target_os = "linux")] -mod linux { - use super::{Command, Output, TARGET}; - - pub(super) async fn detect_targets_linux() -> Vec { - let (abi, libc) = parse_abi_and_libc(); - - if let Libc::Glibc = libc { - // Glibc can only be dynamically linked. - // If we can run this binary, then it means that the target - // supports both glibc and musl. - return create_targets_str(&["gnu", "musl"], abi); - } - - if let Ok(Output { - status: _, - stdout, - stderr, - }) = Command::new("ldd").arg("--version").output().await - { - let libc_version = - if let Some(libc_version) = parse_libc_version_from_ldd_output(&stdout) { - libc_version - } else if let Some(libc_version) = parse_libc_version_from_ldd_output(&stderr) { - libc_version - } else { - return vec![create_target_str("musl", abi)]; - }; - - if libc_version == "gnu" { - return create_targets_str(&["gnu", "musl"], abi); - } - } - - // Fallback to using musl - vec![create_target_str("musl", abi)] - } - - fn parse_libc_version_from_ldd_output(output: &[u8]) -> Option<&'static str> { - let s = String::from_utf8_lossy(output); - if s.contains("musl libc") { - Some("musl") - } else if s.contains("GLIBC") { - Some("gnu") - } else { - None - } - } - - enum Libc { - Glibc, - Musl, - } - - fn parse_abi_and_libc() -> (&'static str, Libc) { - let last = TARGET.rsplit_once('-').unwrap().1; - - if let Some(libc_version) = last.strip_prefix("musl") { - (libc_version, Libc::Musl) - } else if let Some(libc_version) = last.strip_prefix("gnu") { - (libc_version, Libc::Glibc) - } else { - panic!("Unrecognized libc") - } - } - - fn create_target_str(libc_version: &str, abi: &str) -> String { - let prefix = TARGET - .rsplit_once('-') - .expect("unwrap: TARGET always has a -") - .0; - - format!("{prefix}-{libc_version}{abi}") - } - - fn create_targets_str(libc_versions: &[&str], abi: &str) -> Vec { - libc_versions - .iter() - .map(|libc_version| create_target_str(libc_version, abi)) - .collect() - } -} - -#[cfg(target_os = "macos")] -mod macos { - use super::TARGET; - use guess_host_triple::guess_host_triple; - - pub(super) const AARCH64: &str = "aarch64-apple-darwin"; - pub(super) const X86: &str = "x86_64-apple-darwin"; - - pub(super) fn detect_targets_macos() -> Vec { - let mut targets = vec![guess_host_triple().unwrap_or(TARGET).to_string()]; - - if targets[0] == AARCH64 { - targets.push(X86.into()); - } - - targets - } -} - -#[cfg(target_os = "windows")] -mod windows { - use super::TARGET; - use guess_host_triple::guess_host_triple; - - pub(super) fn detect_alternative_targets(target: &str) -> Option { - let (prefix, abi) = target.rsplit_once('-').expect("Invalid target triple"); - - // detect abi in ["gnu", "gnullvm", ...] - (abi != "msvc").then(|| format!("{prefix}-msvc")) - } - - pub(super) fn detect_targets_windows() -> Vec { - let mut targets = vec![guess_host_triple().unwrap_or(TARGET).to_string()]; - - targets.extend(detect_alternative_targets(&targets[0])); - - targets - } -} From b5ea9a2293ac0e59eb3b63700f2a409ac2a0597f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 Aug 2022 15:15:01 +1200 Subject: [PATCH 0696/2020] Update compact_str requirement from 0.5.2 to 0.6.0 in /crates/lib (#308) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- crates/lib/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index 6634a31b..c856f937 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -15,7 +15,7 @@ bytes = "1.2.1" bzip2 = "0.4.3" cargo_toml = "0.11.5" clap = { version = "3.2.17", features = ["derive"] } -compact_str = { version = "0.5.2", features = ["serde"] } +compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.0", default-features = false } detect-targets = { version = "0.1.0", path = "../detect-targets" } flate2 = { version = "1.0.24", default-features = false } From 6b5e8f6875f2ce4a48bc81620fad6d115c602af2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 22 Aug 2022 22:28:36 +1000 Subject: [PATCH 0697/2020] Auto detect `pkg_fmt` (#310) * Refactor: Extract `GhCrateMeta::find_baseline` Signed-off-by: Jiahao XU * Update `Cargo.lock`: Update dep `compact_str` Signed-off-by: Jiahao XU * Fix use of `fetchers`: Set `meta.pkg_fmt` using `fetcher.pkg_fmt()` Signed-off-by: Jiahao XU * Derive `strum_macors::{Display, EnumIter}` for `PkgFmt` Signed-off-by: Jiahao XU * Set typeof field `PkgMeta::pkg_fmt` to be `Option` Signed-off-by: Jiahao XU * Optimize `Fetcher::new` to take `&Arc` instead of `&Data` To avoid unnecessary `Data::clone` call in `GhCrateMeta` Signed-off-by: Jiahao XU * Optimize `GhCrateMeta::find_baseline`: Avoid unnecessary spawning for `let Err(_) = url` Signed-off-by: Jiahao XU * Optimize spawning in `GhCrateMeta::find_baseline` Ret `Option` instead of `(Url, bool)` Signed-off-by: Jiahao XU * Add new method `target_meta` to trait `Fetcher` Signed-off-by: Jiahao XU * Simplify `resolve_inner` using `Fetcher::target_meta` Signed-off-by: Jiahao XU * Optimize loop in `resolve_inner`: Avoid cloning `PkgOverride` Signed-off-by: Jiahao XU * Impl `PkgMeta::clone_without_overrides` Signed-off-by: Jiahao XU * Optimize `resolve_inner` loop: Use `PkgMeta::clone_without_overrides` Signed-off-by: Jiahao XU * Refactor: Simplify `Context::from_data` impl Signed-off-by: Jiahao XU * Refactor: Extract `launch_baseline_find_tasks` Signed-off-by: Jiahao XU * Refactor: Simplify `::find` Instead of launching tasks in an opaque manner in `Self::find_baseline`, the new design returns an iterator which launches the tasks and thus have a unified `.await` point for all these tasks. Signed-off-by: Jiahao XU * Add `warn!`ing to report failure of `Context::render_url` Signed-off-by: Jiahao XU Signed-off-by: Jiahao XU --- Cargo.lock | 4 +- crates/lib/src/bins.rs | 2 +- crates/lib/src/fetchers.rs | 5 +- crates/lib/src/fetchers/gh_crate_meta.rs | 109 +++++++++++------- crates/lib/src/fetchers/quickinstall.rs | 12 +- .../lib/src/manifests/cargo_toml_binstall.rs | 16 ++- .../cargo_toml_binstall/package_formats.rs | 6 +- crates/lib/src/ops/resolve.rs | 18 ++- 8 files changed, 106 insertions(+), 66 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5d9985a9..92628c65 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -288,9 +288,9 @@ dependencies = [ [[package]] name = "compact_str" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5857fc4f27cd0fa2cd7c4a4fa780c0da3d898ae27e66bf6a719343e219e9a559" +checksum = "bbe793f2e4f8b2b8295ea7dfd141260c0a5c9f6d25c91bde42efed76a47e0bfe" dependencies = [ "castaway", "itoa", diff --git a/crates/lib/src/bins.rs b/crates/lib/src/bins.rs index c3b330ef..a2d81c2a 100644 --- a/crates/lib/src/bins.rs +++ b/crates/lib/src/bins.rs @@ -42,7 +42,7 @@ impl BinFile { // Generate install paths // Source path is the download dir + the generated binary path let source_file_path = ctx.render(&data.meta.bin_dir)?; - let source = if data.meta.pkg_fmt == PkgFmt::Bin { + let source = if data.meta.pkg_fmt == Some(PkgFmt::Bin) { data.bin_path.clone() } else { data.bin_path.join(&source_file_path) diff --git a/crates/lib/src/fetchers.rs b/crates/lib/src/fetchers.rs index a61742aa..a6565bc3 100644 --- a/crates/lib/src/fetchers.rs +++ b/crates/lib/src/fetchers.rs @@ -18,7 +18,7 @@ mod quickinstall; #[async_trait::async_trait] pub trait Fetcher: Send + Sync { /// Create a new fetcher from some data - async fn new(client: &Client, data: &Data) -> Arc + async fn new(client: &Client, data: &Arc) -> Arc where Self: Sized; @@ -38,6 +38,9 @@ pub trait Fetcher: Send + Sync { /// Return the package format fn pkg_fmt(&self) -> PkgFmt; + /// Return finalized target meta. + fn target_meta(&self) -> PkgMeta; + /// A short human-readable name or descriptor for the package source fn source_name(&self) -> CompactString; diff --git a/crates/lib/src/fetchers/gh_crate_meta.rs b/crates/lib/src/fetchers/gh_crate_meta.rs index bac96a20..897327df 100644 --- a/crates/lib/src/fetchers/gh_crate_meta.rs +++ b/crates/lib/src/fetchers/gh_crate_meta.rs @@ -5,66 +5,81 @@ use log::{debug, warn}; use once_cell::sync::OnceCell; use reqwest::{Client, Method}; use serde::Serialize; +use strum::IntoEnumIterator; use tinytemplate::TinyTemplate; use url::Url; use crate::{ errors::BinstallError, helpers::{download::download_and_extract, remote::remote_exists, tasks::AutoAbortJoinHandle}, - manifests::cargo_toml_binstall::PkgFmt, + manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; use super::Data; pub struct GhCrateMeta { client: Client, - data: Data, - url: OnceCell, + data: Arc, + resolution: OnceCell<(Url, PkgFmt)>, +} + +type BaselineFindTask = AutoAbortJoinHandle, BinstallError>>; + +impl GhCrateMeta { + fn launch_baseline_find_tasks( + &self, + pkg_fmt: PkgFmt, + ) -> impl Iterator + '_ { + // build up list of potential URLs + let urls = pkg_fmt.extensions().iter().filter_map(|ext| { + let ctx = Context::from_data(&self.data, ext); + match ctx.render_url(&self.data.meta.pkg_url) { + Ok(url) => Some(url), + Err(err) => { + warn!("Failed to render url for {ctx:#?}: {err:#?}"); + None + } + } + }); + + // go check all potential URLs at once + urls.map(move |url| { + let client = self.client.clone(); + + AutoAbortJoinHandle::spawn(async move { + debug!("Checking for package at: '{url}'"); + + remote_exists(client, url.clone(), Method::HEAD) + .await + .map(|exists| exists.then_some((url, pkg_fmt))) + }) + }) + } } #[async_trait::async_trait] impl super::Fetcher for GhCrateMeta { - async fn new(client: &Client, data: &Data) -> Arc { + async fn new(client: &Client, data: &Arc) -> Arc { Arc::new(Self { client: client.clone(), data: data.clone(), - url: OnceCell::new(), + resolution: OnceCell::new(), }) } async fn find(&self) -> Result { - // build up list of potential URLs - let urls = self.data.meta.pkg_fmt.extensions().iter().map(|ext| { - let ctx = Context::from_data(&self.data, ext); - ctx.render_url(&self.data.meta.pkg_url) - }); + let handles: Vec<_> = if let Some(pkg_fmt) = self.data.meta.pkg_fmt { + self.launch_baseline_find_tasks(pkg_fmt).collect() + } else { + PkgFmt::iter() + .flat_map(|pkg_fmt| self.launch_baseline_find_tasks(pkg_fmt)) + .collect() + }; - // go check all potential URLs at once - let checks = urls - .map(|url| { - let client = self.client.clone(); - AutoAbortJoinHandle::spawn(async move { - let url = url?; - debug!("Checking for package at: '{url}'"); - remote_exists(client, url.clone(), Method::HEAD) - .await - .map(|exists| (url.clone(), exists)) - }) - }) - .collect::>(); - - // get the first URL that exists - for check in checks { - let (url, exists) = check.await??; - if exists { - if url.scheme() != "https" { - warn!( - "URL is not HTTPS! This may become a hard error in the future, tell the upstream!" - ); - } - - debug!("Winning URL is {url}"); - self.url.set(url).unwrap(); // find() is called first + for handle in handles { + if let Some((url, pkg_fmt)) = handle.await?? { + debug!("Winning URL is {url}, with pkg_fmt {pkg_fmt}"); + self.resolution.set((url, pkg_fmt)).unwrap(); // find() is called first return Ok(true); } } @@ -73,19 +88,25 @@ impl super::Fetcher for GhCrateMeta { } async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { - let url = self.url.get().unwrap(); // find() is called first + let (url, pkg_fmt) = self.resolution.get().unwrap(); // find() is called first debug!("Downloading package from: '{url}'"); - download_and_extract(&self.client, url, self.pkg_fmt(), dst).await + download_and_extract(&self.client, url, *pkg_fmt, dst).await } fn pkg_fmt(&self) -> PkgFmt { - self.data.meta.pkg_fmt + self.resolution.get().unwrap().1 + } + + fn target_meta(&self) -> PkgMeta { + let mut meta = self.data.meta.clone(); + meta.pkg_fmt = Some(self.pkg_fmt()); + meta } fn source_name(&self) -> CompactString { - self.url + self.resolution .get() - .map(|url| { + .map(|(url, _pkg_fmt)| { if let Some(domain) = url.domain() { domain.to_compact_string() } else if let Some(host) = url.host_str() { @@ -130,7 +151,7 @@ impl<'c> Context<'c> { pub(self) fn from_data(data: &'c Data, archive_format: &'c str) -> Self { Self { name: &data.name, - repo: data.repo.as_ref().map(|s| &s[..]), + repo: data.repo.as_deref(), target: &data.target, version: &data.version, format: archive_format, @@ -271,7 +292,7 @@ mod test { pkg_url: "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }.tar.xz" .into(), - pkg_fmt: PkgFmt::Txz, + pkg_fmt: Some(PkgFmt::Txz), ..Default::default() }; @@ -294,7 +315,7 @@ mod test { fn no_archive() { let meta = PkgMeta { pkg_url: "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }{ binary-ext }".into(), - pkg_fmt: PkgFmt::Bin, + pkg_fmt: Some(PkgFmt::Bin), ..Default::default() }; diff --git a/crates/lib/src/fetchers/quickinstall.rs b/crates/lib/src/fetchers/quickinstall.rs index 015e6273..b0e8460c 100644 --- a/crates/lib/src/fetchers/quickinstall.rs +++ b/crates/lib/src/fetchers/quickinstall.rs @@ -10,7 +10,7 @@ use url::Url; use crate::{ errors::BinstallError, helpers::{download::download_and_extract, remote::remote_exists}, - manifests::cargo_toml_binstall::PkgFmt, + manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; use super::Data; @@ -22,11 +22,12 @@ pub struct QuickInstall { client: Client, package: String, target: String, + data: Arc, } #[async_trait::async_trait] impl super::Fetcher for QuickInstall { - async fn new(client: &Client, data: &Data) -> Arc { + async fn new(client: &Client, data: &Arc) -> Arc { let crate_name = &data.name; let version = &data.version; let target = data.target.clone(); @@ -34,6 +35,7 @@ impl super::Fetcher for QuickInstall { client: client.clone(), package: format!("{crate_name}-{version}-{target}"), target, + data: data.clone(), }) } @@ -54,6 +56,12 @@ impl super::Fetcher for QuickInstall { PkgFmt::Tgz } + fn target_meta(&self) -> PkgMeta { + let mut meta = self.data.meta.clone(); + meta.pkg_fmt = Some(self.pkg_fmt()); + meta + } + fn source_name(&self) -> CompactString { CompactString::from("QuickInstall") } diff --git a/crates/lib/src/manifests/cargo_toml_binstall.rs b/crates/lib/src/manifests/cargo_toml_binstall.rs index 72312ba2..8f2748f3 100644 --- a/crates/lib/src/manifests/cargo_toml_binstall.rs +++ b/crates/lib/src/manifests/cargo_toml_binstall.rs @@ -37,7 +37,7 @@ pub struct PkgMeta { pub pkg_url: String, /// Format for package downloads - pub pkg_fmt: PkgFmt, + pub pkg_fmt: Option, /// Path template for binary files in packages pub bin_dir: String, @@ -53,7 +53,7 @@ impl Default for PkgMeta { fn default() -> Self { Self { pkg_url: DEFAULT_PKG_URL.to_string(), - pkg_fmt: PkgFmt::default(), + pkg_fmt: None, bin_dir: DEFAULT_BIN_DIR.to_string(), pub_key: None, overrides: HashMap::new(), @@ -62,13 +62,23 @@ impl Default for PkgMeta { } impl PkgMeta { + pub fn clone_without_overrides(&self) -> Self { + Self { + pkg_url: self.pkg_url.clone(), + pkg_fmt: self.pkg_fmt, + bin_dir: self.bin_dir.clone(), + pub_key: self.pub_key.clone(), + overrides: HashMap::new(), + } + } + /// Merge configuration overrides into object pub fn merge(&mut self, pkg_override: &PkgOverride) { if let Some(o) = &pkg_override.pkg_url { self.pkg_url = o.clone(); } if let Some(o) = &pkg_override.pkg_fmt { - self.pkg_fmt = *o; + self.pkg_fmt = Some(*o); } if let Some(o) = &pkg_override.bin_dir { self.bin_dir = o.clone(); diff --git a/crates/lib/src/manifests/cargo_toml_binstall/package_formats.rs b/crates/lib/src/manifests/cargo_toml_binstall/package_formats.rs index f7caf2c4..30b16704 100644 --- a/crates/lib/src/manifests/cargo_toml_binstall/package_formats.rs +++ b/crates/lib/src/manifests/cargo_toml_binstall/package_formats.rs @@ -1,8 +1,10 @@ use serde::{Deserialize, Serialize}; -use strum_macros::{Display, EnumString}; +use strum_macros::{Display, EnumIter, EnumString}; /// Binary format enumeration -#[derive(Debug, Copy, Clone, Eq, PartialEq, Serialize, Deserialize, EnumString)] +#[derive( + Debug, Display, Copy, Clone, Eq, PartialEq, Serialize, Deserialize, EnumString, EnumIter, +)] #[serde(rename_all = "snake_case")] pub enum PkgFmt { /// Download format is TAR (uncompressed) diff --git a/crates/lib/src/ops/resolve.rs b/crates/lib/src/ops/resolve.rs index 0dbb1e0b..381a4aaf 100644 --- a/crates/lib/src/ops/resolve.rs +++ b/crates/lib/src/ops/resolve.rs @@ -160,7 +160,7 @@ async fn resolve_inner( } } - let (mut meta, binaries) = ( + let (meta, binaries) = ( package .metadata .as_ref() @@ -175,23 +175,23 @@ async fn resolve_inner( for target in desired_targets { debug!("Building metadata for target: {target}"); - let mut target_meta = meta.clone(); + let mut target_meta = meta.clone_without_overrides(); // Merge any overrides - if let Some(o) = target_meta.overrides.get(target).cloned() { - target_meta.merge(&o); + if let Some(o) = meta.overrides.get(target) { + target_meta.merge(o); } target_meta.merge(&opts.cli_overrides); debug!("Found metadata: {target_meta:?}"); - let fetcher_data = Data { + let fetcher_data = Arc::new(Data { name: package.name.clone(), target: target.clone(), version: package.version.clone(), repo: package.repository.clone(), meta: target_meta, - }; + }); fetchers.add(GhCrateMeta::new(&client, &fetcher_data).await); fetchers.add(QuickInstall::new(&client, &fetcher_data).await); @@ -200,11 +200,7 @@ async fn resolve_inner( let resolution = match fetchers.first_available().await { Some(fetcher) => { // Build final metadata - let fetcher_target = fetcher.target(); - if let Some(o) = meta.overrides.get(&fetcher_target.to_owned()).cloned() { - meta.merge(&o); - } - meta.merge(&opts.cli_overrides); + let meta = fetcher.target_meta(); // Generate temporary binary path let bin_path = temp_dir.join(format!("bin-{}", crate_name.name)); From 846e7ead91bc518a6d6a5d5c84baa86368dd4205 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 24 Aug 2022 17:16:26 +1000 Subject: [PATCH 0698/2020] Support other git hosting services (#312) * Impl new mod `hosting` for detecting git hosting services * Refactor: Make `guess_git_hosting_services` associated fn of `GitHostingService` * Set default value of `PkgMeta::pkg_url` to `None` * Impl new method `get_redirected_final_url` * Use `get_redirected_final_url` in `GhCrateMeta::find` to make `guess_git_hosting_services` more accurate. * Use redirected `repo` in `GhCrateMeta::launch_baseline_find_tasks` * Refactor `::find` * Mod `get_default_pkg_url_template` to ret `&[&str]` * Add more default `pkg-url` templates * Rm `pkg-url` in `bin/Cargo.toml` Signed-off-by: Jiahao XU --- SUPPORT.md | 96 ++++++++++++-- crates/bin/Cargo.toml | 1 - crates/lib/src/fetchers/gh_crate_meta.rs | 117 ++++++++++++++---- .../lib/src/fetchers/gh_crate_meta/hosting.rs | 56 +++++++++ crates/lib/src/helpers/remote.rs | 13 ++ .../lib/src/manifests/cargo_toml_binstall.rs | 10 +- crates/lib/tests/parse-meta.rs | 2 +- 7 files changed, 251 insertions(+), 44 deletions(-) create mode 100644 crates/lib/src/fetchers/gh_crate_meta/hosting.rs diff --git a/SUPPORT.md b/SUPPORT.md index 7c2c871e..5b77791d 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -4,7 +4,10 @@ `binstall` works with existing CI-built binary outputs, with configuration via `[package.metadata.binstall]` keys in the relevant crate manifest. When configuring `binstall` you can test against a local manifest with `--manifest-path=PATH` argument to use the crate and manifest at the provided `PATH`, skipping crate discovery and download. -To get started, add a `[package.metadata.binstall]` section to your `Cargo.toml`. As an example, the default configuration would be: +To get started, check the [default](#Defaults) first, only add a `[package.metadata.binstall]` section +to your `Cargo.toml` if the default does not work for you. + +As an example, the configuration would be like this: ```toml [package.metadata.binstall] @@ -40,18 +43,93 @@ pkg-fmt = "zip" ### Defaults -By default `binstall` is setup to work with github releases, and expects to find: +By default, `binstall` will try all supported package format and would have `bin-dir` set to +`"{ name }-{ target }-v{ version }/{ bin }{ binary-ext }"` (where `bin` is the cargo binary name and +`binary-ext` is `.exe` on windows and empty on other platforms). -- an archive named `{ name }-{ target }-v{ version }.{ archive-format }` - - so that this does not overwrite different targets or versions when manually downloaded -- located at `{ repo }/releases/download/v{ version }/` - - compatible with github tags / releases -- containing a folder named `{ name }-{ target }-v{ version }` - - so that prior binary files are not overwritten when manually executing `tar -xvf ...` -- containing binary files in the form `{ bin }{ binary-ext }` (where `bin` is the cargo binary name and `binary-ext` is `.exe` on windows and empty on other platforms) +All binaries must contain a folder named `{ name }-{ target }-v{ version }` (so that prior binary +files are not overwritten when manually executing `tar -xvf ...`). + +The default value for `pkg-url` will depend on the repository of the package. + +It is setup to work with github releases, gitlab releases, bitbucket downloads +and source forge downloads. + +#### Github + +For github, the `pkg-url` is set to + +```rust +[ + "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }", + "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }.{ archive-format }", + "{ repo }/releases/download/v{ version }/{ name }-{ version }-{ target }.{ archive-format }", + "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }", +] +``` + +The first 3 versions does not overwrite different targets or versions when manually downloaded. + +All `pkg-url` templates download binaries located at `{ repo }/releases/download/v{ version }/`, which +is compatible with github tags / releases. If your package already uses this approach, you shouldn't need to set anything. +#### GitLab + +For gitlab, the `pkg-url` is set to + +```rust +[ + "{ repo }/-/releases/v{ version }/downloads/binaries/{ name }-{ target }-v{ version }.{ archive-format }", + "{ repo }/-/releases/v{ version }/downloads/binaries/{ name }-v{ version }-{ target }.{ archive-format }", + "{ repo }/-/releases/v{ version }/downloads/binaries/{ name }-{ version }-{ target }.{ archive-format }", + "{ repo }/-/releases/v{ version }/downloads/binaries/{ name }-{ target }.{ archive-format }", +] +``` + +This will attempt to find the release assets with `filepath` set to +`binaries/{ name }-{ target }.{ archive-format }` + +Note that this uses the [Permanent links to release assets](https://gitlab.kitware.com/help/user/project/releases/index#permanent-links-to-latest-release-assets) feature of gitlab, it requires you to +create an asset as a link with a `filepath`, which can be set only using gitlab api as of the writing. + +#### BitBucket + +For bitbucket, the `pkg-url` is set to + +```rust +[ + "{ repo }/downloads/{ name }-{ target }-v{ version }.{ archive-format }", + "{ repo }/downloads/{ name }-v{ version }-{ target }.{ archive-format }", + "{ repo }/downloads/{ name }-{ version }-{ target }.{ archive-format }", +] +``` + +To setup the package for binstall, upload the binary into bitbucket downloads page of your project, +with its name set to be `{ name }-{ target }-v{ version }.{ archive-format }`. + +#### SourceForge + +For source forge, the `pkg-url` is set to + +```rust +[ + "{ repo }/files/binaries/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }/download", + "{ repo }/files/binaries/v{ version }/{ name }-v{ version }-{ target }.{ archive-format }/download", + "{ repo }/files/binaries/v{ version }/{ name }-{ version }-{ target }.{ archive-format }/download", + "{ repo }/files/binaries/v{ version }/{ name }-{ target }.{ archive-format }/download", +] +``` + +To setup the package for binstall, upload the binary to the file page of your project, +under the directory `binaries/v{ version }` with the filename `{ name }-{ target }.{ archive-format }`. + +#### Others + +For all other situations, `binstall` does not provide a default `pkg-url` and you need to manually +specify it. + ### QuickInstall [QuickInstall](https://github.com/alsuren/cargo-quickinstall) is an unofficial repository of prebuilt binaries for Crates, and `binstall` has built-in support for it! If your crate is built by QuickInstall, it will already work with `binstall`. However, binaries as configured above take precedence when they exist. diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index d6f416ca..836d4ba3 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -10,7 +10,6 @@ edition = "2021" license = "GPL-3.0" [package.metadata.binstall] -pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }" bin-dir = "{ bin }{ binary-ext }" [package.metadata.binstall.overrides.x86_64-pc-windows-msvc] diff --git a/crates/lib/src/fetchers/gh_crate_meta.rs b/crates/lib/src/fetchers/gh_crate_meta.rs index 897327df..267af11b 100644 --- a/crates/lib/src/fetchers/gh_crate_meta.rs +++ b/crates/lib/src/fetchers/gh_crate_meta.rs @@ -1,4 +1,4 @@ -use std::{path::Path, sync::Arc}; +use std::{borrow::Cow, path::Path, sync::Arc}; use compact_str::{CompactString, ToCompactString}; use log::{debug, warn}; @@ -11,12 +11,19 @@ use url::Url; use crate::{ errors::BinstallError, - helpers::{download::download_and_extract, remote::remote_exists, tasks::AutoAbortJoinHandle}, + helpers::{ + download::download_and_extract, + remote::{get_redirected_final_url, remote_exists}, + tasks::AutoAbortJoinHandle, + }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; use super::Data; +mod hosting; +use hosting::GitHostingServices; + pub struct GhCrateMeta { client: Client, data: Arc, @@ -26,14 +33,16 @@ pub struct GhCrateMeta { type BaselineFindTask = AutoAbortJoinHandle, BinstallError>>; impl GhCrateMeta { - fn launch_baseline_find_tasks( - &self, + fn launch_baseline_find_tasks<'a>( + &'a self, pkg_fmt: PkgFmt, - ) -> impl Iterator + '_ { + pkg_url: &'a str, + repo: Option<&'a str>, + ) -> impl Iterator + 'a { // build up list of potential URLs - let urls = pkg_fmt.extensions().iter().filter_map(|ext| { - let ctx = Context::from_data(&self.data, ext); - match ctx.render_url(&self.data.meta.pkg_url) { + let urls = pkg_fmt.extensions().iter().filter_map(move |ext| { + let ctx = Context::from_data_with_repo(&self.data, ext, repo); + match ctx.render_url(pkg_url) { Ok(url) => Some(url), Err(err) => { warn!("Failed to render url for {ctx:#?}: {err:#?}"); @@ -68,11 +77,54 @@ impl super::Fetcher for GhCrateMeta { } async fn find(&self) -> Result { + let repo = if let Some(repo) = self.data.repo.as_deref() { + Some(get_redirected_final_url(&self.client, Url::parse(repo)?).await?) + } else { + None + }; + + let pkg_urls = if let Some(pkg_url) = self.data.meta.pkg_url.as_deref() { + Cow::Owned(vec![pkg_url]) + } else if let Some(repo) = repo.as_ref() { + if let Some(pkg_urls) = + GitHostingServices::guess_git_hosting_services(repo)?.get_default_pkg_url_template() + { + Cow::Borrowed(pkg_urls) + } else { + warn!( + concat!( + "Unknown repository {}, cargo-binstall cannot provide default pkg_url for it.\n", + "Please ask the upstream to provide it for target {}." + ), + repo, self.data.target + ); + + return Ok(false); + } + } else { + warn!( + concat!( + "Package does not specify repository, cargo-binstall cannot provide default pkg_url for it.\n", + "Please ask the upstream to provide it for target {}." + ), + self.data.target + ); + + return Ok(false); + }; + + let repo = repo.as_ref().map(Url::as_str); + let launch_baseline_find_tasks = |pkg_fmt| { + pkg_urls + .iter() + .flat_map(move |pkg_url| self.launch_baseline_find_tasks(pkg_fmt, pkg_url, repo)) + }; + let handles: Vec<_> = if let Some(pkg_fmt) = self.data.meta.pkg_fmt { - self.launch_baseline_find_tasks(pkg_fmt).collect() + launch_baseline_find_tasks(pkg_fmt).collect() } else { PkgFmt::iter() - .flat_map(|pkg_fmt| self.launch_baseline_find_tasks(pkg_fmt)) + .flat_map(launch_baseline_find_tasks) .collect() }; @@ -148,10 +200,14 @@ struct Context<'c> { } impl<'c> Context<'c> { - pub(self) fn from_data(data: &'c Data, archive_format: &'c str) -> Self { + pub(self) fn from_data_with_repo( + data: &'c Data, + archive_format: &'c str, + repo: Option<&'c str>, + ) -> Self { Self { name: &data.name, - repo: data.repo.as_deref(), + repo, target: &data.target, version: &data.version, format: archive_format, @@ -164,6 +220,11 @@ impl<'c> Context<'c> { } } + #[cfg(test)] + pub(self) fn from_data(data: &'c Data, archive_format: &'c str) -> Self { + Self::from_data_with_repo(data, archive_format, data.repo.as_deref()) + } + pub(self) fn render_url(&self, template: &str) -> Result { debug!("Render {template:?} using context: {:?}", self); @@ -180,6 +241,8 @@ mod test { use super::{super::Data, Context}; use url::Url; + const DEFAULT_PKG_URL: &str = "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }"; + fn url(s: &str) -> Url { Url::parse(s).unwrap() } @@ -197,7 +260,7 @@ mod test { let ctx = Context::from_data(&data, "tgz"); assert_eq!( - ctx.render_url(&data.meta.pkg_url).unwrap(), + ctx.render_url(DEFAULT_PKG_URL).unwrap(), url("https://github.com/ryankurte/cargo-binstall/releases/download/v1.2.3/cargo-binstall-x86_64-unknown-linux-gnu-v1.2.3.tgz") ); } @@ -215,13 +278,14 @@ mod test { }; let ctx = Context::from_data(&data, "tgz"); - ctx.render_url(&data.meta.pkg_url).unwrap(); + ctx.render_url(data.meta.pkg_url.as_deref().unwrap()) + .unwrap(); } #[test] fn no_repo_but_full_url() { let meta = PkgMeta { - pkg_url: format!("https://example.com{}", PkgMeta::default().pkg_url), + pkg_url: Some(format!("https://example.com{DEFAULT_PKG_URL}")), ..Default::default() }; @@ -235,7 +299,7 @@ mod test { let ctx = Context::from_data(&data, "tgz"); assert_eq!( - ctx.render_url(&data.meta.pkg_url).unwrap(), + ctx.render_url(data.meta.pkg_url.as_deref().unwrap()).unwrap(), url("https://example.com/releases/download/v1.2.3/cargo-binstall-x86_64-unknown-linux-gnu-v1.2.3.tgz") ); } @@ -243,9 +307,9 @@ mod test { #[test] fn different_url() { let meta = PkgMeta { - pkg_url: + pkg_url: Some( "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ archive-format }" - .into(), + .to_string()), ..Default::default() }; @@ -259,7 +323,7 @@ mod test { let ctx = Context::from_data(&data, "tgz"); assert_eq!( - ctx.render_url(&data.meta.pkg_url).unwrap(), + ctx.render_url(data.meta.pkg_url.as_deref().unwrap()).unwrap(), url("https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz") ); } @@ -267,7 +331,7 @@ mod test { #[test] fn deprecated_format() { let meta = PkgMeta { - pkg_url: "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ format }".into(), + pkg_url: Some("{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ format }".to_string()), ..Default::default() }; @@ -281,7 +345,7 @@ mod test { let ctx = Context::from_data(&data, "tgz"); assert_eq!( - ctx.render_url(&data.meta.pkg_url).unwrap(), + ctx.render_url(data.meta.pkg_url.as_deref().unwrap()).unwrap(), url("https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz") ); } @@ -289,9 +353,10 @@ mod test { #[test] fn different_ext() { let meta = PkgMeta { - pkg_url: + pkg_url: Some( "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }.tar.xz" - .into(), + .to_string(), + ), pkg_fmt: Some(PkgFmt::Txz), ..Default::default() }; @@ -306,7 +371,7 @@ mod test { let ctx = Context::from_data(&data, "txz"); assert_eq!( - ctx.render_url(&data.meta.pkg_url).unwrap(), + ctx.render_url(data.meta.pkg_url.as_deref().unwrap()).unwrap(), url("https://github.com/watchexec/cargo-watch/releases/download/v9.0.0/cargo-watch-v9.0.0-aarch64-apple-darwin.tar.xz") ); } @@ -314,7 +379,7 @@ mod test { #[test] fn no_archive() { let meta = PkgMeta { - pkg_url: "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }{ binary-ext }".into(), + pkg_url: Some("{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }{ binary-ext }".to_string()), pkg_fmt: Some(PkgFmt::Bin), ..Default::default() }; @@ -329,7 +394,7 @@ mod test { let ctx = Context::from_data(&data, "bin"); assert_eq!( - ctx.render_url(&data.meta.pkg_url).unwrap(), + ctx.render_url(data.meta.pkg_url.as_deref().unwrap()).unwrap(), url("https://github.com/watchexec/cargo-watch/releases/download/v9.0.0/cargo-watch-v9.0.0-aarch64-pc-windows-msvc.exe") ); } diff --git a/crates/lib/src/fetchers/gh_crate_meta/hosting.rs b/crates/lib/src/fetchers/gh_crate_meta/hosting.rs new file mode 100644 index 00000000..265fab79 --- /dev/null +++ b/crates/lib/src/fetchers/gh_crate_meta/hosting.rs @@ -0,0 +1,56 @@ +use url::Url; + +use crate::errors::BinstallError; + +#[derive(Copy, Clone, Debug)] +pub enum GitHostingServices { + GitHub, + GitLab, + BitBucket, + SourceForge, + Unknown, +} +impl GitHostingServices { + pub fn guess_git_hosting_services(repo: &Url) -> Result { + use GitHostingServices::*; + + match repo.domain() { + Some(domain) if domain.starts_with("github") => Ok(GitHub), + Some(domain) if domain.starts_with("gitlab") => Ok(GitLab), + Some(domain) if domain == "bitbucket.org" => Ok(BitBucket), + Some(domain) if domain == "sourceforge.net" => Ok(SourceForge), + _ => Ok(Unknown), + } + } + + pub fn get_default_pkg_url_template(self) -> Option<&'static [&'static str]> { + use GitHostingServices::*; + + match self { + GitHub => Some(&[ + "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }", + "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }.{ archive-format }", + "{ repo }/releases/download/v{ version }/{ name }-{ version }-{ target }.{ archive-format }", + "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }", + ]), + GitLab => Some(&[ + "{ repo }/-/releases/v{ version }/downloads/binaries/{ name }-{ target }-v{ version }.{ archive-format }", + "{ repo }/-/releases/v{ version }/downloads/binaries/{ name }-v{ version }-{ target }.{ archive-format }", + "{ repo }/-/releases/v{ version }/downloads/binaries/{ name }-{ version }-{ target }.{ archive-format }", + "{ repo }/-/releases/v{ version }/downloads/binaries/{ name }-{ target }.{ archive-format }", + ]), + BitBucket => Some(&[ + "{ repo }/downloads/{ name }-{ target }-v{ version }.{ archive-format }", + "{ repo }/downloads/{ name }-v{ version }-{ target }.{ archive-format }", + "{ repo }/downloads/{ name }-{ version }-{ target }.{ archive-format }", + ]), + SourceForge => Some(&[ + "{ repo }/files/binaries/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }/download", + "{ repo }/files/binaries/v{ version }/{ name }-v{ version }-{ target }.{ archive-format }/download", + "{ repo }/files/binaries/v{ version }/{ name }-{ version }-{ target }.{ archive-format }/download", + "{ repo }/files/binaries/v{ version }/{ name }-{ target }.{ archive-format }/download", + ]), + Unknown => None, + } + } +} diff --git a/crates/lib/src/helpers/remote.rs b/crates/lib/src/helpers/remote.rs index 042ae7ce..e609015c 100644 --- a/crates/lib/src/helpers/remote.rs +++ b/crates/lib/src/helpers/remote.rs @@ -42,6 +42,19 @@ pub async fn remote_exists( Ok(req.status().is_success()) } +pub async fn get_redirected_final_url(client: &Client, url: Url) -> Result { + let method = Method::HEAD; + + let req = client + .request(method.clone(), url.clone()) + .send() + .await + .and_then(Response::error_for_status) + .map_err(|err| BinstallError::Http { method, url, err })?; + + Ok(req.url().clone()) +} + pub(crate) async fn create_request( client: &Client, url: Url, diff --git a/crates/lib/src/manifests/cargo_toml_binstall.rs b/crates/lib/src/manifests/cargo_toml_binstall.rs index 8f2748f3..5f04cf5d 100644 --- a/crates/lib/src/manifests/cargo_toml_binstall.rs +++ b/crates/lib/src/manifests/cargo_toml_binstall.rs @@ -11,10 +11,6 @@ pub use package_formats::*; mod package_formats; -/// Default package path template (may be overridden in package Cargo.toml) -pub const DEFAULT_PKG_URL: &str = - "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }"; - /// Default binary name template (may be overridden in package Cargo.toml) pub const DEFAULT_BIN_DIR: &str = "{ name }-{ target }-v{ version }/{ bin }{ binary-ext }"; @@ -34,7 +30,7 @@ pub struct Meta { #[serde(rename_all = "kebab-case", default)] pub struct PkgMeta { /// URL template for package downloads - pub pkg_url: String, + pub pkg_url: Option, /// Format for package downloads pub pkg_fmt: Option, @@ -52,7 +48,7 @@ pub struct PkgMeta { impl Default for PkgMeta { fn default() -> Self { Self { - pkg_url: DEFAULT_PKG_URL.to_string(), + pkg_url: None, pkg_fmt: None, bin_dir: DEFAULT_BIN_DIR.to_string(), pub_key: None, @@ -75,7 +71,7 @@ impl PkgMeta { /// Merge configuration overrides into object pub fn merge(&mut self, pkg_override: &PkgOverride) { if let Some(o) = &pkg_override.pkg_url { - self.pkg_url = o.clone(); + self.pkg_url = Some(o.clone()); } if let Some(o) = &pkg_override.pkg_fmt { self.pkg_fmt = Some(*o); diff --git a/crates/lib/tests/parse-meta.rs b/crates/lib/tests/parse-meta.rs index 7433974b..4517943c 100644 --- a/crates/lib/tests/parse-meta.rs +++ b/crates/lib/tests/parse-meta.rs @@ -15,7 +15,7 @@ fn parse_meta() { assert_eq!(&package.name, "cargo-binstall-test"); assert_eq!( - &meta.pkg_url, + meta.pkg_url.as_deref().unwrap(), "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }" ); From 4def4d08fd098a1771a9ffee4a2f41909e0cf664 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 25 Aug 2022 10:01:22 +1000 Subject: [PATCH 0699/2020] Add new feature `trust-dns` to lib & bin (#318) * Add new feature `trust-dns` to lib & bin * Enable `trust-dns` feature by default Because the `getaddrinfo` is a poorly designed API. * USe default feature set on windows CI because wintls on the CI does not support TLS 1.3 and trust-dns only support dns over https if rustls is used. Signed-off-by: Jiahao XU --- .github/workflows/build.yml | 1 - Cargo.lock | 245 +++++++++++++++++++++++++++++++++++- crates/bin/Cargo.toml | 4 +- crates/lib/Cargo.toml | 16 ++- 4 files changed, 259 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f16f5dbb..940f2819 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,6 @@ jobs: - target: x86_64-pc-windows-msvc os: windows-latest debug_features: [ native-tls ] - release_features: [ static, zlib-ng, native-tls, fancy-no-backtrace ] - target: x86_64-unknown-linux-musl os: ubuntu-latest - target: armv7-unknown-linux-musleabihf diff --git a/Cargo.lock b/Cargo.lock index 92628c65..b766bdde 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -112,6 +112,7 @@ dependencies = [ "tinytemplate", "tokio", "toml_edit", + "trust-dns-resolver", "url", "xz2", "zip", @@ -350,6 +351,12 @@ dependencies = [ "once_cell", ] +[[package]] +name = "data-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" + [[package]] name = "detect-targets" version = "0.1.0" @@ -402,7 +409,7 @@ dependencies = [ "rustc_version", "toml", "vswhom", - "winreg", + "winreg 0.10.1", ] [[package]] @@ -414,6 +421,18 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enum-as-inner" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "env_logger" version = "0.9.0" @@ -696,6 +715,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "hostname" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +dependencies = [ + "libc", + "match_cfg", + "winapi", +] + [[package]] name = "http" version = "0.2.8" @@ -822,6 +852,18 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24c3f4eff5495aee4c0399d7b6a0dc2b6e81be84242ffbfcf253ebacccc1d0cb" +[[package]] +name = "ipconfig" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "723519edce41262b05d4143ceb95050e4c614f483e78e9fd9e39a8275a84ad98" +dependencies = [ + "socket2", + "widestring", + "winapi", + "winreg 0.7.0", +] + [[package]] name = "ipnet" version = "2.5.0" @@ -898,12 +940,28 @@ dependencies = [ "libc", ] +[[package]] +name = "linked-hash-map" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" + [[package]] name = "linux-raw-sys" version = "0.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" +[[package]] +name = "lock_api" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "log" version = "0.4.17" @@ -913,6 +971,15 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "lru-cache" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" +dependencies = [ + "linked-hash-map", +] + [[package]] name = "lzma-sys" version = "0.1.19" @@ -924,6 +991,12 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "match_cfg" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" + [[package]] name = "matches" version = "0.1.9" @@ -1135,6 +1208,29 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "decf7381921fea4dcb2549c5667eda59b3ec297ab7e2b5fc33eac69d2e7da87b" +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall", + "smallvec", + "windows-sys", +] + [[package]] name = "percent-encoding" version = "2.1.0" @@ -1159,6 +1255,12 @@ version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" +[[package]] +name = "ppv-lite86" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb9f9e6e233e5c4a35559a617bf40a4ec447db2e84c20b55a6f83167b7e57872" + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -1192,6 +1294,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "quick-error" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" + [[package]] name = "quote" version = "1.0.20" @@ -1201,6 +1309,36 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom", +] + [[package]] name = "redox_syscall" version = "0.2.15" @@ -1273,7 +1411,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls", - "rustls-pemfile", + "rustls-pemfile 1.0.0", "serde", "serde_json", "serde_urlencoded", @@ -1282,12 +1420,23 @@ dependencies = [ "tokio-rustls", "tokio-util", "tower-service", + "trust-dns-resolver", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", "webpki-roots", - "winreg", + "winreg 0.10.1", +] + +[[package]] +name = "resolv-conf" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" +dependencies = [ + "hostname", + "quick-error", ] [[package]] @@ -1346,6 +1495,15 @@ dependencies = [ "webpki", ] +[[package]] +name = "rustls-pemfile" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ee86d63972a7c661d1536fefe8c3c8407321c3df668891286de28abcd087360" +dependencies = [ + "base64", +] + [[package]] name = "rustls-pemfile" version = "1.0.0" @@ -1506,6 +1664,12 @@ dependencies = [ "autocfg", ] +[[package]] +name = "smallvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" + [[package]] name = "smawk" version = "0.3.1" @@ -1823,6 +1987,66 @@ dependencies = [ "once_cell", ] +[[package]] +name = "trust-dns-proto" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d" +dependencies = [ + "async-trait", + "bytes", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "h2", + "http", + "idna", + "ipnet", + "lazy_static", + "log", + "native-tls", + "rand", + "ring", + "rustls", + "rustls-pemfile 0.3.0", + "smallvec", + "thiserror", + "tinyvec", + "tokio", + "tokio-native-tls", + "tokio-rustls", + "url", + "webpki", + "webpki-roots", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.21.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558" +dependencies = [ + "cfg-if", + "futures-util", + "ipconfig", + "lazy_static", + "log", + "lru-cache", + "parking_lot", + "resolv-conf", + "rustls", + "smallvec", + "thiserror", + "tokio", + "tokio-native-tls", + "tokio-rustls", + "trust-dns-proto", + "webpki-roots", +] + [[package]] name = "try-lock" version = "0.2.3" @@ -2027,6 +2251,12 @@ dependencies = [ "webpki", ] +[[package]] +name = "widestring" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" + [[package]] name = "winapi" version = "0.3.9" @@ -2101,6 +2331,15 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" +[[package]] +name = "winreg" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" +dependencies = [ + "winapi", +] + [[package]] name = "winreg" version = "0.10.1" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 836d4ba3..b2f65fc7 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -35,7 +35,7 @@ tokio = { version = "1.20.1", features = ["rt-multi-thread"], default-features = embed-resource = "1.7.3" [features] -default = ["static", "zlib-ng", "rustls", "fancy-no-backtrace"] +default = ["static", "zlib-ng", "rustls", "trust-dns", "fancy-no-backtrace"] mimalloc = ["dep:mimalloc"] @@ -47,6 +47,8 @@ zlib-ng = ["binstall/zlib-ng"] rustls = ["binstall/rustls"] native-tls = ["binstall/native-tls"] +trust-dns = ["binstall/trust-dns"] + fancy-no-backtrace = ["miette/fancy-no-backtrace"] fancy-with-backtrace = ["fancy-no-backtrace", "miette/fancy"] diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index c856f937..d1067729 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -42,6 +42,7 @@ thiserror = "1.0.32" tinytemplate = "1.2.1" tokio = { version = "1.20.1", features = ["macros", "rt", "process", "sync", "signal"], default-features = false } toml_edit = { version = "0.14.4", features = ["easy"] } +trust-dns-resolver = { version = "0.21.2", optional = true, default-features = false, features = ["dnssec-ring"] } url = { version = "2.2.2", features = ["serde"] } xz2 = "0.1.7" @@ -69,5 +70,16 @@ pkg-config = ["zstd/pkg-config"] zlib-ng = ["flate2/zlib-ng"] -rustls = ["crates_io_api/rustls", "reqwest/rustls-tls"] -native-tls = ["reqwest/native-tls"] +rustls = [ + "crates_io_api/rustls", + "reqwest/rustls-tls", + + # Enable the following features only if trust-dns-resolver is enabled. + "trust-dns-resolver?/dns-over-rustls", + # trust-dns-resolver currently supports https with rustls + "trust-dns-resolver?/dns-over-https-rustls", +] +native-tls = ["reqwest/native-tls", "trust-dns-resolver?/dns-over-native-tls"] + +# Enable trust-dns-resolver so that features on it will also be enabled. +trust-dns = ["trust-dns-resolver", "reqwest/trust-dns"] From 16b16c482ccb3be9985eee596875e41d4b99b619 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 27 Aug 2022 19:56:43 +1000 Subject: [PATCH 0700/2020] Optimize `GhCrateMeta::find`: use `FuturesUnordered` (#321) * Optimize `GhCrateMeta::find` using `FuturesUnordered` * Optimize `MultiFetcher`: Impl `with_capacity` use it in `resolve_inner` to avoid over-reservation * Enable feature "std" of dep futures-util Signed-off-by: Jiahao XU --- crates/lib/Cargo.toml | 2 +- crates/lib/src/fetchers.rs | 5 ++++- crates/lib/src/fetchers/gh_crate_meta.rs | 7 ++++--- crates/lib/src/ops/resolve.rs | 4 ++-- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index d1067729..aaa2449a 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -20,7 +20,7 @@ crates_io_api = { version = "0.8.0", default-features = false } detect-targets = { version = "0.1.0", path = "../detect-targets" } flate2 = { version = "1.0.24", default-features = false } flock = { version = "0.1.0", path = "../flock" } -futures-util = { version = "0.3.23", default-features = false } +futures-util = { version = "0.3.23", default-features = false, features = ["std"] } home = "0.5.3" itertools = "0.10.3" jobserver = "0.1.24" diff --git a/crates/lib/src/fetchers.rs b/crates/lib/src/fetchers.rs index a6565bc3..bc7ab9fd 100644 --- a/crates/lib/src/fetchers.rs +++ b/crates/lib/src/fetchers.rs @@ -63,10 +63,13 @@ pub struct Data { type FetcherJoinHandle = AutoAbortJoinHandle>; -#[derive(Default)] pub struct MultiFetcher(Vec<(Arc, FetcherJoinHandle)>); impl MultiFetcher { + pub fn with_capacity(n: usize) -> Self { + Self(Vec::with_capacity(n)) + } + pub fn add(&mut self, fetcher: Arc) { self.0.push(( fetcher.clone(), diff --git a/crates/lib/src/fetchers/gh_crate_meta.rs b/crates/lib/src/fetchers/gh_crate_meta.rs index 267af11b..29c22f7b 100644 --- a/crates/lib/src/fetchers/gh_crate_meta.rs +++ b/crates/lib/src/fetchers/gh_crate_meta.rs @@ -1,6 +1,7 @@ use std::{borrow::Cow, path::Path, sync::Arc}; use compact_str::{CompactString, ToCompactString}; +use futures_util::stream::{FuturesUnordered, StreamExt}; use log::{debug, warn}; use once_cell::sync::OnceCell; use reqwest::{Client, Method}; @@ -120,7 +121,7 @@ impl super::Fetcher for GhCrateMeta { .flat_map(move |pkg_url| self.launch_baseline_find_tasks(pkg_fmt, pkg_url, repo)) }; - let handles: Vec<_> = if let Some(pkg_fmt) = self.data.meta.pkg_fmt { + let mut handles: FuturesUnordered<_> = if let Some(pkg_fmt) = self.data.meta.pkg_fmt { launch_baseline_find_tasks(pkg_fmt).collect() } else { PkgFmt::iter() @@ -128,8 +129,8 @@ impl super::Fetcher for GhCrateMeta { .collect() }; - for handle in handles { - if let Some((url, pkg_fmt)) = handle.await?? { + while let Some(res) = handles.next().await { + if let Some((url, pkg_fmt)) = res?? { debug!("Winning URL is {url}, with pkg_fmt {pkg_fmt}"); self.resolution.set((url, pkg_fmt)).unwrap(); // find() is called first return Ok(true); diff --git a/crates/lib/src/ops/resolve.rs b/crates/lib/src/ops/resolve.rs index 381a4aaf..bcbaae6b 100644 --- a/crates/lib/src/ops/resolve.rs +++ b/crates/lib/src/ops/resolve.rs @@ -169,10 +169,10 @@ async fn resolve_inner( manifest.bin, ); - let mut fetchers = MultiFetcher::default(); - let desired_targets = opts.desired_targets.get().await; + let mut fetchers = MultiFetcher::with_capacity(desired_targets.len() * 2); + for target in desired_targets { debug!("Building metadata for target: {target}"); let mut target_meta = meta.clone_without_overrides(); From 7f9ad613a813f1e989ef87aa116b93601ece66c5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 27 Aug 2022 20:18:25 +1000 Subject: [PATCH 0701/2020] Optimize `drivers::crates_io::Vfs`: Use `BTreeMap` (#325) instead of `HashMap`. Signed-off-by: Jiahao XU --- crates/lib/src/drivers/crates_io/vfs.rs | 10 +++------- crates/lib/src/drivers/crates_io/visitor.rs | 2 +- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/crates/lib/src/drivers/crates_io/vfs.rs b/crates/lib/src/drivers/crates_io/vfs.rs index 3cd53627..d0ae6a6b 100644 --- a/crates/lib/src/drivers/crates_io/vfs.rs +++ b/crates/lib/src/drivers/crates_io/vfs.rs @@ -1,5 +1,5 @@ use std::{ - collections::{hash_map::HashMap, hash_set::HashSet}, + collections::{hash_set::HashSet, BTreeMap}, io, path::Path, }; @@ -10,14 +10,10 @@ use normalize_path::NormalizePath; /// This type stores the filesystem structure for the crate tarball /// extracted in memory and can be passed to /// `cargo_toml::Manifest::complete_from_abstract_filesystem`. -#[derive(Debug)] -pub(super) struct Vfs(HashMap, HashSet>>); +#[derive(Debug, Default)] +pub(super) struct Vfs(BTreeMap, HashSet>>); impl Vfs { - pub(super) fn new() -> Self { - Self(HashMap::with_capacity(16)) - } - /// * `path` - must be canonical, must not be empty. pub(super) fn add_path(&mut self, mut path: &Path) { while let Some(parent) = path.parent() { diff --git a/crates/lib/src/drivers/crates_io/visitor.rs b/crates/lib/src/drivers/crates_io/visitor.rs index 5efc8012..01a71d39 100644 --- a/crates/lib/src/drivers/crates_io/visitor.rs +++ b/crates/lib/src/drivers/crates_io/visitor.rs @@ -29,7 +29,7 @@ impl ManifestVisitor { // Cargo.toml is quite large usually. cargo_toml_content: Vec::with_capacity(2000), manifest_dir_path, - vfs: Vfs::new(), + vfs: Vfs::default(), } } } From f973d32ff6726ca6d7d4103068dd08aab28fcf93 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 27 Aug 2022 20:35:11 +1000 Subject: [PATCH 0702/2020] Use `BTreeMap` in field `PkgMeta::overrides` (#324) instead of `HashMap`. Signed-off-by: Jiahao XU --- crates/lib/src/manifests/cargo_toml_binstall.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/lib/src/manifests/cargo_toml_binstall.rs b/crates/lib/src/manifests/cargo_toml_binstall.rs index 5f04cf5d..21950214 100644 --- a/crates/lib/src/manifests/cargo_toml_binstall.rs +++ b/crates/lib/src/manifests/cargo_toml_binstall.rs @@ -2,7 +2,7 @@ //! //! This manifest defines how a particular binary crate may be installed by Binstall. -use std::collections::HashMap; +use std::collections::BTreeMap; use serde::{Deserialize, Serialize}; @@ -42,7 +42,7 @@ pub struct PkgMeta { pub pub_key: Option, /// Target specific overrides - pub overrides: HashMap, + pub overrides: BTreeMap, } impl Default for PkgMeta { @@ -52,7 +52,7 @@ impl Default for PkgMeta { pkg_fmt: None, bin_dir: DEFAULT_BIN_DIR.to_string(), pub_key: None, - overrides: HashMap::new(), + overrides: BTreeMap::new(), } } } @@ -64,7 +64,7 @@ impl PkgMeta { pkg_fmt: self.pkg_fmt, bin_dir: self.bin_dir.clone(), pub_key: self.pub_key.clone(), - overrides: HashMap::new(), + overrides: BTreeMap::new(), } } From e39a02aa920fb774c62c2d7e2c8c1051827ebf36 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 27 Aug 2022 20:45:55 +1000 Subject: [PATCH 0703/2020] Test default `pkg-url` for GitLab and BitBucket (#322) * Test default `pkt-url` for GitLab and BitBucket * Fail if `cargo-build` is called when testing GitLab/BitBucket * Fix use of `remote_exists` in `GhCrateMeta::launch_baseline_find_tasks` If `Method::HEAD` fails, try `Method::GET` since some servers reject `Method::HEAD`, e.g. bbuseruploads.s3.amazonaws.com Signed-off-by: Jiahao XU --- .github/scripts/bitbucket-test-Cargo.toml | 15 +++++++++++++++ .github/scripts/fake-cargo/cargo | 4 ++++ .github/scripts/gitlab-test-Cargo.toml | 15 +++++++++++++++ .github/scripts/tests.sh | 19 +++++++++++++++++++ crates/lib/src/fetchers/gh_crate_meta.rs | 8 +++++--- 5 files changed, 58 insertions(+), 3 deletions(-) create mode 100644 .github/scripts/bitbucket-test-Cargo.toml create mode 100755 .github/scripts/fake-cargo/cargo create mode 100644 .github/scripts/gitlab-test-Cargo.toml diff --git a/.github/scripts/bitbucket-test-Cargo.toml b/.github/scripts/bitbucket-test-Cargo.toml new file mode 100644 index 00000000..dd0ff6bd --- /dev/null +++ b/.github/scripts/bitbucket-test-Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "cargo-binstall" +description = "Rust binary package installer for CI integration" +repository = "https://bitbucket.org/nobodyxusdcdc/hello-world" +version = "0.12.0" +rust-version = "1.61.0" +authors = ["ryan "] +edition = "2021" +license = "GPL-3.0" + +[package.metadata.binstall] +bin-dir = "{ bin }{ binary-ext }" + +[[bin]] +name = "cargo-binstall" diff --git a/.github/scripts/fake-cargo/cargo b/.github/scripts/fake-cargo/cargo new file mode 100755 index 00000000..da30ddf7 --- /dev/null +++ b/.github/scripts/fake-cargo/cargo @@ -0,0 +1,4 @@ +#!/bin/bash + +echo Always returns 1 to prevent use of "cargo-build" +exit 1 diff --git a/.github/scripts/gitlab-test-Cargo.toml b/.github/scripts/gitlab-test-Cargo.toml new file mode 100644 index 00000000..feea2041 --- /dev/null +++ b/.github/scripts/gitlab-test-Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "cargo-binstall" +description = "Rust binary package installer for CI integration" +repository = "https://gitlab.kitware.com/NobodyXu/hello-world" +version = "0.2.0" +rust-version = "1.61.0" +authors = ["ryan "] +edition = "2021" +license = "GPL-3.0" + +[package.metadata.binstall] +bin-dir = "{ bin }{ binary-ext }" + +[[bin]] +name = "cargo-binstall" diff --git a/.github/scripts/tests.sh b/.github/scripts/tests.sh index d2ee228d..e5b47654 100755 --- a/.github/scripts/tests.sh +++ b/.github/scripts/tests.sh @@ -58,3 +58,22 @@ cargo binstall --help >/dev/null "./$1" binstall --no-confirm cargo-binstall@0.11.0 "./$1" binstall --no-confirm cargo-binstall@0.11.0 | grep -q 'cargo-binstall v0.11.0 is already installed' "./$1" binstall --no-confirm cargo-binstall@^0.11.0 | grep -q -v 'cargo-binstall v0.11.0 is already installed' + +# Test default GitLab pkg-url templates +test_resources=".github/scripts" +PATH="$test_resources/fake-cargo:$PATH" + +"./$1" binstall \ + --force \ + --manifest-path "$test_resources/gitlab-test-Cargo.toml" \ + --log-level debug \ + --no-confirm \ + cargo-binstall + +# Test default BitBucket pkg-url templates +"./$1" binstall \ + --force \ + --manifest-path "$test_resources/bitbucket-test-Cargo.toml" \ + --log-level debug \ + --no-confirm \ + cargo-binstall diff --git a/crates/lib/src/fetchers/gh_crate_meta.rs b/crates/lib/src/fetchers/gh_crate_meta.rs index 29c22f7b..532d4060 100644 --- a/crates/lib/src/fetchers/gh_crate_meta.rs +++ b/crates/lib/src/fetchers/gh_crate_meta.rs @@ -59,9 +59,11 @@ impl GhCrateMeta { AutoAbortJoinHandle::spawn(async move { debug!("Checking for package at: '{url}'"); - remote_exists(client, url.clone(), Method::HEAD) - .await - .map(|exists| exists.then_some((url, pkg_fmt))) + Ok( + (remote_exists(client.clone(), url.clone(), Method::HEAD).await? + || remote_exists(client, url.clone(), Method::GET).await?) + .then_some((url, pkg_fmt)), + ) }) }) } From 305cda33362b3e9341604075a3d182900cf7f354 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 27 Aug 2022 21:27:39 +1000 Subject: [PATCH 0704/2020] Optimize compilation time (#320) * Print `rerun-if-changed=build.rs` in `build.rs` * Optimize compile-time: Extract `bin/src/lib.rs` so that `cargo-binstall (lib)` can be compiled in parallel to other deps. * Refactor: Extract new mod `bin/src/bin_utils.rs` * Extract new fn `MainExit::new` * Refactor: Extract new fn `run_tokio_main` * Handle `Runtime::new` err gracefully in `run_tokio_main` instead of `panic!`ing, return the error as `BinstallError` * Avoid mixing `eprintln` and `error` in `MainExit::report` * Set profile for `build-override` to speedup building of `build.rs` and proc macros. Signed-off-by: Jiahao XU --- Cargo.toml | 16 +++++++++ crates/bin/build.rs | 2 ++ crates/bin/src/bin_util.rs | 60 ++++++++++++++++++++++++++++++++ crates/bin/src/lib.rs | 5 +++ crates/bin/src/main.rs | 63 ++++++---------------------------- crates/detect-targets/build.rs | 2 ++ 6 files changed, 95 insertions(+), 53 deletions(-) create mode 100644 crates/bin/src/bin_util.rs create mode 100644 crates/bin/src/lib.rs diff --git a/Cargo.toml b/Cargo.toml index 8cbee532..0e1c817a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,3 +14,19 @@ lto = true codegen-units = 1 panic = "abort" strip = "symbols" + +[profile.dev.build-override] +opt-level = 0 +codegen-units = 1024 +debug = false +debug-assertions = false +overflow-checks = false +incremental = false + +[profile.release.build-override] +opt-level = 0 +codegen-units = 1024 +debug = false +debug-assertions = false +overflow-checks = false +incremental = false diff --git a/crates/bin/build.rs b/crates/bin/build.rs index b7db24d6..e3f7605b 100644 --- a/crates/bin/build.rs +++ b/crates/bin/build.rs @@ -1,3 +1,5 @@ fn main() { + println!("cargo:rerun-if-changed=build.rs"); + embed_resource::compile("manifest.rc"); } diff --git a/crates/bin/src/bin_util.rs b/crates/bin/src/bin_util.rs new file mode 100644 index 00000000..783d8419 --- /dev/null +++ b/crates/bin/src/bin_util.rs @@ -0,0 +1,60 @@ +use std::{ + future::Future, + process::{ExitCode, Termination}, + time::Duration, +}; + +use binstall::errors::BinstallError; +use binstall::helpers::{signal::cancel_on_user_sig_term, tasks::AutoAbortJoinHandle}; +use log::{error, info}; +use miette::Result; +use tokio::runtime::Runtime; + +pub enum MainExit { + Success(Duration), + Error(BinstallError), + Report(miette::Report), +} + +impl Termination for MainExit { + fn report(self) -> ExitCode { + match self { + Self::Success(spent) => { + info!("Done in {spent:?}"); + ExitCode::SUCCESS + } + Self::Error(err) => err.report(), + Self::Report(err) => { + error!("Fatal error:\n{err:?}"); + ExitCode::from(16) + } + } + } +} + +impl MainExit { + pub fn new(result: Result, BinstallError>, done: Duration) -> Self { + result.map_or_else(MainExit::Error, |res| { + res.map(|()| MainExit::Success(done)).unwrap_or_else(|err| { + err.downcast::() + .map(MainExit::Error) + .unwrap_or_else(MainExit::Report) + }) + }) + } +} + +/// This function would start a tokio multithreading runtime, +/// spawn a new task on it that runs `f`, then `block_on` it. +/// +/// It will cancel the future if user requested cancellation +/// via signal. +pub fn run_tokio_main(f: F) -> Result +where + F: Future + Send + 'static, + T: Send + 'static, +{ + let rt = Runtime::new()?; + let handle = AutoAbortJoinHandle::new(rt.spawn(f)); + rt.block_on(cancel_on_user_sig_term(handle)) +} diff --git a/crates/bin/src/lib.rs b/crates/bin/src/lib.rs new file mode 100644 index 00000000..4f443dbe --- /dev/null +++ b/crates/bin/src/lib.rs @@ -0,0 +1,5 @@ +pub mod args; +pub mod bin_util; +pub mod entry; +pub mod install_path; +pub mod ui; diff --git a/crates/bin/src/main.rs b/crates/bin/src/main.rs index d02828d2..374233de 100644 --- a/crates/bin/src/main.rs +++ b/crates/bin/src/main.rs @@ -1,22 +1,13 @@ -use std::{ - process::{ExitCode, Termination}, - time::{Duration, Instant}, -}; +use std::time::Instant; -use binstall::{ - errors::BinstallError, - helpers::{ - jobserver_client::LazyJobserverClient, signal::cancel_on_user_sig_term, - tasks::AutoAbortJoinHandle, - }, -}; -use log::{debug, error, info}; -use tokio::runtime::Runtime; +use binstall::helpers::jobserver_client::LazyJobserverClient; +use log::debug; -mod args; -mod entry; -mod install_path; -mod ui; +use cargo_binstall::{ + args, + bin_util::{run_tokio_main, MainExit}, + entry, ui, +}; #[cfg(feature = "mimalloc")] #[global_allocator] @@ -35,44 +26,10 @@ fn main() -> MainExit { let start = Instant::now(); - let result = { - let rt = Runtime::new().unwrap(); - let handle = - AutoAbortJoinHandle::new(rt.spawn(entry::install_crates(args, jobserver_client))); - rt.block_on(cancel_on_user_sig_term(handle)) - }; + let result = run_tokio_main(entry::install_crates(args, jobserver_client)); let done = start.elapsed(); debug!("run time: {done:?}"); - result.map_or_else(MainExit::Error, |res| { - res.map(|()| MainExit::Success(done)).unwrap_or_else(|err| { - err.downcast::() - .map(MainExit::Error) - .unwrap_or_else(MainExit::Report) - }) - }) -} - -enum MainExit { - Success(Duration), - Error(BinstallError), - Report(miette::Report), -} - -impl Termination for MainExit { - fn report(self) -> ExitCode { - match self { - Self::Success(spent) => { - info!("Done in {spent:?}"); - ExitCode::SUCCESS - } - Self::Error(err) => err.report(), - Self::Report(err) => { - error!("Fatal error:"); - eprintln!("{err:?}"); - ExitCode::from(16) - } - } - } + MainExit::new(result, done) } diff --git a/crates/detect-targets/build.rs b/crates/detect-targets/build.rs index 729c4c54..15152d41 100644 --- a/crates/detect-targets/build.rs +++ b/crates/detect-targets/build.rs @@ -1,4 +1,6 @@ fn main() { + println!("cargo:rerun-if-changed=build.rs"); + // Fetch build target and define this for the compiler println!( "cargo:rustc-env=TARGET={}", From f38c1e73c333db3e572e4ab3892b8f3d034ac620 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 27 Aug 2022 21:39:12 +1000 Subject: [PATCH 0705/2020] Ignore `trust_dns` log output (#323) * Ignore all log except `binstall` & `cargo_binstall` unless `level` is set to `Trace` Signed-off-by: Jiahao XU --- crates/bin/src/ui.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/crates/bin/src/ui.rs b/crates/bin/src/ui.rs index e10932da..889df09d 100644 --- a/crates/bin/src/ui.rs +++ b/crates/bin/src/ui.rs @@ -103,14 +103,19 @@ impl UIThread { } pub fn logging(args: &Args) { + let log_level = args.log_level; + // Setup logging let mut log_config = ConfigBuilder::new(); - log_config.add_filter_ignore("hyper".to_string()); - log_config.add_filter_ignore("reqwest".to_string()); - log_config.add_filter_ignore("rustls".to_string()); + + if log_level != LevelFilter::Trace { + log_config.add_filter_allow_str("binstall"); + log_config.add_filter_allow_str("cargo_binstall"); + } + log_config.set_location_level(LevelFilter::Off); TermLogger::init( - args.log_level, + log_level, log_config.build(), TerminalMode::Mixed, ColorChoice::Auto, From 480ea1946225dd6f629e14c8bcf60615f17c6a57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Wed, 31 Aug 2022 12:10:03 +1200 Subject: [PATCH 0706/2020] Move internal details of download to be internal to download (#314) --- crates/lib/src/drivers/crates_io/visitor.rs | 2 +- crates/lib/src/helpers.rs | 3 --- crates/lib/src/helpers/download.rs | 13 ++++++------- .../src/helpers/{ => download}/async_extracter.rs | 3 +-- crates/lib/src/helpers/{ => download}/extracter.rs | 4 ++-- .../src/helpers/{ => download}/stream_readable.rs | 2 +- 6 files changed, 11 insertions(+), 16 deletions(-) rename crates/lib/src/helpers/{ => download}/async_extracter.rs (99%) rename crates/lib/src/helpers/{ => download}/extracter.rs (91%) rename crates/lib/src/helpers/{ => download}/stream_readable.rs (98%) diff --git a/crates/lib/src/drivers/crates_io/visitor.rs b/crates/lib/src/drivers/crates_io/visitor.rs index 01a71d39..f36cae9d 100644 --- a/crates/lib/src/drivers/crates_io/visitor.rs +++ b/crates/lib/src/drivers/crates_io/visitor.rs @@ -10,7 +10,7 @@ use tar::Entries; use super::vfs::Vfs; use crate::{ - errors::BinstallError, helpers::async_extracter::TarEntriesVisitor, + errors::BinstallError, helpers::download::TarEntriesVisitor, manifests::cargo_toml_binstall::Meta, }; diff --git a/crates/lib/src/helpers.rs b/crates/lib/src/helpers.rs index 16ade8b4..ddae0132 100644 --- a/crates/lib/src/helpers.rs +++ b/crates/lib/src/helpers.rs @@ -1,9 +1,6 @@ -pub mod async_extracter; pub mod download; -pub mod extracter; pub mod jobserver_client; pub mod remote; pub mod signal; pub mod statics; -pub mod stream_readable; pub mod tasks; diff --git a/crates/lib/src/helpers/download.rs b/crates/lib/src/helpers/download.rs index 25d94f49..987805a6 100644 --- a/crates/lib/src/helpers/download.rs +++ b/crates/lib/src/helpers/download.rs @@ -5,17 +5,16 @@ use reqwest::{Client, Url}; use crate::{ errors::BinstallError, - helpers::{ - async_extracter::{ - extract_bin, extract_tar_based_stream, extract_tar_based_stream_and_visit, extract_zip, - }, - remote::create_request, - }, + helpers::remote::create_request, manifests::cargo_toml_binstall::{PkgFmt, PkgFmtDecomposed, TarBasedFmt}, }; -use super::async_extracter::TarEntriesVisitor; +pub use async_extracter::TarEntriesVisitor; +use async_extracter::*; +mod async_extracter; +mod extracter; +mod stream_readable; /// Download a file from the provided URL and extract it to the provided path. pub async fn download_and_extract>( client: &Client, diff --git a/crates/lib/src/helpers/async_extracter.rs b/crates/lib/src/helpers/download/async_extracter.rs similarity index 99% rename from crates/lib/src/helpers/async_extracter.rs rename to crates/lib/src/helpers/download/async_extracter.rs index 844fbc0b..682c2c5f 100644 --- a/crates/lib/src/helpers/async_extracter.rs +++ b/crates/lib/src/helpers/download/async_extracter.rs @@ -13,9 +13,8 @@ use tar::Entries; use tempfile::tempfile; use tokio::task::block_in_place; -use crate::{errors::BinstallError, manifests::cargo_toml_binstall::TarBasedFmt}; - use super::{extracter::*, stream_readable::StreamReadable}; +use crate::{errors::BinstallError, manifests::cargo_toml_binstall::TarBasedFmt}; pub async fn extract_bin(stream: S, path: &Path) -> Result<(), BinstallError> where diff --git a/crates/lib/src/helpers/extracter.rs b/crates/lib/src/helpers/download/extracter.rs similarity index 91% rename from crates/lib/src/helpers/extracter.rs rename to crates/lib/src/helpers/download/extracter.rs index 43fa6d3c..86ebe5f5 100644 --- a/crates/lib/src/helpers/extracter.rs +++ b/crates/lib/src/helpers/download/extracter.rs @@ -14,7 +14,7 @@ use zstd::stream::Decoder as ZstdDecoder; use crate::{errors::BinstallError, manifests::cargo_toml_binstall::TarBasedFmt}; -pub(super) fn create_tar_decoder( +pub fn create_tar_decoder( dat: impl BufRead + 'static, fmt: TarBasedFmt, ) -> io::Result>> { @@ -36,7 +36,7 @@ pub(super) fn create_tar_decoder( Ok(Archive::new(r)) } -pub(super) fn unzip(dat: File, dst: &Path) -> Result<(), BinstallError> { +pub fn unzip(dat: File, dst: &Path) -> Result<(), BinstallError> { debug!("Decompressing from zip archive to `{dst:?}`"); let mut zip = ZipArchive::new(dat)?; diff --git a/crates/lib/src/helpers/stream_readable.rs b/crates/lib/src/helpers/download/stream_readable.rs similarity index 98% rename from crates/lib/src/helpers/stream_readable.rs rename to crates/lib/src/helpers/download/stream_readable.rs index 0f26d0a1..bc450fb5 100644 --- a/crates/lib/src/helpers/stream_readable.rs +++ b/crates/lib/src/helpers/download/stream_readable.rs @@ -15,7 +15,7 @@ use crate::errors::BinstallError; /// `tokio::task::{block_in_place, spawn_blocking}` or /// `std::thread::spawn`. #[derive(Debug)] -pub(super) struct StreamReadable { +pub struct StreamReadable { stream: S, handle: Handle, bytes: Bytes, From b330a18d40b11fe19dce4b03340814793b9f21e7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 31 Aug 2022 14:48:15 +1000 Subject: [PATCH 0707/2020] Change typeof `Args::targets` to `Option>` (#327) * Change typeof `Args::targets` to `Option>` Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 2 +- crates/bin/src/entry.rs | 2 +- crates/detect-targets/src/desired_targets.rs | 4 ++-- crates/detect-targets/src/lib.rs | 5 ++++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index fcaec52f..aead6a6d 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -60,7 +60,7 @@ pub struct Args { long, value_name = "TRIPLE" )] - pub targets: Option, + pub targets: Option>, /// Override Cargo.toml package manifest path. /// diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 0091b017..290dc65a 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -29,7 +29,7 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien }; // Launch target detection - let desired_targets = get_desired_targets(args.targets.as_deref()); + let desired_targets = get_desired_targets(args.targets.take()); // Initialize reqwest client let client = create_reqwest_client(args.secure, args.min_tls_version.map(|v| v.into()))?; diff --git a/crates/detect-targets/src/desired_targets.rs b/crates/detect-targets/src/desired_targets.rs index 42acfefd..c7d7179f 100644 --- a/crates/detect-targets/src/desired_targets.rs +++ b/crates/detect-targets/src/desired_targets.rs @@ -50,9 +50,9 @@ impl DesiredTargets { /// Since `detect_targets` internally spawns a process and wait for it, /// it's pretty costy, it is recommended to run this fn ASAP and /// reuse the result. -pub fn get_desired_targets(opts_targets: Option<&str>) -> DesiredTargets { +pub fn get_desired_targets(opts_targets: Option>) -> DesiredTargets { if let Some(targets) = opts_targets { - DesiredTargets::initialized(targets.split(',').map(|t| t.to_string()).collect()) + DesiredTargets::initialized(targets) } else { DesiredTargets::auto_detect() } diff --git a/crates/detect-targets/src/lib.rs b/crates/detect-targets/src/lib.rs index 1ba7831b..6ca2a297 100644 --- a/crates/detect-targets/src/lib.rs +++ b/crates/detect-targets/src/lib.rs @@ -35,7 +35,10 @@ //! # async fn main() { //! //! assert_eq!( -//! get_desired_targets(Some("x86_64-apple-darwin,aarch64-apple-darwin")).get().await, +//! get_desired_targets(Some(vec![ +//! "x86_64-apple-darwin".to_string(), +//! "aarch64-apple-darwin".to_string(), +//! ])).get().await, //! &["x86_64-apple-darwin", "aarch64-apple-darwin"], //! ); //! # } From 0cb4c993b335652821eac583f0ea9cbcb68105b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Fri, 2 Sep 2022 16:00:46 +1200 Subject: [PATCH 0708/2020] Explode out even more variants of default download URLs (#329) --- SUPPORT.md | 89 ++++++++----------- crates/lib/src/fetchers/gh_crate_meta.rs | 12 +-- .../lib/src/fetchers/gh_crate_meta/hosting.rs | 85 ++++++++++++------ .../src/helpers/download/async_extracter.rs | 2 +- 4 files changed, 98 insertions(+), 90 deletions(-) diff --git a/SUPPORT.md b/SUPPORT.md index 5b77791d..dc84940b 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -55,80 +55,61 @@ The default value for `pkg-url` will depend on the repository of the package. It is setup to work with github releases, gitlab releases, bitbucket downloads and source forge downloads. -#### Github +If your package already uses any of these URLs, you shouldn't need to set anything. -For github, the `pkg-url` is set to +The URLs are derived from a set of filenames and a set of paths, which are +"multiplied together": every filename appended to every path. The filenames +are: -```rust -[ - "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }", - "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }.{ archive-format }", - "{ repo }/releases/download/v{ version }/{ name }-{ version }-{ target }.{ archive-format }", - "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }", -] -``` +- `{ name }-{ target }-{ version }.{ archive-format }` +- `{ name }-{ target }-v{ version }.{ archive-format }` +- `{ name }-{ version }-{ target }.{ archive-format }` +- `{ name }-v{ version }-{ target }.{ archive-format }` +- `{ name }-{ version }-{ target }.{ archive-format }` +- `{ name }-v{ version }-{ target }.{ archive-format }` +- `{ name }-{ target }.{ archive-format }` ("versionless") -The first 3 versions does not overwrite different targets or versions when manually downloaded. +The paths are: -All `pkg-url` templates download binaries located at `{ repo }/releases/download/v{ version }/`, which -is compatible with github tags / releases. +#### for GitHub -If your package already uses this approach, you shouldn't need to set anything. +- `{ repo }/releases/download/{ version }/` +- `{ repo }/releases/download/v{ version }/` -#### GitLab +#### for GitLab -For gitlab, the `pkg-url` is set to +- `{ repo }/-/releases/{ version }/downloads/binaries/` +- `{ repo }/-/releases/v{ version }/downloads/binaries/` -```rust -[ - "{ repo }/-/releases/v{ version }/downloads/binaries/{ name }-{ target }-v{ version }.{ archive-format }", - "{ repo }/-/releases/v{ version }/downloads/binaries/{ name }-v{ version }-{ target }.{ archive-format }", - "{ repo }/-/releases/v{ version }/downloads/binaries/{ name }-{ version }-{ target }.{ archive-format }", - "{ repo }/-/releases/v{ version }/downloads/binaries/{ name }-{ target }.{ archive-format }", -] -``` +Note that this uses the [Permanent links to release assets][gitlab-permalinks] +feature of GitLab EE: it requires you to create an asset as a link with a +`filepath`, which, as of writing, can only be set using GitLab's API. -This will attempt to find the release assets with `filepath` set to -`binaries/{ name }-{ target }.{ archive-format }` +[gitlab-permalinks]: https://docs.gitlab.com/ee/user/project/releases/index.html#permanent-links-to-latest-release-assets -Note that this uses the [Permanent links to release assets](https://gitlab.kitware.com/help/user/project/releases/index#permanent-links-to-latest-release-assets) feature of gitlab, it requires you to -create an asset as a link with a `filepath`, which can be set only using gitlab api as of the writing. +#### for BitBucket -#### BitBucket +- `{ repo }/downloads/` -For bitbucket, the `pkg-url` is set to +Binaries must be uploaded into the project's "Downloads" page on BitBucket. -```rust -[ - "{ repo }/downloads/{ name }-{ target }-v{ version }.{ archive-format }", - "{ repo }/downloads/{ name }-v{ version }-{ target }.{ archive-format }", - "{ repo }/downloads/{ name }-{ version }-{ target }.{ archive-format }", -] -``` +Also note that as there are no per-release downloads, the "versionless" +filename is not considered here. -To setup the package for binstall, upload the binary into bitbucket downloads page of your project, -with its name set to be `{ name }-{ target }-v{ version }.{ archive-format }`. +#### for SourceForge -#### SourceForge +- `{ repo }/files/binaries/{ version }` +- `{ repo }/files/binaries/v{ version }` -For source forge, the `pkg-url` is set to +The URLs also have `/download` appended as per SourceForge's schema. -```rust -[ - "{ repo }/files/binaries/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }/download", - "{ repo }/files/binaries/v{ version }/{ name }-v{ version }-{ target }.{ archive-format }/download", - "{ repo }/files/binaries/v{ version }/{ name }-{ version }-{ target }.{ archive-format }/download", - "{ repo }/files/binaries/v{ version }/{ name }-{ target }.{ archive-format }/download", -] -``` - -To setup the package for binstall, upload the binary to the file page of your project, -under the directory `binaries/v{ version }` with the filename `{ name }-{ target }.{ archive-format }`. +Binary must be uploaded to the "File" page of your project, under the directory +`binaries/v{ version }`. #### Others -For all other situations, `binstall` does not provide a default `pkg-url` and you need to manually -specify it. +For all other situations, `binstall` does not provide a default `pkg-url` and +you need to manually specify it. ### QuickInstall diff --git a/crates/lib/src/fetchers/gh_crate_meta.rs b/crates/lib/src/fetchers/gh_crate_meta.rs index 532d4060..d55d033e 100644 --- a/crates/lib/src/fetchers/gh_crate_meta.rs +++ b/crates/lib/src/fetchers/gh_crate_meta.rs @@ -1,4 +1,4 @@ -use std::{borrow::Cow, path::Path, sync::Arc}; +use std::{path::Path, sync::Arc}; use compact_str::{CompactString, ToCompactString}; use futures_util::stream::{FuturesUnordered, StreamExt}; @@ -23,7 +23,7 @@ use crate::{ use super::Data; mod hosting; -use hosting::GitHostingServices; +use hosting::RepositoryHost; pub struct GhCrateMeta { client: Client, @@ -86,13 +86,13 @@ impl super::Fetcher for GhCrateMeta { None }; - let pkg_urls = if let Some(pkg_url) = self.data.meta.pkg_url.as_deref() { - Cow::Owned(vec![pkg_url]) + let pkg_urls = if let Some(pkg_url) = self.data.meta.pkg_url.clone() { + vec![pkg_url] } else if let Some(repo) = repo.as_ref() { if let Some(pkg_urls) = - GitHostingServices::guess_git_hosting_services(repo)?.get_default_pkg_url_template() + RepositoryHost::guess_git_hosting_services(repo)?.get_default_pkg_url_template() { - Cow::Borrowed(pkg_urls) + pkg_urls } else { warn!( concat!( diff --git a/crates/lib/src/fetchers/gh_crate_meta/hosting.rs b/crates/lib/src/fetchers/gh_crate_meta/hosting.rs index 265fab79..521e062c 100644 --- a/crates/lib/src/fetchers/gh_crate_meta/hosting.rs +++ b/crates/lib/src/fetchers/gh_crate_meta/hosting.rs @@ -3,16 +3,17 @@ use url::Url; use crate::errors::BinstallError; #[derive(Copy, Clone, Debug)] -pub enum GitHostingServices { +pub enum RepositoryHost { GitHub, GitLab, BitBucket, SourceForge, Unknown, } -impl GitHostingServices { + +impl RepositoryHost { pub fn guess_git_hosting_services(repo: &Url) -> Result { - use GitHostingServices::*; + use RepositoryHost::*; match repo.domain() { Some(domain) if domain.starts_with("github") => Ok(GitHub), @@ -23,34 +24,60 @@ impl GitHostingServices { } } - pub fn get_default_pkg_url_template(self) -> Option<&'static [&'static str]> { - use GitHostingServices::*; + pub fn get_default_pkg_url_template(self) -> Option> { + use RepositoryHost::*; + + let full_filenames = &[ + "{ name }-{ target }-v{ version }.{ archive-format }", + "{ name }-{ target }-{ version }.{ archive-format }", + "{ name }-{ version }-{ target }.{ archive-format }", + "{ name }-v{ version }-{ target }.{ archive-format }", + "{ name }-{ version }-{ target }.{ archive-format }", + "{ name }-v{ version }-{ target }.{ archive-format }", + ]; + + let noversion_filenames = &["{ name }-{ target }.{ archive-format }"]; match self { - GitHub => Some(&[ - "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }", - "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }.{ archive-format }", - "{ repo }/releases/download/v{ version }/{ name }-{ version }-{ target }.{ archive-format }", - "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }", - ]), - GitLab => Some(&[ - "{ repo }/-/releases/v{ version }/downloads/binaries/{ name }-{ target }-v{ version }.{ archive-format }", - "{ repo }/-/releases/v{ version }/downloads/binaries/{ name }-v{ version }-{ target }.{ archive-format }", - "{ repo }/-/releases/v{ version }/downloads/binaries/{ name }-{ version }-{ target }.{ archive-format }", - "{ repo }/-/releases/v{ version }/downloads/binaries/{ name }-{ target }.{ archive-format }", - ]), - BitBucket => Some(&[ - "{ repo }/downloads/{ name }-{ target }-v{ version }.{ archive-format }", - "{ repo }/downloads/{ name }-v{ version }-{ target }.{ archive-format }", - "{ repo }/downloads/{ name }-{ version }-{ target }.{ archive-format }", - ]), - SourceForge => Some(&[ - "{ repo }/files/binaries/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }/download", - "{ repo }/files/binaries/v{ version }/{ name }-v{ version }-{ target }.{ archive-format }/download", - "{ repo }/files/binaries/v{ version }/{ name }-{ version }-{ target }.{ archive-format }/download", - "{ repo }/files/binaries/v{ version }/{ name }-{ target }.{ archive-format }/download", - ]), - Unknown => None, + GitHub => Some(apply_filenames_to_paths( + &[ + "{ repo }/releases/download/{ version }", + "{ repo }/releases/download/v{ version }", + ], + &[full_filenames, noversion_filenames], + )), + GitLab => Some(apply_filenames_to_paths( + &[ + "{ repo }/-/releases/{ version }/downloads/binaries", + "{ repo }/-/releases/v{ version }/downloads/binaries", + ], + &[full_filenames, noversion_filenames], + )), + BitBucket => Some(apply_filenames_to_paths( + &["{ repo }/downloads"], + &[full_filenames], + )), + SourceForge => Some( + apply_filenames_to_paths( + &[ + "{ repo }/files/binaries/{ version }", + "{ repo }/files/binaries/v{ version }", + ], + &[full_filenames, noversion_filenames], + ) + .into_iter() + .map(|url| format!("{url}/download")) + .collect(), + ), + Unknown => None, } } } + +fn apply_filenames_to_paths(paths: &[&str], filenames: &[&[&str]]) -> Vec { + filenames + .iter() + .flat_map(|fs| fs.iter()) + .flat_map(|filename| paths.iter().map(move |path| format!("{path}/{filename}"))) + .collect() +} diff --git a/crates/lib/src/helpers/download/async_extracter.rs b/crates/lib/src/helpers/download/async_extracter.rs index 682c2c5f..840cbf21 100644 --- a/crates/lib/src/helpers/download/async_extracter.rs +++ b/crates/lib/src/helpers/download/async_extracter.rs @@ -25,7 +25,7 @@ where block_in_place(move || { fs::create_dir_all(path.parent().unwrap())?; - let mut file = fs::File::create(&path)?; + let mut file = fs::File::create(path)?; // remove it unless the operation isn't aborted and no write // fails. From 280bc974eb6f17b88f5547dc7efcb4d87bd14256 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 4 Sep 2022 21:38:08 +1200 Subject: [PATCH 0709/2020] Use release PR action (#330) --- .github/scripts/release-pr-template.ejs | 52 ++++++++++++++++++++ .github/scripts/release-pr.txt | 28 ----------- .github/workflows/release-pr.yml | 65 +++++++------------------ 3 files changed, 70 insertions(+), 75 deletions(-) create mode 100644 .github/scripts/release-pr-template.ejs delete mode 100644 .github/scripts/release-pr.txt diff --git a/.github/scripts/release-pr-template.ejs b/.github/scripts/release-pr-template.ejs new file mode 100644 index 00000000..4cb6353c --- /dev/null +++ b/.github/scripts/release-pr-template.ejs @@ -0,0 +1,52 @@ +This is a release PR for version **<%= version.actual %>**<% + if (version.actual != version.desired) { +%> (performing a <%= version.desired %> bump).<% + } else { +%>.<% + } +%> + +<% if (pr.mergeStrategy == "merge") { %> +**Use a merge commit.** +<% } else if (pr.mergeStrategy == "rebase") { %> +**Use rebase merge.** +<% } else if (pr.mergeStrategy == "squash") { %> +**Use squash merge.** +<% } else if (pr.mergeStrategy == "bors") { %> +**Merge by commenting:** +| bors r+ | +|:-:| +<% } %> + +<% if (crate.name == "cargo-binstall") { %> +Upon merging, this will automatically build the CLI and create a GitHub release. +<% } else { %> +Upon merging, this will create the tag `<%= crate.name %>-<%= version.actual %>`. +<% } %> + +You will still need to manually publish the cargo crate: + +``` +$ git pull +$ git switch --detach v{version} +$ cargo publish +``` + +<% if (pr.releaseNotes) { %> +--- + +_Edit release notes into the section below:_ + + +### Release notes + +_Binstall is a tool to fetch and install Rust-based executables as binaries. It aims to be a drop-in replacement for \`cargo install\` in most cases. Install it today with \`cargo install cargo-binstall\`, from the binaries below, or if you already have it, upgrade with \`cargo binstall cargo-binstall\`._ + +#### In this release: + +- + +#### Other changes: + +- +<% } %> diff --git a/.github/scripts/release-pr.txt b/.github/scripts/release-pr.txt deleted file mode 100644 index e8fe3f7d..00000000 --- a/.github/scripts/release-pr.txt +++ /dev/null @@ -1,28 +0,0 @@ -This is a release PR for version **%version%**. - -**Use squash merge.** -Upon merging, this will automatically build the CLI and create a GitHub release. -You still need to manually publish the cargo crate. - -``` -$ git pull -$ git checkout v%version% -$ cargo publish -``` - ---- - -_Edit release notes into the section below:_ - - -### Release notes - -_Binstall is a tool to fetch and install Rust-based executables as binaries. It aims to be a drop-in replacement for `cargo install` in most cases. Install it today with `cargo install cargo-binstall`, from the binaries below, or if you already have it, upgrade with `cargo binstall cargo-binstall`._ - -#### In this release: - -- - -#### Other changes: - -- diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 1da166bb..09eaf88a 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -2,6 +2,17 @@ name: Open a release PR on: workflow_dispatch: inputs: + crate: + description: Crate to release + required: true + type: choice + options: + - bin + - lib + - detect-targets + - detect-wasi + - flock + - normalize-path version: description: Version to release required: true @@ -20,50 +31,10 @@ jobs: with: ref: main - - name: Extract info - run: | - set -euxo pipefail - - branch_name="release-${{ inputs.version }}" - echo "branch_name=${branch_name}" >> $GITHUB_ENV - - - name: Make release branch - run: git switch -c "${{ env.branch_name }}" - - - name: Do release - run: | - set -euxo pipefail - git config user.name github-actions - git config user.email github-actions@github.com - cargo release \ - --execute \ - --no-push \ - --no-tag \ - --no-publish \ - --no-confirm \ - --verbose \ - --config release.toml \ - --allow-branch "${{ env.branch_name }}" \ - --dependent-version upgrade \ - "${{ inputs.version }}" - - - name: Push new branch - run: | - set -euxo pipefail - git push origin "${{ env.branch_name }}" - - - name: Create PR - run: | - set -euxo pipefail - - nl=$'\n' - br=$'\n\n' - fence=$'```\n' - ecnef=$'\n```' - - title='release: v${{ inputs.version }}' - body=$(sed 's/%version%/${{ inputs.version }}/g' .github/scripts/release-pr.txt) - - gh pr create --title "$title" --body "$body" --base main --head "${{ env.branch_name }}" --label "release" - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: cargo-bins/release-pr@v1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + version: ${{ inputs.version }} + crate-path: crates/${{ inputs.crate }} + pr-release-notes: true + pr-template-file: .github/scripts/release-pr-template.ejs From 1cf6076d621ed796873422ba90318cc02f55f8d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 4 Sep 2022 22:47:18 +1200 Subject: [PATCH 0710/2020] Add phantom digest support to download (#315) --- Cargo.lock | 47 +++++++++ crates/lib/Cargo.toml | 2 + crates/lib/src/drivers/crates_io.rs | 12 +-- crates/lib/src/fetchers/gh_crate_meta.rs | 6 +- crates/lib/src/fetchers/quickinstall.rs | 6 +- crates/lib/src/helpers/download.rs | 124 ++++++++++++++++------- 6 files changed, 149 insertions(+), 48 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b766bdde..313d3807 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -87,10 +87,12 @@ dependencies = [ "compact_str", "crates_io_api", "detect-targets", + "digest", "env_logger", "flate2", "flock", "futures-util", + "generic-array", "home", "itertools", "jobserver", @@ -125,6 +127,15 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "block-buffer" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +dependencies = [ + "generic-array", +] + [[package]] name = "bumpalo" version = "3.10.0" @@ -351,6 +362,16 @@ dependencies = [ "once_cell", ] +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + [[package]] name = "data-encoding" version = "2.3.2" @@ -373,6 +394,16 @@ dependencies = [ "tempfile", ] +[[package]] +name = "digest" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +dependencies = [ + "block-buffer", + "crypto-common", +] + [[package]] name = "dirs" version = "4.0.0" @@ -637,6 +668,16 @@ dependencies = [ "slab", ] +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getrandom" version = "0.2.7" @@ -2053,6 +2094,12 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +[[package]] +name = "typenum" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" + [[package]] name = "unicode-bidi" version = "0.3.8" diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index aaa2449a..bcbb2353 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -18,9 +18,11 @@ clap = { version = "3.2.17", features = ["derive"] } compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.0", default-features = false } detect-targets = { version = "0.1.0", path = "../detect-targets" } +digest = "0.10.3" flate2 = { version = "1.0.24", default-features = false } flock = { version = "0.1.0", path = "../flock" } futures-util = { version = "0.3.23", default-features = false, features = ["std"] } +generic-array = "0.14.6" home = "0.5.3" itertools = "0.10.3" jobserver = "0.1.24" diff --git a/crates/lib/src/drivers/crates_io.rs b/crates/lib/src/drivers/crates_io.rs index 0ac81d64..4858f246 100644 --- a/crates/lib/src/drivers/crates_io.rs +++ b/crates/lib/src/drivers/crates_io.rs @@ -9,7 +9,7 @@ use url::Url; use crate::{ errors::BinstallError, - helpers::download::download_tar_based_and_visit, + helpers::download::Download, manifests::cargo_toml_binstall::{Meta, TarBasedFmt}, }; @@ -52,11 +52,7 @@ pub async fn fetch_crate_cratesio( let manifest_dir_path: PathBuf = format!("{name}-{version_name}").into(); - download_tar_based_and_visit( - client, - Url::parse(&crate_url)?, - TarBasedFmt::Tgz, - ManifestVisitor::new(manifest_dir_path), - ) - .await + Download::new(client, Url::parse(&crate_url)?) + .and_visit_tar(TarBasedFmt::Tgz, ManifestVisitor::new(manifest_dir_path)) + .await } diff --git a/crates/lib/src/fetchers/gh_crate_meta.rs b/crates/lib/src/fetchers/gh_crate_meta.rs index d55d033e..56dac9fa 100644 --- a/crates/lib/src/fetchers/gh_crate_meta.rs +++ b/crates/lib/src/fetchers/gh_crate_meta.rs @@ -13,7 +13,7 @@ use url::Url; use crate::{ errors::BinstallError, helpers::{ - download::download_and_extract, + download::Download, remote::{get_redirected_final_url, remote_exists}, tasks::AutoAbortJoinHandle, }, @@ -145,7 +145,9 @@ impl super::Fetcher for GhCrateMeta { async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { let (url, pkg_fmt) = self.resolution.get().unwrap(); // find() is called first debug!("Downloading package from: '{url}'"); - download_and_extract(&self.client, url, *pkg_fmt, dst).await + Download::new(&self.client, url.clone()) + .and_extract(self.pkg_fmt(), dst) + .await } fn pkg_fmt(&self) -> PkgFmt { diff --git a/crates/lib/src/fetchers/quickinstall.rs b/crates/lib/src/fetchers/quickinstall.rs index b0e8460c..a2bf4012 100644 --- a/crates/lib/src/fetchers/quickinstall.rs +++ b/crates/lib/src/fetchers/quickinstall.rs @@ -9,7 +9,7 @@ use url::Url; use crate::{ errors::BinstallError, - helpers::{download::download_and_extract, remote::remote_exists}, + helpers::{download::Download, remote::remote_exists}, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; @@ -49,7 +49,9 @@ impl super::Fetcher for QuickInstall { async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { let url = self.package_url(); debug!("Downloading package from: '{url}'"); - download_and_extract(&self.client, &Url::parse(&url)?, self.pkg_fmt(), dst).await + Download::new(&self.client, Url::parse(&url)?) + .and_extract(self.pkg_fmt(), dst) + .await } fn pkg_fmt(&self) -> PkgFmt { diff --git a/crates/lib/src/helpers/download.rs b/crates/lib/src/helpers/download.rs index 987805a6..9fb6d8e5 100644 --- a/crates/lib/src/helpers/download.rs +++ b/crates/lib/src/helpers/download.rs @@ -1,5 +1,6 @@ -use std::{fmt::Debug, path::Path}; +use std::{fmt::Debug, marker::PhantomData, path::Path}; +use digest::{Digest, FixedOutput, HashMarker, Output, OutputSizeUser, Update}; use log::debug; use reqwest::{Client, Url}; @@ -15,47 +16,98 @@ use async_extracter::*; mod async_extracter; mod extracter; mod stream_readable; -/// Download a file from the provided URL and extract it to the provided path. -pub async fn download_and_extract>( - client: &Client, - url: &Url, - fmt: PkgFmt, - path: P, -) -> Result<(), BinstallError> { - let stream = create_request(client, url.clone()).await?; - let path = path.as_ref(); - debug!("Downloading and extracting to: '{}'", path.display()); +#[derive(Debug)] +pub struct Download<'client, D: Digest = NoDigest> { + client: &'client Client, + url: Url, + _digest: PhantomData, + _checksum: Vec, +} - match fmt.decompose() { - PkgFmtDecomposed::Tar(fmt) => extract_tar_based_stream(stream, path, fmt).await?, - PkgFmtDecomposed::Bin => extract_bin(stream, path).await?, - PkgFmtDecomposed::Zip => extract_zip(stream, path).await?, +impl<'client> Download<'client> { + pub fn new(client: &'client Client, url: Url) -> Self { + Self { + client, + url, + _digest: PhantomData::default(), + _checksum: Vec::new(), + } } - debug!("Download OK, extracted to: '{}'", path.display()); + /// Download a file from the provided URL and extract part of it to + /// the provided path. + /// + /// * `filter` - If Some, then it will pass the path of the file to it + /// and only extract ones which filter returns `true`. + /// + /// This does not support verifying a checksum due to the partial extraction + /// and will ignore one if specified. + pub async fn and_visit_tar( + self, + fmt: TarBasedFmt, + visitor: V, + ) -> Result { + let stream = create_request(self.client, self.url).await?; - Ok(()) + debug!("Downloading and extracting then in-memory processing"); + + let ret = extract_tar_based_stream_and_visit(stream, fmt, visitor).await?; + + debug!("Download, extraction and in-memory procession OK"); + + Ok(ret) + } + + /// Download a file from the provided URL and extract it to the provided path. + pub async fn and_extract( + self, + fmt: PkgFmt, + path: impl AsRef, + ) -> Result<(), BinstallError> { + let stream = create_request(self.client, self.url).await?; + + let path = path.as_ref(); + debug!("Downloading and extracting to: '{}'", path.display()); + + match fmt.decompose() { + PkgFmtDecomposed::Tar(fmt) => extract_tar_based_stream(stream, path, fmt).await?, + PkgFmtDecomposed::Bin => extract_bin(stream, path).await?, + PkgFmtDecomposed::Zip => extract_zip(stream, path).await?, + } + + debug!("Download OK, extracted to: '{}'", path.display()); + + Ok(()) + } } -/// Download a file from the provided URL and extract part of it to -/// the provided path. -/// -/// * `filter` - If Some, then it will pass the path of the file to it -/// and only extract ones which filter returns `true`. -pub async fn download_tar_based_and_visit( - client: &Client, - url: Url, - fmt: TarBasedFmt, - visitor: V, -) -> Result { - let stream = create_request(client, url).await?; +impl<'client, D: Digest> Download<'client, D> { + pub fn new_with_checksum(client: &'client Client, url: Url, checksum: Vec) -> Self { + Self { + client, + url, + _digest: PhantomData::default(), + _checksum: checksum, + } + } - debug!("Downloading and extracting then in-memory processing"); - - let ret = extract_tar_based_stream_and_visit(stream, fmt, visitor).await?; - - debug!("Download, extraction and in-memory procession OK"); - - Ok(ret) + // TODO: implement checking the sum, may involve bringing (parts of) and_extract() back in here } + +#[derive(Clone, Copy, Debug, Default)] +pub struct NoDigest; + +impl FixedOutput for NoDigest { + fn finalize_into(self, _out: &mut Output) {} +} + +impl OutputSizeUser for NoDigest { + type OutputSize = generic_array::typenum::U0; +} + +impl Update for NoDigest { + fn update(&mut self, _data: &[u8]) {} +} + +impl HashMarker for NoDigest {} From f5a682ccce103a102e9b5f8715df543749c6edbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 4 Sep 2022 23:00:33 +1200 Subject: [PATCH 0711/2020] Stop using borrows of reqwest::Client (#316) --- crates/lib/src/drivers/crates_io.rs | 2 +- crates/lib/src/fetchers/gh_crate_meta.rs | 2 +- crates/lib/src/fetchers/quickinstall.rs | 2 +- crates/lib/src/helpers/download.rs | 12 ++++++------ crates/lib/src/helpers/remote.rs | 2 +- crates/lib/src/ops/resolve.rs | 2 +- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/crates/lib/src/drivers/crates_io.rs b/crates/lib/src/drivers/crates_io.rs index 4858f246..21b1da26 100644 --- a/crates/lib/src/drivers/crates_io.rs +++ b/crates/lib/src/drivers/crates_io.rs @@ -22,7 +22,7 @@ use visitor::ManifestVisitor; /// Fetch a crate Cargo.toml by name and version from crates.io pub async fn fetch_crate_cratesio( - client: &Client, + client: Client, crates_io_api_client: &AsyncClient, name: &str, version_req: &VersionReq, diff --git a/crates/lib/src/fetchers/gh_crate_meta.rs b/crates/lib/src/fetchers/gh_crate_meta.rs index 56dac9fa..dea1877e 100644 --- a/crates/lib/src/fetchers/gh_crate_meta.rs +++ b/crates/lib/src/fetchers/gh_crate_meta.rs @@ -145,7 +145,7 @@ impl super::Fetcher for GhCrateMeta { async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { let (url, pkg_fmt) = self.resolution.get().unwrap(); // find() is called first debug!("Downloading package from: '{url}'"); - Download::new(&self.client, url.clone()) + Download::new(self.client.clone(), url.clone()) .and_extract(self.pkg_fmt(), dst) .await } diff --git a/crates/lib/src/fetchers/quickinstall.rs b/crates/lib/src/fetchers/quickinstall.rs index a2bf4012..e94795c7 100644 --- a/crates/lib/src/fetchers/quickinstall.rs +++ b/crates/lib/src/fetchers/quickinstall.rs @@ -49,7 +49,7 @@ impl super::Fetcher for QuickInstall { async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { let url = self.package_url(); debug!("Downloading package from: '{url}'"); - Download::new(&self.client, Url::parse(&url)?) + Download::new(self.client.clone(), Url::parse(&url)?) .and_extract(self.pkg_fmt(), dst) .await } diff --git a/crates/lib/src/helpers/download.rs b/crates/lib/src/helpers/download.rs index 9fb6d8e5..4918e176 100644 --- a/crates/lib/src/helpers/download.rs +++ b/crates/lib/src/helpers/download.rs @@ -18,15 +18,15 @@ mod extracter; mod stream_readable; #[derive(Debug)] -pub struct Download<'client, D: Digest = NoDigest> { - client: &'client Client, +pub struct Download { + client: Client, url: Url, _digest: PhantomData, _checksum: Vec, } -impl<'client> Download<'client> { - pub fn new(client: &'client Client, url: Url) -> Self { +impl Download { + pub fn new(client: Client, url: Url) -> Self { Self { client, url, @@ -82,8 +82,8 @@ impl<'client> Download<'client> { } } -impl<'client, D: Digest> Download<'client, D> { - pub fn new_with_checksum(client: &'client Client, url: Url, checksum: Vec) -> Self { +impl Download { + pub fn new_with_checksum(client: Client, url: Url, checksum: Vec) -> Self { Self { client, url, diff --git a/crates/lib/src/helpers/remote.rs b/crates/lib/src/helpers/remote.rs index e609015c..ddfdce82 100644 --- a/crates/lib/src/helpers/remote.rs +++ b/crates/lib/src/helpers/remote.rs @@ -56,7 +56,7 @@ pub async fn get_redirected_final_url(client: &Client, url: Url) -> Result Result>, BinstallError> { debug!("Downloading from: '{url}'"); diff --git a/crates/lib/src/ops/resolve.rs b/crates/lib/src/ops/resolve.rs index bcbaae6b..97a553d4 100644 --- a/crates/lib/src/ops/resolve.rs +++ b/crates/lib/src/ops/resolve.rs @@ -133,7 +133,7 @@ async fn resolve_inner( Some(manifest_path) => load_manifest_path(manifest_path)?, None => { fetch_crate_cratesio( - &client, + client.clone(), &crates_io_api_client, &crate_name.name, &version_req, From e21617cc9ec95dcc484c77330f8fc207895d4e82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 4 Sep 2022 23:12:10 +1200 Subject: [PATCH 0712/2020] Adapt release workflow for workspace (#331) Co-authored-by: Jiahao XU --- .../scripts/extract-tag-from-release-commit.sh | 4 +++- .github/scripts/release-pr-template.ejs | 2 +- .github/workflows/release-pr.yml | 2 +- .github/workflows/release.yml | 17 ++++++++++++++--- Cargo.lock | 10 +++++----- crates/bin/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/Cargo.toml | 2 +- crates/flock/Cargo.toml | 2 +- crates/lib/Cargo.toml | 8 ++++---- crates/normalize-path/Cargo.toml | 2 +- 11 files changed, 33 insertions(+), 20 deletions(-) diff --git a/.github/scripts/extract-tag-from-release-commit.sh b/.github/scripts/extract-tag-from-release-commit.sh index a9b11818..3e7d95bb 100755 --- a/.github/scripts/extract-tag-from-release-commit.sh +++ b/.github/scripts/extract-tag-from-release-commit.sh @@ -2,5 +2,7 @@ set -euxo pipefail message="$(head -n1 <<< "$COMMIT_MESSAGE")" -version="$(cut -d ' ' -f 2 <<< "${message}")" +crate="$(cut -d ' ' -f 2 <<< "${message}")" +version="$(cut -d ' ' -f 3 <<< "${message}")" +echo "::set-output name=crate::${crate}" echo "::set-output name=version::${version}" diff --git a/.github/scripts/release-pr-template.ejs b/.github/scripts/release-pr-template.ejs index 4cb6353c..40ad4438 100644 --- a/.github/scripts/release-pr-template.ejs +++ b/.github/scripts/release-pr-template.ejs @@ -29,7 +29,7 @@ You will still need to manually publish the cargo crate: ``` $ git pull $ git switch --detach v{version} -$ cargo publish +$ cargo publish -p <%= crate.name %> ``` <% if (pr.releaseNotes) { %> diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 09eaf88a..7b70ce37 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -36,5 +36,5 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} version: ${{ inputs.version }} crate-path: crates/${{ inputs.crate }} - pr-release-notes: true + pr-release-notes: ${{ inputs.crate == 'bin' }} pr-template-file: .github/scripts/release-pr-template.ejs diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e467de94..c1ff2a44 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -9,9 +9,10 @@ on: jobs: info: runs-on: ubuntu-latest - # the commit message will look like: `release: v{version} (#{pr-number})` - if: "startsWith(github.event.head_commit.message, 'release: v')" + # the commit message will look like: `release: {crate-name} v{version} (#{pr-number})` + if: "startsWith(github.event.head_commit.message, 'release: ')" outputs: + crate: ${{ steps.version.outputs.crate }} version: ${{ steps.version.outputs.version }} notes: ${{ fromJSON(steps.notes.outputs.notes_json) }} env: @@ -33,7 +34,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - - name: Push release tag + - name: Push lib release tag + if: "! startsWith(github.event.head_commit.message, 'release: cargo-binstall v')" + uses: mathieudutour/github-tag-action@v6.0 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + custom_tag: ${{ needs.info.outputs.version }} + tag_prefix: ${{ needs.info.outputs.crate }}- + - name: Push cli release tag + if: "startsWith(github.event.head_commit.message, 'release: cargo-binstall v')" uses: mathieudutour/github-tag-action@v6.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} @@ -41,12 +50,14 @@ jobs: tag_prefix: '' build: + if: "startsWith(github.event.head_commit.message, 'release: cargo-binstall v')" needs: info # not really, but just so it fails fast uses: ./.github/workflows/build.yml with: for_release: true release: + if: "startsWith(github.event.head_commit.message, 'release: cargo-binstall v')" needs: - info - tag diff --git a/Cargo.lock b/Cargo.lock index 313d3807..ef849824 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,7 +77,7 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "binstall" -version = "0.1.0" +version = "0.0.0" dependencies = [ "async-trait", "bytes", @@ -380,7 +380,7 @@ checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" [[package]] name = "detect-targets" -version = "0.1.0" +version = "0.0.0" dependencies = [ "cfg-if", "guess_host_triple", @@ -389,7 +389,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.0" +version = "0.0.0" dependencies = [ "tempfile", ] @@ -532,7 +532,7 @@ dependencies = [ [[package]] name = "flock" -version = "0.1.0" +version = "0.0.0" dependencies = [ "fs4", ] @@ -1137,7 +1137,7 @@ dependencies = [ [[package]] name = "normalize-path" -version = "0.1.0" +version = "0.0.0" [[package]] name = "num-integer" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index b2f65fc7..4401d01b 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -18,7 +18,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstall = { path = "../lib", version = "0.1.0" } +binstall = { path = "../lib", version = "0.0.0" } clap = { version = "3.2.17", features = ["derive"] } crates_io_api = { version = "0.8.0", default-features = false } dirs = "4.0.0" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index e389b996..bd4ed72c 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-target" -version = "0.1.0" +version = "0.0.0" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index e9d4241c..851475ad 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.0" +version = "0.0.0" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" diff --git a/crates/flock/Cargo.toml b/crates/flock/Cargo.toml index e9ce16b9..61461a48 100644 --- a/crates/flock/Cargo.toml +++ b/crates/flock/Cargo.toml @@ -3,7 +3,7 @@ name = "flock" description = "Locked files that can be used like normal File" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/flock" -version = "0.1.0" +version = "0.0.0" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index bcbb2353..b1f1c03c 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -3,7 +3,7 @@ name = "binstall" description = "Library backend for cargo-binstall" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstall" -version = "0.1.0" +version = "0.0.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -17,10 +17,10 @@ cargo_toml = "0.11.5" clap = { version = "3.2.17", features = ["derive"] } compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.0", default-features = false } -detect-targets = { version = "0.1.0", path = "../detect-targets" } +detect-targets = { version = "0.0.0", path = "../detect-targets" } digest = "0.10.3" flate2 = { version = "1.0.24", default-features = false } -flock = { version = "0.1.0", path = "../flock" } +flock = { version = "0.0.0", path = "../flock" } futures-util = { version = "0.3.23", default-features = false, features = ["std"] } generic-array = "0.14.6" home = "0.5.3" @@ -28,7 +28,7 @@ itertools = "0.10.3" jobserver = "0.1.24" log = { version = "0.4.17", features = ["std"] } miette = "5.3.0" -normalize-path = { version = "0.1.0", path = "../normalize-path" } +normalize-path = { version = "0.0.0", path = "../normalize-path" } once_cell = "1.13.0" reqwest = { version = "0.11.11", features = ["stream"], default-features = false } scopeguard = "1.1.0" diff --git a/crates/normalize-path/Cargo.toml b/crates/normalize-path/Cargo.toml index d22ad55b..0a4ec09e 100644 --- a/crates/normalize-path/Cargo.toml +++ b/crates/normalize-path/Cargo.toml @@ -3,7 +3,7 @@ name = "normalize-path" description = "Like canonicalize, but without performing I/O" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/normalize-path" -version = "0.1.0" +version = "0.0.0" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From c3773a4a489550e6ce271c24b12724034aa90de5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 4 Sep 2022 13:45:28 +0000 Subject: [PATCH 0713/2020] release: detect-wasi v1.0.0 (#332) Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/detect-wasi/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ef849824..fae3c83c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -389,7 +389,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "0.0.0" +version = "1.0.0" dependencies = [ "tempfile", ] diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index 851475ad..e9d4241c 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "0.0.0" +version = "1.0.0" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From f439767b6f082178a8ad4ff7e6910011674e130c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 4 Sep 2022 14:34:51 +0000 Subject: [PATCH 0714/2020] release: detect-targets v0.1.0 (#333) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: github-actions Co-authored-by: Félix Saparelli --- Cargo.lock | 2 +- crates/detect-targets/Cargo.toml | 2 +- crates/lib/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fae3c83c..e8aee7fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -380,7 +380,7 @@ checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" [[package]] name = "detect-targets" -version = "0.0.0" +version = "0.1.0" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index bd4ed72c..e389b996 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-target" -version = "0.0.0" +version = "0.1.0" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index b1f1c03c..d8f97266 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -17,7 +17,7 @@ cargo_toml = "0.11.5" clap = { version = "3.2.17", features = ["derive"] } compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.0", default-features = false } -detect-targets = { version = "0.0.0", path = "../detect-targets" } +detect-targets = { version = "0.1.0", path = "../detect-targets" } digest = "0.10.3" flate2 = { version = "1.0.24", default-features = false } flock = { version = "0.0.0", path = "../flock" } From 79d4e9b015fd5d362f6586e29960756a0e9f1831 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 4 Sep 2022 14:59:51 +0000 Subject: [PATCH 0715/2020] release: normalize-path v0.1.0 (#335) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Félix Saparelli --- Cargo.lock | 2 +- crates/lib/Cargo.toml | 2 +- crates/normalize-path/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e8aee7fa..535fa8a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1137,7 +1137,7 @@ dependencies = [ [[package]] name = "normalize-path" -version = "0.0.0" +version = "0.1.0" [[package]] name = "num-integer" diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index d8f97266..1905aec9 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -28,7 +28,7 @@ itertools = "0.10.3" jobserver = "0.1.24" log = { version = "0.4.17", features = ["std"] } miette = "5.3.0" -normalize-path = { version = "0.0.0", path = "../normalize-path" } +normalize-path = { version = "0.1.0", path = "../normalize-path" } once_cell = "1.13.0" reqwest = { version = "0.11.11", features = ["stream"], default-features = false } scopeguard = "1.1.0" diff --git a/crates/normalize-path/Cargo.toml b/crates/normalize-path/Cargo.toml index 0a4ec09e..d22ad55b 100644 --- a/crates/normalize-path/Cargo.toml +++ b/crates/normalize-path/Cargo.toml @@ -3,7 +3,7 @@ name = "normalize-path" description = "Like canonicalize, but without performing I/O" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/normalize-path" -version = "0.0.0" +version = "0.1.0" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From 89869db239afe6ebc25d242e6de46b886bebdeef Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 5 Sep 2022 01:11:28 +1000 Subject: [PATCH 0716/2020] Fix doc of `desired_targets` (#337) --- crates/detect-targets/src/desired_targets.rs | 3 +-- crates/detect-targets/src/lib.rs | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/detect-targets/src/desired_targets.rs b/crates/detect-targets/src/desired_targets.rs index c7d7179f..0f236d7b 100644 --- a/crates/detect-targets/src/desired_targets.rs +++ b/crates/detect-targets/src/desired_targets.rs @@ -43,8 +43,7 @@ impl DesiredTargets { } } -/// If opts_targets is `Some`, then it will be parsed in the format of -/// `$target1,$target2,...`. +/// If opts_targets is `Some`, then it will be used. /// Otherwise, call `detect_targets` using `tokio::spawn` to detect targets. /// /// Since `detect_targets` internally spawns a process and wait for it, diff --git a/crates/detect-targets/src/lib.rs b/crates/detect-targets/src/lib.rs index 6ca2a297..2e74eb17 100644 --- a/crates/detect-targets/src/lib.rs +++ b/crates/detect-targets/src/lib.rs @@ -10,8 +10,8 @@ //! - [`detect_targets`] provides the API to get the target //! at runtime, but the code is run on the current thread. //! - [`get_desired_targets`] provides the API to either -//! parse `$target1,$target2,...` override provided by the users, -//! or run [`detect_targets`] in the background using [`tokio::spawn`]. +//! use override provided by the users, or run [`detect_targets`] +//! in the background using [`tokio::spawn`]. //! //! # Example //! From 3387a63895a28ff7853b4c040a9d834bff5a1bd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Mon, 5 Sep 2022 03:19:17 +1200 Subject: [PATCH 0717/2020] Fix release PR template (#336) --- .github/scripts/release-pr-template.ejs | 4 ++-- .github/workflows/release-pr.yml | 1 + crates/bin/release.toml | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/scripts/release-pr-template.ejs b/.github/scripts/release-pr-template.ejs index 40ad4438..aefae9a8 100644 --- a/.github/scripts/release-pr-template.ejs +++ b/.github/scripts/release-pr-template.ejs @@ -1,4 +1,4 @@ -This is a release PR for version **<%= version.actual %>**<% +This is a release PR for **<%= crate.name %>** version **<%= version.actual %>**<% if (version.actual != version.desired) { %> (performing a <%= version.desired %> bump).<% } else { @@ -28,7 +28,7 @@ You will still need to manually publish the cargo crate: ``` $ git pull -$ git switch --detach v{version} +$ git switch --detach <%= crate.name %>-<%= version.actual %> $ cargo publish -p <%= crate.name %> ``` diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 7b70ce37..e47a148e 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -36,5 +36,6 @@ jobs: github-token: ${{ secrets.GITHUB_TOKEN }} version: ${{ inputs.version }} crate-path: crates/${{ inputs.crate }} + pr-label: release pr-release-notes: ${{ inputs.crate == 'bin' }} pr-template-file: .github/scripts/release-pr-template.ejs diff --git a/crates/bin/release.toml b/crates/bin/release.toml index e72abc9c..db2a5847 100644 --- a/crates/bin/release.toml +++ b/crates/bin/release.toml @@ -1,5 +1,5 @@ -pre-release-commit-message = "release: v{{version}}" -tag-prefix = "cli-" +pre-release-commit-message = "release: cargo-binstall v{{version}}" +tag-prefix = "" tag-message = "cargo-binstall {{version}}" # We wait until the release CI is done before publishing, From a628cbf876b71c84b3ae76db665effcc4d8eeaae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Mon, 5 Sep 2022 03:28:22 +1200 Subject: [PATCH 0718/2020] Rename flock to fs-lock (#338) --- .github/workflows/release-pr.yml | 2 +- Cargo.lock | 16 ++++++++-------- Cargo.toml | 2 +- crates/{flock => fs-lock}/Cargo.toml | 4 ++-- crates/{flock => fs-lock}/LICENSE-APACHE | 0 crates/{flock => fs-lock}/LICENSE-MIT | 0 crates/{flock => fs-lock}/src/lib.rs | 0 crates/lib/Cargo.toml | 2 +- crates/lib/src/fetchers/gh_crate_meta.rs | 2 +- crates/lib/src/manifests/binstall_crates_v1.rs | 2 +- crates/lib/src/manifests/cargo_crates_v1.rs | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) rename crates/{flock => fs-lock}/Cargo.toml (83%) rename crates/{flock => fs-lock}/LICENSE-APACHE (100%) rename crates/{flock => fs-lock}/LICENSE-MIT (100%) rename crates/{flock => fs-lock}/src/lib.rs (100%) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index e47a148e..d7066ed3 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -11,7 +11,7 @@ on: - lib - detect-targets - detect-wasi - - flock + - fs-lock - normalize-path version: description: Version to release diff --git a/Cargo.lock b/Cargo.lock index 535fa8a9..23732f54 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -90,7 +90,7 @@ dependencies = [ "digest", "env_logger", "flate2", - "flock", + "fs-lock", "futures-util", "generic-array", "home", @@ -530,13 +530,6 @@ dependencies = [ "miniz_oxide", ] -[[package]] -name = "flock" -version = "0.0.0" -dependencies = [ - "fs4", -] - [[package]] name = "fnv" version = "1.0.7" @@ -568,6 +561,13 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs-lock" +version = "0.0.0" +dependencies = [ + "fs4", +] + [[package]] name = "fs4" version = "0.6.2" diff --git a/Cargo.toml b/Cargo.toml index 0e1c817a..d9372896 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,7 +3,7 @@ members = [ "crates/bin", "crates/lib", "crates/detect-wasi", - "crates/flock", + "crates/fs-lock", "crates/normalize-path", "crates/detect-targets", ] diff --git a/crates/flock/Cargo.toml b/crates/fs-lock/Cargo.toml similarity index 83% rename from crates/flock/Cargo.toml rename to crates/fs-lock/Cargo.toml index 61461a48..2e84efcc 100644 --- a/crates/flock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -1,8 +1,8 @@ [package] -name = "flock" +name = "fs-lock" description = "Locked files that can be used like normal File" repository = "https://github.com/cargo-bins/cargo-binstall" -documentation = "https://docs.rs/flock" +documentation = "https://docs.rs/fs-lock" version = "0.0.0" rust-version = "1.61.0" authors = ["Jiahao XU "] diff --git a/crates/flock/LICENSE-APACHE b/crates/fs-lock/LICENSE-APACHE similarity index 100% rename from crates/flock/LICENSE-APACHE rename to crates/fs-lock/LICENSE-APACHE diff --git a/crates/flock/LICENSE-MIT b/crates/fs-lock/LICENSE-MIT similarity index 100% rename from crates/flock/LICENSE-MIT rename to crates/fs-lock/LICENSE-MIT diff --git a/crates/flock/src/lib.rs b/crates/fs-lock/src/lib.rs similarity index 100% rename from crates/flock/src/lib.rs rename to crates/fs-lock/src/lib.rs diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index 1905aec9..896c502b 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -20,7 +20,7 @@ crates_io_api = { version = "0.8.0", default-features = false } detect-targets = { version = "0.1.0", path = "../detect-targets" } digest = "0.10.3" flate2 = { version = "1.0.24", default-features = false } -flock = { version = "0.0.0", path = "../flock" } +fs-lock = { version = "0.0.0", path = "../fs-lock" } futures-util = { version = "0.3.23", default-features = false, features = ["std"] } generic-array = "0.14.6" home = "0.5.3" diff --git a/crates/lib/src/fetchers/gh_crate_meta.rs b/crates/lib/src/fetchers/gh_crate_meta.rs index dea1877e..eb36b6e9 100644 --- a/crates/lib/src/fetchers/gh_crate_meta.rs +++ b/crates/lib/src/fetchers/gh_crate_meta.rs @@ -143,7 +143,7 @@ impl super::Fetcher for GhCrateMeta { } async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { - let (url, pkg_fmt) = self.resolution.get().unwrap(); // find() is called first + let (url, _pkg_fmt) = self.resolution.get().unwrap(); // find() is called first debug!("Downloading package from: '{url}'"); Download::new(self.client.clone(), url.clone()) .and_extract(self.pkg_fmt(), dst) diff --git a/crates/lib/src/manifests/binstall_crates_v1.rs b/crates/lib/src/manifests/binstall_crates_v1.rs index 78b9ab02..c343bc23 100644 --- a/crates/lib/src/manifests/binstall_crates_v1.rs +++ b/crates/lib/src/manifests/binstall_crates_v1.rs @@ -14,7 +14,7 @@ use std::{ path::{Path, PathBuf}, }; -use flock::FileLock; +use fs_lock::FileLock; use miette::Diagnostic; use serde::Serialize; use thiserror::Error; diff --git a/crates/lib/src/manifests/cargo_crates_v1.rs b/crates/lib/src/manifests/cargo_crates_v1.rs index 2f9b8296..5b2ca110 100644 --- a/crates/lib/src/manifests/cargo_crates_v1.rs +++ b/crates/lib/src/manifests/cargo_crates_v1.rs @@ -16,7 +16,7 @@ use std::{ }; use compact_str::CompactString; -use flock::FileLock; +use fs_lock::FileLock; use miette::Diagnostic; use serde::{Deserialize, Serialize}; use thiserror::Error; From eb93eafb9d92765b94b1aed78a38786a200c4cfb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 4 Sep 2022 16:04:52 +0000 Subject: [PATCH 0719/2020] release: fs-lock v0.1.0 (#339) Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/fs-lock/Cargo.toml | 2 +- crates/lib/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 23732f54..dd571e99 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -563,7 +563,7 @@ dependencies = [ [[package]] name = "fs-lock" -version = "0.0.0" +version = "0.1.0" dependencies = [ "fs4", ] diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 2e84efcc..0ac904b1 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -3,7 +3,7 @@ name = "fs-lock" description = "Locked files that can be used like normal File" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/fs-lock" -version = "0.0.0" +version = "0.1.0" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index 896c502b..92eb586c 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -20,7 +20,7 @@ crates_io_api = { version = "0.8.0", default-features = false } detect-targets = { version = "0.1.0", path = "../detect-targets" } digest = "0.10.3" flate2 = { version = "1.0.24", default-features = false } -fs-lock = { version = "0.0.0", path = "../fs-lock" } +fs-lock = { version = "0.1.0", path = "../fs-lock" } futures-util = { version = "0.3.23", default-features = false, features = ["std"] } generic-array = "0.14.6" home = "0.5.3" From 73f7719e530b833502b1d583f7905c59e80a5efa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Mon, 5 Sep 2022 15:12:56 +1200 Subject: [PATCH 0720/2020] Recommend taiki-e/install-action (#342) See #309 --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index cfa6930c..a5237915 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,8 @@ $ binstall \ functionally a replacement for `curl ... | bash` or `wget`-ing the same files, so, things can be improved but it's also fairly moot - What do the error codes mean? - You can find a full description of errors including exit codes here: +- Can I use it in CI? + - Yes! For GitHub Actions, we recommend the excellent [taiki-e/install-action](https://github.com/marketplace/actions/install-development-tools), which has explicit support for selected tools and uses `cargo-binstall` for everything else. --- From db82c6935f1f58b236dd5dc4f27b36c56d8c5a15 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Mon, 5 Sep 2022 16:18:14 +1200 Subject: [PATCH 0721/2020] Deprecate --secure, enforce HTTPS (#343) Resolves #124 --- .github/scripts/tests.sh | 2 -- crates/bin/src/args.rs | 11 ++--------- crates/bin/src/entry.rs | 2 +- crates/lib/src/helpers/remote.rs | 16 +++++----------- 4 files changed, 8 insertions(+), 23 deletions(-) diff --git a/.github/scripts/tests.sh b/.github/scripts/tests.sh index e5b47654..162c0e05 100755 --- a/.github/scripts/tests.sh +++ b/.github/scripts/tests.sh @@ -24,14 +24,12 @@ cargo binstall --help >/dev/null # Test that the installed binaries can be run cargo binstall --help >/dev/null -# Install binaries using secure mode min_tls=1.3 [[ "${2:-}" == "Windows" ]] && min_tls=1.2 # WinTLS on GHA doesn't support 1.3 yet "./$1" binstall \ --force \ --log-level debug \ - --secure \ --min-tls-version $min_tls \ --no-confirm \ cargo-binstall diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index aead6a6d..f1cd7cbd 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -113,15 +113,8 @@ pub struct Args { #[clap(help_heading = "Options", long)] pub install_path: Option, - /// Enforce downloads over secure transports only. - /// - /// Insecure HTTP downloads will be removed completely in the future; in the meantime this - /// option forces a fail when the remote endpoint uses plaintext HTTP or insecure TLS suites. - /// - /// Without this option, plain HTTP will warn. - /// - /// Implies `--min-tls-version=1.2`. - #[clap(help_heading = "Options", long)] + /// Deprecated, here for back-compat only. Secure is now on by default. + #[clap(hide(true), long)] pub secure: bool, /// Force a crate to be installed even if it is already installed. diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 290dc65a..68e017d3 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -32,7 +32,7 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien let desired_targets = get_desired_targets(args.targets.take()); // Initialize reqwest client - let client = create_reqwest_client(args.secure, args.min_tls_version.map(|v| v.into()))?; + let client = create_reqwest_client(args.min_tls_version.map(|v| v.into()))?; // Build crates.io api client let crates_io_api_client = crates_io_api::AsyncClient::new( diff --git a/crates/lib/src/helpers/remote.rs b/crates/lib/src/helpers/remote.rs index ddfdce82..95492cc0 100644 --- a/crates/lib/src/helpers/remote.rs +++ b/crates/lib/src/helpers/remote.rs @@ -8,19 +8,13 @@ use url::Url; use crate::errors::BinstallError; -pub fn create_reqwest_client( - secure: bool, - min_tls: Option, -) -> Result { +pub fn create_reqwest_client(min_tls: Option) -> Result { const USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")); - let mut builder = ClientBuilder::new().user_agent(USER_AGENT); - - if secure { - builder = builder - .https_only(true) - .min_tls_version(tls::Version::TLS_1_2); - } + let mut builder = ClientBuilder::new() + .user_agent(USER_AGENT) + .https_only(true) + .min_tls_version(tls::Version::TLS_1_2); if let Some(ver) = min_tls { builder = builder.min_tls_version(ver); From 9b405fc03f19450d4ca76ee0de9dfd5a5323d591 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 5 Sep 2022 04:37:14 +0000 Subject: [PATCH 0722/2020] release: detect-targets v0.1.1 (#344) Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/detect-targets/Cargo.toml | 2 +- crates/lib/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dd571e99..2c7fd499 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -380,7 +380,7 @@ checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" [[package]] name = "detect-targets" -version = "0.1.0" +version = "0.1.1" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index e389b996..6da0416e 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-target" -version = "0.1.0" +version = "0.1.1" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index 92eb586c..b2787745 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -17,7 +17,7 @@ cargo_toml = "0.11.5" clap = { version = "3.2.17", features = ["derive"] } compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.0", default-features = false } -detect-targets = { version = "0.1.0", path = "../detect-targets" } +detect-targets = { version = "0.1.1", path = "../detect-targets" } digest = "0.10.3" flate2 = { version = "1.0.24", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } From 4885cfbb8855e45f8419b7a12865c2abacbd9a03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Mon, 5 Sep 2022 16:47:20 +1200 Subject: [PATCH 0723/2020] Add important usage note for triggering builds to release template (#345) --- .github/scripts/release-pr-template.ejs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/.github/scripts/release-pr-template.ejs b/.github/scripts/release-pr-template.ejs index aefae9a8..5157379b 100644 --- a/.github/scripts/release-pr-template.ejs +++ b/.github/scripts/release-pr-template.ejs @@ -19,18 +19,28 @@ This is a release PR for **<%= crate.name %>** version **<%= version.actual %>** <% } %> <% if (crate.name == "cargo-binstall") { %> -Upon merging, this will automatically build the CLI and create a GitHub release. -<% } else { %> -Upon merging, this will create the tag `<%= crate.name %>-<%= version.actual %>`. -<% } %> - +Upon merging, this will automatically create the tag `v<%= version.actual %>`, build the CLI, and create a GitHub release. You will still need to manually publish the cargo crate: ``` +$ git switch main $ git pull -$ git switch --detach <%= crate.name %>-<%= version.actual %> +$ git switch --detach v<%= version.actual %> $ cargo publish -p <%= crate.name %> ``` +<% } else { %> +Upon merging, this will create the tag `<%= crate.name %>-v<%= version.actual %>`. +You will still need to manually publish the cargo crate: + +``` +$ git switch main +$ git pull +$ git switch --detach <%= crate.name %>-v<%= version.actual %> +$ cargo publish -p <%= crate.name %> +``` +<% } %> + +**To trigger builds initially, close and then immediately re-open this PR once.** <% if (pr.releaseNotes) { %> --- From 02df44592641f4d99d2cd72b9827cc7b3c0799ba Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 5 Sep 2022 15:00:36 +1000 Subject: [PATCH 0724/2020] Fix `documentation` field in `detect-targets/Cargo.toml` (#346) Signed-off-by: Jiahao XU --- crates/detect-targets/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 6da0416e..4d0016e4 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -2,7 +2,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" -documentation = "https://docs.rs/detect-target" +documentation = "https://docs.rs/detect-targets" version = "0.1.1" rust-version = "1.61.0" authors = ["Jiahao XU "] From e7d2eb1aefa26405920adbb7e826eb777cebb0ca Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 5 Sep 2022 05:14:07 +0000 Subject: [PATCH 0725/2020] release: detect-targets v0.1.2 (#347) (cargo-release) version 0.1.2 Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/detect-targets/Cargo.toml | 2 +- crates/lib/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2c7fd499..9cca1793 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -380,7 +380,7 @@ checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" [[package]] name = "detect-targets" -version = "0.1.1" +version = "0.1.2" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 4d0016e4..2ffeec10 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.1" +version = "0.1.2" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index b2787745..3f093a7f 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -17,7 +17,7 @@ cargo_toml = "0.11.5" clap = { version = "3.2.17", features = ["derive"] } compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.0", default-features = false } -detect-targets = { version = "0.1.1", path = "../detect-targets" } +detect-targets = { version = "0.1.2", path = "../detect-targets" } digest = "0.10.3" flate2 = { version = "1.0.24", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } From f7ad78288be81f9f3769d8a9ab3c397dd29f4ab8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 6 Sep 2022 14:52:05 +1000 Subject: [PATCH 0726/2020] Reuse reqwest client in `crates_io_api::AsyncClient` (#349) --- Cargo.lock | 246 +++++++++++++++++++++------------------- crates/bin/Cargo.toml | 2 +- crates/bin/src/entry.rs | 7 +- crates/lib/Cargo.toml | 2 +- 4 files changed, 132 insertions(+), 125 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9cca1793..e993bae4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,9 +19,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aho-corasick" -version = "0.7.18" +version = "0.7.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" +checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" dependencies = [ "memchr", ] @@ -129,18 +129,18 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "block-buffer" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf7fe51849ea569fd452f37822f606a5cabb684dc918707a0193fd4664ff324" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ "generic-array", ] [[package]] name = "bumpalo" -version = "3.10.0" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" +checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" [[package]] name = "byteorder" @@ -231,9 +231,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" dependencies = [ "num-integer", "num-traits", @@ -242,9 +242,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.17" +version = "3.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29e724a68d9319343bb3328c9cc2dfde263f4b3142ee1059a9980580171c954b" +checksum = "23b71c3ce99b7611011217b366d923f1d0a7e07a92bb2dbf1e84508c673ca3bd" dependencies = [ "atty", "bitflags", @@ -259,9 +259,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "3.2.17" +version = "3.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13547f7012c01ab4a0e8f8967730ada8f9fdf419e8b6c792788f39cf4e46eefa" +checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" dependencies = [ "heck", "proc-macro-error", @@ -290,9 +290,9 @@ dependencies = [ [[package]] name = "combine" -version = "4.6.4" +version = "4.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a604e93b79d1808327a6fca85a6f2d69de66461e7620f5a4cbf5fb4d1d7c948" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" dependencies = [ "bytes", "memchr", @@ -300,9 +300,9 @@ dependencies = [ [[package]] name = "compact_str" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe793f2e4f8b2b8295ea7dfd141260c0a5c9f6d25c91bde42efed76a47e0bfe" +checksum = "5138945395949e7dfba09646dc9e766b548ff48e23deb5246890e6b64ae9e1b9" dependencies = [ "castaway", "itoa", @@ -328,9 +328,9 @@ checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "crates_io_api" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f8072e3f4581325ee6c8e3c900099b303924a9c592ab4d23bb87ee5bdc6f7b" +checksum = "9fdfaac64c5eb7a33a5b895ffbaf6f1146721b6cd4c889010d19c8a1c1cae562" dependencies = [ "chrono", "futures", @@ -339,6 +339,7 @@ dependencies = [ "serde", "serde_derive", "serde_json", + "serde_path_to_error", "tokio", "url", ] @@ -426,9 +427,9 @@ dependencies = [ [[package]] name = "either" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" +checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "embed-resource" @@ -500,9 +501,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" dependencies = [ "instant", ] @@ -581,9 +582,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" +checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" dependencies = [ "futures-channel", "futures-core", @@ -596,9 +597,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bfc52cbddcfd745bf1740338492bb0bd83d76c67b445f91c5fb29fae29ecaa1" +checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" dependencies = [ "futures-core", "futures-sink", @@ -606,15 +607,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2acedae88d38235936c3922476b10fced7b2b68136f5e3c03c2d5be348a1115" +checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" [[package]] name = "futures-executor" -version = "0.3.21" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" dependencies = [ "futures-core", "futures-task", @@ -623,15 +624,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93a66fc6d035a26a3ae255a6d2bca35eda63ae4c5512bef54449113f7a1228e5" +checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" [[package]] name = "futures-macro" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0db9cce532b0eae2ccf2766ab246f114b56b9cf6d445e00c2549fbc100ca045d" +checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" dependencies = [ "proc-macro2", "quote", @@ -640,21 +641,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0bae1fe9752cf7fd9b0064c674ae63f97b37bc714d745cbde0afb7ec4e6765" +checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" [[package]] name = "futures-task" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "842fc63b931f4056a24d59de13fb1272134ce261816e063e634ad0c15cdc5306" +checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" [[package]] name = "futures-util" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0828a5471e340229c11c77ca80017937ce3c58cb788a17e5f1c2d5c485a9577" +checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" dependencies = [ "futures-channel", "futures-core", @@ -709,9 +710,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37a82c6d637fc9515a4694bbf1cb2457b79d81ce52b3108bdeea58b07dd34a57" +checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" dependencies = [ "bytes", "fnv", @@ -791,9 +792,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "496ce29bb5a52785b44e0f7ca2847ae0bb839c9bd28f69acac9b99d461c0c04c" +checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" [[package]] name = "httpdate" @@ -889,9 +890,9 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24c3f4eff5495aee4c0399d7b6a0dc2b6e81be84242ffbfcf253ebacccc1d0cb" +checksum = "1ea37f355c05dde75b84bba2d767906ad522e97cd9e2eef2be7a4ab7fb442c06" [[package]] name = "ipconfig" @@ -928,9 +929,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "112c678d4050afce233f4f2852bb2eb519230b3cf12f33585275537d7e41578d" +checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" [[package]] name = "jobserver" @@ -943,9 +944,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.58" +version = "0.3.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" +checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" dependencies = [ "wasm-bindgen", ] @@ -958,9 +959,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.126" +version = "0.2.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" [[package]] name = "libmimalloc-sys" @@ -995,9 +996,9 @@ checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" [[package]] name = "lock_api" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327fa5b6a6940e4699ec49a9beae1ea4845c6bab9314e4f84ac68742139d8c53" +checksum = "9f80bf5aacaf25cbfc8210d1cfb718f2bf3b11c4c54e5afe36c236853a8ec390" dependencies = [ "autocfg", "scopeguard", @@ -1098,9 +1099,9 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "miniz_oxide" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f5c75688da582b8ffc1f1799e9db273f32133c49e048f614d22ec3256773ccc" +checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" dependencies = [ "adler", ] @@ -1188,9 +1189,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.13.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18a6dbe30758c9f83eb00cbea4ac95966305f5a7772f3f42ebfc7fc7eddbd8e1" +checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" [[package]] name = "openssl" @@ -1239,15 +1240,15 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.2.0" +version = "6.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "648001efe5d5c0102d8cea768e348da85d90af8ba91f0bea908f157951493cd4" +checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" [[package]] name = "owo-colors" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "decf7381921fea4dcb2549c5667eda59b3ec297ab7e2b5fc33eac69d2e7da87b" +checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" [[package]] name = "parking_lot" @@ -1328,9 +1329,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.40" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd96a1e8ed2596c337f8eae5f24924ec83f5ad5ab21ea8e455d3566c69fbcaf7" +checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" dependencies = [ "unicode-ident", ] @@ -1343,9 +1344,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bcdf212e9776fbcb2d23ab029360416bb1706b1aea2d1a5ba002727cbcab804" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] @@ -1382,9 +1383,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534cfe58d6a18cc17120fbf4635d53d14691c1fe4d951064df9bd326178d7d5a" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags", ] @@ -1452,7 +1453,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls", - "rustls-pemfile 1.0.0", + "rustls-pemfile 1.0.1", "serde", "serde_json", "serde_urlencoded", @@ -1512,9 +1513,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.35.7" +version = "0.35.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51cc38aa10f6bbb377ed28197aa052aa4e2b762c22be9d3153d01822587e787" +checksum = "72c825b8aa8010eb9ee99b75f05e10180b9278d161583034d7574c9d617aeada" dependencies = [ "bitflags", "errno", @@ -1547,24 +1548,24 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7522c9de787ff061458fe9a829dc790a3f5b22dc571694fc5883f448b94d9a9" +checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" dependencies = [ "base64", ] [[package]] name = "rustversion" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24c8ad4f0c00e1eb5bc7614d236a7f1300e3dbd76b68cac8e06fb00b015ad8d8" +checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" [[package]] name = "ryu" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" [[package]] name = "schannel" @@ -1594,9 +1595,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.6.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dc14f172faf8a0194a3aded622712b0de276821addc574fa54fc0a1167e10dc" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" dependencies = [ "bitflags", "core-foundation", @@ -1626,9 +1627,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.143" +version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53e8e5d5b70924f74ff5c6d64d9a5acd91422117c60f48c4e07855238a254553" +checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" dependencies = [ "serde_derive", ] @@ -1644,9 +1645,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.143" +version = "1.0.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3d8e8de557aee63c26b85b947f5e59b690d0454c753f3adeb5cd7835ab88391" +checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" dependencies = [ "proc-macro2", "quote", @@ -1655,15 +1656,24 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.83" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38dd04e3c8279e75b31ef29dbdceebfe5ad89f4d0937213c53f7d49d01b3d5a7" +checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" dependencies = [ "itoa", "ryu", "serde", ] +[[package]] +name = "serde_path_to_error" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "184c643044780f7ceb59104cef98a5a6f12cb2288a7bc701ab93a362b49fd47d" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -1719,9 +1729,9 @@ checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" [[package]] name = "socket2" -version = "0.4.4" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66d72b759436ae32898a2af0a14218dbf55efde3feeb170eb623637db85ee1e0" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", "winapi", @@ -1788,9 +1798,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.98" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c50aef8a904de4c23c788f104b7dddc7d6f79c647c7c8ce4cc8f73eb0ca773dd" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" dependencies = [ "proc-macro2", "quote", @@ -1854,18 +1864,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.32" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" +checksum = "8c1b05ca9d106ba7d2e31a9dab4a64e7be2cce415321966ea3132c49a656e252" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.32" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" +checksum = "e8f2591983642de85c921015f3f070c665a197ed69e417af436115e3a1407487" dependencies = [ "proc-macro2", "quote", @@ -1874,9 +1884,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.11" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217" +checksum = "3c3f9a28b618c3a6b9251b6908e9c99e04b9e5c02e6581ccbb67d59c34ef7f9b" dependencies = [ "itoa", "libc", @@ -1917,9 +1927,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.20.1" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581" +checksum = "89797afd69d206ccd11fb0ea560a44bbb87731d020670e79416d442919257d42" dependencies = [ "autocfg", "bytes", @@ -2010,9 +2020,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.35" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" +checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" dependencies = [ "cfg-if", "pin-project-lite", @@ -2021,9 +2031,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b7358be39f2f274f322d2aaed611acc57f382e8eb1e5b48cb9ae30933495ce7" +checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" dependencies = [ "once_cell", ] @@ -2108,9 +2118,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c61ba63f9235225a22310255a29b806b907c9b8c964bcbd0a2c70f3f2deea7" +checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" [[package]] name = "unicode-linebreak" @@ -2205,9 +2215,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.81" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" +checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2215,13 +2225,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.81" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" +checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", "syn", @@ -2230,9 +2240,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.31" +version = "0.4.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de9a9cec1733468a8c657e57fa2413d2ae2c0129b95e87c5b72b8ace4d13f31f" +checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" dependencies = [ "cfg-if", "js-sys", @@ -2242,9 +2252,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.81" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" +checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2252,9 +2262,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.81" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" +checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" dependencies = [ "proc-macro2", "quote", @@ -2265,15 +2275,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.81" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" +checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" [[package]] name = "web-sys" -version = "0.3.58" +version = "0.3.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" +checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" dependencies = [ "js-sys", "wasm-bindgen", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 4401d01b..f9500da6 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -20,7 +20,7 @@ pkg-fmt = "zip" [dependencies] binstall = { path = "../lib", version = "0.0.0" } clap = { version = "3.2.17", features = ["derive"] } -crates_io_api = { version = "0.8.0", default-features = false } +crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" miette = "5.3.0" diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 68e017d3..e97853fe 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -35,11 +35,8 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien let client = create_reqwest_client(args.min_tls_version.map(|v| v.into()))?; // Build crates.io api client - let crates_io_api_client = crates_io_api::AsyncClient::new( - "cargo-binstall (https://github.com/ryankurte/cargo-binstall)", - Duration::from_millis(100), - ) - .expect("bug: invalid user agent"); + let crates_io_api_client = + crates_io_api::AsyncClient::with_http_client(client.clone(), Duration::from_millis(100)); // Initialize UI thread let mut uithread = UIThread::new(!args.no_confirm); diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index 3f093a7f..679f2bb9 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -16,7 +16,7 @@ bzip2 = "0.4.3" cargo_toml = "0.11.5" clap = { version = "3.2.17", features = ["derive"] } compact_str = { version = "0.6.0", features = ["serde"] } -crates_io_api = { version = "0.8.0", default-features = false } +crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.2", path = "../detect-targets" } digest = "0.10.3" flate2 = { version = "1.0.24", default-features = false } From bcec382a649ba827a87d3093dbaf711fb9160084 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Wed, 7 Sep 2022 19:40:46 +1200 Subject: [PATCH 0727/2020] Improve release-pr usage (#350) --- .github/workflows/release-pr.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index d7066ed3..c80ac27f 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -17,20 +17,23 @@ on: description: Version to release required: true type: string + default: patch jobs: make-release-pr: + permissions: + id-token: write # Enable OIDC + pull-requests: write + contents: write runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 + - uses: chainguard-dev/actions/setup-gitsign@main - name: Install cargo-release uses: taiki-e/install-action@v1 with: tool: cargo-release - - uses: actions/checkout@v3 - with: - ref: main - - uses: cargo-bins/release-pr@v1 with: github-token: ${{ secrets.GITHUB_TOKEN }} From 23daef610b2d78c162683d3f6a4041d5d76123ac Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 7 Sep 2022 18:46:25 +1000 Subject: [PATCH 0728/2020] Fix `.github/scripts/tests.sh`: Fix testing for ugprading (#352) Signed-off-by: Jiahao XU Signed-off-by: Jiahao XU --- .github/scripts/tests.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/scripts/tests.sh b/.github/scripts/tests.sh index 162c0e05..98dbf9b9 100755 --- a/.github/scripts/tests.sh +++ b/.github/scripts/tests.sh @@ -53,9 +53,9 @@ cargo binstall --help >/dev/null "./$1" binstall --no-confirm cargo-binstall@0.10.0 | grep -q -v 'cargo-binstall v0.10.0 is already installed' ## Test When 0.11.0 is installed but can be upgraded. -"./$1" binstall --no-confirm cargo-binstall@0.11.0 -"./$1" binstall --no-confirm cargo-binstall@0.11.0 | grep -q 'cargo-binstall v0.11.0 is already installed' -"./$1" binstall --no-confirm cargo-binstall@^0.11.0 | grep -q -v 'cargo-binstall v0.11.0 is already installed' +"./$1" binstall --no-confirm cargo-binstall@0.12.0 +"./$1" binstall --no-confirm cargo-binstall@0.12.0 | grep -q 'cargo-binstall v0.12.0 is already installed' +"./$1" binstall --no-confirm cargo-binstall@^0.12.0 | grep -q -v 'cargo-binstall v0.12.0 is already installed' # Test default GitLab pkg-url templates test_resources=".github/scripts" From e24b2ce1e3d2ed0ea94db5eb92dd5cfb8205dc8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Fri, 9 Sep 2022 18:06:05 +1200 Subject: [PATCH 0729/2020] Disable zlib-ng for the default cargo-install build (#354) but explicitly enable it in our own builds. This is because using zlib-ng sometimes does not compile easily on Windows, and using the pure miniz_oxide offers a better install story from source. For our binary builds, we can provide the optimal performance, and still do that for most users as they will update with cargo-binstall, getting our build as a second pass. --- .github/scripts/compile-settings.jq | 2 +- crates/bin/Cargo.toml | 2 +- crates/lib/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/scripts/compile-settings.jq b/.github/scripts/compile-settings.jq index aa0e37f0..6155b24b 100644 --- a/.github/scripts/compile-settings.jq +++ b/.github/scripts/compile-settings.jq @@ -4,7 +4,7 @@ if $for_release then { # Use build-std to build a std library optimized for size and abort immediately on abort, # so that format string for `unwrap`/`expect`/`unreachable`/`panic` can be optimized out. args: ($matrix.release_build_args // "-Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort"), - features: ($matrix.release_features // []), + features: ($matrix.release_features // ["zlib-ng", "static", "rustls", "trust-dns", "fancy-no-backtrace"]), } else { output: "debug", profile: "dev", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index f9500da6..182b92f4 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -35,7 +35,7 @@ tokio = { version = "1.20.1", features = ["rt-multi-thread"], default-features = embed-resource = "1.7.3" [features] -default = ["static", "zlib-ng", "rustls", "trust-dns", "fancy-no-backtrace"] +default = ["static", "rustls", "trust-dns", "fancy-no-backtrace"] mimalloc = ["dep:mimalloc"] diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index 679f2bb9..7a800d77 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -65,7 +65,7 @@ zstd = { version = "0.10.0", default-features = false } env_logger = "0.9.0" [features] -default = ["static", "zlib-ng", "rustls"] +default = ["static", "rustls"] static = ["bzip2/static", "xz2/static"] pkg-config = ["zstd/pkg-config"] From 56bafc8c9b215fbfc94d538a86b2f6bbb3fca60c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Fri, 9 Sep 2022 20:27:54 +1200 Subject: [PATCH 0730/2020] Add install recommendation to readme (#351) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index a5237915..550bd524 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ To support `binstall` maintainers must add configuration values to `Cargo.toml` ## Installation -To get started _using_ `cargo-binstall` first install the binary (either via `cargo install cargo-binstall` or by downloading a pre-compiled [release](https://github.com/cargo-bins/cargo-binstall/releases)). +To get started _using_ `cargo-binstall` first install the binary (either via `cargo install cargo-binstall` or by downloading a pre-compiled [release](https://github.com/cargo-bins/cargo-binstall/releases)). We recommend using the pre-compiled ones because we optimise those more than a standard source build does. | OS | Arch | URL | | ------- | ------- | ------------------------------------------------------------ | From 32c3154abbc7e9ce574f9ca216cff167d8660b88 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 9 Sep 2022 18:46:43 +1000 Subject: [PATCH 0731/2020] Replace dep `jobserver` with `jobslot` (#355) Signed-off-by: Jiahao XU --- Cargo.lock | 14 +++++++++++++- crates/lib/Cargo.toml | 2 +- crates/lib/src/helpers/jobserver_client.rs | 2 +- crates/lib/src/ops/install.rs | 9 ++++----- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e993bae4..b9e7d200 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,7 +95,7 @@ dependencies = [ "generic-array", "home", "itertools", - "jobserver", + "jobslot", "log", "miette", "normalize-path", @@ -942,6 +942,18 @@ dependencies = [ "libc", ] +[[package]] +name = "jobslot" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0478230fe7c53cb89765785904f3cd9a1fb95f7d3261c343fe3248627e6060" +dependencies = [ + "cfg-if", + "libc", + "scopeguard", + "tokio", +] + [[package]] name = "js-sys" version = "0.3.59" diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index 7a800d77..c65d40b2 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -25,7 +25,7 @@ futures-util = { version = "0.3.23", default-features = false, features = ["std" generic-array = "0.14.6" home = "0.5.3" itertools = "0.10.3" -jobserver = "0.1.24" +jobslot = { version = "0.2.1", features = ["tokio"] } log = { version = "0.4.17", features = ["std"] } miette = "5.3.0" normalize-path = { version = "0.1.0", path = "../normalize-path" } diff --git a/crates/lib/src/helpers/jobserver_client.rs b/crates/lib/src/helpers/jobserver_client.rs index acfbc6c5..ca65fcd4 100644 --- a/crates/lib/src/helpers/jobserver_client.rs +++ b/crates/lib/src/helpers/jobserver_client.rs @@ -1,6 +1,6 @@ use std::{num::NonZeroUsize, sync::Arc, thread::available_parallelism}; -use jobserver::Client; +use jobslot::Client; use tokio::sync::OnceCell; use crate::errors::BinstallError; diff --git a/crates/lib/src/ops/install.rs b/crates/lib/src/ops/install.rs index 6632c50b..582bbc42 100644 --- a/crates/lib/src/ops/install.rs +++ b/crates/lib/src/ops/install.rs @@ -1,4 +1,4 @@ -use std::{path::PathBuf, process, sync::Arc}; +use std::{path::PathBuf, sync::Arc}; use cargo_toml::Package; use compact_str::CompactString; @@ -151,10 +151,8 @@ async fn install_from_source( "Running `cargo install {} --version {} --target {target}`", package.name, package.version ); - let mut command = process::Command::new("cargo"); - jobserver_client.configure(&mut command); - let mut cmd = Command::from(command); + let mut cmd = Command::new("cargo"); cmd.arg("install") .arg(package.name) @@ -173,7 +171,8 @@ async fn install_from_source( let command_string = format!("{:?}", cmd); - let mut child = cmd.spawn()?; + let mut child = jobserver_client.configure_and_run(&mut cmd, |cmd| cmd.spawn())?; + debug!("Spawned command pid={:?}", child.id()); let status = child.wait().await?; From 0c6687455f85bb9b98571b63147449caff23553d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 10 Sep 2022 17:32:55 +1200 Subject: [PATCH 0732/2020] Trim trailing slash from repo (#360) --- crates/lib/src/fetchers/gh_crate_meta.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/lib/src/fetchers/gh_crate_meta.rs b/crates/lib/src/fetchers/gh_crate_meta.rs index eb36b6e9..cc10406c 100644 --- a/crates/lib/src/fetchers/gh_crate_meta.rs +++ b/crates/lib/src/fetchers/gh_crate_meta.rs @@ -116,7 +116,7 @@ impl super::Fetcher for GhCrateMeta { return Ok(false); }; - let repo = repo.as_ref().map(Url::as_str); + let repo = repo.as_ref().map(|u| u.as_str().trim_end_matches('/')); let launch_baseline_find_tasks = |pkg_fmt| { pkg_urls .iter() From a94d83f0d56e7e355b9bc44923860500253fc0e3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 10 Sep 2022 16:06:22 +1000 Subject: [PATCH 0733/2020] Fix `tar` by temporarily using a fork (#358) Signed-off-by: Jiahao XU --- Cargo.lock | 24 ++++++++++++------------ crates/lib/Cargo.toml | 6 +++++- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b9e7d200..e41a4558 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -80,6 +80,7 @@ name = "binstall" version = "0.0.0" dependencies = [ "async-trait", + "binstall-tar", "bytes", "bzip2", "cargo_toml", @@ -108,7 +109,6 @@ dependencies = [ "serde_json", "strum", "strum_macros", - "tar", "tempfile", "thiserror", "tinytemplate", @@ -121,6 +121,17 @@ dependencies = [ "zstd", ] +[[package]] +name = "binstall-tar" +version = "0.4.39" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01db907e07c37309ea816c183ffe548daaa66ef640a291408f232d6ca4089dbb" +dependencies = [ + "filetime", + "libc", + "xattr", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -1819,17 +1830,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "tar" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" -dependencies = [ - "filetime", - "libc", - "xattr", -] - [[package]] name = "tempfile" version = "3.3.0" diff --git a/crates/lib/Cargo.toml b/crates/lib/Cargo.toml index c65d40b2..91fec39b 100644 --- a/crates/lib/Cargo.toml +++ b/crates/lib/Cargo.toml @@ -38,7 +38,11 @@ serde-tuple-vec-map = "1.0.1" serde_json = "1.0.83" strum = "0.24.1" strum_macros = "0.24.3" -tar = "0.4.38" +# Use a fork here since we need PAX support, but the upstream +# does not hav the PR merged yet. +# +#tar = "0.4.38" +tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.3.0" thiserror = "1.0.32" tinytemplate = "1.2.1" From e25aa50ec930d1f5b926d20842c8e717da93e79a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 10 Sep 2022 18:44:18 +1200 Subject: [PATCH 0734/2020] Rename lib to binstalk (#361) --- .github/dependabot.yml | 8 ++++---- Cargo.lock | 4 ++-- Cargo.toml | 2 +- crates/bin/Cargo.toml | 14 +++++++------- crates/bin/src/args.rs | 2 +- crates/bin/src/bin_util.rs | 4 ++-- crates/bin/src/entry.rs | 2 +- crates/bin/src/install_path.rs | 2 +- crates/bin/src/main.rs | 2 +- crates/bin/src/ui.rs | 2 +- crates/{lib => binstalk}/Cargo.toml | 6 +++--- crates/{lib => binstalk}/LICENSE | 0 crates/{lib => binstalk}/src/bins.rs | 0 crates/{lib => binstalk}/src/drivers.rs | 0 crates/{lib => binstalk}/src/drivers/crates_io.rs | 0 .../{lib => binstalk}/src/drivers/crates_io/vfs.rs | 0 .../src/drivers/crates_io/visitor.rs | 0 crates/{lib => binstalk}/src/drivers/version.rs | 0 crates/{lib => binstalk}/src/errors.rs | 0 crates/{lib => binstalk}/src/fetchers.rs | 0 .../src/fetchers/gh_crate_meta.rs | 0 .../src/fetchers/gh_crate_meta/hosting.rs | 0 .../{lib => binstalk}/src/fetchers/quickinstall.rs | 0 crates/{lib => binstalk}/src/fs.rs | 0 crates/{lib => binstalk}/src/helpers.rs | 0 crates/{lib => binstalk}/src/helpers/download.rs | 0 .../src/helpers/download/async_extracter.rs | 0 .../src/helpers/download/extracter.rs | 0 .../src/helpers/download/stream_readable.rs | 0 .../src/helpers/jobserver_client.rs | 0 crates/{lib => binstalk}/src/helpers/remote.rs | 0 crates/{lib => binstalk}/src/helpers/signal.rs | 0 crates/{lib => binstalk}/src/helpers/statics.rs | 0 crates/{lib => binstalk}/src/helpers/tasks.rs | 0 crates/{lib => binstalk}/src/lib.rs | 0 crates/{lib => binstalk}/src/manifests.rs | 0 .../src/manifests/binstall_crates_v1.rs | 0 .../src/manifests/cargo_crates_v1.rs | 0 .../cargo_crates_v1/crate_version_source.rs | 0 .../src/manifests/cargo_toml_binstall.rs | 0 .../cargo_toml_binstall/package_formats.rs | 0 .../{lib => binstalk}/src/manifests/crate_info.rs | 0 crates/{lib => binstalk}/src/ops.rs | 0 crates/{lib => binstalk}/src/ops/install.rs | 0 crates/{lib => binstalk}/src/ops/resolve.rs | 0 .../src/ops/resolve/crate_name.rs | 0 .../src/ops/resolve/version_ext.rs | 0 .../{lib => binstalk}/tests/parse-meta.Cargo.toml | 0 crates/{lib => binstalk}/tests/parse-meta.rs | 2 +- 49 files changed, 25 insertions(+), 25 deletions(-) rename crates/{lib => binstalk}/Cargo.toml (96%) rename crates/{lib => binstalk}/LICENSE (100%) rename crates/{lib => binstalk}/src/bins.rs (100%) rename crates/{lib => binstalk}/src/drivers.rs (100%) rename crates/{lib => binstalk}/src/drivers/crates_io.rs (100%) rename crates/{lib => binstalk}/src/drivers/crates_io/vfs.rs (100%) rename crates/{lib => binstalk}/src/drivers/crates_io/visitor.rs (100%) rename crates/{lib => binstalk}/src/drivers/version.rs (100%) rename crates/{lib => binstalk}/src/errors.rs (100%) rename crates/{lib => binstalk}/src/fetchers.rs (100%) rename crates/{lib => binstalk}/src/fetchers/gh_crate_meta.rs (100%) rename crates/{lib => binstalk}/src/fetchers/gh_crate_meta/hosting.rs (100%) rename crates/{lib => binstalk}/src/fetchers/quickinstall.rs (100%) rename crates/{lib => binstalk}/src/fs.rs (100%) rename crates/{lib => binstalk}/src/helpers.rs (100%) rename crates/{lib => binstalk}/src/helpers/download.rs (100%) rename crates/{lib => binstalk}/src/helpers/download/async_extracter.rs (100%) rename crates/{lib => binstalk}/src/helpers/download/extracter.rs (100%) rename crates/{lib => binstalk}/src/helpers/download/stream_readable.rs (100%) rename crates/{lib => binstalk}/src/helpers/jobserver_client.rs (100%) rename crates/{lib => binstalk}/src/helpers/remote.rs (100%) rename crates/{lib => binstalk}/src/helpers/signal.rs (100%) rename crates/{lib => binstalk}/src/helpers/statics.rs (100%) rename crates/{lib => binstalk}/src/helpers/tasks.rs (100%) rename crates/{lib => binstalk}/src/lib.rs (100%) rename crates/{lib => binstalk}/src/manifests.rs (100%) rename crates/{lib => binstalk}/src/manifests/binstall_crates_v1.rs (100%) rename crates/{lib => binstalk}/src/manifests/cargo_crates_v1.rs (100%) rename crates/{lib => binstalk}/src/manifests/cargo_crates_v1/crate_version_source.rs (100%) rename crates/{lib => binstalk}/src/manifests/cargo_toml_binstall.rs (100%) rename crates/{lib => binstalk}/src/manifests/cargo_toml_binstall/package_formats.rs (100%) rename crates/{lib => binstalk}/src/manifests/crate_info.rs (100%) rename crates/{lib => binstalk}/src/ops.rs (100%) rename crates/{lib => binstalk}/src/ops/install.rs (100%) rename crates/{lib => binstalk}/src/ops/resolve.rs (100%) rename crates/{lib => binstalk}/src/ops/resolve/crate_name.rs (100%) rename crates/{lib => binstalk}/src/ops/resolve/version_ext.rs (100%) rename crates/{lib => binstalk}/tests/parse-meta.Cargo.toml (100%) rename crates/{lib => binstalk}/tests/parse-meta.rs (95%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f0420247..a3c3b0d1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,6 +12,10 @@ updates: directory: "/crates/bin" schedule: interval: "daily" + - package-ecosystem: "cargo" + directory: "/crates/binstalk" + schedule: + interval: "daily" - package-ecosystem: "cargo" directory: "/crates/detect-wasi" schedule: @@ -20,10 +24,6 @@ updates: directory: "/crates/flock" schedule: interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/lib" - schedule: - interval: "daily" - package-ecosystem: "cargo" directory: "/crates/normalize-path" schedule: diff --git a/Cargo.lock b/Cargo.lock index e41a4558..0ab0f17f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -76,7 +76,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] -name = "binstall" +name = "binstalk" version = "0.0.0" dependencies = [ "async-trait", @@ -190,7 +190,7 @@ dependencies = [ name = "cargo-binstall" version = "0.12.0" dependencies = [ - "binstall", + "binstalk", "clap", "crates_io_api", "dirs", diff --git a/Cargo.toml b/Cargo.toml index d9372896..8f00a464 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [workspace] members = [ "crates/bin", - "crates/lib", + "crates/binstalk", "crates/detect-wasi", "crates/fs-lock", "crates/normalize-path", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 182b92f4..1efcad6e 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -18,7 +18,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstall = { path = "../lib", version = "0.0.0" } +binstalk = { path = "../binstalk", version = "0.0.0" } clap = { version = "3.2.17", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" @@ -39,15 +39,15 @@ default = ["static", "rustls", "trust-dns", "fancy-no-backtrace"] mimalloc = ["dep:mimalloc"] -static = ["binstall/static"] -pkg-config = ["binstall/pkg-config"] +static = ["binstalk/static"] +pkg-config = ["binstalk/pkg-config"] -zlib-ng = ["binstall/zlib-ng"] +zlib-ng = ["binstalk/zlib-ng"] -rustls = ["binstall/rustls"] -native-tls = ["binstall/native-tls"] +rustls = ["binstalk/rustls"] +native-tls = ["binstalk/native-tls"] -trust-dns = ["binstall/trust-dns"] +trust-dns = ["binstalk/trust-dns"] fancy-no-backtrace = ["miette/fancy-no-backtrace"] fancy-with-backtrace = ["fancy-no-backtrace", "miette/fancy"] diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index f1cd7cbd..af897419 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -1,6 +1,6 @@ use std::{ffi::OsString, path::PathBuf}; -use binstall::{ +use binstalk::{ errors::BinstallError, manifests::cargo_toml_binstall::PkgFmt, ops::resolve::{CrateName, VersionReqExt}, diff --git a/crates/bin/src/bin_util.rs b/crates/bin/src/bin_util.rs index 783d8419..7a85ad0b 100644 --- a/crates/bin/src/bin_util.rs +++ b/crates/bin/src/bin_util.rs @@ -4,8 +4,8 @@ use std::{ time::Duration, }; -use binstall::errors::BinstallError; -use binstall::helpers::{signal::cancel_on_user_sig_term, tasks::AutoAbortJoinHandle}; +use binstalk::errors::BinstallError; +use binstalk::helpers::{signal::cancel_on_user_sig_term, tasks::AutoAbortJoinHandle}; use log::{error, info}; use miette::Result; use tokio::runtime::Runtime; diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index e97853fe..e878bfeb 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -1,6 +1,6 @@ use std::{fs, path::Path, sync::Arc, time::Duration}; -use binstall::{ +use binstalk::{ errors::BinstallError, get_desired_targets, helpers::{ diff --git a/crates/bin/src/install_path.rs b/crates/bin/src/install_path.rs index a64f6260..a979ff77 100644 --- a/crates/bin/src/install_path.rs +++ b/crates/bin/src/install_path.rs @@ -3,7 +3,7 @@ use std::{ sync::Arc, }; -use binstall::helpers::statics::cargo_home; +use binstalk::helpers::statics::cargo_home; use log::debug; /// Fetch install path from environment diff --git a/crates/bin/src/main.rs b/crates/bin/src/main.rs index 374233de..d7312502 100644 --- a/crates/bin/src/main.rs +++ b/crates/bin/src/main.rs @@ -1,6 +1,6 @@ use std::time::Instant; -use binstall::helpers::jobserver_client::LazyJobserverClient; +use binstalk::helpers::jobserver_client::LazyJobserverClient; use log::debug; use cargo_binstall::{ diff --git a/crates/bin/src/ui.rs b/crates/bin/src/ui.rs index 889df09d..7e6e893a 100644 --- a/crates/bin/src/ui.rs +++ b/crates/bin/src/ui.rs @@ -7,7 +7,7 @@ use log::LevelFilter; use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; use tokio::sync::mpsc; -use binstall::errors::BinstallError; +use binstalk::errors::BinstallError; use crate::args::Args; diff --git a/crates/lib/Cargo.toml b/crates/binstalk/Cargo.toml similarity index 96% rename from crates/lib/Cargo.toml rename to crates/binstalk/Cargo.toml index 91fec39b..6a8ba3c7 100644 --- a/crates/lib/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -1,8 +1,8 @@ [package] -name = "binstall" -description = "Library backend for cargo-binstall" +name = "binstalk" +description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" -documentation = "https://docs.rs/binstall" +documentation = "https://docs.rs/binstalk" version = "0.0.0" rust-version = "1.61.0" authors = ["ryan "] diff --git a/crates/lib/LICENSE b/crates/binstalk/LICENSE similarity index 100% rename from crates/lib/LICENSE rename to crates/binstalk/LICENSE diff --git a/crates/lib/src/bins.rs b/crates/binstalk/src/bins.rs similarity index 100% rename from crates/lib/src/bins.rs rename to crates/binstalk/src/bins.rs diff --git a/crates/lib/src/drivers.rs b/crates/binstalk/src/drivers.rs similarity index 100% rename from crates/lib/src/drivers.rs rename to crates/binstalk/src/drivers.rs diff --git a/crates/lib/src/drivers/crates_io.rs b/crates/binstalk/src/drivers/crates_io.rs similarity index 100% rename from crates/lib/src/drivers/crates_io.rs rename to crates/binstalk/src/drivers/crates_io.rs diff --git a/crates/lib/src/drivers/crates_io/vfs.rs b/crates/binstalk/src/drivers/crates_io/vfs.rs similarity index 100% rename from crates/lib/src/drivers/crates_io/vfs.rs rename to crates/binstalk/src/drivers/crates_io/vfs.rs diff --git a/crates/lib/src/drivers/crates_io/visitor.rs b/crates/binstalk/src/drivers/crates_io/visitor.rs similarity index 100% rename from crates/lib/src/drivers/crates_io/visitor.rs rename to crates/binstalk/src/drivers/crates_io/visitor.rs diff --git a/crates/lib/src/drivers/version.rs b/crates/binstalk/src/drivers/version.rs similarity index 100% rename from crates/lib/src/drivers/version.rs rename to crates/binstalk/src/drivers/version.rs diff --git a/crates/lib/src/errors.rs b/crates/binstalk/src/errors.rs similarity index 100% rename from crates/lib/src/errors.rs rename to crates/binstalk/src/errors.rs diff --git a/crates/lib/src/fetchers.rs b/crates/binstalk/src/fetchers.rs similarity index 100% rename from crates/lib/src/fetchers.rs rename to crates/binstalk/src/fetchers.rs diff --git a/crates/lib/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs similarity index 100% rename from crates/lib/src/fetchers/gh_crate_meta.rs rename to crates/binstalk/src/fetchers/gh_crate_meta.rs diff --git a/crates/lib/src/fetchers/gh_crate_meta/hosting.rs b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs similarity index 100% rename from crates/lib/src/fetchers/gh_crate_meta/hosting.rs rename to crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs diff --git a/crates/lib/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs similarity index 100% rename from crates/lib/src/fetchers/quickinstall.rs rename to crates/binstalk/src/fetchers/quickinstall.rs diff --git a/crates/lib/src/fs.rs b/crates/binstalk/src/fs.rs similarity index 100% rename from crates/lib/src/fs.rs rename to crates/binstalk/src/fs.rs diff --git a/crates/lib/src/helpers.rs b/crates/binstalk/src/helpers.rs similarity index 100% rename from crates/lib/src/helpers.rs rename to crates/binstalk/src/helpers.rs diff --git a/crates/lib/src/helpers/download.rs b/crates/binstalk/src/helpers/download.rs similarity index 100% rename from crates/lib/src/helpers/download.rs rename to crates/binstalk/src/helpers/download.rs diff --git a/crates/lib/src/helpers/download/async_extracter.rs b/crates/binstalk/src/helpers/download/async_extracter.rs similarity index 100% rename from crates/lib/src/helpers/download/async_extracter.rs rename to crates/binstalk/src/helpers/download/async_extracter.rs diff --git a/crates/lib/src/helpers/download/extracter.rs b/crates/binstalk/src/helpers/download/extracter.rs similarity index 100% rename from crates/lib/src/helpers/download/extracter.rs rename to crates/binstalk/src/helpers/download/extracter.rs diff --git a/crates/lib/src/helpers/download/stream_readable.rs b/crates/binstalk/src/helpers/download/stream_readable.rs similarity index 100% rename from crates/lib/src/helpers/download/stream_readable.rs rename to crates/binstalk/src/helpers/download/stream_readable.rs diff --git a/crates/lib/src/helpers/jobserver_client.rs b/crates/binstalk/src/helpers/jobserver_client.rs similarity index 100% rename from crates/lib/src/helpers/jobserver_client.rs rename to crates/binstalk/src/helpers/jobserver_client.rs diff --git a/crates/lib/src/helpers/remote.rs b/crates/binstalk/src/helpers/remote.rs similarity index 100% rename from crates/lib/src/helpers/remote.rs rename to crates/binstalk/src/helpers/remote.rs diff --git a/crates/lib/src/helpers/signal.rs b/crates/binstalk/src/helpers/signal.rs similarity index 100% rename from crates/lib/src/helpers/signal.rs rename to crates/binstalk/src/helpers/signal.rs diff --git a/crates/lib/src/helpers/statics.rs b/crates/binstalk/src/helpers/statics.rs similarity index 100% rename from crates/lib/src/helpers/statics.rs rename to crates/binstalk/src/helpers/statics.rs diff --git a/crates/lib/src/helpers/tasks.rs b/crates/binstalk/src/helpers/tasks.rs similarity index 100% rename from crates/lib/src/helpers/tasks.rs rename to crates/binstalk/src/helpers/tasks.rs diff --git a/crates/lib/src/lib.rs b/crates/binstalk/src/lib.rs similarity index 100% rename from crates/lib/src/lib.rs rename to crates/binstalk/src/lib.rs diff --git a/crates/lib/src/manifests.rs b/crates/binstalk/src/manifests.rs similarity index 100% rename from crates/lib/src/manifests.rs rename to crates/binstalk/src/manifests.rs diff --git a/crates/lib/src/manifests/binstall_crates_v1.rs b/crates/binstalk/src/manifests/binstall_crates_v1.rs similarity index 100% rename from crates/lib/src/manifests/binstall_crates_v1.rs rename to crates/binstalk/src/manifests/binstall_crates_v1.rs diff --git a/crates/lib/src/manifests/cargo_crates_v1.rs b/crates/binstalk/src/manifests/cargo_crates_v1.rs similarity index 100% rename from crates/lib/src/manifests/cargo_crates_v1.rs rename to crates/binstalk/src/manifests/cargo_crates_v1.rs diff --git a/crates/lib/src/manifests/cargo_crates_v1/crate_version_source.rs b/crates/binstalk/src/manifests/cargo_crates_v1/crate_version_source.rs similarity index 100% rename from crates/lib/src/manifests/cargo_crates_v1/crate_version_source.rs rename to crates/binstalk/src/manifests/cargo_crates_v1/crate_version_source.rs diff --git a/crates/lib/src/manifests/cargo_toml_binstall.rs b/crates/binstalk/src/manifests/cargo_toml_binstall.rs similarity index 100% rename from crates/lib/src/manifests/cargo_toml_binstall.rs rename to crates/binstalk/src/manifests/cargo_toml_binstall.rs diff --git a/crates/lib/src/manifests/cargo_toml_binstall/package_formats.rs b/crates/binstalk/src/manifests/cargo_toml_binstall/package_formats.rs similarity index 100% rename from crates/lib/src/manifests/cargo_toml_binstall/package_formats.rs rename to crates/binstalk/src/manifests/cargo_toml_binstall/package_formats.rs diff --git a/crates/lib/src/manifests/crate_info.rs b/crates/binstalk/src/manifests/crate_info.rs similarity index 100% rename from crates/lib/src/manifests/crate_info.rs rename to crates/binstalk/src/manifests/crate_info.rs diff --git a/crates/lib/src/ops.rs b/crates/binstalk/src/ops.rs similarity index 100% rename from crates/lib/src/ops.rs rename to crates/binstalk/src/ops.rs diff --git a/crates/lib/src/ops/install.rs b/crates/binstalk/src/ops/install.rs similarity index 100% rename from crates/lib/src/ops/install.rs rename to crates/binstalk/src/ops/install.rs diff --git a/crates/lib/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs similarity index 100% rename from crates/lib/src/ops/resolve.rs rename to crates/binstalk/src/ops/resolve.rs diff --git a/crates/lib/src/ops/resolve/crate_name.rs b/crates/binstalk/src/ops/resolve/crate_name.rs similarity index 100% rename from crates/lib/src/ops/resolve/crate_name.rs rename to crates/binstalk/src/ops/resolve/crate_name.rs diff --git a/crates/lib/src/ops/resolve/version_ext.rs b/crates/binstalk/src/ops/resolve/version_ext.rs similarity index 100% rename from crates/lib/src/ops/resolve/version_ext.rs rename to crates/binstalk/src/ops/resolve/version_ext.rs diff --git a/crates/lib/tests/parse-meta.Cargo.toml b/crates/binstalk/tests/parse-meta.Cargo.toml similarity index 100% rename from crates/lib/tests/parse-meta.Cargo.toml rename to crates/binstalk/tests/parse-meta.Cargo.toml diff --git a/crates/lib/tests/parse-meta.rs b/crates/binstalk/tests/parse-meta.rs similarity index 95% rename from crates/lib/tests/parse-meta.rs rename to crates/binstalk/tests/parse-meta.rs index 4517943c..33ad6dff 100644 --- a/crates/lib/tests/parse-meta.rs +++ b/crates/binstalk/tests/parse-meta.rs @@ -1,4 +1,4 @@ -use binstall::ops::resolve::load_manifest_path; +use binstalk::ops::resolve::load_manifest_path; use cargo_toml::Product; #[test] From be8e83b8bd75e814c14bfb1173912e1d8151a170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 10 Sep 2022 18:56:33 +1200 Subject: [PATCH 0735/2020] Update release-pr config (#364) --- .github/workflows/release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index c80ac27f..82f14b21 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -8,7 +8,7 @@ on: type: choice options: - bin - - lib + - binstalk - detect-targets - detect-wasi - fs-lock From 22ac1cf5d30dcfb4047fff6e87095512b74f8414 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 10 Sep 2022 07:11:06 +0000 Subject: [PATCH 0736/2020] release: binstalk v0.1.0 (#365) Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0ab0f17f..dbd172a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,7 +77,7 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "binstalk" -version = "0.0.0" +version = "0.1.0" dependencies = [ "async-trait", "binstall-tar", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 1efcad6e..c8884340 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -18,7 +18,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.0.0" } +binstalk = { path = "../binstalk", version = "0.1.0" } clap = { version = "3.2.17", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 6a8ba3c7..af52c8d9 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.0.0" +version = "0.1.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From 037e62184fd69cfed953b659c38a347181582789 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 10 Sep 2022 11:07:41 +0000 Subject: [PATCH 0737/2020] release: cargo-binstall v0.13.0 (#366) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: github-actions Co-authored-by: Félix Saparelli --- .github/scripts/github-test-Cargo.toml | 15 +++++++++++++++ .github/scripts/tests.sh | 22 +++++++++++----------- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 5 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 .github/scripts/github-test-Cargo.toml diff --git a/.github/scripts/github-test-Cargo.toml b/.github/scripts/github-test-Cargo.toml new file mode 100644 index 00000000..c472a060 --- /dev/null +++ b/.github/scripts/github-test-Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "cargo-binstall" +description = "Rust binary package installer for CI integration" +repository = "https://github.com/cargo-bins/cargo-binstall" +version = "0.12.0" +rust-version = "1.61.0" +authors = ["ryan "] +edition = "2021" +license = "GPL-3.0" + +[package.metadata.binstall] +bin-dir = "{ bin }{ binary-ext }" + +[[bin]] +name = "cargo-binstall" diff --git a/.github/scripts/tests.sh b/.github/scripts/tests.sh index 98dbf9b9..40ee853c 100755 --- a/.github/scripts/tests.sh +++ b/.github/scripts/tests.sh @@ -2,28 +2,28 @@ set -euxo pipefail -bins="cargo-llvm-cov cargo-binstall" -test_bins="cargo-llvm-cov" - unset CARGO_INSTALL_ROOT unset CARGO_HOME # Install binaries using cargo-binstall # shellcheck disable=SC2086 -"./$1" binstall --log-level debug --no-confirm $bins +"./$1" binstall --log-level debug --no-confirm b3sum cargo-binstall # Test that the installed binaries can be run -for bin in $test_bins; do - "$HOME/.cargo/bin/$bin" --version -done +b3sum --version +cargo-binstall --help >/dev/null cargo binstall --help >/dev/null +test_resources=".github/scripts" + # Install binaries using `--manifest-path` -"./$1" binstall --force --log-level debug --manifest-path crates/bin/Cargo.toml --no-confirm cargo-binstall -"./$1" binstall --force --log-level debug --manifest-path crates/bin --no-confirm cargo-binstall +"./$1" binstall --force --log-level debug --manifest-path "$test_resources/gitlab-test-Cargo.toml" --no-confirm cargo-binstall # Test that the installed binaries can be run cargo binstall --help >/dev/null +# FIXME: test this some other way that is not dependent on the version being published! +# "./$1" binstall --force --log-level debug --manifest-path crates/bin --no-confirm cargo-binstall + min_tls=1.3 [[ "${2:-}" == "Windows" ]] && min_tls=1.2 # WinTLS on GHA doesn't support 1.3 yet @@ -57,8 +57,8 @@ cargo binstall --help >/dev/null "./$1" binstall --no-confirm cargo-binstall@0.12.0 | grep -q 'cargo-binstall v0.12.0 is already installed' "./$1" binstall --no-confirm cargo-binstall@^0.12.0 | grep -q -v 'cargo-binstall v0.12.0 is already installed' -# Test default GitLab pkg-url templates -test_resources=".github/scripts" +# to force failure if falling back to source +# FIXME: remove/replace once #136 lands PATH="$test_resources/fake-cargo:$PATH" "./$1" binstall \ diff --git a/Cargo.lock b/Cargo.lock index dbd172a7..03408042 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -188,7 +188,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.12.0" +version = "0.13.0" dependencies = [ "binstalk", "clap", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index c8884340..52299fc3 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/ryankurte/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.12.0" +version = "0.13.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index b7f74dd9..098c42d7 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From b89a4a56b8287448e44797f7121827440677ccef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 10 Sep 2022 23:46:15 +1200 Subject: [PATCH 0738/2020] Fix (remove) escaping for release blurb in release-pr template (#367) --- .github/scripts/release-pr-template.ejs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/scripts/release-pr-template.ejs b/.github/scripts/release-pr-template.ejs index 5157379b..0d99dfae 100644 --- a/.github/scripts/release-pr-template.ejs +++ b/.github/scripts/release-pr-template.ejs @@ -19,7 +19,7 @@ This is a release PR for **<%= crate.name %>** version **<%= version.actual %>** <% } %> <% if (crate.name == "cargo-binstall") { %> -Upon merging, this will automatically create the tag `v<%= version.actual %>`, build the CLI, and create a GitHub release. +Upon merging, this will automatically create the tag `v<%= version.actual %>`, build the CLI, and create a GitHub release with the release notes below. You will still need to manually publish the cargo crate: ``` @@ -50,7 +50,7 @@ _Edit release notes into the section below:_ ### Release notes -_Binstall is a tool to fetch and install Rust-based executables as binaries. It aims to be a drop-in replacement for \`cargo install\` in most cases. Install it today with \`cargo install cargo-binstall\`, from the binaries below, or if you already have it, upgrade with \`cargo binstall cargo-binstall\`._ +_Binstall is a tool to fetch and install Rust-based executables as binaries. It aims to be a drop-in replacement for `cargo install` in most cases. Install it today with `cargo install cargo-binstall`, from the binaries below, or if you already have it, upgrade with `cargo binstall cargo-binstall`._ #### In this release: From 9372ea4e53625c76189330d9c3b9ba4dbf3c7c6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 10 Sep 2022 23:59:41 +1200 Subject: [PATCH 0739/2020] Fix release script (#368) --- .github/scripts/pack-release-archives.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/scripts/pack-release-archives.sh b/.github/scripts/pack-release-archives.sh index d7d322bf..e79116f1 100755 --- a/.github/scripts/pack-release-archives.sh +++ b/.github/scripts/pack-release-archives.sh @@ -5,7 +5,6 @@ for o in outputs/*; do pushd "$o" chmod +x cargo-binstall* - cp ../../LICENSE.txt ../../README.md . target=$(basename "$o" | cut -d. -f1) if grep -qE '(apple|windows)' <<< "$target"; then From 62dc435e3adf9236606f56defc653bd993eae6e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 11 Sep 2022 00:07:19 +1200 Subject: [PATCH 0740/2020] Fix bin metadata (#369) --- crates/bin/Cargo.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 52299fc3..39d67ea9 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cargo-binstall" description = "Rust binary package installer for CI integration" -repository = "https://github.com/ryankurte/cargo-binstall" +repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" version = "0.13.0" rust-version = "1.61.0" @@ -9,7 +9,10 @@ authors = ["ryan "] edition = "2021" license = "GPL-3.0" +# These MUST remain even if they're not needed in recent versions because +# OLD versions use them to upgrade [package.metadata.binstall] +pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.{ archive-format }" bin-dir = "{ bin }{ binary-ext }" [package.metadata.binstall.overrides.x86_64-pc-windows-msvc] From 757ecfaef8c56dcc4ef2aeee3687dea0847b3d1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 11 Sep 2022 00:54:31 +1200 Subject: [PATCH 0741/2020] Fix logging that was broken due to lib rename (#371) --- crates/bin/src/ui.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bin/src/ui.rs b/crates/bin/src/ui.rs index 7e6e893a..e2856446 100644 --- a/crates/bin/src/ui.rs +++ b/crates/bin/src/ui.rs @@ -109,7 +109,7 @@ pub fn logging(args: &Args) { let mut log_config = ConfigBuilder::new(); if log_level != LevelFilter::Trace { - log_config.add_filter_allow_str("binstall"); + log_config.add_filter_allow_str("binstalk"); log_config.add_filter_allow_str("cargo_binstall"); } From 0e68c0fda3e1eab2592cff5140554e8e613cd1ab Mon Sep 17 00:00:00 2001 From: azzamsa <17734314+azzamsa@users.noreply.github.com> Date: Thu, 15 Sep 2022 09:25:21 +0700 Subject: [PATCH 0742/2020] fix: `pkg-fmt` parsing should be case insensitive (#384) Fixes: #377 --- .../src/manifests/cargo_toml_binstall/package_formats.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/binstalk/src/manifests/cargo_toml_binstall/package_formats.rs b/crates/binstalk/src/manifests/cargo_toml_binstall/package_formats.rs index 30b16704..056cc8f7 100644 --- a/crates/binstalk/src/manifests/cargo_toml_binstall/package_formats.rs +++ b/crates/binstalk/src/manifests/cargo_toml_binstall/package_formats.rs @@ -6,6 +6,7 @@ use strum_macros::{Display, EnumIter, EnumString}; Debug, Display, Copy, Clone, Eq, PartialEq, Serialize, Deserialize, EnumString, EnumIter, )] #[serde(rename_all = "snake_case")] +#[strum(ascii_case_insensitive)] pub enum PkgFmt { /// Download format is TAR (uncompressed) Tar, From 559c3b865811dffb3deaf0e802f5a0f09fbbf88e Mon Sep 17 00:00:00 2001 From: azzamsa <17734314+azzamsa@users.noreply.github.com> Date: Thu, 15 Sep 2022 14:18:55 +0700 Subject: [PATCH 0743/2020] docs: add possible values to `pgk-fmt` argument (#383) Fixes #378 --- crates/bin/src/args.rs | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index af897419..27ef49b0 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -75,7 +75,38 @@ pub struct Args { pub bin_dir: Option, /// Override Cargo.toml package manifest pkg-fmt. - #[clap(help_heading = "Overrides", long)] + /// + /// The availiable package formats are: + /// + /// - tar: download format is TAR (uncompressed) + /// + /// - tbz2: Download format is TAR + Bzip2 + /// + /// - tgz: Download format is TGZ (TAR + GZip) + /// + /// - txz: Download format is TAR + XZ + /// + /// - tzstd: Download format is TAR + Zstd + /// + /// - zip: Download format is Zip + /// + /// - bin: Download format is raw / binary + #[clap( + help_heading = "Overrides", + long, + value_name = "PKG_FMT", + possible_values = [ + PossibleValue::new("tar").help( + "Download format is TAR (uncompressed)." + ), + PossibleValue::new("tbz2").help("Download format is TAR + Bzip2."), + PossibleValue::new("tgz").help("Download format is TGZ (TAR + GZip)."), + PossibleValue::new("txz").help("Download format is TAR + XZ."), + PossibleValue::new("tzstd").help("Download format is TAR + Zstd."), + PossibleValue::new("zip").help("Download format is Zip."), + PossibleValue::new("bin").help("Download format is raw / binary."), + ] + )] pub pkg_fmt: Option, /// Override Cargo.toml package manifest pkg-url. From a5ffba1ffb2b5c995e81b5fd63409f185f6c9720 Mon Sep 17 00:00:00 2001 From: azzamsa <17734314+azzamsa@users.noreply.github.com> Date: Thu, 15 Sep 2022 18:22:28 +0700 Subject: [PATCH 0744/2020] docs: add unsupported crate example (#385) --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 550bd524..4f057d2d 100644 --- a/README.md +++ b/README.md @@ -50,10 +50,18 @@ Package versions and targets may be specified using the `--version` and `--targe To install an unsupported crate, you may specify the Cargo.toml metadata entries for `pkg-url`, `bin-dir`, and `pkg-fmt` at the command line, with values [as documented below](#supporting-binary-installation). For example: -``` +```shell $ binstall \ --pkg-url="{ repo }/releases/download/{ version }/{ name }-{ version }-{ target }.{ archive-format }" \ --pkg-fmt="txz" crate_name + +$ # fnm for x86_64-unknown-linux-gnu only +$ cargo binstall fnm --pkg-url="https://github.com/Schniz/fnm/releases/download/v{ version }/fnm-linux.zip" \ + --pkg-fmt zip --bin-dir "{ bin }" --install-path /opt + +$ # broot +$ cargo binstall broot --pkg-url="https://github.com/Canop/broot/releases/download/v{ version }/broot_{ version }.zip" \ + --pkg-fmt zip --bin-dir "{ target }/{ bin }" --install-path /opt ``` ## FAQ From a611b824fdd8ee9b42d5bd805f15ffefa3600ae2 Mon Sep 17 00:00:00 2001 From: azzamsa <17734314+azzamsa@users.noreply.github.com> Date: Fri, 16 Sep 2022 09:55:19 +0700 Subject: [PATCH 0745/2020] docs: fix grammatical error (#386) --- README.md | 8 ++++---- SUPPORT.md | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/README.md b/README.md index 4f057d2d..babff5be 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ To support `binstall` maintainers must add configuration values to `Cargo.toml` ## Installation -To get started _using_ `cargo-binstall` first install the binary (either via `cargo install cargo-binstall` or by downloading a pre-compiled [release](https://github.com/cargo-bins/cargo-binstall/releases)). We recommend using the pre-compiled ones because we optimise those more than a standard source build does. +To get started _using_ `cargo-binstall` first install the binary (either via `cargo install cargo-binstall` or by downloading a pre-compiled [release](https://github.com/cargo-bins/cargo-binstall/releases)). We recommend using the pre-compiled ones because we optimize those more than a standard source build does. | OS | Arch | URL | | ------- | ------- | ------------------------------------------------------------ | @@ -71,9 +71,9 @@ $ cargo binstall broot --pkg-url="https://github.com/Canop/broot/releases/downlo and often putting together actual _packages_ is overkill. - Why use the cargo manifest? - Crates already have these, and they already contain a significant portion of the required information. - Also there's this great and woefully underused (imo) `[package.metadata]` field. + Also, there's this great and woefully underused (IMO) `[package.metadata]` field. - Is this secure? - - Yes and also no? We're not (yet? [#1](https://github.com/cargo-bins/cargo-binstall/issues/1)) doing anything to verify the CI binaries are produced by the right person / organisation. + - Yes and also no? We're not (yet? [#1](https://github.com/cargo-bins/cargo-binstall/issues/1)) doing anything to verify the CI binaries are produced by the right person/organization. However, we're pulling data from crates.io and the cargo manifest, both of which are _already_ trusted entities, and this is functionally a replacement for `curl ... | bash` or `wget`-ing the same files, so, things can be improved but it's also fairly moot - What do the error codes mean? @@ -83,4 +83,4 @@ $ cargo binstall broot --pkg-url="https://github.com/Canop/broot/releases/downlo --- -If you have ideas / contributions or anything is not working the way you expect (in which case, please include an output with `--log-level debug`) and feel free to open an issue or PR. +If you have ideas/contributions or anything is not working the way you expect (in which case, please include an output with `--log-level debug`) and feel free to open an issue or PR. diff --git a/SUPPORT.md b/SUPPORT.md index dc84940b..a269949a 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -25,14 +25,14 @@ With the following configuration keys: `pkg-url` and `bin-dir` are templated to support different names for different versions / architectures / etc. Template variables use the format `{ VAR }` where `VAR` is the name of the variable, with the following variables available: -- `name` is the name of the crate / package +- `name` is the name of the crate/package - `version` is the crate version (per `--version` and the crate manifest) - `repo` is the repository linked in `Cargo.toml` - `bin` is the name of a specific binary, inferred from the crate configuration - `target` is the rust target name (defaults to your architecture, but can be overridden using the `--target` command line option if required() - `archive-format` is the filename extension of the package archive format - `binary-ext` is the string `.exe` if the `target` is for Windows, or the empty string otherwise -- `format` is a soft-deprecated alias for `archive-format` in `pkg-url`, and for `binary-ext` in `bin-dir`; in the future this may warn at install time. +- `format` is a soft-deprecated alias for `archive-format` in `pkg-url`, and alias for `binary-ext` in `bin-dir`; in the future, this may warn at install time. `pkg-url`, `pkg-fmt` and `bin-dir` can be overridden on a per-target basis if required, for example, if your `x86_64-pc-windows-msvc` builds use `zip` archives this could be set via: @@ -43,7 +43,7 @@ pkg-fmt = "zip" ### Defaults -By default, `binstall` will try all supported package format and would have `bin-dir` set to +By default, `binstall` will try all supported package formats and would have `bin-dir` set to `"{ name }-{ target }-v{ version }/{ bin }{ binary-ext }"` (where `bin` is the cargo binary name and `binary-ext` is `.exe` on windows and empty on other platforms). @@ -52,7 +52,7 @@ files are not overwritten when manually executing `tar -xvf ...`). The default value for `pkg-url` will depend on the repository of the package. -It is setup to work with github releases, gitlab releases, bitbucket downloads +It is set up to work with GitHub releases, GitLab releases, bitbucket downloads and source forge downloads. If your package already uses any of these URLs, you shouldn't need to set anything. @@ -91,7 +91,7 @@ feature of GitLab EE: it requires you to create an asset as a link with a - `{ repo }/downloads/` -Binaries must be uploaded into the project's "Downloads" page on BitBucket. +Binaries must be uploaded to the project's "Downloads" page on BitBucket. Also note that as there are no per-release downloads, the "versionless" filename is not considered here. @@ -126,14 +126,14 @@ For example, the default configuration (as shown above) for a crate called `radi #### If the package name does not match the crate name -As is common with libraries / utilities (and the `radio-sx128x` example), this can be overridden by specifying the `pkg-url`: +As is common with libraries/utilities (and the `radio-sx128x` example), this can be overridden by specifying the `pkg-url`: ```toml [package.metadata.binstall] pkg-url = "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ archive-format }" ``` -Which provides a download URL of: `https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz` +Which provides a download URL of `https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz` #### If the package structure differs from the default From 934ccc257b200547e3766004f70b2b1b3a6da53e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 17 Sep 2022 18:34:36 +1000 Subject: [PATCH 0746/2020] Support new cmdline option `--roots` (#389) * Add new field `Args::roots` * Use `env::var_os` to fetch `CARGO_INSTALL_ROOTS` Previously, it uses `env::var`, which might reject valid path just because it is not utf-8 string. * Update manifest if `CARGO_INSTALL_ROOT` is specified * Add new fn `install_path::get_cargo_roots_path` * Fix updating manifest: Use `cargo_roots` instead of default path * Rm `helpers::statics::cargo_home` Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 13 ++++++ crates/bin/src/entry.rs | 28 +++++++++---- crates/bin/src/install_path.rs | 41 +++++++++++++------ crates/binstalk/src/helpers/statics.rs | 16 +------- crates/binstalk/src/lib.rs | 1 + .../src/manifests/binstall_crates_v1.rs | 3 +- .../binstalk/src/manifests/cargo_crates_v1.rs | 3 +- 7 files changed, 67 insertions(+), 38 deletions(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 27ef49b0..f5a21497 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -144,6 +144,19 @@ pub struct Args { #[clap(help_heading = "Options", long)] pub install_path: Option, + /// Install binaries with a custom cargo root. + /// + /// By default, we use `$CARGO_INSTALL_ROOT` or `$CARGO_HOME` as the + /// cargo root and global metadata files are updated with the + /// package information. + /// + /// Specifying another path here would install the binaries and update + /// the metadata files inside the path you specified. + /// + /// NOTE that `--install-path` takes precedence over this option. + #[clap(help_heading = "Options", long)] + pub roots: Option, + /// Deprecated, here for back-compat only. Secure is now on by default. #[clap(hide(true), long)] pub secure: bool, diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index e878bfeb..10fcee1f 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -41,10 +41,17 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien // Initialize UI thread let mut uithread = UIThread::new(!args.no_confirm); - let (install_path, metadata, temp_dir) = block_in_place(|| -> Result<_> { + let (install_path, cargo_roots, metadata, temp_dir) = block_in_place(|| -> Result<_> { + // Compute cargo_roots + let cargo_roots = + install_path::get_cargo_roots_path(args.roots.take()).ok_or_else(|| { + error!("No viable cargo roots path found of specified, try `--roots`"); + miette!("No cargo roots path found or specified") + })?; + // Compute install directory let (install_path, custom_install_path) = - install_path::get_install_path(args.install_path.as_deref()); + install_path::get_install_path(args.install_path.as_deref(), Some(&cargo_roots)); let install_path = install_path.ok_or_else(|| { error!("No viable install path found of specified, try `--install-path`"); miette!("No install path found or specified") @@ -54,8 +61,12 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien // Load metadata let metadata = if !custom_install_path { - debug!("Reading binstall/crates-v1.json"); - Some(Records::load()?) + let metadata_dir = cargo_roots.join("binstall"); + fs::create_dir_all(&metadata_dir).map_err(BinstallError::Io)?; + let manifest_path = metadata_dir.join("crates-v1.json"); + + debug!("Reading {}", manifest_path.display()); + Some(Records::load_from_path(&manifest_path)?) } else { None }; @@ -71,7 +82,7 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien .map_err(BinstallError::from) .wrap_err("Creating a temporary directory failed.")?; - Ok((install_path, metadata, temp_dir)) + Ok((install_path, cargo_roots, metadata, temp_dir)) })?; // Remove installed crates @@ -206,12 +217,11 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien block_in_place(|| { if let Some(mut records) = metadata { - // If using standardised install path, - // then create_dir_all(&install_path) would also - // create .cargo. + // The cargo manifest path is already created when loading + // metadata. debug!("Writing .crates.toml"); - CratesToml::append(metadata_vec.iter())?; + CratesToml::append_to_path(cargo_roots.join(".crates.toml"), metadata_vec.iter())?; debug!("Writing binstall/crates-v1.json"); for metadata in metadata_vec { diff --git a/crates/bin/src/install_path.rs b/crates/bin/src/install_path.rs index a979ff77..50a3849e 100644 --- a/crates/bin/src/install_path.rs +++ b/crates/bin/src/install_path.rs @@ -1,31 +1,48 @@ use std::{ + env::var_os, path::{Path, PathBuf}, sync::Arc, }; -use binstalk::helpers::statics::cargo_home; +use binstalk::home::cargo_home; use log::debug; +pub fn get_cargo_roots_path(cargo_roots: Option) -> Option { + if let Some(p) = cargo_roots { + return Some(p); + } + + // Environmental variables + if let Some(p) = var_os("CARGO_INSTALL_ROOT") { + let p = PathBuf::from(p); + debug!("using CARGO_INSTALL_ROOT ({})", p.display()); + return Some(p); + } + + if let Ok(p) = cargo_home() { + debug!("using ({}) as cargo home", p.display()); + Some(p) + } else { + None + } +} + /// Fetch install path from environment /// roughly follows /// /// Return (install_path, is_custom_install_path) -pub fn get_install_path>(install_path: Option

) -> (Option>, bool) { +pub fn get_install_path>( + install_path: Option

, + cargo_roots: Option

, +) -> (Option>, bool) { // Command line override first first if let Some(p) = install_path { return (Some(Arc::from(p.as_ref())), true); } - // Environmental variables - if let Ok(p) = std::env::var("CARGO_INSTALL_ROOT") { - debug!("using CARGO_INSTALL_ROOT ({p})"); - let b = PathBuf::from(p); - return (Some(Arc::from(b.join("bin"))), true); - } - - if let Ok(p) = cargo_home() { - debug!("using ({}) as cargo home", p.display()); - return (Some(p.join("bin").into()), false); + // Then cargo_roots + if let Some(p) = cargo_roots { + return (Some(Arc::from(p.as_ref().join("bin"))), false); } // Local executable dir if no cargo is found diff --git a/crates/binstalk/src/helpers/statics.rs b/crates/binstalk/src/helpers/statics.rs index d2ff70ad..7d48aca1 100644 --- a/crates/binstalk/src/helpers/statics.rs +++ b/crates/binstalk/src/helpers/statics.rs @@ -1,20 +1,6 @@ -use std::{ - io::Error, - ops::Deref, - path::{Path, PathBuf}, -}; - -use once_cell::sync::{Lazy, OnceCell}; +use once_cell::sync::Lazy; use url::Url; -pub fn cargo_home() -> Result<&'static Path, Error> { - static CARGO_HOME: OnceCell = OnceCell::new(); - - CARGO_HOME - .get_or_try_init(home::cargo_home) - .map(Deref::deref) -} - pub fn cratesio_url() -> &'static Url { static CRATESIO: Lazy Url> = Lazy::new(|| Url::parse("https://github.com/rust-lang/crates.io-index").unwrap()); diff --git a/crates/binstalk/src/lib.rs b/crates/binstalk/src/lib.rs index 273f4d97..a4b00d85 100644 --- a/crates/binstalk/src/lib.rs +++ b/crates/binstalk/src/lib.rs @@ -8,3 +8,4 @@ pub mod manifests; pub mod ops; pub use detect_targets::{get_desired_targets, DesiredTargets}; +pub use home; diff --git a/crates/binstalk/src/manifests/binstall_crates_v1.rs b/crates/binstalk/src/manifests/binstall_crates_v1.rs index c343bc23..69b3df80 100644 --- a/crates/binstalk/src/manifests/binstall_crates_v1.rs +++ b/crates/binstalk/src/manifests/binstall_crates_v1.rs @@ -15,11 +15,12 @@ use std::{ }; use fs_lock::FileLock; +use home::cargo_home; use miette::Diagnostic; use serde::Serialize; use thiserror::Error; -use crate::{fs::create_if_not_exist, helpers::statics::cargo_home}; +use crate::fs::create_if_not_exist; use super::crate_info::CrateInfo; diff --git a/crates/binstalk/src/manifests/cargo_crates_v1.rs b/crates/binstalk/src/manifests/cargo_crates_v1.rs index 5b2ca110..aa1fa2a5 100644 --- a/crates/binstalk/src/manifests/cargo_crates_v1.rs +++ b/crates/binstalk/src/manifests/cargo_crates_v1.rs @@ -17,11 +17,12 @@ use std::{ use compact_str::CompactString; use fs_lock::FileLock; +use home::cargo_home; use miette::Diagnostic; use serde::{Deserialize, Serialize}; use thiserror::Error; -use crate::{fs::create_if_not_exist, helpers::statics::cargo_home}; +use crate::fs::create_if_not_exist; use super::crate_info::CrateInfo; From ee340d80b656e4f8fafa1b28774951772633f139 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 17 Sep 2022 19:00:16 +1000 Subject: [PATCH 0747/2020] Use fork binstall-zip here for new features & updated deps (#375) * Use fork binstall-zip here for new features & updated deps Also update zstd to v0.11.2 Signed-off-by: Jiahao XU * Update `Cargo.lock` Signed-off-by: Jiahao XU Signed-off-by: Jiahao XU --- Cargo.lock | 42 +++++++++++++++++++------------------- crates/binstalk/Cargo.toml | 10 ++++++--- 2 files changed, 28 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 03408042..937f22f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -81,6 +81,7 @@ version = "0.1.0" dependencies = [ "async-trait", "binstall-tar", + "binstall-zip", "bytes", "bzip2", "cargo_toml", @@ -117,7 +118,6 @@ dependencies = [ "trust-dns-resolver", "url", "xz2", - "zip", "zstd", ] @@ -132,6 +132,20 @@ dependencies = [ "xattr", ] +[[package]] +name = "binstall-zip" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5eddcdebe8fe727d81b47734b3302ffa49a6fe50376fe6c52c609198c0709e5" +dependencies = [ + "byteorder", + "bzip2", + "crc32fast", + "crossbeam-utils", + "flate2", + "zstd", +] + [[package]] name = "bitflags" version = "1.3.2" @@ -2436,34 +2450,20 @@ dependencies = [ "lzma-sys", ] -[[package]] -name = "zip" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf225bcf73bb52cbb496e70475c7bd7a3f769df699c0020f6c7bd9a96dcf0b8d" -dependencies = [ - "byteorder", - "bzip2", - "crc32fast", - "crossbeam-utils", - "flate2", - "zstd", -] - [[package]] name = "zstd" -version = "0.10.2+zstd.1.5.2" +version = "0.11.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4a6bd64f22b5e3e94b4e238669ff9f10815c27a5180108b849d24174a83847" +checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "4.1.6+zstd.1.5.2" +version = "5.0.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b61c51bb270702d6167b8ce67340d2754b088d0c091b06e593aa772c3ee9bb" +checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" dependencies = [ "libc", "zstd-sys", @@ -2471,9 +2471,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "1.6.3+zstd.1.5.2" +version = "2.0.1+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc49afa5c8d634e75761feda8c592051e7eeb4683ba827211eb0d731d3402ea8" +checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" dependencies = [ "cc", "libc", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index af52c8d9..9263c4eb 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -52,18 +52,22 @@ trust-dns-resolver = { version = "0.21.2", optional = true, default-features = f url = { version = "2.2.2", features = ["serde"] } xz2 = "0.1.7" +# Use a fork here since upstream has not published a new release for a long time +# while many of its dependencies are updated. +# Also becasue we need streaming extraction. +# # Disable all features of zip except for features of compression algorithms: # Disabled features include: # - aes-crypto: Enables decryption of files which were encrypted with AES, absolutely zero use for # this crate. # - time: Enables features using the [time](https://github.com/time-rs/time) crate, # which is not used by this crate. -zip = { version = "0.6.2", default-features = false, features = ["deflate", "bzip2", "zstd"] } +zip = { package = "binstall-zip", version = "0.6.3", default-features = false, features = ["deflate", "bzip2", "zstd"] } # zstd is also depended by zip. -# Since zip 0.6.2 depends on zstd 0.10.0, we also have to use 0.10.0 here, +# Since zip 0.6.3 depends on zstd 0.11, we also have to use 0.11 here, # otherwise there will be a link conflict. -zstd = { version = "0.10.0", default-features = false } +zstd = { version = "0.11.2", default-features = false } [dev-dependencies] env_logger = "0.9.0" From 7ac55c46f14cb1036fc04540017cb2ed544f2c5f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 17 Sep 2022 19:22:19 +1000 Subject: [PATCH 0748/2020] Add new feature log_release_max_level_debug and enable it on CI release build (#390) * Add new feature `log_release_max_level_debug` * Fix calculation of `log_level` in `logging` * Enable feature log_release_max_level_debug on CI release build Signed-off-by: Jiahao XU --- .github/scripts/compile-settings.jq | 2 +- crates/bin/Cargo.toml | 1 + crates/bin/src/ui.rs | 5 +++-- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/scripts/compile-settings.jq b/.github/scripts/compile-settings.jq index 6155b24b..a73b4712 100644 --- a/.github/scripts/compile-settings.jq +++ b/.github/scripts/compile-settings.jq @@ -4,7 +4,7 @@ if $for_release then { # Use build-std to build a std library optimized for size and abort immediately on abort, # so that format string for `unwrap`/`expect`/`unreachable`/`panic` can be optimized out. args: ($matrix.release_build_args // "-Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort"), - features: ($matrix.release_features // ["zlib-ng", "static", "rustls", "trust-dns", "fancy-no-backtrace"]), + features: ($matrix.release_features // ["zlib-ng", "static", "rustls", "trust-dns", "fancy-no-backtrace", "log_release_max_level_debug"]), } else { output: "debug", profile: "dev", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 39d67ea9..c58758a3 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -56,3 +56,4 @@ fancy-no-backtrace = ["miette/fancy-no-backtrace"] fancy-with-backtrace = ["fancy-no-backtrace", "miette/fancy"] log_release_max_level_info = ["log/release_max_level_info"] +log_release_max_level_debug = ["log/release_max_level_debug"] diff --git a/crates/bin/src/ui.rs b/crates/bin/src/ui.rs index e2856446..715cc7b6 100644 --- a/crates/bin/src/ui.rs +++ b/crates/bin/src/ui.rs @@ -1,9 +1,10 @@ use std::{ + cmp::min, io::{self, BufRead, Write}, thread, }; -use log::LevelFilter; +use log::{LevelFilter, STATIC_MAX_LEVEL}; use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; use tokio::sync::mpsc; @@ -103,7 +104,7 @@ impl UIThread { } pub fn logging(args: &Args) { - let log_level = args.log_level; + let log_level = min(args.log_level, STATIC_MAX_LEVEL); // Setup logging let mut log_config = ConfigBuilder::new(); From fa79e7f105110f8e9f6e8dba7a7e5f8ed13ac7eb Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 17 Sep 2022 19:28:22 +1000 Subject: [PATCH 0749/2020] Verify that `bin_files` exist in `resolve` stage (#382) * Refactor: Extract new fn `BinFile::check_source_exists` * Impl new async fn `AutoAbortJoinHandle::flattened_join` * Impl new fn `Fetcher::fetcher_name` * Verify that `bin_files` exist in `resolve` stage To ensure that the installation stage won't fail because of missing binaries. * Rm unused `MultiFecther` * Simplify `Future` impl for `AutoAbortJoinHandle` * Add new variant `BinstallError::CargoTomlMissingPackage` * Replace `unwrap` in `resolve_inner` with proper error handling * Make `Fetcher::new` as a regular function instead of an `async` function. * Ret `Arc` in trait fn `Fetcher::new` * Refactor `resolve_inner` Signed-off-by: Jiahao XU --- crates/binstalk/src/bins.rs | 11 +- crates/binstalk/src/errors.rs | 9 + crates/binstalk/src/fetchers.rs | 53 +---- crates/binstalk/src/fetchers/gh_crate_meta.rs | 6 +- crates/binstalk/src/fetchers/quickinstall.rs | 6 +- crates/binstalk/src/helpers/tasks.rs | 8 +- crates/binstalk/src/ops/install.rs | 67 ++---- crates/binstalk/src/ops/resolve.rs | 204 +++++++++++++----- 8 files changed, 207 insertions(+), 157 deletions(-) diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index a2d81c2a..43d20db2 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -83,10 +83,17 @@ impl BinFile { ) } - pub fn install_bin(&self) -> Result<(), BinstallError> { + /// Return `Ok` if the source exists, otherwise `Err`. + pub fn check_source_exists(&self) -> Result<(), BinstallError> { if !self.source.try_exists()? { - return Err(BinstallError::BinFileNotFound(self.source.clone())); + Err(BinstallError::BinFileNotFound(self.source.clone())) + } else { + Ok(()) } + } + + pub fn install_bin(&self) -> Result<(), BinstallError> { + self.check_source_exists()?; debug!( "Atomically install file from '{}' to '{}'", diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index d4a03120..0ebe41f8 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -276,6 +276,14 @@ pub enum BinstallError { #[diagnostic(severity(error), code(binstall::binfile))] BinFileNotFound(PathBuf), + /// `Cargo.toml` of the crate does not have section "Package". + /// + /// - Code: `binstall::cargo_manifest` + /// - Exit: 89 + #[error("Cargo.toml of crate {0} does not have section \"Package\"")] + #[diagnostic(severity(error), code(binstall::cargo_manifest))] + CargoTomlMissingPackage(CompactString), + /// A wrapped error providing the context of which crate the error is about. #[error("for crate {crate_name}")] CrateContext { @@ -310,6 +318,7 @@ impl BinstallError { UnspecifiedBinaries => 86, NoViableTargets => 87, BinFileNotFound(_) => 88, + CargoTomlMissingPackage(_) => 89, CrateContext { error, .. } => error.exit_number(), }; diff --git a/crates/binstalk/src/fetchers.rs b/crates/binstalk/src/fetchers.rs index bc7ab9fd..ceebdb2e 100644 --- a/crates/binstalk/src/fetchers.rs +++ b/crates/binstalk/src/fetchers.rs @@ -8,7 +8,6 @@ use reqwest::Client; use crate::{ errors::BinstallError, - helpers::tasks::AutoAbortJoinHandle, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; @@ -18,7 +17,8 @@ mod quickinstall; #[async_trait::async_trait] pub trait Fetcher: Send + Sync { /// Create a new fetcher from some data - async fn new(client: &Client, data: &Arc) -> Arc + #[allow(clippy::new_ret_no_self)] + fn new(client: &Client, data: &Arc) -> Arc where Self: Sized; @@ -44,6 +44,13 @@ pub trait Fetcher: Send + Sync { /// A short human-readable name or descriptor for the package source fn source_name(&self) -> CompactString; + /// A short human-readable name, must contains only characters + /// and numbers and it also must be unique. + /// + /// It is used to create a temporary dir where it is used for + /// [`Fetcher::fetch_and_extract`]. + fn fetcher_name(&self) -> &'static str; + /// Should return true if the remote is from a third-party source fn is_third_party(&self) -> bool; @@ -60,45 +67,3 @@ pub struct Data { pub repo: Option, pub meta: PkgMeta, } - -type FetcherJoinHandle = AutoAbortJoinHandle>; - -pub struct MultiFetcher(Vec<(Arc, FetcherJoinHandle)>); - -impl MultiFetcher { - pub fn with_capacity(n: usize) -> Self { - Self(Vec::with_capacity(n)) - } - - pub fn add(&mut self, fetcher: Arc) { - self.0.push(( - fetcher.clone(), - AutoAbortJoinHandle::spawn(async move { fetcher.find().await }), - )); - } - - pub async fn first_available(self) -> Option> { - for (fetcher, handle) in self.0 { - match handle.await { - Ok(Ok(true)) => return Some(fetcher), - Ok(Ok(false)) => (), - Ok(Err(err)) => { - debug!( - "Error while checking fetcher {}: {}", - fetcher.source_name(), - err - ); - } - Err(join_err) => { - debug!( - "Error while joining the task that checks the fetcher {}: {}", - fetcher.source_name(), - join_err - ); - } - } - } - - None - } -} diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index cc10406c..54842ce4 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -71,7 +71,7 @@ impl GhCrateMeta { #[async_trait::async_trait] impl super::Fetcher for GhCrateMeta { - async fn new(client: &Client, data: &Arc) -> Arc { + fn new(client: &Client, data: &Arc) -> Arc { Arc::new(Self { client: client.clone(), data: data.clone(), @@ -175,6 +175,10 @@ impl super::Fetcher for GhCrateMeta { .unwrap_or_else(|| "invalid url".into()) } + fn fetcher_name(&self) -> &'static str { + "GhCrateMeta" + } + fn is_third_party(&self) -> bool { false } diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs index e94795c7..d7d539a1 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk/src/fetchers/quickinstall.rs @@ -27,7 +27,7 @@ pub struct QuickInstall { #[async_trait::async_trait] impl super::Fetcher for QuickInstall { - async fn new(client: &Client, data: &Arc) -> Arc { + fn new(client: &Client, data: &Arc) -> Arc { let crate_name = &data.name; let version = &data.version; let target = data.target.clone(); @@ -68,6 +68,10 @@ impl super::Fetcher for QuickInstall { CompactString::from("QuickInstall") } + fn fetcher_name(&self) -> &'static str { + "QuickInstall" + } + fn is_third_party(&self) -> bool { true } diff --git a/crates/binstalk/src/helpers/tasks.rs b/crates/binstalk/src/helpers/tasks.rs index f1820be9..47bee796 100644 --- a/crates/binstalk/src/helpers/tasks.rs +++ b/crates/binstalk/src/helpers/tasks.rs @@ -56,6 +56,12 @@ impl Future for AutoAbortJoinHandle { fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll { Pin::new(&mut Pin::into_inner(self).0) .poll(cx) - .map(|res| res.map_err(BinstallError::TaskJoinError)) + .map_err(BinstallError::TaskJoinError) + } +} + +impl AutoAbortJoinHandle> { + pub async fn flattened_join(self) -> Result { + self.await? } } diff --git a/crates/binstalk/src/ops/install.rs b/crates/binstalk/src/ops/install.rs index 582bbc42..8b9cb3de 100644 --- a/crates/binstalk/src/ops/install.rs +++ b/crates/binstalk/src/ops/install.rs @@ -1,4 +1,4 @@ -use std::{path::PathBuf, sync::Arc}; +use std::sync::Arc; use cargo_toml::Package; use compact_str::CompactString; @@ -9,7 +9,6 @@ use super::{resolve::Resolution, Options}; use crate::{ bins, errors::BinstallError, - fetchers::Fetcher, helpers::jobserver_client::LazyJobserverClient, manifests::{ cargo_toml_binstall::Meta, @@ -29,7 +28,6 @@ pub async fn install( package, name, version_req, - bin_path, bin_files, } => { let current_version = @@ -42,19 +40,17 @@ pub async fn install( })?; let target = fetcher.target().into(); - install_from_package(fetcher, opts, bin_path, bin_files) - .await - .map(|option| { - option.map(|bins| CrateInfo { - name, - version_req, - current_version, - source: CrateSource::cratesio_registry(), - target, - bins, - other: Default::default(), - }) + install_from_package(opts, bin_files).await.map(|option| { + option.map(|bins| CrateInfo { + name, + version_req, + current_version, + source: CrateSource::cratesio_registry(), + target, + bins, + other: Default::default(), }) + }) } Resolution::InstallFromSource { package } => { let desired_targets = opts.desired_targets.get().await; @@ -63,7 +59,7 @@ pub async fn install( .ok_or(BinstallError::NoViableTargets)?; if !opts.dry_run { - install_from_source(package, target, jobserver_client, opts.quiet, opts.force) + install_from_source(&package, target, jobserver_client, opts.quiet, opts.force) .await .map(|_| None) } else { @@ -78,42 +74,9 @@ pub async fn install( } async fn install_from_package( - fetcher: Arc, opts: Arc, - bin_path: PathBuf, bin_files: Vec, ) -> Result>, BinstallError> { - // Download package - if opts.dry_run { - info!("Dry run, not downloading package"); - } else { - fetcher.fetch_and_extract(&bin_path).await?; - } - - #[cfg(incomplete)] - { - // Fetch and check package signature if available - if let Some(pub_key) = meta.as_ref().map(|m| m.pub_key.clone()).flatten() { - debug!("Found public key: {pub_key}"); - - // Generate signature file URL - let mut sig_ctx = ctx.clone(); - sig_ctx.format = "sig".to_string(); - let sig_url = sig_ctx.render(&pkg_url)?; - - debug!("Fetching signature file: {sig_url}"); - - // Download signature file - let sig_path = temp_dir.join(format!("{pkg_name}.sig")); - download(&sig_url, &sig_path).await?; - - // TODO: do the signature check - unimplemented!() - } else { - warn!("No public key found, package signature could not be validated"); - } - } - if opts.dry_run { info!("Dry run, not proceeding"); return Ok(None); @@ -139,7 +102,7 @@ async fn install_from_package( } async fn install_from_source( - package: Package, + package: &Package, target: &str, lazy_jobserver_client: LazyJobserverClient, quiet: bool, @@ -155,9 +118,9 @@ async fn install_from_source( let mut cmd = Command::new("cargo"); cmd.arg("install") - .arg(package.name) + .arg(&package.name) .arg("--version") - .arg(package.version) + .arg(&package.version) .arg("--target") .arg(target); diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 97a553d4..2dc48cac 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -5,6 +5,7 @@ use std::{ use cargo_toml::{Manifest, Package, Product}; use compact_str::{CompactString, ToCompactString}; +use itertools::Itertools; use log::{debug, info, warn}; use reqwest::Client; use semver::{Version, VersionReq}; @@ -15,7 +16,8 @@ use crate::{ bins, drivers::fetch_crate_cratesio, errors::BinstallError, - fetchers::{Data, Fetcher, GhCrateMeta, MultiFetcher, QuickInstall}, + fetchers::{Data, Fetcher, GhCrateMeta, QuickInstall}, + helpers::tasks::AutoAbortJoinHandle, manifests::cargo_toml_binstall::{Meta, PkgMeta}, }; @@ -32,7 +34,6 @@ pub enum Resolution { package: Package, name: CompactString, version_req: CompactString, - bin_path: PathBuf, bin_files: Vec, }, InstallFromSource { @@ -95,8 +96,8 @@ pub async fn resolve( crates_io_api_client: crates_io_api::AsyncClient, ) -> Result { let crate_name_name = crate_name.name.clone(); - resolve_inner( - opts, + let resolution = resolve_inner( + &opts, crate_name, curr_version, temp_dir, @@ -105,11 +106,15 @@ pub async fn resolve( crates_io_api_client, ) .await - .map_err(|err| err.crate_context(crate_name_name)) + .map_err(|err| err.crate_context(crate_name_name))?; + + resolution.print(&opts); + + Ok(resolution) } async fn resolve_inner( - opts: Arc, + opts: &Options, crate_name: CrateName, curr_version: Option, temp_dir: Arc, @@ -142,7 +147,9 @@ async fn resolve_inner( } }; - let package = manifest.package.unwrap(); + let package = manifest + .package + .ok_or_else(|| BinstallError::CargoTomlMissingPackage(crate_name.name.clone()))?; if let Some(curr_version) = curr_version { let new_version = @@ -171,65 +178,150 @@ async fn resolve_inner( let desired_targets = opts.desired_targets.get().await; - let mut fetchers = MultiFetcher::with_capacity(desired_targets.len() * 2); + let mut handles: Vec<(Arc, _)> = Vec::with_capacity(desired_targets.len() * 2); - for target in desired_targets { - debug!("Building metadata for target: {target}"); - let mut target_meta = meta.clone_without_overrides(); + handles.extend( + desired_targets + .iter() + .map(|target| { + debug!("Building metadata for target: {target}"); + let mut target_meta = meta.clone_without_overrides(); - // Merge any overrides - if let Some(o) = meta.overrides.get(target) { - target_meta.merge(o); - } + // Merge any overrides + if let Some(o) = meta.overrides.get(target) { + target_meta.merge(o); + } - target_meta.merge(&opts.cli_overrides); - debug!("Found metadata: {target_meta:?}"); + target_meta.merge(&opts.cli_overrides); + debug!("Found metadata: {target_meta:?}"); - let fetcher_data = Arc::new(Data { - name: package.name.clone(), - target: target.clone(), - version: package.version.clone(), - repo: package.repository.clone(), - meta: target_meta, - }); + Arc::new(Data { + name: package.name.clone(), + target: target.clone(), + version: package.version.clone(), + repo: package.repository.clone(), + meta: target_meta, + }) + }) + .cartesian_product([GhCrateMeta::new, QuickInstall::new]) + .map(|(fetcher_data, f)| { + let fetcher = f(&client, &fetcher_data); + ( + fetcher.clone(), + AutoAbortJoinHandle::spawn(async move { fetcher.find().await }), + ) + }), + ); - fetchers.add(GhCrateMeta::new(&client, &fetcher_data).await); - fetchers.add(QuickInstall::new(&client, &fetcher_data).await); - } + for (fetcher, handle) in handles { + match handle.flattened_join().await { + Ok(true) => { + // Generate temporary binary path + let bin_path = temp_dir.join(format!( + "bin-{}-{}-{}", + crate_name.name, + fetcher.target(), + fetcher.fetcher_name() + )); - let resolution = match fetchers.first_available().await { - Some(fetcher) => { - // Build final metadata - let meta = fetcher.target_meta(); - - // Generate temporary binary path - let bin_path = temp_dir.join(format!("bin-{}", crate_name.name)); - debug!("Using temporary binary path: {}", bin_path.display()); - - let bin_files = collect_bin_files( - fetcher.as_ref(), - &package, - meta, - binaries, - bin_path.clone(), - install_path.to_path_buf(), - )?; - - Resolution::Fetch { - fetcher, - package, - name: crate_name.name, - version_req: version_req.to_compact_string(), - bin_path, - bin_files, + match download_extract_and_verify( + fetcher.as_ref(), + &bin_path, + &package, + &install_path, + binaries.clone(), + ) + .await + { + Ok(bin_files) => { + return Ok(Resolution::Fetch { + fetcher, + package, + name: crate_name.name, + version_req: version_req.to_compact_string(), + bin_files, + }) + } + Err(err) => { + warn!( + "Error while downloading and extracting from fetcher {}: {}", + fetcher.source_name(), + err + ); + } + } + } + Ok(false) => (), + Err(err) => { + warn!( + "Error while checking fetcher {}: {}", + fetcher.source_name(), + err + ); } } - None => Resolution::InstallFromSource { package }, - }; + } - resolution.print(&opts); + Ok(Resolution::InstallFromSource { package }) +} - Ok(resolution) +/// * `fetcher` - `fetcher.find()` must return `Ok(true)`. +async fn download_extract_and_verify( + fetcher: &dyn Fetcher, + bin_path: &Path, + package: &Package, + install_path: &Path, + // TODO: Use &[Product] + binaries: Vec, +) -> Result, BinstallError> { + // Build final metadata + let meta = fetcher.target_meta(); + + let bin_files = collect_bin_files( + fetcher, + package, + meta, + binaries, + bin_path.to_path_buf(), + install_path.to_path_buf(), + )?; + + // Download and extract it. + // If that fails, then ignore this fetcher. + fetcher.fetch_and_extract(bin_path).await?; + + #[cfg(incomplete)] + { + // Fetch and check package signature if available + if let Some(pub_key) = meta.as_ref().map(|m| m.pub_key.clone()).flatten() { + debug!("Found public key: {pub_key}"); + + // Generate signature file URL + let mut sig_ctx = ctx.clone(); + sig_ctx.format = "sig".to_string(); + let sig_url = sig_ctx.render(&pkg_url)?; + + debug!("Fetching signature file: {sig_url}"); + + // Download signature file + let sig_path = temp_dir.join(format!("{pkg_name}.sig")); + download(&sig_url, &sig_path).await?; + + // TODO: do the signature check + unimplemented!() + } else { + warn!("No public key found, package signature could not be validated"); + } + } + + // Verify that all the bin_files exist + block_in_place(|| { + for bin_file in bin_files.iter() { + bin_file.check_source_exists()?; + } + + Ok(bin_files) + }) } fn collect_bin_files( From 946dd2d0b9be304728cea2c4d9aded9f8744c275 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 17 Sep 2022 20:34:38 +1000 Subject: [PATCH 0750/2020] Avoid misleading confusion of `README.md` (#392) Fixed #391 --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index babff5be..57b657f3 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,9 @@ To support `binstall` maintainers must add configuration values to `Cargo.toml` [![GitHub tag](https://img.shields.io/github/tag/cargo-bins/cargo-binstall.svg)](https://github.com/cargo-bins/cargo-binstall) [![Crates.io](https://img.shields.io/crates/v/cargo-binstall.svg)](https://crates.io/crates/cargo-binstall) +NOTE that the docs below are for the `main` branch and may contain unreleased features, +**[see docs for the latest version](https://crates.io/crates/cargo-binstall)** + ## Installation To get started _using_ `cargo-binstall` first install the binary (either via `cargo install cargo-binstall` or by downloading a pre-compiled [release](https://github.com/cargo-bins/cargo-binstall/releases)). We recommend using the pre-compiled ones because we optimize those more than a standard source build does. From d141f4ca81e5752be1123ce876c4611b7d1ba17e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 17 Sep 2022 21:00:43 +1000 Subject: [PATCH 0751/2020] release: binstalk v0.2.0 (#394) (cargo-release) version 0.2.0 Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 937f22f1..d0ff7d2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,7 +77,7 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "binstalk" -version = "0.1.0" +version = "0.2.0" dependencies = [ "async-trait", "binstall-tar", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index c58758a3..5bc8c5ff 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -21,7 +21,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.1.0" } +binstalk = { path = "../binstalk", version = "0.2.0" } clap = { version = "3.2.17", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 9263c4eb..34486067 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.1.0" +version = "0.2.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From e8dfbe3afbc9ee8a0fbc6c7b0c36c08e570df9bf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 17 Sep 2022 23:35:18 +1200 Subject: [PATCH 0752/2020] release: cargo-binstall v0.13.1 (#370) Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d0ff7d2e..299ae149 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -202,7 +202,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.13.0" +version = "0.13.1" dependencies = [ "binstalk", "clap", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 5bc8c5ff..4338ae5c 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.13.0" +version = "0.13.1" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 098c42d7..8fa967fa 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 6bd1fc68b54e769d33d783c6fa002281b2f76fa5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 18 Sep 2022 00:27:52 +1200 Subject: [PATCH 0753/2020] Use github source for latest version readme (#395) The crate _doesn't_ have the readme snapshot anymore, likely due to the new split crate layout; we should probably fix that but in the meantime this does the trick. --- README.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/README.md b/README.md index 57b657f3..7e077f1f 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,7 @@ To support `binstall` maintainers must add configuration values to `Cargo.toml` [![GitHub tag](https://img.shields.io/github/tag/cargo-bins/cargo-binstall.svg)](https://github.com/cargo-bins/cargo-binstall) [![Crates.io](https://img.shields.io/crates/v/cargo-binstall.svg)](https://crates.io/crates/cargo-binstall) -NOTE that the docs below are for the `main` branch and may contain unreleased features, -**[see docs for the latest version](https://crates.io/crates/cargo-binstall)** +You probably want to **[see this page as it was when the latest version was published](https://github.com/cargo-bins/cargo-binstall/tree/v0.13.1#readme)** for accurate documentation. ## Installation From aa12109f3e5439e79b602fd030c5a21fc2229fc9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 18 Sep 2022 13:41:42 +1000 Subject: [PATCH 0754/2020] Fixed link to `BinstallError` in README.md (#397) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7e077f1f..e22d2219 100644 --- a/README.md +++ b/README.md @@ -79,7 +79,7 @@ $ cargo binstall broot --pkg-url="https://github.com/Canop/broot/releases/downlo However, we're pulling data from crates.io and the cargo manifest, both of which are _already_ trusted entities, and this is functionally a replacement for `curl ... | bash` or `wget`-ing the same files, so, things can be improved but it's also fairly moot - What do the error codes mean? - - You can find a full description of errors including exit codes here: + - You can find a full description of errors including exit codes here: - Can I use it in CI? - Yes! For GitHub Actions, we recommend the excellent [taiki-e/install-action](https://github.com/marketplace/actions/install-development-tools), which has explicit support for selected tools and uses `cargo-binstall` for everything else. From 7816b2162bbd367ad95f43c8525225a60853968d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 18 Sep 2022 15:57:18 +1200 Subject: [PATCH 0755/2020] Pull cargo-binstall crate readme from root of repo (#398) --- crates/bin/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 4338ae5c..238dba02 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -8,6 +8,7 @@ rust-version = "1.61.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0" +readme = "../../README.md" # These MUST remain even if they're not needed in recent versions because # OLD versions use them to upgrade From 1a1310f98b9ff42db71fa081ee619a4174f8308b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 22 Sep 2022 13:59:25 +1000 Subject: [PATCH 0756/2020] Enable dependabot for `Cargo.lock` (#399) * Enable dependabot for `Cargo.lock` * Fix dependabot for fs-lock & detect-targets Signed-off-by: Jiahao XU --- .github/dependabot.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index a3c3b0d1..528d447d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,6 +8,10 @@ updates: directory: "/" schedule: interval: "daily" + - package-ecosystem: "cargo" + directory: "/" + schedule: + interval: "daily" - package-ecosystem: "cargo" directory: "/crates/bin" schedule: @@ -21,7 +25,7 @@ updates: schedule: interval: "daily" - package-ecosystem: "cargo" - directory: "/crates/flock" + directory: "/crates/fs-lock" schedule: interval: "daily" - package-ecosystem: "cargo" @@ -29,6 +33,6 @@ updates: schedule: interval: "daily" - package-ecosystem: "cargo" - directory: "/crates/detect-target" + directory: "/crates/detect-targets" schedule: interval: "daily" From ab87f190948d006146a27ad1b29e5c205efe1e43 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 14:31:15 +1000 Subject: [PATCH 0757/2020] Bump tokio from 1.21.0 to 1.21.1 (#401) Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.21.0 to 1.21.1. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.21.0...tokio-1.21.1) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 299ae149..5e534eda 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1953,9 +1953,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.21.0" +version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89797afd69d206ccd11fb0ea560a44bbb87731d020670e79416d442919257d42" +checksum = "0020c875007ad96677dcc890298f4b942882c5d4eb7cc8f439fc3bf813dc9c95" dependencies = [ "autocfg", "bytes", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 238dba02..ffe96ddd 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -33,7 +33,7 @@ reqwest = { version = "0.11.11", default-features = false } semver = "1.0.13" simplelog = "0.12.0" tempfile = "3.3.0" -tokio = { version = "1.20.1", features = ["rt-multi-thread"], default-features = false } +tokio = { version = "1.21.1", features = ["rt-multi-thread"], default-features = false } [build-dependencies] embed-resource = "1.7.3" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 34486067..120373a3 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -46,7 +46,7 @@ tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.3.0" thiserror = "1.0.32" tinytemplate = "1.2.1" -tokio = { version = "1.20.1", features = ["macros", "rt", "process", "sync", "signal"], default-features = false } +tokio = { version = "1.21.1", features = ["macros", "rt", "process", "sync", "signal"], default-features = false } toml_edit = { version = "0.14.4", features = ["easy"] } trust-dns-resolver = { version = "0.21.2", optional = true, default-features = false, features = ["dnssec-ring"] } url = { version = "2.2.2", features = ["serde"] } diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 2ffeec10..ff72b51f 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -10,11 +10,11 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -tokio = { version = "1.20.1", features = ["rt", "process", "sync"], default-features = false } +tokio = { version = "1.21.1", features = ["rt", "process", "sync"], default-features = false } cfg-if = "1.0.0" [target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] guess_host_triple = "0.1.3" [dev-dependencies] -tokio = { version = "1.20.1", features = ["macros"], default-features = false } +tokio = { version = "1.21.1", features = ["macros"], default-features = false } From e4a6925e596053dc2ad627e7cea23e6151a1cdea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 05:00:08 +0000 Subject: [PATCH 0758/2020] Bump url from 2.2.2 to 2.3.0 (#402) Bumps [url](https://github.com/servo/rust-url) from 2.2.2 to 2.3.0. - [Release notes](https://github.com/servo/rust-url/releases) - [Commits](https://github.com/servo/rust-url/compare/v2.2.2...v2.3.0) --- updated-dependencies: - dependency-name: url dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 5 ++--- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5e534eda..a8d60bee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2180,13 +2180,12 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.2.2" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +checksum = "22fe195a4f217c25b25cb5058ced57059824a678474874038dc88d211bf508d3" dependencies = [ "form_urlencoded", "idna", - "matches", "percent-encoding", "serde", ] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 120373a3..3083057a 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -49,7 +49,7 @@ tinytemplate = "1.2.1" tokio = { version = "1.21.1", features = ["macros", "rt", "process", "sync", "signal"], default-features = false } toml_edit = { version = "0.14.4", features = ["easy"] } trust-dns-resolver = { version = "0.21.2", optional = true, default-features = false, features = ["dnssec-ring"] } -url = { version = "2.2.2", features = ["serde"] } +url = { version = "2.3.0", features = ["serde"] } xz2 = "0.1.7" # Use a fork here since upstream has not published a new release for a long time From e186dfd98dbe097aa7a37354f539257b0c243744 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 05:19:33 +0000 Subject: [PATCH 0759/2020] Bump reqwest from 0.11.11 to 0.11.12 (#405) Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.11 to 0.11.12. - [Release notes](https://github.com/seanmonstar/reqwest/releases) - [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md) - [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.11...v0.11.12) --- updated-dependencies: - dependency-name: reqwest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 6 +++--- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a8d60bee..577ec283 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1466,9 +1466,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.11" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b75aa69a3f06bbcc66ede33af2af253c6f7a86b1ca0033f60c580a27074fbf92" +checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" dependencies = [ "base64", "bytes", @@ -1483,10 +1483,10 @@ dependencies = [ "hyper-tls", "ipnet", "js-sys", - "lazy_static", "log", "mime", "native-tls", + "once_cell", "percent-encoding", "pin-project-lite", "rustls", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index ffe96ddd..c99c2e6d 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -29,7 +29,7 @@ dirs = "4.0.0" log = "0.4.17" miette = "5.3.0" mimalloc = { version = "0.1.29", default-features = false, optional = true } -reqwest = { version = "0.11.11", default-features = false } +reqwest = { version = "0.11.12", default-features = false } semver = "1.0.13" simplelog = "0.12.0" tempfile = "3.3.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 3083057a..6de9dfee 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -30,7 +30,7 @@ log = { version = "0.4.17", features = ["std"] } miette = "5.3.0" normalize-path = { version = "0.1.0", path = "../normalize-path" } once_cell = "1.13.0" -reqwest = { version = "0.11.11", features = ["stream"], default-features = false } +reqwest = { version = "0.11.12", features = ["stream"], default-features = false } scopeguard = "1.1.0" semver = { version = "1.0.13", features = ["serde"] } serde = { version = "1.0.143", features = ["derive"] } From 54122e1eaeb7d80693c20837a30bada811069895 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 05:39:11 +0000 Subject: [PATCH 0760/2020] Bump itertools from 0.10.3 to 0.10.5 (#403) Bumps [itertools](https://github.com/rust-itertools/itertools) from 0.10.3 to 0.10.5. - [Release notes](https://github.com/rust-itertools/itertools/releases) - [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-itertools/itertools/commits) --- updated-dependencies: - dependency-name: itertools dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 577ec283..cde14aa2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -945,9 +945,9 @@ checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" [[package]] name = "itertools" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9a9d19fa1e79b6215ff29b9d6880b706147f16e9b1dbb1e4e5947b5b02bc5e3" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ "either", ] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 6de9dfee..a4c77f2f 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -24,7 +24,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } futures-util = { version = "0.3.23", default-features = false, features = ["std"] } generic-array = "0.14.6" home = "0.5.3" -itertools = "0.10.3" +itertools = "0.10.5" jobslot = { version = "0.2.1", features = ["tokio"] } log = { version = "0.4.17", features = ["std"] } miette = "5.3.0" From 569cc3816e97ff524973f3cbb1cea8215556871c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Sep 2022 06:01:33 +0000 Subject: [PATCH 0761/2020] Bump clap from 3.2.20 to 3.2.21 (#404) Bumps [clap](https://github.com/clap-rs/clap) from 3.2.20 to 3.2.21. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/v3.2.21/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v3.2.20...v3.2.21) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cde14aa2..cd09eecd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -267,9 +267,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.20" +version = "3.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b71c3ce99b7611011217b366d923f1d0a7e07a92bb2dbf1e84508c673ca3bd" +checksum = "1ed5341b2301a26ab80be5cbdced622e80ed808483c52e45e3310a877d3b37d7" dependencies = [ "atty", "bitflags", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index c99c2e6d..86e2df81 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.2.0" } -clap = { version = "3.2.17", features = ["derive"] } +clap = { version = "3.2.21", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index a4c77f2f..0a212b89 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -14,7 +14,7 @@ async-trait = "0.1.57" bytes = "1.2.1" bzip2 = "0.4.3" cargo_toml = "0.11.5" -clap = { version = "3.2.17", features = ["derive"] } +clap = { version = "3.2.21", features = ["derive"] } compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.2", path = "../detect-targets" } From f41eacf9f3623e00d7d94c7d565bd96645b440eb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Sep 2022 13:04:31 +1000 Subject: [PATCH 0762/2020] Bump jobslot from 0.2.1 to 0.2.6 (#411) Bumps [jobslot](https://github.com/cargo-bins/jobslot) from 0.2.1 to 0.2.6. - [Release notes](https://github.com/cargo-bins/jobslot/releases) - [Commits](https://github.com/cargo-bins/jobslot/compare/v0.2.1...v0.2.6) --- updated-dependencies: - dependency-name: jobslot dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 6 ++++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cd09eecd..6abeb1c7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -969,14 +969,16 @@ dependencies = [ [[package]] name = "jobslot" -version = "0.2.1" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0478230fe7c53cb89765785904f3cd9a1fb95f7d3261c343fe3248627e6060" +checksum = "d395750ec1a0237b64ce69634232669d352a2b2cf63120d567b5938b9cb17650" dependencies = [ "cfg-if", + "getrandom", "libc", "scopeguard", "tokio", + "winapi", ] [[package]] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 0a212b89..f47de407 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -25,7 +25,7 @@ futures-util = { version = "0.3.23", default-features = false, features = ["std" generic-array = "0.14.6" home = "0.5.3" itertools = "0.10.5" -jobslot = { version = "0.2.1", features = ["tokio"] } +jobslot = { version = "0.2.6", features = ["tokio"] } log = { version = "0.4.17", features = ["std"] } miette = "5.3.0" normalize-path = { version = "0.1.0", path = "../normalize-path" } From 47a663a03e0ef652ba028eea45ed7a2cf75090de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Sep 2022 03:24:20 +0000 Subject: [PATCH 0763/2020] Bump thiserror from 1.0.34 to 1.0.35 (#410) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.34 to 1.0.35. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.34...1.0.35) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6abeb1c7..81242aaa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1892,18 +1892,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c1b05ca9d106ba7d2e31a9dab4a64e7be2cce415321966ea3132c49a656e252" +checksum = "c53f98874615aea268107765aa1ed8f6116782501d18e53d08b471733bea6c85" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8f2591983642de85c921015f3f070c665a197ed69e417af436115e3a1407487" +checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index f47de407..f2d01f96 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -44,7 +44,7 @@ strum_macros = "0.24.3" #tar = "0.4.38" tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.3.0" -thiserror = "1.0.32" +thiserror = "1.0.35" tinytemplate = "1.2.1" tokio = { version = "1.21.1", features = ["macros", "rt", "process", "sync", "signal"], default-features = false } toml_edit = { version = "0.14.4", features = ["easy"] } From 9c649ff3167543a6da9a9a2e47adde7cdc56c16a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Sep 2022 03:39:59 +0000 Subject: [PATCH 0764/2020] Bump once_cell from 1.14.0 to 1.15.0 (#407) Bumps [once_cell](https://github.com/matklad/once_cell) from 1.14.0 to 1.15.0. - [Release notes](https://github.com/matklad/once_cell/releases) - [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md) - [Commits](https://github.com/matklad/once_cell/compare/v1.14.0...v1.15.0) --- updated-dependencies: - dependency-name: once_cell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81242aaa..b4b41ae3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1228,9 +1228,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" [[package]] name = "openssl" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index f2d01f96..1645b57a 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -29,7 +29,7 @@ jobslot = { version = "0.2.6", features = ["tokio"] } log = { version = "0.4.17", features = ["std"] } miette = "5.3.0" normalize-path = { version = "0.1.0", path = "../normalize-path" } -once_cell = "1.13.0" +once_cell = "1.15.0" reqwest = { version = "0.11.12", features = ["stream"], default-features = false } scopeguard = "1.1.0" semver = { version = "1.0.13", features = ["serde"] } From 6928dd63dc2738a3305c4fa434b90f8c17cd633c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Sep 2022 04:00:28 +0000 Subject: [PATCH 0765/2020] Bump clap from 3.2.21 to 3.2.22 (#409) Bumps [clap](https://github.com/clap-rs/clap) from 3.2.21 to 3.2.22. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/v3.2.22/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v3.2.21...v3.2.22) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b4b41ae3..ac9c57c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -267,9 +267,9 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.21" +version = "3.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ed5341b2301a26ab80be5cbdced622e80ed808483c52e45e3310a877d3b37d7" +checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" dependencies = [ "atty", "bitflags", @@ -1881,9 +1881,9 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1141d4d61095b28419e22cb0bbf02755f5e54e0526f97f1e3d1d160e60885fb" +checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" dependencies = [ "smawk", "unicode-linebreak", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 86e2df81..5cce623c 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.2.0" } -clap = { version = "3.2.21", features = ["derive"] } +clap = { version = "3.2.22", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 1645b57a..d61ece74 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -14,7 +14,7 @@ async-trait = "0.1.57" bytes = "1.2.1" bzip2 = "0.4.3" cargo_toml = "0.11.5" -clap = { version = "3.2.21", features = ["derive"] } +clap = { version = "3.2.22", features = ["derive"] } compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.2", path = "../detect-targets" } From 34e493927f37a946c535fbd3632a071423efaea7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Sep 2022 04:15:12 +0000 Subject: [PATCH 0766/2020] Bump serde from 1.0.144 to 1.0.145 (#408) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.144 to 1.0.145. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.144...v1.0.145) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ac9c57c9..cdbfba74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1666,9 +1666,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.144" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f747710de3dcd43b88c9168773254e809d8ddbdf9653b84e2554ab219f17860" +checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" dependencies = [ "serde_derive", ] @@ -1684,9 +1684,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.144" +version = "1.0.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94ed3a816fb1d101812f83e789f888322c34e291f894f19590dc310963e87a00" +checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index d61ece74..1f66c1d4 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -33,7 +33,7 @@ once_cell = "1.15.0" reqwest = { version = "0.11.12", features = ["stream"], default-features = false } scopeguard = "1.1.0" semver = { version = "1.0.13", features = ["serde"] } -serde = { version = "1.0.143", features = ["derive"] } +serde = { version = "1.0.145", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.83" strum = "0.24.1" From cd3afdd9a32e8eb3a575d9b52a9ebbe1c56f6ac9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 24 Sep 2022 11:18:47 +1000 Subject: [PATCH 0767/2020] Bump dep `cargo_toml` to v0.12.0 (#413) * Bump dep cargo_toml to v0.12.0 * FIx compilation error * Fix test parse-meta Signed-off-by: Jiahao XU --- Cargo.lock | 5 ++--- crates/binstalk/Cargo.toml | 2 +- crates/binstalk/src/drivers/crates_io/vfs.rs | 6 ------ crates/binstalk/tests/parse-meta.rs | 2 +- 4 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cdbfba74..78f1a3bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -221,12 +221,11 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.11.5" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5809dd3e6444651fd1cdd3dbec71eca438c439a0fcc8081674a14da0afe50185" +checksum = "1aecd74f843e919090741163a59948751f6f57b5a9b3d7a4a4d278e17b6a16cf" dependencies = [ "serde", - "serde_derive", "toml", ] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 1f66c1d4..f2a10af4 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0" async-trait = "0.1.57" bytes = "1.2.1" bzip2 = "0.4.3" -cargo_toml = "0.11.5" +cargo_toml = "0.12.0" clap = { version = "3.2.22", features = ["derive"] } compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } diff --git a/crates/binstalk/src/drivers/crates_io/vfs.rs b/crates/binstalk/src/drivers/crates_io/vfs.rs index d0ae6a6b..3919b5ed 100644 --- a/crates/binstalk/src/drivers/crates_io/vfs.rs +++ b/crates/binstalk/src/drivers/crates_io/vfs.rs @@ -41,9 +41,3 @@ impl AbstractFilesystem for Vfs { Ok(self.0.get(&*rel_path).map(Clone::clone).unwrap_or_default()) } } - -impl AbstractFilesystem for &Vfs { - fn file_names_in(&self, rel_path: &str) -> io::Result>> { - (*self).file_names_in(rel_path) - } -} diff --git a/crates/binstalk/tests/parse-meta.rs b/crates/binstalk/tests/parse-meta.rs index 33ad6dff..2d9486fc 100644 --- a/crates/binstalk/tests/parse-meta.rs +++ b/crates/binstalk/tests/parse-meta.rs @@ -24,7 +24,7 @@ fn parse_meta() { &[Product { name: Some("cargo-binstall".to_string()), path: Some("src/main.rs".to_string()), - edition: Some(cargo_toml::Edition::E2021), + edition: cargo_toml::Edition::E2021, ..Default::default() },], ); From 480ca8ec19349fe9c4ca60e3b02e1c9f1885aab5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 24 Sep 2022 01:34:52 +0000 Subject: [PATCH 0768/2020] release: binstalk v0.2.1 (#414) (cargo-release) version 0.2.1 Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 78f1a3bb..0ae9aea7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,7 +77,7 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "binstalk" -version = "0.2.0" +version = "0.2.1" dependencies = [ "async-trait", "binstall-tar", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 5cce623c..f0257f3f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.2.0" } +binstalk = { path = "../binstalk", version = "0.2.1" } clap = { version = "3.2.22", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index f2a10af4..3eeef597 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.2.0" +version = "0.2.1" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From c86cba3cc4f601837284c6bccd061d33c736c7a4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 24 Sep 2022 14:21:58 +1200 Subject: [PATCH 0769/2020] release: cargo-binstall v0.13.2 (#415) Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0ae9aea7..5108ce86 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -202,7 +202,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.13.1" +version = "0.13.2" dependencies = [ "binstalk", "clap", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index f0257f3f..7b10d980 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.13.1" +version = "0.13.2" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 8fa967fa..66e5844c 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From ae9f5364005102bc460fda4c0a9423a58dfbfe03 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 25 Sep 2022 13:01:57 +1000 Subject: [PATCH 0770/2020] Fix/dep cargo_toml: Bump to v0.12.1 (#418) * Fix `cargo_toml`: Bump dep to v0.12.1 * Test `cargo-watch` in CI * Fix `*-test-Cargo.toml` used in integration tests Signed-off-by: Jiahao XU --- .github/scripts/{ => cargo-tomls}/bitbucket-test-Cargo.toml | 1 + .github/scripts/{ => cargo-tomls}/github-test-Cargo.toml | 1 + .github/scripts/{ => cargo-tomls}/gitlab-test-Cargo.toml | 1 + .github/scripts/tests.sh | 5 +++-- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 6 files changed, 9 insertions(+), 5 deletions(-) rename .github/scripts/{ => cargo-tomls}/bitbucket-test-Cargo.toml (94%) rename .github/scripts/{ => cargo-tomls}/github-test-Cargo.toml (94%) rename .github/scripts/{ => cargo-tomls}/gitlab-test-Cargo.toml (94%) diff --git a/.github/scripts/bitbucket-test-Cargo.toml b/.github/scripts/cargo-tomls/bitbucket-test-Cargo.toml similarity index 94% rename from .github/scripts/bitbucket-test-Cargo.toml rename to .github/scripts/cargo-tomls/bitbucket-test-Cargo.toml index dd0ff6bd..78a87cd0 100644 --- a/.github/scripts/bitbucket-test-Cargo.toml +++ b/.github/scripts/cargo-tomls/bitbucket-test-Cargo.toml @@ -13,3 +13,4 @@ bin-dir = "{ bin }{ binary-ext }" [[bin]] name = "cargo-binstall" +path = "src/main.rs" diff --git a/.github/scripts/github-test-Cargo.toml b/.github/scripts/cargo-tomls/github-test-Cargo.toml similarity index 94% rename from .github/scripts/github-test-Cargo.toml rename to .github/scripts/cargo-tomls/github-test-Cargo.toml index c472a060..aa47c496 100644 --- a/.github/scripts/github-test-Cargo.toml +++ b/.github/scripts/cargo-tomls/github-test-Cargo.toml @@ -13,3 +13,4 @@ bin-dir = "{ bin }{ binary-ext }" [[bin]] name = "cargo-binstall" +path = "src/main.rs" diff --git a/.github/scripts/gitlab-test-Cargo.toml b/.github/scripts/cargo-tomls/gitlab-test-Cargo.toml similarity index 94% rename from .github/scripts/gitlab-test-Cargo.toml rename to .github/scripts/cargo-tomls/gitlab-test-Cargo.toml index feea2041..133866ff 100644 --- a/.github/scripts/gitlab-test-Cargo.toml +++ b/.github/scripts/cargo-tomls/gitlab-test-Cargo.toml @@ -13,3 +13,4 @@ bin-dir = "{ bin }{ binary-ext }" [[bin]] name = "cargo-binstall" +path = "src/main.rs" diff --git a/.github/scripts/tests.sh b/.github/scripts/tests.sh index 40ee853c..40f09e06 100755 --- a/.github/scripts/tests.sh +++ b/.github/scripts/tests.sh @@ -7,14 +7,15 @@ unset CARGO_HOME # Install binaries using cargo-binstall # shellcheck disable=SC2086 -"./$1" binstall --log-level debug --no-confirm b3sum cargo-binstall +"./$1" binstall --log-level debug --no-confirm b3sum cargo-binstall cargo-watch # Test that the installed binaries can be run b3sum --version cargo-binstall --help >/dev/null cargo binstall --help >/dev/null +cargo watch -V -test_resources=".github/scripts" +test_resources=".github/scripts/cargo-tomls" # Install binaries using `--manifest-path` "./$1" binstall --force --log-level debug --manifest-path "$test_resources/gitlab-test-Cargo.toml" --no-confirm cargo-binstall diff --git a/Cargo.lock b/Cargo.lock index 5108ce86..b07937f8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -221,9 +221,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1aecd74f843e919090741163a59948751f6f57b5a9b3d7a4a4d278e17b6a16cf" +checksum = "c820ea238df9b9054d3401b1d441b4cd6f461646fc55cbc60fabf9d2088b7f3a" dependencies = [ "serde", "toml", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 3eeef597..834c0cd9 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0" async-trait = "0.1.57" bytes = "1.2.1" bzip2 = "0.4.3" -cargo_toml = "0.12.0" +cargo_toml = "0.12.1" clap = { version = "3.2.22", features = ["derive"] } compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } From 20ef4635c4e1f8419e9d9fb53edb33bab526cf19 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 25 Sep 2022 03:14:13 +0000 Subject: [PATCH 0771/2020] release: binstalk v0.2.2 (#419) (cargo-release) version 0.2.2 Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b07937f8..3ee964a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,7 +77,7 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "binstalk" -version = "0.2.1" +version = "0.2.2" dependencies = [ "async-trait", "binstall-tar", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 7b10d980..7eeee96f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.2.1" } +binstalk = { path = "../binstalk", version = "0.2.2" } clap = { version = "3.2.22", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 834c0cd9..ead2312e 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.2.1" +version = "0.2.2" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From c27c3b80b59d62fb23f83c4d9298070c1bfca03e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 25 Sep 2022 03:23:05 +0000 Subject: [PATCH 0772/2020] release: cargo-binstall v0.13.3 (#420) Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3ee964a8..6505294d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -202,7 +202,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.13.2" +version = "0.13.3" dependencies = [ "binstalk", "clap", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 7eeee96f..fb65a618 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.13.2" +version = "0.13.3" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 66e5844c..d95e7e19 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From e034d69e121b4ad5e169df0f5ee5e3bfec38eb01 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 25 Sep 2022 22:15:20 +1000 Subject: [PATCH 0773/2020] Impl try multiple default bin dirs (#417) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From @passcod : * Make bin-dir an Option * Use cargo-release as a test case * WIP: Try multiple default bin dirs * Update bins.rs * Update cargo_toml_binstall.rs From @NobodyXu : * Optimize & Prepare for support multi `bin-path`s * Ensure quickinstall bin_dir work as usual. * Rm dup entries in `FULL_FILENAMES` * Add second version of `NOVERSION_FILENAMES` * Impl multiple default `bin-dir`s * Improve doc for `BinFile::from_product` * Fix tests.sh Signed-off-by: Jiahao XU Co-authored-by: Félix Saparelli --- .github/scripts/tests.sh | 3 +- crates/binstalk/src/bins.rs | 40 ++++++++++++++++- crates/binstalk/src/fetchers.rs | 4 +- crates/binstalk/src/fetchers/gh_crate_meta.rs | 8 ++-- .../src/fetchers/gh_crate_meta/hosting.rs | 33 +++++++------- crates/binstalk/src/fetchers/quickinstall.rs | 1 + .../src/manifests/cargo_toml_binstall.rs | 21 ++------- crates/binstalk/src/ops/resolve.rs | 45 +++++++++---------- 8 files changed, 88 insertions(+), 67 deletions(-) diff --git a/.github/scripts/tests.sh b/.github/scripts/tests.sh index 40f09e06..ad49fb70 100755 --- a/.github/scripts/tests.sh +++ b/.github/scripts/tests.sh @@ -7,10 +7,11 @@ unset CARGO_HOME # Install binaries using cargo-binstall # shellcheck disable=SC2086 -"./$1" binstall --log-level debug --no-confirm b3sum cargo-binstall cargo-watch +"./$1" binstall --log-level debug --no-confirm b3sum cargo-release cargo-binstall cargo-watch # Test that the installed binaries can be run b3sum --version +cargo-release release --version cargo-binstall --help >/dev/null cargo binstall --help >/dev/null cargo watch -V diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 43d20db2..cb66bbf3 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -1,4 +1,7 @@ -use std::path::{Path, PathBuf}; +use std::{ + borrow::Cow, + path::{Path, PathBuf}, +}; use cargo_toml::Product; use compact_str::CompactString; @@ -20,6 +23,8 @@ pub struct BinFile { } impl BinFile { + /// Must be called after the archive is downloaded and extracted. + /// This function might uses blocking I/O. pub fn from_product(data: &Data, product: &Product) -> Result { let base_name = CompactString::from(product.name.clone().unwrap()); @@ -41,7 +46,38 @@ impl BinFile { // Generate install paths // Source path is the download dir + the generated binary path - let source_file_path = ctx.render(&data.meta.bin_dir)?; + let source_file_path = if let Some(bin_dir) = &data.meta.bin_dir { + ctx.render(bin_dir)? + } else { + let name = ctx.name; + let target = ctx.target; + let version = ctx.version; + let bin = ctx.bin; + + // Make sure to update + // fetchers::gh_crate_meta::hosting::{FULL_FILENAMES, + // NOVERSION_FILENAMES} if you update this array. + let possible_dirs = [ + format!("{name}-{target}-v{version}"), + format!("{name}-{target}-{version}"), + format!("{name}-{version}-{target}"), + format!("{name}-v{version}-{target}"), + format!("{name}-{target}"), + name.to_string(), + ]; + + let dir = possible_dirs + .into_iter() + .find(|dirname| Path::new(dirname).is_dir()) + .map(Cow::Owned) + // Fallback to no dir + .unwrap_or_else(|| Cow::Borrowed(".")); + + debug!("Using dir = {dir}"); + + format!("{dir}/{bin}{binary_ext}") + }; + let source = if data.meta.pkg_fmt == Some(PkgFmt::Bin) { data.bin_path.clone() } else { diff --git a/crates/binstalk/src/fetchers.rs b/crates/binstalk/src/fetchers.rs index ceebdb2e..650de1d8 100644 --- a/crates/binstalk/src/fetchers.rs +++ b/crates/binstalk/src/fetchers.rs @@ -11,8 +11,8 @@ use crate::{ manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; -mod gh_crate_meta; -mod quickinstall; +pub(crate) mod gh_crate_meta; +pub(crate) mod quickinstall; #[async_trait::async_trait] pub trait Fetcher: Send + Sync { diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 54842ce4..46a42ae4 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -22,7 +22,7 @@ use crate::{ use super::Data; -mod hosting; +pub(crate) mod hosting; use hosting::RepositoryHost; pub struct GhCrateMeta { @@ -143,10 +143,10 @@ impl super::Fetcher for GhCrateMeta { } async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { - let (url, _pkg_fmt) = self.resolution.get().unwrap(); // find() is called first - debug!("Downloading package from: '{url}'"); + let (url, pkg_fmt) = self.resolution.get().unwrap(); // find() is called first + debug!("Downloading package from: '{url}' dst:{dst:?} fmt:{pkg_fmt:?}"); Download::new(self.client.clone(), url.clone()) - .and_extract(self.pkg_fmt(), dst) + .and_extract(*pkg_fmt, dst) .await } diff --git a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs index 521e062c..2c491d5e 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs @@ -11,6 +11,20 @@ pub enum RepositoryHost { Unknown, } +/// Make sure to update possible_dirs in `bins::BinFile` +/// if you modified FULL_FILENAMES or NOVERSION_FILENAMES. +pub const FULL_FILENAMES: &[&str] = &[ + "{ name }-{ target }-v{ version }.{ archive-format }", + "{ name }-{ target }-{ version }.{ archive-format }", + "{ name }-{ version }-{ target }.{ archive-format }", + "{ name }-v{ version }-{ target }.{ archive-format }", +]; + +pub const NOVERSION_FILENAMES: &[&str] = &[ + "{ name }-{ target }.{ archive-format }", + "{ name }.{ archive-format }", +]; + impl RepositoryHost { pub fn guess_git_hosting_services(repo: &Url) -> Result { use RepositoryHost::*; @@ -27,35 +41,24 @@ impl RepositoryHost { pub fn get_default_pkg_url_template(self) -> Option> { use RepositoryHost::*; - let full_filenames = &[ - "{ name }-{ target }-v{ version }.{ archive-format }", - "{ name }-{ target }-{ version }.{ archive-format }", - "{ name }-{ version }-{ target }.{ archive-format }", - "{ name }-v{ version }-{ target }.{ archive-format }", - "{ name }-{ version }-{ target }.{ archive-format }", - "{ name }-v{ version }-{ target }.{ archive-format }", - ]; - - let noversion_filenames = &["{ name }-{ target }.{ archive-format }"]; - match self { GitHub => Some(apply_filenames_to_paths( &[ "{ repo }/releases/download/{ version }", "{ repo }/releases/download/v{ version }", ], - &[full_filenames, noversion_filenames], + &[FULL_FILENAMES, NOVERSION_FILENAMES], )), GitLab => Some(apply_filenames_to_paths( &[ "{ repo }/-/releases/{ version }/downloads/binaries", "{ repo }/-/releases/v{ version }/downloads/binaries", ], - &[full_filenames, noversion_filenames], + &[FULL_FILENAMES, NOVERSION_FILENAMES], )), BitBucket => Some(apply_filenames_to_paths( &["{ repo }/downloads"], - &[full_filenames], + &[FULL_FILENAMES], )), SourceForge => Some( apply_filenames_to_paths( @@ -63,7 +66,7 @@ impl RepositoryHost { "{ repo }/files/binaries/{ version }", "{ repo }/files/binaries/v{ version }", ], - &[full_filenames, noversion_filenames], + &[FULL_FILENAMES, NOVERSION_FILENAMES], ) .into_iter() .map(|url| format!("{url}/download")) diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs index d7d539a1..6613d308 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk/src/fetchers/quickinstall.rs @@ -61,6 +61,7 @@ impl super::Fetcher for QuickInstall { fn target_meta(&self) -> PkgMeta { let mut meta = self.data.meta.clone(); meta.pkg_fmt = Some(self.pkg_fmt()); + meta.bin_dir = Some("{ bin }{ binary-ext }".to_string()); meta } diff --git a/crates/binstalk/src/manifests/cargo_toml_binstall.rs b/crates/binstalk/src/manifests/cargo_toml_binstall.rs index 21950214..a8b023b8 100644 --- a/crates/binstalk/src/manifests/cargo_toml_binstall.rs +++ b/crates/binstalk/src/manifests/cargo_toml_binstall.rs @@ -11,9 +11,6 @@ pub use package_formats::*; mod package_formats; -/// Default binary name template (may be overridden in package Cargo.toml) -pub const DEFAULT_BIN_DIR: &str = "{ name }-{ target }-v{ version }/{ bin }{ binary-ext }"; - /// `binstall` metadata container /// /// Required to nest metadata under `package.metadata.binstall` @@ -26,7 +23,7 @@ pub struct Meta { /// Metadata for binary installation use. /// /// Exposed via `[package.metadata]` in `Cargo.toml` -#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[derive(Clone, Debug, Default, Eq, PartialEq, Serialize, Deserialize)] #[serde(rename_all = "kebab-case", default)] pub struct PkgMeta { /// URL template for package downloads @@ -36,7 +33,7 @@ pub struct PkgMeta { pub pkg_fmt: Option, /// Path template for binary files in packages - pub bin_dir: String, + pub bin_dir: Option, /// Public key for package verification (base64 encoded) pub pub_key: Option, @@ -45,18 +42,6 @@ pub struct PkgMeta { pub overrides: BTreeMap, } -impl Default for PkgMeta { - fn default() -> Self { - Self { - pkg_url: None, - pkg_fmt: None, - bin_dir: DEFAULT_BIN_DIR.to_string(), - pub_key: None, - overrides: BTreeMap::new(), - } - } -} - impl PkgMeta { pub fn clone_without_overrides(&self) -> Self { Self { @@ -77,7 +62,7 @@ impl PkgMeta { self.pkg_fmt = Some(*o); } if let Some(o) = &pkg_override.bin_dir { - self.bin_dir = o.clone(); + self.bin_dir = Some(o.clone()); } } } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 2dc48cac..b59f848e 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -176,6 +176,11 @@ async fn resolve_inner( manifest.bin, ); + // Check binaries + if binaries.is_empty() { + return Err(BinstallError::UnspecifiedBinaries); + } + let desired_targets = opts.desired_targets.get().await; let mut handles: Vec<(Arc, _)> = Vec::with_capacity(desired_targets.len() * 2); @@ -229,7 +234,7 @@ async fn resolve_inner( &bin_path, &package, &install_path, - binaries.clone(), + &binaries, ) .await { @@ -266,26 +271,17 @@ async fn resolve_inner( } /// * `fetcher` - `fetcher.find()` must return `Ok(true)`. +/// * `binaries` - must not be empty async fn download_extract_and_verify( fetcher: &dyn Fetcher, bin_path: &Path, package: &Package, install_path: &Path, - // TODO: Use &[Product] - binaries: Vec, + binaries: &[Product], ) -> Result, BinstallError> { // Build final metadata let meta = fetcher.target_meta(); - let bin_files = collect_bin_files( - fetcher, - package, - meta, - binaries, - bin_path.to_path_buf(), - install_path.to_path_buf(), - )?; - // Download and extract it. // If that fails, then ignore this fetcher. fetcher.fetch_and_extract(bin_path).await?; @@ -316,6 +312,15 @@ async fn download_extract_and_verify( // Verify that all the bin_files exist block_in_place(|| { + let bin_files = collect_bin_files( + fetcher, + package, + meta, + binaries, + bin_path.to_path_buf(), + install_path.to_path_buf(), + )?; + for bin_file in bin_files.iter() { bin_file.check_source_exists()?; } @@ -324,25 +329,15 @@ async fn download_extract_and_verify( }) } +/// * `binaries` - must not be empty fn collect_bin_files( fetcher: &dyn Fetcher, package: &Package, - mut meta: PkgMeta, - binaries: Vec, + meta: PkgMeta, + binaries: &[Product], bin_path: PathBuf, install_path: PathBuf, ) -> Result, BinstallError> { - // Update meta - if fetcher.source_name() == "QuickInstall" { - // TODO: less of a hack? - meta.bin_dir = "{ bin }{ binary-ext }".to_string(); - } - - // Check binaries - if binaries.is_empty() { - return Err(BinstallError::UnspecifiedBinaries); - } - // List files to be installed // based on those found via Cargo.toml let bin_data = bins::Data { From 3da5cb9d9cf49e64b8186785eac8a9364f708a37 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 25 Sep 2022 23:32:34 +1000 Subject: [PATCH 0774/2020] Check `source_file_path` to ensure it is valid (#421) * Add new variant `BinstallError::DuplicateSourceFilePath` * Check `bin.source` in `collect_bin_files` * Add new variant `BinstallError::InvalidSourceFilePath` * Make sure generated source_file_path cannot access outside curdir * Add new variant `BinstallError::EmptySourceFilePath` * Ensure source_file_path is not empty Signed-off-by: Jiahao XU --- crates/binstalk/src/bins.rs | 33 ++++++++++++++++++++++++++++-- crates/binstalk/src/errors.rs | 30 +++++++++++++++++++++++++++ crates/binstalk/src/ops/resolve.rs | 11 ++++++++++ 3 files changed, 72 insertions(+), 2 deletions(-) diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index cb66bbf3..4d897184 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -1,11 +1,12 @@ use std::{ borrow::Cow, - path::{Path, PathBuf}, + path::{Component, Path, PathBuf}, }; use cargo_toml::Product; use compact_str::CompactString; use log::debug; +use normalize_path::NormalizePath; use serde::Serialize; use tinytemplate::TinyTemplate; @@ -15,6 +16,18 @@ use crate::{ manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; +/// Return true if the path does not look outside of current dir +/// +/// * `path` - must be normalized before passing to this function +fn is_valid_path(path: &Path) -> bool { + !matches!( + path.components().next(), + // normalized path cannot have curdir or parentdir, + // so checking prefix/rootdir is enough. + Some(Component::Prefix(..) | Component::RootDir) + ) +} + pub struct BinFile { pub base_name: CompactString, pub source: PathBuf, @@ -47,7 +60,23 @@ impl BinFile { // Generate install paths // Source path is the download dir + the generated binary path let source_file_path = if let Some(bin_dir) = &data.meta.bin_dir { - ctx.render(bin_dir)? + let path = ctx.render(bin_dir)?; + let path_normalized = Path::new(&path).normalize(); + + if path_normalized.components().next().is_none() { + return Err(BinstallError::EmptySourceFilePath); + } + + if !is_valid_path(&path_normalized) { + return Err(BinstallError::InvalidSourceFilePath { + path: path_normalized.into_owned(), + }); + } + + match path_normalized { + Cow::Borrowed(..) => path, + Cow::Owned(path) => path.to_string_lossy().into_owned(), + } } else { let name = ctx.name; let target = ctx.target; diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index 0ebe41f8..a1abe80d 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -284,6 +284,33 @@ pub enum BinstallError { #[diagnostic(severity(error), code(binstall::cargo_manifest))] CargoTomlMissingPackage(CompactString), + /// bin-dir configuration provided generates duplicate source path. + /// + /// - Code: `binstall::cargo_manifest` + /// - Exit: 90 + #[error("bin-dir configuration provided generates duplicate source path: {path}")] + #[diagnostic(severity(error), code(binstall::SourceFilePath))] + DuplicateSourceFilePath { path: PathBuf }, + + /// bin-dir configuration provided generates source path outside + /// of the temporary dir. + /// + /// - Code: `binstall::cargo_manifest` + /// - Exit: 91 + #[error( + "bin-dir configuration provided generates source path outside of the temporary dir: {path}" + )] + #[diagnostic(severity(error), code(binstall::SourceFilePath))] + InvalidSourceFilePath { path: PathBuf }, + + /// bin-dir configuration provided generates empty source path. + /// + /// - Code: `binstall::cargo_manifest` + /// - Exit: 92 + #[error("bin-dir configuration provided generates empty source path")] + #[diagnostic(severity(error), code(binstall::SourceFilePath))] + EmptySourceFilePath, + /// A wrapped error providing the context of which crate the error is about. #[error("for crate {crate_name}")] CrateContext { @@ -319,6 +346,9 @@ impl BinstallError { NoViableTargets => 87, BinFileNotFound(_) => 88, CargoTomlMissingPackage(_) => 89, + DuplicateSourceFilePath { .. } => 90, + InvalidSourceFilePath { .. } => 91, + EmptySourceFilePath => 92, CrateContext { error, .. } => error.exit_number(), }; diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index b59f848e..4addb38c 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -1,4 +1,5 @@ use std::{ + collections::BTreeSet, path::{Path, PathBuf}, sync::Arc, }; @@ -356,6 +357,16 @@ fn collect_bin_files( .map(|p| bins::BinFile::from_product(&bin_data, p)) .collect::, BinstallError>>()?; + let mut source_set = BTreeSet::new(); + + for bin in &bin_files { + if !source_set.insert(&bin.source) { + return Err(BinstallError::DuplicateSourceFilePath { + path: bin.source.clone(), + }); + } + } + Ok(bin_files) } From 2cc12f9b69bdf56f6ab4d001781e4598a1fc04a8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 26 Sep 2022 06:39:41 +1000 Subject: [PATCH 0775/2020] Optimize `bins::BinFile` (#422) * Extract `infer_bin_dir_template` and call it once in `collect_bin_files` * Ensure `product.name.is_some()` is true * Avoid cloning `str` in `BinFile::from_product` * Optimize: Take reference in `bins::Data` * Optimize: Construct `CompactString` only when needed Signed-off-by: Jiahao XU --- crates/binstalk/src/bins.rs | 121 +++++++++--------- .../src/fetchers/gh_crate_meta/hosting.rs | 2 +- crates/binstalk/src/ops/resolve.rs | 22 +++- 3 files changed, 81 insertions(+), 64 deletions(-) diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 4d897184..9fd74d40 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -28,6 +28,40 @@ fn is_valid_path(path: &Path) -> bool { ) } +/// Must be called after the archive is downloaded and extracted. +/// This function might uses blocking I/O. +pub fn infer_bin_dir_template(data: &Data) -> Cow<'static, str> { + let name = &data.name; + let target = &data.target; + let version = &data.version; + + // Make sure to update + // fetchers::gh_crate_meta::hosting::{FULL_FILENAMES, + // NOVERSION_FILENAMES} if you update this array. + let possible_dirs = [ + format!("{name}-{target}-v{version}"), + format!("{name}-{target}-{version}"), + format!("{name}-{version}-{target}"), + format!("{name}-v{version}-{target}"), + format!("{name}-{target}"), + name.to_string(), + ]; + + let default_bin_dir_template = Cow::Borrowed("{ bin }{ binary_ext }"); + + possible_dirs + .into_iter() + .find(|dirname| Path::new(dirname).is_dir()) + .map(|mut dir| { + dir.reserve_exact(1 + default_bin_dir_template.len()); + dir += "/"; + dir += &default_bin_dir_template; + Cow::Owned(dir) + }) + // Fallback to no dir + .unwrap_or(default_bin_dir_template) +} + pub struct BinFile { pub base_name: CompactString, pub source: PathBuf, @@ -36,10 +70,12 @@ pub struct BinFile { } impl BinFile { - /// Must be called after the archive is downloaded and extracted. - /// This function might uses blocking I/O. - pub fn from_product(data: &Data, product: &Product) -> Result { - let base_name = CompactString::from(product.name.clone().unwrap()); + pub fn from_product( + data: &Data<'_>, + product: &Product, + bin_dir: &str, + ) -> Result { + let base_name = product.name.as_deref().unwrap(); let binary_ext = if data.target.contains("windows") { ".exe" @@ -48,63 +84,34 @@ impl BinFile { }; let ctx = Context { - name: &data.name, - repo: data.repo.as_ref().map(|s| &s[..]), - target: &data.target, - version: &data.version, - bin: &base_name, + name: data.name, + repo: data.repo, + target: data.target, + version: data.version, + bin: base_name, format: binary_ext, binary_ext, }; // Generate install paths // Source path is the download dir + the generated binary path - let source_file_path = if let Some(bin_dir) = &data.meta.bin_dir { - let path = ctx.render(bin_dir)?; - let path_normalized = Path::new(&path).normalize(); + let path = ctx.render(bin_dir)?; - if path_normalized.components().next().is_none() { - return Err(BinstallError::EmptySourceFilePath); - } + let path_normalized = Path::new(&path).normalize(); - if !is_valid_path(&path_normalized) { - return Err(BinstallError::InvalidSourceFilePath { - path: path_normalized.into_owned(), - }); - } + if path_normalized.components().next().is_none() { + return Err(BinstallError::EmptySourceFilePath); + } - match path_normalized { - Cow::Borrowed(..) => path, - Cow::Owned(path) => path.to_string_lossy().into_owned(), - } - } else { - let name = ctx.name; - let target = ctx.target; - let version = ctx.version; - let bin = ctx.bin; + if !is_valid_path(&path_normalized) { + return Err(BinstallError::InvalidSourceFilePath { + path: path_normalized.into_owned(), + }); + } - // Make sure to update - // fetchers::gh_crate_meta::hosting::{FULL_FILENAMES, - // NOVERSION_FILENAMES} if you update this array. - let possible_dirs = [ - format!("{name}-{target}-v{version}"), - format!("{name}-{target}-{version}"), - format!("{name}-{version}-{target}"), - format!("{name}-v{version}-{target}"), - format!("{name}-{target}"), - name.to_string(), - ]; - - let dir = possible_dirs - .into_iter() - .find(|dirname| Path::new(dirname).is_dir()) - .map(Cow::Owned) - // Fallback to no dir - .unwrap_or_else(|| Cow::Borrowed(".")); - - debug!("Using dir = {dir}"); - - format!("{dir}/{bin}{binary_ext}") + let source_file_path = match path_normalized { + Cow::Borrowed(..) => path, + Cow::Owned(path) => path.to_string_lossy().into_owned(), }; let source = if data.meta.pkg_fmt == Some(PkgFmt::Bin) { @@ -123,7 +130,7 @@ impl BinFile { .join(&ctx.render("{ bin }{ binary-ext }")?); Ok(Self { - base_name, + base_name: CompactString::from(base_name), source, dest, link, @@ -199,11 +206,11 @@ impl BinFile { } /// Data required to get bin paths -pub struct Data { - pub name: String, - pub target: String, - pub version: String, - pub repo: Option, +pub struct Data<'a> { + pub name: &'a str, + pub target: &'a str, + pub version: &'a str, + pub repo: Option<&'a str>, pub meta: PkgMeta, pub bin_path: PathBuf, pub install_path: PathBuf, diff --git a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs index 2c491d5e..a48910d0 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs @@ -11,7 +11,7 @@ pub enum RepositoryHost { Unknown, } -/// Make sure to update possible_dirs in `bins::BinFile` +/// Make sure to update possible_dirs in `bins::infer_bin_dir_template` /// if you modified FULL_FILENAMES or NOVERSION_FILENAMES. pub const FULL_FILENAMES: &[&str] = &[ "{ name }-{ target }-v{ version }.{ archive-format }", diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 4addb38c..8310072e 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -1,4 +1,5 @@ use std::{ + borrow::Cow, collections::BTreeSet, path::{Path, PathBuf}, sync::Arc, @@ -168,7 +169,7 @@ async fn resolve_inner( } } - let (meta, binaries) = ( + let (meta, mut binaries) = ( package .metadata .as_ref() @@ -177,6 +178,8 @@ async fn resolve_inner( manifest.bin, ); + binaries.retain(|product| product.name.is_some()); + // Check binaries if binaries.is_empty() { return Err(BinstallError::UnspecifiedBinaries); @@ -342,19 +345,26 @@ fn collect_bin_files( // List files to be installed // based on those found via Cargo.toml let bin_data = bins::Data { - name: package.name.clone(), - target: fetcher.target().to_string(), - version: package.version.clone(), - repo: package.repository.clone(), + name: &package.name, + target: fetcher.target(), + version: &package.version, + repo: package.repository.as_deref(), meta, bin_path, install_path, }; + let bin_dir = bin_data + .meta + .bin_dir + .as_deref() + .map(Cow::Borrowed) + .unwrap_or_else(|| bins::infer_bin_dir_template(&bin_data)); + // Create bin_files let bin_files = binaries .iter() - .map(|p| bins::BinFile::from_product(&bin_data, p)) + .map(|p| bins::BinFile::from_product(&bin_data, p, &bin_dir)) .collect::, BinstallError>>()?; let mut source_set = BTreeSet::new(); From 8414a45ade547da684971f0433edea296d54c5e7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 02:19:10 +0000 Subject: [PATCH 0776/2020] Bump url from 2.3.0 to 2.3.1 (#424) Bumps [url](https://github.com/servo/rust-url) from 2.3.0 to 2.3.1. - [Release notes](https://github.com/servo/rust-url/releases) - [Commits](https://github.com/servo/rust-url/compare/v2.3.0...v2.3.1) --- updated-dependencies: - dependency-name: url dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 27 ++++++++++++++++++--------- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6505294d..17d5931e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -578,11 +578,10 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" dependencies = [ - "matches", "percent-encoding", ] @@ -893,6 +892,16 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "indexmap" version = "1.9.1" @@ -1313,9 +1322,9 @@ dependencies = [ [[package]] name = "percent-encoding" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" +checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pin-project-lite" @@ -2081,7 +2090,7 @@ dependencies = [ "futures-util", "h2", "http", - "idna", + "idna 0.2.3", "ipnet", "lazy_static", "log", @@ -2181,12 +2190,12 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22fe195a4f217c25b25cb5058ced57059824a678474874038dc88d211bf508d3" +checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" dependencies = [ "form_urlencoded", - "idna", + "idna 0.3.0", "percent-encoding", "serde", ] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index ead2312e..8d3f12d4 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -49,7 +49,7 @@ tinytemplate = "1.2.1" tokio = { version = "1.21.1", features = ["macros", "rt", "process", "sync", "signal"], default-features = false } toml_edit = { version = "0.14.4", features = ["easy"] } trust-dns-resolver = { version = "0.21.2", optional = true, default-features = false, features = ["dnssec-ring"] } -url = { version = "2.3.0", features = ["serde"] } +url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" # Use a fork here since upstream has not published a new release for a long time From f2e610c55f997da0a1afd544600b0910871a0a7c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 02:42:15 +0000 Subject: [PATCH 0777/2020] Bump thiserror from 1.0.35 to 1.0.36 (#426) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.35 to 1.0.36. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.35...1.0.36) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 17d5931e..baa91a7f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1900,18 +1900,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c53f98874615aea268107765aa1ed8f6116782501d18e53d08b471733bea6c85" +checksum = "0a99cb8c4b9a8ef0e7907cd3b617cc8dc04d571c4e73c8ae403d80ac160bb122" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8b463991b4eab2d801e724172285ec4195c650e8ec79b149e6c2a8e6dd3f783" +checksum = "3a891860d3c8d66fec8e73ddb3765f90082374dbaaa833407b904a94f1a7eb43" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 8d3f12d4..67e50c0b 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -44,7 +44,7 @@ strum_macros = "0.24.3" #tar = "0.4.38" tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.3.0" -thiserror = "1.0.35" +thiserror = "1.0.36" tinytemplate = "1.2.1" tokio = { version = "1.21.1", features = ["macros", "rt", "process", "sync", "signal"], default-features = false } toml_edit = { version = "0.14.4", features = ["easy"] } From 4135cc412aed5407058d9f43a7aa1f49beb693e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 02:59:57 +0000 Subject: [PATCH 0778/2020] Bump cargo_toml from 0.12.1 to 0.12.2 (#425) Bumps [cargo_toml](https://gitlab.com/crates.rs/cargo_toml) from 0.12.1 to 0.12.2. - [Release notes](https://gitlab.com/crates.rs/cargo_toml/tags) - [Commits](https://gitlab.com/crates.rs/cargo_toml/commits/master) --- updated-dependencies: - dependency-name: cargo_toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index baa91a7f..57ec9aa7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -221,9 +221,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c820ea238df9b9054d3401b1d441b4cd6f461646fc55cbc60fabf9d2088b7f3a" +checksum = "ee685beed1fe2ab3cb9eb95d65727413b5e27f2b34014a3ea9c92053f8c230fc" dependencies = [ "serde", "toml", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 67e50c0b..b56cee04 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0" async-trait = "0.1.57" bytes = "1.2.1" bzip2 = "0.4.3" -cargo_toml = "0.12.1" +cargo_toml = "0.12.2" clap = { version = "3.2.22", features = ["derive"] } compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } From 9ebbf08c636383038bd8904999157fb3220b8743 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 03:17:12 +0000 Subject: [PATCH 0779/2020] Bump semver from 1.0.13 to 1.0.14 (#427) Bumps [semver](https://github.com/dtolnay/semver) from 1.0.13 to 1.0.14. - [Release notes](https://github.com/dtolnay/semver/releases) - [Commits](https://github.com/dtolnay/semver/compare/1.0.13...1.0.14) --- updated-dependencies: - dependency-name: semver dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 57ec9aa7..24d080c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1665,9 +1665,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f6841e709003d68bb2deee8c343572bf446003ec20a583e76f7b15cebf3711" +checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" dependencies = [ "serde", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index fb65a618..c7424abe 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -30,7 +30,7 @@ log = "0.4.17" miette = "5.3.0" mimalloc = { version = "0.1.29", default-features = false, optional = true } reqwest = { version = "0.11.12", default-features = false } -semver = "1.0.13" +semver = "1.0.14" simplelog = "0.12.0" tempfile = "3.3.0" tokio = { version = "1.21.1", features = ["rt-multi-thread"], default-features = false } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index b56cee04..02ac773e 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -32,7 +32,7 @@ normalize-path = { version = "0.1.0", path = "../normalize-path" } once_cell = "1.15.0" reqwest = { version = "0.11.12", features = ["stream"], default-features = false } scopeguard = "1.1.0" -semver = { version = "1.0.13", features = ["serde"] } +semver = { version = "1.0.14", features = ["serde"] } serde = { version = "1.0.145", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.83" From 417143e44dedc045671e5e11c3f36d54fb8cdd7a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 Sep 2022 03:33:10 +0000 Subject: [PATCH 0780/2020] Bump env_logger from 0.9.0 to 0.9.1 (#428) Bumps [env_logger](https://github.com/env-logger-rs/env_logger) from 0.9.0 to 0.9.1. - [Release notes](https://github.com/env-logger-rs/env_logger/releases) - [Changelog](https://github.com/env-logger-rs/env_logger/blob/main/CHANGELOG.md) - [Commits](https://github.com/env-logger-rs/env_logger/compare/v0.9.0...v0.9.1) --- updated-dependencies: - dependency-name: env_logger dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 24d080c3..aa250d86 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -491,9 +491,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +checksum = "c90bf5f19754d10198ccb95b70664fc925bd1fc090a0fd9a6ebc54acc8cd6272" dependencies = [ "atty", "humantime", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 02ac773e..d26fe9b1 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -70,7 +70,7 @@ zip = { package = "binstall-zip", version = "0.6.3", default-features = false, f zstd = { version = "0.11.2", default-features = false } [dev-dependencies] -env_logger = "0.9.0" +env_logger = "0.9.1" [features] default = ["static", "rustls"] From b8d2184ee9d2ca4f87284fd1abfde9104a93a3de Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 26 Sep 2022 16:05:14 +1000 Subject: [PATCH 0781/2020] Optimize applying `PkgOverride`s into `PkgMeta` (#429) * Refactor: Rm `PkgMeta::clone_without_overrides` * Impl new fn `PkgMeta::merge_overrides` to avoid unnecessary clone Signed-off-by: Jiahao XU --- .../src/manifests/cargo_toml_binstall.rs | 40 ++++++++++++++----- crates/binstalk/src/ops/resolve.rs | 13 +++--- 2 files changed, 36 insertions(+), 17 deletions(-) diff --git a/crates/binstalk/src/manifests/cargo_toml_binstall.rs b/crates/binstalk/src/manifests/cargo_toml_binstall.rs index a8b023b8..9e785f20 100644 --- a/crates/binstalk/src/manifests/cargo_toml_binstall.rs +++ b/crates/binstalk/src/manifests/cargo_toml_binstall.rs @@ -43,16 +43,6 @@ pub struct PkgMeta { } impl PkgMeta { - pub fn clone_without_overrides(&self) -> Self { - Self { - pkg_url: self.pkg_url.clone(), - pkg_fmt: self.pkg_fmt, - bin_dir: self.bin_dir.clone(), - pub_key: self.pub_key.clone(), - overrides: BTreeMap::new(), - } - } - /// Merge configuration overrides into object pub fn merge(&mut self, pkg_override: &PkgOverride) { if let Some(o) = &pkg_override.pkg_url { @@ -65,6 +55,36 @@ impl PkgMeta { self.bin_dir = Some(o.clone()); } } + + /// Merge configuration overrides into object + /// + /// * `pkg_overrides` - ordered in preference + pub fn merge_overrides<'a, It>(&self, pkg_overrides: It) -> Self + where + It: IntoIterator + Clone, + { + Self { + pkg_url: pkg_overrides + .clone() + .into_iter() + .find_map(|pkg_override| pkg_override.pkg_url.clone()) + .or_else(|| self.pkg_url.clone()), + + pkg_fmt: pkg_overrides + .clone() + .into_iter() + .find_map(|pkg_override| pkg_override.pkg_fmt) + .or(self.pkg_fmt), + + bin_dir: pkg_overrides + .into_iter() + .find_map(|pkg_override| pkg_override.bin_dir.clone()) + .or_else(|| self.bin_dir.clone()), + + pub_key: self.pub_key.clone(), + overrides: Default::default(), + } + } } /// Target specific overrides for binary installation diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 8310072e..d5a16b99 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -1,6 +1,7 @@ use std::{ borrow::Cow, collections::BTreeSet, + iter, mem, path::{Path, PathBuf}, sync::Arc, }; @@ -169,7 +170,7 @@ async fn resolve_inner( } } - let (meta, mut binaries) = ( + let (mut meta, mut binaries) = ( package .metadata .as_ref() @@ -189,19 +190,17 @@ async fn resolve_inner( let mut handles: Vec<(Arc, _)> = Vec::with_capacity(desired_targets.len() * 2); + let overrides = mem::take(&mut meta.overrides); + handles.extend( desired_targets .iter() .map(|target| { debug!("Building metadata for target: {target}"); - let mut target_meta = meta.clone_without_overrides(); - // Merge any overrides - if let Some(o) = meta.overrides.get(target) { - target_meta.merge(o); - } + let target_meta = meta + .merge_overrides(iter::once(&opts.cli_overrides).chain(overrides.get(target))); - target_meta.merge(&opts.cli_overrides); debug!("Found metadata: {target_meta:?}"); Arc::new(Data { From ac5efc88fca0ba874250474f7e46fb7f69165980 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Sep 2022 12:14:17 +1000 Subject: [PATCH 0782/2020] Bump digest from 0.10.3 to 0.10.5 (#431) Bumps [digest](https://github.com/RustCrypto/traits) from 0.10.3 to 0.10.5. - [Release notes](https://github.com/RustCrypto/traits/releases) - [Commits](https://github.com/RustCrypto/traits/compare/digest-v0.10.3...digest-v0.10.5) --- updated-dependencies: - dependency-name: digest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aa250d86..b4d80b84 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -421,9 +421,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.3" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2fb860ca6fafa5552fb6d0e816a69c8e49f0908bf524e30a90d97c85892d506" +checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" dependencies = [ "block-buffer", "crypto-common", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index d26fe9b1..afad26ae 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -18,7 +18,7 @@ clap = { version = "3.2.22", features = ["derive"] } compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.2", path = "../detect-targets" } -digest = "0.10.3" +digest = "0.10.5" flate2 = { version = "1.0.24", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } futures-util = { version = "0.3.23", default-features = false, features = ["std"] } From f824adeb0630e628918785a30ac40e64013a3d59 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 28 Sep 2022 08:17:57 +1000 Subject: [PATCH 0783/2020] Enable feat gzip, brotli & deflate of dep reqwest (#434) So that downloading uncompressed binary can be faster for slow connection. Signed-off-by: Jiahao XU --- Cargo.lock | 51 ++++++++++++++++++++++++++++++++++++++ crates/binstalk/Cargo.toml | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index b4d80b84..a85e72e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,6 +26,35 @@ dependencies = [ "memchr", ] +[[package]] +name = "alloc-no-stdlib" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc7bb162ec39d46ab1ca8c77bf72e890535becd1751bb45f64c597edb4c8c6b3" + +[[package]] +name = "alloc-stdlib" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94fb8275041c72129eb51b7d0322c29b8387a0386127718b096429201a5d6ece" +dependencies = [ + "alloc-no-stdlib", +] + +[[package]] +name = "async-compression" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345fd392ab01f746c717b1357165b76f0b67a60192007b234058c9045fdcf695" +dependencies = [ + "brotli", + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", +] + [[package]] name = "async-trait" version = "0.1.57" @@ -161,6 +190,27 @@ dependencies = [ "generic-array", ] +[[package]] +name = "brotli" +version = "3.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", + "brotli-decompressor", +] + +[[package]] +name = "brotli-decompressor" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ad2d4653bf5ca36ae797b1f4bb4dbddb60ce49ca4aed8a2ce4829f60425b80" +dependencies = [ + "alloc-no-stdlib", + "alloc-stdlib", +] + [[package]] name = "bumpalo" version = "3.11.0" @@ -1480,6 +1530,7 @@ version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" dependencies = [ + "async-compression", "base64", "bytes", "encoding_rs", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index afad26ae..d02e4e2a 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -30,7 +30,7 @@ log = { version = "0.4.17", features = ["std"] } miette = "5.3.0" normalize-path = { version = "0.1.0", path = "../normalize-path" } once_cell = "1.15.0" -reqwest = { version = "0.11.12", features = ["stream"], default-features = false } +reqwest = { version = "0.11.12", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } scopeguard = "1.1.0" semver = { version = "1.0.14", features = ["serde"] } serde = { version = "1.0.145", features = ["derive"] } From 5bb6344987e6e304c4cf4c204db24d37390a1918 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Sep 2022 01:54:15 +0000 Subject: [PATCH 0784/2020] Bump tokio from 1.21.1 to 1.21.2 (#436) Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.21.1 to 1.21.2. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.21.1...tokio-1.21.2) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 5 ++--- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a85e72e4..d90cab67 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2014,9 +2014,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.21.1" +version = "1.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0020c875007ad96677dcc890298f4b942882c5d4eb7cc8f439fc3bf813dc9c95" +checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" dependencies = [ "autocfg", "bytes", @@ -2024,7 +2024,6 @@ dependencies = [ "memchr", "mio", "num_cpus", - "once_cell", "pin-project-lite", "signal-hook-registry", "socket2", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index c7424abe..3a14be0e 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -33,7 +33,7 @@ reqwest = { version = "0.11.12", default-features = false } semver = "1.0.14" simplelog = "0.12.0" tempfile = "3.3.0" -tokio = { version = "1.21.1", features = ["rt-multi-thread"], default-features = false } +tokio = { version = "1.21.2", features = ["rt-multi-thread"], default-features = false } [build-dependencies] embed-resource = "1.7.3" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index d02e4e2a..6ec88aa6 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -46,7 +46,7 @@ tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.3.0" thiserror = "1.0.36" tinytemplate = "1.2.1" -tokio = { version = "1.21.1", features = ["macros", "rt", "process", "sync", "signal"], default-features = false } +tokio = { version = "1.21.2", features = ["macros", "rt", "process", "sync", "signal"], default-features = false } toml_edit = { version = "0.14.4", features = ["easy"] } trust-dns-resolver = { version = "0.21.2", optional = true, default-features = false, features = ["dnssec-ring"] } url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index ff72b51f..6a2d726e 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -10,11 +10,11 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -tokio = { version = "1.21.1", features = ["rt", "process", "sync"], default-features = false } +tokio = { version = "1.21.2", features = ["rt", "process", "sync"], default-features = false } cfg-if = "1.0.0" [target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] guess_host_triple = "0.1.3" [dev-dependencies] -tokio = { version = "1.21.1", features = ["macros"], default-features = false } +tokio = { version = "1.21.2", features = ["macros"], default-features = false } From e3cf3e9e3a18eaaad39de07be29936cef17a4366 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Sep 2022 02:20:23 +0000 Subject: [PATCH 0785/2020] Bump thiserror from 1.0.36 to 1.0.37 (#437) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.36 to 1.0.37. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.36...1.0.37) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d90cab67..17223e43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1951,18 +1951,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a99cb8c4b9a8ef0e7907cd3b617cc8dc04d571c4e73c8ae403d80ac160bb122" +checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a891860d3c8d66fec8e73ddb3765f90082374dbaaa833407b904a94f1a7eb43" +checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 6ec88aa6..fd3d3269 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -44,7 +44,7 @@ strum_macros = "0.24.3" #tar = "0.4.38" tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.3.0" -thiserror = "1.0.36" +thiserror = "1.0.37" tinytemplate = "1.2.1" tokio = { version = "1.21.2", features = ["macros", "rt", "process", "sync", "signal"], default-features = false } toml_edit = { version = "0.14.4", features = ["easy"] } From c15903684f8b9cdf1105b788e86c8fea490a7091 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 28 Sep 2022 12:32:22 +1000 Subject: [PATCH 0786/2020] Feature/fix no symlink (#432) * Refactor `BinFile::from_product`: Simplify logic flow. * Fix `--no-symlink` behavior Signed-off-by: Jiahao XU --- crates/binstalk/src/bins.rs | 107 ++++++++++++++++------------- crates/binstalk/src/ops/resolve.rs | 6 +- 2 files changed, 65 insertions(+), 48 deletions(-) diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 9fd74d40..181be24d 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -66,7 +66,7 @@ pub struct BinFile { pub base_name: CompactString, pub source: PathBuf, pub dest: PathBuf, - pub link: PathBuf, + pub link: Option, } impl BinFile { @@ -74,6 +74,7 @@ impl BinFile { data: &Data<'_>, product: &Product, bin_dir: &str, + no_symlinks: bool, ) -> Result { let base_name = product.name.as_deref().unwrap(); @@ -93,42 +94,48 @@ impl BinFile { binary_ext, }; - // Generate install paths - // Source path is the download dir + the generated binary path - let path = ctx.render(bin_dir)?; - - let path_normalized = Path::new(&path).normalize(); - - if path_normalized.components().next().is_none() { - return Err(BinstallError::EmptySourceFilePath); - } - - if !is_valid_path(&path_normalized) { - return Err(BinstallError::InvalidSourceFilePath { - path: path_normalized.into_owned(), - }); - } - - let source_file_path = match path_normalized { - Cow::Borrowed(..) => path, - Cow::Owned(path) => path.to_string_lossy().into_owned(), - }; - let source = if data.meta.pkg_fmt == Some(PkgFmt::Bin) { data.bin_path.clone() } else { + // Generate install paths + // Source path is the download dir + the generated binary path + let path = ctx.render(bin_dir)?; + + let path_normalized = Path::new(&path).normalize(); + + if path_normalized.components().next().is_none() { + return Err(BinstallError::EmptySourceFilePath); + } + + if !is_valid_path(&path_normalized) { + return Err(BinstallError::InvalidSourceFilePath { + path: path_normalized.into_owned(), + }); + } + + let source_file_path = match path_normalized { + Cow::Borrowed(..) => path, + Cow::Owned(path) => path.to_string_lossy().into_owned(), + }; + data.bin_path.join(&source_file_path) }; - // Destination path is the install dir + base-name-version{.extension} - let dest_file_path = ctx.render("{ bin }-v{ version }{ binary-ext }")?; - let dest = data.install_path.join(dest_file_path); - - // Link at install dir + base-name{.extension} - let link = data + // Destination at install dir + base-name{.extension} + let dest = data .install_path .join(&ctx.render("{ bin }{ binary-ext }")?); + let (dest, link) = if no_symlinks { + (dest, None) + } else { + // Destination path is the install dir + base-name-version{.extension} + let dest_file_path_with_ver = ctx.render("{ bin }-v{ version }{ binary-ext }")?; + let dest_with_ver = data.install_path.join(dest_file_path_with_ver); + + (dest_with_ver, Some(dest)) + }; + Ok(Self { base_name: CompactString::from(base_name), source, @@ -147,12 +154,16 @@ impl BinFile { } pub fn preview_link(&self) -> String { - format!( - "{} ({} -> {})", - self.base_name, - self.link.display(), - self.link_dest().display() - ) + if let Some(link) = &self.link { + format!( + "{} ({} -> {})", + self.base_name, + link.display(), + self.link_dest().display() + ) + } else { + String::new() + } } /// Return `Ok` if the source exists, otherwise `Err`. @@ -178,20 +189,22 @@ impl BinFile { } pub fn install_link(&self) -> Result<(), BinstallError> { - // Remove existing symlink - // TODO: check if existing symlink is correct - if self.link.exists() { - debug!("Remove link '{}'", self.link.display()); - std::fs::remove_file(&self.link)?; - } + if let Some(link) = &self.link { + // Remove existing symlink + // TODO: check if existing symlink is correct + if link.exists() { + debug!("Remove link '{}'", link.display()); + std::fs::remove_file(link)?; + } - let dest = self.link_dest(); - debug!( - "Create link '{}' pointing to '{}'", - self.link.display(), - dest.display() - ); - atomic_symlink_file(dest, &self.link)?; + let dest = self.link_dest(); + debug!( + "Create link '{}' pointing to '{}'", + link.display(), + dest.display() + ); + atomic_symlink_file(dest, link)?; + } Ok(()) } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index d5a16b99..330ac7ab 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -238,6 +238,7 @@ async fn resolve_inner( &package, &install_path, &binaries, + opts.no_symlinks, ) .await { @@ -281,6 +282,7 @@ async fn download_extract_and_verify( package: &Package, install_path: &Path, binaries: &[Product], + no_symlinks: bool, ) -> Result, BinstallError> { // Build final metadata let meta = fetcher.target_meta(); @@ -322,6 +324,7 @@ async fn download_extract_and_verify( binaries, bin_path.to_path_buf(), install_path.to_path_buf(), + no_symlinks, )?; for bin_file in bin_files.iter() { @@ -340,6 +343,7 @@ fn collect_bin_files( binaries: &[Product], bin_path: PathBuf, install_path: PathBuf, + no_symlinks: bool, ) -> Result, BinstallError> { // List files to be installed // based on those found via Cargo.toml @@ -363,7 +367,7 @@ fn collect_bin_files( // Create bin_files let bin_files = binaries .iter() - .map(|p| bins::BinFile::from_product(&bin_data, p, &bin_dir)) + .map(|p| bins::BinFile::from_product(&bin_data, p, &bin_dir, no_symlinks)) .collect::, BinstallError>>()?; let mut source_set = BTreeSet::new(); From 4ba1e221ea01430e391801655f98e758eb1f7583 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 28 Sep 2022 12:52:14 +1000 Subject: [PATCH 0787/2020] Improve auto discover (#433) * Add new field `gh_crate_meta::Context::archive_suffix` * Support `archive_suffix = ""` for unix * Use `archive-suffix` in `FULL_FILENAMES` & `NOVERSION_FILENAMES` to support `PkgFmt::Bin` * Simplify `PkgFmt::extensions` * Fix `default_bin_dir_template` in `infer_bin_dir_template`: Fix typo `archive_suffix` * Test `default_bin_dir_template` in CI * Fix installation of `PkgFmt::Bin`: `chmod +x $bin` on unix if fmt == Bin * Add miniserve to `.github/scripts/tests.sh` * Update `SUPPORT.md` * Add github-test-Cargo2.toml to test Github pkg-url with bin-dir provided * Avoid allocation on processing `path_normalized` in `BinFile::from_product` Signed-off-by: Jiahao XU --- .../cargo-tomls/bitbucket-test-Cargo.toml | 3 -- .../cargo-tomls/github-test-Cargo.toml | 3 -- .../cargo-tomls/github-test-Cargo2.toml | 16 ++++++++++ .../cargo-tomls/gitlab-test-Cargo.toml | 3 -- .github/scripts/tests.sh | 16 ++++++++-- SUPPORT.md | 21 +++++++------- crates/binstalk/src/bins.rs | 25 +++++++++++----- crates/binstalk/src/fetchers/gh_crate_meta.rs | 29 ++++++++++++++----- .../src/fetchers/gh_crate_meta/hosting.rs | 12 ++++---- .../cargo_toml_binstall/package_formats.rs | 17 ++++++----- 10 files changed, 94 insertions(+), 51 deletions(-) create mode 100644 .github/scripts/cargo-tomls/github-test-Cargo2.toml diff --git a/.github/scripts/cargo-tomls/bitbucket-test-Cargo.toml b/.github/scripts/cargo-tomls/bitbucket-test-Cargo.toml index 78a87cd0..4b91c06f 100644 --- a/.github/scripts/cargo-tomls/bitbucket-test-Cargo.toml +++ b/.github/scripts/cargo-tomls/bitbucket-test-Cargo.toml @@ -8,9 +8,6 @@ authors = ["ryan "] edition = "2021" license = "GPL-3.0" -[package.metadata.binstall] -bin-dir = "{ bin }{ binary-ext }" - [[bin]] name = "cargo-binstall" path = "src/main.rs" diff --git a/.github/scripts/cargo-tomls/github-test-Cargo.toml b/.github/scripts/cargo-tomls/github-test-Cargo.toml index aa47c496..aa3a0898 100644 --- a/.github/scripts/cargo-tomls/github-test-Cargo.toml +++ b/.github/scripts/cargo-tomls/github-test-Cargo.toml @@ -8,9 +8,6 @@ authors = ["ryan "] edition = "2021" license = "GPL-3.0" -[package.metadata.binstall] -bin-dir = "{ bin }{ binary-ext }" - [[bin]] name = "cargo-binstall" path = "src/main.rs" diff --git a/.github/scripts/cargo-tomls/github-test-Cargo2.toml b/.github/scripts/cargo-tomls/github-test-Cargo2.toml new file mode 100644 index 00000000..aa47c496 --- /dev/null +++ b/.github/scripts/cargo-tomls/github-test-Cargo2.toml @@ -0,0 +1,16 @@ +[package] +name = "cargo-binstall" +description = "Rust binary package installer for CI integration" +repository = "https://github.com/cargo-bins/cargo-binstall" +version = "0.12.0" +rust-version = "1.61.0" +authors = ["ryan "] +edition = "2021" +license = "GPL-3.0" + +[package.metadata.binstall] +bin-dir = "{ bin }{ binary-ext }" + +[[bin]] +name = "cargo-binstall" +path = "src/main.rs" diff --git a/.github/scripts/cargo-tomls/gitlab-test-Cargo.toml b/.github/scripts/cargo-tomls/gitlab-test-Cargo.toml index 133866ff..2fd25046 100644 --- a/.github/scripts/cargo-tomls/gitlab-test-Cargo.toml +++ b/.github/scripts/cargo-tomls/gitlab-test-Cargo.toml @@ -8,9 +8,6 @@ authors = ["ryan "] edition = "2021" license = "GPL-3.0" -[package.metadata.binstall] -bin-dir = "{ bin }{ binary-ext }" - [[bin]] name = "cargo-binstall" path = "src/main.rs" diff --git a/.github/scripts/tests.sh b/.github/scripts/tests.sh index ad49fb70..a2feca2f 100755 --- a/.github/scripts/tests.sh +++ b/.github/scripts/tests.sh @@ -7,7 +7,7 @@ unset CARGO_HOME # Install binaries using cargo-binstall # shellcheck disable=SC2086 -"./$1" binstall --log-level debug --no-confirm b3sum cargo-release cargo-binstall cargo-watch +"./$1" binstall --log-level debug --no-confirm b3sum cargo-release cargo-binstall cargo-watch miniserve # Test that the installed binaries can be run b3sum --version @@ -15,11 +15,13 @@ cargo-release release --version cargo-binstall --help >/dev/null cargo binstall --help >/dev/null cargo watch -V +miniserve -V test_resources=".github/scripts/cargo-tomls" # Install binaries using `--manifest-path` -"./$1" binstall --force --log-level debug --manifest-path "$test_resources/gitlab-test-Cargo.toml" --no-confirm cargo-binstall +# Also test default github template +"./$1" binstall --force --log-level debug --manifest-path "$test_resources/github-test-Cargo.toml" --no-confirm cargo-binstall # Test that the installed binaries can be run cargo binstall --help >/dev/null @@ -63,6 +65,7 @@ cargo binstall --help >/dev/null # FIXME: remove/replace once #136 lands PATH="$test_resources/fake-cargo:$PATH" +# Test default GitLab pkg-url templates "./$1" binstall \ --force \ --manifest-path "$test_resources/gitlab-test-Cargo.toml" \ @@ -77,3 +80,12 @@ PATH="$test_resources/fake-cargo:$PATH" --log-level debug \ --no-confirm \ cargo-binstall + +# Test default Github pkg-url templates, +# with bin-dir provided +"./$1" binstall \ + --force \ + --manifest-path "$test_resources/github-test-Cargo2.toml" \ + --log-level debug \ + --no-confirm \ + cargo-binstall diff --git a/SUPPORT.md b/SUPPORT.md index a269949a..afc3bc83 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -11,7 +11,7 @@ As an example, the configuration would be like this: ```toml [package.metadata.binstall] -pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }" +pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }{ archive-suffix }" bin-dir = "{ name }-{ target }-v{ version }/{ bin }{ binary-ext }" pkg-fmt = "tgz" ``` @@ -30,7 +30,8 @@ Template variables use the format `{ VAR }` where `VAR` is the name of the varia - `repo` is the repository linked in `Cargo.toml` - `bin` is the name of a specific binary, inferred from the crate configuration - `target` is the rust target name (defaults to your architecture, but can be overridden using the `--target` command line option if required() -- `archive-format` is the filename extension of the package archive format +- `archive-suffix` is the filename extension of the package archive format that includes the prefix `.`, e.g. `.tgz` for tgz or `.exe`/`""` for bin. +- `archive-format` is the soft-deprecated filename extension of the package archive format that does not include the prefix `.`, e.g. `tgz` for tgz or `exe`/`""` for bin. - `binary-ext` is the string `.exe` if the `target` is for Windows, or the empty string otherwise - `format` is a soft-deprecated alias for `archive-format` in `pkg-url`, and alias for `binary-ext` in `bin-dir`; in the future, this may warn at install time. @@ -61,13 +62,13 @@ The URLs are derived from a set of filenames and a set of paths, which are "multiplied together": every filename appended to every path. The filenames are: -- `{ name }-{ target }-{ version }.{ archive-format }` -- `{ name }-{ target }-v{ version }.{ archive-format }` -- `{ name }-{ version }-{ target }.{ archive-format }` -- `{ name }-v{ version }-{ target }.{ archive-format }` -- `{ name }-{ version }-{ target }.{ archive-format }` -- `{ name }-v{ version }-{ target }.{ archive-format }` -- `{ name }-{ target }.{ archive-format }` ("versionless") +- `{ name }-{ target }-{ version }{ archive-suffix }` +- `{ name }-{ target }-v{ version }{ archive-suffix }` +- `{ name }-{ version }-{ target }{ archive-suffix }` +- `{ name }-v{ version }-{ target }{ archive-suffix }` +- `{ name }-{ version }-{ target }{ archive-suffix }` +- `{ name }-v{ version }-{ target }{ archive-suffix }` +- `{ name }-{ target }{ archive-suffix }` ("versionless") The paths are: @@ -130,7 +131,7 @@ As is common with libraries/utilities (and the `radio-sx128x` example), this can ```toml [package.metadata.binstall] -pkg-url = "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ archive-format }" +pkg-url = "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }{ archive-suffix }" ``` Which provides a download URL of `https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz` diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 181be24d..939ba966 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -1,5 +1,6 @@ use std::{ borrow::Cow, + fs, path::{Component, Path, PathBuf}, }; @@ -47,7 +48,7 @@ pub fn infer_bin_dir_template(data: &Data) -> Cow<'static, str> { name.to_string(), ]; - let default_bin_dir_template = Cow::Borrowed("{ bin }{ binary_ext }"); + let default_bin_dir_template = Cow::Borrowed("{ bin }{ binary-ext }"); possible_dirs .into_iter() @@ -67,6 +68,7 @@ pub struct BinFile { pub source: PathBuf, pub dest: PathBuf, pub link: Option, + pub pkg_fmt: Option, } impl BinFile { @@ -94,7 +96,9 @@ impl BinFile { binary_ext, }; - let source = if data.meta.pkg_fmt == Some(PkgFmt::Bin) { + let pkg_fmt = data.meta.pkg_fmt; + + let source = if pkg_fmt == Some(PkgFmt::Bin) { data.bin_path.clone() } else { // Generate install paths @@ -113,12 +117,7 @@ impl BinFile { }); } - let source_file_path = match path_normalized { - Cow::Borrowed(..) => path, - Cow::Owned(path) => path.to_string_lossy().into_owned(), - }; - - data.bin_path.join(&source_file_path) + data.bin_path.join(path_normalized.as_ref()) }; // Destination at install dir + base-name{.extension} @@ -141,6 +140,7 @@ impl BinFile { source, dest, link, + pkg_fmt, }) } @@ -183,6 +183,15 @@ impl BinFile { self.source.display(), self.dest.display() ); + + if self.pkg_fmt == Some(PkgFmt::Bin) { + #[cfg(unix)] + fs::set_permissions( + &self.source, + std::os::unix::fs::PermissionsExt::from_mode(0o755), + )?; + } + atomic_install(&self.source, &self.dest)?; Ok(()) diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 46a42ae4..8676e74e 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -203,6 +203,9 @@ struct Context<'c> { #[serde(rename = "archive-format")] pub archive_format: &'c str, + #[serde(rename = "archive-suffix")] + pub archive_suffix: &'c str, + /// Filename extension on the binary, i.e. .exe on Windows, nothing otherwise #[serde(rename = "binary-ext")] pub binary_ext: &'c str, @@ -211,9 +214,18 @@ struct Context<'c> { impl<'c> Context<'c> { pub(self) fn from_data_with_repo( data: &'c Data, - archive_format: &'c str, + archive_suffix: &'c str, repo: Option<&'c str>, ) -> Self { + let archive_format = if archive_suffix.is_empty() { + // Empty archive_suffix means PkgFmt::Bin + "bin" + } else { + debug_assert!(archive_suffix.starts_with('.'), "{archive_suffix}"); + + &archive_suffix[1..] + }; + Self { name: &data.name, repo, @@ -221,6 +233,7 @@ impl<'c> Context<'c> { version: &data.version, format: archive_format, archive_format, + archive_suffix, binary_ext: if data.target.contains("windows") { ".exe" } else { @@ -267,7 +280,7 @@ mod test { meta, }; - let ctx = Context::from_data(&data, "tgz"); + let ctx = Context::from_data(&data, ".tgz"); assert_eq!( ctx.render_url(DEFAULT_PKG_URL).unwrap(), url("https://github.com/ryankurte/cargo-binstall/releases/download/v1.2.3/cargo-binstall-x86_64-unknown-linux-gnu-v1.2.3.tgz") @@ -286,7 +299,7 @@ mod test { meta, }; - let ctx = Context::from_data(&data, "tgz"); + let ctx = Context::from_data(&data, ".tgz"); ctx.render_url(data.meta.pkg_url.as_deref().unwrap()) .unwrap(); } @@ -306,7 +319,7 @@ mod test { meta, }; - let ctx = Context::from_data(&data, "tgz"); + let ctx = Context::from_data(&data, ".tgz"); assert_eq!( ctx.render_url(data.meta.pkg_url.as_deref().unwrap()).unwrap(), url("https://example.com/releases/download/v1.2.3/cargo-binstall-x86_64-unknown-linux-gnu-v1.2.3.tgz") @@ -330,7 +343,7 @@ mod test { meta, }; - let ctx = Context::from_data(&data, "tgz"); + let ctx = Context::from_data(&data, ".tgz"); assert_eq!( ctx.render_url(data.meta.pkg_url.as_deref().unwrap()).unwrap(), url("https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz") @@ -352,7 +365,7 @@ mod test { meta, }; - let ctx = Context::from_data(&data, "tgz"); + let ctx = Context::from_data(&data, ".tgz"); assert_eq!( ctx.render_url(data.meta.pkg_url.as_deref().unwrap()).unwrap(), url("https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz") @@ -378,7 +391,7 @@ mod test { meta, }; - let ctx = Context::from_data(&data, "txz"); + let ctx = Context::from_data(&data, ".txz"); assert_eq!( ctx.render_url(data.meta.pkg_url.as_deref().unwrap()).unwrap(), url("https://github.com/watchexec/cargo-watch/releases/download/v9.0.0/cargo-watch-v9.0.0-aarch64-apple-darwin.tar.xz") @@ -401,7 +414,7 @@ mod test { meta, }; - let ctx = Context::from_data(&data, "bin"); + let ctx = Context::from_data(&data, ".bin"); assert_eq!( ctx.render_url(data.meta.pkg_url.as_deref().unwrap()).unwrap(), url("https://github.com/watchexec/cargo-watch/releases/download/v9.0.0/cargo-watch-v9.0.0-aarch64-pc-windows-msvc.exe") diff --git a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs index a48910d0..665e4b7f 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs @@ -14,15 +14,15 @@ pub enum RepositoryHost { /// Make sure to update possible_dirs in `bins::infer_bin_dir_template` /// if you modified FULL_FILENAMES or NOVERSION_FILENAMES. pub const FULL_FILENAMES: &[&str] = &[ - "{ name }-{ target }-v{ version }.{ archive-format }", - "{ name }-{ target }-{ version }.{ archive-format }", - "{ name }-{ version }-{ target }.{ archive-format }", - "{ name }-v{ version }-{ target }.{ archive-format }", + "{ name }-{ target }-v{ version }{ archive-suffix }", + "{ name }-{ target }-{ version }{ archive-suffix }", + "{ name }-{ version }-{ target }{ archive-suffix }", + "{ name }-v{ version }-{ target }{ archive-suffix }", ]; pub const NOVERSION_FILENAMES: &[&str] = &[ - "{ name }-{ target }.{ archive-format }", - "{ name }.{ archive-format }", + "{ name }-{ target }{ archive-suffix }", + "{ name }{ archive-suffix }", ]; impl RepositoryHost { diff --git a/crates/binstalk/src/manifests/cargo_toml_binstall/package_formats.rs b/crates/binstalk/src/manifests/cargo_toml_binstall/package_formats.rs index 056cc8f7..67417324 100644 --- a/crates/binstalk/src/manifests/cargo_toml_binstall/package_formats.rs +++ b/crates/binstalk/src/manifests/cargo_toml_binstall/package_formats.rs @@ -44,16 +44,17 @@ impl PkgFmt { } } - /// List of possible file extensions for the format. + /// List of possible file extensions for the format + /// (with prefix `.`). pub fn extensions(self) -> &'static [&'static str] { match self { - PkgFmt::Tar => &["tar"], - PkgFmt::Tbz2 => &["tbz2", "tar.bz2"], - PkgFmt::Tgz => &["tgz", "tar.gz"], - PkgFmt::Txz => &["txz", "tar.xz"], - PkgFmt::Tzstd => &["tzstd", "tzst", "tar.zst"], - PkgFmt::Bin => &["bin", "exe"], - PkgFmt::Zip => &["zip"], + PkgFmt::Tar => &[".tar"], + PkgFmt::Tbz2 => &[".tbz2", ".tar.bz2"], + PkgFmt::Tgz => &[".tgz", ".tar.gz"], + PkgFmt::Txz => &[".txz", ".tar.xz"], + PkgFmt::Tzstd => &[".tzstd", ".tzst", ".tar.zst"], + PkgFmt::Bin => &[".bin", ".exe", ""], + PkgFmt::Zip => &[".zip"], } } } From f482e362ba7b89a478a7b8d6fde67c97a8eeeb32 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 28 Sep 2022 13:46:55 +1000 Subject: [PATCH 0788/2020] Make binaries with `required-features` optional (#438) * Make binaries with `required-features` optional so that crates like `sccache` would work as expected. * Fix `infer_bin_dir_template`: concat with `data.bin_path` introduced in #417 * Always `chmod +x $bin` on unix in case the archive (e.g. `sccache`) did not set the executable bit of fmt == Bin. * CI: Install `sccache` but do not run it since it requires cargo env to be ready Signed-off-by: Jiahao XU --- .github/scripts/tests.sh | 8 +++++++- crates/binstalk/src/bins.rs | 20 +++++++----------- crates/binstalk/src/ops/resolve.rs | 33 ++++++++++++++++++++++++++---- 3 files changed, 43 insertions(+), 18 deletions(-) diff --git a/.github/scripts/tests.sh b/.github/scripts/tests.sh index a2feca2f..39ef1afa 100755 --- a/.github/scripts/tests.sh +++ b/.github/scripts/tests.sh @@ -7,7 +7,13 @@ unset CARGO_HOME # Install binaries using cargo-binstall # shellcheck disable=SC2086 -"./$1" binstall --log-level debug --no-confirm b3sum cargo-release cargo-binstall cargo-watch miniserve +"./$1" binstall --log-level debug --no-confirm \ + b3sum \ + cargo-release \ + cargo-binstall \ + cargo-watch \ + miniserve \ + sccache # Test that the installed binaries can be run b3sum --version diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 939ba966..0185478b 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -52,7 +52,7 @@ pub fn infer_bin_dir_template(data: &Data) -> Cow<'static, str> { possible_dirs .into_iter() - .find(|dirname| Path::new(dirname).is_dir()) + .find(|dirname| data.bin_path.join(dirname).is_dir()) .map(|mut dir| { dir.reserve_exact(1 + default_bin_dir_template.len()); dir += "/"; @@ -68,7 +68,6 @@ pub struct BinFile { pub source: PathBuf, pub dest: PathBuf, pub link: Option, - pub pkg_fmt: Option, } impl BinFile { @@ -96,9 +95,7 @@ impl BinFile { binary_ext, }; - let pkg_fmt = data.meta.pkg_fmt; - - let source = if pkg_fmt == Some(PkgFmt::Bin) { + let source = if data.meta.pkg_fmt == Some(PkgFmt::Bin) { data.bin_path.clone() } else { // Generate install paths @@ -140,7 +137,6 @@ impl BinFile { source, dest, link, - pkg_fmt, }) } @@ -184,13 +180,11 @@ impl BinFile { self.dest.display() ); - if self.pkg_fmt == Some(PkgFmt::Bin) { - #[cfg(unix)] - fs::set_permissions( - &self.source, - std::os::unix::fs::PermissionsExt::from_mode(0o755), - )?; - } + #[cfg(unix)] + fs::set_permissions( + &self.source, + std::os::unix::fs::PermissionsExt::from_mode(0o755), + )?; atomic_install(&self.source, &self.dest)?; diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 330ac7ab..f47dccfc 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -327,11 +327,36 @@ async fn download_extract_and_verify( no_symlinks, )?; - for bin_file in bin_files.iter() { - bin_file.check_source_exists()?; - } + let name = &package.name; - Ok(bin_files) + binaries + .iter() + .zip(bin_files) + .filter_map(|(bin, bin_file)| { + match bin_file.check_source_exists() { + Ok(()) => Some(Ok(bin_file)), + + // This binary is optional + Err(err) => { + let required_features = &bin.required_features; + + if required_features.is_empty() { + // This bin is not optional, error + Some(Err(err)) + } else { + // Optional, print a warning and continue. + let bin_name = bin.name.as_deref().unwrap(); + let features = required_features.join(","); + warn!( + "When resolving {name} bin {bin_name} is not found. \ + But since it requies features {features}, this bin is ignored." + ); + None + } + } + } + }) + .collect::, BinstallError>>() }) } From 34df6176fe19ee75e0764118214d5886d7ccf6cf Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 28 Sep 2022 14:03:36 +1000 Subject: [PATCH 0789/2020] Add more to `possible_dirs` (#441) Signed-off-by: Jiahao XU --- crates/binstalk/src/bins.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 0185478b..8f93fe67 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -45,6 +45,9 @@ pub fn infer_bin_dir_template(data: &Data) -> Cow<'static, str> { format!("{name}-{version}-{target}"), format!("{name}-v{version}-{target}"), format!("{name}-{target}"), + // Ignore the following when updating hosting::{FULL_FILENAMES, NOVERSION_FILENAMES} + format!("{name}-{version}"), + format!("{name}-v{version}"), name.to_string(), ]; From a79b880e1e43a7e5bce99cbde8f226fca76ecce6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 28 Sep 2022 16:22:14 +1000 Subject: [PATCH 0790/2020] release: binstalk v0.3.0 (#442) (cargo-release) version 0.3.0 Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 17223e43..a9e7fca4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -106,7 +106,7 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "binstalk" -version = "0.2.2" +version = "0.3.0" dependencies = [ "async-trait", "binstall-tar", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 3a14be0e..ad7e2ce1 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.2.2" } +binstalk = { path = "../binstalk", version = "0.3.0" } clap = { version = "3.2.22", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index fd3d3269..52e05fe8 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.2.2" +version = "0.3.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From af3316a8f32862b3aa3edab82ee1be0c42cb36ba Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 28 Sep 2022 06:41:16 +0000 Subject: [PATCH 0791/2020] release: cargo-binstall v0.14.0 (#443) * release: cargo-binstall v0.14.0 * Fix README Signed-off-by: Jiahao XU Signed-off-by: Jiahao XU Co-authored-by: github-actions Co-authored-by: Jiahao XU --- Cargo.lock | 2 +- README.md | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a9e7fca4..c0579762 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -252,7 +252,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.13.3" +version = "0.14.0" dependencies = [ "binstalk", "clap", diff --git a/README.md b/README.md index e22d2219..80442f29 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ To support `binstall` maintainers must add configuration values to `Cargo.toml` [![GitHub tag](https://img.shields.io/github/tag/cargo-bins/cargo-binstall.svg)](https://github.com/cargo-bins/cargo-binstall) [![Crates.io](https://img.shields.io/crates/v/cargo-binstall.svg)](https://crates.io/crates/cargo-binstall) -You probably want to **[see this page as it was when the latest version was published](https://github.com/cargo-bins/cargo-binstall/tree/v0.13.1#readme)** for accurate documentation. +You probably want to **[see this page as it was when the latest version was published](https://crates.io/crates/cargo-binstall)** for accurate documentation. ## Installation diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index ad7e2ce1..5e280de6 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.13.3" +version = "0.14.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index d95e7e19..03af75b1 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From abd50a72ecf176b372ea1c7a3f8df1770f015541 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 29 Sep 2022 00:51:11 +1000 Subject: [PATCH 0792/2020] Fix skipping optional dep: Skip fetcher if they provide 0 bin (#446) Signed-off-by: Jiahao XU --- crates/binstalk/src/ops/resolve.rs | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index f47dccfc..1e24d1fe 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -243,13 +243,21 @@ async fn resolve_inner( .await { Ok(bin_files) => { - return Ok(Resolution::Fetch { - fetcher, - package, - name: crate_name.name, - version_req: version_req.to_compact_string(), - bin_files, - }) + if !bin_files.is_empty() { + return Ok(Resolution::Fetch { + fetcher, + package, + name: crate_name.name, + version_req: version_req.to_compact_string(), + bin_files, + }); + } else { + warn!( + "Error when checking binaries provided by fetcher {}: \ + The fetcher does not provide any optional binary", + fetcher.source_name(), + ); + } } Err(err) => { warn!( From 111bfde2cb434f83a03c0af22227ef8ecce51aa3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Sep 2022 12:00:53 +1000 Subject: [PATCH 0793/2020] Update clap requirement from 3.2.22 to 4.0.2 in /crates/binstalk (#448) Updates the requirements on [clap](https://github.com/clap-rs/clap) to permit the latest version. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.0.0-rc.1...v4.0.2) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- crates/binstalk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 52e05fe8..484529d3 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -14,7 +14,7 @@ async-trait = "0.1.57" bytes = "1.2.1" bzip2 = "0.4.3" cargo_toml = "0.12.2" -clap = { version = "3.2.22", features = ["derive"] } +clap = { version = "4.0.2", features = ["derive"] } compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.2", path = "../detect-targets" } From aa864fad5925707e4a51f8902d887c0b4148cd17 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 29 Sep 2022 13:14:00 +1000 Subject: [PATCH 0794/2020] Bump clap to v4.0.2 (#450) * Rm unused dep clap from crate `binstalk` * Bump clap to v4.0.2 Signed-off-by: Jiahao XU --- Cargo.lock | 15 ++++------ crates/bin/Cargo.toml | 2 +- crates/bin/src/args.rs | 57 ++++++++++++-------------------------- crates/binstalk/Cargo.toml | 1 - 4 files changed, 25 insertions(+), 50 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c0579762..cae1ab7e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -114,7 +114,6 @@ dependencies = [ "bytes", "bzip2", "cargo_toml", - "clap", "compact_str", "crates_io_api", "detect-targets", @@ -316,26 +315,24 @@ dependencies = [ [[package]] name = "clap" -version = "3.2.22" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86447ad904c7fb335a790c9d7fe3d0d971dc523b8ccd1561a520de9a85302750" +checksum = "31c9484ccdc4cb8e7b117cbd0eb150c7c0f04464854e4679aeb50ef03b32d003" dependencies = [ "atty", "bitflags", "clap_derive", "clap_lex", - "indexmap", "once_cell", "strsim", "termcolor", - "textwrap", ] [[package]] name = "clap_derive" -version = "3.2.18" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" +checksum = "ca689d7434ce44517a12a89456b2be4d1ea1cafcd8f581978c03d45f5a5c12a7" dependencies = [ "heck", "proc-macro-error", @@ -346,9 +343,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" dependencies = [ "os_str_bytes", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 5e280de6..ead4903f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.3.0" } -clap = { version = "3.2.22", features = ["derive"] } +clap = { version = "4.0.2", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index f5a21497..e69befd1 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -5,13 +5,19 @@ use binstalk::{ manifests::cargo_toml_binstall::PkgFmt, ops::resolve::{CrateName, VersionReqExt}, }; -use clap::{builder::PossibleValue, AppSettings, ArgEnum, Parser}; +use clap::{Parser, ValueEnum}; use log::LevelFilter; use reqwest::tls::Version; use semver::VersionReq; #[derive(Debug, Parser)] -#[clap(version, about = "Install a Rust binary... from binaries!", setting = AppSettings::ArgRequiredElseHelp)] +#[clap( + version, + about = "Install a Rust binary... from binaries!", + arg_required_else_help(true), + // Avoid conflict with version_req + disable_version_flag(true), +)] pub struct Args { /// Packages to install. /// @@ -39,7 +45,11 @@ pub struct Args { /// /// Cannot be used when multiple packages are installed at once, use the attached version /// syntax in that case. - #[clap(help_heading = "Package selection", long = "version", parse(try_from_str = VersionReq::parse_from_cli))] + #[clap( + help_heading = "Package selection", + long = "version", + value_parser(VersionReq::parse_from_cli) + )] pub version_req: Option, /// Override binary target set. @@ -76,7 +86,7 @@ pub struct Args { /// Override Cargo.toml package manifest pkg-fmt. /// - /// The availiable package formats are: + /// The available package formats are: /// /// - tar: download format is TAR (uncompressed) /// @@ -91,22 +101,7 @@ pub struct Args { /// - zip: Download format is Zip /// /// - bin: Download format is raw / binary - #[clap( - help_heading = "Overrides", - long, - value_name = "PKG_FMT", - possible_values = [ - PossibleValue::new("tar").help( - "Download format is TAR (uncompressed)." - ), - PossibleValue::new("tbz2").help("Download format is TAR + Bzip2."), - PossibleValue::new("tgz").help("Download format is TGZ (TAR + GZip)."), - PossibleValue::new("txz").help("Download format is TAR + XZ."), - PossibleValue::new("tzstd").help("Download format is TAR + Zstd."), - PossibleValue::new("zip").help("Download format is Zip."), - PossibleValue::new("bin").help("Download format is raw / binary."), - ] - )] + #[clap(help_heading = "Overrides", long, value_name = "PKG_FMT")] pub pkg_fmt: Option, /// Override Cargo.toml package manifest pkg-url. @@ -169,13 +164,9 @@ pub struct Args { /// /// The default is not to require any minimum TLS version, and use the negotiated highest /// version available to both this client and the remote server. - #[clap(help_heading = "Options", long, arg_enum, value_name = "VERSION")] + #[clap(help_heading = "Options", long, value_enum, value_name = "VERSION")] pub min_tls_version: Option, - /// Print help information - #[clap(help_heading = "Meta", short, long)] - pub help: bool, - /// Print version information #[clap(help_heading = "Meta", short = 'V')] pub version: bool, @@ -199,19 +190,7 @@ pub struct Args { help_heading = "Meta", long, default_value = "info", - value_name = "LEVEL", - possible_values = [ - PossibleValue::new("trace").help( - "Set to `trace` to print very low priority, often extremely verbose information." - ), - PossibleValue::new("debug").help("Set to debug when submitting a bug report."), - PossibleValue::new("info").help("Set to info to only print useful information."), - PossibleValue::new("warn").help("Set to warn to only print on hazardous situations."), - PossibleValue::new("error").help("Set to error to only print serious errors."), - PossibleValue::new("off").help( - "Set to off to disable logging completely, this will also disable output from `cargo-install`." - ), - ] + value_name = "LEVEL" )] pub log_level: LevelFilter, @@ -222,7 +201,7 @@ pub struct Args { pub quiet: bool, } -#[derive(Debug, Copy, Clone, ArgEnum)] +#[derive(Debug, Copy, Clone, ValueEnum)] pub enum TLSVersion { #[clap(name = "1.2")] Tls1_2, diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 484529d3..48940b00 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -14,7 +14,6 @@ async-trait = "0.1.57" bytes = "1.2.1" bzip2 = "0.4.3" cargo_toml = "0.12.2" -clap = { version = "4.0.2", features = ["derive"] } compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.2", path = "../detect-targets" } From 448542f0c8fe887113c595e7bbabc7a394e5afbb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Sep 2022 02:14:10 +0000 Subject: [PATCH 0795/2020] Bump clap from 4.0.2 to 4.0.4 (#451) Bumps [clap](https://github.com/clap-rs/clap) from 4.0.2 to 4.0.4. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.0.2...v4.0.4) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cae1ab7e..ee7899ea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -315,9 +315,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.2" +version = "4.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9484ccdc4cb8e7b117cbd0eb150c7c0f04464854e4679aeb50ef03b32d003" +checksum = "7f78ad8e84aa8e8aa3e821857be40eb4b925ff232de430d4dd2ae6aa058cbd92" dependencies = [ "atty", "bitflags", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index ead4903f..813a9433 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.3.0" } -clap = { version = "4.0.2", features = ["derive"] } +clap = { version = "4.0.4", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" From ec2bdb551e17242b7bafc822f440140389168fa1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 2 Oct 2022 01:52:25 +1000 Subject: [PATCH 0796/2020] Use `CARGO` env variable if present (#453) * Run `$CARGO -vV` in `detect-targets` if env `CARGO` present * Improve crate doc for `detect-targets` * Use env var `CARGO` in `install_from_source` if present * Test use of `CARGO` env in `tests.sh` Signed-off-by: Jiahao XU --- .github/scripts/tests.sh | 30 ++++++++++++++++++----------- .github/workflows/integration.yml | 2 -- crates/binstalk/src/ops/install.rs | 14 ++++++++++---- crates/detect-targets/src/detect.rs | 14 +++++++++++++- crates/detect-targets/src/lib.rs | 6 ++++++ 5 files changed, 48 insertions(+), 18 deletions(-) diff --git a/.github/scripts/tests.sh b/.github/scripts/tests.sh index 39ef1afa..f2a4453e 100755 --- a/.github/scripts/tests.sh +++ b/.github/scripts/tests.sh @@ -3,17 +3,25 @@ set -euxo pipefail unset CARGO_INSTALL_ROOT -unset CARGO_HOME -# Install binaries using cargo-binstall -# shellcheck disable=SC2086 -"./$1" binstall --log-level debug --no-confirm \ - b3sum \ - cargo-release \ - cargo-binstall \ - cargo-watch \ - miniserve \ - sccache +crates="b3sum cargo-release cargo-binstall cargo-watch miniserve sccache" + +if [ "$2" = "Windows" ]; then + # Install binaries using cargo-binstall + # shellcheck disable=SC2086 + "./$1" --log-level debug --no-confirm $crates +else + export CARGO_HOME=/tmp/cargo-home-for-test + export PATH="$CARGO_HOME/bin:$PATH" + + mkdir -p "$CARGO_HOME/bin" + # Copy it to bin to test use of env var `CARGO` + cp "./$1" "$CARGO_HOME/bin/cargo-binstall" + + # Install binaries using cargo-binstall + # shellcheck disable=SC2086 + cargo binstall --log-level debug --no-confirm $crates +fi # Test that the installed binaries can be run b3sum --version @@ -69,7 +77,7 @@ cargo binstall --help >/dev/null # to force failure if falling back to source # FIXME: remove/replace once #136 lands -PATH="$test_resources/fake-cargo:$PATH" +export PATH="$test_resources/fake-cargo:$PATH" # Test default GitLab pkg-url templates "./$1" binstall \ diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index 401e9868..a5740149 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -51,6 +51,4 @@ jobs: - name: Test shell: bash run: .github/scripts/tests.sh ${{ matrix.bin }} ${{ runner.os }} - env: - CARGO_HOME: /tmp/cargo-home-for-test/ diff --git a/crates/binstalk/src/ops/install.rs b/crates/binstalk/src/ops/install.rs index 8b9cb3de..973cd655 100644 --- a/crates/binstalk/src/ops/install.rs +++ b/crates/binstalk/src/ops/install.rs @@ -1,4 +1,4 @@ -use std::sync::Arc; +use std::{borrow::Cow, env, ffi::OsStr, sync::Arc}; use cargo_toml::Package; use compact_str::CompactString; @@ -110,12 +110,18 @@ async fn install_from_source( ) -> Result<(), BinstallError> { let jobserver_client = lazy_jobserver_client.get().await?; + let cargo = env::var_os("CARGO") + .map(Cow::Owned) + .unwrap_or_else(|| Cow::Borrowed(OsStr::new("cargo"))); + debug!( - "Running `cargo install {} --version {} --target {target}`", - package.name, package.version + "Running `{} install {} --version {} --target {target}`", + cargo.to_string_lossy(), + package.name, + package.version ); - let mut cmd = Command::new("cargo"); + let mut cmd = Command::new(cargo); cmd.arg("install") .arg(&package.name) diff --git a/crates/detect-targets/src/detect.rs b/crates/detect-targets/src/detect.rs index da023365..6200e425 100644 --- a/crates/detect-targets/src/detect.rs +++ b/crates/detect-targets/src/detect.rs @@ -1,4 +1,7 @@ use std::{ + borrow::Cow, + env, + ffi::OsStr, io::{BufRead, Cursor}, process::{Output, Stdio}, }; @@ -65,8 +68,17 @@ pub async fn detect_targets() -> Vec { /// Figure out what the host target is using `rustc`. /// If `rustc` is absent, then it would return `None`. +/// +/// If environment variable `CARGO` is present, then +/// `$CARGO -vV` will be run instead. +/// +/// Otherwise, it will run `rustc -vV` to detect target. async fn get_target_from_rustc() -> Option { - let Output { status, stdout, .. } = Command::new("rustc") + let cmd = env::var_os("CARGO") + .map(Cow::Owned) + .unwrap_or_else(|| Cow::Borrowed(OsStr::new("rustc"))); + + let Output { status, stdout, .. } = Command::new(cmd) .arg("-vV") .stdin(Stdio::null()) .stdout(Stdio::piped()) diff --git a/crates/detect-targets/src/lib.rs b/crates/detect-targets/src/lib.rs index 2e74eb17..a9a5c5c4 100644 --- a/crates/detect-targets/src/lib.rs +++ b/crates/detect-targets/src/lib.rs @@ -1,5 +1,11 @@ //! Detect the target at the runtime. //! +//! It runs `$CARGO -vV` if environment variable `CARGO` is present +//! for cargo subcommands, otherwise it would try running `rustc -vV`. +//! +//! If both `rustc` isn't present on the system, it will fallback +//! to using syscalls plus `ldd` on Linux to detect targets. +//! //! Example use cases: //! - The binary is built with musl libc to run on anywhere, but //! the runtime supports glibc. From dcbe701caa62d8ac16da3848e967c7c51e275fa2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 3 Oct 2022 10:07:16 +1100 Subject: [PATCH 0797/2020] Allow batch installation with `cli_overrides` (#454) which allows pkg-fmt, bin-dir and pkg-url to be specified while providing multiple crates to install. Fixed #444 Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index e69befd1..898c8069 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -26,8 +26,8 @@ pub struct Args { /// Each value is either a crate name alone, or a crate name followed by @ and the version to /// install. The version syntax is as with the --version option. /// - /// When multiple names are provided, the --version option and any override options are - /// unavailable due to ambiguity. + /// When multiple names are provided, the --version option and override option + /// `manifest_path` is unavailable due to ambiguity. /// /// If duplicate names are provided, the last one (and their version requirement) /// is kept. @@ -249,12 +249,6 @@ pub fn parse() -> Result { "version" } else if opts.manifest_path.is_some() { "manifest-path" - } else if opts.bin_dir.is_some() { - "bin-dir" - } else if opts.pkg_fmt.is_some() { - "pkg-fmt" - } else if opts.pkg_url.is_some() { - "pkg-url" } else { "" }; From 51fe4d59e3141c3c1329966fd49d9f24dacc17af Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Oct 2022 10:07:28 +0000 Subject: [PATCH 0798/2020] Bump clap from 4.0.4 to 4.0.8 (#456) Bumps [clap](https://github.com/clap-rs/clap) from 4.0.4 to 4.0.8. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.4...v4.0.8) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ee7899ea..80efa4d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -315,9 +315,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.4" +version = "4.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f78ad8e84aa8e8aa3e821857be40eb4b925ff232de430d4dd2ae6aa058cbd92" +checksum = "5840cd9093aabeabf7fd932754c435b7674520fc3ddc935c397837050f0f1e4b" dependencies = [ "atty", "bitflags", @@ -330,9 +330,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.0.1" +version = "4.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca689d7434ce44517a12a89456b2be4d1ea1cafcd8f581978c03d45f5a5c12a7" +checksum = "92289ffc6fb4a85d85c246ddb874c05a87a2e540fb6ad52f7ca07c8c1e1840b1" dependencies = [ "heck", "proc-macro-error", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 813a9433..4db4f047 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.3.0" } -clap = { version = "4.0.4", features = ["derive"] } +clap = { version = "4.0.8", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" From 405e41eda4c1dd2f1289d920be1788764d6d4e20 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Oct 2022 02:18:54 +1300 Subject: [PATCH 0799/2020] Bump cargo_toml from 0.12.2 to 0.12.4 (#455) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- crates/binstalk/src/ops/install.rs | 11 ++++++----- crates/binstalk/src/ops/resolve.rs | 12 ++++++------ 4 files changed, 15 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 80efa4d0..e6d9319e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -270,9 +270,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.12.2" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee685beed1fe2ab3cb9eb95d65727413b5e27f2b34014a3ea9c92053f8c230fc" +checksum = "6a621d5d6d6c8d086dbaf1fe659981da41a1b63c6bdbba30b4dbb592c6d3bd49" dependencies = [ "serde", "toml", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 48940b00..858a93ed 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0" async-trait = "0.1.57" bytes = "1.2.1" bzip2 = "0.4.3" -cargo_toml = "0.12.2" +cargo_toml = "0.12.4" compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.2", path = "../detect-targets" } diff --git a/crates/binstalk/src/ops/install.rs b/crates/binstalk/src/ops/install.rs index 973cd655..ea834d65 100644 --- a/crates/binstalk/src/ops/install.rs +++ b/crates/binstalk/src/ops/install.rs @@ -32,10 +32,10 @@ pub async fn install( } => { let current_version = package - .version + .version() .parse() .map_err(|err| BinstallError::VersionParse { - v: package.version, + v: package.version().to_string(), err, })?; let target = fetcher.target().into(); @@ -65,7 +65,8 @@ pub async fn install( } else { info!( "Dry-run: running `cargo install {} --version {} --target {target}`", - package.name, package.version + package.name, + package.version() ); Ok(None) } @@ -118,7 +119,7 @@ async fn install_from_source( "Running `{} install {} --version {} --target {target}`", cargo.to_string_lossy(), package.name, - package.version + package.version() ); let mut cmd = Command::new(cargo); @@ -126,7 +127,7 @@ async fn install_from_source( cmd.arg("install") .arg(&package.name) .arg("--version") - .arg(&package.version) + .arg(package.version()) .arg("--target") .arg(target); diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 1e24d1fe..61b090e3 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -156,8 +156,8 @@ async fn resolve_inner( if let Some(curr_version) = curr_version { let new_version = - Version::parse(&package.version).map_err(|err| BinstallError::VersionParse { - v: package.version.clone(), + Version::parse(package.version()).map_err(|err| BinstallError::VersionParse { + v: package.version().to_string(), err, })?; @@ -206,8 +206,8 @@ async fn resolve_inner( Arc::new(Data { name: package.name.clone(), target: target.clone(), - version: package.version.clone(), - repo: package.repository.clone(), + version: package.version().to_string(), + repo: package.repository().map(ToString::to_string), meta: target_meta, }) }) @@ -383,8 +383,8 @@ fn collect_bin_files( let bin_data = bins::Data { name: &package.name, target: fetcher.target(), - version: &package.version, - repo: package.repository.as_deref(), + version: package.version(), + repo: package.repository(), meta, bin_path, install_path, From 70b0f8ec97cc100806036e87f3ff21f31f0677d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Oct 2022 16:04:05 +1100 Subject: [PATCH 0800/2020] Bump clap from 4.0.8 to 4.0.9 (#460) Bumps [clap](https://github.com/clap-rs/clap) from 4.0.8 to 4.0.9. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.8...v4.0.9) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e6d9319e..3c3e1240 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -315,9 +315,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.8" +version = "4.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5840cd9093aabeabf7fd932754c435b7674520fc3ddc935c397837050f0f1e4b" +checksum = "30607dd93c420c6f1f80b544be522a0238a7db35e6a12968d28910983fee0df0" dependencies = [ "atty", "bitflags", @@ -330,9 +330,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.0.8" +version = "4.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92289ffc6fb4a85d85c246ddb874c05a87a2e540fb6ad52f7ca07c8c1e1840b1" +checksum = "a4a307492e1a34939f79d3b6b9650bd2b971513cd775436bf2b78defeb5af00b" dependencies = [ "heck", "proc-macro-error", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 4db4f047..2acc4289 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.3.0" } -clap = { version = "4.0.8", features = ["derive"] } +clap = { version = "4.0.9", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" From 3421403e75c869deafbfcff1073ac39322ddd94c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 6 Oct 2022 02:19:12 +1100 Subject: [PATCH 0801/2020] Refactor and Optimizations (#459) * Refactor: Avoid parsing `package.version()` twice in `ops::resolve` and `ops::install` * Optimize Resolution: Replace `Package` with two `CompactStrings`: `name` and `version` * Use `CompactString` for `BinstallError::CratesIoApi::crate_name` * Use `CompactString` for `BinstallError::VersionParse::v` * Use `CompactString` for `BinstallError::VersionReq::req` * Use `CompactString` for `BinstallError::VersionUnavailable::crate_name` Signed-off-by: Jiahao XU --- crates/binstalk/src/errors.rs | 8 ++--- crates/binstalk/src/ops/install.rs | 48 +++++++++++++----------------- crates/binstalk/src/ops/resolve.rs | 24 ++++++++------- 3 files changed, 38 insertions(+), 42 deletions(-) diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index a1abe80d..19b8554b 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -114,7 +114,7 @@ pub enum BinstallError { help("Check that the crate name you provided is correct.\nYou can also search for a matching crate at: https://lib.rs/search?q={crate_name}") )] CratesIoApi { - crate_name: String, + crate_name: CompactString, #[source] err: crates_io_api::Error, }, @@ -153,7 +153,7 @@ pub enum BinstallError { #[error("version string '{v}' is not semver")] #[diagnostic(severity(error), code(binstall::version::parse))] VersionParse { - v: String, + v: CompactString, #[source] err: semver::Error, }, @@ -170,7 +170,7 @@ pub enum BinstallError { #[error("version requirement '{req}' is not semver")] #[diagnostic(severity(error), code(binstall::version::requirement))] VersionReq { - req: String, + req: CompactString, #[source] err: semver::Error, }, @@ -194,7 +194,7 @@ pub enum BinstallError { #[error("no crate information available for '{crate_name}' version '{v}'")] #[diagnostic(severity(error), code(binstall::version::unavailable))] VersionUnavailable { - crate_name: String, + crate_name: CompactString, v: semver::Version, }, diff --git a/crates/binstalk/src/ops/install.rs b/crates/binstalk/src/ops/install.rs index ea834d65..658758be 100644 --- a/crates/binstalk/src/ops/install.rs +++ b/crates/binstalk/src/ops/install.rs @@ -1,6 +1,5 @@ use std::{borrow::Cow, env, ffi::OsStr, sync::Arc}; -use cargo_toml::Package; use compact_str::CompactString; use log::{debug, error, info}; use tokio::{process::Command, task::block_in_place}; @@ -10,10 +9,7 @@ use crate::{ bins, errors::BinstallError, helpers::jobserver_client::LazyJobserverClient, - manifests::{ - cargo_toml_binstall::Meta, - crate_info::{CrateInfo, CrateSource}, - }, + manifests::crate_info::{CrateInfo, CrateSource}, }; pub async fn install( @@ -25,26 +21,18 @@ pub async fn install( Resolution::AlreadyUpToDate => Ok(None), Resolution::Fetch { fetcher, - package, + new_version, name, version_req, bin_files, } => { - let current_version = - package - .version() - .parse() - .map_err(|err| BinstallError::VersionParse { - v: package.version().to_string(), - err, - })?; let target = fetcher.target().into(); install_from_package(opts, bin_files).await.map(|option| { option.map(|bins| CrateInfo { name, version_req, - current_version, + current_version: new_version, source: CrateSource::cratesio_registry(), target, bins, @@ -52,21 +40,26 @@ pub async fn install( }) }) } - Resolution::InstallFromSource { package } => { + Resolution::InstallFromSource { name, version } => { let desired_targets = opts.desired_targets.get().await; let target = desired_targets .first() .ok_or(BinstallError::NoViableTargets)?; if !opts.dry_run { - install_from_source(&package, target, jobserver_client, opts.quiet, opts.force) - .await - .map(|_| None) + install_from_source( + &name, + &version, + target, + jobserver_client, + opts.quiet, + opts.force, + ) + .await + .map(|_| None) } else { info!( - "Dry-run: running `cargo install {} --version {} --target {target}`", - package.name, - package.version() + "Dry-run: running `cargo install {name} --version {version} --target {target}`", ); Ok(None) } @@ -103,7 +96,8 @@ async fn install_from_package( } async fn install_from_source( - package: &Package, + name: &str, + version: &str, target: &str, lazy_jobserver_client: LazyJobserverClient, quiet: bool, @@ -116,18 +110,16 @@ async fn install_from_source( .unwrap_or_else(|| Cow::Borrowed(OsStr::new("cargo"))); debug!( - "Running `{} install {} --version {} --target {target}`", + "Running `{} install {name} --version {version} --target {target}`", cargo.to_string_lossy(), - package.name, - package.version() ); let mut cmd = Command::new(cargo); cmd.arg("install") - .arg(&package.name) + .arg(name) .arg("--version") - .arg(package.version()) + .arg(version) .arg("--target") .arg(target); diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 61b090e3..c56dfc87 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -34,13 +34,14 @@ pub use version_ext::VersionReqExt; pub enum Resolution { Fetch { fetcher: Arc, - package: Package, + new_version: Version, name: CompactString, version_req: CompactString, bin_files: Vec, }, InstallFromSource { - package: Package, + name: CompactString, + version: CompactString, }, AlreadyUpToDate, } @@ -154,13 +155,13 @@ async fn resolve_inner( .package .ok_or_else(|| BinstallError::CargoTomlMissingPackage(crate_name.name.clone()))?; - if let Some(curr_version) = curr_version { - let new_version = - Version::parse(package.version()).map_err(|err| BinstallError::VersionParse { - v: package.version().to_string(), - err, - })?; + let new_version = + Version::parse(package.version()).map_err(|err| BinstallError::VersionParse { + v: package.version().to_compact_string(), + err, + })?; + if let Some(curr_version) = curr_version { if new_version == curr_version { info!( "{} v{curr_version} is already installed, use --force to override", @@ -246,7 +247,7 @@ async fn resolve_inner( if !bin_files.is_empty() { return Ok(Resolution::Fetch { fetcher, - package, + new_version, name: crate_name.name, version_req: version_req.to_compact_string(), bin_files, @@ -279,7 +280,10 @@ async fn resolve_inner( } } - Ok(Resolution::InstallFromSource { package }) + Ok(Resolution::InstallFromSource { + name: crate_name.name, + version: package.version().to_compact_string(), + }) } /// * `fetcher` - `fetcher.find()` must return `Ok(true)`. From 8398ec2d4ba0a1185965688b197a7c0c5919afa9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 6 Oct 2022 15:25:12 +1300 Subject: [PATCH 0802/2020] Bump clap from 4.0.9 to 4.0.10 (#461) Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3c3e1240..16033ed1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -315,9 +315,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.9" +version = "4.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30607dd93c420c6f1f80b544be522a0238a7db35e6a12968d28910983fee0df0" +checksum = "3b1a0a4208c6c483b952ad35c6eed505fc13b46f08f631b81e828084a9318d74" dependencies = [ "atty", "bitflags", @@ -330,9 +330,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.0.9" +version = "4.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a307492e1a34939f79d3b6b9650bd2b971513cd775436bf2b78defeb5af00b" +checksum = "db342ce9fda24fb191e2ed4e102055a4d381c1086a06630174cd8da8d5d917ce" dependencies = [ "heck", "proc-macro-error", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 2acc4289..b1d84346 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.3.0" } -clap = { version = "4.0.9", features = ["derive"] } +clap = { version = "4.0.10", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" From 76bc030f906ded8a496657a75775bc144941a78b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 7 Oct 2022 15:51:34 +1100 Subject: [PATCH 0803/2020] Disable `tcp_nodelay` for `reqwest::Client` and add rate limiting for https requests (#458) --- Cargo.lock | 46 +++++- crates/bin/Cargo.toml | 1 - crates/bin/src/args.rs | 64 +++++++- crates/bin/src/entry.rs | 19 ++- crates/binstalk/Cargo.toml | 1 + crates/binstalk/src/drivers/crates_io.rs | 7 +- crates/binstalk/src/fetchers.rs | 2 +- crates/binstalk/src/fetchers/gh_crate_meta.rs | 17 +- crates/binstalk/src/fetchers/quickinstall.rs | 21 +-- crates/binstalk/src/helpers/download.rs | 7 +- crates/binstalk/src/helpers/remote.rs | 154 +++++++++++------- crates/binstalk/src/ops/resolve.rs | 3 +- 12 files changed, 243 insertions(+), 99 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 16033ed1..104f0edf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -143,6 +143,7 @@ dependencies = [ "tinytemplate", "tokio", "toml_edit", + "tower", "trust-dns-resolver", "url", "xz2", @@ -261,7 +262,6 @@ dependencies = [ "log", "miette", "mimalloc", - "reqwest", "semver", "simplelog", "tempfile", @@ -1373,6 +1373,26 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pin-project-lite" version = "0.2.9" @@ -2095,6 +2115,29 @@ dependencies = [ "serde", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62" + [[package]] name = "tower-service" version = "0.3.2" @@ -2108,6 +2151,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" dependencies = [ "cfg-if", + "log", "pin-project-lite", "tracing-core", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index b1d84346..8e05e08d 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -29,7 +29,6 @@ dirs = "4.0.0" log = "0.4.17" miette = "5.3.0" mimalloc = { version = "0.1.29", default-features = false, optional = true } -reqwest = { version = "0.11.12", default-features = false } semver = "1.0.14" simplelog = "0.12.0" tempfile = "3.3.0" diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 898c8069..0f2af0f7 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -1,13 +1,19 @@ -use std::{ffi::OsString, path::PathBuf}; +use std::{ + ffi::OsString, + fmt, + num::{NonZeroU64, ParseIntError}, + path::PathBuf, + str::FromStr, +}; use binstalk::{ errors::BinstallError, + helpers::remote::tls::Version, manifests::cargo_toml_binstall::PkgFmt, ops::resolve::{CrateName, VersionReqExt}, }; use clap::{Parser, ValueEnum}; use log::LevelFilter; -use reqwest::tls::Version; use semver::VersionReq; #[derive(Debug, Parser)] @@ -108,6 +114,21 @@ pub struct Args { #[clap(help_heading = "Overrides", long)] pub pkg_url: Option, + /// Override the rate limit duration. + /// + /// By default, cargo-binstall allows one request per 5 ms. + /// + /// Example: + /// + /// - `6`: Set the duration to 6ms, allows one request per 6 ms. + /// + /// - `6/2`: Set the duration to 6ms and request_count to 2, + /// allows 2 requests per 6ms. + /// + /// Both duration and request count must not be 0. + #[clap(help_heading = "Overrides", long, default_value_t = RateLimit::default())] + pub rate_limit: RateLimit, + /// Disable symlinking / versioned updates. /// /// By default, Binstall will install a binary named `-` in the install path, and @@ -218,6 +239,45 @@ impl From for Version { } } +#[derive(Copy, Clone, Debug)] +pub struct RateLimit { + pub duration: NonZeroU64, + pub request_count: NonZeroU64, +} + +impl fmt::Display for RateLimit { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{}/{}", self.duration, self.request_count) + } +} + +impl FromStr for RateLimit { + type Err = ParseIntError; + + fn from_str(s: &str) -> Result { + Ok(if let Some((first, second)) = s.split_once('/') { + Self { + duration: first.parse()?, + request_count: second.parse()?, + } + } else { + Self { + duration: s.parse()?, + ..Default::default() + } + }) + } +} + +impl Default for RateLimit { + fn default() -> Self { + Self { + duration: NonZeroU64::new(5).unwrap(), + request_count: NonZeroU64::new(1).unwrap(), + } + } +} + pub fn parse() -> Result { // Filter extraneous arg when invoked by cargo // `cargo run -- --help` gives ["target/debug/cargo-binstall", "--help"] diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 10fcee1f..b30fddee 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -3,10 +3,7 @@ use std::{fs, path::Path, sync::Arc, time::Duration}; use binstalk::{ errors::BinstallError, get_desired_targets, - helpers::{ - jobserver_client::LazyJobserverClient, remote::create_reqwest_client, - tasks::AutoAbortJoinHandle, - }, + helpers::{jobserver_client::LazyJobserverClient, remote::Client, tasks::AutoAbortJoinHandle}, manifests::{ binstall_crates_v1::Records, cargo_crates_v1::CratesToml, cargo_toml_binstall::PkgOverride, }, @@ -31,12 +28,20 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien // Launch target detection let desired_targets = get_desired_targets(args.targets.take()); + let rate_limit = args.rate_limit; + // Initialize reqwest client - let client = create_reqwest_client(args.min_tls_version.map(|v| v.into()))?; + let client = Client::new( + args.min_tls_version.map(|v| v.into()), + Duration::from_millis(rate_limit.duration.get()), + rate_limit.request_count, + )?; // Build crates.io api client - let crates_io_api_client = - crates_io_api::AsyncClient::with_http_client(client.clone(), Duration::from_millis(100)); + let crates_io_api_client = crates_io_api::AsyncClient::with_http_client( + client.get_inner().clone(), + Duration::from_millis(100), + ); // Initialize UI thread let mut uithread = UIThread::new(!args.no_confirm); diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 858a93ed..c710c2ab 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -47,6 +47,7 @@ thiserror = "1.0.37" tinytemplate = "1.2.1" tokio = { version = "1.21.2", features = ["macros", "rt", "process", "sync", "signal"], default-features = false } toml_edit = { version = "0.14.4", features = ["easy"] } +tower = { version = "0.4.13", features = ["limit", "util"] } trust-dns-resolver = { version = "0.21.2", optional = true, default-features = false, features = ["dnssec-ring"] } url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" diff --git a/crates/binstalk/src/drivers/crates_io.rs b/crates/binstalk/src/drivers/crates_io.rs index 21b1da26..aa7f0abe 100644 --- a/crates/binstalk/src/drivers/crates_io.rs +++ b/crates/binstalk/src/drivers/crates_io.rs @@ -3,13 +3,14 @@ use std::path::PathBuf; use cargo_toml::Manifest; use crates_io_api::AsyncClient; use log::debug; -use reqwest::Client; use semver::VersionReq; -use url::Url; use crate::{ errors::BinstallError, - helpers::download::Download, + helpers::{ + download::Download, + remote::{Client, Url}, + }, manifests::cargo_toml_binstall::{Meta, TarBasedFmt}, }; diff --git a/crates/binstalk/src/fetchers.rs b/crates/binstalk/src/fetchers.rs index 650de1d8..603c1b3d 100644 --- a/crates/binstalk/src/fetchers.rs +++ b/crates/binstalk/src/fetchers.rs @@ -4,10 +4,10 @@ use compact_str::CompactString; pub use gh_crate_meta::*; pub use log::debug; pub use quickinstall::*; -use reqwest::Client; use crate::{ errors::BinstallError, + helpers::remote::Client, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 8676e74e..3d33db51 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -4,7 +4,6 @@ use compact_str::{CompactString, ToCompactString}; use futures_util::stream::{FuturesUnordered, StreamExt}; use log::{debug, warn}; use once_cell::sync::OnceCell; -use reqwest::{Client, Method}; use serde::Serialize; use strum::IntoEnumIterator; use tinytemplate::TinyTemplate; @@ -14,7 +13,7 @@ use crate::{ errors::BinstallError, helpers::{ download::Download, - remote::{get_redirected_final_url, remote_exists}, + remote::{Client, Method}, tasks::AutoAbortJoinHandle, }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, @@ -59,11 +58,9 @@ impl GhCrateMeta { AutoAbortJoinHandle::spawn(async move { debug!("Checking for package at: '{url}'"); - Ok( - (remote_exists(client.clone(), url.clone(), Method::HEAD).await? - || remote_exists(client, url.clone(), Method::GET).await?) - .then_some((url, pkg_fmt)), - ) + Ok((client.remote_exists(url.clone(), Method::HEAD).await? + || client.remote_exists(url.clone(), Method::GET).await?) + .then_some((url, pkg_fmt))) }) }) } @@ -81,7 +78,11 @@ impl super::Fetcher for GhCrateMeta { async fn find(&self) -> Result { let repo = if let Some(repo) = self.data.repo.as_deref() { - Some(get_redirected_final_url(&self.client, Url::parse(repo)?).await?) + Some( + self.client + .get_redirected_final_url(Url::parse(repo)?) + .await?, + ) } else { None }; diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs index 6613d308..0886b200 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk/src/fetchers/quickinstall.rs @@ -2,14 +2,15 @@ use std::{path::Path, sync::Arc}; use compact_str::CompactString; use log::debug; -use reqwest::Client; -use reqwest::Method; use tokio::task::JoinHandle; use url::Url; use crate::{ errors::BinstallError, - helpers::{download::Download, remote::remote_exists}, + helpers::{ + download::Download, + remote::{Client, Method}, + }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; @@ -43,7 +44,9 @@ impl super::Fetcher for QuickInstall { let url = self.package_url(); self.report(); debug!("Checking for package at: '{url}'"); - remote_exists(self.client.clone(), Url::parse(&url)?, Method::HEAD).await + self.client + .remote_exists(Url::parse(&url)?, Method::HEAD) + .await } async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { @@ -112,15 +115,7 @@ impl QuickInstall { let url = Url::parse(&stats_url)?; debug!("Sending installation report to quickinstall ({url})"); - client - .request(Method::HEAD, url.clone()) - .send() - .await - .map_err(|err| BinstallError::Http { - method: Method::HEAD, - url, - err, - })?; + client.remote_exists(url, Method::HEAD).await?; Ok(()) }) diff --git a/crates/binstalk/src/helpers/download.rs b/crates/binstalk/src/helpers/download.rs index 4918e176..cb606000 100644 --- a/crates/binstalk/src/helpers/download.rs +++ b/crates/binstalk/src/helpers/download.rs @@ -2,11 +2,10 @@ use std::{fmt::Debug, marker::PhantomData, path::Path}; use digest::{Digest, FixedOutput, HashMarker, Output, OutputSizeUser, Update}; use log::debug; -use reqwest::{Client, Url}; use crate::{ errors::BinstallError, - helpers::remote::create_request, + helpers::remote::{Client, Url}, manifests::cargo_toml_binstall::{PkgFmt, PkgFmtDecomposed, TarBasedFmt}, }; @@ -48,7 +47,7 @@ impl Download { fmt: TarBasedFmt, visitor: V, ) -> Result { - let stream = create_request(self.client, self.url).await?; + let stream = self.client.create_request(self.url).await?; debug!("Downloading and extracting then in-memory processing"); @@ -65,7 +64,7 @@ impl Download { fmt: PkgFmt, path: impl AsRef, ) -> Result<(), BinstallError> { - let stream = create_request(self.client, self.url).await?; + let stream = self.client.create_request(self.url).await?; let path = path.as_ref(); debug!("Downloading and extracting to: '{}'", path.display()); diff --git a/crates/binstalk/src/helpers/remote.rs b/crates/binstalk/src/helpers/remote.rs index 95492cc0..d009939d 100644 --- a/crates/binstalk/src/helpers/remote.rs +++ b/crates/binstalk/src/helpers/remote.rs @@ -1,69 +1,109 @@ -use std::env; +use std::{env, num::NonZeroU64, sync::Arc, time::Duration}; use bytes::Bytes; use futures_util::stream::Stream; use log::debug; -use reqwest::{tls, Client, ClientBuilder, Method, Response}; -use url::Url; +use reqwest::{Request, Response}; +use tokio::sync::Mutex; +use tower::{limit::rate::RateLimit, Service, ServiceBuilder, ServiceExt}; use crate::errors::BinstallError; -pub fn create_reqwest_client(min_tls: Option) -> Result { - const USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")); +pub use reqwest::{tls, Method}; +pub use url::Url; - let mut builder = ClientBuilder::new() - .user_agent(USER_AGENT) - .https_only(true) - .min_tls_version(tls::Version::TLS_1_2); +#[derive(Clone, Debug)] +pub struct Client { + client: reqwest::Client, + rate_limit: Arc>>, +} - if let Some(ver) = min_tls { - builder = builder.min_tls_version(ver); +impl Client { + /// * `per` - must not be 0. + pub fn new( + min_tls: Option, + per: Duration, + num_request: NonZeroU64, + ) -> Result { + const USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")); + + let mut builder = reqwest::ClientBuilder::new() + .user_agent(USER_AGENT) + .https_only(true) + .min_tls_version(tls::Version::TLS_1_2) + .tcp_nodelay(false); + + if let Some(ver) = min_tls { + builder = builder.min_tls_version(ver); + } + + let client = builder.build()?; + + Ok(Self { + client: client.clone(), + rate_limit: Arc::new(Mutex::new( + ServiceBuilder::new() + .rate_limit(num_request.get(), per) + .service(client), + )), + }) } - Ok(builder.build()?) -} - -pub async fn remote_exists( - client: Client, - url: Url, - method: Method, -) -> Result { - let req = client - .request(method.clone(), url.clone()) - .send() - .await - .map_err(|err| BinstallError::Http { method, url, err })?; - Ok(req.status().is_success()) -} - -pub async fn get_redirected_final_url(client: &Client, url: Url) -> Result { - let method = Method::HEAD; - - let req = client - .request(method.clone(), url.clone()) - .send() - .await - .and_then(Response::error_for_status) - .map_err(|err| BinstallError::Http { method, url, err })?; - - Ok(req.url().clone()) -} - -pub(crate) async fn create_request( - client: Client, - url: Url, -) -> Result>, BinstallError> { - debug!("Downloading from: '{url}'"); - - client - .get(url.clone()) - .send() - .await - .and_then(|r| r.error_for_status()) - .map_err(|err| BinstallError::Http { - method: Method::GET, - url, - err, - }) - .map(Response::bytes_stream) + pub fn get_inner(&self) -> &reqwest::Client { + &self.client + } + + async fn send_request( + &self, + method: Method, + url: Url, + error_for_status: bool, + ) -> Result { + let request = Request::new(method.clone(), url.clone()); + + // Reduce critical section: + // - Construct the request before locking + // - Once the rate_limit is ready, call it and obtain + // the future, then release the lock before + // polling the future. + let future = self.rate_limit.lock().await.ready().await?.call(request); + + future + .await + .and_then(|response| { + if error_for_status { + response.error_for_status() + } else { + Ok(response) + } + }) + .map_err(|err| BinstallError::Http { method, url, err }) + } + + pub async fn remote_exists(&self, url: Url, method: Method) -> Result { + Ok(self + .send_request(method, url, false) + .await? + .status() + .is_success()) + } + + pub async fn get_redirected_final_url(&self, url: Url) -> Result { + Ok(self + .send_request(Method::HEAD, url, true) + .await? + .url() + .clone()) + } + + pub(crate) async fn create_request( + &self, + url: Url, + ) -> Result>, BinstallError> { + debug!("Downloading from: '{url}'"); + + self.send_request(Method::GET, url, true) + .await + .map(Response::bytes_stream) + } } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index c56dfc87..59fa9ad8 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -10,7 +10,6 @@ use cargo_toml::{Manifest, Package, Product}; use compact_str::{CompactString, ToCompactString}; use itertools::Itertools; use log::{debug, info, warn}; -use reqwest::Client; use semver::{Version, VersionReq}; use tokio::task::block_in_place; @@ -20,7 +19,7 @@ use crate::{ drivers::fetch_crate_cratesio, errors::BinstallError, fetchers::{Data, Fetcher, GhCrateMeta, QuickInstall}, - helpers::tasks::AutoAbortJoinHandle, + helpers::{remote::Client, tasks::AutoAbortJoinHandle}, manifests::cargo_toml_binstall::{Meta, PkgMeta}, }; From 9ee78f3736149dd5fbd6695ff3777413f5fbccf0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 8 Oct 2022 00:42:30 +1100 Subject: [PATCH 0804/2020] Update README (#464) Signed-off-by: Jiahao XU --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 80442f29..7ed33b91 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,8 @@ You probably want to **[see this page as it was when the latest version was publ ## Installation -To get started _using_ `cargo-binstall` first install the binary (either via `cargo install cargo-binstall` or by downloading a pre-compiled [release](https://github.com/cargo-bins/cargo-binstall/releases)). We recommend using the pre-compiled ones because we optimize those more than a standard source build does. +To get started _using_ `cargo-binstall` first install the binary (either via `cargo install cargo-binstall` or by downloading a pre-compiled [release](https://github.com/cargo-bins/cargo-binstall/releases)), then extract it using `tar` or `unzip` and move it into `$HOME/.cargo/bin`. +We recommend using the pre-compiled ones because we optimize those more than a standard source build does. | OS | Arch | URL | | ------- | ------- | ------------------------------------------------------------ | From 65c721f9a1b02960870987f95677d601198fa856 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 8 Oct 2022 01:01:03 +1100 Subject: [PATCH 0805/2020] release: binstalk v0.4.0 (#465) (cargo-release) version 0.4.0 Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 104f0edf..bf876d97 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -106,7 +106,7 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "binstalk" -version = "0.3.0" +version = "0.4.0" dependencies = [ "async-trait", "binstall-tar", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 8e05e08d..b474ece1 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.3.0" } +binstalk = { path = "../binstalk", version = "0.4.0" } clap = { version = "4.0.10", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index c710c2ab..3f52ce51 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.3.0" +version = "0.4.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From 5d51541dcf2345c7137562a04832a8ccdaf170b4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 8 Oct 2022 01:10:34 +1100 Subject: [PATCH 0806/2020] release: cargo-binstall v0.15.0 (#466) Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bf876d97..746cf1cc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -252,7 +252,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.14.0" +version = "0.15.0" dependencies = [ "binstalk", "clap", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index b474ece1..2649831c 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.14.0" +version = "0.15.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 03af75b1..465ec8f2 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 98b62251ad33d7b9db3449581c0cf3a1b866b87f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 8 Oct 2022 18:26:46 +1100 Subject: [PATCH 0807/2020] Fix unit test & integration CI and the release CI (#469) * Fix integration test: Make sure `cargo build cargo-binstall` would not fail due to binary already present * Disable feature `zlib-ng` for release build * Disable build-std for release build on aarch64-unknown-linux-gnu * Fix clippy warning in unit test CI * Fix compile-settings.jq * Fix caching: Rm `restores-keys` Signed-off-by: Jiahao XU --- .github/scripts/compile-settings.jq | 16 ++++++++++++---- .github/scripts/tests.sh | 8 +++++--- .github/workflows/build.yml | 4 ---- crates/bin/src/ui.rs | 2 +- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/.github/scripts/compile-settings.jq b/.github/scripts/compile-settings.jq index a73b4712..20ff9132 100644 --- a/.github/scripts/compile-settings.jq +++ b/.github/scripts/compile-settings.jq @@ -1,10 +1,18 @@ +if $matrix.target != "aarch64-unknown-linux-gnu" then { + # Use build-std to build a std library optimized for size and abort immediately on abort, + # so that format string for `unwrap`/`expect`/`unreachable`/`panic` can be optimized out. + # + # Disable it on aarch64-unknown-linux-gnu as it caused the build to fail. + release_build_std_args: "-Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort" +} else { + release_build_std_args: "" +} end +| if $for_release then { output: "release", profile: "release", - # Use build-std to build a std library optimized for size and abort immediately on abort, - # so that format string for `unwrap`/`expect`/`unreachable`/`panic` can be optimized out. - args: ($matrix.release_build_args // "-Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort"), - features: ($matrix.release_features // ["zlib-ng", "static", "rustls", "trust-dns", "fancy-no-backtrace", "log_release_max_level_debug"]), + args: ($matrix.release_build_args // .release_build_std_args), + features: ($matrix.release_features // ["static", "rustls", "trust-dns", "fancy-no-backtrace", "log_release_max_level_debug"]), } else { output: "debug", profile: "dev", diff --git a/.github/scripts/tests.sh b/.github/scripts/tests.sh index f2a4453e..5088bbf7 100755 --- a/.github/scripts/tests.sh +++ b/.github/scripts/tests.sh @@ -12,15 +12,17 @@ if [ "$2" = "Windows" ]; then "./$1" --log-level debug --no-confirm $crates else export CARGO_HOME=/tmp/cargo-home-for-test - export PATH="$CARGO_HOME/bin:$PATH" + export PATH="$CARGO_HOME/bin:/tmp/t/bin:$PATH" - mkdir -p "$CARGO_HOME/bin" + mkdir -p "/tmp/t/bin" # Copy it to bin to test use of env var `CARGO` - cp "./$1" "$CARGO_HOME/bin/cargo-binstall" + cp "./$1" "/tmp/t/bin/cargo-binstall" # Install binaries using cargo-binstall # shellcheck disable=SC2086 cargo binstall --log-level debug --no-confirm $crates + + rm -r /tmp/t fi # Test that the installed binaries can be run diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 940f2819..46d9bcf7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -95,10 +95,6 @@ jobs: ~/.cargo/git/db/ target/ key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}-${{ env.COUTPUT }} - restore-keys: | - ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }} - ${{ runner.os }}-cargo-${{ matrix.target }}- - ${{ runner.os }}-cargo- - name: Install musl-tools if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} diff --git a/crates/bin/src/ui.rs b/crates/bin/src/ui.rs index 715cc7b6..345baf1f 100644 --- a/crates/bin/src/ui.rs +++ b/crates/bin/src/ui.rs @@ -77,7 +77,7 @@ impl UIThreadInner { self.confirm_rx .recv() .await - .unwrap_or(Err(BinstallError::UserAbort)) + .unwrap_or_else(|| Err(BinstallError::UserAbort)) } } From 5e04a22c04b5a5fdfe372f98dafdff3680a476ae Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 8 Oct 2022 18:56:59 +1100 Subject: [PATCH 0808/2020] release: cargo-binstall v0.15.1 (#470) Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 746cf1cc..6c7c42dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -252,7 +252,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.15.0" +version = "0.15.1" dependencies = [ "binstalk", "clap", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 2649831c..7806a69a 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.15.0" +version = "0.15.1" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 465ec8f2..c828b80b 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 3a71c5a5c46552a3b074e61f0acb62a5c2325f53 Mon Sep 17 00:00:00 2001 From: azzamsa <17734314+azzamsa@users.noreply.github.com> Date: Sat, 8 Oct 2022 15:21:50 +0700 Subject: [PATCH 0809/2020] docs: update `unsupported crates` guide (#468) Fixes #467 --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 7ed33b91..5bae3e1e 100644 --- a/README.md +++ b/README.md @@ -48,23 +48,23 @@ Package versions and targets may be specified using the `--version` and `--targe 21:14:21 [INFO] Done in 6.212736s ``` -### Unsupported crates +## Unsupported crates -To install an unsupported crate, you may specify the Cargo.toml metadata entries for `pkg-url`, `bin-dir`, and `pkg-fmt` at the command line, with values [as documented below](#supporting-binary-installation). +Nowadays, `cargo-binstall` is smart enough. All you need just passing the crate name. + +```shell +cargo binstall --no-confirm --no-symlinks cargo-edit cargo-watch cargo-tarpaulin \ + watchexec-cli cargo-outdated just fnm broot stylua +``` + +If your favorite package fails to install, you may specify the Cargo.toml metadata entries for `pkg-url`, `bin-dir`, and `pkg-fmt` at the command line, with values [as documented below](#supporting-binary-installation). For example: + ```shell $ binstall \ --pkg-url="{ repo }/releases/download/{ version }/{ name }-{ version }-{ target }.{ archive-format }" \ --pkg-fmt="txz" crate_name - -$ # fnm for x86_64-unknown-linux-gnu only -$ cargo binstall fnm --pkg-url="https://github.com/Schniz/fnm/releases/download/v{ version }/fnm-linux.zip" \ - --pkg-fmt zip --bin-dir "{ bin }" --install-path /opt - -$ # broot -$ cargo binstall broot --pkg-url="https://github.com/Canop/broot/releases/download/v{ version }/broot_{ version }.zip" \ - --pkg-fmt zip --bin-dir "{ target }/{ bin }" --install-path /opt ``` ## FAQ From 1fdcc5a9824bee6753f50a7c34213ab1dcab8f87 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Oct 2022 13:17:07 +1100 Subject: [PATCH 0810/2020] Bump serde_json from 1.0.85 to 1.0.86 (#475) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.85 to 1.0.86. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.85...v1.0.86) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6c7c42dc..9607a577 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1771,9 +1771,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e55a28e3aaef9d5ce0506d0a14dbba8054ddc7e499ef522dd8b26859ec9d4a44" +checksum = "41feea4228a6f1cd09ec7a3593a682276702cd67b5273544757dae23c096f074" dependencies = [ "itoa", "ryu", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 3f52ce51..6ef1cf5b 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -34,7 +34,7 @@ scopeguard = "1.1.0" semver = { version = "1.0.14", features = ["serde"] } serde = { version = "1.0.145", features = ["derive"] } serde-tuple-vec-map = "1.0.1" -serde_json = "1.0.83" +serde_json = "1.0.86" strum = "0.24.1" strum_macros = "0.24.3" # Use a fork here since we need PAX support, but the upstream From 4e1ac6ee0d58e0719b1295565c83982ff5cf4db0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Oct 2022 02:27:06 +0000 Subject: [PATCH 0811/2020] Bump clap from 4.0.10 to 4.0.11 (#474) Bumps [clap](https://github.com/clap-rs/clap) from 4.0.10 to 4.0.11. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.10...v4.0.11) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9607a577..ab07d4b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -315,9 +315,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.10" +version = "4.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b1a0a4208c6c483b952ad35c6eed505fc13b46f08f631b81e828084a9318d74" +checksum = "4ed45cc2c62a3eff523e718d8576ba762c83a3146151093283ac62ae11933a73" dependencies = [ "atty", "bitflags", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 7806a69a..6ca7b7b5 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.4.0" } -clap = { version = "4.0.10", features = ["derive"] } +clap = { version = "4.0.11", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" From e605a9911316d0d0900284e560b719e789514334 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 10 Oct 2022 15:54:29 +1100 Subject: [PATCH 0812/2020] Impl retry for 503 and 429 status code in response (#473) * Add new dep httpdate v1.0.2 * Enable feature time of dep tokio in binstalk * Impl retry for `helpers::remote::Client` Fixed #472 Signed-off-by: Jiahao XU --- Cargo.lock | 1 + crates/binstalk/Cargo.toml | 3 +- crates/binstalk/src/helpers/remote.rs | 96 +++++++++++++++++++++++---- 3 files changed, 85 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ab07d4b3..81b211e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -124,6 +124,7 @@ dependencies = [ "futures-util", "generic-array", "home", + "httpdate", "itertools", "jobslot", "log", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 6ef1cf5b..0b53625b 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -23,6 +23,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } futures-util = { version = "0.3.23", default-features = false, features = ["std"] } generic-array = "0.14.6" home = "0.5.3" +httpdate = "1.0.2" itertools = "0.10.5" jobslot = { version = "0.2.6", features = ["tokio"] } log = { version = "0.4.17", features = ["std"] } @@ -45,7 +46,7 @@ tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.3.0" thiserror = "1.0.37" tinytemplate = "1.2.1" -tokio = { version = "1.21.2", features = ["macros", "rt", "process", "sync", "signal"], default-features = false } +tokio = { version = "1.21.2", features = ["macros", "rt", "process", "sync", "signal", "time"], default-features = false } toml_edit = { version = "0.14.4", features = ["easy"] } tower = { version = "0.4.13", features = ["limit", "util"] } trust-dns-resolver = { version = "0.21.2", optional = true, default-features = false, features = ["dnssec-ring"] } diff --git a/crates/binstalk/src/helpers/remote.rs b/crates/binstalk/src/helpers/remote.rs index d009939d..f1ce9f6a 100644 --- a/crates/binstalk/src/helpers/remote.rs +++ b/crates/binstalk/src/helpers/remote.rs @@ -1,10 +1,19 @@ -use std::{env, num::NonZeroU64, sync::Arc, time::Duration}; +use std::{ + env, + num::NonZeroU64, + sync::Arc, + time::{Duration, SystemTime}, +}; use bytes::Bytes; use futures_util::stream::Stream; -use log::debug; -use reqwest::{Request, Response}; -use tokio::sync::Mutex; +use httpdate::parse_http_date; +use log::{debug, info}; +use reqwest::{ + header::{HeaderMap, RETRY_AFTER}, + Request, Response, StatusCode, +}; +use tokio::{sync::Mutex, time::sleep}; use tower::{limit::rate::RateLimit, Service, ServiceBuilder, ServiceExt}; use crate::errors::BinstallError; @@ -12,6 +21,9 @@ use crate::errors::BinstallError; pub use reqwest::{tls, Method}; pub use url::Url; +const MAX_RETRY_DURATION: Duration = Duration::from_secs(120); +const MAX_RETRY_COUNT: u8 = 3; + #[derive(Clone, Debug)] pub struct Client { client: reqwest::Client, @@ -53,22 +65,51 @@ impl Client { &self.client } + async fn send_request_inner( + &self, + method: &Method, + url: &Url, + ) -> Result { + let mut count = 0; + + loop { + let request = Request::new(method.clone(), url.clone()); + + // Reduce critical section: + // - Construct the request before locking + // - Once the rate_limit is ready, call it and obtain + // the future, then release the lock before + // polling the future, which performs network I/O that could + // take really long. + let future = self.rate_limit.lock().await.ready().await?.call(request); + + let response = future.await?; + + let status = response.status(); + + match (status, parse_header_retry_after(response.headers())) { + ( + // 503 429 + StatusCode::SERVICE_UNAVAILABLE | StatusCode::TOO_MANY_REQUESTS, + Some(duration), + ) if duration <= MAX_RETRY_DURATION && count < MAX_RETRY_COUNT => { + info!("Receiver status code {status}, will wait for {duration:#?} and retry"); + sleep(duration).await + } + _ => break Ok(response), + } + + count += 1; + } + } + async fn send_request( &self, method: Method, url: Url, error_for_status: bool, ) -> Result { - let request = Request::new(method.clone(), url.clone()); - - // Reduce critical section: - // - Construct the request before locking - // - Once the rate_limit is ready, call it and obtain - // the future, then release the lock before - // polling the future. - let future = self.rate_limit.lock().await.ready().await?.call(request); - - future + self.send_request_inner(&method, &url) .await .and_then(|response| { if error_for_status { @@ -107,3 +148,30 @@ impl Client { .map(Response::bytes_stream) } } + +fn parse_header_retry_after(headers: &HeaderMap) -> Option { + let header = headers + .get_all(RETRY_AFTER) + .into_iter() + .last()? + .to_str() + .ok()?; + + match header.parse::() { + Ok(dur) => Some(Duration::from_secs(dur)), + Err(_) => { + let system_time = parse_http_date(header).ok()?; + + let retry_after_unix_timestamp = + system_time.duration_since(SystemTime::UNIX_EPOCH).ok()?; + + let curr_time_unix_timestamp = SystemTime::now() + .duration_since(SystemTime::UNIX_EPOCH) + .expect("SystemTime before UNIX EPOCH!"); + + // retry_after_unix_timestamp - curr_time_unix_timestamp + // If underflows, returns Duration::ZERO. + Some(retry_after_unix_timestamp.saturating_sub(curr_time_unix_timestamp)) + } + } +} From 2c578e216ecb1c66ff0ff3300b7ae2b825364d97 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Oct 2022 13:02:30 +1100 Subject: [PATCH 0813/2020] Bump clap from 4.0.11 to 4.0.12 (#476) --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 81b211e3..ca2427c8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -316,9 +316,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.11" +version = "4.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ed45cc2c62a3eff523e718d8576ba762c83a3146151093283ac62ae11933a73" +checksum = "385007cbbed899260395a4107435fead4cad80684461b3cc78238bdcb0bad58f" dependencies = [ "atty", "bitflags", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 6ca7b7b5..ee860299 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.4.0" } -clap = { version = "4.0.11", features = ["derive"] } +clap = { version = "4.0.12", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" From f4c840fa29cbc51c0fe98ba3ff597a3452b9ecc9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Oct 2022 13:46:54 +1100 Subject: [PATCH 0814/2020] Bump home from 0.5.3 to 0.5.4 (#478) --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ca2427c8..8f2273cc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -821,9 +821,9 @@ dependencies = [ [[package]] name = "home" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2456aef2e6b6a9784192ae780c0f15bc57df0e918585282325e8c8ac27737654" +checksum = "747309b4b440c06d57b0b25f2aee03ee9b5e5397d288c60e21fc709bb98a7408" dependencies = [ "winapi", ] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 0b53625b..f1054b42 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -22,7 +22,7 @@ flate2 = { version = "1.0.24", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } futures-util = { version = "0.3.23", default-features = false, features = ["std"] } generic-array = "0.14.6" -home = "0.5.3" +home = "0.5.4" httpdate = "1.0.2" itertools = "0.10.5" jobslot = { version = "0.2.6", features = ["tokio"] } From 035e600a56904b441397ded8f57c47f96c8e5d4d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Oct 2022 02:59:44 +0000 Subject: [PATCH 0815/2020] Bump clap from 4.0.12 to 4.0.13 (#477) --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8f2273cc..c2ffecfa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -316,9 +316,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.12" +version = "4.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "385007cbbed899260395a4107435fead4cad80684461b3cc78238bdcb0bad58f" +checksum = "69d64e88428747154bd8bc378d178377ef4dace7a5735ca1f3855be72f2c2cb5" dependencies = [ "atty", "bitflags", @@ -331,9 +331,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.0.10" +version = "4.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db342ce9fda24fb191e2ed4e102055a4d381c1086a06630174cd8da8d5d917ce" +checksum = "c42f169caba89a7d512b5418b09864543eeb4d497416c917d7137863bd2076ad" dependencies = [ "heck", "proc-macro-error", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index ee860299..34cb6ca3 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.4.0" } -clap = { version = "4.0.12", features = ["derive"] } +clap = { version = "4.0.13", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" From fdc617d87036ff137e52bd1f5f91a6426bc69b7b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 12 Oct 2022 15:56:26 +1100 Subject: [PATCH 0816/2020] Fix `install_from_source`: Set `cmd` to be kill_on_drop (#479) If user interrupts `cargo-binstall` by signal while it is running `cargo-install`, then the `cargo-install` would continue to run at background even after `cargo-binstall` terminates. Setting `cmd` to be kill_on_drop fixed this. Signed-off-by: Jiahao XU --- crates/binstalk/src/ops/install.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/binstalk/src/ops/install.rs b/crates/binstalk/src/ops/install.rs index 658758be..6a6c086b 100644 --- a/crates/binstalk/src/ops/install.rs +++ b/crates/binstalk/src/ops/install.rs @@ -121,7 +121,8 @@ async fn install_from_source( .arg("--version") .arg(version) .arg("--target") - .arg(target); + .arg(target) + .kill_on_drop(true); if quiet { cmd.arg("--quiet"); From aa6012baaeb6710f91a620c5be573a227696eaad Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 13 Oct 2022 11:31:13 +1100 Subject: [PATCH 0817/2020] Make extraction cancellable for `bin` and `tar` based formats (#481) Extraction wasn't cancellable by `cancel_on_user_sig_term` used in `entry` since it calls `block_in_place`. This PR adds cancellation support to it by adding a `static` variable `OnceCell` to `wait_on_cancellation_signal` so that once it returns `Ok(())`, all other calls to it after that point also returns `Ok(())` immediately. `StreamReadable`, which is used in cancellation process, then stores a boxed future of `wait_on_cancellation_signal` and polled it in `BufReader::fill_buf`. Note that for zip, the extraction process takes `File` instead of `StreamReadable` due to `io::Seek` requirement, so it cancelling during extraction for zip is still not possible. This PR also optimized `extract_bin` and `extract_zip` by using `StreamReadable::copy` introduced to this PR instead of `io::copy`, which allocates an internal buffer on stack, which imposes extra copy. It also fixed `StreamReadable::fill_buf` by ensuring that empty buffer is only returned on eof. * Make `wait_on_cancellation_signal` pub * Enable feature `parking_lot` of dep tokio * Mod `wait_on_cancellation_signal`: Use `OnceCell` internally to archive the effect that once call to it return `Ok(())`, all calls to it after that also returns `Ok(())`. * Impl `From` for `io::Error` * Impl cancellation on user signal in `StreamReadable` * Fix err msg when cancelling during extraction in `ops::resolve` * Optimize: Impl & use `StreamReadable::copy` which is same as `io::copy` but does not allocate any internal buffer since `StreamReadable` is buffered. * Fix `next_stream`: Return non-empty bytes on `Ok(Some(bytes))` Signed-off-by: Jiahao XU --- Cargo.lock | 1 + crates/binstalk/Cargo.toml | 3 +- crates/binstalk/src/errors.rs | 18 ++++- .../src/helpers/download/async_extracter.rs | 6 +- .../src/helpers/download/stream_readable.rs | 79 ++++++++++++++++--- crates/binstalk/src/helpers/signal.rs | 19 ++++- crates/binstalk/src/ops/resolve.rs | 3 + 7 files changed, 109 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c2ffecfa..64765419 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2042,6 +2042,7 @@ dependencies = [ "memchr", "mio", "num_cpus", + "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index f1054b42..24d09797 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -46,7 +46,8 @@ tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.3.0" thiserror = "1.0.37" tinytemplate = "1.2.1" -tokio = { version = "1.21.2", features = ["macros", "rt", "process", "sync", "signal", "time"], default-features = false } +# parking_lot - for OnceCell::const_new +tokio = { version = "1.21.2", features = ["macros", "rt", "process", "sync", "signal", "time", "parking_lot"], default-features = false } toml_edit = { version = "0.14.4", features = ["easy"] } tower = { version = "0.4.13", features = ["limit", "util"] } trust-dns-resolver = { version = "0.21.2", optional = true, default-features = false, features = ["dnssec-ring"] } diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index 19b8554b..0fc36970 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -1,4 +1,5 @@ use std::{ + io, path::PathBuf, process::{ExitCode, ExitStatus, Termination}, }; @@ -99,7 +100,7 @@ pub enum BinstallError { /// - Exit: 74 #[error(transparent)] #[diagnostic(severity(error), code(binstall::io))] - Io(std::io::Error), + Io(io::Error), /// An error interacting with the crates.io API. /// @@ -392,8 +393,8 @@ impl Termination for BinstallError { } } -impl From for BinstallError { - fn from(err: std::io::Error) -> Self { +impl From for BinstallError { + fn from(err: io::Error) -> Self { if err.get_ref().is_some() { let kind = err.kind(); @@ -404,9 +405,18 @@ impl From for BinstallError { inner .downcast() .map(|b| *b) - .unwrap_or_else(|err| BinstallError::Io(std::io::Error::new(kind, err))) + .unwrap_or_else(|err| BinstallError::Io(io::Error::new(kind, err))) } else { BinstallError::Io(err) } } } + +impl From for io::Error { + fn from(e: BinstallError) -> io::Error { + match e { + BinstallError::Io(io_error) => io_error, + e => io::Error::new(io::ErrorKind::Other, e), + } + } +} diff --git a/crates/binstalk/src/helpers/download/async_extracter.rs b/crates/binstalk/src/helpers/download/async_extracter.rs index 840cbf21..21311b3d 100644 --- a/crates/binstalk/src/helpers/download/async_extracter.rs +++ b/crates/binstalk/src/helpers/download/async_extracter.rs @@ -1,7 +1,7 @@ use std::{ fmt::Debug, fs, - io::{copy, Read, Seek}, + io::{Read, Seek}, path::Path, }; @@ -33,7 +33,7 @@ where fs::remove_file(path).ok(); }); - copy(&mut reader, &mut file)?; + reader.copy(&mut file)?; // Operation isn't aborted and all writes succeed, // disarm the remove_guard. @@ -54,7 +54,7 @@ where let mut file = tempfile()?; - copy(&mut reader, &mut file)?; + reader.copy(&mut file)?; // rewind it so that we can pass it to unzip file.rewind()?; diff --git a/crates/binstalk/src/helpers/download/stream_readable.rs b/crates/binstalk/src/helpers/download/stream_readable.rs index bc450fb5..6685c6bf 100644 --- a/crates/binstalk/src/helpers/download/stream_readable.rs +++ b/crates/binstalk/src/helpers/download/stream_readable.rs @@ -1,24 +1,26 @@ use std::{ cmp::min, - io::{self, BufRead, Read}, + future::Future, + io::{self, BufRead, Read, Write}, + pin::Pin, }; use bytes::{Buf, Bytes}; use futures_util::stream::{Stream, StreamExt}; use tokio::runtime::Handle; -use crate::errors::BinstallError; +use crate::{errors::BinstallError, helpers::signal::wait_on_cancellation_signal}; /// This wraps an AsyncIterator as a `Read`able. /// It must be used in non-async context only, /// meaning you have to use it with /// `tokio::task::{block_in_place, spawn_blocking}` or /// `std::thread::spawn`. -#[derive(Debug)] pub struct StreamReadable { stream: S, handle: Handle, bytes: Bytes, + cancellation_future: Pin> + Send>>, } impl StreamReadable { @@ -27,6 +29,39 @@ impl StreamReadable { stream, handle: Handle::current(), bytes: Bytes::new(), + cancellation_future: Box::pin(wait_on_cancellation_signal()), + } + } +} + +impl StreamReadable +where + S: Stream> + Unpin, + BinstallError: From, +{ + /// Copies from `self` to `writer`. + /// + /// Same as `io::copy` but does not allocate any internal buffer + /// since `self` is buffered. + pub(super) fn copy(&mut self, mut writer: W) -> io::Result<()> + where + W: Write, + { + self.copy_inner(&mut writer) + } + + fn copy_inner(&mut self, writer: &mut dyn Write) -> io::Result<()> { + loop { + let buf = self.fill_buf()?; + if buf.is_empty() { + // Eof + break Ok(()); + } + + writer.write_all(buf)?; + + let n = buf.len(); + self.consume(n); } } } @@ -56,6 +91,27 @@ where Ok(n) } } + +/// If `Ok(Some(bytes))` if returned, then `bytes.is_empty() == false`. +async fn next_stream(stream: &mut S) -> io::Result> +where + S: Stream> + Unpin, + BinstallError: From, +{ + loop { + let option = stream + .next() + .await + .transpose() + .map_err(BinstallError::from)?; + + match option { + Some(bytes) if bytes.is_empty() => continue, + option => break Ok(option), + } + } +} + impl BufRead for StreamReadable where S: Stream> + Unpin, @@ -65,13 +121,18 @@ where let bytes = &mut self.bytes; if !bytes.has_remaining() { - match self.handle.block_on(async { self.stream.next().await }) { - Some(Ok(new_bytes)) => *bytes = new_bytes, - Some(Err(e)) => { - let e: BinstallError = e.into(); - return Err(io::Error::new(io::ErrorKind::Other, e)); + let option = self.handle.block_on(async { + tokio::select! { + res = next_stream(&mut self.stream) => res, + res = self.cancellation_future.as_mut() => { + Err(res.err().unwrap_or_else(|| io::Error::from(BinstallError::UserAbort))) + }, } - None => (), + })?; + + if let Some(new_bytes) = option { + // new_bytes are guaranteed to be non-empty. + *bytes = new_bytes; } } Ok(&*bytes) diff --git a/crates/binstalk/src/helpers/signal.rs b/crates/binstalk/src/helpers/signal.rs index e15ed8e1..d01041df 100644 --- a/crates/binstalk/src/helpers/signal.rs +++ b/crates/binstalk/src/helpers/signal.rs @@ -1,7 +1,7 @@ use std::io; use futures_util::future::pending; -use tokio::signal; +use tokio::{signal, sync::OnceCell}; use super::tasks::AutoAbortJoinHandle; use crate::errors::BinstallError; @@ -24,12 +24,25 @@ pub async fn cancel_on_user_sig_term( tokio::select! { res = handle => res, res = wait_on_cancellation_signal() => { - res.map_err(BinstallError::Io).and(Err(BinstallError::UserAbort)) + res + .map_err(BinstallError::Io) + .and(Err(BinstallError::UserAbort)) } } } -async fn wait_on_cancellation_signal() -> Result<(), io::Error> { +/// If call to it returns `Ok(())`, then all calls to this function after +/// that also returns `Ok(())`. +pub async fn wait_on_cancellation_signal() -> Result<(), io::Error> { + static CANCELLED: OnceCell<()> = OnceCell::const_new(); + + CANCELLED + .get_or_try_init(wait_on_cancellation_signal_inner) + .await + .copied() +} + +async fn wait_on_cancellation_signal_inner() -> Result<(), io::Error> { #[cfg(unix)] async fn inner() -> Result<(), io::Error> { unix::wait_on_cancellation_signal_unix().await diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 59fa9ad8..3335a130 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -260,6 +260,9 @@ async fn resolve_inner( } } Err(err) => { + if let BinstallError::UserAbort = err { + return Err(err); + } warn!( "Error while downloading and extracting from fetcher {}: {}", fetcher.source_name(), From 394425565a997f0453f605b3448d35e7575fa51d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Oct 2022 13:13:55 +1100 Subject: [PATCH 0818/2020] Bump clap from 4.0.13 to 4.0.14 (#482) Bumps [clap](https://github.com/clap-rs/clap) from 4.0.13 to 4.0.14. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.13...v4.0.14) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 64765419..d5cba00f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -316,9 +316,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.13" +version = "4.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d64e88428747154bd8bc378d178377ef4dace7a5735ca1f3855be72f2c2cb5" +checksum = "6ea54a38e4bce14ff6931c72e5b3c43da7051df056913d4e7e1fcdb1c03df69d" dependencies = [ "atty", "bitflags", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 34cb6ca3..d7499385 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.4.0" } -clap = { version = "4.0.13", features = ["derive"] } +clap = { version = "4.0.14", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" From 71ef2f6ed39ee75bb7dbfa2244f1a167c8c86b69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Oct 2022 13:03:10 +1100 Subject: [PATCH 0819/2020] Bump mimalloc from 0.1.29 to 0.1.30 (#484) Bumps [mimalloc](https://github.com/purpleprotocol/mimalloc_rust) from 0.1.29 to 0.1.30. - [Release notes](https://github.com/purpleprotocol/mimalloc_rust/releases) - [Commits](https://github.com/purpleprotocol/mimalloc_rust/compare/v0.1.29...v0.1.30) --- updated-dependencies: - dependency-name: mimalloc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d5cba00f..6242c901 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1060,9 +1060,9 @@ checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" [[package]] name = "libmimalloc-sys" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11ca136052550448f55df7898c6dbe651c6b574fe38a0d9ea687a9f8088a2e2c" +checksum = "8fc093ab289b0bfda3aa1bdfab9c9542be29c7ef385cfcbe77f8c9813588eb48" dependencies = [ "cc", ] @@ -1179,9 +1179,9 @@ dependencies = [ [[package]] name = "mimalloc" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f64ad83c969af2e732e907564deb0d0ed393cec4af80776f77dd77a1a427698" +checksum = "76ce6a4b40d3bff9eb3ce9881ca0737a85072f9f975886082640cd46a75cdb35" dependencies = [ "libmimalloc-sys", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index d7499385..9d0fafd8 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -28,7 +28,7 @@ crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" miette = "5.3.0" -mimalloc = { version = "0.1.29", default-features = false, optional = true } +mimalloc = { version = "0.1.30", default-features = false, optional = true } semver = "1.0.14" simplelog = "0.12.0" tempfile = "3.3.0" From ac7de213f9fa764a8010db2d67177d8b97fa20de Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Oct 2022 02:15:16 +0000 Subject: [PATCH 0820/2020] Bump clap from 4.0.14 to 4.0.15 (#483) Bumps [clap](https://github.com/clap-rs/clap) from 4.0.14 to 4.0.15. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.14...v4.0.15) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6242c901..588d9abe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -316,9 +316,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.14" +version = "4.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea54a38e4bce14ff6931c72e5b3c43da7051df056913d4e7e1fcdb1c03df69d" +checksum = "6bf8832993da70a4c6d13c581f4463c2bdda27b9bf1c5498dc4365543abe6d6f" dependencies = [ "atty", "bitflags", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 9d0fafd8..e5feb2ba 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.4.0" } -clap = { version = "4.0.14", features = ["derive"] } +clap = { version = "4.0.15", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" From 24aa099320b70e41e2a90d121cbfeab074b52fda Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Oct 2022 02:55:54 +0000 Subject: [PATCH 0821/2020] Bump cargo_toml from 0.12.4 to 0.13.0 (#486) Bumps [cargo_toml](https://gitlab.com/crates.rs/cargo_toml) from 0.12.4 to 0.13.0. - [Release notes](https://gitlab.com/crates.rs/cargo_toml/tags) - [Commits](https://gitlab.com/crates.rs/cargo_toml/commits/master) --- updated-dependencies: - dependency-name: cargo_toml dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- .github/workflows/unit-tests.yml | 2 +- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 46d9bcf7..bf2e6a22 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ on: env: CARGO_TERM_COLOR: always - CARGO_UNSTABLE_SPARSE_REGISTRY: "true" + #CARGO_UNSTABLE_SPARSE_REGISTRY: "true" jobs: build: diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 57e10fff..187de168 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -8,7 +8,7 @@ on: env: CARGO_TERM_COLOR: always - CARGO_UNSTABLE_SPARSE_REGISTRY: "true" + #CARGO_UNSTABLE_SPARSE_REGISTRY: "true" jobs: test: diff --git a/Cargo.lock b/Cargo.lock index 588d9abe..7c346df5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -271,9 +271,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.12.4" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a621d5d6d6c8d086dbaf1fe659981da41a1b63c6bdbba30b4dbb592c6d3bd49" +checksum = "aa0e3586af56b3bfa51fca452bd56e8dbbbd5d8d81cbf0b7e4e35b695b537eb8" dependencies = [ "serde", "toml", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 24d09797..bb2b54fd 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0" async-trait = "0.1.57" bytes = "1.2.1" bzip2 = "0.4.3" -cargo_toml = "0.12.4" +cargo_toml = "0.13.0" compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.2", path = "../detect-targets" } From 9ebcd1d426a7465f0c0fdfd1086cf4b240f54650 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Oct 2022 03:13:47 +0000 Subject: [PATCH 0822/2020] Bump clap from 4.0.15 to 4.0.16 (#489) Bumps [clap](https://github.com/clap-rs/clap) from 4.0.15 to 4.0.16. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.15...v4.0.16) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7c346df5..61fb8f69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -316,9 +316,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.15" +version = "4.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bf8832993da70a4c6d13c581f4463c2bdda27b9bf1c5498dc4365543abe6d6f" +checksum = "2ef582e2c00a63a0c0aa1fb4a4870781c4f5729f51196d3537fa7c1c1992eaa3" dependencies = [ "atty", "bitflags", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index e5feb2ba..94f72a26 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.4.0" } -clap = { version = "4.0.15", features = ["derive"] } +clap = { version = "4.0.16", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" From f4f6e369847366d69dd054618adf65d8897c8826 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 18 Oct 2022 15:10:44 +1100 Subject: [PATCH 0823/2020] Fix `-V` behavior (#488) Fixed #485 * Make `Duration` in MainExit::Success` optional * Fix arg parsing: Print version on `-V` Signed-off-by: Jiahao XU --- crates/bin/src/bin_util.rs | 17 ++++++++++------- crates/bin/src/main.rs | 17 +++++++++++------ 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/crates/bin/src/bin_util.rs b/crates/bin/src/bin_util.rs index 7a85ad0b..1fe6f6ae 100644 --- a/crates/bin/src/bin_util.rs +++ b/crates/bin/src/bin_util.rs @@ -11,7 +11,7 @@ use miette::Result; use tokio::runtime::Runtime; pub enum MainExit { - Success(Duration), + Success(Option), Error(BinstallError), Report(miette::Report), } @@ -20,7 +20,9 @@ impl Termination for MainExit { fn report(self) -> ExitCode { match self { Self::Success(spent) => { - info!("Done in {spent:?}"); + if let Some(spent) = spent { + info!("Done in {spent:?}"); + } ExitCode::SUCCESS } Self::Error(err) => err.report(), @@ -35,11 +37,12 @@ impl Termination for MainExit { impl MainExit { pub fn new(result: Result, BinstallError>, done: Duration) -> Self { result.map_or_else(MainExit::Error, |res| { - res.map(|()| MainExit::Success(done)).unwrap_or_else(|err| { - err.downcast::() - .map(MainExit::Error) - .unwrap_or_else(MainExit::Report) - }) + res.map(|()| MainExit::Success(Some(done))) + .unwrap_or_else(|err| { + err.downcast::() + .map(MainExit::Error) + .unwrap_or_else(MainExit::Report) + }) }) } } diff --git a/crates/bin/src/main.rs b/crates/bin/src/main.rs index d7312502..b80cd006 100644 --- a/crates/bin/src/main.rs +++ b/crates/bin/src/main.rs @@ -22,14 +22,19 @@ fn main() -> MainExit { Err(err) => return MainExit::Error(err), }; - ui::logging(&args); + if args.version { + println!("{}", env!("CARGO_PKG_VERSION")); + MainExit::Success(None) + } else { + ui::logging(&args); - let start = Instant::now(); + let start = Instant::now(); - let result = run_tokio_main(entry::install_crates(args, jobserver_client)); + let result = run_tokio_main(entry::install_crates(args, jobserver_client)); - let done = start.elapsed(); - debug!("run time: {done:?}"); + let done = start.elapsed(); + debug!("run time: {done:?}"); - MainExit::new(result, done) + MainExit::new(result, done) + } } From e5f64f705f16d9d7b65c7969195a039264b7e01d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 18 Oct 2022 17:00:49 +1100 Subject: [PATCH 0824/2020] release: binstalk v0.4.1 (#492) (cargo-release) version 0.4.1 Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 61fb8f69..0e1ddd83 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -106,7 +106,7 @@ checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" [[package]] name = "binstalk" -version = "0.4.0" +version = "0.4.1" dependencies = [ "async-trait", "binstall-tar", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 94f72a26..e08f8cc6 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.4.0" } +binstalk = { path = "../binstalk", version = "0.4.1" } clap = { version = "4.0.16", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index bb2b54fd..89a79c6d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.4.0" +version = "0.4.1" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From b9f486d9f51900bf97c52bdb6cd846b03f997165 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 18 Oct 2022 17:42:21 +1100 Subject: [PATCH 0825/2020] release: cargo-binstall v0.16.0 (#491) Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0e1ddd83..63816c92 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -253,7 +253,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.15.1" +version = "0.16.0" dependencies = [ "binstalk", "clap", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index e08f8cc6..462b9ed2 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.15.1" +version = "0.16.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index c828b80b..6d42ca6b 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 7581e878ac591e81a485367709ebc2dc3c1ad6f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Oct 2022 02:05:05 +0000 Subject: [PATCH 0826/2020] Bump clap from 4.0.16 to 4.0.17 (#493) Bumps [clap](https://github.com/clap-rs/clap) from 4.0.16 to 4.0.17. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.16...v4.0.17) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 63816c92..e58d5d41 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -316,9 +316,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.16" +version = "4.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ef582e2c00a63a0c0aa1fb4a4870781c4f5729f51196d3537fa7c1c1992eaa3" +checksum = "06badb543e734a2d6568e19a40af66ed5364360b9226184926f89d229b4b4267" dependencies = [ "atty", "bitflags", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 462b9ed2..ae181ed2 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.4.1" } -clap = { version = "4.0.16", features = ["derive"] } +clap = { version = "4.0.17", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" From 087d69da6e92cf3e49f3e12f5e10443168861669 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Oct 2022 02:24:09 +0000 Subject: [PATCH 0827/2020] Bump async-trait from 0.1.57 to 0.1.58 (#494) Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.57 to 0.1.58. - [Release notes](https://github.com/dtolnay/async-trait/releases) - [Commits](https://github.com/dtolnay/async-trait/compare/0.1.57...0.1.58) --- updated-dependencies: - dependency-name: async-trait dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e58d5d41..4f4e732f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,9 +57,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.57" +version = "0.1.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76464446b8bc32758d7e88ee1a804d9914cd9b1cb264c029899680b0be29826f" +checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 89a79c6d..d21c7445 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0" [dependencies] -async-trait = "0.1.57" +async-trait = "0.1.58" bytes = "1.2.1" bzip2 = "0.4.3" cargo_toml = "0.13.0" From d90547c81803e1c01f4b1be80d3b21208e926bab Mon Sep 17 00:00:00 2001 From: Diogo Sousa Date: Thu, 20 Oct 2022 02:44:35 +0100 Subject: [PATCH 0828/2020] Support default filename with underscores. (#495) This is the default format used by github action rust-build/rust-build. --- SUPPORT.md | 8 ++++++-- crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs | 5 +++++ 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/SUPPORT.md b/SUPPORT.md index afc3bc83..d0ff1850 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -66,9 +66,13 @@ are: - `{ name }-{ target }-v{ version }{ archive-suffix }` - `{ name }-{ version }-{ target }{ archive-suffix }` - `{ name }-v{ version }-{ target }{ archive-suffix }` -- `{ name }-{ version }-{ target }{ archive-suffix }` -- `{ name }-v{ version }-{ target }{ archive-suffix }` +- `{ name }_{ target }_{ version }{ archive-suffix }` +- `{ name }_{ target }_v{ version }{ archive-suffix }` +- `{ name }_{ version }_{ target }{ archive-suffix }` +- `{ name }_v{ version }_{ target }{ archive-suffix }` - `{ name }-{ target }{ archive-suffix }` ("versionless") +- `{ name }{ archive-suffix }` ("versionless") +- `{ name }_{ target }{ archive-suffix }` ("versionless") The paths are: diff --git a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs index 665e4b7f..cf758a8f 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs @@ -18,11 +18,16 @@ pub const FULL_FILENAMES: &[&str] = &[ "{ name }-{ target }-{ version }{ archive-suffix }", "{ name }-{ version }-{ target }{ archive-suffix }", "{ name }-v{ version }-{ target }{ archive-suffix }", + "{ name }_{ target }_v{ version }{ archive-suffix }", + "{ name }_{ target }_{ version }{ archive-suffix }", + "{ name }_{ version }_{ target }{ archive-suffix }", + "{ name }_v{ version }_{ target }{ archive-suffix }", ]; pub const NOVERSION_FILENAMES: &[&str] = &[ "{ name }-{ target }{ archive-suffix }", "{ name }{ archive-suffix }", + "{ name }_{ target }{ archive-suffix }", ]; impl RepositoryHost { From 5ff68472d4bfde0a26ab003f14fa9fea576d4eea Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Oct 2022 02:11:26 +0000 Subject: [PATCH 0829/2020] Bump serde_json from 1.0.86 to 1.0.87 (#496) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.86 to 1.0.87. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.86...v1.0.87) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4f4e732f..7b18fc9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1772,9 +1772,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41feea4228a6f1cd09ec7a3593a682276702cd67b5273544757dae23c096f074" +checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" dependencies = [ "itoa", "ryu", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index d21c7445..6050b2d0 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -35,7 +35,7 @@ scopeguard = "1.1.0" semver = { version = "1.0.14", features = ["serde"] } serde = { version = "1.0.145", features = ["derive"] } serde-tuple-vec-map = "1.0.1" -serde_json = "1.0.86" +serde_json = "1.0.87" strum = "0.24.1" strum_macros = "0.24.3" # Use a fork here since we need PAX support, but the upstream From cd549654cb0670f559ef4b3663a7f45f3ec72532 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Oct 2022 13:43:30 +1100 Subject: [PATCH 0830/2020] Bump clap from 4.0.17 to 4.0.18 (#498) Bumps [clap](https://github.com/clap-rs/clap) from 4.0.17 to 4.0.18. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.17...v4.0.18) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7b18fc9e..12620e79 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -316,9 +316,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.17" +version = "4.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06badb543e734a2d6568e19a40af66ed5364360b9226184926f89d229b4b4267" +checksum = "335867764ed2de42325fafe6d18b8af74ba97ee0c590fa016f157535b42ab04b" dependencies = [ "atty", "bitflags", @@ -331,9 +331,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.0.13" +version = "4.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f169caba89a7d512b5418b09864543eeb4d497416c917d7137863bd2076ad" +checksum = "16a1b0f6422af32d5da0c58e2703320f379216ee70198241c84173a8c5ac28f3" dependencies = [ "heck", "proc-macro-error", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index ae181ed2..d7100822 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.4.1" } -clap = { version = "4.0.17", features = ["derive"] } +clap = { version = "4.0.18", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" From 351d1b747e64e7dea6f2c90ed121f05501455359 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 21 Oct 2022 02:59:37 +0000 Subject: [PATCH 0831/2020] Bump futures-util from 0.3.24 to 0.3.25 (#497) Bumps [futures-util](https://github.com/rust-lang/futures-rs) from 0.3.24 to 0.3.25. - [Release notes](https://github.com/rust-lang/futures-rs/releases) - [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.24...0.3.25) --- updated-dependencies: - dependency-name: futures-util dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 28 ++++++++++++++-------------- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 12620e79..a382892a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -668,9 +668,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bdd20c28fadd505d0fd6712cdfcb0d4b5648baf45faef7f852afb2399bb050" +checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" dependencies = [ "futures-core", "futures-sink", @@ -678,9 +678,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e5aa3de05362c3fb88de6531e6296e85cde7739cccad4b9dfeeb7f6ebce56bf" +checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" [[package]] name = "futures-executor" @@ -695,15 +695,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbf4d2a7a308fd4578637c0b17c7e1c7ba127b8f6ba00b29f717e9655d85eb68" +checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" [[package]] name = "futures-macro" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42cd15d1c7456c04dbdf7e88bcd69760d74f3a798d6444e16974b505b0e62f17" +checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" dependencies = [ "proc-macro2", "quote", @@ -712,21 +712,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b20ba5a92e727ba30e72834706623d94ac93a725410b6a6b6fbc1b07f7ba56" +checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" [[package]] name = "futures-task" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6508c467c73851293f390476d4491cf4d227dbabcd4170f3bb6044959b294f1" +checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" [[package]] name = "futures-util" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44fb6cb1be61cc1d2e43b262516aafcf63b241cffdb1d3fa115f91d9c7b09c90" +checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" dependencies = [ "futures-channel", "futures-core", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 6050b2d0..41e72b82 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -20,7 +20,7 @@ detect-targets = { version = "0.1.2", path = "../detect-targets" } digest = "0.10.5" flate2 = { version = "1.0.24", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } -futures-util = { version = "0.3.23", default-features = false, features = ["std"] } +futures-util = { version = "0.3.25", default-features = false, features = ["std"] } generic-array = "0.14.6" home = "0.5.4" httpdate = "1.0.2" From 78b9e820c3a807502839148e7ee665181c1a08ed Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 13:45:34 +1100 Subject: [PATCH 0832/2020] Bump serde from 1.0.145 to 1.0.147 (#501) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.145 to 1.0.147. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.145...v1.0.147) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a382892a..85b75139 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1743,9 +1743,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.145" +version = "1.0.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "728eb6351430bccb993660dfffc5a72f91ccc1295abaa8ce19b27ebe4f75568b" +checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" dependencies = [ "serde_derive", ] @@ -1761,9 +1761,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.145" +version = "1.0.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fa1584d3d1bcacd84c277a0dfe21f5b0f6accf4a23d04d4c6d61f1af522b4c" +checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 41e72b82..011a1f49 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -33,7 +33,7 @@ once_cell = "1.15.0" reqwest = { version = "0.11.12", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } scopeguard = "1.1.0" semver = { version = "1.0.14", features = ["serde"] } -serde = { version = "1.0.145", features = ["derive"] } +serde = { version = "1.0.147", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.87" strum = "0.24.1" From 3530f942438b538b5d0f7e6e468693063ee9e6ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Oct 2022 14:22:30 +1100 Subject: [PATCH 0833/2020] Bump toml_edit from 0.14.4 to 0.15.0 (#500) --- Cargo.lock | 16 +++++++++++++--- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 85b75139..4276727e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2106,15 +2106,25 @@ dependencies = [ ] [[package]] -name = "toml_edit" -version = "0.14.4" +name = "toml_datetime" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5376256e44f2443f8896ac012507c19a012df0fe8758b55246ae51a2279db51f" +checksum = "808b51e57d0ef8f71115d8f3a01e7d3750d01c79cac4b3eda910f4389fdf92fd" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1541ba70885967e662f69d31ab3aeca7b1aaecfcd58679590b893e9239c3646" dependencies = [ "combine", "indexmap", "itertools", "serde", + "toml_datetime", ] [[package]] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 011a1f49..66420372 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -48,7 +48,7 @@ thiserror = "1.0.37" tinytemplate = "1.2.1" # parking_lot - for OnceCell::const_new tokio = { version = "1.21.2", features = ["macros", "rt", "process", "sync", "signal", "time", "parking_lot"], default-features = false } -toml_edit = { version = "0.14.4", features = ["easy"] } +toml_edit = { version = "0.15.0", features = ["easy"] } tower = { version = "0.4.13", features = ["limit", "util"] } trust-dns-resolver = { version = "0.21.2", optional = true, default-features = false, features = ["dnssec-ring"] } url = { version = "2.3.1", features = ["serde"] } From 9ed04cf89bee3ef0edcb7a08cd961659b23132c9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 28 Oct 2022 11:48:16 +1100 Subject: [PATCH 0834/2020] Fix clippy error on unit test CI (#503) Signed-off-by: Jiahao XU --- crates/bin/src/ui.rs | 2 +- crates/binstalk/src/bins.rs | 4 +--- crates/binstalk/src/ops/install.rs | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/crates/bin/src/ui.rs b/crates/bin/src/ui.rs index 345baf1f..715cc7b6 100644 --- a/crates/bin/src/ui.rs +++ b/crates/bin/src/ui.rs @@ -77,7 +77,7 @@ impl UIThreadInner { self.confirm_rx .recv() .await - .unwrap_or_else(|| Err(BinstallError::UserAbort)) + .unwrap_or(Err(BinstallError::UserAbort)) } } diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 8f93fe67..221cfc59 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -121,9 +121,7 @@ impl BinFile { }; // Destination at install dir + base-name{.extension} - let dest = data - .install_path - .join(&ctx.render("{ bin }{ binary-ext }")?); + let dest = data.install_path.join(ctx.render("{ bin }{ binary-ext }")?); let (dest, link) = if no_symlinks { (dest, None) diff --git a/crates/binstalk/src/ops/install.rs b/crates/binstalk/src/ops/install.rs index 6a6c086b..2e1fe3d1 100644 --- a/crates/binstalk/src/ops/install.rs +++ b/crates/binstalk/src/ops/install.rs @@ -132,7 +132,7 @@ async fn install_from_source( cmd.arg("--force"); } - let command_string = format!("{:?}", cmd); + let command_string = format!("{cmd:?}"); let mut child = jobserver_client.configure_and_run(&mut cmd, |cmd| cmd.spawn())?; From 0ac27bbb1d101100bd08340915b5de8615bd4388 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 28 Oct 2022 12:02:28 +1100 Subject: [PATCH 0835/2020] Re enable `CARGO_UNSTABLE_SPARSE_REGISTRY` (#504) Signed-off-by: Jiahao XU --- .github/workflows/build.yml | 2 +- .github/workflows/unit-tests.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index bf2e6a22..46d9bcf7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ on: env: CARGO_TERM_COLOR: always - #CARGO_UNSTABLE_SPARSE_REGISTRY: "true" + CARGO_UNSTABLE_SPARSE_REGISTRY: "true" jobs: build: diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 187de168..57e10fff 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -8,7 +8,7 @@ on: env: CARGO_TERM_COLOR: always - #CARGO_UNSTABLE_SPARSE_REGISTRY: "true" + CARGO_UNSTABLE_SPARSE_REGISTRY: "true" jobs: test: From 0f120b6948ebeb622b56eacffb0455b1eed4a7f4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Oct 2022 13:05:20 +1100 Subject: [PATCH 0836/2020] Bump miette from 5.3.0 to 5.4.1 (#506) Bumps [miette](https://github.com/zkat/miette) from 5.3.0 to 5.4.1. - [Release notes](https://github.com/zkat/miette/releases) - [Changelog](https://github.com/zkat/miette/blob/main/CHANGELOG.md) - [Commits](https://github.com/zkat/miette/compare/miette-derive-v5.3.0...miette-derive-v5.4.1) --- updated-dependencies: - dependency-name: miette dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4276727e..80a8dc9f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1148,9 +1148,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "miette" -version = "5.3.0" +version = "5.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28d6092d7e94a90bb9ea8e6c26c99d5d112d49dda2afdb4f7ea8cf09e1a5a6d" +checksum = "7a24c4b4063c21e037dffb4de388ee85e400bff299803aba9513d9c52de8116b" dependencies = [ "atty", "backtrace", @@ -1168,9 +1168,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.3.0" +version = "5.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2485ed7d1fe80704928e3eb86387439609bd0c6bb96db8208daa364cfd1e09" +checksum = "827d18edee5d43dc309eb0ac565f2b8e2fdc89b986b2d929e924a0f6e7f23835" dependencies = [ "proc-macro2", "quote", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index d7100822..35ff4911 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -27,7 +27,7 @@ clap = { version = "4.0.18", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" -miette = "5.3.0" +miette = "5.4.1" mimalloc = { version = "0.1.30", default-features = false, optional = true } semver = "1.0.14" simplelog = "0.12.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 66420372..3d9afcad 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -27,7 +27,7 @@ httpdate = "1.0.2" itertools = "0.10.5" jobslot = { version = "0.2.6", features = ["tokio"] } log = { version = "0.4.17", features = ["std"] } -miette = "5.3.0" +miette = "5.4.1" normalize-path = { version = "0.1.0", path = "../normalize-path" } once_cell = "1.15.0" reqwest = { version = "0.11.12", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } From 955751c82f0a959a0cf78161106ece02b2292387 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Oct 2022 02:16:53 +0000 Subject: [PATCH 0837/2020] Bump once_cell from 1.15.0 to 1.16.0 (#505) Bumps [once_cell](https://github.com/matklad/once_cell) from 1.15.0 to 1.16.0. - [Release notes](https://github.com/matklad/once_cell/releases) - [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md) - [Commits](https://github.com/matklad/once_cell/compare/v1.15.0...v1.16.0) --- updated-dependencies: - dependency-name: once_cell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 80a8dc9f..5014d91f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1284,9 +1284,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" +checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" [[package]] name = "openssl" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 3d9afcad..ce76572d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -29,7 +29,7 @@ jobslot = { version = "0.2.6", features = ["tokio"] } log = { version = "0.4.17", features = ["std"] } miette = "5.4.1" normalize-path = { version = "0.1.0", path = "../normalize-path" } -once_cell = "1.15.0" +once_cell = "1.16.0" reqwest = { version = "0.11.12", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } scopeguard = "1.1.0" semver = { version = "1.0.14", features = ["serde"] } From 25a4ceb05012ada93a097b0e6fbda790616e213a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 31 Oct 2022 02:30:40 +0000 Subject: [PATCH 0838/2020] Bump mathieudutour/github-tag-action from 6.0 to 6.1 (#502) Bumps [mathieudutour/github-tag-action](https://github.com/mathieudutour/github-tag-action) from 6.0 to 6.1. - [Release notes](https://github.com/mathieudutour/github-tag-action/releases) - [Commits](https://github.com/mathieudutour/github-tag-action/compare/v6.0...v6.1) --- updated-dependencies: - dependency-name: mathieudutour/github-tag-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c1ff2a44..becca73b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -36,14 +36,14 @@ jobs: - uses: actions/checkout@v3 - name: Push lib release tag if: "! startsWith(github.event.head_commit.message, 'release: cargo-binstall v')" - uses: mathieudutour/github-tag-action@v6.0 + uses: mathieudutour/github-tag-action@v6.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} custom_tag: ${{ needs.info.outputs.version }} tag_prefix: ${{ needs.info.outputs.crate }}- - name: Push cli release tag if: "startsWith(github.event.head_commit.message, 'release: cargo-binstall v')" - uses: mathieudutour/github-tag-action@v6.0 + uses: mathieudutour/github-tag-action@v6.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} custom_tag: ${{ needs.info.outputs.version }} From c48bc2a264eda3efbcd74bbb74f7a64081bf93c4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 3 Nov 2022 21:11:43 +1100 Subject: [PATCH 0839/2020] Fix crate `normalize-path` (#508) * Impl new function `NormalizePath::is_normalized` * Always normalize and ret `PathBuf` in `NormalizePath::normalize` Signed-off-by: Jiahao XU --- crates/binstalk/src/bins.rs | 4 +-- crates/normalize-path/src/lib.rs | 48 +++++++++++++++++--------------- 2 files changed, 27 insertions(+), 25 deletions(-) diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 221cfc59..8961d89d 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -113,11 +113,11 @@ impl BinFile { if !is_valid_path(&path_normalized) { return Err(BinstallError::InvalidSourceFilePath { - path: path_normalized.into_owned(), + path: path_normalized, }); } - data.bin_path.join(path_normalized.as_ref()) + data.bin_path.join(&path_normalized) }; // Destination at install dir + base-name{.extension} diff --git a/crates/normalize-path/src/lib.rs b/crates/normalize-path/src/lib.rs index 20e9ea68..42e2b8ec 100644 --- a/crates/normalize-path/src/lib.rs +++ b/crates/normalize-path/src/lib.rs @@ -18,10 +18,7 @@ //! ); //! ``` -use std::{ - borrow::Cow, - path::{Component, Path, PathBuf}, -}; +use std::path::{Component, Path, PathBuf}; /// Extension trait to add `normalize_path` to std's [`Path`]. pub trait NormalizePath { @@ -30,28 +27,19 @@ pub trait NormalizePath { /// All redundant separator and up-level references are collapsed. /// /// However, this does not resolve links. - fn normalize(&self) -> Cow<'_, Path>; -} + fn normalize(&self) -> PathBuf; -fn is_normalized(path: &Path) -> bool { - for component in path.components() { - match component { - Component::CurDir | Component::ParentDir => { - return false; - } - _ => continue, - } - } - - true + /// Return `true` if the path is normalized. + /// + /// # Quirk + /// + /// If the path does not start with `./` but contains `./` in the middle, + /// then this function might returns `true`. + fn is_normalized(&self) -> bool; } impl NormalizePath for Path { - fn normalize(&self) -> Cow<'_, Path> { - if is_normalized(self) { - return Cow::Borrowed(self); - } - + fn normalize(&self) -> PathBuf { let mut components = self.components().peekable(); let mut ret = if let Some(c @ Component::Prefix(..)) = components.peek() { let buf = PathBuf::from(c.as_os_str()); @@ -76,6 +64,20 @@ impl NormalizePath for Path { } } } - Cow::Owned(ret) + + ret + } + + fn is_normalized(&self) -> bool { + for component in self.components() { + match component { + Component::CurDir | Component::ParentDir => { + return false; + } + _ => continue, + } + } + + true } } From 35a8bfdc6b74c498113a8f018052eb6663ab2527 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 4 Nov 2022 17:30:21 +1100 Subject: [PATCH 0840/2020] release: normalize-path v0.2.0 (#509) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/normalize-path/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5014d91f..e61d60bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1233,7 +1233,7 @@ dependencies = [ [[package]] name = "normalize-path" -version = "0.1.0" +version = "0.2.0" [[package]] name = "num-integer" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index ce76572d..ed80c92f 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -28,7 +28,7 @@ itertools = "0.10.5" jobslot = { version = "0.2.6", features = ["tokio"] } log = { version = "0.4.17", features = ["std"] } miette = "5.4.1" -normalize-path = { version = "0.1.0", path = "../normalize-path" } +normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.16.0" reqwest = { version = "0.11.12", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } scopeguard = "1.1.0" diff --git a/crates/normalize-path/Cargo.toml b/crates/normalize-path/Cargo.toml index d22ad55b..fb744501 100644 --- a/crates/normalize-path/Cargo.toml +++ b/crates/normalize-path/Cargo.toml @@ -3,7 +3,7 @@ name = "normalize-path" description = "Like canonicalize, but without performing I/O" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/normalize-path" -version = "0.1.0" +version = "0.2.0" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From 565be9ae4c577416545f6e74dd364064bb07e54d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 8 Nov 2022 11:32:39 +1100 Subject: [PATCH 0841/2020] Switch back from binstall-zip to zip (#512) Signed-off-by: Jiahao XU --- Cargo.lock | 30 +++++++++++++++--------------- crates/binstalk/Cargo.toml | 6 +----- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e61d60bd..6f957d43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -110,7 +110,6 @@ version = "0.4.1" dependencies = [ "async-trait", "binstall-tar", - "binstall-zip", "bytes", "bzip2", "cargo_toml", @@ -148,6 +147,7 @@ dependencies = [ "trust-dns-resolver", "url", "xz2", + "zip", "zstd", ] @@ -162,20 +162,6 @@ dependencies = [ "xattr", ] -[[package]] -name = "binstall-zip" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5eddcdebe8fe727d81b47734b3302ffa49a6fe50376fe6c52c609198c0709e5" -dependencies = [ - "byteorder", - "bzip2", - "crc32fast", - "crossbeam-utils", - "flate2", - "zstd", -] - [[package]] name = "bitflags" version = "1.3.2" @@ -2562,6 +2548,20 @@ dependencies = [ "lzma-sys", ] +[[package]] +name = "zip" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "537ce7411d25e54e8ae21a7ce0b15840e7bfcff15b51d697ec3266cc76bdf080" +dependencies = [ + "byteorder", + "bzip2", + "crc32fast", + "crossbeam-utils", + "flate2", + "zstd", +] + [[package]] name = "zstd" version = "0.11.2+zstd.1.5.2" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index ed80c92f..50bbb1c5 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -54,17 +54,13 @@ trust-dns-resolver = { version = "0.21.2", optional = true, default-features = f url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" -# Use a fork here since upstream has not published a new release for a long time -# while many of its dependencies are updated. -# Also becasue we need streaming extraction. -# # Disable all features of zip except for features of compression algorithms: # Disabled features include: # - aes-crypto: Enables decryption of files which were encrypted with AES, absolutely zero use for # this crate. # - time: Enables features using the [time](https://github.com/time-rs/time) crate, # which is not used by this crate. -zip = { package = "binstall-zip", version = "0.6.3", default-features = false, features = ["deflate", "bzip2", "zstd"] } +zip = { version = "0.6.3", default-features = false, features = ["deflate", "bzip2", "zstd"] } # zstd is also depended by zip. # Since zip 0.6.3 depends on zstd 0.11, we also have to use 0.11 here, From fc6d9ab956eba76b52568a9cae1b54f90bf4f1df Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 8 Nov 2022 11:50:02 +1100 Subject: [PATCH 0842/2020] Refactor: Extract new crate binstalk-manifests (#511) * Refactor: Extract new crate binstalk-manifests * Fix clippy warning in mod `binstall_crates_v1` * Rm unused deps in binstalk * Update release-pr Signed-off-by: Jiahao XU --- .github/workflows/release-pr.yml | 1 + Cargo.lock | 28 +++++++++++++---- Cargo.toml | 1 + crates/binstalk-manifests/Cargo.toml | 30 +++++++++++++++++++ .../src}/binstall_crates_v1.rs | 14 ++++----- .../src}/cargo_crates_v1.rs | 4 +-- .../cargo_crates_v1/crate_version_source.rs | 4 +-- .../src}/cargo_toml_binstall.rs | 0 .../cargo_toml_binstall/package_formats.rs | 0 .../src}/crate_info.rs | 2 +- crates/binstalk-manifests/src/helpers.rs | 25 ++++++++++++++++ .../src/lib.rs} | 2 ++ crates/binstalk/Cargo.toml | 6 +--- crates/binstalk/src/fs.rs | 14 --------- crates/binstalk/src/helpers.rs | 1 - crates/binstalk/src/helpers/statics.rs | 9 ------ crates/binstalk/src/lib.rs | 2 +- 17 files changed, 96 insertions(+), 47 deletions(-) create mode 100644 crates/binstalk-manifests/Cargo.toml rename crates/{binstalk/src/manifests => binstalk-manifests/src}/binstall_crates_v1.rs (94%) rename crates/{binstalk/src/manifests => binstalk-manifests/src}/cargo_crates_v1.rs (98%) rename crates/{binstalk/src/manifests => binstalk-manifests/src}/cargo_crates_v1/crate_version_source.rs (97%) rename crates/{binstalk/src/manifests => binstalk-manifests/src}/cargo_toml_binstall.rs (100%) rename crates/{binstalk/src/manifests => binstalk-manifests/src}/cargo_toml_binstall/package_formats.rs (100%) rename crates/{binstalk/src/manifests => binstalk-manifests/src}/crate_info.rs (97%) create mode 100644 crates/binstalk-manifests/src/helpers.rs rename crates/{binstalk/src/manifests.rs => binstalk-manifests/src/lib.rs} (97%) delete mode 100644 crates/binstalk/src/helpers/statics.rs diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 82f14b21..c3dca191 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -9,6 +9,7 @@ on: options: - bin - binstalk + - binstalk-manifests - detect-targets - detect-wasi - fs-lock diff --git a/Cargo.lock b/Cargo.lock index 6f957d43..f1798100 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -109,6 +109,7 @@ name = "binstalk" version = "0.4.1" dependencies = [ "async-trait", + "binstalk-manifests", "binstall-tar", "bytes", "bzip2", @@ -119,7 +120,6 @@ dependencies = [ "digest", "env_logger", "flate2", - "fs-lock", "futures-util", "generic-array", "home", @@ -134,15 +134,11 @@ dependencies = [ "scopeguard", "semver", "serde", - "serde-tuple-vec-map", - "serde_json", "strum", - "strum_macros", "tempfile", "thiserror", "tinytemplate", "tokio", - "toml_edit", "tower", "trust-dns-resolver", "url", @@ -151,6 +147,28 @@ dependencies = [ "zstd", ] +[[package]] +name = "binstalk-manifests" +version = "0.1.0" +dependencies = [ + "compact_str", + "detect-targets", + "fs-lock", + "home", + "miette", + "once_cell", + "semver", + "serde", + "serde-tuple-vec-map", + "serde_json", + "strum", + "strum_macros", + "tempfile", + "thiserror", + "toml_edit", + "url", +] + [[package]] name = "binstall-tar" version = "0.4.39" diff --git a/Cargo.toml b/Cargo.toml index 8f00a464..38ccdc7d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,6 +2,7 @@ members = [ "crates/bin", "crates/binstalk", + "crates/binstalk-manifests", "crates/detect-wasi", "crates/fs-lock", "crates/normalize-path", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml new file mode 100644 index 00000000..fd8f3224 --- /dev/null +++ b/crates/binstalk-manifests/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "binstalk-manifests" +description = "The binstall toolkit for manipulating with manifest" +repository = "https://github.com/cargo-bins/cargo-binstall" +documentation = "https://docs.rs/binstalk-manifests" +version = "0.1.0" +rust-version = "1.61.0" +authors = ["ryan "] +edition = "2021" +license = "GPL-3.0" + +[dependencies] +compact_str = { version = "0.6.0", features = ["serde"] } +fs-lock = { version = "0.1.0", path = "../fs-lock" } +home = "0.5.4" +miette = "5.4.1" +once_cell = "1.16.0" +semver = { version = "1.0.14", features = ["serde"] } +serde = { version = "1.0.147", features = ["derive"] } +serde-tuple-vec-map = "1.0.1" +serde_json = "1.0.87" +strum = "0.24.1" +strum_macros = "0.24.3" +thiserror = "1.0.37" +toml_edit = { version = "0.15.0", features = ["easy"] } +url = { version = "2.3.1", features = ["serde"] } + +[dev-dependencies] +detect-targets = { version = "0.1.2", path = "../detect-targets" } +tempfile = "3.3.0" diff --git a/crates/binstalk/src/manifests/binstall_crates_v1.rs b/crates/binstalk-manifests/src/binstall_crates_v1.rs similarity index 94% rename from crates/binstalk/src/manifests/binstall_crates_v1.rs rename to crates/binstalk-manifests/src/binstall_crates_v1.rs index 69b3df80..1eb4bbdd 100644 --- a/crates/binstalk/src/manifests/binstall_crates_v1.rs +++ b/crates/binstalk-manifests/src/binstall_crates_v1.rs @@ -20,7 +20,7 @@ use miette::Diagnostic; use serde::Serialize; use thiserror::Error; -use crate::fs::create_if_not_exist; +use crate::helpers::create_if_not_exist; use super::crate_info::CrateInfo; @@ -171,7 +171,7 @@ impl<'a> IntoIterator for &'a Records { #[cfg(test)] mod test { use super::*; - use crate::manifests::crate_info::CrateSource; + use crate::crate_info::CrateSource; use compact_str::CompactString; use detect_targets::TARGET; @@ -224,14 +224,14 @@ mod test { }, ]; - append_to_path(&path, metadata_vec.clone()).unwrap(); + append_to_path(path, metadata_vec.clone()).unwrap(); let mut iter = metadata_vec.into_iter(); iter.next().unwrap(); let mut metadata_set: BTreeSet<_> = iter.collect(); - let mut records = Records::load_from_path(&path).unwrap(); + let mut records = Records::load_from_path(path).unwrap(); assert_records_eq!(&records, &metadata_set); records.remove("b"); @@ -239,7 +239,7 @@ mod test { records.overwrite().unwrap(); metadata_set.remove("b"); - let records = Records::load_from_path(&path).unwrap(); + let records = Records::load_from_path(path).unwrap(); assert_records_eq!(&records, &metadata_set); // Drop the exclusive file lock drop(records); @@ -253,10 +253,10 @@ mod test { bins: vec!["1".into(), "2".into()], other: Default::default(), }; - append_to_path(&path, [new_metadata.clone()]).unwrap(); + append_to_path(path, [new_metadata.clone()]).unwrap(); metadata_set.insert(new_metadata); - let records = Records::load_from_path(&path).unwrap(); + let records = Records::load_from_path(path).unwrap(); assert_records_eq!(&records, &metadata_set); } } diff --git a/crates/binstalk/src/manifests/cargo_crates_v1.rs b/crates/binstalk-manifests/src/cargo_crates_v1.rs similarity index 98% rename from crates/binstalk/src/manifests/cargo_crates_v1.rs rename to crates/binstalk-manifests/src/cargo_crates_v1.rs index aa1fa2a5..9d3aad47 100644 --- a/crates/binstalk/src/manifests/cargo_crates_v1.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1.rs @@ -22,7 +22,7 @@ use miette::Diagnostic; use serde::{Deserialize, Serialize}; use thiserror::Error; -use crate::fs::create_if_not_exist; +use crate::helpers::create_if_not_exist; use super::crate_info::CrateInfo; @@ -131,7 +131,7 @@ pub enum CratesTomlParseError { #[cfg(test)] mod tests { use super::*; - use crate::manifests::crate_info::CrateSource; + use crate::crate_info::CrateSource; use detect_targets::TARGET; use semver::Version; diff --git a/crates/binstalk/src/manifests/cargo_crates_v1/crate_version_source.rs b/crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs similarity index 97% rename from crates/binstalk/src/manifests/cargo_crates_v1/crate_version_source.rs rename to crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs index bf41e808..43c5ef54 100644 --- a/crates/binstalk/src/manifests/cargo_crates_v1/crate_version_source.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs @@ -8,8 +8,8 @@ use thiserror::Error; use url::Url; use crate::{ - helpers::statics::cratesio_url, - manifests::crate_info::{CrateInfo, CrateSource, SourceType}, + crate_info::{CrateInfo, CrateSource, SourceType}, + helpers::cratesio_url, }; #[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq)] diff --git a/crates/binstalk/src/manifests/cargo_toml_binstall.rs b/crates/binstalk-manifests/src/cargo_toml_binstall.rs similarity index 100% rename from crates/binstalk/src/manifests/cargo_toml_binstall.rs rename to crates/binstalk-manifests/src/cargo_toml_binstall.rs diff --git a/crates/binstalk/src/manifests/cargo_toml_binstall/package_formats.rs b/crates/binstalk-manifests/src/cargo_toml_binstall/package_formats.rs similarity index 100% rename from crates/binstalk/src/manifests/cargo_toml_binstall/package_formats.rs rename to crates/binstalk-manifests/src/cargo_toml_binstall/package_formats.rs diff --git a/crates/binstalk/src/manifests/crate_info.rs b/crates/binstalk-manifests/src/crate_info.rs similarity index 97% rename from crates/binstalk/src/manifests/crate_info.rs rename to crates/binstalk-manifests/src/crate_info.rs index 221390a6..dd5601ce 100644 --- a/crates/binstalk/src/manifests/crate_info.rs +++ b/crates/binstalk-manifests/src/crate_info.rs @@ -7,7 +7,7 @@ use semver::Version; use serde::{Deserialize, Serialize}; use url::Url; -use crate::helpers::statics::cratesio_url; +use crate::helpers::cratesio_url; #[derive(Clone, Debug, Serialize, Deserialize)] pub struct CrateInfo { diff --git a/crates/binstalk-manifests/src/helpers.rs b/crates/binstalk-manifests/src/helpers.rs new file mode 100644 index 00000000..f748d465 --- /dev/null +++ b/crates/binstalk-manifests/src/helpers.rs @@ -0,0 +1,25 @@ +use std::{fs, io, path::Path}; + +use once_cell::sync::Lazy; +use url::Url; + +/// Returned file is readable and writable. +pub(crate) fn create_if_not_exist(path: impl AsRef) -> io::Result { + let path = path.as_ref(); + + let mut options = fs::File::options(); + options.read(true).write(true); + + options + .clone() + .create_new(true) + .open(path) + .or_else(|_| options.open(path)) +} + +pub(crate) fn cratesio_url() -> &'static Url { + static CRATESIO: Lazy Url> = + Lazy::new(|| Url::parse("https://github.com/rust-lang/crates.io-index").unwrap()); + + &CRATESIO +} diff --git a/crates/binstalk/src/manifests.rs b/crates/binstalk-manifests/src/lib.rs similarity index 97% rename from crates/binstalk/src/manifests.rs rename to crates/binstalk-manifests/src/lib.rs index d5dc2542..ed655d1f 100644 --- a/crates/binstalk/src/manifests.rs +++ b/crates/binstalk-manifests/src/lib.rs @@ -8,6 +8,8 @@ //! [Binstall's `.crates-v1.json`][binstall_crates_v1]); //! - manifests that specify which packages _to_ install (currently none). +mod helpers; + pub mod binstall_crates_v1; pub mod cargo_crates_v1; pub mod cargo_toml_binstall; diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 50bbb1c5..53b6a3d0 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,6 +11,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.58" +binstalk-manifests = { version = "0.1.0", path = "../binstalk-manifests" } bytes = "1.2.1" bzip2 = "0.4.3" cargo_toml = "0.13.0" @@ -19,7 +20,6 @@ crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.2", path = "../detect-targets" } digest = "0.10.5" flate2 = { version = "1.0.24", default-features = false } -fs-lock = { version = "0.1.0", path = "../fs-lock" } futures-util = { version = "0.3.25", default-features = false, features = ["std"] } generic-array = "0.14.6" home = "0.5.4" @@ -34,10 +34,7 @@ reqwest = { version = "0.11.12", features = ["stream", "gzip", "brotli", "deflat scopeguard = "1.1.0" semver = { version = "1.0.14", features = ["serde"] } serde = { version = "1.0.147", features = ["derive"] } -serde-tuple-vec-map = "1.0.1" -serde_json = "1.0.87" strum = "0.24.1" -strum_macros = "0.24.3" # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. # @@ -48,7 +45,6 @@ thiserror = "1.0.37" tinytemplate = "1.2.1" # parking_lot - for OnceCell::const_new tokio = { version = "1.21.2", features = ["macros", "rt", "process", "sync", "signal", "time", "parking_lot"], default-features = false } -toml_edit = { version = "0.15.0", features = ["easy"] } tower = { version = "0.4.13", features = ["limit", "util"] } trust-dns-resolver = { version = "0.21.2", optional = true, default-features = false, features = ["dnssec-ring"] } url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/src/fs.rs b/crates/binstalk/src/fs.rs index 2e4f09c6..3962b249 100644 --- a/crates/binstalk/src/fs.rs +++ b/crates/binstalk/src/fs.rs @@ -3,20 +3,6 @@ use std::{fs, io, path::Path}; use log::debug; use tempfile::NamedTempFile; -/// Returned file is readable and writable. -pub fn create_if_not_exist(path: impl AsRef) -> io::Result { - let path = path.as_ref(); - - let mut options = fs::File::options(); - options.read(true).write(true); - - options - .clone() - .create_new(true) - .open(path) - .or_else(|_| options.open(path)) -} - /// Atomically install a file. /// /// This is a blocking function, must be called in `block_in_place` mode. diff --git a/crates/binstalk/src/helpers.rs b/crates/binstalk/src/helpers.rs index ddae0132..b0b8c703 100644 --- a/crates/binstalk/src/helpers.rs +++ b/crates/binstalk/src/helpers.rs @@ -2,5 +2,4 @@ pub mod download; pub mod jobserver_client; pub mod remote; pub mod signal; -pub mod statics; pub mod tasks; diff --git a/crates/binstalk/src/helpers/statics.rs b/crates/binstalk/src/helpers/statics.rs deleted file mode 100644 index 7d48aca1..00000000 --- a/crates/binstalk/src/helpers/statics.rs +++ /dev/null @@ -1,9 +0,0 @@ -use once_cell::sync::Lazy; -use url::Url; - -pub fn cratesio_url() -> &'static Url { - static CRATESIO: Lazy Url> = - Lazy::new(|| Url::parse("https://github.com/rust-lang/crates.io-index").unwrap()); - - &CRATESIO -} diff --git a/crates/binstalk/src/lib.rs b/crates/binstalk/src/lib.rs index a4b00d85..7f00da4b 100644 --- a/crates/binstalk/src/lib.rs +++ b/crates/binstalk/src/lib.rs @@ -4,8 +4,8 @@ pub mod errors; pub mod fetchers; pub mod fs; pub mod helpers; -pub mod manifests; pub mod ops; +pub use binstalk_manifests as manifests; pub use detect_targets::{get_desired_targets, DesiredTargets}; pub use home; From 8a534d095b1ddeec1ead7cd31103c65ffde20b31 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Nov 2022 01:32:50 +0000 Subject: [PATCH 0843/2020] Bump clap from 4.0.18 to 4.0.22 (#516) Bumps [clap](https://github.com/clap-rs/clap) from 4.0.18 to 4.0.22. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.18...v4.0.22) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f1798100..6a9f0e8a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -320,9 +320,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.18" +version = "4.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335867764ed2de42325fafe6d18b8af74ba97ee0c590fa016f157535b42ab04b" +checksum = "91b9970d7505127a162fdaa9b96428d28a479ba78c9ec7550a63a5d9863db682" dependencies = [ "atty", "bitflags", @@ -335,9 +335,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.0.18" +version = "4.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16a1b0f6422af32d5da0c58e2703320f379216ee70198241c84173a8c5ac28f3" +checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" dependencies = [ "heck", "proc-macro-error", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 35ff4911..febd92cd 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.4.1" } -clap = { version = "4.0.18", features = ["derive"] } +clap = { version = "4.0.22", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" From 91e227e2a39e72674dd79ef68fcf90bc027d972a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Nov 2022 02:23:18 +0000 Subject: [PATCH 0844/2020] Bump embed-resource from 1.7.3 to 1.7.4 (#517) Bumps [embed-resource](https://github.com/nabijaczleweli/rust-embed-resource) from 1.7.3 to 1.7.4. - [Release notes](https://github.com/nabijaczleweli/rust-embed-resource/releases) - [Commits](https://github.com/nabijaczleweli/rust-embed-resource/compare/v1.7.3...v1.7.4) --- updated-dependencies: - dependency-name: embed-resource dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6a9f0e8a..5598bf93 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -509,9 +509,9 @@ checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "embed-resource" -version = "1.7.3" +version = "1.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936c1354206a875581696369aef920e12396e93bbd251c43a7a3f3fa85023a7d" +checksum = "782e883d0b9a3db55e6edee9939305d0b5c2ee6df793966d84b31144873e5bde" dependencies = [ "cc", "rustc_version", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index febd92cd..eb46b607 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -35,7 +35,7 @@ tempfile = "3.3.0" tokio = { version = "1.21.2", features = ["rt-multi-thread"], default-features = false } [build-dependencies] -embed-resource = "1.7.3" +embed-resource = "1.7.4" [features] default = ["static", "rustls", "trust-dns", "fancy-no-backtrace"] From 18d525139f2da74bfc085d77d43c4a80168b8bd0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 8 Nov 2022 02:34:26 +0000 Subject: [PATCH 0845/2020] Bump env_logger from 0.9.1 to 0.9.3 (#515) Bumps [env_logger](https://github.com/env-logger-rs/env_logger) from 0.9.1 to 0.9.3. - [Release notes](https://github.com/env-logger-rs/env_logger/releases) - [Changelog](https://github.com/env-logger-rs/env_logger/blob/main/CHANGELOG.md) - [Commits](https://github.com/env-logger-rs/env_logger/compare/v0.9.1...v0.9.3) --- updated-dependencies: - dependency-name: env_logger dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5598bf93..5cf70a0a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -543,9 +543,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.9.1" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c90bf5f19754d10198ccb95b70664fc925bd1fc090a0fd9a6ebc54acc8cd6272" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" dependencies = [ "atty", "humantime", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 53b6a3d0..832785c9 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -64,7 +64,7 @@ zip = { version = "0.6.3", default-features = false, features = ["deflate", "bzi zstd = { version = "0.11.2", default-features = false } [dev-dependencies] -env_logger = "0.9.1" +env_logger = "0.9.3" [features] default = ["static", "rustls"] From 23a4c5db27c828aa8579f47cdc96270415f2cd74 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 9 Nov 2022 12:45:52 +1100 Subject: [PATCH 0846/2020] Bump mimalloc from 0.1.30 to 0.1.31 (#519) Bumps [mimalloc](https://github.com/purpleprotocol/mimalloc_rust) from 0.1.30 to 0.1.31. - [Release notes](https://github.com/purpleprotocol/mimalloc_rust/releases) - [Commits](https://github.com/purpleprotocol/mimalloc_rust/compare/v0.1.30...v0.1.31) --- updated-dependencies: - dependency-name: mimalloc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5cf70a0a..0365e2f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1064,9 +1064,9 @@ checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" [[package]] name = "libmimalloc-sys" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc093ab289b0bfda3aa1bdfab9c9542be29c7ef385cfcbe77f8c9813588eb48" +checksum = "c37567b180c1af25924b303ddf1ee4467653783440c62360beb2b322a4d93361" dependencies = [ "cc", ] @@ -1183,9 +1183,9 @@ dependencies = [ [[package]] name = "mimalloc" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76ce6a4b40d3bff9eb3ce9881ca0737a85072f9f975886082640cd46a75cdb35" +checksum = "b32d6a9ac92d0239d7bfa31137fb47634ac7272a3c11bcee91379ac100781670" dependencies = [ "libmimalloc-sys", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index eb46b607..8ea2698e 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -28,7 +28,7 @@ crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = "0.4.17" miette = "5.4.1" -mimalloc = { version = "0.1.30", default-features = false, optional = true } +mimalloc = { version = "0.1.31", default-features = false, optional = true } semver = "1.0.14" simplelog = "0.12.0" tempfile = "3.3.0" From b27990ecbce095b7414113555dc9d59b766047d0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 9 Nov 2022 15:12:02 +1100 Subject: [PATCH 0847/2020] Add new dep tracing v0.1.37 with feat log-always in crates/bin (#520) to convert all tracing spans and events to log. Signed-off-by: Jiahao XU --- Cargo.lock | 9 +++++---- crates/bin/Cargo.toml | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0365e2f4..c5d5d2c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -271,6 +271,7 @@ dependencies = [ "simplelog", "tempfile", "tokio", + "tracing", ] [[package]] @@ -2162,9 +2163,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.36" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", "log", @@ -2174,9 +2175,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ "once_cell", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 8ea2698e..d8b8f80e 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -33,6 +33,7 @@ semver = "1.0.14" simplelog = "0.12.0" tempfile = "3.3.0" tokio = { version = "1.21.2", features = ["rt-multi-thread"], default-features = false } +tracing = { version = "0.1.37", features = ["log-always"], default-features = false } [build-dependencies] embed-resource = "1.7.4" @@ -55,5 +56,5 @@ trust-dns = ["binstalk/trust-dns"] fancy-no-backtrace = ["miette/fancy-no-backtrace"] fancy-with-backtrace = ["fancy-no-backtrace", "miette/fancy"] -log_release_max_level_info = ["log/release_max_level_info"] -log_release_max_level_debug = ["log/release_max_level_debug"] +log_release_max_level_info = ["log/release_max_level_info", "tracing/release_max_level_info"] +log_release_max_level_debug = ["log/release_max_level_debug", "tracing/release_max_level_debug"] From e62abb442e3bc6a678ac43261f227cf89ada4cbe Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 10 Nov 2022 06:37:18 +1100 Subject: [PATCH 0848/2020] Enable dependabot for binstalk-manifests (#523) Signed-off-by: Jiahao XU --- .github/dependabot.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 528d447d..db3b2fd1 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -16,6 +16,10 @@ updates: directory: "/crates/bin" schedule: interval: "daily" + - package-ecosystem: "cargo" + directory: "/crates/binstalk-manifests" + schedule: + interval: "daily" - package-ecosystem: "cargo" directory: "/crates/binstalk" schedule: From e378be73dfe37d1723b24eab2b8d06d9416e5fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steven=20H=C3=A9=20=28S=C4=ABch=C3=A0ng=29?= <84777573+SichangHe@users.noreply.github.com> Date: Wed, 9 Nov 2022 22:58:52 -0500 Subject: [PATCH 0849/2020] Mention upgrade, fix #514 (#524) Fix #514 --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index 5bae3e1e..ace77482 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,12 @@ $ binstall \ --pkg-fmt="txz" crate_name ``` +## Upgrade installed crates + +The most ergonomic way to upgrade the installed crates is with [`cargo-update`](https://github.com/nabijaczleweli/cargo-update). `cargo-update` automatically uses `cargo-binstall` to install the updates if `cargo-binstall` is present. + +Supported crates such as `cargo-binstall` itself can also be updated with `cargo-binstall` as in the example in [Installation](#installation) above. + ## FAQ - Why use this? From 3841762a5bc595294910aec44a3614285dc1f81e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 11 Nov 2022 10:05:09 +1100 Subject: [PATCH 0850/2020] Replace `simplelog` with `tracing_subscriber::fmt` (#525) * Disable feat log-always of dep tracing * Add dep tracing-log 0.1.3 with no feat * Add new dep tracing-appender v0.2.2 * Add dep tracing-subscriber 0.3.16 with feat fmt and json * Fix `MainExit::report`: Do not use `log::{error, warn}` since `MainExit::report` might be called with no `log`ger, it can only use `println!` and `eprintln!`. * Use `tracing_subscriber::fmt` instead of `simple_log` * Rm unused dep simplelog from crates/bin * Fix `BinstallError::report`: Avoid `log::{warn, error}` since they might be called after `tracing_appender::WorkerGuard` is dropped. * Make tracing output more readable to end users * Add new dep tracing-core v0.1.30 * Add new dep once_cell v1.16.0 * Refactor: Extract new mod `logging` * Add new option `Args::json_output` * Fix `MainExit::report`: Ignore io error * Fix `BinstallError::report`: Ignore IO error Signed-off-by: Jiahao XU --- Cargo.lock | 105 +++++++++++++++---- crates/bin/Cargo.toml | 8 +- crates/bin/src/args.rs | 4 + crates/bin/src/bin_util.rs | 6 +- crates/bin/src/lib.rs | 1 + crates/bin/src/logging.rs | 183 ++++++++++++++++++++++++++++++++++ crates/bin/src/main.rs | 5 +- crates/bin/src/ui.rs | 29 +----- crates/binstalk/src/errors.rs | 8 +- 9 files changed, 290 insertions(+), 59 deletions(-) create mode 100644 crates/bin/src/logging.rs diff --git a/Cargo.lock b/Cargo.lock index c5d5d2c6..727df5f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -267,11 +267,15 @@ dependencies = [ "log", "miette", "mimalloc", + "once_cell", "semver", - "simplelog", "tempfile", "tokio", "tracing", + "tracing-appender", + "tracing-core", + "tracing-log", + "tracing-subscriber", ] [[package]] @@ -430,6 +434,16 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crossbeam-channel" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.11" @@ -1807,6 +1821,15 @@ dependencies = [ "serde", ] +[[package]] +name = "sharded-slab" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +dependencies = [ + "lazy_static", +] + [[package]] name = "signal-hook-registry" version = "1.4.0" @@ -1816,17 +1839,6 @@ dependencies = [ "libc", ] -[[package]] -name = "simplelog" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48dfff04aade74dd495b007c831cd6f4e0cee19c344dd9dc0884c0289b70a786" -dependencies = [ - "log", - "termcolor", - "time", -] - [[package]] name = "slab" version = "0.4.7" @@ -1992,6 +2004,15 @@ dependencies = [ "syn", ] +[[package]] +name = "thread_local" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" +dependencies = [ + "once_cell", +] + [[package]] name = "time" version = "0.3.14" @@ -2001,15 +2022,8 @@ dependencies = [ "itoa", "libc", "num_threads", - "time-macros", ] -[[package]] -name = "time-macros" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" - [[package]] name = "tinytemplate" version = "1.2.1" @@ -2173,6 +2187,17 @@ dependencies = [ "tracing-core", ] +[[package]] +name = "tracing-appender" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e" +dependencies = [ + "crossbeam-channel", + "time", + "tracing-subscriber", +] + [[package]] name = "tracing-core" version = "0.1.30" @@ -2180,6 +2205,42 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ "once_cell", + "valuable", +] + +[[package]] +name = "tracing-log" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +dependencies = [ + "lazy_static", + "log", + "tracing-core", +] + +[[package]] +name = "tracing-serde" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +dependencies = [ + "serde", + "tracing-core", +] + +[[package]] +name = "tracing-subscriber" +version = "0.3.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +dependencies = [ + "serde", + "serde_json", + "sharded-slab", + "thread_local", + "tracing-core", + "tracing-serde", ] [[package]] @@ -2308,6 +2369,12 @@ dependencies = [ "serde", ] +[[package]] +name = "valuable" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" + [[package]] name = "vcpkg" version = "0.2.15" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index d8b8f80e..27560eca 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -29,11 +29,15 @@ dirs = "4.0.0" log = "0.4.17" miette = "5.4.1" mimalloc = { version = "0.1.31", default-features = false, optional = true } +once_cell = "1.16.0" semver = "1.0.14" -simplelog = "0.12.0" tempfile = "3.3.0" tokio = { version = "1.21.2", features = ["rt-multi-thread"], default-features = false } -tracing = { version = "0.1.37", features = ["log-always"], default-features = false } +tracing-core = "0.1.30" +tracing = { version = "0.1.37", default-features = false } +tracing-log = { version = "0.1.3", default-features = false } +tracing-appender = "0.2.2" +tracing-subscriber = { version = "0.3.16", features = ["fmt", "json"], default-features = false } [build-dependencies] embed-resource = "1.7.4" diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 0f2af0f7..9ca2ae30 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -188,6 +188,10 @@ pub struct Args { #[clap(help_heading = "Options", long, value_enum, value_name = "VERSION")] pub min_tls_version: Option, + /// Print logs in json format to be parsable. + #[clap(help_heading = "Options", long)] + pub json_output: bool, + /// Print version information #[clap(help_heading = "Meta", short = 'V')] pub version: bool, diff --git a/crates/bin/src/bin_util.rs b/crates/bin/src/bin_util.rs index 1fe6f6ae..e1732dc9 100644 --- a/crates/bin/src/bin_util.rs +++ b/crates/bin/src/bin_util.rs @@ -1,12 +1,12 @@ use std::{ future::Future, + io::{self, Write}, process::{ExitCode, Termination}, time::Duration, }; use binstalk::errors::BinstallError; use binstalk::helpers::{signal::cancel_on_user_sig_term, tasks::AutoAbortJoinHandle}; -use log::{error, info}; use miette::Result; use tokio::runtime::Runtime; @@ -21,13 +21,13 @@ impl Termination for MainExit { match self { Self::Success(spent) => { if let Some(spent) = spent { - info!("Done in {spent:?}"); + writeln!(io::stdout(), "Done in {spent:?}").ok(); } ExitCode::SUCCESS } Self::Error(err) => err.report(), Self::Report(err) => { - error!("Fatal error:\n{err:?}"); + writeln!(io::stderr(), "Fatal error:\n{err:?}").ok(); ExitCode::from(16) } } diff --git a/crates/bin/src/lib.rs b/crates/bin/src/lib.rs index 4f443dbe..d3221595 100644 --- a/crates/bin/src/lib.rs +++ b/crates/bin/src/lib.rs @@ -2,4 +2,5 @@ pub mod args; pub mod bin_util; pub mod entry; pub mod install_path; +pub mod logging; pub mod ui; diff --git a/crates/bin/src/logging.rs b/crates/bin/src/logging.rs new file mode 100644 index 00000000..6787d0d6 --- /dev/null +++ b/crates/bin/src/logging.rs @@ -0,0 +1,183 @@ +use std::{cmp::min, io, iter::repeat}; + +use log::{LevelFilter, Log, STATIC_MAX_LEVEL}; +use once_cell::sync::Lazy; +use tracing::{ + callsite::Callsite, + dispatcher, field, + subscriber::{self, set_global_default}, + Event, Level, Metadata, +}; +use tracing_appender::non_blocking::{NonBlockingBuilder, WorkerGuard}; +use tracing_core::{identify_callsite, metadata::Kind, subscriber::Subscriber}; +use tracing_log::AsTrace; +use tracing_subscriber::{filter::targets::Targets, fmt::fmt, layer::SubscriberExt}; + +use crate::args::Args; + +// Shamelessly taken from tracing-log + +struct Fields { + message: field::Field, +} + +static FIELD_NAMES: &[&str] = &["message"]; + +impl Fields { + fn new(cs: &'static dyn Callsite) -> Self { + let fieldset = cs.metadata().fields(); + let message = fieldset.field("message").unwrap(); + Fields { message } + } +} + +macro_rules! log_cs { + ($level:expr, $cs:ident, $meta:ident, $fields:ident, $ty:ident) => { + struct $ty; + static $cs: $ty = $ty; + static $meta: Metadata<'static> = Metadata::new( + "log event", + "log", + $level, + None, + None, + None, + field::FieldSet::new(FIELD_NAMES, identify_callsite!(&$cs)), + Kind::EVENT, + ); + static $fields: Lazy = Lazy::new(|| Fields::new(&$cs)); + + impl Callsite for $ty { + fn set_interest(&self, _: subscriber::Interest) {} + fn metadata(&self) -> &'static Metadata<'static> { + &$meta + } + } + }; +} + +log_cs!( + Level::TRACE, + TRACE_CS, + TRACE_META, + TRACE_FIELDS, + TraceCallsite +); +log_cs!( + Level::DEBUG, + DEBUG_CS, + DEBUG_META, + DEBUG_FIELDS, + DebugCallsite +); +log_cs!(Level::INFO, INFO_CS, INFO_META, INFO_FIELDS, InfoCallsite); +log_cs!(Level::WARN, WARN_CS, WARN_META, WARN_FIELDS, WarnCallsite); +log_cs!( + Level::ERROR, + ERROR_CS, + ERROR_META, + ERROR_FIELDS, + ErrorCallsite +); + +fn loglevel_to_cs(level: log::Level) -> (&'static Fields, &'static Metadata<'static>) { + match level { + log::Level::Trace => (&*TRACE_FIELDS, &TRACE_META), + log::Level::Debug => (&*DEBUG_FIELDS, &DEBUG_META), + log::Level::Info => (&*INFO_FIELDS, &INFO_META), + log::Level::Warn => (&*WARN_FIELDS, &WARN_META), + log::Level::Error => (&*ERROR_FIELDS, &ERROR_META), + } +} + +struct Logger; + +impl Logger { + fn init(log_level: LevelFilter) { + log::set_max_level(log_level); + log::set_logger(&Self).unwrap(); + } +} + +impl Log for Logger { + fn enabled(&self, metadata: &log::Metadata<'_>) -> bool { + if metadata.level() > log::max_level() { + // First, check the log record against the current max level enabled. + false + } else { + // Check if the current `tracing` dispatcher cares about this. + dispatcher::get_default(|dispatch| dispatch.enabled(&metadata.as_trace())) + } + } + + fn log(&self, record: &log::Record<'_>) { + // Dispatch manually instead of using methods provided by tracing-log + // to avoid having fields "log.target = ..." in the log message, + // which makes the log really hard to read. + if self.enabled(record.metadata()) { + dispatcher::get_default(|dispatch| { + let (keys, meta) = loglevel_to_cs(record.level()); + + dispatch.event(&Event::new( + meta, + &meta + .fields() + .value_set(&[(&keys.message, Some(record.args() as &dyn field::Value))]), + )); + }); + } + } + + fn flush(&self) {} +} + +pub fn logging(args: &Args) -> WorkerGuard { + // Calculate log_level + let log_level = min(args.log_level, STATIC_MAX_LEVEL); + + let allowed_targets = + (log_level != LevelFilter::Trace).then_some(["binstalk", "cargo_binstall"]); + + // Forward log to tracing + Logger::init(log_level); + + // Setup non-blocking stdout + let (non_blocking, guard) = NonBlockingBuilder::default() + .lossy(false) + .finish(io::stdout()); + + // Build fmt subscriber + let log_level = log_level.as_trace(); + let subscriber_builder = fmt().with_writer(non_blocking).with_max_level(log_level); + + let subscriber: Box = if args.json_output { + Box::new(subscriber_builder.json().finish()) + } else { + Box::new( + subscriber_builder + .compact() + // Disable time, target, file, line_num, thread name/ids to make the + // output more readable + .without_time() + .with_target(false) + .with_file(false) + .with_line_number(false) + .with_thread_names(false) + .with_thread_ids(false) + .finish(), + ) + }; + + // Builder layer for filtering + let filter_layer = allowed_targets.map(|allowed_targets| { + Targets::new().with_targets(allowed_targets.into_iter().zip(repeat(log_level))) + }); + + // Builder final subscriber with filtering + let subscriber = subscriber.with(filter_layer); + + // Setup global subscriber + set_global_default(subscriber).unwrap(); + + guard +} diff --git a/crates/bin/src/main.rs b/crates/bin/src/main.rs index b80cd006..fff42ee5 100644 --- a/crates/bin/src/main.rs +++ b/crates/bin/src/main.rs @@ -6,7 +6,8 @@ use log::debug; use cargo_binstall::{ args, bin_util::{run_tokio_main, MainExit}, - entry, ui, + entry, + logging::logging, }; #[cfg(feature = "mimalloc")] @@ -26,7 +27,7 @@ fn main() -> MainExit { println!("{}", env!("CARGO_PKG_VERSION")); MainExit::Success(None) } else { - ui::logging(&args); + let _guard = logging(&args); let start = Instant::now(); diff --git a/crates/bin/src/ui.rs b/crates/bin/src/ui.rs index 715cc7b6..19667e0c 100644 --- a/crates/bin/src/ui.rs +++ b/crates/bin/src/ui.rs @@ -1,16 +1,10 @@ use std::{ - cmp::min, io::{self, BufRead, Write}, thread, }; -use log::{LevelFilter, STATIC_MAX_LEVEL}; -use simplelog::{ColorChoice, ConfigBuilder, TermLogger, TerminalMode}; -use tokio::sync::mpsc; - use binstalk::errors::BinstallError; - -use crate::args::Args; +use tokio::sync::mpsc; #[derive(Debug)] struct UIThreadInner { @@ -102,24 +96,3 @@ impl UIThread { } } } - -pub fn logging(args: &Args) { - let log_level = min(args.log_level, STATIC_MAX_LEVEL); - - // Setup logging - let mut log_config = ConfigBuilder::new(); - - if log_level != LevelFilter::Trace { - log_config.add_filter_allow_str("binstalk"); - log_config.add_filter_allow_str("cargo_binstall"); - } - - log_config.set_location_level(LevelFilter::Off); - TermLogger::init( - log_level, - log_config.build(), - TerminalMode::Mixed, - ColorChoice::Auto, - ) - .unwrap(); -} diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index 0fc36970..b618eba4 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -1,11 +1,10 @@ use std::{ - io, + io::{self, Write}, path::PathBuf, process::{ExitCode, ExitStatus, Termination}, }; use compact_str::CompactString; -use log::{error, warn}; use miette::{Diagnostic, Report}; use thiserror::Error; use tokio::task; @@ -383,10 +382,9 @@ impl Termination for BinstallError { fn report(self) -> ExitCode { let code = self.exit_code(); if let BinstallError::UserAbort = self { - warn!("Installation cancelled"); + writeln!(io::stdout(), "Installation cancelled").ok(); } else { - error!("Fatal error:"); - eprintln!("{:?}", Report::new(self)); + writeln!(io::stderr(), "Fatal error:\n{:?}", Report::new(self)).ok(); } code From 89fa5b17690a8a6fb9a81c0f1ef1a693517f2f4a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 11 Nov 2022 15:02:54 +1100 Subject: [PATCH 0851/2020] Refactor: Extract new crate binstalk-{signal, downloader} (#518) * Refactor: Extract new crate binstalk-downloader * Re-export `PkgFmt` from `binstalk_manifests` * Update release-pr.yml * Update dependabot Signed-off-by: Jiahao XU --- .github/dependabot.yml | 4 + .github/workflows/release-pr.yml | 1 + Cargo.lock | 33 +++- Cargo.toml | 1 + crates/bin/src/entry.rs | 3 +- crates/binstalk-downloader/Cargo.toml | 70 ++++++++ crates/binstalk-downloader/src/download.rs | 170 ++++++++++++++++++ .../src}/download/async_extracter.rs | 43 +++-- .../src}/download/extracter.rs | 4 +- .../src}/download/stream_readable.rs | 34 ++-- crates/binstalk-downloader/src/lib.rs | 2 + .../src}/remote.rs | 50 ++++-- crates/binstalk/Cargo.toml | 54 +----- crates/binstalk/src/drivers/crates_io.rs | 11 +- .../binstalk/src/drivers/crates_io/visitor.rs | 34 ++-- crates/binstalk/src/errors.rs | 41 ++++- crates/binstalk/src/fetchers/gh_crate_meta.rs | 7 +- crates/binstalk/src/fetchers/quickinstall.rs | 16 +- crates/binstalk/src/helpers.rs | 4 +- crates/binstalk/src/helpers/download.rs | 112 ------------ crates/binstalk/src/helpers/signal.rs | 22 ++- 21 files changed, 456 insertions(+), 260 deletions(-) create mode 100644 crates/binstalk-downloader/Cargo.toml create mode 100644 crates/binstalk-downloader/src/download.rs rename crates/{binstalk/src/helpers => binstalk-downloader/src}/download/async_extracter.rs (68%) rename crates/{binstalk/src/helpers => binstalk-downloader/src}/download/extracter.rs (88%) rename crates/{binstalk/src/helpers => binstalk-downloader/src}/download/stream_readable.rs (77%) create mode 100644 crates/binstalk-downloader/src/lib.rs rename crates/{binstalk/src/helpers => binstalk-downloader/src}/remote.rs (78%) delete mode 100644 crates/binstalk/src/helpers/download.rs diff --git a/.github/dependabot.yml b/.github/dependabot.yml index db3b2fd1..f293064b 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -24,6 +24,10 @@ updates: directory: "/crates/binstalk" schedule: interval: "daily" + - package-ecosystem: "cargo" + directory: "/crates/binstalk-downloader" + schedule: + interval: "daily" - package-ecosystem: "cargo" directory: "/crates/detect-wasi" schedule: diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index c3dca191..3d126b3c 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -10,6 +10,7 @@ on: - bin - binstalk - binstalk-manifests + - binstalk-downloader - detect-targets - detect-wasi - fs-lock diff --git a/Cargo.lock b/Cargo.lock index 727df5f0..a6d0c038 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -109,29 +109,21 @@ name = "binstalk" version = "0.4.1" dependencies = [ "async-trait", + "binstalk-downloader", "binstalk-manifests", - "binstall-tar", - "bytes", - "bzip2", "cargo_toml", "compact_str", "crates_io_api", "detect-targets", - "digest", "env_logger", - "flate2", "futures-util", - "generic-array", "home", - "httpdate", "itertools", "jobslot", "log", "miette", "normalize-path", "once_cell", - "reqwest", - "scopeguard", "semver", "serde", "strum", @@ -139,6 +131,29 @@ dependencies = [ "thiserror", "tinytemplate", "tokio", + "url", + "xz2", +] + +[[package]] +name = "binstalk-downloader" +version = "0.1.0" +dependencies = [ + "binstalk-manifests", + "binstall-tar", + "bytes", + "bzip2", + "digest", + "flate2", + "futures-util", + "generic-array", + "httpdate", + "log", + "reqwest", + "scopeguard", + "tempfile", + "thiserror", + "tokio", "tower", "trust-dns-resolver", "url", diff --git a/Cargo.toml b/Cargo.toml index 38ccdc7d..bd0cb700 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ members = [ "crates/bin", "crates/binstalk", "crates/binstalk-manifests", + "crates/binstalk-downloader", "crates/detect-wasi", "crates/fs-lock", "crates/normalize-path", diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index b30fddee..4518694b 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -35,7 +35,8 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien args.min_tls_version.map(|v| v.into()), Duration::from_millis(rate_limit.duration.get()), rate_limit.request_count, - )?; + ) + .map_err(BinstallError::from)?; // Build crates.io api client let crates_io_api_client = crates_io_api::AsyncClient::with_http_client( diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml new file mode 100644 index 00000000..bbc18ba7 --- /dev/null +++ b/crates/binstalk-downloader/Cargo.toml @@ -0,0 +1,70 @@ +[package] +name = "binstalk-downloader" +description = "The binstall toolkit for downloading and extracting file" +repository = "https://github.com/cargo-bins/cargo-binstall" +documentation = "https://docs.rs/binstalk-downloader" +version = "0.1.0" +rust-version = "1.61.0" +authors = ["ryan "] +edition = "2021" +license = "GPL-3.0" + +[dependencies] +binstalk-manifests = { version = "0.1.0", path = "../binstalk-manifests" } +bytes = "1.2.1" +bzip2 = "0.4.3" +digest = "0.10.5" +flate2 = { version = "1.0.24", default-features = false } +futures-util = { version = "0.3.25", default-features = false, features = ["std"] } +generic-array = "0.14.6" +httpdate = "1.0.2" +log = { version = "0.4.17", features = ["std"] } +reqwest = { version = "0.11.12", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } +scopeguard = "1.1.0" +# Use a fork here since we need PAX support, but the upstream +# does not hav the PR merged yet. +# +#tar = "0.4.38" +tar = { package = "binstall-tar", version = "0.4.39" } +tempfile = "3.3.0" +thiserror = "1.0.37" +tokio = { version = "1.21.2", features = ["macros", "rt-multi-thread", "sync", "time"], default-features = false } +tower = { version = "0.4.13", features = ["limit", "util"] } +trust-dns-resolver = { version = "0.21.2", optional = true, default-features = false, features = ["dnssec-ring"] } +url = "2.3.1" + +xz2 = "0.1.7" + +# Disable all features of zip except for features of compression algorithms: +# Disabled features include: +# - aes-crypto: Enables decryption of files which were encrypted with AES, absolutely zero use for +# this crate. +# - time: Enables features using the [time](https://github.com/time-rs/time) crate, +# which is not used by this crate. +zip = { version = "0.6.3", default-features = false, features = ["deflate", "bzip2", "zstd"] } + +# zstd is also depended by zip. +# Since zip 0.6.3 depends on zstd 0.11, we also have to use 0.11 here, +# otherwise there will be a link conflict. +zstd = { version = "0.11.2", default-features = false } + +[features] +default = ["static", "rustls"] + +static = ["bzip2/static", "xz2/static"] +pkg-config = ["zstd/pkg-config"] + +zlib-ng = ["flate2/zlib-ng"] + +rustls = [ + "reqwest/rustls-tls", + + # Enable the following features only if trust-dns-resolver is enabled. + "trust-dns-resolver?/dns-over-rustls", + # trust-dns-resolver currently supports https with rustls + "trust-dns-resolver?/dns-over-https-rustls", +] +native-tls = ["reqwest/native-tls", "trust-dns-resolver?/dns-over-native-tls"] + +# Enable trust-dns-resolver so that features on it will also be enabled. +trust-dns = ["trust-dns-resolver", "reqwest/trust-dns"] diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs new file mode 100644 index 00000000..6b3985e1 --- /dev/null +++ b/crates/binstalk-downloader/src/download.rs @@ -0,0 +1,170 @@ +use std::{fmt::Debug, future::Future, io, marker::PhantomData, path::Path, pin::Pin}; + +use binstalk_manifests::cargo_toml_binstall::{PkgFmtDecomposed, TarBasedFmt}; +use digest::{Digest, FixedOutput, HashMarker, Output, OutputSizeUser, Update}; +use log::debug; +use thiserror::Error as ThisError; + +pub use binstalk_manifests::cargo_toml_binstall::PkgFmt; +pub use tar::Entries; +pub use zip::result::ZipError; + +use crate::remote::{Client, Error as RemoteError, Url}; + +mod async_extracter; +pub use async_extracter::TarEntriesVisitor; +use async_extracter::*; + +mod extracter; +mod stream_readable; + +pub type CancellationFuture = Option> + Send>>>; + +#[derive(Debug, ThisError)] +pub enum DownloadError { + #[error(transparent)] + Unzip(#[from] ZipError), + + #[error(transparent)] + Remote(#[from] RemoteError), + + /// A generic I/O error. + /// + /// - Code: `binstall::io` + /// - Exit: 74 + #[error(transparent)] + Io(io::Error), + + #[error("installation cancelled by user")] + UserAbort, +} + +impl From for DownloadError { + fn from(err: io::Error) -> Self { + if err.get_ref().is_some() { + let kind = err.kind(); + + let inner = err + .into_inner() + .expect("err.get_ref() returns Some, so err.into_inner() should also return Some"); + + inner + .downcast() + .map(|b| *b) + .unwrap_or_else(|err| DownloadError::Io(io::Error::new(kind, err))) + } else { + DownloadError::Io(err) + } + } +} + +impl From for io::Error { + fn from(e: DownloadError) -> io::Error { + match e { + DownloadError::Io(io_error) => io_error, + e => io::Error::new(io::ErrorKind::Other, e), + } + } +} + +#[derive(Debug)] +pub struct Download { + client: Client, + url: Url, + _digest: PhantomData, + _checksum: Vec, +} + +impl Download { + pub fn new(client: Client, url: Url) -> Self { + Self { + client, + url, + _digest: PhantomData::default(), + _checksum: Vec::new(), + } + } + + /// Download a file from the provided URL and process them in memory. + /// + /// This does not support verifying a checksum due to the partial extraction + /// and will ignore one if specified. + /// + /// `cancellation_future` can be used to cancel the extraction and return + /// [`DownloadError::UserAbort`] error. + pub async fn and_visit_tar( + self, + fmt: TarBasedFmt, + visitor: V, + cancellation_future: CancellationFuture, + ) -> Result { + let stream = self.client.get_stream(self.url).await?; + + debug!("Downloading and extracting then in-memory processing"); + + let ret = + extract_tar_based_stream_and_visit(stream, fmt, visitor, cancellation_future).await?; + + debug!("Download, extraction and in-memory procession OK"); + + Ok(ret) + } + + /// Download a file from the provided URL and extract it to the provided path. + /// + /// `cancellation_future` can be used to cancel the extraction and return + /// [`DownloadError::UserAbort`] error. + pub async fn and_extract( + self, + fmt: PkgFmt, + path: impl AsRef, + cancellation_future: CancellationFuture, + ) -> Result<(), DownloadError> { + let stream = self.client.get_stream(self.url).await?; + + let path = path.as_ref(); + debug!("Downloading and extracting to: '{}'", path.display()); + + match fmt.decompose() { + PkgFmtDecomposed::Tar(fmt) => { + extract_tar_based_stream(stream, path, fmt, cancellation_future).await? + } + PkgFmtDecomposed::Bin => extract_bin(stream, path, cancellation_future).await?, + PkgFmtDecomposed::Zip => extract_zip(stream, path, cancellation_future).await?, + } + + debug!("Download OK, extracted to: '{}'", path.display()); + + Ok(()) + } +} + +impl Download { + pub fn new_with_checksum(client: Client, url: Url, checksum: Vec) -> Self { + Self { + client, + url, + _digest: PhantomData::default(), + _checksum: checksum, + } + } + + // TODO: implement checking the sum, may involve bringing (parts of) and_extract() back in here +} + +#[derive(Clone, Copy, Debug, Default)] +pub struct NoDigest; + +impl FixedOutput for NoDigest { + fn finalize_into(self, _out: &mut Output) {} +} + +impl OutputSizeUser for NoDigest { + type OutputSize = generic_array::typenum::U0; +} + +impl Update for NoDigest { + fn update(&mut self, _data: &[u8]) {} +} + +impl HashMarker for NoDigest {} diff --git a/crates/binstalk/src/helpers/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs similarity index 68% rename from crates/binstalk/src/helpers/download/async_extracter.rs rename to crates/binstalk-downloader/src/download/async_extracter.rs index 21311b3d..bcaaa925 100644 --- a/crates/binstalk/src/helpers/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -13,15 +13,20 @@ use tar::Entries; use tempfile::tempfile; use tokio::task::block_in_place; -use super::{extracter::*, stream_readable::StreamReadable}; -use crate::{errors::BinstallError, manifests::cargo_toml_binstall::TarBasedFmt}; +use super::{ + extracter::*, stream_readable::StreamReadable, CancellationFuture, DownloadError, TarBasedFmt, +}; -pub async fn extract_bin(stream: S, path: &Path) -> Result<(), BinstallError> +pub async fn extract_bin( + stream: S, + path: &Path, + cancellation_future: CancellationFuture, +) -> Result<(), DownloadError> where S: Stream> + Unpin + 'static, - BinstallError: From, + DownloadError: From, { - let mut reader = StreamReadable::new(stream).await; + let mut reader = StreamReadable::new(stream, cancellation_future).await; block_in_place(move || { fs::create_dir_all(path.parent().unwrap())?; @@ -43,12 +48,16 @@ where }) } -pub async fn extract_zip(stream: S, path: &Path) -> Result<(), BinstallError> +pub async fn extract_zip( + stream: S, + path: &Path, + cancellation_future: CancellationFuture, +) -> Result<(), DownloadError> where S: Stream> + Unpin + 'static, - BinstallError: From, + DownloadError: From, { - let mut reader = StreamReadable::new(stream).await; + let mut reader = StreamReadable::new(stream, cancellation_future).await; block_in_place(move || { fs::create_dir_all(path.parent().unwrap())?; @@ -67,12 +76,13 @@ pub async fn extract_tar_based_stream( stream: S, path: &Path, fmt: TarBasedFmt, -) -> Result<(), BinstallError> + cancellation_future: CancellationFuture, +) -> Result<(), DownloadError> where S: Stream> + Unpin + 'static, - BinstallError: From, + DownloadError: From, { - let reader = StreamReadable::new(stream).await; + let reader = StreamReadable::new(stream, cancellation_future).await; block_in_place(move || { fs::create_dir_all(path.parent().unwrap())?; @@ -89,21 +99,22 @@ where pub trait TarEntriesVisitor { type Target; - fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), BinstallError>; - fn finish(self) -> Result; + fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), DownloadError>; + fn finish(self) -> Result; } pub async fn extract_tar_based_stream_and_visit( stream: S, fmt: TarBasedFmt, mut visitor: V, -) -> Result + cancellation_future: CancellationFuture, +) -> Result where S: Stream> + Unpin + 'static, V: TarEntriesVisitor + Debug + Send + 'static, - BinstallError: From, + DownloadError: From, { - let reader = StreamReadable::new(stream).await; + let reader = StreamReadable::new(stream, cancellation_future).await; block_in_place(move || { debug!("Extracting from {fmt} archive to process it in memory"); diff --git a/crates/binstalk/src/helpers/download/extracter.rs b/crates/binstalk-downloader/src/download/extracter.rs similarity index 88% rename from crates/binstalk/src/helpers/download/extracter.rs rename to crates/binstalk-downloader/src/download/extracter.rs index 86ebe5f5..096eca79 100644 --- a/crates/binstalk/src/helpers/download/extracter.rs +++ b/crates/binstalk-downloader/src/download/extracter.rs @@ -12,7 +12,7 @@ use xz2::bufread::XzDecoder; use zip::read::ZipArchive; use zstd::stream::Decoder as ZstdDecoder; -use crate::{errors::BinstallError, manifests::cargo_toml_binstall::TarBasedFmt}; +use super::{DownloadError, TarBasedFmt}; pub fn create_tar_decoder( dat: impl BufRead + 'static, @@ -36,7 +36,7 @@ pub fn create_tar_decoder( Ok(Archive::new(r)) } -pub fn unzip(dat: File, dst: &Path) -> Result<(), BinstallError> { +pub fn unzip(dat: File, dst: &Path) -> Result<(), DownloadError> { debug!("Decompressing from zip archive to `{dst:?}`"); let mut zip = ZipArchive::new(dat)?; diff --git a/crates/binstalk/src/helpers/download/stream_readable.rs b/crates/binstalk-downloader/src/download/stream_readable.rs similarity index 77% rename from crates/binstalk/src/helpers/download/stream_readable.rs rename to crates/binstalk-downloader/src/download/stream_readable.rs index 6685c6bf..af6e9c67 100644 --- a/crates/binstalk/src/helpers/download/stream_readable.rs +++ b/crates/binstalk-downloader/src/download/stream_readable.rs @@ -1,15 +1,13 @@ use std::{ cmp::min, - future::Future, io::{self, BufRead, Read, Write}, - pin::Pin, }; use bytes::{Buf, Bytes}; use futures_util::stream::{Stream, StreamExt}; use tokio::runtime::Handle; -use crate::{errors::BinstallError, helpers::signal::wait_on_cancellation_signal}; +use super::{CancellationFuture, DownloadError}; /// This wraps an AsyncIterator as a `Read`able. /// It must be used in non-async context only, @@ -20,16 +18,16 @@ pub struct StreamReadable { stream: S, handle: Handle, bytes: Bytes, - cancellation_future: Pin> + Send>>, + cancellation_future: CancellationFuture, } impl StreamReadable { - pub(super) async fn new(stream: S) -> Self { + pub(super) async fn new(stream: S, cancellation_future: CancellationFuture) -> Self { Self { stream, handle: Handle::current(), bytes: Bytes::new(), - cancellation_future: Box::pin(wait_on_cancellation_signal()), + cancellation_future, } } } @@ -37,7 +35,7 @@ impl StreamReadable { impl StreamReadable where S: Stream> + Unpin, - BinstallError: From, + DownloadError: From, { /// Copies from `self` to `writer`. /// @@ -69,7 +67,7 @@ where impl Read for StreamReadable where S: Stream> + Unpin, - BinstallError: From, + DownloadError: From, { fn read(&mut self, buf: &mut [u8]) -> io::Result { if buf.is_empty() { @@ -96,14 +94,14 @@ where async fn next_stream(stream: &mut S) -> io::Result> where S: Stream> + Unpin, - BinstallError: From, + DownloadError: From, { loop { let option = stream .next() .await .transpose() - .map_err(BinstallError::from)?; + .map_err(DownloadError::from)?; match option { Some(bytes) if bytes.is_empty() => continue, @@ -115,18 +113,22 @@ where impl BufRead for StreamReadable where S: Stream> + Unpin, - BinstallError: From, + DownloadError: From, { fn fill_buf(&mut self) -> io::Result<&[u8]> { let bytes = &mut self.bytes; if !bytes.has_remaining() { let option = self.handle.block_on(async { - tokio::select! { - res = next_stream(&mut self.stream) => res, - res = self.cancellation_future.as_mut() => { - Err(res.err().unwrap_or_else(|| io::Error::from(BinstallError::UserAbort))) - }, + if let Some(cancellation_future) = self.cancellation_future.as_mut() { + tokio::select! { + res = next_stream(&mut self.stream) => res, + res = cancellation_future => { + Err(res.err().unwrap_or_else(|| io::Error::from(DownloadError::UserAbort))) + }, + } + } else { + next_stream(&mut self.stream).await } })?; diff --git a/crates/binstalk-downloader/src/lib.rs b/crates/binstalk-downloader/src/lib.rs new file mode 100644 index 00000000..abb27a74 --- /dev/null +++ b/crates/binstalk-downloader/src/lib.rs @@ -0,0 +1,2 @@ +pub mod download; +pub mod remote; diff --git a/crates/binstalk/src/helpers/remote.rs b/crates/binstalk-downloader/src/remote.rs similarity index 78% rename from crates/binstalk/src/helpers/remote.rs rename to crates/binstalk-downloader/src/remote.rs index f1ce9f6a..bfe68409 100644 --- a/crates/binstalk/src/helpers/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -6,24 +6,41 @@ use std::{ }; use bytes::Bytes; -use futures_util::stream::Stream; +use futures_util::stream::{Stream, StreamExt}; use httpdate::parse_http_date; use log::{debug, info}; use reqwest::{ header::{HeaderMap, RETRY_AFTER}, Request, Response, StatusCode, }; +use thiserror::Error as ThisError; use tokio::{sync::Mutex, time::sleep}; use tower::{limit::rate::RateLimit, Service, ServiceBuilder, ServiceExt}; -use crate::errors::BinstallError; - -pub use reqwest::{tls, Method}; +pub use reqwest::{tls, Error as ReqwestError, Method}; pub use url::Url; const MAX_RETRY_DURATION: Duration = Duration::from_secs(120); const MAX_RETRY_COUNT: u8 = 3; +#[derive(Debug, ThisError)] +pub enum Error { + #[error(transparent)] + Reqwest(#[from] reqwest::Error), + + #[error(transparent)] + Http(HttpError), +} + +#[derive(Debug, ThisError)] +#[error("could not {method} {url}: {err}")] +pub struct HttpError { + method: reqwest::Method, + url: url::Url, + #[source] + err: reqwest::Error, +} + #[derive(Clone, Debug)] pub struct Client { client: reqwest::Client, @@ -32,11 +49,13 @@ pub struct Client { impl Client { /// * `per` - must not be 0. + /// * `num_request` - maximum number of requests to be processed for + /// each `per` duration. pub fn new( min_tls: Option, per: Duration, num_request: NonZeroU64, - ) -> Result { + ) -> Result { const USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")); let mut builder = reqwest::ClientBuilder::new() @@ -61,6 +80,7 @@ impl Client { }) } + /// Return inner reqwest client. pub fn get_inner(&self) -> &reqwest::Client { &self.client } @@ -69,7 +89,7 @@ impl Client { &self, method: &Method, url: &Url, - ) -> Result { + ) -> Result { let mut count = 0; loop { @@ -108,7 +128,7 @@ impl Client { method: Method, url: Url, error_for_status: bool, - ) -> Result { + ) -> Result { self.send_request_inner(&method, &url) .await .and_then(|response| { @@ -118,10 +138,11 @@ impl Client { Ok(response) } }) - .map_err(|err| BinstallError::Http { method, url, err }) + .map_err(|err| Error::Http(HttpError { method, url, err })) } - pub async fn remote_exists(&self, url: Url, method: Method) -> Result { + /// Check if remote exists using `method`. + pub async fn remote_exists(&self, url: Url, method: Method) -> Result { Ok(self .send_request(method, url, false) .await? @@ -129,7 +150,8 @@ impl Client { .is_success()) } - pub async fn get_redirected_final_url(&self, url: Url) -> Result { + /// Attempt to get final redirected url. + pub async fn get_redirected_final_url(&self, url: Url) -> Result { Ok(self .send_request(Method::HEAD, url, true) .await? @@ -137,15 +159,17 @@ impl Client { .clone()) } - pub(crate) async fn create_request( + /// Create `GET` request to `url` and return a stream of the response data. + /// On status code other than 200, it will return an error. + pub async fn get_stream( &self, url: Url, - ) -> Result>, BinstallError> { + ) -> Result>, Error> { debug!("Downloading from: '{url}'"); self.send_request(Method::GET, url, true) .await - .map(Response::bytes_stream) + .map(|response| response.bytes_stream().map(|res| res.map_err(Error::from))) } } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 832785c9..759cb110 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,79 +11,43 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.58" +binstalk-downloader = { version = "0.1.0", path = "../binstalk-downloader" } binstalk-manifests = { version = "0.1.0", path = "../binstalk-manifests" } -bytes = "1.2.1" -bzip2 = "0.4.3" cargo_toml = "0.13.0" compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.2", path = "../detect-targets" } -digest = "0.10.5" -flate2 = { version = "1.0.24", default-features = false } futures-util = { version = "0.3.25", default-features = false, features = ["std"] } -generic-array = "0.14.6" home = "0.5.4" -httpdate = "1.0.2" itertools = "0.10.5" jobslot = { version = "0.2.6", features = ["tokio"] } log = { version = "0.4.17", features = ["std"] } miette = "5.4.1" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.16.0" -reqwest = { version = "0.11.12", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } -scopeguard = "1.1.0" semver = { version = "1.0.14", features = ["serde"] } serde = { version = "1.0.147", features = ["derive"] } strum = "0.24.1" -# Use a fork here since we need PAX support, but the upstream -# does not hav the PR merged yet. -# -#tar = "0.4.38" -tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.3.0" thiserror = "1.0.37" tinytemplate = "1.2.1" -# parking_lot - for OnceCell::const_new -tokio = { version = "1.21.2", features = ["macros", "rt", "process", "sync", "signal", "time", "parking_lot"], default-features = false } -tower = { version = "0.4.13", features = ["limit", "util"] } -trust-dns-resolver = { version = "0.21.2", optional = true, default-features = false, features = ["dnssec-ring"] } +# parking_lot for `tokio::sync::OnceCell::const_new` +tokio = { version = "1.21.2", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" -# Disable all features of zip except for features of compression algorithms: -# Disabled features include: -# - aes-crypto: Enables decryption of files which were encrypted with AES, absolutely zero use for -# this crate. -# - time: Enables features using the [time](https://github.com/time-rs/time) crate, -# which is not used by this crate. -zip = { version = "0.6.3", default-features = false, features = ["deflate", "bzip2", "zstd"] } - -# zstd is also depended by zip. -# Since zip 0.6.3 depends on zstd 0.11, we also have to use 0.11 here, -# otherwise there will be a link conflict. -zstd = { version = "0.11.2", default-features = false } - [dev-dependencies] env_logger = "0.9.3" [features] default = ["static", "rustls"] -static = ["bzip2/static", "xz2/static"] -pkg-config = ["zstd/pkg-config"] +static = ["binstalk-downloader/static"] +pkg-config = ["binstalk-downloader/pkg-config"] -zlib-ng = ["flate2/zlib-ng"] +zlib-ng = ["binstalk-downloader/zlib-ng"] -rustls = [ - "crates_io_api/rustls", - "reqwest/rustls-tls", +rustls = ["crates_io_api/rustls", "binstalk-downloader/rustls"] +native-tls = ["binstalk-downloader/native-tls"] - # Enable the following features only if trust-dns-resolver is enabled. - "trust-dns-resolver?/dns-over-rustls", - # trust-dns-resolver currently supports https with rustls - "trust-dns-resolver?/dns-over-https-rustls", -] -native-tls = ["reqwest/native-tls", "trust-dns-resolver?/dns-over-native-tls"] - -# Enable trust-dns-resolver so that features on it will also be enabled. -trust-dns = ["trust-dns-resolver", "reqwest/trust-dns"] +trust-dns = ["binstalk-downloader/trust-dns"] diff --git a/crates/binstalk/src/drivers/crates_io.rs b/crates/binstalk/src/drivers/crates_io.rs index aa7f0abe..6fbcbec8 100644 --- a/crates/binstalk/src/drivers/crates_io.rs +++ b/crates/binstalk/src/drivers/crates_io.rs @@ -10,6 +10,7 @@ use crate::{ helpers::{ download::Download, remote::{Client, Url}, + signal::wait_on_cancellation_signal, }, manifests::cargo_toml_binstall::{Meta, TarBasedFmt}, }; @@ -53,7 +54,11 @@ pub async fn fetch_crate_cratesio( let manifest_dir_path: PathBuf = format!("{name}-{version_name}").into(); - Download::new(client, Url::parse(&crate_url)?) - .and_visit_tar(TarBasedFmt::Tgz, ManifestVisitor::new(manifest_dir_path)) - .await + Ok(Download::new(client, Url::parse(&crate_url)?) + .and_visit_tar( + TarBasedFmt::Tgz, + ManifestVisitor::new(manifest_dir_path), + Some(Box::pin(wait_on_cancellation_signal())), + ) + .await?) } diff --git a/crates/binstalk/src/drivers/crates_io/visitor.rs b/crates/binstalk/src/drivers/crates_io/visitor.rs index f36cae9d..b6d082c3 100644 --- a/crates/binstalk/src/drivers/crates_io/visitor.rs +++ b/crates/binstalk/src/drivers/crates_io/visitor.rs @@ -1,16 +1,16 @@ use std::{ - io::Read, + io::{self, Read}, path::{Path, PathBuf}, }; use cargo_toml::Manifest; use log::debug; use normalize_path::NormalizePath; -use tar::Entries; use super::vfs::Vfs; use crate::{ - errors::BinstallError, helpers::download::TarEntriesVisitor, + errors::BinstallError, + helpers::download::{DownloadError, Entries, TarEntriesVisitor}, manifests::cargo_toml_binstall::Meta, }; @@ -37,7 +37,7 @@ impl ManifestVisitor { impl TarEntriesVisitor for ManifestVisitor { type Target = Manifest; - fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), BinstallError> { + fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), DownloadError> { for res in entries { let mut entry = res?; let path = entry.path()?; @@ -71,16 +71,20 @@ impl TarEntriesVisitor for ManifestVisitor { } /// Load binstall metadata using the extracted information stored in memory. - fn finish(self) -> Result { - debug!("Loading manifest directly from extracted file"); - - // Load and parse manifest - let mut manifest = Manifest::from_slice_with_metadata(&self.cargo_toml_content)?; - - // Checks vfs for binary output names - manifest.complete_from_abstract_filesystem(&self.vfs)?; - - // Return metadata - Ok(manifest) + fn finish(self) -> Result { + Ok(load_manifest(&self.cargo_toml_content, &self.vfs).map_err(io::Error::from)?) } } + +fn load_manifest(slice: &[u8], vfs: &Vfs) -> Result, BinstallError> { + debug!("Loading manifest directly from extracted file"); + + // Load and parse manifest + let mut manifest = Manifest::from_slice_with_metadata(slice)?; + + // Checks vfs for binary output names + manifest.complete_from_abstract_filesystem(vfs)?; + + // Return metadata + Ok(manifest) +} diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index b618eba4..351ba02b 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -4,6 +4,10 @@ use std::{ process::{ExitCode, ExitStatus, Termination}, }; +use binstalk_downloader::{ + download::{DownloadError, ZipError}, + remote::{Error as RemoteError, HttpError, ReqwestError}, +}; use compact_str::CompactString; use miette::{Diagnostic, Report}; use thiserror::Error; @@ -47,7 +51,7 @@ pub enum BinstallError { /// - Exit: 66 #[error(transparent)] #[diagnostic(severity(error), code(binstall::unzip))] - Unzip(#[from] zip::result::ZipError), + Unzip(#[from] ZipError), /// A rendering error in a template. /// @@ -65,7 +69,7 @@ pub enum BinstallError { /// - Exit: 68 #[error(transparent)] #[diagnostic(severity(error), code(binstall::reqwest))] - Reqwest(#[from] reqwest::Error), + Reqwest(#[from] ReqwestError), /// An HTTP request failed. /// @@ -74,14 +78,9 @@ pub enum BinstallError { /// /// - Code: `binstall::http` /// - Exit: 69 - #[error("could not {method} {url}")] + #[error(transparent)] #[diagnostic(severity(error), code(binstall::http))] - Http { - method: reqwest::Method, - url: url::Url, - #[source] - err: reqwest::Error, - }, + Http(#[from] HttpError), /// A subprocess failed. /// @@ -418,3 +417,27 @@ impl From for io::Error { } } } + +impl From for BinstallError { + fn from(e: RemoteError) -> Self { + use RemoteError::*; + + match e { + Reqwest(reqwest_error) => reqwest_error.into(), + Http(http_error) => http_error.into(), + } + } +} + +impl From for BinstallError { + fn from(e: DownloadError) -> Self { + use DownloadError::*; + + match e { + Unzip(zip_error) => zip_error.into(), + Remote(remote_error) => remote_error.into(), + Io(io_error) => io_error.into(), + UserAbort => BinstallError::UserAbort, + } + } +} diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 3d33db51..63ced201 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -14,6 +14,7 @@ use crate::{ helpers::{ download::Download, remote::{Client, Method}, + signal::wait_on_cancellation_signal, tasks::AutoAbortJoinHandle, }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, @@ -146,9 +147,9 @@ impl super::Fetcher for GhCrateMeta { async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { let (url, pkg_fmt) = self.resolution.get().unwrap(); // find() is called first debug!("Downloading package from: '{url}' dst:{dst:?} fmt:{pkg_fmt:?}"); - Download::new(self.client.clone(), url.clone()) - .and_extract(*pkg_fmt, dst) - .await + Ok(Download::new(self.client.clone(), url.clone()) + .and_extract(*pkg_fmt, dst, Some(Box::pin(wait_on_cancellation_signal()))) + .await?) } fn pkg_fmt(&self) -> PkgFmt { diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs index 0886b200..e374b143 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk/src/fetchers/quickinstall.rs @@ -10,6 +10,7 @@ use crate::{ helpers::{ download::Download, remote::{Client, Method}, + signal::wait_on_cancellation_signal, }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; @@ -44,17 +45,22 @@ impl super::Fetcher for QuickInstall { let url = self.package_url(); self.report(); debug!("Checking for package at: '{url}'"); - self.client + Ok(self + .client .remote_exists(Url::parse(&url)?, Method::HEAD) - .await + .await?) } async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { let url = self.package_url(); debug!("Downloading package from: '{url}'"); - Download::new(self.client.clone(), Url::parse(&url)?) - .and_extract(self.pkg_fmt(), dst) - .await + Ok(Download::new(self.client.clone(), Url::parse(&url)?) + .and_extract( + self.pkg_fmt(), + dst, + Some(Box::pin(wait_on_cancellation_signal())), + ) + .await?) } fn pkg_fmt(&self) -> PkgFmt { diff --git a/crates/binstalk/src/helpers.rs b/crates/binstalk/src/helpers.rs index b0b8c703..83730ec3 100644 --- a/crates/binstalk/src/helpers.rs +++ b/crates/binstalk/src/helpers.rs @@ -1,5 +1,5 @@ -pub mod download; pub mod jobserver_client; -pub mod remote; pub mod signal; pub mod tasks; + +pub use binstalk_downloader::{download, remote}; diff --git a/crates/binstalk/src/helpers/download.rs b/crates/binstalk/src/helpers/download.rs deleted file mode 100644 index cb606000..00000000 --- a/crates/binstalk/src/helpers/download.rs +++ /dev/null @@ -1,112 +0,0 @@ -use std::{fmt::Debug, marker::PhantomData, path::Path}; - -use digest::{Digest, FixedOutput, HashMarker, Output, OutputSizeUser, Update}; -use log::debug; - -use crate::{ - errors::BinstallError, - helpers::remote::{Client, Url}, - manifests::cargo_toml_binstall::{PkgFmt, PkgFmtDecomposed, TarBasedFmt}, -}; - -pub use async_extracter::TarEntriesVisitor; -use async_extracter::*; - -mod async_extracter; -mod extracter; -mod stream_readable; - -#[derive(Debug)] -pub struct Download { - client: Client, - url: Url, - _digest: PhantomData, - _checksum: Vec, -} - -impl Download { - pub fn new(client: Client, url: Url) -> Self { - Self { - client, - url, - _digest: PhantomData::default(), - _checksum: Vec::new(), - } - } - - /// Download a file from the provided URL and extract part of it to - /// the provided path. - /// - /// * `filter` - If Some, then it will pass the path of the file to it - /// and only extract ones which filter returns `true`. - /// - /// This does not support verifying a checksum due to the partial extraction - /// and will ignore one if specified. - pub async fn and_visit_tar( - self, - fmt: TarBasedFmt, - visitor: V, - ) -> Result { - let stream = self.client.create_request(self.url).await?; - - debug!("Downloading and extracting then in-memory processing"); - - let ret = extract_tar_based_stream_and_visit(stream, fmt, visitor).await?; - - debug!("Download, extraction and in-memory procession OK"); - - Ok(ret) - } - - /// Download a file from the provided URL and extract it to the provided path. - pub async fn and_extract( - self, - fmt: PkgFmt, - path: impl AsRef, - ) -> Result<(), BinstallError> { - let stream = self.client.create_request(self.url).await?; - - let path = path.as_ref(); - debug!("Downloading and extracting to: '{}'", path.display()); - - match fmt.decompose() { - PkgFmtDecomposed::Tar(fmt) => extract_tar_based_stream(stream, path, fmt).await?, - PkgFmtDecomposed::Bin => extract_bin(stream, path).await?, - PkgFmtDecomposed::Zip => extract_zip(stream, path).await?, - } - - debug!("Download OK, extracted to: '{}'", path.display()); - - Ok(()) - } -} - -impl Download { - pub fn new_with_checksum(client: Client, url: Url, checksum: Vec) -> Self { - Self { - client, - url, - _digest: PhantomData::default(), - _checksum: checksum, - } - } - - // TODO: implement checking the sum, may involve bringing (parts of) and_extract() back in here -} - -#[derive(Clone, Copy, Debug, Default)] -pub struct NoDigest; - -impl FixedOutput for NoDigest { - fn finalize_into(self, _out: &mut Output) {} -} - -impl OutputSizeUser for NoDigest { - type OutputSize = generic_array::typenum::U0; -} - -impl Update for NoDigest { - fn update(&mut self, _data: &[u8]) {} -} - -impl HashMarker for NoDigest {} diff --git a/crates/binstalk/src/helpers/signal.rs b/crates/binstalk/src/helpers/signal.rs index d01041df..30eb57bf 100644 --- a/crates/binstalk/src/helpers/signal.rs +++ b/crates/binstalk/src/helpers/signal.rs @@ -1,11 +1,10 @@ -use std::io; - -use futures_util::future::pending; -use tokio::{signal, sync::OnceCell}; +use std::{future::pending, io}; use super::tasks::AutoAbortJoinHandle; use crate::errors::BinstallError; +use tokio::{signal, sync::OnceCell}; + /// This function will poll the handle while listening for ctrl_c, /// `SIGINT`, `SIGHUP`, `SIGTERM` and `SIGQUIT`. /// @@ -18,19 +17,24 @@ use crate::errors::BinstallError; pub async fn cancel_on_user_sig_term( handle: AutoAbortJoinHandle, ) -> Result { - #[cfg(unix)] - unix::ignore_signals_on_unix()?; + ignore_signals()?; tokio::select! { res = handle => res, res = wait_on_cancellation_signal() => { - res - .map_err(BinstallError::Io) + res.map_err(BinstallError::Io) .and(Err(BinstallError::UserAbort)) } } } +pub fn ignore_signals() -> io::Result<()> { + #[cfg(unix)] + unix::ignore_signals_on_unix()?; + + Ok(()) +} + /// If call to it returns `Ok(())`, then all calls to this function after /// that also returns `Ok(())`. pub async fn wait_on_cancellation_signal() -> Result<(), io::Error> { @@ -86,7 +90,7 @@ mod unix { } } - pub fn ignore_signals_on_unix() -> Result<(), BinstallError> { + pub fn ignore_signals_on_unix() -> Result<(), io::Error> { drop(signal(SignalKind::user_defined1())?); drop(signal(SignalKind::user_defined2())?); From 9e80cf0700fe60af3d6cbd9f66a4137973cc977f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 11 Nov 2022 16:24:46 +1100 Subject: [PATCH 0852/2020] Feature: Impl opt-out options (#510) Fixed #136 * Impl opt-out optioins in binstalk * Replace field `Options::{gh_crate, quickinstall}_fetcher` with `resolver` which can determine order of resolver used. * Add new field `Args::{disable_}strategies` * Add new variant `BinstallError::InvalidStrategies` * Add variant `BinstallError::NoFallbackToCargoInstall` * Add code for supporting strategies in mod entry * Test `--disable-strategies` in `tests.sh` * Test for `--strategies` in `tests.sh` Signed-off-by: Jiahao XU --- .github/scripts/tests.sh | 27 ++++++++++-- crates/bin/src/args.rs | 25 +++++++++++ crates/bin/src/entry.rs | 66 ++++++++++++++++++++++++++++-- crates/binstalk/src/errors.rs | 18 ++++++++ crates/binstalk/src/ops.rs | 12 +++++- crates/binstalk/src/ops/resolve.rs | 4 +- 6 files changed, 141 insertions(+), 11 deletions(-) diff --git a/.github/scripts/tests.sh b/.github/scripts/tests.sh index 5088bbf7..5714932d 100755 --- a/.github/scripts/tests.sh +++ b/.github/scripts/tests.sh @@ -77,16 +77,13 @@ cargo binstall --help >/dev/null "./$1" binstall --no-confirm cargo-binstall@0.12.0 | grep -q 'cargo-binstall v0.12.0 is already installed' "./$1" binstall --no-confirm cargo-binstall@^0.12.0 | grep -q -v 'cargo-binstall v0.12.0 is already installed' -# to force failure if falling back to source -# FIXME: remove/replace once #136 lands -export PATH="$test_resources/fake-cargo:$PATH" - # Test default GitLab pkg-url templates "./$1" binstall \ --force \ --manifest-path "$test_resources/gitlab-test-Cargo.toml" \ --log-level debug \ --no-confirm \ + --disable-strategies compile \ cargo-binstall # Test default BitBucket pkg-url templates @@ -95,6 +92,7 @@ export PATH="$test_resources/fake-cargo:$PATH" --manifest-path "$test_resources/bitbucket-test-Cargo.toml" \ --log-level debug \ --no-confirm \ + --disable-strategies compile \ cargo-binstall # Test default Github pkg-url templates, @@ -104,4 +102,25 @@ export PATH="$test_resources/fake-cargo:$PATH" --manifest-path "$test_resources/github-test-Cargo2.toml" \ --log-level debug \ --no-confirm \ + --disable-strategies compile \ cargo-binstall + +## Test --disable-strategies +set +e + +"./$1" binstall --no-confirm --disable-strategies quick-install,compile cargo-update +exit_code="$?" + +if [ "$exit_code" != 94 ]; then + echo "Expected exit code 94, but actual exit code $exit_code" + exit 1 +fi + +## Test --strategies +"./$1" binstall --no-confirm --strategies crate-meta-data cargo-update +exit_code="$?" + +if [ "$exit_code" != 94 ]; then + echo "Expected exit code 94, but actual exit code $exit_code" + exit 1 +fi diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 9ca2ae30..899ced0a 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -129,6 +129,19 @@ pub struct Args { #[clap(help_heading = "Overrides", long, default_value_t = RateLimit::default())] pub rate_limit: RateLimit, + /// Specify the strategies to be used, + /// binstall will run the strategies specified in order. + /// + /// Default value is "crate-meta-data,quick-install,compile". + #[clap(help_heading = "Overrides", long, value_delimiter(','))] + pub strategies: Vec, + + /// Disable the strategies specified. + /// If a strategy is specified in `--strategies` and `--disable-strategies`, + /// then it will be removed. + #[clap(help_heading = "Overrides", long, value_delimiter(','))] + pub disable_strategies: Vec, + /// Disable symlinking / versioned updates. /// /// By default, Binstall will install a binary named `-` in the install path, and @@ -282,6 +295,18 @@ impl Default for RateLimit { } } +/// Strategy for installing the package +#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, ValueEnum)] +pub enum Strategy { + /// Attempt to download official pre-built artifacts using + /// information provided in `Cargo.toml`. + CrateMetaData, + /// Query third-party QuickInstall for the crates. + QuickInstall, + /// Build the crates from source using `cargo-build`. + Compile, +} + pub fn parse() -> Result { // Filter extraneous arg when invoked by cargo // `cargo run -- --help` gives ["target/debug/cargo-binstall", "--help"] diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 4518694b..ee2ae23c 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -1,7 +1,8 @@ -use std::{fs, path::Path, sync::Arc, time::Duration}; +use std::{fs, mem, path::Path, sync::Arc, time::Duration}; use binstalk::{ errors::BinstallError, + fetchers::{Fetcher, GhCrateMeta, QuickInstall}, get_desired_targets, helpers::{jobserver_client::LazyJobserverClient, remote::Client, tasks::AutoAbortJoinHandle}, manifests::{ @@ -16,9 +17,61 @@ use log::{debug, error, info, warn, LevelFilter}; use miette::{miette, Result, WrapErr}; use tokio::task::block_in_place; -use crate::{args::Args, install_path, ui::UIThread}; +use crate::{ + args::{Args, Strategy}, + install_path, + ui::UIThread, +}; pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClient) -> Result<()> { + let mut strategies = vec![]; + + // Remove duplicate strategies + for strategy in mem::take(&mut args.strategies) { + if !strategies.contains(&strategy) { + strategies.push(strategy); + } + } + + // Default strategies if empty + if strategies.is_empty() { + strategies = vec![ + Strategy::CrateMetaData, + Strategy::QuickInstall, + Strategy::Compile, + ]; + } + + let disable_strategies = mem::take(&mut args.disable_strategies); + + let mut strategies: Vec = if !disable_strategies.is_empty() { + strategies + .into_iter() + .filter(|strategy| !disable_strategies.contains(strategy)) + .collect() + } else { + strategies + }; + + if strategies.is_empty() { + return Err(BinstallError::InvalidStrategies(&"No strategy is provided").into()); + } + + let cargo_install_fallback = *strategies.last().unwrap() == Strategy::Compile; + + if cargo_install_fallback { + strategies.pop().unwrap(); + } + + let resolver: Vec<_> = strategies + .into_iter() + .map(|strategy| match strategy { + Strategy::CrateMetaData => GhCrateMeta::new, + Strategy::QuickInstall => QuickInstall::new, + Strategy::Compile => unreachable!(), + }) + .collect(); + let cli_overrides = PkgOverride { pkg_url: args.pkg_url.take(), pkg_fmt: args.pkg_fmt.take(), @@ -138,6 +191,7 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien cli_overrides, desired_targets, quiet: args.log_level == LevelFilter::Off, + resolver, }); let tasks: Vec<_> = if !args.dry_run && !args.no_confirm { @@ -208,7 +262,13 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien ) .await?; - ops::install::install(resolution, opts, jobserver_client).await + if !cargo_install_fallback + && matches!(resolution, Resolution::InstallFromSource { .. }) + { + Err(BinstallError::NoFallbackToCargoInstall) + } else { + ops::install::install(resolution, opts, jobserver_client).await + } }) }) .collect() diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index 351ba02b..5dae3396 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -310,6 +310,22 @@ pub enum BinstallError { #[diagnostic(severity(error), code(binstall::SourceFilePath))] EmptySourceFilePath, + /// Invalid strategies configured. + /// + /// - Code: `binstall::strategies` + /// - Exit: 93 + #[error("Invalid strategies configured: {0}")] + #[diagnostic(severity(error), code(binstall::strategies))] + InvalidStrategies(&'static &'static str), + + /// Fallback to `cargo-install` is disabled. + /// + /// - Code: `binstall::no_fallback_to_cargo_install` + /// - Exit: 94 + #[error("Fallback to cargo-install is disabled")] + #[diagnostic(severity(error), code(binstall::no_fallback_to_cargo_install))] + NoFallbackToCargoInstall, + /// A wrapped error providing the context of which crate the error is about. #[error("for crate {crate_name}")] CrateContext { @@ -348,6 +364,8 @@ impl BinstallError { DuplicateSourceFilePath { .. } => 90, InvalidSourceFilePath { .. } => 91, EmptySourceFilePath => 92, + InvalidStrategies(..) => 93, + NoFallbackToCargoInstall => 94, CrateContext { error, .. } => error.exit_number(), }; diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index b7475750..582d3911 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -1,14 +1,21 @@ //! Concrete Binstall operations. -use std::path::PathBuf; +use std::{path::PathBuf, sync::Arc}; use semver::VersionReq; -use crate::{manifests::cargo_toml_binstall::PkgOverride, DesiredTargets}; +use crate::{ + fetchers::{Data, Fetcher}, + helpers::remote::Client, + manifests::cargo_toml_binstall::PkgOverride, + DesiredTargets, +}; pub mod install; pub mod resolve; +pub type Resolver = fn(&Client, &Arc) -> Arc; + pub struct Options { pub no_symlinks: bool, pub dry_run: bool, @@ -18,4 +25,5 @@ pub struct Options { pub cli_overrides: PkgOverride, pub desired_targets: DesiredTargets, pub quiet: bool, + pub resolver: Vec, } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 3335a130..1e494e5c 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -18,7 +18,7 @@ use crate::{ bins, drivers::fetch_crate_cratesio, errors::BinstallError, - fetchers::{Data, Fetcher, GhCrateMeta, QuickInstall}, + fetchers::{Data, Fetcher}, helpers::{remote::Client, tasks::AutoAbortJoinHandle}, manifests::cargo_toml_binstall::{Meta, PkgMeta}, }; @@ -211,7 +211,7 @@ async fn resolve_inner( meta: target_meta, }) }) - .cartesian_product([GhCrateMeta::new, QuickInstall::new]) + .cartesian_product(&opts.resolver) .map(|(fetcher_data, f)| { let fetcher = f(&client, &fetcher_data); ( From 4e875874b6fd22ddced8ee6807db6efa0d14ae9b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 13 Nov 2022 19:45:37 +1100 Subject: [PATCH 0853/2020] Replace use of `log` with `tracing` (#527) Resolved #522 * Add dep tracing v0.1.37 to binstalk * Use `tracing` instead of `log` for logging in binstalk * Rm dev dep `env_logger` since `log` is no longer used * Rm unused dep `log` from binstalk * Replace use of `log` with `tracing` in crates/bin * Enable feat std of dep log in crates/bin * Add dep tracing v0.1.37 to binstalk-downloader * Replace use of `log` with `tracing` in binstalk-downloader * Rm unused dep `log` from binstalk-downlaoder * Wrap `ops::{install, resolve}` in `tracing::instrument` * Wrap `Download::and_{extract, visit_tar}` in `instrument` Signed-off-by: Jiahao XU --- Cargo.lock | 36 ++++++++----------- crates/bin/Cargo.toml | 2 +- crates/bin/src/entry.rs | 3 +- crates/bin/src/install_path.rs | 2 +- crates/bin/src/main.rs | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-downloader/src/download.rs | 4 ++- .../src/download/async_extracter.rs | 2 +- .../src/download/extracter.rs | 2 +- crates/binstalk-downloader/src/remote.rs | 2 +- crates/binstalk/Cargo.toml | 5 +-- crates/binstalk/src/bins.rs | 2 +- crates/binstalk/src/drivers/crates_io.rs | 2 +- .../binstalk/src/drivers/crates_io/visitor.rs | 2 +- crates/binstalk/src/drivers/version.rs | 2 +- crates/binstalk/src/fetchers.rs | 1 - crates/binstalk/src/fetchers/gh_crate_meta.rs | 2 +- crates/binstalk/src/fetchers/quickinstall.rs | 2 +- crates/binstalk/src/fs.rs | 2 +- crates/binstalk/src/ops/install.rs | 3 +- crates/binstalk/src/ops/resolve.rs | 3 +- crates/binstalk/tests/parse-meta.rs | 2 -- 22 files changed, 38 insertions(+), 47 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a6d0c038..ddeb5b20 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -115,12 +115,10 @@ dependencies = [ "compact_str", "crates_io_api", "detect-targets", - "env_logger", "futures-util", "home", "itertools", "jobslot", - "log", "miette", "normalize-path", "once_cell", @@ -131,6 +129,7 @@ dependencies = [ "thiserror", "tinytemplate", "tokio", + "tracing", "url", "xz2", ] @@ -148,13 +147,13 @@ dependencies = [ "futures-util", "generic-array", "httpdate", - "log", "reqwest", "scopeguard", "tempfile", "thiserror", "tokio", "tower", + "tracing", "trust-dns-resolver", "url", "xz2", @@ -571,19 +570,6 @@ dependencies = [ "syn", ] -[[package]] -name = "env_logger" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - [[package]] name = "errno" version = "0.2.8" @@ -907,12 +893,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - [[package]] name = "hyper" version = "0.14.20" @@ -2199,6 +2179,7 @@ dependencies = [ "cfg-if", "log", "pin-project-lite", + "tracing-attributes", "tracing-core", ] @@ -2213,6 +2194,17 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "tracing-attributes" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "tracing-core" version = "0.1.30" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 27560eca..4567dfc5 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -26,7 +26,7 @@ binstalk = { path = "../binstalk", version = "0.4.1" } clap = { version = "4.0.22", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" -log = "0.4.17" +log = { version = "0.4.17", features = ["std"] } miette = "5.4.1" mimalloc = { version = "0.1.31", default-features = false, optional = true } once_cell = "1.16.0" diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index ee2ae23c..649a72ff 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -13,9 +13,10 @@ use binstalk::{ resolve::{CrateName, Resolution, VersionReqExt}, }, }; -use log::{debug, error, info, warn, LevelFilter}; +use log::LevelFilter; use miette::{miette, Result, WrapErr}; use tokio::task::block_in_place; +use tracing::{debug, error, info, warn}; use crate::{ args::{Args, Strategy}, diff --git a/crates/bin/src/install_path.rs b/crates/bin/src/install_path.rs index 50a3849e..042fee29 100644 --- a/crates/bin/src/install_path.rs +++ b/crates/bin/src/install_path.rs @@ -5,7 +5,7 @@ use std::{ }; use binstalk::home::cargo_home; -use log::debug; +use tracing::debug; pub fn get_cargo_roots_path(cargo_roots: Option) -> Option { if let Some(p) = cargo_roots { diff --git a/crates/bin/src/main.rs b/crates/bin/src/main.rs index fff42ee5..9e57b764 100644 --- a/crates/bin/src/main.rs +++ b/crates/bin/src/main.rs @@ -1,7 +1,7 @@ use std::time::Instant; use binstalk::helpers::jobserver_client::LazyJobserverClient; -use log::debug; +use tracing::debug; use cargo_binstall::{ args, diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index bbc18ba7..86764ee4 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -18,7 +18,6 @@ flate2 = { version = "1.0.24", default-features = false } futures-util = { version = "0.3.25", default-features = false, features = ["std"] } generic-array = "0.14.6" httpdate = "1.0.2" -log = { version = "0.4.17", features = ["std"] } reqwest = { version = "0.11.12", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } scopeguard = "1.1.0" # Use a fork here since we need PAX support, but the upstream @@ -30,6 +29,7 @@ tempfile = "3.3.0" thiserror = "1.0.37" tokio = { version = "1.21.2", features = ["macros", "rt-multi-thread", "sync", "time"], default-features = false } tower = { version = "0.4.13", features = ["limit", "util"] } +tracing = "0.1.37" trust-dns-resolver = { version = "0.21.2", optional = true, default-features = false, features = ["dnssec-ring"] } url = "2.3.1" diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index 6b3985e1..276d5a39 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -2,8 +2,8 @@ use std::{fmt::Debug, future::Future, io, marker::PhantomData, path::Path, pin:: use binstalk_manifests::cargo_toml_binstall::{PkgFmtDecomposed, TarBasedFmt}; use digest::{Digest, FixedOutput, HashMarker, Output, OutputSizeUser, Update}; -use log::debug; use thiserror::Error as ThisError; +use tracing::{debug, instrument}; pub use binstalk_manifests::cargo_toml_binstall::PkgFmt; pub use tar::Entries; @@ -92,6 +92,7 @@ impl Download { /// /// `cancellation_future` can be used to cancel the extraction and return /// [`DownloadError::UserAbort`] error. + #[instrument(skip(visitor, cancellation_future))] pub async fn and_visit_tar( self, fmt: TarBasedFmt, @@ -114,6 +115,7 @@ impl Download { /// /// `cancellation_future` can be used to cancel the extraction and return /// [`DownloadError::UserAbort`] error. + #[instrument(skip(path, cancellation_future))] pub async fn and_extract( self, fmt: PkgFmt, diff --git a/crates/binstalk-downloader/src/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs index bcaaa925..b36deed9 100644 --- a/crates/binstalk-downloader/src/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -7,11 +7,11 @@ use std::{ use bytes::Bytes; use futures_util::stream::Stream; -use log::debug; use scopeguard::{guard, ScopeGuard}; use tar::Entries; use tempfile::tempfile; use tokio::task::block_in_place; +use tracing::debug; use super::{ extracter::*, stream_readable::StreamReadable, CancellationFuture, DownloadError, TarBasedFmt, diff --git a/crates/binstalk-downloader/src/download/extracter.rs b/crates/binstalk-downloader/src/download/extracter.rs index 096eca79..c33e9081 100644 --- a/crates/binstalk-downloader/src/download/extracter.rs +++ b/crates/binstalk-downloader/src/download/extracter.rs @@ -6,8 +6,8 @@ use std::{ use bzip2::bufread::BzDecoder; use flate2::bufread::GzDecoder; -use log::debug; use tar::Archive; +use tracing::debug; use xz2::bufread::XzDecoder; use zip::read::ZipArchive; use zstd::stream::Decoder as ZstdDecoder; diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index bfe68409..1be1d4e4 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -8,7 +8,6 @@ use std::{ use bytes::Bytes; use futures_util::stream::{Stream, StreamExt}; use httpdate::parse_http_date; -use log::{debug, info}; use reqwest::{ header::{HeaderMap, RETRY_AFTER}, Request, Response, StatusCode, @@ -16,6 +15,7 @@ use reqwest::{ use thiserror::Error as ThisError; use tokio::{sync::Mutex, time::sleep}; use tower::{limit::rate::RateLimit, Service, ServiceBuilder, ServiceExt}; +use tracing::{debug, info}; pub use reqwest::{tls, Error as ReqwestError, Method}; pub use url::Url; diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 759cb110..87e259d0 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -21,7 +21,6 @@ futures-util = { version = "0.3.25", default-features = false, features = ["std" home = "0.5.4" itertools = "0.10.5" jobslot = { version = "0.2.6", features = ["tokio"] } -log = { version = "0.4.17", features = ["std"] } miette = "5.4.1" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.16.0" @@ -33,12 +32,10 @@ thiserror = "1.0.37" tinytemplate = "1.2.1" # parking_lot for `tokio::sync::OnceCell::const_new` tokio = { version = "1.21.2", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } +tracing = "0.1.37" url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" -[dev-dependencies] -env_logger = "0.9.3" - [features] default = ["static", "rustls"] diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 8961d89d..21b58fcb 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -6,10 +6,10 @@ use std::{ use cargo_toml::Product; use compact_str::CompactString; -use log::debug; use normalize_path::NormalizePath; use serde::Serialize; use tinytemplate::TinyTemplate; +use tracing::debug; use crate::{ errors::BinstallError, diff --git a/crates/binstalk/src/drivers/crates_io.rs b/crates/binstalk/src/drivers/crates_io.rs index 6fbcbec8..1847b204 100644 --- a/crates/binstalk/src/drivers/crates_io.rs +++ b/crates/binstalk/src/drivers/crates_io.rs @@ -2,8 +2,8 @@ use std::path::PathBuf; use cargo_toml::Manifest; use crates_io_api::AsyncClient; -use log::debug; use semver::VersionReq; +use tracing::debug; use crate::{ errors::BinstallError, diff --git a/crates/binstalk/src/drivers/crates_io/visitor.rs b/crates/binstalk/src/drivers/crates_io/visitor.rs index b6d082c3..36abe991 100644 --- a/crates/binstalk/src/drivers/crates_io/visitor.rs +++ b/crates/binstalk/src/drivers/crates_io/visitor.rs @@ -4,8 +4,8 @@ use std::{ }; use cargo_toml::Manifest; -use log::debug; use normalize_path::NormalizePath; +use tracing::debug; use super::vfs::Vfs; use crate::{ diff --git a/crates/binstalk/src/drivers/version.rs b/crates/binstalk/src/drivers/version.rs index 4b8b7413..3861d360 100644 --- a/crates/binstalk/src/drivers/version.rs +++ b/crates/binstalk/src/drivers/version.rs @@ -1,5 +1,5 @@ -use log::debug; use semver::VersionReq; +use tracing::debug; use crate::errors::BinstallError; diff --git a/crates/binstalk/src/fetchers.rs b/crates/binstalk/src/fetchers.rs index 603c1b3d..6e606340 100644 --- a/crates/binstalk/src/fetchers.rs +++ b/crates/binstalk/src/fetchers.rs @@ -2,7 +2,6 @@ use std::{path::Path, sync::Arc}; use compact_str::CompactString; pub use gh_crate_meta::*; -pub use log::debug; pub use quickinstall::*; use crate::{ diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 63ced201..896582e4 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -2,11 +2,11 @@ use std::{path::Path, sync::Arc}; use compact_str::{CompactString, ToCompactString}; use futures_util::stream::{FuturesUnordered, StreamExt}; -use log::{debug, warn}; use once_cell::sync::OnceCell; use serde::Serialize; use strum::IntoEnumIterator; use tinytemplate::TinyTemplate; +use tracing::{debug, warn}; use url::Url; use crate::{ diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs index e374b143..9821ba8e 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk/src/fetchers/quickinstall.rs @@ -1,8 +1,8 @@ use std::{path::Path, sync::Arc}; use compact_str::CompactString; -use log::debug; use tokio::task::JoinHandle; +use tracing::debug; use url::Url; use crate::{ diff --git a/crates/binstalk/src/fs.rs b/crates/binstalk/src/fs.rs index 3962b249..270f6872 100644 --- a/crates/binstalk/src/fs.rs +++ b/crates/binstalk/src/fs.rs @@ -1,7 +1,7 @@ use std::{fs, io, path::Path}; -use log::debug; use tempfile::NamedTempFile; +use tracing::debug; /// Atomically install a file. /// diff --git a/crates/binstalk/src/ops/install.rs b/crates/binstalk/src/ops/install.rs index 2e1fe3d1..8fbca294 100644 --- a/crates/binstalk/src/ops/install.rs +++ b/crates/binstalk/src/ops/install.rs @@ -1,8 +1,8 @@ use std::{borrow::Cow, env, ffi::OsStr, sync::Arc}; use compact_str::CompactString; -use log::{debug, error, info}; use tokio::{process::Command, task::block_in_place}; +use tracing::{debug, error, info, instrument}; use super::{resolve::Resolution, Options}; use crate::{ @@ -12,6 +12,7 @@ use crate::{ manifests::crate_info::{CrateInfo, CrateSource}, }; +#[instrument(skip_all)] pub async fn install( resolution: Resolution, opts: Arc, diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 1e494e5c..6401f55a 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -9,9 +9,9 @@ use std::{ use cargo_toml::{Manifest, Package, Product}; use compact_str::{CompactString, ToCompactString}; use itertools::Itertools; -use log::{debug, info, warn}; use semver::{Version, VersionReq}; use tokio::task::block_in_place; +use tracing::{debug, info, instrument, warn}; use super::Options; use crate::{ @@ -89,6 +89,7 @@ impl Resolution { } } +#[instrument(skip_all)] pub async fn resolve( opts: Arc, crate_name: CrateName, diff --git a/crates/binstalk/tests/parse-meta.rs b/crates/binstalk/tests/parse-meta.rs index 2d9486fc..a76bedf5 100644 --- a/crates/binstalk/tests/parse-meta.rs +++ b/crates/binstalk/tests/parse-meta.rs @@ -3,8 +3,6 @@ use cargo_toml::Product; #[test] fn parse_meta() { - let _ = env_logger::builder().is_test(true).try_init(); - let mut manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap(); manifest_dir.push_str("/tests/parse-meta.Cargo.toml"); From 90495b35d81c30db593f9345f124760b4d04335f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 13 Nov 2022 20:45:19 +1100 Subject: [PATCH 0854/2020] Enable coloring in console log (#528) * Enable feat ansi of dep tracing-subscriber * Rm use of `tracing_appender::non_blocking` since `cargo-binstall` is so simple that it doesn't need it. * Use `tracing::{error, info}` in `MainExit::report` * Use `tracing::{error, warn}` in `BinstallError::report` * Add dep supports-color v1.3.1 to crates/bin * Enable ansi of `tracing_subscriber::fmt` if stdout supports it Signed-off-by: Jiahao XU --- Cargo.lock | 64 +++++++++++------------------------ crates/bin/Cargo.toml | 4 +-- crates/bin/src/bin_util.rs | 6 ++-- crates/bin/src/logging.rs | 45 ++++++++++++------------ crates/bin/src/main.rs | 2 +- crates/binstalk/src/errors.rs | 7 ++-- 6 files changed, 51 insertions(+), 77 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ddeb5b20..eee57d7d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -283,10 +283,10 @@ dependencies = [ "mimalloc", "once_cell", "semver", + "supports-color", "tempfile", "tokio", "tracing", - "tracing-appender", "tracing-core", "tracing-log", "tracing-subscriber", @@ -448,16 +448,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" -dependencies = [ - "cfg-if", - "crossbeam-utils", -] - [[package]] name = "crossbeam-utils" version = "0.8.11" @@ -1249,6 +1239,16 @@ dependencies = [ name = "normalize-path" version = "0.2.0" +[[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-integer" version = "0.1.45" @@ -1278,15 +1278,6 @@ dependencies = [ "libc", ] -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ - "libc", -] - [[package]] name = "object" version = "0.29.0" @@ -1353,6 +1344,12 @@ version = "6.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" +[[package]] +name = "overload" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" + [[package]] name = "owo-colors" version = "3.5.0" @@ -1898,9 +1895,9 @@ dependencies = [ [[package]] name = "supports-color" -version = "1.3.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4872ced36b91d47bae8a214a683fe54e7078875b399dfa251df346c9b547d1f9" +checksum = "8ba6faf2ca7ee42fdd458f4347ae0a9bd6bcc445ad7cb57ad82b383f18870d6f" dependencies = [ "atty", "is_ci", @@ -2008,17 +2005,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "time" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3f9a28b618c3a6b9251b6908e9c99e04b9e5c02e6581ccbb67d59c34ef7f9b" -dependencies = [ - "itoa", - "libc", - "num_threads", -] - [[package]] name = "tinytemplate" version = "1.2.1" @@ -2183,17 +2169,6 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-appender" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e" -dependencies = [ - "crossbeam-channel", - "time", - "tracing-subscriber", -] - [[package]] name = "tracing-attributes" version = "0.1.23" @@ -2242,6 +2217,7 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" dependencies = [ + "nu-ansi-term", "serde", "serde_json", "sharded-slab", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 4567dfc5..912ea0a1 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -31,13 +31,13 @@ miette = "5.4.1" mimalloc = { version = "0.1.31", default-features = false, optional = true } once_cell = "1.16.0" semver = "1.0.14" +supports-color = "1.3.1" tempfile = "3.3.0" tokio = { version = "1.21.2", features = ["rt-multi-thread"], default-features = false } tracing-core = "0.1.30" tracing = { version = "0.1.37", default-features = false } tracing-log = { version = "0.1.3", default-features = false } -tracing-appender = "0.2.2" -tracing-subscriber = { version = "0.3.16", features = ["fmt", "json"], default-features = false } +tracing-subscriber = { version = "0.3.16", features = ["fmt", "json", "ansi"], default-features = false } [build-dependencies] embed-resource = "1.7.4" diff --git a/crates/bin/src/bin_util.rs b/crates/bin/src/bin_util.rs index e1732dc9..d0d03532 100644 --- a/crates/bin/src/bin_util.rs +++ b/crates/bin/src/bin_util.rs @@ -1,6 +1,5 @@ use std::{ future::Future, - io::{self, Write}, process::{ExitCode, Termination}, time::Duration, }; @@ -9,6 +8,7 @@ use binstalk::errors::BinstallError; use binstalk::helpers::{signal::cancel_on_user_sig_term, tasks::AutoAbortJoinHandle}; use miette::Result; use tokio::runtime::Runtime; +use tracing::{error, info}; pub enum MainExit { Success(Option), @@ -21,13 +21,13 @@ impl Termination for MainExit { match self { Self::Success(spent) => { if let Some(spent) = spent { - writeln!(io::stdout(), "Done in {spent:?}").ok(); + info!("Done in {spent:?}"); } ExitCode::SUCCESS } Self::Error(err) => err.report(), Self::Report(err) => { - writeln!(io::stderr(), "Fatal error:\n{err:?}").ok(); + error!("Fatal error:\n{err:?}"); ExitCode::from(16) } } diff --git a/crates/bin/src/logging.rs b/crates/bin/src/logging.rs index 6787d0d6..29869361 100644 --- a/crates/bin/src/logging.rs +++ b/crates/bin/src/logging.rs @@ -1,14 +1,14 @@ -use std::{cmp::min, io, iter::repeat}; +use std::{cmp::min, iter::repeat}; use log::{LevelFilter, Log, STATIC_MAX_LEVEL}; use once_cell::sync::Lazy; +use supports_color::{on as supports_color_on_stream, Stream::Stdout}; use tracing::{ callsite::Callsite, dispatcher, field, subscriber::{self, set_global_default}, Event, Level, Metadata, }; -use tracing_appender::non_blocking::{NonBlockingBuilder, WorkerGuard}; use tracing_core::{identify_callsite, metadata::Kind, subscriber::Subscriber}; use tracing_log::AsTrace; use tracing_subscriber::{filter::targets::Targets, fmt::fmt, layer::SubscriberExt}; @@ -131,7 +131,7 @@ impl Log for Logger { fn flush(&self) {} } -pub fn logging(args: &Args) -> WorkerGuard { +pub fn logging(args: &Args) { // Calculate log_level let log_level = min(args.log_level, STATIC_MAX_LEVEL); @@ -141,31 +141,30 @@ pub fn logging(args: &Args) -> WorkerGuard { // Forward log to tracing Logger::init(log_level); - // Setup non-blocking stdout - let (non_blocking, guard) = NonBlockingBuilder::default() - .lossy(false) - .finish(io::stdout()); - // Build fmt subscriber let log_level = log_level.as_trace(); - let subscriber_builder = fmt().with_writer(non_blocking).with_max_level(log_level); + let subscriber_builder = fmt().with_max_level(log_level); let subscriber: Box = if args.json_output { Box::new(subscriber_builder.json().finish()) } else { - Box::new( - subscriber_builder - .compact() - // Disable time, target, file, line_num, thread name/ids to make the - // output more readable - .without_time() - .with_target(false) - .with_file(false) - .with_line_number(false) - .with_thread_names(false) - .with_thread_ids(false) - .finish(), - ) + // Disable time, target, file, line_num, thread name/ids to make the + // output more readable + let subscriber_builder = subscriber_builder + .without_time() + .with_target(false) + .with_file(false) + .with_line_number(false) + .with_thread_names(false) + .with_thread_ids(false); + + // subscriber_builder defaults to write to io::stdout(), + // so tests whether it supports color. + let stdout_supports_color = supports_color_on_stream(Stdout) + .map(|color_level| color_level.has_basic) + .unwrap_or_default(); + + Box::new(subscriber_builder.with_ansi(stdout_supports_color).finish()) }; // Builder layer for filtering @@ -178,6 +177,4 @@ pub fn logging(args: &Args) -> WorkerGuard { // Setup global subscriber set_global_default(subscriber).unwrap(); - - guard } diff --git a/crates/bin/src/main.rs b/crates/bin/src/main.rs index 9e57b764..b839f65a 100644 --- a/crates/bin/src/main.rs +++ b/crates/bin/src/main.rs @@ -27,7 +27,7 @@ fn main() -> MainExit { println!("{}", env!("CARGO_PKG_VERSION")); MainExit::Success(None) } else { - let _guard = logging(&args); + logging(&args); let start = Instant::now(); diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index 5dae3396..266b6b43 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -1,5 +1,5 @@ use std::{ - io::{self, Write}, + io, path::PathBuf, process::{ExitCode, ExitStatus, Termination}, }; @@ -12,6 +12,7 @@ use compact_str::CompactString; use miette::{Diagnostic, Report}; use thiserror::Error; use tokio::task; +use tracing::{error, warn}; /// Error kinds emitted by cargo-binstall. #[derive(Error, Diagnostic, Debug)] @@ -399,9 +400,9 @@ impl Termination for BinstallError { fn report(self) -> ExitCode { let code = self.exit_code(); if let BinstallError::UserAbort = self { - writeln!(io::stdout(), "Installation cancelled").ok(); + warn!("Installation cancelled"); } else { - writeln!(io::stderr(), "Fatal error:\n{:?}", Report::new(self)).ok(); + error!("Fatal error:\n{:?}", Report::new(self)); } code From 933c6425ef040463353b4ccfbf7cb43fb5355dee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 14 Nov 2022 01:30:17 +0000 Subject: [PATCH 0855/2020] Bump clap from 4.0.22 to 4.0.23 (#529) Bumps [clap](https://github.com/clap-rs/clap) from 4.0.22 to 4.0.23. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.22...v4.0.23) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eee57d7d..e711d911 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -339,9 +339,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.22" +version = "4.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91b9970d7505127a162fdaa9b96428d28a479ba78c9ec7550a63a5d9863db682" +checksum = "0eb41c13df48950b20eb4cd0eefa618819469df1bffc49d11e8487c4ba0037e5" dependencies = [ "atty", "bitflags", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 912ea0a1..fd183492 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.4.1" } -clap = { version = "4.0.22", features = ["derive"] } +clap = { version = "4.0.23", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = { version = "0.4.17", features = ["std"] } From c34a2850b30a7e7f3e3086080f3bcde73a74ebb8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 15 Nov 2022 00:46:32 +1100 Subject: [PATCH 0856/2020] Optimization: Box variants in Error to reduce size and remove unused variants in `BinstallError` (#530) * Box `HttpError` in `binsalk_downloader::remote::Error::Http` as `HttpError` contains `Url` which are too big. * Box `HttpError` in `BinstallError::Http` same as the previous commit. * Box `TinyTemplateError` in `BinstallError::Template` since `TinyTemplateError` is 56 bytes large where most of the other variants are below 40 bytes large. * Rm unsed variant `BinstallError::VersionUnavailable` * Box `CratesIoApiError` in `BinstallError::CratesIoApi` It is 32 bytes large while other variants are below 40 bytes large. * Improve err msg for `BinstallError::CrateContext` * Rm unused variant `BinstallError::VersionReq` Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/remote.rs | 4 +-- crates/binstalk/src/drivers/crates_io.rs | 2 +- crates/binstalk/src/errors.rs | 46 +++++++----------------- 3 files changed, 15 insertions(+), 37 deletions(-) diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 1be1d4e4..86313afb 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -29,7 +29,7 @@ pub enum Error { Reqwest(#[from] reqwest::Error), #[error(transparent)] - Http(HttpError), + Http(Box), } #[derive(Debug, ThisError)] @@ -138,7 +138,7 @@ impl Client { Ok(response) } }) - .map_err(|err| Error::Http(HttpError { method, url, err })) + .map_err(|err| Error::Http(Box::new(HttpError { method, url, err }))) } /// Check if remote exists using `method`. diff --git a/crates/binstalk/src/drivers/crates_io.rs b/crates/binstalk/src/drivers/crates_io.rs index 1847b204..8202d906 100644 --- a/crates/binstalk/src/drivers/crates_io.rs +++ b/crates/binstalk/src/drivers/crates_io.rs @@ -38,7 +38,7 @@ pub async fn fetch_crate_cratesio( .await .map_err(|err| BinstallError::CratesIoApi { crate_name: name.into(), - err, + err: Box::new(err), })?; // Locate matching version diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index 266b6b43..322be894 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -9,8 +9,10 @@ use binstalk_downloader::{ remote::{Error as RemoteError, HttpError, ReqwestError}, }; use compact_str::CompactString; +use crates_io_api::Error as CratesIoApiError; use miette::{Diagnostic, Report}; use thiserror::Error; +use tinytemplate::error::Error as TinyTemplateError; use tokio::task; use tracing::{error, warn}; @@ -60,7 +62,7 @@ pub enum BinstallError { /// - Exit: 67 #[error(transparent)] #[diagnostic(severity(error), code(binstall::template))] - Template(#[from] tinytemplate::error::Error), + Template(Box), /// A generic error from our HTTP client, reqwest. /// @@ -81,7 +83,7 @@ pub enum BinstallError { /// - Exit: 69 #[error(transparent)] #[diagnostic(severity(error), code(binstall::http))] - Http(#[from] HttpError), + Http(#[from] Box), /// A subprocess failed. /// @@ -116,7 +118,7 @@ pub enum BinstallError { CratesIoApi { crate_name: CompactString, #[source] - err: crates_io_api::Error, + err: Box, }, /// The override path to the cargo manifest is invalid or cannot be resolved. @@ -158,23 +160,6 @@ pub enum BinstallError { err: semver::Error, }, - /// A version requirement is not valid. - /// - /// This is usually provided via the `--version` option. - /// - /// Note that we use the [`semver`] crate, which parses Cargo version requirement syntax; they - /// may be slightly different from other semver requirements expressions implementations. - /// - /// - Code: `binstall::version::requirement` - /// - Exit: 81 - #[error("version requirement '{req}' is not semver")] - #[diagnostic(severity(error), code(binstall::version::requirement))] - VersionReq { - req: CompactString, - #[source] - err: semver::Error, - }, - /// No available version matches the requirements. /// /// This may be the case when using the `--version` option. @@ -187,17 +172,6 @@ pub enum BinstallError { #[diagnostic(severity(error), code(binstall::version::mismatch))] VersionMismatch { req: semver::VersionReq }, - /// The crates.io API doesn't have manifest metadata for the given version. - /// - /// - Code: `binstall::version::unavailable` - /// - Exit: 83 - #[error("no crate information available for '{crate_name}' version '{v}'")] - #[diagnostic(severity(error), code(binstall::version::unavailable))] - VersionUnavailable { - crate_name: CompactString, - v: semver::Version, - }, - /// The crate@version syntax was used at the same time as the --version option. /// /// You can't do that as it's ambiguous which should apply. @@ -328,7 +302,7 @@ pub enum BinstallError { NoFallbackToCargoInstall, /// A wrapped error providing the context of which crate the error is about. - #[error("for crate {crate_name}")] + #[error("For crate {crate_name}: {error}")] CrateContext { #[source] error: Box, @@ -353,9 +327,7 @@ impl BinstallError { CargoManifestPath => 77, CargoManifest { .. } => 78, VersionParse { .. } => 80, - VersionReq { .. } => 81, VersionMismatch { .. } => 82, - VersionUnavailable { .. } => 83, SuperfluousVersionOption => 84, OverrideOptionUsedWithMultiInstall { .. } => 85, UnspecifiedBinaries => 86, @@ -460,3 +432,9 @@ impl From for BinstallError { } } } + +impl From for BinstallError { + fn from(e: TinyTemplateError) -> Self { + BinstallError::Template(Box::new(e)) + } +} From 4ee0c9160f7d9501f641a7d3bf4808ef65cef420 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 12:45:31 +1100 Subject: [PATCH 0857/2020] Bump cargo-bins/release-pr from 1 to 2 (#531) Bumps [cargo-bins/release-pr](https://github.com/cargo-bins/release-pr) from 1 to 2. - [Release notes](https://github.com/cargo-bins/release-pr/releases) - [Commits](https://github.com/cargo-bins/release-pr/compare/v1...v2) --- updated-dependencies: - dependency-name: cargo-bins/release-pr dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 3d126b3c..68fae36b 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -36,7 +36,7 @@ jobs: with: tool: cargo-release - - uses: cargo-bins/release-pr@v1 + - uses: cargo-bins/release-pr@v2 with: github-token: ${{ secrets.GITHUB_TOKEN }} version: ${{ inputs.version }} From 7f4d023914a4f8e121d4fead1e5478f94fc899ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 15 Nov 2022 01:53:55 +0000 Subject: [PATCH 0858/2020] Bump clap from 4.0.23 to 4.0.24 (#532) Bumps [clap](https://github.com/clap-rs/clap) from 4.0.23 to 4.0.24. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.23...v4.0.24) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e711d911..7767b11a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -339,9 +339,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.23" +version = "4.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eb41c13df48950b20eb4cd0eefa618819469df1bffc49d11e8487c4ba0037e5" +checksum = "60494cedb60cb47462c0ff7be53de32c0e42a6fc2c772184554fa12bd9489c03" dependencies = [ "atty", "bitflags", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index fd183492..e467adcf 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.4.1" } -clap = { version = "4.0.23", features = ["derive"] } +clap = { version = "4.0.24", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = { version = "0.4.17", features = ["std"] } From b6f223d925754ae652fd28910d4e3f2f211c33e3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 16 Nov 2022 09:51:11 +1100 Subject: [PATCH 0859/2020] Switch binstalk-manifests LICENSE to "Apache-2.0 OR MIT" (#513) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Félix Saparelli Signed-off-by: Jiahao XU Signed-off-by: pinage404 Signed-off-by: Ryo Yamashita Signed-off-by: azzamsa and https://github.com/cargo-bins/cargo-binstall/pull/513#issuecomment-1315898664 for Ryan Kurte --- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-manifests/LICENSE-APACHE | 176 +++++++++++++++++++++++ crates/binstalk-manifests/LICENSE-MIT | 23 +++ 3 files changed, 200 insertions(+), 1 deletion(-) create mode 100644 crates/binstalk-manifests/LICENSE-APACHE create mode 100644 crates/binstalk-manifests/LICENSE-MIT diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index fd8f3224..45a57288 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -7,7 +7,7 @@ version = "0.1.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" -license = "GPL-3.0" +license = "Apache-2.0 OR MIT" [dependencies] compact_str = { version = "0.6.0", features = ["serde"] } diff --git a/crates/binstalk-manifests/LICENSE-APACHE b/crates/binstalk-manifests/LICENSE-APACHE new file mode 100644 index 00000000..1b5ec8b7 --- /dev/null +++ b/crates/binstalk-manifests/LICENSE-APACHE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/crates/binstalk-manifests/LICENSE-MIT b/crates/binstalk-manifests/LICENSE-MIT new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/crates/binstalk-manifests/LICENSE-MIT @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. From 66eb4d2d54d801ac298a0281acafb81754eb1ddd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Nov 2022 01:27:53 +0000 Subject: [PATCH 0860/2020] Bump clap from 4.0.24 to 4.0.25 (#534) Bumps [clap](https://github.com/clap-rs/clap) from 4.0.24 to 4.0.25. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.24...v4.0.25) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7767b11a..2b3b8bb7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -339,9 +339,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.24" +version = "4.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60494cedb60cb47462c0ff7be53de32c0e42a6fc2c772184554fa12bd9489c03" +checksum = "389ca505fd2c00136e0d0cd34bcd8b6bd0b59d5779aab396054b716334230c1c" dependencies = [ "atty", "bitflags", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index e467adcf..8a3a9e01 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.4.1" } -clap = { version = "4.0.24", features = ["derive"] } +clap = { version = "4.0.25", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = { version = "0.4.17", features = ["std"] } From 58326a6085bac41bc4ea7dfd4501e3421c897c01 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 16 Nov 2022 02:18:59 +0000 Subject: [PATCH 0861/2020] Bump mimalloc from 0.1.31 to 0.1.32 (#533) Bumps [mimalloc](https://github.com/purpleprotocol/mimalloc_rust) from 0.1.31 to 0.1.32. - [Release notes](https://github.com/purpleprotocol/mimalloc_rust/releases) - [Commits](https://github.com/purpleprotocol/mimalloc_rust/compare/v0.1.31...v0.1.32) --- updated-dependencies: - dependency-name: mimalloc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 9 +++++---- crates/bin/Cargo.toml | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2b3b8bb7..a0ba4d9a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1064,11 +1064,12 @@ checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" [[package]] name = "libmimalloc-sys" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c37567b180c1af25924b303ddf1ee4467653783440c62360beb2b322a4d93361" +checksum = "04d1c67deb83e6b75fa4fe3309e09cfeade12e7721d95322af500d3814ea60c9" dependencies = [ "cc", + "libc", ] [[package]] @@ -1183,9 +1184,9 @@ dependencies = [ [[package]] name = "mimalloc" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b32d6a9ac92d0239d7bfa31137fb47634ac7272a3c11bcee91379ac100781670" +checksum = "9b2374e2999959a7b583e1811a1ddbf1d3a4b9496eceb9746f1192a59d871eca" dependencies = [ "libmimalloc-sys", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 8a3a9e01..b40c5ce6 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -28,7 +28,7 @@ crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = { version = "0.4.17", features = ["std"] } miette = "5.4.1" -mimalloc = { version = "0.1.31", default-features = false, optional = true } +mimalloc = { version = "0.1.32", default-features = false, optional = true } once_cell = "1.16.0" semver = "1.0.14" supports-color = "1.3.1" From d9cc3ce219898892488f33fe9c9d0b08b7d109fb Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 17 Nov 2022 11:46:27 +1100 Subject: [PATCH 0862/2020] Refactor: Extract new crate binstalk-types plus other misc refactor and optimization (#535) * Refactor: Extract new crate binstalk-types * Optimize: Rm field `CrateInfo::other` which also removes dep serde-tuple-vec-map and serde-json from binstalk-types. This also makes `CrateInfo` easier to use, more generic and can be used over any `Serializer`, not just `serde_json::Value`. * Mark all errors in `binstalk-manifests` as non_exhaustive * Reduce size of `CvsParseError` by using `Box` instead of `String` for variant `UnknownSourceType`. * Reduce size of `CratesTomlParseError` to 16 bytes on 64bit platform by boxing variants `TomlWrite` and `CvsParse` as these two fields are significantly larger than other variants. * Unify import style in mod `binstall_crates_v1` * Replace dep binstalk-manifests with binstalk-types in binstalk-downloader to reduce its transitive dependencies and enables binstalk-downloader to be built in parallel to binstak-manifests. * Replace dep binstalk-manifests with binstalk-types in binstalk to reduce transitive dependencies and enables binstalk to be built in parallel to binstalk-manifests. This is benefitial because binstalk-manifests pulls in toml_edit, which could takes up to 15s to be built on M1 (7-9s for codegen). * Add dep binstalk-manifests to crates/bin * Update dependabot and GHA release-pr Signed-off-by: Jiahao XU --- .github/dependabot.yml | 4 + .github/workflows/release-pr.yml | 1 + Cargo.lock | 22 ++- Cargo.toml | 1 + crates/bin/Cargo.toml | 1 + crates/bin/src/entry.rs | 6 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-downloader/src/download.rs | 4 +- crates/binstalk-manifests/Cargo.toml | 4 +- .../src/binstall_crates_v1.rs | 115 +++++++++--- .../binstalk-manifests/src/cargo_crates_v1.rs | 18 +- .../cargo_crates_v1/crate_version_source.rs | 13 +- crates/binstalk-manifests/src/helpers.rs | 10 - crates/binstalk-manifests/src/lib.rs | 4 +- crates/binstalk-types/Cargo.toml | 19 ++ crates/binstalk-types/LICENSE-APACHE | 176 ++++++++++++++++++ crates/binstalk-types/LICENSE-MIT | 23 +++ .../src/cargo_toml_binstall.rs | 3 +- .../cargo_toml_binstall/package_formats.rs | 0 .../src/crate_info.rs | 15 +- crates/binstalk-types/src/lib.rs | 2 + crates/binstalk/Cargo.toml | 2 +- crates/binstalk/src/lib.rs | 2 +- crates/binstalk/src/ops/install.rs | 1 - 24 files changed, 372 insertions(+), 76 deletions(-) create mode 100644 crates/binstalk-types/Cargo.toml create mode 100644 crates/binstalk-types/LICENSE-APACHE create mode 100644 crates/binstalk-types/LICENSE-MIT rename crates/{binstalk-manifests => binstalk-types}/src/cargo_toml_binstall.rs (99%) rename crates/{binstalk-manifests => binstalk-types}/src/cargo_toml_binstall/package_formats.rs (100%) rename crates/{binstalk-manifests => binstalk-types}/src/crate_info.rs (82%) create mode 100644 crates/binstalk-types/src/lib.rs diff --git a/.github/dependabot.yml b/.github/dependabot.yml index f293064b..be614717 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -20,6 +20,10 @@ updates: directory: "/crates/binstalk-manifests" schedule: interval: "daily" + - package-ecosystem: "cargo" + directory: "/crates/binstalk-types" + schedule: + interval: "daily" - package-ecosystem: "cargo" directory: "/crates/binstalk" schedule: diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 68fae36b..a075de66 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -10,6 +10,7 @@ on: - bin - binstalk - binstalk-manifests + - binstalk-types - binstalk-downloader - detect-targets - detect-wasi diff --git a/Cargo.lock b/Cargo.lock index a0ba4d9a..5a35e5a4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -110,7 +110,7 @@ version = "0.4.1" dependencies = [ "async-trait", "binstalk-downloader", - "binstalk-manifests", + "binstalk-types", "cargo_toml", "compact_str", "crates_io_api", @@ -138,7 +138,7 @@ dependencies = [ name = "binstalk-downloader" version = "0.1.0" dependencies = [ - "binstalk-manifests", + "binstalk-types", "binstall-tar", "bytes", "bzip2", @@ -165,24 +165,35 @@ dependencies = [ name = "binstalk-manifests" version = "0.1.0" dependencies = [ + "binstalk-types", "compact_str", "detect-targets", "fs-lock", "home", "miette", - "once_cell", "semver", "serde", "serde-tuple-vec-map", "serde_json", - "strum", - "strum_macros", "tempfile", "thiserror", "toml_edit", "url", ] +[[package]] +name = "binstalk-types" +version = "0.1.0" +dependencies = [ + "compact_str", + "once_cell", + "semver", + "serde", + "strum", + "strum_macros", + "url", +] + [[package]] name = "binstall-tar" version = "0.4.39" @@ -274,6 +285,7 @@ name = "cargo-binstall" version = "0.16.0" dependencies = [ "binstalk", + "binstalk-manifests", "clap", "crates_io_api", "dirs", diff --git a/Cargo.toml b/Cargo.toml index bd0cb700..4e3e1f52 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ members = [ "crates/bin", "crates/binstalk", "crates/binstalk-manifests", + "crates/binstalk-types", "crates/binstalk-downloader", "crates/detect-wasi", "crates/fs-lock", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index b40c5ce6..c04f34a0 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,6 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.4.1" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.1.0" } clap = { version = "4.0.25", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 649a72ff..48e50940 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -5,14 +5,14 @@ use binstalk::{ fetchers::{Fetcher, GhCrateMeta, QuickInstall}, get_desired_targets, helpers::{jobserver_client::LazyJobserverClient, remote::Client, tasks::AutoAbortJoinHandle}, - manifests::{ - binstall_crates_v1::Records, cargo_crates_v1::CratesToml, cargo_toml_binstall::PkgOverride, - }, ops::{ self, resolve::{CrateName, Resolution, VersionReqExt}, }, }; +use binstalk_manifests::{ + binstall_crates_v1::Records, cargo_crates_v1::CratesToml, cargo_toml_binstall::PkgOverride, +}; use log::LevelFilter; use miette::{miette, Result, WrapErr}; use tokio::task::block_in_place; diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 86764ee4..f4b1ff90 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0" [dependencies] -binstalk-manifests = { version = "0.1.0", path = "../binstalk-manifests" } +binstalk-types = { version = "0.1.0", path = "../binstalk-types" } bytes = "1.2.1" bzip2 = "0.4.3" digest = "0.10.5" diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index 276d5a39..18d41a5c 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -1,11 +1,11 @@ use std::{fmt::Debug, future::Future, io, marker::PhantomData, path::Path, pin::Pin}; -use binstalk_manifests::cargo_toml_binstall::{PkgFmtDecomposed, TarBasedFmt}; +use binstalk_types::cargo_toml_binstall::{PkgFmtDecomposed, TarBasedFmt}; use digest::{Digest, FixedOutput, HashMarker, Output, OutputSizeUser, Update}; use thiserror::Error as ThisError; use tracing::{debug, instrument}; -pub use binstalk_manifests::cargo_toml_binstall::PkgFmt; +pub use binstalk_types::cargo_toml_binstall::PkgFmt; pub use tar::Entries; pub use zip::result::ZipError; diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 45a57288..4dec5370 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -10,17 +10,15 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] +binstalk-types = { version = "0.1.0", path = "../binstalk-types" } compact_str = { version = "0.6.0", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" miette = "5.4.1" -once_cell = "1.16.0" semver = { version = "1.0.14", features = ["serde"] } serde = { version = "1.0.147", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.87" -strum = "0.24.1" -strum_macros = "0.24.3" thiserror = "1.0.37" toml_edit = { version = "0.15.0", features = ["easy"] } url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk-manifests/src/binstall_crates_v1.rs b/crates/binstalk-manifests/src/binstall_crates_v1.rs index 1eb4bbdd..3cac5e65 100644 --- a/crates/binstalk-manifests/src/binstall_crates_v1.rs +++ b/crates/binstalk-manifests/src/binstall_crates_v1.rs @@ -7,6 +7,8 @@ //! NLJSON to the file will be understood fine. use std::{ + borrow::Borrow, + cmp, collections::{btree_set, BTreeSet}, fs, io::{self, Seek, Write}, @@ -14,17 +16,17 @@ use std::{ path::{Path, PathBuf}, }; +use compact_str::CompactString; use fs_lock::FileLock; use home::cargo_home; use miette::Diagnostic; -use serde::Serialize; +use serde::{Deserialize, Serialize}; use thiserror::Error; -use crate::helpers::create_if_not_exist; - -use super::crate_info::CrateInfo; +use crate::{crate_info::CrateInfo, helpers::create_if_not_exist}; #[derive(Debug, Diagnostic, Error)] +#[non_exhaustive] pub enum Error { #[error(transparent)] Io(#[from] io::Error), @@ -33,28 +35,27 @@ pub enum Error { SerdeJsonParse(#[from] serde_json::Error), } -pub fn append_to_path(path: impl AsRef, iter: Iter) -> Result<(), Error> +pub fn append_to_path(path: impl AsRef, iter: Iter) -> Result<(), Error> where - Iter: IntoIterator, + Iter: IntoIterator, + Data: From, { let mut file = FileLock::new_exclusive(create_if_not_exist(path.as_ref())?)?; // Move the cursor to EOF file.seek(io::SeekFrom::End(0))?; - write_to(&mut file, &mut iter.into_iter()) + write_to(&mut file, &mut iter.into_iter().map(Data::from)) } -pub fn append(iter: Iter) -> Result<(), Error> +pub fn append(iter: Iter) -> Result<(), Error> where - Iter: IntoIterator, + Iter: IntoIterator, + Data: From, { append_to_path(default_path()?, iter) } -pub fn write_to( - file: &mut FileLock, - iter: &mut dyn Iterator, -) -> Result<(), Error> { +pub fn write_to(file: &mut FileLock, iter: &mut dyn Iterator) -> Result<(), Error> { let writer = io::BufWriter::with_capacity(512, file); let mut ser = serde_json::Serializer::new(writer); @@ -76,11 +77,74 @@ pub fn default_path() -> Result { Ok(dir.join("crates-v1.json")) } +#[derive(Debug, Deserialize, Serialize)] +pub struct Data { + #[serde(flatten)] + pub crate_info: CrateInfo, + + /// Forwards compatibility. Unknown keys from future versions + /// will be stored here and retained when the file is saved. + /// + /// We use an `Vec` here since it is never accessed in Rust. + #[serde(flatten, with = "tuple_vec_map")] + pub other: Vec<(CompactString, serde_json::Value)>, +} + +impl From for Data { + fn from(crate_info: CrateInfo) -> Self { + Self { + crate_info, + other: Vec::new(), + } + } +} + +impl From for CrateInfo { + fn from(data: Data) -> Self { + data.crate_info + } +} + +impl Borrow for Data { + fn borrow(&self) -> &str { + &self.crate_info.name + } +} + +impl PartialEq for Data { + fn eq(&self, other: &Self) -> bool { + self.crate_info.name == other.crate_info.name + } +} +impl PartialEq for Data { + fn eq(&self, other: &CrateInfo) -> bool { + self.crate_info.name == other.name + } +} +impl PartialEq for CrateInfo { + fn eq(&self, other: &Data) -> bool { + self.name == other.crate_info.name + } +} +impl Eq for Data {} + +impl PartialOrd for Data { + fn partial_cmp(&self, other: &Self) -> Option { + Some(self.cmp(other)) + } +} + +impl Ord for Data { + fn cmp(&self, other: &Self) -> cmp::Ordering { + self.crate_info.name.cmp(&other.crate_info.name) + } +} + #[derive(Debug)] pub struct Records { file: FileLock, /// Use BTreeSet to dedup the metadata - data: BTreeSet, + data: BTreeSet, } impl Records { @@ -122,7 +186,7 @@ impl Records { } pub fn get(&self, value: impl AsRef) -> Option<&CrateInfo> { - self.data.get(value.as_ref()) + self.data.get(value.as_ref()).map(|data| &data.crate_info) } pub fn contains(&self, value: impl AsRef) -> bool { @@ -134,11 +198,12 @@ impl Records { /// If the set did have an equal element present, false is returned, /// and the entry is not updated. pub fn insert(&mut self, value: CrateInfo) -> bool { - self.data.insert(value) + self.data.insert(Data::from(value)) } + /// Return the previous `CrateInfo` for the package if there is any. pub fn replace(&mut self, value: CrateInfo) -> Option { - self.data.replace(value) + self.data.replace(Data::from(value)).map(CrateInfo::from) } pub fn remove(&mut self, value: impl AsRef) -> bool { @@ -146,7 +211,7 @@ impl Records { } pub fn take(&mut self, value: impl AsRef) -> Option { - self.data.take(value.as_ref()) + self.data.take(value.as_ref()).map(CrateInfo::from) } pub fn len(&self) -> usize { @@ -159,9 +224,9 @@ impl Records { } impl<'a> IntoIterator for &'a Records { - type Item = &'a CrateInfo; + type Item = &'a Data; - type IntoIter = btree_set::Iter<'a, CrateInfo>; + type IntoIter = btree_set::Iter<'a, Data>; fn into_iter(self) -> Self::IntoIter { self.data.iter() @@ -202,7 +267,6 @@ mod test { source: CrateSource::cratesio_registry(), target: target.clone(), bins: vec!["1".into(), "2".into()], - other: Default::default(), }, CrateInfo { name: "b".into(), @@ -211,7 +275,6 @@ mod test { source: CrateSource::cratesio_registry(), target: target.clone(), bins: vec!["1".into(), "2".into()], - other: Default::default(), }, CrateInfo { name: "a".into(), @@ -220,7 +283,6 @@ mod test { source: CrateSource::cratesio_registry(), target: target.clone(), bins: vec!["1".into()], - other: Default::default(), }, ]; @@ -234,11 +296,11 @@ mod test { let mut records = Records::load_from_path(path).unwrap(); assert_records_eq!(&records, &metadata_set); - records.remove("b"); - assert_eq!(records.len(), metadata_set.len() - 1); + assert!(records.remove("b")); + metadata_set.remove("b"); + assert_eq!(records.len(), metadata_set.len()); records.overwrite().unwrap(); - metadata_set.remove("b"); let records = Records::load_from_path(path).unwrap(); assert_records_eq!(&records, &metadata_set); // Drop the exclusive file lock @@ -251,7 +313,6 @@ mod test { source: CrateSource::cratesio_registry(), target, bins: vec!["1".into(), "2".into()], - other: Default::default(), }; append_to_path(path, [new_metadata.clone()]).unwrap(); metadata_set.insert(new_metadata); diff --git a/crates/binstalk-manifests/src/cargo_crates_v1.rs b/crates/binstalk-manifests/src/cargo_crates_v1.rs index 9d3aad47..8d9033fa 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1.rs @@ -114,6 +114,7 @@ impl CratesToml { } #[derive(Debug, Diagnostic, Error)] +#[non_exhaustive] pub enum CratesTomlParseError { #[error(transparent)] Io(#[from] io::Error), @@ -122,10 +123,22 @@ pub enum CratesTomlParseError { TomlParse(#[from] toml_edit::easy::de::Error), #[error(transparent)] - TomlWrite(#[from] toml_edit::easy::ser::Error), + TomlWrite(Box), #[error(transparent)] - CvsParse(#[from] CvsParseError), + CvsParse(Box), +} + +impl From for CratesTomlParseError { + fn from(e: CvsParseError) -> Self { + CratesTomlParseError::CvsParse(Box::new(e)) + } +} + +impl From for CratesTomlParseError { + fn from(e: toml_edit::easy::ser::Error) -> Self { + CratesTomlParseError::TomlWrite(Box::new(e)) + } } #[cfg(test)] @@ -151,7 +164,6 @@ mod tests { source: CrateSource::cratesio_registry(), target: TARGET.into(), bins: vec!["cargo-binstall".into()], - other: Default::default(), }], ) .unwrap(); diff --git a/crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs b/crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs index 43c5ef54..1ed77011 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs @@ -1,5 +1,6 @@ use std::{borrow::Cow, fmt, str::FromStr}; +use binstalk_types::crate_info::cratesio_url; use compact_str::CompactString; use miette::Diagnostic; use semver::Version; @@ -7,10 +8,7 @@ use serde::{Deserialize, Deserializer, Serialize, Serializer}; use thiserror::Error; use url::Url; -use crate::{ - crate_info::{CrateInfo, CrateSource, SourceType}, - helpers::cratesio_url, -}; +use crate::crate_info::{CrateInfo, CrateSource, SourceType}; #[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq)] pub struct CrateVersionSource { @@ -72,8 +70,8 @@ impl FromStr for CrateVersionSource { ["registry", url] => Source::Registry(Url::parse(url)?), [kind, arg] => { return Err(CvsParseError::UnknownSourceType { - kind: kind.to_string(), - arg: arg.to_string(), + kind: kind.to_string().into_boxed_str(), + arg: arg.to_string().into_boxed_str(), }) } _ => return Err(CvsParseError::BadSource), @@ -90,6 +88,7 @@ impl FromStr for CrateVersionSource { } #[derive(Debug, Diagnostic, Error)] +#[non_exhaustive] pub enum CvsParseError { #[error(transparent)] UrlParse(#[from] url::ParseError), @@ -98,7 +97,7 @@ pub enum CvsParseError { VersionParse(#[from] semver::Error), #[error("unknown source type {kind}+{arg}")] - UnknownSourceType { kind: String, arg: String }, + UnknownSourceType { kind: Box, arg: Box }, #[error("bad source format")] BadSource, diff --git a/crates/binstalk-manifests/src/helpers.rs b/crates/binstalk-manifests/src/helpers.rs index f748d465..ac5b35e2 100644 --- a/crates/binstalk-manifests/src/helpers.rs +++ b/crates/binstalk-manifests/src/helpers.rs @@ -1,8 +1,5 @@ use std::{fs, io, path::Path}; -use once_cell::sync::Lazy; -use url::Url; - /// Returned file is readable and writable. pub(crate) fn create_if_not_exist(path: impl AsRef) -> io::Result { let path = path.as_ref(); @@ -16,10 +13,3 @@ pub(crate) fn create_if_not_exist(path: impl AsRef) -> io::Result &'static Url { - static CRATESIO: Lazy Url> = - Lazy::new(|| Url::parse("https://github.com/rust-lang/crates.io-index").unwrap()); - - &CRATESIO -} diff --git a/crates/binstalk-manifests/src/lib.rs b/crates/binstalk-manifests/src/lib.rs index ed655d1f..a87d5bcc 100644 --- a/crates/binstalk-manifests/src/lib.rs +++ b/crates/binstalk-manifests/src/lib.rs @@ -12,5 +12,5 @@ mod helpers; pub mod binstall_crates_v1; pub mod cargo_crates_v1; -pub mod cargo_toml_binstall; -pub mod crate_info; + +pub use binstalk_types::{cargo_toml_binstall, crate_info}; diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml new file mode 100644 index 00000000..c109ed7c --- /dev/null +++ b/crates/binstalk-types/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "binstalk-types" +description = "The binstall toolkit that contains basic types for binstalk crates" +repository = "https://github.com/cargo-bins/cargo-binstall" +documentation = "https://docs.rs/binstalk-types" +version = "0.1.0" +rust-version = "1.61.0" +authors = ["ryan "] +edition = "2021" +license = "Apache-2.0 OR MIT" + +[dependencies] +compact_str = { version = "0.6.0", features = ["serde"] } +once_cell = "1.16.0" +semver = { version = "1.0.14", features = ["serde"] } +serde = { version = "1.0.147", features = ["derive"] } +strum = "0.24.1" +strum_macros = "0.24.3" +url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk-types/LICENSE-APACHE b/crates/binstalk-types/LICENSE-APACHE new file mode 100644 index 00000000..1b5ec8b7 --- /dev/null +++ b/crates/binstalk-types/LICENSE-APACHE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/crates/binstalk-types/LICENSE-MIT b/crates/binstalk-types/LICENSE-MIT new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/crates/binstalk-types/LICENSE-MIT @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/crates/binstalk-manifests/src/cargo_toml_binstall.rs b/crates/binstalk-types/src/cargo_toml_binstall.rs similarity index 99% rename from crates/binstalk-manifests/src/cargo_toml_binstall.rs rename to crates/binstalk-types/src/cargo_toml_binstall.rs index 9e785f20..b941d063 100644 --- a/crates/binstalk-manifests/src/cargo_toml_binstall.rs +++ b/crates/binstalk-types/src/cargo_toml_binstall.rs @@ -6,11 +6,10 @@ use std::collections::BTreeMap; use serde::{Deserialize, Serialize}; +mod package_formats; #[doc(inline)] pub use package_formats::*; -mod package_formats; - /// `binstall` metadata container /// /// Required to nest metadata under `package.metadata.binstall` diff --git a/crates/binstalk-manifests/src/cargo_toml_binstall/package_formats.rs b/crates/binstalk-types/src/cargo_toml_binstall/package_formats.rs similarity index 100% rename from crates/binstalk-manifests/src/cargo_toml_binstall/package_formats.rs rename to crates/binstalk-types/src/cargo_toml_binstall/package_formats.rs diff --git a/crates/binstalk-manifests/src/crate_info.rs b/crates/binstalk-types/src/crate_info.rs similarity index 82% rename from crates/binstalk-manifests/src/crate_info.rs rename to crates/binstalk-types/src/crate_info.rs index dd5601ce..6d019593 100644 --- a/crates/binstalk-manifests/src/crate_info.rs +++ b/crates/binstalk-types/src/crate_info.rs @@ -3,11 +3,17 @@ use std::{borrow, cmp, hash}; use compact_str::CompactString; +use once_cell::sync::Lazy; use semver::Version; use serde::{Deserialize, Serialize}; use url::Url; -use crate::helpers::cratesio_url; +pub fn cratesio_url() -> &'static Url { + static CRATESIO: Lazy Url> = + Lazy::new(|| Url::parse("https://github.com/rust-lang/crates.io-index").unwrap()); + + &CRATESIO +} #[derive(Clone, Debug, Serialize, Deserialize)] pub struct CrateInfo { @@ -17,13 +23,6 @@ pub struct CrateInfo { pub source: CrateSource, pub target: CompactString, pub bins: Vec, - - /// Forwards compatibility. Unknown keys from future versions - /// will be stored here and retained when the file is saved. - /// - /// We use an `Vec` here since it is never accessed in Rust. - #[serde(flatten, with = "tuple_vec_map")] - pub other: Vec<(CompactString, serde_json::Value)>, } impl borrow::Borrow for CrateInfo { diff --git a/crates/binstalk-types/src/lib.rs b/crates/binstalk-types/src/lib.rs new file mode 100644 index 00000000..f4c48c85 --- /dev/null +++ b/crates/binstalk-types/src/lib.rs @@ -0,0 +1,2 @@ +pub mod cargo_toml_binstall; +pub mod crate_info; diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 87e259d0..9c3373e0 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.58" binstalk-downloader = { version = "0.1.0", path = "../binstalk-downloader" } -binstalk-manifests = { version = "0.1.0", path = "../binstalk-manifests" } +binstalk-types = { version = "0.1.0", path = "../binstalk-types" } cargo_toml = "0.13.0" compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } diff --git a/crates/binstalk/src/lib.rs b/crates/binstalk/src/lib.rs index 7f00da4b..b4c67f0b 100644 --- a/crates/binstalk/src/lib.rs +++ b/crates/binstalk/src/lib.rs @@ -6,6 +6,6 @@ pub mod fs; pub mod helpers; pub mod ops; -pub use binstalk_manifests as manifests; +pub use binstalk_types as manifests; pub use detect_targets::{get_desired_targets, DesiredTargets}; pub use home; diff --git a/crates/binstalk/src/ops/install.rs b/crates/binstalk/src/ops/install.rs index 8fbca294..a5c95ee0 100644 --- a/crates/binstalk/src/ops/install.rs +++ b/crates/binstalk/src/ops/install.rs @@ -37,7 +37,6 @@ pub async fn install( source: CrateSource::cratesio_registry(), target, bins, - other: Default::default(), }) }) } From 451c69b37e969a4e840f02db4a74150a6fdcad17 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Nov 2022 12:07:49 +1100 Subject: [PATCH 0863/2020] Bump clap from 4.0.25 to 4.0.26 (#537) Bumps [clap](https://github.com/clap-rs/clap) from 4.0.25 to 4.0.26. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.25...v4.0.26) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a35e5a4..1396cd4b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -351,9 +351,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.25" +version = "4.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389ca505fd2c00136e0d0cd34bcd8b6bd0b59d5779aab396054b716334230c1c" +checksum = "2148adefda54e14492fb9bddcc600b4344c5d1a3123bd666dcb939c6f0e0e57e" dependencies = [ "atty", "bitflags", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index c04f34a0..d5ea20d2 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.4.1" } binstalk-manifests = { path = "../binstalk-manifests", version = "0.1.0" } -clap = { version = "4.0.25", features = ["derive"] } +clap = { version = "4.0.26", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = { version = "0.4.17", features = ["std"] } From 69ed65dbba46388b09577fa0a491337a31759659 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Nov 2022 01:30:32 +0000 Subject: [PATCH 0864/2020] Bump digest from 0.10.5 to 0.10.6 (#539) Bumps [digest](https://github.com/RustCrypto/traits) from 0.10.5 to 0.10.6. - [Release notes](https://github.com/RustCrypto/traits/releases) - [Commits](https://github.com/RustCrypto/traits/compare/digest-v0.10.5...digest-v0.10.6) --- updated-dependencies: - dependency-name: digest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1396cd4b..8f56eacd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -504,9 +504,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adfbc57365a37acbd2ebf2b64d7e69bb766e2fea813521ed536f5d0520dcf86c" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" dependencies = [ "block-buffer", "crypto-common", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index f4b1ff90..14c5022c 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0" binstalk-types = { version = "0.1.0", path = "../binstalk-types" } bytes = "1.2.1" bzip2 = "0.4.3" -digest = "0.10.5" +digest = "0.10.6" flate2 = { version = "1.0.24", default-features = false } futures-util = { version = "0.3.25", default-features = false, features = ["std"] } generic-array = "0.14.6" From bb1f51a7397ec3025776ae7f57decfe6d00f9de2 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 17 Nov 2022 08:54:10 +0100 Subject: [PATCH 0865/2020] Short option for no-confirm flag (#540) Add short name for no-confirm flag Closes #536 The -y short name is a convention, often used by package managers (apt, yum, ...) and it is associated with a request of no interaction (thus often used in scripts, to automate workflows) --- crates/bin/src/args.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 899ced0a..571ba0f8 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -157,7 +157,7 @@ pub struct Args { pub dry_run: bool, /// Disable interactive mode / confirmation prompts. - #[clap(help_heading = "Options", long)] + #[clap(help_heading = "Options", short = 'y', long)] pub no_confirm: bool, /// Do not cleanup temporary files. From 325cb5cc193a40b4142ad286e2ed0f211229984e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 18 Nov 2022 10:59:35 +1100 Subject: [PATCH 0866/2020] Optimizations plus bug fix (#541) * Optimize `Download::and_extract`: Avoid dup monomorphization * Increase buffer size for binstall_crates_v1 to `4096 * 5` * Optimize `opts::resolve`: Avoid unnecessary `clone`s * Fix reserve in `opts::resolve`: Do not over-reserve * Rename field `opts::Options::resolver` => `resolvers` * Refactor: Extract new type `resolve::PackageInfo` - which makes `opts::resolve_inner` easier to understand - reduce number of parameters required for `download_extract_and_verify` and `collect_bin_files` - reducing size of future returned by `opts::resolve_inner` by dropping `cargo_toml::{Manifest, Package}` as early as possible since `Manifest` is 3000 Bytes large while `Package` is 600 Bytes large. * Optimize `fetchers::Data`: Use `CompactString` for field name & version since they are usually small enough to fit in inlined version of `CompactString`. * Optimize `gh_crate_meta`: Avoid unnecessary allocation in `RepositoryHost::get_default_pkg_url_template`. * Refacator: Use `Itertools::cartesian_product` in `apply_filenames_to_paths` * Optimize `ops::resolve`: Avoid unnecessary `clone` & reduce future size by calling `fetcher.target_meta()` to obtain final metadata after downloaded and extracted the binaries. * Optimize `ops::resolve`: Avoid unnecessary allocation in `download_extract_and_verify`: Replace `Itertools::join` with `Itertools::format` to avoid allocating the string. * Fix disabling cargo-install fallback * Simplify `BinFile::from_product`: Takes `&str` instead of `&Product` since we only need `product.name` * Rename `BinFile::from_product` => `BinFile::new` * Refactor: Create newtype `ops::resolve::Bin` so that we don't need to `unwrap()` on `Product::name` and reduce memory usage. Signed-off-by: Jiahao XU --- crates/bin/src/entry.rs | 13 +- crates/binstalk-downloader/src/download.rs | 30 ++- .../src/binstall_crates_v1.rs | 7 +- crates/binstalk/src/bins.rs | 13 +- crates/binstalk/src/fetchers.rs | 4 +- crates/binstalk/src/fetchers/gh_crate_meta.rs | 29 +- .../src/fetchers/gh_crate_meta/hosting.rs | 29 +- crates/binstalk/src/ops.rs | 3 +- crates/binstalk/src/ops/resolve.rs | 252 +++++++++++------- 9 files changed, 220 insertions(+), 160 deletions(-) diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 48e50940..624d82b1 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -64,7 +64,7 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien strategies.pop().unwrap(); } - let resolver: Vec<_> = strategies + let resolvers: Vec<_> = strategies .into_iter() .map(|strategy| match strategy { Strategy::CrateMetaData => GhCrateMeta::new, @@ -192,7 +192,8 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien cli_overrides, desired_targets, quiet: args.log_level == LevelFilter::Off, - resolver, + resolvers, + cargo_install_fallback, }); let tasks: Vec<_> = if !args.dry_run && !args.no_confirm { @@ -263,13 +264,7 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien ) .await?; - if !cargo_install_fallback - && matches!(resolution, Resolution::InstallFromSource { .. }) - { - Err(BinstallError::NoFallbackToCargoInstall) - } else { - ops::install::install(resolution, opts, jobserver_client).await - } + ops::install::install(resolution, opts, jobserver_client).await }) }) .collect() diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index 18d41a5c..7cac3ff6 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -122,22 +122,30 @@ impl Download { path: impl AsRef, cancellation_future: CancellationFuture, ) -> Result<(), DownloadError> { - let stream = self.client.get_stream(self.url).await?; + async fn inner( + this: Download, + fmt: PkgFmt, + path: &Path, + cancellation_future: CancellationFuture, + ) -> Result<(), DownloadError> { + let stream = this.client.get_stream(this.url).await?; - let path = path.as_ref(); - debug!("Downloading and extracting to: '{}'", path.display()); + debug!("Downloading and extracting to: '{}'", path.display()); - match fmt.decompose() { - PkgFmtDecomposed::Tar(fmt) => { - extract_tar_based_stream(stream, path, fmt, cancellation_future).await? + match fmt.decompose() { + PkgFmtDecomposed::Tar(fmt) => { + extract_tar_based_stream(stream, path, fmt, cancellation_future).await? + } + PkgFmtDecomposed::Bin => extract_bin(stream, path, cancellation_future).await?, + PkgFmtDecomposed::Zip => extract_zip(stream, path, cancellation_future).await?, } - PkgFmtDecomposed::Bin => extract_bin(stream, path, cancellation_future).await?, - PkgFmtDecomposed::Zip => extract_zip(stream, path, cancellation_future).await?, + + debug!("Download OK, extracted to: '{}'", path.display()); + + Ok(()) } - debug!("Download OK, extracted to: '{}'", path.display()); - - Ok(()) + inner(self, fmt, path.as_ref(), cancellation_future).await } } diff --git a/crates/binstalk-manifests/src/binstall_crates_v1.rs b/crates/binstalk-manifests/src/binstall_crates_v1.rs index 3cac5e65..10393211 100644 --- a/crates/binstalk-manifests/src/binstall_crates_v1.rs +++ b/crates/binstalk-manifests/src/binstall_crates_v1.rs @@ -25,6 +25,9 @@ use thiserror::Error; use crate::{crate_info::CrateInfo, helpers::create_if_not_exist}; +/// Buffer size for loading and writing binstall_crates_v1 manifest. +const BUFFER_SIZE: usize = 4096 * 5; + #[derive(Debug, Diagnostic, Error)] #[non_exhaustive] pub enum Error { @@ -56,7 +59,7 @@ where } pub fn write_to(file: &mut FileLock, iter: &mut dyn Iterator) -> Result<(), Error> { - let writer = io::BufWriter::with_capacity(512, file); + let writer = io::BufWriter::with_capacity(BUFFER_SIZE, file); let mut ser = serde_json::Serializer::new(writer); @@ -149,7 +152,7 @@ pub struct Records { impl Records { fn load_impl(&mut self) -> Result<(), Error> { - let reader = io::BufReader::with_capacity(1024, &mut self.file); + let reader = io::BufReader::with_capacity(BUFFER_SIZE, &mut self.file); let stream_deser = serde_json::Deserializer::from_reader(reader).into_iter(); for res in stream_deser { diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 21b58fcb..4f949405 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -4,7 +4,6 @@ use std::{ path::{Component, Path, PathBuf}, }; -use cargo_toml::Product; use compact_str::CompactString; use normalize_path::NormalizePath; use serde::Serialize; @@ -74,14 +73,12 @@ pub struct BinFile { } impl BinFile { - pub fn from_product( + pub fn new( data: &Data<'_>, - product: &Product, + base_name: &str, bin_dir: &str, no_symlinks: bool, ) -> Result { - let base_name = product.name.as_deref().unwrap(); - let binary_ext = if data.target.contains("windows") { ".exe" } else { @@ -99,7 +96,7 @@ impl BinFile { }; let source = if data.meta.pkg_fmt == Some(PkgFmt::Bin) { - data.bin_path.clone() + data.bin_path.to_path_buf() } else { // Generate install paths // Source path is the download dir + the generated binary path @@ -229,8 +226,8 @@ pub struct Data<'a> { pub version: &'a str, pub repo: Option<&'a str>, pub meta: PkgMeta, - pub bin_path: PathBuf, - pub install_path: PathBuf, + pub bin_path: &'a Path, + pub install_path: &'a Path, } #[derive(Clone, Debug, Serialize)] diff --git a/crates/binstalk/src/fetchers.rs b/crates/binstalk/src/fetchers.rs index 6e606340..a2d5e541 100644 --- a/crates/binstalk/src/fetchers.rs +++ b/crates/binstalk/src/fetchers.rs @@ -60,9 +60,9 @@ pub trait Fetcher: Send + Sync { /// Data required to fetch a package #[derive(Clone, Debug)] pub struct Data { - pub name: String, + pub name: CompactString, pub target: String, - pub version: String, + pub version: CompactString, pub repo: Option, pub meta: PkgMeta, } diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 896582e4..8df5680b 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -263,6 +263,7 @@ mod test { use crate::manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}; use super::{super::Data, Context}; + use compact_str::ToCompactString; use url::Url; const DEFAULT_PKG_URL: &str = "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }"; @@ -275,9 +276,9 @@ mod test { fn defaults() { let meta = PkgMeta::default(); let data = Data { - name: "cargo-binstall".to_string(), + name: "cargo-binstall".to_compact_string(), target: "x86_64-unknown-linux-gnu".to_string(), - version: "1.2.3".to_string(), + version: "1.2.3".to_compact_string(), repo: Some("https://github.com/ryankurte/cargo-binstall".to_string()), meta, }; @@ -294,9 +295,9 @@ mod test { fn no_repo() { let meta = PkgMeta::default(); let data = Data { - name: "cargo-binstall".to_string(), + name: "cargo-binstall".to_compact_string(), target: "x86_64-unknown-linux-gnu".to_string(), - version: "1.2.3".to_string(), + version: "1.2.3".to_compact_string(), repo: None, meta, }; @@ -314,9 +315,9 @@ mod test { }; let data = Data { - name: "cargo-binstall".to_string(), + name: "cargo-binstall".to_compact_string(), target: "x86_64-unknown-linux-gnu".to_string(), - version: "1.2.3".to_string(), + version: "1.2.3".to_compact_string(), repo: None, meta, }; @@ -338,9 +339,9 @@ mod test { }; let data = Data { - name: "radio-sx128x".to_string(), + name: "radio-sx128x".to_compact_string(), target: "x86_64-unknown-linux-gnu".to_string(), - version: "0.14.1-alpha.5".to_string(), + version: "0.14.1-alpha.5".to_compact_string(), repo: Some("https://github.com/rust-iot/rust-radio-sx128x".to_string()), meta, }; @@ -360,9 +361,9 @@ mod test { }; let data = Data { - name: "radio-sx128x".to_string(), + name: "radio-sx128x".to_compact_string(), target: "x86_64-unknown-linux-gnu".to_string(), - version: "0.14.1-alpha.5".to_string(), + version: "0.14.1-alpha.5".to_compact_string(), repo: Some("https://github.com/rust-iot/rust-radio-sx128x".to_string()), meta, }; @@ -386,9 +387,9 @@ mod test { }; let data = Data { - name: "cargo-watch".to_string(), + name: "cargo-watch".to_compact_string(), target: "aarch64-apple-darwin".to_string(), - version: "9.0.0".to_string(), + version: "9.0.0".to_compact_string(), repo: Some("https://github.com/watchexec/cargo-watch".to_string()), meta, }; @@ -409,9 +410,9 @@ mod test { }; let data = Data { - name: "cargo-watch".to_string(), + name: "cargo-watch".to_compact_string(), target: "aarch64-pc-windows-msvc".to_string(), - version: "9.0.0".to_string(), + version: "9.0.0".to_compact_string(), repo: Some("https://github.com/watchexec/cargo-watch".to_string()), meta, }; diff --git a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs index cf758a8f..7cb26b85 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs @@ -1,3 +1,4 @@ +use itertools::Itertools; use url::Url; use crate::errors::BinstallError; @@ -53,6 +54,7 @@ impl RepositoryHost { "{ repo }/releases/download/v{ version }", ], &[FULL_FILENAMES, NOVERSION_FILENAMES], + "", )), GitLab => Some(apply_filenames_to_paths( &[ @@ -60,32 +62,31 @@ impl RepositoryHost { "{ repo }/-/releases/v{ version }/downloads/binaries", ], &[FULL_FILENAMES, NOVERSION_FILENAMES], + "", )), BitBucket => Some(apply_filenames_to_paths( &["{ repo }/downloads"], &[FULL_FILENAMES], + "", + )), + SourceForge => Some(apply_filenames_to_paths( + &[ + "{ repo }/files/binaries/{ version }", + "{ repo }/files/binaries/v{ version }", + ], + &[FULL_FILENAMES, NOVERSION_FILENAMES], + "/download", )), - SourceForge => Some( - apply_filenames_to_paths( - &[ - "{ repo }/files/binaries/{ version }", - "{ repo }/files/binaries/v{ version }", - ], - &[FULL_FILENAMES, NOVERSION_FILENAMES], - ) - .into_iter() - .map(|url| format!("{url}/download")) - .collect(), - ), Unknown => None, } } } -fn apply_filenames_to_paths(paths: &[&str], filenames: &[&[&str]]) -> Vec { +fn apply_filenames_to_paths(paths: &[&str], filenames: &[&[&str]], suffix: &str) -> Vec { filenames .iter() .flat_map(|fs| fs.iter()) - .flat_map(|filename| paths.iter().map(move |path| format!("{path}/{filename}"))) + .cartesian_product(paths.iter()) + .map(|(filename, path)| format!("{path}/{filename}{suffix}")) .collect() } diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index 582d3911..805cd4d1 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -25,5 +25,6 @@ pub struct Options { pub cli_overrides: PkgOverride, pub desired_targets: DesiredTargets, pub quiet: bool, - pub resolver: Vec, + pub resolvers: Vec, + pub cargo_install_fallback: bool, } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 6401f55a..7999ae96 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -1,12 +1,12 @@ use std::{ borrow::Cow, - collections::BTreeSet, + collections::{BTreeMap, BTreeSet}, iter, mem, - path::{Path, PathBuf}, + path::Path, sync::Arc, }; -use cargo_toml::{Manifest, Package, Product}; +use cargo_toml::Manifest; use compact_str::{CompactString, ToCompactString}; use itertools::Itertools; use semver::{Version, VersionReq}; @@ -20,7 +20,7 @@ use crate::{ errors::BinstallError, fetchers::{Data, Fetcher}, helpers::{remote::Client, tasks::AutoAbortJoinHandle}, - manifests::cargo_toml_binstall::{Meta, PkgMeta}, + manifests::cargo_toml_binstall::{Meta, PkgMeta, PkgOverride}, }; mod crate_name; @@ -128,70 +128,30 @@ async fn resolve_inner( ) -> Result { info!("Resolving package: '{}'", crate_name); - let version_req: VersionReq = match (&crate_name.version_req, &opts.version_req) { - (Some(version), None) => version.clone(), + let version_req: VersionReq = match (crate_name.version_req, &opts.version_req) { + (Some(version), None) => version, (None, Some(version)) => version.clone(), (Some(_), Some(_)) => Err(BinstallError::SuperfluousVersionOption)?, (None, None) => VersionReq::STAR, }; - // Fetch crate via crates.io, git, or use a local manifest path - // TODO: work out which of these to do based on `opts.name` - // TODO: support git-based fetches (whole repo name rather than just crate name) - let manifest = match opts.manifest_path.clone() { - Some(manifest_path) => load_manifest_path(manifest_path)?, - None => { - fetch_crate_cratesio( - client.clone(), - &crates_io_api_client, - &crate_name.name, - &version_req, - ) - .await? - } + let version_req_str = version_req.to_compact_string(); + + let Some(package_info) = PackageInfo::resolve(opts, + crate_name.name, + curr_version, + version_req, + client.clone(), + crates_io_api_client).await? + else { + return Ok(Resolution::AlreadyUpToDate) }; - let package = manifest - .package - .ok_or_else(|| BinstallError::CargoTomlMissingPackage(crate_name.name.clone()))?; - - let new_version = - Version::parse(package.version()).map_err(|err| BinstallError::VersionParse { - v: package.version().to_compact_string(), - err, - })?; - - if let Some(curr_version) = curr_version { - if new_version == curr_version { - info!( - "{} v{curr_version} is already installed, use --force to override", - crate_name.name - ); - return Ok(Resolution::AlreadyUpToDate); - } - } - - let (mut meta, mut binaries) = ( - package - .metadata - .as_ref() - .and_then(|m| m.binstall.clone()) - .unwrap_or_default(), - manifest.bin, - ); - - binaries.retain(|product| product.name.is_some()); - - // Check binaries - if binaries.is_empty() { - return Err(BinstallError::UnspecifiedBinaries); - } - let desired_targets = opts.desired_targets.get().await; + let resolvers = &opts.resolvers; - let mut handles: Vec<(Arc, _)> = Vec::with_capacity(desired_targets.len() * 2); - - let overrides = mem::take(&mut meta.overrides); + let mut handles: Vec<(Arc, _)> = + Vec::with_capacity(desired_targets.len() * resolvers.len()); handles.extend( desired_targets @@ -199,20 +159,21 @@ async fn resolve_inner( .map(|target| { debug!("Building metadata for target: {target}"); - let target_meta = meta - .merge_overrides(iter::once(&opts.cli_overrides).chain(overrides.get(target))); + let target_meta = package_info.meta.merge_overrides( + iter::once(&opts.cli_overrides).chain(package_info.overrides.get(target)), + ); debug!("Found metadata: {target_meta:?}"); Arc::new(Data { - name: package.name.clone(), + name: package_info.name.clone(), target: target.clone(), - version: package.version().to_string(), - repo: package.repository().map(ToString::to_string), + version: package_info.version_str.clone(), + repo: package_info.repo.clone(), meta: target_meta, }) }) - .cartesian_product(&opts.resolver) + .cartesian_product(resolvers) .map(|(fetcher_data, f)| { let fetcher = f(&client, &fetcher_data); ( @@ -228,7 +189,7 @@ async fn resolve_inner( // Generate temporary binary path let bin_path = temp_dir.join(format!( "bin-{}-{}-{}", - crate_name.name, + package_info.name, fetcher.target(), fetcher.fetcher_name() )); @@ -236,9 +197,8 @@ async fn resolve_inner( match download_extract_and_verify( fetcher.as_ref(), &bin_path, - &package, + &package_info, &install_path, - &binaries, opts.no_symlinks, ) .await @@ -247,9 +207,9 @@ async fn resolve_inner( if !bin_files.is_empty() { return Ok(Resolution::Fetch { fetcher, - new_version, - name: crate_name.name, - version_req: version_req.to_compact_string(), + new_version: package_info.version, + name: package_info.name, + version_req: version_req_str, bin_files, }); } else { @@ -283,29 +243,31 @@ async fn resolve_inner( } } - Ok(Resolution::InstallFromSource { - name: crate_name.name, - version: package.version().to_compact_string(), - }) + if opts.cargo_install_fallback { + Ok(Resolution::InstallFromSource { + name: package_info.name, + version: package_info.version_str, + }) + } else { + Err(BinstallError::NoFallbackToCargoInstall) + } } /// * `fetcher` - `fetcher.find()` must return `Ok(true)`. -/// * `binaries` - must not be empty async fn download_extract_and_verify( fetcher: &dyn Fetcher, bin_path: &Path, - package: &Package, + package_info: &PackageInfo, install_path: &Path, - binaries: &[Product], no_symlinks: bool, ) -> Result, BinstallError> { - // Build final metadata - let meta = fetcher.target_meta(); - // Download and extract it. // If that fails, then ignore this fetcher. fetcher.fetch_and_extract(bin_path).await?; + // Build final metadata + let meta = fetcher.target_meta(); + #[cfg(incomplete)] { // Fetch and check package signature if available @@ -334,17 +296,17 @@ async fn download_extract_and_verify( block_in_place(|| { let bin_files = collect_bin_files( fetcher, - package, + package_info, meta, - binaries, - bin_path.to_path_buf(), - install_path.to_path_buf(), + bin_path, + install_path, no_symlinks, )?; - let name = &package.name; + let name = &package_info.name; - binaries + package_info + .binaries .iter() .zip(bin_files) .filter_map(|(bin, bin_file)| { @@ -360,8 +322,8 @@ async fn download_extract_and_verify( Some(Err(err)) } else { // Optional, print a warning and continue. - let bin_name = bin.name.as_deref().unwrap(); - let features = required_features.join(","); + let bin_name = bin.name.as_str(); + let features = required_features.iter().format(","); warn!( "When resolving {name} bin {bin_name} is not found. \ But since it requies features {features}, this bin is ignored." @@ -375,23 +337,21 @@ async fn download_extract_and_verify( }) } -/// * `binaries` - must not be empty fn collect_bin_files( fetcher: &dyn Fetcher, - package: &Package, + package_info: &PackageInfo, meta: PkgMeta, - binaries: &[Product], - bin_path: PathBuf, - install_path: PathBuf, + bin_path: &Path, + install_path: &Path, no_symlinks: bool, ) -> Result, BinstallError> { // List files to be installed // based on those found via Cargo.toml let bin_data = bins::Data { - name: &package.name, + name: &package_info.name, target: fetcher.target(), - version: package.version(), - repo: package.repository(), + version: &package_info.version_str, + repo: package_info.repo.as_deref(), meta, bin_path, install_path, @@ -405,9 +365,10 @@ fn collect_bin_files( .unwrap_or_else(|| bins::infer_bin_dir_template(&bin_data)); // Create bin_files - let bin_files = binaries + let bin_files = package_info + .binaries .iter() - .map(|p| bins::BinFile::from_product(&bin_data, p, &bin_dir, no_symlinks)) + .map(|bin| bins::BinFile::new(&bin_data, bin.name.as_str(), &bin_dir, no_symlinks)) .collect::, BinstallError>>()?; let mut source_set = BTreeSet::new(); @@ -423,6 +384,99 @@ fn collect_bin_files( Ok(bin_files) } +struct PackageInfo { + meta: PkgMeta, + binaries: Vec, + name: CompactString, + version_str: CompactString, + version: Version, + repo: Option, + overrides: BTreeMap, +} + +struct Bin { + name: String, + required_features: Vec, +} + +impl PackageInfo { + /// Return `None` if already up-to-date. + async fn resolve( + opts: &Options, + name: CompactString, + curr_version: Option, + version_req: VersionReq, + client: Client, + crates_io_api_client: crates_io_api::AsyncClient, + ) -> Result, BinstallError> { + // Fetch crate via crates.io, git, or use a local manifest path + let manifest = match opts.manifest_path.as_ref() { + Some(manifest_path) => load_manifest_path(manifest_path)?, + None => { + fetch_crate_cratesio(client, &crates_io_api_client, &name, &version_req).await? + } + }; + + let Some(mut package) = manifest.package else { + return Err(BinstallError::CargoTomlMissingPackage(name)); + }; + + let new_version_str = package.version().to_compact_string(); + let new_version = match Version::parse(&new_version_str) { + Ok(new_version) => new_version, + Err(err) => { + return Err(BinstallError::VersionParse { + v: new_version_str, + err, + }) + } + }; + + if let Some(curr_version) = curr_version { + if new_version == curr_version { + info!( + "{} v{curr_version} is already installed, use --force to override", + name + ); + return Ok(None); + } + } + + let (mut meta, binaries): (_, Vec) = ( + package + .metadata + .take() + .and_then(|mut m| m.binstall.take()) + .unwrap_or_default(), + manifest + .bin + .into_iter() + .filter_map(|p| { + p.name.map(|name| Bin { + name, + required_features: p.required_features, + }) + }) + .collect(), + ); + + // Check binaries + if binaries.is_empty() { + Err(BinstallError::UnspecifiedBinaries) + } else { + Ok(Some(Self { + overrides: mem::take(&mut meta.overrides), + meta, + binaries, + name, + version_str: new_version_str, + version: new_version, + repo: package.repository().map(ToString::to_string), + })) + } + } +} + /// Load binstall metadata from the crate `Cargo.toml` at the provided path pub fn load_manifest_path>( manifest_path: P, From 50b6e62164e69b61c1a96a1fe5bf0dd5a82186f4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 19 Nov 2022 18:00:27 +1100 Subject: [PATCH 0867/2020] Minor refactor and optimization (#543) * Avoid potential panicking in `args::parse` by using `Vec::get` instead of indexing * Refactor: Simplify `opts::{resolve, install}` API Many parameters can be shared and put into `opts::Options` intead and that would also avoid a few `Arc`. * Optimize `get_install_path`: Avoid cloning `install_path` * Optimize `LazyJobserverClient`: Un`Arc` & remove `Clone` impl to avoid additional boxing * Optimize `find_version`: Avoid cloning `semver::Version` * Optimize `GhCrateMeta::launch_baseline_find_tasks` return `impl Iterator>` instead of `impl Iterator>` to avoid unnecessary spawning. Each task spawned has to be boxed and then polled by tokio runtime. They might also be moved. While they increase parallelism, spawning these futures does not justify the costs because: - Each `Future` only calls `remote_exists` - Each `remote_exists` call send requests to the same domain, which is likely to share the same http2 connection. Since the conn is shared anyway, spawning does not speedup anything but merely add communication overhead. - Plus the tokio runtime spawning cost * Optimize `install_crates`: Destruct `Args` before any `.await` point to reduce size of the future * Refactor `logging`: Replace param `arg` with `log_level` & `json_output` to avoid dep on `Args` * Add dep strum & strum_macros to crates/bin * Derive `strum_macros::EnumCount` for `Strategy` * Optimize strategies parsing in `install_crates` * Fix panic in `install_crates` when `Compile` is not the last strategy specified * Optimize: Take `Vec` instead of slice in `CrateName::dedup` * Refactor: Extract new fn `compute_resolvers` * Refactor: Extract new fn `compute_paths_and_load_manifests` * Refactor: Extract new fn `filter_out_installed_crates` * Reorder `install_crates`: Only run target detection if args are valid and there are some crates to be installed. * Optimize `filter_out_installed_crates`: Avoid allocation by returning an `Iterator` * Fix user_agent of `remote::Client`: Let user specify it * Refactor: Replace `UIThread` with `ui::confirm` which is much simpler. Signed-off-by: Jiahao XU --- Cargo.lock | 2 + crates/bin/Cargo.toml | 2 + crates/bin/src/args.rs | 5 +- crates/bin/src/entry.rs | 394 ++++++++++-------- crates/bin/src/install_path.rs | 15 +- crates/bin/src/logging.rs | 8 +- crates/bin/src/main.rs | 2 +- crates/bin/src/ui.rs | 114 ++--- crates/binstalk-downloader/src/remote.rs | 45 +- crates/binstalk/src/drivers/version.rs | 2 +- crates/binstalk/src/fetchers/gh_crate_meta.rs | 13 +- .../binstalk/src/helpers/jobserver_client.rs | 7 +- crates/binstalk/src/ops.rs | 13 +- crates/binstalk/src/ops/install.rs | 5 +- crates/binstalk/src/ops/resolve.rs | 39 +- crates/binstalk/src/ops/resolve/crate_name.rs | 7 +- 16 files changed, 325 insertions(+), 348 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8f56eacd..07f46c2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -295,6 +295,8 @@ dependencies = [ "mimalloc", "once_cell", "semver", + "strum", + "strum_macros", "supports-color", "tempfile", "tokio", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index d5ea20d2..546017b5 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -32,6 +32,8 @@ miette = "5.4.1" mimalloc = { version = "0.1.32", default-features = false, optional = true } once_cell = "1.16.0" semver = "1.0.14" +strum = "0.24.1" +strum_macros = "0.24.3" supports-color = "1.3.1" tempfile = "3.3.0" tokio = { version = "1.21.2", features = ["rt-multi-thread"], default-features = false } diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 571ba0f8..0265c974 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -15,6 +15,7 @@ use binstalk::{ use clap::{Parser, ValueEnum}; use log::LevelFilter; use semver::VersionReq; +use strum_macros::EnumCount; #[derive(Debug, Parser)] #[clap( @@ -296,7 +297,7 @@ impl Default for RateLimit { } /// Strategy for installing the package -#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, ValueEnum)] +#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, ValueEnum, EnumCount)] pub enum Strategy { /// Attempt to download official pre-built artifacts using /// information provided in `Cargo.toml`. @@ -312,7 +313,7 @@ pub fn parse() -> Result { // `cargo run -- --help` gives ["target/debug/cargo-binstall", "--help"] // `cargo binstall --help` gives ["/home/ryan/.cargo/bin/cargo-binstall", "binstall", "--help"] let mut args: Vec = std::env::args_os().collect(); - let args = if args.len() > 1 && args[1] == "binstall" { + let args = if args.get(1).map(|arg| arg == "binstall").unwrap_or_default() { // Equivalent to // // args.remove(1); diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 624d82b1..e41efdbd 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -1,4 +1,4 @@ -use std::{fs, mem, path::Path, sync::Arc, time::Duration}; +use std::{fs, path::PathBuf, sync::Arc, time::Duration}; use binstalk::{ errors::BinstallError, @@ -8,27 +8,197 @@ use binstalk::{ ops::{ self, resolve::{CrateName, Resolution, VersionReqExt}, + Resolver, }, }; use binstalk_manifests::{ binstall_crates_v1::Records, cargo_crates_v1::CratesToml, cargo_toml_binstall::PkgOverride, }; +use crates_io_api::AsyncClient as CratesIoApiClient; use log::LevelFilter; use miette::{miette, Result, WrapErr}; +use strum::EnumCount; use tokio::task::block_in_place; use tracing::{debug, error, info, warn}; use crate::{ args::{Args, Strategy}, install_path, - ui::UIThread, + ui::confirm, }; -pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClient) -> Result<()> { +pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) -> Result<()> { + // Compute strategies + let (resolvers, cargo_install_fallback) = + compute_resolvers(args.strategies, args.disable_strategies)?; + + // Compute paths + let (install_path, cargo_roots, metadata, temp_dir) = + compute_paths_and_load_manifests(args.roots, args.install_path)?; + + // Remove installed crates + let mut crate_names = + filter_out_installed_crates(args.crate_names, args.force, metadata.as_ref()).peekable(); + + if crate_names.peek().is_none() { + debug!("Nothing to do"); + return Ok(()); + } + + // Launch target detection + let desired_targets = get_desired_targets(args.targets); + + // Computer cli_overrides + let cli_overrides = PkgOverride { + pkg_url: args.pkg_url, + pkg_fmt: args.pkg_fmt, + bin_dir: args.bin_dir, + }; + + // Initialize reqwest client + let rate_limit = args.rate_limit; + + let client = Client::new( + concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), + args.min_tls_version.map(|v| v.into()), + Duration::from_millis(rate_limit.duration.get()), + rate_limit.request_count, + ) + .map_err(BinstallError::from)?; + + // Build crates.io api client + let crates_io_api_client = + CratesIoApiClient::with_http_client(client.get_inner().clone(), Duration::from_millis(100)); + + // Create binstall_opts + let binstall_opts = Arc::new(ops::Options { + no_symlinks: args.no_symlinks, + dry_run: args.dry_run, + force: args.force, + quiet: args.log_level == LevelFilter::Off, + + version_req: args.version_req, + manifest_path: args.manifest_path, + cli_overrides, + + desired_targets, + resolvers, + cargo_install_fallback, + + temp_dir: temp_dir.path().to_owned(), + install_path, + client, + crates_io_api_client, + jobserver_client, + }); + + // Destruct args before any async function to reduce size of the future + let dry_run = args.dry_run; + let no_confirm = args.no_confirm; + let no_cleanup = args.no_cleanup; + + let tasks: Vec<_> = if !dry_run && !no_confirm { + // Resolve crates + let tasks: Vec<_> = crate_names + .map(|(crate_name, current_version)| { + AutoAbortJoinHandle::spawn(ops::resolve::resolve( + binstall_opts.clone(), + crate_name, + current_version, + )) + }) + .collect(); + + // Confirm + let mut resolutions = Vec::with_capacity(tasks.len()); + for task in tasks { + match task.await?? { + Resolution::AlreadyUpToDate => {} + res => resolutions.push(res), + } + } + + if resolutions.is_empty() { + debug!("Nothing to do"); + return Ok(()); + } + + confirm().await?; + + // Install + resolutions + .into_iter() + .map(|resolution| { + AutoAbortJoinHandle::spawn(ops::install::install(resolution, binstall_opts.clone())) + }) + .collect() + } else { + // Resolve crates and install without confirmation + crate_names + .map(|(crate_name, current_version)| { + let opts = binstall_opts.clone(); + + AutoAbortJoinHandle::spawn(async move { + let resolution = + ops::resolve::resolve(opts.clone(), crate_name, current_version).await?; + + ops::install::install(resolution, opts).await + }) + }) + .collect() + }; + + let mut metadata_vec = Vec::with_capacity(tasks.len()); + for task in tasks { + if let Some(metadata) = task.await?? { + metadata_vec.push(metadata); + } + } + + block_in_place(|| { + if let Some(mut records) = metadata { + // The cargo manifest path is already created when loading + // metadata. + + debug!("Writing .crates.toml"); + CratesToml::append_to_path(cargo_roots.join(".crates.toml"), metadata_vec.iter())?; + + debug!("Writing binstall/crates-v1.json"); + for metadata in metadata_vec { + records.replace(metadata); + } + records.overwrite()?; + } + + if no_cleanup { + // Consume temp_dir without removing it from fs. + temp_dir.into_path(); + } else { + temp_dir.close().unwrap_or_else(|err| { + warn!("Failed to clean up some resources: {err}"); + }); + } + + Ok(()) + }) +} + +/// Return (resolvers, cargo_install_fallback) +fn compute_resolvers( + input_strategies: Vec, + mut disable_strategies: Vec, +) -> Result<(Vec, bool), BinstallError> { + // Compute strategies let mut strategies = vec![]; // Remove duplicate strategies - for strategy in mem::take(&mut args.strategies) { + for strategy in input_strategies { + if strategies.len() == Strategy::COUNT { + // All variants of Strategy is present in strategies, + // there is no need to continue since all the remaining + // args.strategies must be present in stratetgies. + break; + } if !strategies.contains(&strategy) { strategies.push(strategy); } @@ -43,9 +213,12 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien ]; } - let disable_strategies = mem::take(&mut args.disable_strategies); - let mut strategies: Vec = if !disable_strategies.is_empty() { + // Since order doesn't matter, we can sort it and remove all duplicates + // to speedup checking. + disable_strategies.sort_unstable(); + disable_strategies.dedup(); + strategies .into_iter() .filter(|strategy| !disable_strategies.contains(strategy)) @@ -55,7 +228,7 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien }; if strategies.is_empty() { - return Err(BinstallError::InvalidStrategies(&"No strategy is provided").into()); + return Err(BinstallError::InvalidStrategies(&"No strategy is provided")); } let cargo_install_fallback = *strategies.last().unwrap() == Strategy::Compile; @@ -64,54 +237,35 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien strategies.pop().unwrap(); } - let resolvers: Vec<_> = strategies + let resolvers = strategies .into_iter() .map(|strategy| match strategy { - Strategy::CrateMetaData => GhCrateMeta::new, - Strategy::QuickInstall => QuickInstall::new, - Strategy::Compile => unreachable!(), + Strategy::CrateMetaData => Ok(GhCrateMeta::new as Resolver), + Strategy::QuickInstall => Ok(QuickInstall::new as Resolver), + Strategy::Compile => Err(BinstallError::InvalidStrategies( + &"Compile strategy must be the last one", + )), }) - .collect(); + .collect::, BinstallError>>()?; - let cli_overrides = PkgOverride { - pkg_url: args.pkg_url.take(), - pkg_fmt: args.pkg_fmt.take(), - bin_dir: args.bin_dir.take(), - }; + Ok((resolvers, cargo_install_fallback)) +} - // Launch target detection - let desired_targets = get_desired_targets(args.targets.take()); - - let rate_limit = args.rate_limit; - - // Initialize reqwest client - let client = Client::new( - args.min_tls_version.map(|v| v.into()), - Duration::from_millis(rate_limit.duration.get()), - rate_limit.request_count, - ) - .map_err(BinstallError::from)?; - - // Build crates.io api client - let crates_io_api_client = crates_io_api::AsyncClient::with_http_client( - client.get_inner().clone(), - Duration::from_millis(100), - ); - - // Initialize UI thread - let mut uithread = UIThread::new(!args.no_confirm); - - let (install_path, cargo_roots, metadata, temp_dir) = block_in_place(|| -> Result<_> { +/// Return (install_path, cargo_roots, metadata, temp_dir) +fn compute_paths_and_load_manifests( + roots: Option, + install_path: Option, +) -> Result<(PathBuf, PathBuf, Option, tempfile::TempDir)> { + block_in_place(|| { // Compute cargo_roots - let cargo_roots = - install_path::get_cargo_roots_path(args.roots.take()).ok_or_else(|| { - error!("No viable cargo roots path found of specified, try `--roots`"); - miette!("No cargo roots path found or specified") - })?; + let cargo_roots = install_path::get_cargo_roots_path(roots).ok_or_else(|| { + error!("No viable cargo roots path found of specified, try `--roots`"); + miette!("No cargo roots path found or specified") + })?; // Compute install directory let (install_path, custom_install_path) = - install_path::get_install_path(args.install_path.as_deref(), Some(&cargo_roots)); + install_path::get_install_path(install_path, Some(&cargo_roots)); let install_path = install_path.ok_or_else(|| { error!("No viable install path found of specified, try `--install-path`"); miette!("No install path found or specified") @@ -143,14 +297,20 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien .wrap_err("Creating a temporary directory failed.")?; Ok((install_path, cargo_roots, metadata, temp_dir)) - })?; + }) +} - // Remove installed crates - let crate_names = CrateName::dedup(&args.crate_names) - .filter_map(|crate_name| { +/// Return vec of (crate_name, current_version) +fn filter_out_installed_crates( + crate_names: Vec, + force: bool, + metadata: Option<&Records>, +) -> impl Iterator)> + '_ { + CrateName::dedup(crate_names) + .filter_map(move |crate_name| { match ( - args.force, - metadata.as_ref().and_then(|records| records.get(&crate_name.name)), + force, + metadata.and_then(|records| records.get(&crate_name.name)), &crate_name.version_req, ) { (false, Some(metadata), Some(version_req)) @@ -173,134 +333,4 @@ pub async fn install_crates(mut args: Args, jobserver_client: LazyJobserverClien _ => Some((crate_name, None)), } }) - .collect::>(); - - if crate_names.is_empty() { - debug!("Nothing to do"); - return Ok(()); - } - - let temp_dir_path: Arc = Arc::from(temp_dir.path()); - - // Create binstall_opts - let binstall_opts = Arc::new(ops::Options { - no_symlinks: args.no_symlinks, - dry_run: args.dry_run, - force: args.force, - version_req: args.version_req.take(), - manifest_path: args.manifest_path.take(), - cli_overrides, - desired_targets, - quiet: args.log_level == LevelFilter::Off, - resolvers, - cargo_install_fallback, - }); - - let tasks: Vec<_> = if !args.dry_run && !args.no_confirm { - // Resolve crates - let tasks: Vec<_> = crate_names - .into_iter() - .map(|(crate_name, current_version)| { - AutoAbortJoinHandle::spawn(ops::resolve::resolve( - binstall_opts.clone(), - crate_name, - current_version, - temp_dir_path.clone(), - install_path.clone(), - client.clone(), - crates_io_api_client.clone(), - )) - }) - .collect(); - - // Confirm - let mut resolutions = Vec::with_capacity(tasks.len()); - for task in tasks { - match task.await?? { - Resolution::AlreadyUpToDate => {} - res => resolutions.push(res), - } - } - - if resolutions.is_empty() { - debug!("Nothing to do"); - return Ok(()); - } - - uithread.confirm().await?; - - // Install - resolutions - .into_iter() - .map(|resolution| { - AutoAbortJoinHandle::spawn(ops::install::install( - resolution, - binstall_opts.clone(), - jobserver_client.clone(), - )) - }) - .collect() - } else { - // Resolve crates and install without confirmation - crate_names - .into_iter() - .map(|(crate_name, current_version)| { - let opts = binstall_opts.clone(); - let temp_dir_path = temp_dir_path.clone(); - let jobserver_client = jobserver_client.clone(); - let client = client.clone(); - let crates_io_api_client = crates_io_api_client.clone(); - let install_path = install_path.clone(); - - AutoAbortJoinHandle::spawn(async move { - let resolution = ops::resolve::resolve( - opts.clone(), - crate_name, - current_version, - temp_dir_path, - install_path, - client, - crates_io_api_client, - ) - .await?; - - ops::install::install(resolution, opts, jobserver_client).await - }) - }) - .collect() - }; - - let mut metadata_vec = Vec::with_capacity(tasks.len()); - for task in tasks { - if let Some(metadata) = task.await?? { - metadata_vec.push(metadata); - } - } - - block_in_place(|| { - if let Some(mut records) = metadata { - // The cargo manifest path is already created when loading - // metadata. - - debug!("Writing .crates.toml"); - CratesToml::append_to_path(cargo_roots.join(".crates.toml"), metadata_vec.iter())?; - - debug!("Writing binstall/crates-v1.json"); - for metadata in metadata_vec { - records.replace(metadata); - } - records.overwrite()?; - } - - if args.no_cleanup { - // Consume temp_dir without removing it from fs. - temp_dir.into_path(); - } else { - temp_dir.close().unwrap_or_else(|err| { - warn!("Failed to clean up some resources: {err}"); - }); - } - - Ok(()) - }) } diff --git a/crates/bin/src/install_path.rs b/crates/bin/src/install_path.rs index 042fee29..71da8317 100644 --- a/crates/bin/src/install_path.rs +++ b/crates/bin/src/install_path.rs @@ -1,7 +1,6 @@ use std::{ env::var_os, path::{Path, PathBuf}, - sync::Arc, }; use binstalk::home::cargo_home; @@ -31,18 +30,18 @@ pub fn get_cargo_roots_path(cargo_roots: Option) -> Option { /// roughly follows /// /// Return (install_path, is_custom_install_path) -pub fn get_install_path>( - install_path: Option

, - cargo_roots: Option

, -) -> (Option>, bool) { +pub fn get_install_path( + install_path: Option, + cargo_roots: Option>, +) -> (Option, bool) { // Command line override first first if let Some(p) = install_path { - return (Some(Arc::from(p.as_ref())), true); + return (Some(p), true); } // Then cargo_roots if let Some(p) = cargo_roots { - return (Some(Arc::from(p.as_ref().join("bin"))), false); + return (Some(p.as_ref().join("bin")), false); } // Local executable dir if no cargo is found @@ -52,5 +51,5 @@ pub fn get_install_path>( debug!("Fallback to {}", d.display()); } - (dir.map(Arc::from), true) + (dir, true) } diff --git a/crates/bin/src/logging.rs b/crates/bin/src/logging.rs index 29869361..4001d773 100644 --- a/crates/bin/src/logging.rs +++ b/crates/bin/src/logging.rs @@ -13,8 +13,6 @@ use tracing_core::{identify_callsite, metadata::Kind, subscriber::Subscriber}; use tracing_log::AsTrace; use tracing_subscriber::{filter::targets::Targets, fmt::fmt, layer::SubscriberExt}; -use crate::args::Args; - // Shamelessly taken from tracing-log struct Fields { @@ -131,9 +129,9 @@ impl Log for Logger { fn flush(&self) {} } -pub fn logging(args: &Args) { +pub fn logging(log_level: LevelFilter, json_output: bool) { // Calculate log_level - let log_level = min(args.log_level, STATIC_MAX_LEVEL); + let log_level = min(log_level, STATIC_MAX_LEVEL); let allowed_targets = (log_level != LevelFilter::Trace).then_some(["binstalk", "cargo_binstall"]); @@ -145,7 +143,7 @@ pub fn logging(args: &Args) { let log_level = log_level.as_trace(); let subscriber_builder = fmt().with_max_level(log_level); - let subscriber: Box = if args.json_output { + let subscriber: Box = if json_output { Box::new(subscriber_builder.json().finish()) } else { // Disable time, target, file, line_num, thread name/ids to make the diff --git a/crates/bin/src/main.rs b/crates/bin/src/main.rs index b839f65a..9940a933 100644 --- a/crates/bin/src/main.rs +++ b/crates/bin/src/main.rs @@ -27,7 +27,7 @@ fn main() -> MainExit { println!("{}", env!("CARGO_PKG_VERSION")); MainExit::Success(None) } else { - logging(&args); + logging(args.log_level, args.json_output); let start = Instant::now(); diff --git a/crates/bin/src/ui.rs b/crates/bin/src/ui.rs index 19667e0c..461ef5d1 100644 --- a/crates/bin/src/ui.rs +++ b/crates/bin/src/ui.rs @@ -4,95 +4,45 @@ use std::{ }; use binstalk::errors::BinstallError; -use tokio::sync::mpsc; +use tokio::sync::oneshot; -#[derive(Debug)] -struct UIThreadInner { - /// Request for confirmation - request_tx: mpsc::Sender<()>, +pub async fn confirm() -> Result<(), BinstallError> { + let (tx, rx) = oneshot::channel(); - /// Confirmation - confirm_rx: mpsc::Receiver>, -} + thread::spawn(move || { + // This task should be the only one able to + // access stdin + let mut stdin = io::stdin().lock(); + let mut input = String::with_capacity(16); -impl UIThreadInner { - fn new() -> Self { - let (request_tx, mut request_rx) = mpsc::channel(1); - let (confirm_tx, confirm_rx) = mpsc::channel(10); + let res = loop { + { + let mut stdout = io::stdout().lock(); - thread::spawn(move || { - // This task should be the only one able to - // access stdin - let mut stdin = io::stdin().lock(); - let mut input = String::with_capacity(16); - - loop { - if request_rx.blocking_recv().is_none() { - break; - } - - let res = loop { - { - let mut stdout = io::stdout().lock(); - - writeln!(&mut stdout, "Do you wish to continue? yes/[no]").unwrap(); - write!(&mut stdout, "? ").unwrap(); - stdout.flush().unwrap(); - } - - input.clear(); - stdin.read_line(&mut input).unwrap(); - - match input.as_str().trim() { - "yes" | "y" | "YES" | "Y" => break Ok(()), - "no" | "n" | "NO" | "N" | "" => break Err(BinstallError::UserAbort), - _ => continue, - } - }; - - confirm_tx - .blocking_send(res) - .expect("entry exits when confirming request"); + write!(&mut stdout, "Do you wish to continue? yes/[no]\n? ").unwrap(); + stdout.flush().unwrap(); } - }); - Self { - request_tx, - confirm_rx, - } - } + stdin.read_line(&mut input).unwrap(); - async fn confirm(&mut self) -> Result<(), BinstallError> { - self.request_tx - .send(()) - .await - .map_err(|_| BinstallError::UserAbort)?; + match input.as_str().trim() { + "yes" | "y" | "YES" | "Y" => break true, + "no" | "n" | "NO" | "N" | "" => break false, + _ => { + input.clear(); + continue; + } + } + }; - self.confirm_rx - .recv() - .await - .unwrap_or(Err(BinstallError::UserAbort)) - } -} - -#[derive(Debug)] -pub struct UIThread(Option); - -impl UIThread { - /// * `enable` - `true` to enable confirmation, `false` to disable it. - pub fn new(enable: bool) -> Self { - Self(if enable { - Some(UIThreadInner::new()) - } else { - None - }) - } - - pub async fn confirm(&mut self) -> Result<(), BinstallError> { - if let Some(inner) = self.0.as_mut() { - inner.confirm().await - } else { - Ok(()) - } + // The main thread might be terminated by signal and thus cancelled + // the confirmation. + tx.send(res).ok(); + }); + + if rx.await.unwrap() { + Ok(()) + } else { + Err(BinstallError::UserAbort) } } diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 86313afb..228d31a1 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -1,5 +1,4 @@ use std::{ - env, num::NonZeroU64, sync::Arc, time::{Duration, SystemTime}, @@ -52,32 +51,40 @@ impl Client { /// * `num_request` - maximum number of requests to be processed for /// each `per` duration. pub fn new( + user_agent: impl AsRef, min_tls: Option, per: Duration, num_request: NonZeroU64, ) -> Result { - const USER_AGENT: &str = concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")); + fn inner( + user_agent: &str, + min_tls: Option, + per: Duration, + num_request: NonZeroU64, + ) -> Result { + let mut builder = reqwest::ClientBuilder::new() + .user_agent(user_agent) + .https_only(true) + .min_tls_version(tls::Version::TLS_1_2) + .tcp_nodelay(false); - let mut builder = reqwest::ClientBuilder::new() - .user_agent(USER_AGENT) - .https_only(true) - .min_tls_version(tls::Version::TLS_1_2) - .tcp_nodelay(false); + if let Some(ver) = min_tls { + builder = builder.min_tls_version(ver); + } - if let Some(ver) = min_tls { - builder = builder.min_tls_version(ver); + let client = builder.build()?; + + Ok(Client { + client: client.clone(), + rate_limit: Arc::new(Mutex::new( + ServiceBuilder::new() + .rate_limit(num_request.get(), per) + .service(client), + )), + }) } - let client = builder.build()?; - - Ok(Self { - client: client.clone(), - rate_limit: Arc::new(Mutex::new( - ServiceBuilder::new() - .rate_limit(num_request.get(), per) - .service(client), - )), - }) + inner(user_agent.as_ref(), min_tls, per, num_request) } /// Return inner reqwest client. diff --git a/crates/binstalk/src/drivers/version.rs b/crates/binstalk/src/drivers/version.rs index 3861d360..3c6abaed 100644 --- a/crates/binstalk/src/drivers/version.rs +++ b/crates/binstalk/src/drivers/version.rs @@ -45,7 +45,7 @@ pub(super) fn find_version>( } }) // Return highest version - .max_by_key(|(_item, ver)| ver.clone()) + .max_by(|(_item_x, ver_x), (_item_y, ver_y)| ver_x.cmp(ver_y)) .ok_or(BinstallError::VersionMismatch { req: version_req.clone(), }) diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 8df5680b..473fa2db 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -1,4 +1,4 @@ -use std::{path::Path, sync::Arc}; +use std::{future::Future, path::Path, sync::Arc}; use compact_str::{CompactString, ToCompactString}; use futures_util::stream::{FuturesUnordered, StreamExt}; @@ -15,7 +15,6 @@ use crate::{ download::Download, remote::{Client, Method}, signal::wait_on_cancellation_signal, - tasks::AutoAbortJoinHandle, }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; @@ -31,7 +30,7 @@ pub struct GhCrateMeta { resolution: OnceCell<(Url, PkgFmt)>, } -type BaselineFindTask = AutoAbortJoinHandle, BinstallError>>; +type FindTaskRes = Result, BinstallError>; impl GhCrateMeta { fn launch_baseline_find_tasks<'a>( @@ -39,7 +38,7 @@ impl GhCrateMeta { pkg_fmt: PkgFmt, pkg_url: &'a str, repo: Option<&'a str>, - ) -> impl Iterator + 'a { + ) -> impl Iterator + 'a> + 'a { // build up list of potential URLs let urls = pkg_fmt.extensions().iter().filter_map(move |ext| { let ctx = Context::from_data_with_repo(&self.data, ext, repo); @@ -56,13 +55,13 @@ impl GhCrateMeta { urls.map(move |url| { let client = self.client.clone(); - AutoAbortJoinHandle::spawn(async move { + async move { debug!("Checking for package at: '{url}'"); Ok((client.remote_exists(url.clone(), Method::HEAD).await? || client.remote_exists(url.clone(), Method::GET).await?) .then_some((url, pkg_fmt))) - }) + } }) } } @@ -134,7 +133,7 @@ impl super::Fetcher for GhCrateMeta { }; while let Some(res) = handles.next().await { - if let Some((url, pkg_fmt)) = res?? { + if let Some((url, pkg_fmt)) = res? { debug!("Winning URL is {url}, with pkg_fmt {pkg_fmt}"); self.resolution.set((url, pkg_fmt)).unwrap(); // find() is called first return Ok(true); diff --git a/crates/binstalk/src/helpers/jobserver_client.rs b/crates/binstalk/src/helpers/jobserver_client.rs index ca65fcd4..5b625d9d 100644 --- a/crates/binstalk/src/helpers/jobserver_client.rs +++ b/crates/binstalk/src/helpers/jobserver_client.rs @@ -1,12 +1,11 @@ -use std::{num::NonZeroUsize, sync::Arc, thread::available_parallelism}; +use std::{num::NonZeroUsize, thread::available_parallelism}; use jobslot::Client; use tokio::sync::OnceCell; use crate::errors::BinstallError; -#[derive(Clone)] -pub struct LazyJobserverClient(Arc>); +pub struct LazyJobserverClient(OnceCell); impl LazyJobserverClient { /// This must be called at the start of the program since @@ -19,7 +18,7 @@ impl LazyJobserverClient { // It doesn't do anything that is actually unsafe, like // dereferencing pointer. let opt = unsafe { Client::from_env() }; - Self(Arc::new(OnceCell::new_with(opt))) + Self(OnceCell::new_with(opt)) } pub async fn get(&self) -> Result<&Client, BinstallError> { diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index 805cd4d1..b4d26a44 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -2,11 +2,12 @@ use std::{path::PathBuf, sync::Arc}; +use crates_io_api::AsyncClient as CratesIoApiClient; use semver::VersionReq; use crate::{ fetchers::{Data, Fetcher}, - helpers::remote::Client, + helpers::{jobserver_client::LazyJobserverClient, remote::Client}, manifests::cargo_toml_binstall::PkgOverride, DesiredTargets, }; @@ -20,11 +21,19 @@ pub struct Options { pub no_symlinks: bool, pub dry_run: bool, pub force: bool, + pub quiet: bool, + pub version_req: Option, pub manifest_path: Option, pub cli_overrides: PkgOverride, + pub desired_targets: DesiredTargets, - pub quiet: bool, pub resolvers: Vec, pub cargo_install_fallback: bool, + + pub temp_dir: PathBuf, + pub install_path: PathBuf, + pub client: Client, + pub crates_io_api_client: CratesIoApiClient, + pub jobserver_client: LazyJobserverClient, } diff --git a/crates/binstalk/src/ops/install.rs b/crates/binstalk/src/ops/install.rs index a5c95ee0..cb4c504d 100644 --- a/crates/binstalk/src/ops/install.rs +++ b/crates/binstalk/src/ops/install.rs @@ -16,7 +16,6 @@ use crate::{ pub async fn install( resolution: Resolution, opts: Arc, - jobserver_client: LazyJobserverClient, ) -> Result, BinstallError> { match resolution { Resolution::AlreadyUpToDate => Ok(None), @@ -51,7 +50,7 @@ pub async fn install( &name, &version, target, - jobserver_client, + &opts.jobserver_client, opts.quiet, opts.force, ) @@ -99,7 +98,7 @@ async fn install_from_source( name: &str, version: &str, target: &str, - lazy_jobserver_client: LazyJobserverClient, + lazy_jobserver_client: &LazyJobserverClient, quiet: bool, force: bool, ) -> Result<(), BinstallError> { diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 7999ae96..45d736f7 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -8,6 +8,7 @@ use std::{ use cargo_toml::Manifest; use compact_str::{CompactString, ToCompactString}; +use crates_io_api::AsyncClient as CratesIoApiClient; use itertools::Itertools; use semver::{Version, VersionReq}; use tokio::task::block_in_place; @@ -94,23 +95,11 @@ pub async fn resolve( opts: Arc, crate_name: CrateName, curr_version: Option, - temp_dir: Arc, - install_path: Arc, - client: Client, - crates_io_api_client: crates_io_api::AsyncClient, ) -> Result { let crate_name_name = crate_name.name.clone(); - let resolution = resolve_inner( - &opts, - crate_name, - curr_version, - temp_dir, - install_path, - client, - crates_io_api_client, - ) - .await - .map_err(|err| err.crate_context(crate_name_name))?; + let resolution = resolve_inner(&opts, crate_name, curr_version) + .await + .map_err(|err| err.crate_context(crate_name_name))?; resolution.print(&opts); @@ -121,10 +110,6 @@ async fn resolve_inner( opts: &Options, crate_name: CrateName, curr_version: Option, - temp_dir: Arc, - install_path: Arc, - client: Client, - crates_io_api_client: crates_io_api::AsyncClient, ) -> Result { info!("Resolving package: '{}'", crate_name); @@ -141,8 +126,8 @@ async fn resolve_inner( crate_name.name, curr_version, version_req, - client.clone(), - crates_io_api_client).await? + opts.client.clone(), + &opts.crates_io_api_client).await? else { return Ok(Resolution::AlreadyUpToDate) }; @@ -175,7 +160,7 @@ async fn resolve_inner( }) .cartesian_product(resolvers) .map(|(fetcher_data, f)| { - let fetcher = f(&client, &fetcher_data); + let fetcher = f(&opts.client, &fetcher_data); ( fetcher.clone(), AutoAbortJoinHandle::spawn(async move { fetcher.find().await }), @@ -187,7 +172,7 @@ async fn resolve_inner( match handle.flattened_join().await { Ok(true) => { // Generate temporary binary path - let bin_path = temp_dir.join(format!( + let bin_path = opts.temp_dir.join(format!( "bin-{}-{}-{}", package_info.name, fetcher.target(), @@ -198,7 +183,7 @@ async fn resolve_inner( fetcher.as_ref(), &bin_path, &package_info, - &install_path, + &opts.install_path, opts.no_symlinks, ) .await @@ -407,14 +392,12 @@ impl PackageInfo { curr_version: Option, version_req: VersionReq, client: Client, - crates_io_api_client: crates_io_api::AsyncClient, + crates_io_api_client: &CratesIoApiClient, ) -> Result, BinstallError> { // Fetch crate via crates.io, git, or use a local manifest path let manifest = match opts.manifest_path.as_ref() { Some(manifest_path) => load_manifest_path(manifest_path)?, - None => { - fetch_crate_cratesio(client, &crates_io_api_client, &name, &version_req).await? - } + None => fetch_crate_cratesio(client, crates_io_api_client, &name, &version_req).await?, }; let Some(mut package) = manifest.package else { diff --git a/crates/binstalk/src/ops/resolve/crate_name.rs b/crates/binstalk/src/ops/resolve/crate_name.rs index 398f9793..775c1f33 100644 --- a/crates/binstalk/src/ops/resolve/crate_name.rs +++ b/crates/binstalk/src/ops/resolve/crate_name.rs @@ -43,8 +43,7 @@ impl FromStr for CrateName { } impl CrateName { - pub fn dedup(crate_names: &[Self]) -> impl Iterator { - let mut crate_names = crate_names.to_vec(); + pub fn dedup(mut crate_names: Vec) -> impl Iterator { crate_names.sort_by(|x, y| x.name.cmp(&y.name)); crate_names.into_iter().coalesce(|previous, current| { if previous.name == current.name { @@ -62,7 +61,7 @@ mod tests { macro_rules! assert_dedup { ([ $( ( $input_name:expr, $input_version:expr ) ),* ], [ $( ( $output_name:expr, $output_version:expr ) ),* ]) => { - let input_crate_names = [$( CrateName { + let input_crate_names = vec![$( CrateName { name: $input_name.into(), version_req: Some($input_version.parse().unwrap()) }, )*]; @@ -72,7 +71,7 @@ mod tests { }, )*]; output_crate_names.sort_by(|x, y| x.name.cmp(&y.name)); - let crate_names: Vec<_> = CrateName::dedup(&input_crate_names).collect(); + let crate_names: Vec<_> = CrateName::dedup(input_crate_names).collect(); assert_eq!(crate_names, output_crate_names); }; } From 696d8c2a8288eaffa655ac07b34339b754ad37da Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 20 Nov 2022 00:21:50 +1100 Subject: [PATCH 0868/2020] Bump reqwest from 0.11.12 to 0.11.13 (#538) * Bump reqwest from 0.11.12 to 0.11.13 Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.12 to 0.11.13. - [Release notes](https://github.com/seanmonstar/reqwest/releases) - [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md) - [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.12...v0.11.13) --- updated-dependencies: - dependency-name: reqwest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Bump trust-dns-resolver to v0.22.0 * Enable feature dns-over-quic if rustls & trust-dns-resolver are enabled Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU --- Cargo.lock | 103 ++++++++++++++++++++++---- crates/binstalk-downloader/Cargo.toml | 5 +- 2 files changed, 92 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 07f46c2e..07c840c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -564,9 +564,9 @@ dependencies = [ [[package]] name = "enum-as-inner" -version = "0.4.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21cdad81446a7f7dc43f6a77409efeb9733d2fa65553efef6018ef257c959b73" +checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" dependencies = [ "heck", "proc-macro2", @@ -764,6 +764,15 @@ dependencies = [ "slab", ] +[[package]] +name = "fxhash" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" +dependencies = [ + "byteorder", +] + [[package]] name = "generic-array" version = "0.14.6" @@ -1483,6 +1492,59 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +[[package]] +name = "quinn" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b435e71d9bfa0d8889927231970c51fb89c58fa63bffcab117c9c7a41e5ef8f" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "fxhash", + "quinn-proto", + "quinn-udp", + "rustls", + "thiserror", + "tokio", + "tracing", + "webpki", +] + +[[package]] +name = "quinn-proto" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fce546b9688f767a57530652488420d419a8b1f44a478b451c3d1ab6d992a55" +dependencies = [ + "bytes", + "fxhash", + "rand", + "ring", + "rustls", + "rustls-native-certs", + "rustls-pemfile 0.2.1", + "slab", + "thiserror", + "tinyvec", + "tracing", + "webpki", +] + +[[package]] +name = "quinn-udp" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f832d8958db3e84d2ec93b5eb2272b45aa23cf7f8fe6e79f578896f4e6c231b" +dependencies = [ + "futures-util", + "libc", + "quinn-proto", + "socket2", + "tokio", + "tracing", +] + [[package]] name = "quote" version = "1.0.21" @@ -1570,9 +1632,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.12" +version = "0.11.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "431949c384f4e2ae07605ccaa56d1d9d2ecdb5cadd4f9577ccfab29f2e5149fc" +checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" dependencies = [ "async-compression", "base64", @@ -1680,10 +1742,22 @@ dependencies = [ ] [[package]] -name = "rustls-pemfile" -version = "0.3.0" +name = "rustls-native-certs" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee86d63972a7c661d1536fefe8c3c8407321c3df668891286de28abcd087360" +checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +dependencies = [ + "openssl-probe", + "rustls-pemfile 1.0.1", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pemfile" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" dependencies = [ "base64", ] @@ -2243,9 +2317,9 @@ dependencies = [ [[package]] name = "trust-dns-proto" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c31f240f59877c3d4bb3b3ea0ec5a6a0cff07323580ff8c7a605cd7d08b255d" +checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" dependencies = [ "async-trait", "bytes", @@ -2260,18 +2334,19 @@ dependencies = [ "idna 0.2.3", "ipnet", "lazy_static", - "log", "native-tls", + "quinn", "rand", "ring", "rustls", - "rustls-pemfile 0.3.0", + "rustls-pemfile 1.0.1", "smallvec", "thiserror", "tinyvec", "tokio", "tokio-native-tls", "tokio-rustls", + "tracing", "url", "webpki", "webpki-roots", @@ -2279,15 +2354,14 @@ dependencies = [ [[package]] name = "trust-dns-resolver" -version = "0.21.2" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ba72c2ea84515690c9fcef4c6c660bb9df3036ed1051686de84605b74fd558" +checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" dependencies = [ "cfg-if", "futures-util", "ipconfig", "lazy_static", - "log", "lru-cache", "parking_lot", "resolv-conf", @@ -2297,6 +2371,7 @@ dependencies = [ "tokio", "tokio-native-tls", "tokio-rustls", + "tracing", "trust-dns-proto", "webpki-roots", ] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 14c5022c..ac2d048e 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -18,7 +18,7 @@ flate2 = { version = "1.0.24", default-features = false } futures-util = { version = "0.3.25", default-features = false, features = ["std"] } generic-array = "0.14.6" httpdate = "1.0.2" -reqwest = { version = "0.11.12", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } +reqwest = { version = "0.11.13", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } scopeguard = "1.1.0" # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. @@ -30,7 +30,7 @@ thiserror = "1.0.37" tokio = { version = "1.21.2", features = ["macros", "rt-multi-thread", "sync", "time"], default-features = false } tower = { version = "0.4.13", features = ["limit", "util"] } tracing = "0.1.37" -trust-dns-resolver = { version = "0.21.2", optional = true, default-features = false, features = ["dnssec-ring"] } +trust-dns-resolver = { version = "0.22.0", optional = true, default-features = false, features = ["dnssec-ring"] } url = "2.3.1" xz2 = "0.1.7" @@ -63,6 +63,7 @@ rustls = [ "trust-dns-resolver?/dns-over-rustls", # trust-dns-resolver currently supports https with rustls "trust-dns-resolver?/dns-over-https-rustls", + "trust-dns-resolver?/dns-over-quic", ] native-tls = ["reqwest/native-tls", "trust-dns-resolver?/dns-over-native-tls"] From bdb4b2070dfafe794ef05f75ebc4e88b86e4ed62 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 21 Nov 2022 08:32:46 +1100 Subject: [PATCH 0869/2020] Minor optimization (#544) * Optimization: Rm `debug!` in `find_version` printing all version iterated obviously doesn't help much in debugging in the problem but rather just confusing. Also this makes it hard for the compiler to optimize the iterators. * Use let-else in `ManifestVisitor` * Optimize `BinFile::preview_{bin, link}` for zero-copy Return `impl Display` that lazily format instead of allocating a `String` * Optimize `infer_bin_dir_template`: Generate dir lazily * Optimize `find_version`: Lazily clone `version_req` only on err * Refactor `find_version`: Use `bool::then_some` * Add dep either v1.8.0 to binstalk * Optimize `GhCrateMeta::find`: Avoid cloning and `Vec` creation by using `Either` * Optimize `ops::install::install_from_package`: Make it a regular fn instead of async fn since it does not `.await` on any async fn. * Optimize `QuickInstall`: Rm field `target` since `Arc` already contains that field. * Optimize `Fetcher`s: Extract new struct `TargetData` so that `Data` can be shared by all fetchers, regardless of the target. * Optimize `QuickInstall`: Rm unused field `data` * Optimize `Resolution::print`: Replace branching with conditional move Signed-off-by: Jiahao XU --- Cargo.lock | 1 + crates/binstalk/Cargo.toml | 1 + crates/binstalk/src/bins.rs | 85 ++++++++++------- .../binstalk/src/drivers/crates_io/visitor.rs | 5 +- crates/binstalk/src/drivers/version.rs | 10 +- crates/binstalk/src/fetchers.rs | 9 +- crates/binstalk/src/fetchers/gh_crate_meta.rs | 95 +++++++++---------- crates/binstalk/src/fetchers/quickinstall.rs | 22 +++-- crates/binstalk/src/ops.rs | 4 +- crates/binstalk/src/ops/install.rs | 4 +- crates/binstalk/src/ops/resolve.rs | 37 ++++---- 11 files changed, 145 insertions(+), 128 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 07c840c2..bee783fe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -115,6 +115,7 @@ dependencies = [ "compact_str", "crates_io_api", "detect-targets", + "either", "futures-util", "home", "itertools", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 9c3373e0..12f7d726 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -17,6 +17,7 @@ cargo_toml = "0.13.0" compact_str = { version = "0.6.0", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.2", path = "../detect-targets" } +either = "1.8.0" futures-util = { version = "0.3.25", default-features = false, features = ["std"] } home = "0.5.4" itertools = "0.10.5" diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 4f949405..6ea20b9c 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -1,7 +1,7 @@ use std::{ borrow::Cow, - fs, - path::{Component, Path, PathBuf}, + fmt, fs, + path::{self, Component, Path, PathBuf}, }; use compact_str::CompactString; @@ -31,29 +31,30 @@ fn is_valid_path(path: &Path) -> bool { /// Must be called after the archive is downloaded and extracted. /// This function might uses blocking I/O. pub fn infer_bin_dir_template(data: &Data) -> Cow<'static, str> { - let name = &data.name; - let target = &data.target; - let version = &data.version; + let name = data.name; + let target = data.target; + let version = data.version; // Make sure to update // fetchers::gh_crate_meta::hosting::{FULL_FILENAMES, // NOVERSION_FILENAMES} if you update this array. - let possible_dirs = [ - format!("{name}-{target}-v{version}"), - format!("{name}-{target}-{version}"), - format!("{name}-{version}-{target}"), - format!("{name}-v{version}-{target}"), - format!("{name}-{target}"), + let gen_possible_dirs: [for<'r> fn(&'r str, &'r str, &'r str) -> String; 8] = [ + |name, target, version| format!("{name}-{target}-v{version}"), + |name, target, version| format!("{name}-{target}-{version}"), + |name, target, version| format!("{name}-{version}-{target}"), + |name, target, version| format!("{name}-v{version}-{target}"), + |name, target, _version| format!("{name}-{target}"), // Ignore the following when updating hosting::{FULL_FILENAMES, NOVERSION_FILENAMES} - format!("{name}-{version}"), - format!("{name}-v{version}"), - name.to_string(), + |name, _target, version| format!("{name}-{version}"), + |name, _target, version| format!("{name}-v{version}"), + |name, _target, _version| name.to_string(), ]; let default_bin_dir_template = Cow::Borrowed("{ bin }{ binary-ext }"); - possible_dirs + gen_possible_dirs .into_iter() + .map(|gen_possible_dir| gen_possible_dir(name, target, version)) .find(|dirname| data.bin_path.join(dirname).is_dir()) .map(|mut dir| { dir.reserve_exact(1 + default_bin_dir_template.len()); @@ -138,26 +139,20 @@ impl BinFile { }) } - pub fn preview_bin(&self) -> String { - format!( - "{} ({} -> {})", - self.base_name, - self.source.file_name().unwrap().to_string_lossy(), - self.dest.display() - ) + pub fn preview_bin(&self) -> impl fmt::Display + '_ { + LazyFormat { + base_name: &self.base_name, + source: self.source.file_name().unwrap().to_string_lossy(), + dest: self.dest.display(), + } } - pub fn preview_link(&self) -> String { - if let Some(link) = &self.link { - format!( - "{} ({} -> {})", - self.base_name, - link.display(), - self.link_dest().display() - ) - } else { - String::new() - } + pub fn preview_link(&self) -> impl fmt::Display + '_ { + OptionalLazyFormat(self.link.as_ref().map(|link| LazyFormat { + base_name: &self.base_name, + source: link.display(), + dest: self.link_dest().display(), + })) } /// Return `Ok` if the source exists, otherwise `Err`. @@ -253,3 +248,27 @@ impl<'c> Context<'c> { Ok(tt.render("path", self)?) } } + +struct LazyFormat<'a, S: fmt::Display> { + base_name: &'a str, + source: S, + dest: path::Display<'a>, +} + +impl fmt::Display for LazyFormat<'_, S> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{} ({} -> {})", self.base_name, self.source, self.dest) + } +} + +struct OptionalLazyFormat<'a, S: fmt::Display>(Option>); + +impl fmt::Display for OptionalLazyFormat<'_, S> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + if let Some(lazy_format) = self.0.as_ref() { + fmt::Display::fmt(lazy_format, f) + } else { + Ok(()) + } + } +} diff --git a/crates/binstalk/src/drivers/crates_io/visitor.rs b/crates/binstalk/src/drivers/crates_io/visitor.rs index 36abe991..b182659d 100644 --- a/crates/binstalk/src/drivers/crates_io/visitor.rs +++ b/crates/binstalk/src/drivers/crates_io/visitor.rs @@ -43,9 +43,8 @@ impl TarEntriesVisitor for ManifestVisitor { let path = entry.path()?; let path = path.normalize(); - let path = if let Ok(path) = path.strip_prefix(&self.manifest_dir_path) { - path - } else { + let Ok(path) = path.strip_prefix(&self.manifest_dir_path) + else { // The path is outside of the curr dir (manifest dir), // ignore it. continue; diff --git a/crates/binstalk/src/drivers/version.rs b/crates/binstalk/src/drivers/version.rs index 3c6abaed..f04d4b30 100644 --- a/crates/binstalk/src/drivers/version.rs +++ b/crates/binstalk/src/drivers/version.rs @@ -1,5 +1,4 @@ use semver::VersionReq; -use tracing::debug; use crate::errors::BinstallError; @@ -37,16 +36,11 @@ pub(super) fn find_version>( let ver = item.get_version()?; // Filter by version match - if version_req.matches(&ver) { - debug!("Version: {:?}", ver); - Some((item, ver)) - } else { - None - } + version_req.matches(&ver).then_some((item, ver)) }) // Return highest version .max_by(|(_item_x, ver_x), (_item_y, ver_y)| ver_x.cmp(ver_y)) - .ok_or(BinstallError::VersionMismatch { + .ok_or_else(|| BinstallError::VersionMismatch { req: version_req.clone(), }) } diff --git a/crates/binstalk/src/fetchers.rs b/crates/binstalk/src/fetchers.rs index a2d5e541..5da5d33a 100644 --- a/crates/binstalk/src/fetchers.rs +++ b/crates/binstalk/src/fetchers.rs @@ -17,7 +17,7 @@ pub(crate) mod quickinstall; pub trait Fetcher: Send + Sync { /// Create a new fetcher from some data #[allow(clippy::new_ret_no_self)] - fn new(client: &Client, data: &Arc) -> Arc + fn new(client: Client, data: Arc, target_data: Arc) -> Arc where Self: Sized; @@ -61,8 +61,13 @@ pub trait Fetcher: Send + Sync { #[derive(Clone, Debug)] pub struct Data { pub name: CompactString, - pub target: String, pub version: CompactString, pub repo: Option, +} + +/// Target specific data required to fetch a package +#[derive(Clone, Debug)] +pub struct TargetData { + pub target: String, pub meta: PkgMeta, } diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 473fa2db..7091183f 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -1,6 +1,7 @@ -use std::{future::Future, path::Path, sync::Arc}; +use std::{future::Future, iter, ops::Deref, path::Path, sync::Arc}; use compact_str::{CompactString, ToCompactString}; +use either::Either; use futures_util::stream::{FuturesUnordered, StreamExt}; use once_cell::sync::OnceCell; use serde::Serialize; @@ -19,7 +20,7 @@ use crate::{ manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; -use super::Data; +use super::{Data, TargetData}; pub(crate) mod hosting; use hosting::RepositoryHost; @@ -27,6 +28,7 @@ use hosting::RepositoryHost; pub struct GhCrateMeta { client: Client, data: Arc, + target_data: Arc, resolution: OnceCell<(Url, PkgFmt)>, } @@ -41,7 +43,7 @@ impl GhCrateMeta { ) -> impl Iterator + 'a> + 'a { // build up list of potential URLs let urls = pkg_fmt.extensions().iter().filter_map(move |ext| { - let ctx = Context::from_data_with_repo(&self.data, ext, repo); + let ctx = Context::from_data_with_repo(&self.data, &self.target_data.target, ext, repo); match ctx.render_url(pkg_url) { Ok(url) => Some(url), Err(err) => { @@ -68,10 +70,15 @@ impl GhCrateMeta { #[async_trait::async_trait] impl super::Fetcher for GhCrateMeta { - fn new(client: &Client, data: &Arc) -> Arc { + fn new( + client: Client, + data: Arc, + target_data: Arc, + ) -> Arc { Arc::new(Self { - client: client.clone(), - data: data.clone(), + client, + data, + target_data, resolution: OnceCell::new(), }) } @@ -87,20 +94,20 @@ impl super::Fetcher for GhCrateMeta { None }; - let pkg_urls = if let Some(pkg_url) = self.data.meta.pkg_url.clone() { - vec![pkg_url] + let pkg_urls = if let Some(pkg_url) = self.target_data.meta.pkg_url.as_deref() { + Either::Left(pkg_url) } else if let Some(repo) = repo.as_ref() { if let Some(pkg_urls) = RepositoryHost::guess_git_hosting_services(repo)?.get_default_pkg_url_template() { - pkg_urls + Either::Right(pkg_urls) } else { warn!( concat!( "Unknown repository {}, cargo-binstall cannot provide default pkg_url for it.\n", "Please ask the upstream to provide it for target {}." ), - repo, self.data.target + repo, self.target_data.target ); return Ok(false); @@ -111,7 +118,7 @@ impl super::Fetcher for GhCrateMeta { "Package does not specify repository, cargo-binstall cannot provide default pkg_url for it.\n", "Please ask the upstream to provide it for target {}." ), - self.data.target + self.target_data.target ); return Ok(false); @@ -119,12 +126,15 @@ impl super::Fetcher for GhCrateMeta { let repo = repo.as_ref().map(|u| u.as_str().trim_end_matches('/')); let launch_baseline_find_tasks = |pkg_fmt| { - pkg_urls - .iter() - .flat_map(move |pkg_url| self.launch_baseline_find_tasks(pkg_fmt, pkg_url, repo)) + match &pkg_urls { + Either::Left(pkg_url) => Either::Left(iter::once(*pkg_url)), + Either::Right(pkg_urls) => Either::Right(pkg_urls.iter().map(Deref::deref)), + } + .flat_map(move |pkg_url| self.launch_baseline_find_tasks(pkg_fmt, pkg_url, repo)) }; - let mut handles: FuturesUnordered<_> = if let Some(pkg_fmt) = self.data.meta.pkg_fmt { + let mut handles: FuturesUnordered<_> = if let Some(pkg_fmt) = self.target_data.meta.pkg_fmt + { launch_baseline_find_tasks(pkg_fmt).collect() } else { PkgFmt::iter() @@ -156,7 +166,7 @@ impl super::Fetcher for GhCrateMeta { } fn target_meta(&self) -> PkgMeta { - let mut meta = self.data.meta.clone(); + let mut meta = self.target_data.meta.clone(); meta.pkg_fmt = Some(self.pkg_fmt()); meta } @@ -185,7 +195,7 @@ impl super::Fetcher for GhCrateMeta { } fn target(&self) -> &str { - &self.data.target + &self.target_data.target } } @@ -215,6 +225,7 @@ struct Context<'c> { impl<'c> Context<'c> { pub(self) fn from_data_with_repo( data: &'c Data, + target: &'c str, archive_suffix: &'c str, repo: Option<&'c str>, ) -> Self { @@ -230,12 +241,12 @@ impl<'c> Context<'c> { Self { name: &data.name, repo, - target: &data.target, + target, version: &data.version, format: archive_format, archive_format, archive_suffix, - binary_ext: if data.target.contains("windows") { + binary_ext: if target.contains("windows") { ".exe" } else { "" @@ -244,8 +255,8 @@ impl<'c> Context<'c> { } #[cfg(test)] - pub(self) fn from_data(data: &'c Data, archive_format: &'c str) -> Self { - Self::from_data_with_repo(data, archive_format, data.repo.as_deref()) + pub(self) fn from_data(data: &'c Data, target: &'c str, archive_format: &'c str) -> Self { + Self::from_data_with_repo(data, target, archive_format, data.repo.as_deref()) } pub(self) fn render_url(&self, template: &str) -> Result { @@ -273,16 +284,13 @@ mod test { #[test] fn defaults() { - let meta = PkgMeta::default(); let data = Data { name: "cargo-binstall".to_compact_string(), - target: "x86_64-unknown-linux-gnu".to_string(), version: "1.2.3".to_compact_string(), repo: Some("https://github.com/ryankurte/cargo-binstall".to_string()), - meta, }; - let ctx = Context::from_data(&data, ".tgz"); + let ctx = Context::from_data(&data, "x86_64-unknown-linux-gnu", ".tgz"); assert_eq!( ctx.render_url(DEFAULT_PKG_URL).unwrap(), url("https://github.com/ryankurte/cargo-binstall/releases/download/v1.2.3/cargo-binstall-x86_64-unknown-linux-gnu-v1.2.3.tgz") @@ -295,15 +303,12 @@ mod test { let meta = PkgMeta::default(); let data = Data { name: "cargo-binstall".to_compact_string(), - target: "x86_64-unknown-linux-gnu".to_string(), version: "1.2.3".to_compact_string(), repo: None, - meta, }; - let ctx = Context::from_data(&data, ".tgz"); - ctx.render_url(data.meta.pkg_url.as_deref().unwrap()) - .unwrap(); + let ctx = Context::from_data(&data, "x86_64-unknown-linux-gnu", ".tgz"); + ctx.render_url(meta.pkg_url.as_deref().unwrap()).unwrap(); } #[test] @@ -315,15 +320,13 @@ mod test { let data = Data { name: "cargo-binstall".to_compact_string(), - target: "x86_64-unknown-linux-gnu".to_string(), version: "1.2.3".to_compact_string(), repo: None, - meta, }; - let ctx = Context::from_data(&data, ".tgz"); + let ctx = Context::from_data(&data, "x86_64-unknown-linux-gnu", ".tgz"); assert_eq!( - ctx.render_url(data.meta.pkg_url.as_deref().unwrap()).unwrap(), + ctx.render_url(meta.pkg_url.as_deref().unwrap()).unwrap(), url("https://example.com/releases/download/v1.2.3/cargo-binstall-x86_64-unknown-linux-gnu-v1.2.3.tgz") ); } @@ -339,15 +342,13 @@ mod test { let data = Data { name: "radio-sx128x".to_compact_string(), - target: "x86_64-unknown-linux-gnu".to_string(), version: "0.14.1-alpha.5".to_compact_string(), repo: Some("https://github.com/rust-iot/rust-radio-sx128x".to_string()), - meta, }; - let ctx = Context::from_data(&data, ".tgz"); + let ctx = Context::from_data(&data, "x86_64-unknown-linux-gnu", ".tgz"); assert_eq!( - ctx.render_url(data.meta.pkg_url.as_deref().unwrap()).unwrap(), + ctx.render_url(meta.pkg_url.as_deref().unwrap()).unwrap(), url("https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz") ); } @@ -361,15 +362,13 @@ mod test { let data = Data { name: "radio-sx128x".to_compact_string(), - target: "x86_64-unknown-linux-gnu".to_string(), version: "0.14.1-alpha.5".to_compact_string(), repo: Some("https://github.com/rust-iot/rust-radio-sx128x".to_string()), - meta, }; - let ctx = Context::from_data(&data, ".tgz"); + let ctx = Context::from_data(&data, "x86_64-unknown-linux-gnu", ".tgz"); assert_eq!( - ctx.render_url(data.meta.pkg_url.as_deref().unwrap()).unwrap(), + ctx.render_url(meta.pkg_url.as_deref().unwrap()).unwrap(), url("https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz") ); } @@ -387,15 +386,13 @@ mod test { let data = Data { name: "cargo-watch".to_compact_string(), - target: "aarch64-apple-darwin".to_string(), version: "9.0.0".to_compact_string(), repo: Some("https://github.com/watchexec/cargo-watch".to_string()), - meta, }; - let ctx = Context::from_data(&data, ".txz"); + let ctx = Context::from_data(&data, "aarch64-apple-darwin", ".txz"); assert_eq!( - ctx.render_url(data.meta.pkg_url.as_deref().unwrap()).unwrap(), + ctx.render_url(meta.pkg_url.as_deref().unwrap()).unwrap(), url("https://github.com/watchexec/cargo-watch/releases/download/v9.0.0/cargo-watch-v9.0.0-aarch64-apple-darwin.tar.xz") ); } @@ -410,15 +407,13 @@ mod test { let data = Data { name: "cargo-watch".to_compact_string(), - target: "aarch64-pc-windows-msvc".to_string(), version: "9.0.0".to_compact_string(), repo: Some("https://github.com/watchexec/cargo-watch".to_string()), - meta, }; - let ctx = Context::from_data(&data, ".bin"); + let ctx = Context::from_data(&data, "aarch64-pc-windows-msvc", ".bin"); assert_eq!( - ctx.render_url(data.meta.pkg_url.as_deref().unwrap()).unwrap(), + ctx.render_url(meta.pkg_url.as_deref().unwrap()).unwrap(), url("https://github.com/watchexec/cargo-watch/releases/download/v9.0.0/cargo-watch-v9.0.0-aarch64-pc-windows-msvc.exe") ); } diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs index 9821ba8e..f03eec41 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk/src/fetchers/quickinstall.rs @@ -15,7 +15,7 @@ use crate::{ manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; -use super::Data; +use super::{Data, TargetData}; const BASE_URL: &str = "https://github.com/alsuren/cargo-quickinstall/releases/download"; const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; @@ -23,21 +23,23 @@ const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; pub struct QuickInstall { client: Client, package: String, - target: String, - data: Arc, + target_data: Arc, } #[async_trait::async_trait] impl super::Fetcher for QuickInstall { - fn new(client: &Client, data: &Arc) -> Arc { + fn new( + client: Client, + data: Arc, + target_data: Arc, + ) -> Arc { let crate_name = &data.name; let version = &data.version; - let target = data.target.clone(); + let target = &target_data.target; Arc::new(Self { - client: client.clone(), + client, package: format!("{crate_name}-{version}-{target}"), - target, - data: data.clone(), + target_data, }) } @@ -68,7 +70,7 @@ impl super::Fetcher for QuickInstall { } fn target_meta(&self) -> PkgMeta { - let mut meta = self.data.meta.clone(); + let mut meta = self.target_data.meta.clone(); meta.pkg_fmt = Some(self.pkg_fmt()); meta.bin_dir = Some("{ bin }{ binary-ext }".to_string()); meta @@ -87,7 +89,7 @@ impl super::Fetcher for QuickInstall { } fn target(&self) -> &str { - &self.target + &self.target_data.target } } diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index b4d26a44..a0a14982 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -6,7 +6,7 @@ use crates_io_api::AsyncClient as CratesIoApiClient; use semver::VersionReq; use crate::{ - fetchers::{Data, Fetcher}, + fetchers::{Data, Fetcher, TargetData}, helpers::{jobserver_client::LazyJobserverClient, remote::Client}, manifests::cargo_toml_binstall::PkgOverride, DesiredTargets, @@ -15,7 +15,7 @@ use crate::{ pub mod install; pub mod resolve; -pub type Resolver = fn(&Client, &Arc) -> Arc; +pub type Resolver = fn(Client, Arc, Arc) -> Arc; pub struct Options { pub no_symlinks: bool, diff --git a/crates/binstalk/src/ops/install.rs b/crates/binstalk/src/ops/install.rs index cb4c504d..bf660efc 100644 --- a/crates/binstalk/src/ops/install.rs +++ b/crates/binstalk/src/ops/install.rs @@ -28,7 +28,7 @@ pub async fn install( } => { let target = fetcher.target().into(); - install_from_package(opts, bin_files).await.map(|option| { + install_from_package(opts, bin_files).map(|option| { option.map(|bins| CrateInfo { name, version_req, @@ -66,7 +66,7 @@ pub async fn install( } } -async fn install_from_package( +fn install_from_package( opts: Arc, bin_files: Vec, ) -> Result>, BinstallError> { diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 45d736f7..7cc8e5bb 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -19,7 +19,7 @@ use crate::{ bins, drivers::fetch_crate_cratesio, errors::BinstallError, - fetchers::{Data, Fetcher}, + fetchers::{Data, Fetcher, TargetData}, helpers::{remote::Client, tasks::AutoAbortJoinHandle}, manifests::cargo_toml_binstall::{Meta, PkgMeta, PkgOverride}, }; @@ -58,17 +58,15 @@ impl Resolution { fetcher.source_name() ); - if fetcher.is_third_party() { - warn!( - "The package will be downloaded from third-party source {}", - fetcher.source_name() - ); - } else { - info!( - "The package will be downloaded from {}", - fetcher.source_name() - ); - } + warn!( + "The package will be downloaded from {}{}", + if fetcher.is_third_party() { + "third-party source " + } else { + "" + }, + fetcher.source_name() + ); info!("This will install the following binaries:"); for file in bin_files { @@ -138,6 +136,12 @@ async fn resolve_inner( let mut handles: Vec<(Arc, _)> = Vec::with_capacity(desired_targets.len() * resolvers.len()); + let data = Arc::new(Data { + name: package_info.name.clone(), + version: package_info.version_str.clone(), + repo: package_info.repo.clone(), + }); + handles.extend( desired_targets .iter() @@ -150,17 +154,14 @@ async fn resolve_inner( debug!("Found metadata: {target_meta:?}"); - Arc::new(Data { - name: package_info.name.clone(), + Arc::new(TargetData { target: target.clone(), - version: package_info.version_str.clone(), - repo: package_info.repo.clone(), meta: target_meta, }) }) .cartesian_product(resolvers) - .map(|(fetcher_data, f)| { - let fetcher = f(&opts.client, &fetcher_data); + .map(|(target_data, f)| { + let fetcher = f(opts.client.clone(), data.clone(), target_data); ( fetcher.clone(), AutoAbortJoinHandle::spawn(async move { fetcher.find().await }), From 83b2de3ea2a62a17bb349a808bb44e68157db57a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 21 Nov 2022 12:02:58 +1100 Subject: [PATCH 0870/2020] Enforce strict strategies parsing rule: Reject duplicate strategy in `--strategies` (#545) `cargo-binstall` should reject duplicate strategy in `--strategies` as it is illegal input and it cannot be interpreted reasonably. * Reject duplicate strategy in `--strategies` * Optimize `compute_resolvers`: Use `Vec::retain` instead of `Iterator::filter` plus collecting into `Vec`. * Optimize `compute_resolvers`: Reject `strategies.len() > Strategy::COUNT` * Improve err msg for cases where user disabled all strategies * Simplify `BinstallError::InvalidStrategies`: Takes `&'static str` instead of `&'static &'static str` since other variants are larger than 8B. Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 1 + crates/bin/src/entry.rs | 53 +++++++++++++++++++---------------- crates/binstalk/src/errors.rs | 2 +- 3 files changed, 31 insertions(+), 25 deletions(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 0265c974..84c936ee 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -298,6 +298,7 @@ impl Default for RateLimit { /// Strategy for installing the package #[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, ValueEnum, EnumCount)] +#[repr(u8)] pub enum Strategy { /// Attempt to download official pre-built artifacts using /// information provided in `Cargo.toml`. diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index e41efdbd..5ae562d4 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -185,22 +185,27 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - /// Return (resolvers, cargo_install_fallback) fn compute_resolvers( - input_strategies: Vec, + mut strategies: Vec, mut disable_strategies: Vec, ) -> Result<(Vec, bool), BinstallError> { - // Compute strategies - let mut strategies = vec![]; + let dup_strategy_err = + BinstallError::InvalidStrategies("--strategies should not contain duplicate strategy"); - // Remove duplicate strategies - for strategy in input_strategies { - if strategies.len() == Strategy::COUNT { - // All variants of Strategy is present in strategies, - // there is no need to continue since all the remaining - // args.strategies must be present in stratetgies. - break; - } - if !strategies.contains(&strategy) { - strategies.push(strategy); + if strategies.len() > Strategy::COUNT { + // If len of strategies is larger than number of variants of Strategy, + // then there must be duplicates by pigeon hole principle. + return Err(dup_strategy_err); + } + + // Whether specific variant of Strategy is present + let mut is_variant_present = [false; Strategy::COUNT]; + + for strategy in &strategies { + let index = *strategy as u8 as usize; + if is_variant_present[index] { + return Err(dup_strategy_err); + } else { + is_variant_present[index] = true; } } @@ -213,22 +218,22 @@ fn compute_resolvers( ]; } - let mut strategies: Vec = if !disable_strategies.is_empty() { + // Filter out all disabled strategies + if !disable_strategies.is_empty() { // Since order doesn't matter, we can sort it and remove all duplicates // to speedup checking. disable_strategies.sort_unstable(); disable_strategies.dedup(); - strategies - .into_iter() - .filter(|strategy| !disable_strategies.contains(strategy)) - .collect() - } else { - strategies - }; + // disable_strategies.len() <= Strategy::COUNT, of which is faster + // to just use [T]::contains rather than [T]::binary_search + strategies.retain(|strategy| !disable_strategies.contains(strategy)); - if strategies.is_empty() { - return Err(BinstallError::InvalidStrategies(&"No strategy is provided")); + if strategies.is_empty() { + return Err(BinstallError::InvalidStrategies( + "You have disabled all strategies", + )); + } } let cargo_install_fallback = *strategies.last().unwrap() == Strategy::Compile; @@ -243,7 +248,7 @@ fn compute_resolvers( Strategy::CrateMetaData => Ok(GhCrateMeta::new as Resolver), Strategy::QuickInstall => Ok(QuickInstall::new as Resolver), Strategy::Compile => Err(BinstallError::InvalidStrategies( - &"Compile strategy must be the last one", + "Compile strategy must be the last one", )), }) .collect::, BinstallError>>()?; diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index 322be894..4fadd1d8 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -291,7 +291,7 @@ pub enum BinstallError { /// - Exit: 93 #[error("Invalid strategies configured: {0}")] #[diagnostic(severity(error), code(binstall::strategies))] - InvalidStrategies(&'static &'static str), + InvalidStrategies(&'static str), /// Fallback to `cargo-install` is disabled. /// From 1821469342c8e4d4bc7e18fa0dd30d301c3f26f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Nov 2022 02:19:14 +0000 Subject: [PATCH 0871/2020] Bump tokio from 1.21.2 to 1.22.0 (#548) Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.21.2 to 1.22.0. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.21.2...tokio-1.22.0) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bee783fe..afac50cc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2122,9 +2122,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.21.2" +version = "1.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e03c497dc955702ba729190dc4aac6f2a0ce97f913e5b1b5912fc5039d9099" +checksum = "d76ce4a75fb488c605c54bf610f221cea8b0dafb53333c1a67e8ee199dcd2ae3" dependencies = [ "autocfg", "bytes", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 546017b5..dcf60d18 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -36,7 +36,7 @@ strum = "0.24.1" strum_macros = "0.24.3" supports-color = "1.3.1" tempfile = "3.3.0" -tokio = { version = "1.21.2", features = ["rt-multi-thread"], default-features = false } +tokio = { version = "1.22.0", features = ["rt-multi-thread"], default-features = false } tracing-core = "0.1.30" tracing = { version = "0.1.37", default-features = false } tracing-log = { version = "0.1.3", default-features = false } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index ac2d048e..4f9900b1 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -27,7 +27,7 @@ scopeguard = "1.1.0" tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.3.0" thiserror = "1.0.37" -tokio = { version = "1.21.2", features = ["macros", "rt-multi-thread", "sync", "time"], default-features = false } +tokio = { version = "1.22.0", features = ["macros", "rt-multi-thread", "sync", "time"], default-features = false } tower = { version = "0.4.13", features = ["limit", "util"] } tracing = "0.1.37" trust-dns-resolver = { version = "0.22.0", optional = true, default-features = false, features = ["dnssec-ring"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 12f7d726..4031e066 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -32,7 +32,7 @@ tempfile = "3.3.0" thiserror = "1.0.37" tinytemplate = "1.2.1" # parking_lot for `tokio::sync::OnceCell::const_new` -tokio = { version = "1.21.2", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } +tokio = { version = "1.22.0", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } tracing = "0.1.37" url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 6a2d726e..e56b1c4b 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -10,11 +10,11 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -tokio = { version = "1.21.2", features = ["rt", "process", "sync"], default-features = false } +tokio = { version = "1.22.0", features = ["rt", "process", "sync"], default-features = false } cfg-if = "1.0.0" [target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] guess_host_triple = "0.1.3" [dev-dependencies] -tokio = { version = "1.21.2", features = ["macros"], default-features = false } +tokio = { version = "1.22.0", features = ["macros"], default-features = false } From 7706aa14cfc6c761eabffdab570039c3dd9c1298 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Nov 2022 02:37:50 +0000 Subject: [PATCH 0872/2020] Bump serde_json from 1.0.87 to 1.0.88 (#547) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.87 to 1.0.88. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.87...v1.0.88) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-manifests/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index afac50cc..a3154a08 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1873,9 +1873,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.87" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce777b7b150d76b9cf60d28b55f5847135a003f7d7350c6be7a773508ce7d45" +checksum = "8e8b3801309262e8184d9687fb697586833e939767aea0dda89f5a8e650e8bd7" dependencies = [ "itoa", "ryu", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 4dec5370..0b045687 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -18,7 +18,7 @@ miette = "5.4.1" semver = { version = "1.0.14", features = ["serde"] } serde = { version = "1.0.147", features = ["derive"] } serde-tuple-vec-map = "1.0.1" -serde_json = "1.0.87" +serde_json = "1.0.88" thiserror = "1.0.37" toml_edit = { version = "0.15.0", features = ["easy"] } url = { version = "2.3.1", features = ["serde"] } From 26b28dc63ffa52810b8e2d1c509a3aaf4926116b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 21 Nov 2022 15:55:51 +1100 Subject: [PATCH 0873/2020] Update transitive dependencies (#549) Signed-off-by: Jiahao XU --- Cargo.lock | 326 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 194 insertions(+), 132 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a3154a08..65b058a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,17 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + [[package]] name = "aho-corasick" version = "0.7.19" @@ -43,9 +54,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345fd392ab01f746c717b1357165b76f0b67a60192007b234058c9045fdcf695" +checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" dependencies = [ "brotli", "flate2", @@ -100,9 +111,9 @@ dependencies = [ [[package]] name = "base64" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "binstalk" @@ -244,9 +255,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.11.0" +version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ad822118d20d2c234f427000d5acc36eabe1e29a348c89b63dd60b13f28e5d" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "byteorder" @@ -328,9 +339,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.73" +version = "1.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" dependencies = [ "jobserver", ] @@ -343,9 +354,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.22" +version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" +checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" dependencies = [ "num-integer", "num-traits", @@ -391,9 +402,9 @@ dependencies = [ [[package]] name = "cmake" -version = "0.1.48" +version = "0.1.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" +checksum = "db34956e100b30725f2eb215f90d4871051239535632f84fea3bc92722c66b7c" dependencies = [ "cc", ] @@ -465,12 +476,11 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.11" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" +checksum = "422f23e724af1240ec469ea1e834d87a4b59ce2efe2c6a96256b0c47e2fd86aa" dependencies = [ "cfg-if", - "once_cell", ] [[package]] @@ -551,7 +561,7 @@ dependencies = [ "rustc_version", "toml", "vswhom", - "winreg 0.10.1", + "winreg", ] [[package]] @@ -607,14 +617,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94a7bbaa59354bc20dd75b67f23e2797b4490e9d6928203fb105c79e448c86c" +checksum = "4b9663d381d07ae25dc88dbdf27df458faa83a9b25336bcac83d5e452b5fc9d3" dependencies = [ "cfg-if", "libc", "redox_syscall", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -678,9 +688,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f21eda599937fba36daeb58a22e8f5cee2d14c4a17b5b7739c7c8e5e3b8230c" +checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" dependencies = [ "futures-channel", "futures-core", @@ -709,9 +719,9 @@ checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" [[package]] name = "futures-executor" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff63c23854bee61b6e9cd331d523909f238fc7636290b96826e9cfa5faa00ab" +checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" dependencies = [ "futures-core", "futures-task", @@ -786,9 +796,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if", "libc", @@ -815,9 +825,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca32592cf21ac7ccab1825cd87f6c9b3d9022c44d086172ed0966bec8af30be" +checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" dependencies = [ "bytes", "fnv", @@ -837,6 +847,9 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] [[package]] name = "heck" @@ -909,9 +922,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.20" +version = "0.14.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c929dc5c39e335a03c405292728118860721b10190d98c2a0f0efd5baafbac" +checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" dependencies = [ "bytes", "futures-channel", @@ -933,9 +946,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d87c48c02e0dc5e3b849a2041db3029fd066650f8f717c07bf8ed78ccb895cac" +checksum = "59df7c4e19c950e6e0e868dcc0a300b09a9b88e9ec55bd879ca819087a77355d" dependencies = [ "http", "hyper", @@ -980,9 +993,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "1.9.1" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", "hashbrown", @@ -999,27 +1012,27 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "0.7.3" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ea37f355c05dde75b84bba2d767906ad522e97cd9e2eef2be7a4ab7fb442c06" +checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" [[package]] name = "ipconfig" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723519edce41262b05d4143ceb95050e4c614f483e78e9fd9e39a8275a84ad98" +checksum = "bd302af1b90f2463a98fa5ad469fc212c8e3175a41c3068601bfa2727591c5be" dependencies = [ "socket2", "widestring", "winapi", - "winreg 0.7.0", + "winreg", ] [[package]] name = "ipnet" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879d54834c8c76457ef4293a689b2a8c59b076067ad77b15efafbb05f92a592b" +checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" [[package]] name = "is_ci" @@ -1038,15 +1051,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" +checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" [[package]] name = "jobserver" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" dependencies = [ "libc", ] @@ -1067,9 +1080,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.59" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" dependencies = [ "wasm-bindgen", ] @@ -1082,9 +1095,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.132" +version = "0.2.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" +checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" [[package]] name = "libmimalloc-sys" @@ -1120,9 +1133,9 @@ checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" [[package]] name = "lock_api" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f80bf5aacaf25cbfc8210d1cfb718f2bf3b11c4c54e5afe36c236853a8ec390" +checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" dependencies = [ "autocfg", "scopeguard", @@ -1148,9 +1161,9 @@ dependencies = [ [[package]] name = "lzma-sys" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e06754c4acf47d49c727d5665ca9fb828851cda315ed3bd51edd148ef78a8772" +checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" dependencies = [ "cc", "libc", @@ -1232,21 +1245,21 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" dependencies = [ "libc", "log", "wasi", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] name = "native-tls" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd7e2f3618557f980e0b17e8856252eee3c97fa12c54dff0ca290fb6266ca4a9" +checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" dependencies = [ "lazy_static", "libc", @@ -1295,9 +1308,9 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" +checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" dependencies = [ "hermit-abi", "libc", @@ -1320,9 +1333,9 @@ checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" [[package]] name = "openssl" -version = "0.10.41" +version = "0.10.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "618febf65336490dfcf20b73f885f5651a0c89c64c2d4a8c3662585a70bf5bd0" +checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" dependencies = [ "bitflags", "cfg-if", @@ -1352,9 +1365,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.75" +version = "0.9.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5f9bd0c2710541a3cda73d6f9ac4f1b240de4ae261065d309dbe73d9dceb42f" +checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" dependencies = [ "autocfg", "cc", @@ -1365,9 +1378,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.3.0" +version = "6.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ff7415e9ae3fff1225851df9e0d9e4e5479f947619774677a63572e55e80eff" +checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" [[package]] name = "overload" @@ -1393,15 +1406,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" +checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -1444,15 +1457,15 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" +checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" [[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-error" @@ -1480,9 +1493,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.43" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" +checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" dependencies = [ "unicode-ident", ] @@ -1578,9 +1591,9 @@ 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", ] @@ -1607,9 +1620,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" +checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" dependencies = [ "aho-corasick", "memchr", @@ -1618,9 +1631,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.27" +version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" +checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "remove_dir_all" @@ -1673,7 +1686,7 @@ dependencies = [ "wasm-bindgen-futures", "web-sys", "webpki-roots", - "winreg 0.10.1", + "winreg", ] [[package]] @@ -1718,23 +1731,23 @@ dependencies = [ [[package]] name = "rustix" -version = "0.35.9" +version = "0.35.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c825b8aa8010eb9ee99b75f05e10180b9278d161583034d7574c9d617aeada" +checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9" dependencies = [ "bitflags", "errno", "io-lifetimes", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] name = "rustls" -version = "0.20.6" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aab8ee6c7097ed6057f43c187a62418d0c05a4bd5f18b3571db50ee0f9ce033" +checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" dependencies = [ "log", "ring", @@ -1791,7 +1804,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" dependencies = [ "lazy_static", - "windows-sys", + "windows-sys 0.36.1", ] [[package]] @@ -1932,9 +1945,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" +checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" [[package]] name = "smawk" @@ -2013,9 +2026,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.99" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" +checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" dependencies = [ "proc-macro2", "quote", @@ -2057,9 +2070,9 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "949517c0cf1bf4ee812e2e07e08ab448e3ae0d23472aee8a06c985f0c8815b16" +checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d" dependencies = [ "smawk", "unicode-linebreak", @@ -2174,9 +2187,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc463cd8deddc3770d20f9852143d50bf6094e640b485cb2e189a2099085ff45" +checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" dependencies = [ "bytes", "futures-core", @@ -2236,9 +2249,9 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" [[package]] name = "tower-service" @@ -2397,33 +2410,34 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.3" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" +checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" [[package]] name = "unicode-linebreak" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a52dcaab0c48d931f7cc8ef826fa51690a08e1ea55117ef26f89864f532383f" +checksum = "c5faade31a542b8b35855fff6e8def199853b2da8da256da52f52f1316ee3137" dependencies = [ + "hashbrown", "regex", ] [[package]] name = "unicode-normalization" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "untrusted" @@ -2499,9 +2513,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2509,9 +2523,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" dependencies = [ "bumpalo", "log", @@ -2524,9 +2538,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.32" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa76fb221a1f8acddf5b54ace85912606980ad661ac7a503b4570ffd3a624dad" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ "cfg-if", "js-sys", @@ -2536,9 +2550,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2546,9 +2560,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2", "quote", @@ -2559,15 +2573,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.82" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" [[package]] name = "web-sys" -version = "0.3.59" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" dependencies = [ "js-sys", "wasm-bindgen", @@ -2585,9 +2599,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.4" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1c760f0d366a6c24a02ed7816e23e691f5d92291f94d15e836006fd11b04daf" +checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" dependencies = [ "webpki", ] @@ -2635,37 +2649,88 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", + "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.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc 0.42.0", + "windows_i686_gnu 0.42.0", + "windows_i686_msvc 0.42.0", + "windows_x86_64_gnu 0.42.0", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc 0.42.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" + [[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" + [[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" + [[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" + [[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" + [[package]] name = "windows_x86_64_msvc" version = "0.36.1" @@ -2673,13 +2738,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] -name = "winreg" -version = "0.7.0" +name = "windows_x86_64_msvc" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" -dependencies = [ - "winapi", -] +checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" [[package]] name = "winreg" From 62e350eba916f610a2f5e265e18b9fc78a3b47e6 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 21 Nov 2022 20:16:28 +1100 Subject: [PATCH 0874/2020] detect-targets: Add support of MacOS universal binary (#552) * Add support for MacOS universal bin * Refactor: Extract new fn `macos::detect_alternative_targets` Signed-off-by: Jiahao XU --- crates/detect-targets/src/detect.rs | 4 +--- crates/detect-targets/src/detect/macos.rs | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/crates/detect-targets/src/detect.rs b/crates/detect-targets/src/detect.rs index 6200e425..71940e71 100644 --- a/crates/detect-targets/src/detect.rs +++ b/crates/detect-targets/src/detect.rs @@ -42,9 +42,7 @@ pub async fn detect_targets() -> Vec { v.push(v[0].replace("gnu", "musl")); } } else if #[cfg(target_os = "macos")] { - if &*v[0] == macos::AARCH64 { - v.push(macos::X86.into()); - } + v.extend(macos::detect_alternative_targets(&v[0])); } else if #[cfg(target_os = "windows")] { v.extend(windows::detect_alternative_targets(&v[0])); } diff --git a/crates/detect-targets/src/detect/macos.rs b/crates/detect-targets/src/detect/macos.rs index 67e31ccf..ad5b1f0e 100644 --- a/crates/detect-targets/src/detect/macos.rs +++ b/crates/detect-targets/src/detect/macos.rs @@ -1,15 +1,25 @@ use crate::TARGET; use guess_host_triple::guess_host_triple; -pub(super) const AARCH64: &str = "aarch64-apple-darwin"; -pub(super) const X86: &str = "x86_64-apple-darwin"; +const AARCH64: &str = "aarch64-apple-darwin"; +const X86: &str = "x86_64-apple-darwin"; +const UNIVERSAL: &str = "universal-apple-darwin"; + +pub(super) fn detect_alternative_targets(target: &str) -> impl Iterator { + match target { + AARCH64 => [Some(X86), Some(UNIVERSAL)], + X86 => [Some(UNIVERSAL), None], + _ => [None, None], + } + .into_iter() + .flatten() + .map(ToString::to_string) +} pub(super) fn detect_targets_macos() -> Vec { let mut targets = vec![guess_host_triple().unwrap_or(TARGET).to_string()]; - if targets[0] == AARCH64 { - targets.push(X86.into()); - } + targets.extend(detect_alternative_targets(&targets[0])); targets } From 707b173de15284656a915464caa9a481debcf7ab Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 22 Nov 2022 16:52:36 +1100 Subject: [PATCH 0875/2020] Create universal binary for MacOS in workflow release (#551) * Create universal binary for MacOS in workflow build * Update README Signed-off-by: Jiahao XU --- .github/workflows/build.yml | 26 +++++++++++++++++++++++++- README.md | 1 + 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 46d9bcf7..c11ec2d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -122,4 +122,28 @@ jobs: retention-days: 1 name: "${{ matrix.target }}.${{ env.CBIN }}" path: "${{ env.CBIN }}" - + macos_universal_bin: + needs: build + runs-on: macos-latest + env: + aarch64: aarch64-apple-darwin.cargo-binstall + x86_64: x86_64-apple-darwin.cargo-binstall + steps: + - name: Download aarch64 artifact + uses: actions/download-artifact@v3 + with: + name: ${{ env.aarch64 }} + path: ${{ env.aarch64 }} + - name: Download x86-64 artifact + uses: actions/download-artifact@v3 + with: + name: ${{ env.x86_64 }} + path: ${{ env.x86_64 }} + - name: Create universal binary for MacOS + run: lipo -create -output cargo-binstall $aarch64/cargo-binstall $x86_64/cargo-binstall + - name: Upload output + uses: actions/upload-artifact@v3 + with: + retention-days: 1 + name: universal-apple-darwin.cargo-binstall + path: cargo-binstall diff --git a/README.md b/README.md index ace77482..9fb69869 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,7 @@ We recommend using the pre-compiled ones because we optimize those more than a s | linux | arm64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-unknown-linux-musl.tgz | | macos | x86\_64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-apple-darwin.zip | | macos | m1 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-apple-darwin.zip | +| macos | universal | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-universal-apple-darwin.zip | | windows | x86\_64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-pc-windows-msvc.zip | To upgrade, use `cargo binstall cargo-binstall`! From 66abf1b8c17a8c96f51f70c19cd0712744400d3c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 22 Nov 2022 17:35:16 +1100 Subject: [PATCH 0876/2020] More mionr optimizations (#553) * Optimize `BinFile::preview_bin`: Use `Path::display` instead of `to_string_lossy` to avoid allocation. * Refactor: Rm useless `AsRef::as_ref` call * Optimize `GhCrateMeta::find`: Reduce fut size by converting `Url` to `String` `Url` is much larger than `String`. * Refactor `PackageInfo::resolve`: Destruct `Meta::binstall` * Optimize `resolve::load_manifest_path`: Avoid allocation Signed-off-by: Jiahao XU --- crates/binstalk/src/bins.rs | 12 ++++++------ crates/binstalk/src/drivers/crates_io.rs | 15 ++++++++------- crates/binstalk/src/fetchers/gh_crate_meta.rs | 5 ++++- crates/binstalk/src/ops/resolve.rs | 16 ++++++++++------ 4 files changed, 28 insertions(+), 20 deletions(-) diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 6ea20b9c..8349337e 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -142,7 +142,7 @@ impl BinFile { pub fn preview_bin(&self) -> impl fmt::Display + '_ { LazyFormat { base_name: &self.base_name, - source: self.source.file_name().unwrap().to_string_lossy(), + source: Path::new(self.source.file_name().unwrap()).display(), dest: self.dest.display(), } } @@ -249,21 +249,21 @@ impl<'c> Context<'c> { } } -struct LazyFormat<'a, S: fmt::Display> { +struct LazyFormat<'a> { base_name: &'a str, - source: S, + source: path::Display<'a>, dest: path::Display<'a>, } -impl fmt::Display for LazyFormat<'_, S> { +impl fmt::Display for LazyFormat<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { write!(f, "{} ({} -> {})", self.base_name, self.source, self.dest) } } -struct OptionalLazyFormat<'a, S: fmt::Display>(Option>); +struct OptionalLazyFormat<'a>(Option>); -impl fmt::Display for OptionalLazyFormat<'_, S> { +impl fmt::Display for OptionalLazyFormat<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { if let Some(lazy_format) = self.0.as_ref() { fmt::Display::fmt(lazy_format, f) diff --git a/crates/binstalk/src/drivers/crates_io.rs b/crates/binstalk/src/drivers/crates_io.rs index 8202d906..36787148 100644 --- a/crates/binstalk/src/drivers/crates_io.rs +++ b/crates/binstalk/src/drivers/crates_io.rs @@ -33,13 +33,14 @@ pub async fn fetch_crate_cratesio( debug!("Looking up crate information"); // Fetch online crate information - let base_info = crates_io_api_client - .get_crate(name.as_ref()) - .await - .map_err(|err| BinstallError::CratesIoApi { - crate_name: name.into(), - err: Box::new(err), - })?; + let base_info = + crates_io_api_client + .get_crate(name) + .await + .map_err(|err| BinstallError::CratesIoApi { + crate_name: name.into(), + err: Box::new(err), + })?; // Locate matching version let version_iter = base_info.versions.iter().filter(|v| !v.yanked); diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 7091183f..257e2630 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -124,7 +124,10 @@ impl super::Fetcher for GhCrateMeta { return Ok(false); }; - let repo = repo.as_ref().map(|u| u.as_str().trim_end_matches('/')); + // Convert Option to Option to reduce size of future. + let repo = repo.map(String::from); + let repo = repo.as_deref().map(|u| u.trim_end_matches('/')); + let launch_baseline_find_tasks = |pkg_fmt| { match &pkg_urls { Either::Left(pkg_url) => Either::Left(iter::once(*pkg_url)), diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 7cc8e5bb..09784b7b 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -239,7 +239,10 @@ async fn resolve_inner( } } -/// * `fetcher` - `fetcher.find()` must return `Ok(true)`. +/// * `fetcher` - `fetcher.find()` must have returned `Ok(true)`. +/// +/// Can return empty Vec if all `BinFile` is optional and does not exist +/// in the archive downloaded. async fn download_extract_and_verify( fetcher: &dyn Fetcher, bin_path: &Path, @@ -278,7 +281,7 @@ async fn download_extract_and_verify( } } - // Verify that all the bin_files exist + // Verify that all non-optional bin_files exist block_in_place(|| { let bin_files = collect_bin_files( fetcher, @@ -430,7 +433,7 @@ impl PackageInfo { package .metadata .take() - .and_then(|mut m| m.binstall.take()) + .and_then(|m| m.binstall) .unwrap_or_default(), manifest .bin @@ -465,12 +468,13 @@ impl PackageInfo { pub fn load_manifest_path>( manifest_path: P, ) -> Result, BinstallError> { + let manifest_path = manifest_path.as_ref(); + block_in_place(|| { - let manifest_path = manifest_path.as_ref(); let manifest_path = if manifest_path.is_dir() { - manifest_path.join("Cargo.toml") + Cow::Owned(manifest_path.join("Cargo.toml")) } else if manifest_path.is_file() { - manifest_path.into() + Cow::Borrowed(manifest_path) } else { return Err(BinstallError::CargoManifestPath); }; From bd3f1d598cd2ac813a33f3f5263b51b67cd811ae Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 22 Nov 2022 17:52:41 +1100 Subject: [PATCH 0877/2020] Enable feature thin of dep zstd for any target built natively (#480) * Add new feature `binstalk-downloader/zstd-thin` * Add new feature `binstalk/zstd-thin` * Add new feature `binstalk/zstd-thin` * Enable feature zstd-thin for targets built natively Signed-off-by: Jiahao XU --- .github/scripts/compile-settings.jq | 6 ++++++ crates/bin/Cargo.toml | 2 ++ crates/binstalk-downloader/Cargo.toml | 2 ++ crates/binstalk/Cargo.toml | 2 ++ 4 files changed, 12 insertions(+) diff --git a/.github/scripts/compile-settings.jq b/.github/scripts/compile-settings.jq index 20ff9132..24391921 100644 --- a/.github/scripts/compile-settings.jq +++ b/.github/scripts/compile-settings.jq @@ -26,6 +26,12 @@ if $for_release then { else "" end ) | +.features = ( + if ($matrix."use-cross" // false) + then .features // ["zstd-thin"] + else .features end +) +| .features = ( if (.features | length > 0) then "--no-default-features --features \(.features | join(","))" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index dcf60d18..d7db1754 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -60,6 +60,8 @@ native-tls = ["binstalk/native-tls"] trust-dns = ["binstalk/trust-dns"] +zstd-thin = ["binstalk/zstd-thin"] + fancy-no-backtrace = ["miette/fancy-no-backtrace"] fancy-with-backtrace = ["fancy-no-backtrace", "miette/fancy"] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 4f9900b1..c15f887a 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -69,3 +69,5 @@ native-tls = ["reqwest/native-tls", "trust-dns-resolver?/dns-over-native-tls"] # Enable trust-dns-resolver so that features on it will also be enabled. trust-dns = ["trust-dns-resolver", "reqwest/trust-dns"] + +zstd-thin = ["zstd/thin"] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 4031e066..8abc3811 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -49,3 +49,5 @@ rustls = ["crates_io_api/rustls", "binstalk-downloader/rustls"] native-tls = ["binstalk-downloader/native-tls"] trust-dns = ["binstalk-downloader/trust-dns"] + +zstd-thin = ["binstalk-downloader/zstd-thin"] From 822e7094e5f9ea0e69c6f0396c35f5a6204e622d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 22 Nov 2022 18:39:58 +1100 Subject: [PATCH 0878/2020] Upgrade dependencies (#554) - bytes v1.2.1 => v1.3.0 - serde_json v1.0.88 => v1.0.89 - compact_str v0.6.0 => v0.6.1 Signed-off-by: Jiahao XU --- Cargo.lock | 8 ++++---- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 65b058a7..9205f577 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -267,9 +267,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" +checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" [[package]] name = "bzip2" @@ -1886,9 +1886,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8b3801309262e8184d9687fb697586833e939767aea0dda89f5a8e650e8bd7" +checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" dependencies = [ "itoa", "ryu", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index c15f887a..a6d0f28f 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0" [dependencies] binstalk-types = { version = "0.1.0", path = "../binstalk-types" } -bytes = "1.2.1" +bytes = "1.3.0" bzip2 = "0.4.3" digest = "0.10.6" flate2 = { version = "1.0.24", default-features = false } diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 0b045687..17e8c040 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -11,14 +11,14 @@ license = "Apache-2.0 OR MIT" [dependencies] binstalk-types = { version = "0.1.0", path = "../binstalk-types" } -compact_str = { version = "0.6.0", features = ["serde"] } +compact_str = { version = "0.6.1", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" miette = "5.4.1" semver = { version = "1.0.14", features = ["serde"] } serde = { version = "1.0.147", features = ["derive"] } serde-tuple-vec-map = "1.0.1" -serde_json = "1.0.88" +serde_json = "1.0.89" thiserror = "1.0.37" toml_edit = { version = "0.15.0", features = ["easy"] } url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index c109ed7c..382af3ff 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -compact_str = { version = "0.6.0", features = ["serde"] } +compact_str = { version = "0.6.1", features = ["serde"] } once_cell = "1.16.0" semver = { version = "1.0.14", features = ["serde"] } serde = { version = "1.0.147", features = ["derive"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 8abc3811..0f257a58 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -14,7 +14,7 @@ async-trait = "0.1.58" binstalk-downloader = { version = "0.1.0", path = "../binstalk-downloader" } binstalk-types = { version = "0.1.0", path = "../binstalk-types" } cargo_toml = "0.13.0" -compact_str = { version = "0.6.0", features = ["serde"] } +compact_str = { version = "0.6.1", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.2", path = "../detect-targets" } either = "1.8.0" From e5cd7d7ca166029108974a78d895b56aadd980d3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 22 Nov 2022 08:31:43 +0000 Subject: [PATCH 0879/2020] release: detect-targets v0.1.3 (#555) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9205f577..9a636a7e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -501,7 +501,7 @@ checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" [[package]] name = "detect-targets" -version = "0.1.2" +version = "0.1.3" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 17e8c040..e84904f0 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -24,5 +24,5 @@ toml_edit = { version = "0.15.0", features = ["easy"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.2", path = "../detect-targets" } +detect-targets = { version = "0.1.3", path = "../detect-targets" } tempfile = "3.3.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 0f257a58..ab13689e 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -16,7 +16,7 @@ binstalk-types = { version = "0.1.0", path = "../binstalk-types" } cargo_toml = "0.13.0" compact_str = { version = "0.6.1", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } -detect-targets = { version = "0.1.2", path = "../detect-targets" } +detect-targets = { version = "0.1.3", path = "../detect-targets" } either = "1.8.0" futures-util = { version = "0.3.25", default-features = false, features = ["std"] } home = "0.5.4" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index e56b1c4b..9812baee 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.2" +version = "0.1.3" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From 73751c44375703d70d1f2164bd2a3849259c2f1e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 22 Nov 2022 19:52:27 +1100 Subject: [PATCH 0880/2020] Set version of newly created crates to v0.0.0 (#556) so that release-pr can operate on them and increase minor version for a new release. Signed-off-by: Jiahao XU --- Cargo.lock | 6 +++--- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 4 ++-- crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9a636a7e..09003dd7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -148,7 +148,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.1.0" +version = "0.0.0" dependencies = [ "binstalk-types", "binstall-tar", @@ -175,7 +175,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.1.0" +version = "0.0.0" dependencies = [ "binstalk-types", "compact_str", @@ -195,7 +195,7 @@ dependencies = [ [[package]] name = "binstalk-types" -version = "0.1.0" +version = "0.0.0" dependencies = [ "compact_str", "once_cell", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index d7db1754..e6332967 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.4.1" } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.1.0" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.0.0" } clap = { version = "4.0.26", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index a6d0f28f..891ab38c 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.1.0" +version = "0.0.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0" [dependencies] -binstalk-types = { version = "0.1.0", path = "../binstalk-types" } +binstalk-types = { version = "0.0.0", path = "../binstalk-types" } bytes = "1.3.0" bzip2 = "0.4.3" digest = "0.10.6" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index e84904f0..41eb92c0 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.1.0" +version = "0.0.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-types = { version = "0.1.0", path = "../binstalk-types" } +binstalk-types = { version = "0.0.0", path = "../binstalk-types" } compact_str = { version = "0.6.1", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 382af3ff..5db4b7be 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-types" description = "The binstall toolkit that contains basic types for binstalk crates" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-types" -version = "0.1.0" +version = "0.0.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index ab13689e..0d054724 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,8 +11,8 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.58" -binstalk-downloader = { version = "0.1.0", path = "../binstalk-downloader" } -binstalk-types = { version = "0.1.0", path = "../binstalk-types" } +binstalk-downloader = { version = "0.0.0", path = "../binstalk-downloader" } +binstalk-types = { version = "0.0.0", path = "../binstalk-types" } cargo_toml = "0.13.0" compact_str = { version = "0.6.1", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } From 6fd3044c1234d4f9332082e6403424f768144d77 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 22 Nov 2022 09:21:27 +0000 Subject: [PATCH 0881/2020] release: binstalk-types v0.1.0 (#557) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 09003dd7..8251898a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -195,7 +195,7 @@ dependencies = [ [[package]] name = "binstalk-types" -version = "0.0.0" +version = "0.1.0" dependencies = [ "compact_str", "once_cell", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 891ab38c..36cdd680 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0" [dependencies] -binstalk-types = { version = "0.0.0", path = "../binstalk-types" } +binstalk-types = { version = "0.1.0", path = "../binstalk-types" } bytes = "1.3.0" bzip2 = "0.4.3" digest = "0.10.6" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 41eb92c0..5305e410 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-types = { version = "0.0.0", path = "../binstalk-types" } +binstalk-types = { version = "0.1.0", path = "../binstalk-types" } compact_str = { version = "0.6.1", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 5db4b7be..382af3ff 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-types" description = "The binstall toolkit that contains basic types for binstalk crates" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-types" -version = "0.0.0" +version = "0.1.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 0d054724..51ee42d3 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.58" binstalk-downloader = { version = "0.0.0", path = "../binstalk-downloader" } -binstalk-types = { version = "0.0.0", path = "../binstalk-types" } +binstalk-types = { version = "0.1.0", path = "../binstalk-types" } cargo_toml = "0.13.0" compact_str = { version = "0.6.1", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } From 44316e1f029841a5b7522ad8647860aecd4dab4b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 22 Nov 2022 20:59:24 +1100 Subject: [PATCH 0882/2020] Fix workflow release-pr: Install nightly toolchain (#560) Default rust/cargo in ubuntu-latest is too old. Signed-off-by: Jiahao XU --- .github/workflows/release-pr.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index a075de66..9b268f85 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -31,6 +31,10 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: Configure toolchain + run: | + rustup toolchain install --profile minimal --no-self-update nightly + rustup default nightly - uses: chainguard-dev/actions/setup-gitsign@main - name: Install cargo-release uses: taiki-e/install-action@v1 From 0084254c8c00ce510d255f7128ae8bd7db007fe0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 22 Nov 2022 10:36:10 +0000 Subject: [PATCH 0883/2020] release: binstalk-manifests v0.1.0 (#558) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8251898a..849f6e3c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -175,7 +175,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.0.0" +version = "0.1.0" dependencies = [ "binstalk-types", "compact_str", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index e6332967..d7db1754 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.4.1" } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.0.0" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.1.0" } clap = { version = "4.0.26", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 5305e410..e84904f0 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.0.0" +version = "0.1.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From d1b490468b56cd17416a0f767fd1eb82c85fa11e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 22 Nov 2022 10:53:50 +0000 Subject: [PATCH 0884/2020] release: binstalk-downloader v0.1.0 (#559) chore: Release Co-authored-by: github-actions Co-authored-by: Jiahao XU --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 849f6e3c..9a636a7e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -148,7 +148,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.0.0" +version = "0.1.0" dependencies = [ "binstalk-types", "binstall-tar", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 36cdd680..a6d0f28f 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.0.0" +version = "0.1.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 51ee42d3..ab13689e 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.58" -binstalk-downloader = { version = "0.0.0", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.1.0", path = "../binstalk-downloader" } binstalk-types = { version = "0.1.0", path = "../binstalk-types" } cargo_toml = "0.13.0" compact_str = { version = "0.6.1", features = ["serde"] } From 5172bd46a0870e84c110e0542c2688bdb3199067 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 22 Nov 2022 11:24:54 +0000 Subject: [PATCH 0885/2020] release: binstalk v0.5.0 (#561) chore: Release Co-authored-by: github-actions Co-authored-by: Jiahao XU --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9a636a7e..99ff3de1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -117,7 +117,7 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "binstalk" -version = "0.4.1" +version = "0.5.0" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index d7db1754..d928db12 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.4.1" } +binstalk = { path = "../binstalk", version = "0.5.0" } binstalk-manifests = { path = "../binstalk-manifests", version = "0.1.0" } clap = { version = "4.0.26", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index ab13689e..d43311d1 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.4.1" +version = "0.5.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From 7544fde813e2ae8a97d46e75714e0e219468e51e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 23 Nov 2022 01:18:44 +1100 Subject: [PATCH 0886/2020] release: cargo-binstall v0.17.0 (#562) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 99ff3de1..0798ac4d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -294,7 +294,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.16.0" +version = "0.17.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index d928db12..9270df53 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.16.0" +version = "0.17.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 6d42ca6b..9547f902 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From f71c3606f8167be404587f6f856be8c97cc4b806 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Nov 2022 12:46:34 +0000 Subject: [PATCH 0887/2020] Bump miette from 5.4.1 to 5.5.0 (#565) Bumps [miette](https://github.com/zkat/miette) from 5.4.1 to 5.5.0. - [Release notes](https://github.com/zkat/miette/releases) - [Changelog](https://github.com/zkat/miette/blob/main/CHANGELOG.md) - [Commits](https://github.com/zkat/miette/compare/miette-derive-v5.4.1...miette-derive-v5.5.0) --- updated-dependencies: - dependency-name: miette dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0798ac4d..79c70406 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1190,9 +1190,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "miette" -version = "5.4.1" +version = "5.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a24c4b4063c21e037dffb4de388ee85e400bff299803aba9513d9c52de8116b" +checksum = "4afd9b301defa984bbdbe112b4763e093ed191750a0d914a78c1106b2d0fe703" dependencies = [ "atty", "backtrace", @@ -1210,9 +1210,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.4.1" +version = "5.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "827d18edee5d43dc309eb0ac565f2b8e2fdc89b986b2d929e924a0f6e7f23835" +checksum = "97c2401ab7ac5282ca5c8b518a87635b1a93762b0b90b9990c509888eeccba29" dependencies = [ "proc-macro2", "quote", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 9270df53..2eff28f8 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -28,7 +28,7 @@ clap = { version = "4.0.26", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = { version = "0.4.17", features = ["std"] } -miette = "5.4.1" +miette = "5.5.0" mimalloc = { version = "0.1.32", default-features = false, optional = true } once_cell = "1.16.0" semver = "1.0.14" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index e84904f0..4bb4836b 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -14,7 +14,7 @@ binstalk-types = { version = "0.1.0", path = "../binstalk-types" } compact_str = { version = "0.6.1", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" -miette = "5.4.1" +miette = "5.5.0" semver = { version = "1.0.14", features = ["serde"] } serde = { version = "1.0.147", features = ["derive"] } serde-tuple-vec-map = "1.0.1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index d43311d1..9cac8fb2 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -22,7 +22,7 @@ futures-util = { version = "0.3.25", default-features = false, features = ["std" home = "0.5.4" itertools = "0.10.5" jobslot = { version = "0.2.6", features = ["tokio"] } -miette = "5.4.1" +miette = "5.5.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.16.0" semver = { version = "1.0.14", features = ["serde"] } From 0f21db4c49e05fbe1dcf18534e2a1c34be14ce13 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Nov 2022 13:03:41 +0000 Subject: [PATCH 0888/2020] Bump jobslot from 0.2.6 to 0.2.8 (#564) Bumps [jobslot](https://github.com/cargo-bins/jobslot) from 0.2.6 to 0.2.8. - [Release notes](https://github.com/cargo-bins/jobslot/releases) - [Commits](https://github.com/cargo-bins/jobslot/compare/v0.2.6...v0.2.8) --- updated-dependencies: - dependency-name: jobslot dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 6 +++--- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 79c70406..2a5bab8e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1066,16 +1066,16 @@ dependencies = [ [[package]] name = "jobslot" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d395750ec1a0237b64ce69634232669d352a2b2cf63120d567b5938b9cb17650" +checksum = "45a08d2656617d9bcba4763baf13ae19b7d5183e2c5c1db9e2074c5ae93d9905" dependencies = [ "cfg-if", "getrandom", "libc", "scopeguard", "tokio", - "winapi", + "windows-sys 0.42.0", ] [[package]] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 9cac8fb2..cb112eb3 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -21,7 +21,7 @@ either = "1.8.0" futures-util = { version = "0.3.25", default-features = false, features = ["std"] } home = "0.5.4" itertools = "0.10.5" -jobslot = { version = "0.2.6", features = ["tokio"] } +jobslot = { version = "0.2.8", features = ["tokio"] } miette = "5.5.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.16.0" From 81bd1483a9905df4cbd67eeaa98133e3264aefe9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 24 Nov 2022 13:22:27 +0000 Subject: [PATCH 0889/2020] Bump zstd from 0.11.2+zstd.1.5.2 to 0.12.0+zstd.1.5.2 (#563) * Bump zstd from 0.11.2+zstd.1.5.2 to 0.12.0+zstd.1.5.2 Bumps [zstd](https://github.com/gyscos/zstd-rs) from 0.11.2+zstd.1.5.2 to 0.12.0+zstd.1.5.2. - [Release notes](https://github.com/gyscos/zstd-rs/releases) - [Commits](https://github.com/gyscos/zstd-rs/commits) --- updated-dependencies: - dependency-name: zstd dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update comment in `binstalk-downloader/Cargo.toml` Signed-off-by: Jiahao XU Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU --- Cargo.lock | 25 ++++++++++++++++++++++--- crates/binstalk-downloader/Cargo.toml | 7 ++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2a5bab8e..d2ad3332 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -170,7 +170,7 @@ dependencies = [ "url", "xz2", "zip", - "zstd", + "zstd 0.12.0+zstd.1.5.2", ] [[package]] @@ -2781,7 +2781,7 @@ dependencies = [ "crc32fast", "crossbeam-utils", "flate2", - "zstd", + "zstd 0.11.2+zstd.1.5.2", ] [[package]] @@ -2790,7 +2790,16 @@ version = "0.11.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" dependencies = [ - "zstd-safe", + "zstd-safe 5.0.2+zstd.1.5.2", +] + +[[package]] +name = "zstd" +version = "0.12.0+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8148aa921e9d53217ab9322f8553bd130f7ae33489db68b381d76137d2e6374" +dependencies = [ + "zstd-safe 6.0.2+zstd.1.5.2", ] [[package]] @@ -2803,6 +2812,16 @@ dependencies = [ "zstd-sys", ] +[[package]] +name = "zstd-safe" +version = "6.0.2+zstd.1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cf39f730b440bab43da8fb5faf5f254574462f73f260f85f7987f32154ff17" +dependencies = [ + "libc", + "zstd-sys", +] + [[package]] name = "zstd-sys" version = "2.0.1+zstd.1.5.2" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index a6d0f28f..36d33615 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -44,9 +44,10 @@ xz2 = "0.1.7" zip = { version = "0.6.3", default-features = false, features = ["deflate", "bzip2", "zstd"] } # zstd is also depended by zip. -# Since zip 0.6.3 depends on zstd 0.11, we also have to use 0.11 here, -# otherwise there will be a link conflict. -zstd = { version = "0.11.2", default-features = false } +# Since zip 0.6.3 depends on zstd 0.11, we can use 0.12.0 here +# because it uses the same zstd-sys version. +# Otherwise there will be a link conflict. +zstd = { version = "0.12.0", default-features = false } [features] default = ["static", "rustls"] From 6c9d932b8137ceb254a757581125c455fb2149b0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Nov 2022 01:24:37 +0000 Subject: [PATCH 0890/2020] Bump flate2 from 1.0.24 to 1.0.25 (#570) Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.0.24 to 1.0.25. - [Release notes](https://github.com/rust-lang/flate2-rs/releases) - [Commits](https://github.com/rust-lang/flate2-rs/commits/1.0.25) --- updated-dependencies: - dependency-name: flate2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 17 +++++++++++++---- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d2ad3332..a1cf35be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -104,7 +104,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.5.4", "object", "rustc-demangle", ] @@ -629,13 +629,13 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ "crc32fast", "libz-ng-sys", - "miniz_oxide", + "miniz_oxide 0.6.2", ] [[package]] @@ -1243,6 +1243,15 @@ dependencies = [ "adler", ] +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + [[package]] name = "mio" version = "0.8.5" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 36d33615..e11668ec 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -14,7 +14,7 @@ binstalk-types = { version = "0.1.0", path = "../binstalk-types" } bytes = "1.3.0" bzip2 = "0.4.3" digest = "0.10.6" -flate2 = { version = "1.0.24", default-features = false } +flate2 = { version = "1.0.25", default-features = false } futures-util = { version = "0.3.25", default-features = false, features = ["std"] } generic-array = "0.14.6" httpdate = "1.0.2" From 4b018cf90a0e89ab55c83c921901fd5d38818100 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 25 Nov 2022 01:39:18 +0000 Subject: [PATCH 0891/2020] Bump clap from 4.0.26 to 4.0.27 (#571) Bumps [clap](https://github.com/clap-rs/clap) from 4.0.26 to 4.0.27. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.26...v4.0.27) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 67 +++++++++++++++++++++++++++++++++++++------ crates/bin/Cargo.toml | 2 +- 2 files changed, 60 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a1cf35be..5baf8614 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -83,7 +83,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -365,14 +365,14 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.26" +version = "4.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2148adefda54e14492fb9bddcc600b4344c5d1a3123bd666dcb939c6f0e0e57e" +checksum = "0acbd8d28a0a60d7108d7ae850af6ba34cf2d1257fc646980e5f97ce14275966" dependencies = [ - "atty", "bitflags", "clap_derive", "clap_lex", + "is-terminal", "once_cell", "strsim", "termcolor", @@ -682,7 +682,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9813c3dc174931eff4bd78609debba56465b7c1da888576d21636b601a46790" dependencies = [ "libc", - "rustix", + "rustix 0.35.13", "winapi", ] @@ -866,6 +866,15 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" +dependencies = [ + "libc", +] + [[package]] name = "home" version = "0.5.4" @@ -1016,6 +1025,16 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" +[[package]] +name = "io-lifetimes" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7d367024b3f3414d8e01f437f704f41a9f64ab36f9067fa73e526ad4c763c87" +dependencies = [ + "libc", + "windows-sys 0.42.0", +] + [[package]] name = "ipconfig" version = "0.3.1" @@ -1034,6 +1053,18 @@ version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" +[[package]] +name = "is-terminal" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aae5bc6e2eb41c9def29a3e0f1306382807764b9b53112030eff57435667352d" +dependencies = [ + "hermit-abi 0.2.6", + "io-lifetimes 1.0.1", + "rustix 0.36.3", + "windows-sys 0.42.0", +] + [[package]] name = "is_ci" version = "1.1.1" @@ -1131,6 +1162,12 @@ version = "0.0.46" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" +[[package]] +name = "linux-raw-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f9f08d8963a6c613f4b1a78f4f4a4dbfadf8e6545b2d72861731e4858b8b47f" + [[package]] name = "lock_api" version = "0.4.9" @@ -1321,7 +1358,7 @@ version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", ] @@ -1746,9 +1783,23 @@ checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9" dependencies = [ "bitflags", "errno", - "io-lifetimes", + "io-lifetimes 0.7.5", "libc", - "linux-raw-sys", + "linux-raw-sys 0.0.46", + "windows-sys 0.42.0", +] + +[[package]] +name = "rustix" +version = "0.36.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b1fbb4dfc4eb1d390c02df47760bb19a84bb80b301ecc947ab5406394d8223e" +dependencies = [ + "bitflags", + "errno", + "io-lifetimes 1.0.1", + "libc", + "linux-raw-sys 0.1.3", "windows-sys 0.42.0", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 2eff28f8..6e36a94b 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.5.0" } binstalk-manifests = { path = "../binstalk-manifests", version = "0.1.0" } -clap = { version = "4.0.26", features = ["derive"] } +clap = { version = "4.0.27", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = { version = "0.4.17", features = ["std"] } From 30cc94b5bcae6c5da2b6c078547d950fb95f8597 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 29 Nov 2022 13:39:33 +1100 Subject: [PATCH 0892/2020] Bump serde from 1.0.147 to 1.0.148 (#572) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.147 to 1.0.148. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.147...v1.0.148) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 12 ++++++------ crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5baf8614..243e3d31 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1917,9 +1917,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.147" +version = "1.0.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d193d69bae983fc11a79df82342761dfbf28a99fc8d203dca4c3c1b590948965" +checksum = "e53f64bb4ba0191d6d0676e1b141ca55047d83b74f5607e6d8eb88126c52c2dc" dependencies = [ "serde_derive", ] @@ -1935,9 +1935,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.147" +version = "1.0.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f1d362ca8fc9c3e3a7484440752472d68a6caa98f1ab81d99b5dfe517cec852" +checksum = "a55492425aa53521babf6137309e7d34c20bbfbbfcfe2c7f3a047fd1f6b92c0c" dependencies = [ "proc-macro2", "quote", @@ -2086,9 +2086,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.103" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a864042229133ada95abf3b54fdc62ef5ccabe9515b64717bcb9a1919e59445d" +checksum = "4ae548ec36cf198c0ef7710d3c230987c2d6d7bd98ad6edc0274462724c585ce" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 4bb4836b..dbd3f011 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -16,7 +16,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" miette = "5.5.0" semver = { version = "1.0.14", features = ["serde"] } -serde = { version = "1.0.147", features = ["derive"] } +serde = { version = "1.0.148", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.89" thiserror = "1.0.37" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 382af3ff..95ead86b 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" compact_str = { version = "0.6.1", features = ["serde"] } once_cell = "1.16.0" semver = { version = "1.0.14", features = ["serde"] } -serde = { version = "1.0.147", features = ["derive"] } +serde = { version = "1.0.148", features = ["derive"] } strum = "0.24.1" strum_macros = "0.24.3" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index cb112eb3..3663563a 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ miette = "5.5.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.16.0" semver = { version = "1.0.14", features = ["serde"] } -serde = { version = "1.0.147", features = ["derive"] } +serde = { version = "1.0.148", features = ["derive"] } strum = "0.24.1" tempfile = "3.3.0" thiserror = "1.0.37" From b5002de9c4214272e0d0c0e24ed0e18c8e5e37e2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 29 Nov 2022 14:26:54 +1100 Subject: [PATCH 0893/2020] Return `Future + 'static` in `GhCrateMeta::launch_baseline_find_tasks` (#573) So that the borrow checker know that `FuturesUnordered` holds no reference to any data and thus it can further optimize future returned by `GhCrateMeta::find`. Signed-off-by: Jiahao XU --- crates/binstalk/src/fetchers/gh_crate_meta.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 257e2630..20c99e3a 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -40,7 +40,7 @@ impl GhCrateMeta { pkg_fmt: PkgFmt, pkg_url: &'a str, repo: Option<&'a str>, - ) -> impl Iterator + 'a> + 'a { + ) -> impl Iterator + 'static> + 'a { // build up list of potential URLs let urls = pkg_fmt.extensions().iter().filter_map(move |ext| { let ctx = Context::from_data_with_repo(&self.data, &self.target_data.target, ext, repo); From 6785d3ef82350c5a3b97f1f60bc9230dd37eae5b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 29 Nov 2022 15:18:28 +1100 Subject: [PATCH 0894/2020] Fix msrv: Bump to v1.65.0 (#574) - bin and binstalk uses new let-else lang feature - dep zstd of binstalk-downloader just bumped its msrv to v1.64.0 Signed-off-by: Jiahao XU --- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 6e36a94b..bf80fc20 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -4,7 +4,7 @@ description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" version = "0.17.0" -rust-version = "1.61.0" +rust-version = "1.65.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index e11668ec..c081ccd9 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -4,7 +4,7 @@ description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" version = "0.1.0" -rust-version = "1.61.0" +rust-version = "1.65.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 3663563a..5289ed5c 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -4,7 +4,7 @@ description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" version = "0.5.0" -rust-version = "1.61.0" +rust-version = "1.65.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0" From d64710d3a6a1c5fe0e3df0d91c96f59809a21fbd Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 29 Nov 2022 16:31:59 +1100 Subject: [PATCH 0895/2020] Fix crates/bin/build.rs: Rerun build.rs if manifest.rc and windows.manifest changed (#575) Signed-off-by: Jiahao XU --- crates/bin/build.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/bin/build.rs b/crates/bin/build.rs index e3f7605b..526d5bbc 100644 --- a/crates/bin/build.rs +++ b/crates/bin/build.rs @@ -1,5 +1,7 @@ fn main() { println!("cargo:rerun-if-changed=build.rs"); + println!("cargo:rerun-if-changed=manifest.rc"); + println!("cargo:rerun-if-changed=windows.manifest"); embed_resource::compile("manifest.rc"); } From d63e001d6ff453e690fc79742e812b605d68624d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 29 Nov 2022 16:53:45 +1100 Subject: [PATCH 0896/2020] Fix panic in `ui::confirm` on I/O error (#576) Signed-off-by: Jiahao XU --- crates/bin/src/ui.rs | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/crates/bin/src/ui.rs b/crates/bin/src/ui.rs index 461ef5d1..ff02d2ec 100644 --- a/crates/bin/src/ui.rs +++ b/crates/bin/src/ui.rs @@ -1,11 +1,24 @@ use std::{ - io::{self, BufRead, Write}, + io::{self, BufRead, StdinLock, Write}, thread, }; use binstalk::errors::BinstallError; use tokio::sync::oneshot; +fn ask_for_confirm(stdin: &mut StdinLock, input: &mut String) -> io::Result<()> { + { + let mut stdout = io::stdout().lock(); + + write!(&mut stdout, "Do you wish to continue? yes/[no]\n? ")?; + stdout.flush()?; + } + + stdin.read_line(input)?; + + Ok(()) +} + pub async fn confirm() -> Result<(), BinstallError> { let (tx, rx) = oneshot::channel(); @@ -16,15 +29,10 @@ pub async fn confirm() -> Result<(), BinstallError> { let mut input = String::with_capacity(16); let res = loop { - { - let mut stdout = io::stdout().lock(); - - write!(&mut stdout, "Do you wish to continue? yes/[no]\n? ").unwrap(); - stdout.flush().unwrap(); + if ask_for_confirm(&mut stdin, &mut input).is_err() { + break false; } - stdin.read_line(&mut input).unwrap(); - match input.as_str().trim() { "yes" | "y" | "YES" | "Y" => break true, "no" | "n" | "NO" | "N" | "" => break false, From 99548b1e5074cee8008e4e3dfb37a2e328e76ef7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Nov 2022 01:35:11 +0000 Subject: [PATCH 0897/2020] Bump clap from 4.0.27 to 4.0.29 (#577) Bumps [clap](https://github.com/clap-rs/clap) from 4.0.27 to 4.0.29. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.27...v4.0.29) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 14 +++++++------- crates/bin/Cargo.toml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 243e3d31..e7ec043d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -365,9 +365,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.27" +version = "4.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0acbd8d28a0a60d7108d7ae850af6ba34cf2d1257fc646980e5f97ce14275966" +checksum = "4d63b9e9c07271b9957ad22c173bae2a4d9a81127680962039296abcd2f8251d" dependencies = [ "bitflags", "clap_derive", @@ -1055,13 +1055,13 @@ checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" [[package]] name = "is-terminal" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aae5bc6e2eb41c9def29a3e0f1306382807764b9b53112030eff57435667352d" +checksum = "927609f78c2913a6f6ac3c27a4fe87f43e2a35367c0c4b0f8265e8f49a104330" dependencies = [ "hermit-abi 0.2.6", "io-lifetimes 1.0.1", - "rustix 0.36.3", + "rustix 0.36.4", "windows-sys 0.42.0", ] @@ -1791,9 +1791,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.3" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b1fbb4dfc4eb1d390c02df47760bb19a84bb80b301ecc947ab5406394d8223e" +checksum = "cb93e85278e08bb5788653183213d3a60fc242b10cb9be96586f5a73dcb67c23" dependencies = [ "bitflags", "errno", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index bf80fc20..14ab1f69 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.5.0" } binstalk-manifests = { path = "../binstalk-manifests", version = "0.1.0" } -clap = { version = "4.0.27", features = ["derive"] } +clap = { version = "4.0.29", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = { version = "0.4.17", features = ["std"] } From af82f1021cf8d4484fab6c01749286ccd6507cb0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 30 Nov 2022 01:50:00 +0000 Subject: [PATCH 0898/2020] Bump async-trait from 0.1.58 to 0.1.59 (#578) Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.58 to 0.1.59. - [Release notes](https://github.com/dtolnay/async-trait/releases) - [Commits](https://github.com/dtolnay/async-trait/compare/0.1.58...0.1.59) --- updated-dependencies: - dependency-name: async-trait dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e7ec043d..908aa1f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,9 +68,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.58" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e805d94e6b5001b651426cf4cd446b1ab5f319d27bab5c644f61de0a804360c" +checksum = "31e6e93155431f3931513b243d371981bb2770112b370c82745a1d19d2f99364" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 5289ed5c..99e1df6b 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0" [dependencies] -async-trait = "0.1.58" +async-trait = "0.1.59" binstalk-downloader = { version = "0.1.0", path = "../binstalk-downloader" } binstalk-types = { version = "0.1.0", path = "../binstalk-types" } cargo_toml = "0.13.0" From ff737730f4c6bbc6c9840163c5f792c00833a771 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 30 Nov 2022 14:05:52 +1100 Subject: [PATCH 0899/2020] Optimize use of `tokio::select!`: Use biased selection (#580) as there is no need to randomize the first one to be polled. For `cancel_on_user_sig_term` and `StreamReadable::fill_buf`, the cancellation future should always to be polled first so that user would feel responsive. Signed-off-by: Jiahao XU --- .../binstalk-downloader/src/download/stream_readable.rs | 4 +++- crates/binstalk/src/helpers/signal.rs | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/binstalk-downloader/src/download/stream_readable.rs b/crates/binstalk-downloader/src/download/stream_readable.rs index af6e9c67..2db0666a 100644 --- a/crates/binstalk-downloader/src/download/stream_readable.rs +++ b/crates/binstalk-downloader/src/download/stream_readable.rs @@ -122,10 +122,12 @@ where let option = self.handle.block_on(async { if let Some(cancellation_future) = self.cancellation_future.as_mut() { tokio::select! { - res = next_stream(&mut self.stream) => res, + biased; + res = cancellation_future => { Err(res.err().unwrap_or_else(|| io::Error::from(DownloadError::UserAbort))) }, + res = next_stream(&mut self.stream) => res, } } else { next_stream(&mut self.stream).await diff --git a/crates/binstalk/src/helpers/signal.rs b/crates/binstalk/src/helpers/signal.rs index 30eb57bf..5b6b7465 100644 --- a/crates/binstalk/src/helpers/signal.rs +++ b/crates/binstalk/src/helpers/signal.rs @@ -20,11 +20,13 @@ pub async fn cancel_on_user_sig_term( ignore_signals()?; tokio::select! { - res = handle => res, + biased; + res = wait_on_cancellation_signal() => { res.map_err(BinstallError::Io) .and(Err(BinstallError::UserAbort)) } + res = handle => res, } } @@ -59,6 +61,8 @@ async fn wait_on_cancellation_signal_inner() -> Result<(), io::Error> { } tokio::select! { + biased; + res = signal::ctrl_c() => res, res = inner() => res, } @@ -72,6 +76,8 @@ mod unix { /// Same as [`wait_on_cancellation_signal`] but is only available on unix. pub async fn wait_on_cancellation_signal_unix() -> Result<(), io::Error> { tokio::select! { + biased; + res = wait_for_signal_unix(SignalKind::interrupt()) => res, res = wait_for_signal_unix(SignalKind::hangup()) => res, res = wait_for_signal_unix(SignalKind::terminate()) => res, From ab3e47c42b4750c33ebb1df9ce30ea8a0643a20c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 30 Nov 2022 14:15:22 +1100 Subject: [PATCH 0900/2020] Optimize `Fetcher::find` and fix quickinstall reporting (#579) * Optimize `Fetcher::find`: Make it non-async to avoid boxing and return `AutoAbortJoinHandle<...>` instead. Since spawning a new task in tokio box the future anyway, boxing the returned future again in `Fetcher::find` merely adds unnecessary overheads. * Optimize `QuickInstall::report`: Make it async fn instead of ret `JoinHandle` This provides several benefits: - On debug build, no task will be spawned - The calls to `self.stats_url()` can be evaluated in parallel. - The task now returns `()` so that the task spawned is smaller. * Fix `QuickInstall::find`: `warn!` if quickinstall report fails Signed-off-by: Jiahao XU --- crates/binstalk/src/fetchers.rs | 4 +- crates/binstalk/src/fetchers/gh_crate_meta.rs | 111 ++++++++++-------- crates/binstalk/src/fetchers/quickinstall.rs | 55 +++++---- crates/binstalk/src/ops/resolve.rs | 7 +- 4 files changed, 93 insertions(+), 84 deletions(-) diff --git a/crates/binstalk/src/fetchers.rs b/crates/binstalk/src/fetchers.rs index 5da5d33a..1b9d324c 100644 --- a/crates/binstalk/src/fetchers.rs +++ b/crates/binstalk/src/fetchers.rs @@ -6,7 +6,7 @@ pub use quickinstall::*; use crate::{ errors::BinstallError, - helpers::remote::Client, + helpers::{remote::Client, tasks::AutoAbortJoinHandle}, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; @@ -32,7 +32,7 @@ pub trait Fetcher: Send + Sync { /// /// Must return `true` if a package is available, `false` if none is, and reserve errors to /// fatal conditions only. - async fn find(&self) -> Result; + fn find(self: Arc) -> AutoAbortJoinHandle>; /// Return the package format fn pkg_fmt(&self) -> PkgFmt; diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 20c99e3a..15defd2e 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -16,6 +16,7 @@ use crate::{ download::Download, remote::{Client, Method}, signal::wait_on_cancellation_signal, + tasks::AutoAbortJoinHandle, }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; @@ -83,26 +84,27 @@ impl super::Fetcher for GhCrateMeta { }) } - async fn find(&self) -> Result { - let repo = if let Some(repo) = self.data.repo.as_deref() { - Some( - self.client - .get_redirected_final_url(Url::parse(repo)?) - .await?, - ) - } else { - None - }; - - let pkg_urls = if let Some(pkg_url) = self.target_data.meta.pkg_url.as_deref() { - Either::Left(pkg_url) - } else if let Some(repo) = repo.as_ref() { - if let Some(pkg_urls) = - RepositoryHost::guess_git_hosting_services(repo)?.get_default_pkg_url_template() - { - Either::Right(pkg_urls) + fn find(self: Arc) -> AutoAbortJoinHandle> { + AutoAbortJoinHandle::spawn(async move { + let repo = if let Some(repo) = self.data.repo.as_deref() { + Some( + self.client + .get_redirected_final_url(Url::parse(repo)?) + .await?, + ) } else { - warn!( + None + }; + + let pkg_urls = if let Some(pkg_url) = self.target_data.meta.pkg_url.as_deref() { + Either::Left(pkg_url) + } else if let Some(repo) = repo.as_ref() { + if let Some(pkg_urls) = + RepositoryHost::guess_git_hosting_services(repo)?.get_default_pkg_url_template() + { + Either::Right(pkg_urls) + } else { + warn!( concat!( "Unknown repository {}, cargo-binstall cannot provide default pkg_url for it.\n", "Please ask the upstream to provide it for target {}." @@ -110,10 +112,10 @@ impl super::Fetcher for GhCrateMeta { repo, self.target_data.target ); - return Ok(false); - } - } else { - warn!( + return Ok(false); + } + } else { + warn!( concat!( "Package does not specify repository, cargo-binstall cannot provide default pkg_url for it.\n", "Please ask the upstream to provide it for target {}." @@ -121,39 +123,44 @@ impl super::Fetcher for GhCrateMeta { self.target_data.target ); - return Ok(false); - }; + return Ok(false); + }; - // Convert Option to Option to reduce size of future. - let repo = repo.map(String::from); - let repo = repo.as_deref().map(|u| u.trim_end_matches('/')); + // Convert Option to Option to reduce size of future. + let repo = repo.map(String::from); + let repo = repo.as_deref().map(|u| u.trim_end_matches('/')); - let launch_baseline_find_tasks = |pkg_fmt| { - match &pkg_urls { - Either::Left(pkg_url) => Either::Left(iter::once(*pkg_url)), - Either::Right(pkg_urls) => Either::Right(pkg_urls.iter().map(Deref::deref)), + // Use reference to self to fix error of closure + // launch_baseline_find_tasks which moves `this` + let this = &self; + + let launch_baseline_find_tasks = |pkg_fmt| { + match &pkg_urls { + Either::Left(pkg_url) => Either::Left(iter::once(*pkg_url)), + Either::Right(pkg_urls) => Either::Right(pkg_urls.iter().map(Deref::deref)), + } + .flat_map(move |pkg_url| this.launch_baseline_find_tasks(pkg_fmt, pkg_url, repo)) + }; + + let mut handles: FuturesUnordered<_> = + if let Some(pkg_fmt) = self.target_data.meta.pkg_fmt { + launch_baseline_find_tasks(pkg_fmt).collect() + } else { + PkgFmt::iter() + .flat_map(launch_baseline_find_tasks) + .collect() + }; + + while let Some(res) = handles.next().await { + if let Some((url, pkg_fmt)) = res? { + debug!("Winning URL is {url}, with pkg_fmt {pkg_fmt}"); + self.resolution.set((url, pkg_fmt)).unwrap(); // find() is called first + return Ok(true); + } } - .flat_map(move |pkg_url| self.launch_baseline_find_tasks(pkg_fmt, pkg_url, repo)) - }; - let mut handles: FuturesUnordered<_> = if let Some(pkg_fmt) = self.target_data.meta.pkg_fmt - { - launch_baseline_find_tasks(pkg_fmt).collect() - } else { - PkgFmt::iter() - .flat_map(launch_baseline_find_tasks) - .collect() - }; - - while let Some(res) = handles.next().await { - if let Some((url, pkg_fmt)) = res? { - debug!("Winning URL is {url}, with pkg_fmt {pkg_fmt}"); - self.resolution.set((url, pkg_fmt)).unwrap(); // find() is called first - return Ok(true); - } - } - - Ok(false) + Ok(false) + }) } async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs index f03eec41..d49847e3 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk/src/fetchers/quickinstall.rs @@ -1,8 +1,7 @@ use std::{path::Path, sync::Arc}; use compact_str::CompactString; -use tokio::task::JoinHandle; -use tracing::debug; +use tracing::{debug, warn}; use url::Url; use crate::{ @@ -11,6 +10,7 @@ use crate::{ download::Download, remote::{Client, Method}, signal::wait_on_cancellation_signal, + tasks::AutoAbortJoinHandle, }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; @@ -43,14 +43,29 @@ impl super::Fetcher for QuickInstall { }) } - async fn find(&self) -> Result { - let url = self.package_url(); - self.report(); - debug!("Checking for package at: '{url}'"); - Ok(self - .client - .remote_exists(Url::parse(&url)?, Method::HEAD) - .await?) + fn find(self: Arc) -> AutoAbortJoinHandle> { + AutoAbortJoinHandle::spawn(async move { + if cfg!(debug_assertions) { + debug!("Not sending quickinstall report in debug mode"); + } else { + let this = self.clone(); + tokio::spawn(async move { + if let Err(err) = this.report().await { + warn!( + "Failed to send quickinstall report for package {}: {err}", + this.package + ) + } + }); + } + + let url = self.package_url(); + debug!("Checking for package at: '{url}'"); + Ok(self + .client + .remote_exists(Url::parse(&url)?, Method::HEAD) + .await?) + }) } async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { @@ -110,22 +125,12 @@ impl QuickInstall { ) } - pub fn report(&self) -> JoinHandle> { - let stats_url = self.stats_url(); - let client = self.client.clone(); + pub async fn report(&self) -> Result<(), BinstallError> { + let url = Url::parse(&self.stats_url())?; + debug!("Sending installation report to quickinstall ({url})"); - tokio::spawn(async move { - if cfg!(debug_assertions) { - debug!("Not sending quickinstall report in debug mode"); - return Ok(()); - } + self.client.remote_exists(url, Method::HEAD).await?; - let url = Url::parse(&stats_url)?; - debug!("Sending installation report to quickinstall ({url})"); - - client.remote_exists(url, Method::HEAD).await?; - - Ok(()) - }) + Ok(()) } } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 09784b7b..44dcb11e 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -20,7 +20,7 @@ use crate::{ drivers::fetch_crate_cratesio, errors::BinstallError, fetchers::{Data, Fetcher, TargetData}, - helpers::{remote::Client, tasks::AutoAbortJoinHandle}, + helpers::remote::Client, manifests::cargo_toml_binstall::{Meta, PkgMeta, PkgOverride}, }; @@ -162,10 +162,7 @@ async fn resolve_inner( .cartesian_product(resolvers) .map(|(target_data, f)| { let fetcher = f(opts.client.clone(), data.clone(), target_data); - ( - fetcher.clone(), - AutoAbortJoinHandle::spawn(async move { fetcher.find().await }), - ) + (fetcher.clone(), fetcher.find()) }), ); From 8a5577297e8aa29a1b41390b5c6185ac4ddcd1f0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 1 Dec 2022 18:05:00 +1100 Subject: [PATCH 0901/2020] Optimize `BinstallError`: Reduce size from 40B to 32B (#581) * Optimize `BinstallError::CratesIoApi`: Extract new type `errors::CratesIoApiError` and box it Also improve `::fmt` impl. * Optimize `BinstallError::SubProcess`: Use `Box` instead of `String` * Optimize `BinstallError::CargoManifest`: Box `CargoTomlError` * Optimize `BinstallError::VersionParse`: Extract `VersionParseError` and box it Also improve `::fmt` impl. * Optimize `BinstallError::CrateContext`: Extract `CrateContextError` and box it in * Optimize `install_from_source`: Only format `cmd` on err Signed-off-by: Jiahao XU --- crates/binstalk/src/drivers/crates_io.rs | 16 +++--- crates/binstalk/src/errors.rs | 73 +++++++++++++++--------- crates/binstalk/src/ops/install.rs | 4 +- crates/binstalk/src/ops/resolve.rs | 5 +- 4 files changed, 58 insertions(+), 40 deletions(-) diff --git a/crates/binstalk/src/drivers/crates_io.rs b/crates/binstalk/src/drivers/crates_io.rs index 36787148..ec4179bd 100644 --- a/crates/binstalk/src/drivers/crates_io.rs +++ b/crates/binstalk/src/drivers/crates_io.rs @@ -6,7 +6,7 @@ use semver::VersionReq; use tracing::debug; use crate::{ - errors::BinstallError, + errors::{BinstallError, CratesIoApiError}, helpers::{ download::Download, remote::{Client, Url}, @@ -33,14 +33,12 @@ pub async fn fetch_crate_cratesio( debug!("Looking up crate information"); // Fetch online crate information - let base_info = - crates_io_api_client - .get_crate(name) - .await - .map_err(|err| BinstallError::CratesIoApi { - crate_name: name.into(), - err: Box::new(err), - })?; + let base_info = crates_io_api_client.get_crate(name).await.map_err(|err| { + Box::new(CratesIoApiError { + crate_name: name.into(), + err, + }) + })?; // Locate matching version let version_iter = base_info.versions.iter().filter(|v| !v.yanked); diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index 4fadd1d8..23a02a88 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -8,14 +8,38 @@ use binstalk_downloader::{ download::{DownloadError, ZipError}, remote::{Error as RemoteError, HttpError, ReqwestError}, }; +use cargo_toml::Error as CargoTomlError; use compact_str::CompactString; -use crates_io_api::Error as CratesIoApiError; use miette::{Diagnostic, Report}; use thiserror::Error; use tinytemplate::error::Error as TinyTemplateError; use tokio::task; use tracing::{error, warn}; +#[derive(Debug, Error)] +#[error("crates.io API error for {crate_name}: {err}")] +pub struct CratesIoApiError { + pub crate_name: CompactString, + #[source] + pub err: crates_io_api::Error, +} + +#[derive(Debug, Error)] +#[error("version string '{v}' is not semver: {err}")] +pub struct VersionParseError { + pub v: CompactString, + #[source] + pub err: semver::Error, +} + +#[derive(Debug, Error)] +#[error("For crate {crate_name}: {err}")] +pub struct CrateContextError { + crate_name: CompactString, + #[source] + err: BinstallError, +} + /// Error kinds emitted by cargo-binstall. #[derive(Error, Diagnostic, Debug)] #[non_exhaustive] @@ -93,7 +117,10 @@ pub enum BinstallError { /// - Exit: 70 #[error("subprocess {command} errored with {status}")] #[diagnostic(severity(error), code(binstall::subprocess))] - SubProcess { command: String, status: ExitStatus }, + SubProcess { + command: Box, + status: ExitStatus, + }, /// A generic I/O error. /// @@ -109,17 +136,13 @@ pub enum BinstallError { /// /// - Code: `binstall::crates_io_api` /// - Exit: 76 - #[error("crates.io API error")] + #[error(transparent)] #[diagnostic( severity(error), code(binstall::crates_io_api), - help("Check that the crate name you provided is correct.\nYou can also search for a matching crate at: https://lib.rs/search?q={crate_name}") + help("Check that the crate name you provided is correct.\nYou can also search for a matching crate at: https://lib.rs/search?q={}", .0.crate_name) )] - CratesIoApi { - crate_name: CompactString, - #[source] - err: Box, - }, + CratesIoApi(#[from] Box), /// The override path to the cargo manifest is invalid or cannot be resolved. /// @@ -143,7 +166,7 @@ pub enum BinstallError { code(binstall::cargo_manifest), help("If you used --manifest-path, check the Cargo.toml syntax.") )] - CargoManifest(#[from] cargo_toml::Error), + CargoManifest(Box), /// A version is not valid semver. /// @@ -152,13 +175,9 @@ pub enum BinstallError { /// /// - Code: `binstall::version::parse` /// - Exit: 80 - #[error("version string '{v}' is not semver")] + #[error(transparent)] #[diagnostic(severity(error), code(binstall::version::parse))] - VersionParse { - v: CompactString, - #[source] - err: semver::Error, - }, + VersionParse(#[from] Box), /// No available version matches the requirements. /// @@ -302,12 +321,8 @@ pub enum BinstallError { NoFallbackToCargoInstall, /// A wrapped error providing the context of which crate the error is about. - #[error("For crate {crate_name}: {error}")] - CrateContext { - #[source] - error: Box, - crate_name: CompactString, - }, + #[error(transparent)] + CrateContext(Box), } impl BinstallError { @@ -339,7 +354,7 @@ impl BinstallError { EmptySourceFilePath => 92, InvalidStrategies(..) => 93, NoFallbackToCargoInstall => 94, - CrateContext { error, .. } => error.exit_number(), + CrateContext(context) => context.err.exit_number(), }; // reserved codes @@ -361,10 +376,10 @@ impl BinstallError { /// Add crate context to the error pub fn crate_context(self, crate_name: impl Into) -> Self { - Self::CrateContext { - error: Box::new(self), + Self::CrateContext(Box::new(CrateContextError { + err: self, crate_name: crate_name.into(), - } + })) } } @@ -438,3 +453,9 @@ impl From for BinstallError { BinstallError::Template(Box::new(e)) } } + +impl From for BinstallError { + fn from(e: CargoTomlError) -> Self { + BinstallError::CargoManifest(Box::new(e)) + } +} diff --git a/crates/binstalk/src/ops/install.rs b/crates/binstalk/src/ops/install.rs index bf660efc..d541315f 100644 --- a/crates/binstalk/src/ops/install.rs +++ b/crates/binstalk/src/ops/install.rs @@ -131,8 +131,6 @@ async fn install_from_source( cmd.arg("--force"); } - let command_string = format!("{cmd:?}"); - let mut child = jobserver_client.configure_and_run(&mut cmd, |cmd| cmd.spawn())?; debug!("Spawned command pid={:?}", child.id()); @@ -144,7 +142,7 @@ async fn install_from_source( } else { error!("Cargo errored! {status:?}"); Err(BinstallError::SubProcess { - command: command_string, + command: format!("{cmd:?}").into_boxed_str(), status, }) } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 44dcb11e..b5153bf3 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -18,7 +18,7 @@ use super::Options; use crate::{ bins, drivers::fetch_crate_cratesio, - errors::BinstallError, + errors::{BinstallError, VersionParseError}, fetchers::{Data, Fetcher, TargetData}, helpers::remote::Client, manifests::cargo_toml_binstall::{Meta, PkgMeta, PkgOverride}, @@ -409,10 +409,11 @@ impl PackageInfo { let new_version = match Version::parse(&new_version_str) { Ok(new_version) => new_version, Err(err) => { - return Err(BinstallError::VersionParse { + return Err(Box::new(VersionParseError { v: new_version_str, err, }) + .into()) } }; From f45c18ff817ab61348142ac72a91433f01e4d379 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Dec 2022 14:46:59 +1300 Subject: [PATCH 0902/2020] Bump softprops/action-gh-release from 0.1.14 to 0.1.15 (#583) --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index becca73b..2e3a5310 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -75,7 +75,7 @@ jobs: run: .github/scripts/pack-release-archives.sh - name: Publish release - uses: softprops/action-gh-release@1e07f4398721186383de40550babbdf2b84acfc5 + uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 with: tag_name: ${{ needs.info.outputs.version }} name: ${{ needs.info.outputs.version }} From b564b8ac4efe3ed777903d0a8afd00c535381b09 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 3 Dec 2022 22:15:15 +1100 Subject: [PATCH 0903/2020] Fix logging: Print error and continue on failure to flush logs (#584) instead of exiting the entire process. Signed-off-by: Jiahao XU --- crates/bin/src/logging.rs | 58 +++++++++++++++++++++++++++++++++++++-- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/crates/bin/src/logging.rs b/crates/bin/src/logging.rs index 4001d773..377c7c4b 100644 --- a/crates/bin/src/logging.rs +++ b/crates/bin/src/logging.rs @@ -1,4 +1,4 @@ -use std::{cmp::min, iter::repeat}; +use std::{cmp::min, io, iter::repeat}; use log::{LevelFilter, Log, STATIC_MAX_LEVEL}; use once_cell::sync::Lazy; @@ -11,7 +11,11 @@ use tracing::{ }; use tracing_core::{identify_callsite, metadata::Kind, subscriber::Subscriber}; use tracing_log::AsTrace; -use tracing_subscriber::{filter::targets::Targets, fmt::fmt, layer::SubscriberExt}; +use tracing_subscriber::{ + filter::targets::Targets, + fmt::{fmt, MakeWriter}, + layer::SubscriberExt, +}; // Shamelessly taken from tracing-log @@ -129,6 +133,54 @@ impl Log for Logger { fn flush(&self) {} } +struct ErrorFreeWriter; + +impl io::Write for &ErrorFreeWriter { + fn write(&mut self, buf: &[u8]) -> io::Result { + io::stdout().write(buf).or_else(|err| { + write!(io::stderr(), "Failed to write to stdout: {err}").ok(); + // Behave as if writing to /dev/null so that logging system + // would keep working. + Ok(buf.len()) + }) + } + + fn write_all(&mut self, buf: &[u8]) -> io::Result<()> { + io::stdout().write_all(buf).or_else(|err| { + write!(io::stderr(), "Failed to write to stdout: {err}").ok(); + // Behave as if writing to /dev/null so that logging system + // would keep working. + Ok(()) + }) + } + + fn write_vectored(&mut self, bufs: &[io::IoSlice<'_>]) -> io::Result { + io::stdout().write_vectored(bufs).or_else(|err| { + write!(io::stderr(), "Failed to write to stdout: {err}").ok(); + // Behave as if writing to /dev/null so that logging system + // would keep working. + Ok(bufs.iter().map(|io_slice| io_slice.len()).sum()) + }) + } + + fn flush(&mut self) -> io::Result<()> { + io::stdout().flush().or_else(|err| { + write!(io::stderr(), "Failed to write to stdout: {err}").ok(); + // Behave as if writing to /dev/null so that logging system + // would keep working. + Ok(()) + }) + } +} + +impl<'a> MakeWriter<'a> for ErrorFreeWriter { + type Writer = &'a Self; + + fn make_writer(&'a self) -> Self::Writer { + self + } +} + pub fn logging(log_level: LevelFilter, json_output: bool) { // Calculate log_level let log_level = min(log_level, STATIC_MAX_LEVEL); @@ -141,7 +193,7 @@ pub fn logging(log_level: LevelFilter, json_output: bool) { // Build fmt subscriber let log_level = log_level.as_trace(); - let subscriber_builder = fmt().with_max_level(log_level); + let subscriber_builder = fmt().with_max_level(log_level).with_writer(ErrorFreeWriter); let subscriber: Box = if json_output { Box::new(subscriber_builder.json().finish()) From a69db83aa6410c4d8a27c666d777dd4a3ea863a2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 3 Dec 2022 22:57:50 +1100 Subject: [PATCH 0904/2020] Fix error reporting in main and move all arg validation into fn `args::parse` (#585) * Fix reporting parsing error from `args::parse` Report it in `args::parse` by using `Args::command().error(...).exit()` instead of returning `BinstallError`. * Rm unused variant `BinstallError::OverrideOptionUsedWithMultiInstall` * Refactor: Move `strategies` validation into `args::parse` * Rm unused variant `BinstallError::InvalidStrategies` * Add new unit test `args::test::verify_cli` Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 107 +++++++++++++++++++++++++++++++--- crates/bin/src/entry.rs | 92 +++++------------------------ crates/bin/src/main.rs | 5 +- crates/binstalk/src/errors.rs | 32 ---------- 4 files changed, 114 insertions(+), 122 deletions(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 84c936ee..30c41fc5 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -7,14 +7,14 @@ use std::{ }; use binstalk::{ - errors::BinstallError, helpers::remote::tls::Version, manifests::cargo_toml_binstall::PkgFmt, ops::resolve::{CrateName, VersionReqExt}, }; -use clap::{Parser, ValueEnum}; +use clap::{error::ErrorKind, CommandFactory, Parser, ValueEnum}; use log::LevelFilter; use semver::VersionReq; +use strum::EnumCount; use strum_macros::EnumCount; #[derive(Debug, Parser)] @@ -39,10 +39,10 @@ pub struct Args { /// If duplicate names are provided, the last one (and their version requirement) /// is kept. #[clap( - help_heading = "Package selection", - value_name = "crate[@version]", - required_unless_present_any = ["version", "help"], -)] + help_heading = "Package selection", + value_name = "crate[@version]", + required_unless_present_any = ["version", "help"], + )] pub crate_names: Vec, /// Package version to install. @@ -309,7 +309,7 @@ pub enum Strategy { Compile, } -pub fn parse() -> Result { +pub fn parse() -> Args { // Filter extraneous arg when invoked by cargo // `cargo run -- --help` gives ["target/debug/cargo-binstall", "--help"] // `cargo binstall --help` gives ["/home/ryan/.cargo/bin/cargo-binstall", "binstall", "--help"] @@ -335,6 +335,9 @@ pub fn parse() -> Result { opts.log_level = LevelFilter::Off; } + // Ensure no conflict + let mut command = Args::command(); + if opts.crate_names.len() > 1 { let option = if opts.version_req.is_some() { "version" @@ -345,9 +348,95 @@ pub fn parse() -> Result { }; if !option.is_empty() { - return Err(BinstallError::OverrideOptionUsedWithMultiInstall { option }); + command + .error( + ErrorKind::ArgumentConflict, + format_args!( + r#"override option used with multi package syntax. +You cannot use --{option} and specify multiple packages at the same time. Do one or the other."# + ), + ) + .exit(); } } - Ok(opts) + // Check strategies for duplicates + let mut new_dup_strategy_err = || { + command.error( + ErrorKind::TooManyValues, + "--strategies should not contain duplicate strategy", + ) + }; + + if opts.strategies.len() > Strategy::COUNT { + // If len of strategies is larger than number of variants of Strategy, + // then there must be duplicates by pigeon hole principle. + new_dup_strategy_err().exit() + } + + // Whether specific variant of Strategy is present + let mut is_variant_present = [false; Strategy::COUNT]; + + for strategy in &opts.strategies { + let index = *strategy as u8 as usize; + if is_variant_present[index] { + new_dup_strategy_err().exit() + } else { + is_variant_present[index] = true; + } + } + + // Default strategies if empty + if opts.strategies.is_empty() { + opts.strategies = vec![ + Strategy::CrateMetaData, + Strategy::QuickInstall, + Strategy::Compile, + ]; + } + + // Filter out all disabled strategies + if !opts.disable_strategies.is_empty() { + // Since order doesn't matter, we can sort it and remove all duplicates + // to speedup checking. + opts.disable_strategies.sort_unstable(); + opts.disable_strategies.dedup(); + + // disable_strategies.len() <= Strategy::COUNT, of which is faster + // to just use [Strategy]::contains rather than + // [Strategy]::binary_search + opts.strategies + .retain(|strategy| !opts.disable_strategies.contains(strategy)); + + if opts.strategies.is_empty() { + command + .error(ErrorKind::TooFewValues, "You have disabled all strategies") + .exit() + } + + // Free disable_strategies as it will not be used again. + opts.disable_strategies = Vec::new(); + } + + // Ensure that Strategy::Compile is specified as the last strategy + if opts.strategies[..(opts.strategies.len() - 1)].contains(&Strategy::Compile) { + command + .error( + ErrorKind::InvalidValue, + "Compile strategy must be the last one", + ) + .exit() + } + + opts +} + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn verify_cli() { + Args::command().debug_assert() + } } diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 5ae562d4..48a7161d 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -17,7 +17,6 @@ use binstalk_manifests::{ use crates_io_api::AsyncClient as CratesIoApiClient; use log::LevelFilter; use miette::{miette, Result, WrapErr}; -use strum::EnumCount; use tokio::task::block_in_place; use tracing::{debug, error, info, warn}; @@ -28,9 +27,21 @@ use crate::{ }; pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) -> Result<()> { - // Compute strategies - let (resolvers, cargo_install_fallback) = - compute_resolvers(args.strategies, args.disable_strategies)?; + // Compute Resolvers + let mut cargo_install_fallback = false; + + let resolvers: Vec<_> = args + .strategies + .into_iter() + .filter_map(|strategy| match strategy { + Strategy::CrateMetaData => Some(GhCrateMeta::new as Resolver), + Strategy::QuickInstall => Some(QuickInstall::new as Resolver), + Strategy::Compile => { + cargo_install_fallback = true; + None + } + }) + .collect(); // Compute paths let (install_path, cargo_roots, metadata, temp_dir) = @@ -183,79 +194,6 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - }) } -/// Return (resolvers, cargo_install_fallback) -fn compute_resolvers( - mut strategies: Vec, - mut disable_strategies: Vec, -) -> Result<(Vec, bool), BinstallError> { - let dup_strategy_err = - BinstallError::InvalidStrategies("--strategies should not contain duplicate strategy"); - - if strategies.len() > Strategy::COUNT { - // If len of strategies is larger than number of variants of Strategy, - // then there must be duplicates by pigeon hole principle. - return Err(dup_strategy_err); - } - - // Whether specific variant of Strategy is present - let mut is_variant_present = [false; Strategy::COUNT]; - - for strategy in &strategies { - let index = *strategy as u8 as usize; - if is_variant_present[index] { - return Err(dup_strategy_err); - } else { - is_variant_present[index] = true; - } - } - - // Default strategies if empty - if strategies.is_empty() { - strategies = vec![ - Strategy::CrateMetaData, - Strategy::QuickInstall, - Strategy::Compile, - ]; - } - - // Filter out all disabled strategies - if !disable_strategies.is_empty() { - // Since order doesn't matter, we can sort it and remove all duplicates - // to speedup checking. - disable_strategies.sort_unstable(); - disable_strategies.dedup(); - - // disable_strategies.len() <= Strategy::COUNT, of which is faster - // to just use [T]::contains rather than [T]::binary_search - strategies.retain(|strategy| !disable_strategies.contains(strategy)); - - if strategies.is_empty() { - return Err(BinstallError::InvalidStrategies( - "You have disabled all strategies", - )); - } - } - - let cargo_install_fallback = *strategies.last().unwrap() == Strategy::Compile; - - if cargo_install_fallback { - strategies.pop().unwrap(); - } - - let resolvers = strategies - .into_iter() - .map(|strategy| match strategy { - Strategy::CrateMetaData => Ok(GhCrateMeta::new as Resolver), - Strategy::QuickInstall => Ok(QuickInstall::new as Resolver), - Strategy::Compile => Err(BinstallError::InvalidStrategies( - "Compile strategy must be the last one", - )), - }) - .collect::, BinstallError>>()?; - - Ok((resolvers, cargo_install_fallback)) -} - /// Return (install_path, cargo_roots, metadata, temp_dir) fn compute_paths_and_load_manifests( roots: Option, diff --git a/crates/bin/src/main.rs b/crates/bin/src/main.rs index 9940a933..ecf0f41b 100644 --- a/crates/bin/src/main.rs +++ b/crates/bin/src/main.rs @@ -18,10 +18,7 @@ fn main() -> MainExit { // This must be the very first thing to happen let jobserver_client = LazyJobserverClient::new(); - let args = match args::parse() { - Ok(args) => args, - Err(err) => return MainExit::Error(err), - }; + let args = args::parse(); if args.version { println!("{}", env!("CARGO_PKG_VERSION")); diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index 23a02a88..5d799a8b 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -205,28 +205,6 @@ pub enum BinstallError { )] SuperfluousVersionOption, - /// An override option is used when multiple packages are to be installed. - /// - /// This is raised when more than one package name is provided and any of: - /// - /// - `--version` - /// - `--manifest-path` - /// - `--bin-dir` - /// - `--pkg-fmt` - /// - `--pkg-url` - /// - /// is provided. - /// - /// - Code: `binstall::conflict::overrides` - /// - Exit: 85 - #[error("override option used with multi package syntax")] - #[diagnostic( - severity(error), - code(binstall::conflict::overrides), - help("You cannot use --{option} and specify multiple packages at the same time. Do one or the other.") - )] - OverrideOptionUsedWithMultiInstall { option: &'static str }, - /// No binaries were found for the crate. /// /// When installing, either the binaries are specified in the crate's Cargo.toml, or they're @@ -304,14 +282,6 @@ pub enum BinstallError { #[diagnostic(severity(error), code(binstall::SourceFilePath))] EmptySourceFilePath, - /// Invalid strategies configured. - /// - /// - Code: `binstall::strategies` - /// - Exit: 93 - #[error("Invalid strategies configured: {0}")] - #[diagnostic(severity(error), code(binstall::strategies))] - InvalidStrategies(&'static str), - /// Fallback to `cargo-install` is disabled. /// /// - Code: `binstall::no_fallback_to_cargo_install` @@ -344,7 +314,6 @@ impl BinstallError { VersionParse { .. } => 80, VersionMismatch { .. } => 82, SuperfluousVersionOption => 84, - OverrideOptionUsedWithMultiInstall { .. } => 85, UnspecifiedBinaries => 86, NoViableTargets => 87, BinFileNotFound(_) => 88, @@ -352,7 +321,6 @@ impl BinstallError { DuplicateSourceFilePath { .. } => 90, InvalidSourceFilePath { .. } => 91, EmptySourceFilePath => 92, - InvalidStrategies(..) => 93, NoFallbackToCargoInstall => 94, CrateContext(context) => context.err.exit_number(), }; From 887ebb6f6fd4f3a0292f2fbfd0bf9a2d7ea41e89 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 3 Dec 2022 23:12:04 +1100 Subject: [PATCH 0905/2020] Fix `BinstallError::CrateContext`: Forward diagnostics of field `CrateContextError::err` (#586) Signed-off-by: Jiahao XU --- crates/binstalk/src/errors.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index 5d799a8b..5c263370 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -32,11 +32,12 @@ pub struct VersionParseError { pub err: semver::Error, } -#[derive(Debug, Error)] +#[derive(Debug, Diagnostic, Error)] #[error("For crate {crate_name}: {err}")] pub struct CrateContextError { crate_name: CompactString, #[source] + #[diagnostic(transparent)] err: BinstallError, } @@ -292,6 +293,7 @@ pub enum BinstallError { /// A wrapped error providing the context of which crate the error is about. #[error(transparent)] + #[diagnostic(transparent)] CrateContext(Box), } From 39f175be0410537eb22516685d679dcfff1dc6af Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 4 Dec 2022 02:25:41 +1100 Subject: [PATCH 0906/2020] Feature: Check for installed crates in cargo_install_v1_manifest (#582) * Add & Impl new fn `CratesToml::collect_into_crates_versions` to iterate over crates listed in cargo_crates_v1, accessing their names and versions. * Re-export `CompactString`, `Version` & `Url` in binstalk-manifests for convenience * Fix `CratesToml::load_from_path`: Wrap `File` in `FileLock::new_shared` to avoid concurrent write while reading the file. * Filter out installed crates in cargo_install_v1_metadata * Make match in `filter_out_installed_crates` more explicit * Add new test `cargo_crates_v1::test::test_loading` * Optimize `CratesToml`: Use `Vec` instead of `BTreeMap` since we cannot simply call `BTreeMap::get` to find an entry for a crate anyway. This also accidentally fixed the CI. * Impl new API `CratesToml::remove` * Fix`CratesToml::append_to_path` by removing previous records of the crates that are just updated. Signed-off-by: Jiahao XU --- crates/bin/src/entry.rs | 85 ++++++++++++---- .../binstalk-manifests/src/cargo_crates_v1.rs | 99 ++++++++++++++++++- crates/binstalk-manifests/src/lib.rs | 3 + 3 files changed, 164 insertions(+), 23 deletions(-) diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 48a7161d..be51cf0f 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -1,4 +1,4 @@ -use std::{fs, path::PathBuf, sync::Arc, time::Duration}; +use std::{collections::BTreeMap, fs, io, path::PathBuf, sync::Arc, time::Duration}; use binstalk::{ errors::BinstallError, @@ -12,7 +12,10 @@ use binstalk::{ }, }; use binstalk_manifests::{ - binstall_crates_v1::Records, cargo_crates_v1::CratesToml, cargo_toml_binstall::PkgOverride, + binstall_crates_v1::Records as BinstallCratesV1Records, + cargo_crates_v1::{CratesToml, CratesTomlParseError}, + cargo_toml_binstall::PkgOverride, + CompactString, Version, }; use crates_io_api::AsyncClient as CratesIoApiClient; use log::LevelFilter; @@ -167,7 +170,7 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - } block_in_place(|| { - if let Some(mut records) = metadata { + if let Some((mut cargo_binstall_metadata, _)) = metadata { // The cargo manifest path is already created when loading // metadata. @@ -176,9 +179,9 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - debug!("Writing binstall/crates-v1.json"); for metadata in metadata_vec { - records.replace(metadata); + cargo_binstall_metadata.replace(metadata); } - records.overwrite()?; + cargo_binstall_metadata.overwrite()?; } if no_cleanup { @@ -194,11 +197,13 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - }) } +type Metadata = (BinstallCratesV1Records, BTreeMap); + /// Return (install_path, cargo_roots, metadata, temp_dir) fn compute_paths_and_load_manifests( roots: Option, install_path: Option, -) -> Result<(PathBuf, PathBuf, Option, tempfile::TempDir)> { +) -> Result<(PathBuf, PathBuf, Option, tempfile::TempDir)> { block_in_place(|| { // Compute cargo_roots let cargo_roots = install_path::get_cargo_roots_path(roots).ok_or_else(|| { @@ -218,12 +223,40 @@ fn compute_paths_and_load_manifests( // Load metadata let metadata = if !custom_install_path { + // Read cargo_binstall_metadata let metadata_dir = cargo_roots.join("binstall"); fs::create_dir_all(&metadata_dir).map_err(BinstallError::Io)?; let manifest_path = metadata_dir.join("crates-v1.json"); - debug!("Reading {}", manifest_path.display()); - Some(Records::load_from_path(&manifest_path)?) + debug!( + "Reading {} from {}", + "cargo_binstall_metadata", + manifest_path.display() + ); + + let cargo_binstall_metadata = BinstallCratesV1Records::load_from_path(&manifest_path)?; + + // Read cargo_install_v1_metadata + let manifest_path = cargo_roots.join(".crates.toml"); + + debug!( + "Reading {} from {}", + "cargo_install_v1_metadata", + manifest_path.display() + ); + + let cargo_install_v1_metadata = match CratesToml::load_from_path(&manifest_path) { + Ok(metadata) => metadata.collect_into_crates_versions()?, + Err(CratesTomlParseError::Io(io_err)) + if io_err.kind() == io::ErrorKind::NotFound => + { + // .crates.toml does not exist, create an empty BTreeMap + Default::default() + } + Err(err) => Err(err)?, + }; + + Some((cargo_binstall_metadata, cargo_install_v1_metadata)) } else { None }; @@ -247,30 +280,42 @@ fn compute_paths_and_load_manifests( fn filter_out_installed_crates( crate_names: Vec, force: bool, - metadata: Option<&Records>, + metadata: Option<&Metadata>, ) -> impl Iterator)> + '_ { CrateName::dedup(crate_names) .filter_map(move |crate_name| { + let name = &crate_name.name; + + let curr_version = metadata + .and_then(|metadata| { + metadata + .0 + .get(name) + .map(|crate_info| &crate_info.current_version) + .into_iter() + .chain(metadata.1.get(name)) + // Since the cargo_install_v1_metadata could be out of sync + // from cargo_binstall_metadata, it is better to obtain + // the version from both of them and takes the larger one. + .max() + }); + match ( force, - metadata.and_then(|records| records.get(&crate_name.name)), + curr_version, &crate_name.version_req, ) { - (false, Some(metadata), Some(version_req)) - if version_req.is_latest_compatible(&metadata.current_version) => + (false, Some(curr_version), Some(version_req)) + if version_req.is_latest_compatible(curr_version) => { debug!("Bailing out early because we can assume wanted is already installed from metafile"); - info!( - "{} v{} is already installed, use --force to override", - crate_name.name, metadata.current_version - ); + info!("{name} v{curr_version} is already installed, use --force to override"); None } - // we have to assume that the version req could be *, - // and therefore a remote upgraded version could exist - (false, Some(metadata), _) => { - Some((crate_name, Some(metadata.current_version.clone()))) + // The version req is "*" thus a remote upgraded version could exist + (false, Some(curr_version), None) => { + Some((crate_name, Some(curr_version.clone()))) } _ => Some((crate_name, None)), diff --git a/crates/binstalk-manifests/src/cargo_crates_v1.rs b/crates/binstalk-manifests/src/cargo_crates_v1.rs index 8d9033fa..6db43bd1 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1.rs @@ -13,12 +13,14 @@ use std::{ io::{self, Seek}, iter::IntoIterator, path::{Path, PathBuf}, + str::FromStr, }; use compact_str::CompactString; use fs_lock::FileLock; use home::cargo_home; use miette::Diagnostic; +use semver::Version; use serde::{Deserialize, Serialize}; use thiserror::Error; @@ -31,7 +33,8 @@ use crate_version_source::*; #[derive(Clone, Debug, Default, Deserialize, Serialize)] pub struct CratesToml { - v1: BTreeMap>, + #[serde(with = "tuple_vec_map")] + v1: Vec<(String, Vec)>, } impl CratesToml { @@ -50,12 +53,22 @@ impl CratesToml { } pub fn load_from_path(path: impl AsRef) -> Result { - let file = File::open(path)?; + let file = FileLock::new_shared(File::open(path)?)?; Self::load_from_reader(file) } + /// Only use it when you know that the crate is not in the manifest. + /// Otherwise, you need to call [`CratesToml::remove`] first. pub fn insert(&mut self, cvs: &CrateVersionSource, bins: Vec) { - self.v1.insert(cvs.to_string(), bins); + self.v1.push((cvs.to_string(), bins)); + } + + pub fn remove(&mut self, name: &str) { + self.v1.retain(|(s, _bin)| { + s.split_once(' ') + .map(|(crate_name, _rest)| crate_name != name) + .unwrap_or_default() + }); } pub fn write(&self) -> Result<(), CratesTomlParseError> { @@ -96,6 +109,7 @@ impl CratesToml { }; for metadata in iter { + c1.remove(&metadata.name); c1.insert(&CrateVersionSource::from(metadata), metadata.bins.clone()); } @@ -111,6 +125,20 @@ impl CratesToml { { Self::append_to_path(Self::default_path()?, iter) } + + /// Return BTreeMap with crate name as key and its corresponding version + /// as value. + pub fn collect_into_crates_versions( + self, + ) -> Result, CratesTomlParseError> { + self.v1 + .into_iter() + .map(|(s, _bins)| { + let cvs = CrateVersionSource::from_str(&s)?; + Ok((cvs.name, cvs.version)) + }) + .collect() + } } #[derive(Debug, Diagnostic, Error)] @@ -167,5 +195,70 @@ mod tests { }], ) .unwrap(); + + let crates = CratesToml::load_from_path(&path) + .unwrap() + .collect_into_crates_versions() + .unwrap(); + + assert_eq!(crates.len(), 1); + + assert_eq!( + crates.get("cargo-binstall").unwrap(), + &Version::new(0, 11, 1) + ); + + // Update + CratesToml::append_to_path( + &path, + &[CrateInfo { + name: "cargo-binstall".into(), + version_req: "*".into(), + current_version: Version::new(0, 12, 0), + source: CrateSource::cratesio_registry(), + target: TARGET.into(), + bins: vec!["cargo-binstall".into()], + }], + ) + .unwrap(); + + let crates = CratesToml::load_from_path(&path) + .unwrap() + .collect_into_crates_versions() + .unwrap(); + + assert_eq!(crates.len(), 1); + + assert_eq!( + crates.get("cargo-binstall").unwrap(), + &Version::new(0, 12, 0) + ); + } + + #[test] + fn test_loading() { + let raw_data = br#" +[v1] +"alacritty 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = ["alacritty"] +"cargo-audit 0.17.0 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-audit"] +"cargo-binstall 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-binstall"] +"cargo-criterion 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-criterion"] +"cargo-edit 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-add", "cargo-rm", "cargo-set-version", "cargo-upgrade"] +"cargo-expand 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-expand"] +"cargo-geiger 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-geiger"] +"cargo-hack 0.5.15 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-hack"] +"cargo-nextest 0.9.26 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-nextest"] +"cargo-supply-chain 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-supply-chain"] +"cargo-tarpaulin 0.20.1 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-tarpaulin"] +"cargo-update 8.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-install-update", "cargo-install-update-config"] +"cargo-watch 8.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-watch"] +"cargo-with 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = ["cargo-with"] +"cross 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = ["cross", "cross-util"] +"irust 1.63.3 (registry+https://github.com/rust-lang/crates.io-index)" = ["irust"] +"tokei 12.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = ["tokei"] +"xargo 0.3.26 (registry+https://github.com/rust-lang/crates.io-index)" = ["xargo", "xargo-check"] + "#; + + CratesToml::load_from_reader(raw_data.as_slice()).unwrap(); } } diff --git a/crates/binstalk-manifests/src/lib.rs b/crates/binstalk-manifests/src/lib.rs index a87d5bcc..418764f6 100644 --- a/crates/binstalk-manifests/src/lib.rs +++ b/crates/binstalk-manifests/src/lib.rs @@ -14,3 +14,6 @@ pub mod binstall_crates_v1; pub mod cargo_crates_v1; pub use binstalk_types::{cargo_toml_binstall, crate_info}; +pub use compact_str::CompactString; +pub use semver::Version; +pub use url::Url; From 23a5937aff3f1c3f7367b5f71fd9001d198553e2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 4 Dec 2022 12:31:34 +1100 Subject: [PATCH 0907/2020] Optimization: Rewrite Download::and_visit_tar to use tokio-tar (#587) * Add new dep tokio-tar v0.3.0 to binstalk-downloader * Add new dep tokio-util v0.7.4 with feat io to binstalk-downloader * Add dep async-trait v0.1.59 to binstalk-downloader * Add new dep async-compression v0.3.15 to binstalk-downloader with features "gzip", "zstd", "xz", "bzip2", "tokio". * Rewrite `Download::and_visit_tar` to use `tokio-tar` to avoid the cumbersome `block_in_place`. * Apply temporary workaround: Rm use of let-else in mod visitor Signed-off-by: Jiahao XU --- Cargo.lock | 34 +++++ crates/binstalk-downloader/Cargo.toml | 4 + crates/binstalk-downloader/src/download.rs | 27 +++- .../src/download/async_extracter.rs | 38 +----- .../src/download/async_tar_visitor.rs | 129 ++++++++++++++++++ .../binstalk/src/drivers/crates_io/visitor.rs | 54 ++++---- 6 files changed, 218 insertions(+), 68 deletions(-) create mode 100644 crates/binstalk-downloader/src/download/async_tar_visitor.rs diff --git a/Cargo.lock b/Cargo.lock index 908aa1f6..fb3ba359 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -59,11 +59,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" dependencies = [ "brotli", + "bzip2", "flate2", "futures-core", "memchr", "pin-project-lite", "tokio", + "xz2", + "zstd 0.11.2+zstd.1.5.2", + "zstd-safe 5.0.2+zstd.1.5.2", ] [[package]] @@ -150,6 +154,8 @@ dependencies = [ name = "binstalk-downloader" version = "0.1.0" dependencies = [ + "async-compression", + "async-trait", "binstalk-types", "binstall-tar", "bytes", @@ -164,6 +170,8 @@ dependencies = [ "tempfile", "thiserror", "tokio", + "tokio-tar", + "tokio-util", "tower", "tracing", "trust-dns-resolver", @@ -2245,6 +2253,32 @@ dependencies = [ "webpki", ] +[[package]] +name = "tokio-stream" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-tar" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a50188549787c32c1c3d9c8c71ad7e003ccf2f102489c5a96e385c84760477f4" +dependencies = [ + "filetime", + "futures-core", + "libc", + "redox_syscall", + "tokio", + "tokio-stream", + "xattr", +] + [[package]] name = "tokio-util" version = "0.7.4" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index c081ccd9..211d9ce4 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -10,6 +10,8 @@ edition = "2021" license = "GPL-3.0" [dependencies] +async-trait = "0.1.59" +async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } binstalk-types = { version = "0.1.0", path = "../binstalk-types" } bytes = "1.3.0" bzip2 = "0.4.3" @@ -28,6 +30,8 @@ tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.3.0" thiserror = "1.0.37" tokio = { version = "1.22.0", features = ["macros", "rt-multi-thread", "sync", "time"], default-features = false } +tokio-tar = "0.3.0" +tokio-util = { version = "0.7.4", features = ["io"] } tower = { version = "0.4.13", features = ["limit", "util"] } tracing = "0.1.37" trust-dns-resolver = { version = "0.22.0", optional = true, default-features = false, features = ["dnssec-ring"] } diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index 7cac3ff6..ac9eacb6 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -2,19 +2,21 @@ use std::{fmt::Debug, future::Future, io, marker::PhantomData, path::Path, pin:: use binstalk_types::cargo_toml_binstall::{PkgFmtDecomposed, TarBasedFmt}; use digest::{Digest, FixedOutput, HashMarker, Output, OutputSizeUser, Update}; +use futures_util::stream::StreamExt; use thiserror::Error as ThisError; use tracing::{debug, instrument}; pub use binstalk_types::cargo_toml_binstall::PkgFmt; -pub use tar::Entries; pub use zip::result::ZipError; use crate::remote::{Client, Error as RemoteError, Url}; mod async_extracter; -pub use async_extracter::TarEntriesVisitor; use async_extracter::*; +mod async_tar_visitor; +pub use async_tar_visitor::*; + mod extracter; mod stream_readable; @@ -92,6 +94,9 @@ impl Download { /// /// `cancellation_future` can be used to cancel the extraction and return /// [`DownloadError::UserAbort`] error. + /// + /// NOTE that this API does not support gnu extension sparse file unlike + /// [`Download::and_extract`]. #[instrument(skip(visitor, cancellation_future))] pub async fn and_visit_tar( self, @@ -99,12 +104,24 @@ impl Download { visitor: V, cancellation_future: CancellationFuture, ) -> Result { - let stream = self.client.get_stream(self.url).await?; + let stream = self + .client + .get_stream(self.url) + .await? + .map(|res| res.map_err(DownloadError::from)); debug!("Downloading and extracting then in-memory processing"); - let ret = - extract_tar_based_stream_and_visit(stream, fmt, visitor, cancellation_future).await?; + let ret = if let Some(cancellation_future) = cancellation_future { + tokio::select! { + res = extract_tar_based_stream_and_visit(stream, fmt, visitor) => res?, + res = cancellation_future => { + Err(res.err().unwrap_or_else(|| io::Error::from(DownloadError::UserAbort)))? + } + } + } else { + extract_tar_based_stream_and_visit(stream, fmt, visitor).await? + }; debug!("Download, extraction and in-memory procession OK"); diff --git a/crates/binstalk-downloader/src/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs index b36deed9..bf7fd9e2 100644 --- a/crates/binstalk-downloader/src/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -1,14 +1,8 @@ -use std::{ - fmt::Debug, - fs, - io::{Read, Seek}, - path::Path, -}; +use std::{fs, io::Seek, path::Path}; use bytes::Bytes; use futures_util::stream::Stream; use scopeguard::{guard, ScopeGuard}; -use tar::Entries; use tempfile::tempfile; use tokio::task::block_in_place; use tracing::debug; @@ -93,33 +87,3 @@ where Ok(()) }) } - -/// Visitor must iterate over all entries. -/// Entires can be in arbitary order. -pub trait TarEntriesVisitor { - type Target; - - fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), DownloadError>; - fn finish(self) -> Result; -} - -pub async fn extract_tar_based_stream_and_visit( - stream: S, - fmt: TarBasedFmt, - mut visitor: V, - cancellation_future: CancellationFuture, -) -> Result -where - S: Stream> + Unpin + 'static, - V: TarEntriesVisitor + Debug + Send + 'static, - DownloadError: From, -{ - let reader = StreamReadable::new(stream, cancellation_future).await; - block_in_place(move || { - debug!("Extracting from {fmt} archive to process it in memory"); - - let mut tar = create_tar_decoder(reader, fmt)?; - visitor.visit(tar.entries()?)?; - visitor.finish() - }) -} diff --git a/crates/binstalk-downloader/src/download/async_tar_visitor.rs b/crates/binstalk-downloader/src/download/async_tar_visitor.rs new file mode 100644 index 00000000..d33ba2ef --- /dev/null +++ b/crates/binstalk-downloader/src/download/async_tar_visitor.rs @@ -0,0 +1,129 @@ +use std::{borrow::Cow, fmt::Debug, io, path::Path, pin::Pin}; + +use async_compression::tokio::bufread; +use bytes::Bytes; +use futures_util::stream::{Stream, StreamExt}; +use tokio::io::{copy, sink, AsyncRead}; +use tokio_tar::{Archive, Entry, EntryType}; +use tokio_util::io::StreamReader; +use tracing::debug; + +use super::{ + DownloadError, + TarBasedFmt::{self, *}, +}; + +pub trait TarEntry: AsyncRead + Send + Sync + Unpin + Debug { + /// Returns the path name for this entry. + /// + /// This method may fail if the pathname is not valid Unicode and + /// this is called on a Windows platform. + /// + /// Note that this function will convert any `\` characters to + /// directory separators. + fn path(&self) -> io::Result>; + + fn size(&self) -> io::Result; + + fn entry_type(&self) -> TarEntryType; +} + +impl TarEntry for &mut T { + fn path(&self) -> io::Result> { + T::path(self) + } + + fn size(&self) -> io::Result { + T::size(self) + } + + fn entry_type(&self) -> TarEntryType { + T::entry_type(self) + } +} + +impl TarEntry for Entry { + fn path(&self) -> io::Result> { + Entry::path(self) + } + + fn size(&self) -> io::Result { + self.header().size() + } + + fn entry_type(&self) -> TarEntryType { + match self.header().entry_type() { + EntryType::Regular => TarEntryType::Regular, + EntryType::Link => TarEntryType::Link, + EntryType::Symlink => TarEntryType::Symlink, + EntryType::Char => TarEntryType::Char, + EntryType::Block => TarEntryType::Block, + EntryType::Directory => TarEntryType::Directory, + EntryType::Fifo => TarEntryType::Fifo, + // Implementation-defined ‘high-performance’ type, treated as regular file + EntryType::Continuous => TarEntryType::Regular, + _ => TarEntryType::Unknown, + } + } +} + +#[derive(Copy, Clone, Debug)] +#[non_exhaustive] +pub enum TarEntryType { + Regular, + Link, + Symlink, + Char, + Block, + Directory, + Fifo, + Unknown, +} + +/// Visitor must iterate over all entries. +/// Entires can be in arbitary order. +#[async_trait::async_trait] +pub trait TarEntriesVisitor: Send + Sync { + type Target; + + /// Will be called once per entry + async fn visit(&mut self, entry: &mut dyn TarEntry) -> Result<(), DownloadError>; + fn finish(self) -> Result; +} + +pub async fn extract_tar_based_stream_and_visit( + stream: S, + fmt: TarBasedFmt, + mut visitor: V, +) -> Result +where + S: Stream> + Send + Sync, + V: TarEntriesVisitor, +{ + debug!("Extracting from {fmt} archive to process it in memory"); + + let reader = StreamReader::new(stream); + let decoder: Pin> = match fmt { + Tar => Box::pin(reader), + Tbz2 => Box::pin(bufread::BzDecoder::new(reader)), + Tgz => Box::pin(bufread::GzipDecoder::new(reader)), + Txz => Box::pin(bufread::XzDecoder::new(reader)), + Tzstd => Box::pin(bufread::ZstdDecoder::new(reader)), + }; + + let mut tar = Archive::new(decoder); + let mut entries = tar.entries()?; + + let mut sink = sink(); + + while let Some(res) = entries.next().await { + let mut entry = res?; + visitor.visit(&mut entry).await?; + + // Consume all remaining data so that next iteration would work fine + // instead of reading the data of prevoius entry. + copy(&mut entry, &mut sink).await?; + } + + visitor.finish() +} diff --git a/crates/binstalk/src/drivers/crates_io/visitor.rs b/crates/binstalk/src/drivers/crates_io/visitor.rs index b182659d..26366759 100644 --- a/crates/binstalk/src/drivers/crates_io/visitor.rs +++ b/crates/binstalk/src/drivers/crates_io/visitor.rs @@ -1,16 +1,17 @@ use std::{ - io::{self, Read}, + io, path::{Path, PathBuf}, }; use cargo_toml::Manifest; use normalize_path::NormalizePath; +use tokio::io::AsyncReadExt; use tracing::debug; use super::vfs::Vfs; use crate::{ errors::BinstallError, - helpers::download::{DownloadError, Entries, TarEntriesVisitor}, + helpers::download::{DownloadError, TarEntriesVisitor, TarEntry}, manifests::cargo_toml_binstall::Meta, }; @@ -34,36 +35,37 @@ impl ManifestVisitor { } } +#[async_trait::async_trait] impl TarEntriesVisitor for ManifestVisitor { type Target = Manifest; - fn visit(&mut self, entries: Entries<'_, R>) -> Result<(), DownloadError> { - for res in entries { - let mut entry = res?; - let path = entry.path()?; - let path = path.normalize(); + async fn visit(&mut self, entry: &mut dyn TarEntry) -> Result<(), DownloadError> { + let path = entry.path()?; + let path = path.normalize(); - let Ok(path) = path.strip_prefix(&self.manifest_dir_path) - else { - // The path is outside of the curr dir (manifest dir), - // ignore it. - continue; - }; + let path = if let Ok(path) = path.strip_prefix(&self.manifest_dir_path) { + path + } else { + // The path is outside of the curr dir (manifest dir), + // ignore it. + return Ok(()); + }; - if path == Path::new("Cargo.toml") - || path == Path::new("src/main.rs") - || path.starts_with("src/bin") - { - self.vfs.add_path(path); - } + if path == Path::new("Cargo.toml") + || path == Path::new("src/main.rs") + || path.starts_with("src/bin") + { + self.vfs.add_path(path); + } - if path == Path::new("Cargo.toml") { - // Since it is possible for the same Cargo.toml to appear - // multiple times using `tar --keep-old-files`, here we - // clear the buffer first before reading into it. - self.cargo_toml_content.clear(); - entry.read_to_end(&mut self.cargo_toml_content)?; - } + if path == Path::new("Cargo.toml") { + // Since it is possible for the same Cargo.toml to appear + // multiple times using `tar --keep-old-files`, here we + // clear the buffer first before reading into it. + self.cargo_toml_content.clear(); + self.cargo_toml_content + .reserve_exact(entry.size()?.try_into().unwrap_or(usize::MAX)); + entry.read_to_end(&mut self.cargo_toml_content).await?; } Ok(()) From ec026c171168ba3ac8b1804b5ac84d2248da1810 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 4 Dec 2022 12:46:30 +1100 Subject: [PATCH 0908/2020] Optimize `CratesToml::collect_into_crates_versions` (#589) Avoid calling `CrateVersionSource::from_str` which parses the source and allocates `Url`. Signed-off-by: Jiahao XU --- crates/binstalk-manifests/src/cargo_crates_v1.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/crates/binstalk-manifests/src/cargo_crates_v1.rs b/crates/binstalk-manifests/src/cargo_crates_v1.rs index 6db43bd1..536c484b 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1.rs @@ -13,7 +13,6 @@ use std::{ io::{self, Seek}, iter::IntoIterator, path::{Path, PathBuf}, - str::FromStr, }; use compact_str::CompactString; @@ -131,12 +130,16 @@ impl CratesToml { pub fn collect_into_crates_versions( self, ) -> Result, CratesTomlParseError> { + fn parse_name_ver(s: &str) -> Result<(CompactString, Version), CvsParseError> { + match s.splitn(3, ' ').collect::>()[..] { + [name, version, _source] => Ok((CompactString::new(name), version.parse()?)), + _ => Err(CvsParseError::BadFormat), + } + } + self.v1 .into_iter() - .map(|(s, _bins)| { - let cvs = CrateVersionSource::from_str(&s)?; - Ok((cvs.name, cvs.version)) - }) + .map(|(s, _bins)| parse_name_ver(&s).map_err(CratesTomlParseError::from)) .collect() } } From 75d2fc4d42f1699e00312380b81553c92466a91a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 9 Dec 2022 13:14:37 +1100 Subject: [PATCH 0909/2020] Optimize pre-built artifact size: Set compression level for `zip` to 9 (max) (#596) Signed-off-by: Jiahao XU --- .github/scripts/pack-release-archives.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/pack-release-archives.sh b/.github/scripts/pack-release-archives.sh index e79116f1..8ecb1c48 100755 --- a/.github/scripts/pack-release-archives.sh +++ b/.github/scripts/pack-release-archives.sh @@ -8,7 +8,7 @@ for o in outputs/*; do target=$(basename "$o" | cut -d. -f1) if grep -qE '(apple|windows)' <<< "$target"; then - zip "../cargo-binstall-${target}.zip" * + zip -9 "../cargo-binstall-${target}.zip" * else tar cv * | gzip -9 > "../cargo-binstall-${target}.tgz" fi From e6f969245ab6c85df8f774fcfc9ad0a4b3bfd0fe Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 11 Dec 2022 14:47:23 +0000 Subject: [PATCH 0910/2020] Bump zstd from 0.12.0+zstd.1.5.2 to 0.12.1+zstd.1.5.2 (#595) Bumps [zstd](https://github.com/gyscos/zstd-rs) from 0.12.0+zstd.1.5.2 to 0.12.1+zstd.1.5.2. - [Release notes](https://github.com/gyscos/zstd-rs/releases) - [Commits](https://github.com/gyscos/zstd-rs/compare/v0.12.0...v0.12.1) --- updated-dependencies: - dependency-name: zstd dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 6 +++--- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fb3ba359..ce3fb94e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -178,7 +178,7 @@ dependencies = [ "url", "xz2", "zip", - "zstd 0.12.0+zstd.1.5.2", + "zstd 0.12.1+zstd.1.5.2", ] [[package]] @@ -2889,9 +2889,9 @@ dependencies = [ [[package]] name = "zstd" -version = "0.12.0+zstd.1.5.2" +version = "0.12.1+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8148aa921e9d53217ab9322f8553bd130f7ae33489db68b381d76137d2e6374" +checksum = "5c947d2adc84ff9a59f2e3c03b81aa4128acf28d6ad7d56273f7e8af14e47bea" dependencies = [ "zstd-safe 6.0.2+zstd.1.5.2", ] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 211d9ce4..a09feddf 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -51,7 +51,7 @@ zip = { version = "0.6.3", default-features = false, features = ["deflate", "bzi # Since zip 0.6.3 depends on zstd 0.11, we can use 0.12.0 here # because it uses the same zstd-sys version. # Otherwise there will be a link conflict. -zstd = { version = "0.12.0", default-features = false } +zstd = { version = "0.12.1", default-features = false } [features] default = ["static", "rustls"] From 3b1a7f2c78ed7291490a77f55267a0514561db26 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 12 Dec 2022 11:44:34 +1100 Subject: [PATCH 0911/2020] Optimize `extract_zip`: Use `async_zip::read::stream::ZipFileReader` to avoid temporary file (#590) * Add new dep async_zip v0.0.9 to binstalk-downloader with features "gzip", "zstd", "xz", "bzip2", "tokio". * Refactor: Simplify `async_extracter::extract_*` API * Refactor: Create newtype wrapper of `ZipError` so that the zip can be upgraded without affecting API of this crate. * Enable feature fs of dep tokio in binstalk-downloader * Rewrite `extract_zip` to use `async_zip::read::stream::ZipFileReader` which avoids writing the zip file to a temporary file and then read it back into memory. * Refactor: Impl new fn `await_on_option` and use it * Optimize `tokio::select!`: Make them biased and check for cancellation first to make cancellation takes effect ASAP. * Rm unused dep zip from binstalk-downloader Signed-off-by: Jiahao XU --- Cargo.lock | 176 +++++++++++++++--- crates/binstalk-downloader/Cargo.toml | 11 +- crates/binstalk-downloader/src/download.rs | 27 ++- .../src/download/async_extracter.rs | 49 ++--- .../src/download/extracter.rs | 19 +- .../src/download/stream_readable.rs | 19 +- .../binstalk-downloader/src/download/utils.rs | 16 ++ .../src/download/zip_extraction.rs | 149 +++++++++++++++ 8 files changed, 372 insertions(+), 94 deletions(-) create mode 100644 crates/binstalk-downloader/src/download/utils.rs create mode 100644 crates/binstalk-downloader/src/download/zip_extraction.rs diff --git a/Cargo.lock b/Cargo.lock index ce3fb94e..955b65f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,6 +52,15 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "async-compression" version = "0.3.15" @@ -81,6 +90,29 @@ dependencies = [ "syn", ] +[[package]] +name = "async_io_utilities" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b20cffc5590f4bf33f05f97a3ea587feba9c50d20325b401daa096b92ff7da0" +dependencies = [ + "tokio", +] + +[[package]] +name = "async_zip" +version = "0.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a36d43bdefc7215b2b3a97edd03b1553b7969ad76551025eedd3b913c645f6e" +dependencies = [ + "async-compression", + "async_io_utilities", + "chrono", + "crc32fast", + "thiserror", + "tokio", +] + [[package]] name = "atty" version = "0.2.14" @@ -156,6 +188,7 @@ version = "0.1.0" dependencies = [ "async-compression", "async-trait", + "async_zip", "binstalk-types", "binstall-tar", "bytes", @@ -177,7 +210,6 @@ dependencies = [ "trust-dns-resolver", "url", "xz2", - "zip", "zstd 0.12.1+zstd.1.5.2", ] @@ -366,9 +398,14 @@ version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" dependencies = [ + "iana-time-zone", + "js-sys", "num-integer", "num-traits", "serde", + "time", + "wasm-bindgen", + "winapi", ] [[package]] @@ -417,6 +454,16 @@ dependencies = [ "cc", ] +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + [[package]] name = "combine" version = "4.6.6" @@ -482,15 +529,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam-utils" -version = "0.8.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "422f23e724af1240ec469ea1e834d87a4b59ce2efe2c6a96256b0c47e2fd86aa" -dependencies = [ - "cfg-if", -] - [[package]] name = "crypto-common" version = "0.1.6" @@ -501,6 +539,50 @@ dependencies = [ "typenum", ] +[[package]] +name = "cxx" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdf07d07d6531bfcdbe9b8b739b104610c6508dcc4d63b410585faf338241daf" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2eb5b96ecdc99f72657332953d4d9c50135af1bac34277801cc3937906ebd39" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac040a39517fd1674e0f32177648334b0f4074625b5588a64519804ba0553b12" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1362b0ddcfc4eb0a1f57b68bd77dd99f0e826958a96abd0ae9bd092e114ffed6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "data-encoding" version = "2.3.2" @@ -810,7 +892,7 @@ checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", ] [[package]] @@ -987,6 +1069,30 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "iana-time-zone" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + [[package]] name = "idna" version = "0.2.3" @@ -1158,6 +1264,15 @@ dependencies = [ "libc", ] +[[package]] +name = "link-cplusplus" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +dependencies = [ + "cc", +] + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -1305,7 +1420,7 @@ checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" dependencies = [ "libc", "log", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.42.0", ] @@ -1881,6 +1996,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "scratch" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" + [[package]] name = "sct" version = "0.7.0" @@ -2176,6 +2297,17 @@ dependencies = [ "once_cell", ] +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -2599,6 +2731,12 @@ dependencies = [ "try-lock", ] +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" @@ -2864,20 +3002,6 @@ dependencies = [ "lzma-sys", ] -[[package]] -name = "zip" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "537ce7411d25e54e8ae21a7ce0b15840e7bfcff15b51d697ec3266cc76bdf080" -dependencies = [ - "byteorder", - "bzip2", - "crc32fast", - "crossbeam-utils", - "flate2", - "zstd 0.11.2+zstd.1.5.2", -] - [[package]] name = "zstd" version = "0.11.2+zstd.1.5.2" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index a09feddf..ffef2324 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -12,6 +12,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.59" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } +async_zip = { version = "0.0.9", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } binstalk-types = { version = "0.1.0", path = "../binstalk-types" } bytes = "1.3.0" bzip2 = "0.4.3" @@ -29,7 +30,7 @@ scopeguard = "1.1.0" tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.3.0" thiserror = "1.0.37" -tokio = { version = "1.22.0", features = ["macros", "rt-multi-thread", "sync", "time"], default-features = false } +tokio = { version = "1.22.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.4", features = ["io"] } tower = { version = "0.4.13", features = ["limit", "util"] } @@ -39,14 +40,6 @@ url = "2.3.1" xz2 = "0.1.7" -# Disable all features of zip except for features of compression algorithms: -# Disabled features include: -# - aes-crypto: Enables decryption of files which were encrypted with AES, absolutely zero use for -# this crate. -# - time: Enables features using the [time](https://github.com/time-rs/time) crate, -# which is not used by this crate. -zip = { version = "0.6.3", default-features = false, features = ["deflate", "bzip2", "zstd"] } - # zstd is also depended by zip. # Since zip 0.6.3 depends on zstd 0.11, we can use 0.12.0 here # because it uses the same zstd-sys version. diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index ac9eacb6..a3a9469a 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -7,7 +7,6 @@ use thiserror::Error as ThisError; use tracing::{debug, instrument}; pub use binstalk_types::cargo_toml_binstall::PkgFmt; -pub use zip::result::ZipError; use crate::remote::{Client, Error as RemoteError, Url}; @@ -20,6 +19,12 @@ pub use async_tar_visitor::*; mod extracter; mod stream_readable; +mod zip_extraction; +pub use zip_extraction::ZipError; + +mod utils; +use utils::await_on_option; + pub type CancellationFuture = Option> + Send>>>; #[derive(Debug, ThisError)] @@ -112,15 +117,13 @@ impl Download { debug!("Downloading and extracting then in-memory processing"); - let ret = if let Some(cancellation_future) = cancellation_future { - tokio::select! { - res = extract_tar_based_stream_and_visit(stream, fmt, visitor) => res?, - res = cancellation_future => { - Err(res.err().unwrap_or_else(|| io::Error::from(DownloadError::UserAbort)))? - } + let ret = tokio::select! { + biased; + + res = await_on_option(cancellation_future) => { + Err(res.err().unwrap_or_else(|| io::Error::from(DownloadError::UserAbort)))? } - } else { - extract_tar_based_stream_and_visit(stream, fmt, visitor).await? + res = extract_tar_based_stream_and_visit(stream, fmt, visitor) => res?, }; debug!("Download, extraction and in-memory procession OK"); @@ -145,7 +148,11 @@ impl Download { path: &Path, cancellation_future: CancellationFuture, ) -> Result<(), DownloadError> { - let stream = this.client.get_stream(this.url).await?; + let stream = this + .client + .get_stream(this.url) + .await? + .map(|res| res.map_err(DownloadError::from)); debug!("Downloading and extracting to: '{}'", path.display()); diff --git a/crates/binstalk-downloader/src/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs index bf7fd9e2..5034374b 100644 --- a/crates/binstalk-downloader/src/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -1,24 +1,25 @@ -use std::{fs, io::Seek, path::Path}; +use std::{fs, path::Path}; +use async_zip::read::stream::ZipFileReader; use bytes::Bytes; use futures_util::stream::Stream; use scopeguard::{guard, ScopeGuard}; -use tempfile::tempfile; use tokio::task::block_in_place; +use tokio_util::io::StreamReader; use tracing::debug; use super::{ - extracter::*, stream_readable::StreamReadable, CancellationFuture, DownloadError, TarBasedFmt, + await_on_option, extracter::*, stream_readable::StreamReadable, + zip_extraction::extract_zip_entry, CancellationFuture, DownloadError, TarBasedFmt, ZipError, }; -pub async fn extract_bin( +pub async fn extract_bin( stream: S, path: &Path, cancellation_future: CancellationFuture, ) -> Result<(), DownloadError> where - S: Stream> + Unpin + 'static, - DownloadError: From, + S: Stream> + Unpin + 'static, { let mut reader = StreamReadable::new(stream, cancellation_future).await; block_in_place(move || { @@ -42,39 +43,45 @@ where }) } -pub async fn extract_zip( +pub async fn extract_zip( stream: S, path: &Path, cancellation_future: CancellationFuture, ) -> Result<(), DownloadError> where - S: Stream> + Unpin + 'static, - DownloadError: From, + S: Stream> + Unpin + Send + Sync + 'static, { - let mut reader = StreamReadable::new(stream, cancellation_future).await; - block_in_place(move || { - fs::create_dir_all(path.parent().unwrap())?; + debug!("Decompressing from zip archive to `{}`", path.display()); - let mut file = tempfile()?; + let extract_future = Box::pin(async move { + let reader = StreamReader::new(stream); + let mut zip = ZipFileReader::new(reader); - reader.copy(&mut file)?; + while let Some(entry) = zip.entry_reader().await.map_err(ZipError::from_inner)? { + extract_zip_entry(entry, path).await?; + } - // rewind it so that we can pass it to unzip - file.rewind()?; + Ok(()) + }); - unzip(file, path) - }) + tokio::select! { + biased; + + res = await_on_option(cancellation_future) => { + Err(res.err().map(DownloadError::from).unwrap_or(DownloadError::UserAbort)) + } + res = extract_future => res, + } } -pub async fn extract_tar_based_stream( +pub async fn extract_tar_based_stream( stream: S, path: &Path, fmt: TarBasedFmt, cancellation_future: CancellationFuture, ) -> Result<(), DownloadError> where - S: Stream> + Unpin + 'static, - DownloadError: From, + S: Stream> + Unpin + 'static, { let reader = StreamReadable::new(stream, cancellation_future).await; block_in_place(move || { diff --git a/crates/binstalk-downloader/src/download/extracter.rs b/crates/binstalk-downloader/src/download/extracter.rs index c33e9081..32e131e6 100644 --- a/crates/binstalk-downloader/src/download/extracter.rs +++ b/crates/binstalk-downloader/src/download/extracter.rs @@ -1,18 +1,12 @@ -use std::{ - fs::File, - io::{self, BufRead, Read}, - path::Path, -}; +use std::io::{self, BufRead, Read}; use bzip2::bufread::BzDecoder; use flate2::bufread::GzDecoder; use tar::Archive; -use tracing::debug; use xz2::bufread::XzDecoder; -use zip::read::ZipArchive; use zstd::stream::Decoder as ZstdDecoder; -use super::{DownloadError, TarBasedFmt}; +use super::TarBasedFmt; pub fn create_tar_decoder( dat: impl BufRead + 'static, @@ -35,12 +29,3 @@ pub fn create_tar_decoder( Ok(Archive::new(r)) } - -pub fn unzip(dat: File, dst: &Path) -> Result<(), DownloadError> { - debug!("Decompressing from zip archive to `{dst:?}`"); - - let mut zip = ZipArchive::new(dat)?; - zip.extract(dst)?; - - Ok(()) -} diff --git a/crates/binstalk-downloader/src/download/stream_readable.rs b/crates/binstalk-downloader/src/download/stream_readable.rs index 2db0666a..dee2f379 100644 --- a/crates/binstalk-downloader/src/download/stream_readable.rs +++ b/crates/binstalk-downloader/src/download/stream_readable.rs @@ -7,7 +7,7 @@ use bytes::{Buf, Bytes}; use futures_util::stream::{Stream, StreamExt}; use tokio::runtime::Handle; -use super::{CancellationFuture, DownloadError}; +use super::{await_on_option, CancellationFuture, DownloadError}; /// This wraps an AsyncIterator as a `Read`able. /// It must be used in non-async context only, @@ -120,17 +120,14 @@ where if !bytes.has_remaining() { let option = self.handle.block_on(async { - if let Some(cancellation_future) = self.cancellation_future.as_mut() { - tokio::select! { - biased; + let cancellation_future = self.cancellation_future.as_mut(); + tokio::select! { + biased; - res = cancellation_future => { - Err(res.err().unwrap_or_else(|| io::Error::from(DownloadError::UserAbort))) - }, - res = next_stream(&mut self.stream) => res, - } - } else { - next_stream(&mut self.stream).await + res = await_on_option(cancellation_future) => { + Err(res.err().unwrap_or_else(|| io::Error::from(DownloadError::UserAbort))) + }, + res = next_stream(&mut self.stream) => res, } })?; diff --git a/crates/binstalk-downloader/src/download/utils.rs b/crates/binstalk-downloader/src/download/utils.rs new file mode 100644 index 00000000..94ad39cf --- /dev/null +++ b/crates/binstalk-downloader/src/download/utils.rs @@ -0,0 +1,16 @@ +use std::future::{pending, Future}; + +/// Await on `future` if it is not `None`, or call [`pending`] +/// so that this branch would never get selected again. +/// +/// Designed to use with [`tokio::select`]. +pub(super) async fn await_on_option(future: Option) -> R +where + Fut: Future, +{ + if let Some(future) = future { + future.await + } else { + pending().await + } +} diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs new file mode 100644 index 00000000..ca3b89f3 --- /dev/null +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -0,0 +1,149 @@ +use std::{ + io, + path::{Component, Path, PathBuf}, +}; + +use async_zip::{read::ZipEntryReader, ZipEntryExt}; +use thiserror::Error as ThisError; +use tokio::{fs, io::AsyncRead, task::spawn_blocking}; + +use super::DownloadError; + +#[derive(Debug, ThisError)] +enum ZipErrorInner { + #[error(transparent)] + Inner(#[from] async_zip::error::ZipError), + + #[error("Invalid file path: {0}")] + InvalidFilePath(Box), +} + +#[derive(Debug, ThisError)] +#[error(transparent)] +pub struct ZipError(#[from] ZipErrorInner); + +impl ZipError { + pub(super) fn from_inner(err: async_zip::error::ZipError) -> Self { + Self(ZipErrorInner::Inner(err)) + } +} + +pub(super) async fn extract_zip_entry( + entry: ZipEntryReader<'_, R>, + path: &Path, +) -> Result<(), DownloadError> +where + R: AsyncRead + Unpin + Send + Sync, +{ + // Sanitize filename + let raw_filename = entry.entry().filename(); + let filename = check_filename_and_normalize(raw_filename) + .ok_or_else(|| ZipError(ZipErrorInner::InvalidFilePath(raw_filename.into())))?; + + // Calculates the outpath + let outpath = path.join(filename); + + // Get permissions + let mut perms = None; + + #[cfg(unix)] + { + use std::{fs::Permissions, os::unix::fs::PermissionsExt}; + + if let Some(mode) = entry.entry().unix_permissions() { + let mode: u16 = mode; + perms = Some(Permissions::from_mode(mode as u32)); + } + } + + if raw_filename.ends_with('/') { + // This entry is a dir. + asyncify(move || { + std::fs::create_dir_all(&outpath)?; + if let Some(perms) = perms { + std::fs::set_permissions(&outpath, perms)?; + } + + Ok(()) + }) + .await?; + } else { + // This entry is a file. + let mut outfile = asyncify(move || { + if let Some(p) = outpath.parent() { + std::fs::create_dir_all(p)?; + } + let outfile = std::fs::File::create(&outpath)?; + + if let Some(perms) = perms { + outfile.set_permissions(perms)?; + } + + Ok(outfile) + }) + .await + .map(fs::File::from_std)?; + + entry + .copy_to_end_crc(&mut outfile, 64 * 1024) + .await + .map_err(ZipError::from_inner)?; + } + + Ok(()) +} + +/// Ensure the file path is safe to use as a [`Path`]. +/// +/// - It can't contain NULL bytes +/// - It can't resolve to a path outside the current directory +/// > `foo/../bar` is fine, `foo/../../bar` is not. +/// - It can't be an absolute path +/// +/// It will then return a normalized path. +/// +/// This will read well-formed ZIP files correctly, and is resistant +/// to path-based exploits. +/// +/// This function is adapted from `zip::ZipFile::enclosed_name`. +fn check_filename_and_normalize(filename: &str) -> Option { + if filename.contains('\0') { + return None; + } + + let mut path = PathBuf::new(); + + // The following loop is adapted from + // `normalize_path::NormalizePath::normalize`. + for component in Path::new(filename).components() { + match component { + Component::Prefix(_) | Component::RootDir => return None, + Component::CurDir => (), + Component::ParentDir => { + if !path.pop() { + // `PathBuf::pop` returns false if there is no parent. + // which means the path is invalid. + return None; + } + } + Component::Normal(c) => path.push(c), + } + } + + Some(path) +} + +/// Copied from tokio https://docs.rs/tokio/latest/src/tokio/fs/mod.rs.html#132 +async fn asyncify(f: F) -> io::Result +where + F: FnOnce() -> io::Result + Send + 'static, + T: Send + 'static, +{ + match spawn_blocking(f).await { + Ok(res) => res, + Err(_) => Err(io::Error::new( + io::ErrorKind::Other, + "background task failed", + )), + } +} From 97c5857e58c0b7c326c6c34afe1248a53b153d05 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 00:59:27 +0000 Subject: [PATCH 0912/2020] Bump serde from 1.0.148 to 1.0.149 (#592) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.148 to 1.0.149. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.148...v1.0.149) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 955b65f5..0b36e6af 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2046,9 +2046,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.148" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e53f64bb4ba0191d6d0676e1b141ca55047d83b74f5607e6d8eb88126c52c2dc" +checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055" dependencies = [ "serde_derive", ] @@ -2064,9 +2064,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.148" +version = "1.0.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a55492425aa53521babf6137309e7d34c20bbfbbfcfe2c7f3a047fd1f6b92c0c" +checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index dbd3f011..ba41a148 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -16,7 +16,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" miette = "5.5.0" semver = { version = "1.0.14", features = ["serde"] } -serde = { version = "1.0.148", features = ["derive"] } +serde = { version = "1.0.149", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.89" thiserror = "1.0.37" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 95ead86b..1a7829ce 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" compact_str = { version = "0.6.1", features = ["serde"] } once_cell = "1.16.0" semver = { version = "1.0.14", features = ["serde"] } -serde = { version = "1.0.148", features = ["derive"] } +serde = { version = "1.0.149", features = ["derive"] } strum = "0.24.1" strum_macros = "0.24.3" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 99e1df6b..e3761802 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ miette = "5.5.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.16.0" semver = { version = "1.0.14", features = ["serde"] } -serde = { version = "1.0.148", features = ["derive"] } +serde = { version = "1.0.149", features = ["derive"] } strum = "0.24.1" tempfile = "3.3.0" thiserror = "1.0.37" From fa78517712f693ff2e2f24f6c0a9eaec08f58718 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 01:33:53 +0000 Subject: [PATCH 0913/2020] Bump tokio from 1.22.0 to 1.23.0 (#593) Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.22.0 to 1.23.0. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.22.0...tokio-1.23.0) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 6 +++--- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0b36e6af..8cb598c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2335,9 +2335,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.22.0" +version = "1.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76ce4a75fb488c605c54bf610f221cea8b0dafb53333c1a67e8ee199dcd2ae3" +checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" dependencies = [ "autocfg", "bytes", @@ -2350,7 +2350,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "winapi", + "windows-sys 0.42.0", ] [[package]] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 14ab1f69..2f1c0073 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -36,7 +36,7 @@ strum = "0.24.1" strum_macros = "0.24.3" supports-color = "1.3.1" tempfile = "3.3.0" -tokio = { version = "1.22.0", features = ["rt-multi-thread"], default-features = false } +tokio = { version = "1.23.0", features = ["rt-multi-thread"], default-features = false } tracing-core = "0.1.30" tracing = { version = "0.1.37", default-features = false } tracing-log = { version = "0.1.3", default-features = false } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index ffef2324..5f5aab2e 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -30,7 +30,7 @@ scopeguard = "1.1.0" tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.3.0" thiserror = "1.0.37" -tokio = { version = "1.22.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } +tokio = { version = "1.23.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.4", features = ["io"] } tower = { version = "0.4.13", features = ["limit", "util"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index e3761802..bb45da6a 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -32,7 +32,7 @@ tempfile = "3.3.0" thiserror = "1.0.37" tinytemplate = "1.2.1" # parking_lot for `tokio::sync::OnceCell::const_new` -tokio = { version = "1.22.0", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } +tokio = { version = "1.23.0", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } tracing = "0.1.37" url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 9812baee..6943e400 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -10,11 +10,11 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -tokio = { version = "1.22.0", features = ["rt", "process", "sync"], default-features = false } +tokio = { version = "1.23.0", features = ["rt", "process", "sync"], default-features = false } cfg-if = "1.0.0" [target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] guess_host_triple = "0.1.3" [dev-dependencies] -tokio = { version = "1.22.0", features = ["macros"], default-features = false } +tokio = { version = "1.23.0", features = ["macros"], default-features = false } From 23cfb61ec84eeb120e1f26ef782dd5c79736524e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 02:05:29 +0000 Subject: [PATCH 0914/2020] Bump embed-resource from 1.7.4 to 1.8.0 (#598) Bumps [embed-resource](https://github.com/nabijaczleweli/rust-embed-resource) from 1.7.4 to 1.8.0. - [Release notes](https://github.com/nabijaczleweli/rust-embed-resource/releases) - [Commits](https://github.com/nabijaczleweli/rust-embed-resource/compare/v1.7.4...v1.8.0) --- updated-dependencies: - dependency-name: embed-resource dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8cb598c6..a20689a4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -643,9 +643,9 @@ checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" [[package]] name = "embed-resource" -version = "1.7.4" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "782e883d0b9a3db55e6edee9939305d0b5c2ee6df793966d84b31144873e5bde" +checksum = "e62abb876c07e4754fae5c14cafa77937841f01740637e17d78dc04352f32a5e" dependencies = [ "cc", "rustc_version", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 2f1c0073..71944e29 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -43,7 +43,7 @@ tracing-log = { version = "0.1.3", default-features = false } tracing-subscriber = { version = "0.3.16", features = ["fmt", "json", "ansi"], default-features = false } [build-dependencies] -embed-resource = "1.7.4" +embed-resource = "1.8.0" [features] default = ["static", "rustls", "trust-dns", "fancy-no-backtrace"] From 058208bae9ac11cb8ab499caec7711cbdceebce1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 02:40:53 +0000 Subject: [PATCH 0915/2020] Bump serde from 1.0.149 to 1.0.150 (#597) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.149 to 1.0.150. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.149...v1.0.150) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a20689a4..ab2949c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2046,9 +2046,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.149" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "256b9932320c590e707b94576e3cc1f7c9024d0ee6612dfbcf1cb106cbe8e055" +checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91" dependencies = [ "serde_derive", ] @@ -2064,9 +2064,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.149" +version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4eae9b04cbffdfd550eb462ed33bc6a1b68c935127d008b27444d08380f94e4" +checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index ba41a148..d453a143 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -16,7 +16,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" miette = "5.5.0" semver = { version = "1.0.14", features = ["serde"] } -serde = { version = "1.0.149", features = ["derive"] } +serde = { version = "1.0.150", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.89" thiserror = "1.0.37" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 1a7829ce..17ec93bc 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" compact_str = { version = "0.6.1", features = ["serde"] } once_cell = "1.16.0" semver = { version = "1.0.14", features = ["serde"] } -serde = { version = "1.0.149", features = ["derive"] } +serde = { version = "1.0.150", features = ["derive"] } strum = "0.24.1" strum_macros = "0.24.3" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index bb45da6a..a4a5feed 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ miette = "5.5.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.16.0" semver = { version = "1.0.14", features = ["serde"] } -serde = { version = "1.0.149", features = ["derive"] } +serde = { version = "1.0.150", features = ["derive"] } strum = "0.24.1" tempfile = "3.3.0" thiserror = "1.0.37" From db45f2fb7f729325fc73d20685a245f508926a47 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 12 Dec 2022 14:15:30 +1100 Subject: [PATCH 0916/2020] Refactor `binstalk-downloader` APIs: Remove `cancellation_future` plus optimizations (#591) - Refactor: Mv fn `utils::asyncify` into mod `utils` - Improve err msg for task failure in `utils::asyncify` - Make sure `asyncify` always returns the same annoymous type that implements `Future` if the `T` is same. - Rewrite `extract_bin` to avoid `block_in_place` support cancellation by dropping - Rm unused dep scopeguard from binstalk-downloader - Rewrite `extract_tar_based_stream` so that it is cancellable by dropping - Unbox `extract_future` in `async_extracter::extract_zip` - Refactor `Download` API: Remove `CancellationFuture` as param since all futures returned by `Download::and_*` does not call `block_in_place`, so they can be cancelled by drop instead of using this cumbersome hack. - Fix exports from mod `async_tar_visitor` - Make `signal::{ignore_signals, wait_on_cancellation_signal}` private - Rm the global variable `CANCELLED` in `wait_on_cancellation_signal` and rm fn `wait_on_cancellation_signal_inner` - Optimize `wait_on_cancellation_signal`: Avoid `tokio::select!` on `not(unix)` - Rm unnecessary `tokio::select!` in `wait_on_cancellation_signal` on unix Since `unix::wait_on_cancellation_signal_unix` already waits for ctrl + c signal. - Optimize `extract_bin`: Send `Bytes` to blocking thread for zero-copy - Optimize `extract_with_blocking_decoder`: Avoid dup monomorphization - Box fut of `fetch_crate_cratesio` in `PackageInfo::resolve` - Optimize `extract_zip_entry`: Spawn only one blocking task per fn call by using a mspc queue for the data to be written to the `outfile`. This would improve efficiency as using `tokio::fs::File` is expensive: It spawns a new blocking task, which needs one heap allocation and then pushed to a mpmc queue, and then wait for it to be done on every loop. This also fix a race condition where the unix permission is set before the whole file is written, which might be used by attackers. - Optimize `extract_zip`: Use one `BytesMut` for entire extraction process To avoid frequent allocation and deallocation. - Optimize `extract_zip_entry`: Inc prob of reusing alloc in `BytesMut` Performs the reserve before sending the buf over mpsc queue to increase the possibility of reusing the previous allocation. NOTE: `BytesMut` only reuses the previous allocation if it is the only one holds the reference to it, which is either on the first allocation or all the `Bytes` in the mpsc queue has been consumed, written to the file and dropped. Since reading from entry would have to wait for external file I/O, this would give the blocking thread some time to flush `Bytes` out. - Disable unused feature fs of dep tokio Signed-off-by: Jiahao XU --- Cargo.lock | 1 - crates/binstalk-downloader/Cargo.toml | 1 - crates/binstalk-downloader/src/download.rs | 40 ++--- .../src/download/async_extracter.rs | 157 +++++++++++------- .../src/download/async_tar_visitor.rs | 2 +- .../src/download/stream_readable.rs | 106 ++---------- .../binstalk-downloader/src/download/utils.rs | 28 ++-- .../src/download/zip_extraction.rs | 110 ++++++++---- crates/binstalk/src/drivers/crates_io.rs | 7 +- crates/binstalk/src/fetchers/gh_crate_meta.rs | 3 +- crates/binstalk/src/fetchers/quickinstall.rs | 7 +- crates/binstalk/src/helpers/signal.rs | 25 +-- crates/binstalk/src/ops/resolve.rs | 10 +- 13 files changed, 234 insertions(+), 263 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ab2949c6..12580c12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -199,7 +199,6 @@ dependencies = [ "generic-array", "httpdate", "reqwest", - "scopeguard", "tempfile", "thiserror", "tokio", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 5f5aab2e..67afa703 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -22,7 +22,6 @@ futures-util = { version = "0.3.25", default-features = false, features = ["std" generic-array = "0.14.6" httpdate = "1.0.2" reqwest = { version = "0.11.13", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } -scopeguard = "1.1.0" # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. # diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index a3a9469a..1636577f 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -1,4 +1,4 @@ -use std::{fmt::Debug, future::Future, io, marker::PhantomData, path::Path, pin::Pin}; +use std::{fmt::Debug, io, marker::PhantomData, path::Path}; use binstalk_types::cargo_toml_binstall::{PkgFmtDecomposed, TarBasedFmt}; use digest::{Digest, FixedOutput, HashMarker, Output, OutputSizeUser, Update}; @@ -14,7 +14,8 @@ mod async_extracter; use async_extracter::*; mod async_tar_visitor; -pub use async_tar_visitor::*; +use async_tar_visitor::extract_tar_based_stream_and_visit; +pub use async_tar_visitor::{TarEntriesVisitor, TarEntry, TarEntryType}; mod extracter; mod stream_readable; @@ -23,9 +24,6 @@ mod zip_extraction; pub use zip_extraction::ZipError; mod utils; -use utils::await_on_option; - -pub type CancellationFuture = Option> + Send>>>; #[derive(Debug, ThisError)] pub enum DownloadError { @@ -102,12 +100,11 @@ impl Download { /// /// NOTE that this API does not support gnu extension sparse file unlike /// [`Download::and_extract`]. - #[instrument(skip(visitor, cancellation_future))] + #[instrument(skip(visitor))] pub async fn and_visit_tar( self, fmt: TarBasedFmt, visitor: V, - cancellation_future: CancellationFuture, ) -> Result { let stream = self .client @@ -117,14 +114,7 @@ impl Download { debug!("Downloading and extracting then in-memory processing"); - let ret = tokio::select! { - biased; - - res = await_on_option(cancellation_future) => { - Err(res.err().unwrap_or_else(|| io::Error::from(DownloadError::UserAbort)))? - } - res = extract_tar_based_stream_and_visit(stream, fmt, visitor) => res?, - }; + let ret = extract_tar_based_stream_and_visit(stream, fmt, visitor).await?; debug!("Download, extraction and in-memory procession OK"); @@ -135,19 +125,13 @@ impl Download { /// /// `cancellation_future` can be used to cancel the extraction and return /// [`DownloadError::UserAbort`] error. - #[instrument(skip(path, cancellation_future))] + #[instrument(skip(path))] pub async fn and_extract( self, fmt: PkgFmt, path: impl AsRef, - cancellation_future: CancellationFuture, ) -> Result<(), DownloadError> { - async fn inner( - this: Download, - fmt: PkgFmt, - path: &Path, - cancellation_future: CancellationFuture, - ) -> Result<(), DownloadError> { + async fn inner(this: Download, fmt: PkgFmt, path: &Path) -> Result<(), DownloadError> { let stream = this .client .get_stream(this.url) @@ -157,11 +141,9 @@ impl Download { debug!("Downloading and extracting to: '{}'", path.display()); match fmt.decompose() { - PkgFmtDecomposed::Tar(fmt) => { - extract_tar_based_stream(stream, path, fmt, cancellation_future).await? - } - PkgFmtDecomposed::Bin => extract_bin(stream, path, cancellation_future).await?, - PkgFmtDecomposed::Zip => extract_zip(stream, path, cancellation_future).await?, + PkgFmtDecomposed::Tar(fmt) => extract_tar_based_stream(stream, path, fmt).await?, + PkgFmtDecomposed::Bin => extract_bin(stream, path).await?, + PkgFmtDecomposed::Zip => extract_zip(stream, path).await?, } debug!("Download OK, extracted to: '{}'", path.display()); @@ -169,7 +151,7 @@ impl Download { Ok(()) } - inner(self, fmt, path.as_ref(), cancellation_future).await + inner(self, fmt, path.as_ref()).await } } diff --git a/crates/binstalk-downloader/src/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs index 5034374b..4850771e 100644 --- a/crates/binstalk-downloader/src/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -1,96 +1,137 @@ -use std::{fs, path::Path}; +use std::{ + fs, + future::Future, + io::{self, Write}, + path::Path, +}; use async_zip::read::stream::ZipFileReader; -use bytes::Bytes; -use futures_util::stream::Stream; -use scopeguard::{guard, ScopeGuard}; -use tokio::task::block_in_place; +use bytes::{Bytes, BytesMut}; +use futures_util::{ + future::try_join, + stream::{Stream, StreamExt}, +}; +use tokio::sync::mpsc; use tokio_util::io::StreamReader; use tracing::debug; use super::{ - await_on_option, extracter::*, stream_readable::StreamReadable, - zip_extraction::extract_zip_entry, CancellationFuture, DownloadError, TarBasedFmt, ZipError, + extracter::*, stream_readable::StreamReadable, utils::asyncify, + zip_extraction::extract_zip_entry, DownloadError, TarBasedFmt, ZipError, }; -pub async fn extract_bin( - stream: S, - path: &Path, - cancellation_future: CancellationFuture, -) -> Result<(), DownloadError> +pub async fn extract_bin(stream: S, path: &Path) -> Result<(), DownloadError> where - S: Stream> + Unpin + 'static, + S: Stream> + Send + Sync + Unpin + 'static, { - let mut reader = StreamReadable::new(stream, cancellation_future).await; - block_in_place(move || { - fs::create_dir_all(path.parent().unwrap())?; + debug!("Writing to `{}`", path.display()); + extract_with_blocking_decoder(stream, path, |mut rx, path| { let mut file = fs::File::create(path)?; - // remove it unless the operation isn't aborted and no write - // fails. - let remove_guard = guard(&path, |path| { - fs::remove_file(path).ok(); - }); + while let Some(bytes) = rx.blocking_recv() { + file.write_all(&bytes)?; + } - reader.copy(&mut file)?; - - // Operation isn't aborted and all writes succeed, - // disarm the remove_guard. - ScopeGuard::into_inner(remove_guard); - - Ok(()) + file.flush() }) + .await } -pub async fn extract_zip( - stream: S, - path: &Path, - cancellation_future: CancellationFuture, -) -> Result<(), DownloadError> +pub async fn extract_zip(stream: S, path: &Path) -> Result<(), DownloadError> where S: Stream> + Unpin + Send + Sync + 'static, { debug!("Decompressing from zip archive to `{}`", path.display()); - let extract_future = Box::pin(async move { - let reader = StreamReader::new(stream); - let mut zip = ZipFileReader::new(reader); + let reader = StreamReader::new(stream); + let mut zip = ZipFileReader::new(reader); + let mut buf = BytesMut::with_capacity(4 * 4096); - while let Some(entry) = zip.entry_reader().await.map_err(ZipError::from_inner)? { - extract_zip_entry(entry, path).await?; - } - - Ok(()) - }); - - tokio::select! { - biased; - - res = await_on_option(cancellation_future) => { - Err(res.err().map(DownloadError::from).unwrap_or(DownloadError::UserAbort)) - } - res = extract_future => res, + while let Some(entry) = zip.entry_reader().await.map_err(ZipError::from_inner)? { + extract_zip_entry(entry, path, &mut buf).await?; } + + Ok(()) } pub async fn extract_tar_based_stream( stream: S, path: &Path, fmt: TarBasedFmt, - cancellation_future: CancellationFuture, ) -> Result<(), DownloadError> where - S: Stream> + Unpin + 'static, + S: Stream> + Send + Sync + Unpin + 'static, { - let reader = StreamReadable::new(stream, cancellation_future).await; - block_in_place(move || { - fs::create_dir_all(path.parent().unwrap())?; + debug!("Extracting from {fmt} archive to {path:#?}"); - debug!("Extracting from {fmt} archive to {path:#?}"); + extract_with_blocking_decoder(stream, path, move |rx, path| { + create_tar_decoder(StreamReadable::new(rx), fmt)?.unpack(path) + }) + .await +} - create_tar_decoder(reader, fmt)?.unpack(path)?; +async fn extract_with_blocking_decoder( + stream: S, + path: &Path, + f: F, +) -> Result<(), DownloadError> +where + S: Stream> + Send + Sync + Unpin + 'static, + F: FnOnce(mpsc::Receiver, &Path) -> io::Result<()> + Send + Sync + 'static, +{ + async fn inner( + mut stream: S, + task: Fut, + tx: mpsc::Sender, + ) -> Result<(), DownloadError> + where + // We do not use trait object for S since there will only be one + // S used with this function. + S: Stream> + Send + Sync + Unpin + 'static, + // asyncify would always return the same future, so no need to + // use trait object here. + Fut: Future> + Send + Sync, + { + try_join( + async move { + while let Some(bytes) = stream.next().await.transpose()? { + if tx.send(bytes).await.is_err() { + // The extract tar returns, which could be that: + // - Extraction fails with an error + // - Extraction success without the rest of the data + // + // + // It's hard to tell the difference here, so we assume + // the first scienario occurs. + // + // Even if the second scienario occurs, it won't affect the + // extraction process anyway, so we can jsut ignore it. + return Ok(()); + } + } + + Ok(()) + }, + task, + ) + .await?; Ok(()) - }) + } + + // Use channel size = 5 to minimize the waiting time in the extraction task + let (tx, rx) = mpsc::channel(5); + + let path = path.to_owned(); + + let task = asyncify(move || { + if let Some(parent) = path.parent() { + fs::create_dir_all(parent)?; + } + + f(rx, &path) + }); + + inner(stream, task, tx).await } diff --git a/crates/binstalk-downloader/src/download/async_tar_visitor.rs b/crates/binstalk-downloader/src/download/async_tar_visitor.rs index d33ba2ef..bab6d0eb 100644 --- a/crates/binstalk-downloader/src/download/async_tar_visitor.rs +++ b/crates/binstalk-downloader/src/download/async_tar_visitor.rs @@ -91,7 +91,7 @@ pub trait TarEntriesVisitor: Send + Sync { fn finish(self) -> Result; } -pub async fn extract_tar_based_stream_and_visit( +pub(crate) async fn extract_tar_based_stream_and_visit( stream: S, fmt: TarBasedFmt, mut visitor: V, diff --git a/crates/binstalk-downloader/src/download/stream_readable.rs b/crates/binstalk-downloader/src/download/stream_readable.rs index dee2f379..f1ec5a27 100644 --- a/crates/binstalk-downloader/src/download/stream_readable.rs +++ b/crates/binstalk-downloader/src/download/stream_readable.rs @@ -1,74 +1,28 @@ -use std::{ - cmp::min, - io::{self, BufRead, Read, Write}, -}; +use std::io::{self, BufRead, Read}; use bytes::{Buf, Bytes}; -use futures_util::stream::{Stream, StreamExt}; -use tokio::runtime::Handle; - -use super::{await_on_option, CancellationFuture, DownloadError}; +use tokio::sync::mpsc; /// This wraps an AsyncIterator as a `Read`able. /// It must be used in non-async context only, /// meaning you have to use it with /// `tokio::task::{block_in_place, spawn_blocking}` or /// `std::thread::spawn`. -pub struct StreamReadable { - stream: S, - handle: Handle, +pub struct StreamReadable { + rx: mpsc::Receiver, bytes: Bytes, - cancellation_future: CancellationFuture, } -impl StreamReadable { - pub(super) async fn new(stream: S, cancellation_future: CancellationFuture) -> Self { +impl StreamReadable { + pub(super) fn new(rx: mpsc::Receiver) -> Self { Self { - stream, - handle: Handle::current(), + rx, bytes: Bytes::new(), - cancellation_future, } } } -impl StreamReadable -where - S: Stream> + Unpin, - DownloadError: From, -{ - /// Copies from `self` to `writer`. - /// - /// Same as `io::copy` but does not allocate any internal buffer - /// since `self` is buffered. - pub(super) fn copy(&mut self, mut writer: W) -> io::Result<()> - where - W: Write, - { - self.copy_inner(&mut writer) - } - - fn copy_inner(&mut self, writer: &mut dyn Write) -> io::Result<()> { - loop { - let buf = self.fill_buf()?; - if buf.is_empty() { - // Eof - break Ok(()); - } - - writer.write_all(buf)?; - - let n = buf.len(); - self.consume(n); - } - } -} - -impl Read for StreamReadable -where - S: Stream> + Unpin, - DownloadError: From, -{ +impl Read for StreamReadable { fn read(&mut self, buf: &mut [u8]) -> io::Result { if buf.is_empty() { return Ok(0); @@ -82,60 +36,26 @@ where // copy_to_slice requires the bytes to have enough remaining bytes // to fill buf. - let n = min(buf.len(), bytes.remaining()); + let n = buf.len().min(bytes.remaining()); + // ::copy_to_slice copies and consumes the bytes bytes.copy_to_slice(&mut buf[..n]); Ok(n) } } -/// If `Ok(Some(bytes))` if returned, then `bytes.is_empty() == false`. -async fn next_stream(stream: &mut S) -> io::Result> -where - S: Stream> + Unpin, - DownloadError: From, -{ - loop { - let option = stream - .next() - .await - .transpose() - .map_err(DownloadError::from)?; - - match option { - Some(bytes) if bytes.is_empty() => continue, - option => break Ok(option), - } - } -} - -impl BufRead for StreamReadable -where - S: Stream> + Unpin, - DownloadError: From, -{ +impl BufRead for StreamReadable { fn fill_buf(&mut self) -> io::Result<&[u8]> { let bytes = &mut self.bytes; if !bytes.has_remaining() { - let option = self.handle.block_on(async { - let cancellation_future = self.cancellation_future.as_mut(); - tokio::select! { - biased; - - res = await_on_option(cancellation_future) => { - Err(res.err().unwrap_or_else(|| io::Error::from(DownloadError::UserAbort))) - }, - res = next_stream(&mut self.stream) => res, - } - })?; - - if let Some(new_bytes) = option { + if let Some(new_bytes) = self.rx.blocking_recv() { // new_bytes are guaranteed to be non-empty. *bytes = new_bytes; } } + Ok(&*bytes) } diff --git a/crates/binstalk-downloader/src/download/utils.rs b/crates/binstalk-downloader/src/download/utils.rs index 94ad39cf..9fde5239 100644 --- a/crates/binstalk-downloader/src/download/utils.rs +++ b/crates/binstalk-downloader/src/download/utils.rs @@ -1,16 +1,22 @@ -use std::future::{pending, Future}; +use std::{future::Future, io}; -/// Await on `future` if it is not `None`, or call [`pending`] -/// so that this branch would never get selected again. -/// -/// Designed to use with [`tokio::select`]. -pub(super) async fn await_on_option(future: Option) -> R +use tokio::task; + +/// Copied from tokio https://docs.rs/tokio/latest/src/tokio/fs/mod.rs.html#132 +pub(super) fn asyncify(f: F) -> impl Future> + Send + Sync + 'static where - Fut: Future, + F: FnOnce() -> io::Result + Send + 'static, + T: Send + 'static, { - if let Some(future) = future { - future.await - } else { - pending().await + async fn inner(handle: task::JoinHandle>) -> io::Result { + match handle.await { + Ok(res) => res, + Err(err) => Err(io::Error::new( + io::ErrorKind::Other, + format!("background task failed: {err}"), + )), + } } + + inner(task::spawn_blocking(f)) } diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index ca3b89f3..89e4f2ab 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -1,13 +1,18 @@ use std::{ - io, + io::Write, path::{Component, Path, PathBuf}, }; use async_zip::{read::ZipEntryReader, ZipEntryExt}; +use bytes::{Bytes, BytesMut}; +use futures_util::future::{try_join, TryFutureExt}; use thiserror::Error as ThisError; -use tokio::{fs, io::AsyncRead, task::spawn_blocking}; +use tokio::{ + io::{AsyncRead, AsyncReadExt}, + sync::mpsc, +}; -use super::DownloadError; +use super::{utils::asyncify, DownloadError}; #[derive(Debug, ThisError)] enum ZipErrorInner { @@ -31,6 +36,7 @@ impl ZipError { pub(super) async fn extract_zip_entry( entry: ZipEntryReader<'_, R>, path: &Path, + buf: &mut BytesMut, ) -> Result<(), DownloadError> where R: AsyncRead + Unpin + Send + Sync, @@ -68,31 +74,82 @@ where }) .await?; } else { + // Use channel size = 5 to minimize the waiting time in the extraction task + let (tx, mut rx) = mpsc::channel::(5); + // This entry is a file. - let mut outfile = asyncify(move || { - if let Some(p) = outpath.parent() { - std::fs::create_dir_all(p)?; - } - let outfile = std::fs::File::create(&outpath)?; + try_join( + asyncify(move || { + if let Some(p) = outpath.parent() { + std::fs::create_dir_all(p)?; + } + let mut outfile = std::fs::File::create(&outpath)?; - if let Some(perms) = perms { - outfile.set_permissions(perms)?; - } + while let Some(bytes) = rx.blocking_recv() { + outfile.write_all(&bytes)?; + } - Ok(outfile) - }) - .await - .map(fs::File::from_std)?; + outfile.flush()?; - entry - .copy_to_end_crc(&mut outfile, 64 * 1024) - .await - .map_err(ZipError::from_inner)?; + if let Some(perms) = perms { + outfile.set_permissions(perms)?; + } + + Ok(()) + }) + .err_into(), + copy_file_to_mpsc(entry, tx, buf) + .map_err(ZipError::from_inner) + .map_err(DownloadError::from), + ) + .await?; } Ok(()) } +async fn copy_file_to_mpsc( + mut entry: ZipEntryReader<'_, R>, + tx: mpsc::Sender, + buf: &mut BytesMut, +) -> Result<(), async_zip::error::ZipError> +where + R: AsyncRead + Unpin + Send + Sync, +{ + // Since BytesMut does not have a max cap, if AsyncReadExt::read_buf returns + // 0 then it means Eof. + while entry.read_buf(buf).await? != 0 { + // Ensure AsyncReadExt::read_buf can read at least 4096B to avoid + // frequent expensive read syscalls. + // + // Performs this reserve before sending the buf over mpsc queue to + // increase the possibility of reusing the previous allocation. + // + // NOTE: `BytesMut` only reuses the previous allocation if it is the + // only one holds the reference to it, which is either on the first + // iteration or all the `Bytes` in the mpsc queue has been consumed, + // written to the file and dropped. + // + // Since reading from entry would have to wait for external file I/O, + // this would give the blocking thread some time to flush `Bytes` + // out. + // + // If all `Bytes` are flushed out, then we can reuse the allocation here. + buf.reserve(4096); + + if tx.send(buf.split().freeze()).await.is_err() { + // Same reason as extract_with_blocking_decoder + break; + } + } + + if entry.compare_crc() { + Ok(()) + } else { + Err(async_zip::error::ZipError::CRC32CheckError) + } +} + /// Ensure the file path is safe to use as a [`Path`]. /// /// - It can't contain NULL bytes @@ -132,18 +189,3 @@ fn check_filename_and_normalize(filename: &str) -> Option { Some(path) } - -/// Copied from tokio https://docs.rs/tokio/latest/src/tokio/fs/mod.rs.html#132 -async fn asyncify(f: F) -> io::Result -where - F: FnOnce() -> io::Result + Send + 'static, - T: Send + 'static, -{ - match spawn_blocking(f).await { - Ok(res) => res, - Err(_) => Err(io::Error::new( - io::ErrorKind::Other, - "background task failed", - )), - } -} diff --git a/crates/binstalk/src/drivers/crates_io.rs b/crates/binstalk/src/drivers/crates_io.rs index ec4179bd..402fca46 100644 --- a/crates/binstalk/src/drivers/crates_io.rs +++ b/crates/binstalk/src/drivers/crates_io.rs @@ -10,7 +10,6 @@ use crate::{ helpers::{ download::Download, remote::{Client, Url}, - signal::wait_on_cancellation_signal, }, manifests::cargo_toml_binstall::{Meta, TarBasedFmt}, }; @@ -54,10 +53,6 @@ pub async fn fetch_crate_cratesio( let manifest_dir_path: PathBuf = format!("{name}-{version_name}").into(); Ok(Download::new(client, Url::parse(&crate_url)?) - .and_visit_tar( - TarBasedFmt::Tgz, - ManifestVisitor::new(manifest_dir_path), - Some(Box::pin(wait_on_cancellation_signal())), - ) + .and_visit_tar(TarBasedFmt::Tgz, ManifestVisitor::new(manifest_dir_path)) .await?) } diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 15defd2e..5e865df2 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -15,7 +15,6 @@ use crate::{ helpers::{ download::Download, remote::{Client, Method}, - signal::wait_on_cancellation_signal, tasks::AutoAbortJoinHandle, }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, @@ -167,7 +166,7 @@ impl super::Fetcher for GhCrateMeta { let (url, pkg_fmt) = self.resolution.get().unwrap(); // find() is called first debug!("Downloading package from: '{url}' dst:{dst:?} fmt:{pkg_fmt:?}"); Ok(Download::new(self.client.clone(), url.clone()) - .and_extract(*pkg_fmt, dst, Some(Box::pin(wait_on_cancellation_signal()))) + .and_extract(*pkg_fmt, dst) .await?) } diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs index d49847e3..90daef53 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk/src/fetchers/quickinstall.rs @@ -9,7 +9,6 @@ use crate::{ helpers::{ download::Download, remote::{Client, Method}, - signal::wait_on_cancellation_signal, tasks::AutoAbortJoinHandle, }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, @@ -72,11 +71,7 @@ impl super::Fetcher for QuickInstall { let url = self.package_url(); debug!("Downloading package from: '{url}'"); Ok(Download::new(self.client.clone(), Url::parse(&url)?) - .and_extract( - self.pkg_fmt(), - dst, - Some(Box::pin(wait_on_cancellation_signal())), - ) + .and_extract(self.pkg_fmt(), dst) .await?) } diff --git a/crates/binstalk/src/helpers/signal.rs b/crates/binstalk/src/helpers/signal.rs index 5b6b7465..36a25f6e 100644 --- a/crates/binstalk/src/helpers/signal.rs +++ b/crates/binstalk/src/helpers/signal.rs @@ -3,7 +3,7 @@ use std::{future::pending, io}; use super::tasks::AutoAbortJoinHandle; use crate::errors::BinstallError; -use tokio::{signal, sync::OnceCell}; +use tokio::signal; /// This function will poll the handle while listening for ctrl_c, /// `SIGINT`, `SIGHUP`, `SIGTERM` and `SIGQUIT`. @@ -30,7 +30,7 @@ pub async fn cancel_on_user_sig_term( } } -pub fn ignore_signals() -> io::Result<()> { +fn ignore_signals() -> io::Result<()> { #[cfg(unix)] unix::ignore_signals_on_unix()?; @@ -39,16 +39,7 @@ pub fn ignore_signals() -> io::Result<()> { /// If call to it returns `Ok(())`, then all calls to this function after /// that also returns `Ok(())`. -pub async fn wait_on_cancellation_signal() -> Result<(), io::Error> { - static CANCELLED: OnceCell<()> = OnceCell::const_new(); - - CANCELLED - .get_or_try_init(wait_on_cancellation_signal_inner) - .await - .copied() -} - -async fn wait_on_cancellation_signal_inner() -> Result<(), io::Error> { +async fn wait_on_cancellation_signal() -> Result<(), io::Error> { #[cfg(unix)] async fn inner() -> Result<(), io::Error> { unix::wait_on_cancellation_signal_unix().await @@ -56,16 +47,10 @@ async fn wait_on_cancellation_signal_inner() -> Result<(), io::Error> { #[cfg(not(unix))] async fn inner() -> Result<(), io::Error> { - // Use pending here so that tokio::select! would just skip this branch. - pending().await + signal::ctrl_c().await } - tokio::select! { - biased; - - res = signal::ctrl_c() => res, - res = inner() => res, - } + inner().await } #[cfg(unix)] diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index b5153bf3..306a562a 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -398,7 +398,15 @@ impl PackageInfo { // Fetch crate via crates.io, git, or use a local manifest path let manifest = match opts.manifest_path.as_ref() { Some(manifest_path) => load_manifest_path(manifest_path)?, - None => fetch_crate_cratesio(client, crates_io_api_client, &name, &version_req).await?, + None => { + Box::pin(fetch_crate_cratesio( + client, + crates_io_api_client, + &name, + &version_req, + )) + .await? + } }; let Some(mut package) = manifest.package else { From e6e912540e0f44903430dc3e7325d0d6166067aa Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 12 Dec 2022 17:32:40 +1100 Subject: [PATCH 0917/2020] Fix `binstalk-downloader`: Re-export `TarBasedFmt` (#599) Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/download.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index 1636577f..897dd4ec 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -1,12 +1,12 @@ use std::{fmt::Debug, io, marker::PhantomData, path::Path}; -use binstalk_types::cargo_toml_binstall::{PkgFmtDecomposed, TarBasedFmt}; +use binstalk_types::cargo_toml_binstall::PkgFmtDecomposed; use digest::{Digest, FixedOutput, HashMarker, Output, OutputSizeUser, Update}; use futures_util::stream::StreamExt; use thiserror::Error as ThisError; use tracing::{debug, instrument}; -pub use binstalk_types::cargo_toml_binstall::PkgFmt; +pub use binstalk_types::cargo_toml_binstall::{PkgFmt, TarBasedFmt}; use crate::remote::{Client, Error as RemoteError, Url}; From 2595bbabfb1df82e12344de1d772c941e986ae26 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 07:42:36 +0000 Subject: [PATCH 0918/2020] release: binstalk-manifests v0.1.1 (#603) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 12580c12..f014e099 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -214,7 +214,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.1.0" +version = "0.1.1" dependencies = [ "binstalk-types", "compact_str", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 71944e29..9eb2631b 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.5.0" } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.1.0" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.1.1" } clap = { version = "4.0.29", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index d453a143..e6512ee0 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.1.0" +version = "0.1.1" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From 647e340d387414c14c201a6e69f72d25c9951c4c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 07:55:38 +0000 Subject: [PATCH 0919/2020] release: binstalk-downloader v0.2.0 (#604) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f014e099..5d204e4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -184,7 +184,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.1.0" +version = "0.2.0" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 67afa703..efe57b1e 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.1.0" +version = "0.2.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index a4a5feed..5de58a71 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.59" -binstalk-downloader = { version = "0.1.0", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.2.0", path = "../binstalk-downloader" } binstalk-types = { version = "0.1.0", path = "../binstalk-types" } cargo_toml = "0.13.0" compact_str = { version = "0.6.1", features = ["serde"] } From 73a794dc13e7255500f23bd5b6254e9b827ab47c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 12 Dec 2022 19:42:11 +1100 Subject: [PATCH 0920/2020] Optimization: Box fut `Remote::get_redirected_final_url` in `GhCrateMeta::find` (#600) * Box fut `Remote::get_redirected_final_url` in `GhCrateMeta::find` Since the other await point in `GhCrateMeta::find` only needs `Arc` and `handles` to be saved, which is much smaller than the future returned by `Remote::get_redirected_final_url` * Refactor: Simplify `wait_on_cancellation_signal` Signed-off-by: Jiahao XU --- crates/binstalk/src/fetchers/gh_crate_meta.rs | 6 +----- crates/binstalk/src/helpers/signal.rs | 10 +++------- 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 5e865df2..790ef084 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -86,11 +86,7 @@ impl super::Fetcher for GhCrateMeta { fn find(self: Arc) -> AutoAbortJoinHandle> { AutoAbortJoinHandle::spawn(async move { let repo = if let Some(repo) = self.data.repo.as_deref() { - Some( - self.client - .get_redirected_final_url(Url::parse(repo)?) - .await?, - ) + Some(Box::pin(self.client.get_redirected_final_url(Url::parse(repo)?)).await?) } else { None }; diff --git a/crates/binstalk/src/helpers/signal.rs b/crates/binstalk/src/helpers/signal.rs index 36a25f6e..3ad352b4 100644 --- a/crates/binstalk/src/helpers/signal.rs +++ b/crates/binstalk/src/helpers/signal.rs @@ -41,16 +41,12 @@ fn ignore_signals() -> io::Result<()> { /// that also returns `Ok(())`. async fn wait_on_cancellation_signal() -> Result<(), io::Error> { #[cfg(unix)] - async fn inner() -> Result<(), io::Error> { - unix::wait_on_cancellation_signal_unix().await - } + unix::wait_on_cancellation_signal_unix().await?; #[cfg(not(unix))] - async fn inner() -> Result<(), io::Error> { - signal::ctrl_c().await - } + signal::ctrl_c().await?; - inner().await + Ok(()) } #[cfg(unix)] From b35e7bd43c16cd1f8285e85590c280e8933e7372 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 12 Dec 2022 08:57:40 +0000 Subject: [PATCH 0921/2020] release: binstalk v0.6.0 (#605) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5d204e4a..e0b87fd0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -153,7 +153,7 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "binstalk" -version = "0.5.0" +version = "0.6.0" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 9eb2631b..3d9a7a9a 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.5.0" } +binstalk = { path = "../binstalk", version = "0.6.0" } binstalk-manifests = { path = "../binstalk-manifests", version = "0.1.1" } clap = { version = "4.0.29", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 5de58a71..c050dbb5 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.5.0" +version = "0.6.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From 09bc8e7bb8d2c17e0c7ca92271f8faea172c4f89 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 13 Dec 2022 00:58:06 +1100 Subject: [PATCH 0922/2020] release: cargo-binstall v0.18.0 (#606) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e0b87fd0..5c684203 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -333,7 +333,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.17.0" +version = "0.18.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 3d9a7a9a..7c69aa24 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.17.0" +version = "0.18.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 9547f902..6cf82106 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 597e092774ae2519e1783ea36d8efd1905ca6888 Mon Sep 17 00:00:00 2001 From: Noa Date: Tue, 13 Dec 2022 18:14:20 -0600 Subject: [PATCH 0923/2020] CI: Build -gnu targets on ubuntu-20.04 (#607) This commit pins it to 20.04, so the glibc version required by the release binaries can be run on docker image `rust:1.65` which uses glibc 2.31. --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c11ec2d6..b4b46e1c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ jobs: matrix: include: - target: x86_64-unknown-linux-gnu - os: ubuntu-latest + os: ubuntu-20.04 debug_features: [ rustls, pkg-config ] - target: x86_64-apple-darwin os: macos-latest @@ -49,7 +49,7 @@ jobs: os: ubuntu-latest use-cross: true - target: aarch64-unknown-linux-gnu - os: ubuntu-latest + os: ubuntu-20.04 use-cross: true runs-on: ${{ matrix.os }} From 628fd336e750da78c0c60c204a2ede9c53cadb09 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 14 Dec 2022 11:37:48 +1100 Subject: [PATCH 0924/2020] release: cargo-binstall v0.18.1 (#608) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5c684203..35f01f7f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -333,7 +333,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.18.0" +version = "0.18.1" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 7c69aa24..865456a0 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.18.0" +version = "0.18.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 6cf82106..b52bea5e 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From b102d5a5f06541135181ab696b21c61c560ae0d6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 14:21:58 +1100 Subject: [PATCH 0925/2020] Update supports-color requirement from 1.3.1 to 2.0.0 in /crates/bin (#611) --- crates/bin/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 865456a0..26389610 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -34,7 +34,7 @@ once_cell = "1.16.0" semver = "1.0.14" strum = "0.24.1" strum_macros = "0.24.3" -supports-color = "1.3.1" +supports-color = "2.0.0" tempfile = "3.3.0" tokio = { version = "1.23.0", features = ["rt-multi-thread"], default-features = false } tracing-core = "0.1.30" From 9aaa5c48dd0d944c1361209e962871f1822de3ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 03:42:22 +0000 Subject: [PATCH 0926/2020] Bump async-trait from 0.1.59 to 0.1.60 (#612) --- Cargo.lock | 18 ++++++++++++++---- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 35f01f7f..be800711 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -81,9 +81,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.59" +version = "0.1.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6e93155431f3931513b243d371981bb2770112b370c82745a1d19d2f99364" +checksum = "677d1d8ab452a3936018a687b20e6f7cf5363d713b732b8884001317b0e48aa3" dependencies = [ "proc-macro2", "quote", @@ -348,7 +348,7 @@ dependencies = [ "semver", "strum", "strum_macros", - "supports-color", + "supports-color 2.0.0", "tempfile", "tokio", "tracing", @@ -1358,7 +1358,7 @@ dependencies = [ "miette-derive", "once_cell", "owo-colors", - "supports-color", + "supports-color 1.3.1", "supports-hyperlinks", "supports-unicode", "terminal_size", @@ -2194,6 +2194,16 @@ dependencies = [ "is_ci", ] +[[package]] +name = "supports-color" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4950e7174bffabe99455511c39707310e7e9b440364a2fcb1cc21521be57b354" +dependencies = [ + "is-terminal", + "is_ci", +] + [[package]] name = "supports-hyperlinks" version = "1.2.0" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index efe57b1e..0727f0fe 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0" [dependencies] -async-trait = "0.1.59" +async-trait = "0.1.60" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.9", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } binstalk-types = { version = "0.1.0", path = "../binstalk-types" } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index c050dbb5..bbb370be 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0" [dependencies] -async-trait = "0.1.59" +async-trait = "0.1.60" binstalk-downloader = { version = "0.2.0", path = "../binstalk-downloader" } binstalk-types = { version = "0.1.0", path = "../binstalk-types" } cargo_toml = "0.13.0" From b209d10ed5f3639e8986377a1c0d6a6135e86aaa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 04:39:48 +0000 Subject: [PATCH 0927/2020] Bump serde_json from 1.0.89 to 1.0.91 (#615) --- Cargo.lock | 4 ++-- crates/binstalk-manifests/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index be800711..eb526d0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2074,9 +2074,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.89" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "020ff22c755c2ed3f8cf162dbb41a7268d934702f3ed3631656ea597e08fc3db" +checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" dependencies = [ "itoa", "ryu", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index e6512ee0..bd0a930d 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -18,7 +18,7 @@ miette = "5.5.0" semver = { version = "1.0.14", features = ["serde"] } serde = { version = "1.0.150", features = ["derive"] } serde-tuple-vec-map = "1.0.1" -serde_json = "1.0.89" +serde_json = "1.0.91" thiserror = "1.0.37" toml_edit = { version = "0.15.0", features = ["easy"] } url = { version = "2.3.1", features = ["serde"] } From daf52a475adf6c2acf350151c38df23b9095b96b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 05:12:15 +0000 Subject: [PATCH 0928/2020] Bump serde from 1.0.150 to 1.0.151 (#616) --- Cargo.lock | 8 ++++---- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eb526d0c..8384b22a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2045,9 +2045,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.150" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e326c9ec8042f1b5da33252c8a37e9ffbd2c9bef0155215b6e6c80c790e05f91" +checksum = "97fed41fc1a24994d044e6db6935e69511a1153b52c15eb42493b26fa87feba0" dependencies = [ "serde_derive", ] @@ -2063,9 +2063,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.150" +version = "1.0.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42a3df25b0713732468deadad63ab9da1f1fd75a48a15024b50363f128db627e" +checksum = "255abe9a125a985c05190d687b320c12f9b1f0b99445e608c21ba0782c719ad8" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index bd0a930d..8e0dde75 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -16,7 +16,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" miette = "5.5.0" semver = { version = "1.0.14", features = ["serde"] } -serde = { version = "1.0.150", features = ["derive"] } +serde = { version = "1.0.151", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.91" thiserror = "1.0.37" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 17ec93bc..13ca104c 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" compact_str = { version = "0.6.1", features = ["serde"] } once_cell = "1.16.0" semver = { version = "1.0.14", features = ["serde"] } -serde = { version = "1.0.150", features = ["derive"] } +serde = { version = "1.0.151", features = ["derive"] } strum = "0.24.1" strum_macros = "0.24.3" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index bbb370be..f806f6c1 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ miette = "5.5.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.16.0" semver = { version = "1.0.14", features = ["serde"] } -serde = { version = "1.0.150", features = ["derive"] } +serde = { version = "1.0.151", features = ["derive"] } strum = "0.24.1" tempfile = "3.3.0" thiserror = "1.0.37" From 7714d42b605419ac922ef026ee59a9083b254516 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 19 Dec 2022 05:51:35 +0000 Subject: [PATCH 0929/2020] Bump semver from 1.0.14 to 1.0.16 (#614) --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8384b22a..4cbbe10b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2036,9 +2036,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.14" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" +checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" dependencies = [ "serde", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 26389610..3c275edd 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -31,7 +31,7 @@ log = { version = "0.4.17", features = ["std"] } miette = "5.5.0" mimalloc = { version = "0.1.32", default-features = false, optional = true } once_cell = "1.16.0" -semver = "1.0.14" +semver = "1.0.16" strum = "0.24.1" strum_macros = "0.24.3" supports-color = "2.0.0" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 8e0dde75..2001b7fb 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -15,7 +15,7 @@ compact_str = { version = "0.6.1", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" miette = "5.5.0" -semver = { version = "1.0.14", features = ["serde"] } +semver = { version = "1.0.16", features = ["serde"] } serde = { version = "1.0.151", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.91" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 13ca104c..804f1c16 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -12,7 +12,7 @@ license = "Apache-2.0 OR MIT" [dependencies] compact_str = { version = "0.6.1", features = ["serde"] } once_cell = "1.16.0" -semver = { version = "1.0.14", features = ["serde"] } +semver = { version = "1.0.16", features = ["serde"] } serde = { version = "1.0.151", features = ["derive"] } strum = "0.24.1" strum_macros = "0.24.3" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index f806f6c1..21d94204 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -25,7 +25,7 @@ jobslot = { version = "0.2.8", features = ["tokio"] } miette = "5.5.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.16.0" -semver = { version = "1.0.14", features = ["serde"] } +semver = { version = "1.0.16", features = ["serde"] } serde = { version = "1.0.151", features = ["derive"] } strum = "0.24.1" tempfile = "3.3.0" From e519409ad84d11a44a973e852a3edcfbcf9e5c32 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Dec 2022 14:38:07 +1100 Subject: [PATCH 0930/2020] Bump thiserror from 1.0.37 to 1.0.38 (#618) Bumps [thiserror](https://github.com/dtolnay/thiserror) from 1.0.37 to 1.0.38. - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.37...1.0.38) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4cbbe10b..99e81e8d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2279,18 +2279,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 0727f0fe..445c57c0 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -28,7 +28,7 @@ reqwest = { version = "0.11.13", features = ["stream", "gzip", "brotli", "deflat #tar = "0.4.38" tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.3.0" -thiserror = "1.0.37" +thiserror = "1.0.38" tokio = { version = "1.23.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.4", features = ["io"] } diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 2001b7fb..d88e74f3 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -19,7 +19,7 @@ semver = { version = "1.0.16", features = ["serde"] } serde = { version = "1.0.151", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.91" -thiserror = "1.0.37" +thiserror = "1.0.38" toml_edit = { version = "0.15.0", features = ["easy"] } url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 21d94204..06219d06 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -29,7 +29,7 @@ semver = { version = "1.0.16", features = ["serde"] } serde = { version = "1.0.151", features = ["derive"] } strum = "0.24.1" tempfile = "3.3.0" -thiserror = "1.0.37" +thiserror = "1.0.38" tinytemplate = "1.2.1" # parking_lot for `tokio::sync::OnceCell::const_new` tokio = { version = "1.23.0", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } From fef8bb67747f860508fadea1b60ae6e2c967a5c6 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 21 Dec 2022 17:07:04 +1100 Subject: [PATCH 0931/2020] Optimize binstalk-{manifest, types} (#610) * Add new dep maybe-owned v0.3.4 to binstalk-types with features serde * Re-export maybe_owned in binstalk-types * Optimize `CrateSource::url`: Use `MaybeOwned<'static, Url>` to avoid cloning in `CrateSource::cratesio_registry` * Optimize `Source`: Use `MaybeOwned<'static, Url>` to avoid cloning in `Source::cratesio_registry` and `impl From<&CrateSource> for Source`. * Optimize `Source`: Add lifetime `<'a>` to avoid cloning in `impl<'a> From<&'a CrateSource> for Source<'a>` * Optimize `CratesToml::append_to_path`: Avoid cloning caused by `CrateVersionSource::from` by manually `format!` name, version and source into string. * Add new dep beef v0.5.2 to binstalk-manifests with features impl_serde * Optimize `CratesToml::append_to_path`: Eliminate `metadata.bins.clone()` by using `Cow` * Replace dep toml_edit with toml v0.5.10 in binstalk-manifests to speed up compilation and reduce bloat. Previously we switch to toml_edit because it is unmaintained, but now with it moved into toml-rs/toml as a workspace, it is now under active maintenance again, thus we switch back to it. Signed-off-by: Jiahao XU --- Cargo.lock | 58 ++++++++----------- crates/binstalk-manifests/Cargo.toml | 3 +- .../binstalk-manifests/src/cargo_crates_v1.rs | 32 ++++++---- .../cargo_crates_v1/crate_version_source.rs | 42 ++++++++------ crates/binstalk-types/Cargo.toml | 1 + crates/binstalk-types/src/crate_info.rs | 5 +- crates/binstalk-types/src/lib.rs | 2 + 7 files changed, 76 insertions(+), 67 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 99e81e8d..0aa8c399 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -151,6 +151,15 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "beef" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" +dependencies = [ + "serde", +] + [[package]] name = "binstalk" version = "0.6.0" @@ -216,6 +225,7 @@ dependencies = [ name = "binstalk-manifests" version = "0.1.1" dependencies = [ + "beef", "binstalk-types", "compact_str", "detect-targets", @@ -228,7 +238,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror", - "toml_edit", + "toml", "url", ] @@ -237,6 +247,7 @@ name = "binstalk-types" version = "0.1.0" dependencies = [ "compact_str", + "maybe-owned", "once_cell", "semver", "serde", @@ -463,16 +474,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "combine" -version = "4.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" -dependencies = [ - "bytes", - "memchr", -] - [[package]] name = "compact_str" version = "0.6.1" @@ -1341,6 +1342,15 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +[[package]] +name = "maybe-owned" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4facc753ae494aeb6e3c22f839b158aebd4f9270f55cd3c79906c45476c47ab4" +dependencies = [ + "serde", +] + [[package]] name = "memchr" version = "2.5.0" @@ -2436,35 +2446,13 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" +checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f" dependencies = [ "serde", ] -[[package]] -name = "toml_datetime" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808b51e57d0ef8f71115d8f3a01e7d3750d01c79cac4b3eda910f4389fdf92fd" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1541ba70885967e662f69d31ab3aeca7b1aaecfcd58679590b893e9239c3646" -dependencies = [ - "combine", - "indexmap", - "itertools", - "serde", - "toml_datetime", -] - [[package]] name = "tower" version = "0.4.13" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index d88e74f3..aee13394 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -10,6 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] +beef = { version = "0.5.2", features = ["impl_serde"] } binstalk-types = { version = "0.1.0", path = "../binstalk-types" } compact_str = { version = "0.6.1", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } @@ -20,7 +21,7 @@ serde = { version = "1.0.151", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.91" thiserror = "1.0.38" -toml_edit = { version = "0.15.0", features = ["easy"] } +toml = "0.5.10" url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] diff --git a/crates/binstalk-manifests/src/cargo_crates_v1.rs b/crates/binstalk-manifests/src/cargo_crates_v1.rs index 536c484b..b9528220 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1.rs @@ -15,6 +15,7 @@ use std::{ path::{Path, PathBuf}, }; +use beef::Cow; use compact_str::CompactString; use fs_lock::FileLock; use home::cargo_home; @@ -31,12 +32,12 @@ mod crate_version_source; use crate_version_source::*; #[derive(Clone, Debug, Default, Deserialize, Serialize)] -pub struct CratesToml { +pub struct CratesToml<'a> { #[serde(with = "tuple_vec_map")] - v1: Vec<(String, Vec)>, + v1: Vec<(String, Cow<'a, [CompactString]>)>, } -impl CratesToml { +impl CratesToml<'_> { pub fn default_path() -> Result { Ok(cargo_home()?.join(".crates.toml")) } @@ -48,7 +49,7 @@ impl CratesToml { pub fn load_from_reader(mut reader: R) -> Result { let mut vec = Vec::new(); reader.read_to_end(&mut vec)?; - Ok(toml_edit::easy::from_slice(&vec)?) + Ok(toml::from_slice(&vec)?) } pub fn load_from_path(path: impl AsRef) -> Result { @@ -59,7 +60,7 @@ impl CratesToml { /// Only use it when you know that the crate is not in the manifest. /// Otherwise, you need to call [`CratesToml::remove`] first. pub fn insert(&mut self, cvs: &CrateVersionSource, bins: Vec) { - self.v1.push((cvs.to_string(), bins)); + self.v1.push((cvs.to_string(), Cow::owned(bins))); } pub fn remove(&mut self, name: &str) { @@ -75,7 +76,7 @@ impl CratesToml { } pub fn write_to_writer(&self, mut writer: W) -> Result<(), CratesTomlParseError> { - let data = toml_edit::easy::to_vec(&self)?; + let data = toml::to_vec(&self)?; writer.write_all(&data)?; Ok(()) } @@ -108,8 +109,15 @@ impl CratesToml { }; for metadata in iter { - c1.remove(&metadata.name); - c1.insert(&CrateVersionSource::from(metadata), metadata.bins.clone()); + let name = &metadata.name; + let version = &metadata.current_version; + let source = Source::from(&metadata.source); + + c1.remove(name); + c1.v1.push(( + format!("{name} {version} ({source})"), + Cow::borrowed(&metadata.bins), + )); } file.rewind()?; @@ -151,10 +159,10 @@ pub enum CratesTomlParseError { Io(#[from] io::Error), #[error(transparent)] - TomlParse(#[from] toml_edit::easy::de::Error), + TomlParse(#[from] toml::de::Error), #[error(transparent)] - TomlWrite(Box), + TomlWrite(Box), #[error(transparent)] CvsParse(Box), @@ -166,8 +174,8 @@ impl From for CratesTomlParseError { } } -impl From for CratesTomlParseError { - fn from(e: toml_edit::easy::ser::Error) -> Self { +impl From for CratesTomlParseError { + fn from(e: toml::ser::Error) -> Self { CratesTomlParseError::TomlWrite(Box::new(e)) } } diff --git a/crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs b/crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs index 1ed77011..313532e0 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs @@ -1,6 +1,6 @@ use std::{borrow::Cow, fmt, str::FromStr}; -use binstalk_types::crate_info::cratesio_url; +use binstalk_types::{crate_info::cratesio_url, maybe_owned::MaybeOwned}; use compact_str::CompactString; use miette::Diagnostic; use semver::Version; @@ -14,37 +14,45 @@ use crate::crate_info::{CrateInfo, CrateSource, SourceType}; pub struct CrateVersionSource { pub name: CompactString, pub version: Version, - pub source: Source, + pub source: Source<'static>, } impl From<&CrateInfo> for CrateVersionSource { fn from(metadata: &CrateInfo) -> Self { + use SourceType::*; + + let url = metadata.source.url.clone(); + super::CrateVersionSource { name: metadata.name.clone(), version: metadata.current_version.clone(), - source: Source::from(&metadata.source), + source: match metadata.source.source_type { + Git => Source::Git(url), + Path => Source::Path(url), + Registry => Source::Registry(url), + }, } } } #[derive(Clone, Debug, Ord, PartialOrd, Eq, PartialEq)] -pub enum Source { - Git(Url), - Path(Url), - Registry(Url), +pub enum Source<'a> { + Git(MaybeOwned<'a, Url>), + Path(MaybeOwned<'a, Url>), + Registry(MaybeOwned<'a, Url>), } -impl Source { - pub fn cratesio_registry() -> Source { - Self::Registry(cratesio_url().clone()) +impl Source<'static> { + pub fn cratesio_registry() -> Self { + Self::Registry(MaybeOwned::Borrowed(cratesio_url())) } } -impl From<&CrateSource> for Source { - fn from(source: &CrateSource) -> Self { +impl<'a> From<&'a CrateSource> for Source<'a> { + fn from(source: &'a CrateSource) -> Self { use SourceType::*; - let url = source.url.clone(); + let url = MaybeOwned::Borrowed(source.url.as_ref()); match source.source_type { Git => Self::Git(url), @@ -65,9 +73,9 @@ impl FromStr for CrateVersionSource { .splitn(2, '+') .collect::>()[..] { - ["git", url] => Source::Git(Url::parse(url)?), - ["path", url] => Source::Path(Url::parse(url)?), - ["registry", url] => Source::Registry(Url::parse(url)?), + ["git", url] => Source::Git(Url::parse(url)?.into()), + ["path", url] => Source::Path(Url::parse(url)?.into()), + ["registry", url] => Source::Registry(Url::parse(url)?.into()), [kind, arg] => { return Err(CvsParseError::UnknownSourceType { kind: kind.to_string().into_boxed_str(), @@ -117,7 +125,7 @@ impl fmt::Display for CrateVersionSource { } } -impl fmt::Display for Source { +impl fmt::Display for Source<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { match self { Source::Git(url) => write!(f, "git+{url}"), diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 804f1c16..3ca6d593 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -11,6 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] compact_str = { version = "0.6.1", features = ["serde"] } +maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.16.0" semver = { version = "1.0.16", features = ["serde"] } serde = { version = "1.0.151", features = ["derive"] } diff --git a/crates/binstalk-types/src/crate_info.rs b/crates/binstalk-types/src/crate_info.rs index 6d019593..eb28750e 100644 --- a/crates/binstalk-types/src/crate_info.rs +++ b/crates/binstalk-types/src/crate_info.rs @@ -3,6 +3,7 @@ use std::{borrow, cmp, hash}; use compact_str::CompactString; +use maybe_owned::MaybeOwned; use once_cell::sync::Lazy; use semver::Version; use serde::{Deserialize, Serialize}; @@ -69,14 +70,14 @@ pub enum SourceType { #[derive(Clone, Debug, Serialize, Deserialize)] pub struct CrateSource { pub source_type: SourceType, - pub url: Url, + pub url: MaybeOwned<'static, Url>, } impl CrateSource { pub fn cratesio_registry() -> CrateSource { Self { source_type: SourceType::Registry, - url: cratesio_url().clone(), + url: MaybeOwned::Borrowed(cratesio_url()), } } } diff --git a/crates/binstalk-types/src/lib.rs b/crates/binstalk-types/src/lib.rs index f4c48c85..25096520 100644 --- a/crates/binstalk-types/src/lib.rs +++ b/crates/binstalk-types/src/lib.rs @@ -1,2 +1,4 @@ pub mod cargo_toml_binstall; pub mod crate_info; + +pub use maybe_owned; From b5ca794ce93e8653754a018d0da95e33371545c3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Dec 2022 12:41:08 +1100 Subject: [PATCH 0932/2020] Bump clap from 4.0.29 to 4.0.30 (#620) --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0aa8c399..f9aad9d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -420,9 +420,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.29" +version = "4.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d63b9e9c07271b9957ad22c173bae2a4d9a81127680962039296abcd2f8251d" +checksum = "656ad1e55e23d287773f7d8192c300dc715c3eeded93b3da651d11c42cfd74d2" dependencies = [ "bitflags", "clap_derive", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 3c275edd..3ba5f842 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.6.0" } binstalk-manifests = { path = "../binstalk-manifests", version = "0.1.1" } -clap = { version = "4.0.29", features = ["derive"] } +clap = { version = "4.0.30", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = { version = "0.4.17", features = ["std"] } From 76e89f7b301bba7653ccc92188f9e26ba547b453 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Dec 2022 01:20:07 +0000 Subject: [PATCH 0933/2020] Bump clap from 4.0.30 to 4.0.32 (#624) Bumps [clap](https://github.com/clap-rs/clap) from 4.0.30 to 4.0.32. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.30...v4.0.32) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f9aad9d0..a16b8e91 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -420,9 +420,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.30" +version = "4.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "656ad1e55e23d287773f7d8192c300dc715c3eeded93b3da651d11c42cfd74d2" +checksum = "a7db700bc935f9e43e88d00b0850dae18a63773cfbec6d8e070fccf7fef89a39" dependencies = [ "bitflags", "clap_derive", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 3ba5f842..64438cd9 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.6.0" } binstalk-manifests = { path = "../binstalk-manifests", version = "0.1.1" } -clap = { version = "4.0.30", features = ["derive"] } +clap = { version = "4.0.32", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" log = { version = "0.4.17", features = ["std"] } From cdff92aa3ca05547426d0bf2c3c72a49c33c6048 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 24 Dec 2022 16:04:51 +1100 Subject: [PATCH 0934/2020] Fix reinstalling crates after removed by `cargo-uninstall` (#628) Honor `.crates.toml` only since `cargo-uninstall` can only update `.crates.toml`, not binstall's own manifest. Fixed #625 Signed-off-by: Jiahao XU --- crates/bin/src/entry.rs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index be51cf0f..6cb2216d 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -287,18 +287,11 @@ fn filter_out_installed_crates( let name = &crate_name.name; let curr_version = metadata - .and_then(|metadata| { - metadata - .0 - .get(name) - .map(|crate_info| &crate_info.current_version) - .into_iter() - .chain(metadata.1.get(name)) - // Since the cargo_install_v1_metadata could be out of sync - // from cargo_binstall_metadata, it is better to obtain - // the version from both of them and takes the larger one. - .max() - }); + // `cargo-uninstall` can be called to uninstall crates, + // but it only updates .crates.toml. + // + // So here we will honour .crates.toml only. + .and_then(|metadata| metadata.1.get(name)); match ( force, From 611485de52a31f3ba294c68db432dacc01aef512 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 27 Dec 2022 11:43:56 +0000 Subject: [PATCH 0935/2020] Bump taiki-e/install-action from 1 to 2 (#630) --- .github/workflows/build.yml | 2 +- .github/workflows/release-pr.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b4b46e1c..3140c933 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -65,7 +65,7 @@ jobs: - name: Install cross if: matrix.use-cross - uses: taiki-e/install-action@v1 + uses: taiki-e/install-action@v2 with: tool: cross diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 9b268f85..7e8ae121 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -37,7 +37,7 @@ jobs: rustup default nightly - uses: chainguard-dev/actions/setup-gitsign@main - name: Install cargo-release - uses: taiki-e/install-action@v1 + uses: taiki-e/install-action@v2 with: tool: cargo-release From 6bdb26930eba0a7c8566bb0741372c82a6424e53 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 28 Dec 2022 11:18:07 +1100 Subject: [PATCH 0936/2020] Refactor, improvements and bugfix for resolution and installation process (#619) * Refactor: Extract new mod `ops::resolve::resolution` * Refactor: Extract new type `ResolutionFetch` * Refactor: Extract new type `ResolutionSource` * Improve `Resolution::print`: Provides more details on which crate is the resolution for. * Make `Resolution::print` a pub fn * Refactor: Extract new fn `ResolutionFetch::install` * Refactor: Extract new async fn `ResolutionSource::install` * Optimize `ResolutionSource::install` avoiding `OsStr::to_string_lossy`. * Add new dep command-group v2.0.0 to binstalk with feat with-tokio * Fix `ResolutionSource::install`: Use `AsyncCommandGroup::group_spawn` instead of `tokio::process::Command::spawn` to ensure all the processes spanwed by the `cargo` process can be terminated with one signal sent to the `cargo` process. * Fix printing resolution: Make sure they are printed without interleaving * Refactor `entry::install_crates` * Improve dry-run output for `ResolutionSource::install` * Refactor: Extract new fn `ResolutionFetch::print` * Refactor: Extract new fn `ResolutionSource::print` * Optimize `Resolution`: Box unit variant `Fetch` * Improve formatting of `tokio::process::Command` Prints out sth like `cargo install ...` instead of the `Debug::fmt`. * Improve dry-run output Signed-off-by: Jiahao XU --- Cargo.lock | 31 +++ crates/bin/src/entry.rs | 156 +++++++------- crates/binstalk/Cargo.toml | 1 + crates/binstalk/src/ops.rs | 1 - crates/binstalk/src/ops/install.rs | 149 ------------- crates/binstalk/src/ops/resolve.rs | 76 +------ crates/binstalk/src/ops/resolve/resolution.rs | 198 ++++++++++++++++++ 7 files changed, 323 insertions(+), 289 deletions(-) delete mode 100644 crates/binstalk/src/ops/install.rs create mode 100644 crates/binstalk/src/ops/resolve/resolution.rs diff --git a/Cargo.lock b/Cargo.lock index a16b8e91..27c89098 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -168,6 +168,7 @@ dependencies = [ "binstalk-downloader", "binstalk-types", "cargo_toml", + "command-group", "compact_str", "crates_io_api", "detect-targets", @@ -474,6 +475,18 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "command-group" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e98782b6b757b633bd1da9d1a4ee7d323a6bd205a32b1c242d5e56e7092dfd3f" +dependencies = [ + "async-trait", + "nix", + "tokio", + "winapi", +] + [[package]] name = "compact_str" version = "0.6.1" @@ -1451,6 +1464,18 @@ dependencies = [ "tempfile", ] +[[package]] +name = "nix" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46a58d1d356c6597d08cde02c2f09d785b09e28711837b1ed667dc652c08a694" +dependencies = [ + "bitflags", + "cfg-if", + "libc", + "static_assertions", +] + [[package]] name = "normalize-path" version = "0.2.0" @@ -2169,6 +2194,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + [[package]] name = "strsim" version = "0.10.0" diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 6cb2216d..5431e4c9 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -111,90 +111,98 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - let no_confirm = args.no_confirm; let no_cleanup = args.no_cleanup; - let tasks: Vec<_> = if !dry_run && !no_confirm { - // Resolve crates - let tasks: Vec<_> = crate_names - .map(|(crate_name, current_version)| { - AutoAbortJoinHandle::spawn(ops::resolve::resolve( - binstall_opts.clone(), - crate_name, - current_version, - )) - }) - .collect(); + // Resolve crates + let tasks: Vec<_> = crate_names + .map(|(crate_name, current_version)| { + AutoAbortJoinHandle::spawn(ops::resolve::resolve( + binstall_opts.clone(), + crate_name, + current_version, + )) + }) + .collect(); - // Confirm - let mut resolutions = Vec::with_capacity(tasks.len()); - for task in tasks { - match task.await?? { - Resolution::AlreadyUpToDate => {} - res => resolutions.push(res), - } - } + // Collect results + let mut resolution_fetchs = Vec::new(); + let mut resolution_sources = Vec::new(); - if resolutions.is_empty() { - debug!("Nothing to do"); - return Ok(()); - } - - confirm().await?; - - // Install - resolutions - .into_iter() - .map(|resolution| { - AutoAbortJoinHandle::spawn(ops::install::install(resolution, binstall_opts.clone())) - }) - .collect() - } else { - // Resolve crates and install without confirmation - crate_names - .map(|(crate_name, current_version)| { - let opts = binstall_opts.clone(); - - AutoAbortJoinHandle::spawn(async move { - let resolution = - ops::resolve::resolve(opts.clone(), crate_name, current_version).await?; - - ops::install::install(resolution, opts).await - }) - }) - .collect() - }; - - let mut metadata_vec = Vec::with_capacity(tasks.len()); for task in tasks { - if let Some(metadata) = task.await?? { - metadata_vec.push(metadata); + match task.await?? { + Resolution::AlreadyUpToDate => {} + Resolution::Fetch(fetch) => { + fetch.print(&binstall_opts); + resolution_fetchs.push(fetch) + } + Resolution::InstallFromSource(source) => { + source.print(); + resolution_sources.push(source) + } } } - block_in_place(|| { - if let Some((mut cargo_binstall_metadata, _)) = metadata { - // The cargo manifest path is already created when loading - // metadata. + if resolution_fetchs.is_empty() && resolution_sources.is_empty() { + debug!("Nothing to do"); + return Ok(()); + } - debug!("Writing .crates.toml"); - CratesToml::append_to_path(cargo_roots.join(".crates.toml"), metadata_vec.iter())?; + // Confirm + if !dry_run && !no_confirm { + confirm().await?; + } - debug!("Writing binstall/crates-v1.json"); - for metadata in metadata_vec { - cargo_binstall_metadata.replace(metadata); - } - cargo_binstall_metadata.overwrite()?; - } - - if no_cleanup { - // Consume temp_dir without removing it from fs. - temp_dir.into_path(); + if !resolution_fetchs.is_empty() { + if dry_run { + info!("Dry-run: Not proceeding to install fetched binaries"); } else { - temp_dir.close().unwrap_or_else(|err| { - warn!("Failed to clean up some resources: {err}"); - }); - } + let f = || -> Result<()> { + let metadata_vec = resolution_fetchs + .into_iter() + .map(|fetch| fetch.install(&binstall_opts)) + .collect::, BinstallError>>()?; - Ok(()) - }) + if let Some((mut cargo_binstall_metadata, _)) = metadata { + // The cargo manifest path is already created when loading + // metadata. + + debug!("Writing .crates.toml"); + CratesToml::append_to_path( + cargo_roots.join(".crates.toml"), + metadata_vec.iter(), + )?; + + debug!("Writing binstall/crates-v1.json"); + for metadata in metadata_vec { + cargo_binstall_metadata.replace(metadata); + } + cargo_binstall_metadata.overwrite()?; + } + + if no_cleanup { + // Consume temp_dir without removing it from fs. + temp_dir.into_path(); + } else { + temp_dir.close().unwrap_or_else(|err| { + warn!("Failed to clean up some resources: {err}"); + }); + } + + Ok(()) + }; + + block_in_place(f)?; + } + } + + let tasks: Vec<_> = resolution_sources + .into_iter() + .map(|source| AutoAbortJoinHandle::spawn(source.install(binstall_opts.clone()))) + .collect(); + + for task in tasks { + task.await??; + } + + Ok(()) } type Metadata = (BinstallCratesV1Records, BTreeMap); diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 06219d06..7b13ebd0 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -14,6 +14,7 @@ async-trait = "0.1.60" binstalk-downloader = { version = "0.2.0", path = "../binstalk-downloader" } binstalk-types = { version = "0.1.0", path = "../binstalk-types" } cargo_toml = "0.13.0" +command-group = { version = "2.0.0", features = ["with-tokio"] } compact_str = { version = "0.6.1", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.3", path = "../detect-targets" } diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index a0a14982..1b49f8a0 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -12,7 +12,6 @@ use crate::{ DesiredTargets, }; -pub mod install; pub mod resolve; pub type Resolver = fn(Client, Arc, Arc) -> Arc; diff --git a/crates/binstalk/src/ops/install.rs b/crates/binstalk/src/ops/install.rs deleted file mode 100644 index d541315f..00000000 --- a/crates/binstalk/src/ops/install.rs +++ /dev/null @@ -1,149 +0,0 @@ -use std::{borrow::Cow, env, ffi::OsStr, sync::Arc}; - -use compact_str::CompactString; -use tokio::{process::Command, task::block_in_place}; -use tracing::{debug, error, info, instrument}; - -use super::{resolve::Resolution, Options}; -use crate::{ - bins, - errors::BinstallError, - helpers::jobserver_client::LazyJobserverClient, - manifests::crate_info::{CrateInfo, CrateSource}, -}; - -#[instrument(skip_all)] -pub async fn install( - resolution: Resolution, - opts: Arc, -) -> Result, BinstallError> { - match resolution { - Resolution::AlreadyUpToDate => Ok(None), - Resolution::Fetch { - fetcher, - new_version, - name, - version_req, - bin_files, - } => { - let target = fetcher.target().into(); - - install_from_package(opts, bin_files).map(|option| { - option.map(|bins| CrateInfo { - name, - version_req, - current_version: new_version, - source: CrateSource::cratesio_registry(), - target, - bins, - }) - }) - } - Resolution::InstallFromSource { name, version } => { - let desired_targets = opts.desired_targets.get().await; - let target = desired_targets - .first() - .ok_or(BinstallError::NoViableTargets)?; - - if !opts.dry_run { - install_from_source( - &name, - &version, - target, - &opts.jobserver_client, - opts.quiet, - opts.force, - ) - .await - .map(|_| None) - } else { - info!( - "Dry-run: running `cargo install {name} --version {version} --target {target}`", - ); - Ok(None) - } - } - } -} - -fn install_from_package( - opts: Arc, - bin_files: Vec, -) -> Result>, BinstallError> { - if opts.dry_run { - info!("Dry run, not proceeding"); - return Ok(None); - } - - info!("Installing binaries..."); - block_in_place(|| { - for file in &bin_files { - file.install_bin()?; - } - - // Generate symlinks - if !opts.no_symlinks { - for file in &bin_files { - file.install_link()?; - } - } - - Ok(Some( - bin_files.into_iter().map(|bin| bin.base_name).collect(), - )) - }) -} - -async fn install_from_source( - name: &str, - version: &str, - target: &str, - lazy_jobserver_client: &LazyJobserverClient, - quiet: bool, - force: bool, -) -> Result<(), BinstallError> { - let jobserver_client = lazy_jobserver_client.get().await?; - - let cargo = env::var_os("CARGO") - .map(Cow::Owned) - .unwrap_or_else(|| Cow::Borrowed(OsStr::new("cargo"))); - - debug!( - "Running `{} install {name} --version {version} --target {target}`", - cargo.to_string_lossy(), - ); - - let mut cmd = Command::new(cargo); - - cmd.arg("install") - .arg(name) - .arg("--version") - .arg(version) - .arg("--target") - .arg(target) - .kill_on_drop(true); - - if quiet { - cmd.arg("--quiet"); - } - - if force { - cmd.arg("--force"); - } - - let mut child = jobserver_client.configure_and_run(&mut cmd, |cmd| cmd.spawn())?; - - debug!("Spawned command pid={:?}", child.id()); - - let status = child.wait().await?; - if status.success() { - info!("Cargo finished successfully"); - Ok(()) - } else { - error!("Cargo errored! {status:?}"); - Err(BinstallError::SubProcess { - command: format!("{cmd:?}").into_boxed_str(), - status, - }) - } -} diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 306a562a..7fa725ac 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -27,66 +27,14 @@ use crate::{ mod crate_name; #[doc(inline)] pub use crate_name::CrateName; + mod version_ext; #[doc(inline)] pub use version_ext::VersionReqExt; -pub enum Resolution { - Fetch { - fetcher: Arc, - new_version: Version, - name: CompactString, - version_req: CompactString, - bin_files: Vec, - }, - InstallFromSource { - name: CompactString, - version: CompactString, - }, - AlreadyUpToDate, -} -impl Resolution { - fn print(&self, opts: &Options) { - match self { - Resolution::Fetch { - fetcher, bin_files, .. - } => { - let fetcher_target = fetcher.target(); - // Prompt user for confirmation - debug!( - "Found a binary install source: {} ({fetcher_target})", - fetcher.source_name() - ); - - warn!( - "The package will be downloaded from {}{}", - if fetcher.is_third_party() { - "third-party source " - } else { - "" - }, - fetcher.source_name() - ); - - info!("This will install the following binaries:"); - for file in bin_files { - info!(" - {}", file.preview_bin()); - } - - if !opts.no_symlinks { - info!("And create (or update) the following symlinks:"); - for file in bin_files { - info!(" - {}", file.preview_link()); - } - } - } - Resolution::InstallFromSource { .. } => { - warn!("The package will be installed from source (with cargo)",) - } - Resolution::AlreadyUpToDate => (), - } - } -} +mod resolution; +#[doc(inline)] +pub use resolution::{Resolution, ResolutionFetch, ResolutionSource}; #[instrument(skip_all)] pub async fn resolve( @@ -95,17 +43,15 @@ pub async fn resolve( curr_version: Option, ) -> Result { let crate_name_name = crate_name.name.clone(); - let resolution = resolve_inner(&opts, crate_name, curr_version) + let resolution = resolve_inner(opts, crate_name, curr_version) .await .map_err(|err| err.crate_context(crate_name_name))?; - resolution.print(&opts); - Ok(resolution) } async fn resolve_inner( - opts: &Options, + opts: Arc, crate_name: CrateName, curr_version: Option, ) -> Result { @@ -120,7 +66,7 @@ async fn resolve_inner( let version_req_str = version_req.to_compact_string(); - let Some(package_info) = PackageInfo::resolve(opts, + let Some(package_info) = PackageInfo::resolve(&opts, crate_name.name, curr_version, version_req, @@ -188,13 +134,13 @@ async fn resolve_inner( { Ok(bin_files) => { if !bin_files.is_empty() { - return Ok(Resolution::Fetch { + return Ok(Resolution::Fetch(Box::new(ResolutionFetch { fetcher, new_version: package_info.version, name: package_info.name, version_req: version_req_str, bin_files, - }); + }))); } else { warn!( "Error when checking binaries provided by fetcher {}: \ @@ -227,10 +173,10 @@ async fn resolve_inner( } if opts.cargo_install_fallback { - Ok(Resolution::InstallFromSource { + Ok(Resolution::InstallFromSource(ResolutionSource { name: package_info.name, version: package_info.version_str, - }) + })) } else { Err(BinstallError::NoFallbackToCargoInstall) } diff --git a/crates/binstalk/src/ops/resolve/resolution.rs b/crates/binstalk/src/ops/resolve/resolution.rs new file mode 100644 index 00000000..d313ac59 --- /dev/null +++ b/crates/binstalk/src/ops/resolve/resolution.rs @@ -0,0 +1,198 @@ +use std::{borrow::Cow, env, ffi::OsStr, fmt, iter, path::Path, sync::Arc}; + +use command_group::AsyncCommandGroup; +use compact_str::{CompactString, ToCompactString}; +use either::Either; +use itertools::Itertools; +use semver::Version; +use tokio::process::Command; +use tracing::{debug, error, info, warn}; + +use crate::{ + bins, + errors::BinstallError, + fetchers::Fetcher, + manifests::crate_info::{CrateInfo, CrateSource}, + ops::Options, +}; + +pub struct ResolutionFetch { + pub fetcher: Arc, + pub new_version: Version, + pub name: CompactString, + pub version_req: CompactString, + pub bin_files: Vec, +} + +pub struct ResolutionSource { + pub name: CompactString, + pub version: CompactString, +} + +pub enum Resolution { + Fetch(Box), + InstallFromSource(ResolutionSource), + AlreadyUpToDate, +} + +impl Resolution { + pub fn print(&self, opts: &Options) { + match self { + Resolution::Fetch(fetch) => { + fetch.print(opts); + } + Resolution::InstallFromSource(source) => { + source.print(); + } + Resolution::AlreadyUpToDate => (), + } + } +} + +impl ResolutionFetch { + pub fn install(self, opts: &Options) -> Result { + info!("Installing binaries..."); + for file in &self.bin_files { + file.install_bin()?; + } + + // Generate symlinks + if !opts.no_symlinks { + for file in &self.bin_files { + file.install_link()?; + } + } + + Ok(CrateInfo { + name: self.name, + version_req: self.version_req, + current_version: self.new_version, + source: CrateSource::cratesio_registry(), + target: self.fetcher.target().to_compact_string(), + bins: self + .bin_files + .into_iter() + .map(|bin| bin.base_name) + .collect(), + }) + } + + pub fn print(&self, opts: &Options) { + let fetcher = &self.fetcher; + let bin_files = &self.bin_files; + let name = &self.name; + let new_version = &self.new_version; + + debug!( + "Found a binary install source: {} ({})", + fetcher.source_name(), + fetcher.target() + ); + + warn!( + "The package {name} v{new_version} will be downloaded from {}{}", + if fetcher.is_third_party() { + "third-party source " + } else { + "" + }, + fetcher.source_name() + ); + + info!("This will install the following binaries:"); + for file in bin_files { + info!(" - {}", file.preview_bin()); + } + + if !opts.no_symlinks { + info!("And create (or update) the following symlinks:"); + for file in bin_files { + info!(" - {}", file.preview_link()); + } + } + } +} + +impl ResolutionSource { + pub async fn install(self, opts: Arc) -> Result<(), BinstallError> { + let desired_targets = opts.desired_targets.get().await; + let target = desired_targets + .first() + .ok_or(BinstallError::NoViableTargets)?; + + let name = &self.name; + let version = &self.version; + + let cargo = env::var_os("CARGO") + .map(Cow::Owned) + .unwrap_or_else(|| Cow::Borrowed(OsStr::new("cargo"))); + + debug!( + "Running `{} install {name} --version {version} --target {target}`", + Path::new(&cargo).display(), + ); + + let mut cmd = Command::new(cargo); + + cmd.arg("install") + .arg(name) + .arg("--version") + .arg(version) + .arg("--target") + .arg(target) + .kill_on_drop(true); + + if opts.quiet { + cmd.arg("--quiet"); + } + + if opts.force { + cmd.arg("--force"); + } + + if !opts.dry_run { + let mut child = opts + .jobserver_client + .get() + .await? + .configure_and_run(&mut cmd, |cmd| cmd.group_spawn())?; + + debug!("Spawned command pid={:?}", child.id()); + + let status = child.wait().await?; + if status.success() { + info!("Cargo finished successfully"); + Ok(()) + } else { + error!("Cargo errored! {status:?}"); + Err(BinstallError::SubProcess { + command: format_cmd(&cmd).to_string().into_boxed_str(), + status, + }) + } + } else { + info!("Dry-run: running `{}`", format_cmd(&cmd)); + Ok(()) + } + } + + pub fn print(&self) { + warn!( + "The package {} v{} will be installed from source (with cargo)", + self.name, self.version + ) + } +} + +fn format_cmd(cmd: &Command) -> impl fmt::Display + '_ { + let cmd = cmd.as_std(); + + let program = Either::Left(Path::new(cmd.get_program()).display()); + + let program_args = cmd + .get_args() + .map(OsStr::to_string_lossy) + .map(Either::Right); + + iter::once(program).chain(program_args).format(" ") +} From c87d42d2d84ad37c9a85c49d4e15cded49765fa5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 28 Dec 2022 11:31:47 +1100 Subject: [PATCH 0937/2020] Fix `CratesToml::load_from_reader`: Ret default for empty reader (#622) Fixed #621 Also add a new unit test for this bug. Signed-off-by: Jiahao XU --- .../binstalk-manifests/src/cargo_crates_v1.rs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/crates/binstalk-manifests/src/cargo_crates_v1.rs b/crates/binstalk-manifests/src/cargo_crates_v1.rs index b9528220..7be49cb7 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1.rs @@ -49,7 +49,12 @@ impl CratesToml<'_> { pub fn load_from_reader(mut reader: R) -> Result { let mut vec = Vec::new(); reader.read_to_end(&mut vec)?; - Ok(toml::from_slice(&vec)?) + + if vec.is_empty() { + Ok(Self::default()) + } else { + toml::from_slice(&vec).map_err(CratesTomlParseError::from) + } } pub fn load_from_path(path: impl AsRef) -> Result { @@ -246,6 +251,16 @@ mod tests { ); } + #[test] + fn test_empty_file() { + let tempdir = TempDir::new().unwrap(); + let path = tempdir.path().join("crates-v1.toml"); + + File::create(&path).unwrap(); + + assert!(CratesToml::load_from_path(&path).unwrap().v1.is_empty()); + } + #[test] fn test_loading() { let raw_data = br#" From 31c6524833425bc22bc249bb93f22f40fea626fb Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 28 Dec 2022 11:33:35 +1100 Subject: [PATCH 0938/2020] Impl new fn `CratesToml::append_to_file` (#629) Prepare for fix for #588 * Impl new fn `CratesToml::append_to_file` * Optimize `CratesToml::append_to_file`: Avoid dup monomorphization Signed-off-by: Jiahao XU --- .../binstalk-manifests/src/cargo_crates_v1.rs | 54 +++++++++++-------- 1 file changed, 32 insertions(+), 22 deletions(-) diff --git a/crates/binstalk-manifests/src/cargo_crates_v1.rs b/crates/binstalk-manifests/src/cargo_crates_v1.rs index 7be49cb7..f5315682 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1.rs @@ -99,6 +99,37 @@ impl CratesToml<'_> { self.write_to_file(&mut file) } + pub fn append_to_file<'a, Iter>(file: &mut File, iter: Iter) -> Result<(), CratesTomlParseError> + where + Iter: IntoIterator, + { + fn inner( + file: &mut File, + iter: &mut dyn Iterator, + ) -> Result<(), CratesTomlParseError> { + let mut c1 = CratesToml::load_from_reader(&mut *file)?; + + for metadata in iter { + let name = &metadata.name; + let version = &metadata.current_version; + let source = Source::from(&metadata.source); + + c1.remove(name); + c1.v1.push(( + format!("{name} {version} ({source})"), + Cow::borrowed(&metadata.bins), + )); + } + + file.rewind()?; + c1.write_to_file(file)?; + + Ok(()) + } + + inner(file, &mut iter.into_iter()) + } + pub fn append_to_path<'a, Iter>( path: impl AsRef, iter: Iter, @@ -107,28 +138,7 @@ impl CratesToml<'_> { Iter: IntoIterator, { let mut file = FileLock::new_exclusive(create_if_not_exist(path.as_ref())?)?; - let mut c1 = if file.metadata()?.len() != 0 { - Self::load_from_reader(&mut *file)? - } else { - Self::default() - }; - - for metadata in iter { - let name = &metadata.name; - let version = &metadata.current_version; - let source = Source::from(&metadata.source); - - c1.remove(name); - c1.v1.push(( - format!("{name} {version} ({source})"), - Cow::borrowed(&metadata.bins), - )); - } - - file.rewind()?; - c1.write_to_file(&mut file)?; - - Ok(()) + Self::append_to_file(&mut file, iter) } pub fn append<'a, Iter>(iter: Iter) -> Result<(), CratesTomlParseError> From 6a83e22460fcaea4eb4493a4d7659012e55c9aaa Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 28 Dec 2022 12:00:04 +1100 Subject: [PATCH 0939/2020] Update transitive dependencies (#623) Signed-off-by: Jiahao XU --- Cargo.lock | 179 +++++++++++++++++++++++++---------------------------- 1 file changed, 85 insertions(+), 94 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 27c89098..ed117e52 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.17.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ecd88a8c8378ca913a680cd98f0f13ac67383d35993f86c90a70e3f137816b" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" dependencies = [ "gimli", ] @@ -30,9 +30,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.19" +version = "0.7.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4f55bd91a0978cbfd91c457a164bab8b4001c833b7f323132c0a4e1922dd44e" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" dependencies = [ "memchr", ] @@ -132,15 +132,15 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide 0.5.4", + "miniz_oxide", "object", "rustc-demangle", ] @@ -390,9 +390,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.77" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9f73505338f7d905b19d18738976aae232eb46b8efc15554ffc56deb5d9ebe4" +checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" dependencies = [ "jobserver", ] @@ -554,9 +554,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.83" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf07d07d6531bfcdbe9b8b739b104610c6508dcc4d63b410585faf338241daf" +checksum = "5add3fc1717409d029b20c5b6903fc0c0b02fa6741d820054f4a2efa5e5816fd" dependencies = [ "cc", "cxxbridge-flags", @@ -566,9 +566,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.83" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2eb5b96ecdc99f72657332953d4d9c50135af1bac34277801cc3937906ebd39" +checksum = "b4c87959ba14bc6fbc61df77c3fcfe180fc32b93538c4f1031dd802ccb5f2ff0" dependencies = [ "cc", "codespan-reporting", @@ -581,15 +581,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.83" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac040a39517fd1674e0f32177648334b0f4074625b5588a64519804ba0553b12" +checksum = "69a3e162fde4e594ed2b07d0f83c6c67b745e7f28ce58c6df5e6b6bef99dfb59" [[package]] name = "cxxbridge-macro" -version = "1.0.83" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1362b0ddcfc4eb0a1f57b68bd77dd99f0e826958a96abd0ae9bd092e114ffed6" +checksum = "3e7e2adeb6a0d4a282e581096b06e1791532b7d576dcde5ccd9382acf55db8e6" dependencies = [ "proc-macro2", "quote", @@ -598,9 +598,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" +checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" [[package]] name = "detect-targets" @@ -720,9 +720,9 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b9663d381d07ae25dc88dbdf27df458faa83a9b25336bcac83d5e452b5fc9d3" +checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9" dependencies = [ "cfg-if", "libc", @@ -738,7 +738,7 @@ checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" dependencies = [ "crc32fast", "libz-ng-sys", - "miniz_oxide 0.6.2", + "miniz_oxide", ] [[package]] @@ -910,9 +910,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.26.2" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" +checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793" [[package]] name = "guess_host_triple" @@ -1058,9 +1058,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.1" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59df7c4e19c950e6e0e868dcc0a300b09a9b88e9ec55bd879ca819087a77355d" +checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" dependencies = [ "http", "hyper", @@ -1154,9 +1154,9 @@ checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" [[package]] name = "io-lifetimes" -version = "1.0.1" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7d367024b3f3414d8e01f437f704f41a9f64ab36f9067fa73e526ad4c763c87" +checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c" dependencies = [ "libc", "windows-sys 0.42.0", @@ -1176,19 +1176,19 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.5.1" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f88c5561171189e69df9d98bcf18fd5f9558300f7ea7b801eb8a0fd748bd8745" +checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e" [[package]] name = "is-terminal" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927609f78c2913a6f6ac3c27a4fe87f43e2a35367c0c4b0f8265e8f49a104330" +checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" dependencies = [ "hermit-abi 0.2.6", - "io-lifetimes 1.0.1", - "rustix 0.36.4", + "io-lifetimes 1.0.3", + "rustix 0.36.5", "windows-sys 0.42.0", ] @@ -1209,9 +1209,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" [[package]] name = "jobserver" @@ -1253,9 +1253,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.137" +version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7fcc620a3bff7cdd7a365be3376c97191aeaccc2a603e600951e452615bf89" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "libmimalloc-sys" @@ -1279,9 +1279,9 @@ dependencies = [ [[package]] name = "link-cplusplus" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9272ab7b96c9046fbc5bc56c06c117cb639fe2d509df0c421cad82d2915cf369" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" dependencies = [ "cc", ] @@ -1300,9 +1300,9 @@ checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" [[package]] name = "linux-raw-sys" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f9f08d8963a6c613f4b1a78f4f4a4dbfadf8e6545b2d72861731e4858b8b47f" +checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "lock_api" @@ -1416,15 +1416,6 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" -[[package]] -name = "miniz_oxide" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.6.2" @@ -1511,19 +1502,19 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi 0.2.6", "libc", ] [[package]] name = "object" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" +checksum = "239da7f290cfa979f43f85a8efeee9a8a76d0827c356d37f9d3d7254d6b537fb" dependencies = [ "memchr", ] @@ -1536,9 +1527,9 @@ checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" [[package]] name = "openssl" -version = "0.10.42" +version = "0.10.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12fc0523e3bd51a692c8850d075d74dc062ccf251c0110668cbd921917118a13" +checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" dependencies = [ "bitflags", "cfg-if", @@ -1568,9 +1559,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.77" +version = "0.9.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03b84c3b2d099b81f0953422b4d4ad58761589d0229b5506356afca05a3670a" +checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" dependencies = [ "autocfg", "cc", @@ -1609,9 +1600,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dc9e0dc2adc1c69d09143aff38d3d30c5c3f0df0dad82e6d25547af174ebec0" +checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" dependencies = [ "cfg-if", "libc", @@ -1696,9 +1687,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" dependencies = [ "unicode-ident", ] @@ -1750,9 +1741,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f832d8958db3e84d2ec93b5eb2272b45aa23cf7f8fe6e79f578896f4e6c231b" +checksum = "b07946277141531aea269befd949ed16b2c85a780ba1043244eda0969e538e54" dependencies = [ "futures-util", "libc", @@ -1764,9 +1755,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.21" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" dependencies = [ "proc-macro2", ] @@ -1948,15 +1939,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb93e85278e08bb5788653183213d3a60fc242b10cb9be96586f5a73dcb67c23" +checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588" dependencies = [ "bitflags", "errno", - "io-lifetimes 1.0.1", + "io-lifetimes 1.0.3", "libc", - "linux-raw-sys 0.1.3", + "linux-raw-sys 0.1.4", "windows-sys 0.42.0", ] @@ -2004,15 +1995,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97477e48b4cf8603ad5f7aaf897467cf42ab4218a38ef76fb14c2d6773a6d6a8" +checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" [[package]] name = "ryu" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" [[package]] name = "schannel" @@ -2032,9 +2023,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "scratch" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8132065adcfd6e02db789d9285a0deb2f3fcb04002865ab67d5fb103533898" +checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" [[package]] name = "sct" @@ -2120,9 +2111,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "184c643044780f7ceb59104cef98a5a6f12cb2288a7bc701ab93a362b49fd47d" +checksum = "26b04f22b563c91331a10074bda3dd5492e3cc39d56bd557e91c0af42b6c7341" dependencies = [ "serde", ] @@ -2265,9 +2256,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.104" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae548ec36cf198c0ef7710d3c230987c2d6d7bd98ad6edc0274462724c585ce" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", @@ -2405,9 +2396,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.0" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9724f9a975fb987ef7a3cd9be0350edcbe130698af5b8f7a631e23d42d052484" +checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" dependencies = [ "proc-macro2", "quote", @@ -2652,9 +2643,9 @@ checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" [[package]] name = "typenum" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "unicode-bidi" @@ -2664,9 +2655,9 @@ checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ceab39d59e4c9499d4e5a8ee0e2735b891bb7308ac83dfb4e80cad195c9f6f3" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" [[package]] name = "unicode-linebreak" @@ -2741,9 +2732,9 @@ dependencies = [ [[package]] name = "vswhom-sys" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22025f6d8eb903ebf920ea6933b70b1e495be37e2cb4099e62c80454aaf57c39" +checksum = "d3b17ae1f6c8a2b28506cd96d412eebf83b4a0ff2cbefeeb952f2f9dfa44ba18" dependencies = [ "cc", "libc", @@ -2859,9 +2850,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.22.5" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368bfe657969fb01238bb756d351dcade285e0f6fcbd36dcb23359a5169975be" +checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ "webpki", ] @@ -3070,9 +3061,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.1+zstd.1.5.2" +version = "2.0.4+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fd07cbbc53846d9145dbffdf6dd09a7a0aa52be46741825f5c97bdd4f73f12b" +checksum = "4fa202f2ef00074143e219d15b62ffc317d17cc33909feac471c044087cad7b0" dependencies = [ "cc", "libc", From 6120a6d17ff53b96440f763d87ec566eb4eb9d04 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Dec 2022 01:29:03 +0000 Subject: [PATCH 0940/2020] Bump command-group from 2.0.0 to 2.0.1 (#634) Bumps [command-group](https://github.com/watchexec/command-group) from 2.0.0 to 2.0.1. - [Release notes](https://github.com/watchexec/command-group/releases) - [Changelog](https://github.com/watchexec/command-group/blob/main/CHANGELOG.md) - [Commits](https://github.com/watchexec/command-group/compare/v2.0.0...v2.0.1) --- updated-dependencies: - dependency-name: command-group dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ed117e52..c0a9f1e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -477,9 +477,9 @@ dependencies = [ [[package]] name = "command-group" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98782b6b757b633bd1da9d1a4ee7d323a6bd205a32b1c242d5e56e7092dfd3f" +checksum = "026c3922235f9f7d78f21251a026f3acdeb7cce3deba107fe09a4bfa63d850a2" dependencies = [ "async-trait", "nix", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 7b13ebd0..77b10a57 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -14,7 +14,7 @@ async-trait = "0.1.60" binstalk-downloader = { version = "0.2.0", path = "../binstalk-downloader" } binstalk-types = { version = "0.1.0", path = "../binstalk-types" } cargo_toml = "0.13.0" -command-group = { version = "2.0.0", features = ["with-tokio"] } +command-group = { version = "2.0.1", features = ["with-tokio"] } compact_str = { version = "0.6.1", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.3", path = "../detect-targets" } From c022cd9b0cfc7fa217cc97010837afa0208934a1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Dec 2022 02:30:38 +0000 Subject: [PATCH 0941/2020] Bump serde from 1.0.151 to 1.0.152 (#633) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.151 to 1.0.152. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.151...v1.0.152) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c0a9f1e8..f7a54717 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2071,9 +2071,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.151" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fed41fc1a24994d044e6db6935e69511a1153b52c15eb42493b26fa87feba0" +checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" dependencies = [ "serde_derive", ] @@ -2089,9 +2089,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.151" +version = "1.0.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "255abe9a125a985c05190d687b320c12f9b1f0b99445e608c21ba0782c719ad8" +checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index aee13394..1b67f72a 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -17,7 +17,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" miette = "5.5.0" semver = { version = "1.0.16", features = ["serde"] } -serde = { version = "1.0.151", features = ["derive"] } +serde = { version = "1.0.152", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.91" thiserror = "1.0.38" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 3ca6d593..9c7d067c 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -14,7 +14,7 @@ compact_str = { version = "0.6.1", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.16.0" semver = { version = "1.0.16", features = ["serde"] } -serde = { version = "1.0.151", features = ["derive"] } +serde = { version = "1.0.152", features = ["derive"] } strum = "0.24.1" strum_macros = "0.24.3" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 77b10a57..732abb14 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -27,7 +27,7 @@ miette = "5.5.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.16.0" semver = { version = "1.0.16", features = ["serde"] } -serde = { version = "1.0.151", features = ["derive"] } +serde = { version = "1.0.152", features = ["derive"] } strum = "0.24.1" tempfile = "3.3.0" thiserror = "1.0.38" From 287ae03a51f1012dc93a7444ebc942a8fd941436 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 28 Dec 2022 04:16:24 +0000 Subject: [PATCH 0942/2020] Bump cargo_toml from 0.13.0 to 0.14.0 (#632) * Bump cargo_toml from 0.13.0 to 0.14.0 Bumps [cargo_toml](https://gitlab.com/crates.rs/cargo_toml) from 0.13.0 to 0.14.0. - [Release notes](https://gitlab.com/crates.rs/cargo_toml/tags) - [Commits](https://gitlab.com/crates.rs/cargo_toml/commits/main) --- updated-dependencies: - dependency-name: cargo_toml dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Fix use of `Manifest::complete_from_abstract_filesystem` Signed-off-by: Jiahao XU Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- crates/binstalk/src/drivers/crates_io/visitor.rs | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f7a54717..8a086edf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -371,9 +371,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa0e3586af56b3bfa51fca452bd56e8dbbbd5d8d81cbf0b7e4e35b695b537eb8" +checksum = "0f1204fe51a1e56042b8ec31d6407547ecd18f596b66f470dadb9abd9be9c843" dependencies = [ "serde", "toml", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 732abb14..018b5aff 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0" async-trait = "0.1.60" binstalk-downloader = { version = "0.2.0", path = "../binstalk-downloader" } binstalk-types = { version = "0.1.0", path = "../binstalk-types" } -cargo_toml = "0.13.0" +cargo_toml = "0.14.0" command-group = { version = "2.0.1", features = ["with-tokio"] } compact_str = { version = "0.6.1", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } diff --git a/crates/binstalk/src/drivers/crates_io/visitor.rs b/crates/binstalk/src/drivers/crates_io/visitor.rs index 26366759..5e85f15b 100644 --- a/crates/binstalk/src/drivers/crates_io/visitor.rs +++ b/crates/binstalk/src/drivers/crates_io/visitor.rs @@ -3,7 +3,7 @@ use std::{ path::{Path, PathBuf}, }; -use cargo_toml::Manifest; +use cargo_toml::{Manifest, Value}; use normalize_path::NormalizePath; use tokio::io::AsyncReadExt; use tracing::debug; @@ -84,7 +84,7 @@ fn load_manifest(slice: &[u8], vfs: &Vfs) -> Result, BinstallErro let mut manifest = Manifest::from_slice_with_metadata(slice)?; // Checks vfs for binary output names - manifest.complete_from_abstract_filesystem(vfs)?; + manifest.complete_from_abstract_filesystem::(vfs, None)?; // Return metadata Ok(manifest) From 31c9d4de1db2bed655bdb80620f34e92fd95a928 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 29 Dec 2022 11:42:54 +1100 Subject: [PATCH 0943/2020] Verify target triple retrieved from `rustc` is valid (#637) Signed-off-by: Jiahao XU --- crates/detect-targets/src/detect.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/detect-targets/src/detect.rs b/crates/detect-targets/src/detect.rs index 71940e71..b2b859d0 100644 --- a/crates/detect-targets/src/detect.rs +++ b/crates/detect-targets/src/detect.rs @@ -95,4 +95,6 @@ async fn get_target_from_rustc() -> Option { .lines() .filter_map(|line| line.ok()) .find_map(|line| line.strip_prefix("host: ").map(|host| host.to_owned())) + // All valid target triple must be in the form of $arch-$os-$abi. + .filter(|target| target.split('-').count() >= 3) } From 0ecb30dc9d889716605dfb34910579c6bc200d65 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 29 Dec 2022 11:59:13 +1100 Subject: [PATCH 0944/2020] Update quickinstall url (#638) Signed-off-by: Jiahao XU --- crates/binstalk/src/fetchers/quickinstall.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs index 90daef53..109fa5ae 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk/src/fetchers/quickinstall.rs @@ -16,7 +16,7 @@ use crate::{ use super::{Data, TargetData}; -const BASE_URL: &str = "https://github.com/alsuren/cargo-quickinstall/releases/download"; +const BASE_URL: &str = "https://github.com/cargo-bins/cargo-quickinstall/releases/download"; const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; pub struct QuickInstall { From 59d79d15730effc5a655f8ad6e8cc67c12e90800 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 29 Dec 2022 12:24:28 +1100 Subject: [PATCH 0945/2020] Refactor `detect-targets` (#636) * Enable dep guess_host_triple for any non-linux OS * Refactor: Rm `{windows, macos}::detect_target_*` * Refactor `detect_targets` Signed-off-by: Jiahao XU --- crates/detect-targets/Cargo.toml | 2 +- crates/detect-targets/src/detect.rs | 52 ++++++++++++--------- crates/detect-targets/src/detect/macos.rs | 11 ----- crates/detect-targets/src/detect/windows.rs | 11 ----- 4 files changed, 31 insertions(+), 45 deletions(-) diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 6943e400..a3469b29 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" tokio = { version = "1.23.0", features = ["rt", "process", "sync"], default-features = false } cfg-if = "1.0.0" -[target.'cfg(any(target_os = "macos", target_os = "windows"))'.dependencies] +[target.'cfg(not(target_os = "linux"))'.dependencies] guess_host_triple = "0.1.3" [dev-dependencies] diff --git a/crates/detect-targets/src/detect.rs b/crates/detect-targets/src/detect.rs index b2b859d0..4c1877fe 100644 --- a/crates/detect-targets/src/detect.rs +++ b/crates/detect-targets/src/detect.rs @@ -9,6 +9,8 @@ use std::{ use cfg_if::cfg_if; use tokio::process::Command; +use crate::TARGET; + cfg_if! { if #[cfg(target_os = "linux")] { mod linux; @@ -33,34 +35,40 @@ cfg_if! { /// Check [this issue](https://github.com/ryankurte/cargo-binstall/issues/155) /// for more information. pub async fn detect_targets() -> Vec { - if let Some(target) = get_target_from_rustc().await { - let mut v = vec![target]; + #[cfg(target_os = "linux")] + { + if let Some(target) = get_target_from_rustc().await { + let mut targets = vec![target]; + + if targets[0].contains("gnu") { + targets.push(targets[0].replace("gnu", "musl")); + } + + targets + } else { + linux::detect_targets_linux().await + } + } + + #[cfg(not(target_os = "linux"))] + { + let target = get_target_from_rustc().await.unwrap_or_else(|| { + guess_host_triple::guess_host_triple() + .unwrap_or(TARGET) + .to_string() + }); + + let mut targets = vec![target]; cfg_if! { - if #[cfg(target_os = "linux")] { - if v[0].contains("gnu") { - v.push(v[0].replace("gnu", "musl")); - } - } else if #[cfg(target_os = "macos")] { - v.extend(macos::detect_alternative_targets(&v[0])); + if #[cfg(target_os = "macos")] { + targets.extend(macos::detect_alternative_targets(&targets[0])); } else if #[cfg(target_os = "windows")] { - v.extend(windows::detect_alternative_targets(&v[0])); + targets.extend(windows::detect_alternative_targets(&targets[0])); } } - v - } else { - cfg_if! { - if #[cfg(target_os = "linux")] { - linux::detect_targets_linux().await - } else if #[cfg(target_os = "macos")] { - macos::detect_targets_macos() - } else if #[cfg(target_os = "windows")] { - windows::detect_targets_windows() - } else { - vec![TARGET.into()] - } - } + targets } } diff --git a/crates/detect-targets/src/detect/macos.rs b/crates/detect-targets/src/detect/macos.rs index ad5b1f0e..0c216981 100644 --- a/crates/detect-targets/src/detect/macos.rs +++ b/crates/detect-targets/src/detect/macos.rs @@ -1,6 +1,3 @@ -use crate::TARGET; -use guess_host_triple::guess_host_triple; - const AARCH64: &str = "aarch64-apple-darwin"; const X86: &str = "x86_64-apple-darwin"; const UNIVERSAL: &str = "universal-apple-darwin"; @@ -15,11 +12,3 @@ pub(super) fn detect_alternative_targets(target: &str) -> impl Iterator Vec { - let mut targets = vec![guess_host_triple().unwrap_or(TARGET).to_string()]; - - targets.extend(detect_alternative_targets(&targets[0])); - - targets -} diff --git a/crates/detect-targets/src/detect/windows.rs b/crates/detect-targets/src/detect/windows.rs index 4efd5f2c..04e86428 100644 --- a/crates/detect-targets/src/detect/windows.rs +++ b/crates/detect-targets/src/detect/windows.rs @@ -1,17 +1,6 @@ -use crate::TARGET; -use guess_host_triple::guess_host_triple; - pub(super) fn detect_alternative_targets(target: &str) -> Option { let (prefix, abi) = target.rsplit_once('-')?; // detect abi in ["gnu", "gnullvm", ...] (abi != "msvc").then(|| format!("{prefix}-msvc")) } - -pub(super) fn detect_targets_windows() -> Vec { - let mut targets = vec![guess_host_triple().unwrap_or(TARGET).to_string()]; - - targets.extend(detect_alternative_targets(&targets[0])); - - targets -} From 1ab979cde82da0a9eaecfd127fc022a0fd119de1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Dec 2022 01:31:30 +0000 Subject: [PATCH 0946/2020] Bump once_cell from 1.16.0 to 1.17.0 (#640) Bumps [once_cell](https://github.com/matklad/once_cell) from 1.16.0 to 1.17.0. - [Release notes](https://github.com/matklad/once_cell/releases) - [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md) - [Commits](https://github.com/matklad/once_cell/compare/v1.16.0...v1.17.0) --- updated-dependencies: - dependency-name: once_cell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8a086edf..47e36edb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1521,9 +1521,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "openssl" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 64438cd9..00ab33ef 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -30,7 +30,7 @@ dirs = "4.0.0" log = { version = "0.4.17", features = ["std"] } miette = "5.5.0" mimalloc = { version = "0.1.32", default-features = false, optional = true } -once_cell = "1.16.0" +once_cell = "1.17.0" semver = "1.0.16" strum = "0.24.1" strum_macros = "0.24.3" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 9c7d067c..335f0ee5 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -12,7 +12,7 @@ license = "Apache-2.0 OR MIT" [dependencies] compact_str = { version = "0.6.1", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } -once_cell = "1.16.0" +once_cell = "1.17.0" semver = { version = "1.0.16", features = ["serde"] } serde = { version = "1.0.152", features = ["derive"] } strum = "0.24.1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 018b5aff..218eab48 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -25,7 +25,7 @@ itertools = "0.10.5" jobslot = { version = "0.2.8", features = ["tokio"] } miette = "5.5.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } -once_cell = "1.16.0" +once_cell = "1.17.0" semver = { version = "1.0.16", features = ["serde"] } serde = { version = "1.0.152", features = ["derive"] } strum = "0.24.1" From 959b465d818af2db1c5e2628d0650fd280319e94 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 4 Jan 2023 11:11:10 +1100 Subject: [PATCH 0947/2020] Optimize `Download::and_visit_tar`: Use trait object to avoid monomorphization (#644) by removing method `TarEntriesVisitor::finish` and associated type `TarEntriesVisitor::Target`. Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/download.rs | 10 +++--- .../src/download/async_tar_visitor.rs | 12 +++---- crates/binstalk/src/drivers/crates_io.rs | 10 ++++-- .../binstalk/src/drivers/crates_io/visitor.rs | 35 ++++++++----------- 4 files changed, 30 insertions(+), 37 deletions(-) diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index 897dd4ec..42b608e6 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -101,11 +101,11 @@ impl Download { /// NOTE that this API does not support gnu extension sparse file unlike /// [`Download::and_extract`]. #[instrument(skip(visitor))] - pub async fn and_visit_tar( + pub async fn and_visit_tar( self, fmt: TarBasedFmt, - visitor: V, - ) -> Result { + visitor: &mut dyn TarEntriesVisitor, + ) -> Result<(), DownloadError> { let stream = self .client .get_stream(self.url) @@ -114,11 +114,11 @@ impl Download { debug!("Downloading and extracting then in-memory processing"); - let ret = extract_tar_based_stream_and_visit(stream, fmt, visitor).await?; + extract_tar_based_stream_and_visit(stream, fmt, visitor).await?; debug!("Download, extraction and in-memory procession OK"); - Ok(ret) + Ok(()) } /// Download a file from the provided URL and extract it to the provided path. diff --git a/crates/binstalk-downloader/src/download/async_tar_visitor.rs b/crates/binstalk-downloader/src/download/async_tar_visitor.rs index bab6d0eb..9c44506c 100644 --- a/crates/binstalk-downloader/src/download/async_tar_visitor.rs +++ b/crates/binstalk-downloader/src/download/async_tar_visitor.rs @@ -84,21 +84,17 @@ pub enum TarEntryType { /// Entires can be in arbitary order. #[async_trait::async_trait] pub trait TarEntriesVisitor: Send + Sync { - type Target; - /// Will be called once per entry async fn visit(&mut self, entry: &mut dyn TarEntry) -> Result<(), DownloadError>; - fn finish(self) -> Result; } -pub(crate) async fn extract_tar_based_stream_and_visit( +pub(crate) async fn extract_tar_based_stream_and_visit( stream: S, fmt: TarBasedFmt, - mut visitor: V, -) -> Result + visitor: &mut dyn TarEntriesVisitor, +) -> Result<(), DownloadError> where S: Stream> + Send + Sync, - V: TarEntriesVisitor, { debug!("Extracting from {fmt} archive to process it in memory"); @@ -125,5 +121,5 @@ where copy(&mut entry, &mut sink).await?; } - visitor.finish() + Ok(()) } diff --git a/crates/binstalk/src/drivers/crates_io.rs b/crates/binstalk/src/drivers/crates_io.rs index 402fca46..fabb1d00 100644 --- a/crates/binstalk/src/drivers/crates_io.rs +++ b/crates/binstalk/src/drivers/crates_io.rs @@ -52,7 +52,11 @@ pub async fn fetch_crate_cratesio( let manifest_dir_path: PathBuf = format!("{name}-{version_name}").into(); - Ok(Download::new(client, Url::parse(&crate_url)?) - .and_visit_tar(TarBasedFmt::Tgz, ManifestVisitor::new(manifest_dir_path)) - .await?) + let mut manifest_visitor = ManifestVisitor::new(manifest_dir_path); + + Download::new(client, Url::parse(&crate_url)?) + .and_visit_tar(TarBasedFmt::Tgz, &mut manifest_visitor) + .await?; + + manifest_visitor.load_manifest() } diff --git a/crates/binstalk/src/drivers/crates_io/visitor.rs b/crates/binstalk/src/drivers/crates_io/visitor.rs index 5e85f15b..f86b3d6b 100644 --- a/crates/binstalk/src/drivers/crates_io/visitor.rs +++ b/crates/binstalk/src/drivers/crates_io/visitor.rs @@ -1,7 +1,4 @@ -use std::{ - io, - path::{Path, PathBuf}, -}; +use std::path::{Path, PathBuf}; use cargo_toml::{Manifest, Value}; use normalize_path::NormalizePath; @@ -37,8 +34,6 @@ impl ManifestVisitor { #[async_trait::async_trait] impl TarEntriesVisitor for ManifestVisitor { - type Target = Manifest; - async fn visit(&mut self, entry: &mut dyn TarEntry) -> Result<(), DownloadError> { let path = entry.path()?; let path = path.normalize(); @@ -70,22 +65,20 @@ impl TarEntriesVisitor for ManifestVisitor { Ok(()) } +} +impl ManifestVisitor { /// Load binstall metadata using the extracted information stored in memory. - fn finish(self) -> Result { - Ok(load_manifest(&self.cargo_toml_content, &self.vfs).map_err(io::Error::from)?) + pub(super) fn load_manifest(self) -> Result, BinstallError> { + debug!("Loading manifest directly from extracted file"); + + // Load and parse manifest + let mut manifest = Manifest::from_slice_with_metadata(&self.cargo_toml_content)?; + + // Checks vfs for binary output names + manifest.complete_from_abstract_filesystem::(&self.vfs, None)?; + + // Return metadata + Ok(manifest) } } - -fn load_manifest(slice: &[u8], vfs: &Vfs) -> Result, BinstallError> { - debug!("Loading manifest directly from extracted file"); - - // Load and parse manifest - let mut manifest = Manifest::from_slice_with_metadata(slice)?; - - // Checks vfs for binary output names - manifest.complete_from_abstract_filesystem::(vfs, None)?; - - // Return metadata - Ok(manifest) -} From d4da4680f63610aa663b0517d5bddfc71ca093e5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 4 Jan 2023 11:37:01 +1100 Subject: [PATCH 0948/2020] Minor Optimization and fix for `bintalk-manifests` (#643) * Optimize `CratesToml::load_from_reader`: Avoid dup monomorphization * Optimize `CratesToml::write_to_writer`: Avoid dup monomophization * Optimize `create_if_not_exist`: Take `&path` to avoid dup monomorphization * Fix `CratesToml::write_to_path`: Use exclusive file lock to prevent race conditions. Signed-off-by: Jiahao XU --- .../binstalk-manifests/src/cargo_crates_v1.rs | 31 +++++++++++++------ crates/binstalk-manifests/src/helpers.rs | 4 +-- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/crates/binstalk-manifests/src/cargo_crates_v1.rs b/crates/binstalk-manifests/src/cargo_crates_v1.rs index f5315682..27a7fbe1 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1.rs @@ -47,14 +47,18 @@ impl CratesToml<'_> { } pub fn load_from_reader(mut reader: R) -> Result { - let mut vec = Vec::new(); - reader.read_to_end(&mut vec)?; + fn inner(reader: &mut dyn io::Read) -> Result, CratesTomlParseError> { + let mut vec = Vec::new(); + reader.read_to_end(&mut vec)?; - if vec.is_empty() { - Ok(Self::default()) - } else { - toml::from_slice(&vec).map_err(CratesTomlParseError::from) + if vec.is_empty() { + Ok(CratesToml::default()) + } else { + toml::from_slice(&vec).map_err(CratesTomlParseError::from) + } } + + inner(&mut reader) } pub fn load_from_path(path: impl AsRef) -> Result { @@ -81,9 +85,16 @@ impl CratesToml<'_> { } pub fn write_to_writer(&self, mut writer: W) -> Result<(), CratesTomlParseError> { - let data = toml::to_vec(&self)?; - writer.write_all(&data)?; - Ok(()) + fn inner( + this: &CratesToml<'_>, + writer: &mut dyn io::Write, + ) -> Result<(), CratesTomlParseError> { + let data = toml::to_vec(&this)?; + writer.write_all(&data)?; + Ok(()) + } + + inner(self, &mut writer) } pub fn write_to_file(&self, file: &mut File) -> Result<(), CratesTomlParseError> { @@ -95,7 +106,7 @@ impl CratesToml<'_> { } pub fn write_to_path(&self, path: impl AsRef) -> Result<(), CratesTomlParseError> { - let mut file = File::create(path)?; + let mut file = FileLock::new_exclusive(File::create(path)?)?; self.write_to_file(&mut file) } diff --git a/crates/binstalk-manifests/src/helpers.rs b/crates/binstalk-manifests/src/helpers.rs index ac5b35e2..029564c9 100644 --- a/crates/binstalk-manifests/src/helpers.rs +++ b/crates/binstalk-manifests/src/helpers.rs @@ -1,9 +1,7 @@ use std::{fs, io, path::Path}; /// Returned file is readable and writable. -pub(crate) fn create_if_not_exist(path: impl AsRef) -> io::Result { - let path = path.as_ref(); - +pub(crate) fn create_if_not_exist(path: &Path) -> io::Result { let mut options = fs::File::options(); options.read(true).write(true); From 49f60d37fe6ab76eb4d1e7de63302aebe6f103db Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 4 Jan 2023 12:01:02 +1100 Subject: [PATCH 0949/2020] Fix #588 race cond updating `.crates.toml` (#645) Fixed #588 * Add new dep fs-lock v0.1.0 to crates/bin * Refactor: Impl new type `Manifests` in crates/bin for managing manifests. * Fix #588 race cond updating `.crates.toml` Signed-off-by: Jiahao XU --- Cargo.lock | 1 + crates/bin/Cargo.toml | 1 + crates/bin/src/entry.rs | 105 ++++++++++-------------------------- crates/bin/src/lib.rs | 1 + crates/bin/src/manifests.rs | 85 +++++++++++++++++++++++++++++ 5 files changed, 117 insertions(+), 76 deletions(-) create mode 100644 crates/bin/src/manifests.rs diff --git a/Cargo.lock b/Cargo.lock index 47e36edb..33d0a1a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -353,6 +353,7 @@ dependencies = [ "crates_io_api", "dirs", "embed-resource", + "fs-lock", "log", "miette", "mimalloc", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 00ab33ef..5861c712 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -27,6 +27,7 @@ binstalk-manifests = { path = "../binstalk-manifests", version = "0.1.1" } clap = { version = "4.0.32", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" +fs-lock = { version = "0.1.0", path = "../fs-lock" } log = { version = "0.4.17", features = ["std"] } miette = "5.5.0" mimalloc = { version = "0.1.32", default-features = false, optional = true } diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 5431e4c9..f1490f6c 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -1,4 +1,4 @@ -use std::{collections::BTreeMap, fs, io, path::PathBuf, sync::Arc, time::Duration}; +use std::{fs, path::PathBuf, sync::Arc, time::Duration}; use binstalk::{ errors::BinstallError, @@ -11,12 +11,7 @@ use binstalk::{ Resolver, }, }; -use binstalk_manifests::{ - binstall_crates_v1::Records as BinstallCratesV1Records, - cargo_crates_v1::{CratesToml, CratesTomlParseError}, - cargo_toml_binstall::PkgOverride, - CompactString, Version, -}; +use binstalk_manifests::cargo_toml_binstall::PkgOverride; use crates_io_api::AsyncClient as CratesIoApiClient; use log::LevelFilter; use miette::{miette, Result, WrapErr}; @@ -26,6 +21,7 @@ use tracing::{debug, error, info, warn}; use crate::{ args::{Args, Strategy}, install_path, + manifests::Manifests, ui::confirm, }; @@ -47,12 +43,12 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - .collect(); // Compute paths - let (install_path, cargo_roots, metadata, temp_dir) = + let (install_path, mut manifests, temp_dir) = compute_paths_and_load_manifests(args.roots, args.install_path)?; // Remove installed crates let mut crate_names = - filter_out_installed_crates(args.crate_names, args.force, metadata.as_ref()).peekable(); + filter_out_installed_crates(args.crate_names, args.force, manifests.as_mut())?.peekable(); if crate_names.peek().is_none() { debug!("Nothing to do"); @@ -160,21 +156,8 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - .map(|fetch| fetch.install(&binstall_opts)) .collect::, BinstallError>>()?; - if let Some((mut cargo_binstall_metadata, _)) = metadata { - // The cargo manifest path is already created when loading - // metadata. - - debug!("Writing .crates.toml"); - CratesToml::append_to_path( - cargo_roots.join(".crates.toml"), - metadata_vec.iter(), - )?; - - debug!("Writing binstall/crates-v1.json"); - for metadata in metadata_vec { - cargo_binstall_metadata.replace(metadata); - } - cargo_binstall_metadata.overwrite()?; + if let Some(manifests) = manifests { + manifests.update(metadata_vec)?; } if no_cleanup { @@ -205,13 +188,11 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - Ok(()) } -type Metadata = (BinstallCratesV1Records, BTreeMap); - -/// Return (install_path, cargo_roots, metadata, temp_dir) +/// Return (install_path, manifests, temp_dir) fn compute_paths_and_load_manifests( roots: Option, install_path: Option, -) -> Result<(PathBuf, PathBuf, Option, tempfile::TempDir)> { +) -> Result<(PathBuf, Option, tempfile::TempDir)> { block_in_place(|| { // Compute cargo_roots let cargo_roots = install_path::get_cargo_roots_path(roots).ok_or_else(|| { @@ -229,42 +210,9 @@ fn compute_paths_and_load_manifests( fs::create_dir_all(&install_path).map_err(BinstallError::Io)?; debug!("Using install path: {}", install_path.display()); - // Load metadata - let metadata = if !custom_install_path { - // Read cargo_binstall_metadata - let metadata_dir = cargo_roots.join("binstall"); - fs::create_dir_all(&metadata_dir).map_err(BinstallError::Io)?; - let manifest_path = metadata_dir.join("crates-v1.json"); - - debug!( - "Reading {} from {}", - "cargo_binstall_metadata", - manifest_path.display() - ); - - let cargo_binstall_metadata = BinstallCratesV1Records::load_from_path(&manifest_path)?; - - // Read cargo_install_v1_metadata - let manifest_path = cargo_roots.join(".crates.toml"); - - debug!( - "Reading {} from {}", - "cargo_install_v1_metadata", - manifest_path.display() - ); - - let cargo_install_v1_metadata = match CratesToml::load_from_path(&manifest_path) { - Ok(metadata) => metadata.collect_into_crates_versions()?, - Err(CratesTomlParseError::Io(io_err)) - if io_err.kind() == io::ErrorKind::NotFound => - { - // .crates.toml does not exist, create an empty BTreeMap - Default::default() - } - Err(err) => Err(err)?, - }; - - Some((cargo_binstall_metadata, cargo_install_v1_metadata)) + // Load manifests + let manifests = if !custom_install_path { + Some(Manifests::open_exclusive(&cargo_roots)?) } else { None }; @@ -280,7 +228,7 @@ fn compute_paths_and_load_manifests( .map_err(BinstallError::from) .wrap_err("Creating a temporary directory failed.")?; - Ok((install_path, cargo_roots, metadata, temp_dir)) + Ok((install_path, manifests, temp_dir)) }) } @@ -288,18 +236,23 @@ fn compute_paths_and_load_manifests( fn filter_out_installed_crates( crate_names: Vec, force: bool, - metadata: Option<&Metadata>, -) -> impl Iterator)> + '_ { - CrateName::dedup(crate_names) + manifests: Option<&mut Manifests>, +) -> Result)> + '_> { + let mut installed_crates = manifests + .map(Manifests::load_installed_crates) + .transpose()?; + + Ok(CrateName::dedup(crate_names) .filter_map(move |crate_name| { let name = &crate_name.name; - let curr_version = metadata - // `cargo-uninstall` can be called to uninstall crates, - // but it only updates .crates.toml. + let curr_version = installed_crates + .as_mut() + // Since crate_name is deduped, every entry of installed_crates + // can be visited at most once. // - // So here we will honour .crates.toml only. - .and_then(|metadata| metadata.1.get(name)); + // So here we take ownership of the version stored to avoid cloning. + .and_then(|crates| crates.remove(name)); match ( force, @@ -307,7 +260,7 @@ fn filter_out_installed_crates( &crate_name.version_req, ) { (false, Some(curr_version), Some(version_req)) - if version_req.is_latest_compatible(curr_version) => + if version_req.is_latest_compatible(&curr_version) => { debug!("Bailing out early because we can assume wanted is already installed from metafile"); info!("{name} v{curr_version} is already installed, use --force to override"); @@ -316,10 +269,10 @@ fn filter_out_installed_crates( // The version req is "*" thus a remote upgraded version could exist (false, Some(curr_version), None) => { - Some((crate_name, Some(curr_version.clone()))) + Some((crate_name, Some(curr_version))) } _ => Some((crate_name, None)), } - }) + })) } diff --git a/crates/bin/src/lib.rs b/crates/bin/src/lib.rs index d3221595..c1c70c59 100644 --- a/crates/bin/src/lib.rs +++ b/crates/bin/src/lib.rs @@ -3,4 +3,5 @@ pub mod bin_util; pub mod entry; pub mod install_path; pub mod logging; +pub mod manifests; pub mod ui; diff --git a/crates/bin/src/manifests.rs b/crates/bin/src/manifests.rs new file mode 100644 index 00000000..609fa250 --- /dev/null +++ b/crates/bin/src/manifests.rs @@ -0,0 +1,85 @@ +use std::{collections::BTreeMap, fs, io::Seek, path::Path}; + +use binstalk::errors::BinstallError; +use binstalk_manifests::{ + binstall_crates_v1::Records as BinstallCratesV1Records, cargo_crates_v1::CratesToml, + crate_info::CrateInfo, CompactString, Version, +}; +use fs_lock::FileLock; +use miette::{Error, Result}; +use tracing::debug; + +pub struct Manifests { + binstall: BinstallCratesV1Records, + cargo_crates_v1: FileLock, +} + +impl Manifests { + pub fn open_exclusive(cargo_roots: &Path) -> Result { + // Read cargo_binstall_metadata + let metadata_path = cargo_roots.join("binstall/crates-v1.json"); + fs::create_dir_all(metadata_path.parent().unwrap()).map_err(BinstallError::Io)?; + + debug!( + "Reading binstall metadata from {} and obtaining exclusive lock", + metadata_path.display() + ); + + let binstall = BinstallCratesV1Records::load_from_path(&metadata_path)?; + + // Read cargo_install_v1_metadata + let manifest_path = cargo_roots.join(".crates.toml"); + + debug!( + "Obtaining exclusive lock of cargo install v1 metadata in path {}", + manifest_path.display() + ); + + let cargo_crates_v1 = fs::File::options() + .read(true) + .write(true) + .create(true) + .open(manifest_path) + .and_then(FileLock::new_exclusive) + .map_err(BinstallError::Io)?; + + Ok(Self { + binstall, + cargo_crates_v1, + }) + } + + fn rewind_cargo_crates_v1(&mut self) -> Result<()> { + self.cargo_crates_v1 + .rewind() + .map_err(BinstallError::Io) + .map_err(Error::from) + } + + /// `cargo-uninstall` can be called to uninstall crates, + /// but it only updates .crates.toml. + /// + /// So here we will honour .crates.toml only. + pub fn load_installed_crates(&mut self) -> Result> { + self.rewind_cargo_crates_v1()?; + + CratesToml::load_from_reader(&mut self.cargo_crates_v1) + .and_then(CratesToml::collect_into_crates_versions) + .map_err(Error::from) + } + + pub fn update(mut self, metadata_vec: Vec) -> Result<()> { + self.rewind_cargo_crates_v1()?; + + debug!("Writing .crates.toml"); + CratesToml::append_to_file(&mut self.cargo_crates_v1, &metadata_vec)?; + + debug!("Writing binstall/crates-v1.json"); + for metadata in metadata_vec { + self.binstall.replace(metadata); + } + self.binstall.overwrite()?; + + Ok(()) + } +} From 42672ccf4005cc5ef353d3f867d1703228b4fbca Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 4 Jan 2023 12:32:13 +1100 Subject: [PATCH 0950/2020] Fix `detect_targets_linux`: Detect arch/libc at runtime using `guess_host_triple` (#649) - Enable `guess_host_triple` on all targets - Fix `detect_targets_linux`: Detect runtime arch/libc using `guess_host_triple` instead of using the one specified in `TARGET`. - Add support for android in `detect_targets` Signed-off-by: Jiahao XU --- crates/detect-targets/Cargo.toml | 2 - crates/detect-targets/src/detect.rs | 2 + crates/detect-targets/src/detect/linux.rs | 101 ++++++++++------------ 3 files changed, 47 insertions(+), 58 deletions(-) diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index a3469b29..529f6805 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -12,8 +12,6 @@ license = "Apache-2.0 OR MIT" [dependencies] tokio = { version = "1.23.0", features = ["rt", "process", "sync"], default-features = false } cfg-if = "1.0.0" - -[target.'cfg(not(target_os = "linux"))'.dependencies] guess_host_triple = "0.1.3" [dev-dependencies] diff --git a/crates/detect-targets/src/detect.rs b/crates/detect-targets/src/detect.rs index 4c1877fe..2ef978c8 100644 --- a/crates/detect-targets/src/detect.rs +++ b/crates/detect-targets/src/detect.rs @@ -42,6 +42,8 @@ pub async fn detect_targets() -> Vec { if targets[0].contains("gnu") { targets.push(targets[0].replace("gnu", "musl")); + } else if targets[0].contains("android") { + targets.push(targets[0].replace("android", "musl")); } targets diff --git a/crates/detect-targets/src/detect/linux.rs b/crates/detect-targets/src/detect/linux.rs index ebe635a6..bedbc775 100644 --- a/crates/detect-targets/src/detect/linux.rs +++ b/crates/detect-targets/src/detect/linux.rs @@ -2,43 +2,58 @@ use crate::TARGET; use std::process::{Output, Stdio}; +use guess_host_triple::guess_host_triple; use tokio::process::Command; pub(super) async fn detect_targets_linux() -> Vec { - let (abi, libc) = parse_abi_and_libc(); + let target = guess_host_triple().unwrap_or(TARGET); - if let Libc::Glibc = libc { - // Glibc can only be dynamically linked. - // If we can run this binary, then it means that the target - // supports both glibc and musl. - return create_targets_str(&["gnu", "musl"], abi); + let (prefix, postfix) = target + .rsplit_once('-') + .expect("unwrap: target always has a -"); + + let (abi, libc) = if let Some(abi) = postfix.strip_prefix("musl") { + (abi, Libc::Musl) + } else if let Some(abi) = postfix.strip_prefix("gnu") { + (abi, Libc::Gnu) + } else if let Some(abi) = postfix.strip_prefix("android") { + (abi, Libc::Android) + } else { + (postfix, Libc::Unknown) + }; + + let musl_fallback_target = || format!("{prefix}-{}{abi}", "musl"); + + match libc { + Libc::Gnu => { + // guess_host_triple cannot detect whether the system is using glibc, + // musl libc or other libc. + // + // As such, we need to launch the test ourselves. + if supports_gnu().await { + vec![target.to_string(), musl_fallback_target()] + } else { + vec![musl_fallback_target()] + } + } + Libc::Android => vec![target.to_string(), musl_fallback_target()], + + _ => vec![target.to_string()], } +} - if let Ok(Output { - status: _, - stdout, - stderr, - }) = Command::new("ldd") +async fn supports_gnu() -> bool { + Command::new("ldd") .arg("--version") .stdin(Stdio::null()) .output() .await - { - let libc_version = if let Some(libc_version) = parse_libc_version_from_ldd_output(&stdout) { - libc_version - } else if let Some(libc_version) = parse_libc_version_from_ldd_output(&stderr) { - libc_version - } else { - return vec![create_target_str("musl", abi)]; - }; - - if libc_version == "gnu" { - return create_targets_str(&["gnu", "musl"], abi); - } - } - - // Fallback to using musl - vec![create_target_str("musl", abi)] + .ok() + .and_then(|Output { stdout, stderr, .. }| { + parse_libc_version_from_ldd_output(&stdout) + .or_else(|| parse_libc_version_from_ldd_output(&stderr)) + }) + == Some("gnu") } fn parse_libc_version_from_ldd_output(output: &[u8]) -> Option<&'static str> { @@ -53,34 +68,8 @@ fn parse_libc_version_from_ldd_output(output: &[u8]) -> Option<&'static str> { } enum Libc { - Glibc, + Gnu, Musl, -} - -fn parse_abi_and_libc() -> (&'static str, Libc) { - let last = TARGET.rsplit_once('-').unwrap().1; - - if let Some(libc_version) = last.strip_prefix("musl") { - (libc_version, Libc::Musl) - } else if let Some(libc_version) = last.strip_prefix("gnu") { - (libc_version, Libc::Glibc) - } else { - panic!("Unrecognized libc") - } -} - -fn create_target_str(libc_version: &str, abi: &str) -> String { - let prefix = TARGET - .rsplit_once('-') - .expect("unwrap: TARGET always has a -") - .0; - - format!("{prefix}-{libc_version}{abi}") -} - -fn create_targets_str(libc_versions: &[&str], abi: &str) -> Vec { - libc_versions - .iter() - .map(|libc_version| create_target_str(libc_version, abi)) - .collect() + Android, + Unknown, } From daec8800086171c65a7024abaf87929d9875a3fb Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 6 Jan 2023 00:08:57 +1100 Subject: [PATCH 0951/2020] Rm unused variant `binstalk_downloader::download::DownloadError::UserAbort` (#653) Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/download.rs | 3 --- crates/binstalk/src/errors.rs | 1 - 2 files changed, 4 deletions(-) diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index 42b608e6..ca3fe268 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -39,9 +39,6 @@ pub enum DownloadError { /// - Exit: 74 #[error(transparent)] Io(io::Error), - - #[error("installation cancelled by user")] - UserAbort, } impl From for DownloadError { diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index 5c263370..dd3470a4 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -413,7 +413,6 @@ impl From for BinstallError { Unzip(zip_error) => zip_error.into(), Remote(remote_error) => remote_error.into(), Io(io_error) => io_error.into(), - UserAbort => BinstallError::UserAbort, } } } From 7656b887d9daf5ce0c5a0d5c46204a3fbc9b52b0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 6 Jan 2023 00:21:00 +1100 Subject: [PATCH 0952/2020] Fix `Client::new`: Make sure we use at least tls 1.2 (#652) Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/remote.rs | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 228d31a1..876cd998 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -21,6 +21,7 @@ pub use url::Url; const MAX_RETRY_DURATION: Duration = Duration::from_secs(120); const MAX_RETRY_COUNT: u8 = 3; +const DEFAULT_MIN_TLS: tls::Version = tls::Version::TLS_1_2; #[derive(Debug, ThisError)] pub enum Error { @@ -50,6 +51,8 @@ impl Client { /// * `per` - must not be 0. /// * `num_request` - maximum number of requests to be processed for /// each `per` duration. + /// + /// The Client created would use at least tls 1.2 pub fn new( user_agent: impl AsRef, min_tls: Option, @@ -62,17 +65,16 @@ impl Client { per: Duration, num_request: NonZeroU64, ) -> Result { - let mut builder = reqwest::ClientBuilder::new() + let tls_ver = min_tls + .map(|tls| tls.max(DEFAULT_MIN_TLS)) + .unwrap_or(DEFAULT_MIN_TLS); + + let client = reqwest::ClientBuilder::new() .user_agent(user_agent) .https_only(true) - .min_tls_version(tls::Version::TLS_1_2) - .tcp_nodelay(false); - - if let Some(ver) = min_tls { - builder = builder.min_tls_version(ver); - } - - let client = builder.build()?; + .min_tls_version(tls_ver) + .tcp_nodelay(false) + .build()?; Ok(Client { client: client.clone(), From 7b34178bccf990468007833e6ea519d315be71b7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 6 Jan 2023 11:47:45 +1100 Subject: [PATCH 0953/2020] Optimize `resolve_inner`: Avoid `VersionReq::clone` (#656) * Add new dep maybe-owned v0.3.4 to binstalk * Optimize `resolve_inner`: Avoid `VersionReq::clone` Signed-off-by: Jiahao XU --- Cargo.lock | 1 + crates/binstalk/Cargo.toml | 1 + crates/binstalk/src/ops/resolve.rs | 15 ++++++++------- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 33d0a1a0..176871aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -177,6 +177,7 @@ dependencies = [ "home", "itertools", "jobslot", + "maybe-owned", "miette", "normalize-path", "once_cell", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 218eab48..01bfa0cd 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -23,6 +23,7 @@ futures-util = { version = "0.3.25", default-features = false, features = ["std" home = "0.5.4" itertools = "0.10.5" jobslot = { version = "0.2.8", features = ["tokio"] } +maybe-owned = "0.3.4" miette = "5.5.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.17.0" diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 7fa725ac..1e5c5f03 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -10,6 +10,7 @@ use cargo_toml::Manifest; use compact_str::{CompactString, ToCompactString}; use crates_io_api::AsyncClient as CratesIoApiClient; use itertools::Itertools; +use maybe_owned::MaybeOwned; use semver::{Version, VersionReq}; use tokio::task::block_in_place; use tracing::{debug, info, instrument, warn}; @@ -57,11 +58,11 @@ async fn resolve_inner( ) -> Result { info!("Resolving package: '{}'", crate_name); - let version_req: VersionReq = match (crate_name.version_req, &opts.version_req) { - (Some(version), None) => version, - (None, Some(version)) => version.clone(), + let version_req = match (&crate_name.version_req, &opts.version_req) { + (Some(version), None) => MaybeOwned::Borrowed(version), + (None, Some(version)) => MaybeOwned::Borrowed(version), (Some(_), Some(_)) => Err(BinstallError::SuperfluousVersionOption)?, - (None, None) => VersionReq::STAR, + (None, None) => MaybeOwned::Owned(VersionReq::STAR), }; let version_req_str = version_req.to_compact_string(); @@ -69,7 +70,7 @@ async fn resolve_inner( let Some(package_info) = PackageInfo::resolve(&opts, crate_name.name, curr_version, - version_req, + &version_req, opts.client.clone(), &opts.crates_io_api_client).await? else { @@ -337,7 +338,7 @@ impl PackageInfo { opts: &Options, name: CompactString, curr_version: Option, - version_req: VersionReq, + version_req: &VersionReq, client: Client, crates_io_api_client: &CratesIoApiClient, ) -> Result, BinstallError> { @@ -349,7 +350,7 @@ impl PackageInfo { client, crates_io_api_client, &name, - &version_req, + version_req, )) .await? } From ecb572d02dec042589de76926326fba612eb3690 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 6 Jan 2023 01:28:15 +0000 Subject: [PATCH 0954/2020] Bump bzip2 from 0.4.3 to 0.4.4 (#657) Bumps [bzip2](https://github.com/alexcrichton/bzip2-rs) from 0.4.3 to 0.4.4. - [Release notes](https://github.com/alexcrichton/bzip2-rs/releases) - [Commits](https://github.com/alexcrichton/bzip2-rs/commits/0.4.4) --- updated-dependencies: - dependency-name: bzip2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 176871aa..838bedcc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -325,9 +325,9 @@ checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" [[package]] name = "bzip2" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6afcd980b5f3a45017c57e57a2fcccbb351cc43a356ce117ef760ef8052b89b0" +checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" dependencies = [ "bzip2-sys", "libc", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 445c57c0..acd6f070 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -15,7 +15,7 @@ async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzi async_zip = { version = "0.0.9", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } binstalk-types = { version = "0.1.0", path = "../binstalk-types" } bytes = "1.3.0" -bzip2 = "0.4.3" +bzip2 = "0.4.4" digest = "0.10.6" flate2 = { version = "1.0.25", default-features = false } futures-util = { version = "0.3.25", default-features = false, features = ["std"] } From 305bf8123dee2dd7e7c95b87c486aa067caa2058 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 6 Jan 2023 14:02:14 +1100 Subject: [PATCH 0955/2020] Optimize `Client`: Reduce size from 16 to 8 (#655) Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/remote.rs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 876cd998..5632c19f 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -41,12 +41,15 @@ pub struct HttpError { err: reqwest::Error, } -#[derive(Clone, Debug)] -pub struct Client { +#[derive(Debug)] +struct Inner { client: reqwest::Client, - rate_limit: Arc>>, + rate_limit: Mutex>, } +#[derive(Clone, Debug)] +pub struct Client(Arc); + impl Client { /// * `per` - must not be 0. /// * `num_request` - maximum number of requests to be processed for @@ -76,14 +79,14 @@ impl Client { .tcp_nodelay(false) .build()?; - Ok(Client { + Ok(Client(Arc::new(Inner { client: client.clone(), - rate_limit: Arc::new(Mutex::new( + rate_limit: Mutex::new( ServiceBuilder::new() .rate_limit(num_request.get(), per) .service(client), - )), - }) + ), + }))) } inner(user_agent.as_ref(), min_tls, per, num_request) @@ -91,7 +94,7 @@ impl Client { /// Return inner reqwest client. pub fn get_inner(&self) -> &reqwest::Client { - &self.client + &self.0.client } async fn send_request_inner( @@ -110,7 +113,7 @@ impl Client { // the future, then release the lock before // polling the future, which performs network I/O that could // take really long. - let future = self.rate_limit.lock().await.ready().await?.call(request); + let future = self.0.rate_limit.lock().await.ready().await?.call(request); let response = future.await?; From aea9df602c1007e18d7eb7914c150764c4343ca6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sun, 8 Jan 2023 18:27:36 +1300 Subject: [PATCH 0956/2020] Migrate CI and builds to Just, add "full" builds (#660) --- .github/actions/just-setup/action.yml | 52 ++++ .github/scripts/install-deps.sh | 6 - .github/scripts/pack-release-archives.sh | 17 -- .github/scripts/tests.sh | 126 ---------- .github/workflows/build.yml | 149 ----------- .github/workflows/ci.yml | 119 +++++++++ .github/workflows/integration.yml | 54 ---- .github/workflows/release-build.yml | 119 +++++++++ .github/workflows/release.yml | 41 +-- .github/workflows/unit-tests.yml | 61 ----- .gitignore | 2 + README.md | 4 +- crates/bin/src/args.rs | 22 +- crates/bin/src/entry.rs | 2 +- crates/bin/src/main.rs | 6 +- crates/detect-targets/src/detect.rs | 4 +- crates/detect-wasi/Cargo.toml | 3 + .../scripts => e2e-tests}/fake-cargo/cargo | 0 e2e-tests/live.sh | 29 +++ e2e-tests/manifest-path.sh | 14 ++ .../manifests}/bitbucket-test-Cargo.toml | 0 .../manifests}/github-test-Cargo.toml | 0 .../manifests}/github-test-Cargo2.toml | 0 .../manifests}/gitlab-test-Cargo.toml | 0 e2e-tests/other-repos.sh | 33 +++ e2e-tests/strategies.sh | 26 ++ e2e-tests/tls.sh | 16 ++ e2e-tests/upgrade.sh | 19 ++ e2e-tests/version-syntax.sh | 18 ++ justfile | 238 ++++++++++++++++++ 30 files changed, 717 insertions(+), 463 deletions(-) create mode 100644 .github/actions/just-setup/action.yml delete mode 100755 .github/scripts/install-deps.sh delete mode 100755 .github/scripts/pack-release-archives.sh delete mode 100755 .github/scripts/tests.sh delete mode 100644 .github/workflows/build.yml create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/integration.yml create mode 100644 .github/workflows/release-build.yml delete mode 100644 .github/workflows/unit-tests.yml rename {.github/scripts => e2e-tests}/fake-cargo/cargo (100%) create mode 100755 e2e-tests/live.sh create mode 100755 e2e-tests/manifest-path.sh rename {.github/scripts/cargo-tomls => e2e-tests/manifests}/bitbucket-test-Cargo.toml (100%) rename {.github/scripts/cargo-tomls => e2e-tests/manifests}/github-test-Cargo.toml (100%) rename {.github/scripts/cargo-tomls => e2e-tests/manifests}/github-test-Cargo2.toml (100%) rename {.github/scripts/cargo-tomls => e2e-tests/manifests}/gitlab-test-Cargo.toml (100%) create mode 100755 e2e-tests/other-repos.sh create mode 100755 e2e-tests/strategies.sh create mode 100755 e2e-tests/tls.sh create mode 100755 e2e-tests/upgrade.sh create mode 100755 e2e-tests/version-syntax.sh create mode 100644 justfile diff --git a/.github/actions/just-setup/action.yml b/.github/actions/just-setup/action.yml new file mode 100644 index 00000000..7b97ece5 --- /dev/null +++ b/.github/actions/just-setup/action.yml @@ -0,0 +1,52 @@ +name: Setup tools and cache +inputs: + tools: + description: Extra tools + required: false + default: "" + cache: + description: Enable caches + required: true + default: true + type: boolean + cache-suffix: + description: Suffix for cache key + required: false + default: "" +runs: + using: composite + steps: + - if: inputs.tools == '' + name: Install just + uses: taiki-e/install-action@v2 + with: + tool: just + - if: inputs.tools != '' + name: Install just and tools + uses: taiki-e/install-action@v2 + with: + tool: just,${{ inputs.tools }} + + - if: inputs.cache + name: Configure index cache + uses: actions/cache@v3 + with: + path: | + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}-${{ inputs.cache-suffix }} + restore-keys: | + ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}- + ${{ runner.os }}-cargo-index- + + - if: inputs.cache + name: Configure build cache + uses: actions/cache@v3 + with: + path: | + target/ + key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ inputs.cache-suffix }} + restore-keys: | + ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}- diff --git a/.github/scripts/install-deps.sh b/.github/scripts/install-deps.sh deleted file mode 100755 index 085c3286..00000000 --- a/.github/scripts/install-deps.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -set -euxo pipefail - -apt update -exec apt install -y --no-install-recommends liblzma-dev libzip-dev libzstd-dev diff --git a/.github/scripts/pack-release-archives.sh b/.github/scripts/pack-release-archives.sh deleted file mode 100755 index 8ecb1c48..00000000 --- a/.github/scripts/pack-release-archives.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -set -euxo pipefail - -for o in outputs/*; do - pushd "$o" - - chmod +x cargo-binstall* - - target=$(basename "$o" | cut -d. -f1) - if grep -qE '(apple|windows)' <<< "$target"; then - zip -9 "../cargo-binstall-${target}.zip" * - else - tar cv * | gzip -9 > "../cargo-binstall-${target}.tgz" - fi - - popd -done diff --git a/.github/scripts/tests.sh b/.github/scripts/tests.sh deleted file mode 100755 index 5714932d..00000000 --- a/.github/scripts/tests.sh +++ /dev/null @@ -1,126 +0,0 @@ -#!/bin/bash - -set -euxo pipefail - -unset CARGO_INSTALL_ROOT - -crates="b3sum cargo-release cargo-binstall cargo-watch miniserve sccache" - -if [ "$2" = "Windows" ]; then - # Install binaries using cargo-binstall - # shellcheck disable=SC2086 - "./$1" --log-level debug --no-confirm $crates -else - export CARGO_HOME=/tmp/cargo-home-for-test - export PATH="$CARGO_HOME/bin:/tmp/t/bin:$PATH" - - mkdir -p "/tmp/t/bin" - # Copy it to bin to test use of env var `CARGO` - cp "./$1" "/tmp/t/bin/cargo-binstall" - - # Install binaries using cargo-binstall - # shellcheck disable=SC2086 - cargo binstall --log-level debug --no-confirm $crates - - rm -r /tmp/t -fi - -# Test that the installed binaries can be run -b3sum --version -cargo-release release --version -cargo-binstall --help >/dev/null -cargo binstall --help >/dev/null -cargo watch -V -miniserve -V - -test_resources=".github/scripts/cargo-tomls" - -# Install binaries using `--manifest-path` -# Also test default github template -"./$1" binstall --force --log-level debug --manifest-path "$test_resources/github-test-Cargo.toml" --no-confirm cargo-binstall -# Test that the installed binaries can be run -cargo binstall --help >/dev/null - -# FIXME: test this some other way that is not dependent on the version being published! -# "./$1" binstall --force --log-level debug --manifest-path crates/bin --no-confirm cargo-binstall - -min_tls=1.3 -[[ "${2:-}" == "Windows" ]] && min_tls=1.2 # WinTLS on GHA doesn't support 1.3 yet - -"./$1" binstall \ - --force \ - --log-level debug \ - --min-tls-version $min_tls \ - --no-confirm \ - cargo-binstall -# Test that the installed binaries can be run -cargo binstall --help >/dev/null - -# Test --version -"./$1" binstall --force --log-level debug --no-confirm --version 0.11.1 cargo-binstall -# Test that the installed binaries can be run -cargo binstall --help >/dev/null - -# Test "$crate_name@$version" -"./$1" binstall --force --log-level debug --no-confirm cargo-binstall@0.11.1 -# Test that the installed binaries can be run -cargo binstall --help >/dev/null - -# Test skip when installed -"./$1" binstall --no-confirm --force cargo-binstall@0.11.1 -"./$1" binstall --no-confirm cargo-binstall@0.11.1 | grep -q 'cargo-binstall v0.11.1 is already installed' - -"./$1" binstall --no-confirm cargo-binstall@0.10.0 | grep -q -v 'cargo-binstall v0.10.0 is already installed' - -## Test When 0.11.0 is installed but can be upgraded. -"./$1" binstall --no-confirm cargo-binstall@0.12.0 -"./$1" binstall --no-confirm cargo-binstall@0.12.0 | grep -q 'cargo-binstall v0.12.0 is already installed' -"./$1" binstall --no-confirm cargo-binstall@^0.12.0 | grep -q -v 'cargo-binstall v0.12.0 is already installed' - -# Test default GitLab pkg-url templates -"./$1" binstall \ - --force \ - --manifest-path "$test_resources/gitlab-test-Cargo.toml" \ - --log-level debug \ - --no-confirm \ - --disable-strategies compile \ - cargo-binstall - -# Test default BitBucket pkg-url templates -"./$1" binstall \ - --force \ - --manifest-path "$test_resources/bitbucket-test-Cargo.toml" \ - --log-level debug \ - --no-confirm \ - --disable-strategies compile \ - cargo-binstall - -# Test default Github pkg-url templates, -# with bin-dir provided -"./$1" binstall \ - --force \ - --manifest-path "$test_resources/github-test-Cargo2.toml" \ - --log-level debug \ - --no-confirm \ - --disable-strategies compile \ - cargo-binstall - -## Test --disable-strategies -set +e - -"./$1" binstall --no-confirm --disable-strategies quick-install,compile cargo-update -exit_code="$?" - -if [ "$exit_code" != 94 ]; then - echo "Expected exit code 94, but actual exit code $exit_code" - exit 1 -fi - -## Test --strategies -"./$1" binstall --no-confirm --strategies crate-meta-data cargo-update -exit_code="$?" - -if [ "$exit_code" != 94 ]; then - echo "Expected exit code 94, but actual exit code $exit_code" - exit 1 -fi diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 3140c933..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,149 +0,0 @@ -name: Build - -on: - workflow_call: - inputs: - for_release: - description: "True if the build is for a release" - required: true - default: false - type: boolean - - workflow_dispatch: - inputs: - for_release: - description: "True if the build is for a release" - required: true - default: false - type: boolean - -env: - CARGO_TERM_COLOR: always - CARGO_UNSTABLE_SPARSE_REGISTRY: "true" - -jobs: - build: - strategy: - fail-fast: false - matrix: - include: - - target: x86_64-unknown-linux-gnu - os: ubuntu-20.04 - debug_features: [ rustls, pkg-config ] - - target: x86_64-apple-darwin - os: macos-latest - - target: aarch64-apple-darwin - os: macos-latest - - target: x86_64-pc-windows-msvc - os: windows-latest - debug_features: [ native-tls ] - - target: x86_64-unknown-linux-musl - os: ubuntu-latest - - target: armv7-unknown-linux-musleabihf - os: ubuntu-20.04 - use-cross: true - - target: armv7-unknown-linux-gnueabihf - os: ubuntu-20.04 - use-cross: true - - target: aarch64-unknown-linux-musl - os: ubuntu-latest - use-cross: true - - target: aarch64-unknown-linux-gnu - os: ubuntu-20.04 - use-cross: true - - runs-on: ${{ matrix.os }} - name: ${{ matrix.target }} - - steps: - - uses: actions/checkout@v3 - - - name: Configure toolchain - run: | - rustup toolchain install --profile minimal --no-self-update nightly - rustup default nightly - - - name: Install cross - if: matrix.use-cross - uses: taiki-e/install-action@v2 - with: - tool: cross - - - name: Install host target - if: "!matrix.use-cross" - run: rustup target add ${{ matrix.target }} - - - name: Install rust-src - if: inputs.for_release - run: rustup component add rust-src - - - name: Select compile settings - shell: bash - run: | - jq \ - --argjson for_release '${{ toJSON(inputs.for_release) }}' \ - --argjson matrix '${{ toJSON(matrix) }}' \ - -nrf .github/scripts/compile-settings.jq \ - | tee -a $GITHUB_ENV - - - name: Configure caching - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-cargo-${{ matrix.target }}-${{ hashFiles('**/Cargo.lock') }}-${{ env.COUTPUT }} - - - name: Install musl-tools - if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} - run: sudo apt-get install -y musl-tools - - - name: Install deps - if: ${{ matrix.target == 'x86_64-unknown-linux-gnu' && !startsWith(github.ref, 'refs/tags/v') }} - run: sudo .github/scripts/install-deps.sh - - - name: Build - run: ${{ env.CTOOL }} build ${{ env.CARGS }} - env: - RUSTFLAGS: ${{ env.RUSTFLAGS }} - - - name: Get output - shell: bash - run: | - cp target/${{ matrix.target }}/${{ env.COUTPUT }}/${{ env.CBIN }} ${{ env.CBIN }} - chmod +x ${{ env.CBIN }} || true - ls -l ${{ env.CBIN }} - - - name: Upload output - uses: actions/upload-artifact@v3 - with: - retention-days: 1 - name: "${{ matrix.target }}.${{ env.CBIN }}" - path: "${{ env.CBIN }}" - macos_universal_bin: - needs: build - runs-on: macos-latest - env: - aarch64: aarch64-apple-darwin.cargo-binstall - x86_64: x86_64-apple-darwin.cargo-binstall - steps: - - name: Download aarch64 artifact - uses: actions/download-artifact@v3 - with: - name: ${{ env.aarch64 }} - path: ${{ env.aarch64 }} - - name: Download x86-64 artifact - uses: actions/download-artifact@v3 - with: - name: ${{ env.x86_64 }} - path: ${{ env.x86_64 }} - - name: Create universal binary for MacOS - run: lipo -create -output cargo-binstall $aarch64/cargo-binstall $x86_64/cargo-binstall - - name: Upload output - uses: actions/upload-artifact@v3 - with: - retention-days: 1 - name: universal-apple-darwin.cargo-binstall - path: cargo-binstall diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..d3e29bfe --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,119 @@ +name: CI + +on: + workflow_dispatch: + pull_request: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always + CARGO_UNSTABLE_SPARSE_REGISTRY: "true" + +jobs: + test: + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-apple-darwin + os: macos-latest + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + - target: x86_64-unknown-linux-musl + os: ubuntu-latest + - target: x86_64-pc-windows-msvc + os: windows-latest + + runs-on: ${{ matrix.os }} + env: + CARGO_BUILD_TARGET: ${{ matrix.target }} + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/just-setup + with: + cache-suffix: ${{ env.CARGO_BUILD_TARGET }} + + - run: just toolchain + - run: just ci-install-deps + - run: just test + + linux-cross-check: + strategy: + fail-fast: false + matrix: + target: + - armv7-unknown-linux-musleabihf + - armv7-unknown-linux-gnueabihf + - aarch64-unknown-linux-musl + - aarch64-unknown-linux-gnu + + runs-on: ubuntu-latest + env: + CARGO_BUILD_TARGET: ${{ matrix.target }} + JUST_USE_CROSS: true + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/just-setup + with: + tools: cross + cache-suffix: ${{ env.CARGO_BUILD_TARGET }} + + - run: just toolchain + - run: just ci-install-deps + - run: just check + + apple-m1-check: + runs-on: macos-latest + env: + CARGO_BUILD_TARGET: aarch64-apple-darwin + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/just-setup + with: + cache-suffix: ${{ env.CARGO_BUILD_TARGET }} + + - run: just toolchain + - run: just check + + lint: + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/just-setup + + - run: just toolchain rustfmt,clippy + - run: just ci-install-deps + - run: just lint + + # Dummy job to have a stable name for the "all tests pass" requirement + tests-pass: + name: Tests pass + needs: + - test + - linux-cross-check + - apple-m1-check + - lint + runs-on: ubuntu-latest + steps: + - run: echo "Tests pass" + + # if everything succeeds and PR is ready for review, test the release/package process + release-builds: + if: (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || github.event_name == 'workflow_dispatch' + needs: + - tests-pass + uses: ./.github/workflows/release-build.yml diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml deleted file mode 100644 index a5740149..00000000 --- a/.github/workflows/integration.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Integration - -on: - workflow_dispatch: - pull_request: - push: - branches: - - main - -env: - CARGO_TERM_COLOR: always - -jobs: - build: - uses: ./.github/workflows/build.yml - with: - for_release: false - - test: - needs: build - - strategy: - fail-fast: false - matrix: - include: - - target: x86_64-apple-darwin - os: macos-latest - bin: cargo-binstall - - target: x86_64-unknown-linux-gnu - os: ubuntu-latest - bin: cargo-binstall - - target: x86_64-unknown-linux-musl - os: ubuntu-latest - bin: cargo-binstall - - target: x86_64-pc-windows-msvc - os: windows-latest - bin: cargo-binstall.exe - - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v3 - - - name: Download build - uses: actions/download-artifact@v3 - with: - name: "${{ matrix.target }}.${{ matrix.bin }}" - - - run: chmod +x ${{ matrix.bin }} - if: matrix.os != 'windows-latest' - - - name: Test - shell: bash - run: .github/scripts/tests.sh ${{ matrix.bin }} ${{ runner.os }} - diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml new file mode 100644 index 00000000..fe408e98 --- /dev/null +++ b/.github/workflows/release-build.yml @@ -0,0 +1,119 @@ +name: Build for release + +on: + workflow_dispatch: # can't publish from dispatch + workflow_call: + inputs: + publish: + description: "Set to the release metadata JSON to publish the release" + required: false + type: string + +env: + CARGO_TERM_COLOR: always + CARGO_UNSTABLE_SPARSE_REGISTRY: "true" + +jobs: + build: + strategy: + fail-fast: false + matrix: + include: + - { o: macos-latest, t: x86_64-apple-darwin } + - { o: macos-latest, t: aarch64-apple-darwin } + - { o: ubuntu-20.04, t: x86_64-unknown-linux-gnu } + - { o: ubuntu-20.04, t: armv7-unknown-linux-gnueabihf, c: true } + - { o: ubuntu-20.04, t: aarch64-unknown-linux-gnu, c: true } + - { o: ubuntu-latest, t: x86_64-unknown-linux-musl } + - { o: ubuntu-latest, t: armv7-unknown-linux-musleabihf, c: true } + - { o: ubuntu-latest, t: aarch64-unknown-linux-musl, c: true } + - { o: windows-latest, t: x86_64-pc-windows-msvc } + - { o: windows-latest, t: aarch64-pc-windows-msvc } + + name: ${{ matrix.t }} + runs-on: ${{ matrix.o }} + env: + CARGO_BUILD_TARGET: ${{ matrix.t }} + JUST_USE_CROSS: ${{ matrix.c }} + JUST_FOR_RELEASE: true + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/just-setup + with: + tools: cross + cache-suffix: release-${{ matrix.t }} + + - run: just toolchain rust-src + - run: just ci-install-deps + - run: just package + - if: runner.os == 'Windows' + run: Get-ChildItem packages/ + - if: runner.os != 'Windows' + run: ls -shal packages/ + + - if: ${{ inputs.publish }} + name: Publish release + uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 + with: + tag_name: ${{ fromJSON(inputs.publish).version }} + name: ${{ fromJSON(inputs.publish).version }} + body: ${{ fromJSON(inputs.publish).notes }} + append_body: false + files: | + packages/cargo-binstall-* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: ${{ !inputs.publish || runner.os == 'macOS' }} + name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.t }} + path: packages/cargo-binstall-* + retention-days: 1 + + lipo: + needs: build + name: universal-apple-darwin + runs-on: macos-latest + env: + JUST_FOR_RELEASE: true + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/just-setup + with: + cache: false + + - uses: actions/download-artifact@v3 + with: + name: x86_64-apple-darwin + path: packages/ + - uses: actions/download-artifact@v3 + with: + name: aarch64-apple-darwin + path: packages/ + + - run: ls -shalr packages/ + - run: just repackage-lipo + - run: ls -shal packages/ + + - if: ${{ inputs.publish }} + name: Publish release + uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 + with: + tag_name: ${{ fromJSON(inputs.publish).version }} + name: ${{ fromJSON(inputs.publish).version }} + body: ${{ fromJSON(inputs.publish).notes }} + append_body: false + files: | + packages/cargo-binstall-universal-* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: ${{ !inputs.publish }} + name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: universal-apple-darwin + path: packages/cargo-binstall-universal-* + retention-days: 1 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2e3a5310..f47f9710 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -49,40 +49,11 @@ jobs: custom_tag: ${{ needs.info.outputs.version }} tag_prefix: '' - build: - if: "startsWith(github.event.head_commit.message, 'release: cargo-binstall v')" - needs: info # not really, but just so it fails fast - uses: ./.github/workflows/build.yml - with: - for_release: true - - release: + package: if: "startsWith(github.event.head_commit.message, 'release: cargo-binstall v')" needs: - - info - - tag - - build - name: Package and release - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Get outputs - uses: actions/download-artifact@v3 - with: - path: outputs/ - - - name: Pack archives - run: .github/scripts/pack-release-archives.sh - - - name: Publish release - uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 - with: - tag_name: ${{ needs.info.outputs.version }} - name: ${{ needs.info.outputs.version }} - body: ${{ needs.info.outputs.notes }} - append_body: true - files: | - outputs/cargo-binstall-*.zip - outputs/cargo-binstall-*.tgz - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - info + - tag + uses: ./.github/workflows/release-build.yml + with: + publish: ${{ toJSON(needs.info.outputs) }} diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml deleted file mode 100644 index 57e10fff..00000000 --- a/.github/workflows/unit-tests.yml +++ /dev/null @@ -1,61 +0,0 @@ -name: Unit tests - -on: - pull_request: - push: - branches: - - main - -env: - CARGO_TERM_COLOR: always - CARGO_UNSTABLE_SPARSE_REGISTRY: "true" - -jobs: - test: - strategy: - fail-fast: false - matrix: - os: - - macos - - ubuntu - - windows - - runs-on: ${{ matrix.os }}-latest - name: unit tests on ${{ matrix.os }} - - steps: - - uses: actions/checkout@v3 - - name: Configure toolchain - run: | - rustup toolchain install nightly --component rustfmt,clippy --no-self-update --profile minimal - rustup default nightly - - - name: Configure caching - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - target/ - key: ${{ runner.os }}-unit-tests-${{ hashFiles('**/Cargo.lock') }} - restore-keys: | - ${{ runner.os }}-unit-tests - - - name: Install deps - if: matrix.os == 'ubuntu' - run: sudo .github/scripts/install-deps.sh - - - name: Test (Unix) - if: matrix.os != 'windows' - run: cargo test --no-default-features --features pkg-config,native-tls - - - name: Test (Windows) - if: matrix.os == 'windows' - run: cargo test --no-default-features --features native-tls - - - name: fmt - run: cargo fmt --all --check - - - name: clippy - run: cargo clippy --no-deps -- -D clippy::all diff --git a/.gitignore b/.gitignore index 05923927..b8aaf2b2 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ /target .DS_Store +/packages +/e2e-tests/cargo-binstall* diff --git a/README.md b/README.md index 9fb69869..6739e2b2 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ We recommend using the pre-compiled ones because we optimize those more than a s | macos | universal | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-universal-apple-darwin.zip | | windows | x86\_64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-pc-windows-msvc.zip | -To upgrade, use `cargo binstall cargo-binstall`! +To upgrade cargo-binstall, use `cargo binstall cargo-binstall`! ## Usage @@ -90,6 +90,8 @@ Supported crates such as `cargo-binstall` itself can also be updated with `cargo - You can find a full description of errors including exit codes here: - Can I use it in CI? - Yes! For GitHub Actions, we recommend the excellent [taiki-e/install-action](https://github.com/marketplace/actions/install-development-tools), which has explicit support for selected tools and uses `cargo-binstall` for everything else. +- Are debug symbols available? + - Yes! Extra pre-built packages with a `.full` suffix are available and contain split debuginfo (for Windows and macOS, Linux coming soon), documentation files, and extra binaries like the `detect-wasi` utility. --- diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 30c41fc5..107c452c 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -1,4 +1,5 @@ use std::{ + env, ffi::OsString, fmt, num::{NonZeroU64, ParseIntError}, @@ -225,13 +226,8 @@ pub struct Args { /// /// Set to `off` to disable logging completely, this will also /// disable output from `cargo-install`. - #[clap( - help_heading = "Meta", - long, - default_value = "info", - value_name = "LEVEL" - )] - pub log_level: LevelFilter, + #[clap(help_heading = "Meta", long, value_name = "LEVEL")] + pub log_level: Option, /// Equivalent to setting `log_level` to `off`. /// @@ -331,8 +327,16 @@ pub fn parse() -> Args { // Load options let mut opts = Args::parse_from(args); - if opts.quiet { - opts.log_level = LevelFilter::Off; + + if let (true, Some(log)) = ( + opts.log_level.is_none(), + env::var("BINSTALL_LOG_LEVEL") + .ok() + .and_then(|s| s.parse().ok()), + ) { + opts.log_level = Some(log); + } else if opts.quiet { + opts.log_level = Some(LevelFilter::Off); } // Ensure no conflict diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index f1490f6c..020fedb2 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -85,7 +85,7 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - no_symlinks: args.no_symlinks, dry_run: args.dry_run, force: args.force, - quiet: args.log_level == LevelFilter::Off, + quiet: args.log_level == Some(LevelFilter::Off), version_req: args.version_req, manifest_path: args.manifest_path, diff --git a/crates/bin/src/main.rs b/crates/bin/src/main.rs index ecf0f41b..721ba51f 100644 --- a/crates/bin/src/main.rs +++ b/crates/bin/src/main.rs @@ -1,6 +1,7 @@ use std::time::Instant; use binstalk::helpers::jobserver_client::LazyJobserverClient; +use log::LevelFilter; use tracing::debug; use cargo_binstall::{ @@ -24,7 +25,10 @@ fn main() -> MainExit { println!("{}", env!("CARGO_PKG_VERSION")); MainExit::Success(None) } else { - logging(args.log_level, args.json_output); + logging( + args.log_level.unwrap_or(LevelFilter::Info), + args.json_output, + ); let start = Instant::now(); diff --git a/crates/detect-targets/src/detect.rs b/crates/detect-targets/src/detect.rs index 2ef978c8..0216d4ad 100644 --- a/crates/detect-targets/src/detect.rs +++ b/crates/detect-targets/src/detect.rs @@ -9,8 +9,6 @@ use std::{ use cfg_if::cfg_if; use tokio::process::Command; -use crate::TARGET; - cfg_if! { if #[cfg(target_os = "linux")] { mod linux; @@ -56,7 +54,7 @@ pub async fn detect_targets() -> Vec { { let target = get_target_from_rustc().await.unwrap_or_else(|| { guess_host_triple::guess_host_triple() - .unwrap_or(TARGET) + .unwrap_or(crate::TARGET) .to_string() }); diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index e9d4241c..01df98a6 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -11,3 +11,6 @@ license = "Apache-2.0 OR MIT" [dependencies] tempfile = "3.3.0" + +[package.metadata.binstall] +pkg-url = "{ repo }/releases/download/v{ version }/cargo-binstall-{ target }.full.{ archive-format }" diff --git a/.github/scripts/fake-cargo/cargo b/e2e-tests/fake-cargo/cargo similarity index 100% rename from .github/scripts/fake-cargo/cargo rename to e2e-tests/fake-cargo/cargo diff --git a/e2e-tests/live.sh b/e2e-tests/live.sh new file mode 100755 index 00000000..fd9107fe --- /dev/null +++ b/e2e-tests/live.sh @@ -0,0 +1,29 @@ +#!/bin/bash + +set -euxo pipefail + +unset CARGO_INSTALL_ROOT + +crates="b3sum cargo-release cargo-binstall cargo-watch miniserve sccache" + +export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +othertmpdir=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-test') +export PATH="$CARGO_HOME/bin:$othertmpdir/bin:$PATH" + +mkdir -p "$othertmpdir/bin" +# Copy it to bin to test use of env var `CARGO` +cp "./$1" "$othertmpdir/bin/" + +# Install binaries using cargo-binstall +# shellcheck disable=SC2086 +cargo binstall --no-confirm $crates + +rm -r "$othertmpdir" + +# Test that the installed binaries can be run +b3sum --version +cargo-release release --version +cargo-binstall --help >/dev/null +cargo binstall --help >/dev/null +cargo watch -V +miniserve -V diff --git a/e2e-tests/manifest-path.sh b/e2e-tests/manifest-path.sh new file mode 100755 index 00000000..9818eef1 --- /dev/null +++ b/e2e-tests/manifest-path.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -euxo pipefail + +unset CARGO_INSTALL_ROOT + +export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export PATH="$CARGO_HOME/bin:$PATH" + +# Install binaries using `--manifest-path` +# Also test default github template +"./$1" binstall --force --manifest-path "manifests/github-test-Cargo.toml" --no-confirm cargo-binstall +# Test that the installed binaries can be run +cargo binstall --help >/dev/null diff --git a/.github/scripts/cargo-tomls/bitbucket-test-Cargo.toml b/e2e-tests/manifests/bitbucket-test-Cargo.toml similarity index 100% rename from .github/scripts/cargo-tomls/bitbucket-test-Cargo.toml rename to e2e-tests/manifests/bitbucket-test-Cargo.toml diff --git a/.github/scripts/cargo-tomls/github-test-Cargo.toml b/e2e-tests/manifests/github-test-Cargo.toml similarity index 100% rename from .github/scripts/cargo-tomls/github-test-Cargo.toml rename to e2e-tests/manifests/github-test-Cargo.toml diff --git a/.github/scripts/cargo-tomls/github-test-Cargo2.toml b/e2e-tests/manifests/github-test-Cargo2.toml similarity index 100% rename from .github/scripts/cargo-tomls/github-test-Cargo2.toml rename to e2e-tests/manifests/github-test-Cargo2.toml diff --git a/.github/scripts/cargo-tomls/gitlab-test-Cargo.toml b/e2e-tests/manifests/gitlab-test-Cargo.toml similarity index 100% rename from .github/scripts/cargo-tomls/gitlab-test-Cargo.toml rename to e2e-tests/manifests/gitlab-test-Cargo.toml diff --git a/e2e-tests/other-repos.sh b/e2e-tests/other-repos.sh new file mode 100755 index 00000000..2097da43 --- /dev/null +++ b/e2e-tests/other-repos.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +set -euxo pipefail + +unset CARGO_INSTALL_ROOT + +export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export PATH="$CARGO_HOME/bin:$PATH" + +# Test default GitLab pkg-url templates +"./$1" binstall \ + --force \ + --manifest-path "manifests/gitlab-test-Cargo.toml" \ + --no-confirm \ + --disable-strategies compile \ + cargo-binstall + +# Test default BitBucket pkg-url templates +"./$1" binstall \ + --force \ + --manifest-path "manifests/bitbucket-test-Cargo.toml" \ + --no-confirm \ + --disable-strategies compile \ + cargo-binstall + +# Test default Github pkg-url templates, +# with bin-dir provided +"./$1" binstall \ + --force \ + --manifest-path "manifests/github-test-Cargo2.toml" \ + --no-confirm \ + --disable-strategies compile \ + cargo-binstall diff --git a/e2e-tests/strategies.sh b/e2e-tests/strategies.sh new file mode 100755 index 00000000..741cdddd --- /dev/null +++ b/e2e-tests/strategies.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +set -uxo pipefail + +unset CARGO_INSTALL_ROOT + +export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export PATH="$CARGO_HOME/bin:$PATH" + +## Test --disable-strategies +"./$1" binstall --no-confirm --disable-strategies quick-install,compile cargo-update +exit_code="$?" + +if [ "$exit_code" != 94 ]; then + echo "Expected exit code 94, but actual exit code $exit_code" + exit 1 +fi + +## Test --strategies +"./$1" binstall --no-confirm --strategies crate-meta-data cargo-update +exit_code="$?" + +if [ "$exit_code" != 94 ]; then + echo "Expected exit code 94, but actual exit code $exit_code" + exit 1 +fi diff --git a/e2e-tests/tls.sh b/e2e-tests/tls.sh new file mode 100755 index 00000000..e603e197 --- /dev/null +++ b/e2e-tests/tls.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -euxo pipefail + +unset CARGO_INSTALL_ROOT + +export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export PATH="$CARGO_HOME/bin:$PATH" + +"./$1" binstall \ + --force \ + --min-tls-version "${2:-1.3}" \ + --no-confirm \ + cargo-binstall +# Test that the installed binaries can be run +cargo binstall --help >/dev/null diff --git a/e2e-tests/upgrade.sh b/e2e-tests/upgrade.sh new file mode 100755 index 00000000..dd591905 --- /dev/null +++ b/e2e-tests/upgrade.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +set -euxo pipefail + +unset CARGO_INSTALL_ROOT + +export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export PATH="$CARGO_HOME/bin:$PATH" + +# Test skip when installed +"./$1" binstall --no-confirm --force cargo-binstall@0.11.1 +"./$1" binstall --log-level=info --no-confirm cargo-binstall@0.11.1 | grep -q 'cargo-binstall v0.11.1 is already installed' + +"./$1" binstall --log-level=info --no-confirm cargo-binstall@0.10.0 | grep -q -v 'cargo-binstall v0.10.0 is already installed' + +## Test When 0.11.0 is installed but can be upgraded. +"./$1" binstall --no-confirm cargo-binstall@0.12.0 +"./$1" binstall --log-level=info --no-confirm cargo-binstall@0.12.0 | grep -q 'cargo-binstall v0.12.0 is already installed' +"./$1" binstall --log-level=info --no-confirm cargo-binstall@^0.12.0 | grep -q -v 'cargo-binstall v0.12.0 is already installed' diff --git a/e2e-tests/version-syntax.sh b/e2e-tests/version-syntax.sh new file mode 100755 index 00000000..e4096dab --- /dev/null +++ b/e2e-tests/version-syntax.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -euxo pipefail + +unset CARGO_INSTALL_ROOT + +export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export PATH="$CARGO_HOME/bin:$PATH" + +# Test --version +"./$1" binstall --force --no-confirm --version 0.11.1 cargo-binstall +# Test that the installed binaries can be run +cargo binstall --help >/dev/null + +# Test "$crate_name@$version" +"./$1" binstall --force --no-confirm cargo-binstall@0.11.1 +# Test that the installed binaries can be run +cargo binstall --help >/dev/null diff --git a/justfile b/justfile new file mode 100644 index 00000000..92ed4389 --- /dev/null +++ b/justfile @@ -0,0 +1,238 @@ +# input variables +ci := env_var_or_default("CI", "") +for-release := env_var_or_default("JUST_FOR_RELEASE", "") +use-cross := env_var_or_default("JUST_USE_CROSS", "") +extra-build-args := env_var_or_default("JUST_EXTRA_BUILD_ARGS", "") +extra-features := env_var_or_default("JUST_EXTRA_FEATURES", "") +default-features := env_var_or_default("JUST_DEFAULT_FEATURES", "") +override-features := env_var_or_default("JUST_OVERRIDE_FEATURES", "") + +export BINSTALL_LOG_LEVEL := if env_var_or_default("RUNNER_DEBUG", "0") == "1" { "debug" } else { "info" } + +# target information +target-host := `rustc -vV | grep host: | cut -d ' ' -f 2` +target := env_var_or_default("CARGO_BUILD_TARGET", target-host) +target-os := if target =~ "-windows-" { "windows" + } else if target =~ "darwin" { "macos" + } else if target =~ "linux" { "linux" + } else { "unknown" } +target-arch := if target =~ "x86_64" { "x64" + } else if target =~ "i[56]86" { "x86" + } else if target =~ "aarch64" { "arm64" + } else if target =~ "armv7" { "arm32" + } else { "unknown" } +target-libc := if target =~ "gnu" { "gnu" + } else if target =~ "musl" { "musl" + } else { "unknown" } + +# build output location +output-ext := if target-os == "windows" { ".exe" } else { "" } +output-filename := "cargo-binstall" + output-ext +output-profile-folder := if for-release != "" { "release" } else { "debug" } +output-folder := if target != target-host { "target" / target / output-profile-folder + } else if env_var_or_default("CARGO_BUILD_TARGET", "") != "" { "target" / target / output-profile-folder + } else if cargo-buildstd != "" { "target" / target / output-profile-folder + } else { "target" / output-profile-folder } +output-path := output-folder / output-filename + +# which tool to use for compiling +cargo-bin := if use-cross != "" { "cross" } else { "cargo +nightly" } + +# cargo compile options +cargo-profile := if for-release != "" { "release" } else { "dev" } + + +ci-or-no := if ci != "" { "ci" } else { "noci" } + +# In release builds in CI, build the std library ourselves so it uses our +# compile profile, and optimise panic messages out with immediate abort. +# +# explicitly disabled on aarch64-unknown-linux-gnu due to a failing build +cargo-buildstd := if (cargo-profile / ci-or-no) == "release/ci" { + if target == "aarch64-unknown-linux-gnu" { "" + } else { " -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort" } +} else { "" } + +# In musl release builds in CI, statically link gcclibs. +cargo-gcclibs := if (cargo-profile / ci-or-no / target-libc) == "release/ci/musl" { + " -C link-arg=-lgcc -C link-arg=-static-libgcc" +} else { "" } + +# disable default features in CI for debug builds, for speed +cargo-no-default-features := if default-features == "false" { " --no-default-features" + } else if default-features == "true" { "" + } else if (cargo-profile / ci-or-no) == "dev/ci" { " --no-default-features" + } else { "" } + +cargo-features := trim_end_match(if override-features != "" { override-features + } else if (cargo-profile / ci-or-no) == "dev/ci" { "rustls,fancy-with-backtrace," + extra-features + } else if (cargo-profile / ci-or-no / target-libc) == "release/ci/musl" { "rustls,fancy-with-backtrace,zstd-thin," + extra-features + } else if (cargo-profile / ci-or-no) == "release/ci" { "rustls,fancy-with-backtrace," + extra-features + } else { extra-features +}, ",") + +# it seems we can't split debuginfo for non-buildstd builds +# errors with: "Found a record with an unknown abbreviation code" +cargo-split-debuginfo := if cargo-buildstd != "" { " --config='profile.release.split-debuginfo=\"packed\"' --config=profile.release.debug=2" } else { "" } + +# for ARM64 Windows, use a patched version of ring +# this should be unnecessary once ring 0.17 is released +win-arm64-ring16 := if target == "aarch64-pc-windows-msvc" { " --config='patch.crates-io.ring.git=\"https://github.com/awakecoding/ring\"' --config='patch.crates-io.ring.branch=\"0.16.20_alpha\"'" } else { "" } + +cargo-build-args := (if for-release != "" { " --release" } else { "" }) + (if target != target-host { " --target " + target } else if cargo-buildstd != "" { " --target " + target } else { "" }) + (cargo-buildstd) + (if extra-build-args != "" { " " + extra-build-args } else { "" }) + (cargo-no-default-features) + (cargo-split-debuginfo) + (if cargo-features != "" { " --features " + cargo-features } else { "" }) + (win-arm64-ring16) +export RUSTFLAGS := (cargo-gcclibs) + + +ci-apt-deps := if target == "x86_64-unknown-linux-gnu" { "liblzma-dev libzip-dev libzstd-dev" + } else if target == "x86_64-unknown-linux-musl" { "musl-tools" + } else { "" } + +[linux] +ci-install-deps: + {{ if ci-apt-deps == "" { "exit" } else { "" } }} + sudo apt update && sudo apt install -y --no-install-recommends {{ci-apt-deps}} + +[macos] +[windows] +ci-install-deps: + +toolchain components="": + rustup toolchain install nightly {{ if components != "" { "--component " + components } else { "" } }} --no-self-update --profile minimal + {{ if ci != "" { "rustup default nightly" } else { "rustup override set nightly" } }} + {{ if target != "" { "rustup target add " + target } else { "" } }} + + +build: + {{cargo-bin}} build {{cargo-build-args}} + +check: + {{cargo-bin}} check {{cargo-build-args}} + +get-output file outdir=".": + test -d "{{outdir}}" || mkdir -p {{outdir}} + cp -r {{ output-folder / file }} {{outdir}}/{{ file_name(file) }} + -ls -l {{outdir}}/{{ file_name(file) }} + +get-binary outdir=".": (get-output output-filename outdir) + -chmod +x {{ outdir / output-filename }} + +e2e-test file *arguments: (get-binary "e2e-tests") + cd e2e-tests && bash {{file}}.sh {{output-filename}} {{arguments}} + +e2e-test-live: (e2e-test "live") +e2e-test-manifest-path: (e2e-test "manifest-path") +e2e-test-other-repos: (e2e-test "other-repos") +e2e-test-strategies: (e2e-test "strategies") +e2e-test-version-syntax: (e2e-test "version-syntax") +e2e-test-upgrade: (e2e-test "upgrade") + +# WinTLS (Windows in CI) does not have TLS 1.3 support +[windows] +e2e-test-tls: (e2e-test "tls" "1.2") +[linux] +[macos] +e2e-test-tls: (e2e-test "tls" "1.2") (e2e-test "tls" "1.3") + +e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls + +unit-tests: + {{cargo-bin}} test {{cargo-build-args}} + +test: unit-tests build e2e-tests + +clippy: + {{cargo-bin}} clippy --no-deps -- -D clippy::all + +fmt: + cargo fmt --all -- --check + +fmt-check: + cargo fmt --all -- --check + +lint: clippy fmt-check + +package-dir: + rm -rf packages/prep + mkdir -p packages/prep + cp crates/bin/LICENSE packages/prep + cp README.md packages/prep + +[macos] +package-prepare: build package-dir + just get-binary packages/prep + -just get-output cargo-binstall.dSYM packages/prep + + just get-output detect-wasi{{output-ext}} packages/prep + -just get-output detect-wasi.dSYM packages/prep + +# when https://github.com/rust-lang/cargo/pull/11384 lands, we can use +# -just get-output cargo_binstall.dwp packages/prep +# underscored dwp name needs to remain for debuggers to find the file properly +[linux] +package-prepare: build package-dir + just get-binary packages/prep + -cp {{output-folder}}/deps/cargo_binstall-*.dwp packages/prep/cargo_binstall.dwp + + just get-output detect-wasi packages/prep + -cp {{output-folder}}/deps/detect_wasi-*.dwp packages/prep/detect_wasi.dwp + +# underscored pdb name needs to remain for debuggers to find the file properly +# read from deps because sometimes cargo doesn't copy the pdb to the output folder +[windows] +package-prepare: build package-dir + just get-binary packages/prep + -just get-output deps/cargo_binstall.pdb packages/prep + + just get-output detect-wasi.exe packages/prep + -just get-output deps/detect_wasi.pdb packages/prep + +# we don't get dSYM bundles for universal binaries; unsure if it's even a thing +[macos] +lipo-prepare: package-dir + just target=aarch64-apple-darwin build get-binary packages/prep/arm64 + just target=x86_64-apple-darwin build get-binary packages/prep/x64 + + just target=aarch64-apple-darwin get-binary packages/prep/arm64 + just target=x86_64-apple-darwin get-binary packages/prep/x64 + lipo -create -output packages/prep/{{output-filename}} packages/prep/{arm64,x64}/{{output-filename}} + + just target=aarch64-apple-darwin get-output detect-wasi{{output-ext}} packages/prep/arm64 + just target=x86_64-apple-darwin get-output detect-wasi{{output-ext}} packages/prep/x64 + lipo -create -output packages/prep/detect-wasi{{output-ext}} packages/prep/{arm64,x64}/detect-wasi{{output-ext}} + + rm -rf packages/prep/{arm64,x64} + + +[linux] +package: package-prepare + cd packages/prep && tar cv {{output-filename}} | gzip -9 > "../cargo-binstall-{{target}}.tgz" + cd packages/prep && tar cv * | gzip -9 > "../cargo-binstall-{{target}}.full.tgz" + +[macos] +package: package-prepare + cd packages/prep && zip -9 "../cargo-binstall-{{target}}.zip" {{output-filename}} + cd packages/prep && zip -9 "../cargo-binstall-{{target}}.full.zip" * + +[windows] +package: package-prepare + cd packages/prep && 7z a -mx9 "../cargo-binstall-{{target}}.zip" {{output-filename}} + cd packages/prep && 7z a -mx9 "../cargo-binstall-{{target}}.full.zip" * + +[macos] +package-lipo: lipo-prepare + cd packages/prep && zip -9 "../cargo-binstall-universal-apple-darwin.zip" {{output-filename}} + cd packages/prep && zip -9 "../cargo-binstall-universal-apple-darwin.full.zip" * + +# assuming x64 and arm64 packages are already built, extract and lipo them +[macos] +repackage-lipo: package-dir + mkdir -p packages/prep/{arm64,x64} + cd packages/prep/x64 && unzip -o "../../cargo-binstall-x86_64-apple-darwin.full.zip" + cd packages/prep/arm64 && unzip -o "../../cargo-binstall-aarch64-apple-darwin.full.zip" + + lipo -create -output packages/prep/{{output-filename}} packages/prep/{arm64,x64}/{{output-filename}} + lipo -create -output packages/prep/detect-wasi packages/prep/{arm64,x64}/detect-wasi + + rm -rf packages/prep/{arm64,x64} + cd packages/prep && zip -9 "../cargo-binstall-universal-apple-darwin.zip" {{output-filename}} + cd packages/prep && zip -9 "../cargo-binstall-universal-apple-darwin.full.zip" * From 4b2deb19b9bc9f0a520eff67853cec3a99f0167b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Mon, 9 Jan 2023 12:35:00 +1300 Subject: [PATCH 0957/2020] Try build-std with arm64 gnu (#667) --- .github/workflows/ci.yml | 3 +-- .github/workflows/release-build.yml | 2 +- justfile | 22 +++++++++++++++------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d3e29bfe..2b16f277 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,6 +114,5 @@ jobs: # if everything succeeds and PR is ready for review, test the release/package process release-builds: if: (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || github.event_name == 'workflow_dispatch' - needs: - - tests-pass + needs: tests-pass uses: ./.github/workflows/release-build.yml diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index fe408e98..f0c44965 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -23,7 +23,7 @@ jobs: - { o: macos-latest, t: aarch64-apple-darwin } - { o: ubuntu-20.04, t: x86_64-unknown-linux-gnu } - { o: ubuntu-20.04, t: armv7-unknown-linux-gnueabihf, c: true } - - { o: ubuntu-20.04, t: aarch64-unknown-linux-gnu, c: true } + - { o: ubuntu-20.04, t: aarch64-unknown-linux-gnu } - { o: ubuntu-latest, t: x86_64-unknown-linux-musl } - { o: ubuntu-latest, t: armv7-unknown-linux-musleabihf, c: true } - { o: ubuntu-latest, t: aarch64-unknown-linux-musl, c: true } diff --git a/justfile b/justfile index 92ed4389..88d79775 100644 --- a/justfile +++ b/justfile @@ -46,15 +46,12 @@ ci-or-no := if ci != "" { "ci" } else { "noci" } # In release builds in CI, build the std library ourselves so it uses our # compile profile, and optimise panic messages out with immediate abort. -# -# explicitly disabled on aarch64-unknown-linux-gnu due to a failing build cargo-buildstd := if (cargo-profile / ci-or-no) == "release/ci" { - if target == "aarch64-unknown-linux-gnu" { "" - } else { " -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort" } -} else { "" } + " -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort" + } else { "" } # In musl release builds in CI, statically link gcclibs. -cargo-gcclibs := if (cargo-profile / ci-or-no / target-libc) == "release/ci/musl" { +rustc-gcclibs := if (cargo-profile / ci-or-no / target-libc) == "release/ci/musl" { " -C link-arg=-lgcc -C link-arg=-static-libgcc" } else { "" } @@ -79,12 +76,23 @@ cargo-split-debuginfo := if cargo-buildstd != "" { " --config='profile.release.s # this should be unnecessary once ring 0.17 is released win-arm64-ring16 := if target == "aarch64-pc-windows-msvc" { " --config='patch.crates-io.ring.git=\"https://github.com/awakecoding/ring\"' --config='patch.crates-io.ring.branch=\"0.16.20_alpha\"'" } else { "" } +# MIR optimisation level (defaults to 2, bring it up to 4 for release builds) +# disabled for now, as it ICEs +# https://github.com/rust-lang/rust/issues/106141 +rustc-miropt := "" #if for-release != "" { " -Z mir-opt-level=4" } else { "" } + +# ICF: link-time identical code folding +# disabled for now, as it requires the gold linker +rustc-icf := "" #if for-release != "" { " -C link-arg=-Wl,--icf=all" } else { "" } + cargo-build-args := (if for-release != "" { " --release" } else { "" }) + (if target != target-host { " --target " + target } else if cargo-buildstd != "" { " --target " + target } else { "" }) + (cargo-buildstd) + (if extra-build-args != "" { " " + extra-build-args } else { "" }) + (cargo-no-default-features) + (cargo-split-debuginfo) + (if cargo-features != "" { " --features " + cargo-features } else { "" }) + (win-arm64-ring16) -export RUSTFLAGS := (cargo-gcclibs) +export RUSTFLAGS := (rustc-gcclibs) + (rustc-miropt) + (rustc-icf) +# libblocksruntime-dev provides compiler-rt ci-apt-deps := if target == "x86_64-unknown-linux-gnu" { "liblzma-dev libzip-dev libzstd-dev" } else if target == "x86_64-unknown-linux-musl" { "musl-tools" + } else if target == "aarch64-unknown-linux-gnu" { "g++-aarch64-linux-gnu libc6-dev-arm64-cross binutils binutils-aarch64-linux-gnu libblocksruntime-dev" } else { "" } [linux] From 211cb3ceb0677f0122475b4bc732e50c495e5569 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Mon, 9 Jan 2023 13:53:55 +1300 Subject: [PATCH 0958/2020] Add release metadata in PR (from release-pr v2) (#668) --- .github/scripts/release-pr-template.ejs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/scripts/release-pr-template.ejs b/.github/scripts/release-pr-template.ejs index 0d99dfae..aa5482fc 100644 --- a/.github/scripts/release-pr-template.ejs +++ b/.github/scripts/release-pr-template.ejs @@ -1,3 +1,7 @@ +<% if (pr.metaComment) { %> + +<% } %> + This is a release PR for **<%= crate.name %>** version **<%= version.actual %>**<% if (version.actual != version.desired) { %> (performing a <%= version.desired %> bump).<% @@ -6,17 +10,7 @@ This is a release PR for **<%= crate.name %>** version **<%= version.actual %>** } %> -<% if (pr.mergeStrategy == "merge") { %> -**Use a merge commit.** -<% } else if (pr.mergeStrategy == "rebase") { %> -**Use rebase merge.** -<% } else if (pr.mergeStrategy == "squash") { %> **Use squash merge.** -<% } else if (pr.mergeStrategy == "bors") { %> -**Merge by commenting:** -| bors r+ | -|:-:| -<% } %> <% if (crate.name == "cargo-binstall") { %> Upon merging, this will automatically create the tag `v<%= version.actual %>`, build the CLI, and create a GitHub release with the release notes below. From 94cabeb5d795fe18fae741ecde8cb13eee99b788 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jan 2023 14:01:41 +1100 Subject: [PATCH 0959/2020] Bump async-trait from 0.1.60 to 0.1.61 (#669) Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.60 to 0.1.61. - [Release notes](https://github.com/dtolnay/async-trait/releases) - [Commits](https://github.com/dtolnay/async-trait/compare/0.1.60...0.1.61) --- updated-dependencies: - dependency-name: async-trait dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 838bedcc..efa20634 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -81,9 +81,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d1d8ab452a3936018a687b20e6f7cf5363d713b732b8884001317b0e48aa3" +checksum = "705339e0e4a9690e2908d2b3d049d85682cf19fbd5782494498fbf7003a6a282" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index acd6f070..c570534f 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0" [dependencies] -async-trait = "0.1.60" +async-trait = "0.1.61" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.9", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } binstalk-types = { version = "0.1.0", path = "../binstalk-types" } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 01bfa0cd..afc5a01c 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0" [dependencies] -async-trait = "0.1.60" +async-trait = "0.1.61" binstalk-downloader = { version = "0.2.0", path = "../binstalk-downloader" } binstalk-types = { version = "0.1.0", path = "../binstalk-types" } cargo_toml = "0.14.0" From e5d4c13d1bc325d73af786b9124c6d1720bf350b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jan 2023 03:19:08 +0000 Subject: [PATCH 0960/2020] Bump mimalloc from 0.1.32 to 0.1.34 (#670) Bumps [mimalloc](https://github.com/purpleprotocol/mimalloc_rust) from 0.1.32 to 0.1.34. - [Release notes](https://github.com/purpleprotocol/mimalloc_rust/releases) - [Commits](https://github.com/purpleprotocol/mimalloc_rust/compare/v0.1.32...v0.1.34) --- updated-dependencies: - dependency-name: mimalloc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index efa20634..74a09890 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1261,9 +1261,9 @@ checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "libmimalloc-sys" -version = "0.1.28" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04d1c67deb83e6b75fa4fe3309e09cfeade12e7721d95322af500d3814ea60c9" +checksum = "dd8c7cbf8b89019683667e347572e6d55a7df7ea36b0c4ce69961b0cde67b174" dependencies = [ "cc", "libc", @@ -1405,9 +1405,9 @@ dependencies = [ [[package]] name = "mimalloc" -version = "0.1.32" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2374e2999959a7b583e1811a1ddbf1d3a4b9496eceb9746f1192a59d871eca" +checksum = "9dcb174b18635f7561a0c6c9fc2ce57218ac7523cf72c50af80e2d79ab8f3ba1" dependencies = [ "libmimalloc-sys", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 5861c712..4b970c45 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -30,7 +30,7 @@ dirs = "4.0.0" fs-lock = { version = "0.1.0", path = "../fs-lock" } log = { version = "0.4.17", features = ["std"] } miette = "5.5.0" -mimalloc = { version = "0.1.32", default-features = false, optional = true } +mimalloc = { version = "0.1.34", default-features = false, optional = true } once_cell = "1.17.0" semver = "1.0.16" strum = "0.24.1" From 4ebf7cb4214044f79637cdb5f6953d3130eeada9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 9 Jan 2023 20:39:39 +1100 Subject: [PATCH 0961/2020] Bump tokio from 1.23.0 to 1.24.1 (#658) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Bump tokio from 1.23.0 to 1.24.1 Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.23.0 to 1.24.1. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.23.0...tokio-1.24.1) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Don't reuse build cache * fix index cache Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Félix Saparelli --- .github/actions/just-setup/action.yml | 3 --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 4 ++-- 6 files changed, 7 insertions(+), 10 deletions(-) diff --git a/.github/actions/just-setup/action.yml b/.github/actions/just-setup/action.yml index 7b97ece5..3cecba1e 100644 --- a/.github/actions/just-setup/action.yml +++ b/.github/actions/just-setup/action.yml @@ -35,7 +35,6 @@ runs: ~/.cargo/registry/index/ ~/.cargo/registry/cache/ ~/.cargo/git/db/ - target/ key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}-${{ inputs.cache-suffix }} restore-keys: | ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}- @@ -48,5 +47,3 @@ runs: path: | target/ key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ inputs.cache-suffix }} - restore-keys: | - ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}- diff --git a/Cargo.lock b/Cargo.lock index 74a09890..079632ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2378,9 +2378,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.23.0" +version = "1.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eab6d665857cc6ca78d6e80303a02cea7a7851e85dfbd77cbdc09bd129f1ef46" +checksum = "1d9f76183f91ecfb55e1d7d5602bd1d979e38a3a522fe900241cf195624d67ae" dependencies = [ "autocfg", "bytes", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 4b970c45..5fdbe06e 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -37,7 +37,7 @@ strum = "0.24.1" strum_macros = "0.24.3" supports-color = "2.0.0" tempfile = "3.3.0" -tokio = { version = "1.23.0", features = ["rt-multi-thread"], default-features = false } +tokio = { version = "1.24.1", features = ["rt-multi-thread"], default-features = false } tracing-core = "0.1.30" tracing = { version = "0.1.37", default-features = false } tracing-log = { version = "0.1.3", default-features = false } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index c570534f..9c9da08a 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -29,7 +29,7 @@ reqwest = { version = "0.11.13", features = ["stream", "gzip", "brotli", "deflat tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.3.0" thiserror = "1.0.38" -tokio = { version = "1.23.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } +tokio = { version = "1.24.1", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.4", features = ["io"] } tower = { version = "0.4.13", features = ["limit", "util"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index afc5a01c..7e31fe39 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -34,7 +34,7 @@ tempfile = "3.3.0" thiserror = "1.0.38" tinytemplate = "1.2.1" # parking_lot for `tokio::sync::OnceCell::const_new` -tokio = { version = "1.23.0", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } +tokio = { version = "1.24.1", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } tracing = "0.1.37" url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 529f6805..5118050f 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -10,9 +10,9 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -tokio = { version = "1.23.0", features = ["rt", "process", "sync"], default-features = false } +tokio = { version = "1.24.1", features = ["rt", "process", "sync"], default-features = false } cfg-if = "1.0.0" guess_host_triple = "0.1.3" [dev-dependencies] -tokio = { version = "1.23.0", features = ["macros"], default-features = false } +tokio = { version = "1.24.1", features = ["macros"], default-features = false } From ce411910a9aa2af17c906b8fc2de3e6d264d675a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Mon, 9 Jan 2023 23:30:35 +1300 Subject: [PATCH 0962/2020] Linux split debuginfo is already here actually (#672) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6739e2b2..5bfff1f7 100644 --- a/README.md +++ b/README.md @@ -91,7 +91,7 @@ Supported crates such as `cargo-binstall` itself can also be updated with `cargo - Can I use it in CI? - Yes! For GitHub Actions, we recommend the excellent [taiki-e/install-action](https://github.com/marketplace/actions/install-development-tools), which has explicit support for selected tools and uses `cargo-binstall` for everything else. - Are debug symbols available? - - Yes! Extra pre-built packages with a `.full` suffix are available and contain split debuginfo (for Windows and macOS, Linux coming soon), documentation files, and extra binaries like the `detect-wasi` utility. + - Yes! Extra pre-built packages with a `.full` suffix are available and contain split debuginfo, documentation files, and extra binaries like the `detect-wasi` utility. --- From 02484327c1e7667825658be0da47a1c9431efcb4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 11 Jan 2023 01:02:24 +1100 Subject: [PATCH 0963/2020] Update transitive deps (#674) Signed-off-by: Jiahao XU --- Cargo.lock | 116 +++++++++++++++++------------------------------------ 1 file changed, 36 insertions(+), 80 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 079632ab..d8587a72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -556,9 +556,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5add3fc1717409d029b20c5b6903fc0c0b02fa6741d820054f4a2efa5e5816fd" +checksum = "51d1075c37807dcf850c379432f0df05ba52cc30f279c5cfc43cc221ce7f8579" dependencies = [ "cc", "cxxbridge-flags", @@ -568,9 +568,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c87959ba14bc6fbc61df77c3fcfe180fc32b93538c4f1031dd802ccb5f2ff0" +checksum = "5044281f61b27bc598f2f6647d480aed48d2bf52d6eb0b627d84c0361b17aa70" dependencies = [ "cc", "codespan-reporting", @@ -583,15 +583,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69a3e162fde4e594ed2b07d0f83c6c67b745e7f28ce58c6df5e6b6bef99dfb59" +checksum = "61b50bc93ba22c27b0d31128d2d130a0a6b3d267ae27ef7e4fae2167dfe8781c" [[package]] name = "cxxbridge-macro" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e7e2adeb6a0d4a282e581096b06e1791532b7d576dcde5ccd9382acf55db8e6" +checksum = "39e61fda7e62115119469c7b3591fd913ecca96fb766cfd3f2e2502ab7bc87a5" dependencies = [ "proc-macro2", "quote", @@ -729,7 +729,7 @@ dependencies = [ "cfg-if", "libc", "redox_syscall", - "windows-sys 0.42.0", + "windows-sys", ] [[package]] @@ -1161,7 +1161,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c" dependencies = [ "libc", - "windows-sys 0.42.0", + "windows-sys", ] [[package]] @@ -1178,9 +1178,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.7.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11b0d96e660696543b251e58030cf9787df56da39dab19ad60eae7353040917e" +checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" [[package]] name = "is-terminal" @@ -1190,8 +1190,8 @@ checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" dependencies = [ "hermit-abi 0.2.6", "io-lifetimes 1.0.3", - "rustix 0.36.5", - "windows-sys 0.42.0", + "rustix 0.36.6", + "windows-sys", ] [[package]] @@ -1235,7 +1235,7 @@ dependencies = [ "libc", "scopeguard", "tokio", - "windows-sys 0.42.0", + "windows-sys", ] [[package]] @@ -1436,7 +1436,7 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.42.0", + "windows-sys", ] [[package]] @@ -1514,9 +1514,9 @@ dependencies = [ [[package]] name = "object" -version = "0.30.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239da7f290cfa979f43f85a8efeee9a8a76d0827c356d37f9d3d7254d6b537fb" +checksum = "8d864c91689fdc196779b98dba0aceac6118594c2df6ee5d943eb6a8df4d107a" dependencies = [ "memchr", ] @@ -1610,7 +1610,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-sys 0.42.0", + "windows-sys", ] [[package]] @@ -1816,9 +1816,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e076559ef8e241f2ae3479e36f97bd5741c0330689e217ad51ce2c76808b868a" +checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" dependencies = [ "aho-corasick", "memchr", @@ -1936,21 +1936,21 @@ dependencies = [ "io-lifetimes 0.7.5", "libc", "linux-raw-sys 0.0.46", - "windows-sys 0.42.0", + "windows-sys", ] [[package]] name = "rustix" -version = "0.36.5" +version = "0.36.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3807b5d10909833d3e9acd1eb5fb988f79376ff10fce42937de71a449c4c588" +checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549" dependencies = [ "bitflags", "errno", "io-lifetimes 1.0.3", "libc", "linux-raw-sys 0.1.4", - "windows-sys 0.42.0", + "windows-sys", ] [[package]] @@ -2009,12 +2009,11 @@ checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" [[package]] name = "schannel" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d6731146462ea25d9244b2ed5fd1d716d25c52e4d54aa4fb0f3c4e9854dbe2" +checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" dependencies = [ - "lazy_static", - "windows-sys 0.36.1", + "windows-sys", ] [[package]] @@ -2393,7 +2392,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.42.0", + "windows-sys", ] [[package]] @@ -2639,9 +2638,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" +checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "typenum" @@ -2896,19 +2895,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.42.0" @@ -2916,12 +2902,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.42.0", - "windows_i686_gnu 0.42.0", - "windows_i686_msvc 0.42.0", - "windows_x86_64_gnu 0.42.0", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.42.0", + "windows_x86_64_msvc", ] [[package]] @@ -2930,48 +2916,24 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" -[[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.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" -[[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.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" -[[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.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" -[[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.0" @@ -2984,12 +2946,6 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" - [[package]] name = "windows_x86_64_msvc" version = "0.42.0" From 9821caa6d06156363c8f899f8f0e6536a7ade200 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Wed, 11 Jan 2023 11:22:53 +1300 Subject: [PATCH 0964/2020] Use release-meta action instead of parsing commits (#675) --- .github/scripts/extract-release-notes.sh | 16 ------ .../extract-tag-from-release-commit.sh | 8 --- .github/workflows/release-build.yml | 4 +- .github/workflows/release.yml | 52 ++++++++----------- 4 files changed, 25 insertions(+), 55 deletions(-) delete mode 100755 .github/scripts/extract-release-notes.sh delete mode 100755 .github/scripts/extract-tag-from-release-commit.sh diff --git a/.github/scripts/extract-release-notes.sh b/.github/scripts/extract-release-notes.sh deleted file mode 100755 index 3bf70165..00000000 --- a/.github/scripts/extract-release-notes.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/bash -set -euxo pipefail - -release_pr=$(head -n1 <<< "${COMMIT_MESSAGE:-}" | jq -Rr 'split("[()]"; "")[1] // ""') -if [[ -z "$release_pr" ]]; then - echo "::set-output name=notes_json::null" - exit -fi - -gh \ - pr --repo "$GITHUB_REPO" \ - view "$release_pr" \ - --json body \ - --jq '"::set-output name=notes_json::\((.body | split("### Release notes")[1] // "") | tojson)"' - - diff --git a/.github/scripts/extract-tag-from-release-commit.sh b/.github/scripts/extract-tag-from-release-commit.sh deleted file mode 100755 index 3e7d95bb..00000000 --- a/.github/scripts/extract-tag-from-release-commit.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -set -euxo pipefail - -message="$(head -n1 <<< "$COMMIT_MESSAGE")" -crate="$(cut -d ' ' -f 2 <<< "${message}")" -version="$(cut -d ' ' -f 3 <<< "${message}")" -echo "::set-output name=crate::${crate}" -echo "::set-output name=version::${version}" diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index f0c44965..f4f886f5 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -102,8 +102,8 @@ jobs: name: Publish release uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 with: - tag_name: ${{ fromJSON(inputs.publish).version }} - name: ${{ fromJSON(inputs.publish).version }} + tag_name: v${{ fromJSON(inputs.publish).version }} + name: v${{ fromJSON(inputs.publish).version }} body: ${{ fromJSON(inputs.publish).notes }} append_body: false files: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f47f9710..b286bac2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,56 +1,50 @@ -name: Release +name: On release on: - push: - branches: - - main - tags-ignore: - - "*" + pull_request: + types: closed + branches: [main] # target branch of release PRs jobs: info: - runs-on: ubuntu-latest - # the commit message will look like: `release: {crate-name} v{version} (#{pr-number})` - if: "startsWith(github.event.head_commit.message, 'release: ')" + if: github.event.pull_request.merged + outputs: - crate: ${{ steps.version.outputs.crate }} - version: ${{ steps.version.outputs.version }} - notes: ${{ fromJSON(steps.notes.outputs.notes_json) }} - env: - COMMIT_MESSAGE: ${{ github.event.head_commit.message }} + is-release: ${{ steps.meta.outputs.is-release }} + crate: ${{ steps.meta.outputs.crate-names }} + version: ${{ steps.meta.outputs.version-actual }} + notes: ${{ steps.meta.outputs.notes }} + + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - name: Extract tag from commit message - id: version - run: .github/scripts/extract-tag-from-release-commit.sh - - name: Extract release notes - id: notes - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_REPO: ${{ github.repository }} - run: .github/scripts/extract-release-notes.sh + - id: meta + uses: cargo-bins/release-meta@v1 + with: + event-data: ${{ toJSON(github.event) }} + extract-notes-under: '### Release notes' tag: + if: needs.info.outputs.is-release == 'true' needs: info runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - name: Push lib release tag - if: "! startsWith(github.event.head_commit.message, 'release: cargo-binstall v')" + if: needs.info.outputs.crate != 'cargo-binstall' uses: mathieudutour/github-tag-action@v6.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} custom_tag: ${{ needs.info.outputs.version }} - tag_prefix: ${{ needs.info.outputs.crate }}- + tag_prefix: ${{ needs.info.outputs.crate }}-v - name: Push cli release tag - if: "startsWith(github.event.head_commit.message, 'release: cargo-binstall v')" + if: needs.info.outputs.crate == 'cargo-binstall' uses: mathieudutour/github-tag-action@v6.1 with: github_token: ${{ secrets.GITHUB_TOKEN }} custom_tag: ${{ needs.info.outputs.version }} - tag_prefix: '' + tag_prefix: v package: - if: "startsWith(github.event.head_commit.message, 'release: cargo-binstall v')" + if: needs.info.outputs.is-release == 'true' && needs.info.outputs.crate == 'cargo-binstall' needs: - info - tag From 6033e30db51517bcf75b2e22495a0f3d0e46118d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Wed, 11 Jan 2023 11:36:35 +1300 Subject: [PATCH 0965/2020] Remove old jq script (#676) --- .github/scripts/compile-settings.jq | 49 ----------------------------- 1 file changed, 49 deletions(-) delete mode 100644 .github/scripts/compile-settings.jq diff --git a/.github/scripts/compile-settings.jq b/.github/scripts/compile-settings.jq deleted file mode 100644 index 24391921..00000000 --- a/.github/scripts/compile-settings.jq +++ /dev/null @@ -1,49 +0,0 @@ -if $matrix.target != "aarch64-unknown-linux-gnu" then { - # Use build-std to build a std library optimized for size and abort immediately on abort, - # so that format string for `unwrap`/`expect`/`unreachable`/`panic` can be optimized out. - # - # Disable it on aarch64-unknown-linux-gnu as it caused the build to fail. - release_build_std_args: "-Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort" -} else { - release_build_std_args: "" -} end -| -if $for_release then { - output: "release", - profile: "release", - args: ($matrix.release_build_args // .release_build_std_args), - features: ($matrix.release_features // ["static", "rustls", "trust-dns", "fancy-no-backtrace", "log_release_max_level_debug"]), -} else { - output: "debug", - profile: "dev", - args: ($matrix.debug_build_args // ""), - features: ($matrix.debug_features // ["rustls", "fancy-with-backtrace"]), -} end -| -.rustflags = ( - if $for_release and $matrix.target == "aarch64-unknown-linux-musl" or $matrix.target == "armv7-unknown-linux-musleabihf" - then "-C link-arg=-lgcc -Clink-arg=-static-libgcc" - else "" end -) -| -.features = ( - if ($matrix."use-cross" // false) - then .features // ["zstd-thin"] - else .features end -) -| -.features = ( - if (.features | length > 0) - then "--no-default-features --features \(.features | join(","))" - else "" end -) -| -{ - CBIN: (if ($matrix.target | test("windows")) then "cargo-binstall.exe" else "cargo-binstall" end), - CTOOL: (if ($matrix."use-cross" // false) then "cross" else "cargo" end), - COUTPUT: .output, - CARGS: "--target \($matrix.target) --profile \(.profile) \(.features) \(.args)", - RUSTFLAGS: .rustflags, -} -| -to_entries[] | "\(.key)=\(.value)" From 9cdaf777c0d54f56b0cd3632ebdeb644bc06c883 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 10 Jan 2023 23:12:37 +0000 Subject: [PATCH 0966/2020] release: detect-targets v0.1.4 (#683) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d8587a72..b30299a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -606,7 +606,7 @@ checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" [[package]] name = "detect-targets" -version = "0.1.3" +version = "0.1.4" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 1b67f72a..1208ab80 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -25,5 +25,5 @@ toml = "0.5.10" url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.3", path = "../detect-targets" } +detect-targets = { version = "0.1.4", path = "../detect-targets" } tempfile = "3.3.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 7e31fe39..3957735c 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -17,7 +17,7 @@ cargo_toml = "0.14.0" command-group = { version = "2.0.1", features = ["with-tokio"] } compact_str = { version = "0.6.1", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } -detect-targets = { version = "0.1.3", path = "../detect-targets" } +detect-targets = { version = "0.1.4", path = "../detect-targets" } either = "1.8.0" futures-util = { version = "0.3.25", default-features = false, features = ["std"] } home = "0.5.4" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 5118050f..411a5658 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.3" +version = "0.1.4" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From 3d79401d81f10034c14e0bd9b47d1f118f2a3a10 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 11 Jan 2023 10:29:31 +1100 Subject: [PATCH 0967/2020] release: binstalk-types v0.2.0 (#685) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b30299a6..8a2f3b53 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -246,7 +246,7 @@ dependencies = [ [[package]] name = "binstalk-types" -version = "0.1.0" +version = "0.2.0" dependencies = [ "compact_str", "maybe-owned", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 9c9da08a..23b3efe5 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0" async-trait = "0.1.61" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.9", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } -binstalk-types = { version = "0.1.0", path = "../binstalk-types" } +binstalk-types = { version = "0.2.0", path = "../binstalk-types" } bytes = "1.3.0" bzip2 = "0.4.4" digest = "0.10.6" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 1208ab80..bd32c0c8 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] beef = { version = "0.5.2", features = ["impl_serde"] } -binstalk-types = { version = "0.1.0", path = "../binstalk-types" } +binstalk-types = { version = "0.2.0", path = "../binstalk-types" } compact_str = { version = "0.6.1", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 335f0ee5..00fd8613 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-types" description = "The binstall toolkit that contains basic types for binstalk crates" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-types" -version = "0.1.0" +version = "0.2.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 3957735c..e2d56c9b 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.61" binstalk-downloader = { version = "0.2.0", path = "../binstalk-downloader" } -binstalk-types = { version = "0.1.0", path = "../binstalk-types" } +binstalk-types = { version = "0.2.0", path = "../binstalk-types" } cargo_toml = "0.14.0" command-group = { version = "2.0.1", features = ["with-tokio"] } compact_str = { version = "0.6.1", features = ["serde"] } From 24c15e57e9c579f4c960c8a7267ce54d14ca6ef5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 10 Jan 2023 23:48:36 +0000 Subject: [PATCH 0968/2020] release: binstalk-manifests v0.2.0 (#684) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8a2f3b53..38649121 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -225,7 +225,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.1.1" +version = "0.2.0" dependencies = [ "beef", "binstalk-types", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 5fdbe06e..cead4b3f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.6.0" } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.1.1" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.2.0" } clap = { version = "4.0.32", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index bd32c0c8..6611885d 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.1.1" +version = "0.2.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From 236829b7f20f179b198278348e4b04762f4e1d3b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 11 Jan 2023 00:31:10 +0000 Subject: [PATCH 0969/2020] release: binstalk-downloader v0.3.0 (#689) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 38649121..aaf3b02f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -195,7 +195,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.2.0" +version = "0.3.0" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 23b3efe5..7dec8424 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.2.0" +version = "0.3.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index e2d56c9b..f3468671 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.61" -binstalk-downloader = { version = "0.2.0", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.3.0", path = "../binstalk-downloader" } binstalk-types = { version = "0.2.0", path = "../binstalk-types" } cargo_toml = "0.14.0" command-group = { version = "2.0.1", features = ["with-tokio"] } From 1b0e9292ae8c4bd8dcd1b16f85fbd7ead20a5c7e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 11 Jan 2023 00:49:45 +0000 Subject: [PATCH 0970/2020] release: binstalk v0.7.0 (#690) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aaf3b02f..f5c6d0cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -162,7 +162,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.6.0" +version = "0.7.0" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index cead4b3f..5b45d388 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.6.0" } +binstalk = { path = "../binstalk", version = "0.7.0" } binstalk-manifests = { path = "../binstalk-manifests", version = "0.2.0" } clap = { version = "4.0.32", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index f3468671..898e8ef1 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.6.0" +version = "0.7.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From ede976d650c64e81ab9d61b2f8ddf43483f8bf42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Wed, 11 Jan 2023 14:21:16 +1300 Subject: [PATCH 0971/2020] Fix typo (#691) --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b286bac2..bc054982 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,7 +10,7 @@ jobs: outputs: is-release: ${{ steps.meta.outputs.is-release }} - crate: ${{ steps.meta.outputs.crate-names }} + crate: ${{ steps.meta.outputs.crates-names }} version: ${{ steps.meta.outputs.version-actual }} notes: ${{ steps.meta.outputs.notes }} From 64c359a86f9ff688e8fc7f788f88d46490695e61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Thu, 12 Jan 2023 02:45:04 +1300 Subject: [PATCH 0972/2020] Run CI on auto-merge enable (#692) --- .github/workflows/ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2b16f277..ec09a8e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,11 @@ name: CI on: workflow_dispatch: pull_request: + types: + - opened + - reopened + - synchronize + - auto_merge_enabled push: branches: - main From ea28e5e1e43ab9ed6a62aa3dbb2bdeb334549662 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 12 Jan 2023 10:22:31 +1100 Subject: [PATCH 0973/2020] release: cargo-binstall v0.19.0 (#688) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f5c6d0cd..38256f3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -346,7 +346,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.18.1" +version = "0.19.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 5b45d388..1bb2b866 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.18.1" +version = "0.19.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index b52bea5e..c80557f4 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From aed3d9d71c4e3144d6f35303ba864026792d1d07 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Thu, 12 Jan 2023 13:48:03 +1300 Subject: [PATCH 0974/2020] Use release action with explicit support for being called multiple times (#693) --- .github/workflows/release-build.yml | 39 +++++++++++++---------------- 1 file changed, 17 insertions(+), 22 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index f4f886f5..add62091 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -52,19 +52,16 @@ jobs: - if: runner.os != 'Windows' run: ls -shal packages/ - - if: ${{ inputs.publish }} - name: Publish release - uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 + - if: inputs.publish + name: Upload to release + uses: svenstaro/upload-release-action@v2 with: - tag_name: ${{ fromJSON(inputs.publish).version }} - name: ${{ fromJSON(inputs.publish).version }} + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: v${{ fromJSON(inputs.publish).version }} body: ${{ fromJSON(inputs.publish).notes }} - append_body: false - files: | - packages/cargo-binstall-* - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - if: ${{ !inputs.publish || runner.os == 'macOS' }} + file: packages/cargo-binstall-* + file_glob: true + - if: "! inputs.publish || runner.os == 'macOS'" name: Upload artifact uses: actions/upload-artifact@v3 with: @@ -98,19 +95,17 @@ jobs: - run: just repackage-lipo - run: ls -shal packages/ - - if: ${{ inputs.publish }} - name: Publish release - uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 + - if: inputs.publish + name: Upload to release + uses: svenstaro/upload-release-action@v2 with: - tag_name: v${{ fromJSON(inputs.publish).version }} - name: v${{ fromJSON(inputs.publish).version }} + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: v${{ fromJSON(inputs.publish).version }} body: ${{ fromJSON(inputs.publish).notes }} - append_body: false - files: | - packages/cargo-binstall-universal-* - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - if: ${{ !inputs.publish }} + file: packages/cargo-binstall-universal-* + file_glob: true + overwrite: true + - if: "! inputs.publish" name: Upload artifact uses: actions/upload-artifact@v3 with: From 87854d8cc463f5895bd9da3064040b875c745973 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Thu, 12 Jan 2023 16:11:43 +1300 Subject: [PATCH 0975/2020] Recurse when packaging for mac (#696) --- justfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/justfile b/justfile index 88d79775..aa3f6616 100644 --- a/justfile +++ b/justfile @@ -218,8 +218,8 @@ package: package-prepare [macos] package: package-prepare - cd packages/prep && zip -9 "../cargo-binstall-{{target}}.zip" {{output-filename}} - cd packages/prep && zip -9 "../cargo-binstall-{{target}}.full.zip" * + cd packages/prep && zip -r -9 "../cargo-binstall-{{target}}.zip" {{output-filename}} + cd packages/prep && zip -r -9 "../cargo-binstall-{{target}}.full.zip" * [windows] package: package-prepare @@ -228,8 +228,8 @@ package: package-prepare [macos] package-lipo: lipo-prepare - cd packages/prep && zip -9 "../cargo-binstall-universal-apple-darwin.zip" {{output-filename}} - cd packages/prep && zip -9 "../cargo-binstall-universal-apple-darwin.full.zip" * + cd packages/prep && zip -r -9 "../cargo-binstall-universal-apple-darwin.zip" {{output-filename}} + cd packages/prep && zip -r -9 "../cargo-binstall-universal-apple-darwin.full.zip" * # assuming x64 and arm64 packages are already built, extract and lipo them [macos] From 1be25f81b53945c5dc86d79ca1f6eec52c455ce4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 12 Jan 2023 16:45:36 +1100 Subject: [PATCH 0976/2020] Fix `FileLock` for `.crates.toml` not dropped (#697) * Fix `FileLock` for `.crates.toml` not dropped Signed-off-by: Jiahao XU * Rm unneccessary ret type annotation for the closure Signed-off-by: Jiahao XU * Add regression test Signed-off-by: Jiahao XU Signed-off-by: Jiahao XU --- crates/bin/src/entry.rs | 81 ++++++++++++++++++++++++++--------------- e2e-tests/strategies.sh | 3 ++ 2 files changed, 54 insertions(+), 30 deletions(-) diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 020fedb2..69da24ee 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -7,7 +7,7 @@ use binstalk::{ helpers::{jobserver_client::LazyJobserverClient, remote::Client, tasks::AutoAbortJoinHandle}, ops::{ self, - resolve::{CrateName, Resolution, VersionReqExt}, + resolve::{CrateName, Resolution, ResolutionFetch, VersionReqExt}, Resolver, }, }; @@ -146,35 +146,14 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - confirm().await?; } - if !resolution_fetchs.is_empty() { - if dry_run { - info!("Dry-run: Not proceeding to install fetched binaries"); - } else { - let f = || -> Result<()> { - let metadata_vec = resolution_fetchs - .into_iter() - .map(|fetch| fetch.install(&binstall_opts)) - .collect::, BinstallError>>()?; - - if let Some(manifests) = manifests { - manifests.update(metadata_vec)?; - } - - if no_cleanup { - // Consume temp_dir without removing it from fs. - temp_dir.into_path(); - } else { - temp_dir.close().unwrap_or_else(|err| { - warn!("Failed to clean up some resources: {err}"); - }); - } - - Ok(()) - }; - - block_in_place(f)?; - } - } + do_install_fetches( + resolution_fetchs, + manifests, + &binstall_opts, + dry_run, + temp_dir, + no_cleanup, + )?; let tasks: Vec<_> = resolution_sources .into_iter() @@ -276,3 +255,45 @@ fn filter_out_installed_crates( } })) } + +#[allow(clippy::vec_box)] +fn do_install_fetches( + resolution_fetchs: Vec>, + // Take manifests by value to drop the `FileLock`. + manifests: Option, + binstall_opts: &ops::Options, + dry_run: bool, + temp_dir: tempfile::TempDir, + no_cleanup: bool, +) -> Result<()> { + if resolution_fetchs.is_empty() { + return Ok(()); + } + + if dry_run { + info!("Dry-run: Not proceeding to install fetched binaries"); + return Ok(()); + } + + block_in_place(|| { + let metadata_vec = resolution_fetchs + .into_iter() + .map(|fetch| fetch.install(binstall_opts)) + .collect::, BinstallError>>()?; + + if let Some(manifests) = manifests { + manifests.update(metadata_vec)?; + } + + if no_cleanup { + // Consume temp_dir without removing it from fs. + temp_dir.into_path(); + } else { + temp_dir.close().unwrap_or_else(|err| { + warn!("Failed to clean up some resources: {err}"); + }); + } + + Ok(()) + }) +} diff --git a/e2e-tests/strategies.sh b/e2e-tests/strategies.sh index 741cdddd..649dfec7 100755 --- a/e2e-tests/strategies.sh +++ b/e2e-tests/strategies.sh @@ -24,3 +24,6 @@ if [ "$exit_code" != 94 ]; then echo "Expected exit code 94, but actual exit code $exit_code" exit 1 fi + +## Test compile-only strategy +"./$1" binstall --no-confirm --strategies compile cargo-quickinstall From 850ad63df98e7b5444218b6d7a01da47474a948b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 12 Jan 2023 17:16:40 +1100 Subject: [PATCH 0977/2020] release: cargo-binstall v0.19.1 (#698) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 38256f3f..2aae1e3c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -346,7 +346,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.19.0" +version = "0.19.1" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 1bb2b866..1ef9e387 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.19.0" +version = "0.19.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index c80557f4..d0d6bbfa 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 13845a7ca2a4b127979f89acf0ca54551e349858 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 12 Jan 2023 07:36:21 +0000 Subject: [PATCH 0978/2020] Bump zstd from 0.12.1+zstd.1.5.2 to 0.12.2+zstd.1.5.2 (#695) --- Cargo.lock | 6 +++--- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2aae1e3c..1173149d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -220,7 +220,7 @@ dependencies = [ "trust-dns-resolver", "url", "xz2", - "zstd 0.12.1+zstd.1.5.2", + "zstd 0.12.2+zstd.1.5.2", ] [[package]] @@ -2990,9 +2990,9 @@ dependencies = [ [[package]] name = "zstd" -version = "0.12.1+zstd.1.5.2" +version = "0.12.2+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c947d2adc84ff9a59f2e3c03b81aa4128acf28d6ad7d56273f7e8af14e47bea" +checksum = "e9262a83dc741c0b0ffec209881b45dbc232c21b02a2b9cb1adb93266e41303d" dependencies = [ "zstd-safe 6.0.2+zstd.1.5.2", ] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 7dec8424..073907d2 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -43,7 +43,7 @@ xz2 = "0.1.7" # Since zip 0.6.3 depends on zstd 0.11, we can use 0.12.0 here # because it uses the same zstd-sys version. # Otherwise there will be a link conflict. -zstd = { version = "0.12.1", default-features = false } +zstd = { version = "0.12.2", default-features = false } [features] default = ["static", "rustls"] From abb6874da3f9b66d594bc4e309abea973deb3fea Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 13 Jan 2023 23:46:18 +1100 Subject: [PATCH 0979/2020] Update README: Include aarch64 windows and full build info (#700) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update README: Include aarch64 windows and full build info Co-authored-by: Félix Saparelli --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 5bfff1f7..1084df5b 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,10 @@ We recommend using the pre-compiled ones because we optimize those more than a s | macos | m1 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-apple-darwin.zip | | macos | universal | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-universal-apple-darwin.zip | | windows | x86\_64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-pc-windows-msvc.zip | +| windows | arm64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-pc-windows-msvc.zip | + +We also provide pre-built artifacts with debuginfo for Linux and Mac. +These artifacts are suffixed with `.full.tgz` on Linux and `.full.zip` on Mac and Windows. To upgrade cargo-binstall, use `cargo binstall cargo-binstall`! From d72abde8e92ec3cd51c6ecb71e386fced8563924 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 16 Jan 2023 10:57:53 +1100 Subject: [PATCH 0980/2020] Fixed #704: Fix `get_target_from_rustc` for alpine (#705) On Alpine, rustc returns host triple `x86_64-alpine-linux-musl`, so we have to adopt code from [`convert_custom_linux_target`](https://github.com/crossbeam-rs/crossbeam/blob/5519aeb5c2156c5aff9a88d41dcfbcd838e9a1ea/build-common.rs#L1-L13) to fix this. * Optimize `get_target_from_rustc`: Avoid frequent String allocation caused by `Cursor::new(stdout).lines()` which calls `BufRead::lines` and returns `Lines` iterator, which returns `Item = io::Result`. Signed-off-by: Jiahao XU Signed-off-by: Jiahao XU --- crates/detect-targets/src/detect.rs | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/crates/detect-targets/src/detect.rs b/crates/detect-targets/src/detect.rs index 0216d4ad..62af9f20 100644 --- a/crates/detect-targets/src/detect.rs +++ b/crates/detect-targets/src/detect.rs @@ -2,7 +2,6 @@ use std::{ borrow::Cow, env, ffi::OsStr, - io::{BufRead, Cursor}, process::{Output, Stdio}, }; @@ -99,10 +98,26 @@ async fn get_target_from_rustc() -> Option { return None; } - Cursor::new(stdout) + let stdout = String::from_utf8_lossy(&stdout); + let target = stdout .lines() - .filter_map(|line| line.ok()) - .find_map(|line| line.strip_prefix("host: ").map(|host| host.to_owned())) - // All valid target triple must be in the form of $arch-$os-$abi. - .filter(|target| target.split('-').count() >= 3) + .find_map(|line| line.strip_prefix("host: "))?; + + // The target triplets have the form of 'arch-vendor-system'. + // + // When building for Linux (e.g. the 'system' part is + // 'linux-something'), replace the vendor with 'unknown' + // so that mapping to rust standard targets happens correctly. + // + // For example, alpine set `rustc` host triple to + // `x86_64-alpine-linux-musl`. + // + // Here we use splitn with n=4 since we just need to check + // the third part to see if it equals to "linux" and verify + // that we have at least three parts. + let mut parts: Vec<&str> = target.splitn(4, '-').collect(); + if *parts.get(2)? == "linux" { + parts[1] = "unknown"; + } + Some(parts.join("-")) } From 8119acfeb01c6c360820333aec2af10988cd831f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 16 Jan 2023 11:23:54 +1100 Subject: [PATCH 0981/2020] release: detect-targets v0.1.5 (#706) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1173149d..cbb4d328 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -606,7 +606,7 @@ checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" [[package]] name = "detect-targets" -version = "0.1.4" +version = "0.1.5" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 6611885d..a5c27ccf 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -25,5 +25,5 @@ toml = "0.5.10" url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.4", path = "../detect-targets" } +detect-targets = { version = "0.1.5", path = "../detect-targets" } tempfile = "3.3.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 898e8ef1..71f5d9da 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -17,7 +17,7 @@ cargo_toml = "0.14.0" command-group = { version = "2.0.1", features = ["with-tokio"] } compact_str = { version = "0.6.1", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } -detect-targets = { version = "0.1.4", path = "../detect-targets" } +detect-targets = { version = "0.1.5", path = "../detect-targets" } either = "1.8.0" futures-util = { version = "0.3.25", default-features = false, features = ["std"] } home = "0.5.4" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 411a5658..d6cf2f49 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.4" +version = "0.1.5" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From bc6ac734b44a059f58371de8b5e093f6d47d15c1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jan 2023 13:54:52 +1100 Subject: [PATCH 0982/2020] Bump clap from 4.0.32 to 4.1.1 (#710) Bumps [clap](https://github.com/clap-rs/clap) from 4.0.32 to 4.1.1. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.0.32...v4.1.1) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cbb4d328..151d65da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -423,9 +423,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.0.32" +version = "4.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7db700bc935f9e43e88d00b0850dae18a63773cfbec6d8e070fccf7fef89a39" +checksum = "4ec7a4128863c188deefe750ac1d1dfe66c236909f845af04beed823638dc1b2" dependencies = [ "bitflags", "clap_derive", @@ -438,9 +438,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.0.21" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0177313f9f02afc995627906bbd8967e2be069f5261954222dac78290c2b9014" +checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8" dependencies = [ "heck", "proc-macro-error", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 1ef9e387..96442b26 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.7.0" } binstalk-manifests = { path = "../binstalk-manifests", version = "0.2.0" } -clap = { version = "4.0.32", features = ["derive"] } +clap = { version = "4.1.1", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" fs-lock = { version = "0.1.0", path = "../fs-lock" } From 7cd782271e7020bd630fe676e4b968c272d87dfd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 16 Jan 2023 14:26:08 +1100 Subject: [PATCH 0983/2020] Bump async_zip from 0.0.9 to 0.0.10 (#709) * Bump async_zip from 0.0.9 to 0.0.10 Bumps [async_zip](https://github.com/Majored/rs-async-zip) from 0.0.9 to 0.0.10. - [Release notes](https://github.com/Majored/rs-async-zip/releases) - [Commits](https://github.com/Majored/rs-async-zip/compare/v0.0.9...v0.0.10) --- updated-dependencies: - dependency-name: async_zip dependency-type: direct:production update-type: version-update:semver-patch ... * Fix usage of `async_zip::read::stream` APIs Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU --- Cargo.lock | 144 +----------------- crates/binstalk-downloader/Cargo.toml | 2 +- .../src/download/async_extracter.rs | 6 +- .../src/download/zip_extraction.rs | 29 ++-- 4 files changed, 29 insertions(+), 152 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 151d65da..c72de44e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,15 +52,6 @@ dependencies = [ "alloc-no-stdlib", ] -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - [[package]] name = "async-compression" version = "0.3.15" @@ -90,25 +81,15 @@ dependencies = [ "syn", ] -[[package]] -name = "async_io_utilities" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b20cffc5590f4bf33f05f97a3ea587feba9c50d20325b401daa096b92ff7da0" -dependencies = [ - "tokio", -] - [[package]] name = "async_zip" -version = "0.0.9" +version = "0.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a36d43bdefc7215b2b3a97edd03b1553b7969ad76551025eedd3b913c645f6e" +checksum = "b5282f208287c58b7df1f7965531a49192eb4a22558fa1421d26d1a7c6118613" dependencies = [ "async-compression", - "async_io_utilities", - "chrono", "crc32fast", + "pin-project", "thiserror", "tokio", ] @@ -411,14 +392,9 @@ version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" dependencies = [ - "iana-time-zone", - "js-sys", "num-integer", "num-traits", "serde", - "time", - "wasm-bindgen", - "winapi", ] [[package]] @@ -467,16 +443,6 @@ dependencies = [ "cc", ] -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - [[package]] name = "command-group" version = "2.0.1" @@ -554,50 +520,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "cxx" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d1075c37807dcf850c379432f0df05ba52cc30f279c5cfc43cc221ce7f8579" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5044281f61b27bc598f2f6647d480aed48d2bf52d6eb0b627d84c0361b17aa70" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b50bc93ba22c27b0d31128d2d130a0a6b3d267ae27ef7e4fae2167dfe8781c" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e61fda7e62115119469c7b3591fd913ecca96fb766cfd3f2e2502ab7bc87a5" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "data-encoding" version = "2.3.3" @@ -907,7 +829,7 @@ checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", ] [[package]] @@ -1084,30 +1006,6 @@ dependencies = [ "tokio-native-tls", ] -[[package]] -name = "iana-time-zone" -version = "0.1.53" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "winapi", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" -dependencies = [ - "cxx", - "cxx-build", -] - [[package]] name = "idna" version = "0.2.3" @@ -1279,15 +1177,6 @@ dependencies = [ "libc", ] -[[package]] -name = "link-cplusplus" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" -dependencies = [ - "cc", -] - [[package]] name = "linked-hash-map" version = "0.5.6" @@ -1435,7 +1324,7 @@ checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys", ] @@ -2022,12 +1911,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -[[package]] -name = "scratch" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" - [[package]] name = "sct" version = "0.7.0" @@ -2339,17 +2222,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - [[package]] name = "tinytemplate" version = "1.2.1" @@ -2751,12 +2623,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 073907d2..2f6e296b 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.61" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } -async_zip = { version = "0.0.9", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } +async_zip = { version = "0.0.10", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } binstalk-types = { version = "0.2.0", path = "../binstalk-types" } bytes = "1.3.0" bzip2 = "0.4.4" diff --git a/crates/binstalk-downloader/src/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs index 4850771e..6fd8d8a5 100644 --- a/crates/binstalk-downloader/src/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -48,8 +48,10 @@ where let mut zip = ZipFileReader::new(reader); let mut buf = BytesMut::with_capacity(4 * 4096); - while let Some(entry) = zip.entry_reader().await.map_err(ZipError::from_inner)? { - extract_zip_entry(entry, path, &mut buf).await?; + while let Some(mut zip_reader) = zip.next_entry().await.map_err(ZipError::from_inner)? { + extract_zip_entry(&mut zip_reader, path, &mut buf).await?; + + zip = zip_reader.done().await.map_err(ZipError::from_inner)?; } Ok(()) diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index 89e4f2ab..2f13a9e6 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -3,12 +3,15 @@ use std::{ path::{Component, Path, PathBuf}, }; -use async_zip::{read::ZipEntryReader, ZipEntryExt}; +use async_zip::read::{ + seek::ZipEntryReader, + stream::{Reading, ZipFileReader}, +}; use bytes::{Bytes, BytesMut}; use futures_util::future::{try_join, TryFutureExt}; use thiserror::Error as ThisError; use tokio::{ - io::{AsyncRead, AsyncReadExt}, + io::{AsyncRead, AsyncReadExt, Take}, sync::mpsc, }; @@ -34,7 +37,7 @@ impl ZipError { } pub(super) async fn extract_zip_entry( - entry: ZipEntryReader<'_, R>, + zip_reader: &mut ZipFileReader>>, path: &Path, buf: &mut BytesMut, ) -> Result<(), DownloadError> @@ -42,7 +45,7 @@ where R: AsyncRead + Unpin + Send + Sync, { // Sanitize filename - let raw_filename = entry.entry().filename(); + let raw_filename = zip_reader.entry().filename(); let filename = check_filename_and_normalize(raw_filename) .ok_or_else(|| ZipError(ZipErrorInner::InvalidFilePath(raw_filename.into())))?; @@ -56,7 +59,7 @@ where { use std::{fs::Permissions, os::unix::fs::PermissionsExt}; - if let Some(mode) = entry.entry().unix_permissions() { + if let Some(mode) = zip_reader.entry().unix_permissions() { let mode: u16 = mode; perms = Some(Permissions::from_mode(mode as u32)); } @@ -98,7 +101,7 @@ where Ok(()) }) .err_into(), - copy_file_to_mpsc(entry, tx, buf) + copy_file_to_mpsc(zip_reader.reader(), tx, buf) .map_err(ZipError::from_inner) .map_err(DownloadError::from), ) @@ -109,7 +112,7 @@ where } async fn copy_file_to_mpsc( - mut entry: ZipEntryReader<'_, R>, + entry_reader: &mut ZipEntryReader<'_, R>, tx: mpsc::Sender, buf: &mut BytesMut, ) -> Result<(), async_zip::error::ZipError> @@ -118,7 +121,7 @@ where { // Since BytesMut does not have a max cap, if AsyncReadExt::read_buf returns // 0 then it means Eof. - while entry.read_buf(buf).await? != 0 { + while entry_reader.read_buf(buf).await? != 0 { // Ensure AsyncReadExt::read_buf can read at least 4096B to avoid // frequent expensive read syscalls. // @@ -143,11 +146,17 @@ where } } - if entry.compare_crc() { + // With async_zip 0.0.10, ZipEntryReader::compare_crc is removed. + // Hopefully it will restored later. + + /* + if entry_reader.compare_crc() { Ok(()) } else { Err(async_zip::error::ZipError::CRC32CheckError) - } + }*/ + + Ok(()) } /// Ensure the file path is safe to use as a [`Path`]. From 97a1ce82ebf6c0c9e7fd81c0fa9780edd71195be Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 16 Jan 2023 15:00:21 +1100 Subject: [PATCH 0984/2020] release: binstalk-downloader v0.3.1 (#711) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c72de44e..1fff909d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -176,7 +176,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.3.0" +version = "0.3.1" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 2f6e296b..4b23c175 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.3.0" +version = "0.3.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 71f5d9da..8db622b4 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.61" -binstalk-downloader = { version = "0.3.0", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.3.1", path = "../binstalk-downloader" } binstalk-types = { version = "0.2.0", path = "../binstalk-types" } cargo_toml = "0.14.0" command-group = { version = "2.0.1", features = ["with-tokio"] } From c2b1c243eafc4a2d1a599e3c6f6f08f55421dfc6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 16 Jan 2023 15:39:07 +1100 Subject: [PATCH 0985/2020] release: cargo-binstall v0.19.2 (#707) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1fff909d..a08b595d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -327,7 +327,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.19.1" +version = "0.19.2" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 96442b26..875bd6fa 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.19.1" +version = "0.19.2" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index d0d6bbfa..71098481 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From c1332c0d2dfd5d2145ed2398ece14d78e800da28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Tue, 17 Jan 2023 13:08:25 +1300 Subject: [PATCH 0986/2020] Revert "Bump async_zip from 0.0.9 to 0.0.10" (#714) --- Cargo.lock | 146 +++++++++++++++++- crates/binstalk-downloader/Cargo.toml | 2 +- .../src/download/async_extracter.rs | 6 +- .../src/download/zip_extraction.rs | 29 ++-- 4 files changed, 153 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a08b595d..99695ee6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,6 +52,15 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "async-compression" version = "0.3.15" @@ -82,14 +91,24 @@ dependencies = [ ] [[package]] -name = "async_zip" -version = "0.0.10" +name = "async_io_utilities" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5282f208287c58b7df1f7965531a49192eb4a22558fa1421d26d1a7c6118613" +checksum = "9b20cffc5590f4bf33f05f97a3ea587feba9c50d20325b401daa096b92ff7da0" +dependencies = [ + "tokio", +] + +[[package]] +name = "async_zip" +version = "0.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a36d43bdefc7215b2b3a97edd03b1553b7969ad76551025eedd3b913c645f6e" dependencies = [ "async-compression", + "async_io_utilities", + "chrono", "crc32fast", - "pin-project", "thiserror", "tokio", ] @@ -392,9 +411,14 @@ version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" dependencies = [ + "iana-time-zone", + "js-sys", "num-integer", "num-traits", "serde", + "time", + "wasm-bindgen", + "winapi", ] [[package]] @@ -443,6 +467,16 @@ dependencies = [ "cc", ] +[[package]] +name = "codespan-reporting" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" +dependencies = [ + "termcolor", + "unicode-width", +] + [[package]] name = "command-group" version = "2.0.1" @@ -520,6 +554,50 @@ dependencies = [ "typenum", ] +[[package]] +name = "cxx" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d1075c37807dcf850c379432f0df05ba52cc30f279c5cfc43cc221ce7f8579" +dependencies = [ + "cc", + "cxxbridge-flags", + "cxxbridge-macro", + "link-cplusplus", +] + +[[package]] +name = "cxx-build" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5044281f61b27bc598f2f6647d480aed48d2bf52d6eb0b627d84c0361b17aa70" +dependencies = [ + "cc", + "codespan-reporting", + "once_cell", + "proc-macro2", + "quote", + "scratch", + "syn", +] + +[[package]] +name = "cxxbridge-flags" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61b50bc93ba22c27b0d31128d2d130a0a6b3d267ae27ef7e4fae2167dfe8781c" + +[[package]] +name = "cxxbridge-macro" +version = "1.0.86" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e61fda7e62115119469c7b3591fd913ecca96fb766cfd3f2e2502ab7bc87a5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "data-encoding" version = "2.3.3" @@ -829,7 +907,7 @@ checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", ] [[package]] @@ -1006,6 +1084,30 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "iana-time-zone" +version = "0.1.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "winapi", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" +dependencies = [ + "cxx", + "cxx-build", +] + [[package]] name = "idna" version = "0.2.3" @@ -1177,6 +1279,15 @@ dependencies = [ "libc", ] +[[package]] +name = "link-cplusplus" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" +dependencies = [ + "cc", +] + [[package]] name = "linked-hash-map" version = "0.5.6" @@ -1324,7 +1435,7 @@ checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" dependencies = [ "libc", "log", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys", ] @@ -1911,6 +2022,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "scratch" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" + [[package]] name = "sct" version = "0.7.0" @@ -2222,6 +2339,17 @@ dependencies = [ "once_cell", ] +[[package]] +name = "time" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" +dependencies = [ + "libc", + "wasi 0.10.0+wasi-snapshot-preview1", + "winapi", +] + [[package]] name = "tinytemplate" version = "1.2.1" @@ -2623,6 +2751,12 @@ dependencies = [ "try-lock", ] +[[package]] +name = "wasi" +version = "0.10.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" + [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 4b23c175..acf9d0e1 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.61" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } -async_zip = { version = "0.0.10", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } +async_zip = { version = "0.0.9", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } binstalk-types = { version = "0.2.0", path = "../binstalk-types" } bytes = "1.3.0" bzip2 = "0.4.4" diff --git a/crates/binstalk-downloader/src/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs index 6fd8d8a5..4850771e 100644 --- a/crates/binstalk-downloader/src/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -48,10 +48,8 @@ where let mut zip = ZipFileReader::new(reader); let mut buf = BytesMut::with_capacity(4 * 4096); - while let Some(mut zip_reader) = zip.next_entry().await.map_err(ZipError::from_inner)? { - extract_zip_entry(&mut zip_reader, path, &mut buf).await?; - - zip = zip_reader.done().await.map_err(ZipError::from_inner)?; + while let Some(entry) = zip.entry_reader().await.map_err(ZipError::from_inner)? { + extract_zip_entry(entry, path, &mut buf).await?; } Ok(()) diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index 2f13a9e6..89e4f2ab 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -3,15 +3,12 @@ use std::{ path::{Component, Path, PathBuf}, }; -use async_zip::read::{ - seek::ZipEntryReader, - stream::{Reading, ZipFileReader}, -}; +use async_zip::{read::ZipEntryReader, ZipEntryExt}; use bytes::{Bytes, BytesMut}; use futures_util::future::{try_join, TryFutureExt}; use thiserror::Error as ThisError; use tokio::{ - io::{AsyncRead, AsyncReadExt, Take}, + io::{AsyncRead, AsyncReadExt}, sync::mpsc, }; @@ -37,7 +34,7 @@ impl ZipError { } pub(super) async fn extract_zip_entry( - zip_reader: &mut ZipFileReader>>, + entry: ZipEntryReader<'_, R>, path: &Path, buf: &mut BytesMut, ) -> Result<(), DownloadError> @@ -45,7 +42,7 @@ where R: AsyncRead + Unpin + Send + Sync, { // Sanitize filename - let raw_filename = zip_reader.entry().filename(); + let raw_filename = entry.entry().filename(); let filename = check_filename_and_normalize(raw_filename) .ok_or_else(|| ZipError(ZipErrorInner::InvalidFilePath(raw_filename.into())))?; @@ -59,7 +56,7 @@ where { use std::{fs::Permissions, os::unix::fs::PermissionsExt}; - if let Some(mode) = zip_reader.entry().unix_permissions() { + if let Some(mode) = entry.entry().unix_permissions() { let mode: u16 = mode; perms = Some(Permissions::from_mode(mode as u32)); } @@ -101,7 +98,7 @@ where Ok(()) }) .err_into(), - copy_file_to_mpsc(zip_reader.reader(), tx, buf) + copy_file_to_mpsc(entry, tx, buf) .map_err(ZipError::from_inner) .map_err(DownloadError::from), ) @@ -112,7 +109,7 @@ where } async fn copy_file_to_mpsc( - entry_reader: &mut ZipEntryReader<'_, R>, + mut entry: ZipEntryReader<'_, R>, tx: mpsc::Sender, buf: &mut BytesMut, ) -> Result<(), async_zip::error::ZipError> @@ -121,7 +118,7 @@ where { // Since BytesMut does not have a max cap, if AsyncReadExt::read_buf returns // 0 then it means Eof. - while entry_reader.read_buf(buf).await? != 0 { + while entry.read_buf(buf).await? != 0 { // Ensure AsyncReadExt::read_buf can read at least 4096B to avoid // frequent expensive read syscalls. // @@ -146,17 +143,11 @@ where } } - // With async_zip 0.0.10, ZipEntryReader::compare_crc is removed. - // Hopefully it will restored later. - - /* - if entry_reader.compare_crc() { + if entry.compare_crc() { Ok(()) } else { Err(async_zip::error::ZipError::CRC32CheckError) - }*/ - - Ok(()) + } } /// Ensure the file path is safe to use as a [`Path`]. From a60ae7ef6c8b4dc1369a9763f96336aacd57f86f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 17 Jan 2023 14:42:26 +1300 Subject: [PATCH 0987/2020] release: binstalk-downloader v0.3.2 (#715) Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 99695ee6..b07434ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -195,7 +195,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.3.1" +version = "0.3.2" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index acf9d0e1..cac2dee8 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.3.1" +version = "0.3.2" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 8db622b4..0e22f854 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.61" -binstalk-downloader = { version = "0.3.1", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.3.2", path = "../binstalk-downloader" } binstalk-types = { version = "0.2.0", path = "../binstalk-types" } cargo_toml = "0.14.0" command-group = { version = "2.0.1", features = ["with-tokio"] } From ab4da7f0596a7878c6c773554700a8b2aa441231 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 17 Jan 2023 18:05:07 +1100 Subject: [PATCH 0988/2020] Fix self-update on windows (#712) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed #702 * Add new dep windows v0.44.0 for windows only * Add regression test for #702 * Impl `win::replace_file` * Use `ReplaceFileW` on windows if `fs::rename` in `fs::atomic_install` fails * Improve logging and err messages * Add more regression tests * Make `BinFile::install_link` atomic: Do not remove file if dst exists * Fallback to `ReplaceFileW` in `fs::atomic_symlink_file` * Refactor: Extract new fn `fs::persist` * Use `fs::persist` instead of `TempFile::persist` in `fs::atomic_install`, which fallbacks to `ReplaceFileW` on windows Signed-off-by: Jiahao XU Co-authored-by: Félix Saparelli --- Cargo.lock | 55 ++++++++++++----- crates/binstalk/Cargo.toml | 3 + crates/binstalk/src/bins.rs | 7 --- crates/binstalk/src/fs.rs | 91 +++++++++++++++++++++++----- e2e-tests/self-upgrade-no-symlink.sh | 32 ++++++++++ justfile | 3 +- 6 files changed, 153 insertions(+), 38 deletions(-) create mode 100644 e2e-tests/self-upgrade-no-symlink.sh diff --git a/Cargo.lock b/Cargo.lock index b07434ef..1c569995 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -190,6 +190,7 @@ dependencies = [ "tokio", "tracing", "url", + "windows", "xz2", ] @@ -2895,6 +2896,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-sys" version = "0.42.0" @@ -2911,46 +2921,61 @@ dependencies = [ ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.0" +name = "windows-targets" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41d2aa71f6f0cbe00ae5167d90ef3cfe66527d6f613ca78ac8024c3ccab9a19e" +checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" [[package]] name = "windows_aarch64_msvc" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0f252f5a35cac83d6311b2e795981f5ee6e67eb1f9a7f64eb4500fbc4dcdb4" +checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" [[package]] name = "windows_i686_gnu" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbeae19f6716841636c28d695375df17562ca208b2b7d0dc47635a50ae6c5de7" +checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" [[package]] name = "windows_i686_msvc" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84c12f65daa39dd2babe6e442988fc329d6243fdce47d7d2d155b8d874862246" +checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" [[package]] name = "windows_x86_64_gnu" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf7b1b21b5362cbc318f686150e5bcea75ecedc74dd157d874d754a2ca44b0ed" +checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d525d2ba30eeb3297665bd434a54297e4170c7f1a44cad4ef58095b4cd2028" +checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" [[package]] name = "windows_x86_64_msvc" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40009d85759725a34da6d89a94e63d7bdc50a862acf0dbc7c8e488f1edcb6f5" +checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" [[package]] name = "winreg" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 0e22f854..c1d9b7ed 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -39,6 +39,9 @@ tracing = "0.1.37" url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" +[target.'cfg(target_os = "windows")'.dependencies] +windows = { version = "0.44.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } + [features] default = ["static", "rustls"] diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 8349337e..38c42fef 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -186,13 +186,6 @@ impl BinFile { pub fn install_link(&self) -> Result<(), BinstallError> { if let Some(link) = &self.link { - // Remove existing symlink - // TODO: check if existing symlink is correct - if link.exists() { - debug!("Remove link '{}'", link.display()); - std::fs::remove_file(link)?; - } - let dest = self.link_dest(); debug!( "Create link '{}' pointing to '{}'", diff --git a/crates/binstalk/src/fs.rs b/crates/binstalk/src/fs.rs index 270f6872..8b4c63e5 100644 --- a/crates/binstalk/src/fs.rs +++ b/crates/binstalk/src/fs.rs @@ -1,7 +1,7 @@ use std::{fs, io, path::Path}; -use tempfile::NamedTempFile; -use tracing::debug; +use tempfile::{NamedTempFile, TempPath}; +use tracing::{debug, warn}; /// Atomically install a file. /// @@ -14,7 +14,21 @@ pub fn atomic_install(src: &Path, dst: &Path) -> io::Result<()> { ); if let Err(err) = fs::rename(src, dst) { - debug!("Attempting at atomic rename failed: {err:#?}, fallback to creating tempfile."); + warn!("Attempting at atomic rename failed: {err:#?}, fallback to other methods."); + + #[cfg(target_os = "windows")] + { + match win::replace_file(src, dst) { + Ok(()) => { + debug!("ReplaceFileW succeeded.",); + return Ok(()); + } + Err(err) => { + warn!("ReplaceFileW failed: {err}, fallback to using tempfile plus rename",); + } + } + } + // src and dst is not on the same filesystem/mountpoint. // Fallback to creating NamedTempFile on the parent dir of // dst. @@ -41,12 +55,7 @@ pub fn atomic_install(src: &Path, dst: &Path) -> io::Result<()> { ); tempfile.as_file().set_permissions(permissions)?; - debug!( - "Persisting '{}' to '{}'", - tempfile.path().display(), - dst.display() - ); - tempfile.persist(dst).map_err(io::Error::from)?; + persist(tempfile.into_temp_path(), dst)?; } else { debug!("Attempting at atomically succeeded."); } @@ -80,10 +89,62 @@ pub fn atomic_symlink_file(dest: &Path, link: &Path) -> io::Result<()> { ); symlink_file(dest, &temp_path)?; - debug!( - "Persisting '{}' to '{}'", - temp_path.display(), - link.display() - ); - temp_path.persist(link).map_err(io::Error::from) + persist(temp_path, link) +} + +fn persist(temp_path: TempPath, to: &Path) -> io::Result<()> { + debug!("Persisting '{}' to '{}'", temp_path.display(), to.display()); + match temp_path.persist(to) { + Ok(()) => Ok(()), + #[cfg(target_os = "windows")] + Err(tempfile::PathPersistError { + error, + path: temp_path, + }) => { + warn!( + "Failed to persist symlink '{}' to '{}': {error}, fallback to ReplaceFileW", + temp_path.display(), + to.display(), + ); + win::replace_file(&temp_path, to).map_err(io::Error::from) + } + #[cfg(not(target_os = "windows"))] + Err(err) => Err(err.into()), + } +} + +#[cfg(target_os = "windows")] +mod win { + use std::{os::windows::ffi::OsStrExt, path::Path}; + + use windows::{ + core::{Error, PCWSTR}, + Win32::Storage::FileSystem::{ReplaceFileW, REPLACE_FILE_FLAGS}, + }; + + pub(super) fn replace_file(src: &Path, dst: &Path) -> Result<(), Error> { + let mut src: Vec<_> = src.as_os_str().encode_wide().collect(); + let mut dst: Vec<_> = dst.as_os_str().encode_wide().collect(); + + // Ensure it is terminated with 0 + src.push(0); + dst.push(0); + + // SAFETY: We use it according its doc + // https://learn.microsoft.com/en-nz/windows/win32/api/winbase/nf-winbase-replacefilew + // + // NOTE that this function is available since windows XP, so we don't need to + // lazily load this function. + unsafe { + ReplaceFileW( + PCWSTR::from_raw(dst.as_ptr()), // lpreplacedfilename + PCWSTR::from_raw(src.as_ptr()), // lpreplacementfilename + PCWSTR::null(), // lpbackupfilename, null for no backup file + REPLACE_FILE_FLAGS(0), // dwreplaceflags + None, // lpexclude, unused + None, // lpreserved, unused + ) + } + .ok() + } } diff --git a/e2e-tests/self-upgrade-no-symlink.sh b/e2e-tests/self-upgrade-no-symlink.sh new file mode 100644 index 00000000..66c61ee8 --- /dev/null +++ b/e2e-tests/self-upgrade-no-symlink.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +set -euxo pipefail + +unset CARGO_INSTALL_ROOT + +export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export PATH="$CARGO_HOME/bin:$PATH" + +# first boostrap-install into the CARGO_HOME +mkdir -p "$CARGO_HOME/bin" +cp "./$1" "$CARGO_HOME/bin" + +# now we're running the CARGO_HOME/bin/cargo-binstall (via cargo): + +# self update replacing no-symlinks with no-symlinks +cargo binstall --no-confirm --no-symlinks --force cargo-binstall + +# self update replacing no-symlinks with symlinks +cp "./$1" "$CARGO_HOME/bin" + +cargo binstall --no-confirm --force cargo-binstall + +# self update replacing symlinks with symlinks +ln -snf "$(pwd)/cargo-binstall" "$CARGO_HOME/bin/cargo-binstall" + +cargo binstall --no-confirm --force cargo-binstall + +# self update replacing symlinks with no-symlinks +ln -snf "$(pwd)/cargo-binstall" "$CARGO_HOME/bin/cargo-binstall" + +cargo binstall --no-confirm --force --no-symlinks cargo-binstall diff --git a/justfile b/justfile index aa3f6616..d0d45577 100644 --- a/justfile +++ b/justfile @@ -133,6 +133,7 @@ e2e-test-other-repos: (e2e-test "other-repos") e2e-test-strategies: (e2e-test "strategies") e2e-test-version-syntax: (e2e-test "version-syntax") e2e-test-upgrade: (e2e-test "upgrade") +e2e-test-self-upgrade-no-symlink: (e2e-test "self-upgrade-no-symlink") # WinTLS (Windows in CI) does not have TLS 1.3 support [windows] @@ -141,7 +142,7 @@ e2e-test-tls: (e2e-test "tls" "1.2") [macos] e2e-test-tls: (e2e-test "tls" "1.2") (e2e-test "tls" "1.3") -e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls +e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink unit-tests: {{cargo-bin}} test {{cargo-build-args}} From 42b858927b208a18077b015ad87a3c0bcc111bb0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 17 Jan 2023 19:36:35 +1100 Subject: [PATCH 0989/2020] release: binstalk v0.7.1 (#720) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1c569995..1ab45bbb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -162,7 +162,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.7.0" +version = "0.7.1" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 875bd6fa..e832440c 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.7.0" } +binstalk = { path = "../binstalk", version = "0.7.1" } binstalk-manifests = { path = "../binstalk-manifests", version = "0.2.0" } clap = { version = "4.1.1", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index c1d9b7ed..8316e2d6 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.7.0" +version = "0.7.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From a70589a47cf875c6e81d385fcd9113752198d8c9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 17 Jan 2023 21:42:37 +1100 Subject: [PATCH 0990/2020] Update transitive dependencies (#717) Signed-off-by: Jiahao XU --- Cargo.lock | 62 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1ab45bbb..2080899e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -151,6 +151,12 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + [[package]] name = "beef" version = "0.5.2" @@ -298,9 +304,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.3.2" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ad2d4653bf5ca36ae797b1f4bb4dbddb60ce49ca4aed8a2ce4829f60425b80" +checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -452,9 +458,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d4198f73e42b4936b35b5bb248d81d2b595ecb170da0bac7655c54eedfa8da8" +checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade" dependencies = [ "os_str_bytes", ] @@ -1157,9 +1163,9 @@ checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" [[package]] name = "io-lifetimes" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46112a93252b123d31a119a8d1a1ac19deac4fac6e0e8b0df58f0d4e5870e63c" +checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e" dependencies = [ "libc", "windows-sys", @@ -1190,7 +1196,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" dependencies = [ "hermit-abi 0.2.6", - "io-lifetimes 1.0.3", + "io-lifetimes 1.0.4", "rustix 0.36.6", "windows-sys", ] @@ -1515,9 +1521,9 @@ dependencies = [ [[package]] name = "object" -version = "0.30.1" +version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d864c91689fdc196779b98dba0aceac6118594c2df6ee5d943eb6a8df4d107a" +checksum = "2b8c786513eb403643f2a88c244c2aaa270ef2153f55094587d0c48a3cf22a83" dependencies = [ "memchr", ] @@ -1603,9 +1609,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.5" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff9f3fef3968a3ec5945535ed654cb38ff72d7495a25619e2247fb15a2ed9ba" +checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" dependencies = [ "cfg-if", "libc", @@ -1690,9 +1696,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.49" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" +checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" dependencies = [ "unicode-ident", ] @@ -1848,7 +1854,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" dependencies = [ "async-compression", - "base64", + "base64 0.13.1", "bytes", "encoding_rs", "futures-core", @@ -1868,7 +1874,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls", - "rustls-pemfile 1.0.1", + "rustls-pemfile 1.0.2", "serde", "serde_json", "serde_urlencoded", @@ -1948,7 +1954,7 @@ checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549" dependencies = [ "bitflags", "errno", - "io-lifetimes 1.0.3", + "io-lifetimes 1.0.4", "libc", "linux-raw-sys 0.1.4", "windows-sys", @@ -1956,9 +1962,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.7" +version = "0.20.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "539a2bfe908f471bfa933876bd1eb6a19cf2176d375f82ef7f99530a40e48c2c" +checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", @@ -1973,7 +1979,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.1", + "rustls-pemfile 1.0.2", "schannel", "security-framework", ] @@ -1984,16 +1990,16 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" dependencies = [ - "base64", + "base64 0.13.1", ] [[package]] name = "rustls-pemfile" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0864aeff53f8c05aa08d86e5ef839d3dfcf07aeba2db32f12db0ef716e87bd55" +checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "base64", + "base64 0.21.0", ] [[package]] @@ -2283,9 +2289,9 @@ dependencies = [ [[package]] name = "termcolor" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bab24d30b911b2376f3a13cc2cd443142f0c81dda04c118693e35b3835757755" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" dependencies = [ "winapi-util", ] @@ -2600,7 +2606,7 @@ dependencies = [ "rand", "ring", "rustls", - "rustls-pemfile 1.0.1", + "rustls-pemfile 1.0.2", "smallvec", "thiserror", "tinyvec", @@ -3044,9 +3050,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.4+zstd.1.5.2" +version = "2.0.5+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fa202f2ef00074143e219d15b62ffc317d17cc33909feac471c044087cad7b0" +checksum = "edc50ffce891ad571e9f9afe5039c4837bede781ac4bb13052ed7ae695518596" dependencies = [ "cc", "libc", From 18cc65171348829fbb4e639731c603633a225000 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 17 Jan 2023 21:57:18 +1100 Subject: [PATCH 0991/2020] Enable `mir-opt-level=4` for release (#718) Signed-off-by: Jiahao XU --- justfile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/justfile b/justfile index d0d45577..b54bbbde 100644 --- a/justfile +++ b/justfile @@ -77,9 +77,7 @@ cargo-split-debuginfo := if cargo-buildstd != "" { " --config='profile.release.s win-arm64-ring16 := if target == "aarch64-pc-windows-msvc" { " --config='patch.crates-io.ring.git=\"https://github.com/awakecoding/ring\"' --config='patch.crates-io.ring.branch=\"0.16.20_alpha\"'" } else { "" } # MIR optimisation level (defaults to 2, bring it up to 4 for release builds) -# disabled for now, as it ICEs -# https://github.com/rust-lang/rust/issues/106141 -rustc-miropt := "" #if for-release != "" { " -Z mir-opt-level=4" } else { "" } +rustc-miropt := if for-release != "" { " -Z mir-opt-level=4" } else { "" } # ICF: link-time identical code folding # disabled for now, as it requires the gold linker From ba91777faf3f995a70d8dd2fb20ef5c2ceb0df96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Wed, 18 Jan 2023 00:22:49 +1300 Subject: [PATCH 0992/2020] Fix name of release (#723) --- .github/workflows/release-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index add62091..fa26c58e 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -101,6 +101,7 @@ jobs: with: repo_token: ${{ secrets.GITHUB_TOKEN }} tag: v${{ fromJSON(inputs.publish).version }} + release_name: v${{ fromJSON(inputs.publish).version }} body: ${{ fromJSON(inputs.publish).notes }} file: packages/cargo-binstall-universal-* file_glob: true From 46a035699ea41ffd21fce678c5bb4ac501095f8c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 17 Jan 2023 22:47:38 +1100 Subject: [PATCH 0993/2020] release: cargo-binstall v0.19.3 (#721) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2080899e..bdd2ac3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -353,7 +353,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.19.2" +version = "0.19.3" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index e832440c..25f9907b 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.19.2" +version = "0.19.3" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 71098481..f7a36d4f 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 939f17dcd0842be535599cf860bd0d70ca006036 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Wed, 18 Jan 2023 03:13:49 +1300 Subject: [PATCH 0994/2020] Fix "Tests pass" step (#726) --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ec09a8e6..a986ca37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,9 +112,12 @@ jobs: - linux-cross-check - apple-m1-check - lint + if: always() # always run even if dependencies fail runs-on: ubuntu-latest steps: - - run: echo "Tests pass" + # fail if ANY dependency has failed or been skipped or cancelled + - if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled')" + run: exit 1 # if everything succeeds and PR is ready for review, test the release/package process release-builds: From 493d2778fe85445a1b3e7c6273133dbf7220ec35 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 18 Jan 2023 01:23:26 +0000 Subject: [PATCH 0995/2020] Bump tokio from 1.24.1 to 1.24.2 (#727) Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.24.1 to 1.24.2. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/commits) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bdd2ac3f..493e4d9b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2384,9 +2384,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.24.1" +version = "1.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d9f76183f91ecfb55e1d7d5602bd1d979e38a3a522fe900241cf195624d67ae" +checksum = "597a12a59981d9e3c38d216785b0c37399f6e415e8d0712047620f189371b0bb" dependencies = [ "autocfg", "bytes", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 25f9907b..1873c3cf 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -37,7 +37,7 @@ strum = "0.24.1" strum_macros = "0.24.3" supports-color = "2.0.0" tempfile = "3.3.0" -tokio = { version = "1.24.1", features = ["rt-multi-thread"], default-features = false } +tokio = { version = "1.24.2", features = ["rt-multi-thread"], default-features = false } tracing-core = "0.1.30" tracing = { version = "0.1.37", default-features = false } tracing-log = { version = "0.1.3", default-features = false } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index cac2dee8..cad779c5 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -29,7 +29,7 @@ reqwest = { version = "0.11.13", features = ["stream", "gzip", "brotli", "deflat tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.3.0" thiserror = "1.0.38" -tokio = { version = "1.24.1", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } +tokio = { version = "1.24.2", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.4", features = ["io"] } tower = { version = "0.4.13", features = ["limit", "util"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 8316e2d6..90b80bf4 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -34,7 +34,7 @@ tempfile = "3.3.0" thiserror = "1.0.38" tinytemplate = "1.2.1" # parking_lot for `tokio::sync::OnceCell::const_new` -tokio = { version = "1.24.1", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } +tokio = { version = "1.24.2", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } tracing = "0.1.37" url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index d6cf2f49..131becc0 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -10,9 +10,9 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -tokio = { version = "1.24.1", features = ["rt", "process", "sync"], default-features = false } +tokio = { version = "1.24.2", features = ["rt", "process", "sync"], default-features = false } cfg-if = "1.0.0" guess_host_triple = "0.1.3" [dev-dependencies] -tokio = { version = "1.24.1", features = ["macros"], default-features = false } +tokio = { version = "1.24.2", features = ["macros"], default-features = false } From 7857856f78efa46e2ebfaab28451e171d6e4c54d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 20 Jan 2023 01:28:21 +0000 Subject: [PATCH 0996/2020] Bump reqwest from 0.11.13 to 0.11.14 (#732) Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.13 to 0.11.14. - [Release notes](https://github.com/seanmonstar/reqwest/releases) - [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md) - [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.13...v0.11.14) --- updated-dependencies: - dependency-name: reqwest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 20 +++++++++++++++++--- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 493e4d9b..7e7aff92 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1849,12 +1849,12 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.11.13" +version = "0.11.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68cc60575865c7831548863cc02356512e3f1dc2f3f82cb837d7fc4cc8f3c97c" +checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" dependencies = [ "async-compression", - "base64 0.13.1", + "base64 0.21.0", "bytes", "encoding_rs", "futures-core", @@ -1887,6 +1887,7 @@ dependencies = [ "url", "wasm-bindgen", "wasm-bindgen-futures", + "wasm-streams", "web-sys", "webpki-roots", "winreg", @@ -2836,6 +2837,19 @@ version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +[[package]] +name = "wasm-streams" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078" +dependencies = [ + "futures-util", + "js-sys", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", +] + [[package]] name = "web-sys" version = "0.3.60" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index cad779c5..26899835 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -21,7 +21,7 @@ flate2 = { version = "1.0.25", default-features = false } futures-util = { version = "0.3.25", default-features = false, features = ["std"] } generic-array = "0.14.6" httpdate = "1.0.2" -reqwest = { version = "0.11.13", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } +reqwest = { version = "0.11.14", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. # From 5bd6a50d7088ea51567ff7e3733a79c6e86362c9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 15:37:35 +1100 Subject: [PATCH 0997/2020] Bump async-trait from 0.1.61 to 0.1.63 (#733) Bumps [async-trait](https://github.com/dtolnay/async-trait) from 0.1.61 to 0.1.63. - [Release notes](https://github.com/dtolnay/async-trait/releases) - [Commits](https://github.com/dtolnay/async-trait/compare/0.1.61...0.1.63) --- updated-dependencies: - dependency-name: async-trait dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7e7aff92..cfc3ba3b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -81,9 +81,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.61" +version = "0.1.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705339e0e4a9690e2908d2b3d049d85682cf19fbd5782494498fbf7003a6a282" +checksum = "eff18d764974428cf3a9328e23fc5c986f5fbed46e6cd4cdf42544df5d297ec1" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 26899835..e9aeca10 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0" [dependencies] -async-trait = "0.1.61" +async-trait = "0.1.63" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.9", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } binstalk-types = { version = "0.2.0", path = "../binstalk-types" } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 90b80bf4..e4fb094d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0" [dependencies] -async-trait = "0.1.61" +async-trait = "0.1.63" binstalk-downloader = { version = "0.3.2", path = "../binstalk-downloader" } binstalk-types = { version = "0.2.0", path = "../binstalk-types" } cargo_toml = "0.14.0" From e22d319825743cc64477c24925fd1b1c10cc1702 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Jan 2023 04:50:58 +0000 Subject: [PATCH 0998/2020] Bump toml from 0.5.10 to 0.5.11 (#734) Bumps [toml](https://github.com/toml-rs/toml) from 0.5.10 to 0.5.11. - [Release notes](https://github.com/toml-rs/toml/releases) - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.5.10...toml-v0.5.11) --- updated-dependencies: - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-manifests/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cfc3ba3b..a3ff78e1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2477,9 +2477,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1333c76748e868a4d9d1017b5ab53171dfd095f70c712fdb4653a406547f598f" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" dependencies = [ "serde", ] diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index a5c27ccf..b0a1dbfb 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.152", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.91" thiserror = "1.0.38" -toml = "0.5.10" +toml = "0.5.11" url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] From 9a2b4c9ab1b076ae92f01d3d7435c5b23ffa5e84 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Jan 2023 12:56:44 +1100 Subject: [PATCH 0999/2020] Bump clap from 4.1.1 to 4.1.3 (#735) Bumps [clap](https://github.com/clap-rs/clap) from 4.1.1 to 4.1.3. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/clap_complete-v4.1.1...v4.1.3) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a3ff78e1..0c7ede49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -430,9 +430,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.1.1" +version = "4.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec7a4128863c188deefe750ac1d1dfe66c236909f845af04beed823638dc1b2" +checksum = "d8d93d855ce6a0aa87b8473ef9169482f40abaa2e9e0993024c35c902cbd5920" dependencies = [ "bitflags", "clap_derive", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 1873c3cf..55cbae29 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.7.1" } binstalk-manifests = { path = "../binstalk-manifests", version = "0.2.0" } -clap = { version = "4.1.1", features = ["derive"] } +clap = { version = "4.1.3", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" fs-lock = { version = "0.1.0", path = "../fs-lock" } From 425c6c2509237d17c4afc28788d23139ac9aec11 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Jan 2023 02:51:29 +0000 Subject: [PATCH 1000/2020] Bump toml from 0.5.11 to 0.6.0 (#736) * Bump toml from 0.5.11 to 0.6.0 Bumps [toml](https://github.com/toml-rs/toml) from 0.5.11 to 0.6.0. - [Release notes](https://github.com/toml-rs/toml/releases) - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.5.11...toml-v0.6.0) --- updated-dependencies: - dependency-name: toml dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Fix use of `toml` v0.6 * Optimize `CratesTomlParseError`: Box variant `TomlParse` Since now `toml::de::Error` is a wrapper of `toml_edit::TomlError`, which is at least 3 * `size_of::>()`. Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU --- Cargo.lock | 58 ++++++++++++++++++- crates/binstalk-manifests/Cargo.toml | 2 +- .../binstalk-manifests/src/cargo_crates_v1.rs | 16 ++++- 3 files changed, 69 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c7ede49..a2e25333 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -247,7 +247,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror", - "toml", + "toml 0.6.0", "url", ] @@ -385,7 +385,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f1204fe51a1e56042b8ec31d6407547ecd18f596b66f470dadb9abd9be9c843" dependencies = [ "serde", - "toml", + "toml 0.5.11", ] [[package]] @@ -671,7 +671,7 @@ checksum = "e62abb876c07e4754fae5c14cafa77937841f01740637e17d78dc04352f32a5e" dependencies = [ "cc", "rustc_version", - "toml", + "toml 0.5.11", "vswhom", "winreg", ] @@ -1476,6 +1476,15 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "nom8" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8" +dependencies = [ + "memchr", +] + [[package]] name = "normalize-path" version = "0.2.0" @@ -2127,6 +2136,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c68e921cef53841b8925c2abadd27c9b891d9613bdc43d6b823062866df38e8" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -2484,6 +2502,40 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb9d890e4dc9298b70f740f615f2e05b9db37dce531f6b24fb77ac993f9f217" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + +[[package]] +name = "toml_datetime" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4553f467ac8e3d374bc9a177a26801e5d0f9b211aa1673fb137a403afd1c9cf5" +dependencies = [ + "serde", +] + +[[package]] +name = "toml_edit" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "729bfd096e40da9c001f778f5cdecbd2957929a24e10e5883d9392220a751581" +dependencies = [ + "indexmap", + "nom8", + "serde", + "serde_spanned", + "toml_datetime", +] + [[package]] name = "tower" version = "0.4.13" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index b0a1dbfb..d424655d 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.152", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.91" thiserror = "1.0.38" -toml = "0.5.11" +toml = "0.6.0" url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] diff --git a/crates/binstalk-manifests/src/cargo_crates_v1.rs b/crates/binstalk-manifests/src/cargo_crates_v1.rs index 27a7fbe1..42a58a7c 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1.rs @@ -13,6 +13,7 @@ use std::{ io::{self, Seek}, iter::IntoIterator, path::{Path, PathBuf}, + str::{self, Utf8Error}, }; use beef::Cow; @@ -54,7 +55,7 @@ impl CratesToml<'_> { if vec.is_empty() { Ok(CratesToml::default()) } else { - toml::from_slice(&vec).map_err(CratesTomlParseError::from) + toml::from_str(str::from_utf8(&vec)?).map_err(CratesTomlParseError::from) } } @@ -89,7 +90,7 @@ impl CratesToml<'_> { this: &CratesToml<'_>, writer: &mut dyn io::Write, ) -> Result<(), CratesTomlParseError> { - let data = toml::to_vec(&this)?; + let data = toml::to_string(&this)?.into_bytes(); writer.write_all(&data)?; Ok(()) } @@ -184,8 +185,11 @@ pub enum CratesTomlParseError { #[error(transparent)] Io(#[from] io::Error), + #[error("Failed to parse toml: File is not in valid utf-8 encodings: {0}")] + TomlParseNonUtf8(#[from] Utf8Error), + #[error(transparent)] - TomlParse(#[from] toml::de::Error), + TomlParse(Box), #[error(transparent)] TomlWrite(Box), @@ -206,6 +210,12 @@ impl From for CratesTomlParseError { } } +impl From for CratesTomlParseError { + fn from(e: toml::de::Error) -> Self { + CratesTomlParseError::TomlParse(Box::new(e)) + } +} + #[cfg(test)] mod tests { use super::*; From 152ea8376b814cfb4ae394b7c5580ba6fdc79e1e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 24 Jan 2023 14:27:34 +1100 Subject: [PATCH 1001/2020] Switch from toml back to toml_edit (#738) Since now toml simply uses toml_edit, there is no reason to continue using it as it merely increase compilation time and bloat. Instead, we switch to toml_edit v0.18.0 with feature serde enabled. This also remove the `CratesTomlParseError::TomlParseNonUtf8` variant intorduced in #736. Signed-off-by: Jiahao XU --- Cargo.lock | 18 +++------------- crates/binstalk-manifests/Cargo.toml | 2 +- .../binstalk-manifests/src/cargo_crates_v1.rs | 21 ++++++++----------- 3 files changed, 13 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a2e25333..82396e69 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -247,7 +247,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror", - "toml 0.6.0", + "toml_edit", "url", ] @@ -385,7 +385,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0f1204fe51a1e56042b8ec31d6407547ecd18f596b66f470dadb9abd9be9c843" dependencies = [ "serde", - "toml 0.5.11", + "toml", ] [[package]] @@ -671,7 +671,7 @@ checksum = "e62abb876c07e4754fae5c14cafa77937841f01740637e17d78dc04352f32a5e" dependencies = [ "cc", "rustc_version", - "toml 0.5.11", + "toml", "vswhom", "winreg", ] @@ -2502,18 +2502,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb9d890e4dc9298b70f740f615f2e05b9db37dce531f6b24fb77ac993f9f217" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - [[package]] name = "toml_datetime" version = "0.5.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index d424655d..4e8e826b 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.152", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.91" thiserror = "1.0.38" -toml = "0.6.0" +toml_edit = { version = "0.18.0", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] diff --git a/crates/binstalk-manifests/src/cargo_crates_v1.rs b/crates/binstalk-manifests/src/cargo_crates_v1.rs index 42a58a7c..2741e5a2 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1.rs @@ -55,7 +55,7 @@ impl CratesToml<'_> { if vec.is_empty() { Ok(CratesToml::default()) } else { - toml::from_str(str::from_utf8(&vec)?).map_err(CratesTomlParseError::from) + toml_edit::de::from_slice(&vec).map_err(CratesTomlParseError::from) } } @@ -90,7 +90,7 @@ impl CratesToml<'_> { this: &CratesToml<'_>, writer: &mut dyn io::Write, ) -> Result<(), CratesTomlParseError> { - let data = toml::to_string(&this)?.into_bytes(); + let data = toml_edit::ser::to_vec(&this)?; writer.write_all(&data)?; Ok(()) } @@ -185,14 +185,11 @@ pub enum CratesTomlParseError { #[error(transparent)] Io(#[from] io::Error), - #[error("Failed to parse toml: File is not in valid utf-8 encodings: {0}")] - TomlParseNonUtf8(#[from] Utf8Error), + #[error(transparent)] + TomlParse(Box), #[error(transparent)] - TomlParse(Box), - - #[error(transparent)] - TomlWrite(Box), + TomlWrite(Box), #[error(transparent)] CvsParse(Box), @@ -204,14 +201,14 @@ impl From for CratesTomlParseError { } } -impl From for CratesTomlParseError { - fn from(e: toml::ser::Error) -> Self { +impl From for CratesTomlParseError { + fn from(e: toml_edit::ser::Error) -> Self { CratesTomlParseError::TomlWrite(Box::new(e)) } } -impl From for CratesTomlParseError { - fn from(e: toml::de::Error) -> Self { +impl From for CratesTomlParseError { + fn from(e: toml_edit::de::Error) -> Self { CratesTomlParseError::TomlParse(Box::new(e)) } } From 9047d99c1a00dff92e29d4b5ce3e8a5197c072a4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 24 Jan 2023 23:47:50 +1100 Subject: [PATCH 1002/2020] Fix unused import in binstalk-manifests (#740) Signed-off-by: Jiahao XU --- crates/binstalk-manifests/src/cargo_crates_v1.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/binstalk-manifests/src/cargo_crates_v1.rs b/crates/binstalk-manifests/src/cargo_crates_v1.rs index 2741e5a2..e5fb6c85 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1.rs @@ -13,7 +13,6 @@ use std::{ io::{self, Seek}, iter::IntoIterator, path::{Path, PathBuf}, - str::{self, Utf8Error}, }; use beef::Cow; From 283163bbdac692f1774a6e48ed9aeb9a98b21e51 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 24 Jan 2023 23:48:12 +1100 Subject: [PATCH 1003/2020] Enable feature `zstd-thin` by default (#741) Signed-off-by: Jiahao XU --- crates/bin/Cargo.toml | 2 +- justfile | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 55cbae29..62ca5e7c 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -47,7 +47,7 @@ tracing-subscriber = { version = "0.3.16", features = ["fmt", "json", "ansi"], d embed-resource = "1.8.0" [features] -default = ["static", "rustls", "trust-dns", "fancy-no-backtrace"] +default = ["static", "rustls", "trust-dns", "fancy-no-backtrace", "zstd-thin"] mimalloc = ["dep:mimalloc"] diff --git a/justfile b/justfile index b54bbbde..485eabc6 100644 --- a/justfile +++ b/justfile @@ -62,9 +62,8 @@ cargo-no-default-features := if default-features == "false" { " --no-default-fea } else { "" } cargo-features := trim_end_match(if override-features != "" { override-features - } else if (cargo-profile / ci-or-no) == "dev/ci" { "rustls,fancy-with-backtrace," + extra-features - } else if (cargo-profile / ci-or-no / target-libc) == "release/ci/musl" { "rustls,fancy-with-backtrace,zstd-thin," + extra-features - } else if (cargo-profile / ci-or-no) == "release/ci" { "rustls,fancy-with-backtrace," + extra-features + } else if (cargo-profile / ci-or-no) == "dev/ci" { "rustls,fancy-with-backtrace,zstd-thin" + extra-features + } else if (cargo-profile / ci-or-no) == "release/ci" { "rustls,fancy-with-backtrace,zstd-thin" + extra-features } else { extra-features }, ",") From eb95c5b799c2991a87cfc5bfcb620a3e6f1308dc Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 24 Jan 2023 23:58:07 +1100 Subject: [PATCH 1004/2020] Minor optimization for bin and binstalk (#646) * Refactor `logging`: Extract `report_err` * Optimize `get_default_pkg_url_template`: Return iter instead of `Vec` to avoid heap allocation. * Refactor `GhCrateMeta::find`: Rm `launch_baseline_find_tasks` * Optimize `GhCrateMeta::find`: Avoid cloning `Cow<'_, str>` * Improve `report_err` output: Print newline after msg Signed-off-by: Jiahao XU --- crates/bin/src/logging.rs | 18 +++++++--- crates/binstalk/src/fetchers/gh_crate_meta.rs | 36 ++++++++++--------- .../src/fetchers/gh_crate_meta/hosting.rs | 13 ++++--- 3 files changed, 41 insertions(+), 26 deletions(-) diff --git a/crates/bin/src/logging.rs b/crates/bin/src/logging.rs index 377c7c4b..2db20e2f 100644 --- a/crates/bin/src/logging.rs +++ b/crates/bin/src/logging.rs @@ -1,4 +1,8 @@ -use std::{cmp::min, io, iter::repeat}; +use std::{ + cmp::min, + io::{self, Write}, + iter::repeat, +}; use log::{LevelFilter, Log, STATIC_MAX_LEVEL}; use once_cell::sync::Lazy; @@ -135,10 +139,14 @@ impl Log for Logger { struct ErrorFreeWriter; +fn report_err(err: io::Error) { + writeln!(io::stderr(), "Failed to write to stdout: {err}").ok(); +} + impl io::Write for &ErrorFreeWriter { fn write(&mut self, buf: &[u8]) -> io::Result { io::stdout().write(buf).or_else(|err| { - write!(io::stderr(), "Failed to write to stdout: {err}").ok(); + report_err(err); // Behave as if writing to /dev/null so that logging system // would keep working. Ok(buf.len()) @@ -147,7 +155,7 @@ impl io::Write for &ErrorFreeWriter { fn write_all(&mut self, buf: &[u8]) -> io::Result<()> { io::stdout().write_all(buf).or_else(|err| { - write!(io::stderr(), "Failed to write to stdout: {err}").ok(); + report_err(err); // Behave as if writing to /dev/null so that logging system // would keep working. Ok(()) @@ -156,7 +164,7 @@ impl io::Write for &ErrorFreeWriter { fn write_vectored(&mut self, bufs: &[io::IoSlice<'_>]) -> io::Result { io::stdout().write_vectored(bufs).or_else(|err| { - write!(io::stderr(), "Failed to write to stdout: {err}").ok(); + report_err(err); // Behave as if writing to /dev/null so that logging system // would keep working. Ok(bufs.iter().map(|io_slice| io_slice.len()).sum()) @@ -165,7 +173,7 @@ impl io::Write for &ErrorFreeWriter { fn flush(&mut self) -> io::Result<()> { io::stdout().flush().or_else(|err| { - write!(io::stderr(), "Failed to write to stdout: {err}").ok(); + report_err(err); // Behave as if writing to /dev/null so that logging system // would keep working. Ok(()) diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 790ef084..72c467ea 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -1,4 +1,4 @@ -use std::{future::Future, iter, ops::Deref, path::Path, sync::Arc}; +use std::{borrow::Cow, future::Future, iter, path::Path, sync::Arc}; use compact_str::{CompactString, ToCompactString}; use either::Either; @@ -92,12 +92,12 @@ impl super::Fetcher for GhCrateMeta { }; let pkg_urls = if let Some(pkg_url) = self.target_data.meta.pkg_url.as_deref() { - Either::Left(pkg_url) + Either::Left(iter::once(Cow::Borrowed(pkg_url))) } else if let Some(repo) = repo.as_ref() { if let Some(pkg_urls) = RepositoryHost::guess_git_hosting_services(repo)?.get_default_pkg_url_template() { - Either::Right(pkg_urls) + Either::Right(pkg_urls.map(Cow::Owned)) } else { warn!( concat!( @@ -129,22 +129,24 @@ impl super::Fetcher for GhCrateMeta { // launch_baseline_find_tasks which moves `this` let this = &self; - let launch_baseline_find_tasks = |pkg_fmt| { - match &pkg_urls { - Either::Left(pkg_url) => Either::Left(iter::once(*pkg_url)), - Either::Right(pkg_urls) => Either::Right(pkg_urls.iter().map(Deref::deref)), - } - .flat_map(move |pkg_url| this.launch_baseline_find_tasks(pkg_fmt, pkg_url, repo)) + let pkg_fmts = if let Some(pkg_fmt) = self.target_data.meta.pkg_fmt { + Either::Left(iter::once(pkg_fmt)) + } else { + Either::Right(PkgFmt::iter()) }; - let mut handles: FuturesUnordered<_> = - if let Some(pkg_fmt) = self.target_data.meta.pkg_fmt { - launch_baseline_find_tasks(pkg_fmt).collect() - } else { - PkgFmt::iter() - .flat_map(launch_baseline_find_tasks) - .collect() - }; + let mut handles = FuturesUnordered::new(); + + // Iterate over pkg_urls first to avoid String::clone. + for pkg_url in pkg_urls { + // Clone iter pkg_fmts to ensure all pkg_fmts is + // iterated over for each pkg_url, which is + // basically cartesian product. + // | + for pkg_fmt in pkg_fmts.clone() { + handles.extend(this.launch_baseline_find_tasks(pkg_fmt, &pkg_url, repo)); + } + } while let Some(res) = handles.next().await { if let Some((url, pkg_fmt)) = res? { diff --git a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs index 7cb26b85..00a030fa 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs @@ -44,7 +44,9 @@ impl RepositoryHost { } } - pub fn get_default_pkg_url_template(self) -> Option> { + pub fn get_default_pkg_url_template( + self, + ) -> Option + Clone + 'static> { use RepositoryHost::*; match self { @@ -82,11 +84,14 @@ impl RepositoryHost { } } -fn apply_filenames_to_paths(paths: &[&str], filenames: &[&[&str]], suffix: &str) -> Vec { +fn apply_filenames_to_paths( + paths: &'static [&'static str], + filenames: &'static [&'static [&'static str]], + suffix: &'static str, +) -> impl Iterator + Clone + 'static { filenames .iter() .flat_map(|fs| fs.iter()) .cartesian_product(paths.iter()) - .map(|(filename, path)| format!("{path}/{filename}{suffix}")) - .collect() + .map(move |(filename, path)| format!("{path}/{filename}{suffix}")) } From 719b20aadd68086b2d6fa1f85bd54c4e26be1dcd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 25 Jan 2023 16:57:09 +1100 Subject: [PATCH 1005/2020] Bump clap from 4.1.3 to 4.1.4 (#742) --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 82396e69..878dcb3e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -430,9 +430,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.1.3" +version = "4.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8d93d855ce6a0aa87b8473ef9169482f40abaa2e9e0993024c35c902cbd5920" +checksum = "f13b9c79b5d1dd500d20ef541215a6423c75829ef43117e1b4d17fd8af0b5d76" dependencies = [ "bitflags", "clap_derive", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 62ca5e7c..80200e85 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.7.1" } binstalk-manifests = { path = "../binstalk-manifests", version = "0.2.0" } -clap = { version = "4.1.3", features = ["derive"] } +clap = { version = "4.1.4", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" fs-lock = { version = "0.1.0", path = "../fs-lock" } From 270bf08a2409920e9e68ec11905e3e6f94b9697d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 26 Jan 2023 15:33:49 +1100 Subject: [PATCH 1006/2020] Optimize use of `tinytemplate` (#647) * Optimize `GhCrateMeta::find`: Cache compiled template `pkg_url` * Optimize `collect_bin_files`: Cache compiled template `bin_dir` * Refactor: Improve readability of `gh_crate_meta` * Optimize `GhCrateMeta::launch_baseline_find_tasks`: Dedup urls before checking * Optimize `BinFile::new`: Avoid one heap alloc when creating `dest` * Improve `warn!` msg in `GhCrateMeta::launch_baseline_find_tasks` Signed-off-by: Jiahao XU --- crates/binstalk/src/bins.rs | 24 ++++++--- crates/binstalk/src/fetchers/gh_crate_meta.rs | 50 +++++++++++++------ crates/binstalk/src/ops/resolve.rs | 7 ++- 3 files changed, 58 insertions(+), 23 deletions(-) diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 38c42fef..5fefc6c6 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -74,10 +74,11 @@ pub struct BinFile { } impl BinFile { + /// * `tt` - must have a template with name "bin_dir" pub fn new( data: &Data<'_>, base_name: &str, - bin_dir: &str, + tt: &TinyTemplate, no_symlinks: bool, ) -> Result { let binary_ext = if data.target.contains("windows") { @@ -101,7 +102,7 @@ impl BinFile { } else { // Generate install paths // Source path is the download dir + the generated binary path - let path = ctx.render(bin_dir)?; + let path = ctx.render_with_compiled_tt(tt)?; let path_normalized = Path::new(&path).normalize(); @@ -119,13 +120,21 @@ impl BinFile { }; // Destination at install dir + base-name{.extension} - let dest = data.install_path.join(ctx.render("{ bin }{ binary-ext }")?); + let mut dest = data.install_path.join(ctx.bin); + if !binary_ext.is_empty() { + let binary_ext = binary_ext.strip_prefix('.').unwrap(); + + // PathBuf::set_extension returns false if Path::file_name + // is None, but we know that the file name must be Some, + // thus we assert! the return value here. + assert!(dest.set_extension(binary_ext)); + } let (dest, link) = if no_symlinks { (dest, None) } else { // Destination path is the install dir + base-name-version{.extension} - let dest_file_path_with_ver = ctx.render("{ bin }-v{ version }{ binary-ext }")?; + let dest_file_path_with_ver = format!("{}-v{}{}", ctx.bin, ctx.version, ctx.binary_ext); let dest_with_ver = data.install_path.join(dest_file_path_with_ver); (dest_with_ver, Some(dest)) @@ -235,10 +244,9 @@ struct Context<'c> { } impl<'c> Context<'c> { - fn render(&self, template: &str) -> Result { - let mut tt = TinyTemplate::new(); - tt.add_template("path", template)?; - Ok(tt.render("path", self)?) + /// * `tt` - must have a template with name "bin_dir" + fn render_with_compiled_tt(&self, tt: &TinyTemplate) -> Result { + Ok(tt.render("bin_dir", self)?) } } diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 72c467ea..bde0af83 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -3,6 +3,7 @@ use std::{borrow::Cow, future::Future, iter, path::Path, sync::Arc}; use compact_str::{CompactString, ToCompactString}; use either::Either; use futures_util::stream::{FuturesUnordered, StreamExt}; +use itertools::Itertools; use once_cell::sync::OnceCell; use serde::Serialize; use strum::IntoEnumIterator; @@ -35,23 +36,30 @@ pub struct GhCrateMeta { type FindTaskRes = Result, BinstallError>; impl GhCrateMeta { + /// * `tt` - must have added a template named "pkg_url". fn launch_baseline_find_tasks<'a>( &'a self, pkg_fmt: PkgFmt, + tt: &'a TinyTemplate, pkg_url: &'a str, repo: Option<&'a str>, ) -> impl Iterator + 'static> + 'a { // build up list of potential URLs - let urls = pkg_fmt.extensions().iter().filter_map(move |ext| { - let ctx = Context::from_data_with_repo(&self.data, &self.target_data.target, ext, repo); - match ctx.render_url(pkg_url) { - Ok(url) => Some(url), - Err(err) => { - warn!("Failed to render url for {ctx:#?}: {err:#?}"); - None + let urls = pkg_fmt + .extensions() + .iter() + .filter_map(move |ext| { + let ctx = + Context::from_data_with_repo(&self.data, &self.target_data.target, ext, repo); + match ctx.render_url_with_compiled_tt(tt, pkg_url) { + Ok(url) => Some(url), + Err(err) => { + warn!("Failed to render url for {ctx:#?}: {err}"); + None + } } - } - }); + }) + .dedup(); // go check all potential URLs at once urls.map(move |url| { @@ -139,12 +147,16 @@ impl super::Fetcher for GhCrateMeta { // Iterate over pkg_urls first to avoid String::clone. for pkg_url in pkg_urls { + let mut tt = TinyTemplate::new(); + + tt.add_template("pkg_url", &pkg_url)?; + // Clone iter pkg_fmts to ensure all pkg_fmts is // iterated over for each pkg_url, which is // basically cartesian product. // | for pkg_fmt in pkg_fmts.clone() { - handles.extend(this.launch_baseline_find_tasks(pkg_fmt, &pkg_url, repo)); + handles.extend(this.launch_baseline_find_tasks(pkg_fmt, &tt, &pkg_url, repo)); } } @@ -266,12 +278,22 @@ impl<'c> Context<'c> { Self::from_data_with_repo(data, target, archive_format, data.repo.as_deref()) } - pub(self) fn render_url(&self, template: &str) -> Result { - debug!("Render {template:?} using context: {:?}", self); + /// * `tt` - must have added a template named "pkg_url". + pub(self) fn render_url_with_compiled_tt( + &self, + tt: &TinyTemplate, + template: &str, + ) -> Result { + debug!("Render {template} using context: {self:?}"); + Ok(Url::parse(&tt.render("pkg_url", self)?)?) + } + + #[cfg(test)] + pub(self) fn render_url(&self, template: &str) -> Result { let mut tt = TinyTemplate::new(); - tt.add_template("path", template)?; - Ok(Url::parse(&tt.render("path", self)?)?) + tt.add_template("pkg_url", template)?; + self.render_url_with_compiled_tt(&tt, template) } } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 1e5c5f03..4140b062 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -12,6 +12,7 @@ use crates_io_api::AsyncClient as CratesIoApiClient; use itertools::Itertools; use maybe_owned::MaybeOwned; use semver::{Version, VersionReq}; +use tinytemplate::TinyTemplate; use tokio::task::block_in_place; use tracing::{debug, info, instrument, warn}; @@ -297,11 +298,15 @@ fn collect_bin_files( .map(Cow::Borrowed) .unwrap_or_else(|| bins::infer_bin_dir_template(&bin_data)); + let mut tt = TinyTemplate::new(); + + tt.add_template("bin_dir", &bin_dir)?; + // Create bin_files let bin_files = package_info .binaries .iter() - .map(|bin| bins::BinFile::new(&bin_data, bin.name.as_str(), &bin_dir, no_symlinks)) + .map(|bin| bins::BinFile::new(&bin_data, bin.name.as_str(), &tt, no_symlinks)) .collect::, BinstallError>>()?; let mut source_set = BTreeSet::new(); From d36acbb4e64a6804abf07e6a91feb14495225909 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 27 Jan 2023 01:23:22 +0000 Subject: [PATCH 1007/2020] Bump either from 1.8.0 to 1.8.1 (#743) Bumps [either](https://github.com/bluss/either) from 1.8.0 to 1.8.1. - [Release notes](https://github.com/bluss/either/releases) - [Commits](https://github.com/bluss/either/compare/1.8.0...1.8.1) --- updated-dependencies: - dependency-name: either dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 878dcb3e..4ff10139 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -659,9 +659,9 @@ dependencies = [ [[package]] name = "either" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "embed-resource" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index e4fb094d..d2115125 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -18,7 +18,7 @@ command-group = { version = "2.0.1", features = ["with-tokio"] } compact_str = { version = "0.6.1", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.5", path = "../detect-targets" } -either = "1.8.0" +either = "1.8.1" futures-util = { version = "0.3.25", default-features = false, features = ["std"] } home = "0.5.4" itertools = "0.10.5" From d34ad5ad1fdf81ad831d55c7e65db3ca1f6a81c0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 02:20:04 +0000 Subject: [PATCH 1008/2020] Bump tokio from 1.24.2 to 1.25.0 (#749) --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4ff10139..4b7f787a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2403,9 +2403,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.24.2" +version = "1.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a12a59981d9e3c38d216785b0c37399f6e415e8d0712047620f189371b0bb" +checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" dependencies = [ "autocfg", "bytes", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 80200e85..c0a3b8d0 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -37,7 +37,7 @@ strum = "0.24.1" strum_macros = "0.24.3" supports-color = "2.0.0" tempfile = "3.3.0" -tokio = { version = "1.24.2", features = ["rt-multi-thread"], default-features = false } +tokio = { version = "1.25.0", features = ["rt-multi-thread"], default-features = false } tracing-core = "0.1.30" tracing = { version = "0.1.37", default-features = false } tracing-log = { version = "0.1.3", default-features = false } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index e9aeca10..38582d1e 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -29,7 +29,7 @@ reqwest = { version = "0.11.14", features = ["stream", "gzip", "brotli", "deflat tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.3.0" thiserror = "1.0.38" -tokio = { version = "1.24.2", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } +tokio = { version = "1.25.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.4", features = ["io"] } tower = { version = "0.4.13", features = ["limit", "util"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index d2115125..e0207424 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -34,7 +34,7 @@ tempfile = "3.3.0" thiserror = "1.0.38" tinytemplate = "1.2.1" # parking_lot for `tokio::sync::OnceCell::const_new` -tokio = { version = "1.24.2", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } +tokio = { version = "1.25.0", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } tracing = "0.1.37" url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 131becc0..2aaf4dde 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -10,9 +10,9 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -tokio = { version = "1.24.2", features = ["rt", "process", "sync"], default-features = false } +tokio = { version = "1.25.0", features = ["rt", "process", "sync"], default-features = false } cfg-if = "1.0.0" guess_host_triple = "0.1.3" [dev-dependencies] -tokio = { version = "1.24.2", features = ["macros"], default-features = false } +tokio = { version = "1.25.0", features = ["macros"], default-features = false } From 1ad5d4657f31d0e3b0f9a9ddb27b61cf6dd42d2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 30 Jan 2023 02:37:41 +0000 Subject: [PATCH 1009/2020] Bump toml_edit from 0.18.0 to 0.19.0 (#748) --- Cargo.lock | 8 ++++---- crates/binstalk-manifests/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4b7f787a..b6dd0c16 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2504,18 +2504,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4553f467ac8e3d374bc9a177a26801e5d0f9b211aa1673fb137a403afd1c9cf5" +checksum = "886f31a9b85b6182cabd4d8b07df3b451afcc216563748201490940d2a28ed36" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729bfd096e40da9c001f778f5cdecbd2957929a24e10e5883d9392220a751581" +checksum = "233d8716cdc5d20ec88a18a839edaf545edc71efa4a5ff700ef4a102c26cd8fa" dependencies = [ "indexmap", "nom8", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 4e8e826b..b532ec3c 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.152", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.91" thiserror = "1.0.38" -toml_edit = { version = "0.18.0", features = ["serde"] } +toml_edit = { version = "0.19.0", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] From aa89f0073d68cf3c020f3914dd537e968f26ef5f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Jan 2023 12:36:22 +1100 Subject: [PATCH 1010/2020] Bump futures-util from 0.3.25 to 0.3.26 (#751) Bumps [futures-util](https://github.com/rust-lang/futures-rs) from 0.3.25 to 0.3.26. - [Release notes](https://github.com/rust-lang/futures-rs/releases) - [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.25...0.3.26) --- updated-dependencies: - dependency-name: futures-util dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 28 +++++++++++++-------------- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b6dd0c16..ae06bfa6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -815,9 +815,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" +checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" dependencies = [ "futures-core", "futures-sink", @@ -825,9 +825,9 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" +checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" [[package]] name = "futures-executor" @@ -842,15 +842,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00f5fb52a06bdcadeb54e8d3671f8888a39697dcb0b81b23b55174030427f4eb" +checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" [[package]] name = "futures-macro" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfb8ce053d86b91919aad980c220b1fb8401a9394410e1c289ed7e66b61835d" +checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" dependencies = [ "proc-macro2", "quote", @@ -859,21 +859,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39c15cf1a4aa79df40f1bb462fb39676d0ad9e366c2a33b590d7c66f4f81fcf9" +checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" [[package]] name = "futures-task" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ffb393ac5d9a6eaa9d3fdf37ae2776656b706e200c8e16b1bdb227f5198e6ea" +checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" [[package]] name = "futures-util" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" +checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" dependencies = [ "futures-channel", "futures-core", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 38582d1e..f9af31c4 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -18,7 +18,7 @@ bytes = "1.3.0" bzip2 = "0.4.4" digest = "0.10.6" flate2 = { version = "1.0.25", default-features = false } -futures-util = { version = "0.3.25", default-features = false, features = ["std"] } +futures-util = { version = "0.3.26", default-features = false, features = ["std"] } generic-array = "0.14.6" httpdate = "1.0.2" reqwest = { version = "0.11.14", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index e0207424..07580378 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -19,7 +19,7 @@ compact_str = { version = "0.6.1", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.5", path = "../detect-targets" } either = "1.8.1" -futures-util = { version = "0.3.25", default-features = false, features = ["std"] } +futures-util = { version = "0.3.26", default-features = false, features = ["std"] } home = "0.5.4" itertools = "0.10.5" jobslot = { version = "0.2.8", features = ["tokio"] } From 84621d54a5ff5e19ef201ca13662cace4fac5c69 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Jan 2023 01:39:31 +0000 Subject: [PATCH 1011/2020] Bump async-trait from 0.1.63 to 0.1.64 (#752) --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ae06bfa6..d8121197 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -81,9 +81,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.63" +version = "0.1.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eff18d764974428cf3a9328e23fc5c986f5fbed46e6cd4cdf42544df5d297ec1" +checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index f9af31c4..85087efe 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0" [dependencies] -async-trait = "0.1.63" +async-trait = "0.1.64" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.9", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } binstalk-types = { version = "0.2.0", path = "../binstalk-types" } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 07580378..ef7e79c0 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0" [dependencies] -async-trait = "0.1.63" +async-trait = "0.1.64" binstalk-downloader = { version = "0.3.2", path = "../binstalk-downloader" } binstalk-types = { version = "0.2.0", path = "../binstalk-types" } cargo_toml = "0.14.0" From 28449c21f4ddcab1b29f7f066e3d6ef106df798b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 31 Jan 2023 01:41:22 +0000 Subject: [PATCH 1012/2020] Bump toml_edit from 0.19.0 to 0.19.1 (#753) --- Cargo.lock | 12 ++++++------ crates/binstalk-manifests/Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d8121197..e400de88 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2138,9 +2138,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c68e921cef53841b8925c2abadd27c9b891d9613bdc43d6b823062866df38e8" +checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" dependencies = [ "serde", ] @@ -2504,18 +2504,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "886f31a9b85b6182cabd4d8b07df3b451afcc216563748201490940d2a28ed36" +checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d8716cdc5d20ec88a18a839edaf545edc71efa4a5ff700ef4a102c26cd8fa" +checksum = "90a238ee2e6ede22fb95350acc78e21dc40da00bb66c0334bde83de4ed89424e" dependencies = [ "indexmap", "nom8", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index b532ec3c..650273dc 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.152", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.91" thiserror = "1.0.38" -toml_edit = { version = "0.19.0", features = ["serde"] } +toml_edit = { version = "0.19.1", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] From 68f3eb81d4bc8e84860b95d8f5e6ea0e350a1b6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Feb 2023 01:40:45 +0000 Subject: [PATCH 1013/2020] Bump fs4 from 0.6.2 to 0.6.3 (#755) --- Cargo.lock | 4 ++-- crates/fs-lock/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e400de88..64dcace7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -789,9 +789,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9813c3dc174931eff4bd78609debba56465b7c1da888576d21636b601a46790" +checksum = "8ea55201cc351fdb478217c0fb641b59813da9b4efe4c414a9d8f989a657d149" dependencies = [ "libc", "rustix 0.35.13", diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 0ac904b1..62327306 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -10,4 +10,4 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -fs4 = "0.6.2" +fs4 = "0.6.3" From 7dc07ad23c73c77720071f4885bb4571e7d5b976 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Feb 2023 01:43:33 +0000 Subject: [PATCH 1014/2020] Bump bytes from 1.3.0 to 1.4.0 (#754) --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 64dcace7..43e3fc61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -326,9 +326,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "bzip2" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 85087efe..f3b59cac 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -14,7 +14,7 @@ async-trait = "0.1.64" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.9", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } binstalk-types = { version = "0.2.0", path = "../binstalk-types" } -bytes = "1.3.0" +bytes = "1.4.0" bzip2 = "0.4.4" digest = "0.10.6" flate2 = { version = "1.0.25", default-features = false } From b05548440d578ed610f8a44b7cf1f367af5cd89f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Feb 2023 02:13:58 +0000 Subject: [PATCH 1015/2020] Bump zstd from 0.12.2+zstd.1.5.2 to 0.12.3+zstd.1.5.2 (#756) --- Cargo.lock | 12 ++++++------ crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 43e3fc61..b09d5784 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -227,7 +227,7 @@ dependencies = [ "trust-dns-resolver", "url", "xz2", - "zstd 0.12.2+zstd.1.5.2", + "zstd 0.12.3+zstd.1.5.2", ] [[package]] @@ -3075,11 +3075,11 @@ dependencies = [ [[package]] name = "zstd" -version = "0.12.2+zstd.1.5.2" +version = "0.12.3+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9262a83dc741c0b0ffec209881b45dbc232c21b02a2b9cb1adb93266e41303d" +checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" dependencies = [ - "zstd-safe 6.0.2+zstd.1.5.2", + "zstd-safe 6.0.3+zstd.1.5.2", ] [[package]] @@ -3094,9 +3094,9 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "6.0.2+zstd.1.5.2" +version = "6.0.3+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6cf39f730b440bab43da8fb5faf5f254574462f73f260f85f7987f32154ff17" +checksum = "68e4a3f57d13d0ab7e478665c60f35e2a613dcd527851c2c7287ce5c787e134a" dependencies = [ "libc", "zstd-sys", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index f3b59cac..41f79917 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -43,7 +43,7 @@ xz2 = "0.1.7" # Since zip 0.6.3 depends on zstd 0.11, we can use 0.12.0 here # because it uses the same zstd-sys version. # Otherwise there will be a link conflict. -zstd = { version = "0.12.2", default-features = false } +zstd = { version = "0.12.3", default-features = false } [features] default = ["static", "rustls"] From 5c02581569770f9d3ba113e9d140fc0956d79428 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 3 Feb 2023 18:38:10 +1100 Subject: [PATCH 1016/2020] Disable backtrace support from miette in release/CI build (#744) Signed-off-by: Jiahao XU --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index 485eabc6..6d903a05 100644 --- a/justfile +++ b/justfile @@ -63,7 +63,7 @@ cargo-no-default-features := if default-features == "false" { " --no-default-fea cargo-features := trim_end_match(if override-features != "" { override-features } else if (cargo-profile / ci-or-no) == "dev/ci" { "rustls,fancy-with-backtrace,zstd-thin" + extra-features - } else if (cargo-profile / ci-or-no) == "release/ci" { "rustls,fancy-with-backtrace,zstd-thin" + extra-features + } else if (cargo-profile / ci-or-no) == "release/ci" { "rustls,fancy-no-backtrace,zstd-thin" + extra-features } else { extra-features }, ",") From e51051148728e93a809c7717178e1f70d93bc575 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 4 Feb 2023 08:47:57 +1100 Subject: [PATCH 1017/2020] Improve `GhCrateMeta`: Detect cases where pkg-fmt is not specified (#757) * Fix fmt of mod `::find` * Add new variant `BinstallError::InvalidPkgFmt` * Impl new fn `PkgFmt::guess_pkg_format` * Improve `GhCrateMeta`: Detect cases where `pkg-fmt` is not specified but `pkg-url` also does not contain format, archive-format or archive-suffix which is required for automatically deducing the pkg-fmt. In these cases, we would call `PkgFmt::guess_pkg_format` to try out best to figure out the pkg-fmt, otherwise we just return an error. Signed-off-by: Jiahao XU --- .../cargo_toml_binstall/package_formats.rs | 32 +++++++++++ crates/binstalk/src/errors.rs | 25 +++++++++ crates/binstalk/src/fetchers/gh_crate_meta.rs | 55 ++++++++++++++----- 3 files changed, 98 insertions(+), 14 deletions(-) diff --git a/crates/binstalk-types/src/cargo_toml_binstall/package_formats.rs b/crates/binstalk-types/src/cargo_toml_binstall/package_formats.rs index 67417324..46a82ca1 100644 --- a/crates/binstalk-types/src/cargo_toml_binstall/package_formats.rs +++ b/crates/binstalk-types/src/cargo_toml_binstall/package_formats.rs @@ -57,6 +57,38 @@ impl PkgFmt { PkgFmt::Zip => &[".zip"], } } + + /// Given the pkg-url template, guess the possible pkg-fmt. + pub fn guess_pkg_format(pkg_url: &str) -> Option { + let mut it = pkg_url.rsplitn(3, '.'); + + let guess = match it.next()? { + "tar" => Some(PkgFmt::Tar), + + "tbz2" => Some(PkgFmt::Tbz2), + "bz2" if it.next() == Some("tar") => Some(PkgFmt::Tbz2), + + "tgz" => Some(PkgFmt::Tgz), + "gz" if it.next() == Some("tar") => Some(PkgFmt::Tgz), + + "txz" => Some(PkgFmt::Txz), + "xz" if it.next() == Some("tar") => Some(PkgFmt::Txz), + + "tzstd" | "tzst" => Some(PkgFmt::Tzstd), + "zst" if it.next() == Some("tar") => Some(PkgFmt::Tzstd), + + "exe" | "bin" => Some(PkgFmt::Bin), + "zip" => Some(PkgFmt::Zip), + + _ => None, + }; + + if it.next().is_some() { + guess + } else { + None + } + } } #[derive(Debug, Copy, Clone, Eq, PartialEq)] diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index dd3470a4..c833bdaf 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -41,6 +41,16 @@ pub struct CrateContextError { err: BinstallError, } +#[derive(Debug, Error)] +#[error("Invalid pkg-url {pkg_url} for {crate_name}@{version} on {target}: {reason}")] +pub struct InvalidPkgFmtError { + pub crate_name: CompactString, + pub version: CompactString, + pub target: String, + pub pkg_url: String, + pub reason: &'static str, +} + /// Error kinds emitted by cargo-binstall. #[derive(Error, Diagnostic, Debug)] #[non_exhaustive] @@ -291,6 +301,14 @@ pub enum BinstallError { #[diagnostic(severity(error), code(binstall::no_fallback_to_cargo_install))] NoFallbackToCargoInstall, + /// Fallback to `cargo-install` is disabled. + /// + /// - Code: `binstall::invalid_pkg_fmt` + /// - Exit: 95 + #[error(transparent)] + #[diagnostic(severity(error), code(binstall::invalid_pkg_fmt))] + InvalidPkgFmt(Box), + /// A wrapped error providing the context of which crate the error is about. #[error(transparent)] #[diagnostic(transparent)] @@ -324,6 +342,7 @@ impl BinstallError { InvalidSourceFilePath { .. } => 91, EmptySourceFilePath => 92, NoFallbackToCargoInstall => 94, + InvalidPkgFmt(..) => 95, CrateContext(context) => context.err.exit_number(), }; @@ -428,3 +447,9 @@ impl From for BinstallError { BinstallError::CargoManifest(Box::new(e)) } } + +impl From for BinstallError { + fn from(e: InvalidPkgFmtError) -> Self { + BinstallError::InvalidPkgFmt(Box::new(e)) + } +} diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index bde0af83..47a1a9c7 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -12,7 +12,7 @@ use tracing::{debug, warn}; use url::Url; use crate::{ - errors::BinstallError, + errors::{BinstallError, InvalidPkgFmtError}, helpers::{ download::Download, remote::{Client, Method}, @@ -99,7 +99,34 @@ impl super::Fetcher for GhCrateMeta { None }; + let mut pkg_fmt = self.target_data.meta.pkg_fmt; + let pkg_urls = if let Some(pkg_url) = self.target_data.meta.pkg_url.as_deref() { + if pkg_fmt.is_none() + && !(pkg_url.contains("format") + || pkg_url.contains("archive-format") + || pkg_url.contains("archive-suffix")) + { + // The crate does not specify the pkg-fmt, yet its pkg-url + // template doesn't contains format, archive-format or + // archive-suffix which is required for automatically + // deducing the pkg-fmt. + // + // We will attempt to guess the pkg-fmt there, but this is + // just a best-effort + pkg_fmt = PkgFmt::guess_pkg_format(pkg_url); + + if pkg_fmt.is_none() { + return Err(InvalidPkgFmtError { + crate_name: self.data.name.clone(), + version: self.data.version.clone(), + target: self.target_data.target.clone(), + pkg_url: pkg_url.to_string(), + reason: "pkg-fmt is not specified, yet pkg-url does not contain format, archive-format or archive-suffix which is required for automatically deducing pkg-fmt", + } + .into()); + } + } Either::Left(iter::once(Cow::Borrowed(pkg_url))) } else if let Some(repo) = repo.as_ref() { if let Some(pkg_urls) = @@ -108,23 +135,23 @@ impl super::Fetcher for GhCrateMeta { Either::Right(pkg_urls.map(Cow::Owned)) } else { warn!( - concat!( - "Unknown repository {}, cargo-binstall cannot provide default pkg_url for it.\n", - "Please ask the upstream to provide it for target {}." - ), - repo, self.target_data.target - ); + concat!( + "Unknown repository {}, cargo-binstall cannot provide default pkg_url for it.\n", + "Please ask the upstream to provide it for target {}." + ), + repo, self.target_data.target + ); return Ok(false); } } else { warn!( - concat!( - "Package does not specify repository, cargo-binstall cannot provide default pkg_url for it.\n", - "Please ask the upstream to provide it for target {}." - ), - self.target_data.target - ); + concat!( + "Package does not specify repository, cargo-binstall cannot provide default pkg_url for it.\n", + "Please ask the upstream to provide it for target {}." + ), + self.target_data.target + ); return Ok(false); }; @@ -137,7 +164,7 @@ impl super::Fetcher for GhCrateMeta { // launch_baseline_find_tasks which moves `this` let this = &self; - let pkg_fmts = if let Some(pkg_fmt) = self.target_data.meta.pkg_fmt { + let pkg_fmts = if let Some(pkg_fmt) = pkg_fmt { Either::Left(iter::once(pkg_fmt)) } else { Either::Right(PkgFmt::iter()) From f2fc37eea5bc219fb53416d755dd92fb26dc59ab Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 4 Feb 2023 11:14:53 +1100 Subject: [PATCH 1018/2020] Fix "Too many "Too Many Requests" log" (#761) Fixed #747 - Add dep compact_str v0.6.1 to binstalk-downloader - Impl new type `DelayRequest` - Handle 503/429 with wait duration > `MAX_RETRY_DURATION` by simply taking the min - Fix `Client::send_request_inner`: Ensure 503/429 get propagated to other requests even if the current requests reach its maximum retry and decides to simply return an error. Signed-off-by: Jiahao XU --- Cargo.lock | 1 + crates/binstalk-downloader/Cargo.toml | 1 + crates/binstalk-downloader/src/remote.rs | 40 +++++-- .../src/remote/delay_request.rs | 104 ++++++++++++++++++ 4 files changed, 134 insertions(+), 12 deletions(-) create mode 100644 crates/binstalk-downloader/src/remote/delay_request.rs diff --git a/Cargo.lock b/Cargo.lock index b09d5784..7251166c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -211,6 +211,7 @@ dependencies = [ "binstall-tar", "bytes", "bzip2", + "compact_str", "digest", "flate2", "futures-util", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 41f79917..c7ff4790 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -16,6 +16,7 @@ async_zip = { version = "0.0.9", features = ["deflate", "bzip2", "lzma", "zstd", binstalk-types = { version = "0.2.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" +compact_str = "0.6.1" digest = "0.10.6" flate2 = { version = "1.0.25", default-features = false } futures-util = { version = "0.3.26", default-features = false, features = ["std"] } diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 5632c19f..53f69170 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -12,13 +12,16 @@ use reqwest::{ Request, Response, StatusCode, }; use thiserror::Error as ThisError; -use tokio::{sync::Mutex, time::sleep}; +use tokio::time::Instant; use tower::{limit::rate::RateLimit, Service, ServiceBuilder, ServiceExt}; use tracing::{debug, info}; pub use reqwest::{tls, Error as ReqwestError, Method}; pub use url::Url; +mod delay_request; +use delay_request::DelayRequest; + const MAX_RETRY_DURATION: Duration = Duration::from_secs(120); const MAX_RETRY_COUNT: u8 = 3; const DEFAULT_MIN_TLS: tls::Version = tls::Version::TLS_1_2; @@ -44,7 +47,7 @@ pub struct HttpError { #[derive(Debug)] struct Inner { client: reqwest::Client, - rate_limit: Mutex>, + service: DelayRequest>, } #[derive(Clone, Debug)] @@ -81,7 +84,7 @@ impl Client { Ok(Client(Arc::new(Inner { client: client.clone(), - rate_limit: Mutex::new( + service: DelayRequest::new( ServiceBuilder::new() .rate_limit(num_request.get(), per) .service(client), @@ -107,13 +110,7 @@ impl Client { loop { let request = Request::new(method.clone(), url.clone()); - // Reduce critical section: - // - Construct the request before locking - // - Once the rate_limit is ready, call it and obtain - // the future, then release the lock before - // polling the future, which performs network I/O that could - // take really long. - let future = self.0.rate_limit.lock().await.ready().await?.call(request); + let future = (&self.0.service).ready().await?.call(request); let response = future.await?; @@ -124,9 +121,20 @@ impl Client { // 503 429 StatusCode::SERVICE_UNAVAILABLE | StatusCode::TOO_MANY_REQUESTS, Some(duration), - ) if duration <= MAX_RETRY_DURATION && count < MAX_RETRY_COUNT => { + ) => { + let duration = duration.min(MAX_RETRY_DURATION); + info!("Receiver status code {status}, will wait for {duration:#?} and retry"); - sleep(duration).await + + let deadline = Instant::now() + duration; + + self.0 + .service + .add_urls_to_delay(dedup([url, response.url()]), deadline); + + if count >= MAX_RETRY_COUNT { + break Ok(response); + } } _ => break Ok(response), } @@ -211,3 +219,11 @@ fn parse_header_retry_after(headers: &HeaderMap) -> Option { } } } + +fn dedup(urls: [&Url; 2]) -> impl Iterator { + if urls[0] == urls[1] { + Some(urls[0]).into_iter().chain(None) + } else { + Some(urls[0]).into_iter().chain(Some(urls[1])) + } +} diff --git a/crates/binstalk-downloader/src/remote/delay_request.rs b/crates/binstalk-downloader/src/remote/delay_request.rs new file mode 100644 index 00000000..64af08a9 --- /dev/null +++ b/crates/binstalk-downloader/src/remote/delay_request.rs @@ -0,0 +1,104 @@ +use std::{ + collections::HashMap, + future::Future, + pin::Pin, + sync::Mutex, + task::{Context, Poll}, +}; + +use compact_str::{CompactString, ToCompactString}; +use reqwest::{Request, Url}; +use tokio::{ + sync::Mutex as AsyncMutex, + time::{sleep_until, Instant}, +}; +use tower::{Service, ServiceExt}; + +#[derive(Debug)] +pub(super) struct DelayRequest { + inner: AsyncMutex, + hosts_to_delay: Mutex>, +} + +impl DelayRequest { + pub(super) fn new(inner: S) -> Self { + Self { + inner: AsyncMutex::new(inner), + hosts_to_delay: Default::default(), + } + } + + pub(super) fn add_urls_to_delay<'a, Urls>(&self, urls: Urls, deadline: Instant) + where + Urls: IntoIterator, + { + let mut hosts_to_delay = self.hosts_to_delay.lock().unwrap(); + + urls.into_iter().filter_map(Url::host_str).for_each(|host| { + hosts_to_delay + .entry(host.to_compact_string()) + .and_modify(|old_dl| { + *old_dl = deadline.max(*old_dl); + }) + .or_insert(deadline); + }); + } + + fn wait_until_available(&self, url: &Url) -> impl Future + Send + 'static { + let mut hosts_to_delay = self.hosts_to_delay.lock().unwrap(); + + let sleep = url + .host_str() + .and_then(|host| hosts_to_delay.get(host).map(|deadline| (*deadline, host))) + .and_then(|(deadline, host)| { + if deadline.elapsed().is_zero() { + Some(sleep_until(deadline)) + } else { + // We have already gone past the deadline, + // so we should remove it instead. + hosts_to_delay.remove(host); + None + } + }); + + async move { + if let Some(sleep) = sleep { + sleep.await; + } + } + } +} + +impl<'this, S> Service for &'this DelayRequest +where + S: Service + Send, + S::Future: Send, +{ + type Response = S::Response; + type Error = S::Error; + // TODO: Replace this with `type_alias_impl_trait` once it stablises + // https://github.com/rust-lang/rust/issues/63063 + type Future = Pin> + Send + 'this>>; + + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + + fn call(&mut self, req: Request) -> Self::Future { + let this = *self; + + Box::pin(async move { + this.wait_until_available(req.url()).await; + + // Reduce critical section: + // - Construct the request before locking + // - Once it is ready, call it and obtain + // the future, then release the lock before + // polling the future, which performs network I/O that could + // take really long. + let future = this.inner.lock().await.ready().await?.call(req); + + future.await + }) + } +} From 6bc1fb498390b996d3ecf4ed385b504b7adf374d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 4 Feb 2023 14:14:08 +1300 Subject: [PATCH 1019/2020] Fix #728: fallback to copy when symlinking on windows (#763) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix #728: fallback to copy when symlinking on windows * Signature hmm? * Squash warnings on windows * Just don’t use generics here --- crates/binstalk/src/bins.rs | 4 ++-- crates/binstalk/src/fs.rs | 12 +++++++----- crates/binstalk/src/helpers/signal.rs | 4 ++-- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 5fefc6c6..e6549627 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -1,6 +1,6 @@ use std::{ borrow::Cow, - fmt, fs, + fmt, path::{self, Component, Path, PathBuf}, }; @@ -183,7 +183,7 @@ impl BinFile { ); #[cfg(unix)] - fs::set_permissions( + std::fs::set_permissions( &self.source, std::os::unix::fs::PermissionsExt::from_mode(0o755), )?; diff --git a/crates/binstalk/src/fs.rs b/crates/binstalk/src/fs.rs index 8b4c63e5..abf5c959 100644 --- a/crates/binstalk/src/fs.rs +++ b/crates/binstalk/src/fs.rs @@ -63,13 +63,15 @@ pub fn atomic_install(src: &Path, dst: &Path) -> io::Result<()> { Ok(()) } -fn symlink_file, Q: AsRef>(original: P, link: Q) -> io::Result<()> { +fn symlink_file(original: &Path, link: &Path) -> io::Result<()> { #[cfg(target_family = "unix")] - let f = std::os::unix::fs::symlink; - #[cfg(target_family = "windows")] - let f = std::os::windows::fs::symlink_file; + std::os::unix::fs::symlink(original, link)?; - f(original, link) + // Symlinks on Windows are disabled in some editions, so creating one is unreliable. + #[cfg(target_family = "windows")] + std::os::windows::fs::symlink_file(original, link) + .or_else(|_| std::fs::copy(original, link).map(drop))?; + Ok(()) } /// Atomically install symlink "link" to a file "dst". diff --git a/crates/binstalk/src/helpers/signal.rs b/crates/binstalk/src/helpers/signal.rs index 3ad352b4..0520a258 100644 --- a/crates/binstalk/src/helpers/signal.rs +++ b/crates/binstalk/src/helpers/signal.rs @@ -1,4 +1,4 @@ -use std::{future::pending, io}; +use std::io; use super::tasks::AutoAbortJoinHandle; use crate::errors::BinstallError; @@ -73,7 +73,7 @@ mod unix { Ok(()) } else { // Use pending() here for the same reason as above. - pending().await + std::future::pending().await } } From 833684b09561956b58dbc9fd261336ab135bcaf1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 4 Feb 2023 16:05:03 +1100 Subject: [PATCH 1020/2020] Replace dep `futures-util` with `futures-lite` in binstalk-downloader (#764) `futures-util` has too many dependencies and it contains a lot of code of which we only use a tiny bit of them. Signed-off-by: Jiahao XU --- Cargo.lock | 12 ++++- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-downloader/src/download.rs | 2 +- .../src/download/async_extracter.rs | 4 +- .../src/download/async_tar_visitor.rs | 2 +- .../src/download/zip_extraction.rs | 53 +++++++++++-------- crates/binstalk-downloader/src/remote.rs | 2 +- 7 files changed, 47 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7251166c..1e38ed72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -214,7 +214,7 @@ dependencies = [ "compact_str", "digest", "flate2", - "futures-util", + "futures-lite", "generic-array", "httpdate", "reqwest", @@ -847,6 +847,16 @@ version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" +[[package]] +name = "futures-lite" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +dependencies = [ + "futures-core", + "pin-project-lite", +] + [[package]] name = "futures-macro" version = "0.3.26" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index c7ff4790..a9c01de0 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -19,7 +19,7 @@ bzip2 = "0.4.4" compact_str = "0.6.1" digest = "0.10.6" flate2 = { version = "1.0.25", default-features = false } -futures-util = { version = "0.3.26", default-features = false, features = ["std"] } +futures-lite = { version = "1.12.0", default-features = false } generic-array = "0.14.6" httpdate = "1.0.2" reqwest = { version = "0.11.14", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index ca3fe268..2d491239 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -2,7 +2,7 @@ use std::{fmt::Debug, io, marker::PhantomData, path::Path}; use binstalk_types::cargo_toml_binstall::PkgFmtDecomposed; use digest::{Digest, FixedOutput, HashMarker, Output, OutputSizeUser, Update}; -use futures_util::stream::StreamExt; +use futures_lite::stream::StreamExt; use thiserror::Error as ThisError; use tracing::{debug, instrument}; diff --git a/crates/binstalk-downloader/src/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs index 4850771e..ecb087a5 100644 --- a/crates/binstalk-downloader/src/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -7,8 +7,8 @@ use std::{ use async_zip::read::stream::ZipFileReader; use bytes::{Bytes, BytesMut}; -use futures_util::{ - future::try_join, +use futures_lite::{ + future::try_zip as try_join, stream::{Stream, StreamExt}, }; use tokio::sync::mpsc; diff --git a/crates/binstalk-downloader/src/download/async_tar_visitor.rs b/crates/binstalk-downloader/src/download/async_tar_visitor.rs index 9c44506c..af1abba2 100644 --- a/crates/binstalk-downloader/src/download/async_tar_visitor.rs +++ b/crates/binstalk-downloader/src/download/async_tar_visitor.rs @@ -2,7 +2,7 @@ use std::{borrow::Cow, fmt::Debug, io, path::Path, pin::Pin}; use async_compression::tokio::bufread; use bytes::Bytes; -use futures_util::stream::{Stream, StreamExt}; +use futures_lite::stream::{Stream, StreamExt}; use tokio::io::{copy, sink, AsyncRead}; use tokio_tar::{Archive, Entry, EntryType}; use tokio_util::io::StreamReader; diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index 89e4f2ab..69cfcb17 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -5,7 +5,7 @@ use std::{ use async_zip::{read::ZipEntryReader, ZipEntryExt}; use bytes::{Bytes, BytesMut}; -use futures_util::future::{try_join, TryFutureExt}; +use futures_lite::future::try_zip as try_join; use thiserror::Error as ThisError; use tokio::{ io::{AsyncRead, AsyncReadExt}, @@ -78,29 +78,36 @@ where let (tx, mut rx) = mpsc::channel::(5); // This entry is a file. + + let write_task = asyncify(move || { + if let Some(p) = outpath.parent() { + std::fs::create_dir_all(p)?; + } + let mut outfile = std::fs::File::create(&outpath)?; + + while let Some(bytes) = rx.blocking_recv() { + outfile.write_all(&bytes)?; + } + + outfile.flush()?; + + if let Some(perms) = perms { + outfile.set_permissions(perms)?; + } + + Ok(()) + }); + + let read_task = copy_file_to_mpsc(entry, tx, buf); + try_join( - asyncify(move || { - if let Some(p) = outpath.parent() { - std::fs::create_dir_all(p)?; - } - let mut outfile = std::fs::File::create(&outpath)?; - - while let Some(bytes) = rx.blocking_recv() { - outfile.write_all(&bytes)?; - } - - outfile.flush()?; - - if let Some(perms) = perms { - outfile.set_permissions(perms)?; - } - - Ok(()) - }) - .err_into(), - copy_file_to_mpsc(entry, tx, buf) - .map_err(ZipError::from_inner) - .map_err(DownloadError::from), + async move { write_task.await.map_err(From::from) }, + async move { + read_task + .await + .map_err(ZipError::from_inner) + .map_err(DownloadError::from) + }, ) .await?; } diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 53f69170..56eb42b3 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -5,7 +5,7 @@ use std::{ }; use bytes::Bytes; -use futures_util::stream::{Stream, StreamExt}; +use futures_lite::stream::{Stream, StreamExt}; use httpdate::parse_http_date; use reqwest::{ header::{HeaderMap, RETRY_AFTER}, From a13c01b7698bda8e26c9b704b9ba9742aa211be7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 5 Feb 2023 16:26:25 +1100 Subject: [PATCH 1021/2020] Replace dep futures-util with `helpers::FuturesResolver` (#765) futures-util has too many dependencies and it contains a lot of code of which we only use `futures_util::stream::{FuturesUnordered, StreamExt}`. We don't even need most of the functionalities in `FuturesUnordered` as we just need the output of first future that either returns `Err(_)` or `Ok(Some(_))`. So we replace it with ou own homebrew solution (~80 loc) and it's easier to use. Signed-off-by: Jiahao XU --- Cargo.lock | 1 - crates/binstalk/Cargo.toml | 1 - crates/binstalk/src/fetchers/gh_crate_meta.rs | 20 +++-- crates/binstalk/src/helpers.rs | 1 + .../binstalk/src/helpers/futures_resolver.rs | 76 +++++++++++++++++++ 5 files changed, 86 insertions(+), 13 deletions(-) create mode 100644 crates/binstalk/src/helpers/futures_resolver.rs diff --git a/Cargo.lock b/Cargo.lock index 1e38ed72..1671667e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -179,7 +179,6 @@ dependencies = [ "crates_io_api", "detect-targets", "either", - "futures-util", "home", "itertools", "jobslot", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index ef7e79c0..3262d695 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -19,7 +19,6 @@ compact_str = { version = "0.6.1", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.5", path = "../detect-targets" } either = "1.8.1" -futures-util = { version = "0.3.26", default-features = false, features = ["std"] } home = "0.5.4" itertools = "0.10.5" jobslot = { version = "0.2.8", features = ["tokio"] } diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 47a1a9c7..5d25bb3c 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -2,7 +2,6 @@ use std::{borrow::Cow, future::Future, iter, path::Path, sync::Arc}; use compact_str::{CompactString, ToCompactString}; use either::Either; -use futures_util::stream::{FuturesUnordered, StreamExt}; use itertools::Itertools; use once_cell::sync::OnceCell; use serde::Serialize; @@ -15,6 +14,7 @@ use crate::{ errors::{BinstallError, InvalidPkgFmtError}, helpers::{ download::Download, + futures_resolver::FuturesResolver, remote::{Client, Method}, tasks::AutoAbortJoinHandle, }, @@ -170,7 +170,7 @@ impl super::Fetcher for GhCrateMeta { Either::Right(PkgFmt::iter()) }; - let mut handles = FuturesUnordered::new(); + let resolver = FuturesResolver::default(); // Iterate over pkg_urls first to avoid String::clone. for pkg_url in pkg_urls { @@ -183,19 +183,17 @@ impl super::Fetcher for GhCrateMeta { // basically cartesian product. // | for pkg_fmt in pkg_fmts.clone() { - handles.extend(this.launch_baseline_find_tasks(pkg_fmt, &tt, &pkg_url, repo)); + resolver.extend(this.launch_baseline_find_tasks(pkg_fmt, &tt, &pkg_url, repo)); } } - while let Some(res) = handles.next().await { - if let Some((url, pkg_fmt)) = res? { - debug!("Winning URL is {url}, with pkg_fmt {pkg_fmt}"); - self.resolution.set((url, pkg_fmt)).unwrap(); // find() is called first - return Ok(true); - } + if let Some((url, pkg_fmt)) = resolver.resolve().await? { + debug!("Winning URL is {url}, with pkg_fmt {pkg_fmt}"); + self.resolution.set((url, pkg_fmt)).unwrap(); // find() is called first + Ok(true) + } else { + Ok(false) } - - Ok(false) }) } diff --git a/crates/binstalk/src/helpers.rs b/crates/binstalk/src/helpers.rs index 83730ec3..68d84553 100644 --- a/crates/binstalk/src/helpers.rs +++ b/crates/binstalk/src/helpers.rs @@ -1,3 +1,4 @@ +pub mod futures_resolver; pub mod jobserver_client; pub mod signal; pub mod tasks; diff --git a/crates/binstalk/src/helpers/futures_resolver.rs b/crates/binstalk/src/helpers/futures_resolver.rs new file mode 100644 index 00000000..38b4eb98 --- /dev/null +++ b/crates/binstalk/src/helpers/futures_resolver.rs @@ -0,0 +1,76 @@ +use std::{future::Future, pin::Pin}; +use tokio::sync::mpsc; + +/// Given multiple futures with output = Result, E>, +/// returns the the first one that returns either `Err(_)` or +/// `Ok(Some(_))`. +pub struct FuturesResolver { + rx: mpsc::Receiver>, + tx: mpsc::Sender>, +} + +impl Default for FuturesResolver { + fn default() -> Self { + // We only need the first one, so the channel is of size 1. + let (tx, rx) = mpsc::channel(1); + Self { tx, rx } + } +} + +impl FuturesResolver { + /// Insert new future into this resolver, they will start running + /// right away. + pub fn push(&self, fut: Fut) + where + Fut: Future, E>> + Send + 'static, + { + let tx = self.tx.clone(); + + tokio::spawn(async move { + tokio::pin!(fut); + + Self::spawn_inner(fut, tx).await; + }); + } + + async fn spawn_inner( + fut: Pin<&mut (dyn Future, E>> + Send)>, + tx: mpsc::Sender>, + ) { + let res = tokio::select! { + biased; + + _ = tx.closed() => return, + res = fut => res, + }; + + if let Some(res) = res.transpose() { + // try_send can only fail due to being full or being closed. + // + // In both cases, this could means some other future has + // completed first. + // + // For closed, it could additionally means that the task + // is cancelled. + tx.try_send(res).ok(); + } + } + + /// Insert multiple futures into this resolver, they will start running + /// right away. + pub fn extend(&self, iter: Iter) + where + Fut: Future, E>> + Send + 'static, + Iter: IntoIterator, + { + iter.into_iter().for_each(|fut| self.push(fut)); + } + + /// Return the resolution. + pub fn resolve(self) -> impl Future, E>> { + let mut rx = self.rx; + drop(self.tx); + + async move { rx.recv().await.transpose() } + } +} From cb56770fac6e053a9dd3768ae7a469d96d4e88d0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Feb 2023 02:40:03 +0000 Subject: [PATCH 1022/2020] Bump cargo_toml from 0.14.0 to 0.15.1 (#770) --- Cargo.lock | 20 ++++++++++++++++---- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1671667e..96aa7eef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -380,12 +380,12 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.14.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1204fe51a1e56042b8ec31d6407547ecd18f596b66f470dadb9abd9be9c843" +checksum = "189929343288eb08d1f418bfbc022a5bddc6889e4a8f8dfaf06035fd3adf6fed" dependencies = [ "serde", - "toml", + "toml 0.7.1", ] [[package]] @@ -671,7 +671,7 @@ checksum = "e62abb876c07e4754fae5c14cafa77937841f01740637e17d78dc04352f32a5e" dependencies = [ "cc", "rustc_version", - "toml", + "toml 0.5.11", "vswhom", "winreg", ] @@ -2512,6 +2512,18 @@ dependencies = [ "serde", ] +[[package]] +name = "toml" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "772c1426ab886e7362aedf4abc9c0d1348a979517efedfc25862944d10137af0" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", +] + [[package]] name = "toml_datetime" version = "0.6.1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 3262d695..a7a5707d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0" async-trait = "0.1.64" binstalk-downloader = { version = "0.3.2", path = "../binstalk-downloader" } binstalk-types = { version = "0.2.0", path = "../binstalk-types" } -cargo_toml = "0.14.0" +cargo_toml = "0.15.1" command-group = { version = "2.0.1", features = ["with-tokio"] } compact_str = { version = "0.6.1", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } From 1c863d829fa9f709e3c5b1afb6b6ab58929cd6e1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Feb 2023 02:49:33 +0000 Subject: [PATCH 1023/2020] Bump serde_json from 1.0.91 to 1.0.92 (#771) --- Cargo.lock | 4 ++-- crates/binstalk-manifests/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 96aa7eef..ff0b4f55 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2128,9 +2128,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.91" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877c235533714907a8c2464236f5c4b2a17262ef1bd71f38f35ea592c8da6883" +checksum = "7434af0dc1cbd59268aa98b4c22c131c0584d2232f6fb166efb993e2832e896a" dependencies = [ "itoa", "ryu", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 650273dc..7cdc66a7 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -19,7 +19,7 @@ miette = "5.5.0" semver = { version = "1.0.16", features = ["serde"] } serde = { version = "1.0.152", features = ["derive"] } serde-tuple-vec-map = "1.0.1" -serde_json = "1.0.91" +serde_json = "1.0.92" thiserror = "1.0.38" toml_edit = { version = "0.19.1", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } From 98c9f8619223f119d02ba0f27dab61b55739693b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Feb 2023 02:19:42 +0000 Subject: [PATCH 1024/2020] Bump toml_edit from 0.19.1 to 0.19.2 (#772) --- Cargo.lock | 4 ++-- crates/binstalk-manifests/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ff0b4f55..056bb5d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2535,9 +2535,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90a238ee2e6ede22fb95350acc78e21dc40da00bb66c0334bde83de4ed89424e" +checksum = "1f35c303ea3e062b6131be4de16debe23860b9d3f2396658f13b7af1987fb473" dependencies = [ "indexmap", "nom8", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 7cdc66a7..4fededcb 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.152", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.92" thiserror = "1.0.38" -toml_edit = { version = "0.19.1", features = ["serde"] } +toml_edit = { version = "0.19.2", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] From c76014018b267641b4f9c84305f5bee67db92e14 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Feb 2023 12:53:00 +1100 Subject: [PATCH 1025/2020] Bump serde_json from 1.0.92 to 1.0.93 (#778) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.92 to 1.0.93. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.92...v1.0.93) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-manifests/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 056bb5d0..32c0f780 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2128,9 +2128,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7434af0dc1cbd59268aa98b4c22c131c0584d2232f6fb166efb993e2832e896a" +checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" dependencies = [ "itoa", "ryu", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 4fededcb..1370ac80 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -19,7 +19,7 @@ miette = "5.5.0" semver = { version = "1.0.16", features = ["serde"] } serde = { version = "1.0.152", features = ["derive"] } serde-tuple-vec-map = "1.0.1" -serde_json = "1.0.92" +serde_json = "1.0.93" thiserror = "1.0.38" toml_edit = { version = "0.19.2", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } From 9d9b72c76821365a36feed5a4d5301d506865989 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Feb 2023 13:46:01 +1100 Subject: [PATCH 1026/2020] Bump toml_edit from 0.19.2 to 0.19.3 (#773) Bumps [toml_edit](https://github.com/ordian/toml_edit) from 0.19.2 to 0.19.3. - [Release notes](https://github.com/ordian/toml_edit/releases) - [Commits](https://github.com/ordian/toml_edit/compare/v0.19.2...v0.19.3) --- updated-dependencies: - dependency-name: toml_edit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-manifests/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 32c0f780..c07782ec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2535,9 +2535,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.2" +version = "0.19.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f35c303ea3e062b6131be4de16debe23860b9d3f2396658f13b7af1987fb473" +checksum = "5e6a7712b49e1775fb9a7b998de6635b299237f48b404dde71704f2e0e7f37e5" dependencies = [ "indexmap", "nom8", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 1370ac80..f0412fd5 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.152", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.93" thiserror = "1.0.38" -toml_edit = { version = "0.19.2", features = ["serde"] } +toml_edit = { version = "0.19.3", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] From d9dd611b9e729c5095b010c220bdc584a421981a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Feb 2023 14:01:22 +1100 Subject: [PATCH 1027/2020] Improve `fmt::Display` impl for all Error types (#781) Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/download.rs | 6 +++--- crates/binstalk-downloader/src/remote.rs | 2 +- crates/binstalk-manifests/src/binstall_crates_v1.rs | 4 ++-- crates/binstalk-manifests/src/cargo_crates_v1.rs | 6 +++--- .../src/cargo_crates_v1/crate_version_source.rs | 4 ++-- crates/binstalk/src/errors.rs | 12 ++++++------ 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index 2d491239..10de2348 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -27,17 +27,17 @@ mod utils; #[derive(Debug, ThisError)] pub enum DownloadError { - #[error(transparent)] + #[error("Failed to extract zipfile: {0}")] Unzip(#[from] ZipError), - #[error(transparent)] + #[error("Failed to download from remote: {0}")] Remote(#[from] RemoteError), /// A generic I/O error. /// /// - Code: `binstall::io` /// - Exit: 74 - #[error(transparent)] + #[error("I/O Error: {0}")] Io(io::Error), } diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 56eb42b3..5f2ea6d0 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -28,7 +28,7 @@ const DEFAULT_MIN_TLS: tls::Version = tls::Version::TLS_1_2; #[derive(Debug, ThisError)] pub enum Error { - #[error(transparent)] + #[error("Reqwest error: {0}")] Reqwest(#[from] reqwest::Error), #[error(transparent)] diff --git a/crates/binstalk-manifests/src/binstall_crates_v1.rs b/crates/binstalk-manifests/src/binstall_crates_v1.rs index 10393211..e0234f77 100644 --- a/crates/binstalk-manifests/src/binstall_crates_v1.rs +++ b/crates/binstalk-manifests/src/binstall_crates_v1.rs @@ -31,10 +31,10 @@ const BUFFER_SIZE: usize = 4096 * 5; #[derive(Debug, Diagnostic, Error)] #[non_exhaustive] pub enum Error { - #[error(transparent)] + #[error("I/O Error: {0}")] Io(#[from] io::Error), - #[error(transparent)] + #[error("Failed to parse json: {0}")] SerdeJsonParse(#[from] serde_json::Error), } diff --git a/crates/binstalk-manifests/src/cargo_crates_v1.rs b/crates/binstalk-manifests/src/cargo_crates_v1.rs index e5fb6c85..5cffb4e0 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1.rs @@ -181,13 +181,13 @@ impl CratesToml<'_> { #[derive(Debug, Diagnostic, Error)] #[non_exhaustive] pub enum CratesTomlParseError { - #[error(transparent)] + #[error("I/O Error: {0}")] Io(#[from] io::Error), - #[error(transparent)] + #[error("Failed to deserialize toml: {0}")] TomlParse(Box), - #[error(transparent)] + #[error("Failed to serialie toml: {0}")] TomlWrite(Box), #[error(transparent)] diff --git a/crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs b/crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs index 313532e0..389bed2a 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs @@ -98,10 +98,10 @@ impl FromStr for CrateVersionSource { #[derive(Debug, Diagnostic, Error)] #[non_exhaustive] pub enum CvsParseError { - #[error(transparent)] + #[error("Failed to parse url in cvs: {0}")] UrlParse(#[from] url::ParseError), - #[error(transparent)] + #[error("Failed to parse version in cvs: {0}")] VersionParse(#[from] semver::Error), #[error("unknown source type {kind}+{arg}")] diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index c833bdaf..5bf297ce 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -79,7 +79,7 @@ pub enum BinstallError { /// /// - Code: `binstall::url_parse` /// - Exit: 65 - #[error(transparent)] + #[error("Failed to parse url: {0}")] #[diagnostic(severity(error), code(binstall::url_parse))] UrlParse(#[from] url::ParseError), @@ -87,7 +87,7 @@ pub enum BinstallError { /// /// - Code: `binstall::unzip` /// - Exit: 66 - #[error(transparent)] + #[error("Failed to extract zipfile: {0}")] #[diagnostic(severity(error), code(binstall::unzip))] Unzip(#[from] ZipError), @@ -95,7 +95,7 @@ pub enum BinstallError { /// /// - Code: `binstall::template` /// - Exit: 67 - #[error(transparent)] + #[error("Failed to render template: {0}")] #[diagnostic(severity(error), code(binstall::template))] Template(Box), @@ -105,7 +105,7 @@ pub enum BinstallError { /// /// - Code: `binstall::reqwest` /// - Exit: 68 - #[error(transparent)] + #[error("Reqwest error: {0}")] #[diagnostic(severity(error), code(binstall::reqwest))] Reqwest(#[from] ReqwestError), @@ -137,7 +137,7 @@ pub enum BinstallError { /// /// - Code: `binstall::io` /// - Exit: 74 - #[error(transparent)] + #[error("I/O Error: {0}")] #[diagnostic(severity(error), code(binstall::io))] Io(io::Error), @@ -171,7 +171,7 @@ pub enum BinstallError { /// /// - Code: `binstall::cargo_manifest` /// - Exit: 78 - #[error(transparent)] + #[error("Failed to parse cargo manifest: {0}")] #[diagnostic( severity(error), code(binstall::cargo_manifest), From ff753f06f27b1b951a951a190b3f783e04b10eee Mon Sep 17 00:00:00 2001 From: figsoda Date: Thu, 9 Feb 2023 22:01:51 -0500 Subject: [PATCH 1028/2020] Make disabling static and rustls features possible (#782) Default features were turned on for binstalk and the `static` and `pkg-config` features of cargo-binstall didn't do anything --- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index c0a3b8d0..8eed2f2f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.7.1" } +binstalk = { path = "../binstalk", version = "0.7.1", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.2.0" } clap = { version = "4.1.4", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index a7a5707d..f91801e8 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.64" -binstalk-downloader = { version = "0.3.2", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.3.2", path = "../binstalk-downloader", default-features = false } binstalk-types = { version = "0.2.0", path = "../binstalk-types" } cargo_toml = "0.15.1" command-group = { version = "2.0.1", features = ["with-tokio"] } From c92f9ab11512f95a59dd8ddbb39fd427c6944244 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 10 Feb 2023 14:02:19 +1100 Subject: [PATCH 1029/2020] Bump tokio-util from 0.7.4 to 0.7.5 (#783) Bumps [tokio-util](https://github.com/tokio-rs/tokio) from 0.7.4 to 0.7.5. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-util-0.7.4...tokio-util-0.7.5) --- updated-dependencies: - dependency-name: tokio-util dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c07782ec..d2aef305 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2491,9 +2491,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb2e075f03b3d66d8d8785356224ba688d2906a371015e225beeb65ca92c740" +checksum = "7e267c18a719545b481171952a79f8c25c80361463ba44bc7fa9eba7c742ef4f" dependencies = [ "bytes", "futures-core", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index a9c01de0..54f3bcb8 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -32,7 +32,7 @@ tempfile = "3.3.0" thiserror = "1.0.38" tokio = { version = "1.25.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" -tokio-util = { version = "0.7.4", features = ["io"] } +tokio-util = { version = "0.7.5", features = ["io"] } tower = { version = "0.4.13", features = ["limit", "util"] } tracing = "0.1.37" trust-dns-resolver = { version = "0.22.0", optional = true, default-features = false, features = ["dnssec-ring"] } From 1a4f98085c13fdadf1e9da70dd8d27485b6a3baa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 10 Feb 2023 23:06:23 +1100 Subject: [PATCH 1030/2020] release: binstalk-types v0.2.1 (#784) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d2aef305..ba0ecb16 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -253,7 +253,7 @@ dependencies = [ [[package]] name = "binstalk-types" -version = "0.2.0" +version = "0.2.1" dependencies = [ "compact_str", "maybe-owned", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 54f3bcb8..6de9bcaa 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0" async-trait = "0.1.64" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.9", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } -binstalk-types = { version = "0.2.0", path = "../binstalk-types" } +binstalk-types = { version = "0.2.1", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" compact_str = "0.6.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index f0412fd5..c0fe67fb 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] beef = { version = "0.5.2", features = ["impl_serde"] } -binstalk-types = { version = "0.2.0", path = "../binstalk-types" } +binstalk-types = { version = "0.2.1", path = "../binstalk-types" } compact_str = { version = "0.6.1", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 00fd8613..fe0da931 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-types" description = "The binstall toolkit that contains basic types for binstalk crates" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-types" -version = "0.2.0" +version = "0.2.1" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index f91801e8..1b3fdcda 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.64" binstalk-downloader = { version = "0.3.2", path = "../binstalk-downloader", default-features = false } -binstalk-types = { version = "0.2.0", path = "../binstalk-types" } +binstalk-types = { version = "0.2.1", path = "../binstalk-types" } cargo_toml = "0.15.1" command-group = { version = "2.0.1", features = ["with-tokio"] } compact_str = { version = "0.6.1", features = ["serde"] } From b8d9a4d649c9f2290670c8b057adbc3a16b3cbfc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 10 Feb 2023 23:55:41 +1100 Subject: [PATCH 1031/2020] release: binstalk-manifests v0.3.0 (#785) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ba0ecb16..5ad72bdb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -232,7 +232,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.2.0" +version = "0.3.0" dependencies = [ "beef", "binstalk-types", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 8eed2f2f..273a2cdd 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.7.1", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.2.0" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.3.0" } clap = { version = "4.1.4", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index c0fe67fb..7d650e27 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.2.0" +version = "0.3.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From e03f9e0445f33a7dfb63de3c4fce7f5753746e8c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 11 Feb 2023 00:53:59 +1100 Subject: [PATCH 1032/2020] release: binstalk-downloader v0.3.3 (#786) chore: Release Co-authored-by: github-actions Co-authored-by: Jiahao XU --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5ad72bdb..ed6c8266 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -201,7 +201,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.3.2" +version = "0.3.3" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 6de9bcaa..cef54fcb 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.3.2" +version = "0.3.3" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 1b3fdcda..e98b5291 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.64" -binstalk-downloader = { version = "0.3.2", path = "../binstalk-downloader", default-features = false } +binstalk-downloader = { version = "0.3.3", path = "../binstalk-downloader", default-features = false } binstalk-types = { version = "0.2.1", path = "../binstalk-types" } cargo_toml = "0.15.1" command-group = { version = "2.0.1", features = ["with-tokio"] } From 166bd0590660974984de2fba25ac797907003e89 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 11 Feb 2023 00:54:27 +1100 Subject: [PATCH 1033/2020] release: binstalk v0.8.0 (#787) chore: Release Co-authored-by: github-actions Co-authored-by: Jiahao XU --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ed6c8266..677a1ee6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -168,7 +168,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.7.1" +version = "0.8.0" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 273a2cdd..6d483648 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.7.1", default-features = false } +binstalk = { path = "../binstalk", version = "0.8.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.3.0" } clap = { version = "4.1.4", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index e98b5291..bb2e79f1 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.7.1" +version = "0.8.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From b408a1a9dd83154bbf36127385664307d999549b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 11 Feb 2023 00:56:03 +1100 Subject: [PATCH 1034/2020] release: cargo-binstall v0.20.0 (#788) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 677a1ee6..907d246b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -353,7 +353,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.19.3" +version = "0.20.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 6d483648..97791471 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.19.3" +version = "0.20.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index f7a36d4f..31f91e5c 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From e84228ba01bd80623ba19013360a59a96ca8cee1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Feb 2023 14:59:38 +1100 Subject: [PATCH 1035/2020] Read `log_level` from env `CARGO_BINSTALL_LOG_LEVEL` if arg not present (#790) * Enable feature "env" on dep clap in bin * Read log_level from env `CARGO_BINSTALL_LOG_LEVEL` if arg not present Signed-off-by: Jiahao XU --- crates/bin/Cargo.toml | 2 +- crates/bin/src/args.rs | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 97791471..3025aacf 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.8.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.3.0" } -clap = { version = "4.1.4", features = ["derive"] } +clap = { version = "4.1.4", features = ["derive", "env"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" fs-lock = { version = "0.1.0", path = "../fs-lock" } diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 107c452c..8a3df325 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -226,7 +226,12 @@ pub struct Args { /// /// Set to `off` to disable logging completely, this will also /// disable output from `cargo-install`. - #[clap(help_heading = "Meta", long, value_name = "LEVEL")] + #[clap( + help_heading = "Meta", + long, + value_name = "LEVEL", + env = "CARGO_BINSTALL_LOG_LEVEL" + )] pub log_level: Option, /// Equivalent to setting `log_level` to `off`. From f46de3714aec3e9c66a2d2eab3f3bbc35e538621 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Feb 2023 14:48:28 +1100 Subject: [PATCH 1036/2020] Add step to relase-build to make sure it's runnable (#792) Signed-off-by: Jiahao XU --- .github/workflows/release-build.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index fa26c58e..bf7617ba 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -19,15 +19,15 @@ jobs: fail-fast: false matrix: include: - - { o: macos-latest, t: x86_64-apple-darwin } + - { o: macos-latest, t: x86_64-apple-darwin, r: true } - { o: macos-latest, t: aarch64-apple-darwin } - - { o: ubuntu-20.04, t: x86_64-unknown-linux-gnu } + - { o: ubuntu-20.04, t: x86_64-unknown-linux-gnu, r: true } - { o: ubuntu-20.04, t: armv7-unknown-linux-gnueabihf, c: true } - { o: ubuntu-20.04, t: aarch64-unknown-linux-gnu } - - { o: ubuntu-latest, t: x86_64-unknown-linux-musl } + - { o: ubuntu-latest, t: x86_64-unknown-linux-musl, r: true } - { o: ubuntu-latest, t: armv7-unknown-linux-musleabihf, c: true } - { o: ubuntu-latest, t: aarch64-unknown-linux-musl, c: true } - - { o: windows-latest, t: x86_64-pc-windows-msvc } + - { o: windows-latest, t: x86_64-pc-windows-msvc, r: true } - { o: windows-latest, t: aarch64-pc-windows-msvc } name: ${{ matrix.t }} @@ -52,6 +52,10 @@ jobs: - if: runner.os != 'Windows' run: ls -shal packages/ + - name: Ensure release binary is runnable + if: "matrix.r" + run: ./target/${{ matrix.t }}/release/cargo-binstall -V + - if: inputs.publish name: Upload to release uses: svenstaro/upload-release-action@v2 From 015bd2e47a5479b5437c063419cb6b9bdb6dae8d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Feb 2023 15:33:28 +1100 Subject: [PATCH 1037/2020] Update transitive deps (#768) Signed-off-by: Jiahao XU --- Cargo.lock | 203 ++++++++++++++++++++++++++++------------------------- 1 file changed, 109 insertions(+), 94 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 907d246b..8d6a009c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -314,9 +314,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.11.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" [[package]] name = "byteorder" @@ -385,7 +385,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "189929343288eb08d1f418bfbc022a5bddc6889e4a8f8dfaf06035fd3adf6fed" dependencies = [ "serde", - "toml 0.7.1", + "toml 0.7.2", ] [[package]] @@ -399,9 +399,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" dependencies = [ "jobserver", ] @@ -563,9 +563,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.86" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51d1075c37807dcf850c379432f0df05ba52cc30f279c5cfc43cc221ce7f8579" +checksum = "90d59d9acd2a682b4e40605a242f6670eaa58c5957471cbf85e8aa6a0b97a5e8" dependencies = [ "cc", "cxxbridge-flags", @@ -575,9 +575,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.86" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5044281f61b27bc598f2f6647d480aed48d2bf52d6eb0b627d84c0361b17aa70" +checksum = "ebfa40bda659dd5c864e65f4c9a2b0aff19bea56b017b9b77c73d3766a453a38" dependencies = [ "cc", "codespan-reporting", @@ -590,15 +590,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.86" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61b50bc93ba22c27b0d31128d2d130a0a6b3d267ae27ef7e4fae2167dfe8781c" +checksum = "457ce6757c5c70dc6ecdbda6925b958aae7f959bda7d8fb9bde889e34a09dc03" [[package]] name = "cxxbridge-macro" -version = "1.0.86" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e61fda7e62115119469c7b3591fd913ecca96fb766cfd3f2e2502ab7bc87a5" +checksum = "ebf883b7aacd7b2aeb2a7b338648ee19f57c140d4ee8e52c68979c6b2f7f2263" dependencies = [ "proc-macro2", "quote", @@ -678,9 +678,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.31" +version = "0.8.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" dependencies = [ "cfg-if", ] @@ -729,14 +729,14 @@ dependencies = [ [[package]] name = "filetime" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9" +checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" dependencies = [ "cfg-if", "libc", "redox_syscall", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -800,9 +800,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" +checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" dependencies = [ "futures-channel", "futures-core", @@ -831,9 +831,9 @@ checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" [[package]] name = "futures-executor" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" +checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" dependencies = [ "futures-core", "futures-task", @@ -929,9 +929,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793" +checksum = "221996f774192f0f718773def8201c4ae31f02616a54ccfc2d358bb0e5cefdec" [[package]] name = "guess_host_triple" @@ -975,9 +975,9 @@ 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" @@ -997,6 +997,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + [[package]] name = "home" version = "0.5.4" @@ -1053,9 +1059,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.23" +version = "0.14.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c" dependencies = [ "bytes", "futures-channel", @@ -1173,12 +1179,12 @@ checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" [[package]] name = "io-lifetimes" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e" +checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -1201,14 +1207,14 @@ checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" [[package]] name = "is-terminal" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" +checksum = "22e18b0a45d56fe973d6db23972bf5bc46f988a4a2385deac9cc29572f09daef" dependencies = [ - "hermit-abi 0.2.6", - "io-lifetimes 1.0.4", - "rustix 0.36.6", - "windows-sys", + "hermit-abi 0.3.1", + "io-lifetimes 1.0.5", + "rustix 0.36.8", + "windows-sys 0.45.0", ] [[package]] @@ -1252,14 +1258,14 @@ dependencies = [ "libc", "scopeguard", "tokio", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" dependencies = [ "wasm-bindgen", ] @@ -1370,9 +1376,9 @@ checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" [[package]] name = "matches" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "maybe-owned" @@ -1453,7 +1459,7 @@ dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -1476,9 +1482,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a58d1d356c6597d08cde02c2f09d785b09e28711837b1ed667dc652c08a694" +checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" dependencies = [ "bitflags", "cfg-if", @@ -1540,9 +1546,9 @@ dependencies = [ [[package]] name = "object" -version = "0.30.2" +version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b8c786513eb403643f2a88c244c2aaa270ef2153f55094587d0c48a3cf22a83" +checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" dependencies = [ "memchr", ] @@ -1628,15 +1634,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -1715,9 +1721,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.50" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" +checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" dependencies = [ "unicode-ident", ] @@ -1963,21 +1969,21 @@ dependencies = [ "io-lifetimes 0.7.5", "libc", "linux-raw-sys 0.0.46", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] name = "rustix" -version = "0.36.6" +version = "0.36.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549" +checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" dependencies = [ "bitflags", "errno", - "io-lifetimes 1.0.4", + "io-lifetimes 1.0.5", "libc", "linux-raw-sys 0.1.4", - "windows-sys", + "windows-sys 0.45.0", ] [[package]] @@ -2040,7 +2046,7 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" dependencies = [ - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2067,9 +2073,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.7.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" dependencies = [ "bitflags", "core-foundation", @@ -2080,9 +2086,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.6.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" dependencies = [ "core-foundation-sys", "libc", @@ -2178,9 +2184,9 @@ dependencies = [ [[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", ] @@ -2407,9 +2413,9 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" @@ -2428,7 +2434,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys", + "windows-sys 0.42.0", ] [[package]] @@ -2444,9 +2450,9 @@ dependencies = [ [[package]] name = "tokio-native-tls" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", "tokio", @@ -2491,9 +2497,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e267c18a719545b481171952a79f8c25c80361463ba44bc7fa9eba7c742ef4f" +checksum = "bc6a3b08b64e6dfad376fa2432c7b1f01522e37a623c3050bc95db2d3ff21583" dependencies = [ "bytes", "futures-core", @@ -2514,9 +2520,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "772c1426ab886e7362aedf4abc9c0d1348a979517efedfc25862944d10137af0" +checksum = "f7afcae9e3f0fe2c370fd4657108972cbb2fa9db1b9f84849cefd80741b01cb6" dependencies = [ "serde", "serde_spanned", @@ -2720,9 +2726,9 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" [[package]] name = "unicode-ident" @@ -2835,9 +2841,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2845,9 +2851,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" dependencies = [ "bumpalo", "log", @@ -2860,9 +2866,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" dependencies = [ "cfg-if", "js-sys", @@ -2872,9 +2878,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2882,9 +2888,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", @@ -2895,9 +2901,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" [[package]] name = "wasm-streams" @@ -2914,9 +2920,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.60" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" dependencies = [ "js-sys", "wasm-bindgen", @@ -3002,6 +3008,15 @@ dependencies = [ "windows_x86_64_msvc", ] +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-targets" version = "0.42.1" @@ -3101,7 +3116,7 @@ version = "0.12.3+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" dependencies = [ - "zstd-safe 6.0.3+zstd.1.5.2", + "zstd-safe 6.0.4+zstd.1.5.4", ] [[package]] @@ -3116,9 +3131,9 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "6.0.3+zstd.1.5.2" +version = "6.0.4+zstd.1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e4a3f57d13d0ab7e478665c60f35e2a613dcd527851c2c7287ce5c787e134a" +checksum = "7afb4b54b8910cf5447638cb54bf4e8a65cbedd783af98b98c62ffe91f185543" dependencies = [ "libc", "zstd-sys", @@ -3126,9 +3141,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.5+zstd.1.5.2" +version = "2.0.7+zstd.1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc50ffce891ad571e9f9afe5039c4837bede781ac4bb13052ed7ae695518596" +checksum = "94509c3ba2fe55294d752b79842c530ccfab760192521df74a081a78d2b3c7f5" dependencies = [ "cc", "libc", From 1b2fb08bcb10f1be56c2eb6fe4f0be4ebc1672ca Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 12 Feb 2023 15:46:27 +1100 Subject: [PATCH 1038/2020] release: cargo-binstall v0.20.1 (#793) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8d6a009c..8e3c5ec8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -353,7 +353,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.20.0" +version = "0.20.1" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 3025aacf..7c249476 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.20.0" +version = "0.20.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 31f91e5c..1a0c4132 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 87686cb2f72fdb804b303d3832144f549ca6543f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 13 Feb 2023 13:43:48 +1100 Subject: [PATCH 1039/2020] Feature: Better retry policy in `binstalk-downloader` (#794) Fixed #779 #791 - Retry request on timeout - Retry for `StatusCode::{REQUEST_TIMEOUT, GATEWAY_TIMEOUT}` - Add `DEFAULT_RETRY_DURATION_FOR_RATE_LIMIT` for 503/429 if 503/429 does not give us a header or give us an invalid header on when to retry, we would default to `DEFAULT_RETRY_DURATION_FOR_RATE_LIMIT`. - Fix `Client::get_redirected_final_url`: Retry using `GET` on status code 400..405 + 410 - Rename remote_exists => remote_gettable & support fallback to GET if HEAD fails due to status code 400..405 + 410. - Improve `Client::get_stream`: Include url & method in the err of the stream returned Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 1 + crates/bin/src/logging.rs | 7 +- crates/binstalk-downloader/src/remote.rs | 195 +++++++++++++----- .../src/remote/delay_request.rs | 68 ++++-- crates/binstalk/src/fetchers/gh_crate_meta.rs | 9 +- crates/binstalk/src/fetchers/quickinstall.rs | 13 +- 6 files changed, 202 insertions(+), 91 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a986ca37..9d7c9bda 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,6 +38,7 @@ jobs: runs-on: ${{ matrix.os }} env: CARGO_BUILD_TARGET: ${{ matrix.target }} + CARGO_BINSTALL_LOG_LEVEL: debug steps: - uses: actions/checkout@v3 diff --git a/crates/bin/src/logging.rs b/crates/bin/src/logging.rs index 2db20e2f..acda166f 100644 --- a/crates/bin/src/logging.rs +++ b/crates/bin/src/logging.rs @@ -193,8 +193,11 @@ pub fn logging(log_level: LevelFilter, json_output: bool) { // Calculate log_level let log_level = min(log_level, STATIC_MAX_LEVEL); - let allowed_targets = - (log_level != LevelFilter::Trace).then_some(["binstalk", "cargo_binstall"]); + let allowed_targets = (log_level != LevelFilter::Trace).then_some([ + "binstalk", + "binstalk_downloader", + "cargo_binstall", + ]); // Forward log to tracing Logger::init(log_level); diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 5f2ea6d0..d9cc7ab7 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -1,5 +1,6 @@ use std::{ - num::NonZeroU64, + num::{NonZeroU64, NonZeroU8}, + ops::ControlFlow, sync::Arc, time::{Duration, SystemTime}, }; @@ -12,7 +13,6 @@ use reqwest::{ Request, Response, StatusCode, }; use thiserror::Error as ThisError; -use tokio::time::Instant; use tower::{limit::rate::RateLimit, Service, ServiceBuilder, ServiceExt}; use tracing::{debug, info}; @@ -24,6 +24,8 @@ use delay_request::DelayRequest; const MAX_RETRY_DURATION: Duration = Duration::from_secs(120); const MAX_RETRY_COUNT: u8 = 3; +const DEFAULT_RETRY_DURATION_FOR_RATE_LIMIT: Duration = Duration::from_millis(200); +const RETRY_DURATION_FOR_TIMEOUT: Duration = Duration::from_millis(200); const DEFAULT_MIN_TLS: tls::Version = tls::Version::TLS_1_2; #[derive(Debug, ThisError)] @@ -100,46 +102,88 @@ impl Client { &self.0.client } + /// Return `Err(_)` for fatal error tht cannot be retried. + /// + /// Return `Ok(ControlFlow::Continue(res))` for retryable error, `res` + /// will contain the previous `Result`. + /// A retryable error could be a `ReqwestError` or `Response` with + /// unsuccessful status code. + /// + /// Return `Ok(ControlFlow::Break(response))` when succeeds and no need + /// to retry. + async fn do_send_request( + &self, + method: &Method, + url: &Url, + ) -> Result>, ReqwestError> { + let request = Request::new(method.clone(), url.clone()); + + let future = (&self.0.service).ready().await?.call(request); + + let response = match future.await { + Err(err) if err.is_timeout() => { + let duration = RETRY_DURATION_FOR_TIMEOUT; + + info!("Received timeout error from reqwest. Delay future request by {duration:#?}"); + + self.0.service.add_urls_to_delay(&[url], duration); + + return Ok(ControlFlow::Continue(Err(err))); + } + res => res?, + }; + + let status = response.status(); + + let add_delay_and_continue = |response: Response, duration| { + info!("Receiver status code {status}, will wait for {duration:#?} and retry"); + + self.0 + .service + .add_urls_to_delay(&[url, response.url()], duration); + + Ok(ControlFlow::Continue(Ok(response))) + }; + + match status { + // Delay further request on rate limit + StatusCode::SERVICE_UNAVAILABLE | StatusCode::TOO_MANY_REQUESTS => { + let duration = parse_header_retry_after(response.headers()) + .unwrap_or(DEFAULT_RETRY_DURATION_FOR_RATE_LIMIT) + .min(MAX_RETRY_DURATION); + + add_delay_and_continue(response, duration) + } + + // Delay further request on timeout + StatusCode::REQUEST_TIMEOUT | StatusCode::GATEWAY_TIMEOUT => { + add_delay_and_continue(response, RETRY_DURATION_FOR_TIMEOUT) + } + + _ => Ok(ControlFlow::Break(response)), + } + } + async fn send_request_inner( &self, method: &Method, url: &Url, ) -> Result { let mut count = 0; + let max_retry_count = NonZeroU8::new(MAX_RETRY_COUNT).unwrap(); + // Since max_retry_count is non-zero, there is at least one iteration. loop { - let request = Request::new(method.clone(), url.clone()); - - let future = (&self.0.service).ready().await?.call(request); - - let response = future.await?; - - let status = response.status(); - - match (status, parse_header_retry_after(response.headers())) { - ( - // 503 429 - StatusCode::SERVICE_UNAVAILABLE | StatusCode::TOO_MANY_REQUESTS, - Some(duration), - ) => { - let duration = duration.min(MAX_RETRY_DURATION); - - info!("Receiver status code {status}, will wait for {duration:#?} and retry"); - - let deadline = Instant::now() + duration; - - self.0 - .service - .add_urls_to_delay(dedup([url, response.url()]), deadline); - - if count >= MAX_RETRY_COUNT { - break Ok(response); - } - } - _ => break Ok(response), - } - + // Increment the counter before checking for terminal condition. count += 1; + + match self.do_send_request(method, url).await? { + ControlFlow::Break(response) => break Ok(response), + ControlFlow::Continue(res) if count >= max_retry_count.get() => { + break res; + } + _ => (), + } } } @@ -161,22 +205,57 @@ impl Client { .map_err(|err| Error::Http(Box::new(HttpError { method, url, err }))) } - /// Check if remote exists using `method`. - pub async fn remote_exists(&self, url: Url, method: Method) -> Result { - Ok(self - .send_request(method, url, false) - .await? - .status() - .is_success()) + async fn head_or_fallback_to_get( + &self, + url: Url, + error_for_status: bool, + ) -> Result { + let res = self + .send_request(Method::HEAD, url.clone(), error_for_status) + .await; + + let retry_with_get = move || async move { + // Retry using GET + info!("HEAD on {url} is not allowed, fallback to GET"); + self.send_request(Method::GET, url, error_for_status).await + }; + + let is_retryable = |status| { + matches!( + status, + StatusCode::BAD_REQUEST // 400 + | StatusCode::UNAUTHORIZED // 401 + | StatusCode::FORBIDDEN // 403 + | StatusCode::NOT_FOUND // 404 + | StatusCode::METHOD_NOT_ALLOWED // 405 + | StatusCode::GONE // 410 + ) + }; + + match res { + Err(Error::Http(http_error)) + if http_error.err.status().map(is_retryable).unwrap_or(false) => + { + retry_with_get().await + } + Ok(response) if is_retryable(response.status()) => retry_with_get().await, + res => res, + } } - /// Attempt to get final redirected url. + /// Check if remote exists using `Method::HEAD` or `Method::GET` as fallback. + pub async fn remote_gettable(&self, url: Url) -> Result { + self.head_or_fallback_to_get(url, false) + .await + .map(|response| response.status().is_success()) + } + + /// Attempt to get final redirected url using `Method::HEAD` or fallback + /// to `Method::GET`. pub async fn get_redirected_final_url(&self, url: Url) -> Result { - Ok(self - .send_request(Method::HEAD, url, true) - .await? - .url() - .clone()) + self.head_or_fallback_to_get(url, true) + .await + .map(|response| response.url().clone()) } /// Create `GET` request to `url` and return a stream of the response data. @@ -187,9 +266,19 @@ impl Client { ) -> Result>, Error> { debug!("Downloading from: '{url}'"); - self.send_request(Method::GET, url, true) - .await - .map(|response| response.bytes_stream().map(|res| res.map_err(Error::from))) + let response = self.send_request(Method::GET, url.clone(), true).await?; + + let url = Box::new(url); + + Ok(response.bytes_stream().map(move |res| { + res.map_err(|err| { + Error::Http(Box::new(HttpError { + method: Method::GET, + url: Url::clone(&*url), + err, + })) + }) + })) } } @@ -219,11 +308,3 @@ fn parse_header_retry_after(headers: &HeaderMap) -> Option { } } } - -fn dedup(urls: [&Url; 2]) -> impl Iterator { - if urls[0] == urls[1] { - Some(urls[0]).into_iter().chain(None) - } else { - Some(urls[0]).into_iter().chain(Some(urls[1])) - } -} diff --git a/crates/binstalk-downloader/src/remote/delay_request.rs b/crates/binstalk-downloader/src/remote/delay_request.rs index 64af08a9..8e20682b 100644 --- a/crates/binstalk-downloader/src/remote/delay_request.rs +++ b/crates/binstalk-downloader/src/remote/delay_request.rs @@ -1,6 +1,7 @@ use std::{ collections::HashMap, future::Future, + iter::Peekable, pin::Pin, sync::Mutex, task::{Context, Poll}, @@ -10,10 +11,41 @@ use compact_str::{CompactString, ToCompactString}; use reqwest::{Request, Url}; use tokio::{ sync::Mutex as AsyncMutex, - time::{sleep_until, Instant}, + time::{sleep_until, Duration, Instant}, }; use tower::{Service, ServiceExt}; +trait IterExt: Iterator { + fn dedup(self) -> Dedup + where + Self: Sized, + Self::Item: PartialEq, + { + Dedup(self.peekable()) + } +} + +impl IterExt for It {} + +struct Dedup(Peekable); + +impl Iterator for Dedup +where + It: Iterator, + It::Item: PartialEq, +{ + type Item = It::Item; + + fn next(&mut self) -> Option { + let curr = self.0.next()?; + + // Drop all consecutive dup values + while self.0.next_if_eq(&curr).is_some() {} + + Some(curr) + } +} + #[derive(Debug)] pub(super) struct DelayRequest { inner: AsyncMutex, @@ -28,31 +60,33 @@ impl DelayRequest { } } - pub(super) fn add_urls_to_delay<'a, Urls>(&self, urls: Urls, deadline: Instant) - where - Urls: IntoIterator, - { + pub(super) fn add_urls_to_delay(&self, urls: &[&Url], delay_duration: Duration) { + let deadline = Instant::now() + delay_duration; + let mut hosts_to_delay = self.hosts_to_delay.lock().unwrap(); - urls.into_iter().filter_map(Url::host_str).for_each(|host| { - hosts_to_delay - .entry(host.to_compact_string()) - .and_modify(|old_dl| { - *old_dl = deadline.max(*old_dl); - }) - .or_insert(deadline); - }); + urls.iter() + .filter_map(|url| url.host_str()) + .dedup() + .for_each(|host| { + hosts_to_delay + .entry(host.to_compact_string()) + .and_modify(|old_dl| { + *old_dl = deadline.max(*old_dl); + }) + .or_insert(deadline); + }); } fn wait_until_available(&self, url: &Url) -> impl Future + Send + 'static { let mut hosts_to_delay = self.hosts_to_delay.lock().unwrap(); - let sleep = url + let deadline = url .host_str() .and_then(|host| hosts_to_delay.get(host).map(|deadline| (*deadline, host))) .and_then(|(deadline, host)| { if deadline.elapsed().is_zero() { - Some(sleep_until(deadline)) + Some(deadline) } else { // We have already gone past the deadline, // so we should remove it instead. @@ -62,8 +96,8 @@ impl DelayRequest { }); async move { - if let Some(sleep) = sleep { - sleep.await; + if let Some(deadline) = deadline { + sleep_until(deadline).await; } } } diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 5d25bb3c..14478a68 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -13,9 +13,7 @@ use url::Url; use crate::{ errors::{BinstallError, InvalidPkgFmtError}, helpers::{ - download::Download, - futures_resolver::FuturesResolver, - remote::{Client, Method}, + download::Download, futures_resolver::FuturesResolver, remote::Client, tasks::AutoAbortJoinHandle, }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, @@ -68,8 +66,9 @@ impl GhCrateMeta { async move { debug!("Checking for package at: '{url}'"); - Ok((client.remote_exists(url.clone(), Method::HEAD).await? - || client.remote_exists(url.clone(), Method::GET).await?) + Ok(client + .remote_gettable(url.clone()) + .await? .then_some((url, pkg_fmt))) } }) diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs index 109fa5ae..884409cb 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk/src/fetchers/quickinstall.rs @@ -6,11 +6,7 @@ use url::Url; use crate::{ errors::BinstallError, - helpers::{ - download::Download, - remote::{Client, Method}, - tasks::AutoAbortJoinHandle, - }, + helpers::{download::Download, remote::Client, tasks::AutoAbortJoinHandle}, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; @@ -60,10 +56,7 @@ impl super::Fetcher for QuickInstall { let url = self.package_url(); debug!("Checking for package at: '{url}'"); - Ok(self - .client - .remote_exists(Url::parse(&url)?, Method::HEAD) - .await?) + Ok(self.client.remote_gettable(Url::parse(&url)?).await?) }) } @@ -124,7 +117,7 @@ impl QuickInstall { let url = Url::parse(&self.stats_url())?; debug!("Sending installation report to quickinstall ({url})"); - self.client.remote_exists(url, Method::HEAD).await?; + self.client.remote_gettable(url).await?; Ok(()) } From 04113e9dd95342e34e3bb612b91a74d47b04f9be Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 13 Feb 2023 13:44:24 +1100 Subject: [PATCH 1040/2020] Rm `NOVERSION_FILENAMES` "{ name }{ archive-suffix }" (#795) which does not contain `target`, hence it might report the binary being available for any target we specified. Signed-off-by: Jiahao XU --- SUPPORT.md | 1 - crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs | 1 - 2 files changed, 2 deletions(-) diff --git a/SUPPORT.md b/SUPPORT.md index d0ff1850..d47dc42e 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -71,7 +71,6 @@ are: - `{ name }_{ version }_{ target }{ archive-suffix }` - `{ name }_v{ version }_{ target }{ archive-suffix }` - `{ name }-{ target }{ archive-suffix }` ("versionless") -- `{ name }{ archive-suffix }` ("versionless") - `{ name }_{ target }{ archive-suffix }` ("versionless") The paths are: diff --git a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs index 00a030fa..34e4c74e 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs @@ -27,7 +27,6 @@ pub const FULL_FILENAMES: &[&str] = &[ pub const NOVERSION_FILENAMES: &[&str] = &[ "{ name }-{ target }{ archive-suffix }", - "{ name }{ archive-suffix }", "{ name }_{ target }{ archive-suffix }", ]; From 7c15dd20523a3b88cb0bf57c92c52b4133fadd55 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 13 Feb 2023 15:31:15 +1100 Subject: [PATCH 1041/2020] Revert "Read `log_level` from env `CARGO_BINSTALL_LOG_LEVEL` if arg not present" (#796) This reverts commit e84228ba01bd80623ba19013360a59a96ca8cee1. --- crates/bin/Cargo.toml | 2 +- crates/bin/src/args.rs | 7 +------ 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 7c249476..672dd89e 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.8.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.3.0" } -clap = { version = "4.1.4", features = ["derive", "env"] } +clap = { version = "4.1.4", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" fs-lock = { version = "0.1.0", path = "../fs-lock" } diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 8a3df325..107c452c 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -226,12 +226,7 @@ pub struct Args { /// /// Set to `off` to disable logging completely, this will also /// disable output from `cargo-install`. - #[clap( - help_heading = "Meta", - long, - value_name = "LEVEL", - env = "CARGO_BINSTALL_LOG_LEVEL" - )] + #[clap(help_heading = "Meta", long, value_name = "LEVEL")] pub log_level: Option, /// Equivalent to setting `log_level` to `off`. From 28415f7927a55269743dd84235f310d0f71de280 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Feb 2023 17:14:15 +1100 Subject: [PATCH 1042/2020] Bump tokio-util from 0.7.6 to 0.7.7 (#797) Bumps [tokio-util](https://github.com/tokio-rs/tokio) from 0.7.6 to 0.7.7. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-util-0.7.6...tokio-util-0.7.7) --- updated-dependencies: - dependency-name: tokio-util dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e3c5ec8..69fceec8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2497,9 +2497,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6a3b08b64e6dfad376fa2432c7b1f01522e37a623c3050bc95db2d3ff21583" +checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" dependencies = [ "bytes", "futures-core", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index cef54fcb..d77cc12e 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -32,7 +32,7 @@ tempfile = "3.3.0" thiserror = "1.0.38" tokio = { version = "1.25.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" -tokio-util = { version = "0.7.5", features = ["io"] } +tokio-util = { version = "0.7.7", features = ["io"] } tower = { version = "0.4.13", features = ["limit", "util"] } tracing = "0.1.37" trust-dns-resolver = { version = "0.22.0", optional = true, default-features = false, features = ["dnssec-ring"] } From 3fffe3963561b1e13716ca94cb8b6901285adccf Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 13 Feb 2023 17:26:16 +1100 Subject: [PATCH 1043/2020] Document environment variable `BINSTALL_LOG_LEVEL` (#798) Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 107c452c..5cae7d82 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -226,6 +226,10 @@ pub struct Args { /// /// Set to `off` to disable logging completely, this will also /// disable output from `cargo-install`. + /// + /// If `--log-level` is not specified on cmdline, then cargo-binstall + /// will try to read environment variable `BINSTALL_LOG_LEVEL` and + /// interpret it as a log-level. #[clap(help_heading = "Meta", long, value_name = "LEVEL")] pub log_level: Option, From 647f02bb5958ca21036982df90249c98545d4e9a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 15 Feb 2023 09:19:59 +1100 Subject: [PATCH 1044/2020] Use `cargo-zigbuild` for cross compilation (#767) * Disable link arg `-lgcc` for musl builds when `cargo-zigbuild` is used Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 2 +- .github/workflows/release-build.yml | 2 +- justfile | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9d7c9bda..5f9c4e8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,7 @@ jobs: runs-on: ubuntu-latest env: CARGO_BUILD_TARGET: ${{ matrix.target }} - JUST_USE_CROSS: true + JUST_USE_CARGO_ZIGBUILD: true steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index bf7617ba..45f78f22 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -34,7 +34,7 @@ jobs: runs-on: ${{ matrix.o }} env: CARGO_BUILD_TARGET: ${{ matrix.t }} - JUST_USE_CROSS: ${{ matrix.c }} + JUST_USE_CARGO_ZIGBUILD: ${{ matrix.c }} JUST_FOR_RELEASE: true steps: diff --git a/justfile b/justfile index 6d903a05..521332e4 100644 --- a/justfile +++ b/justfile @@ -2,6 +2,7 @@ ci := env_var_or_default("CI", "") for-release := env_var_or_default("JUST_FOR_RELEASE", "") use-cross := env_var_or_default("JUST_USE_CROSS", "") +use-cargo-zigbuild := env_var_or_default("JUST_USE_CARGO_ZIGBUILD", "") extra-build-args := env_var_or_default("JUST_EXTRA_BUILD_ARGS", "") extra-features := env_var_or_default("JUST_EXTRA_FEATURES", "") default-features := env_var_or_default("JUST_DEFAULT_FEATURES", "") @@ -36,7 +37,7 @@ output-folder := if target != target-host { "target" / target / output-profile-f output-path := output-folder / output-filename # which tool to use for compiling -cargo-bin := if use-cross != "" { "cross" } else { "cargo +nightly" } +cargo-bin := if use-cargo-zigbuild != "" { "cargo-zigbuild" } else if use-cross != "" { "cross" } else { "cargo +nightly" } # cargo compile options cargo-profile := if for-release != "" { "release" } else { "dev" } @@ -52,7 +53,7 @@ cargo-buildstd := if (cargo-profile / ci-or-no) == "release/ci" { # In musl release builds in CI, statically link gcclibs. rustc-gcclibs := if (cargo-profile / ci-or-no / target-libc) == "release/ci/musl" { - " -C link-arg=-lgcc -C link-arg=-static-libgcc" + if use-cargo-zigbuild != "" { "-C link-arg=-static-libgcc" } else { " -C link-arg=-lgcc -C link-arg=-static-libgcc" } } else { "" } # disable default features in CI for debug builds, for speed @@ -94,8 +95,8 @@ ci-apt-deps := if target == "x86_64-unknown-linux-gnu" { "liblzma-dev libzip-dev [linux] ci-install-deps: - {{ if ci-apt-deps == "" { "exit" } else { "" } }} - sudo apt update && sudo apt install -y --no-install-recommends {{ci-apt-deps}} + if [ -n "{{ci-apt-deps}}" ]; then sudo apt update && sudo apt install -y --no-install-recommends {{ci-apt-deps}}; fi + pip3 install cargo-zigbuild [macos] [windows] From 9635e05d6c942675189a4f53c78ccb3d42a0207c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 15 Feb 2023 09:33:59 +1100 Subject: [PATCH 1045/2020] Support adding root cert via env `CARGO_HTTP_CAINFO`, `SSL_CERT_{FILE, PATH}` (#774) * Support for custom root cert in `binstalk_downloader::remote::Client` * Support adding root cert via env `CARGO_HTTP_CAINFO`, `SSL_CERT_{FILE, PATH}` Signed-off-by: Jiahao XU --- crates/bin/src/entry.rs | 15 ++++- crates/binstalk-downloader/src/remote.rs | 24 +++++-- .../src/remote/certificate.rs | 67 +++++++++++++++++++ 3 files changed, 101 insertions(+), 5 deletions(-) create mode 100644 crates/binstalk-downloader/src/remote/certificate.rs diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 69da24ee..7a20e43c 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -4,7 +4,11 @@ use binstalk::{ errors::BinstallError, fetchers::{Fetcher, GhCrateMeta, QuickInstall}, get_desired_targets, - helpers::{jobserver_client::LazyJobserverClient, remote::Client, tasks::AutoAbortJoinHandle}, + helpers::{ + jobserver_client::LazyJobserverClient, + remote::{Certificate, Client}, + tasks::AutoAbortJoinHandle, + }, ops::{ self, resolve::{CrateName, Resolution, ResolutionFetch, VersionReqExt}, @@ -73,6 +77,15 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - args.min_tls_version.map(|v| v.into()), Duration::from_millis(rate_limit.duration.get()), rate_limit.request_count, + ["CARGO_HTTP_CAINFO", "SSL_CERT_FILE", "SSL_CERT_PATH"] + .into_iter() + .filter_map(|env_name| match Certificate::from_env(env_name) { + Ok(option) => option, + Err(err) => { + warn!("Failed to load root certificate specified by env {env_name}: {err}",); + None + } + }), ) .map_err(BinstallError::from)?; diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index d9cc7ab7..e301614b 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -22,6 +22,9 @@ pub use url::Url; mod delay_request; use delay_request::DelayRequest; +mod certificate; +pub use certificate::{Certificate, OpenCertificateError}; + const MAX_RETRY_DURATION: Duration = Duration::from_secs(120); const MAX_RETRY_COUNT: u8 = 3; const DEFAULT_RETRY_DURATION_FOR_RATE_LIMIT: Duration = Duration::from_millis(200); @@ -66,23 +69,30 @@ impl Client { min_tls: Option, per: Duration, num_request: NonZeroU64, + certificates: impl IntoIterator, ) -> Result { fn inner( user_agent: &str, min_tls: Option, per: Duration, num_request: NonZeroU64, + certificates: &mut dyn Iterator, ) -> Result { let tls_ver = min_tls .map(|tls| tls.max(DEFAULT_MIN_TLS)) .unwrap_or(DEFAULT_MIN_TLS); - let client = reqwest::ClientBuilder::new() + let mut builder = reqwest::ClientBuilder::new() .user_agent(user_agent) .https_only(true) .min_tls_version(tls_ver) - .tcp_nodelay(false) - .build()?; + .tcp_nodelay(false); + + for certificate in certificates { + builder = builder.add_root_certificate(certificate.0); + } + + let client = builder.build()?; Ok(Client(Arc::new(Inner { client: client.clone(), @@ -94,7 +104,13 @@ impl Client { }))) } - inner(user_agent.as_ref(), min_tls, per, num_request) + inner( + user_agent.as_ref(), + min_tls, + per, + num_request, + &mut certificates.into_iter(), + ) } /// Return inner reqwest client. diff --git a/crates/binstalk-downloader/src/remote/certificate.rs b/crates/binstalk-downloader/src/remote/certificate.rs new file mode 100644 index 00000000..553c5c3f --- /dev/null +++ b/crates/binstalk-downloader/src/remote/certificate.rs @@ -0,0 +1,67 @@ +use std::{env, ffi::OsStr, fs, io, path::Path}; + +use compact_str::CompactString; +use reqwest::tls; +use thiserror::Error as ThisError; + +use super::ReqwestError; + +#[derive(Debug, ThisError)] +pub enum OpenCertificateError { + #[error(transparent)] + Reqwest(#[from] ReqwestError), + + #[error(transparent)] + Io(#[from] io::Error), + + #[error("Expected extension .pem or .der, but found {0:#?}")] + UnknownExtensions(Option), +} + +#[derive(Clone, Debug)] +pub struct Certificate(pub(super) tls::Certificate); + +impl Certificate { + /// Open Certificate with path specified by the environment variable `name` + pub fn from_env(name: impl AsRef) -> Result, OpenCertificateError> { + Self::from_env_inner(name.as_ref()) + } + + fn from_env_inner(name: &OsStr) -> Result, OpenCertificateError> { + env::var_os(name) + .map(|value| Self::open_inner(Path::new(&value))) + .transpose() + } + + /// Open Certificate on disk and automatically detect its format based on + /// its extension. + pub fn open(path: impl AsRef) -> Result { + Self::open_inner(path.as_ref()) + } + + fn open_inner(path: &Path) -> Result { + let ext = path.extension(); + + let f = if ext == Some(OsStr::new("pem")) { + Self::from_pem + } else if ext == Some(OsStr::new("der")) { + Self::from_der + } else { + return Err(OpenCertificateError::UnknownExtensions( + ext.map(|os_str| os_str.to_string_lossy().into()), + )); + }; + + Ok(f(fs::read(path)?)?) + } + + /// Create a Certificate from a binary DER encoded certificate + pub fn from_der(der: impl AsRef<[u8]>) -> Result { + tls::Certificate::from_der(der.as_ref()).map(Self) + } + + /// Create a Certificate from a PEM encoded certificate + pub fn from_pem(pem: impl AsRef<[u8]>) -> Result { + tls::Certificate::from_pem(pem.as_ref()).map(Self) + } +} From 1e49460ac7294da4455c5ec691658f9e38d9ccce Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 15 Feb 2023 12:01:14 +1100 Subject: [PATCH 1046/2020] Fix use of `StreamReadable`: Ensure no empty `Bytes` (#799) which would cause the `StreamReadable` to return eof even if the underlying stream is still open and has not sent EOF yet. Fixed #777 Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/download/async_extracter.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/binstalk-downloader/src/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs index ecb087a5..2c8115cc 100644 --- a/crates/binstalk-downloader/src/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -96,6 +96,10 @@ where try_join( async move { while let Some(bytes) = stream.next().await.transpose()? { + if bytes.is_empty() { + continue; + } + if tx.send(bytes).await.is_err() { // The extract tar returns, which could be that: // - Extraction fails with an error From 30f77221313fdfb13617ca830967834c9809d162 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Feb 2023 02:39:44 +0000 Subject: [PATCH 1047/2020] Bump once_cell from 1.17.0 to 1.17.1 (#803) --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 69fceec8..4c852745 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1555,9 +1555,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.0" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "openssl" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 672dd89e..2047ff53 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -31,7 +31,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } log = { version = "0.4.17", features = ["std"] } miette = "5.5.0" mimalloc = { version = "0.1.34", default-features = false, optional = true } -once_cell = "1.17.0" +once_cell = "1.17.1" semver = "1.0.16" strum = "0.24.1" strum_macros = "0.24.3" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index fe0da931..f2e7ea73 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -12,7 +12,7 @@ license = "Apache-2.0 OR MIT" [dependencies] compact_str = { version = "0.6.1", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } -once_cell = "1.17.0" +once_cell = "1.17.1" semver = { version = "1.0.16", features = ["serde"] } serde = { version = "1.0.152", features = ["derive"] } strum = "0.24.1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index bb2e79f1..8fc3fbed 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -25,7 +25,7 @@ jobslot = { version = "0.2.8", features = ["tokio"] } maybe-owned = "0.3.4" miette = "5.5.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } -once_cell = "1.17.0" +once_cell = "1.17.1" semver = { version = "1.0.16", features = ["serde"] } serde = { version = "1.0.152", features = ["derive"] } strum = "0.24.1" From 9874dca454b483bdcf9cb1536549d5029d5b3f4c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 15 Feb 2023 15:24:50 +1100 Subject: [PATCH 1048/2020] Fix bin names in `.crates.toml` on win (#802) `bins::BinFile::new` does not include `binary_ext` in the `BinFile::base_name`. Also add regression e2e-test. Fixed #801 Signed-off-by: Jiahao XU --- crates/binstalk/src/bins.rs | 4 ++-- e2e-tests/uninstall.sh | 17 +++++++++++++++++ justfile | 3 ++- 3 files changed, 21 insertions(+), 3 deletions(-) create mode 100644 e2e-tests/uninstall.sh diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index e6549627..ab7fabab 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -4,7 +4,7 @@ use std::{ path::{self, Component, Path, PathBuf}, }; -use compact_str::CompactString; +use compact_str::{format_compact, CompactString}; use normalize_path::NormalizePath; use serde::Serialize; use tinytemplate::TinyTemplate; @@ -141,7 +141,7 @@ impl BinFile { }; Ok(Self { - base_name: CompactString::from(base_name), + base_name: format_compact!("{base_name}{binary_ext}"), source, dest, link, diff --git a/e2e-tests/uninstall.sh b/e2e-tests/uninstall.sh new file mode 100644 index 00000000..8f1cb8ca --- /dev/null +++ b/e2e-tests/uninstall.sh @@ -0,0 +1,17 @@ +#!/bin/bash + +set -euxo pipefail + +unset CARGO_INSTALL_ROOT + +export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +othertmpdir=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-test') +export PATH="$CARGO_HOME/bin:$othertmpdir/bin:$PATH" + +mkdir -p "$othertmpdir/bin" +# Copy it to bin to test use of env var `CARGO` +cp "./$1" "$othertmpdir/bin/" + + +cargo binstall --no-confirm cargo-watch +cargo uninstall cargo-watch diff --git a/justfile b/justfile index 521332e4..bd34afad 100644 --- a/justfile +++ b/justfile @@ -132,6 +132,7 @@ e2e-test-strategies: (e2e-test "strategies") e2e-test-version-syntax: (e2e-test "version-syntax") e2e-test-upgrade: (e2e-test "upgrade") e2e-test-self-upgrade-no-symlink: (e2e-test "self-upgrade-no-symlink") +e2e-test-uninstall: (e2e-test "uninstall") # WinTLS (Windows in CI) does not have TLS 1.3 support [windows] @@ -140,7 +141,7 @@ e2e-test-tls: (e2e-test "tls" "1.2") [macos] e2e-test-tls: (e2e-test "tls" "1.2") (e2e-test "tls" "1.3") -e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink +e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall unit-tests: {{cargo-bin}} test {{cargo-build-args}} From 89b920a8762c9ed89dd7fdb0f8289993b40f55e0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 15 Feb 2023 17:07:25 +1100 Subject: [PATCH 1049/2020] Inc default interval in `--rate-limit` to 10ms (#804) Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 5cae7d82..7fe87a27 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -118,7 +118,7 @@ pub struct Args { /// Override the rate limit duration. /// - /// By default, cargo-binstall allows one request per 5 ms. + /// By default, cargo-binstall allows one request per 10 ms. /// /// Example: /// @@ -290,7 +290,7 @@ impl FromStr for RateLimit { impl Default for RateLimit { fn default() -> Self { Self { - duration: NonZeroU64::new(5).unwrap(), + duration: NonZeroU64::new(10).unwrap(), request_count: NonZeroU64::new(1).unwrap(), } } From 9c6ab5991ebb34d2c1cc4349ab1e2417c5de296a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 15 Feb 2023 18:24:17 +1100 Subject: [PATCH 1050/2020] Enable icf=safe & use rust-lld for targets other than win (#805) Signed-off-by: Jiahao XU --- justfile | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/justfile b/justfile index bd34afad..1ecd7610 100644 --- a/justfile +++ b/justfile @@ -79,12 +79,24 @@ win-arm64-ring16 := if target == "aarch64-pc-windows-msvc" { " --config='patch.c # MIR optimisation level (defaults to 2, bring it up to 4 for release builds) rustc-miropt := if for-release != "" { " -Z mir-opt-level=4" } else { "" } +# Use rust-lld that is bundled with rustup to speedup linking +# and support for icf=safe. +# +# -Zgcc-ld=lld uses the rust-lld that is bundled with rustup. +# +# TODO: There is ongoing effort to stabilise this and we will need to update +# this once it is merged. +# https://github.com/rust-lang/compiler-team/issues/510 +rust-lld := if target-os != "windows" { " -Z gcc-ld=lld" } else { "" } + # ICF: link-time identical code folding -# disabled for now, as it requires the gold linker -rustc-icf := "" #if for-release != "" { " -C link-arg=-Wl,--icf=all" } else { "" } +# +# On windows it works out of the box and on other targets it uses +# rust-lld. +rustc-icf := if for-release != "" { " -C link-arg=-Wl,--icf=safe" } else { "" } cargo-build-args := (if for-release != "" { " --release" } else { "" }) + (if target != target-host { " --target " + target } else if cargo-buildstd != "" { " --target " + target } else { "" }) + (cargo-buildstd) + (if extra-build-args != "" { " " + extra-build-args } else { "" }) + (cargo-no-default-features) + (cargo-split-debuginfo) + (if cargo-features != "" { " --features " + cargo-features } else { "" }) + (win-arm64-ring16) -export RUSTFLAGS := (rustc-gcclibs) + (rustc-miropt) + (rustc-icf) +export RUSTFLAGS := (rustc-gcclibs) + (rustc-miropt) + (rust-lld) + (rustc-icf) # libblocksruntime-dev provides compiler-rt From 45ce84134218caf38dc5e70d72db5236cb8b75c9 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 16 Feb 2023 09:57:58 +1100 Subject: [PATCH 1051/2020] Adjust feature flags enabled on CI (#809) Enable feature `pkg-config` and `log_release_max_level_debug` for debug build and enable feature `static`, `trust-dns` and `log_release_max_level_debug` for release build. Signed-off-by: Jiahao XU --- justfile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/justfile b/justfile index 1ecd7610..a391216c 100644 --- a/justfile +++ b/justfile @@ -62,9 +62,13 @@ cargo-no-default-features := if default-features == "false" { " --no-default-fea } else if (cargo-profile / ci-or-no) == "dev/ci" { " --no-default-features" } else { "" } +support-pkg-config := if target == target-host { + if target-os != "windows" { "true" } else { "" } +} else { "" } + cargo-features := trim_end_match(if override-features != "" { override-features - } else if (cargo-profile / ci-or-no) == "dev/ci" { "rustls,fancy-with-backtrace,zstd-thin" + extra-features - } else if (cargo-profile / ci-or-no) == "release/ci" { "rustls,fancy-no-backtrace,zstd-thin" + extra-features + } else if (cargo-profile / ci-or-no) == "dev/ci" { "rustls,fancy-with-backtrace,zstd-thin,log_release_max_level_debug" + (if support-pkg-config != "" { ",pkg-config" } else { "" }) + extra-features + } else if (cargo-profile / ci-or-no) == "release/ci" { "static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug" + extra-features } else { extra-features }, ",") From 93f15ea1c4294cecf23f5b974f61d163b9a2cc9a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 16 Feb 2023 09:58:16 +1100 Subject: [PATCH 1052/2020] Ignore README.md and SUPPORT.md in workflow "ci" (#812) Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f9c4e8a..d36af8bc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,9 +8,15 @@ on: - reopened - synchronize - auto_merge_enabled + paths-ignore: + - README.md + - SUPPORT.md push: branches: - main + paths-ignore: + - README.md + - SUPPORT.md concurrency: group: ${{ github.workflow }}-${{ github.ref || github.run_id }} From 7b086bfcbcea9839ee4143af3055d98746ac96a4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 16 Feb 2023 09:59:15 +1100 Subject: [PATCH 1053/2020] Update SUPPORT.md on `bin-dir` default (#811) Signed-off-by: Jiahao XU --- SUPPORT.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/SUPPORT.md b/SUPPORT.md index d47dc42e..0e567279 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -44,12 +44,24 @@ pkg-fmt = "zip" ### Defaults -By default, `binstall` will try all supported package formats and would have `bin-dir` set to -`"{ name }-{ target }-v{ version }/{ bin }{ binary-ext }"` (where `bin` is the cargo binary name and -`binary-ext` is `.exe` on windows and empty on other platforms). +By default, `binstall` will try all supported package formats and would do the same for `bin-dir`. -All binaries must contain a folder named `{ name }-{ target }-v{ version }` (so that prior binary -files are not overwritten when manually executing `tar -xvf ...`). +It will first extract the archives, then iterate over the following list, finding the first dir +that exists: + + - `{ name }-{ target }-v{ version }` + - `{ name }-{ target }-{ version }` + - `{ name }-{ version }-{ target }` + - `{ name }-v{ version }-{ target }` + - `{ name }-{ target }` + - `{ name }-{ version }` + - `{ name }-v{ version }` + - `{ name }` + +Then it will concat the dir with `"{ bin }{ binary-ext }"` and use that as the final `bin-dir`. + +`name` here is name of the crate, `bin` is the cargo binary name and `binary-ext` is `.exe` +on windows and empty on other platforms). The default value for `pkg-url` will depend on the repository of the package. From a8b9ae6fda31462413e254a6e819faee85dddb27 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 16 Feb 2023 12:47:37 +1100 Subject: [PATCH 1054/2020] Enable `-Z share-generics` to reduce compilation time (#807) Signed-off-by: Jiahao XU --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index a391216c..2ef052b6 100644 --- a/justfile +++ b/justfile @@ -100,7 +100,7 @@ rust-lld := if target-os != "windows" { " -Z gcc-ld=lld" } else { "" } rustc-icf := if for-release != "" { " -C link-arg=-Wl,--icf=safe" } else { "" } cargo-build-args := (if for-release != "" { " --release" } else { "" }) + (if target != target-host { " --target " + target } else if cargo-buildstd != "" { " --target " + target } else { "" }) + (cargo-buildstd) + (if extra-build-args != "" { " " + extra-build-args } else { "" }) + (cargo-no-default-features) + (cargo-split-debuginfo) + (if cargo-features != "" { " --features " + cargo-features } else { "" }) + (win-arm64-ring16) -export RUSTFLAGS := (rustc-gcclibs) + (rustc-miropt) + (rust-lld) + (rustc-icf) +export RUSTFLAGS := "-Z share-generics " + (rustc-gcclibs) + (rustc-miropt) + (rust-lld) + (rustc-icf) # libblocksruntime-dev provides compiler-rt From 2e118b3044547803a782b8799849c463004136d0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 16 Feb 2023 12:51:47 +1100 Subject: [PATCH 1055/2020] Optimize `GhCrateMeta::find`: Cache url resolution result (#810) So that we don't have to create multiple HEAD/GET http request to get the final, redirected url. Signed-off-by: Jiahao XU --- crates/binstalk/src/fetchers.rs | 36 ++++++++- crates/binstalk/src/fetchers/gh_crate_meta.rs | 79 +++++++++---------- crates/binstalk/src/ops/resolve.rs | 10 +-- 3 files changed, 75 insertions(+), 50 deletions(-) diff --git a/crates/binstalk/src/fetchers.rs b/crates/binstalk/src/fetchers.rs index 1b9d324c..57f5f662 100644 --- a/crates/binstalk/src/fetchers.rs +++ b/crates/binstalk/src/fetchers.rs @@ -3,6 +3,8 @@ use std::{path::Path, sync::Arc}; use compact_str::CompactString; pub use gh_crate_meta::*; pub use quickinstall::*; +use tokio::sync::OnceCell; +use url::Url; use crate::{ errors::BinstallError, @@ -60,9 +62,37 @@ pub trait Fetcher: Send + Sync { /// Data required to fetch a package #[derive(Clone, Debug)] pub struct Data { - pub name: CompactString, - pub version: CompactString, - pub repo: Option, + name: CompactString, + version: CompactString, + repo: Option, + repo_final_url: OnceCell>, +} + +impl Data { + pub fn new(name: CompactString, version: CompactString, repo: Option) -> Self { + Self { + name, + version, + repo, + repo_final_url: OnceCell::new(), + } + } + + async fn resolve_final_repo_url(&self, client: &Client) -> Result<&Option, BinstallError> { + self.repo_final_url + .get_or_try_init(move || { + Box::pin(async move { + if let Some(repo) = self.repo.as_deref() { + Ok(Some( + client.get_redirected_final_url(Url::parse(repo)?).await?, + )) + } else { + Ok(None) + } + }) + }) + .await + } } /// Target specific data required to fetch a package diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 14478a68..2940afc2 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -92,11 +92,7 @@ impl super::Fetcher for GhCrateMeta { fn find(self: Arc) -> AutoAbortJoinHandle> { AutoAbortJoinHandle::spawn(async move { - let repo = if let Some(repo) = self.data.repo.as_deref() { - Some(Box::pin(self.client.get_redirected_final_url(Url::parse(repo)?)).await?) - } else { - None - }; + let repo = self.data.resolve_final_repo_url(&self.client).await?; let mut pkg_fmt = self.target_data.meta.pkg_fmt; @@ -156,8 +152,7 @@ impl super::Fetcher for GhCrateMeta { }; // Convert Option to Option to reduce size of future. - let repo = repo.map(String::from); - let repo = repo.as_deref().map(|u| u.trim_end_matches('/')); + let repo = repo.as_ref().map(|u| u.as_str().trim_end_matches('/')); // Use reference to self to fix error of closure // launch_baseline_find_tasks which moves `this` @@ -337,11 +332,11 @@ mod test { #[test] fn defaults() { - let data = Data { - name: "cargo-binstall".to_compact_string(), - version: "1.2.3".to_compact_string(), - repo: Some("https://github.com/ryankurte/cargo-binstall".to_string()), - }; + let data = Data::new( + "cargo-binstall".to_compact_string(), + "1.2.3".to_compact_string(), + Some("https://github.com/ryankurte/cargo-binstall".to_string()), + ); let ctx = Context::from_data(&data, "x86_64-unknown-linux-gnu", ".tgz"); assert_eq!( @@ -354,11 +349,11 @@ mod test { #[should_panic] fn no_repo() { let meta = PkgMeta::default(); - let data = Data { - name: "cargo-binstall".to_compact_string(), - version: "1.2.3".to_compact_string(), - repo: None, - }; + let data = Data::new( + "cargo-binstall".to_compact_string(), + "1.2.3".to_compact_string(), + None, + ); let ctx = Context::from_data(&data, "x86_64-unknown-linux-gnu", ".tgz"); ctx.render_url(meta.pkg_url.as_deref().unwrap()).unwrap(); @@ -371,11 +366,11 @@ mod test { ..Default::default() }; - let data = Data { - name: "cargo-binstall".to_compact_string(), - version: "1.2.3".to_compact_string(), - repo: None, - }; + let data = Data::new( + "cargo-binstall".to_compact_string(), + "1.2.3".to_compact_string(), + None, + ); let ctx = Context::from_data(&data, "x86_64-unknown-linux-gnu", ".tgz"); assert_eq!( @@ -393,11 +388,11 @@ mod test { ..Default::default() }; - let data = Data { - name: "radio-sx128x".to_compact_string(), - version: "0.14.1-alpha.5".to_compact_string(), - repo: Some("https://github.com/rust-iot/rust-radio-sx128x".to_string()), - }; + let data = Data::new( + "radio-sx128x".to_compact_string(), + "0.14.1-alpha.5".to_compact_string(), + Some("https://github.com/rust-iot/rust-radio-sx128x".to_string()), + ); let ctx = Context::from_data(&data, "x86_64-unknown-linux-gnu", ".tgz"); assert_eq!( @@ -413,11 +408,11 @@ mod test { ..Default::default() }; - let data = Data { - name: "radio-sx128x".to_compact_string(), - version: "0.14.1-alpha.5".to_compact_string(), - repo: Some("https://github.com/rust-iot/rust-radio-sx128x".to_string()), - }; + let data = Data::new( + "radio-sx128x".to_compact_string(), + "0.14.1-alpha.5".to_compact_string(), + Some("https://github.com/rust-iot/rust-radio-sx128x".to_string()), + ); let ctx = Context::from_data(&data, "x86_64-unknown-linux-gnu", ".tgz"); assert_eq!( @@ -437,11 +432,11 @@ mod test { ..Default::default() }; - let data = Data { - name: "cargo-watch".to_compact_string(), - version: "9.0.0".to_compact_string(), - repo: Some("https://github.com/watchexec/cargo-watch".to_string()), - }; + let data = Data::new( + "cargo-watch".to_compact_string(), + "9.0.0".to_compact_string(), + Some("https://github.com/watchexec/cargo-watch".to_string()), + ); let ctx = Context::from_data(&data, "aarch64-apple-darwin", ".txz"); assert_eq!( @@ -458,11 +453,11 @@ mod test { ..Default::default() }; - let data = Data { - name: "cargo-watch".to_compact_string(), - version: "9.0.0".to_compact_string(), - repo: Some("https://github.com/watchexec/cargo-watch".to_string()), - }; + let data = Data::new( + "cargo-watch".to_compact_string(), + "9.0.0".to_compact_string(), + Some("https://github.com/watchexec/cargo-watch".to_string()), + ); let ctx = Context::from_data(&data, "aarch64-pc-windows-msvc", ".bin"); assert_eq!( diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 4140b062..4beb5101 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -84,11 +84,11 @@ async fn resolve_inner( let mut handles: Vec<(Arc, _)> = Vec::with_capacity(desired_targets.len() * resolvers.len()); - let data = Arc::new(Data { - name: package_info.name.clone(), - version: package_info.version_str.clone(), - repo: package_info.repo.clone(), - }); + let data = Arc::new(Data::new( + package_info.name.clone(), + package_info.version_str.clone(), + package_info.repo.clone(), + )); handles.extend( desired_targets From 69a1c2695121ec6b8986496fa6234c73ac546e7c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Feb 2023 02:29:06 +0000 Subject: [PATCH 1056/2020] Bump clap from 4.1.4 to 4.1.6 (#813) --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4c852745..431783b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -430,9 +430,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.1.4" +version = "4.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f13b9c79b5d1dd500d20ef541215a6423c75829ef43117e1b4d17fd8af0b5d76" +checksum = "ec0b0588d44d4d63a87dbd75c136c166bbfd9a86a31cb89e09906521c7d3f5e3" dependencies = [ "bitflags", "clap_derive", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 2047ff53..7d52126a 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.8.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.3.0" } -clap = { version = "4.1.4", features = ["derive"] } +clap = { version = "4.1.6", features = ["derive"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" fs-lock = { version = "0.1.0", path = "../fs-lock" } From 61c992612c706b639da7374707ccae0dcd0c8013 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 17 Feb 2023 07:36:45 +1100 Subject: [PATCH 1057/2020] Switch to `cargo-zigbuild` for `aarch64-unknown-linux-gnu` and `x86_64-unknown-linux-musl` (#814) Signed-off-by: Jiahao XU --- .github/workflows/release-build.yml | 20 ++++++++++---------- justfile | 2 -- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 45f78f22..142d9ef0 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -19,16 +19,16 @@ jobs: fail-fast: false matrix: include: - - { o: macos-latest, t: x86_64-apple-darwin, r: true } - - { o: macos-latest, t: aarch64-apple-darwin } - - { o: ubuntu-20.04, t: x86_64-unknown-linux-gnu, r: true } - - { o: ubuntu-20.04, t: armv7-unknown-linux-gnueabihf, c: true } - - { o: ubuntu-20.04, t: aarch64-unknown-linux-gnu } - - { o: ubuntu-latest, t: x86_64-unknown-linux-musl, r: true } - - { o: ubuntu-latest, t: armv7-unknown-linux-musleabihf, c: true } - - { o: ubuntu-latest, t: aarch64-unknown-linux-musl, c: true } - - { o: windows-latest, t: x86_64-pc-windows-msvc, r: true } - - { o: windows-latest, t: aarch64-pc-windows-msvc } + - { o: macos-latest, t: x86_64-apple-darwin, r: true } + - { o: macos-latest, t: aarch64-apple-darwin } + - { o: ubuntu-20.04, t: x86_64-unknown-linux-gnu, r: true } + - { o: ubuntu-20.04, t: armv7-unknown-linux-gnueabihf, c: true } + - { o: ubuntu-20.04, t: aarch64-unknown-linux-gnu, c: true } + - { o: ubuntu-latest, t: x86_64-unknown-linux-musl, r: true, c: true } + - { o: ubuntu-latest, t: armv7-unknown-linux-musleabihf, c: true } + - { o: ubuntu-latest, t: aarch64-unknown-linux-musl, c: true } + - { o: windows-latest, t: x86_64-pc-windows-msvc, r: true } + - { o: windows-latest, t: aarch64-pc-windows-msvc } name: ${{ matrix.t }} runs-on: ${{ matrix.o }} diff --git a/justfile b/justfile index 2ef052b6..bc95db81 100644 --- a/justfile +++ b/justfile @@ -105,8 +105,6 @@ export RUSTFLAGS := "-Z share-generics " + (rustc-gcclibs) + (rustc-miropt) + (r # libblocksruntime-dev provides compiler-rt ci-apt-deps := if target == "x86_64-unknown-linux-gnu" { "liblzma-dev libzip-dev libzstd-dev" - } else if target == "x86_64-unknown-linux-musl" { "musl-tools" - } else if target == "aarch64-unknown-linux-gnu" { "g++-aarch64-linux-gnu libc6-dev-arm64-cross binutils binutils-aarch64-linux-gnu libblocksruntime-dev" } else { "" } [linux] From 9923788f07e44869f7b5a49bee68650bef0a8d01 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 17 Feb 2023 22:07:24 +1100 Subject: [PATCH 1058/2020] Fix CI: Only turn on feature pkg-config on linux and fix cross compilation (#815) Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 3 ++- justfile | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d36af8bc..3a510540 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,13 +38,14 @@ jobs: os: ubuntu-latest - target: x86_64-unknown-linux-musl os: ubuntu-latest + c: true - target: x86_64-pc-windows-msvc os: windows-latest runs-on: ${{ matrix.os }} env: CARGO_BUILD_TARGET: ${{ matrix.target }} - CARGO_BINSTALL_LOG_LEVEL: debug + JUST_USE_CARGO_ZIGBUILD: ${{ matrix.c }} steps: - uses: actions/checkout@v3 diff --git a/justfile b/justfile index bc95db81..543d0251 100644 --- a/justfile +++ b/justfile @@ -63,7 +63,7 @@ cargo-no-default-features := if default-features == "false" { " --no-default-fea } else { "" } support-pkg-config := if target == target-host { - if target-os != "windows" { "true" } else { "" } + if target-os == "linux" { "true" } else { "" } } else { "" } cargo-features := trim_end_match(if override-features != "" { override-features From e76a4dff62e17a841a115c8abc907e78c670d247 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 18 Feb 2023 13:41:17 +1100 Subject: [PATCH 1059/2020] Improve CI: All in cargo-zigbuild for linux targets (#816) --- .github/workflows/release-build.yml | 21 +++++++++++---------- justfile | 13 ++++++++++++- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 142d9ef0..fa497977 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -19,21 +19,22 @@ jobs: fail-fast: false matrix: include: - - { o: macos-latest, t: x86_64-apple-darwin, r: true } - - { o: macos-latest, t: aarch64-apple-darwin } - - { o: ubuntu-20.04, t: x86_64-unknown-linux-gnu, r: true } - - { o: ubuntu-20.04, t: armv7-unknown-linux-gnueabihf, c: true } - - { o: ubuntu-20.04, t: aarch64-unknown-linux-gnu, c: true } - - { o: ubuntu-latest, t: x86_64-unknown-linux-musl, r: true, c: true } - - { o: ubuntu-latest, t: armv7-unknown-linux-musleabihf, c: true } - - { o: ubuntu-latest, t: aarch64-unknown-linux-musl, c: true } - - { o: windows-latest, t: x86_64-pc-windows-msvc, r: true } - - { o: windows-latest, t: aarch64-pc-windows-msvc } + - { o: macos-latest, t: x86_64-apple-darwin, r: true } + - { o: macos-latest, t: aarch64-apple-darwin } + - { o: ubuntu-latest, t: x86_64-unknown-linux-gnu, g: 2.17, r: true, c: true } + - { o: ubuntu-latest, t: armv7-unknown-linux-gnueabihf, g: 2.17, c: true } + - { o: ubuntu-latest, t: aarch64-unknown-linux-gnu, g: 2.17, c: true } + - { o: ubuntu-latest, t: x86_64-unknown-linux-musl, r: true, c: true } + - { o: ubuntu-latest, t: armv7-unknown-linux-musleabihf, c: true } + - { o: ubuntu-latest, t: aarch64-unknown-linux-musl, c: true } + - { o: windows-latest, t: x86_64-pc-windows-msvc, r: true } + - { o: windows-latest, t: aarch64-pc-windows-msvc } name: ${{ matrix.t }} runs-on: ${{ matrix.o }} env: CARGO_BUILD_TARGET: ${{ matrix.t }} + GLIBC_VERSION: ${{ matrix.g }} JUST_USE_CARGO_ZIGBUILD: ${{ matrix.c }} JUST_FOR_RELEASE: true diff --git a/justfile b/justfile index 543d0251..a79cfb15 100644 --- a/justfile +++ b/justfile @@ -7,6 +7,7 @@ extra-build-args := env_var_or_default("JUST_EXTRA_BUILD_ARGS", "") extra-features := env_var_or_default("JUST_EXTRA_FEATURES", "") default-features := env_var_or_default("JUST_DEFAULT_FEATURES", "") override-features := env_var_or_default("JUST_OVERRIDE_FEATURES", "") +glibc-version := env_var_or_default("GLIBC_VERSION", "") export BINSTALL_LOG_LEVEL := if env_var_or_default("RUNNER_DEBUG", "0") == "1" { "debug" } else { "info" } @@ -99,7 +100,17 @@ rust-lld := if target-os != "windows" { " -Z gcc-ld=lld" } else { "" } # rust-lld. rustc-icf := if for-release != "" { " -C link-arg=-Wl,--icf=safe" } else { "" } -cargo-build-args := (if for-release != "" { " --release" } else { "" }) + (if target != target-host { " --target " + target } else if cargo-buildstd != "" { " --target " + target } else { "" }) + (cargo-buildstd) + (if extra-build-args != "" { " " + extra-build-args } else { "" }) + (cargo-no-default-features) + (cargo-split-debuginfo) + (if cargo-features != "" { " --features " + cargo-features } else { "" }) + (win-arm64-ring16) +target-glibc-ver-postfix := if glibc-version != "" { + if use-cargo-zigbuild != "" { + "." + glibc-version + } else { + "" + } +} else { + "" +} + +cargo-build-args := (if for-release != "" { " --release" } else { "" }) + (" --target ") + (target) + (target-glibc-ver-postfix) + (cargo-buildstd) + (if extra-build-args != "" { " " + extra-build-args } else { "" }) + (cargo-no-default-features) + (cargo-split-debuginfo) + (if cargo-features != "" { " --features " + cargo-features } else { "" }) + (win-arm64-ring16) export RUSTFLAGS := "-Z share-generics " + (rustc-gcclibs) + (rustc-miropt) + (rust-lld) + (rustc-icf) From 3f0107696bd816011472910723acffa18b0198db Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 19 Feb 2023 15:19:35 +1100 Subject: [PATCH 1060/2020] Enable cross-lang-fat-lto on Linux (#817) Fixed #806 - Add new feature flag `cross-lang-fat-lto` and enable it on release for linux - Enable `-C linker-plugin-lto` for linux - Only use `-Z gcc-ld=lld` on non-windows targets when `cargo-zigbuild` is not enabled Signed-off-by: Jiahao XU --- crates/bin/Cargo.toml | 1 + crates/binstalk-downloader/Cargo.toml | 2 ++ crates/binstalk/Cargo.toml | 1 + justfile | 25 ++++++++++++++++++++++--- 4 files changed, 26 insertions(+), 3 deletions(-) diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 7d52126a..71d2aabf 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -62,6 +62,7 @@ native-tls = ["binstalk/native-tls"] trust-dns = ["binstalk/trust-dns"] zstd-thin = ["binstalk/zstd-thin"] +cross-lang-fat-lto = ["binstalk/cross-lang-fat-lto"] fancy-no-backtrace = ["miette/fancy-no-backtrace"] fancy-with-backtrace = ["fancy-no-backtrace", "miette/fancy"] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index d77cc12e..b6ac3966 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -69,3 +69,5 @@ native-tls = ["reqwest/native-tls", "trust-dns-resolver?/dns-over-native-tls"] trust-dns = ["trust-dns-resolver", "reqwest/trust-dns"] zstd-thin = ["zstd/thin"] + +cross-lang-fat-lto = ["zstd/fat-lto"] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 8fc3fbed..a804d1ea 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -55,3 +55,4 @@ native-tls = ["binstalk-downloader/native-tls"] trust-dns = ["binstalk-downloader/trust-dns"] zstd-thin = ["binstalk-downloader/zstd-thin"] +cross-lang-fat-lto = ["binstalk-downloader/cross-lang-fat-lto"] diff --git a/justfile b/justfile index a79cfb15..4edb4bdb 100644 --- a/justfile +++ b/justfile @@ -69,7 +69,7 @@ support-pkg-config := if target == target-host { cargo-features := trim_end_match(if override-features != "" { override-features } else if (cargo-profile / ci-or-no) == "dev/ci" { "rustls,fancy-with-backtrace,zstd-thin,log_release_max_level_debug" + (if support-pkg-config != "" { ",pkg-config" } else { "" }) + extra-features - } else if (cargo-profile / ci-or-no) == "release/ci" { "static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug" + extra-features + } else if (cargo-profile / ci-or-no) == "release/ci" { "static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug" + (if target-os != "macos" { ",cross-lang-fat-lto" } else { "" }) + extra-features } else { extra-features }, ",") @@ -92,7 +92,16 @@ rustc-miropt := if for-release != "" { " -Z mir-opt-level=4" } else { "" } # TODO: There is ongoing effort to stabilise this and we will need to update # this once it is merged. # https://github.com/rust-lang/compiler-team/issues/510 -rust-lld := if target-os != "windows" { " -Z gcc-ld=lld" } else { "" } +# +# If cargo-zigbuild is used, then it will provide the lld linker. +# This option is disabled on windows since it not supported. +rust-lld := if use-cargo-zigbuild != "" { + "" +} else if target-os != "windows" { + " -Z gcc-ld=lld" +} else { + "" +} # ICF: link-time identical code folding # @@ -100,6 +109,16 @@ rust-lld := if target-os != "windows" { " -Z gcc-ld=lld" } else { "" } # rust-lld. rustc-icf := if for-release != "" { " -C link-arg=-Wl,--icf=safe" } else { "" } +# Only enable linker-plugin-lto for release +# Also disable this on windows since it uses msvc. +linker-plugin-lto := if for-release == "" { + "" +} else if target-os == "linux" { + "-C linker-plugin-lto " +} else { + "" +} + target-glibc-ver-postfix := if glibc-version != "" { if use-cargo-zigbuild != "" { "." + glibc-version @@ -111,7 +130,7 @@ target-glibc-ver-postfix := if glibc-version != "" { } cargo-build-args := (if for-release != "" { " --release" } else { "" }) + (" --target ") + (target) + (target-glibc-ver-postfix) + (cargo-buildstd) + (if extra-build-args != "" { " " + extra-build-args } else { "" }) + (cargo-no-default-features) + (cargo-split-debuginfo) + (if cargo-features != "" { " --features " + cargo-features } else { "" }) + (win-arm64-ring16) -export RUSTFLAGS := "-Z share-generics " + (rustc-gcclibs) + (rustc-miropt) + (rust-lld) + (rustc-icf) +export RUSTFLAGS := "-Z share-generics " + (linker-plugin-lto) + (rustc-gcclibs) + (rustc-miropt) + (rust-lld) + (rustc-icf) # libblocksruntime-dev provides compiler-rt From 467ba0d854ab7e651c89d3f3862b42995f877238 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Feb 2023 14:33:12 +1100 Subject: [PATCH 1061/2020] Bump cargo_toml from 0.15.1 to 0.15.2 (#819) Bumps [cargo_toml](https://gitlab.com/crates.rs/cargo_toml) from 0.15.1 to 0.15.2. - [Release notes](https://gitlab.com/crates.rs/cargo_toml/tags) - [Commits](https://gitlab.com/crates.rs/cargo_toml/compare/v0.15.1...v0.15.2) --- updated-dependencies: - dependency-name: cargo_toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 431783b2..6a3a8150 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -380,9 +380,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "189929343288eb08d1f418bfbc022a5bddc6889e4a8f8dfaf06035fd3adf6fed" +checksum = "7f83bc2e401ed041b7057345ebc488c005efa0341d5541ce7004d30458d0090b" dependencies = [ "serde", "toml 0.7.2", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index a804d1ea..4e2ac9cf 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0" async-trait = "0.1.64" binstalk-downloader = { version = "0.3.3", path = "../binstalk-downloader", default-features = false } binstalk-types = { version = "0.2.1", path = "../binstalk-types" } -cargo_toml = "0.15.1" +cargo_toml = "0.15.2" command-group = { version = "2.0.1", features = ["with-tokio"] } compact_str = { version = "0.6.1", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } From 7bc4d4a5c6377ef118c167b3cddb7629f6255948 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 20 Feb 2023 20:48:33 +1100 Subject: [PATCH 1062/2020] Add opt `--root-ceritificates` & env `BINSTALL_HTTPS_ROOT_CERTS` (#820) for specifying root ceritificates used for https connnections. And remove old environment variable `CARGO_HTTP_CAINFO`, `SSL_CERT_FILE` and `SSL_CERT_PATH` to avoid accidentally setting them, especially in CI env. Also: - Rm fn `binstalk_downloader::Certificate::from_env` - Enable feature `env` of dep `clap` in `crates/bin` - Add new dep `file-format` v0.14.0 to `crates/bin` - Use `file-format` to determine pem/der file format when loading root certs - Rm fn `binstalk_downloader::Certificate::open` and enum `binstalk_downloader::OpenCertificateError` Signed-off-by: Jiahao XU --- Cargo.lock | 7 +++ crates/bin/Cargo.toml | 3 +- crates/bin/src/args.rs | 7 ++- crates/bin/src/entry.rs | 61 ++++++++++++++++--- crates/binstalk-downloader/src/remote.rs | 2 +- .../src/remote/certificate.rs | 49 --------------- 6 files changed, 67 insertions(+), 62 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6a3a8150..5e662470 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -361,6 +361,7 @@ dependencies = [ "crates_io_api", "dirs", "embed-resource", + "file-format", "fs-lock", "log", "miette", @@ -727,6 +728,12 @@ dependencies = [ "instant", ] +[[package]] +name = "file-format" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d645737d3dda11cbf14905e9b943a1bd578cdcb751709b581a924ea9b9b18b5c" + [[package]] name = "filetime" version = "0.2.20" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 71d2aabf..c5d45739 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,9 +24,10 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.8.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.3.0" } -clap = { version = "4.1.6", features = ["derive"] } +clap = { version = "4.1.6", features = ["derive", "env"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" +file-format = { version = "0.14.0", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } log = { version = "0.4.17", features = ["std"] } miette = "5.5.0" diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 7fe87a27..19b18b77 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -203,6 +203,11 @@ pub struct Args { #[clap(help_heading = "Options", long, value_enum, value_name = "VERSION")] pub min_tls_version: Option, + /// Specify the root certificates to use for https connnections, + /// in addition to default system-wide ones. + #[clap(help_heading = "Options", long, env = "BINSTALL_HTTPS_ROOT_CERTS")] + pub root_certificates: Vec, + /// Print logs in json format to be parsable. #[clap(help_heading = "Options", long)] pub json_output: bool, @@ -313,7 +318,7 @@ pub fn parse() -> Args { // Filter extraneous arg when invoked by cargo // `cargo run -- --help` gives ["target/debug/cargo-binstall", "--help"] // `cargo binstall --help` gives ["/home/ryan/.cargo/bin/cargo-binstall", "binstall", "--help"] - let mut args: Vec = std::env::args_os().collect(); + let mut args: Vec = env::args_os().collect(); let args = if args.get(1).map(|arg| arg == "binstall").unwrap_or_default() { // Equivalent to // diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 7a20e43c..3e9f30cb 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -1,4 +1,9 @@ -use std::{fs, path::PathBuf, sync::Arc, time::Duration}; +use std::{ + fs, + path::{Path, PathBuf}, + sync::Arc, + time::Duration, +}; use binstalk::{ errors::BinstallError, @@ -17,6 +22,7 @@ use binstalk::{ }; use binstalk_manifests::cargo_toml_binstall::PkgOverride; use crates_io_api::AsyncClient as CratesIoApiClient; +use file_format::FileFormat; use log::LevelFilter; use miette::{miette, Result, WrapErr}; use tokio::task::block_in_place; @@ -77,15 +83,7 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - args.min_tls_version.map(|v| v.into()), Duration::from_millis(rate_limit.duration.get()), rate_limit.request_count, - ["CARGO_HTTP_CAINFO", "SSL_CERT_FILE", "SSL_CERT_PATH"] - .into_iter() - .filter_map(|env_name| match Certificate::from_env(env_name) { - Ok(option) => option, - Err(err) => { - warn!("Failed to load root certificate specified by env {env_name}: {err}",); - None - } - }), + read_root_certs(args.root_certificates), ) .map_err(BinstallError::from)?; @@ -180,6 +178,49 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - Ok(()) } +fn do_read_root_cert(path: &Path) -> Result, BinstallError> { + use std::io::{Read, Seek}; + + let mut file = fs::File::open(path)?; + let file_format = FileFormat::from_reader(&mut file)?; + + let open_cert = match file_format { + FileFormat::PemCertificate => Certificate::from_pem, + FileFormat::DerCertificate => Certificate::from_der, + _ => { + warn!( + "Unable to load {}: Expected pem or der ceritificate but found {file_format}", + path.display() + ); + + return Ok(None); + } + }; + + // Move file back to its head + file.rewind()?; + + let mut buffer = Vec::with_capacity(200); + file.read_to_end(&mut buffer)?; + + open_cert(&buffer).map_err(From::from).map(Some) +} + +fn read_root_certs(root_certificate_paths: Vec) -> impl Iterator { + root_certificate_paths + .into_iter() + .filter_map(|path| match do_read_root_cert(&path) { + Ok(optional_cert) => optional_cert, + Err(err) => { + warn!( + "Failed to load root certificate at {}: {err}", + path.display() + ); + None + } + }) +} + /// Return (install_path, manifests, temp_dir) fn compute_paths_and_load_manifests( roots: Option, diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index e301614b..049ccb38 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -23,7 +23,7 @@ mod delay_request; use delay_request::DelayRequest; mod certificate; -pub use certificate::{Certificate, OpenCertificateError}; +pub use certificate::Certificate; const MAX_RETRY_DURATION: Duration = Duration::from_secs(120); const MAX_RETRY_COUNT: u8 = 3; diff --git a/crates/binstalk-downloader/src/remote/certificate.rs b/crates/binstalk-downloader/src/remote/certificate.rs index 553c5c3f..3c59eac5 100644 --- a/crates/binstalk-downloader/src/remote/certificate.rs +++ b/crates/binstalk-downloader/src/remote/certificate.rs @@ -1,60 +1,11 @@ -use std::{env, ffi::OsStr, fs, io, path::Path}; - -use compact_str::CompactString; use reqwest::tls; -use thiserror::Error as ThisError; use super::ReqwestError; -#[derive(Debug, ThisError)] -pub enum OpenCertificateError { - #[error(transparent)] - Reqwest(#[from] ReqwestError), - - #[error(transparent)] - Io(#[from] io::Error), - - #[error("Expected extension .pem or .der, but found {0:#?}")] - UnknownExtensions(Option), -} - #[derive(Clone, Debug)] pub struct Certificate(pub(super) tls::Certificate); impl Certificate { - /// Open Certificate with path specified by the environment variable `name` - pub fn from_env(name: impl AsRef) -> Result, OpenCertificateError> { - Self::from_env_inner(name.as_ref()) - } - - fn from_env_inner(name: &OsStr) -> Result, OpenCertificateError> { - env::var_os(name) - .map(|value| Self::open_inner(Path::new(&value))) - .transpose() - } - - /// Open Certificate on disk and automatically detect its format based on - /// its extension. - pub fn open(path: impl AsRef) -> Result { - Self::open_inner(path.as_ref()) - } - - fn open_inner(path: &Path) -> Result { - let ext = path.extension(); - - let f = if ext == Some(OsStr::new("pem")) { - Self::from_pem - } else if ext == Some(OsStr::new("der")) { - Self::from_der - } else { - return Err(OpenCertificateError::UnknownExtensions( - ext.map(|os_str| os_str.to_string_lossy().into()), - )); - }; - - Ok(f(fs::read(path)?)?) - } - /// Create a Certificate from a binary DER encoded certificate pub fn from_der(der: impl AsRef<[u8]>) -> Result { tls::Certificate::from_der(der.as_ref()).map(Self) From a89c3735fdc72a28e8173ada81b44cb4be511028 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 20 Feb 2023 23:16:40 +1100 Subject: [PATCH 1063/2020] Update transitive deps (#821) Signed-off-by: Jiahao XU --- Cargo.lock | 47 ++++++++++++++++++++++++----------------------- 1 file changed, 24 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5e662470..9f52b535 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -564,9 +564,9 @@ dependencies = [ [[package]] name = "cxx" -version = "1.0.90" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90d59d9acd2a682b4e40605a242f6670eaa58c5957471cbf85e8aa6a0b97a5e8" +checksum = "86d3488e7665a7a483b57e25bdd90d0aeb2bc7608c8d0346acf2ad3f1caf1d62" dependencies = [ "cc", "cxxbridge-flags", @@ -576,9 +576,9 @@ dependencies = [ [[package]] name = "cxx-build" -version = "1.0.90" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebfa40bda659dd5c864e65f4c9a2b0aff19bea56b017b9b77c73d3766a453a38" +checksum = "48fcaf066a053a41a81dfb14d57d99738b767febb8b735c3016e469fac5da690" dependencies = [ "cc", "codespan-reporting", @@ -591,15 +591,15 @@ dependencies = [ [[package]] name = "cxxbridge-flags" -version = "1.0.90" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "457ce6757c5c70dc6ecdbda6925b958aae7f959bda7d8fb9bde889e34a09dc03" +checksum = "a2ef98b8b717a829ca5603af80e1f9e2e48013ab227b68ef37872ef84ee479bf" [[package]] name = "cxxbridge-macro" -version = "1.0.90" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebf883b7aacd7b2aeb2a7b338648ee19f57c140d4ee8e52c68979c6b2f7f2263" +checksum = "086c685979a698443656e5cf7856c95c642295a38599f12fb1ff76fb28d19892" dependencies = [ "proc-macro2", "quote", @@ -721,9 +721,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" dependencies = [ "instant", ] @@ -936,9 +936,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.1" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "221996f774192f0f718773def8201c4ae31f02616a54ccfc2d358bb0e5cefdec" +checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" [[package]] name = "guess_host_triple" @@ -1032,9 +1032,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", @@ -1459,14 +1459,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" dependencies = [ "libc", "log", "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -2200,9 +2200,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" dependencies = [ "autocfg", ] @@ -2381,10 +2381,11 @@ dependencies = [ [[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", ] @@ -2478,9 +2479,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" dependencies = [ "futures-core", "pin-project-lite", From 8f50bab0d8ec8067589e74457e20b463363b1ae0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Feb 2023 17:55:18 +1100 Subject: [PATCH 1064/2020] Bump compact_str from 0.6.1 to 0.7.0 (#825) Bumps [compact_str](https://github.com/ParkMyCar/compact_str) from 0.6.1 to 0.7.0. - [Release notes](https://github.com/ParkMyCar/compact_str/releases) - [Changelog](https://github.com/ParkMyCar/compact_str/blob/main/CHANGELOG.md) - [Commits](https://github.com/ParkMyCar/compact_str/commits) --- updated-dependencies: - dependency-name: compact_str dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 6 ++++-- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9f52b535..0723ddce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -499,14 +499,16 @@ dependencies = [ [[package]] name = "compact_str" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5138945395949e7dfba09646dc9e766b548ff48e23deb5246890e6b64ae9e1b9" +checksum = "bff0805f79ecb1b35163f3957a6934ea8d04fcd36ef98b52e7316f63e72e73d1" dependencies = [ "castaway", + "cfg-if", "itoa", "ryu", "serde", + "static_assertions", ] [[package]] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index b6ac3966..c5e412a1 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -16,7 +16,7 @@ async_zip = { version = "0.0.9", features = ["deflate", "bzip2", "lzma", "zstd", binstalk-types = { version = "0.2.1", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" -compact_str = "0.6.1" +compact_str = "0.7.0" digest = "0.10.6" flate2 = { version = "1.0.25", default-features = false } futures-lite = { version = "1.12.0", default-features = false } diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 7d650e27..0cb41605 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -12,7 +12,7 @@ license = "Apache-2.0 OR MIT" [dependencies] beef = { version = "0.5.2", features = ["impl_serde"] } binstalk-types = { version = "0.2.1", path = "../binstalk-types" } -compact_str = { version = "0.6.1", features = ["serde"] } +compact_str = { version = "0.7.0", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" miette = "5.5.0" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index f2e7ea73..2f639575 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -compact_str = { version = "0.6.1", features = ["serde"] } +compact_str = { version = "0.7.0", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.17.1" semver = { version = "1.0.16", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 4e2ac9cf..9d3fa9dd 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -15,7 +15,7 @@ binstalk-downloader = { version = "0.3.3", path = "../binstalk-downloader", defa binstalk-types = { version = "0.2.1", path = "../binstalk-types" } cargo_toml = "0.15.2" command-group = { version = "2.0.1", features = ["with-tokio"] } -compact_str = { version = "0.6.1", features = ["serde"] } +compact_str = { version = "0.7.0", features = ["serde"] } crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.5", path = "../detect-targets" } either = "1.8.1" From 0e055dbb7cf6cec8def678e886ea2c56302630c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 22 Feb 2023 08:47:47 +0000 Subject: [PATCH 1065/2020] Bump async_zip from 0.0.9 to 0.0.12 (#824) --- Cargo.lock | 145 +----------------- crates/binstalk-downloader/Cargo.toml | 2 +- .../src/download/async_extracter.rs | 10 +- .../src/download/zip_extraction.rs | 24 ++- 4 files changed, 25 insertions(+), 156 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0723ddce..e847c56c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,15 +52,6 @@ dependencies = [ "alloc-no-stdlib", ] -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - [[package]] name = "async-compression" version = "0.3.15" @@ -90,25 +81,16 @@ dependencies = [ "syn", ] -[[package]] -name = "async_io_utilities" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b20cffc5590f4bf33f05f97a3ea587feba9c50d20325b401daa096b92ff7da0" -dependencies = [ - "tokio", -] - [[package]] name = "async_zip" -version = "0.0.9" +version = "0.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a36d43bdefc7215b2b3a97edd03b1553b7969ad76551025eedd3b913c645f6e" +checksum = "b2105142db9c6203b9dadc83b0553394589a6cb31b1449a3b46b42f47c3434d0" dependencies = [ "async-compression", - "async_io_utilities", - "chrono", "crc32fast", + "log", + "pin-project", "thiserror", "tokio", ] @@ -419,14 +401,9 @@ version = "0.4.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" dependencies = [ - "iana-time-zone", - "js-sys", "num-integer", "num-traits", "serde", - "time", - "wasm-bindgen", - "winapi", ] [[package]] @@ -475,16 +452,6 @@ dependencies = [ "cc", ] -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - [[package]] name = "command-group" version = "2.0.1" @@ -564,50 +531,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "cxx" -version = "1.0.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d3488e7665a7a483b57e25bdd90d0aeb2bc7608c8d0346acf2ad3f1caf1d62" -dependencies = [ - "cc", - "cxxbridge-flags", - "cxxbridge-macro", - "link-cplusplus", -] - -[[package]] -name = "cxx-build" -version = "1.0.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48fcaf066a053a41a81dfb14d57d99738b767febb8b735c3016e469fac5da690" -dependencies = [ - "cc", - "codespan-reporting", - "once_cell", - "proc-macro2", - "quote", - "scratch", - "syn", -] - -[[package]] -name = "cxxbridge-flags" -version = "1.0.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2ef98b8b717a829ca5603af80e1f9e2e48013ab227b68ef37872ef84ee479bf" - -[[package]] -name = "cxxbridge-macro" -version = "1.0.91" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "086c685979a698443656e5cf7856c95c642295a38599f12fb1ff76fb28d19892" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "data-encoding" version = "2.3.3" @@ -933,7 +856,7 @@ checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", ] [[package]] @@ -1116,30 +1039,6 @@ dependencies = [ "tokio-native-tls", ] -[[package]] -name = "iana-time-zone" -version = "0.1.53" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "winapi", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0703ae284fc167426161c2e3f1da3ea71d94b21bedbcc9494e92b28e334e3dca" -dependencies = [ - "cxx", - "cxx-build", -] - [[package]] name = "idna" version = "0.2.3" @@ -1311,15 +1210,6 @@ dependencies = [ "libc", ] -[[package]] -name = "link-cplusplus" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd207c9c713c34f95a097a5b029ac2ce6010530c7b49d7fea24d977dede04f5" -dependencies = [ - "cc", -] - [[package]] name = "linked-hash-map" version = "0.5.6" @@ -1467,7 +1357,7 @@ checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" dependencies = [ "libc", "log", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi", "windows-sys 0.45.0", ] @@ -2064,12 +1954,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" -[[package]] -name = "scratch" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" - [[package]] name = "sct" version = "0.7.0" @@ -2391,17 +2275,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "time" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" -dependencies = [ - "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi", -] - [[package]] name = "tinytemplate" version = "1.2.1" @@ -2837,12 +2710,6 @@ dependencies = [ "try-lock", ] -[[package]] -name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" - [[package]] name = "wasi" version = "0.11.0+wasi-snapshot-preview1" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index c5e412a1..86491a98 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.64" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } -async_zip = { version = "0.0.9", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } +async_zip = { version = "0.0.12", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } binstalk-types = { version = "0.2.1", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" diff --git a/crates/binstalk-downloader/src/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs index 2c8115cc..7d7f0ffa 100644 --- a/crates/binstalk-downloader/src/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -48,8 +48,14 @@ where let mut zip = ZipFileReader::new(reader); let mut buf = BytesMut::with_capacity(4 * 4096); - while let Some(entry) = zip.entry_reader().await.map_err(ZipError::from_inner)? { - extract_zip_entry(entry, path, &mut buf).await?; + while let Some(mut zip_reader) = zip.next_entry().await.map_err(ZipError::from_inner)? { + extract_zip_entry(&mut zip_reader, path, &mut buf).await?; + + // extract_zip_entry would read the zip_reader until read the file until + // eof unless extract_zip itself is cancelled or an error is raised. + // + // So calling done here should not raise any error. + zip = zip_reader.done().await.map_err(ZipError::from_inner)?; } Ok(()) diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index 69cfcb17..da708453 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -3,12 +3,12 @@ use std::{ path::{Component, Path, PathBuf}, }; -use async_zip::{read::ZipEntryReader, ZipEntryExt}; +use async_zip::read::stream::{Reading, ZipFileReader}; use bytes::{Bytes, BytesMut}; use futures_lite::future::try_zip as try_join; use thiserror::Error as ThisError; use tokio::{ - io::{AsyncRead, AsyncReadExt}, + io::{AsyncRead, AsyncReadExt, Take}, sync::mpsc, }; @@ -34,7 +34,7 @@ impl ZipError { } pub(super) async fn extract_zip_entry( - entry: ZipEntryReader<'_, R>, + zip_reader: &mut ZipFileReader>>, path: &Path, buf: &mut BytesMut, ) -> Result<(), DownloadError> @@ -42,7 +42,7 @@ where R: AsyncRead + Unpin + Send + Sync, { // Sanitize filename - let raw_filename = entry.entry().filename(); + let raw_filename = zip_reader.entry().filename(); let filename = check_filename_and_normalize(raw_filename) .ok_or_else(|| ZipError(ZipErrorInner::InvalidFilePath(raw_filename.into())))?; @@ -56,7 +56,7 @@ where { use std::{fs::Permissions, os::unix::fs::PermissionsExt}; - if let Some(mode) = entry.entry().unix_permissions() { + if let Some(mode) = zip_reader.entry().unix_permissions() { let mode: u16 = mode; perms = Some(Permissions::from_mode(mode as u32)); } @@ -98,7 +98,7 @@ where Ok(()) }); - let read_task = copy_file_to_mpsc(entry, tx, buf); + let read_task = copy_file_to_mpsc(zip_reader.reader(), tx, buf); try_join( async move { write_task.await.map_err(From::from) }, @@ -115,8 +115,8 @@ where Ok(()) } -async fn copy_file_to_mpsc( - mut entry: ZipEntryReader<'_, R>, +async fn copy_file_to_mpsc( + entry_reader: &mut R, tx: mpsc::Sender, buf: &mut BytesMut, ) -> Result<(), async_zip::error::ZipError> @@ -125,7 +125,7 @@ where { // Since BytesMut does not have a max cap, if AsyncReadExt::read_buf returns // 0 then it means Eof. - while entry.read_buf(buf).await? != 0 { + while entry_reader.read_buf(buf).await? != 0 { // Ensure AsyncReadExt::read_buf can read at least 4096B to avoid // frequent expensive read syscalls. // @@ -150,11 +150,7 @@ where } } - if entry.compare_crc() { - Ok(()) - } else { - Err(async_zip::error::ZipError::CRC32CheckError) - } + Ok(()) } /// Ensure the file path is safe to use as a [`Path`]. From 96ebcfd08f643aaf10bd7bdd383f4c08265f6a6f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 22 Feb 2023 22:27:17 +1100 Subject: [PATCH 1066/2020] Add new option `--locked` that is passed through to `cargo-install` (#830) Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 6 ++++++ crates/bin/src/entry.rs | 1 + crates/binstalk/src/ops.rs | 1 + crates/binstalk/src/ops/resolve/resolution.rs | 4 ++++ 4 files changed, 12 insertions(+) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 19b18b77..f9b52526 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -188,6 +188,12 @@ pub struct Args { #[clap(help_heading = "Options", long)] pub roots: Option, + /// This option will be passed through to all `cargo-install` invocations. + /// + /// It will require `Cargo.lock` to be up to date. + #[clap(help_heading = "Options", long)] + pub locked: bool, + /// Deprecated, here for back-compat only. Secure is now on by default. #[clap(hide(true), long)] pub secure: bool, diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 3e9f30cb..7385e2f9 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -97,6 +97,7 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - dry_run: args.dry_run, force: args.force, quiet: args.log_level == Some(LevelFilter::Off), + locked: args.locked, version_req: args.version_req, manifest_path: args.manifest_path, diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index 1b49f8a0..3d965edb 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -21,6 +21,7 @@ pub struct Options { pub dry_run: bool, pub force: bool, pub quiet: bool, + pub locked: bool, pub version_req: Option, pub manifest_path: Option, diff --git a/crates/binstalk/src/ops/resolve/resolution.rs b/crates/binstalk/src/ops/resolve/resolution.rs index d313ac59..935ae3d6 100644 --- a/crates/binstalk/src/ops/resolve/resolution.rs +++ b/crates/binstalk/src/ops/resolve/resolution.rs @@ -150,6 +150,10 @@ impl ResolutionSource { cmd.arg("--force"); } + if opts.locked { + cmd.arg("--locked"); + } + if !opts.dry_run { let mut child = opts .jobserver_client From 809c8e9cad81d9ca48a21d31342134e6c92ab77a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Feb 2023 13:29:33 +1100 Subject: [PATCH 1067/2020] Bump toml_edit from 0.19.3 to 0.19.4 (#831) --- Cargo.lock | 24 ++++++++++++------------ crates/binstalk-manifests/Cargo.toml | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e847c56c..bd0802c9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1391,15 +1391,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "nom8" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8" -dependencies = [ - "memchr", -] - [[package]] name = "normalize-path" version = "0.2.0" @@ -2424,15 +2415,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.3" +version = "0.19.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6a7712b49e1775fb9a7b998de6635b299237f48b404dde71704f2e0e7f37e5" +checksum = "9a1eb0622d28f4b9c90adc4ea4b2b46b47663fde9ac5fafcb14a1369d5508825" dependencies = [ "indexmap", - "nom8", "serde", "serde_spanned", "toml_datetime", + "winnow", ] [[package]] @@ -2951,6 +2942,15 @@ version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +[[package]] +name = "winnow" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efdd927d1a3d5d98abcfc4cf8627371862ee6abfe52a988050621c50c66b4493" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.10.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 0cb41605..7397e87c 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.152", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.93" thiserror = "1.0.38" -toml_edit = { version = "0.19.3", features = ["serde"] } +toml_edit = { version = "0.19.4", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] From fd0166e31b9988775cf2305fae60d62ec4440718 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 03:29:16 +0000 Subject: [PATCH 1068/2020] Bump jobslot from 0.2.8 to 0.2.9 (#833) --- Cargo.lock | 6 +++--- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bd0802c9..acb28492 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1157,16 +1157,16 @@ dependencies = [ [[package]] name = "jobslot" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a08d2656617d9bcba4763baf13ae19b7d5183e2c5c1db9e2074c5ae93d9905" +checksum = "f63428cec7a79b3b4e1b4ba56d56a7da9e205a7957c99f7d27df5260ca361505" dependencies = [ "cfg-if", "getrandom", "libc", "scopeguard", "tokio", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 9d3fa9dd..8a8bbc77 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -21,7 +21,7 @@ detect-targets = { version = "0.1.5", path = "../detect-targets" } either = "1.8.1" home = "0.5.4" itertools = "0.10.5" -jobslot = { version = "0.2.8", features = ["tokio"] } +jobslot = { version = "0.2.9", features = ["tokio"] } maybe-owned = "0.3.4" miette = "5.5.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } From e13354e8fa825b946b4df440dba71909fc4b9f02 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Feb 2023 03:35:21 +0000 Subject: [PATCH 1069/2020] Bump tempfile from 3.3.0 to 3.4.0 (#834) --- Cargo.lock | 18 ++++-------------- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-wasi/Cargo.toml | 2 +- 6 files changed, 9 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index acb28492..7773e3a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1753,15 +1753,6 @@ version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - [[package]] name = "reqwest" version = "0.11.14" @@ -2194,16 +2185,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.3.0" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" +checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" dependencies = [ "cfg-if", "fastrand", - "libc", "redox_syscall", - "remove_dir_all", - "winapi", + "rustix 0.36.8", + "windows-sys 0.42.0", ] [[package]] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index c5d45739..7b51739a 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -37,7 +37,7 @@ semver = "1.0.16" strum = "0.24.1" strum_macros = "0.24.3" supports-color = "2.0.0" -tempfile = "3.3.0" +tempfile = "3.4.0" tokio = { version = "1.25.0", features = ["rt-multi-thread"], default-features = false } tracing-core = "0.1.30" tracing = { version = "0.1.37", default-features = false } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 86491a98..579bfcd9 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -28,7 +28,7 @@ reqwest = { version = "0.11.14", features = ["stream", "gzip", "brotli", "deflat # #tar = "0.4.38" tar = { package = "binstall-tar", version = "0.4.39" } -tempfile = "3.3.0" +tempfile = "3.4.0" thiserror = "1.0.38" tokio = { version = "1.25.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 7397e87c..7f323d33 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -26,4 +26,4 @@ url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] detect-targets = { version = "0.1.5", path = "../detect-targets" } -tempfile = "3.3.0" +tempfile = "3.4.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 8a8bbc77..26d1e966 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -29,7 +29,7 @@ once_cell = "1.17.1" semver = { version = "1.0.16", features = ["serde"] } serde = { version = "1.0.152", features = ["derive"] } strum = "0.24.1" -tempfile = "3.3.0" +tempfile = "3.4.0" thiserror = "1.0.38" tinytemplate = "1.2.1" # parking_lot for `tokio::sync::OnceCell::const_new` diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index 01df98a6..c1b561e1 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -tempfile = "3.3.0" +tempfile = "3.4.0" [package.metadata.binstall] pkg-url = "{ repo }/releases/download/v{ version }/cargo-binstall-{ target }.full.{ archive-format }" From fc4b02e7bce2d12bdea74280874f0225dd7f694b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 28 Feb 2023 14:02:34 +1100 Subject: [PATCH 1070/2020] Disable GitLab e2e-test due to them deleting my account & repo (#836) Signed-off-by: Jiahao XU --- e2e-tests/other-repos.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/e2e-tests/other-repos.sh b/e2e-tests/other-repos.sh index 2097da43..4e932d75 100755 --- a/e2e-tests/other-repos.sh +++ b/e2e-tests/other-repos.sh @@ -8,12 +8,12 @@ export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') export PATH="$CARGO_HOME/bin:$PATH" # Test default GitLab pkg-url templates -"./$1" binstall \ - --force \ - --manifest-path "manifests/gitlab-test-Cargo.toml" \ - --no-confirm \ - --disable-strategies compile \ - cargo-binstall +#"./$1" binstall \ +# --force \ +# --manifest-path "manifests/gitlab-test-Cargo.toml" \ +# --no-confirm \ +# --disable-strategies compile \ +# cargo-binstall # Test default BitBucket pkg-url templates "./$1" binstall \ From 5b70e41966bad238c54cde085cc1d95956e56a7f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Feb 2023 04:35:43 +0000 Subject: [PATCH 1071/2020] Bump clap from 4.1.6 to 4.1.7 (#837) --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7773e3a7..48972465 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -408,9 +408,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.1.6" +version = "4.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0b0588d44d4d63a87dbd75c136c166bbfd9a86a31cb89e09906521c7d3f5e3" +checksum = "2f3061d6db6d8fcbbd4b05e057f2acace52e64e96b498c08c2d7a4e65addd340" dependencies = [ "bitflags", "clap_derive", @@ -423,9 +423,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.1.0" +version = "4.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "684a277d672e91966334af371f1a7b5833f9aa00b07c84e92fbce95e00208ce8" +checksum = "34d122164198950ba84a918270a3bb3f7ededd25e15f7451673d986f55bd2667" dependencies = [ "heck", "proc-macro-error", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 7b51739a..28a40394 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.8.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.3.0" } -clap = { version = "4.1.6", features = ["derive", "env"] } +clap = { version = "4.1.7", features = ["derive", "env"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" file-format = { version = "0.14.0", default-features = false } From 2bf70b6a0182057b0f57dd8701d7049a07fe3e36 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 28 Feb 2023 22:53:57 +1100 Subject: [PATCH 1072/2020] Run e2e test for release build and fix it by switching back to stable (#818) * Run e2e-tests for release build * Print `RUSTFLAGS` for justfile target build & check * Fix CI: Disable miropt level 4 * Fix CI: Disable -Zbuild-std * Disable `-Zgcc-ld=lld` and `-Zshare-generics` so that we can switch back to stable Signed-off-by: Jiahao XU --- .github/workflows/release-build.yml | 2 +- justfile | 35 ++++++++++++++++------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index fa497977..038f6a9c 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -55,7 +55,7 @@ jobs: - name: Ensure release binary is runnable if: "matrix.r" - run: ./target/${{ matrix.t }}/release/cargo-binstall -V + run: just e2e-tests - if: inputs.publish name: Upload to release diff --git a/justfile b/justfile index 4edb4bdb..9fc8eb5b 100644 --- a/justfile +++ b/justfile @@ -38,7 +38,7 @@ output-folder := if target != target-host { "target" / target / output-profile-f output-path := output-folder / output-filename # which tool to use for compiling -cargo-bin := if use-cargo-zigbuild != "" { "cargo-zigbuild" } else if use-cross != "" { "cross" } else { "cargo +nightly" } +cargo-bin := if use-cargo-zigbuild != "" { "cargo-zigbuild" } else if use-cross != "" { "cross" } else { "cargo" } # cargo compile options cargo-profile := if for-release != "" { "release" } else { "dev" } @@ -48,9 +48,9 @@ ci-or-no := if ci != "" { "ci" } else { "noci" } # In release builds in CI, build the std library ourselves so it uses our # compile profile, and optimise panic messages out with immediate abort. -cargo-buildstd := if (cargo-profile / ci-or-no) == "release/ci" { - " -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort" - } else { "" } +cargo-buildstd := "" #if (cargo-profile / ci-or-no) == "release/ci" { +#" -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort" +#} else { "" } # In musl release builds in CI, statically link gcclibs. rustc-gcclibs := if (cargo-profile / ci-or-no / target-libc) == "release/ci/musl" { @@ -82,7 +82,8 @@ cargo-split-debuginfo := if cargo-buildstd != "" { " --config='profile.release.s win-arm64-ring16 := if target == "aarch64-pc-windows-msvc" { " --config='patch.crates-io.ring.git=\"https://github.com/awakecoding/ring\"' --config='patch.crates-io.ring.branch=\"0.16.20_alpha\"'" } else { "" } # MIR optimisation level (defaults to 2, bring it up to 4 for release builds) -rustc-miropt := if for-release != "" { " -Z mir-opt-level=4" } else { "" } +# **DISABLED because it's buggy** +rustc-miropt := "" # if for-release != "" { " -Z mir-opt-level=4" } else { "" } # Use rust-lld that is bundled with rustup to speedup linking # and support for icf=safe. @@ -95,13 +96,13 @@ rustc-miropt := if for-release != "" { " -Z mir-opt-level=4" } else { "" } # # If cargo-zigbuild is used, then it will provide the lld linker. # This option is disabled on windows since it not supported. -rust-lld := if use-cargo-zigbuild != "" { - "" -} else if target-os != "windows" { - " -Z gcc-ld=lld" -} else { - "" -} +rust-lld := "" #if use-cargo-zigbuild != "" { +#"" +#} else if target-os != "windows" { +#" -Z gcc-ld=lld" +#} else { +#"" +#} # ICF: link-time identical code folding # @@ -130,7 +131,7 @@ target-glibc-ver-postfix := if glibc-version != "" { } cargo-build-args := (if for-release != "" { " --release" } else { "" }) + (" --target ") + (target) + (target-glibc-ver-postfix) + (cargo-buildstd) + (if extra-build-args != "" { " " + extra-build-args } else { "" }) + (cargo-no-default-features) + (cargo-split-debuginfo) + (if cargo-features != "" { " --features " + cargo-features } else { "" }) + (win-arm64-ring16) -export RUSTFLAGS := "-Z share-generics " + (linker-plugin-lto) + (rustc-gcclibs) + (rustc-miropt) + (rust-lld) + (rustc-icf) +export RUSTFLAGS := (linker-plugin-lto) + (rustc-gcclibs) + (rustc-miropt) + (rust-lld) + (rustc-icf) # libblocksruntime-dev provides compiler-rt @@ -147,15 +148,17 @@ ci-install-deps: ci-install-deps: toolchain components="": - rustup toolchain install nightly {{ if components != "" { "--component " + components } else { "" } }} --no-self-update --profile minimal - {{ if ci != "" { "rustup default nightly" } else { "rustup override set nightly" } }} + rustup toolchain install stable {{ if components != "" { "--component " + components } else { "" } }} --no-self-update --profile minimal + {{ if ci != "" { "rustup default stable" } else { "rustup override set stable" } }} {{ if target != "" { "rustup target add " + target } else { "" } }} build: + echo "env RUSTFLAGS=$RUSTFLAGS" {{cargo-bin}} build {{cargo-build-args}} check: + echo "env RUSTFLAGS=$RUSTFLAGS" {{cargo-bin}} check {{cargo-build-args}} get-output file outdir=".": @@ -167,7 +170,7 @@ get-binary outdir=".": (get-output output-filename outdir) -chmod +x {{ outdir / output-filename }} e2e-test file *arguments: (get-binary "e2e-tests") - cd e2e-tests && bash {{file}}.sh {{output-filename}} {{arguments}} + cd e2e-tests && env -u RUSTFLAGS bash {{file}}.sh {{output-filename}} {{arguments}} e2e-test-live: (e2e-test "live") e2e-test-manifest-path: (e2e-test "manifest-path") From af6dc61f3d6f169e11ac953ef27939a4385ca61a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 1 Mar 2023 01:32:40 +1100 Subject: [PATCH 1073/2020] Disable `--icf=safe` on MacOS (#839) Signed-off-by: Jiahao XU --- justfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/justfile b/justfile index 9fc8eb5b..34ffa2d7 100644 --- a/justfile +++ b/justfile @@ -106,9 +106,19 @@ rust-lld := "" #if use-cargo-zigbuild != "" { # ICF: link-time identical code folding # -# On windows it works out of the box and on other targets it uses +# On windows it works out of the box and on linux it uses # rust-lld. -rustc-icf := if for-release != "" { " -C link-arg=-Wl,--icf=safe" } else { "" } +rustc-icf := if for-release != "" { + if target-os == "windows" { + " -C link-arg=-Wl,--icf=safe" + } else if target-os == "linux" { + " -C link-arg=-Wl,--icf=safe" + } else { + "" + } +} else { + "" +} # Only enable linker-plugin-lto for release # Also disable this on windows since it uses msvc. From 263c836757a403f0f4491026e2e1435a4890b844 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 1 Mar 2023 02:35:26 +0000 Subject: [PATCH 1074/2020] Bump clap from 4.1.7 to 4.1.8 (#840) --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 48972465..57984697 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -408,9 +408,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.1.7" +version = "4.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f3061d6db6d8fcbbd4b05e057f2acace52e64e96b498c08c2d7a4e65addd340" +checksum = "c3d7ae14b20b94cb02149ed21a86c423859cbe18dc7ed69845cace50e52b40a5" dependencies = [ "bitflags", "clap_derive", @@ -423,9 +423,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.1.7" +version = "4.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34d122164198950ba84a918270a3bb3f7ededd25e15f7451673d986f55bd2667" +checksum = "44bec8e5c9d09e439c4335b1af0abaab56dcf3b94999a936e1bb47b9134288f0" dependencies = [ "heck", "proc-macro-error", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 28a40394..7269055a 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.8.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.3.0" } -clap = { version = "4.1.7", features = ["derive", "env"] } +clap = { version = "4.1.8", features = ["derive", "env"] } crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" file-format = { version = "0.14.0", default-features = false } From 599bcaf3330e4d42043506c9372ae14af3dee6eb Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 2 Mar 2023 12:04:22 +1100 Subject: [PATCH 1075/2020] Impl `GhApiClient` and use it in `cargo-binstall` to speedup resolution process (#832) Fixed #776 - Add new feature gh-api-client to binstalk-downloader - Impl new type `binstalk_downloader::remote::{RequestBuilder, Response}` - Impl `binstalk_downloader::gh_api_client::GhApiClient`, exposed if `cfg(feature = "gh-api-client")` and add e2e and unit tests for it - Use `binstalk_downloader::gh_api_client::GhApiClient` to speedup `cargo-binstall` - Add new option `--github-token` to supply the token for GitHub restful API, or read from env variable `GITHUB_TOKEN` if not present. Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 2 + .github/workflows/release-build.yml | 2 + Cargo.lock | 3 + crates/bin/Cargo.toml | 1 + crates/bin/src/args.rs | 5 + crates/bin/src/entry.rs | 8 +- crates/binstalk-downloader/Cargo.toml | 8 + crates/binstalk-downloader/src/download.rs | 3 - .../src/download/async_extracter.rs | 66 +-- .../src/download/stream_readable.rs | 65 --- .../binstalk-downloader/src/download/utils.rs | 22 - .../src/download/zip_extraction.rs | 3 +- .../binstalk-downloader/src/gh_api_client.rs | 398 ++++++++++++++++++ .../src/gh_api_client/request.rs | 135 ++++++ crates/binstalk-downloader/src/lib.rs | 11 + crates/binstalk-downloader/src/remote.rs | 73 ++-- .../src/remote/request_builder.rs | 99 +++++ crates/binstalk-downloader/src/utils.rs | 175 ++++++++ crates/binstalk/Cargo.toml | 2 +- crates/binstalk/src/errors.rs | 16 + crates/binstalk/src/fetchers.rs | 9 +- crates/binstalk/src/fetchers/gh_crate_meta.rs | 27 +- crates/binstalk/src/fetchers/quickinstall.rs | 5 +- crates/binstalk/src/helpers.rs | 2 +- crates/binstalk/src/ops.rs | 5 +- crates/binstalk/src/ops/resolve.rs | 7 +- 26 files changed, 960 insertions(+), 192 deletions(-) delete mode 100644 crates/binstalk-downloader/src/download/stream_readable.rs delete mode 100644 crates/binstalk-downloader/src/download/utils.rs create mode 100644 crates/binstalk-downloader/src/gh_api_client.rs create mode 100644 crates/binstalk-downloader/src/gh_api_client/request.rs create mode 100644 crates/binstalk-downloader/src/remote/request_builder.rs create mode 100644 crates/binstalk-downloader/src/utils.rs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3a510540..3de12b55 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,6 +56,8 @@ jobs: - run: just toolchain - run: just ci-install-deps - run: just test + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} linux-cross-check: strategy: diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 038f6a9c..f81c2c78 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -56,6 +56,8 @@ jobs: - name: Ensure release binary is runnable if: "matrix.r" run: just e2e-tests + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - if: inputs.publish name: Upload to release diff --git a/Cargo.lock b/Cargo.lock index 57984697..1e493f82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -199,6 +199,8 @@ dependencies = [ "generic-array", "httpdate", "reqwest", + "serde", + "serde_json", "tempfile", "thiserror", "tokio", @@ -340,6 +342,7 @@ dependencies = [ "binstalk", "binstalk-manifests", "clap", + "compact_str", "crates_io_api", "dirs", "embed-resource", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 7269055a..0c3ddce1 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -25,6 +25,7 @@ pkg-fmt = "zip" binstalk = { path = "../binstalk", version = "0.8.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.3.0" } clap = { version = "4.1.8", features = ["derive", "env"] } +compact_str = "0.7.0" crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" file-format = { version = "0.14.0", default-features = false } diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index f9b52526..0668c093 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -13,6 +13,7 @@ use binstalk::{ ops::resolve::{CrateName, VersionReqExt}, }; use clap::{error::ErrorKind, CommandFactory, Parser, ValueEnum}; +use compact_str::CompactString; use log::LevelFilter; use semver::VersionReq; use strum::EnumCount; @@ -218,6 +219,10 @@ pub struct Args { #[clap(help_heading = "Options", long)] pub json_output: bool, + /// Provide the github token for accessing the restful API of api.github.com + #[clap(help_heading = "Options", long, env = "GITHUB_TOKEN")] + pub github_token: Option, + /// Print version information #[clap(help_heading = "Meta", short = 'V')] pub version: bool, diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 7385e2f9..6cd1338a 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -1,5 +1,5 @@ use std::{ - fs, + env, fs, path::{Path, PathBuf}, sync::Arc, time::Duration, @@ -10,6 +10,7 @@ use binstalk::{ fetchers::{Fetcher, GhCrateMeta, QuickInstall}, get_desired_targets, helpers::{ + gh_api_client::GhApiClient, jobserver_client::LazyJobserverClient, remote::{Certificate, Client}, tasks::AutoAbortJoinHandle, @@ -87,6 +88,8 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - ) .map_err(BinstallError::from)?; + let gh_api_client = GhApiClient::new(client.clone(), args.github_token); + // Build crates.io api client let crates_io_api_client = CratesIoApiClient::with_http_client(client.get_inner().clone(), Duration::from_millis(100)); @@ -111,6 +114,7 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - install_path, client, crates_io_api_client, + gh_api_client, jobserver_client, }); @@ -342,7 +346,7 @@ fn do_install_fetches( if no_cleanup { // Consume temp_dir without removing it from fs. - temp_dir.into_path(); + let _ = temp_dir.into_path(); } else { temp_dir.close().unwrap_or_else(|err| { warn!("Failed to clean up some resources: {err}"); diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 579bfcd9..f7c298b2 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -23,6 +23,8 @@ futures-lite = { version = "1.12.0", default-features = false } generic-array = "0.14.6" httpdate = "1.0.2" reqwest = { version = "0.11.14", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } +serde = { version = "1.0.152", features = ["derive"], optional = true } +serde_json = { version = "1.0.93", optional = true } # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. # @@ -71,3 +73,9 @@ trust-dns = ["trust-dns-resolver", "reqwest/trust-dns"] zstd-thin = ["zstd/thin"] cross-lang-fat-lto = ["zstd/fat-lto"] + +gh-api-client = ["serde", "serde_json"] + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index 10de2348..8a9c40be 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -18,13 +18,10 @@ use async_tar_visitor::extract_tar_based_stream_and_visit; pub use async_tar_visitor::{TarEntriesVisitor, TarEntry, TarEntryType}; mod extracter; -mod stream_readable; mod zip_extraction; pub use zip_extraction::ZipError; -mod utils; - #[derive(Debug, ThisError)] pub enum DownloadError { #[error("Failed to extract zipfile: {0}")] diff --git a/crates/binstalk-downloader/src/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs index 7d7f0ffa..970d2a90 100644 --- a/crates/binstalk-downloader/src/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -7,18 +7,15 @@ use std::{ use async_zip::read::stream::ZipFileReader; use bytes::{Bytes, BytesMut}; -use futures_lite::{ - future::try_zip as try_join, - stream::{Stream, StreamExt}, -}; +use futures_lite::stream::Stream; use tokio::sync::mpsc; use tokio_util::io::StreamReader; use tracing::debug; use super::{ - extracter::*, stream_readable::StreamReadable, utils::asyncify, - zip_extraction::extract_zip_entry, DownloadError, TarBasedFmt, ZipError, + extracter::*, zip_extraction::extract_zip_entry, DownloadError, TarBasedFmt, ZipError, }; +use crate::utils::{extract_with_blocking_task, StreamReadable}; pub async fn extract_bin(stream: S, path: &Path) -> Result<(), DownloadError> where @@ -77,71 +74,22 @@ where .await } -async fn extract_with_blocking_decoder( +fn extract_with_blocking_decoder( stream: S, path: &Path, f: F, -) -> Result<(), DownloadError> +) -> impl Future> where S: Stream> + Send + Sync + Unpin + 'static, F: FnOnce(mpsc::Receiver, &Path) -> io::Result<()> + Send + Sync + 'static, { - async fn inner( - mut stream: S, - task: Fut, - tx: mpsc::Sender, - ) -> Result<(), DownloadError> - where - // We do not use trait object for S since there will only be one - // S used with this function. - S: Stream> + Send + Sync + Unpin + 'static, - // asyncify would always return the same future, so no need to - // use trait object here. - Fut: Future> + Send + Sync, - { - try_join( - async move { - while let Some(bytes) = stream.next().await.transpose()? { - if bytes.is_empty() { - continue; - } - - if tx.send(bytes).await.is_err() { - // The extract tar returns, which could be that: - // - Extraction fails with an error - // - Extraction success without the rest of the data - // - // - // It's hard to tell the difference here, so we assume - // the first scienario occurs. - // - // Even if the second scienario occurs, it won't affect the - // extraction process anyway, so we can jsut ignore it. - return Ok(()); - } - } - - Ok(()) - }, - task, - ) - .await?; - - Ok(()) - } - - // Use channel size = 5 to minimize the waiting time in the extraction task - let (tx, rx) = mpsc::channel(5); - let path = path.to_owned(); - let task = asyncify(move || { + extract_with_blocking_task(stream, move |rx| { if let Some(parent) = path.parent() { fs::create_dir_all(parent)?; } f(rx, &path) - }); - - inner(stream, task, tx).await + }) } diff --git a/crates/binstalk-downloader/src/download/stream_readable.rs b/crates/binstalk-downloader/src/download/stream_readable.rs deleted file mode 100644 index f1ec5a27..00000000 --- a/crates/binstalk-downloader/src/download/stream_readable.rs +++ /dev/null @@ -1,65 +0,0 @@ -use std::io::{self, BufRead, Read}; - -use bytes::{Buf, Bytes}; -use tokio::sync::mpsc; - -/// This wraps an AsyncIterator as a `Read`able. -/// It must be used in non-async context only, -/// meaning you have to use it with -/// `tokio::task::{block_in_place, spawn_blocking}` or -/// `std::thread::spawn`. -pub struct StreamReadable { - rx: mpsc::Receiver, - bytes: Bytes, -} - -impl StreamReadable { - pub(super) fn new(rx: mpsc::Receiver) -> Self { - Self { - rx, - bytes: Bytes::new(), - } - } -} - -impl Read for StreamReadable { - fn read(&mut self, buf: &mut [u8]) -> io::Result { - if buf.is_empty() { - return Ok(0); - } - - if self.fill_buf()?.is_empty() { - return Ok(0); - } - - let bytes = &mut self.bytes; - - // copy_to_slice requires the bytes to have enough remaining bytes - // to fill buf. - let n = buf.len().min(bytes.remaining()); - - // ::copy_to_slice copies and consumes the bytes - bytes.copy_to_slice(&mut buf[..n]); - - Ok(n) - } -} - -impl BufRead for StreamReadable { - fn fill_buf(&mut self) -> io::Result<&[u8]> { - let bytes = &mut self.bytes; - - if !bytes.has_remaining() { - if let Some(new_bytes) = self.rx.blocking_recv() { - // new_bytes are guaranteed to be non-empty. - *bytes = new_bytes; - } - } - - Ok(&*bytes) - } - - fn consume(&mut self, amt: usize) { - self.bytes.advance(amt); - } -} diff --git a/crates/binstalk-downloader/src/download/utils.rs b/crates/binstalk-downloader/src/download/utils.rs deleted file mode 100644 index 9fde5239..00000000 --- a/crates/binstalk-downloader/src/download/utils.rs +++ /dev/null @@ -1,22 +0,0 @@ -use std::{future::Future, io}; - -use tokio::task; - -/// Copied from tokio https://docs.rs/tokio/latest/src/tokio/fs/mod.rs.html#132 -pub(super) fn asyncify(f: F) -> impl Future> + Send + Sync + 'static -where - F: FnOnce() -> io::Result + Send + 'static, - T: Send + 'static, -{ - async fn inner(handle: task::JoinHandle>) -> io::Result { - match handle.await { - Ok(res) => res, - Err(err) => Err(io::Error::new( - io::ErrorKind::Other, - format!("background task failed: {err}"), - )), - } - } - - inner(task::spawn_blocking(f)) -} diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index da708453..8ddddc68 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -12,7 +12,8 @@ use tokio::{ sync::mpsc, }; -use super::{utils::asyncify, DownloadError}; +use super::DownloadError; +use crate::utils::asyncify; #[derive(Debug, ThisError)] enum ZipErrorInner { diff --git a/crates/binstalk-downloader/src/gh_api_client.rs b/crates/binstalk-downloader/src/gh_api_client.rs new file mode 100644 index 00000000..ab8ad91c --- /dev/null +++ b/crates/binstalk-downloader/src/gh_api_client.rs @@ -0,0 +1,398 @@ +use std::{ + collections::HashMap, + ops::Deref, + sync::{Arc, Mutex, RwLock}, + time::{Duration, Instant}, +}; + +use compact_str::{CompactString, ToCompactString}; +use tokio::sync::OnceCell; + +use crate::remote; + +mod request; +pub use request::{GhApiError, JsonError}; + +/// default retry duration if x-ratelimit-reset is not found in response header +const DEFAULT_RETRY_DURATION: Duration = Duration::from_secs(3); + +/// The keys required to identify a github release. +#[derive(Clone, Eq, PartialEq, Hash, Debug)] +pub struct GhRelease { + pub owner: CompactString, + pub repo: CompactString, + pub tag: CompactString, +} + +/// The Github Release and one of its artifact. +#[derive(Clone, Eq, PartialEq, Hash, Debug)] +pub struct GhReleaseArtifact { + pub release: GhRelease, + pub artifact_name: CompactString, +} + +impl GhReleaseArtifact { + /// Create [`GhReleaseArtifact`] from url. + pub fn try_extract_from_url(url: &remote::Url) -> Option { + if url.domain() != Some("github.com") { + return None; + } + + let mut path_segments = url.path_segments()?; + + let owner = path_segments.next()?; + let repo = path_segments.next()?; + + if (path_segments.next()?, path_segments.next()?) != ("releases", "download") { + return None; + } + + let tag = path_segments.next()?; + let artifact_name = path_segments.next()?; + + (path_segments.next().is_none() && url.fragment().is_none() && url.query().is_none()).then( + || Self { + release: GhRelease { + owner: owner.to_compact_string(), + repo: repo.to_compact_string(), + tag: tag.to_compact_string(), + }, + artifact_name: artifact_name.to_compact_string(), + }, + ) + } +} + +#[derive(Debug)] +struct Map(RwLock>>); + +impl Default for Map { + fn default() -> Self { + Self(Default::default()) + } +} + +impl Map +where + K: Eq + std::hash::Hash, + V: Default, +{ + fn get(&self, k: K) -> Arc { + let optional_value = self.0.read().unwrap().deref().get(&k).cloned(); + optional_value.unwrap_or_else(|| Arc::clone(self.0.write().unwrap().entry(k).or_default())) + } +} + +#[derive(Debug)] +struct Inner { + client: remote::Client, + auth_token: Option, + release_artifacts: Map>>, + retry_after: Mutex>, +} + +/// Github API client for querying whether a release artifact exitsts. +/// Can only handle github.com for now. +#[derive(Clone, Debug)] +pub struct GhApiClient(Arc); + +impl GhApiClient { + pub fn new(client: remote::Client, auth_token: Option) -> Self { + Self(Arc::new(Inner { + client, + auth_token, + release_artifacts: Default::default(), + retry_after: Default::default(), + })) + } + + /// The returned future is guaranteed to be pointer size. + pub async fn has_release_artifact( + &self, + GhReleaseArtifact { + release, + artifact_name, + }: GhReleaseArtifact, + ) -> Result { + enum Failure { + Error(GhApiError), + RateLimit { retry_after: Instant }, + Unauthorized, + } + + let once_cell = self.0.release_artifacts.get(release.clone()); + let res = once_cell + .get_or_try_init(|| { + Box::pin(async { + use request::FetchReleaseRet::*; + + { + let mut guard = self.0.retry_after.lock().unwrap(); + + if let Some(retry_after) = *guard { + if retry_after.elapsed().is_zero() { + return Err(Failure::RateLimit { retry_after }); + } else { + // Instant retry_after is already reached. + *guard = None; + } + }; + } + + match request::fetch_release_artifacts( + &self.0.client, + release, + self.0.auth_token.as_deref(), + ) + .await + { + Ok(ReleaseNotFound) => Ok::<_, Failure>(None), + Ok(Artifacts(artifacts)) => Ok(Some(artifacts)), + Ok(ReachedRateLimit { retry_after }) => { + let retry_after = retry_after.unwrap_or(DEFAULT_RETRY_DURATION); + + let now = Instant::now(); + let retry_after = now + .checked_add(retry_after) + .unwrap_or_else(|| now + DEFAULT_RETRY_DURATION); + + Err(Failure::RateLimit { retry_after }) + } + Ok(Unauthorized) => Err(Failure::Unauthorized), + Err(err) => Err(Failure::Error(err)), + } + }) + }) + .await; + + match res { + Ok(Some(artifacts)) => { + let has_artifact = artifacts.contains(&artifact_name); + Ok(if has_artifact { + HasReleaseArtifact::Yes + } else { + HasReleaseArtifact::No + }) + } + Ok(None) => Ok(HasReleaseArtifact::NoSuchRelease), + Err(Failure::Unauthorized) => Ok(HasReleaseArtifact::Unauthorized), + Err(Failure::RateLimit { retry_after }) => { + *self.0.retry_after.lock().unwrap() = Some(retry_after); + + Ok(HasReleaseArtifact::RateLimit { retry_after }) + } + Err(Failure::Error(err)) => Err(err), + } + } +} + +#[derive(Eq, PartialEq, Copy, Clone, Debug)] +pub enum HasReleaseArtifact { + Yes, + No, + NoSuchRelease, + /// GitHub returns 401 requiring a token. + /// In this case, it makes sense to fallback to HEAD/GET. + Unauthorized, + + /// GitHub rate limit is applied per hour, so in case of reaching the rate + /// limit, [`GhApiClient`] will return this variant and let the user decide + /// what to do. + /// + /// Usually it is more sensible to fallback to directly HEAD/GET the + /// artifact url than waiting until `retry_after`. + /// + /// If you encounter this frequently, then you should consider getting an + /// authentication token (can be personal access or oath access token), + /// which should give you 5000 requests per hour per user. + /// + /// Rate limit for unauthorized user is 60 requests per hour per originating + /// IP address, so it is very easy to be rate limited. + RateLimit { + retry_after: Instant, + }, +} + +#[cfg(test)] +mod test { + use super::*; + + mod cargo_binstall_v0_20_1 { + use super::{CompactString, GhRelease}; + + pub(super) const RELEASE: GhRelease = GhRelease { + owner: CompactString::new_inline("cargo-bins"), + repo: CompactString::new_inline("cargo-binstall"), + tag: CompactString::new_inline("v0.20.1"), + }; + + pub(super) const ARTIFACTS: &[&str] = &[ + "cargo-binstall-aarch64-apple-darwin.full.zip", + "cargo-binstall-aarch64-apple-darwin.zip", + "cargo-binstall-aarch64-pc-windows-msvc.full.zip", + "cargo-binstall-aarch64-pc-windows-msvc.zip", + "cargo-binstall-aarch64-unknown-linux-gnu.full.tgz", + "cargo-binstall-aarch64-unknown-linux-gnu.tgz", + "cargo-binstall-aarch64-unknown-linux-musl.full.tgz", + "cargo-binstall-aarch64-unknown-linux-musl.tgz", + "cargo-binstall-armv7-unknown-linux-gnueabihf.full.tgz", + "cargo-binstall-armv7-unknown-linux-gnueabihf.tgz", + "cargo-binstall-armv7-unknown-linux-musleabihf.full.tgz", + "cargo-binstall-armv7-unknown-linux-musleabihf.tgz", + "cargo-binstall-universal-apple-darwin.full.zip", + "cargo-binstall-universal-apple-darwin.zip", + "cargo-binstall-x86_64-apple-darwin.full.zip", + "cargo-binstall-x86_64-apple-darwin.zip", + "cargo-binstall-x86_64-pc-windows-msvc.full.zip", + "cargo-binstall-x86_64-pc-windows-msvc.zip", + "cargo-binstall-x86_64-unknown-linux-gnu.full.tgz", + "cargo-binstall-x86_64-unknown-linux-gnu.tgz", + "cargo-binstall-x86_64-unknown-linux-musl.full.tgz", + "cargo-binstall-x86_64-unknown-linux-musl.tgz", + ]; + } + + fn try_extract_artifact_from_str(s: &str) -> Option { + GhReleaseArtifact::try_extract_from_url(&url::Url::parse(s).unwrap()) + } + + fn assert_extract_gh_release_artifacts_failures(urls: &[&str]) { + for url in urls { + assert_eq!(try_extract_artifact_from_str(url), None); + } + } + + #[test] + fn extract_gh_release_artifacts_failure() { + use cargo_binstall_v0_20_1::*; + + let GhRelease { owner, repo, tag } = RELEASE; + + assert_extract_gh_release_artifacts_failures(&[ + "https://examle.com", + "https://github.com", + &format!("https://github.com/{owner}"), + &format!("https://github.com/{owner}/{repo}"), + &format!("https://github.com/{owner}/{repo}/123e"), + &format!("https://github.com/{owner}/{repo}/releases/21343"), + &format!("https://github.com/{owner}/{repo}/releases/download"), + &format!("https://github.com/{owner}/{repo}/releases/download/{tag}"), + &format!("https://github.com/{owner}/{repo}/releases/download/{tag}/a/23"), + &format!("https://github.com/{owner}/{repo}/releases/download/{tag}/a#a=12"), + &format!("https://github.com/{owner}/{repo}/releases/download/{tag}/a?page=3"), + ]); + } + + #[test] + fn extract_gh_release_artifacts_success() { + use cargo_binstall_v0_20_1::*; + + let GhRelease { owner, repo, tag } = RELEASE; + + for artifact in ARTIFACTS { + let GhReleaseArtifact { + release, + artifact_name, + } = try_extract_artifact_from_str(&format!( + "https://github.com/{owner}/{repo}/releases/download/{tag}/{artifact}" + )) + .unwrap(); + + assert_eq!(release, RELEASE); + assert_eq!(artifact_name, artifact); + } + } + + /// Mark this as an async fn so that you won't accidentally use it in + /// sync context. + async fn create_client() -> GhApiClient { + GhApiClient::new( + remote::Client::new( + concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), + None, + Duration::from_millis(10), + 1.try_into().unwrap(), + [], + ) + .unwrap(), + None, + ) + } + + #[tokio::test] + async fn test_gh_api_client_cargo_binstall_v0_20_1() { + let client = create_client().await; + + let release = cargo_binstall_v0_20_1::RELEASE; + + let artifacts = cargo_binstall_v0_20_1::ARTIFACTS + .iter() + .map(ToCompactString::to_compact_string); + + for artifact_name in artifacts { + let ret = client + .has_release_artifact(GhReleaseArtifact { + release: release.clone(), + artifact_name, + }) + .await + .unwrap(); + + assert!( + matches!( + ret, + HasReleaseArtifact::Yes | HasReleaseArtifact::RateLimit { .. } + ), + "ret = {:#?}", + ret + ); + } + + let ret = client + .has_release_artifact(GhReleaseArtifact { + release, + artifact_name: "123z".to_compact_string(), + }) + .await + .unwrap(); + + assert!( + matches!( + ret, + HasReleaseArtifact::No | HasReleaseArtifact::RateLimit { .. } + ), + "ret = {:#?}", + ret + ); + } + + #[tokio::test] + async fn test_gh_api_client_cargo_binstall_no_such_release() { + let client = create_client().await; + + let release = GhRelease { + owner: "cargo-bins".to_compact_string(), + repo: "cargo-binstall".to_compact_string(), + // We are currently at v0.20.1 and we would never release + // anything older than v0.20.1 + tag: "v0.18.2".to_compact_string(), + }; + + let ret = client + .has_release_artifact(GhReleaseArtifact { + release, + artifact_name: "1234".to_compact_string(), + }) + .await + .unwrap(); + + assert!( + matches!( + ret, + HasReleaseArtifact::NoSuchRelease | HasReleaseArtifact::RateLimit { .. } + ), + "ret = {:#?}", + ret + ); + } +} diff --git a/crates/binstalk-downloader/src/gh_api_client/request.rs b/crates/binstalk-downloader/src/gh_api_client/request.rs new file mode 100644 index 00000000..d759e434 --- /dev/null +++ b/crates/binstalk-downloader/src/gh_api_client/request.rs @@ -0,0 +1,135 @@ +use std::{ + borrow::Borrow, + collections::HashSet, + hash::{Hash, Hasher}, + io, + time::Duration, +}; + +use compact_str::CompactString; +use serde::Deserialize; +use serde_json::from_slice as json_from_slice; +use thiserror::Error as ThisError; +use url::Url; + +pub use serde_json::Error as JsonError; + +use super::{remote, GhRelease}; + +#[derive(ThisError, Debug)] +pub enum GhApiError { + #[error("IO Error: {0}")] + Io(#[from] io::Error), + + #[error("Failed to parse json: {0}")] + Json(#[from] JsonError), + + #[error("Remote Error: {0}")] + Remote(#[from] remote::Error), + + #[error("Failed to parse url: {0}")] + InvalidUrl(#[from] url::ParseError), +} + +// Only include fields we do care about + +#[derive(Eq, Deserialize, Debug)] +struct Artifact { + name: CompactString, +} + +// Manually implement PartialEq and Hash to ensure it will always produce the +// same hash as a str with the same content, and that the comparison will be +// the same to coparing a string. + +impl PartialEq for Artifact { + fn eq(&self, other: &Self) -> bool { + self.name.eq(&other.name) + } +} + +impl Hash for Artifact { + fn hash(&self, state: &mut H) + where + H: Hasher, + { + let s: &str = self.name.as_str(); + s.hash(state) + } +} + +// Implement Borrow so that we can use call +// `HashSet::contains::` + +impl Borrow for Artifact { + fn borrow(&self) -> &str { + &self.name + } +} + +#[derive(Debug, Deserialize)] +pub(super) struct Artifacts { + assets: HashSet, +} + +impl Artifacts { + pub(super) fn contains(&self, artifact_name: &str) -> bool { + self.assets.contains(artifact_name) + } +} + +pub(super) enum FetchReleaseRet { + ReachedRateLimit { retry_after: Option }, + ReleaseNotFound, + Artifacts(Artifacts), + Unauthorized, +} + +/// Returns 404 if not found +pub(super) async fn fetch_release_artifacts( + client: &remote::Client, + GhRelease { owner, repo, tag }: GhRelease, + auth_token: Option<&str>, +) -> Result { + let mut request_builder = client + .get(Url::parse(&format!( + "https://api.github.com/repos/{owner}/{repo}/releases/tags/{tag}" + ))?) + .header("Accept", "application/vnd.github+json") + .header("X-GitHub-Api-Version", "2022-11-28"); + + if let Some(auth_token) = auth_token { + request_builder = request_builder.bearer_auth(&auth_token); + } + + let response = request_builder.send(false).await?; + + let status = response.status(); + let headers = response.headers(); + + if status == remote::StatusCode::FORBIDDEN + && headers + .get("x-ratelimit-remaining") + .map(|val| val == "0") + .unwrap_or(false) + { + return Ok(FetchReleaseRet::ReachedRateLimit { + retry_after: headers.get("x-ratelimit-reset").and_then(|value| { + let secs = value.to_str().ok()?.parse().ok()?; + Some(Duration::from_secs(secs)) + }), + }); + } + + if status == remote::StatusCode::UNAUTHORIZED { + return Ok(FetchReleaseRet::Unauthorized); + } + + if status == remote::StatusCode::NOT_FOUND { + return Ok(FetchReleaseRet::ReleaseNotFound); + } + + let bytes = response.error_for_status()?.bytes().await?; + + Ok(FetchReleaseRet::Artifacts(json_from_slice(&bytes)?)) +} diff --git a/crates/binstalk-downloader/src/lib.rs b/crates/binstalk-downloader/src/lib.rs index abb27a74..e4d6ddbd 100644 --- a/crates/binstalk-downloader/src/lib.rs +++ b/crates/binstalk-downloader/src/lib.rs @@ -1,2 +1,13 @@ +#![cfg_attr(docsrs, feature(doc_auto_cfg))] + pub mod download; + +/// Github API client. +/// Currently only support github.com and does not support other enterprise +/// github. +#[cfg(feature = "gh-api-client")] +pub mod gh_api_client; + pub mod remote; + +mod utils; diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 049ccb38..f5cec8bc 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -6,17 +6,17 @@ use std::{ }; use bytes::Bytes; -use futures_lite::stream::{Stream, StreamExt}; +use futures_lite::stream::Stream; use httpdate::parse_http_date; use reqwest::{ header::{HeaderMap, RETRY_AFTER}, - Request, Response, StatusCode, + Request, }; use thiserror::Error as ThisError; use tower::{limit::rate::RateLimit, Service, ServiceBuilder, ServiceExt}; use tracing::{debug, info}; -pub use reqwest::{tls, Error as ReqwestError, Method}; +pub use reqwest::{header, tls, Error as ReqwestError, Method, StatusCode}; pub use url::Url; mod delay_request; @@ -25,6 +25,9 @@ use delay_request::DelayRequest; mod certificate; pub use certificate::Certificate; +mod request_builder; +pub use request_builder::{RequestBuilder, Response}; + const MAX_RETRY_DURATION: Duration = Duration::from_secs(120); const MAX_RETRY_COUNT: u8 = 3; const DEFAULT_RETRY_DURATION_FOR_RATE_LIMIT: Duration = Duration::from_millis(200); @@ -129,11 +132,10 @@ impl Client { /// to retry. async fn do_send_request( &self, - method: &Method, + request: Request, url: &Url, - ) -> Result>, ReqwestError> { - let request = Request::new(method.clone(), url.clone()); - + ) -> Result>, ReqwestError> + { let future = (&self.0.service).ready().await?.call(request); let response = match future.await { @@ -151,7 +153,7 @@ impl Client { let status = response.status(); - let add_delay_and_continue = |response: Response, duration| { + let add_delay_and_continue = |response: reqwest::Response, duration| { info!("Receiver status code {status}, will wait for {duration:#?} and retry"); self.0 @@ -180,11 +182,11 @@ impl Client { } } + /// * `request` - `Request::try_clone` must always return `Some`. async fn send_request_inner( &self, - method: &Method, - url: &Url, - ) -> Result { + request: &Request, + ) -> Result { let mut count = 0; let max_retry_count = NonZeroU8::new(MAX_RETRY_COUNT).unwrap(); @@ -193,7 +195,10 @@ impl Client { // Increment the counter before checking for terminal condition. count += 1; - match self.do_send_request(method, url).await? { + match self + .do_send_request(request.try_clone().unwrap(), request.url()) + .await? + { ControlFlow::Break(response) => break Ok(response), ControlFlow::Continue(res) if count >= max_retry_count.get() => { break res; @@ -203,13 +208,13 @@ impl Client { } } + /// * `request` - `Request::try_clone` must always return `Some`. async fn send_request( &self, - method: Method, - url: Url, + request: Request, error_for_status: bool, - ) -> Result { - self.send_request_inner(&method, &url) + ) -> Result { + self.send_request_inner(&request) .await .and_then(|response| { if error_for_status { @@ -218,22 +223,29 @@ impl Client { Ok(response) } }) - .map_err(|err| Error::Http(Box::new(HttpError { method, url, err }))) + .map_err(|err| { + Error::Http(Box::new(HttpError { + method: request.method().clone(), + url: request.url().clone(), + err, + })) + }) } async fn head_or_fallback_to_get( &self, url: Url, error_for_status: bool, - ) -> Result { + ) -> Result { let res = self - .send_request(Method::HEAD, url.clone(), error_for_status) + .send_request(Request::new(Method::HEAD, url.clone()), error_for_status) .await; let retry_with_get = move || async move { // Retry using GET info!("HEAD on {url} is not allowed, fallback to GET"); - self.send_request(Method::GET, url, error_for_status).await + self.send_request(Request::new(Method::GET, url), error_for_status) + .await }; let is_retryable = |status| { @@ -282,19 +294,18 @@ impl Client { ) -> Result>, Error> { debug!("Downloading from: '{url}'"); - let response = self.send_request(Method::GET, url.clone(), true).await?; + Ok(self.get(url).send(true).await?.bytes_stream()) + } - let url = Box::new(url); + pub fn request(&self, method: Method, url: Url) -> RequestBuilder { + RequestBuilder { + client: self.clone(), + inner: self.0.client.request(method, url), + } + } - Ok(response.bytes_stream().map(move |res| { - res.map_err(|err| { - Error::Http(Box::new(HttpError { - method: Method::GET, - url: Url::clone(&*url), - err, - })) - }) - })) + pub fn get(&self, url: Url) -> RequestBuilder { + self.request(Method::GET, url) } } diff --git a/crates/binstalk-downloader/src/remote/request_builder.rs b/crates/binstalk-downloader/src/remote/request_builder.rs new file mode 100644 index 00000000..b8e88428 --- /dev/null +++ b/crates/binstalk-downloader/src/remote/request_builder.rs @@ -0,0 +1,99 @@ +use std::fmt; + +use bytes::Bytes; +use futures_lite::stream::{Stream, StreamExt}; +use reqwest::Method; + +use super::{header, Client, Error, HttpError, StatusCode, Url}; + +#[derive(Debug)] +pub struct RequestBuilder { + pub(super) client: Client, + pub(super) inner: reqwest::RequestBuilder, +} + +impl RequestBuilder { + pub fn bearer_auth(self, token: &dyn fmt::Display) -> RequestBuilder { + Self { + client: self.client, + inner: self.inner.bearer_auth(token), + } + } + + pub fn header(self, key: &str, value: &str) -> RequestBuilder { + Self { + client: self.client, + inner: self.inner.header(key, value), + } + } + + pub async fn send(self, error_for_status: bool) -> Result { + let request = self.inner.build()?; + let method = request.method().clone(); + Ok(Response { + inner: self.client.send_request(request, error_for_status).await?, + method, + }) + } +} + +#[derive(Debug)] +pub struct Response { + inner: reqwest::Response, + method: Method, +} + +impl Response { + pub async fn bytes(self) -> Result { + self.inner.bytes().await.map_err(Error::from) + } + + pub fn bytes_stream(self) -> impl Stream> { + let url = Box::new(self.inner.url().clone()); + let method = self.method; + + self.inner.bytes_stream().map(move |res| { + res.map_err(|err| { + Error::Http(Box::new(HttpError { + method: method.clone(), + url: Url::clone(&*url), + err, + })) + }) + }) + } + + pub fn status(&self) -> StatusCode { + self.inner.status() + } + + pub fn url(&self) -> &Url { + self.inner.url() + } + + pub fn method(&self) -> &Method { + &self.method + } + + pub fn error_for_status_ref(&self) -> Result<&Self, Error> { + match self.inner.error_for_status_ref() { + Ok(_) => Ok(self), + Err(err) => Err(Error::Http(Box::new(HttpError { + method: self.method().clone(), + url: self.url().clone(), + err, + }))), + } + } + + pub fn error_for_status(self) -> Result { + match self.error_for_status_ref() { + Ok(_) => Ok(self), + Err(err) => Err(err), + } + } + + pub fn headers(&self) -> &header::HeaderMap { + self.inner.headers() + } +} diff --git a/crates/binstalk-downloader/src/utils.rs b/crates/binstalk-downloader/src/utils.rs new file mode 100644 index 00000000..2b3c833b --- /dev/null +++ b/crates/binstalk-downloader/src/utils.rs @@ -0,0 +1,175 @@ +use std::{ + future::Future, + io::{self, BufRead, Read}, +}; + +use bytes::{Buf, Bytes}; +use futures_lite::{ + future::poll_once, + stream::{Stream, StreamExt}, +}; +use tokio::{sync::mpsc, task}; + +pub(super) fn extract_with_blocking_task( + stream: S, + f: F, +) -> impl Future> +where + T: Send + 'static, + E: From, + E: From, + S: Stream> + Send + Sync + Unpin + 'static, + F: FnOnce(mpsc::Receiver) -> io::Result + Send + Sync + 'static, +{ + async fn inner( + mut stream: S, + task: Fut, + tx: mpsc::Sender, + ) -> Result + where + E: From, + E: From, + // We do not use trait object for S since there will only be one + // S used with this function. + S: Stream> + Send + Sync + Unpin + 'static, + // asyncify would always return the same future, so no need to + // use trait object here. + Fut: Future> + Send + Sync, + { + let read_fut = async move { + while let Some(bytes) = stream.next().await.transpose()? { + if bytes.is_empty() { + continue; + } + + if tx.send(bytes).await.is_err() { + // The extract tar returns, which could be that: + // - Extraction fails with an error + // - Extraction success without the rest of the data + // + // + // It's hard to tell the difference here, so we assume + // the first scienario occurs. + // + // Even if the second scienario occurs, it won't affect the + // extraction process anyway, so we can jsut ignore it. + return Ok(()); + } + } + + Ok::<_, E>(()) + }; + tokio::pin!(read_fut); + + let task_fut = async move { task.await.map_err(E::from) }; + tokio::pin!(task_fut); + + tokio::select! { + biased; + + res = &mut read_fut => { + // The stream reaches eof, propagate error and wait for + // read task to be done. + res?; + + task_fut.await + }, + res = &mut task_fut => { + // The task finishes before the read task, return early + // after checking for errors in read_fut. + if let Some(Err(err)) = poll_once(read_fut).await { + Err(err) + } else { + res + } + } + } + } + + // Use channel size = 5 to minimize the waiting time in the extraction task + let (tx, rx) = mpsc::channel(5); + + let task = asyncify(move || f(rx)); + + inner(stream, task, tx) +} + +/// Copied from tokio https://docs.rs/tokio/latest/src/tokio/fs/mod.rs.html#132 +pub(super) fn asyncify(f: F) -> impl Future> + Send + Sync + 'static +where + F: FnOnce() -> io::Result + Send + 'static, + T: Send + 'static, +{ + async fn inner(handle: task::JoinHandle>) -> io::Result { + match handle.await { + Ok(res) => res, + Err(err) => Err(io::Error::new( + io::ErrorKind::Other, + format!("background task failed: {err}"), + )), + } + } + + inner(task::spawn_blocking(f)) +} + +/// This wraps an AsyncIterator as a `Read`able. +/// It must be used in non-async context only, +/// meaning you have to use it with +/// `tokio::task::{block_in_place, spawn_blocking}` or +/// `std::thread::spawn`. +pub(super) struct StreamReadable { + rx: mpsc::Receiver, + bytes: Bytes, +} + +impl StreamReadable { + pub(super) fn new(rx: mpsc::Receiver) -> Self { + Self { + rx, + bytes: Bytes::new(), + } + } +} + +impl Read for StreamReadable { + fn read(&mut self, buf: &mut [u8]) -> io::Result { + if buf.is_empty() { + return Ok(0); + } + + if self.fill_buf()?.is_empty() { + return Ok(0); + } + + let bytes = &mut self.bytes; + + // copy_to_slice requires the bytes to have enough remaining bytes + // to fill buf. + let n = buf.len().min(bytes.remaining()); + + // ::copy_to_slice copies and consumes the bytes + bytes.copy_to_slice(&mut buf[..n]); + + Ok(n) + } +} + +impl BufRead for StreamReadable { + fn fill_buf(&mut self) -> io::Result<&[u8]> { + let bytes = &mut self.bytes; + + if !bytes.has_remaining() { + if let Some(new_bytes) = self.rx.blocking_recv() { + // new_bytes are guaranteed to be non-empty. + *bytes = new_bytes; + } + } + + Ok(&*bytes) + } + + fn consume(&mut self, amt: usize) { + self.bytes.advance(amt); + } +} diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 26d1e966..d93daffa 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.64" -binstalk-downloader = { version = "0.3.3", path = "../binstalk-downloader", default-features = false } +binstalk-downloader = { version = "0.3.3", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.2.1", path = "../binstalk-types" } cargo_toml = "0.15.2" command-group = { version = "2.0.1", features = ["with-tokio"] } diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index 5bf297ce..06bca267 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -6,6 +6,7 @@ use std::{ use binstalk_downloader::{ download::{DownloadError, ZipError}, + gh_api_client::GhApiError, remote::{Error as RemoteError, HttpError, ReqwestError}, }; use cargo_toml::Error as CargoTomlError; @@ -309,6 +310,14 @@ pub enum BinstallError { #[diagnostic(severity(error), code(binstall::invalid_pkg_fmt))] InvalidPkgFmt(Box), + /// Request to GitHub Restful API failed + /// + /// - Code: `binstall::gh_restful_api_failure` + /// - Exit: 96 + #[error("Request to GitHub Restful API failed: {0}")] + #[diagnostic(severity(error), code(binstall::gh_restful_api_failure))] + GhApiErr(#[source] Box), + /// A wrapped error providing the context of which crate the error is about. #[error(transparent)] #[diagnostic(transparent)] @@ -343,6 +352,7 @@ impl BinstallError { EmptySourceFilePath => 92, NoFallbackToCargoInstall => 94, InvalidPkgFmt(..) => 95, + GhApiErr(..) => 96, CrateContext(context) => context.err.exit_number(), }; @@ -453,3 +463,9 @@ impl From for BinstallError { BinstallError::InvalidPkgFmt(Box::new(e)) } } + +impl From for BinstallError { + fn from(e: GhApiError) -> Self { + BinstallError::GhApiErr(Box::new(e)) + } +} diff --git a/crates/binstalk/src/fetchers.rs b/crates/binstalk/src/fetchers.rs index 57f5f662..c43c2cda 100644 --- a/crates/binstalk/src/fetchers.rs +++ b/crates/binstalk/src/fetchers.rs @@ -8,7 +8,7 @@ use url::Url; use crate::{ errors::BinstallError, - helpers::{remote::Client, tasks::AutoAbortJoinHandle}, + helpers::{gh_api_client::GhApiClient, remote::Client, tasks::AutoAbortJoinHandle}, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; @@ -19,7 +19,12 @@ pub(crate) mod quickinstall; pub trait Fetcher: Send + Sync { /// Create a new fetcher from some data #[allow(clippy::new_ret_no_self)] - fn new(client: Client, data: Arc, target_data: Arc) -> Arc + fn new( + client: Client, + gh_api_client: GhApiClient, + data: Arc, + target_data: Arc, + ) -> Arc where Self: Sized; diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 2940afc2..e6f4d59f 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -13,7 +13,10 @@ use url::Url; use crate::{ errors::{BinstallError, InvalidPkgFmtError}, helpers::{ - download::Download, futures_resolver::FuturesResolver, remote::Client, + download::Download, + futures_resolver::FuturesResolver, + gh_api_client::{GhApiClient, GhReleaseArtifact, HasReleaseArtifact}, + remote::Client, tasks::AutoAbortJoinHandle, }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, @@ -26,6 +29,7 @@ use hosting::RepositoryHost; pub struct GhCrateMeta { client: Client, + gh_api_client: GhApiClient, data: Arc, target_data: Arc, resolution: OnceCell<(Url, PkgFmt)>, @@ -62,10 +66,29 @@ impl GhCrateMeta { // go check all potential URLs at once urls.map(move |url| { let client = self.client.clone(); + let gh_api_client = self.gh_api_client.clone(); async move { debug!("Checking for package at: '{url}'"); + if let Some(artifact) = GhReleaseArtifact::try_extract_from_url(&url) { + debug!("Using GitHub Restful API to check for existence of artifact, which will also cache the API response"); + + match gh_api_client.has_release_artifact(artifact).await? { + HasReleaseArtifact::Yes => return Ok(Some((url, pkg_fmt))), + HasReleaseArtifact::No | HasReleaseArtifact::NoSuchRelease=> return Ok(None), + + HasReleaseArtifact::RateLimit { retry_after } => { + warn!("Your GitHub API token (if any) has reached its rate limit and cannot be used again until {retry_after:?}, so we will fallback to HEAD/GET on the url."); + warn!("If you did not supply the github token, consider supply one since GitHub by default limit the number of requests for unauthoized user to 60 requests per hour per origin IP address."); + } + HasReleaseArtifact::Unauthorized => { + warn!("GitHub API somehow requires a token for the API access, so we will fallback to HEAD/GET on the url."); + warn!("Please consider supplying a token to cargo-binstall to speedup resolution."); + } + } + } + Ok(client .remote_gettable(url.clone()) .await? @@ -79,11 +102,13 @@ impl GhCrateMeta { impl super::Fetcher for GhCrateMeta { fn new( client: Client, + gh_api_client: GhApiClient, data: Arc, target_data: Arc, ) -> Arc { Arc::new(Self { client, + gh_api_client, data, target_data, resolution: OnceCell::new(), diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs index 884409cb..12020446 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk/src/fetchers/quickinstall.rs @@ -6,7 +6,9 @@ use url::Url; use crate::{ errors::BinstallError, - helpers::{download::Download, remote::Client, tasks::AutoAbortJoinHandle}, + helpers::{ + download::Download, gh_api_client::GhApiClient, remote::Client, tasks::AutoAbortJoinHandle, + }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; @@ -25,6 +27,7 @@ pub struct QuickInstall { impl super::Fetcher for QuickInstall { fn new( client: Client, + _gh_api_client: GhApiClient, data: Arc, target_data: Arc, ) -> Arc { diff --git a/crates/binstalk/src/helpers.rs b/crates/binstalk/src/helpers.rs index 68d84553..f610706d 100644 --- a/crates/binstalk/src/helpers.rs +++ b/crates/binstalk/src/helpers.rs @@ -3,4 +3,4 @@ pub mod jobserver_client; pub mod signal; pub mod tasks; -pub use binstalk_downloader::{download, remote}; +pub use binstalk_downloader::{download, gh_api_client, remote}; diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index 3d965edb..b27cb3ca 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -7,14 +7,14 @@ use semver::VersionReq; use crate::{ fetchers::{Data, Fetcher, TargetData}, - helpers::{jobserver_client::LazyJobserverClient, remote::Client}, + helpers::{gh_api_client::GhApiClient, jobserver_client::LazyJobserverClient, remote::Client}, manifests::cargo_toml_binstall::PkgOverride, DesiredTargets, }; pub mod resolve; -pub type Resolver = fn(Client, Arc, Arc) -> Arc; +pub type Resolver = fn(Client, GhApiClient, Arc, Arc) -> Arc; pub struct Options { pub no_symlinks: bool, @@ -35,5 +35,6 @@ pub struct Options { pub install_path: PathBuf, pub client: Client, pub crates_io_api_client: CratesIoApiClient, + pub gh_api_client: GhApiClient, pub jobserver_client: LazyJobserverClient, } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 4beb5101..09977cd3 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -109,7 +109,12 @@ async fn resolve_inner( }) .cartesian_product(resolvers) .map(|(target_data, f)| { - let fetcher = f(opts.client.clone(), data.clone(), target_data); + let fetcher = f( + opts.client.clone(), + opts.gh_api_client.clone(), + data.clone(), + target_data, + ); (fetcher.clone(), fetcher.find()) }), ); From c8b92b19855438833396671b93221b312b0d9b30 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 2 Mar 2023 13:09:25 +1100 Subject: [PATCH 1076/2020] Speedup CI (#842) - Remove `tools: cross` input to `actions/just-setup` since we use `cargo-zigbuild` for cross compiling instead of `cross-rs` now. - Only install `cargo-zigbuild` in `just ci-install-deps` if `JUST_USE_CARGO_ZIGBUILD` is enabled - Include hash of `rustc -vV` in `build-cache` Switching between different versions of `rustc` will cause all crates to be rebuilt using new `rustc`. - Replace input `cache` with `index-cache` and `build-cache` in `actions/just-setup` for better control of caching behavior - Reuse workflow `test`'s `build-cache` in workflow `lint` Signed-off-by: Jiahao XU --- .github/actions/just-setup/action.yml | 23 ++++++++++++++++++----- .github/workflows/ci.yml | 14 +++++++++----- .github/workflows/release-build.yml | 4 ++-- justfile | 2 +- 4 files changed, 30 insertions(+), 13 deletions(-) diff --git a/.github/actions/just-setup/action.yml b/.github/actions/just-setup/action.yml index 3cecba1e..2d169960 100644 --- a/.github/actions/just-setup/action.yml +++ b/.github/actions/just-setup/action.yml @@ -4,8 +4,13 @@ inputs: description: Extra tools required: false default: "" - cache: - description: Enable caches + index-cache: + description: Enable index cache + required: true + default: true + type: boolean + build-cache: + description: Enable build cache required: true default: true type: boolean @@ -27,7 +32,7 @@ runs: with: tool: just,${{ inputs.tools }} - - if: inputs.cache + - if: inputs.index-cache name: Configure index cache uses: actions/cache@v3 with: @@ -40,10 +45,18 @@ runs: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}- ${{ runner.os }}-cargo-index- - - if: inputs.cache + - name: Install rust toolchains + run: just toolchain + shell: bash + + - name: rustc version + run: rustc -vV | tee /tmp/rustc-version + shell: bash + + - if: inputs.build-cache name: Configure build cache uses: actions/cache@v3 with: path: | target/ - key: ${{ runner.os }}-cargo-build-${{ hashFiles('**/Cargo.lock') }}-${{ inputs.cache-suffix }} + key: ${{ runner.os }}-cargo-build-${{ hashFiles('/tmp/rustc-version') }}-${{ hashFiles('**/Cargo.lock') }}-${{ inputs.cache-suffix }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3de12b55..e28d9767 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,6 @@ jobs: with: cache-suffix: ${{ env.CARGO_BUILD_TARGET }} - - run: just toolchain - run: just ci-install-deps - run: just test env: @@ -78,10 +77,8 @@ jobs: - uses: actions/checkout@v3 - uses: ./.github/actions/just-setup with: - tools: cross cache-suffix: ${{ env.CARGO_BUILD_TARGET }} - - run: just toolchain - run: just ci-install-deps - run: just check @@ -96,19 +93,26 @@ jobs: with: cache-suffix: ${{ env.CARGO_BUILD_TARGET }} - - run: just toolchain - run: just check lint: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + include: + - target: x86_64-apple-darwin + os: macos-latest + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + - target: x86_64-pc-windows-msvc + os: windows-latest runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - uses: ./.github/actions/just-setup + with: + cache-suffix: ${{ matrix.target }} - run: just toolchain rustfmt,clippy - run: just ci-install-deps diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index f81c2c78..e05f04f1 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -42,7 +42,6 @@ jobs: - uses: actions/checkout@v3 - uses: ./.github/actions/just-setup with: - tools: cross cache-suffix: release-${{ matrix.t }} - run: just toolchain rust-src @@ -87,7 +86,8 @@ jobs: - uses: actions/checkout@v3 - uses: ./.github/actions/just-setup with: - cache: false + index-cache: false + build-cache: false - uses: actions/download-artifact@v3 with: diff --git a/justfile b/justfile index 34ffa2d7..30e25fde 100644 --- a/justfile +++ b/justfile @@ -151,7 +151,7 @@ ci-apt-deps := if target == "x86_64-unknown-linux-gnu" { "liblzma-dev libzip-dev [linux] ci-install-deps: if [ -n "{{ci-apt-deps}}" ]; then sudo apt update && sudo apt install -y --no-install-recommends {{ci-apt-deps}}; fi - pip3 install cargo-zigbuild + if [ -n "{{use-cargo-zigbuild}}" ]; then pip3 install cargo-zigbuild; fi [macos] [windows] From fcbdfcf04fcc8b77b4219ae8f5f818800a1d0d33 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Mar 2023 03:02:43 +0000 Subject: [PATCH 1077/2020] Bump tokio from 1.25.0 to 1.26.0 (#843) --- Cargo.lock | 6 +++--- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1e493f82..c5752461 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2286,9 +2286,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.25.0" +version = "1.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e00990ebabbe4c14c08aca901caed183ecd5c09562a12c824bb53d3c3fd3af" +checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" dependencies = [ "autocfg", "bytes", @@ -2301,7 +2301,7 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 0c3ddce1..9171ed20 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -39,7 +39,7 @@ strum = "0.24.1" strum_macros = "0.24.3" supports-color = "2.0.0" tempfile = "3.4.0" -tokio = { version = "1.25.0", features = ["rt-multi-thread"], default-features = false } +tokio = { version = "1.26.0", features = ["rt-multi-thread"], default-features = false } tracing-core = "0.1.30" tracing = { version = "0.1.37", default-features = false } tracing-log = { version = "0.1.3", default-features = false } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index f7c298b2..26f869bf 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -32,7 +32,7 @@ serde_json = { version = "1.0.93", optional = true } tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.4.0" thiserror = "1.0.38" -tokio = { version = "1.25.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } +tokio = { version = "1.26.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.7", features = ["io"] } tower = { version = "0.4.13", features = ["limit", "util"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index d93daffa..a9c45b4c 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -33,7 +33,7 @@ tempfile = "3.4.0" thiserror = "1.0.38" tinytemplate = "1.2.1" # parking_lot for `tokio::sync::OnceCell::const_new` -tokio = { version = "1.25.0", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } +tokio = { version = "1.26.0", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } tracing = "0.1.37" url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 2aaf4dde..8632605e 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -10,9 +10,9 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -tokio = { version = "1.25.0", features = ["rt", "process", "sync"], default-features = false } +tokio = { version = "1.26.0", features = ["rt", "process", "sync"], default-features = false } cfg-if = "1.0.0" guess_host_triple = "0.1.3" [dev-dependencies] -tokio = { version = "1.25.0", features = ["macros"], default-features = false } +tokio = { version = "1.26.0", features = ["macros"], default-features = false } From 44eaff97dcac0852a548672720e40e04ccd78300 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 2 Mar 2023 15:40:39 +1100 Subject: [PATCH 1078/2020] Fix use of `hashFiles` in `key` of bulid-cache (#845) Signed-off-by: Jiahao XU --- .github/actions/just-setup/action.yml | 12 ++++++------ .github/workflows/release-build.yml | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/actions/just-setup/action.yml b/.github/actions/just-setup/action.yml index 2d169960..078f46df 100644 --- a/.github/actions/just-setup/action.yml +++ b/.github/actions/just-setup/action.yml @@ -4,12 +4,12 @@ inputs: description: Extra tools required: false default: "" - index-cache: + indexcache: description: Enable index cache required: true default: true type: boolean - build-cache: + buildcache: description: Enable build cache required: true default: true @@ -32,7 +32,7 @@ runs: with: tool: just,${{ inputs.tools }} - - if: inputs.index-cache + - if: inputs.indexcache name: Configure index cache uses: actions/cache@v3 with: @@ -50,13 +50,13 @@ runs: shell: bash - name: rustc version - run: rustc -vV | tee /tmp/rustc-version + run: rustc -vV | tee rustc-version shell: bash - - if: inputs.build-cache + - if: inputs.buildcache name: Configure build cache uses: actions/cache@v3 with: path: | target/ - key: ${{ runner.os }}-cargo-build-${{ hashFiles('/tmp/rustc-version') }}-${{ hashFiles('**/Cargo.lock') }}-${{ inputs.cache-suffix }} + key: ${{ runner.os }}-cargo-build-${{ hashFiles('rustc-version') }}-${{ hashFiles('**/Cargo.lock') }}-${{ inputs.cache-suffix }} diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index e05f04f1..8371f17a 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -86,8 +86,8 @@ jobs: - uses: actions/checkout@v3 - uses: ./.github/actions/just-setup with: - index-cache: false - build-cache: false + indexcache: false + buildcache: false - uses: actions/download-artifact@v3 with: From c00d648dac3e0b63f63415682b806838489770bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Mar 2023 05:19:38 +0000 Subject: [PATCH 1079/2020] Bump jobslot from 0.2.9 to 0.2.10 (#844) --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c5752461..b48d2e84 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1160,9 +1160,9 @@ dependencies = [ [[package]] name = "jobslot" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f63428cec7a79b3b4e1b4ba56d56a7da9e205a7957c99f7d27df5260ca361505" +checksum = "6650f8f817795211f076e9923ba9f35e66aad1946ac19c960ef5b114cd75c727" dependencies = [ "cfg-if", "getrandom", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index a9c45b4c..b13d332c 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -21,7 +21,7 @@ detect-targets = { version = "0.1.5", path = "../detect-targets" } either = "1.8.1" home = "0.5.4" itertools = "0.10.5" -jobslot = { version = "0.2.9", features = ["tokio"] } +jobslot = { version = "0.2.10", features = ["tokio"] } maybe-owned = "0.3.4" miette = "5.5.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } From 8eee318ccdde5f480a4530f589a979d3e3942c58 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 2 Mar 2023 18:25:34 +1100 Subject: [PATCH 1080/2020] Replace dep `crates_io_api` with in-house solution (#846) It also uses `max_stable_version` in the json downloaded from https://crates.io/api/v1/crates/$name if possible, which is equivalent to the version shown on https://crates.io/crates/$name . - Add new feat `json` to `binstalk-downloader` - Impl new async fn `Response::json` - use `Response::json` in `GhApiClient` impl - Mark all err types in binstalk-downloader as `non_exhaustive` - Ret `remote::Error` in `remote::Certificate::{from_pem, from_der}` instead of `ReqwestError`. - Refactor `BinstallError`: Merge variant `Unzip`, `Reqwest` & `Http` into one variant `Download`. - Manually download and parse json from httos://crates.io/api/v1 - Remove unused deps `crates_io_api` Signed-off-by: Jiahao XU --- Cargo.lock | 87 ------------------ crates/bin/Cargo.toml | 1 - crates/bin/src/entry.rs | 6 -- crates/binstalk-downloader/Cargo.toml | 3 +- crates/binstalk-downloader/src/download.rs | 1 + .../binstalk-downloader/src/gh_api_client.rs | 2 +- .../src/gh_api_client/request.rs | 11 +-- crates/binstalk-downloader/src/remote.rs | 8 ++ .../src/remote/certificate.rs | 14 ++- .../src/remote/request_builder.rs | 12 +++ crates/binstalk/Cargo.toml | 3 +- crates/binstalk/src/drivers.rs | 3 - crates/binstalk/src/drivers/crates_io.rs | 92 +++++++++++++++---- crates/binstalk/src/drivers/version.rs | 46 ---------- crates/binstalk/src/errors.rs | 58 ++---------- crates/binstalk/src/ops.rs | 2 - crates/binstalk/src/ops/resolve.rs | 15 +-- 17 files changed, 120 insertions(+), 244 deletions(-) delete mode 100644 crates/binstalk/src/drivers/version.rs diff --git a/Cargo.lock b/Cargo.lock index b48d2e84..c78e0866 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -158,7 +158,6 @@ dependencies = [ "cargo_toml", "command-group", "compact_str", - "crates_io_api", "detect-targets", "either", "home", @@ -343,7 +342,6 @@ dependencies = [ "binstalk-manifests", "clap", "compact_str", - "crates_io_api", "dirs", "embed-resource", "file-format", @@ -398,17 +396,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b0a3d9ed01224b22057780a37bb8c5dbfe1be8ba48678e7bf57ec4b385411f" -dependencies = [ - "num-integer", - "num-traits", - "serde", -] - [[package]] name = "clap" version = "4.1.8" @@ -497,24 +484,6 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" -[[package]] -name = "crates_io_api" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fdfaac64c5eb7a33a5b895ffbaf6f1146721b6cd4c889010d19c8a1c1cae562" -dependencies = [ - "chrono", - "futures", - "log", - "reqwest", - "serde", - "serde_derive", - "serde_json", - "serde_path_to_error", - "tokio", - "url", -] - [[package]] name = "crc32fast" version = "1.3.2" @@ -733,21 +702,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "futures" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13e2792b0ff0340399d58445b88fd9770e3489eff258a4cbc1523418f12abf84" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - [[package]] name = "futures-channel" version = "0.3.26" @@ -755,7 +709,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" dependencies = [ "futures-core", - "futures-sink", ] [[package]] @@ -764,17 +717,6 @@ version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" -[[package]] -name = "futures-executor" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8de0a35a6ab97ec8869e32a2473f4b1324459e14c29275d14b10cb1fd19b50e" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - [[package]] name = "futures-io" version = "0.3.26" @@ -820,7 +762,6 @@ version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" dependencies = [ - "futures-channel", "futures-core", "futures-io", "futures-macro", @@ -1408,25 +1349,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - [[package]] name = "num_cpus" version = "1.15.0" @@ -2021,15 +1943,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_path_to_error" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b04f22b563c91331a10074bda3dd5492e3cc39d56bd557e91c0af42b6c7341" -dependencies = [ - "serde", -] - [[package]] name = "serde_spanned" version = "0.6.1" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 9171ed20..2c717027 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -26,7 +26,6 @@ binstalk = { path = "../binstalk", version = "0.8.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.3.0" } clap = { version = "4.1.8", features = ["derive", "env"] } compact_str = "0.7.0" -crates_io_api = { version = "0.8.1", default-features = false } dirs = "4.0.0" file-format = { version = "0.14.0", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 6cd1338a..8673e75f 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -22,7 +22,6 @@ use binstalk::{ }, }; use binstalk_manifests::cargo_toml_binstall::PkgOverride; -use crates_io_api::AsyncClient as CratesIoApiClient; use file_format::FileFormat; use log::LevelFilter; use miette::{miette, Result, WrapErr}; @@ -90,10 +89,6 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - let gh_api_client = GhApiClient::new(client.clone(), args.github_token); - // Build crates.io api client - let crates_io_api_client = - CratesIoApiClient::with_http_client(client.get_inner().clone(), Duration::from_millis(100)); - // Create binstall_opts let binstall_opts = Arc::new(ops::Options { no_symlinks: args.no_symlinks, @@ -113,7 +108,6 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - temp_dir: temp_dir.path().to_owned(), install_path, client, - crates_io_api_client, gh_api_client, jobserver_client, }); diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 26f869bf..4f682f17 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -74,7 +74,8 @@ zstd-thin = ["zstd/thin"] cross-lang-fat-lto = ["zstd/fat-lto"] -gh-api-client = ["serde", "serde_json"] +gh-api-client = ["json"] +json = ["serde", "serde_json"] [package.metadata.docs.rs] all-features = true diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index 8a9c40be..9dfd94c2 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -23,6 +23,7 @@ mod zip_extraction; pub use zip_extraction::ZipError; #[derive(Debug, ThisError)] +#[non_exhaustive] pub enum DownloadError { #[error("Failed to extract zipfile: {0}")] Unzip(#[from] ZipError), diff --git a/crates/binstalk-downloader/src/gh_api_client.rs b/crates/binstalk-downloader/src/gh_api_client.rs index ab8ad91c..be66da7a 100644 --- a/crates/binstalk-downloader/src/gh_api_client.rs +++ b/crates/binstalk-downloader/src/gh_api_client.rs @@ -11,7 +11,7 @@ use tokio::sync::OnceCell; use crate::remote; mod request; -pub use request::{GhApiError, JsonError}; +pub use request::GhApiError; /// default retry duration if x-ratelimit-reset is not found in response header const DEFAULT_RETRY_DURATION: Duration = Duration::from_secs(3); diff --git a/crates/binstalk-downloader/src/gh_api_client/request.rs b/crates/binstalk-downloader/src/gh_api_client/request.rs index d759e434..98999449 100644 --- a/crates/binstalk-downloader/src/gh_api_client/request.rs +++ b/crates/binstalk-downloader/src/gh_api_client/request.rs @@ -8,22 +8,17 @@ use std::{ use compact_str::CompactString; use serde::Deserialize; -use serde_json::from_slice as json_from_slice; use thiserror::Error as ThisError; use url::Url; -pub use serde_json::Error as JsonError; - use super::{remote, GhRelease}; #[derive(ThisError, Debug)] +#[non_exhaustive] pub enum GhApiError { #[error("IO Error: {0}")] Io(#[from] io::Error), - #[error("Failed to parse json: {0}")] - Json(#[from] JsonError), - #[error("Remote Error: {0}")] Remote(#[from] remote::Error), @@ -129,7 +124,5 @@ pub(super) async fn fetch_release_artifacts( return Ok(FetchReleaseRet::ReleaseNotFound); } - let bytes = response.error_for_status()?.bytes().await?; - - Ok(FetchReleaseRet::Artifacts(json_from_slice(&bytes)?)) + Ok(FetchReleaseRet::Artifacts(response.json().await?)) } diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index f5cec8bc..8a1f24f1 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -28,6 +28,9 @@ pub use certificate::Certificate; mod request_builder; pub use request_builder::{RequestBuilder, Response}; +#[cfg(feature = "json")] +pub use request_builder::JsonError; + const MAX_RETRY_DURATION: Duration = Duration::from_secs(120); const MAX_RETRY_COUNT: u8 = 3; const DEFAULT_RETRY_DURATION_FOR_RATE_LIMIT: Duration = Duration::from_millis(200); @@ -35,12 +38,17 @@ const RETRY_DURATION_FOR_TIMEOUT: Duration = Duration::from_millis(200); const DEFAULT_MIN_TLS: tls::Version = tls::Version::TLS_1_2; #[derive(Debug, ThisError)] +#[non_exhaustive] pub enum Error { #[error("Reqwest error: {0}")] Reqwest(#[from] reqwest::Error), #[error(transparent)] Http(Box), + + #[cfg(feature = "json")] + #[error("Failed to parse http response body as Json: {0}")] + Json(#[from] JsonError), } #[derive(Debug, ThisError)] diff --git a/crates/binstalk-downloader/src/remote/certificate.rs b/crates/binstalk-downloader/src/remote/certificate.rs index 3c59eac5..b5dd8259 100644 --- a/crates/binstalk-downloader/src/remote/certificate.rs +++ b/crates/binstalk-downloader/src/remote/certificate.rs @@ -1,18 +1,22 @@ use reqwest::tls; -use super::ReqwestError; +use super::Error; #[derive(Clone, Debug)] pub struct Certificate(pub(super) tls::Certificate); impl Certificate { /// Create a Certificate from a binary DER encoded certificate - pub fn from_der(der: impl AsRef<[u8]>) -> Result { - tls::Certificate::from_der(der.as_ref()).map(Self) + pub fn from_der(der: impl AsRef<[u8]>) -> Result { + tls::Certificate::from_der(der.as_ref()) + .map(Self) + .map_err(Error::from) } /// Create a Certificate from a PEM encoded certificate - pub fn from_pem(pem: impl AsRef<[u8]>) -> Result { - tls::Certificate::from_pem(pem.as_ref()).map(Self) + pub fn from_pem(pem: impl AsRef<[u8]>) -> Result { + tls::Certificate::from_pem(pem.as_ref()) + .map(Self) + .map_err(Error::from) } } diff --git a/crates/binstalk-downloader/src/remote/request_builder.rs b/crates/binstalk-downloader/src/remote/request_builder.rs index b8e88428..fbb74a61 100644 --- a/crates/binstalk-downloader/src/remote/request_builder.rs +++ b/crates/binstalk-downloader/src/remote/request_builder.rs @@ -6,6 +6,9 @@ use reqwest::Method; use super::{header, Client, Error, HttpError, StatusCode, Url}; +#[cfg(feature = "json")] +pub use serde_json::Error as JsonError; + #[derive(Debug)] pub struct RequestBuilder { pub(super) client: Client, @@ -96,4 +99,13 @@ impl Response { pub fn headers(&self) -> &header::HeaderMap { self.inner.headers() } + + #[cfg(feature = "json")] + pub async fn json(self) -> Result + where + T: serde::de::DeserializeOwned, + { + let bytes = self.error_for_status()?.bytes().await?; + Ok(serde_json::from_slice(&bytes)?) + } } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index b13d332c..eecf7164 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -16,7 +16,6 @@ binstalk-types = { version = "0.2.1", path = "../binstalk-types" } cargo_toml = "0.15.2" command-group = { version = "2.0.1", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } -crates_io_api = { version = "0.8.1", default-features = false } detect-targets = { version = "0.1.5", path = "../detect-targets" } either = "1.8.1" home = "0.5.4" @@ -49,7 +48,7 @@ pkg-config = ["binstalk-downloader/pkg-config"] zlib-ng = ["binstalk-downloader/zlib-ng"] -rustls = ["crates_io_api/rustls", "binstalk-downloader/rustls"] +rustls = ["binstalk-downloader/rustls"] native-tls = ["binstalk-downloader/native-tls"] trust-dns = ["binstalk-downloader/trust-dns"] diff --git a/crates/binstalk/src/drivers.rs b/crates/binstalk/src/drivers.rs index 54304a92..16d43f03 100644 --- a/crates/binstalk/src/drivers.rs +++ b/crates/binstalk/src/drivers.rs @@ -1,5 +1,2 @@ -mod version; -use version::find_version; - mod crates_io; pub use crates_io::fetch_crate_cratesio; diff --git a/crates/binstalk/src/drivers/crates_io.rs b/crates/binstalk/src/drivers/crates_io.rs index fabb1d00..b758d7c3 100644 --- a/crates/binstalk/src/drivers/crates_io.rs +++ b/crates/binstalk/src/drivers/crates_io.rs @@ -1,8 +1,9 @@ use std::path::PathBuf; use cargo_toml::Manifest; -use crates_io_api::AsyncClient; +use compact_str::CompactString; use semver::VersionReq; +use serde::Deserialize; use tracing::debug; use crate::{ @@ -14,43 +15,98 @@ use crate::{ manifests::cargo_toml_binstall::{Meta, TarBasedFmt}, }; -use super::find_version; - mod vfs; mod visitor; use visitor::ManifestVisitor; -/// Fetch a crate Cargo.toml by name and version from crates.io +#[derive(Deserialize)] +struct CrateInfo { + #[serde(rename = "crate")] + inner: CrateInfoInner, +} + +#[derive(Deserialize)] +struct CrateInfoInner { + max_stable_version: CompactString, +} + +#[derive(Deserialize)] +struct Versions { + versions: Vec, +} + +#[derive(Deserialize)] +struct Version { + num: CompactString, + yanked: bool, +} + +/// Find the crate by name, get its latest stable version matches `version_req`, +/// retrieve its Cargo.toml and infer all its bins. pub async fn fetch_crate_cratesio( client: Client, - crates_io_api_client: &AsyncClient, name: &str, version_req: &VersionReq, ) -> Result, BinstallError> { // Fetch / update index debug!("Looking up crate information"); - // Fetch online crate information - let base_info = crates_io_api_client.get_crate(name).await.map_err(|err| { - Box::new(CratesIoApiError { - crate_name: name.into(), - err, - }) - })?; + let response = client + .get(Url::parse(&format!( + "https://crates.io/api/v1/crates/{name}" + ))?) + .send(true) + .await + .map_err(|err| { + BinstallError::CratesIoApi(Box::new(CratesIoApiError { + crate_name: name.into(), + err, + })) + })?; - // Locate matching version - let version_iter = base_info.versions.iter().filter(|v| !v.yanked); - let (version, version_name) = find_version(version_req, version_iter)?; + let version = if version_req == &VersionReq::STAR { + let crate_info: CrateInfo = response.json().await?; + crate_info.inner.max_stable_version + } else { + let response: Versions = response.json().await?; + response + .versions + .into_iter() + .filter_map(|item| { + if !item.yanked { + // Remove leading `v` for git tags + let num = if let Some(num) = item.num.strip_prefix('v') { + num.into() + } else { + item.num + }; - debug!("Found information for crate version: '{}'", version.num); + // Parse out version + let ver = semver::Version::parse(&num).ok()?; + + // Filter by version match + version_req.matches(&ver).then_some((num, ver)) + } else { + None + } + }) + // Return highest version + .max_by(|(_ver_str_x, ver_x), (_ver_str_y, ver_y)| ver_x.cmp(ver_y)) + .ok_or_else(|| BinstallError::VersionMismatch { + req: version_req.clone(), + })? + .0 + }; + + debug!("Found information for crate version: '{version}'"); // Download crate to temporary dir (crates.io or git?) - let crate_url = format!("https://crates.io/{}", version.dl_path); + let crate_url = format!("https://crates.io/api/v1/crates/{name}/{version}/download"); debug!("Fetching crate from: {crate_url} and extracting Cargo.toml from it"); - let manifest_dir_path: PathBuf = format!("{name}-{version_name}").into(); + let manifest_dir_path: PathBuf = format!("{name}-{version}").into(); let mut manifest_visitor = ManifestVisitor::new(manifest_dir_path); diff --git a/crates/binstalk/src/drivers/version.rs b/crates/binstalk/src/drivers/version.rs deleted file mode 100644 index f04d4b30..00000000 --- a/crates/binstalk/src/drivers/version.rs +++ /dev/null @@ -1,46 +0,0 @@ -use semver::VersionReq; - -use crate::errors::BinstallError; - -pub(super) trait Version { - /// Return `None` on error. - fn get_version(&self) -> Option; -} - -impl Version for &T { - fn get_version(&self) -> Option { - (*self).get_version() - } -} - -impl Version for crates_io_api::Version { - fn get_version(&self) -> Option { - // Remove leading `v` for git tags - let ver_str = match self.num.strip_prefix('v') { - Some(v) => v, - None => &self.num, - }; - - // Parse out version - semver::Version::parse(ver_str).ok() - } -} - -pub(super) fn find_version>( - version_req: &VersionReq, - version_iter: VersionIter, -) -> Result<(Item, semver::Version), BinstallError> { - version_iter - // Filter for matching versions - .filter_map(|item| { - let ver = item.get_version()?; - - // Filter by version match - version_req.matches(&ver).then_some((item, ver)) - }) - // Return highest version - .max_by(|(_item_x, ver_x), (_item_y, ver_y)| ver_x.cmp(ver_y)) - .ok_or_else(|| BinstallError::VersionMismatch { - req: version_req.clone(), - }) -} diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index 06bca267..edd222b4 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -5,9 +5,7 @@ use std::{ }; use binstalk_downloader::{ - download::{DownloadError, ZipError}, - gh_api_client::GhApiError, - remote::{Error as RemoteError, HttpError, ReqwestError}, + download::DownloadError, gh_api_client::GhApiError, remote::Error as RemoteError, }; use cargo_toml::Error as CargoTomlError; use compact_str::CompactString; @@ -22,7 +20,7 @@ use tracing::{error, warn}; pub struct CratesIoApiError { pub crate_name: CompactString, #[source] - pub err: crates_io_api::Error, + pub err: RemoteError, } #[derive(Debug, Error)] @@ -84,14 +82,6 @@ pub enum BinstallError { #[diagnostic(severity(error), code(binstall::url_parse))] UrlParse(#[from] url::ParseError), - /// An error while unzipping a file. - /// - /// - Code: `binstall::unzip` - /// - Exit: 66 - #[error("Failed to extract zipfile: {0}")] - #[diagnostic(severity(error), code(binstall::unzip))] - Unzip(#[from] ZipError), - /// A rendering error in a template. /// /// - Code: `binstall::template` @@ -100,26 +90,13 @@ pub enum BinstallError { #[diagnostic(severity(error), code(binstall::template))] Template(Box), - /// A generic error from our HTTP client, reqwest. + /// Failed to download or failed to decode the body. /// - /// Errors resulting from HTTP fetches are handled with [`BinstallError::Http`] instead. - /// - /// - Code: `binstall::reqwest` + /// - Code: `binstall::download` /// - Exit: 68 - #[error("Reqwest error: {0}")] - #[diagnostic(severity(error), code(binstall::reqwest))] - Reqwest(#[from] ReqwestError), - - /// An HTTP request failed. - /// - /// This includes both connection/transport failures and when the HTTP status of the response - /// is not as expected. - /// - /// - Code: `binstall::http` - /// - Exit: 69 #[error(transparent)] - #[diagnostic(severity(error), code(binstall::http))] - Http(#[from] Box), + #[diagnostic(severity(error), code(binstall::download))] + Download(#[from] DownloadError), /// A subprocess failed. /// @@ -331,10 +308,8 @@ impl BinstallError { TaskJoinError(_) => 17, UserAbort => 32, UrlParse(_) => 65, - Unzip(_) => 66, Template(_) => 67, - Reqwest(_) => 68, - Http { .. } => 69, + Download(_) => 68, SubProcess { .. } => 70, Io(_) => 74, CratesIoApi { .. } => 76, @@ -425,24 +400,7 @@ impl From for io::Error { impl From for BinstallError { fn from(e: RemoteError) -> Self { - use RemoteError::*; - - match e { - Reqwest(reqwest_error) => reqwest_error.into(), - Http(http_error) => http_error.into(), - } - } -} - -impl From for BinstallError { - fn from(e: DownloadError) -> Self { - use DownloadError::*; - - match e { - Unzip(zip_error) => zip_error.into(), - Remote(remote_error) => remote_error.into(), - Io(io_error) => io_error.into(), - } + DownloadError::from(e).into() } } diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index b27cb3ca..47655068 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -2,7 +2,6 @@ use std::{path::PathBuf, sync::Arc}; -use crates_io_api::AsyncClient as CratesIoApiClient; use semver::VersionReq; use crate::{ @@ -34,7 +33,6 @@ pub struct Options { pub temp_dir: PathBuf, pub install_path: PathBuf, pub client: Client, - pub crates_io_api_client: CratesIoApiClient, pub gh_api_client: GhApiClient, pub jobserver_client: LazyJobserverClient, } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 09977cd3..7cdc974c 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -8,7 +8,6 @@ use std::{ use cargo_toml::Manifest; use compact_str::{CompactString, ToCompactString}; -use crates_io_api::AsyncClient as CratesIoApiClient; use itertools::Itertools; use maybe_owned::MaybeOwned; use semver::{Version, VersionReq}; @@ -72,8 +71,7 @@ async fn resolve_inner( crate_name.name, curr_version, &version_req, - opts.client.clone(), - &opts.crates_io_api_client).await? + opts.client.clone()).await? else { return Ok(Resolution::AlreadyUpToDate) }; @@ -350,20 +348,11 @@ impl PackageInfo { curr_version: Option, version_req: &VersionReq, client: Client, - crates_io_api_client: &CratesIoApiClient, ) -> Result, BinstallError> { // Fetch crate via crates.io, git, or use a local manifest path let manifest = match opts.manifest_path.as_ref() { Some(manifest_path) => load_manifest_path(manifest_path)?, - None => { - Box::pin(fetch_crate_cratesio( - client, - crates_io_api_client, - &name, - version_req, - )) - .await? - } + None => Box::pin(fetch_crate_cratesio(client, &name, version_req)).await?, }; let Some(mut package) = manifest.package else { From 75289cc2b486af2da23efd507c9daf916bde2aa5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 3 Mar 2023 13:29:58 +1100 Subject: [PATCH 1081/2020] Only use `GET` in `remote::Client::remote_gettable` (#847) Fixed #835 Using `HEAD` for this would often cause false negative that requires the `Client` to fallback to `GET`, which creates a lot of requests even if the url doesn't exist and then get cargo-binstall rate limited by GitHub/GitLab/etc. Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/remote.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 8a1f24f1..09564d9a 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -279,11 +279,9 @@ impl Client { } } - /// Check if remote exists using `Method::HEAD` or `Method::GET` as fallback. + /// Check if remote exists using `Method::GET`. pub async fn remote_gettable(&self, url: Url) -> Result { - self.head_or_fallback_to_get(url, false) - .await - .map(|response| response.status().is_success()) + Ok(self.get(url).send(false).await?.status().is_success()) } /// Attempt to get final redirected url using `Method::HEAD` or fallback From 44ac63ce0df089c28aac970446b7636da247dea0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 3 Mar 2023 15:32:50 +1100 Subject: [PATCH 1082/2020] Extract GitHub token from file if `--github-token` or env variable `GITHUB_TOKEN` is not present (#849) - Add option `--no-discover-github-token` for disabling this behavior - Add new dep gh-token v0.1.0 to crates/bin - Extract github-token from git-credentials or gh config if `--github-token` or environment variable `GITHUB_TOKEN` is not present. Signed-off-by: Jiahao XU --- Cargo.lock | 32 ++++++++++++++++++ crates/bin/Cargo.toml | 1 + crates/bin/src/args.rs | 74 +++++++++++++++++++++++++++++++++++++++++- 3 files changed, 106 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index c78e0866..6514754f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -346,6 +346,7 @@ dependencies = [ "embed-resource", "file-format", "fs-lock", + "gh-token", "log", "miette", "mimalloc", @@ -803,6 +804,18 @@ dependencies = [ "wasi", ] +[[package]] +name = "gh-token" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc623f67e9004eac91ad251d7d4c0b1fa7ac53646c09d9c8ef6e27a21b2d02fd" +dependencies = [ + "home", + "serde", + "serde_derive", + "serde_yaml", +] + [[package]] name = "gimli" version = "0.27.2" @@ -1964,6 +1977,19 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_yaml" +version = "0.9.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fb06d4b6cdaef0e0c51fa881acb721bed3c924cfaa71d9c94a3b771dfdf6567" +dependencies = [ + "indexmap", + "itoa", + "ryu", + "serde", + "unsafe-libyaml", +] + [[package]] name = "sharded-slab" version = "0.1.4" @@ -2541,6 +2567,12 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +[[package]] +name = "unsafe-libyaml" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7ed8ba44ca06be78ea1ad2c3682a43349126c8818054231ee6f4748012aed2" + [[package]] name = "untrusted" version = "0.7.1" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 2c717027..805de46e 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -29,6 +29,7 @@ compact_str = "0.7.0" dirs = "4.0.0" file-format = { version = "0.14.0", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } +gh-token = "0.1.0" log = { version = "0.4.17", features = ["std"] } miette = "5.5.0" mimalloc = { version = "0.1.34", default-features = false, optional = true } diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 0668c093..f2401288 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -1,7 +1,7 @@ use std::{ env, ffi::OsString, - fmt, + fmt, fs, iter, num::{NonZeroU64, ParseIntError}, path::PathBuf, str::FromStr, @@ -14,6 +14,7 @@ use binstalk::{ }; use clap::{error::ErrorKind, CommandFactory, Parser, ValueEnum}; use compact_str::CompactString; +use dirs::home_dir; use log::LevelFilter; use semver::VersionReq; use strum::EnumCount; @@ -145,6 +146,14 @@ pub struct Args { #[clap(help_heading = "Overrides", long, value_delimiter(','))] pub disable_strategies: Vec, + /// If `--github-token` or environment variable `GITHUB_TOKEN` is not + /// specified, then cargo-binstall will try to extract github token from + /// `$HOME/.git-credentials` or `$HOME/.config/gh/hosts.yml` by default. + /// + /// This option can be used to disable that behavior. + #[clap(help_heading = "Overrides", long)] + pub no_discover_github_token: bool, + /// Disable symlinking / versioned updates. /// /// By default, Binstall will install a binary named `-` in the install path, and @@ -452,9 +461,52 @@ You cannot use --{option} and specify multiple packages at the same time. Do one .exit() } + if opts.github_token.is_none() && !opts.no_discover_github_token { + if let Some(github_token) = try_extract_from_git_credentials() { + opts.github_token = Some(github_token); + } else if let Ok(github_token) = gh_token::get() { + opts.github_token = Some(github_token.into()); + } + } + opts } +fn try_extract_from_git_credentials() -> Option { + home_dir() + .map(|mut home| { + home.push(".git-credentials"); + home + }) + .into_iter() + .chain(iter::from_fn(|| { + let home = env::var_os("XDG_CONFIG_HOME")?; + (!home.is_empty()).then(|| { + let mut path = PathBuf::from(home); + path.push("git/credentials"); + path + }) + })) + .find_map(try_extract_from_git_credentials_from) +} + +fn try_extract_from_git_credentials_from(path: PathBuf) -> Option { + fs::read_to_string(path) + .ok()? + .lines() + .find_map(extract_github_token_from_git_credentials_line) + .map(CompactString::from) +} + +fn extract_github_token_from_git_credentials_line(line: &str) -> Option<&str> { + let cred = line + .trim() + .strip_prefix("https://")? + .strip_suffix("@github.com")?; + + Some(cred.split_once(':')?.1) +} + #[cfg(test)] mod test { use super::*; @@ -463,4 +515,24 @@ mod test { fn verify_cli() { Args::command().debug_assert() } + + const GIT_CREDENTIALS_TEST_CASES: &[(&str, Option<&str>)] = &[ + // Success + ("https://NobodyXu:gho_asdc@github.com", Some("gho_asdc")), + ( + "https://NobodyXu:gho_asdc12dz@github.com", + Some("gho_asdc12dz"), + ), + // Failure + ("http://NobodyXu:gho_asdc@github.com", None), + ("https://NobodyXu:gho_asdc@gitlab.com", None), + ("https://NobodyXugho_asdc@github.com", None), + ]; + + #[test] + fn test_extract_github_token_from_git_credentials_line() { + GIT_CREDENTIALS_TEST_CASES.iter().for_each(|(line, res)| { + assert_eq!(extract_github_token_from_git_credentials_line(line), *res); + }) + } } From 9c7da6a179d78cbdbf00f96a9dbefbde4828e778 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 3 Mar 2023 23:31:27 +1100 Subject: [PATCH 1083/2020] Return a list of files written to disk in `binstalk_downloader::download::Download::and_extract` (#856) to avoid collecting extracted files from disk again in resolution stage. Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/download.rs | 119 ++++++++++++++++-- .../src/download/async_extracter.rs | 86 ++++++++++--- .../src/download/extracted_files.rs | 102 +++++++++++++++ .../src/download/zip_extraction.rs | 9 +- crates/binstalk/src/bins.rs | 35 ++++-- crates/binstalk/src/fetchers.rs | 7 +- crates/binstalk/src/fetchers/gh_crate_meta.rs | 4 +- crates/binstalk/src/fetchers/quickinstall.rs | 7 +- crates/binstalk/src/ops/resolve.rs | 76 +++++------ justfile | 5 +- 10 files changed, 366 insertions(+), 84 deletions(-) create mode 100644 crates/binstalk-downloader/src/download/extracted_files.rs diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index 9dfd94c2..a0412e07 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -19,6 +19,9 @@ pub use async_tar_visitor::{TarEntriesVisitor, TarEntry, TarEntryType}; mod extracter; +mod extracted_files; +pub use extracted_files::{ExtractedFiles, ExtractedFilesEntry}; + mod zip_extraction; pub use zip_extraction::ZipError; @@ -90,9 +93,6 @@ impl Download { /// This does not support verifying a checksum due to the partial extraction /// and will ignore one if specified. /// - /// `cancellation_future` can be used to cancel the extraction and return - /// [`DownloadError::UserAbort`] error. - /// /// NOTE that this API does not support gnu extension sparse file unlike /// [`Download::and_extract`]. #[instrument(skip(visitor))] @@ -118,15 +118,18 @@ impl Download { /// Download a file from the provided URL and extract it to the provided path. /// - /// `cancellation_future` can be used to cancel the extraction and return - /// [`DownloadError::UserAbort`] error. + /// NOTE that this would only extract directory and regular files. #[instrument(skip(path))] pub async fn and_extract( self, fmt: PkgFmt, path: impl AsRef, - ) -> Result<(), DownloadError> { - async fn inner(this: Download, fmt: PkgFmt, path: &Path) -> Result<(), DownloadError> { + ) -> Result { + async fn inner( + this: Download, + fmt: PkgFmt, + path: &Path, + ) -> Result { let stream = this .client .get_stream(this.url) @@ -135,15 +138,15 @@ impl Download { debug!("Downloading and extracting to: '{}'", path.display()); - match fmt.decompose() { + let extracted_files = match fmt.decompose() { PkgFmtDecomposed::Tar(fmt) => extract_tar_based_stream(stream, path, fmt).await?, PkgFmtDecomposed::Bin => extract_bin(stream, path).await?, PkgFmtDecomposed::Zip => extract_zip(stream, path).await?, - } + }; debug!("Download OK, extracted to: '{}'", path.display()); - Ok(()) + Ok(extracted_files) } inner(self, fmt, path.as_ref()).await @@ -179,3 +182,99 @@ impl Update for NoDigest { } impl HashMarker for NoDigest {} + +#[cfg(test)] +mod test { + use super::*; + + use std::{ + collections::{HashMap, HashSet}, + ffi::OsStr, + }; + use tempfile::tempdir; + + #[tokio::test] + async fn test_and_extract() { + let client = crate::remote::Client::new( + concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), + None, + std::time::Duration::from_millis(10), + 1.try_into().unwrap(), + [], + ) + .unwrap(); + + let cargo_binstall_url = "https://github.com/cargo-bins/cargo-binstall/releases/download/v0.20.1/cargo-binstall-aarch64-unknown-linux-musl.tgz"; + + let extracted_files = + Download::new(client.clone(), Url::parse(cargo_binstall_url).unwrap()) + .and_extract(PkgFmt::Tgz, tempdir().unwrap()) + .await + .unwrap(); + + assert!(extracted_files.has_file(Path::new("cargo-binstall"))); + assert!(!extracted_files.has_file(Path::new("1234"))); + + let files = HashSet::from([OsStr::new("cargo-binstall").into()]); + assert_eq!(extracted_files.get_dir(Path::new(".")).unwrap(), &files); + + assert_eq!( + extracted_files.0, + HashMap::from([ + ( + Path::new("cargo-binstall").into(), + ExtractedFilesEntry::File + ), + ( + Path::new(".").into(), + ExtractedFilesEntry::Dir(Box::new(files)) + ) + ]) + ); + + let cargo_watch_url = "https://github.com/watchexec/cargo-watch/releases/download/v8.4.0/cargo-watch-v8.4.0-aarch64-unknown-linux-gnu.tar.xz"; + + let extracted_files = Download::new(client, Url::parse(cargo_watch_url).unwrap()) + .and_extract(PkgFmt::Txz, tempdir().unwrap()) + .await + .unwrap(); + + let dir = Path::new("cargo-watch-v8.4.0-aarch64-unknown-linux-gnu"); + + assert_eq!( + extracted_files.get_dir(Path::new(".")).unwrap(), + &HashSet::from([dir.as_os_str().into()]) + ); + + assert_eq!( + extracted_files.get_dir(dir).unwrap(), + &HashSet::from_iter( + [ + "README.md", + "LICENSE", + "completions", + "cargo-watch", + "cargo-watch.1" + ] + .iter() + .map(OsStr::new) + .map(Box::::from) + ), + ); + + assert_eq!( + extracted_files.get_dir(&dir.join("completions")).unwrap(), + &HashSet::from([OsStr::new("zsh").into()]), + ); + + assert!(extracted_files.has_file(&dir.join("cargo-watch"))); + assert!(extracted_files.has_file(&dir.join("cargo-watch.1"))); + assert!(extracted_files.has_file(&dir.join("LICENSE"))); + assert!(extracted_files.has_file(&dir.join("README.md"))); + + assert!(!extracted_files.has_file(&dir.join("completions"))); + assert!(!extracted_files.has_file(&dir.join("asdfcqwe"))); + + assert!(extracted_files.has_file(&dir.join("completions/zsh"))); + } +} diff --git a/crates/binstalk-downloader/src/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs index 970d2a90..6c6b6905 100644 --- a/crates/binstalk-downloader/src/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -1,4 +1,5 @@ use std::{ + borrow::Cow, fs, future::Future, io::{self, Write}, @@ -13,11 +14,12 @@ use tokio_util::io::StreamReader; use tracing::debug; use super::{ - extracter::*, zip_extraction::extract_zip_entry, DownloadError, TarBasedFmt, ZipError, + extracter::*, zip_extraction::extract_zip_entry, DownloadError, ExtractedFiles, TarBasedFmt, + ZipError, }; use crate::utils::{extract_with_blocking_task, StreamReadable}; -pub async fn extract_bin(stream: S, path: &Path) -> Result<(), DownloadError> +pub async fn extract_bin(stream: S, path: &Path) -> Result where S: Stream> + Send + Sync + Unpin + 'static, { @@ -32,10 +34,16 @@ where file.flush() }) - .await + .await?; + + let mut extracted_files = ExtractedFiles::new(); + + extracted_files.add_file(Path::new(path.file_name().unwrap())); + + Ok(extracted_files) } -pub async fn extract_zip(stream: S, path: &Path) -> Result<(), DownloadError> +pub async fn extract_zip(stream: S, path: &Path) -> Result where S: Stream> + Unpin + Send + Sync + 'static, { @@ -44,9 +52,10 @@ where let reader = StreamReader::new(stream); let mut zip = ZipFileReader::new(reader); let mut buf = BytesMut::with_capacity(4 * 4096); + let mut extracted_files = ExtractedFiles::new(); while let Some(mut zip_reader) = zip.next_entry().await.map_err(ZipError::from_inner)? { - extract_zip_entry(&mut zip_reader, path, &mut buf).await?; + extract_zip_entry(&mut zip_reader, path, &mut buf, &mut extracted_files).await?; // extract_zip_entry would read the zip_reader until read the file until // eof unless extract_zip itself is cancelled or an error is raised. @@ -55,33 +64,82 @@ where zip = zip_reader.done().await.map_err(ZipError::from_inner)?; } - Ok(()) + Ok(extracted_files) } pub async fn extract_tar_based_stream( stream: S, - path: &Path, + dst: &Path, fmt: TarBasedFmt, -) -> Result<(), DownloadError> +) -> Result where S: Stream> + Send + Sync + Unpin + 'static, { - debug!("Extracting from {fmt} archive to {path:#?}"); + debug!("Extracting from {fmt} archive to {}", dst.display()); - extract_with_blocking_decoder(stream, path, move |rx, path| { - create_tar_decoder(StreamReadable::new(rx), fmt)?.unpack(path) + extract_with_blocking_decoder(stream, dst, move |rx, dst| { + // Adapted from https://docs.rs/tar/latest/src/tar/archive.rs.html#189-219 + + if dst.symlink_metadata().is_err() { + fs::create_dir_all(dst)?; + } + + // Canonicalizing the dst directory will prepend the path with '\\?\' + // on windows which will allow windows APIs to treat the path as an + // extended-length path with a 32,767 character limit. Otherwise all + // unpacked paths over 260 characters will fail on creation with a + // NotFound exception. + let dst = &dst + .canonicalize() + .map(Cow::Owned) + .unwrap_or(Cow::Borrowed(dst)); + + let mut tar = create_tar_decoder(StreamReadable::new(rx), fmt)?; + let mut entries = tar.entries()?; + + let mut extracted_files = ExtractedFiles::new(); + + // Delay any directory entries until the end (they will be created if needed by + // descendants), to ensure that directory permissions do not interfer with descendant + // extraction. + let mut directories = Vec::new(); + + while let Some(mut entry) = entries.next().transpose()? { + match entry.header().entry_type() { + tar::EntryType::Regular => { + // unpack_in returns false if the path contains ".." + // and is skipped. + if entry.unpack_in(dst)? { + extracted_files.add_file(&entry.path()?); + } + } + tar::EntryType::Directory => { + directories.push(entry); + } + _ => (), + } + } + + for mut dir in directories { + if dir.unpack_in(dst)? { + extracted_files.add_dir(&dir.path()?); + } + } + + Ok(extracted_files) }) .await } -fn extract_with_blocking_decoder( +fn extract_with_blocking_decoder( stream: S, path: &Path, f: F, -) -> impl Future> +) -> impl Future> where S: Stream> + Send + Sync + Unpin + 'static, - F: FnOnce(mpsc::Receiver, &Path) -> io::Result<()> + Send + Sync + 'static, + F: FnOnce(mpsc::Receiver, &Path) -> io::Result + Send + Sync + 'static, + T: Send + 'static, { let path = path.to_owned(); diff --git a/crates/binstalk-downloader/src/download/extracted_files.rs b/crates/binstalk-downloader/src/download/extracted_files.rs new file mode 100644 index 00000000..2cc4c90a --- /dev/null +++ b/crates/binstalk-downloader/src/download/extracted_files.rs @@ -0,0 +1,102 @@ +use std::{ + collections::{hash_map::Entry as HashMapEntry, HashMap, HashSet}, + ffi::OsStr, + path::Path, +}; + +#[derive(Debug)] +#[cfg_attr(test, derive(Eq, PartialEq))] +pub enum ExtractedFilesEntry { + Dir(Box>>), + File, +} + +impl ExtractedFilesEntry { + fn new_dir(file_name: Option<&OsStr>) -> Self { + ExtractedFilesEntry::Dir(Box::new( + file_name + .map(|file_name| HashSet::from([file_name.into()])) + .unwrap_or_else(HashSet::default), + )) + } +} + +#[derive(Debug)] +pub struct ExtractedFiles(pub(super) HashMap, ExtractedFilesEntry>); + +impl ExtractedFiles { + pub(super) fn new() -> Self { + Self(Default::default()) + } + + /// * `path` - must be canonical and must not be empty + /// + /// NOTE that if the entry for the `path` is previously set to a dir, + /// it would be replaced with a file. + pub(super) fn add_file(&mut self, path: &Path) { + self.0.insert(path.into(), ExtractedFilesEntry::File); + self.add_dir_if_has_parent(path); + } + + fn add_dir_if_has_parent(&mut self, path: &Path) { + if let Some(parent) = path.parent() { + if !parent.as_os_str().is_empty() { + self.add_dir_inner(parent, path.file_name()); + self.add_dir_if_has_parent(parent); + } else { + self.add_dir_inner(Path::new("."), path.file_name()) + } + } + } + + /// * `path` - must be canonical and must not be empty + /// + /// NOTE that if the entry for the `path` is previously set to a dir, + /// it would be replaced with an empty Dir entry. + pub(super) fn add_dir(&mut self, path: &Path) { + self.add_dir_inner(path, None); + self.add_dir_if_has_parent(path); + } + + /// * `path` - must be canonical and must not be empty + /// + /// NOTE that if the entry for the `path` is previously set to a dir, + /// it would be replaced with a Dir entry containing `file_name` if it + /// is `Some(..)`, or an empty Dir entry. + fn add_dir_inner(&mut self, path: &Path, file_name: Option<&OsStr>) { + match self.0.entry(path.into()) { + HashMapEntry::Vacant(entry) => { + entry.insert(ExtractedFilesEntry::new_dir(file_name)); + } + HashMapEntry::Occupied(entry) => match entry.into_mut() { + ExtractedFilesEntry::Dir(hash_set) => { + if let Some(file_name) = file_name { + hash_set.insert(file_name.into()); + } + } + entry => *entry = ExtractedFilesEntry::new_dir(file_name), + }, + } + } + + /// * `path` - must be canonical and must not be empty, but could be "." + /// for top-level. + pub fn get_entry(&self, path: &Path) -> Option<&ExtractedFilesEntry> { + self.0.get(path) + } + + /// * `path` - must be canonical and must not be empty, but could be "." + /// for top-level. + pub fn get_dir(&self, path: &Path) -> Option<&HashSet>> { + match self.get_entry(path)? { + ExtractedFilesEntry::Dir(file_names) => Some(file_names), + ExtractedFilesEntry::File => None, + } + } + + /// * `path` - must be canonical and must not be empty, but could be "." + /// for top-level. + pub fn has_file(&self, path: &Path) -> bool { + matches!(self.get_entry(path), Some(ExtractedFilesEntry::File)) + } +} diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index 8ddddc68..cf48465c 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -12,7 +12,7 @@ use tokio::{ sync::mpsc, }; -use super::DownloadError; +use super::{DownloadError, ExtractedFiles}; use crate::utils::asyncify; #[derive(Debug, ThisError)] @@ -38,6 +38,7 @@ pub(super) async fn extract_zip_entry( zip_reader: &mut ZipFileReader>>, path: &Path, buf: &mut BytesMut, + extracted_files: &mut ExtractedFiles, ) -> Result<(), DownloadError> where R: AsyncRead + Unpin + Send + Sync, @@ -48,7 +49,7 @@ where .ok_or_else(|| ZipError(ZipErrorInner::InvalidFilePath(raw_filename.into())))?; // Calculates the outpath - let outpath = path.join(filename); + let outpath = path.join(&filename); // Get permissions let mut perms = None; @@ -64,6 +65,8 @@ where } if raw_filename.ends_with('/') { + extracted_files.add_dir(&filename); + // This entry is a dir. asyncify(move || { std::fs::create_dir_all(&outpath)?; @@ -75,6 +78,8 @@ where }) .await?; } else { + extracted_files.add_file(&filename); + // Use channel size = 5 to minimize the waiting time in the extraction task let (tx, mut rx) = mpsc::channel::(5); diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index ab7fabab..6ab63626 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -13,6 +13,7 @@ use tracing::debug; use crate::{ errors::BinstallError, fs::{atomic_install, atomic_symlink_file}, + helpers::download::ExtractedFiles, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; @@ -30,7 +31,7 @@ fn is_valid_path(path: &Path) -> bool { /// Must be called after the archive is downloaded and extracted. /// This function might uses blocking I/O. -pub fn infer_bin_dir_template(data: &Data) -> Cow<'static, str> { +pub fn infer_bin_dir_template(data: &Data, extracted_files: &ExtractedFiles) -> Cow<'static, str> { let name = data.name; let target = data.target; let version = data.version; @@ -55,7 +56,11 @@ pub fn infer_bin_dir_template(data: &Data) -> Cow<'static, str> { gen_possible_dirs .into_iter() .map(|gen_possible_dir| gen_possible_dir(name, target, version)) - .find(|dirname| data.bin_path.join(dirname).is_dir()) + .find(|dirname| { + extracted_files + .get_dir(&data.bin_path.join(dirname)) + .is_some() + }) .map(|mut dir| { dir.reserve_exact(1 + default_bin_dir_template.len()); dir += "/"; @@ -69,6 +74,7 @@ pub fn infer_bin_dir_template(data: &Data) -> Cow<'static, str> { pub struct BinFile { pub base_name: CompactString, pub source: PathBuf, + pub archive_source_path: PathBuf, pub dest: PathBuf, pub link: Option, } @@ -97,8 +103,11 @@ impl BinFile { binary_ext, }; - let source = if data.meta.pkg_fmt == Some(PkgFmt::Bin) { - data.bin_path.to_path_buf() + let (source, archive_source_path) = if data.meta.pkg_fmt == Some(PkgFmt::Bin) { + ( + data.bin_path.to_path_buf(), + data.bin_path.file_name().unwrap().into(), + ) } else { // Generate install paths // Source path is the download dir + the generated binary path @@ -116,7 +125,7 @@ impl BinFile { }); } - data.bin_path.join(&path_normalized) + (data.bin_path.join(&path_normalized), path_normalized) }; // Destination at install dir + base-name{.extension} @@ -143,6 +152,7 @@ impl BinFile { Ok(Self { base_name: format_compact!("{base_name}{binary_ext}"), source, + archive_source_path, dest, link, }) @@ -165,16 +175,21 @@ impl BinFile { } /// Return `Ok` if the source exists, otherwise `Err`. - pub fn check_source_exists(&self) -> Result<(), BinstallError> { - if !self.source.try_exists()? { - Err(BinstallError::BinFileNotFound(self.source.clone())) - } else { + pub fn check_source_exists( + &self, + extracted_files: &ExtractedFiles, + ) -> Result<(), BinstallError> { + if extracted_files.has_file(&self.archive_source_path) { Ok(()) + } else { + Err(BinstallError::BinFileNotFound(self.source.clone())) } } pub fn install_bin(&self) -> Result<(), BinstallError> { - self.check_source_exists()?; + if !self.source.try_exists()? { + return Err(BinstallError::BinFileNotFound(self.source.clone())); + } debug!( "Atomically install file from '{}' to '{}'", diff --git a/crates/binstalk/src/fetchers.rs b/crates/binstalk/src/fetchers.rs index c43c2cda..00d782ad 100644 --- a/crates/binstalk/src/fetchers.rs +++ b/crates/binstalk/src/fetchers.rs @@ -8,7 +8,10 @@ use url::Url; use crate::{ errors::BinstallError, - helpers::{gh_api_client::GhApiClient, remote::Client, tasks::AutoAbortJoinHandle}, + helpers::{ + download::ExtractedFiles, gh_api_client::GhApiClient, remote::Client, + tasks::AutoAbortJoinHandle, + }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; @@ -29,7 +32,7 @@ pub trait Fetcher: Send + Sync { Self: Sized; /// Fetch a package and extract - async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError>; + async fn fetch_and_extract(&self, dst: &Path) -> Result; /// Find the package, if it is available for download /// diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index e6f4d59f..344e326f 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -13,7 +13,7 @@ use url::Url; use crate::{ errors::{BinstallError, InvalidPkgFmtError}, helpers::{ - download::Download, + download::{Download, ExtractedFiles}, futures_resolver::FuturesResolver, gh_api_client::{GhApiClient, GhReleaseArtifact, HasReleaseArtifact}, remote::Client, @@ -216,7 +216,7 @@ impl super::Fetcher for GhCrateMeta { }) } - async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { + async fn fetch_and_extract(&self, dst: &Path) -> Result { let (url, pkg_fmt) = self.resolution.get().unwrap(); // find() is called first debug!("Downloading package from: '{url}' dst:{dst:?} fmt:{pkg_fmt:?}"); Ok(Download::new(self.client.clone(), url.clone()) diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs index 12020446..50ef1ed6 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk/src/fetchers/quickinstall.rs @@ -7,7 +7,10 @@ use url::Url; use crate::{ errors::BinstallError, helpers::{ - download::Download, gh_api_client::GhApiClient, remote::Client, tasks::AutoAbortJoinHandle, + download::{Download, ExtractedFiles}, + gh_api_client::GhApiClient, + remote::Client, + tasks::AutoAbortJoinHandle, }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; @@ -63,7 +66,7 @@ impl super::Fetcher for QuickInstall { }) } - async fn fetch_and_extract(&self, dst: &Path) -> Result<(), BinstallError> { + async fn fetch_and_extract(&self, dst: &Path) -> Result { let url = self.package_url(); debug!("Downloading package from: '{url}'"); Ok(Download::new(self.client.clone(), Url::parse(&url)?) diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 7cdc974c..3cb20d95 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -21,7 +21,7 @@ use crate::{ drivers::fetch_crate_cratesio, errors::{BinstallError, VersionParseError}, fetchers::{Data, Fetcher, TargetData}, - helpers::remote::Client, + helpers::{download::ExtractedFiles, remote::Client}, manifests::cargo_toml_binstall::{Meta, PkgMeta, PkgOverride}, }; @@ -200,7 +200,7 @@ async fn download_extract_and_verify( ) -> Result, BinstallError> { // Download and extract it. // If that fails, then ignore this fetcher. - fetcher.fetch_and_extract(bin_path).await?; + let extracted_files = fetcher.fetch_and_extract(bin_path).await?; // Build final metadata let meta = fetcher.target_meta(); @@ -230,48 +230,47 @@ async fn download_extract_and_verify( } // Verify that all non-optional bin_files exist - block_in_place(|| { - let bin_files = collect_bin_files( - fetcher, - package_info, - meta, - bin_path, - install_path, - no_symlinks, - )?; + let bin_files = collect_bin_files( + fetcher, + package_info, + meta, + bin_path, + install_path, + no_symlinks, + &extracted_files, + )?; - let name = &package_info.name; + let name = &package_info.name; - package_info - .binaries - .iter() - .zip(bin_files) - .filter_map(|(bin, bin_file)| { - match bin_file.check_source_exists() { - Ok(()) => Some(Ok(bin_file)), + package_info + .binaries + .iter() + .zip(bin_files) + .filter_map(|(bin, bin_file)| { + match bin_file.check_source_exists(&extracted_files) { + Ok(()) => Some(Ok(bin_file)), - // This binary is optional - Err(err) => { - let required_features = &bin.required_features; + // This binary is optional + Err(err) => { + let required_features = &bin.required_features; - if required_features.is_empty() { - // This bin is not optional, error - Some(Err(err)) - } else { - // Optional, print a warning and continue. - let bin_name = bin.name.as_str(); - let features = required_features.iter().format(","); - warn!( - "When resolving {name} bin {bin_name} is not found. \ + if required_features.is_empty() { + // This bin is not optional, error + Some(Err(err)) + } else { + // Optional, print a warning and continue. + let bin_name = bin.name.as_str(); + let features = required_features.iter().format(","); + warn!( + "When resolving {name} bin {bin_name} is not found. \ But since it requies features {features}, this bin is ignored." - ); - None - } + ); + None } } - }) - .collect::, BinstallError>>() - }) + } + }) + .collect::, BinstallError>>() } fn collect_bin_files( @@ -281,6 +280,7 @@ fn collect_bin_files( bin_path: &Path, install_path: &Path, no_symlinks: bool, + extracted_files: &ExtractedFiles, ) -> Result, BinstallError> { // List files to be installed // based on those found via Cargo.toml @@ -299,7 +299,7 @@ fn collect_bin_files( .bin_dir .as_deref() .map(Cow::Borrowed) - .unwrap_or_else(|| bins::infer_bin_dir_template(&bin_data)); + .unwrap_or_else(|| bins::infer_bin_dir_template(&bin_data, extracted_files)); let mut tt = TinyTemplate::new(); diff --git a/justfile b/justfile index 30e25fde..4aa1e554 100644 --- a/justfile +++ b/justfile @@ -31,10 +31,7 @@ target-libc := if target =~ "gnu" { "gnu" output-ext := if target-os == "windows" { ".exe" } else { "" } output-filename := "cargo-binstall" + output-ext output-profile-folder := if for-release != "" { "release" } else { "debug" } -output-folder := if target != target-host { "target" / target / output-profile-folder - } else if env_var_or_default("CARGO_BUILD_TARGET", "") != "" { "target" / target / output-profile-folder - } else if cargo-buildstd != "" { "target" / target / output-profile-folder - } else { "target" / output-profile-folder } +output-folder := "target" / target / output-profile-folder output-path := output-folder / output-filename # which tool to use for compiling From 44e81c7e1a0d9ac4498cca460a5163e2451f7621 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 6 Mar 2023 11:52:28 +1100 Subject: [PATCH 1084/2020] Fix: Pass value of `--roots` to `cargo-install` as `--root` (#860) Pass value of `--roots` to `cargo-install` as `--root` Signed-off-by: Jiahao XU --- crates/bin/src/entry.rs | 5 ++++- crates/binstalk/src/ops.rs | 2 ++ crates/binstalk/src/ops/resolve/resolution.rs | 4 ++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 8673e75f..553fd032 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -53,8 +53,9 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - .collect(); // Compute paths + let cargo_root = args.roots; let (install_path, mut manifests, temp_dir) = - compute_paths_and_load_manifests(args.roots, args.install_path)?; + compute_paths_and_load_manifests(cargo_root.clone(), args.install_path)?; // Remove installed crates let mut crate_names = @@ -107,6 +108,8 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - temp_dir: temp_dir.path().to_owned(), install_path, + cargo_root, + client, gh_api_client, jobserver_client, diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index 47655068..42f2eec3 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -32,6 +32,8 @@ pub struct Options { pub temp_dir: PathBuf, pub install_path: PathBuf, + pub cargo_root: Option, + pub client: Client, pub gh_api_client: GhApiClient, pub jobserver_client: LazyJobserverClient, diff --git a/crates/binstalk/src/ops/resolve/resolution.rs b/crates/binstalk/src/ops/resolve/resolution.rs index 935ae3d6..1a0b2ea6 100644 --- a/crates/binstalk/src/ops/resolve/resolution.rs +++ b/crates/binstalk/src/ops/resolve/resolution.rs @@ -154,6 +154,10 @@ impl ResolutionSource { cmd.arg("--locked"); } + if let Some(cargo_root) = &opts.cargo_root { + cmd.arg("--root").arg(cargo_root); + } + if !opts.dry_run { let mut child = opts .jobserver_client From ee909e4045fc2ab60c3b40e6bbd6c9e7f13175f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Mon, 6 Mar 2023 14:05:32 +1300 Subject: [PATCH 1085/2020] Rename --roots to --root (with alias for back compat) (#861) Co-authored-by: Jiahao XU --- crates/bin/src/args.rs | 4 ++-- crates/bin/src/entry.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index f2401288..8823cd12 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -195,8 +195,8 @@ pub struct Args { /// the metadata files inside the path you specified. /// /// NOTE that `--install-path` takes precedence over this option. - #[clap(help_heading = "Options", long)] - pub roots: Option, + #[clap(help_heading = "Options", long, alias = "roots")] + pub root: Option, /// This option will be passed through to all `cargo-install` invocations. /// diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 553fd032..f981d15f 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -53,7 +53,7 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - .collect(); // Compute paths - let cargo_root = args.roots; + let cargo_root = args.root; let (install_path, mut manifests, temp_dir) = compute_paths_and_load_manifests(cargo_root.clone(), args.install_path)?; From 1f18deb142966e3290ed34818d438fb2ab348128 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 14:01:17 +1100 Subject: [PATCH 1086/2020] Bump serde_json from 1.0.93 to 1.0.94 (#862) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.93 to 1.0.94. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.93...v1.0.94) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6514754f..8a26729e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1947,9 +1947,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76" +checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" dependencies = [ "itoa", "ryu", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 4f682f17..713768e0 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -24,7 +24,7 @@ generic-array = "0.14.6" httpdate = "1.0.2" reqwest = { version = "0.11.14", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } serde = { version = "1.0.152", features = ["derive"], optional = true } -serde_json = { version = "1.0.93", optional = true } +serde_json = { version = "1.0.94", optional = true } # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. # diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 7f323d33..664f7f03 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -19,7 +19,7 @@ miette = "5.5.0" semver = { version = "1.0.16", features = ["serde"] } serde = { version = "1.0.152", features = ["derive"] } serde-tuple-vec-map = "1.0.1" -serde_json = "1.0.93" +serde_json = "1.0.94" thiserror = "1.0.38" toml_edit = { version = "0.19.4", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } From 7f00d803f7a79e7b93e6c1561c8e19da15cc25f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 03:14:41 +0000 Subject: [PATCH 1087/2020] Bump gh-token from 0.1.0 to 0.1.1 (#863) --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8a26729e..922595a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -806,9 +806,9 @@ dependencies = [ [[package]] name = "gh-token" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc623f67e9004eac91ad251d7d4c0b1fa7ac53646c09d9c8ef6e27a21b2d02fd" +checksum = "74f7f3953b155f5df52140de17556ed1464c9d3c9092e2dc0adf2b55211fd10d" dependencies = [ "home", "serde", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 805de46e..4eb742c6 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -29,7 +29,7 @@ compact_str = "0.7.0" dirs = "4.0.0" file-format = { version = "0.14.0", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } -gh-token = "0.1.0" +gh-token = "0.1.1" log = { version = "0.4.17", features = ["std"] } miette = "5.5.0" mimalloc = { version = "0.1.34", default-features = false, optional = true } From a6a42f30af770256961c1f72351aad0426a3b62d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 03:16:31 +0000 Subject: [PATCH 1088/2020] Bump async-trait from 0.1.64 to 0.1.66 (#866) --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 922595a3..97a0d6f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.64" +version = "0.1.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd7fce9ba8c3c042128ce72d8b2ddbf3a05747efb67ea0313c635e10bda47a2" +checksum = "b84f9ebcc6c1f5b8cb160f6990096a5c127f423fcb6e1ccc46c370cbdfb75dfc" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 713768e0..bdc31103 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0" [dependencies] -async-trait = "0.1.64" +async-trait = "0.1.66" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.12", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } binstalk-types = { version = "0.2.1", path = "../binstalk-types" } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index eecf7164..b3eddc09 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0" [dependencies] -async-trait = "0.1.64" +async-trait = "0.1.66" binstalk-downloader = { version = "0.3.3", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.2.1", path = "../binstalk-types" } cargo_toml = "0.15.2" From eff8a50d13ad6663778a529a1d6c613eb1e5a30c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 03:36:02 +0000 Subject: [PATCH 1089/2020] Bump command-group from 2.0.1 to 2.1.0 (#864) --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 97a0d6f6..65551be6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -445,9 +445,9 @@ dependencies = [ [[package]] name = "command-group" -version = "2.0.1" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "026c3922235f9f7d78f21251a026f3acdeb7cce3deba107fe09a4bfa63d850a2" +checksum = "5080df6b0f0ecb76cab30808f00d937ba725cebe266a3da8cd89dff92f2a9916" dependencies = [ "async-trait", "nix", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index b3eddc09..580d4ded 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -14,7 +14,7 @@ async-trait = "0.1.66" binstalk-downloader = { version = "0.3.3", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.2.1", path = "../binstalk-types" } cargo_toml = "0.15.2" -command-group = { version = "2.0.1", features = ["with-tokio"] } +command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.5", path = "../detect-targets" } either = "1.8.1" From 460522f5bd95b0c9fc7d3450f6d753bdcadf6286 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Mar 2023 03:45:37 +0000 Subject: [PATCH 1090/2020] Bump thiserror from 1.0.38 to 1.0.39 (#865) --- Cargo.lock | 8 ++++---- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 65551be6..ca625a14 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2170,18 +2170,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.38" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +checksum = "a5ab016db510546d856297882807df8da66a16fb8c4101cb8b30054b0d5b2d9c" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.38" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index bdc31103..4365fdf1 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -31,7 +31,7 @@ serde_json = { version = "1.0.94", optional = true } #tar = "0.4.38" tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.4.0" -thiserror = "1.0.38" +thiserror = "1.0.39" tokio = { version = "1.26.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.7", features = ["io"] } diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 664f7f03..09171672 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -20,7 +20,7 @@ semver = { version = "1.0.16", features = ["serde"] } serde = { version = "1.0.152", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.94" -thiserror = "1.0.38" +thiserror = "1.0.39" toml_edit = { version = "0.19.4", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 580d4ded..9817c6da 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -29,7 +29,7 @@ semver = { version = "1.0.16", features = ["serde"] } serde = { version = "1.0.152", features = ["derive"] } strum = "0.24.1" tempfile = "3.4.0" -thiserror = "1.0.38" +thiserror = "1.0.39" tinytemplate = "1.2.1" # parking_lot for `tokio::sync::OnceCell::const_new` tokio = { version = "1.26.0", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } From 01c8ecb7781ffb70a9ff95bae98e710f029760ad Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 6 Mar 2023 17:54:31 +1100 Subject: [PATCH 1091/2020] Fix zip extraction and `bins::infer_bin_dir_template` (#869) - Fix zip extraction code: Ensure dir is rwx and file is readable for curr user - Add more integration test for `ExtractedFiles` - Fix `bins::infer_bin_dir_template` introduced in #856 Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/download.rs | 34 ++++++++++++++++++- .../src/download/extracted_files.rs | 18 ++++++---- .../src/download/zip_extraction.rs | 12 +++++-- crates/binstalk/src/bins.rs | 6 +--- 4 files changed, 56 insertions(+), 14 deletions(-) diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index a0412e07..bebd7bce 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -204,6 +204,7 @@ mod test { ) .unwrap(); + // cargo-binstall let cargo_binstall_url = "https://github.com/cargo-bins/cargo-binstall/releases/download/v0.20.1/cargo-binstall-aarch64-unknown-linux-musl.tgz"; let extracted_files = @@ -232,9 +233,10 @@ mod test { ]) ); + // cargo-watch let cargo_watch_url = "https://github.com/watchexec/cargo-watch/releases/download/v8.4.0/cargo-watch-v8.4.0-aarch64-unknown-linux-gnu.tar.xz"; - let extracted_files = Download::new(client, Url::parse(cargo_watch_url).unwrap()) + let extracted_files = Download::new(client.clone(), Url::parse(cargo_watch_url).unwrap()) .and_extract(PkgFmt::Txz, tempdir().unwrap()) .await .unwrap(); @@ -276,5 +278,35 @@ mod test { assert!(!extracted_files.has_file(&dir.join("asdfcqwe"))); assert!(extracted_files.has_file(&dir.join("completions/zsh"))); + + // sccache, tgz and zip + let sccache_config = [ + ("https://github.com/mozilla/sccache/releases/download/v0.3.3/sccache-v0.3.3-x86_64-pc-windows-msvc.tar.gz", PkgFmt::Tgz), + ("https://github.com/mozilla/sccache/releases/download/v0.3.3/sccache-v0.3.3-x86_64-pc-windows-msvc.zip", PkgFmt::Zip), + ]; + + for (sccache_url, fmt) in sccache_config { + let extracted_files = Download::new(client.clone(), Url::parse(sccache_url).unwrap()) + .and_extract(fmt, tempdir().unwrap()) + .await + .unwrap(); + + let dir = Path::new("sccache-v0.3.3-x86_64-pc-windows-msvc"); + + assert_eq!( + extracted_files.get_dir(Path::new(".")).unwrap(), + &HashSet::from([dir.as_os_str().into()]) + ); + + assert_eq!( + extracted_files.get_dir(dir).unwrap(), + &HashSet::from_iter( + ["README.md", "LICENSE", "sccache.exe"] + .iter() + .map(OsStr::new) + .map(Box::::from) + ), + ); + } } } diff --git a/crates/binstalk-downloader/src/download/extracted_files.rs b/crates/binstalk-downloader/src/download/extracted_files.rs index 2cc4c90a..87074e00 100644 --- a/crates/binstalk-downloader/src/download/extracted_files.rs +++ b/crates/binstalk-downloader/src/download/extracted_files.rs @@ -79,14 +79,18 @@ impl ExtractedFiles { } } - /// * `path` - must be canonical and must not be empty, but could be "." - /// for top-level. + /// * `path` - must be a relative path without `.`, `..`, `/`, `prefix:/` + /// and must not be empty, for these values it is guaranteed to + /// return `None`. + /// But could be set to "." for top-level. pub fn get_entry(&self, path: &Path) -> Option<&ExtractedFilesEntry> { self.0.get(path) } - /// * `path` - must be canonical and must not be empty, but could be "." - /// for top-level. + /// * `path` - must be a relative path without `.`, `..`, `/`, `prefix:/` + /// and must not be empty, for these values it is guaranteed to + /// return `None`. + /// But could be set to "." for top-level. pub fn get_dir(&self, path: &Path) -> Option<&HashSet>> { match self.get_entry(path)? { ExtractedFilesEntry::Dir(file_names) => Some(file_names), @@ -94,8 +98,10 @@ impl ExtractedFiles { } } - /// * `path` - must be canonical and must not be empty, but could be "." - /// for top-level. + /// * `path` - must be a relative path without `.`, `..`, `/`, `prefix:/` + /// and must not be empty, for these values it is guaranteed to + /// return `false`. + /// But could be set to "." for top-level. pub fn has_file(&self, path: &Path) -> bool { matches!(self.get_entry(path), Some(ExtractedFilesEntry::File)) } diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index cf48465c..fad0f481 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -54,17 +54,25 @@ where // Get permissions let mut perms = None; + let is_dir = raw_filename.ends_with('/'); + #[cfg(unix)] { use std::{fs::Permissions, os::unix::fs::PermissionsExt}; if let Some(mode) = zip_reader.entry().unix_permissions() { - let mode: u16 = mode; + // If it is a dir, then it needs to be at least rwx for the current + // user so that we can create new files, search for existing files + // and list its contents. + // + // If it is a file, then it needs to be at least readable for the + // current user. + let mode: u16 = mode | if is_dir { 0o700 } else { 0o400 }; perms = Some(Permissions::from_mode(mode as u32)); } } - if raw_filename.ends_with('/') { + if is_dir { extracted_files.add_dir(&filename); // This entry is a dir. diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 6ab63626..2e216b55 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -56,11 +56,7 @@ pub fn infer_bin_dir_template(data: &Data, extracted_files: &ExtractedFiles) -> gen_possible_dirs .into_iter() .map(|gen_possible_dir| gen_possible_dir(name, target, version)) - .find(|dirname| { - extracted_files - .get_dir(&data.bin_path.join(dirname)) - .is_some() - }) + .find(|dirname| extracted_files.get_dir(Path::new(&dirname)).is_some()) .map(|mut dir| { dir.reserve_exact(1 + default_bin_dir_template.len()); dir += "/"; From 72789874f030ed6fb0e912cb6ccb809cc48625ab Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 6 Mar 2023 19:13:08 +1100 Subject: [PATCH 1092/2020] Use Quickinstall new release schema (#867) - Refactor: Extract new fn `binstalk::helpers::remote::does_url_exist` - Use new quickinstall release schema in `binstalk::fetchers::QuickInstall` - Optimize `fetchers::QuickInstall`: Generate url once in `Fetcher::new` Avoid repeated string allocation plus `Url` parsing. This also makes changing package_url and stats_url easier. - Optimize `QuickInstall::report`: Use HEAD instead of GET Signed-off-by: Jiahao XU --- crates/binstalk/src/fetchers/gh_crate_meta.rs | 27 +-------- crates/binstalk/src/fetchers/quickinstall.rs | 56 ++++++++++--------- crates/binstalk/src/helpers.rs | 3 +- crates/binstalk/src/helpers/remote.rs | 37 ++++++++++++ e2e-tests/upgrade.sh | 2 - 5 files changed, 72 insertions(+), 53 deletions(-) create mode 100644 crates/binstalk/src/helpers/remote.rs diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 344e326f..8f93cea4 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -15,8 +15,8 @@ use crate::{ helpers::{ download::{Download, ExtractedFiles}, futures_resolver::FuturesResolver, - gh_api_client::{GhApiClient, GhReleaseArtifact, HasReleaseArtifact}, - remote::Client, + gh_api_client::GhApiClient, + remote::{does_url_exist, Client}, tasks::AutoAbortJoinHandle, }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, @@ -69,28 +69,7 @@ impl GhCrateMeta { let gh_api_client = self.gh_api_client.clone(); async move { - debug!("Checking for package at: '{url}'"); - - if let Some(artifact) = GhReleaseArtifact::try_extract_from_url(&url) { - debug!("Using GitHub Restful API to check for existence of artifact, which will also cache the API response"); - - match gh_api_client.has_release_artifact(artifact).await? { - HasReleaseArtifact::Yes => return Ok(Some((url, pkg_fmt))), - HasReleaseArtifact::No | HasReleaseArtifact::NoSuchRelease=> return Ok(None), - - HasReleaseArtifact::RateLimit { retry_after } => { - warn!("Your GitHub API token (if any) has reached its rate limit and cannot be used again until {retry_after:?}, so we will fallback to HEAD/GET on the url."); - warn!("If you did not supply the github token, consider supply one since GitHub by default limit the number of requests for unauthoized user to 60 requests per hour per origin IP address."); - } - HasReleaseArtifact::Unauthorized => { - warn!("GitHub API somehow requires a token for the API access, so we will fallback to HEAD/GET on the url."); - warn!("Please consider supplying a token to cargo-binstall to speedup resolution."); - } - } - } - - Ok(client - .remote_gettable(url.clone()) + Ok(does_url_exist(client, gh_api_client, &url) .await? .then_some((url, pkg_fmt))) } diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs index 50ef1ed6..959e61d2 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk/src/fetchers/quickinstall.rs @@ -9,7 +9,7 @@ use crate::{ helpers::{ download::{Download, ExtractedFiles}, gh_api_client::GhApiClient, - remote::Client, + remote::{does_url_exist, Client, Method}, tasks::AutoAbortJoinHandle, }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, @@ -22,7 +22,12 @@ const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; pub struct QuickInstall { client: Client, + gh_api_client: GhApiClient, + package: String, + package_url: Url, + stats_url: Url, + target_data: Arc, } @@ -30,16 +35,28 @@ pub struct QuickInstall { impl super::Fetcher for QuickInstall { fn new( client: Client, - _gh_api_client: GhApiClient, + gh_api_client: GhApiClient, data: Arc, target_data: Arc, ) -> Arc { let crate_name = &data.name; let version = &data.version; let target = &target_data.target; + + let package = format!("{crate_name}-{version}-{target}"); + Arc::new(Self { client, - package: format!("{crate_name}-{version}-{target}"), + gh_api_client, + + package_url: Url::parse(&format!( + "{BASE_URL}/{crate_name}-{version}/{package}.tar.gz", + )) + .expect("package_url is pre-generated and should never be invalid url"), + stats_url: Url::parse(&format!("{STATS_URL}/{package}.tar.gz",)) + .expect("stats_url is pre-generated and should never be invalid url"), + package, + target_data, }) } @@ -60,16 +77,19 @@ impl super::Fetcher for QuickInstall { }); } - let url = self.package_url(); - debug!("Checking for package at: '{url}'"); - Ok(self.client.remote_gettable(Url::parse(&url)?).await?) + does_url_exist( + self.client.clone(), + self.gh_api_client.clone(), + &self.package_url, + ) + .await }) } async fn fetch_and_extract(&self, dst: &Path) -> Result { - let url = self.package_url(); + let url = &self.package_url; debug!("Downloading package from: '{url}'"); - Ok(Download::new(self.client.clone(), Url::parse(&url)?) + Ok(Download::new(self.client.clone(), url.clone()) .and_extract(self.pkg_fmt(), dst) .await?) } @@ -103,27 +123,11 @@ impl super::Fetcher for QuickInstall { } impl QuickInstall { - fn package_url(&self) -> String { - format!( - "{base_url}/{package}/{package}.tar.gz", - base_url = BASE_URL, - package = self.package - ) - } - - fn stats_url(&self) -> String { - format!( - "{stats_url}/{package}.tar.gz", - stats_url = STATS_URL, - package = self.package - ) - } - pub async fn report(&self) -> Result<(), BinstallError> { - let url = Url::parse(&self.stats_url())?; + let url = self.stats_url.clone(); debug!("Sending installation report to quickinstall ({url})"); - self.client.remote_gettable(url).await?; + self.client.request(Method::HEAD, url).send(true).await?; Ok(()) } diff --git a/crates/binstalk/src/helpers.rs b/crates/binstalk/src/helpers.rs index f610706d..bfc42460 100644 --- a/crates/binstalk/src/helpers.rs +++ b/crates/binstalk/src/helpers.rs @@ -1,6 +1,7 @@ pub mod futures_resolver; pub mod jobserver_client; +pub mod remote; pub mod signal; pub mod tasks; -pub use binstalk_downloader::{download, gh_api_client, remote}; +pub use binstalk_downloader::{download, gh_api_client}; diff --git a/crates/binstalk/src/helpers/remote.rs b/crates/binstalk/src/helpers/remote.rs new file mode 100644 index 00000000..1d46f793 --- /dev/null +++ b/crates/binstalk/src/helpers/remote.rs @@ -0,0 +1,37 @@ +pub use binstalk_downloader::remote::*; + +use binstalk_downloader::gh_api_client::{GhApiClient, GhReleaseArtifact, HasReleaseArtifact}; +use tracing::{debug, warn}; + +use crate::errors::BinstallError; + +/// This function returns a future where its size should be at most size of +/// 2 pointers. +pub async fn does_url_exist( + client: Client, + gh_api_client: GhApiClient, + url: &Url, +) -> Result { + debug!("Checking for package at: '{url}'"); + + if let Some(artifact) = GhReleaseArtifact::try_extract_from_url(url) { + debug!("Using GitHub Restful API to check for existence of artifact, which will also cache the API response"); + + // The future returned has the same size as a pointer + match gh_api_client.has_release_artifact(artifact).await? { + HasReleaseArtifact::Yes => return Ok(true), + HasReleaseArtifact::No | HasReleaseArtifact::NoSuchRelease => return Ok(false), + + HasReleaseArtifact::RateLimit { retry_after } => { + warn!("Your GitHub API token (if any) has reached its rate limit and cannot be used again until {retry_after:?}, so we will fallback to HEAD/GET on the url."); + warn!("If you did not supply a github token, consider doing so: GitHub limits unauthorized users to 60 requests per hour per origin IP address."); + } + HasReleaseArtifact::Unauthorized => { + warn!("GitHub API somehow requires a token for the API access, so we will fallback to HEAD/GET on the url."); + warn!("Please consider supplying a token to cargo-binstall to speedup resolution."); + } + } + } + + Ok(Box::pin(client.remote_gettable(url.clone())).await?) +} diff --git a/e2e-tests/upgrade.sh b/e2e-tests/upgrade.sh index dd591905..83db3d12 100755 --- a/e2e-tests/upgrade.sh +++ b/e2e-tests/upgrade.sh @@ -11,8 +11,6 @@ export PATH="$CARGO_HOME/bin:$PATH" "./$1" binstall --no-confirm --force cargo-binstall@0.11.1 "./$1" binstall --log-level=info --no-confirm cargo-binstall@0.11.1 | grep -q 'cargo-binstall v0.11.1 is already installed' -"./$1" binstall --log-level=info --no-confirm cargo-binstall@0.10.0 | grep -q -v 'cargo-binstall v0.10.0 is already installed' - ## Test When 0.11.0 is installed but can be upgraded. "./$1" binstall --no-confirm cargo-binstall@0.12.0 "./$1" binstall --log-level=info --no-confirm cargo-binstall@0.12.0 | grep -q 'cargo-binstall v0.12.0 is already installed' From 174b6c8144b3a000f9d54847406c9132072a2da3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Mar 2023 02:44:31 +0000 Subject: [PATCH 1093/2020] Bump file-format from 0.14.0 to 0.15.0 (#872) --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ca625a14..17ffe1ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -628,9 +628,9 @@ dependencies = [ [[package]] name = "file-format" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d645737d3dda11cbf14905e9b943a1bd578cdcb751709b581a924ea9b9b18b5c" +checksum = "bbe20e5f282c61432e5cf0e33185e5dde032b2c2e4281c4735c31ce5b455a869" [[package]] name = "filetime" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 4eb742c6..234b53be 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -27,7 +27,7 @@ binstalk-manifests = { path = "../binstalk-manifests", version = "0.3.0" } clap = { version = "4.1.8", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "4.0.0" -file-format = { version = "0.14.0", default-features = false } +file-format = { version = "0.15.0", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } gh-token = "0.1.1" log = { version = "0.4.17", features = ["std"] } From ecd599bfa868096a2a39f2f5c8570b1d631a9b78 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 7 Mar 2023 18:48:01 +1100 Subject: [PATCH 1094/2020] Verify syntax of the github token provided in `GhApiClient::new` (#870) Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/gh_api_client.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/binstalk-downloader/src/gh_api_client.rs b/crates/binstalk-downloader/src/gh_api_client.rs index be66da7a..649817a6 100644 --- a/crates/binstalk-downloader/src/gh_api_client.rs +++ b/crates/binstalk-downloader/src/gh_api_client.rs @@ -7,6 +7,7 @@ use std::{ use compact_str::{CompactString, ToCompactString}; use tokio::sync::OnceCell; +use tracing::warn; use crate::remote; @@ -96,8 +97,21 @@ struct Inner { #[derive(Clone, Debug)] pub struct GhApiClient(Arc); +fn gh_prefixed(token: &str) -> bool { + matches!((token.get(0..2), token.get(3..4)), (Some("gh"), Some("_"))) +} + impl GhApiClient { pub fn new(client: remote::Client, auth_token: Option) -> Self { + let auth_token = auth_token.and_then(|auth_token| { + if gh_prefixed(&auth_token) { + Some(auth_token) + } else { + warn!("Invalid auth_token, expected 'gh*_', fallback to unauthorized mode"); + None + } + }); + Self(Arc::new(Inner { client, auth_token, From f5c30c2f8ce96937e5308ac9e9a590e564f1105a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Mar 2023 02:37:38 +0000 Subject: [PATCH 1095/2020] Bump serde from 1.0.152 to 1.0.153 (#873) --- Cargo.lock | 8 ++++---- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 17ffe1ee..c27976c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1918,9 +1918,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.152" +version = "1.0.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" +checksum = "3a382c72b4ba118526e187430bb4963cd6d55051ebf13d9b25574d379cc98d20" dependencies = [ "serde_derive", ] @@ -1936,9 +1936,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.152" +version = "1.0.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" +checksum = "1ef476a5790f0f6decbc66726b6e5d63680ed518283e64c7df415989d880954f" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 4365fdf1..4ddf23f7 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -23,7 +23,7 @@ futures-lite = { version = "1.12.0", default-features = false } generic-array = "0.14.6" httpdate = "1.0.2" reqwest = { version = "0.11.14", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } -serde = { version = "1.0.152", features = ["derive"], optional = true } +serde = { version = "1.0.153", features = ["derive"], optional = true } serde_json = { version = "1.0.94", optional = true } # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 09171672..c697f278 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -17,7 +17,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" miette = "5.5.0" semver = { version = "1.0.16", features = ["serde"] } -serde = { version = "1.0.152", features = ["derive"] } +serde = { version = "1.0.153", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.94" thiserror = "1.0.39" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 2f639575..6c1e9a2a 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -14,7 +14,7 @@ compact_str = { version = "0.7.0", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.17.1" semver = { version = "1.0.16", features = ["serde"] } -serde = { version = "1.0.152", features = ["derive"] } +serde = { version = "1.0.153", features = ["derive"] } strum = "0.24.1" strum_macros = "0.24.3" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 9817c6da..175acda9 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ miette = "5.5.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.17.1" semver = { version = "1.0.16", features = ["serde"] } -serde = { version = "1.0.152", features = ["derive"] } +serde = { version = "1.0.153", features = ["derive"] } strum = "0.24.1" tempfile = "3.4.0" thiserror = "1.0.39" From cfbdf1181f18314d20ddb5f548e4646b3f98e346 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 9 Mar 2023 02:35:50 +0000 Subject: [PATCH 1096/2020] Bump serde from 1.0.153 to 1.0.154 (#874) --- Cargo.lock | 8 ++++---- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c27976c5..cf789c49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1918,9 +1918,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.153" +version = "1.0.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a382c72b4ba118526e187430bb4963cd6d55051ebf13d9b25574d379cc98d20" +checksum = "8cdd151213925e7f1ab45a9bbfb129316bd00799784b174b7cc7bcd16961c49e" dependencies = [ "serde_derive", ] @@ -1936,9 +1936,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.153" +version = "1.0.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ef476a5790f0f6decbc66726b6e5d63680ed518283e64c7df415989d880954f" +checksum = "4fc80d722935453bcafdc2c9a73cd6fac4dc1938f0346035d84bf99fa9e33217" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 4ddf23f7..c7d31328 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -23,7 +23,7 @@ futures-lite = { version = "1.12.0", default-features = false } generic-array = "0.14.6" httpdate = "1.0.2" reqwest = { version = "0.11.14", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } -serde = { version = "1.0.153", features = ["derive"], optional = true } +serde = { version = "1.0.154", features = ["derive"], optional = true } serde_json = { version = "1.0.94", optional = true } # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index c697f278..8db21c71 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -17,7 +17,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" miette = "5.5.0" semver = { version = "1.0.16", features = ["serde"] } -serde = { version = "1.0.153", features = ["derive"] } +serde = { version = "1.0.154", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.94" thiserror = "1.0.39" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 6c1e9a2a..a4877d19 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -14,7 +14,7 @@ compact_str = { version = "0.7.0", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.17.1" semver = { version = "1.0.16", features = ["serde"] } -serde = { version = "1.0.153", features = ["derive"] } +serde = { version = "1.0.154", features = ["derive"] } strum = "0.24.1" strum_macros = "0.24.3" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 175acda9..c2aa601b 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ miette = "5.5.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.17.1" semver = { version = "1.0.16", features = ["serde"] } -serde = { version = "1.0.153", features = ["derive"] } +serde = { version = "1.0.154", features = ["derive"] } strum = "0.24.1" tempfile = "3.4.0" thiserror = "1.0.39" From 9c617c2f8a47b713b6b68d0f617111f8a489b20f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Mar 2023 22:08:54 +1100 Subject: [PATCH 1097/2020] Enable only feature `cross-lang-fat-lto` on MacOS (#876) --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index 4aa1e554..67a64b82 100644 --- a/justfile +++ b/justfile @@ -66,7 +66,7 @@ support-pkg-config := if target == target-host { cargo-features := trim_end_match(if override-features != "" { override-features } else if (cargo-profile / ci-or-no) == "dev/ci" { "rustls,fancy-with-backtrace,zstd-thin,log_release_max_level_debug" + (if support-pkg-config != "" { ",pkg-config" } else { "" }) + extra-features - } else if (cargo-profile / ci-or-no) == "release/ci" { "static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug" + (if target-os != "macos" { ",cross-lang-fat-lto" } else { "" }) + extra-features + } else if (cargo-profile / ci-or-no) == "release/ci" { "static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug,cross-lang-fat-lto" + extra-features } else { extra-features }, ",") From a22cb3a332624bb35eabb66143314d946851fe9f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 10 Mar 2023 22:09:16 +1100 Subject: [PATCH 1098/2020] Fix x86_64 fallback for aarch64 MacOS (#875) --- crates/detect-targets/src/detect.rs | 2 +- crates/detect-targets/src/detect/macos.rs | 24 +++++++++++++++++++++-- 2 files changed, 23 insertions(+), 3 deletions(-) diff --git a/crates/detect-targets/src/detect.rs b/crates/detect-targets/src/detect.rs index 62af9f20..a7863e6c 100644 --- a/crates/detect-targets/src/detect.rs +++ b/crates/detect-targets/src/detect.rs @@ -61,7 +61,7 @@ pub async fn detect_targets() -> Vec { cfg_if! { if #[cfg(target_os = "macos")] { - targets.extend(macos::detect_alternative_targets(&targets[0])); + targets.extend(macos::detect_alternative_targets(&targets[0]).await); } else if #[cfg(target_os = "windows")] { targets.extend(windows::detect_alternative_targets(&targets[0])); } diff --git a/crates/detect-targets/src/detect/macos.rs b/crates/detect-targets/src/detect/macos.rs index 0c216981..58fc7fe8 100644 --- a/crates/detect-targets/src/detect/macos.rs +++ b/crates/detect-targets/src/detect/macos.rs @@ -1,10 +1,30 @@ +use std::{io, process::Stdio}; + +use tokio::process::Command; + const AARCH64: &str = "aarch64-apple-darwin"; const X86: &str = "x86_64-apple-darwin"; const UNIVERSAL: &str = "universal-apple-darwin"; -pub(super) fn detect_alternative_targets(target: &str) -> impl Iterator { +async fn is_x86_64_supported() -> io::Result { + let exit_status = Command::new("arch") + .args(["-arch", "x86_64", "/usr/bin/true"]) + .stdin(Stdio::null()) + .stdout(Stdio::null()) + .stderr(Stdio::null()) + .spawn()? + .wait() + .await?; + + Ok(exit_status.success()) +} + +pub(super) async fn detect_alternative_targets(target: &str) -> impl Iterator { match target { - AARCH64 => [Some(X86), Some(UNIVERSAL)], + AARCH64 => [ + is_x86_64_supported().await.unwrap_or(false).then_some(X86), + Some(UNIVERSAL), + ], X86 => [Some(UNIVERSAL), None], _ => [None, None], } From 620d0e5f9e8fee7a597254f149a0a931eec1bb15 Mon Sep 17 00:00:00 2001 From: EdJoPaTo Date: Sat, 11 Mar 2023 01:56:57 +0100 Subject: [PATCH 1099/2020] docs(readme): fix link to metadata (#877) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Félix Saparelli --- README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1084df5b..bc8de9c3 100644 --- a/README.md +++ b/README.md @@ -62,14 +62,15 @@ cargo binstall --no-confirm --no-symlinks cargo-edit cargo-watch cargo-tarpaulin watchexec-cli cargo-outdated just fnm broot stylua ``` -If your favorite package fails to install, you may specify the Cargo.toml metadata entries for `pkg-url`, `bin-dir`, and `pkg-fmt` at the command line, with values [as documented below](#supporting-binary-installation). +If your favorite package fails to install, you can instead specify the `pkg-url`, `bin-dir`, and `pkg-fmt` at the command line, with values as documented in [SUPPORT.md](./SUPPORT.md). For example: ```shell -$ binstall \ +$ cargo-binstall \ --pkg-url="{ repo }/releases/download/{ version }/{ name }-{ version }-{ target }.{ archive-format }" \ - --pkg-fmt="txz" crate_name + --pkg-fmt="txz" \ + crate_name ``` ## Upgrade installed crates From ac414df5bedcf23cb63f5d2475999a28dd524428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 11 Mar 2023 14:58:58 +1300 Subject: [PATCH 1100/2020] Use stable sparse registry option (#879) --- .github/workflows/ci.yml | 2 +- .github/workflows/release-build.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e28d9767..cd0a8ad6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,7 +24,7 @@ concurrency: env: CARGO_TERM_COLOR: always - CARGO_UNSTABLE_SPARSE_REGISTRY: "true" + CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse jobs: test: diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 8371f17a..7e08cc2e 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -11,7 +11,7 @@ on: env: CARGO_TERM_COLOR: always - CARGO_UNSTABLE_SPARSE_REGISTRY: "true" + CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse jobs: build: From 18bc81f46f2eee29cf2feb1150f3f0fd4eb6b15a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Mar 2023 13:57:14 +1100 Subject: [PATCH 1101/2020] Use `cargo-auditable` for release build (#878) to make the pre-built artifacts auditable by `cargo-audit` and other tools. * Add new env `JUST_USE_AUDITABLE` to enable use of `cargo-auditable` Signed-off-by: Jiahao XU --- .github/workflows/release-build.yml | 2 ++ justfile | 27 +++++++++++++++++---------- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 7e08cc2e..93ba0d59 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -37,12 +37,14 @@ jobs: GLIBC_VERSION: ${{ matrix.g }} JUST_USE_CARGO_ZIGBUILD: ${{ matrix.c }} JUST_FOR_RELEASE: true + JUST_USE_AUDITABLE: true steps: - uses: actions/checkout@v3 - uses: ./.github/actions/just-setup with: cache-suffix: release-${{ matrix.t }} + tools: cargo-auditable - run: just toolchain rust-src - run: just ci-install-deps diff --git a/justfile b/justfile index 67a64b82..fe6488b0 100644 --- a/justfile +++ b/justfile @@ -8,9 +8,13 @@ extra-features := env_var_or_default("JUST_EXTRA_FEATURES", "") default-features := env_var_or_default("JUST_DEFAULT_FEATURES", "") override-features := env_var_or_default("JUST_OVERRIDE_FEATURES", "") glibc-version := env_var_or_default("GLIBC_VERSION", "") +use-auditable := env_var_or_default("JUST_USE_AUDITABLE", "") export BINSTALL_LOG_LEVEL := if env_var_or_default("RUNNER_DEBUG", "0") == "1" { "debug" } else { "info" } +cargo := if use-cargo-zigbuild != "" { "cargo-zigbuild" } else if use-cross != "" { "cross" } else { "cargo" } +export CARGO := cargo + # target information target-host := `rustc -vV | grep host: | cut -d ' ' -f 2` target := env_var_or_default("CARGO_BUILD_TARGET", target-host) @@ -35,7 +39,11 @@ output-folder := "target" / target / output-profile-folder output-path := output-folder / output-filename # which tool to use for compiling -cargo-bin := if use-cargo-zigbuild != "" { "cargo-zigbuild" } else if use-cross != "" { "cross" } else { "cargo" } +cargo-bin := if use-auditable != "" { + "cargo-auditable auditable" +} else { + cargo +} # cargo compile options cargo-profile := if for-release != "" { "release" } else { "dev" } @@ -159,13 +167,13 @@ toolchain components="": {{ if ci != "" { "rustup default stable" } else { "rustup override set stable" } }} {{ if target != "" { "rustup target add " + target } else { "" } }} +print-env: + echo "env RUSTFLAGS='$RUSTFLAGS', CARGO='$CARGO'" -build: - echo "env RUSTFLAGS=$RUSTFLAGS" +build: print-env {{cargo-bin}} build {{cargo-build-args}} -check: - echo "env RUSTFLAGS=$RUSTFLAGS" +check: print-env {{cargo-bin}} check {{cargo-build-args}} get-output file outdir=".": @@ -197,19 +205,18 @@ e2e-test-tls: (e2e-test "tls" "1.2") (e2e-test "tls" "1.3") e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall -unit-tests: +unit-tests: print-env {{cargo-bin}} test {{cargo-build-args}} test: unit-tests build e2e-tests -clippy: +clippy: print-env {{cargo-bin}} clippy --no-deps -- -D clippy::all -fmt: +fmt: print-env cargo fmt --all -- --check -fmt-check: - cargo fmt --all -- --check +fmt-check: fmt lint: clippy fmt-check From c5d0b84aa6d324c22f4d7280e332537d1507351f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Mar 2023 15:06:46 +1100 Subject: [PATCH 1102/2020] Perform startup/init code eagerly in `entry::install_crates` (#880) The startup/init code in `entry::install_crates` performs a lot of blocking operations, from testing if dir exists to reading from files and there is no `.await` in there until after the startup. There are also a few cases where `block_in_place` should be called (e.g. loading manifests, loading TLS certificates) but is missing. Most of the `Args` passed to `entry::install_crates` are actually consumed before the first `.await` point, so performing startup/init code eagerly would make the generated future much smaller, reduce codegen and also makes it easier to optimize. Signed-off-by: Jiahao XU --- crates/bin/src/bin_util.rs | 36 +++++---- crates/bin/src/entry.rs | 150 +++++++++++++++++++------------------ crates/bin/src/main.rs | 2 +- 3 files changed, 98 insertions(+), 90 deletions(-) diff --git a/crates/bin/src/bin_util.rs b/crates/bin/src/bin_util.rs index d0d03532..310f507c 100644 --- a/crates/bin/src/bin_util.rs +++ b/crates/bin/src/bin_util.rs @@ -35,29 +35,33 @@ impl Termination for MainExit { } impl MainExit { - pub fn new(result: Result, BinstallError>, done: Duration) -> Self { - result.map_or_else(MainExit::Error, |res| { - res.map(|()| MainExit::Success(Some(done))) - .unwrap_or_else(|err| { - err.downcast::() - .map(MainExit::Error) - .unwrap_or_else(MainExit::Report) - }) - }) + pub fn new(res: Result<()>, done: Duration) -> Self { + res.map(|()| MainExit::Success(Some(done))) + .unwrap_or_else(|err| { + err.downcast::() + .map(MainExit::Error) + .unwrap_or_else(MainExit::Report) + }) } } /// This function would start a tokio multithreading runtime, -/// spawn a new task on it that runs `f`, then `block_on` it. +/// spawn a new task on it that runs `f()`, then `block_on` it. /// /// It will cancel the future if user requested cancellation /// via signal. -pub fn run_tokio_main(f: F) -> Result +pub fn run_tokio_main(f: Func) -> Result<()> where - F: Future + Send + 'static, - T: Send + 'static, + Func: FnOnce() -> Result>, + Fut: Future> + Send + 'static, { - let rt = Runtime::new()?; - let handle = AutoAbortJoinHandle::new(rt.spawn(f)); - rt.block_on(cancel_on_user_sig_term(handle)) + let rt = Runtime::new().map_err(BinstallError::from)?; + let _guard = rt.enter(); + + if let Some(fut) = f()? { + let handle = AutoAbortJoinHandle::new(rt.spawn(fut)); + rt.block_on(cancel_on_user_sig_term(handle))? + } else { + Ok(()) + } } diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index f981d15f..ccc2d953 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -1,5 +1,6 @@ use std::{ env, fs, + future::Future, path::{Path, PathBuf}, sync::Arc, time::Duration, @@ -35,7 +36,10 @@ use crate::{ ui::confirm, }; -pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) -> Result<()> { +pub fn install_crates( + args: Args, + jobserver_client: LazyJobserverClient, +) -> Result>>> { // Compute Resolvers let mut cargo_install_fallback = false; @@ -63,7 +67,7 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - if crate_names.peek().is_none() { debug!("Nothing to do"); - return Ok(()); + return Ok(None); } // Launch target detection @@ -131,53 +135,55 @@ pub async fn install_crates(args: Args, jobserver_client: LazyJobserverClient) - }) .collect(); - // Collect results - let mut resolution_fetchs = Vec::new(); - let mut resolution_sources = Vec::new(); + Ok(Some(async move { + // Collect results + let mut resolution_fetchs = Vec::new(); + let mut resolution_sources = Vec::new(); - for task in tasks { - match task.await?? { - Resolution::AlreadyUpToDate => {} - Resolution::Fetch(fetch) => { - fetch.print(&binstall_opts); - resolution_fetchs.push(fetch) - } - Resolution::InstallFromSource(source) => { - source.print(); - resolution_sources.push(source) + for task in tasks { + match task.await?? { + Resolution::AlreadyUpToDate => {} + Resolution::Fetch(fetch) => { + fetch.print(&binstall_opts); + resolution_fetchs.push(fetch) + } + Resolution::InstallFromSource(source) => { + source.print(); + resolution_sources.push(source) + } } } - } - if resolution_fetchs.is_empty() && resolution_sources.is_empty() { - debug!("Nothing to do"); - return Ok(()); - } + if resolution_fetchs.is_empty() && resolution_sources.is_empty() { + debug!("Nothing to do"); + return Ok(()); + } - // Confirm - if !dry_run && !no_confirm { - confirm().await?; - } + // Confirm + if !dry_run && !no_confirm { + confirm().await?; + } - do_install_fetches( - resolution_fetchs, - manifests, - &binstall_opts, - dry_run, - temp_dir, - no_cleanup, - )?; + do_install_fetches( + resolution_fetchs, + manifests, + &binstall_opts, + dry_run, + temp_dir, + no_cleanup, + )?; - let tasks: Vec<_> = resolution_sources - .into_iter() - .map(|source| AutoAbortJoinHandle::spawn(source.install(binstall_opts.clone()))) - .collect(); + let tasks: Vec<_> = resolution_sources + .into_iter() + .map(|source| AutoAbortJoinHandle::spawn(source.install(binstall_opts.clone()))) + .collect(); - for task in tasks { - task.await??; - } + for task in tasks { + task.await??; + } - Ok(()) + Ok(()) + })) } fn do_read_root_cert(path: &Path) -> Result, BinstallError> { @@ -228,43 +234,41 @@ fn compute_paths_and_load_manifests( roots: Option, install_path: Option, ) -> Result<(PathBuf, Option, tempfile::TempDir)> { - block_in_place(|| { - // Compute cargo_roots - let cargo_roots = install_path::get_cargo_roots_path(roots).ok_or_else(|| { - error!("No viable cargo roots path found of specified, try `--roots`"); - miette!("No cargo roots path found or specified") - })?; + // Compute cargo_roots + let cargo_roots = install_path::get_cargo_roots_path(roots).ok_or_else(|| { + error!("No viable cargo roots path found of specified, try `--roots`"); + miette!("No cargo roots path found or specified") + })?; - // Compute install directory - let (install_path, custom_install_path) = - install_path::get_install_path(install_path, Some(&cargo_roots)); - let install_path = install_path.ok_or_else(|| { - error!("No viable install path found of specified, try `--install-path`"); - miette!("No install path found or specified") - })?; - fs::create_dir_all(&install_path).map_err(BinstallError::Io)?; - debug!("Using install path: {}", install_path.display()); + // Compute install directory + let (install_path, custom_install_path) = + install_path::get_install_path(install_path, Some(&cargo_roots)); + let install_path = install_path.ok_or_else(|| { + error!("No viable install path found of specified, try `--install-path`"); + miette!("No install path found or specified") + })?; + fs::create_dir_all(&install_path).map_err(BinstallError::Io)?; + debug!("Using install path: {}", install_path.display()); - // Load manifests - let manifests = if !custom_install_path { - Some(Manifests::open_exclusive(&cargo_roots)?) - } else { - None - }; + // Load manifests + let manifests = if !custom_install_path { + Some(Manifests::open_exclusive(&cargo_roots)?) + } else { + None + }; - // Create a temporary directory for downloads etc. - // - // Put all binaries to a temporary directory under `dst` first, catching - // some failure modes (e.g., out of space) before touching the existing - // binaries. This directory will get cleaned up via RAII. - let temp_dir = tempfile::Builder::new() - .prefix("cargo-binstall") - .tempdir_in(&install_path) - .map_err(BinstallError::from) - .wrap_err("Creating a temporary directory failed.")?; + // Create a temporary directory for downloads etc. + // + // Put all binaries to a temporary directory under `dst` first, catching + // some failure modes (e.g., out of space) before touching the existing + // binaries. This directory will get cleaned up via RAII. + let temp_dir = tempfile::Builder::new() + .prefix("cargo-binstall") + .tempdir_in(&install_path) + .map_err(BinstallError::from) + .wrap_err("Creating a temporary directory failed.")?; - Ok((install_path, manifests, temp_dir)) - }) + Ok((install_path, manifests, temp_dir)) } /// Return vec of (crate_name, current_version) diff --git a/crates/bin/src/main.rs b/crates/bin/src/main.rs index 721ba51f..49c90ad9 100644 --- a/crates/bin/src/main.rs +++ b/crates/bin/src/main.rs @@ -32,7 +32,7 @@ fn main() -> MainExit { let start = Instant::now(); - let result = run_tokio_main(entry::install_crates(args, jobserver_client)); + let result = run_tokio_main(|| entry::install_crates(args, jobserver_client)); let done = start.elapsed(); debug!("run time: {done:?}"); From ff5276f4f4adc66e862deef1a3e2f09de2621876 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 11 Mar 2023 19:17:50 +1300 Subject: [PATCH 1103/2020] Squash lint warning on windows (#881) Squash warning on windows --- crates/binstalk-downloader/src/download/zip_extraction.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index fad0f481..824088d4 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -52,6 +52,7 @@ where let outpath = path.join(&filename); // Get permissions + #[cfg_attr(not(unix), allow(unused_mut))] let mut perms = None; let is_dir = raw_filename.ends_with('/'); From 3e0d7363a50be55369012957a253478f71af7f9f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Mar 2023 18:10:40 +1100 Subject: [PATCH 1104/2020] Read from env `GH_TOKEN` for github_token as a fallback (#883) Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 8823cd12..ee9581bf 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -461,11 +461,15 @@ You cannot use --{option} and specify multiple packages at the same time. Do one .exit() } - if opts.github_token.is_none() && !opts.no_discover_github_token { - if let Some(github_token) = try_extract_from_git_credentials() { - opts.github_token = Some(github_token); - } else if let Ok(github_token) = gh_token::get() { + if opts.github_token.is_none() { + if let Ok(github_token) = env::var("GH_TOKEN") { opts.github_token = Some(github_token.into()); + } else if !opts.no_discover_github_token { + if let Some(github_token) = try_extract_from_git_credentials() { + opts.github_token = Some(github_token); + } else if let Ok(github_token) = gh_token::get() { + opts.github_token = Some(github_token.into()); + } } } From 00b8a417e64013c2d0202c8d36b9b00c6fcfea48 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Mar 2023 23:46:14 +1100 Subject: [PATCH 1105/2020] Update doc for `--github-token` (#886) --- crates/bin/src/args.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index ee9581bf..0122d87c 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -146,8 +146,8 @@ pub struct Args { #[clap(help_heading = "Overrides", long, value_delimiter(','))] pub disable_strategies: Vec, - /// If `--github-token` or environment variable `GITHUB_TOKEN` is not - /// specified, then cargo-binstall will try to extract github token from + /// If `--github-token` or environment variable `GITHUB_TOKEN`/`GH_TOKEN` + /// is not specified, then cargo-binstall will try to extract github token from /// `$HOME/.git-credentials` or `$HOME/.config/gh/hosts.yml` by default. /// /// This option can be used to disable that behavior. @@ -229,6 +229,14 @@ pub struct Args { pub json_output: bool, /// Provide the github token for accessing the restful API of api.github.com + /// + /// Fallback to environment variable `GITHUB_TOKEN` if this option is not + /// specified (which is also shown by clap's auto generated doc below), or + /// try environment variable `GH_TOKEN`, which is also used by `gh` cli. + /// + /// If none of them is present, then binstal will try to extract github + /// token from `$HOME/.git-credentials` or `$HOME/.config/gh/hosts.yml` + /// unless `--no-discover-github-token` is specified. #[clap(help_heading = "Options", long, env = "GITHUB_TOKEN")] pub github_token: Option, From 235d324d3d71b38f30547aab202db88e0ba9462e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Mar 2023 23:46:26 +1100 Subject: [PATCH 1106/2020] Add job windows-aarch64-check to workflow ci (#882) Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd0a8ad6..2370a3c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,6 +95,19 @@ jobs: - run: just check + windows-aarch64-check: + runs-on: windows-latest + env: + CARGO_BUILD_TARGET: aarch64-pc-windows-msvc + + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/just-setup + with: + cache-suffix: ${{ env.CARGO_BUILD_TARGET }} + + - run: just check + lint: strategy: fail-fast: false @@ -126,6 +139,7 @@ jobs: - linux-cross-check - apple-m1-check - lint + - windows-aarch64-check if: always() # always run even if dependencies fail runs-on: ubuntu-latest steps: From 45045041a481c3c9c260e4c4b8af955a1d907253 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 12 Mar 2023 08:18:34 +0000 Subject: [PATCH 1107/2020] release: binstalk-types v0.3.0 (#887) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cf789c49..1de856e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -236,7 +236,7 @@ dependencies = [ [[package]] name = "binstalk-types" -version = "0.2.1" +version = "0.3.0" dependencies = [ "compact_str", "maybe-owned", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index c7d31328..96b74c0a 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0" async-trait = "0.1.66" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.12", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } -binstalk-types = { version = "0.2.1", path = "../binstalk-types" } +binstalk-types = { version = "0.3.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" compact_str = "0.7.0" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 8db21c71..21d7b621 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] beef = { version = "0.5.2", features = ["impl_serde"] } -binstalk-types = { version = "0.2.1", path = "../binstalk-types" } +binstalk-types = { version = "0.3.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index a4877d19..6a3adf57 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-types" description = "The binstall toolkit that contains basic types for binstalk crates" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-types" -version = "0.2.1" +version = "0.3.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index c2aa601b..28e35c39 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.66" binstalk-downloader = { version = "0.3.3", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } -binstalk-types = { version = "0.2.1", path = "../binstalk-types" } +binstalk-types = { version = "0.3.0", path = "../binstalk-types" } cargo_toml = "0.15.2" command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } From 5b92b43a87ab78e50c16b4a148a1550e1ac36dfa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 12 Mar 2023 20:15:31 +1100 Subject: [PATCH 1108/2020] release: detect-targets v0.1.6 (#889) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1de856e3..fbd03d19 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -512,7 +512,7 @@ checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" [[package]] name = "detect-targets" -version = "0.1.5" +version = "0.1.6" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 21d7b621..7705d997 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -25,5 +25,5 @@ toml_edit = { version = "0.19.4", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.5", path = "../detect-targets" } +detect-targets = { version = "0.1.6", path = "../detect-targets" } tempfile = "3.4.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 28e35c39..3da955ec 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -16,7 +16,7 @@ binstalk-types = { version = "0.3.0", path = "../binstalk-types" } cargo_toml = "0.15.2" command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } -detect-targets = { version = "0.1.5", path = "../detect-targets" } +detect-targets = { version = "0.1.6", path = "../detect-targets" } either = "1.8.1" home = "0.5.4" itertools = "0.10.5" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 8632605e..9766dcf4 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.5" +version = "0.1.6" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From c188f85ec9eade2fc0b9dde645409a0adfa370fb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 12 Mar 2023 20:42:10 +1100 Subject: [PATCH 1109/2020] release: binstalk-manifests v0.4.0 (#888) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fbd03d19..d3bb451a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -215,7 +215,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.3.0" +version = "0.4.0" dependencies = [ "beef", "binstalk-types", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 234b53be..c9b4f18f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.8.0", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.3.0" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.4.0" } clap = { version = "4.1.8", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "4.0.0" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 7705d997..b9c42b1f 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.3.0" +version = "0.4.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From bb272347dab3586798c3e3dbc62e2142311dcbea Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 12 Mar 2023 22:14:18 +1100 Subject: [PATCH 1110/2020] release: binstalk-downloader v0.4.0 (#891) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d3bb451a..cb0082c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -182,7 +182,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.3.3" +version = "0.4.0" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 96b74c0a..e0d01af2 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.3.3" +version = "0.4.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 3da955ec..0f031f6e 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.66" -binstalk-downloader = { version = "0.3.3", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.4.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.3.0", path = "../binstalk-types" } cargo_toml = "0.15.2" command-group = { version = "2.1.0", features = ["with-tokio"] } From a7d8574c4a5cdf1a3f9c73aa7b604c77e85f80ea Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 12 Mar 2023 22:52:43 +1100 Subject: [PATCH 1111/2020] release: binstalk v0.9.0 (#892) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cb0082c0..2cf92f33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -150,7 +150,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.8.0" +version = "0.9.0" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index c9b4f18f..65319525 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.8.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.9.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.4.0" } clap = { version = "4.1.8", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 0f031f6e..1347e113 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.8.0" +version = "0.9.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From ba9fa170c06b94333d128f7d79f62b492f4c3089 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 12:29:51 +1300 Subject: [PATCH 1112/2020] release: cargo-binstall v0.21.0 (#893) Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2cf92f33..cbec5e74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -336,7 +336,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.20.1" +version = "0.21.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 65319525..9905df97 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.20.1" +version = "0.21.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 1a0c4132..b9039de6 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 45952446d62f7ac61e6ab0b5c5c7252048a5140f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 02:40:10 +0000 Subject: [PATCH 1113/2020] Bump serde from 1.0.154 to 1.0.155 (#894) --- Cargo.lock | 8 ++++---- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cbec5e74..9bc99c64 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1918,9 +1918,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.154" +version = "1.0.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cdd151213925e7f1ab45a9bbfb129316bd00799784b174b7cc7bcd16961c49e" +checksum = "71f2b4817415c6d4210bfe1c7bfcf4801b2d904cb4d0e1a8fdb651013c9e86b8" dependencies = [ "serde_derive", ] @@ -1936,9 +1936,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.154" +version = "1.0.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fc80d722935453bcafdc2c9a73cd6fac4dc1938f0346035d84bf99fa9e33217" +checksum = "d071a94a3fac4aff69d023a7f411e33f40f3483f8c5190b1953822b6b76d7630" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index e0d01af2..c749ca3f 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -23,7 +23,7 @@ futures-lite = { version = "1.12.0", default-features = false } generic-array = "0.14.6" httpdate = "1.0.2" reqwest = { version = "0.11.14", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } -serde = { version = "1.0.154", features = ["derive"], optional = true } +serde = { version = "1.0.155", features = ["derive"], optional = true } serde_json = { version = "1.0.94", optional = true } # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index b9c42b1f..acea5187 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -17,7 +17,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" miette = "5.5.0" semver = { version = "1.0.16", features = ["serde"] } -serde = { version = "1.0.154", features = ["derive"] } +serde = { version = "1.0.155", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.94" thiserror = "1.0.39" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 6a3adf57..fbfe065f 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -14,7 +14,7 @@ compact_str = { version = "0.7.0", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.17.1" semver = { version = "1.0.16", features = ["serde"] } -serde = { version = "1.0.154", features = ["derive"] } +serde = { version = "1.0.155", features = ["derive"] } strum = "0.24.1" strum_macros = "0.24.3" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 1347e113..42fd1dde 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ miette = "5.5.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.17.1" semver = { version = "1.0.16", features = ["serde"] } -serde = { version = "1.0.154", features = ["derive"] } +serde = { version = "1.0.155", features = ["derive"] } strum = "0.24.1" tempfile = "3.4.0" thiserror = "1.0.39" From f6056c89047afd2f5fe04b3a8be2c45554e5e026 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 02:55:32 +0000 Subject: [PATCH 1114/2020] Bump toml_edit from 0.19.4 to 0.19.5 (#896) --- Cargo.lock | 4 ++-- crates/binstalk-manifests/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9bc99c64..e94df5a4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2347,9 +2347,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.4" +version = "0.19.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1eb0622d28f4b9c90adc4ea4b2b46b47663fde9ac5fafcb14a1369d5508825" +checksum = "7082a95d48029677a28f181e5f6422d0c8339ad8396a39d3f33d62a90c1f6c30" dependencies = [ "indexmap", "serde", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index acea5187..522d7d11 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.155", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.94" thiserror = "1.0.39" -toml_edit = { version = "0.19.4", features = ["serde"] } +toml_edit = { version = "0.19.5", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] From fce7141bec8110091f8e75e93937f3eec590ac4a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 03:13:07 +0000 Subject: [PATCH 1115/2020] Bump semver from 1.0.16 to 1.0.17 (#895) --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e94df5a4..23e784c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1909,9 +1909,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" dependencies = [ "serde", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 9905df97..6d8a0e60 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -34,7 +34,7 @@ log = { version = "0.4.17", features = ["std"] } miette = "5.5.0" mimalloc = { version = "0.1.34", default-features = false, optional = true } once_cell = "1.17.1" -semver = "1.0.16" +semver = "1.0.17" strum = "0.24.1" strum_macros = "0.24.3" supports-color = "2.0.0" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 522d7d11..da62f4a9 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -16,7 +16,7 @@ compact_str = { version = "0.7.0", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" miette = "5.5.0" -semver = { version = "1.0.16", features = ["serde"] } +semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.155", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.94" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index fbfe065f..26045bae 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" compact_str = { version = "0.7.0", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.17.1" -semver = { version = "1.0.16", features = ["serde"] } +semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.155", features = ["derive"] } strum = "0.24.1" strum_macros = "0.24.3" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 42fd1dde..7d8c9f98 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -25,7 +25,7 @@ maybe-owned = "0.3.4" miette = "5.5.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.17.1" -semver = { version = "1.0.16", features = ["serde"] } +semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.155", features = ["derive"] } strum = "0.24.1" tempfile = "3.4.0" From b29234c93b3c3f35b16df0b42b7a478e9516e5c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Mon, 13 Mar 2023 16:40:36 +1300 Subject: [PATCH 1116/2020] Clarify git credential code and fix infinite loop bug (#898) Fixes #897 --- crates/bin/src/args.rs | 61 ++-------------------------- crates/bin/src/git_credentials.rs | 67 +++++++++++++++++++++++++++++++ crates/bin/src/lib.rs | 1 + 3 files changed, 71 insertions(+), 58 deletions(-) create mode 100644 crates/bin/src/git_credentials.rs diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 0122d87c..d234711b 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -1,7 +1,7 @@ use std::{ env, ffi::OsString, - fmt, fs, iter, + fmt, num::{NonZeroU64, ParseIntError}, path::PathBuf, str::FromStr, @@ -14,7 +14,7 @@ use binstalk::{ }; use clap::{error::ErrorKind, CommandFactory, Parser, ValueEnum}; use compact_str::CompactString; -use dirs::home_dir; + use log::LevelFilter; use semver::VersionReq; use strum::EnumCount; @@ -473,7 +473,7 @@ You cannot use --{option} and specify multiple packages at the same time. Do one if let Ok(github_token) = env::var("GH_TOKEN") { opts.github_token = Some(github_token.into()); } else if !opts.no_discover_github_token { - if let Some(github_token) = try_extract_from_git_credentials() { + if let Some(github_token) = crate::git_credentials::try_from_home() { opts.github_token = Some(github_token); } else if let Ok(github_token) = gh_token::get() { opts.github_token = Some(github_token.into()); @@ -484,41 +484,6 @@ You cannot use --{option} and specify multiple packages at the same time. Do one opts } -fn try_extract_from_git_credentials() -> Option { - home_dir() - .map(|mut home| { - home.push(".git-credentials"); - home - }) - .into_iter() - .chain(iter::from_fn(|| { - let home = env::var_os("XDG_CONFIG_HOME")?; - (!home.is_empty()).then(|| { - let mut path = PathBuf::from(home); - path.push("git/credentials"); - path - }) - })) - .find_map(try_extract_from_git_credentials_from) -} - -fn try_extract_from_git_credentials_from(path: PathBuf) -> Option { - fs::read_to_string(path) - .ok()? - .lines() - .find_map(extract_github_token_from_git_credentials_line) - .map(CompactString::from) -} - -fn extract_github_token_from_git_credentials_line(line: &str) -> Option<&str> { - let cred = line - .trim() - .strip_prefix("https://")? - .strip_suffix("@github.com")?; - - Some(cred.split_once(':')?.1) -} - #[cfg(test)] mod test { use super::*; @@ -527,24 +492,4 @@ mod test { fn verify_cli() { Args::command().debug_assert() } - - const GIT_CREDENTIALS_TEST_CASES: &[(&str, Option<&str>)] = &[ - // Success - ("https://NobodyXu:gho_asdc@github.com", Some("gho_asdc")), - ( - "https://NobodyXu:gho_asdc12dz@github.com", - Some("gho_asdc12dz"), - ), - // Failure - ("http://NobodyXu:gho_asdc@github.com", None), - ("https://NobodyXu:gho_asdc@gitlab.com", None), - ("https://NobodyXugho_asdc@github.com", None), - ]; - - #[test] - fn test_extract_github_token_from_git_credentials_line() { - GIT_CREDENTIALS_TEST_CASES.iter().for_each(|(line, res)| { - assert_eq!(extract_github_token_from_git_credentials_line(line), *res); - }) - } } diff --git a/crates/bin/src/git_credentials.rs b/crates/bin/src/git_credentials.rs new file mode 100644 index 00000000..7accd935 --- /dev/null +++ b/crates/bin/src/git_credentials.rs @@ -0,0 +1,67 @@ +use std::{ + env, fs, + path::{Path, PathBuf}, +}; + +use compact_str::CompactString; +use dirs::home_dir; + +pub fn try_from_home() -> Option { + if let Some(mut home) = home_dir() { + home.push(".git-credentials"); + if let Some(cred) = from_file(home) { + return Some(cred); + } + } + + if let Some(home) = env::var_os("XDG_CONFIG_HOME") { + let home = Path::new(&home).join("git/credentials"); + if let Some(cred) = from_file(home) { + return Some(cred); + } + } + + None +} + +fn from_file(path: PathBuf) -> Option { + fs::read_to_string(path) + .ok()? + .lines() + .find_map(from_line) + .map(CompactString::from) +} + +fn from_line(line: &str) -> Option<&str> { + let cred = line + .trim() + .strip_prefix("https://")? + .strip_suffix("@github.com")?; + + Some(cred.split_once(':')?.1) +} + +#[cfg(test)] +mod test { + use super::*; + + const GIT_CREDENTIALS_TEST_CASES: &[(&str, Option<&str>)] = &[ + // Success + ("https://NobodyXu:gho_asdc@github.com", Some("gho_asdc")), + ( + "https://NobodyXu:gho_asdc12dz@github.com", + Some("gho_asdc12dz"), + ), + // Failure + ("http://NobodyXu:gho_asdc@github.com", None), + ("https://NobodyXu:gho_asdc@gitlab.com", None), + ("https://NobodyXugho_asdc@github.com", None), + ]; + + #[test] + fn test_extract_from_line() { + GIT_CREDENTIALS_TEST_CASES.iter().for_each(|(line, res)| { + assert_eq!(from_line(line), *res); + }) + } +} diff --git a/crates/bin/src/lib.rs b/crates/bin/src/lib.rs index c1c70c59..57299fe9 100644 --- a/crates/bin/src/lib.rs +++ b/crates/bin/src/lib.rs @@ -1,6 +1,7 @@ pub mod args; pub mod bin_util; pub mod entry; +pub mod git_credentials; pub mod install_path; pub mod logging; pub mod manifests; From 5f1d5ce5592c96aaf6cde01cb8855691877adb64 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 15:11:10 +1100 Subject: [PATCH 1117/2020] release: cargo-binstall v0.21.1 (#899) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 23e784c2..0d60ea93 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -336,7 +336,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.21.0" +version = "0.21.1" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 6d8a0e60..d73c06e0 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.21.0" +version = "0.21.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index b9039de6..f362c50a 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From e89b8e246386686275ce148f72f08f9d34a52530 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Mon, 13 Mar 2023 18:11:29 +1300 Subject: [PATCH 1118/2020] Use known-working versions for tests (#900) --- e2e-tests/live.sh | 2 +- e2e-tests/self-upgrade-no-symlink.sh | 8 ++++---- e2e-tests/strategies.sh | 6 +++--- e2e-tests/tls.sh | 2 +- e2e-tests/uninstall.sh | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/e2e-tests/live.sh b/e2e-tests/live.sh index fd9107fe..0361f7c4 100755 --- a/e2e-tests/live.sh +++ b/e2e-tests/live.sh @@ -4,7 +4,7 @@ set -euxo pipefail unset CARGO_INSTALL_ROOT -crates="b3sum cargo-release cargo-binstall cargo-watch miniserve sccache" +crates="b3sum@1.3.3 cargo-release@0.24.5 cargo-binstall@0.20.1 cargo-watch@8.4.0 miniserve@0.23.0 sccache@0.3.3" export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') othertmpdir=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-test') diff --git a/e2e-tests/self-upgrade-no-symlink.sh b/e2e-tests/self-upgrade-no-symlink.sh index 66c61ee8..3521c6a3 100644 --- a/e2e-tests/self-upgrade-no-symlink.sh +++ b/e2e-tests/self-upgrade-no-symlink.sh @@ -14,19 +14,19 @@ cp "./$1" "$CARGO_HOME/bin" # now we're running the CARGO_HOME/bin/cargo-binstall (via cargo): # self update replacing no-symlinks with no-symlinks -cargo binstall --no-confirm --no-symlinks --force cargo-binstall +cargo binstall --no-confirm --no-symlinks --force cargo-binstall@0.20.1 # self update replacing no-symlinks with symlinks cp "./$1" "$CARGO_HOME/bin" -cargo binstall --no-confirm --force cargo-binstall +cargo binstall --no-confirm --force cargo-binstall@0.20.1 # self update replacing symlinks with symlinks ln -snf "$(pwd)/cargo-binstall" "$CARGO_HOME/bin/cargo-binstall" -cargo binstall --no-confirm --force cargo-binstall +cargo binstall --no-confirm --force cargo-binstall@0.20.1 # self update replacing symlinks with no-symlinks ln -snf "$(pwd)/cargo-binstall" "$CARGO_HOME/bin/cargo-binstall" -cargo binstall --no-confirm --force --no-symlinks cargo-binstall +cargo binstall --no-confirm --force --no-symlinks cargo-binstall@0.20.1 diff --git a/e2e-tests/strategies.sh b/e2e-tests/strategies.sh index 649dfec7..c992757f 100755 --- a/e2e-tests/strategies.sh +++ b/e2e-tests/strategies.sh @@ -8,7 +8,7 @@ export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') export PATH="$CARGO_HOME/bin:$PATH" ## Test --disable-strategies -"./$1" binstall --no-confirm --disable-strategies quick-install,compile cargo-update +"./$1" binstall --no-confirm --disable-strategies quick-install,compile cargo-update@11.1.2 exit_code="$?" if [ "$exit_code" != 94 ]; then @@ -17,7 +17,7 @@ if [ "$exit_code" != 94 ]; then fi ## Test --strategies -"./$1" binstall --no-confirm --strategies crate-meta-data cargo-update +"./$1" binstall --no-confirm --strategies crate-meta-data cargo-update@11.1.2 exit_code="$?" if [ "$exit_code" != 94 ]; then @@ -26,4 +26,4 @@ if [ "$exit_code" != 94 ]; then fi ## Test compile-only strategy -"./$1" binstall --no-confirm --strategies compile cargo-quickinstall +"./$1" binstall --no-confirm --strategies compile cargo-quickinstall@0.2.8 diff --git a/e2e-tests/tls.sh b/e2e-tests/tls.sh index e603e197..f891fb0f 100755 --- a/e2e-tests/tls.sh +++ b/e2e-tests/tls.sh @@ -11,6 +11,6 @@ export PATH="$CARGO_HOME/bin:$PATH" --force \ --min-tls-version "${2:-1.3}" \ --no-confirm \ - cargo-binstall + cargo-binstall@0.20.1 # Test that the installed binaries can be run cargo binstall --help >/dev/null diff --git a/e2e-tests/uninstall.sh b/e2e-tests/uninstall.sh index 8f1cb8ca..ff4c78e1 100644 --- a/e2e-tests/uninstall.sh +++ b/e2e-tests/uninstall.sh @@ -13,5 +13,5 @@ mkdir -p "$othertmpdir/bin" cp "./$1" "$othertmpdir/bin/" -cargo binstall --no-confirm cargo-watch +cargo binstall --no-confirm cargo-watch@8.4.0 cargo uninstall cargo-watch From 89a47cbec975acae0fd53625cae7251e57c268b4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 13 Mar 2023 21:27:50 +1100 Subject: [PATCH 1119/2020] Fix `extract_tar_based_stream`: Normalize path before adding them to `ExtractedFiles` (#901) Signed-off-by: Jiahao XU --- .../src/download/async_extracter.rs | 23 +++++++++++++++++-- crates/binstalk/src/ops/resolve.rs | 2 ++ 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/crates/binstalk-downloader/src/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs index 6c6b6905..c04675a2 100644 --- a/crates/binstalk-downloader/src/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -3,7 +3,7 @@ use std::{ fs, future::Future, io::{self, Write}, - path::Path, + path::{Component, Path, PathBuf}, }; use async_zip::read::stream::ZipFileReader; @@ -110,7 +110,26 @@ where // unpack_in returns false if the path contains ".." // and is skipped. if entry.unpack_in(dst)? { - extracted_files.add_file(&entry.path()?); + let path = entry.path()?; + + // create normalized_path in the same way + // tar::Entry::unpack_in would normalize the path. + let mut normalized_path = PathBuf::new(); + + for part in path.components() { + match part { + Component::Prefix(..) | Component::RootDir | Component::CurDir => { + continue + } + + // unpack_in would return false if this happens. + Component::ParentDir => unreachable!(), + + Component::Normal(part) => normalized_path.push(part), + } + } + + extracted_files.add_file(&normalized_path); } } tar::EntryType::Directory => { diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 3cb20d95..8b378902 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -202,6 +202,8 @@ async fn download_extract_and_verify( // If that fails, then ignore this fetcher. let extracted_files = fetcher.fetch_and_extract(bin_path).await?; + debug!("extracted_files = {extracted_files:#?}"); + // Build final metadata let meta = fetcher.target_meta(); From 5e4e04749300066efb3d8d39b01881080efe311c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 10:41:06 +0000 Subject: [PATCH 1120/2020] release: binstalk-downloader v0.4.1 (#902) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d60ea93..126974d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -182,7 +182,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.4.0" +version = "0.4.1" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index c749ca3f..ed664b24 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.4.0" +version = "0.4.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 7d8c9f98..2d998c2c 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.66" -binstalk-downloader = { version = "0.4.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.4.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.3.0", path = "../binstalk-types" } cargo_toml = "0.15.2" command-group = { version = "2.1.0", features = ["with-tokio"] } From 57182fae70f595b6305d344cb8193ac52e144774 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 13 Mar 2023 23:01:05 +1100 Subject: [PATCH 1121/2020] release: binstalk v0.9.1 (#903) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 126974d3..2bfe0c8d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -150,7 +150,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.9.0" +version = "0.9.1" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index d73c06e0..c6db1671 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.9.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.9.1", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.4.0" } clap = { version = "4.1.8", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 2d998c2c..1487b7c4 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.9.0" +version = "0.9.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From 9e3223acf8fbaf70cb1eb85f0dc9b430439e028d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 00:14:19 +1100 Subject: [PATCH 1122/2020] release: cargo-binstall v0.21.2 (#904) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2bfe0c8d..87c716b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -336,7 +336,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.21.1" +version = "0.21.2" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index c6db1671..b77576a5 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.21.1" +version = "0.21.2" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index f362c50a..51592998 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 6df38f1f111fe3887e331c9a07d5081b85f310dd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 02:32:36 +0000 Subject: [PATCH 1123/2020] Bump windows from 0.44.0 to 0.46.0 (#905) --- Cargo.lock | 36 ++++++++++++++++++------------------ crates/binstalk/Cargo.toml | 2 +- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 87c716b1..3a1561f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2792,9 +2792,9 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.44.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25" dependencies = [ "windows-targets", ] @@ -2825,9 +2825,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e2522491fbfcd58cc84d47aeb2958948c4b8982e9a2d8a2a35bbaed431390e7" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ "windows_aarch64_gnullvm", "windows_aarch64_msvc", @@ -2840,45 +2840,45 @@ dependencies = [ [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_i686_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_x86_64_gnu" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_msvc" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "winnow" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 1487b7c4..64f9a08d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -38,7 +38,7 @@ url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" [target.'cfg(target_os = "windows")'.dependencies] -windows = { version = "0.44.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } +windows = { version = "0.46.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } [features] default = ["static", "rustls"] From f37796a55f52bac9e5f4f8527881f91047031362 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 02:38:54 +0000 Subject: [PATCH 1124/2020] Bump toml_edit from 0.19.5 to 0.19.6 (#906) --- Cargo.lock | 4 ++-- crates/binstalk-manifests/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3a1561f9..569ebb0d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2347,9 +2347,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.5" +version = "0.19.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7082a95d48029677a28f181e5f6422d0c8339ad8396a39d3f33d62a90c1f6c30" +checksum = "08de71aa0d6e348f070457f85af8bd566e2bc452156a423ddf22861b3a953fae" dependencies = [ "indexmap", "serde", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index da62f4a9..36d8338c 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.155", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.94" thiserror = "1.0.39" -toml_edit = { version = "0.19.5", features = ["serde"] } +toml_edit = { version = "0.19.6", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] From d118fa8fdb68c96eeb3493542b1d99efa2008dcf Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 14 Mar 2023 17:11:22 +1100 Subject: [PATCH 1125/2020] Obey crates.io crawler policy: Only make one request per sec (#908) Fixed https://github.com/taiki-e/install-action/issues/89 Signed-off-by: Jiahao XU --- crates/bin/src/entry.rs | 1 + crates/binstalk/src/drivers/crates_io.rs | 5 ++++ crates/binstalk/src/ops.rs | 32 ++++++++++++++++++++++++ crates/binstalk/src/ops/resolve.rs | 10 +++++++- 4 files changed, 47 insertions(+), 1 deletion(-) diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index ccc2d953..1eb7b61b 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -117,6 +117,7 @@ pub fn install_crates( client, gh_api_client, jobserver_client, + crates_io_rate_limit: Default::default(), }); // Destruct args before any async function to reduce size of the future diff --git a/crates/binstalk/src/drivers/crates_io.rs b/crates/binstalk/src/drivers/crates_io.rs index b758d7c3..28816597 100644 --- a/crates/binstalk/src/drivers/crates_io.rs +++ b/crates/binstalk/src/drivers/crates_io.rs @@ -13,6 +13,7 @@ use crate::{ remote::{Client, Url}, }, manifests::cargo_toml_binstall::{Meta, TarBasedFmt}, + ops::CratesIoRateLimit, }; mod vfs; @@ -48,7 +49,11 @@ pub async fn fetch_crate_cratesio( client: Client, name: &str, version_req: &VersionReq, + crates_io_rate_limit: &CratesIoRateLimit, ) -> Result, BinstallError> { + // Wait until we can make another request to crates.io + crates_io_rate_limit.tick().await; + // Fetch / update index debug!("Looking up crate information"); diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index 42f2eec3..67b33a38 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -3,6 +3,10 @@ use std::{path::PathBuf, sync::Arc}; use semver::VersionReq; +use tokio::{ + sync::Mutex, + time::{interval, Duration, Interval, MissedTickBehavior}, +}; use crate::{ fetchers::{Data, Fetcher, TargetData}, @@ -37,4 +41,32 @@ pub struct Options { pub client: Client, pub gh_api_client: GhApiClient, pub jobserver_client: LazyJobserverClient, + pub crates_io_rate_limit: CratesIoRateLimit, +} + +pub struct CratesIoRateLimit(Mutex); + +impl Default for CratesIoRateLimit { + fn default() -> Self { + let mut interval = interval(Duration::from_secs(1)); + // If somehow one tick is delayed, then next tick should be at least + // 1s later than the current tick. + // + // Other MissedTickBehavior including Burst (default), which will + // tick as fast as possible to catch up, and Skip, which will + // skip the current tick for the next one. + // + // Both Burst and Skip is not the expected behavior for rate limit: + // ticking as fast as possible would violate crates.io crawler + // policy, and skipping the current one will slow down the resolution + // process. + interval.set_missed_tick_behavior(MissedTickBehavior::Delay); + Self(Mutex::new(interval)) + } +} + +impl CratesIoRateLimit { + pub(super) async fn tick(&self) { + self.0.lock().await.tick().await; + } } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 8b378902..8255be87 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -354,7 +354,15 @@ impl PackageInfo { // Fetch crate via crates.io, git, or use a local manifest path let manifest = match opts.manifest_path.as_ref() { Some(manifest_path) => load_manifest_path(manifest_path)?, - None => Box::pin(fetch_crate_cratesio(client, &name, version_req)).await?, + None => { + Box::pin(fetch_crate_cratesio( + client, + &name, + version_req, + &opts.crates_io_rate_limit, + )) + .await? + } }; let Some(mut package) = manifest.package else { From 63443e88b1008c0d12c7361354032ae4c5d60f7c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 18:31:20 +1100 Subject: [PATCH 1126/2020] release: binstalk v0.10.0 (#909) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 569ebb0d..5a0161fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -150,7 +150,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.9.1" +version = "0.10.0" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index b77576a5..67dcc898 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.9.1", default-features = false } +binstalk = { path = "../binstalk", version = "0.10.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.4.0" } clap = { version = "4.1.8", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 64f9a08d..cc2cac2a 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.9.1" +version = "0.10.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From c04b15dbc8c686ca2117744a695c1afbe81b8479 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 14 Mar 2023 19:30:56 +1100 Subject: [PATCH 1127/2020] release: cargo-binstall v0.21.3 (#910) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a0161fb..350fd824 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -336,7 +336,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.21.2" +version = "0.21.3" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 67dcc898..1768b956 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.21.2" +version = "0.21.3" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 51592998..11939830 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 42bffef98c47e2d8c44a8e1912584da96a129ce2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 15 Mar 2023 15:42:42 +1100 Subject: [PATCH 1128/2020] Use sccache for build cache and disable incremental mode in CI (#914) Fixed #911 sccache cannot cache build artifacts if incremental mode is enabled. Signed-off-by: Jiahao XU --- .github/actions/just-setup/action.yml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/.github/actions/just-setup/action.yml b/.github/actions/just-setup/action.yml index 078f46df..0d1405be 100644 --- a/.github/actions/just-setup/action.yml +++ b/.github/actions/just-setup/action.yml @@ -54,9 +54,15 @@ runs: shell: bash - if: inputs.buildcache - name: Configure build cache - uses: actions/cache@v3 + name: Configure sccache + uses: mozilla-actions/sccache-action@v0.0.2 with: - path: | - target/ - key: ${{ runner.os }}-cargo-build-${{ hashFiles('rustc-version') }}-${{ hashFiles('**/Cargo.lock') }}-${{ inputs.cache-suffix }} + version: "v0.4.0-pre.10" + + - if: inputs.buildcache + name: Export env for sccache to work + shell: bash + run: | + echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV + echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV + echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV From 48b85cc38f9fa6ad50c84139d41695fd1d92dadd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Wed, 15 Mar 2023 17:44:06 +1300 Subject: [PATCH 1129/2020] Cleanup caches for closed PRs (#915) As suggested here: https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#managing-caches --- .github/workflows/cache-cleanup.yml | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/cache-cleanup.yml diff --git a/.github/workflows/cache-cleanup.yml b/.github/workflows/cache-cleanup.yml new file mode 100644 index 00000000..23de39f3 --- /dev/null +++ b/.github/workflows/cache-cleanup.yml @@ -0,0 +1,31 @@ +name: Cleanup caches for closed PRs +on: + pull_request: + types: + - closed + +jobs: + cleanup: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Cleanup + run: | + gh extension install actions/gh-actions-cache + + REPO=${{ github.repository }} + BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge" + + echo "Fetching list of cache key" + cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 ) + + ## Setting this to not fail the workflow while deleting cache keys. + set +e + echo "Deleting caches..." + for cacheKey in $cacheKeysForPR + do + gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm + done + echo "Done" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} From ca7b489663eb7a9fa5df0214697bb14df800ea56 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Mar 2023 15:56:07 +1100 Subject: [PATCH 1130/2020] Bump miette from 5.5.0 to 5.6.0 (#913) Bumps [miette](https://github.com/zkat/miette) from 5.5.0 to 5.6.0. - [Release notes](https://github.com/zkat/miette/releases) - [Changelog](https://github.com/zkat/miette/blob/main/CHANGELOG.md) - [Commits](https://github.com/zkat/miette/compare/miette-derive-v5.5.0...miette-derive-v5.6.0) --- updated-dependencies: - dependency-name: miette dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 56 +++++++--------------------- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 16 insertions(+), 46 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 350fd824..4bab21ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,17 +95,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -354,7 +343,7 @@ dependencies = [ "semver", "strum", "strum_macros", - "supports-color 2.0.0", + "supports-color", "tempfile", "tokio", "tracing", @@ -868,15 +857,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.2.6" @@ -1253,16 +1233,16 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "miette" -version = "5.5.0" +version = "5.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd9b301defa984bbdbe112b4763e093ed191750a0d914a78c1106b2d0fe703" +checksum = "07749fb52853e739208049fb513287c6f448de9103dfa78b05ae01f2fc5809bb" dependencies = [ - "atty", "backtrace", + "is-terminal", "miette-derive", "once_cell", "owo-colors", - "supports-color 1.3.1", + "supports-color", "supports-hyperlinks", "supports-unicode", "terminal_size", @@ -1273,9 +1253,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.5.0" +version = "5.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97c2401ab7ac5282ca5c8b518a87635b1a93762b0b90b9990c509888eeccba29" +checksum = "2a07ad93a80d1b92bb44cb42d7c49b49c9aab1778befefad49cceb5e4c5bf460" dependencies = [ "proc-macro2", "quote", @@ -2076,16 +2056,6 @@ dependencies = [ "syn", ] -[[package]] -name = "supports-color" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ba6faf2ca7ee42fdd458f4347ae0a9bd6bcc445ad7cb57ad82b383f18870d6f" -dependencies = [ - "atty", - "is_ci", -] - [[package]] name = "supports-color" version = "2.0.0" @@ -2098,20 +2068,20 @@ dependencies = [ [[package]] name = "supports-hyperlinks" -version = "1.2.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "590b34f7c5f01ecc9d78dba4b3f445f31df750a67621cf31626f3b7441ce6406" +checksum = "4b4806e0b03b9906e76b018a5d821ebf198c8e9dc0829ed3328eeeb5094aed60" dependencies = [ - "atty", + "is-terminal", ] [[package]] name = "supports-unicode" -version = "1.0.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8b945e45b417b125a8ec51f1b7df2f8df7920367700d1f98aedd21e5735f8b2" +checksum = "4b6c2cb240ab5dd21ed4906895ee23fe5a48acdbd15a3ce388e7b62a9b66baf7" dependencies = [ - "atty", + "is-terminal", ] [[package]] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 1768b956..aa26b5c3 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -31,7 +31,7 @@ file-format = { version = "0.15.0", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } gh-token = "0.1.1" log = { version = "0.4.17", features = ["std"] } -miette = "5.5.0" +miette = "5.6.0" mimalloc = { version = "0.1.34", default-features = false, optional = true } once_cell = "1.17.1" semver = "1.0.17" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 36d8338c..0e462389 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -15,7 +15,7 @@ binstalk-types = { version = "0.3.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" -miette = "5.5.0" +miette = "5.6.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.155", features = ["derive"] } serde-tuple-vec-map = "1.0.1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index cc2cac2a..5af6ee5d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -22,7 +22,7 @@ home = "0.5.4" itertools = "0.10.5" jobslot = { version = "0.2.10", features = ["tokio"] } maybe-owned = "0.3.4" -miette = "5.5.0" +miette = "5.6.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.17.1" semver = { version = "1.0.17", features = ["serde"] } From 3e830c9fad24b845fade26ae18f82d1f0856e934 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 15 Mar 2023 15:56:30 +1100 Subject: [PATCH 1131/2020] Bump serde from 1.0.155 to 1.0.156 (#912) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.155 to 1.0.156. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.155...v1.0.156) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4bab21ef..cee041d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1898,9 +1898,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.155" +version = "1.0.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71f2b4817415c6d4210bfe1c7bfcf4801b2d904cb4d0e1a8fdb651013c9e86b8" +checksum = "314b5b092c0ade17c00142951e50ced110ec27cea304b1037c6969246c2469a4" dependencies = [ "serde_derive", ] @@ -1916,9 +1916,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.155" +version = "1.0.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d071a94a3fac4aff69d023a7f411e33f40f3483f8c5190b1953822b6b76d7630" +checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index ed664b24..60f8adbf 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -23,7 +23,7 @@ futures-lite = { version = "1.12.0", default-features = false } generic-array = "0.14.6" httpdate = "1.0.2" reqwest = { version = "0.11.14", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } -serde = { version = "1.0.155", features = ["derive"], optional = true } +serde = { version = "1.0.156", features = ["derive"], optional = true } serde_json = { version = "1.0.94", optional = true } # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 0e462389..58469c63 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -17,7 +17,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" miette = "5.6.0" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.155", features = ["derive"] } +serde = { version = "1.0.156", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.94" thiserror = "1.0.39" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 26045bae..e89eaee9 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -14,7 +14,7 @@ compact_str = { version = "0.7.0", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.17.1" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.155", features = ["derive"] } +serde = { version = "1.0.156", features = ["derive"] } strum = "0.24.1" strum_macros = "0.24.3" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 5af6ee5d..30b18578 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ miette = "5.6.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.17.1" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.155", features = ["derive"] } +serde = { version = "1.0.156", features = ["derive"] } strum = "0.24.1" tempfile = "3.4.0" thiserror = "1.0.39" From 58b7044e98f5b4c6ae3bf2f766116b845e6e580a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 16 Mar 2023 11:53:12 +1100 Subject: [PATCH 1132/2020] Use `install.root` in `$CARGO_HOME/config.toml` (#884) Fixed #859 * Impl `cargo_config` * Use `install.root` in `$CARGO_HOME/.cargo/config.toml` before fallback to `cargo_home`. * Improve logging in `get_cargo_roots_path` Signed-off-by: Jiahao XU --- crates/bin/src/install_path.rs | 30 ++-- crates/binstalk-manifests/src/cargo_config.rs | 161 ++++++++++++++++++ crates/binstalk-manifests/src/lib.rs | 1 + 3 files changed, 182 insertions(+), 10 deletions(-) create mode 100644 crates/binstalk-manifests/src/cargo_config.rs diff --git a/crates/bin/src/install_path.rs b/crates/bin/src/install_path.rs index 71da8317..f37313fc 100644 --- a/crates/bin/src/install_path.rs +++ b/crates/bin/src/install_path.rs @@ -4,23 +4,33 @@ use std::{ }; use binstalk::home::cargo_home; +use binstalk_manifests::cargo_config::Config; use tracing::debug; pub fn get_cargo_roots_path(cargo_roots: Option) -> Option { if let Some(p) = cargo_roots { - return Some(p); - } - - // Environmental variables - if let Some(p) = var_os("CARGO_INSTALL_ROOT") { + Some(p) + } else if let Some(p) = var_os("CARGO_INSTALL_ROOT") { + // Environmental variables let p = PathBuf::from(p); debug!("using CARGO_INSTALL_ROOT ({})", p.display()); - return Some(p); - } - - if let Ok(p) = cargo_home() { - debug!("using ({}) as cargo home", p.display()); Some(p) + } else if let Ok(cargo_home) = cargo_home() { + let config_path = cargo_home.join("config.toml"); + if let Some(root) = Config::load_from_path(&config_path) + .ok() + .and_then(|config| config.install.root) + { + debug!( + "using `install.root` {} from config {}", + root.display(), + config_path.display() + ); + Some(root) + } else { + debug!("using ({}) as cargo home", cargo_home.display()); + Some(cargo_home) + } } else { None } diff --git a/crates/binstalk-manifests/src/cargo_config.rs b/crates/binstalk-manifests/src/cargo_config.rs new file mode 100644 index 00000000..f84b1887 --- /dev/null +++ b/crates/binstalk-manifests/src/cargo_config.rs @@ -0,0 +1,161 @@ +//! Cargo's `.cargo/config.toml` +//! +//! This manifest is used by Cargo to load configurations stored by users. +//! +//! Binstall reads from them to be compatible with `cargo-install`'s behavior. + +use std::{ + fs::File, + io, + path::{Path, PathBuf}, +}; + +use compact_str::CompactString; +use fs_lock::FileLock; +use home::cargo_home; +use miette::Diagnostic; +use serde::Deserialize; +use thiserror::Error; + +#[derive(Debug, Default, Deserialize)] +pub struct Install { + /// `cargo install` destination directory + pub root: Option, +} + +#[derive(Debug, Default, Deserialize)] +pub struct Http { + /// HTTP proxy in libcurl format: "host:port" + pub proxy: Option, + /// timeout for each HTTP request, in seconds + pub timeout: Option, + /// path to Certificate Authority (CA) bundle + pub cainfo: Option, + // TODO: + // Support field ssl-version, ssl-version.max, ssl-version.min, + // which needs `toml_edit::Item`. +} + +#[derive(Debug, Default, Deserialize)] +pub struct Config { + pub install: Install, + pub http: Http, + // TODO: + // Add support for section patch, source and registry for alternative + // crates.io registry. + + // TODO: + // Add field env for specifying env vars + // which needs `toml_edit::Item`. +} + +fn join_if_relative(path: &mut Option, dir: &Path) { + match path { + Some(path) if path.is_relative() => *path = dir.join(&path), + _ => (), + } +} + +impl Config { + pub fn default_path() -> Result { + Ok(cargo_home()?.join("config.toml")) + } + + pub fn load() -> Result { + Self::load_from_path(Self::default_path()?) + } + + /// * `dir` - path to the dir where the config.toml is located. + /// For relative path in the config, `Config::load_from_reader` + /// will join the `dir` and the relative path to form the final + /// path. + pub fn load_from_reader( + mut reader: R, + dir: &Path, + ) -> Result { + fn inner(reader: &mut dyn io::Read, dir: &Path) -> Result { + let mut vec = Vec::new(); + reader.read_to_end(&mut vec)?; + + if vec.is_empty() { + Ok(Default::default()) + } else { + let mut config: Config = toml_edit::de::from_slice(&vec)?; + join_if_relative(&mut config.install.root, dir); + join_if_relative(&mut config.http.cainfo, dir); + Ok(config) + } + } + + inner(&mut reader, dir) + } + + pub fn load_from_path(path: impl AsRef) -> Result { + let path = path.as_ref(); + let file = FileLock::new_shared(File::open(path)?)?; + // Any regular file must have a parent dir + Self::load_from_reader(file, path.parent().unwrap()) + } +} + +#[derive(Debug, Diagnostic, Error)] +#[non_exhaustive] +pub enum ConfigLoadError { + #[error("I/O Error: {0}")] + Io(#[from] io::Error), + + #[error("Failed to deserialize toml: {0}")] + TomlParse(Box), +} + +impl From for ConfigLoadError { + fn from(e: toml_edit::de::Error) -> Self { + ConfigLoadError::TomlParse(Box::new(e)) + } +} + +#[cfg(test)] +mod tests { + use super::*; + + use std::io::Cursor; + + const CONFIG: &str = r#" +[env] +# Set ENV_VAR_NAME=value for any process run by Cargo +ENV_VAR_NAME = "value" +# Set even if already present in environment +ENV_VAR_NAME_2 = { value = "value", force = true } +# Value is relative to .cargo directory containing `config.toml`, make absolute +ENV_VAR_NAME_3 = { value = "relative/path", relative = true } + +[http] +debug = false # HTTP debugging +proxy = "host:port" # HTTP proxy in libcurl format +timeout = 30 # timeout for each HTTP request, in seconds +cainfo = "cert.pem" # path to Certificate Authority (CA) bundle + +[install] +root = "/some/path" # `cargo install` destination directory + "#; + + #[test] + fn test_loading() { + let config = Config::load_from_reader(Cursor::new(&CONFIG), Path::new("/root")).unwrap(); + + assert_eq!( + config.install.root.as_deref().unwrap(), + Path::new("/some/path") + ); + assert_eq!( + config.http.proxy, + Some(CompactString::new_inline("host:port")) + ); + + assert_eq!(config.http.timeout, Some(30)); + assert_eq!( + config.http.cainfo.as_deref().unwrap(), + Path::new("/root/cert.pem") + ); + } +} diff --git a/crates/binstalk-manifests/src/lib.rs b/crates/binstalk-manifests/src/lib.rs index 418764f6..f3befa80 100644 --- a/crates/binstalk-manifests/src/lib.rs +++ b/crates/binstalk-manifests/src/lib.rs @@ -11,6 +11,7 @@ mod helpers; pub mod binstall_crates_v1; +pub mod cargo_config; pub mod cargo_crates_v1; pub use binstalk_types::{cargo_toml_binstall, crate_info}; From 2c19c3afd43279e969b521a2134bfb676d842114 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 16 Mar 2023 13:56:23 +1100 Subject: [PATCH 1133/2020] Bump toml_edit from 0.19.6 to 0.19.7 (#916) Bumps [toml_edit](https://github.com/ordian/toml_edit) from 0.19.6 to 0.19.7. - [Release notes](https://github.com/ordian/toml_edit/releases) - [Commits](https://github.com/ordian/toml_edit/compare/v0.19.6...v0.19.7) --- updated-dependencies: - dependency-name: toml_edit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-manifests/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cee041d1..798aa29a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2317,9 +2317,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.6" +version = "0.19.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08de71aa0d6e348f070457f85af8bd566e2bc452156a423ddf22861b3a953fae" +checksum = "dc18466501acd8ac6a3f615dd29a3438f8ca6bb3b19537138b3106e575621274" dependencies = [ "indexmap", "serde", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 58469c63..e87f13fb 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.156", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.94" thiserror = "1.0.39" -toml_edit = { version = "0.19.6", features = ["serde"] } +toml_edit = { version = "0.19.7", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] From 6843f478a924b2e9268b0ee8f3e03486baace9b9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Mar 2023 02:25:23 +0000 Subject: [PATCH 1134/2020] Bump clap from 4.1.8 to 4.1.9 (#917) --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 798aa29a..e438832b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -388,9 +388,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.1.8" +version = "4.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d7ae14b20b94cb02149ed21a86c423859cbe18dc7ed69845cace50e52b40a5" +checksum = "9a9d6ada83c1edcce028902ea27dd929069c70df4c7600b131b4d9a1ad2879cc" dependencies = [ "bitflags", "clap_derive", @@ -403,9 +403,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.1.8" +version = "4.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44bec8e5c9d09e439c4335b1af0abaab56dcf3b94999a936e1bb47b9134288f0" +checksum = "fddf67631444a3a3e3e5ac51c36a5e01335302de677bd78759eaa90ab1f46644" dependencies = [ "heck", "proc-macro-error", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index aa26b5c3..e8354ac3 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.10.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.4.0" } -clap = { version = "4.1.8", features = ["derive", "env"] } +clap = { version = "4.1.9", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "4.0.0" file-format = { version = "0.15.0", default-features = false } From cc78ff3b90e7baf203c9d05d081d18afdeba78ad Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 17 Mar 2023 21:05:19 +1100 Subject: [PATCH 1135/2020] Fix `fetcher::QuickInstall`stats report sending (#918) Fixed https://github.com/cargo-bins/cargo-quickinstall/issues/195 - Fix `fetchers::QuickInstall`: Stop sending stats for `universal-apple-darwin` since quickinstall only supports targets officially supports by rust. - Only send stats report to quickinstall if the `Fetcher::find` is `.await`ed on This prevents stats report to be sent for cases where the `QuickInstall` fetcher is actually unused, e.g. resolved to `GhCrateMeta` or other `QuickInstall` fetcher with different target. This also reduces amount of http requests created in background. Signed-off-by: Jiahao XU --- crates/binstalk/src/fetchers.rs | 4 +++ crates/binstalk/src/fetchers/quickinstall.rs | 36 +++++++++++++------- crates/binstalk/src/ops/resolve.rs | 1 + 3 files changed, 29 insertions(+), 12 deletions(-) diff --git a/crates/binstalk/src/fetchers.rs b/crates/binstalk/src/fetchers.rs index 00d782ad..0b53b346 100644 --- a/crates/binstalk/src/fetchers.rs +++ b/crates/binstalk/src/fetchers.rs @@ -44,6 +44,10 @@ pub trait Fetcher: Send + Sync { /// fatal conditions only. fn find(self: Arc) -> AutoAbortJoinHandle>; + /// Report to upstream that cargo-binstall tries to use this fetcher. + /// Currently it is only overriden by [`quickinstall::QuickInstall`]. + fn report_to_upstream(self: Arc) {} + /// Return the package format fn pkg_fmt(&self) -> PkgFmt; diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs index 959e61d2..7a3d4b86 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk/src/fetchers/quickinstall.rs @@ -63,18 +63,8 @@ impl super::Fetcher for QuickInstall { fn find(self: Arc) -> AutoAbortJoinHandle> { AutoAbortJoinHandle::spawn(async move { - if cfg!(debug_assertions) { - debug!("Not sending quickinstall report in debug mode"); - } else { - let this = self.clone(); - tokio::spawn(async move { - if let Err(err) = this.report().await { - warn!( - "Failed to send quickinstall report for package {}: {err}", - this.package - ) - } - }); + if self.target_data.target == "universal-apple-darwin" { + return Ok(false); } does_url_exist( @@ -86,6 +76,28 @@ impl super::Fetcher for QuickInstall { }) } + fn report_to_upstream(self: Arc) { + if cfg!(debug_assertions) { + debug!("Not sending quickinstall report in debug mode"); + } else if self.target_data.target == "universal-apple-darwin" { + debug!( + r#"Not sending quickinstall report for universal-apple-darwin +quickinstall does not support our homebrew target +universal-apple-darwin, it only supports targets supported by +rust officially."#, + ); + } else { + tokio::spawn(async move { + if let Err(err) = self.report().await { + warn!( + "Failed to send quickinstall report for package {}: {err}", + self.package + ) + } + }); + } + } + async fn fetch_and_extract(&self, dst: &Path) -> Result { let url = &self.package_url; debug!("Downloading package from: '{url}'"); diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 8255be87..fe9f42f8 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -118,6 +118,7 @@ async fn resolve_inner( ); for (fetcher, handle) in handles { + fetcher.clone().report_to_upstream(); match handle.flattened_join().await { Ok(true) => { // Generate temporary binary path From 06b89b2d1896dcf04a597d66773001303be50910 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 17 Mar 2023 22:30:55 +1100 Subject: [PATCH 1136/2020] Add alias `universal2-apple-darwin` to `universal-apple-darwin` (#919) Signed-off-by: Jiahao XU --- crates/detect-targets/src/detect/macos.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/detect-targets/src/detect/macos.rs b/crates/detect-targets/src/detect/macos.rs index 58fc7fe8..dccd6b65 100644 --- a/crates/detect-targets/src/detect/macos.rs +++ b/crates/detect-targets/src/detect/macos.rs @@ -5,6 +5,7 @@ use tokio::process::Command; const AARCH64: &str = "aarch64-apple-darwin"; const X86: &str = "x86_64-apple-darwin"; const UNIVERSAL: &str = "universal-apple-darwin"; +const UNIVERSAL2: &str = "universal2-apple-darwin"; async fn is_x86_64_supported() -> io::Result { let exit_status = Command::new("arch") @@ -24,9 +25,10 @@ pub(super) async fn detect_alternative_targets(target: &str) -> impl Iterator [ is_x86_64_supported().await.unwrap_or(false).then_some(X86), Some(UNIVERSAL), + Some(UNIVERSAL2), ], - X86 => [Some(UNIVERSAL), None], - _ => [None, None], + X86 => [Some(UNIVERSAL), Some(UNIVERSAL2), None], + _ => [None, None, None], } .into_iter() .flatten() From a6e52afaa0ec57713b81d56043ece3b7a652cc61 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 18 Mar 2023 20:35:18 +1100 Subject: [PATCH 1137/2020] Retry http request on connection error (#922) --- crates/binstalk-downloader/src/remote.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 09564d9a..24e18a5b 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -147,7 +147,7 @@ impl Client { let future = (&self.0.service).ready().await?.call(request); let response = match future.await { - Err(err) if err.is_timeout() => { + Err(err) if err.is_timeout() || err.is_connect() => { let duration = RETRY_DURATION_FOR_TIMEOUT; info!("Received timeout error from reqwest. Delay future request by {duration:#?}"); From f28c05b0ee53a438b6b2a21d448481ed604b14a5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 18 Mar 2023 20:35:48 +1100 Subject: [PATCH 1138/2020] Fix `QuickInstall` report bug for target `universal2-apple-darwin` (#921) This bug was reintroduced by #919 and it was fixed by #918 Signed-off-by: Jiahao XU --- crates/binstalk/src/fetchers/quickinstall.rs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs index 7a3d4b86..cb071c6b 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk/src/fetchers/quickinstall.rs @@ -20,6 +20,10 @@ use super::{Data, TargetData}; const BASE_URL: &str = "https://github.com/cargo-bins/cargo-quickinstall/releases/download"; const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; +fn is_universal_macos(target: &str) -> bool { + ["universal-apple-darwin", "universal2-apple-darwin"].contains(&target) +} + pub struct QuickInstall { client: Client, gh_api_client: GhApiClient, @@ -63,7 +67,7 @@ impl super::Fetcher for QuickInstall { fn find(self: Arc) -> AutoAbortJoinHandle> { AutoAbortJoinHandle::spawn(async move { - if self.target_data.target == "universal-apple-darwin" { + if is_universal_macos(&self.target_data.target) { return Ok(false); } @@ -79,12 +83,12 @@ impl super::Fetcher for QuickInstall { fn report_to_upstream(self: Arc) { if cfg!(debug_assertions) { debug!("Not sending quickinstall report in debug mode"); - } else if self.target_data.target == "universal-apple-darwin" { + } else if is_universal_macos(&self.target_data.target) { debug!( r#"Not sending quickinstall report for universal-apple-darwin -quickinstall does not support our homebrew target -universal-apple-darwin, it only supports targets supported by -rust officially."#, +and universal2-apple-darwin. +Quickinstall does not support these targets, it only supports targets supported +by rust officially."#, ); } else { tokio::spawn(async move { From 30c1e6af8f01ef06319f82606289ed5a52fe05ee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 02:48:52 +0000 Subject: [PATCH 1139/2020] Bump async-trait from 0.1.66 to 0.1.67 (#924) --- Cargo.lock | 53 ++++++++++++++++----------- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 34 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e438832b..30ca9f53 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -72,13 +72,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.66" +version = "0.1.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84f9ebcc6c1f5b8cb160f6990096a5c127f423fcb6e1ccc46c370cbdfb75dfc" +checksum = "86ea188f25f0255d8f92797797c97ebf5631fa88178beb1a46fdf5622c9a00e4" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.2", ] [[package]] @@ -411,7 +411,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -582,7 +582,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -731,7 +731,7 @@ checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1259,7 +1259,7 @@ checksum = "2a07ad93a80d1b92bb44cb42d7c49b49c9aab1778befefad49cceb5e4c5bf460" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1390,7 +1390,7 @@ checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1476,7 +1476,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -1512,7 +1512,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn", + "syn 1.0.107", "version_check", ] @@ -1529,9 +1529,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224" dependencies = [ "unicode-ident", ] @@ -1597,9 +1597,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.23" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" dependencies = [ "proc-macro2", ] @@ -1922,7 +1922,7 @@ checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2053,7 +2053,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn", + "syn 1.0.107", ] [[package]] @@ -2095,6 +2095,17 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "syn" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59d3276aee1fa0c33612917969b5172b5be2db051232a6e4826f1a1a9191b045" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "tempfile" version = "3.4.0" @@ -2155,7 +2166,7 @@ checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2221,7 +2232,7 @@ checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2378,7 +2389,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", ] [[package]] @@ -2636,7 +2647,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 1.0.107", "wasm-bindgen-shared", ] @@ -2670,7 +2681,7 @@ checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.107", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 60f8adbf..e770d8d4 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0" [dependencies] -async-trait = "0.1.66" +async-trait = "0.1.67" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.12", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } binstalk-types = { version = "0.3.0", path = "../binstalk-types" } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 30b18578..f0f3cc6d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0" [dependencies] -async-trait = "0.1.66" +async-trait = "0.1.67" binstalk-downloader = { version = "0.4.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.3.0", path = "../binstalk-types" } cargo_toml = "0.15.2" From bbb4eb7e58acd46ce0d0db823f0e7610f921065e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 02:50:04 +0000 Subject: [PATCH 1140/2020] Bump dirs from 4.0.0 to 5.0.0 (#925) --- Cargo.lock | 10 +++++----- crates/bin/Cargo.toml | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 30ca9f53..cac8cbb1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -527,22 +527,22 @@ dependencies = [ [[package]] name = "dirs" -version = "4.0.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" +checksum = "dece029acd3353e3a58ac2e3eb3c8d6c35827a892edc6cc4138ef9c33df46ecd" dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" -version = "0.3.7" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" +checksum = "04414300db88f70d74c5ff54e50f9e1d1737d9a5b90f53fcf2e95ca2a9ab554b" dependencies = [ "libc", "redox_users", - "winapi", + "windows-sys 0.45.0", ] [[package]] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index e8354ac3..c6584cd9 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -26,7 +26,7 @@ binstalk = { path = "../binstalk", version = "0.10.0", default-features = false binstalk-manifests = { path = "../binstalk-manifests", version = "0.4.0" } clap = { version = "4.1.9", features = ["derive", "env"] } compact_str = "0.7.0" -dirs = "4.0.0" +dirs = "5.0.0" file-format = { version = "0.15.0", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } gh-token = "0.1.1" From dd4595e6a49b948ea78371e8cded69e2d7054b26 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 03:35:45 +0000 Subject: [PATCH 1141/2020] Bump thiserror from 1.0.39 to 1.0.40 (#928) --- Cargo.lock | 10 +++++----- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cac8cbb1..06f6484f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2151,22 +2151,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5ab016db510546d856297882807df8da66a16fb8c4101cb8b30054b0d5b2d9c" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5420d42e90af0c38c3290abcca25b9b3bdf379fc9f55c528f53a269d9c9a267e" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.2", ] [[package]] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index e770d8d4..b57887be 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -31,7 +31,7 @@ serde_json = { version = "1.0.94", optional = true } #tar = "0.4.38" tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.4.0" -thiserror = "1.0.39" +thiserror = "1.0.40" tokio = { version = "1.26.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.7", features = ["io"] } diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index e87f13fb..734b98c1 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -20,7 +20,7 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.156", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.94" -thiserror = "1.0.39" +thiserror = "1.0.40" toml_edit = { version = "0.19.7", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index f0f3cc6d..09cd3388 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -29,7 +29,7 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.156", features = ["derive"] } strum = "0.24.1" tempfile = "3.4.0" -thiserror = "1.0.39" +thiserror = "1.0.40" tinytemplate = "1.2.1" # parking_lot for `tokio::sync::OnceCell::const_new` tokio = { version = "1.26.0", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } From b3dc52f6d76ce837d2c09a531629c08f806680a2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 03:39:08 +0000 Subject: [PATCH 1142/2020] Bump clap from 4.1.9 to 4.1.11 (#927) --- Cargo.lock | 24 +++++++++++++++--------- crates/bin/Cargo.toml | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 06f6484f..befe7998 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -254,6 +254,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487f1e0fcbe47deb8b0574e646def1c903389d95241dd1bbcc6ce4a715dfc0c1" + [[package]] name = "block-buffer" version = "0.10.3" @@ -388,11 +394,11 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.1.9" +version = "4.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a9d6ada83c1edcce028902ea27dd929069c70df4c7600b131b4d9a1ad2879cc" +checksum = "42dfd32784433290c51d92c438bb72ea5063797fc3cc9a21a8c4346bebbb2098" dependencies = [ - "bitflags", + "bitflags 2.0.2", "clap_derive", "clap_lex", "is-terminal", @@ -1322,7 +1328,7 @@ 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", "static_assertions", @@ -1373,7 +1379,7 @@ version = "0.10.45" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "foreign-types", "libc", @@ -1640,7 +1646,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1763,7 +1769,7 @@ version = "0.35.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", "io-lifetimes 0.7.5", "libc", @@ -1777,7 +1783,7 @@ version = "0.36.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno", "io-lifetimes 1.0.5", "libc", @@ -1870,7 +1876,7 @@ version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index c6584cd9..57975f35 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.10.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.4.0" } -clap = { version = "4.1.9", features = ["derive", "env"] } +clap = { version = "4.1.11", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.0" file-format = { version = "0.15.0", default-features = false } From 6a9827e66f1e7798f573e55064ef53c72f727ec5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 Mar 2023 04:02:13 +0000 Subject: [PATCH 1143/2020] Bump serde from 1.0.156 to 1.0.157 (#926) --- Cargo.lock | 10 +++++----- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index befe7998..03353774 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1904,9 +1904,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.156" +version = "1.0.157" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "314b5b092c0ade17c00142951e50ced110ec27cea304b1037c6969246c2469a4" +checksum = "707de5fcf5df2b5788fca98dd7eab490bc2fd9b7ef1404defc462833b83f25ca" dependencies = [ "serde_derive", ] @@ -1922,13 +1922,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.156" +version = "1.0.157" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7e29c4601e36bcec74a223228dce795f4cd3616341a4af93520ca1a837c087d" +checksum = "78997f4555c22a7971214540c4a661291970619afd56de19f77e0de86296e1e5" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 2.0.2", ] [[package]] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index b57887be..d46846df 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -23,7 +23,7 @@ futures-lite = { version = "1.12.0", default-features = false } generic-array = "0.14.6" httpdate = "1.0.2" reqwest = { version = "0.11.14", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } -serde = { version = "1.0.156", features = ["derive"], optional = true } +serde = { version = "1.0.157", features = ["derive"], optional = true } serde_json = { version = "1.0.94", optional = true } # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 734b98c1..bb6e77c4 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -17,7 +17,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" miette = "5.6.0" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.156", features = ["derive"] } +serde = { version = "1.0.157", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.94" thiserror = "1.0.40" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index e89eaee9..1ade18d0 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -14,7 +14,7 @@ compact_str = { version = "0.7.0", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.17.1" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.156", features = ["derive"] } +serde = { version = "1.0.157", features = ["derive"] } strum = "0.24.1" strum_macros = "0.24.3" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 09cd3388..4f72e97f 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ miette = "5.6.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.17.1" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.156", features = ["derive"] } +serde = { version = "1.0.157", features = ["derive"] } strum = "0.24.1" tempfile = "3.4.0" thiserror = "1.0.40" From daf8cdd010a46ff0c718ef0bbf1604b4f8d7940a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 21 Mar 2023 12:04:00 +1100 Subject: [PATCH 1144/2020] Bump transtive deps (#929) Signed-off-by: Jiahao XU --- Cargo.lock | 169 +++++++++++++++++++++++++++-------------------------- 1 file changed, 85 insertions(+), 84 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 03353774..36ef7add 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -78,7 +78,7 @@ checksum = "86ea188f25f0255d8f92797797c97ebf5631fa88178beb1a46fdf5622c9a00e4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.2", + "syn 2.0.4", ] [[package]] @@ -262,9 +262,9 @@ checksum = "487f1e0fcbe47deb8b0574e646def1c903389d95241dd1bbcc6ce4a715dfc0c1" [[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", ] @@ -365,7 +365,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f83bc2e401ed041b7057345ebc488c005efa0341d5541ce7004d30458d0090b" dependencies = [ "serde", - "toml 0.7.2", + "toml 0.7.3", ] [[package]] @@ -417,14 +417,14 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] name = "clap_lex" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade" +checksum = "033f6b7a4acb1f358c742aaca805c939ee73b4c6209ae4318ec7aca81c42e646" dependencies = [ "os_str_bytes", ] @@ -588,7 +588,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -700,24 +700,24 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" +checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" [[package]] name = "futures-io" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" +checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" [[package]] name = "futures-lite" @@ -731,32 +731,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" +checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] name = "futures-sink" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" +checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" [[package]] name = "futures-task" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" +checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" [[package]] name = "futures-util" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" dependencies = [ "futures-core", "futures-io", @@ -831,9 +831,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" dependencies = [ "bytes", "fnv", @@ -934,9 +934,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.24" +version = "0.14.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e011372fa0b68db8350aa7a248930ecc7839bf46d8485577d69f117a75f164c" +checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" dependencies = [ "bytes", "futures-channel", @@ -1030,10 +1030,11 @@ checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" [[package]] name = "io-lifetimes" -version = "1.0.5" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1abeb7a0dd0f8181267ff8adc397075586500b81b28a73e8a0208b00fc170fb3" +checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" dependencies = [ + "hermit-abi 0.3.1", "libc", "windows-sys 0.45.0", ] @@ -1058,13 +1059,13 @@ checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" [[package]] name = "is-terminal" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e18b0a45d56fe973d6db23972bf5bc46f988a4a2385deac9cc29572f09daef" +checksum = "8687c819457e979cc940d09cb16e42a1bf70aa6b60a549de6d3a62a0ee90c69e" dependencies = [ "hermit-abi 0.3.1", - "io-lifetimes 1.0.5", - "rustix 0.36.8", + "io-lifetimes 1.0.9", + "rustix 0.36.11", "windows-sys 0.45.0", ] @@ -1085,15 +1086,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "jobserver" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" dependencies = [ "libc", ] @@ -1129,9 +1130,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.139" +version = "0.2.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" [[package]] name = "libmimalloc-sys" @@ -1265,7 +1266,7 @@ checksum = "2a07ad93a80d1b92bb44cb42d7c49b49c9aab1778befefad49cceb5e4c5bf460" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -1279,9 +1280,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 = "miniz_oxide" @@ -1375,9 +1376,9 @@ checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "openssl" -version = "0.10.45" +version = "0.10.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" +checksum = "d8b277f87dacc05a6b709965d1cbafac4649d6ce9f3ce9ceb88508b5666dfec9" dependencies = [ "bitflags 1.3.2", "cfg-if", @@ -1396,7 +1397,7 @@ checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -1407,9 +1408,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.80" +version = "0.9.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" +checksum = "a95792af3c4e0153c3914df2261bedd30a98476f94dc892b67dfe1d89d433a04" dependencies = [ "autocfg", "cc", @@ -1420,9 +1421,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.4.1" +version = "6.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" [[package]] name = "overload" @@ -1482,7 +1483,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -1518,7 +1519,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", "version_check", ] @@ -1779,13 +1780,13 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.8" +version = "0.36.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43abb88211988493c1abb44a70efa56ff0ce98f233b7b276146f1f3f7ba9644" +checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" dependencies = [ "bitflags 1.3.2", "errno", - "io-lifetimes 1.0.5", + "io-lifetimes 1.0.9", "libc", "linux-raw-sys 0.1.4", "windows-sys 0.45.0", @@ -1835,15 +1836,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" +checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" [[package]] name = "ryu" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "schannel" @@ -1928,7 +1929,7 @@ checksum = "78997f4555c22a7971214540c4a661291970619afd56de19f77e0de86296e1e5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.2", + "syn 2.0.4", ] [[package]] @@ -1965,9 +1966,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.17" +version = "0.9.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb06d4b6cdaef0e0c51fa881acb721bed3c924cfaa71d9c94a3b771dfdf6567" +checksum = "f82e6c8c047aa50a7328632d067bcae6ef38772a79e28daf32f735e0e4f3dd10" dependencies = [ "indexmap", "itoa", @@ -2017,9 +2018,9 @@ checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" [[package]] name = "socket2" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", @@ -2059,7 +2060,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -2092,9 +2093,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.107" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -2103,9 +2104,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.2" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59d3276aee1fa0c33612917969b5172b5be2db051232a6e4826f1a1a9191b045" +checksum = "2c622ae390c9302e214c31013517c2061ecb2699935882c60a9b37f82f8625ae" dependencies = [ "proc-macro2", "quote", @@ -2121,7 +2122,7 @@ dependencies = [ "cfg-if", "fastrand", "redox_syscall", - "rustix 0.36.8", + "rustix 0.36.11", "windows-sys 0.42.0", ] @@ -2172,7 +2173,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.2", + "syn 2.0.4", ] [[package]] @@ -2238,7 +2239,7 @@ checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -2313,9 +2314,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7afcae9e3f0fe2c370fd4657108972cbb2fa9db1b9f84849cefd80741b01cb6" +checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21" dependencies = [ "serde", "serde_spanned", @@ -2395,7 +2396,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -2519,15 +2520,15 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "unicode-bidi" -version = "0.3.10" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54675592c1dbefd78cbd98db9bacd89886e1ca50692a0692baefffdeb92dd58" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" [[package]] name = "unicode-linebreak" @@ -2556,9 +2557,9 @@ checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "unsafe-libyaml" -version = "0.2.5" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc7ed8ba44ca06be78ea1ad2c3682a43349126c8818054231ee6f4748012aed2" +checksum = "ad2024452afd3874bf539695e04af6732ba06517424dbf958fdb16a01f3bef6c" [[package]] name = "untrusted" @@ -2653,7 +2654,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", "wasm-bindgen-shared", ] @@ -2687,7 +2688,7 @@ checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2869,9 +2870,9 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "winnow" -version = "0.3.0" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efdd927d1a3d5d98abcfc4cf8627371862ee6abfe52a988050621c50c66b4493" +checksum = "23d020b441f92996c80d94ae9166e8501e59c7bb56121189dc9eab3bd8216966" dependencies = [ "memchr", ] From 2227d363f71ef79da5574b0345497330d1908c91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Tue, 21 Mar 2023 14:36:02 +1300 Subject: [PATCH 1145/2020] Leon template library (#766) * leon: first implementation * Update crates/leon/src/values.rs Co-authored-by: Jiahao XU * Workaround orphan rules to make API more intuitive * Fmt * Clippy * Use CoW * Use cow for items too * Test that const construction works * leon: Initial attempt at O(n) parser * leon: finish parser (except escapes) * leon: Improve ergonomics of compile-time templates * Document helpers * leon: Docs tweaks * leon: Use macro to minimise parser tests * leon: add escapes to parser * leon: test escapes preceding keys * leon: add multibyte tests * leon: test escapes following keys * Format * Debug * leon: Don't actually need to keep track of the key * leon: Parse to vec first * leon: there's actually no need for string cows * leon: reorganise and redo macro now that there's no coww * Well that was silly * leon: Adjust text end when pushing * leon: catch unbalanced keys * Add error tests * leon: Catch unfinished escape * Comment out debugging * leon: fuzz * Clippy * leon: Box parse error * leon: &dyn instead of impl * Can't impl FromStr, so rename to parse * Add Vec<> to values * leon: Add benches for ways to supply values * leon: Add bench comparing to std and tt * Fix fuzz * Fmt * Split ParseError and RenderError * Make miette optional * Remove RenderError lifetime * Simplify ParseError type schema * Write concrete Values types instead of generics * Add license files * Reduce criterion deps * Make default a cow * Add a CLI leon tool * Fix tests * Clippy * Disable cli by default * Avoid failing the build when cli is off * Add to ci * Update crates/leon/src/main.rs Co-authored-by: Jiahao XU * Update crates/leon/Cargo.toml Co-authored-by: Jiahao XU * Bump version * Error not transparent * Diagnostic can do forwarding * Simplify error type * Expand doc examples * Generic Values for Hash and BTree maps * One more borrowed * Forward implementations * More generics * Add has_keys * Lock stdout in leon tool * No more debug comments in parser * Even more generics * Macros to reduce bench duplication * Further simplify error * Fix leon main * Stable support * Clippy --------- Co-authored-by: Jiahao XU --- .github/dependabot.yml | 4 + .github/workflows/release-pr.yml | 1 + Cargo.lock | 489 +++++++++++++------- Cargo.toml | 1 + crates/leon/Cargo.toml | 33 ++ crates/leon/LICENSE-APACHE | 176 ++++++++ crates/leon/LICENSE-MIT | 23 + crates/leon/benches/others.rs | 89 ++++ crates/leon/benches/values.rs | 298 +++++++++++++ crates/leon/fuzz/.gitignore | 4 + crates/leon/fuzz/Cargo.lock | 150 +++++++ crates/leon/fuzz/Cargo.toml | 27 ++ crates/leon/fuzz/fuzz_targets/parser.rs | 9 + crates/leon/src/error.rs | 85 ++++ crates/leon/src/lib.rs | 148 +++++++ crates/leon/src/macros.rs | 50 +++ crates/leon/src/main.rs | 61 +++ crates/leon/src/parser.rs | 565 ++++++++++++++++++++++++ crates/leon/src/template.rs | 198 +++++++++ crates/leon/src/values.rs | 133 ++++++ 20 files changed, 2382 insertions(+), 162 deletions(-) create mode 100644 crates/leon/Cargo.toml create mode 100644 crates/leon/LICENSE-APACHE create mode 100644 crates/leon/LICENSE-MIT create mode 100644 crates/leon/benches/others.rs create mode 100644 crates/leon/benches/values.rs create mode 100644 crates/leon/fuzz/.gitignore create mode 100644 crates/leon/fuzz/Cargo.lock create mode 100644 crates/leon/fuzz/Cargo.toml create mode 100644 crates/leon/fuzz/fuzz_targets/parser.rs create mode 100644 crates/leon/src/error.rs create mode 100644 crates/leon/src/lib.rs create mode 100644 crates/leon/src/macros.rs create mode 100644 crates/leon/src/main.rs create mode 100644 crates/leon/src/parser.rs create mode 100644 crates/leon/src/template.rs create mode 100644 crates/leon/src/values.rs diff --git a/.github/dependabot.yml b/.github/dependabot.yml index be614717..2d36099e 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -48,3 +48,7 @@ updates: directory: "/crates/detect-targets" schedule: interval: "daily" + - package-ecosystem: "cargo" + directory: "/crates/leon" + schedule: + interval: "daily" diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 7e8ae121..899fb7ae 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -16,6 +16,7 @@ on: - detect-wasi - fs-lock - normalize-path + - leon version: description: Version to release required: true diff --git a/Cargo.lock b/Cargo.lock index 36ef7add..1e5b44b1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,6 +52,12 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + [[package]] name = "async-compression" version = "0.3.15" @@ -78,7 +84,7 @@ checksum = "86ea188f25f0255d8f92797797c97ebf5631fa88178beb1a46fdf5622c9a00e4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.4", + "syn 2.0.3", ] [[package]] @@ -95,6 +101,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi 0.1.19", + "libc", + "winapi", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -262,9 +279,9 @@ checksum = "487f1e0fcbe47deb8b0574e646def1c903389d95241dd1bbcc6ce4a715dfc0c1" [[package]] name = "block-buffer" -version = "0.10.4" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" dependencies = [ "generic-array", ] @@ -292,9 +309,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "byteorder" @@ -335,7 +352,7 @@ version = "0.21.3" dependencies = [ "binstalk", "binstalk-manifests", - "clap", + "clap 4.1.11", "compact_str", "dirs", "embed-resource", @@ -365,9 +382,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f83bc2e401ed041b7057345ebc488c005efa0341d5541ce7004d30458d0090b" dependencies = [ "serde", - "toml 0.7.3", + "toml 0.7.1", ] +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + [[package]] name = "castaway" version = "0.2.2" @@ -379,9 +402,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.79" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" dependencies = [ "jobserver", ] @@ -392,6 +415,45 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "ciborium" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" + +[[package]] +name = "ciborium-ll" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b" +dependencies = [ + "ciborium-io", + "half", +] + +[[package]] +name = "clap" +version = "3.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +dependencies = [ + "bitflags 1.3.2", + "clap_lex 0.2.4", + "indexmap", + "textwrap 0.16.0", +] + [[package]] name = "clap" version = "4.1.11" @@ -400,7 +462,7 @@ checksum = "42dfd32784433290c51d92c438bb72ea5063797fc3cc9a21a8c4346bebbb2098" dependencies = [ "bitflags 2.0.2", "clap_derive", - "clap_lex", + "clap_lex 0.3.1", "is-terminal", "once_cell", "strsim", @@ -417,14 +479,23 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] name = "clap_lex" -version = "0.3.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "033f6b7a4acb1f358c742aaca805c939ee73b4c6209ae4318ec7aca81c42e646" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "clap_lex" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade" dependencies = [ "os_str_bytes", ] @@ -489,6 +560,40 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "criterion" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" +dependencies = [ + "anes", + "atty", + "cast", + "ciborium", + "clap 3.2.23", + "criterion-plot", + "itertools", + "lazy_static", + "num-traits", + "oorandom", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", +] + +[[package]] +name = "criterion-plot" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" +dependencies = [ + "cast", + "itertools", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -572,9 +677,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" dependencies = [ "cfg-if", ] @@ -588,7 +693,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -614,9 +719,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "1.9.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" dependencies = [ "instant", ] @@ -629,14 +734,14 @@ checksum = "bbe20e5f282c61432e5cf0e33185e5dde032b2c2e4281c4735c31ce5b455a869" [[package]] name = "filetime" -version = "0.2.20" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" +checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9" dependencies = [ "cfg-if", "libc", "redox_syscall", - "windows-sys 0.45.0", + "windows-sys 0.42.0", ] [[package]] @@ -700,24 +805,24 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.27" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" +checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.27" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" +checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" [[package]] name = "futures-io" -version = "0.3.27" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" +checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" [[package]] name = "futures-lite" @@ -731,32 +836,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.27" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" +checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] name = "futures-sink" -version = "0.3.27" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" +checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" [[package]] name = "futures-task" -version = "0.3.27" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" +checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" [[package]] name = "futures-util" -version = "0.3.27" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" +checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" dependencies = [ "futures-core", "futures-io", @@ -813,9 +918,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.2" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" +checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793" [[package]] name = "guess_host_triple" @@ -831,9 +936,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.16" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" +checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" dependencies = [ "bytes", "fnv", @@ -848,6 +953,12 @@ dependencies = [ "tracing", ] +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + [[package]] name = "hashbrown" version = "0.12.3" @@ -859,9 +970,18 @@ dependencies = [ [[package]] name = "heck" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] [[package]] name = "hermit-abi" @@ -872,12 +992,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 = "home" version = "0.5.4" @@ -900,9 +1014,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" dependencies = [ "bytes", "fnv", @@ -934,9 +1048,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.25" +version = "0.14.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" +checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" dependencies = [ "bytes", "futures-channel", @@ -1030,13 +1144,12 @@ checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" [[package]] name = "io-lifetimes" -version = "1.0.9" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" +checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e" dependencies = [ - "hermit-abi 0.3.1", "libc", - "windows-sys 0.45.0", + "windows-sys 0.42.0", ] [[package]] @@ -1059,14 +1172,14 @@ checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" [[package]] name = "is-terminal" -version = "0.4.5" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8687c819457e979cc940d09cb16e42a1bf70aa6b60a549de6d3a62a0ee90c69e" +checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes 1.0.9", - "rustix 0.36.11", - "windows-sys 0.45.0", + "hermit-abi 0.2.6", + "io-lifetimes 1.0.4", + "rustix 0.36.6", + "windows-sys 0.42.0", ] [[package]] @@ -1086,15 +1199,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" dependencies = [ "libc", ] @@ -1115,9 +1228,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" dependencies = [ "wasm-bindgen", ] @@ -1128,11 +1241,23 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +[[package]] +name = "leon" +version = "0.0.1" +dependencies = [ + "clap 4.1.11", + "criterion", + "miette", + "serde", + "thiserror", + "tinytemplate", +] + [[package]] name = "libc" -version = "0.2.140" +version = "0.2.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" [[package]] name = "libmimalloc-sys" @@ -1219,9 +1344,9 @@ checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" [[package]] name = "matches" -version = "0.1.10" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" [[package]] name = "maybe-owned" @@ -1253,7 +1378,7 @@ dependencies = [ "supports-hyperlinks", "supports-unicode", "terminal_size", - "textwrap", + "textwrap 0.15.2", "thiserror", "unicode-width", ] @@ -1266,7 +1391,7 @@ checksum = "2a07ad93a80d1b92bb44cb42d7c49b49c9aab1778befefad49cceb5e4c5bf460" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -1280,9 +1405,9 @@ dependencies = [ [[package]] name = "mime" -version = "0.3.17" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "miniz_oxide" @@ -1295,14 +1420,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.6" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" dependencies = [ "libc", "log", "wasi", - "windows-sys 0.45.0", + "windows-sys 0.42.0", ] [[package]] @@ -1325,9 +1450,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.2" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +checksum = "46a58d1d356c6597d08cde02c2f09d785b09e28711837b1ed667dc652c08a694" dependencies = [ "bitflags 1.3.2", "cfg-if", @@ -1349,6 +1474,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + [[package]] name = "num_cpus" version = "1.15.0" @@ -1361,9 +1495,9 @@ dependencies = [ [[package]] name = "object" -version = "0.30.3" +version = "0.30.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" +checksum = "2b8c786513eb403643f2a88c244c2aaa270ef2153f55094587d0c48a3cf22a83" dependencies = [ "memchr", ] @@ -1375,10 +1509,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] -name = "openssl" -version = "0.10.47" +name = "oorandom" +version = "11.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b277f87dacc05a6b709965d1cbafac4649d6ce9f3ce9ceb88508b5666dfec9" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" + +[[package]] +name = "openssl" +version = "0.10.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" dependencies = [ "bitflags 1.3.2", "cfg-if", @@ -1397,7 +1537,7 @@ checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -1408,9 +1548,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.82" +version = "0.9.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a95792af3c4e0153c3914df2261bedd30a98476f94dc892b67dfe1d89d433a04" +checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" dependencies = [ "autocfg", "cc", @@ -1421,9 +1561,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.5.0" +version = "6.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" +checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" [[package]] name = "overload" @@ -1449,15 +1589,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.7" +version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys 0.45.0", + "windows-sys 0.42.0", ] [[package]] @@ -1483,7 +1623,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -1519,7 +1659,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", "version_check", ] @@ -1780,16 +1920,16 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.11" +version = "0.36.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" +checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549" dependencies = [ "bitflags 1.3.2", "errno", - "io-lifetimes 1.0.9", + "io-lifetimes 1.0.4", "libc", "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", + "windows-sys 0.42.0", ] [[package]] @@ -1836,15 +1976,24 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.12" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" +checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] [[package]] name = "schannel" @@ -1873,9 +2022,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.8.2" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -1886,9 +2035,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.8.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" dependencies = [ "core-foundation-sys", "libc", @@ -1905,9 +2054,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.157" +version = "1.0.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707de5fcf5df2b5788fca98dd7eab490bc2fd9b7ef1404defc462833b83f25ca" +checksum = "771d4d9c4163ee138805e12c710dd365e4f44be8be0503cb1bb9eb989425d9c9" dependencies = [ "serde_derive", ] @@ -1923,13 +2072,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.157" +version = "1.0.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78997f4555c22a7971214540c4a661291970619afd56de19f77e0de86296e1e5" +checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad" dependencies = [ "proc-macro2", "quote", - "syn 2.0.4", + "syn 2.0.3", ] [[package]] @@ -1988,18 +2137,18 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "e51e73328dc4ac0c7ccbda3a494dfa03df1de2f46018127f60c693f2648455b0" dependencies = [ "libc", ] [[package]] name = "slab" -version = "0.4.8" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" dependencies = [ "autocfg", ] @@ -2018,9 +2167,9 @@ checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" dependencies = [ "libc", "winapi", @@ -2060,7 +2209,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -2093,9 +2242,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.109" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", @@ -2104,9 +2253,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.4" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c622ae390c9302e214c31013517c2061ecb2699935882c60a9b37f82f8625ae" +checksum = "e8234ae35e70582bfa0f1fedffa6daa248e41dd045310b19800c4a36382c8f60" dependencies = [ "proc-macro2", "quote", @@ -2122,7 +2271,7 @@ dependencies = [ "cfg-if", "fastrand", "redox_syscall", - "rustix 0.36.11", + "rustix 0.36.6", "windows-sys 0.42.0", ] @@ -2156,6 +2305,12 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + [[package]] name = "thiserror" version = "1.0.40" @@ -2173,16 +2328,15 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.4", + "syn 2.0.3", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" dependencies = [ - "cfg-if", "once_cell", ] @@ -2207,9 +2361,9 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.1" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" @@ -2239,14 +2393,14 @@ checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] name = "tokio-native-tls" -version = "0.3.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" +checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" dependencies = [ "native-tls", "tokio", @@ -2265,9 +2419,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.12" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" +checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" dependencies = [ "futures-core", "pin-project-lite", @@ -2314,9 +2468,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.3" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21" +checksum = "772c1426ab886e7362aedf4abc9c0d1348a979517efedfc25862944d10137af0" dependencies = [ "serde", "serde_spanned", @@ -2396,7 +2550,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", ] [[package]] @@ -2520,15 +2674,15 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" [[package]] name = "unicode-linebreak" @@ -2617,6 +2771,17 @@ dependencies = [ "libc", ] +[[package]] +name = "walkdir" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +dependencies = [ + "same-file", + "winapi", + "winapi-util", +] + [[package]] name = "want" version = "0.3.0" @@ -2635,9 +2800,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2645,24 +2810,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.34" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" +checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" dependencies = [ "cfg-if", "js-sys", @@ -2672,9 +2837,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2682,22 +2847,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 1.0.107", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" [[package]] name = "wasm-streams" @@ -2714,9 +2879,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.61" +version = "0.3.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" dependencies = [ "js-sys", "wasm-bindgen", @@ -2919,7 +3084,7 @@ version = "0.12.3+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" dependencies = [ - "zstd-safe 6.0.4+zstd.1.5.4", + "zstd-safe 6.0.3+zstd.1.5.2", ] [[package]] @@ -2934,9 +3099,9 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "6.0.4+zstd.1.5.4" +version = "6.0.3+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7afb4b54b8910cf5447638cb54bf4e8a65cbedd783af98b98c62ffe91f185543" +checksum = "68e4a3f57d13d0ab7e478665c60f35e2a613dcd527851c2c7287ce5c787e134a" dependencies = [ "libc", "zstd-sys", diff --git a/Cargo.toml b/Cargo.toml index 4e3e1f52..c4fd9e9c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,6 +9,7 @@ members = [ "crates/fs-lock", "crates/normalize-path", "crates/detect-targets", + "crates/leon", ] [profile.release] diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml new file mode 100644 index 00000000..b12324d1 --- /dev/null +++ b/crates/leon/Cargo.toml @@ -0,0 +1,33 @@ +[package] +name = "leon" +description = "Dead-simple string templating" +repository = "https://github.com/cargo-bins/cargo-binstall" +documentation = "https://docs.rs/leon" +version = "0.0.1" +rust-version = "1.61.0" +authors = ["Félix Saparelli "] +edition = "2021" +license = "Apache-2.0 OR MIT" + +[dependencies] +clap = { version = "4.1.4", features = ["derive"], optional = true } +miette = { version = "5.5.0", default-features = false, optional = true } +thiserror = "1.0.38" + +[features] +default = ["miette"] +cli = ["dep:clap", "miette?/fancy-no-backtrace"] +miette = ["dep:miette"] + +[dev-dependencies] +criterion = { version = "0.4.0", default-features = false, features = ["cargo_bench_support"] } +serde = { version = "1.0.152", features = ["derive"] } +tinytemplate = "1.2.1" + +[[bench]] +name = "values" +harness = false + +[[bench]] +name = "others" +harness = false diff --git a/crates/leon/LICENSE-APACHE b/crates/leon/LICENSE-APACHE new file mode 100644 index 00000000..1b5ec8b7 --- /dev/null +++ b/crates/leon/LICENSE-APACHE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/crates/leon/LICENSE-MIT b/crates/leon/LICENSE-MIT new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/crates/leon/LICENSE-MIT @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/crates/leon/benches/others.rs b/crates/leon/benches/others.rs new file mode 100644 index 00000000..9b48f871 --- /dev/null +++ b/crates/leon/benches/others.rs @@ -0,0 +1,89 @@ +use std::borrow::Cow; + +use criterion::{black_box, criterion_group, criterion_main, Criterion}; +use leon::{vals, Template}; +use serde::Serialize; +use tinytemplate::TinyTemplate; + +fn compare_impls(c: &mut Criterion) { + const TEMPLATE: &str = "hello {name}! i am {age} years old. my goal is to {goal}. i like: {flower}, {music}, {animal}, {color}, {food}. i'm drinking {drink}"; + fn replace_fn<'s>(key: &'s str) -> Option> { + Some(Cow::Borrowed(match key { + "name" => "marcus", + "age" => "42", + "goal" => "primary", + "flower" => "lotus", + "music" => "jazz", + "animal" => "cat", + "color" => "blue", + "food" => "pizza", + "drink" => "coffee", + _ => return None, + })) + } + + #[derive(Serialize)] + struct Context<'c> { + name: &'c str, + age: u8, + goal: &'c str, + flower: &'c str, + music: &'c str, + animal: &'c str, + color: &'c str, + food: &'c str, + drink: &'c str, + } + + let tt_context = Context { + name: "marcus", + age: 42, + goal: "primary", + flower: "lotus", + music: "jazz", + animal: "cat", + color: "blue", + food: "pizza", + drink: "coffee", + }; + + c.bench_function("leon", |b| { + b.iter(|| { + let template = Template::parse(black_box(TEMPLATE)).unwrap(); + let output = template.render(&vals(replace_fn)).unwrap(); + black_box(output); + }) + }); + + c.bench_function("std, string replaces", |b| { + b.iter(|| { + let mut output = black_box(TEMPLATE).to_string(); + for (key, value) in [ + ("name", "marcus"), + ("age", "42"), + ("goal", "primary"), + ("flower", "lotus"), + ("music", "jazz"), + ("animal", "cat"), + ("color", "blue"), + ("food", "pizza"), + ("drink", "coffee"), + ] { + output = output.replace(&format!("{{{}}}", key), value); + } + black_box(output); + }) + }); + + c.bench_function("tiny template", |b| { + b.iter(|| { + let mut tt = TinyTemplate::new(); + tt.add_template("tmp", black_box(TEMPLATE)).unwrap(); + let output = tt.render("tmp", &tt_context).unwrap(); + black_box(output); + }) + }); +} + +criterion_group!(compare, compare_impls); +criterion_main!(compare); diff --git a/crates/leon/benches/values.rs b/crates/leon/benches/values.rs new file mode 100644 index 00000000..b4fd7944 --- /dev/null +++ b/crates/leon/benches/values.rs @@ -0,0 +1,298 @@ +use std::{borrow::Cow, collections::HashMap}; + +use criterion::{black_box, criterion_group, criterion_main, Criterion}; +use leon::{vals, Template, Values, ValuesFn}; + +macro_rules! make_values { + ($($name:expr => $value:expr),*) => { + ( + &[$(($name, $value)),*], + { + let mut map = HashMap::new(); + $( + map.insert($name, $value); + )* + map + }, + vals(|key| match key { + $( + $name => Some(Cow::Borrowed($value)), + )* + _ => None, + }) + ) + }; +} + +fn one_replace(c: &mut Criterion) { + const TEMPLATE: &str = "Hello, {name}!"; + + let (slice, hashmap, vals) = make_values!( + "name" => "marcus" + ); + + inner_bench("one replace", c, TEMPLATE, vals, hashmap, slice); +} + +fn some_replaces(c: &mut Criterion) { + const TEMPLATE: &str = "hello {name}! i am {age} years old. my goal is to {goal}. i like: {flower}, {music}, {animal}, {color}, {food}. i'm drinking {drink}"; + + let (slice, hashmap, vals) = make_values!( + "name" => "marcus", + "age" => "42", + "goal" => "primary", + "flower" => "lotus", + "music" => "jazz", + "animal" => "cat", + "color" => "blue", + "food" => "pizza", + "drink" => "coffee" + ); + + inner_bench("some replaces", c, TEMPLATE, vals, hashmap, slice); +} + +fn many_replaces(c: &mut Criterion) { + const TEMPLATE: &str = " + {artichoke} + {aubergine} + {asparagus} + {broccoflower} + {broccoli} + {brussels sprouts} + {cabbage} + {kohlrabi} + {Savoy cabbage} + {red cabbage} + {cauliflower} + {celery} + {endive} + {fiddleheads} + {frisee} + {fennel} + {greens} + {arugula} + {bok choy} + {chard} + {collard greens} + {kale} + {lettuce} + {mustard greens} + {spinach} + {herbs} + {anise} + {basil} + {caraway} + {coriander} + {chamomile} + {daikon} + {dill} + {squash} + {lavender} + {cymbopogon} + {marjoram} + {oregano} + {parsley} + {rosemary} + {thyme} + {legumes} + {alfalfa sprouts} + {azuki beans} + {bean sprouts} + {black beans} + {black-eyed peas} + {borlotti bean} + {broad beans} + {chickpeas, garbanzos, or ceci beans} + {green beans} + {kidney beans} + {lentils} + {lima beans or butter bean} + {mung beans} + {navy beans} + {peanuts} + {pinto beans} + {runner beans} + {split peas} + {soy beans} + {peas} + {mange tout or snap peas} + {mushrooms} + {nettles} + {New Zealand spinach} + {okra} + {onions} + {chives} + {garlic} + {leek} + {onion} + {shallot} + {scallion} + {peppers} + {bell pepper} + {chili pepper} + {jalapeño} + {habanero} + {paprika} + {tabasco pepper} + {cayenne pepper} + {radicchio} + {rhubarb} + {root vegetables} + {beetroot} + {beet} + {mangelwurzel} + {carrot} + {celeriac} + {corms} + {eddoe} + {konjac} + {taro} + {water chestnut} + {ginger} + {parsnip} + {rutabaga} + {radish} + {wasabi} + "; + + let (slice, hashmap, vals) = make_values!( + "artichoke" => "Abiu", + "aubergine" => "Açaí", + "asparagus" => "Acerola", + "broccoflower" => "Akebi", + "broccoli" => "Ackee", + "brussels sprouts" => "African Cherry Orange", + "cabbage" => "American Mayapple", + "kohlrabi" => "Apple", + "Savoy cabbage" => "Apricot", + "red cabbage" => "Araza", + "cauliflower" => "Avocado", + "celery" => "Banana", + "endive" => "Bilberry", + "fiddleheads" => "Blackberry", + "frisee" => "Blackcurrant", + "fennel" => "Black sapote", + "greens" => "Blueberry", + "arugula" => "Boysenberry", + "bok choy" => "Breadfruit", + "chard" => "Buddha's hand", + "collard greens" => "Cactus pear", + "kale" => "Canistel", + "lettuce" => "Cashew", + "mustard greens" => "Cempedak", + "spinach" => "Cherimoya", + "herbs" => "Cherry", + "anise" => "Chico fruit", + "basil" => "Cloudberry", + "caraway" => "Coco de mer", + "coriander" => "Coconut", + "chamomile" => "Crab apple", + "daikon" => "Cranberry", + "dill" => "Currant", + "squash" => "Damson", + "lavender" => "Date", + "cymbopogon" => "Dragonfruit", + "marjoram" => "Pitaya", + "oregano" => "Durian", + "parsley" => "Elderberry", + "rosemary" => "Feijoa", + "thyme" => "Fig", + "legumes" => "Finger Lime", + "alfalfa sprouts" => "Caviar Lime", + "azuki beans" => "Goji berry", + "bean sprouts" => "Gooseberry", + "black beans" => "Grape", + "black-eyed peas" => "Raisin", + "borlotti bean" => "Grapefruit", + "broad beans" => "Grewia asiatica", + "chickpeas, garbanzos, or ceci beans" => "Guava", + "green beans" => "Hala Fruit", + "kidney beans" => "Honeyberry", + "lentils" => "Huckleberry", + "lima beans or butter bean" => "Jabuticaba", + "mung beans" => "Jackfruit", + "navy beans" => "Jambul", + "peanuts" => "Japanese plum", + "pinto beans" => "Jostaberry", + "runner beans" => "Jujube", + "split peas" => "Juniper berry", + "soy beans" => "Kaffir Lime", + "peas" => "Kiwano", + "mange tout or snap peas" => "Kiwifruit", + "mushrooms" => "Kumquat", + "nettles" => "Lemon", + "New Zealand spinach" => "Lime", + "okra" => "Loganberry", + "onions" => "Longan", + "chives" => "Loquat", + "garlic" => "Lulo", + "leek" => "Lychee", + "onion" => "Magellan Barberry", + "shallot" => "Mamey Apple", + "scallion" => "Mamey Sapote", + "peppers" => "Mango", + "bell pepper" => "Mangosteen", + "chili pepper" => "Marionberry", + "jalapeño" => "Melon", + "habanero" => "Cantaloupe", + "paprika" => "Galia melon", + "tabasco pepper" => "Honeydew", + "cayenne pepper" => "Mouse melon", + "radicchio" => "Musk melon", + "rhubarb" => "Watermelon", + "root vegetables" => "Miracle fruit", + "beetroot" => "Momordica fruit", + "beet" => "Monstera deliciosa", + "mangelwurzel" => "Mulberry", + "carrot" => "Nance", + "celeriac" => "Nectarine", + "corms" => "Orange", + "eddoe" => "Blood orange", + "konjac" => "Clementine", + "taro" => "Mandarine", + "water chestnut" => "Tangerine", + "ginger" => "Papaya", + "parsnip" => "Passionfruit", + "rutabaga" => "Pawpaw", + "radish" => "Peach", + "wasabi" => "Pear" + ); + + inner_bench("many replaces", c, TEMPLATE, vals, hashmap, slice); +} + +fn inner_bench( + name: &str, + c: &mut Criterion, + template_str: &str, + vals: ValuesFn, + hashmap: HashMap<&str, &str>, + slice: &[(&str, &str)], +) where + F: for<'s> Fn(&'s str) -> Option> + Send + 'static, +{ + c.bench_function(&format!("{name}, fn"), |b| { + b.iter(|| { + let template = Template::parse(black_box(template_str)).unwrap(); + black_box(template.render(&vals).unwrap()); + }) + }); + c.bench_function(&format!("{name}, hashmap"), |b| { + b.iter(|| { + let template = Template::parse(black_box(template_str)).unwrap(); + black_box(template.render(&hashmap).unwrap()); + }) + }); + c.bench_function(&format!("{name}, slice"), |b| { + b.iter(|| { + let template = Template::parse(black_box(template_str)).unwrap(); + black_box(template.render(&slice as &dyn Values).unwrap()); + }) + }); +} + +criterion_group!(one, one_replace); +criterion_group!(some, some_replaces); +criterion_group!(many, many_replaces); +criterion_main!(one, some, many); diff --git a/crates/leon/fuzz/.gitignore b/crates/leon/fuzz/.gitignore new file mode 100644 index 00000000..1a45eee7 --- /dev/null +++ b/crates/leon/fuzz/.gitignore @@ -0,0 +1,4 @@ +target +corpus +artifacts +coverage diff --git a/crates/leon/fuzz/Cargo.lock b/crates/leon/fuzz/Cargo.lock new file mode 100644 index 00000000..9409a0dd --- /dev/null +++ b/crates/leon/fuzz/Cargo.lock @@ -0,0 +1,150 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "arbitrary" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e90af4de65aa7b293ef2d09daff88501eb254f58edde2e1ac02c82d873eadad" + +[[package]] +name = "cc" +version = "1.0.79" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +dependencies = [ + "jobserver", +] + +[[package]] +name = "jobserver" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" +dependencies = [ + "libc", +] + +[[package]] +name = "leon" +version = "0.0.0" +dependencies = [ + "miette", + "thiserror", +] + +[[package]] +name = "leon-fuzz" +version = "0.0.0" +dependencies = [ + "leon", + "libfuzzer-sys", +] + +[[package]] +name = "libc" +version = "0.2.139" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" + +[[package]] +name = "libfuzzer-sys" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "beb09950ae85a0a94b27676cccf37da5ff13f27076aa1adbc6545dd0d0e1bd4e" +dependencies = [ + "arbitrary", + "cc", + "once_cell", +] + +[[package]] +name = "miette" +version = "5.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4afd9b301defa984bbdbe112b4763e093ed191750a0d914a78c1106b2d0fe703" +dependencies = [ + "miette-derive", + "once_cell", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette-derive" +version = "5.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97c2401ab7ac5282ca5c8b518a87635b1a93762b0b90b9990c509888eeccba29" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "once_cell" +version = "1.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" + +[[package]] +name = "proc-macro2" +version = "1.0.51" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "syn" +version = "1.0.107" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "unicode-ident" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" diff --git a/crates/leon/fuzz/Cargo.toml b/crates/leon/fuzz/Cargo.toml new file mode 100644 index 00000000..1801da08 --- /dev/null +++ b/crates/leon/fuzz/Cargo.toml @@ -0,0 +1,27 @@ +[package] +name = "leon-fuzz" +version = "0.0.0" +publish = false +edition = "2021" + +[package.metadata] +cargo-fuzz = true + +[dependencies] +libfuzzer-sys = "0.4" + +[dependencies.leon] +path = ".." + +# Prevent this from interfering with workspaces +[workspace] +members = ["."] + +[profile.release] +debug = 1 + +[[bin]] +name = "parser" +path = "fuzz_targets/parser.rs" +test = false +doc = false diff --git a/crates/leon/fuzz/fuzz_targets/parser.rs b/crates/leon/fuzz/fuzz_targets/parser.rs new file mode 100644 index 00000000..9cd51fe5 --- /dev/null +++ b/crates/leon/fuzz/fuzz_targets/parser.rs @@ -0,0 +1,9 @@ +#![no_main] + +use libfuzzer_sys::fuzz_target; + +fuzz_target!(|data: &[u8]| { + if let Ok(s) = std::str::from_utf8(data) { + let _ = leon::Template::parse(s); + } +}); diff --git a/crates/leon/src/error.rs b/crates/leon/src/error.rs new file mode 100644 index 00000000..6e064e2f --- /dev/null +++ b/crates/leon/src/error.rs @@ -0,0 +1,85 @@ +#[derive(Debug, thiserror::Error)] +#[cfg_attr(feature = "miette", derive(miette::Diagnostic))] +pub enum RenderError { + /// A key was missing from the provided values. + #[error("missing key `{0}`")] + MissingKey(String), + + /// An I/O error passed through from [`Template::render_into`]. + #[error("write failed: {0}")] + Io(#[from] std::io::Error), +} + +/// An error that can occur when parsing a template. +/// +/// When the `miette` feature is enabled, this is a rich miette-powered error +/// which will highlight the source of the error in the template when output +/// (with miette's `fancy` feature). With `miette` disabled, this is opaque. +#[derive(Clone, Debug, thiserror::Error, PartialEq, Eq)] +#[cfg_attr(feature = "miette", derive(miette::Diagnostic))] +#[cfg_attr(feature = "miette", diagnostic(transparent))] +#[error(transparent)] +pub struct ParseError(Box); + +/// The inner (unboxed) type of [`ParseError`]. +#[derive(Clone, Debug, thiserror::Error, PartialEq, Eq)] +#[cfg_attr(feature = "miette", derive(miette::Diagnostic))] +#[error("template parse failed")] +struct InnerParseError { + #[cfg_attr(feature = "miette", source_code)] + src: String, + + #[cfg_attr(feature = "miette", label("This bracket is not opening or closing anything. Try removing it, or escaping it with a backslash."))] + unbalanced: Option<(usize, usize)>, + + #[cfg_attr(feature = "miette", label("This escape is malformed."))] + escape: Option<(usize, usize)>, + + #[cfg_attr(feature = "miette", label("A key cannot be empty."))] + key_empty: Option<(usize, usize)>, + + #[cfg_attr(feature = "miette", label("Escapes are not allowed in keys."))] + key_escape: Option<(usize, usize)>, +} + +impl ParseError { + pub(crate) fn unbalanced(src: &str, start: usize, end: usize) -> Self { + Self(Box::new(InnerParseError { + src: String::from(src), + unbalanced: Some((start, end.saturating_sub(start) + 1)), + escape: None, + key_empty: None, + key_escape: None, + })) + } + + pub(crate) fn escape(src: &str, start: usize, end: usize) -> Self { + Self(Box::new(InnerParseError { + src: String::from(src), + unbalanced: None, + escape: Some((start, end.saturating_sub(start) + 1)), + key_empty: None, + key_escape: None, + })) + } + + pub(crate) fn key_empty(src: &str, start: usize, end: usize) -> Self { + Self(Box::new(InnerParseError { + src: String::from(src), + unbalanced: None, + escape: None, + key_empty: Some((start, end.saturating_sub(start) + 1)), + key_escape: None, + })) + } + + pub(crate) fn key_escape(src: &str, start: usize, end: usize) -> Self { + Self(Box::new(InnerParseError { + src: String::from(src), + unbalanced: None, + escape: None, + key_empty: None, + key_escape: Some((start, end.saturating_sub(start) + 1)), + })) + } +} diff --git a/crates/leon/src/lib.rs b/crates/leon/src/lib.rs new file mode 100644 index 00000000..17eeeeca --- /dev/null +++ b/crates/leon/src/lib.rs @@ -0,0 +1,148 @@ +//! Dead-simple string templating. +//! +//! Leon parses a template string into a list of tokens, and then substitutes +//! provided values in. Unlike other templating engines, it is extremely simple: +//! it supports no logic, only replaces. It is even simpler than `format!()`, +//! albeit with a similar syntax. +//! +//! # Syntax +//! +//! ```plain +//! it is better to rule { group } +//! one can live {adverb} without power +//! ``` +//! +//! A replacement is denoted by `{` and `}`. The contents of the braces, trimmed +//! of any whitespace, are the key. Any text outside of braces is left as-is. +//! +//! To escape a brace, use `\{` or `\}`. To escape a backslash, use `\\`. Keys +//! cannot contain escapes. +//! +//! ```plain +//! \{ leon \} +//! ``` +//! +//! The above examples, given the values `group = "no one"` and +//! `adverb = "honourably"`, would render to: +//! +//! ```plain +//! it is better to rule no one +//! one can live honourably without power +//! { leon } +//! ``` +//! +//! # Usage +//! +//! A template is first parsed to a token list: +//! +//! ``` +//! use leon::Template; +//! +//! let template = Template::parse("hello {name}").unwrap(); +//! ``` +//! +//! The template can be inspected, for example to check if a key is present: +//! +//! ``` +//! # use leon::Template; +//! # +//! # let template = Template::parse("hello {name}").unwrap(); +//! assert!(template.has_key("name")); +//! ``` +//! +//! The template can be rendered to a string: +//! +//! ``` +//! # use leon::Template; +//! use leon::vals; +//! # +//! # let template = Template::parse("hello {name}").unwrap(); +//! assert_eq!( +//! template.render( +//! &vals(|_key| Some("marcus".into())) +//! ).unwrap().as_str(), +//! "hello marcus", +//! ); +//! ``` +//! +//! …or to a writer: +//! +//! ``` +//! use std::io::Write; +//! # use leon::Template; +//! use leon::vals; +//! # +//! # let template = Template::parse("hello {name}").unwrap(); +//! let mut buf: Vec = Vec::new(); +//! template.render_into( +//! &mut buf, +//! &vals(|key| if key == "name" { +//! Some("julius".into()) +//! } else { +//! None +//! }) +//! ).unwrap(); +//! assert_eq!(buf.as_slice(), b"hello julius"); +//! ``` +//! +//! …with a map: +//! +//! ``` +//! use std::collections::HashMap; +//! # use leon::Template; +//! # let template = Template::parse("hello {name}").unwrap(); +//! let mut values = HashMap::new(); +//! values.insert("name", "brutus"); +//! assert_eq!(template.render(&values).unwrap().as_str(), "hello brutus"); +//! ``` +//! +//! …or with your own type, if you implement the [`Values`] trait: +//! +//! ``` +//! # use leon::Template; +//! use std::borrow::Cow; +//! use leon::Values; +//! +//! struct MyMap { +//! name: &'static str, +//! } +//! impl Values for MyMap { +//! fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option> { +//! if key == "name" { +//! Some(self.name.into()) +//! } else { +//! None +//! } +//! } +//! } +//! # +//! # let template = Template::parse("hello {name}").unwrap(); +//! let values = MyMap { name: "pontifex" }; +//! assert_eq!(template.render(&values).unwrap().as_str(), "hello pontifex"); +//! ``` +//! +//! # Errors +//! +//! Leon will return a [`LeonError::InvalidTemplate`] if the template fails to +//! parse. This can happen if there are unbalanced braces, or if a key is empty. +//! +//! Leon will return a [`LeonError::MissingKey`] if a key is missing from keyed +//! values passed to [`Template::render()`], unless a default value is provided +//! with [`Template.default`]. +//! +//! It will also pass through I/O errors when using [`Template::render_into()`]. + +#[doc(inline)] +pub use error::*; + +#[doc(inline)] +pub use template::*; + +#[doc(inline)] +pub use values::*; + +mod error; +mod macros; +mod parser; +mod template; +mod values; diff --git a/crates/leon/src/macros.rs b/crates/leon/src/macros.rs new file mode 100644 index 00000000..3833a3c3 --- /dev/null +++ b/crates/leon/src/macros.rs @@ -0,0 +1,50 @@ +/// Construct a template constant without needing to make an items constant. +/// +/// This is essentially a shorthand for: +/// +/// ``` +/// use leon::{Item, Template}; +/// Template::new({ +/// const ITEMS: &'static [Item<'static>] = &[Item::Text("Hello "), Item::Key("name")]; +/// ITEMS +/// }, Some("world")); +/// ``` +/// +/// # Examples +/// +/// ``` +/// use leon::Item::*; +/// assert_eq!( +/// leon::template!(Text("Hello "), Key("name")) +/// .render(&[("name", "Магда Нахман")]) +/// .unwrap(), +/// "Hello Магда Нахман", +/// ); +/// ``` +/// +/// With a default: +/// +/// ``` +/// use leon::Item::*; +/// assert_eq!( +/// leon::template!(Text("Hello "), Key("name"); "M. P. T. Acharya") +/// .render(&[("city", "Madras")]) +/// .unwrap(), +/// "Hello M. P. T. Acharya", +/// ); +/// ``` +#[macro_export] +macro_rules! template { + ($($item:expr),* $(,)?) => { + $crate::Template::new({ + const ITEMS: &'static [$crate::Item<'static>] = &[$($item),*]; + ITEMS + }, ::core::option::Option::None) + }; + ($($item:expr),* $(,)? ; $default:expr) => { + $crate::Template::new({ + const ITEMS: &'static [$crate::Item<'static>] = &[$($item),*]; + ITEMS + }, ::core::option::Option::Some($default)) + }; +} diff --git a/crates/leon/src/main.rs b/crates/leon/src/main.rs new file mode 100644 index 00000000..acbdb1f5 --- /dev/null +++ b/crates/leon/src/main.rs @@ -0,0 +1,61 @@ +#[cfg(feature = "cli")] +fn main() -> miette::Result<()> { + use std::{collections::HashMap, error::Error, io::stdout}; + + use clap::Parser; + use leon::Template; + + /// Render a Leon template with the given values. + #[derive(Parser, Debug)] + #[command(author, version, about, long_about = None)] + struct Args { + /// Leon template + template: String, + + /// Default to use for missing keys + #[arg(long)] + default: Option, + + /// Use values from the environment + #[arg(long)] + env: bool, + + /// Key-value pairs to use + #[arg(short, long, value_parser = parse_key_val::)] + values: Vec<(String, String)>, + } + + /// Parse a single key-value pair + fn parse_key_val(s: &str) -> Result<(T, U), Box> + where + T: std::str::FromStr, + T::Err: Error + Send + Sync + 'static, + U: std::str::FromStr, + U::Err: Error + Send + Sync + 'static, + { + let (k, v) = s + .split_once('=') + .ok_or_else(|| format!("invalid KEY=value: no `=` found in `{s}`"))?; + Ok((k.parse()?, v.parse()?)) + } + + let args = Args::parse(); + let mut values: HashMap = HashMap::from_iter(args.values); + if args.env { + for (key, value) in std::env::vars() { + values.entry(key).or_insert(value); + } + } + + let template = args.template; + let mut template = Template::parse(&template)?; + if let Some(default) = &args.default { + template.set_default(default); + } + + template.render_into(&mut stdout().lock(), &values)?; + Ok(()) +} + +#[cfg(not(feature = "cli"))] +fn main() {} diff --git a/crates/leon/src/parser.rs b/crates/leon/src/parser.rs new file mode 100644 index 00000000..5f9efb37 --- /dev/null +++ b/crates/leon/src/parser.rs @@ -0,0 +1,565 @@ +use std::mem::replace; + +use crate::{Item, ParseError, Template}; + +#[derive(Debug, Clone, Copy)] +enum Token { + Text { + start: usize, + end: usize, + }, + BracePair { + start: usize, + key_seen: bool, + end: usize, + }, + Escape { + start: usize, + end: usize, + ch: Option, + }, +} + +impl Token { + fn start_text(pos: usize, ch: char) -> Self { + Self::Text { + start: pos, + end: pos + ch.len_utf8(), + } + } + + fn start_text_single(pos: usize) -> Self { + Self::Text { + start: pos, + end: pos, + } + } + + fn start_brace_pair(pos: usize, ch: char) -> Self { + Self::BracePair { + start: pos, + key_seen: false, + end: pos + ch.len_utf8(), + } + } + + fn start_escape(pos: usize, ch: char) -> Self { + Self::Escape { + start: pos, + end: pos + ch.len_utf8(), + ch: None, + } + } + + fn is_empty(&self, source_len: usize) -> bool { + match self { + Self::Text { start, end } => { + *start >= source_len || *end >= source_len || *start > *end + } + Self::BracePair { + start, + key_seen, + end, + } => !key_seen || *start >= source_len || *end >= source_len || *start > *end, + Self::Escape { start, end, .. } => { + *start >= source_len || *end >= source_len || *start > *end + } + } + } + + fn start(&self) -> usize { + match self { + Self::Text { start, .. } + | Self::BracePair { start, .. } + | Self::Escape { start, .. } => *start, + } + } + + fn end(&self) -> usize { + match self { + Self::Text { end, .. } | Self::BracePair { end, .. } | Self::Escape { end, .. } => *end, + } + } + + fn set_end(&mut self, pos: usize) { + match self { + Self::Text { end, .. } | Self::BracePair { end, .. } | Self::Escape { end, .. } => { + *end = pos + } + } + } +} + +impl<'s> Template<'s> { + pub(crate) fn parse_items(s: &'s str) -> Result>, ParseError> { + let source_len = s.len(); + let mut tokens = Vec::new(); + + let mut current = Token::start_text(0, '\0'); + + for (pos, chara) in s.char_indices() { + match (&mut current, chara) { + (tok @ (Token::Text { .. } | Token::Escape { ch: Some(_), .. }), ch @ '{') => { + if matches!(tok, Token::Text { .. }) && tok.start() == pos { + *tok = Token::start_brace_pair(pos, ch); + } else { + if let Token::Text { end, .. } = tok { + *end = pos - 1; + } + tokens.push(replace(tok, Token::start_brace_pair(pos, ch))); + } + } + (txt @ Token::Text { .. }, ch @ '\\') => { + if txt.is_empty(source_len) || txt.start() == pos { + *txt = Token::start_escape(pos, ch); + } else { + if let Token::Text { end, .. } = txt { + *end = pos - 1; + } + tokens.push(replace(txt, Token::start_escape(pos, ch))); + } + } + (bp @ Token::BracePair { .. }, '}') => { + if let Token::BracePair { end, .. } = bp { + *end = pos; + } else { + unreachable!("bracepair isn't bracepair"); + } + + tokens.push(replace(bp, Token::start_text_single(pos + 1))); + } + (Token::BracePair { start, .. }, '\\') => { + return Err(ParseError::key_escape(s, *start, pos)); + } + (Token::BracePair { key_seen, end, .. }, ws) if ws.is_whitespace() => { + if *key_seen { + *end = pos; + } else { + // We're in a brace pair, but we're not in the key yet. + } + } + (Token::BracePair { key_seen, end, .. }, _) => { + *key_seen = true; + *end = pos + 1; + } + (Token::Text { .. }, '}') => { + return Err(ParseError::unbalanced(s, pos, pos)); + } + (Token::Text { end, .. }, _) => { + *end = pos; + } + (esc @ Token::Escape { .. }, es @ ('\\' | '{' | '}')) => { + if let Token::Escape { start, end, ch, .. } = esc { + if ch.is_none() { + *end = pos; + *ch = Some(es); + } else if es == '\\' { + // A new escape right after a completed escape. + tokens.push(replace(esc, Token::start_escape(pos, es))); + } else if es == '{' { + // A new brace pair right after a completed escape, should be handled prior to this. + unreachable!("escape followed by brace pair, unhandled"); + } else { + // } right after a completed escape, probably unreachable but just in case: + return Err(ParseError::key_escape(s, *start, pos)); + } + } else { + unreachable!("escape is not an escape"); + } + } + ( + Token::Escape { + start, ch: None, .. + }, + _, + ) => { + return Err(ParseError::escape(s, *start, pos)); + } + (Token::Escape { ch: Some(_), .. }, _) => { + tokens.push(replace(&mut current, Token::start_text_single(pos))); + } + } + } + + if !current.is_empty(source_len) { + if current.end() < source_len - 1 { + current.set_end(source_len - 1); + } + + tokens.push(current); + } + + if let Token::BracePair { start, end, .. } = current { + return Err(ParseError::unbalanced(s, start, end)); + } + + if let Token::Escape { + start, + end, + ch: None, + } = current + { + return Err(ParseError::escape(s, start, end)); + } + + let mut items = Vec::with_capacity(tokens.len()); + for token in tokens { + match token { + Token::Text { start, end } => { + items.push(Item::Text(&s[start..=end])); + } + Token::BracePair { + start, + end, + key_seen: false, + } => { + return Err(ParseError::key_empty(s, start, end)); + } + Token::BracePair { + start, + end, + key_seen: true, + } => { + let key = s[start..=end] + .trim_matches(|c: char| c.is_whitespace() || c == '{' || c == '}'); + if key.is_empty() { + return Err(ParseError::key_empty(s, start, end)); + } else { + items.push(Item::Key(key)); + } + } + Token::Escape { + ch: Some(_), end, .. + } => { + items.push(Item::Text(&s[end..=end])); + } + Token::Escape { + ch: None, + start, + end, + } => { + return Err(ParseError::escape(s, start, end)); + } + } + } + + Ok(items) + } +} + +#[cfg(test)] +mod test_valid { + use crate::{template, Item::*, Template}; + + #[test] + fn empty() { + let template = Template::parse("").unwrap(); + assert_eq!(template, Template::default()); + } + + #[test] + fn no_keys() { + let template = Template::parse("hello world").unwrap(); + assert_eq!(template, template!(Text("hello world"))); + } + + #[test] + fn leading_key() { + let template = Template::parse("{salutation} world").unwrap(); + assert_eq!(template, template!(Key("salutation"), Text(" world"))); + } + + #[test] + fn trailing_key() { + let template = Template::parse("hello {name}").unwrap(); + assert_eq!(template, template!(Text("hello "), Key("name"))); + } + + #[test] + fn middle_key() { + let template = Template::parse("hello {name}!").unwrap(); + assert_eq!(template, template!(Text("hello "), Key("name"), Text("!"))); + } + + #[test] + fn middle_text() { + let template = Template::parse("{salutation} good {title}").unwrap(); + assert_eq!( + template, + template!(Key("salutation"), Text(" good "), Key("title")) + ); + } + + #[test] + fn multiline() { + let template = Template::parse( + " + And if thy native country was { ancient civilisation }, + What need to slight thee? Came not {hero} thence, + Who gave to { country } her books and art of writing? + ", + ) + .unwrap(); + assert_eq!( + template, + template!( + Text("\n And if thy native country was "), + Key("ancient civilisation"), + Text(",\n What need to slight thee? Came not "), + Key("hero"), + Text(" thence,\n Who gave to "), + Key("country"), + Text(" her books and art of writing?\n "), + ) + ); + } + + #[test] + fn key_no_whitespace() { + let template = Template::parse("{word}").unwrap(); + assert_eq!(template, template!(Key("word"))); + } + + #[test] + fn key_leading_whitespace() { + let template = Template::parse("{ word}").unwrap(); + assert_eq!(template, template!(Key("word"))); + } + + #[test] + fn key_trailing_whitespace() { + let template = Template::parse("{word\n}").unwrap(); + assert_eq!(template, template!(Key("word"))); + } + + #[test] + fn key_both_whitespace() { + let template = Template::parse( + "{ + \tword + }", + ) + .unwrap(); + assert_eq!(template, template!(Key("word"))); + } + + #[test] + fn key_inner_whitespace() { + let template = Template::parse("{ a word }").unwrap(); + assert_eq!(template, template!(Key("a word"))); + } + + #[test] + fn escape_left() { + let template = Template::parse(r"this \{ single left brace").unwrap(); + assert_eq!( + template, + template!(Text("this "), Text("{"), Text(" single left brace")) + ); + } + + #[test] + fn escape_right() { + let template = Template::parse(r"this \} single right brace").unwrap(); + assert_eq!( + template, + template!(Text("this "), Text("}"), Text(" single right brace")) + ); + } + + #[test] + fn escape_both() { + let template = Template::parse(r"these \{ two \} braces").unwrap(); + assert_eq!( + template, + template!( + Text("these "), + Text("{"), + Text(" two "), + Text("}"), + Text(" braces") + ) + ); + } + + #[test] + fn escape_doubled() { + let template = Template::parse(r"these \{\{ four \}\} braces").unwrap(); + assert_eq!( + template, + template!( + Text("these "), + Text("{"), + Text("{"), + Text(" four "), + Text("}"), + Text("}"), + Text(" braces") + ) + ); + } + + #[test] + fn escape_escape() { + let template = Template::parse(r"these \\ backslashes \\\\").unwrap(); + assert_eq!( + template, + template!( + Text("these "), + Text(r"\"), + Text(" backslashes "), + Text(r"\"), + Text(r"\"), + ) + ); + } + + #[test] + fn escape_before_key() { + let template = Template::parse(r"\\{ a } \{{ b } \}{ c }").unwrap(); + assert_eq!( + template, + template!( + Text(r"\"), + Key("a"), + Text(" "), + Text(r"{"), + Key("b"), + Text(" "), + Text(r"}"), + Key("c"), + ) + ); + } + + #[test] + fn escape_after_key() { + let template = Template::parse(r"{ a }\\ { b }\{ { c }\}").unwrap(); + assert_eq!( + template, + template!( + Key("a"), + Text(r"\"), + Text(" "), + Key("b"), + Text(r"{"), + Text(" "), + Key("c"), + Text(r"}"), + ) + ); + } + + #[test] + fn multibyte_texts() { + let template = Template::parse("幸徳 {particle} 秋水").unwrap(); + assert_eq!( + template, + template!(Text("幸徳 "), Key("particle"), Text(" 秋水")) + ); + } + + #[test] + fn multibyte_key() { + let template = Template::parse("The { 連盟 }").unwrap(); + assert_eq!(template, template!(Text("The "), Key("連盟"))); + } + + #[test] + fn multibyte_both() { + let template = Template::parse("大杉 {栄}").unwrap(); + assert_eq!(template, template!(Text("大杉 "), Key("栄"))); + } + + #[test] + fn multibyte_whitespace() { + let template = Template::parse("岩佐 作{ 太 }郎").unwrap(); + assert_eq!(template, template!(Text("岩佐 作"), Key("太"), Text("郎"))); + } + + #[test] + fn multibyte_with_escapes() { + let template = Template::parse(r"日本\{アナキスト\}連盟").unwrap(); + assert_eq!( + template, + template!( + Text("日本"), + Text(r"{"), + Text("アナキスト"), + Text(r"}"), + Text("連盟") + ) + ); + } + + #[test] + fn multibyte_rtl_text() { + let template = Template::parse("محمد صايل").unwrap(); + assert_eq!(template, template!(Text("محمد صايل"))); + } + + #[test] + fn multibyte_rtl_key() { + let template = Template::parse("محمد {ريشة}").unwrap(); + assert_eq!(template, template!(Text("محمد "), Key("ريشة"))); + } +} + +#[cfg(test)] +mod test_error { + use crate::{ParseError, Template}; + + #[test] + fn key_left_half() { + let template = Template::parse("{ open").unwrap_err(); + assert_eq!(template, ParseError::unbalanced("{ open", 0, 6)); + } + + #[test] + fn key_right_half() { + let template = Template::parse("open }").unwrap_err(); + assert_eq!(template, ParseError::unbalanced("open }", 5, 5)); + } + + #[test] + fn key_with_half_escape() { + let template = Template::parse(r"this is { not \ allowed }").unwrap_err(); + assert_eq!( + template, + ParseError::key_escape(r"this is { not \ allowed }", 8, 14) + ); + } + + #[test] + fn key_with_full_escape() { + let template = Template::parse(r"{ not \} allowed }").unwrap_err(); + assert_eq!( + template, + ParseError::key_escape(r"{ not \} allowed }", 0, 6) + ); + } + + #[test] + fn key_empty() { + let template = Template::parse(r"void: {}").unwrap_err(); + assert_eq!(template, ParseError::key_empty(r"void: {}", 6, 7)); + } + + #[test] + fn key_only_whitespace() { + let template = Template::parse(r"nothing: { }").unwrap_err(); + assert_eq!(template, ParseError::key_empty(r"nothing: { }", 9, 11)); + } + + #[test] + fn bad_escape() { + let template = Template::parse(r"not \a thing").unwrap_err(); + assert_eq!(template, ParseError::escape(r"not \a thing", 4, 5)); + } + + #[test] + fn end_escape() { + let template = Template::parse(r"forget me not \").unwrap_err(); + assert_eq!(template, ParseError::escape(r"forget me not \", 14, 15)); + } +} diff --git a/crates/leon/src/template.rs b/crates/leon/src/template.rs new file mode 100644 index 00000000..bf32e92d --- /dev/null +++ b/crates/leon/src/template.rs @@ -0,0 +1,198 @@ +use std::{borrow::Cow, fmt::Display, io::Write, ops::Add}; + +use crate::{ParseError, RenderError, Values}; + +#[derive(Clone, Debug, Default, PartialEq, Eq)] +pub struct Template<'s> { + pub items: Cow<'s, [Item<'s>]>, + pub default: Option>, +} + +#[derive(Clone, Debug, PartialEq, Eq)] +pub enum Item<'s> { + Text(&'s str), + Key(&'s str), +} + +impl<'s> Template<'s> { + /// Construct a template with the given items and default. + /// + /// You can write a template literal without any help by constructing it directly: + /// + /// ``` + /// use std::borrow::Cow; + /// use leon::{Item, Template}; + /// const TEMPLATE: Template = Template { + /// items: Cow::Borrowed({ + /// const ITEMS: &'static [Item<'static>] = &[ + /// Item::Text("Hello"), + /// Item::Key("name"), + /// ]; + /// ITEMS + /// }), + /// default: None, + /// }; + /// assert_eq!(TEMPLATE.render(&[("name", "world")]).unwrap(), "Helloworld"); + /// ``` + /// + /// As that's a bit verbose, using this function and the enum shorthands can be helpful: + /// + /// ``` + /// use leon::{Item, Item::*, Template}; + /// const TEMPLATE: Template = Template::new({ + /// const ITEMS: &'static [Item<'static>] = &[Text("Hello "), Key("name")]; + /// ITEMS + /// }, Some("world")); + /// + /// assert_eq!(TEMPLATE.render(&[("unrelated", "value")]).unwrap(), "Hello world"); + /// ``` + /// + /// For an even more ergonomic syntax, see the [`leon::template!`] macro. + pub const fn new(items: &'s [Item<'s>], default: Option<&'s str>) -> Template<'s> { + Template { + items: Cow::Borrowed(items), + default: match default { + Some(default) => Some(Cow::Borrowed(default)), + None => None, + }, + } + } + + /// Parse a template from a string. + /// + /// # Syntax + /// + /// ```plain + /// it is better to rule { group } + /// one can live {adverb} without power + /// ``` + /// + /// A replacement is denoted by `{` and `}`. The contents of the braces, trimmed + /// of any whitespace, are the key. Any text outside of braces is left as-is. + /// + /// To escape a brace, use `\{` or `\}`. To escape a backslash, use `\\`. Keys + /// cannot contain escapes. + /// + /// ```plain + /// \{ leon \} + /// ``` + /// + /// The above examples, given the values `group = "no one"` and + /// `adverb = "honourably"`, would render to: + /// + /// ```plain + /// it is better to rule no one + /// one can live honourably without power + /// { leon } + /// ``` + /// + /// # Example + /// + /// ``` + /// use leon::Template; + /// let template = Template::parse("hello {name}").unwrap(); + /// ``` + /// + pub fn parse(s: &'s str) -> Result { + Self::parse_items(s).map(|items| Template { + items: Cow::Owned(items), + default: None, + }) + } + + pub fn render_into( + &self, + writer: &mut dyn Write, + values: &dyn Values, + ) -> Result<(), RenderError> { + for token in self.items.as_ref() { + match token { + Item::Text(text) => writer.write_all(text.as_bytes())?, + Item::Key(key) => { + if let Some(value) = values.get_value(key) { + writer.write_all(value.as_bytes())?; + } else if let Some(default) = &self.default { + writer.write_all(default.as_bytes())?; + } else { + return Err(RenderError::MissingKey(key.to_string())); + } + } + } + } + Ok(()) + } + + pub fn render(&self, values: &dyn Values) -> Result { + let mut buf = Vec::with_capacity( + self.items + .iter() + .map(|item| match item { + Item::Key(_) => 0, + Item::Text(t) => t.len(), + }) + .sum(), + ); + self.render_into(&mut buf, values)?; + + // UNWRAP: We know that the buffer is valid UTF-8 because we only write strings. + Ok(String::from_utf8(buf).unwrap()) + } + + pub fn has_key(&self, key: &str) -> bool { + self.has_keys(&[key]) + } + + pub fn has_keys(&self, keys: &[&str]) -> bool { + self.items.iter().any(|token| match token { + Item::Key(k) => keys.contains(k), + _ => false, + }) + } + + pub fn keys(&self) -> impl Iterator { + self.items.iter().filter_map(|token| match token { + Item::Key(k) => Some(k), + _ => None, + }) + } + + /// Sets the default value for this template. + pub fn set_default(&mut self, default: &dyn Display) { + self.default = Some(Cow::Owned(default.to_string())); + } +} + +impl<'s> Add for Template<'s> { + type Output = Self; + + fn add(mut self, rhs: Self) -> Self::Output { + self.items + .to_mut() + .extend(rhs.items.as_ref().iter().cloned()); + if let Some(default) = rhs.default { + self.default = Some(default); + } + self + } +} + +#[cfg(test)] +mod test { + use crate::Item::{Key, Text}; + + #[test] + fn concat_templates() { + let t1 = crate::template!(Text("Hello"), Key("name")); + let t2 = crate::template!(Text("have a"), Key("adjective"), Text("day")); + assert_eq!( + t1 + t2, + crate::template!( + Text("Hello"), + Key("name"), + Text("have a"), + Key("adjective"), + Text("day") + ), + ); + } +} diff --git a/crates/leon/src/values.rs b/crates/leon/src/values.rs new file mode 100644 index 00000000..3e7d8ca9 --- /dev/null +++ b/crates/leon/src/values.rs @@ -0,0 +1,133 @@ +use std::{ + borrow::{Borrow, Cow}, + collections::{BTreeMap, HashMap}, + hash::{BuildHasher, Hash}, +}; + +pub trait Values { + fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option>; +} + +impl Values for &T +where + T: Values, +{ + fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option> { + T::get_value(self, key) + } +} + +impl Values for [(K, V)] +where + K: AsRef, + V: AsRef, +{ + fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option> { + self.iter().find_map(|(k, v)| { + if k.as_ref() == key { + Some(Cow::Borrowed(v.as_ref())) + } else { + None + } + }) + } +} + +impl Values for &[(K, V)] +where + K: AsRef, + V: AsRef, +{ + fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option> { + (*self).get_value(key) + } +} + +impl Values for [(K, V); N] +where + K: AsRef, + V: AsRef, +{ + fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option> { + self.as_slice().get_value(key) + } +} + +impl Values for Vec<(K, V)> +where + K: AsRef, + V: AsRef, +{ + fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option> { + self.as_slice().get_value(key) + } +} + +impl Values for HashMap +where + K: Borrow + Eq + Hash, + V: AsRef, + S: BuildHasher, +{ + fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option> { + self.get(key).map(|v| Cow::Borrowed(v.as_ref())) + } +} + +impl Values for BTreeMap +where + K: Borrow + Ord, + V: AsRef, +{ + fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option> { + self.get(key).map(|v| Cow::Borrowed(v.as_ref())) + } +} + +/// Workaround to allow using functions as [`Values`]. +/// +/// As this isn't constructible you'll want to use [`vals()`] instead. +pub struct ValuesFn +where + F: for<'s> Fn(&'s str) -> Option> + Send + 'static, +{ + inner: F, +} + +impl Values for ValuesFn +where + F: for<'s> Fn(&'s str) -> Option> + Send + 'static, +{ + fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option> { + (self.inner)(key) + } +} + +impl From for ValuesFn +where + F: for<'s> Fn(&'s str) -> Option> + Send + 'static, +{ + fn from(inner: F) -> Self { + Self { inner } + } +} + +/// Workaround to allow using functions as [`Values`]. +/// +/// Wraps your function so it implements [`Values`]. +/// +/// # Example +/// +/// ``` +/// use leon::{Values, vals}; +/// +/// fn use_values(_values: impl Values) {} +/// +/// use_values(vals(|_| Some("hello".into()))); +/// ``` +pub const fn vals(func: F) -> ValuesFn +where + F: for<'s> Fn(&'s str) -> Option> + Send + 'static, +{ + ValuesFn { inner: func } +} From 0d730b5e9516231f5cd3e5be803b2decde6e9fa9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 01:59:36 +0000 Subject: [PATCH 1146/2020] release: leon v1.0.0 (#931) Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/leon/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1e5b44b1..46ce173a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1243,7 +1243,7 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "leon" -version = "0.0.1" +version = "1.0.0" dependencies = [ "clap 4.1.11", "criterion", diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index b12324d1..7e0cc17e 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -3,7 +3,7 @@ name = "leon" description = "Dead-simple string templating" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/leon" -version = "0.0.1" +version = "1.0.0" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From 849d9ef9eebf0d8b64a4ce4f208a955faca8e2ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 Mar 2023 02:10:27 +0000 Subject: [PATCH 1147/2020] Bump reqwest from 0.11.14 to 0.11.15 (#930) --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 46ce173a..c1331248 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1820,9 +1820,9 @@ checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" [[package]] name = "reqwest" -version = "0.11.14" +version = "0.11.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21eed90ec8570952d53b772ecf8f206aa1ec9a3d76b2521c56c42973f2d91ee9" +checksum = "0ba30cc2c0cd02af1222ed216ba659cdb2f879dfe3181852fe7c50b1d0005949" dependencies = [ "async-compression", "base64 0.21.0", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index d46846df..58c41bdf 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -22,7 +22,7 @@ flate2 = { version = "1.0.25", default-features = false } futures-lite = { version = "1.12.0", default-features = false } generic-array = "0.14.6" httpdate = "1.0.2" -reqwest = { version = "0.11.14", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } +reqwest = { version = "0.11.15", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } serde = { version = "1.0.157", features = ["derive"], optional = true } serde_json = { version = "1.0.94", optional = true } # Use a fork here since we need PAX support, but the upstream From 44923d25cae5be2c93064d2afcbb59ee931f84e8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 21 Mar 2023 18:22:23 +1100 Subject: [PATCH 1148/2020] Rewrite `Template::parse_items`: More readable & better perf (#932) Replace the algorithm with explicit state and complex matching with a loop that encodes state in the current structure of the loop. The new code is much more readable and might be more performant since it uses `str::find`/`str::split_once` to look for next token instead of manually iterating over `str::chars`. Signed-off-by: Jiahao XU --- crates/leon/src/parser.rs | 290 ++++++++------------------------------ 1 file changed, 59 insertions(+), 231 deletions(-) diff --git a/crates/leon/src/parser.rs b/crates/leon/src/parser.rs index 5f9efb37..963775fc 100644 --- a/crates/leon/src/parser.rs +++ b/crates/leon/src/parser.rs @@ -1,249 +1,77 @@ -use std::mem::replace; - use crate::{Item, ParseError, Template}; -#[derive(Debug, Clone, Copy)] -enum Token { - Text { - start: usize, - end: usize, - }, - BracePair { - start: usize, - key_seen: bool, - end: usize, - }, - Escape { - start: usize, - end: usize, - ch: Option, - }, -} - -impl Token { - fn start_text(pos: usize, ch: char) -> Self { - Self::Text { - start: pos, - end: pos + ch.len_utf8(), - } - } - - fn start_text_single(pos: usize) -> Self { - Self::Text { - start: pos, - end: pos, - } - } - - fn start_brace_pair(pos: usize, ch: char) -> Self { - Self::BracePair { - start: pos, - key_seen: false, - end: pos + ch.len_utf8(), - } - } - - fn start_escape(pos: usize, ch: char) -> Self { - Self::Escape { - start: pos, - end: pos + ch.len_utf8(), - ch: None, - } - } - - fn is_empty(&self, source_len: usize) -> bool { - match self { - Self::Text { start, end } => { - *start >= source_len || *end >= source_len || *start > *end - } - Self::BracePair { - start, - key_seen, - end, - } => !key_seen || *start >= source_len || *end >= source_len || *start > *end, - Self::Escape { start, end, .. } => { - *start >= source_len || *end >= source_len || *start > *end - } - } - } - - fn start(&self) -> usize { - match self { - Self::Text { start, .. } - | Self::BracePair { start, .. } - | Self::Escape { start, .. } => *start, - } - } - - fn end(&self) -> usize { - match self { - Self::Text { end, .. } | Self::BracePair { end, .. } | Self::Escape { end, .. } => *end, - } - } - - fn set_end(&mut self, pos: usize) { - match self { - Self::Text { end, .. } | Self::BracePair { end, .. } | Self::Escape { end, .. } => { - *end = pos - } - } - } -} - impl<'s> Template<'s> { - pub(crate) fn parse_items(s: &'s str) -> Result>, ParseError> { - let source_len = s.len(); - let mut tokens = Vec::new(); + pub(crate) fn parse_items(source: &'s str) -> Result>, ParseError> { + let mut items = Vec::new(); - let mut current = Token::start_text(0, '\0'); + let mut start = 0; + let mut s = source; - for (pos, chara) in s.char_indices() { - match (&mut current, chara) { - (tok @ (Token::Text { .. } | Token::Escape { ch: Some(_), .. }), ch @ '{') => { - if matches!(tok, Token::Text { .. }) && tok.start() == pos { - *tok = Token::start_brace_pair(pos, ch); - } else { - if let Token::Text { end, .. } = tok { - *end = pos - 1; + loop { + if let Some(index) = s.find(['\\', '{', '}']) { + if index != 0 { + let (first, last) = s.split_at(index); + items.push(Item::Text(first)); + + // Move cursor forward + start += index; + s = last; + } + } else { + if !s.is_empty() { + items.push(Item::Text(s)); + } + + break Ok(items); + }; + + let mut chars = s.chars(); + let ch = chars.next().unwrap(); + + match ch { + '\\' => { + match chars.next() { + Some('\\' | '{' | '}') => { + let t = s.get(1..2).unwrap(); + debug_assert!(["\\", "{", "}"].contains(&t), "{}", t); + items.push(Item::Text(t)); + + // Move cursor forward + start += 2; + s = s.get(2..).unwrap(); + } + _ => { + return Err(ParseError::escape(source, start, start + 1)); } - tokens.push(replace(tok, Token::start_brace_pair(pos, ch))); } } - (txt @ Token::Text { .. }, ch @ '\\') => { - if txt.is_empty(source_len) || txt.start() == pos { - *txt = Token::start_escape(pos, ch); - } else { - if let Token::Text { end, .. } = txt { - *end = pos - 1; - } - tokens.push(replace(txt, Token::start_escape(pos, ch))); - } - } - (bp @ Token::BracePair { .. }, '}') => { - if let Token::BracePair { end, .. } = bp { - *end = pos; - } else { - unreachable!("bracepair isn't bracepair"); + '{' => { + let Some((key, rest)) = s[1..].split_once('}') else { + return Err(ParseError::unbalanced(source, start, start + s.len())); + }; + if let Some(index) = key.find('\\') { + return Err(ParseError::key_escape(source, start, start + 1 + index)); } - tokens.push(replace(bp, Token::start_text_single(pos + 1))); - } - (Token::BracePair { start, .. }, '\\') => { - return Err(ParseError::key_escape(s, *start, pos)); - } - (Token::BracePair { key_seen, end, .. }, ws) if ws.is_whitespace() => { - if *key_seen { - *end = pos; - } else { - // We're in a brace pair, but we're not in the key yet. + let k = key.trim(); + if k.is_empty() { + return Err(ParseError::key_empty(source, start, start + key.len() + 1)); } + items.push(Item::Key(k)); + + // Move cursor forward + // for the '{' + // | for the '}' + // | | + start += 1 + key.len() + 1; + s = rest; } - (Token::BracePair { key_seen, end, .. }, _) => { - *key_seen = true; - *end = pos + 1; - } - (Token::Text { .. }, '}') => { - return Err(ParseError::unbalanced(s, pos, pos)); - } - (Token::Text { end, .. }, _) => { - *end = pos; - } - (esc @ Token::Escape { .. }, es @ ('\\' | '{' | '}')) => { - if let Token::Escape { start, end, ch, .. } = esc { - if ch.is_none() { - *end = pos; - *ch = Some(es); - } else if es == '\\' { - // A new escape right after a completed escape. - tokens.push(replace(esc, Token::start_escape(pos, es))); - } else if es == '{' { - // A new brace pair right after a completed escape, should be handled prior to this. - unreachable!("escape followed by brace pair, unhandled"); - } else { - // } right after a completed escape, probably unreachable but just in case: - return Err(ParseError::key_escape(s, *start, pos)); - } - } else { - unreachable!("escape is not an escape"); - } - } - ( - Token::Escape { - start, ch: None, .. - }, - _, - ) => { - return Err(ParseError::escape(s, *start, pos)); - } - (Token::Escape { ch: Some(_), .. }, _) => { - tokens.push(replace(&mut current, Token::start_text_single(pos))); + '}' => { + return Err(ParseError::unbalanced(source, start, start)); } + _ => unreachable!(), } } - - if !current.is_empty(source_len) { - if current.end() < source_len - 1 { - current.set_end(source_len - 1); - } - - tokens.push(current); - } - - if let Token::BracePair { start, end, .. } = current { - return Err(ParseError::unbalanced(s, start, end)); - } - - if let Token::Escape { - start, - end, - ch: None, - } = current - { - return Err(ParseError::escape(s, start, end)); - } - - let mut items = Vec::with_capacity(tokens.len()); - for token in tokens { - match token { - Token::Text { start, end } => { - items.push(Item::Text(&s[start..=end])); - } - Token::BracePair { - start, - end, - key_seen: false, - } => { - return Err(ParseError::key_empty(s, start, end)); - } - Token::BracePair { - start, - end, - key_seen: true, - } => { - let key = s[start..=end] - .trim_matches(|c: char| c.is_whitespace() || c == '{' || c == '}'); - if key.is_empty() { - return Err(ParseError::key_empty(s, start, end)); - } else { - items.push(Item::Key(key)); - } - } - Token::Escape { - ch: Some(_), end, .. - } => { - items.push(Item::Text(&s[end..=end])); - } - Token::Escape { - ch: None, - start, - end, - } => { - return Err(ParseError::escape(s, start, end)); - } - } - } - - Ok(items) } } From 8b83e150bb0fe19a0fdbeeec97cf824bd3744486 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 22 Mar 2023 21:22:11 +1100 Subject: [PATCH 1149/2020] Bump transitive deps using `cargo update --aggressive` (#935) Signed-off-by: Jiahao XU --- Cargo.lock | 319 +++++++++++++++++++++++++++-------------------------- 1 file changed, 163 insertions(+), 156 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c1331248..2781245a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -84,7 +84,7 @@ checksum = "86ea188f25f0255d8f92797797c97ebf5631fa88178beb1a46fdf5622c9a00e4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.3", + "syn 2.0.5", ] [[package]] @@ -279,9 +279,9 @@ checksum = "487f1e0fcbe47deb8b0574e646def1c903389d95241dd1bbcc6ce4a715dfc0c1" [[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", ] @@ -309,9 +309,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.11.1" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" [[package]] name = "byteorder" @@ -382,7 +382,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f83bc2e401ed041b7057345ebc488c005efa0341d5541ce7004d30458d0090b" dependencies = [ "serde", - "toml 0.7.1", + "toml 0.7.3", ] [[package]] @@ -402,9 +402,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a20104e2335ce8a659d6dd92a51a767a0c062599c73b343fd152cb401e828c3d" +checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" dependencies = [ "jobserver", ] @@ -462,7 +462,7 @@ checksum = "42dfd32784433290c51d92c438bb72ea5063797fc3cc9a21a8c4346bebbb2098" dependencies = [ "bitflags 2.0.2", "clap_derive", - "clap_lex 0.3.1", + "clap_lex 0.3.3", "is-terminal", "once_cell", "strsim", @@ -479,7 +479,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -493,9 +493,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "783fe232adfca04f90f56201b26d79682d4cd2625e0bc7290b95123afe558ade" +checksum = "033f6b7a4acb1f358c742aaca805c939ee73b4c6209ae4318ec7aca81c42e646" dependencies = [ "os_str_bytes", ] @@ -677,9 +677,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.31" +version = "0.8.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9852635589dc9f9ea1b6fe9f05b50ef208c85c834a562f0c6abb1c475736ec2b" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" dependencies = [ "cfg-if", ] @@ -693,7 +693,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -719,9 +719,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" dependencies = [ "instant", ] @@ -734,14 +734,14 @@ checksum = "bbe20e5f282c61432e5cf0e33185e5dde032b2c2e4281c4735c31ce5b455a869" [[package]] name = "filetime" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e884668cd0c7480504233e951174ddc3b382f7c2666e3b7310b5c4e7b0c37f9" +checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" dependencies = [ "cfg-if", "libc", "redox_syscall", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -805,24 +805,24 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5317663a9089767a1ec00a487df42e0ca174b61b4483213ac24448e4664df5" +checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec90ff4d0fe1f57d600049061dc6bb68ed03c7d2fbd697274c41805dcb3f8608" +checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" [[package]] name = "futures-io" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfb8371b6fb2aeb2d280374607aeabfc99d95c72edfe51692e42d3d7f0d08531" +checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" [[package]] name = "futures-lite" @@ -836,32 +836,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a73af87da33b5acf53acfebdc339fe592ecf5357ac7c0a7734ab9d8c876a70" +checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] name = "futures-sink" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f310820bb3e8cfd46c80db4d7fb8353e15dfff853a127158425f31e0be6c8364" +checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" [[package]] name = "futures-task" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf79a1bf610b10f42aea489289c5a2c478a786509693b80cd39c44ccd936366" +checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" [[package]] name = "futures-util" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1d6de3acfef38d2be4b1f543f553131788603495be83da675e180c8d6b7bd1" +checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" dependencies = [ "futures-core", "futures-io", @@ -918,9 +918,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.0" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec7af912d60cdbd3677c1af9352ebae6fb8394d165568a2234df0fa00f87793" +checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" [[package]] name = "guess_host_triple" @@ -936,9 +936,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f9f29bc9dda355256b2916cf526ab02ce0aeaaaf2bad60d65ef3f12f11dd0f4" +checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" dependencies = [ "bytes", "fnv", @@ -970,9 +970,9 @@ 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" @@ -992,6 +992,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + [[package]] name = "home" version = "0.5.4" @@ -1014,9 +1020,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" +checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" dependencies = [ "bytes", "fnv", @@ -1048,9 +1054,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.23" +version = "0.14.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "034711faac9d2166cb1baf1a2fb0b60b1f277f8492fd72176c17f3515e1abd3c" +checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" dependencies = [ "bytes", "futures-channel", @@ -1144,12 +1150,13 @@ checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" [[package]] name = "io-lifetimes" -version = "1.0.4" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7d6c6f8c91b4b9ed43484ad1a938e393caf35960fce7f82a040497207bd8e9e" +checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" dependencies = [ + "hermit-abi 0.3.1", "libc", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -1172,14 +1179,14 @@ checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" [[package]] name = "is-terminal" -version = "0.4.2" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28dfb6c8100ccc63462345b67d1bbc3679177c75ee4bf59bf29c8b1d110b8189" +checksum = "8687c819457e979cc940d09cb16e42a1bf70aa6b60a549de6d3a62a0ee90c69e" dependencies = [ - "hermit-abi 0.2.6", - "io-lifetimes 1.0.4", - "rustix 0.36.6", - "windows-sys 0.42.0", + "hermit-abi 0.3.1", + "io-lifetimes 1.0.9", + "rustix 0.36.11", + "windows-sys 0.45.0", ] [[package]] @@ -1199,15 +1206,15 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" [[package]] name = "jobserver" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" dependencies = [ "libc", ] @@ -1228,9 +1235,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.60" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" dependencies = [ "wasm-bindgen", ] @@ -1255,9 +1262,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.139" +version = "0.2.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" [[package]] name = "libmimalloc-sys" @@ -1344,9 +1351,9 @@ checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" [[package]] name = "matches" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" +checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" [[package]] name = "maybe-owned" @@ -1391,7 +1398,7 @@ checksum = "2a07ad93a80d1b92bb44cb42d7c49b49c9aab1778befefad49cceb5e4c5bf460" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -1405,9 +1412,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 = "miniz_oxide" @@ -1420,14 +1427,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d732bc30207a6423068df043e3d02e0735b155ad7ce1a6f76fe2baa5b158de" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" dependencies = [ "libc", "log", "wasi", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -1450,9 +1457,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a58d1d356c6597d08cde02c2f09d785b09e28711837b1ed667dc652c08a694" +checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" dependencies = [ "bitflags 1.3.2", "cfg-if", @@ -1495,9 +1502,9 @@ dependencies = [ [[package]] name = "object" -version = "0.30.2" +version = "0.30.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b8c786513eb403643f2a88c244c2aaa270ef2153f55094587d0c48a3cf22a83" +checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" dependencies = [ "memchr", ] @@ -1516,9 +1523,9 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "openssl" -version = "0.10.45" +version = "0.10.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b102428fd03bc5edf97f62620f7298614c45cedf287c271e7ed450bbaf83f2e1" +checksum = "d8b277f87dacc05a6b709965d1cbafac4649d6ce9f3ce9ceb88508b5666dfec9" dependencies = [ "bitflags 1.3.2", "cfg-if", @@ -1537,7 +1544,7 @@ checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -1548,9 +1555,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.80" +version = "0.9.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" +checksum = "a95792af3c4e0153c3914df2261bedd30a98476f94dc892b67dfe1d89d433a04" dependencies = [ "autocfg", "cc", @@ -1561,9 +1568,9 @@ dependencies = [ [[package]] name = "os_str_bytes" -version = "6.4.1" +version = "6.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" [[package]] name = "overload" @@ -1589,15 +1596,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.6" +version = "0.9.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", "redox_syscall", "smallvec", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -1623,7 +1630,7 @@ checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -1659,7 +1666,7 @@ dependencies = [ "proc-macro-error-attr", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", "version_check", ] @@ -1676,9 +1683,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.52" +version = "1.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d0e1ae9e836cc3beddd63db0df682593d7e2d3d891ae8c9083d2113e1744224" +checksum = "ba466839c78239c09faf015484e5cc04860f88242cff4d03eb038f04b4699b73" dependencies = [ "unicode-ident", ] @@ -1803,9 +1810,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" +checksum = "cce168fea28d3e05f158bda4576cf0c844d5045bc2cc3620fa0292ed5bb5814c" dependencies = [ "aho-corasick", "memchr", @@ -1814,9 +1821,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.28" +version = "0.6.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "reqwest" @@ -1920,16 +1927,16 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.6" +version = "0.36.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4feacf7db682c6c329c4ede12649cd36ecab0f3be5b7d74e6a20304725db4549" +checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" dependencies = [ "bitflags 1.3.2", "errno", - "io-lifetimes 1.0.4", + "io-lifetimes 1.0.9", "libc", "linux-raw-sys 0.1.4", - "windows-sys 0.42.0", + "windows-sys 0.45.0", ] [[package]] @@ -1976,15 +1983,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" +checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" [[package]] name = "ryu" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" [[package]] name = "same-file" @@ -2022,9 +2029,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.7.0" +version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bc1bb97804af6631813c55739f771071e0f2ed33ee20b68c86ec505d906356c" +checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -2035,9 +2042,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.6.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0160a13a177a45bfb43ce71c01580998474f556ad854dcbca936dd2841a5c556" +checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" dependencies = [ "core-foundation-sys", "libc", @@ -2078,7 +2085,7 @@ checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad" dependencies = [ "proc-macro2", "quote", - "syn 2.0.3", + "syn 2.0.5", ] [[package]] @@ -2137,18 +2144,18 @@ dependencies = [ [[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", ] [[package]] name = "slab" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" dependencies = [ "autocfg", ] @@ -2167,9 +2174,9 @@ checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" [[package]] name = "socket2" -version = "0.4.7" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e2d2db9033d13a1567121ddd7a095ee144db4e1ca1b1bda3419bc0da294ebd" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" dependencies = [ "libc", "winapi", @@ -2209,7 +2216,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -2242,9 +2249,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.107" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", @@ -2253,9 +2260,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.3" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8234ae35e70582bfa0f1fedffa6daa248e41dd045310b19800c4a36382c8f60" +checksum = "89c2d1c76a26822187a1fbb5964e3fff108bc208f02e820ab9dac1234f6b388a" dependencies = [ "proc-macro2", "quote", @@ -2271,7 +2278,7 @@ dependencies = [ "cfg-if", "fastrand", "redox_syscall", - "rustix 0.36.6", + "rustix 0.36.11", "windows-sys 0.42.0", ] @@ -2328,15 +2335,16 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.3", + "syn 2.0.5", ] [[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", ] @@ -2361,9 +2369,9 @@ dependencies = [ [[package]] name = "tinyvec_macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" +checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" @@ -2393,14 +2401,14 @@ checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] name = "tokio-native-tls" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" +checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" dependencies = [ "native-tls", "tokio", @@ -2419,9 +2427,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" +checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" dependencies = [ "futures-core", "pin-project-lite", @@ -2468,9 +2476,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.1" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "772c1426ab886e7362aedf4abc9c0d1348a979517efedfc25862944d10137af0" +checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21" dependencies = [ "serde", "serde_spanned", @@ -2550,7 +2558,7 @@ checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", ] [[package]] @@ -2674,15 +2682,15 @@ checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "unicode-bidi" -version = "0.3.8" +version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" +checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" [[package]] name = "unicode-linebreak" @@ -2773,12 +2781,11 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" dependencies = [ "same-file", - "winapi", "winapi-util", ] @@ -2800,9 +2807,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2810,24 +2817,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.33" +version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" +checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" dependencies = [ "cfg-if", "js-sys", @@ -2837,9 +2844,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2847,22 +2854,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" dependencies = [ "proc-macro2", "quote", - "syn 1.0.107", + "syn 1.0.109", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.83" +version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" [[package]] name = "wasm-streams" @@ -2879,9 +2886,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.60" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" dependencies = [ "js-sys", "wasm-bindgen", @@ -3084,7 +3091,7 @@ version = "0.12.3+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" dependencies = [ - "zstd-safe 6.0.3+zstd.1.5.2", + "zstd-safe 6.0.4+zstd.1.5.4", ] [[package]] @@ -3099,9 +3106,9 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "6.0.3+zstd.1.5.2" +version = "6.0.4+zstd.1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e4a3f57d13d0ab7e478665c60f35e2a613dcd527851c2c7287ce5c787e134a" +checksum = "7afb4b54b8910cf5447638cb54bf4e8a65cbedd783af98b98c62ffe91f185543" dependencies = [ "libc", "zstd-sys", From b69d8c25cb12e15ba6183592a297692f0d239a88 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 22 Mar 2023 21:58:37 +1100 Subject: [PATCH 1150/2020] Enable `--no-symlinks` by default and fix `sccache` installation (#936) Partially resolve #731 Using symlinks not only add unnecessary bloat to users' `$CARGO_HOME/bin` directory, but it actually breaks `sccache`, which inspects its binary name and decides how to act on. For `sccache` to function, it must be invoked directly or use a hard link. Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index d234711b..cedab272 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -154,14 +154,10 @@ pub struct Args { #[clap(help_heading = "Overrides", long)] pub no_discover_github_token: bool, - /// Disable symlinking / versioned updates. + /// This flag is now enabled by default thus a no-op. /// - /// By default, Binstall will install a binary named `-` in the install path, and - /// either symlink or copy it to (depending on platform) the plain binary name. This makes it - /// possible to have multiple versions of the same binary, for example for testing or rollback. - /// - /// Pass this flag to disable this behavior. - #[clap(help_heading = "Options", long)] + /// By default, Binstall will install a binary as-is in the install path. + #[clap(help_heading = "Options", long, default_value_t = true)] pub no_symlinks: bool, /// Dry run, fetch and show changes without installing binaries. From 0291259fa5a03f16c69e6c7751c3eb5dda59c524 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 22 Mar 2023 22:23:15 +1100 Subject: [PATCH 1151/2020] release: detect-targets v0.1.7 (#937) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2781245a..808945d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -612,7 +612,7 @@ checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" [[package]] name = "detect-targets" -version = "0.1.6" +version = "0.1.7" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index bb6e77c4..65d8b0b9 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -25,5 +25,5 @@ toml_edit = { version = "0.19.7", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.6", path = "../detect-targets" } +detect-targets = { version = "0.1.7", path = "../detect-targets" } tempfile = "3.4.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 4f72e97f..cd88760d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -16,7 +16,7 @@ binstalk-types = { version = "0.3.0", path = "../binstalk-types" } cargo_toml = "0.15.2" command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } -detect-targets = { version = "0.1.6", path = "../detect-targets" } +detect-targets = { version = "0.1.7", path = "../detect-targets" } either = "1.8.1" home = "0.5.4" itertools = "0.10.5" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 9766dcf4..ce6a3074 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.6" +version = "0.1.7" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From 9ae7f40ea91f45cb143b16a2989cf99d06fc676c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 22 Mar 2023 22:53:51 +1100 Subject: [PATCH 1152/2020] release: binstalk-manifests v0.4.1 (#938) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 808945d8..400ae1ae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -221,7 +221,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.4.0" +version = "0.4.1" dependencies = [ "beef", "binstalk-types", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 57975f35..cc850f0b 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.10.0", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.4.0" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.4.1" } clap = { version = "4.1.11", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.0" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 65d8b0b9..041583b2 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.4.0" +version = "0.4.1" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From e58a79846fa96d83005b9b05546d64004742319c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 22 Mar 2023 23:27:01 +1100 Subject: [PATCH 1153/2020] release: binstalk-downloader v0.4.2 (#939) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 400ae1ae..6a7895df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -188,7 +188,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.4.1" +version = "0.4.2" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 58c41bdf..234595b0 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.4.1" +version = "0.4.2" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index cd88760d..b1d43102 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.67" -binstalk-downloader = { version = "0.4.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.4.2", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.3.0", path = "../binstalk-types" } cargo_toml = "0.15.2" command-group = { version = "2.1.0", features = ["with-tokio"] } From b43d0c9dfe24a8dcc16e5ba00d9559734de3c447 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Mar 2023 00:12:42 +1100 Subject: [PATCH 1154/2020] release: binstalk v0.11.0 (#940) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6a7895df..1b1f5a24 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -156,7 +156,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.10.0" +version = "0.11.0" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index cc850f0b..3dc5ead8 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.10.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.11.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.4.1" } clap = { version = "4.1.11", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index b1d43102..99e5d4e6 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.10.0" +version = "0.11.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From 17610963de46228d5dcfaa0f0511e8b600941b96 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 23 Mar 2023 00:44:11 +1100 Subject: [PATCH 1155/2020] release: cargo-binstall v0.22.0 (#941) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1b1f5a24..80f91148 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -348,7 +348,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.21.3" +version = "0.22.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 3dc5ead8..63cfd0f9 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.21.3" +version = "0.22.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 11939830..a6c1ee66 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 9a59119163b4b4223fbd3561c746d11cd91b6d92 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 23 Mar 2023 00:50:13 +1100 Subject: [PATCH 1156/2020] Fully remove all caches for PR in `cache-cleanup.yml` (#942) Previously it only removes 30 caches for the PR because gh actions-cache list defaults to only listing 30 cache entries. In this PR, I changed the limit to the maximum allowed 100 cache entries and I also added a loop to keep getting the next 100 cache entries until there is none. Signed-off-by: Jiahao XU --- .github/workflows/cache-cleanup.yml | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/.github/workflows/cache-cleanup.yml b/.github/workflows/cache-cleanup.yml index 23de39f3..fd6bc47e 100644 --- a/.github/workflows/cache-cleanup.yml +++ b/.github/workflows/cache-cleanup.yml @@ -12,19 +12,26 @@ jobs: - name: Cleanup run: | gh extension install actions/gh-actions-cache - - REPO=${{ github.repository }} + + REPO="${{ github.repository }}" BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge" - echo "Fetching list of cache key" - cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 ) + while true; do + echo "Fetching list of cache key" + cacheKeysForPR="$(gh actions-cache list -R "$REPO" -B "$BRANCH" -L 100 | cut -f 1 )" - ## Setting this to not fail the workflow while deleting cache keys. - set +e - echo "Deleting caches..." - for cacheKey in $cacheKeysForPR - do - gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm + if [ -z "$cacheKeysForPR" ]; then + break + fi + + ## Setting this to not fail the workflow while deleting cache keys. + set +e + echo "Deleting caches..." + for cacheKey in $cacheKeysForPR + do + echo Removing "$cacheKey" + gh actions-cache delete "$cacheKey" -R "$REPO" -B "$BRANCH" --confirm + done done echo "Done" env: From 2ebc39478c59310776e525987348907c329f2642 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 23 Mar 2023 14:35:01 +1100 Subject: [PATCH 1157/2020] Bump toml_edit from 0.19.7 to 0.19.8 (#943) Bumps [toml_edit](https://github.com/ordian/toml_edit) from 0.19.7 to 0.19.8. - [Release notes](https://github.com/ordian/toml_edit/releases) - [Commits](https://github.com/ordian/toml_edit/compare/v0.19.7...v0.19.8) --- updated-dependencies: - dependency-name: toml_edit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/binstalk-manifests/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 80f91148..6f31eeb2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2497,9 +2497,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.7" +version = "0.19.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc18466501acd8ac6a3f615dd29a3438f8ca6bb3b19537138b3106e575621274" +checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" dependencies = [ "indexmap", "serde", @@ -3042,9 +3042,9 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "winnow" -version = "0.3.6" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d020b441f92996c80d94ae9166e8501e59c7bb56121189dc9eab3bd8216966" +checksum = "deac0939bd6e4f24ab5919fbf751c97a8cfc8543bb083a305ed5c0c10bb241d1" dependencies = [ "memchr", ] diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 041583b2..b2beec94 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.157", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.94" thiserror = "1.0.40" -toml_edit = { version = "0.19.7", features = ["serde"] } +toml_edit = { version = "0.19.8", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] From 47d4aeaa96cd478fdd6cc97165b70240da44497b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 23 Mar 2023 18:10:30 +1100 Subject: [PATCH 1158/2020] Run cache-cleanup at 3am & 4:30am AEST instead of after every PR (#944) since cache-cleanup will issue a lot of gh api requests, running the workflow right after the PRs would cause the GH API to rate limit all workflows (including our CI for testing and release) that they can no longer upload artifacts and `cargo-binstall` would have to fallback to sending GET requests instead of using GH API, which makes it a lot slower and more likely to fail. This PR changes it to be run at 3am and 4:30am AEST which nobody would submit any PR at that time and then remove all caches of the top 20 closed prs. The workflow can also now be triggered manually. Signed-off-by: Jiahao XU --- .github/workflows/cache-cleanup.yml | 34 ++++++++++------------------- cleanup-cache.sh | 25 +++++++++++++++++++++ 2 files changed, 37 insertions(+), 22 deletions(-) create mode 100755 cleanup-cache.sh diff --git a/.github/workflows/cache-cleanup.yml b/.github/workflows/cache-cleanup.yml index fd6bc47e..1e8da6ba 100644 --- a/.github/workflows/cache-cleanup.yml +++ b/.github/workflows/cache-cleanup.yml @@ -1,8 +1,12 @@ name: Cleanup caches for closed PRs + on: - pull_request: - types: - - closed + # Run twice every day to remove the cache so that the caches from the closed prs + # are removed. + schedule: + - cron: "0 17 * * *" + - cron: "30 18 * * *" + workflow_dispatch: jobs: cleanup: @@ -13,26 +17,12 @@ jobs: run: | gh extension install actions/gh-actions-cache - REPO="${{ github.repository }}" - BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge" + export REPO="${{ github.repository }}" - while true; do - echo "Fetching list of cache key" - cacheKeysForPR="$(gh actions-cache list -R "$REPO" -B "$BRANCH" -L 100 | cut -f 1 )" - - if [ -z "$cacheKeysForPR" ]; then - break - fi - - ## Setting this to not fail the workflow while deleting cache keys. - set +e - echo "Deleting caches..." - for cacheKey in $cacheKeysForPR - do - echo Removing "$cacheKey" - gh actions-cache delete "$cacheKey" -R "$REPO" -B "$BRANCH" --confirm + gh pr list --state closed -L 20 --json number --jq '.[]|.number' | ( + while IFS='$\n' read -r closed_pr; do + BRANCH="refs/pull/${closed_pr}/merge" ./cleanup-cache.sh done - done - echo "Done" + ) env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/cleanup-cache.sh b/cleanup-cache.sh new file mode 100755 index 00000000..5c38d86a --- /dev/null +++ b/cleanup-cache.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -uxo pipefail + +REPO="${REPO?}" +BRANCH="${BRANCH?}" + +while true; do + echo "Fetching list of cache key for $BRANCH" + cacheKeysForPR="$(gh actions-cache list -R "$REPO" -B "$BRANCH" -L 100 | cut -f 1 )" + + if [ -z "$cacheKeysForPR" ]; then + break + fi + + ## Setting this to not fail the workflow while deleting cache keys. + set +e + echo "Deleting caches..." + for cacheKey in $cacheKeysForPR + do + echo Removing "$cacheKey" + gh actions-cache delete "$cacheKey" -R "$REPO" -B "$BRANCH" --confirm + done +done +echo "Done cleaning up $BRANCH" From a27d5aebf6afe3e49aadb53244f3d0c30095b5a4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 26 Mar 2023 16:11:10 +1100 Subject: [PATCH 1159/2020] Use leon for template in binstalk & detect malformed pkg-url/pkg-fmt early (#933) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed #851 * Add new dep leon to crate binstalk * Add new variant `BinstallError::Template{Parse, Render}Error` * Use `leon::Template` in mod `bins` * Use `leon::Template` in mod `fetchers::gh_crate_meta` * Refactor mod `bins`: Rm unused associated fn & fields from `Context` * Simplify unit testing in mod `fetchers::gh_crate_meta` * Rm soft-deprecated field `fetchers::gh_crate_meta::Context::format` and change the `match` to resolve `archive` => `self.archive_format`. * Make macro_rules `leon::template!` far easier to use * Construct `leon::Template<'_>` as constant in `gh_crate_meta::hosting` * Simplify `leon::Values` trait Change its method `get_value` signature to ```rust fn get_value(&self, key: &str) -> Option>; ``` Now, `ValuesFn` also accepts non-`'static` function, but now `leon::Values` is only implemented for `&ValuesFn` now. This makes it a little bit more cumbersome to use but I think it's a reasonable drawback. * Rm `Send` bound req from `ValuesFn` * Impl new fn `leon::Template::cast` for casting `Template<'s>` to `Template<'t>` where `'s: 't` * Rename `leon::Template::has_keys` => `has_any_of_keys` * Make checking whether format related keys are present more robust * Optimize `GhCrateMeta::launch_baseline_find_tasks`: Skip checking all fmt ext if none of the format related keys ("format", "archive-format", "archive-suffix") are present. * Only ret `.exe` in `PkgFmt::extensions` on windows by adding a new param `is_windows: bool` * Improve debug msg in `GhCrateMeta::fetch_and_extract` * Add warnings to `GhCrateMeta::find` * Rm dep tinytemplate * `impl<'s, 'rhs: 's> ops::AddAssign<&Template<'rhs>> for Template<'s>` * `impl<'s, 'rhs: 's> ops::AddAssign> for Template<'s>` * `impl<'s, 'item: 's> ops::AddAssign> for Template<'s>` * `impl<'s, 'item: 's> ops::AddAssign<&Item<'item>> for Template<'s>` * `impl<'s, 'rhs: 's> ops::Add> for Template<'s>` (improved existing `Add` impl) * `impl<'s, 'rhs: 's> ops::Add<&Template<'rhs>> for Template<'s>` * `impl<'s, 'item: 's> ops::Add> for Template<'s>` * `impl<'s, 'item: 's> ops::Add<&Item<'item>> for Template<'s>` Signed-off-by: Jiahao XU Co-authored-by: Félix Saparelli --- Cargo.lock | 2 +- .../cargo_toml_binstall/package_formats.rs | 13 +- crates/binstalk/Cargo.toml | 2 +- crates/binstalk/src/bins.rs | 31 +-- crates/binstalk/src/errors.rs | 34 ++- crates/binstalk/src/fetchers/gh_crate_meta.rs | 219 ++++++++++-------- .../src/fetchers/gh_crate_meta/hosting.rs | 99 +++++--- crates/binstalk/src/ops/resolve.rs | 8 +- crates/leon/src/lib.rs | 6 +- crates/leon/src/macros.rs | 136 +++++++++-- crates/leon/src/parser.rs | 123 +++------- crates/leon/src/template.rs | 114 +++++++-- crates/leon/src/values.rs | 37 ++- 13 files changed, 512 insertions(+), 312 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6f31eeb2..49ac3c13 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -169,6 +169,7 @@ dependencies = [ "home", "itertools", "jobslot", + "leon", "maybe-owned", "miette", "normalize-path", @@ -178,7 +179,6 @@ dependencies = [ "strum", "tempfile", "thiserror", - "tinytemplate", "tokio", "tracing", "url", diff --git a/crates/binstalk-types/src/cargo_toml_binstall/package_formats.rs b/crates/binstalk-types/src/cargo_toml_binstall/package_formats.rs index 46a82ca1..8619bddc 100644 --- a/crates/binstalk-types/src/cargo_toml_binstall/package_formats.rs +++ b/crates/binstalk-types/src/cargo_toml_binstall/package_formats.rs @@ -46,14 +46,23 @@ impl PkgFmt { /// List of possible file extensions for the format /// (with prefix `.`). - pub fn extensions(self) -> &'static [&'static str] { + /// + /// * `is_windows` - if true and `self == PkgFmt::Bin`, then it will return + /// `.exe` in additional to other bin extension names. + pub fn extensions(self, is_windows: bool) -> &'static [&'static str] { match self { PkgFmt::Tar => &[".tar"], PkgFmt::Tbz2 => &[".tbz2", ".tar.bz2"], PkgFmt::Tgz => &[".tgz", ".tar.gz"], PkgFmt::Txz => &[".txz", ".tar.xz"], PkgFmt::Tzstd => &[".tzstd", ".tzst", ".tar.zst"], - PkgFmt::Bin => &[".bin", ".exe", ""], + PkgFmt::Bin => { + if is_windows { + &[".bin", "", ".exe"] + } else { + &[".bin", ""] + } + } PkgFmt::Zip => &[".zip"], } } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 99e5d4e6..a5533a97 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -21,6 +21,7 @@ either = "1.8.1" home = "0.5.4" itertools = "0.10.5" jobslot = { version = "0.2.10", features = ["tokio"] } +leon = { version = "1.0.0", path = "../leon" } maybe-owned = "0.3.4" miette = "5.6.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } @@ -30,7 +31,6 @@ serde = { version = "1.0.157", features = ["derive"] } strum = "0.24.1" tempfile = "3.4.0" thiserror = "1.0.40" -tinytemplate = "1.2.1" # parking_lot for `tokio::sync::OnceCell::const_new` tokio = { version = "1.26.0", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } tracing = "0.1.37" diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 2e216b55..0b95ef76 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -5,9 +5,8 @@ use std::{ }; use compact_str::{format_compact, CompactString}; +use leon::Template; use normalize_path::NormalizePath; -use serde::Serialize; -use tinytemplate::TinyTemplate; use tracing::debug; use crate::{ @@ -80,7 +79,7 @@ impl BinFile { pub fn new( data: &Data<'_>, base_name: &str, - tt: &TinyTemplate, + tt: &Template<'_>, no_symlinks: bool, ) -> Result { let binary_ext = if data.target.contains("windows") { @@ -95,7 +94,6 @@ impl BinFile { target: data.target, version: data.version, bin: base_name, - format: binary_ext, binary_ext, }; @@ -107,7 +105,7 @@ impl BinFile { } else { // Generate install paths // Source path is the download dir + the generated binary path - let path = ctx.render_with_compiled_tt(tt)?; + let path = tt.render(&ctx)?; let path_normalized = Path::new(&path).normalize(); @@ -238,7 +236,7 @@ pub struct Data<'a> { pub install_path: &'a Path, } -#[derive(Clone, Debug, Serialize)] +#[derive(Clone, Debug)] struct Context<'c> { pub name: &'c str, pub repo: Option<&'c str>, @@ -246,18 +244,23 @@ struct Context<'c> { pub version: &'c str, pub bin: &'c str, - /// Soft-deprecated alias for binary-ext - pub format: &'c str, - /// Filename extension on the binary, i.e. .exe on Windows, nothing otherwise - #[serde(rename = "binary-ext")] pub binary_ext: &'c str, } -impl<'c> Context<'c> { - /// * `tt` - must have a template with name "bin_dir" - fn render_with_compiled_tt(&self, tt: &TinyTemplate) -> Result { - Ok(tt.render("bin_dir", self)?) +impl leon::Values for Context<'_> { + fn get_value<'s>(&'s self, key: &str) -> Option> { + match key { + "name" => Some(Cow::Borrowed(self.name)), + "repo" => self.repo.map(Cow::Borrowed), + "target" => Some(Cow::Borrowed(self.target)), + "version" => Some(Cow::Borrowed(self.version)), + "bin" => Some(Cow::Borrowed(self.bin)), + "binary-ext" => Some(Cow::Borrowed(self.binary_ext)), + // Soft-deprecated alias for binary-ext + "format" => Some(Cow::Borrowed(self.binary_ext)), + _ => None, + } } } diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index edd222b4..8fb1f3dd 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -11,7 +11,6 @@ use cargo_toml::Error as CargoTomlError; use compact_str::CompactString; use miette::{Diagnostic, Report}; use thiserror::Error; -use tinytemplate::error::Error as TinyTemplateError; use tokio::task; use tracing::{error, warn}; @@ -82,13 +81,33 @@ pub enum BinstallError { #[diagnostic(severity(error), code(binstall::url_parse))] UrlParse(#[from] url::ParseError), - /// A rendering error in a template. + /// Failed to parse template. /// /// - Code: `binstall::template` /// - Exit: 67 + #[error(transparent)] + #[diagnostic(severity(error), code(binstall::template))] + #[source_code(transparent)] + #[label(transparent)] + TemplateParseError( + #[from] + #[diagnostic_source] + leon::ParseError, + ), + + /// Failed to render template. + /// + /// - Code: `binstall::template` + /// - Exit: 69 #[error("Failed to render template: {0}")] #[diagnostic(severity(error), code(binstall::template))] - Template(Box), + #[source_code(transparent)] + #[label(transparent)] + TemplateRenderError( + #[from] + #[diagnostic_source] + leon::RenderError, + ), /// Failed to download or failed to decode the body. /// @@ -308,7 +327,8 @@ impl BinstallError { TaskJoinError(_) => 17, UserAbort => 32, UrlParse(_) => 65, - Template(_) => 67, + TemplateParseError(..) => 67, + TemplateRenderError(..) => 69, Download(_) => 68, SubProcess { .. } => 70, Io(_) => 74, @@ -404,12 +424,6 @@ impl From for BinstallError { } } -impl From for BinstallError { - fn from(e: TinyTemplateError) -> Self { - BinstallError::Template(Box::new(e)) - } -} - impl From for BinstallError { fn from(e: CargoTomlError) -> Self { BinstallError::CargoManifest(Box::new(e)) diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 8f93cea4..1fb193a5 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -1,12 +1,10 @@ -use std::{borrow::Cow, future::Future, iter, path::Path, sync::Arc}; +use std::{borrow::Cow, iter, path::Path, sync::Arc}; use compact_str::{CompactString, ToCompactString}; use either::Either; -use itertools::Itertools; +use leon::Template; use once_cell::sync::OnceCell; -use serde::Serialize; use strum::IntoEnumIterator; -use tinytemplate::TinyTemplate; use tracing::{debug, warn}; use url::Url; @@ -35,36 +33,41 @@ pub struct GhCrateMeta { resolution: OnceCell<(Url, PkgFmt)>, } -type FindTaskRes = Result, BinstallError>; - impl GhCrateMeta { - /// * `tt` - must have added a template named "pkg_url". - fn launch_baseline_find_tasks<'a>( - &'a self, + fn launch_baseline_find_tasks( + &self, + futures_resolver: &FuturesResolver<(Url, PkgFmt), BinstallError>, pkg_fmt: PkgFmt, - tt: &'a TinyTemplate, - pkg_url: &'a str, - repo: Option<&'a str>, - ) -> impl Iterator + 'static> + 'a { - // build up list of potential URLs - let urls = pkg_fmt - .extensions() - .iter() - .filter_map(move |ext| { - let ctx = - Context::from_data_with_repo(&self.data, &self.target_data.target, ext, repo); - match ctx.render_url_with_compiled_tt(tt, pkg_url) { - Ok(url) => Some(url), - Err(err) => { - warn!("Failed to render url for {ctx:#?}: {err}"); - None - } + pkg_url: &Template<'_>, + repo: Option<&str>, + ) { + let render_url = |ext| { + let ctx = Context::from_data_with_repo(&self.data, &self.target_data.target, ext, repo); + match ctx.render_url_with_compiled_tt(pkg_url) { + Ok(url) => Some(url), + Err(err) => { + warn!("Failed to render url for {ctx:#?}: {err}"); + None } - }) - .dedup(); + } + }; + + let is_windows = self.target_data.target.contains("windows"); + + let urls = if pkg_url.has_any_of_keys(&["format", "archive-format", "archive-suffix"]) { + // build up list of potential URLs + Either::Left( + pkg_fmt + .extensions(is_windows) + .iter() + .filter_map(|ext| render_url(Some(ext))), + ) + } else { + Either::Right(render_url(None).into_iter()) + }; // go check all potential URLs at once - urls.map(move |url| { + futures_resolver.extend(urls.map(move |url| { let client = self.client.clone(); let gh_api_client = self.gh_api_client.clone(); @@ -73,7 +76,7 @@ impl GhCrateMeta { .await? .then_some((url, pkg_fmt))) } - }) + })); } } @@ -101,10 +104,10 @@ impl super::Fetcher for GhCrateMeta { let mut pkg_fmt = self.target_data.meta.pkg_fmt; let pkg_urls = if let Some(pkg_url) = self.target_data.meta.pkg_url.as_deref() { + let template = Template::parse(pkg_url)?; + if pkg_fmt.is_none() - && !(pkg_url.contains("format") - || pkg_url.contains("archive-format") - || pkg_url.contains("archive-suffix")) + && !template.has_any_of_keys(&["format", "archive-format", "archive-suffix"]) { // The crate does not specify the pkg-fmt, yet its pkg-url // template doesn't contains format, archive-format or @@ -115,23 +118,36 @@ impl super::Fetcher for GhCrateMeta { // just a best-effort pkg_fmt = PkgFmt::guess_pkg_format(pkg_url); + let crate_name = &self.data.name; + let version = &self.data.version; + let target = &self.target_data.target; + if pkg_fmt.is_none() { return Err(InvalidPkgFmtError { - crate_name: self.data.name.clone(), - version: self.data.version.clone(), - target: self.target_data.target.clone(), + crate_name: crate_name.clone(), + version: version.clone(), + target: target.clone(), pkg_url: pkg_url.to_string(), reason: "pkg-fmt is not specified, yet pkg-url does not contain format, archive-format or archive-suffix which is required for automatically deducing pkg-fmt", } .into()); } + + warn!( + "Crate {crate_name}@{version} on target {target} does not specify pkg-fmt \ + but its pkg-url also does not contain key format, archive-format or \ + archive-suffix.\nbinstall was able to guess that from pkg-url, but \ + just note that it could be wrong:\npkg-fmt=\"{pkg_fmt}\", pkg-url=\"{pkg_url}\"", + pkg_fmt = pkg_fmt.unwrap(), + ); } - Either::Left(iter::once(Cow::Borrowed(pkg_url))) + + Either::Left(iter::once(template)) } else if let Some(repo) = repo.as_ref() { if let Some(pkg_urls) = RepositoryHost::guess_git_hosting_services(repo)?.get_default_pkg_url_template() { - Either::Right(pkg_urls.map(Cow::Owned)) + Either::Right(pkg_urls.map(Template::cast)) } else { warn!( concat!( @@ -172,16 +188,12 @@ impl super::Fetcher for GhCrateMeta { // Iterate over pkg_urls first to avoid String::clone. for pkg_url in pkg_urls { - let mut tt = TinyTemplate::new(); - - tt.add_template("pkg_url", &pkg_url)?; - // Clone iter pkg_fmts to ensure all pkg_fmts is // iterated over for each pkg_url, which is // basically cartesian product. // | for pkg_fmt in pkg_fmts.clone() { - resolver.extend(this.launch_baseline_find_tasks(pkg_fmt, &tt, &pkg_url, repo)); + this.launch_baseline_find_tasks(&resolver, pkg_fmt, &pkg_url, repo); } } @@ -197,7 +209,10 @@ impl super::Fetcher for GhCrateMeta { async fn fetch_and_extract(&self, dst: &Path) -> Result { let (url, pkg_fmt) = self.resolution.get().unwrap(); // find() is called first - debug!("Downloading package from: '{url}' dst:{dst:?} fmt:{pkg_fmt:?}"); + debug!( + "Downloading package from: '{url}' dst:{} fmt:{pkg_fmt:?}", + dst.display() + ); Ok(Download::new(self.client.clone(), url.clone()) .and_extract(*pkg_fmt, dst) .await?) @@ -242,50 +257,67 @@ impl super::Fetcher for GhCrateMeta { } /// Template for constructing download paths -#[derive(Clone, Debug, Serialize)] +#[derive(Clone, Debug)] struct Context<'c> { pub name: &'c str, pub repo: Option<&'c str>, pub target: &'c str, pub version: &'c str, - /// Soft-deprecated alias for archive-format - pub format: &'c str, - /// Archive format e.g. tar.gz, zip - #[serde(rename = "archive-format")] - pub archive_format: &'c str, + pub archive_format: Option<&'c str>, - #[serde(rename = "archive-suffix")] - pub archive_suffix: &'c str, + pub archive_suffix: Option<&'c str>, /// Filename extension on the binary, i.e. .exe on Windows, nothing otherwise - #[serde(rename = "binary-ext")] pub binary_ext: &'c str, } +impl leon::Values for Context<'_> { + fn get_value<'s>(&'s self, key: &str) -> Option> { + match key { + "name" => Some(Cow::Borrowed(self.name)), + "repo" => self.repo.map(Cow::Borrowed), + "target" => Some(Cow::Borrowed(self.target)), + "version" => Some(Cow::Borrowed(self.version)), + + "archive-format" => self.archive_format.map(Cow::Borrowed), + + // Soft-deprecated alias for archive-format + "format" => self.archive_format.map(Cow::Borrowed), + + "archive-suffix" => self.archive_suffix.map(Cow::Borrowed), + + "binary-ext" => Some(Cow::Borrowed(self.binary_ext)), + + _ => None, + } + } +} + impl<'c> Context<'c> { pub(self) fn from_data_with_repo( data: &'c Data, target: &'c str, - archive_suffix: &'c str, + archive_suffix: Option<&'c str>, repo: Option<&'c str>, ) -> Self { - let archive_format = if archive_suffix.is_empty() { - // Empty archive_suffix means PkgFmt::Bin - "bin" - } else { - debug_assert!(archive_suffix.starts_with('.'), "{archive_suffix}"); + let archive_format = archive_suffix.map(|archive_suffix| { + if archive_suffix.is_empty() { + // Empty archive_suffix means PkgFmt::Bin + "bin" + } else { + debug_assert!(archive_suffix.starts_with('.'), "{archive_suffix}"); - &archive_suffix[1..] - }; + &archive_suffix[1..] + } + }); Self { name: &data.name, repo, target, version: &data.version, - format: archive_format, archive_format, archive_suffix, binary_ext: if target.contains("windows") { @@ -298,31 +330,31 @@ impl<'c> Context<'c> { #[cfg(test)] pub(self) fn from_data(data: &'c Data, target: &'c str, archive_format: &'c str) -> Self { - Self::from_data_with_repo(data, target, archive_format, data.repo.as_deref()) + Self::from_data_with_repo(data, target, Some(archive_format), data.repo.as_deref()) } /// * `tt` - must have added a template named "pkg_url". pub(self) fn render_url_with_compiled_tt( &self, - tt: &TinyTemplate, - template: &str, + tt: &Template<'_>, ) -> Result { - debug!("Render {template} using context: {self:?}"); + debug!("Render {tt:#?} using context: {self:?}"); - Ok(Url::parse(&tt.render("pkg_url", self)?)?) + Ok(Url::parse(&tt.render(self)?)?) } #[cfg(test)] pub(self) fn render_url(&self, template: &str) -> Result { - let mut tt = TinyTemplate::new(); - tt.add_template("pkg_url", template)?; - self.render_url_with_compiled_tt(&tt, template) + debug!("Render {template} using context in render_url: {self:?}"); + + let tt = Template::parse(template)?; + self.render_url_with_compiled_tt(&tt) } } #[cfg(test)] mod test { - use crate::manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}; + use crate::manifests::cargo_toml_binstall::PkgMeta; use super::{super::Data, Context}; use compact_str::ToCompactString; @@ -365,10 +397,7 @@ mod test { #[test] fn no_repo_but_full_url() { - let meta = PkgMeta { - pkg_url: Some(format!("https://example.com{DEFAULT_PKG_URL}")), - ..Default::default() - }; + let pkg_url = &format!("https://example.com{}", &DEFAULT_PKG_URL[8..]); let data = Data::new( "cargo-binstall".to_compact_string(), @@ -378,19 +407,15 @@ mod test { let ctx = Context::from_data(&data, "x86_64-unknown-linux-gnu", ".tgz"); assert_eq!( - ctx.render_url(meta.pkg_url.as_deref().unwrap()).unwrap(), + ctx.render_url(pkg_url).unwrap(), url("https://example.com/releases/download/v1.2.3/cargo-binstall-x86_64-unknown-linux-gnu-v1.2.3.tgz") ); } #[test] fn different_url() { - let meta = PkgMeta { - pkg_url: Some( - "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ archive-format }" - .to_string()), - ..Default::default() - }; + let pkg_url = + "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ archive-format }"; let data = Data::new( "radio-sx128x".to_compact_string(), @@ -400,17 +425,14 @@ mod test { let ctx = Context::from_data(&data, "x86_64-unknown-linux-gnu", ".tgz"); assert_eq!( - ctx.render_url(meta.pkg_url.as_deref().unwrap()).unwrap(), + ctx.render_url(pkg_url).unwrap(), url("https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz") ); } #[test] fn deprecated_format() { - let meta = PkgMeta { - pkg_url: Some("{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ format }".to_string()), - ..Default::default() - }; + let pkg_url = "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ format }"; let data = Data::new( "radio-sx128x".to_compact_string(), @@ -420,21 +442,15 @@ mod test { let ctx = Context::from_data(&data, "x86_64-unknown-linux-gnu", ".tgz"); assert_eq!( - ctx.render_url(meta.pkg_url.as_deref().unwrap()).unwrap(), + ctx.render_url(pkg_url).unwrap(), url("https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz") ); } #[test] fn different_ext() { - let meta = PkgMeta { - pkg_url: Some( - "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }.tar.xz" - .to_string(), - ), - pkg_fmt: Some(PkgFmt::Txz), - ..Default::default() - }; + let pkg_url = + "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }.tar.xz"; let data = Data::new( "cargo-watch".to_compact_string(), @@ -444,18 +460,15 @@ mod test { let ctx = Context::from_data(&data, "aarch64-apple-darwin", ".txz"); assert_eq!( - ctx.render_url(meta.pkg_url.as_deref().unwrap()).unwrap(), + ctx.render_url(pkg_url).unwrap(), url("https://github.com/watchexec/cargo-watch/releases/download/v9.0.0/cargo-watch-v9.0.0-aarch64-apple-darwin.tar.xz") ); } #[test] fn no_archive() { - let meta = PkgMeta { - pkg_url: Some("{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }{ binary-ext }".to_string()), - pkg_fmt: Some(PkgFmt::Bin), - ..Default::default() - }; + let pkg_url = "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }{ binary-ext }" + ; let data = Data::new( "cargo-watch".to_compact_string(), @@ -465,7 +478,7 @@ mod test { let ctx = Context::from_data(&data, "aarch64-pc-windows-msvc", ".bin"); assert_eq!( - ctx.render_url(meta.pkg_url.as_deref().unwrap()).unwrap(), + ctx.render_url(pkg_url).unwrap(), url("https://github.com/watchexec/cargo-watch/releases/download/v9.0.0/cargo-watch-v9.0.0-aarch64-pc-windows-msvc.exe") ); } diff --git a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs index 34e4c74e..e6a7ed91 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs @@ -1,4 +1,5 @@ use itertools::Itertools; +use leon::{template, Item, Template}; use url::Url; use crate::errors::BinstallError; @@ -14,20 +15,63 @@ pub enum RepositoryHost { /// Make sure to update possible_dirs in `bins::infer_bin_dir_template` /// if you modified FULL_FILENAMES or NOVERSION_FILENAMES. -pub const FULL_FILENAMES: &[&str] = &[ - "{ name }-{ target }-v{ version }{ archive-suffix }", - "{ name }-{ target }-{ version }{ archive-suffix }", - "{ name }-{ version }-{ target }{ archive-suffix }", - "{ name }-v{ version }-{ target }{ archive-suffix }", - "{ name }_{ target }_v{ version }{ archive-suffix }", - "{ name }_{ target }_{ version }{ archive-suffix }", - "{ name }_{ version }_{ target }{ archive-suffix }", - "{ name }_v{ version }_{ target }{ archive-suffix }", +pub const FULL_FILENAMES: &[Template<'_>] = &[ + template!("/", { "name" }, "-", { "target" }, "-v", { "version" }, { + "archive-suffix" + }), + template!("/", { "name" }, "-", { "target" }, "-", { "version" }, { + "archive-suffix" + }), + template!("/", { "name" }, "-", { "version" }, "-", { "target" }, { + "archive-suffix" + }), + template!("/", { "name" }, "-v", { "version" }, "-", { "target" }, { + "archive-suffix" + }), + template!("/", { "name" }, "_", { "target" }, "_v", { "version" }, { + "archive-suffix" + }), + template!("/", { "name" }, "_", { "target" }, "_", { "version" }, { + "archive-suffix" + }), + template!("/", { "name" }, "_", { "version" }, "_", { "target" }, { + "archive-suffix" + }), + template!("/", { "name" }, "_v", { "version" }, "_", { "target" }, { + "archive-suffix" + }), ]; -pub const NOVERSION_FILENAMES: &[&str] = &[ - "{ name }-{ target }{ archive-suffix }", - "{ name }_{ target }{ archive-suffix }", +pub const NOVERSION_FILENAMES: &[Template<'_>] = &[ + template!("/", { "name" }, "-", { "target" }, { "archive-suffix" }), + template!("/", { "name" }, "_", { "target" }, { "archive-suffix" }), +]; + +const GITHUB_RELEASE_PATHS: &[Template<'_>] = &[ + template!({ "repo" }, "/releases/download/", { "version" }), + template!({ "repo" }, "/releases/download/v", { "version" }), +]; + +const GITLAB_RELEASE_PATHS: &[Template<'_>] = &[ + template!( + { "repo" }, + "/-/releases/", + { "version" }, + "/downloads/binaries" + ), + template!( + { "repo" }, + "/-/releases/v", + { "version" }, + "/downloads/binaries" + ), +]; + +const BITBUCKET_RELEASE_PATHS: &[Template<'_>] = &[template!({ "repo" }, "/downloads")]; + +const SOURCEFORGE_RELEASE_PATHS: &[Template<'_>] = &[ + template!({ "repo" }, "/files/binaries/", { "version" }), + template!({ "repo" }, "/files/binaries/v", { "version" }), ]; impl RepositoryHost { @@ -45,36 +89,27 @@ impl RepositoryHost { pub fn get_default_pkg_url_template( self, - ) -> Option + Clone + 'static> { + ) -> Option> + Clone + 'static> { use RepositoryHost::*; match self { GitHub => Some(apply_filenames_to_paths( - &[ - "{ repo }/releases/download/{ version }", - "{ repo }/releases/download/v{ version }", - ], + GITHUB_RELEASE_PATHS, &[FULL_FILENAMES, NOVERSION_FILENAMES], "", )), GitLab => Some(apply_filenames_to_paths( - &[ - "{ repo }/-/releases/{ version }/downloads/binaries", - "{ repo }/-/releases/v{ version }/downloads/binaries", - ], + GITLAB_RELEASE_PATHS, &[FULL_FILENAMES, NOVERSION_FILENAMES], "", )), BitBucket => Some(apply_filenames_to_paths( - &["{ repo }/downloads"], + BITBUCKET_RELEASE_PATHS, &[FULL_FILENAMES], "", )), SourceForge => Some(apply_filenames_to_paths( - &[ - "{ repo }/files/binaries/{ version }", - "{ repo }/files/binaries/v{ version }", - ], + SOURCEFORGE_RELEASE_PATHS, &[FULL_FILENAMES, NOVERSION_FILENAMES], "/download", )), @@ -84,13 +119,17 @@ impl RepositoryHost { } fn apply_filenames_to_paths( - paths: &'static [&'static str], - filenames: &'static [&'static [&'static str]], + paths: &'static [Template<'static>], + filenames: &'static [&'static [Template<'static>]], suffix: &'static str, -) -> impl Iterator + Clone + 'static { +) -> impl Iterator> + Clone + 'static { filenames .iter() .flat_map(|fs| fs.iter()) .cartesian_product(paths.iter()) - .map(move |(filename, path)| format!("{path}/{filename}{suffix}")) + .map(move |(filename, path)| { + let mut template = path.clone() + filename; + template += Item::Text(suffix); + template + }) } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index fe9f42f8..0c98a6f3 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -9,9 +9,9 @@ use std::{ use cargo_toml::Manifest; use compact_str::{CompactString, ToCompactString}; use itertools::Itertools; +use leon::Template; use maybe_owned::MaybeOwned; use semver::{Version, VersionReq}; -use tinytemplate::TinyTemplate; use tokio::task::block_in_place; use tracing::{debug, info, instrument, warn}; @@ -304,15 +304,13 @@ fn collect_bin_files( .map(Cow::Borrowed) .unwrap_or_else(|| bins::infer_bin_dir_template(&bin_data, extracted_files)); - let mut tt = TinyTemplate::new(); - - tt.add_template("bin_dir", &bin_dir)?; + let template = Template::parse(&bin_dir)?; // Create bin_files let bin_files = package_info .binaries .iter() - .map(|bin| bins::BinFile::new(&bin_data, bin.name.as_str(), &tt, no_symlinks)) + .map(|bin| bins::BinFile::new(&bin_data, bin.name.as_str(), &template, no_symlinks)) .collect::, BinstallError>>()?; let mut source_set = BTreeSet::new(); diff --git a/crates/leon/src/lib.rs b/crates/leon/src/lib.rs index 17eeeeca..e58e41e8 100644 --- a/crates/leon/src/lib.rs +++ b/crates/leon/src/lib.rs @@ -59,7 +59,7 @@ //! # let template = Template::parse("hello {name}").unwrap(); //! assert_eq!( //! template.render( -//! &vals(|_key| Some("marcus".into())) +//! &&vals(|_key| Some("marcus".into())) //! ).unwrap().as_str(), //! "hello marcus", //! ); @@ -76,7 +76,7 @@ //! let mut buf: Vec = Vec::new(); //! template.render_into( //! &mut buf, -//! &vals(|key| if key == "name" { +//! &&vals(|key| if key == "name" { //! Some("julius".into()) //! } else { //! None @@ -107,7 +107,7 @@ //! name: &'static str, //! } //! impl Values for MyMap { -//! fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option> { +//! fn get_value(&self, key: &str) -> Option> { //! if key == "name" { //! Some(self.name.into()) //! } else { diff --git a/crates/leon/src/macros.rs b/crates/leon/src/macros.rs index 3833a3c3..c489765d 100644 --- a/crates/leon/src/macros.rs +++ b/crates/leon/src/macros.rs @@ -1,4 +1,35 @@ -/// Construct a template constant without needing to make an items constant. +#[doc(hidden)] +#[macro_export] +macro_rules! __template_item { + () => {}; + ({ $key:literal }) => { + $crate::Item::Key($key) + }; + ( $text:literal ) => { + $crate::Item::Text($text) + }; +} + +#[doc(hidden)] +#[macro_export] +macro_rules! __template_impl { + ($( $token:tt ),* ; $default:expr) => { + $crate::Template::new( + { + const ITEMS: &'static [$crate::Item<'static>] = &[ + $( + $crate::__template_item!($token) + ),* + ]; + ITEMS + }, + $default, + ) + }; +} + +/// Construct a template constant using syntax similar to the template to be +/// passed to [`Template::parse`]. /// /// This is essentially a shorthand for: /// @@ -13,9 +44,8 @@ /// # Examples /// /// ``` -/// use leon::Item::*; /// assert_eq!( -/// leon::template!(Text("Hello "), Key("name")) +/// leon::template!("Hello ", {"name"}) /// .render(&[("name", "Магда Нахман")]) /// .unwrap(), /// "Hello Магда Нахман", @@ -25,9 +55,8 @@ /// With a default: /// /// ``` -/// use leon::Item::*; /// assert_eq!( -/// leon::template!(Text("Hello "), Key("name"); "M. P. T. Acharya") +/// leon::template!("Hello ", {"name"}; "M. P. T. Acharya") /// .render(&[("city", "Madras")]) /// .unwrap(), /// "Hello M. P. T. Acharya", @@ -35,16 +64,93 @@ /// ``` #[macro_export] macro_rules! template { - ($($item:expr),* $(,)?) => { - $crate::Template::new({ - const ITEMS: &'static [$crate::Item<'static>] = &[$($item),*]; - ITEMS - }, ::core::option::Option::None) + () => { + $crate::Template::new( + { + const ITEMS: &'static [$crate::Item<'static>] = &[]; + ITEMS + }, + ::core::option::Option::None, + ) }; - ($($item:expr),* $(,)? ; $default:expr) => { - $crate::Template::new({ - const ITEMS: &'static [$crate::Item<'static>] = &[$($item),*]; - ITEMS - }, ::core::option::Option::Some($default)) + + ($( $token:tt ),* $(,)?) => { + $crate::__template_impl!($( $token ),* ; ::core::option::Option::None) + }; + + ($( $token:tt ),* $(,)? ; $default:expr) => { + $crate::__template_impl!($( $token ),* ; ::core::option::Option::Some($default)) }; } + +#[cfg(test)] +mod tests { + use crate::{template, Item, Template}; + + #[test] + fn test_template2() { + assert_eq!(template!(), Template::new(&[], None),); + + // Only literals + assert_eq!(template!("1"), Template::new(&[Item::Text("1")], None)); + + assert_eq!( + template!("1", "2"), + Template::new(&[Item::Text("1"), Item::Text("2")], None) + ); + + assert_eq!( + template!("1", "2", "3"), + Template::new(&[Item::Text("1"), Item::Text("2"), Item::Text("3")], None) + ); + + // Only keys + assert_eq!(template!({ "k1" }), Template::new(&[Item::Key("k1")], None)); + + assert_eq!( + template!({ "k1" }, { "k2" }), + Template::new(&[Item::Key("k1"), Item::Key("k2")], None) + ); + + assert_eq!( + template!({ "k1" }, { "k2" }, { "k3" }), + Template::new(&[Item::Key("k1"), Item::Key("k2"), Item::Key("k3")], None) + ); + + // Mixed + assert_eq!( + template!("1", { "k1" }, "3"), + Template::new(&[Item::Text("1"), Item::Key("k1"), Item::Text("3")], None) + ); + + assert_eq!( + template!("1", "2", { "k1" }, "3", "4"), + Template::new( + &[ + Item::Text("1"), + Item::Text("2"), + Item::Key("k1"), + Item::Text("3"), + Item::Text("4") + ], + None + ) + ); + + assert_eq!( + template!("1", "2", { "k1" }, { "k2" }, "3", "4", { "k3" }), + Template::new( + &[ + Item::Text("1"), + Item::Text("2"), + Item::Key("k1"), + Item::Key("k2"), + Item::Text("3"), + Item::Text("4"), + Item::Key("k3"), + ], + None + ) + ); + } +} diff --git a/crates/leon/src/parser.rs b/crates/leon/src/parser.rs index 963775fc..7c033cba 100644 --- a/crates/leon/src/parser.rs +++ b/crates/leon/src/parser.rs @@ -77,7 +77,7 @@ impl<'s> Template<'s> { #[cfg(test)] mod test_valid { - use crate::{template, Item::*, Template}; + use crate::{template, Template}; #[test] fn empty() { @@ -88,34 +88,31 @@ mod test_valid { #[test] fn no_keys() { let template = Template::parse("hello world").unwrap(); - assert_eq!(template, template!(Text("hello world"))); + assert_eq!(template, template!("hello world")); } #[test] fn leading_key() { let template = Template::parse("{salutation} world").unwrap(); - assert_eq!(template, template!(Key("salutation"), Text(" world"))); + assert_eq!(template, template!({ "salutation" }, " world")); } #[test] fn trailing_key() { let template = Template::parse("hello {name}").unwrap(); - assert_eq!(template, template!(Text("hello "), Key("name"))); + assert_eq!(template, template!("hello ", { "name" })); } #[test] fn middle_key() { let template = Template::parse("hello {name}!").unwrap(); - assert_eq!(template, template!(Text("hello "), Key("name"), Text("!"))); + assert_eq!(template, template!("hello ", { "name" }, "!")); } #[test] fn middle_text() { let template = Template::parse("{salutation} good {title}").unwrap(); - assert_eq!( - template, - template!(Key("salutation"), Text(" good "), Key("title")) - ); + assert_eq!(template, template!({ "salutation" }, " good ", { "title" })); } #[test] @@ -131,13 +128,13 @@ mod test_valid { assert_eq!( template, template!( - Text("\n And if thy native country was "), - Key("ancient civilisation"), - Text(",\n What need to slight thee? Came not "), - Key("hero"), - Text(" thence,\n Who gave to "), - Key("country"), - Text(" her books and art of writing?\n "), + "\n And if thy native country was ", + { "ancient civilisation" }, + ",\n What need to slight thee? Came not ", + { "hero" }, + " thence,\n Who gave to ", + { "country" }, + " her books and art of writing?\n ", ) ); } @@ -145,19 +142,19 @@ mod test_valid { #[test] fn key_no_whitespace() { let template = Template::parse("{word}").unwrap(); - assert_eq!(template, template!(Key("word"))); + assert_eq!(template, template!({ "word" })); } #[test] fn key_leading_whitespace() { let template = Template::parse("{ word}").unwrap(); - assert_eq!(template, template!(Key("word"))); + assert_eq!(template, template!({ "word" })); } #[test] fn key_trailing_whitespace() { let template = Template::parse("{word\n}").unwrap(); - assert_eq!(template, template!(Key("word"))); + assert_eq!(template, template!({ "word" })); } #[test] @@ -168,46 +165,31 @@ mod test_valid { }", ) .unwrap(); - assert_eq!(template, template!(Key("word"))); + assert_eq!(template, template!({ "word" })); } #[test] fn key_inner_whitespace() { let template = Template::parse("{ a word }").unwrap(); - assert_eq!(template, template!(Key("a word"))); + assert_eq!(template, template!({ "a word" })); } #[test] fn escape_left() { let template = Template::parse(r"this \{ single left brace").unwrap(); - assert_eq!( - template, - template!(Text("this "), Text("{"), Text(" single left brace")) - ); + assert_eq!(template, template!("this ", "{", " single left brace")); } #[test] fn escape_right() { let template = Template::parse(r"this \} single right brace").unwrap(); - assert_eq!( - template, - template!(Text("this "), Text("}"), Text(" single right brace")) - ); + assert_eq!(template, template!("this ", "}", " single right brace")); } #[test] fn escape_both() { let template = Template::parse(r"these \{ two \} braces").unwrap(); - assert_eq!( - template, - template!( - Text("these "), - Text("{"), - Text(" two "), - Text("}"), - Text(" braces") - ) - ); + assert_eq!(template, template!("these ", "{", " two ", "}", " braces")); } #[test] @@ -215,15 +197,7 @@ mod test_valid { let template = Template::parse(r"these \{\{ four \}\} braces").unwrap(); assert_eq!( template, - template!( - Text("these "), - Text("{"), - Text("{"), - Text(" four "), - Text("}"), - Text("}"), - Text(" braces") - ) + template!("these ", "{", "{", " four ", "}", "}", " braces") ); } @@ -232,13 +206,7 @@ mod test_valid { let template = Template::parse(r"these \\ backslashes \\\\").unwrap(); assert_eq!( template, - template!( - Text("these "), - Text(r"\"), - Text(" backslashes "), - Text(r"\"), - Text(r"\"), - ) + template!("these ", r"\", " backslashes ", r"\", r"\",) ); } @@ -247,16 +215,7 @@ mod test_valid { let template = Template::parse(r"\\{ a } \{{ b } \}{ c }").unwrap(); assert_eq!( template, - template!( - Text(r"\"), - Key("a"), - Text(" "), - Text(r"{"), - Key("b"), - Text(" "), - Text(r"}"), - Key("c"), - ) + template!(r"\", { "a" }, " ", r"{", { "b" }, " ", r"}", { "c" }) ); } @@ -265,44 +224,32 @@ mod test_valid { let template = Template::parse(r"{ a }\\ { b }\{ { c }\}").unwrap(); assert_eq!( template, - template!( - Key("a"), - Text(r"\"), - Text(" "), - Key("b"), - Text(r"{"), - Text(" "), - Key("c"), - Text(r"}"), - ) + template!({ "a" }, r"\", " ", { "b" }, r"{", " ", { "c" }, r"}") ); } #[test] fn multibyte_texts() { let template = Template::parse("幸徳 {particle} 秋水").unwrap(); - assert_eq!( - template, - template!(Text("幸徳 "), Key("particle"), Text(" 秋水")) - ); + assert_eq!(template, template!("幸徳 ", { "particle" }, " 秋水")); } #[test] fn multibyte_key() { let template = Template::parse("The { 連盟 }").unwrap(); - assert_eq!(template, template!(Text("The "), Key("連盟"))); + assert_eq!(template, template!("The ", { "連盟" })); } #[test] fn multibyte_both() { let template = Template::parse("大杉 {栄}").unwrap(); - assert_eq!(template, template!(Text("大杉 "), Key("栄"))); + assert_eq!(template, template!("大杉 ", { "栄" })); } #[test] fn multibyte_whitespace() { let template = Template::parse("岩佐 作{ 太 }郎").unwrap(); - assert_eq!(template, template!(Text("岩佐 作"), Key("太"), Text("郎"))); + assert_eq!(template, template!("岩佐 作", { "太" }, "郎")); } #[test] @@ -310,26 +257,20 @@ mod test_valid { let template = Template::parse(r"日本\{アナキスト\}連盟").unwrap(); assert_eq!( template, - template!( - Text("日本"), - Text(r"{"), - Text("アナキスト"), - Text(r"}"), - Text("連盟") - ) + template!("日本", r"{", "アナキスト", r"}", "連盟") ); } #[test] fn multibyte_rtl_text() { let template = Template::parse("محمد صايل").unwrap(); - assert_eq!(template, template!(Text("محمد صايل"))); + assert_eq!(template, template!("محمد صايل")); } #[test] fn multibyte_rtl_key() { let template = Template::parse("محمد {ريشة}").unwrap(); - assert_eq!(template, template!(Text("محمد "), Key("ريشة"))); + assert_eq!(template, template!("محمد ", { "ريشة" })); } } diff --git a/crates/leon/src/template.rs b/crates/leon/src/template.rs index bf32e92d..67a4466b 100644 --- a/crates/leon/src/template.rs +++ b/crates/leon/src/template.rs @@ -1,4 +1,4 @@ -use std::{borrow::Cow, fmt::Display, io::Write, ops::Add}; +use std::{borrow::Cow, fmt::Display, io::Write, ops}; use crate::{ParseError, RenderError, Values}; @@ -138,17 +138,20 @@ impl<'s> Template<'s> { Ok(String::from_utf8(buf).unwrap()) } + /// If the template contains key `key`. pub fn has_key(&self, key: &str) -> bool { - self.has_keys(&[key]) + self.has_any_of_keys(&[key]) } - pub fn has_keys(&self, keys: &[&str]) -> bool { + /// If the template contains any one of the `keys`. + pub fn has_any_of_keys(&self, keys: &[&str]) -> bool { self.items.iter().any(|token| match token { Item::Key(k) => keys.contains(k), _ => false, }) } + /// Returns all keys in this template. pub fn keys(&self) -> impl Iterator { self.items.iter().filter_map(|token| match token { Item::Key(k) => Some(k), @@ -160,39 +163,116 @@ impl<'s> Template<'s> { pub fn set_default(&mut self, default: &dyn Display) { self.default = Some(Cow::Owned(default.to_string())); } + + /// Cast `Template<'s>` to `Template<'t>` where `'s` is a subtype of `'t`, + /// meaning that `Template<'s>` outlives `Template<'t>`. + pub fn cast<'t>(self) -> Template<'t> + where + 's: 't, + { + Template { + items: match self.items { + Cow::Owned(vec) => Cow::Owned(vec), + Cow::Borrowed(slice) => Cow::Borrowed(slice as &'t [Item<'t>]), + }, + default: self.default.map(|default| default as Cow<'t, str>), + } + } } -impl<'s> Add for Template<'s> { - type Output = Self; - - fn add(mut self, rhs: Self) -> Self::Output { +impl<'s, 'rhs: 's> ops::AddAssign<&Template<'rhs>> for Template<'s> { + fn add_assign(&mut self, rhs: &Template<'rhs>) { self.items .to_mut() .extend(rhs.items.as_ref().iter().cloned()); + + if let Some(default) = &rhs.default { + self.default = Some(default.clone()); + } + } +} + +impl<'s, 'rhs: 's> ops::AddAssign> for Template<'s> { + fn add_assign(&mut self, rhs: Template<'rhs>) { + match rhs.items { + Cow::Borrowed(items) => self.items.to_mut().extend(items.iter().cloned()), + Cow::Owned(items) => self.items.to_mut().extend(items.into_iter()), + } + if let Some(default) = rhs.default { self.default = Some(default); } + } +} + +impl<'s, 'item: 's> ops::AddAssign> for Template<'s> { + fn add_assign(&mut self, item: Item<'item>) { + self.items.to_mut().push(item); + } +} + +impl<'s, 'item: 's> ops::AddAssign<&Item<'item>> for Template<'s> { + fn add_assign(&mut self, item: &Item<'item>) { + self.add_assign(item.clone()) + } +} + +impl<'s, 'rhs: 's> ops::Add> for Template<'s> { + type Output = Self; + + fn add(mut self, rhs: Template<'rhs>) -> Self::Output { + self += rhs; + self + } +} + +impl<'s, 'rhs: 's> ops::Add<&Template<'rhs>> for Template<'s> { + type Output = Self; + + fn add(mut self, rhs: &Template<'rhs>) -> Self::Output { + self += rhs; + self + } +} + +impl<'s, 'item: 's> ops::Add> for Template<'s> { + type Output = Self; + + fn add(mut self, item: Item<'item>) -> Self::Output { + self += item; + self + } +} + +impl<'s, 'item: 's> ops::Add<&Item<'item>> for Template<'s> { + type Output = Self; + + fn add(mut self, item: &Item<'item>) -> Self::Output { + self += item; self } } #[cfg(test)] mod test { - use crate::Item::{Key, Text}; + use crate::Template; #[test] fn concat_templates() { - let t1 = crate::template!(Text("Hello"), Key("name")); - let t2 = crate::template!(Text("have a"), Key("adjective"), Text("day")); + let t1 = crate::template!("Hello", { "name" }); + let t2 = crate::template!("have a", { "adjective" }, "day"); assert_eq!( t1 + t2, - crate::template!( - Text("Hello"), - Key("name"), - Text("have a"), - Key("adjective"), - Text("day") - ), + crate::template!("Hello", { "name" }, "have a", { "adjective" }, "day"), ); } + + #[test] + fn test_cast() { + fn inner<'a>(_: &'a u32, _: Template<'a>) {} + + let template: Template<'static> = crate::template!("hello"); + let i = 1; + inner(&i, template.cast()); + } } diff --git a/crates/leon/src/values.rs b/crates/leon/src/values.rs index 3e7d8ca9..7641d8a8 100644 --- a/crates/leon/src/values.rs +++ b/crates/leon/src/values.rs @@ -5,14 +5,14 @@ use std::{ }; pub trait Values { - fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option>; + fn get_value(&self, key: &str) -> Option>; } impl Values for &T where T: Values, { - fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option> { + fn get_value(&self, key: &str) -> Option> { T::get_value(self, key) } } @@ -22,7 +22,7 @@ where K: AsRef, V: AsRef, { - fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option> { + fn get_value(&self, key: &str) -> Option> { self.iter().find_map(|(k, v)| { if k.as_ref() == key { Some(Cow::Borrowed(v.as_ref())) @@ -38,7 +38,7 @@ where K: AsRef, V: AsRef, { - fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option> { + fn get_value(&self, key: &str) -> Option> { (*self).get_value(key) } } @@ -48,7 +48,7 @@ where K: AsRef, V: AsRef, { - fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option> { + fn get_value(&self, key: &str) -> Option> { self.as_slice().get_value(key) } } @@ -58,7 +58,7 @@ where K: AsRef, V: AsRef, { - fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option> { + fn get_value(&self, key: &str) -> Option> { self.as_slice().get_value(key) } } @@ -69,7 +69,7 @@ where V: AsRef, S: BuildHasher, { - fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option> { + fn get_value(&self, key: &str) -> Option> { self.get(key).map(|v| Cow::Borrowed(v.as_ref())) } } @@ -79,7 +79,7 @@ where K: Borrow + Ord, V: AsRef, { - fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option> { + fn get_value(&self, key: &str) -> Option> { self.get(key).map(|v| Cow::Borrowed(v.as_ref())) } } @@ -87,25 +87,22 @@ where /// Workaround to allow using functions as [`Values`]. /// /// As this isn't constructible you'll want to use [`vals()`] instead. -pub struct ValuesFn -where - F: for<'s> Fn(&'s str) -> Option> + Send + 'static, -{ +pub struct ValuesFn { inner: F, } -impl Values for ValuesFn +impl<'s, F> Values for &'s ValuesFn where - F: for<'s> Fn(&'s str) -> Option> + Send + 'static, + F: Fn(&str) -> Option> + 's, { - fn get_value<'s, 'k: 's>(&'s self, key: &'k str) -> Option> { + fn get_value(&self, key: &str) -> Option> { (self.inner)(key) } } -impl From for ValuesFn +impl<'f, F> From for ValuesFn where - F: for<'s> Fn(&'s str) -> Option> + Send + 'static, + F: Fn(&str) -> Option> + 'f, { fn from(inner: F) -> Self { Self { inner } @@ -123,11 +120,11 @@ where /// /// fn use_values(_values: impl Values) {} /// -/// use_values(vals(|_| Some("hello".into()))); +/// use_values(&vals(|_| Some("hello".into()))); /// ``` -pub const fn vals(func: F) -> ValuesFn +pub const fn vals<'f, F>(func: F) -> ValuesFn where - F: for<'s> Fn(&'s str) -> Option> + Send + 'static, + F: Fn(&str) -> Option> + 'f, { ValuesFn { inner: func } } From a403c99d3f793fce7030e8c1b2c3a5eef0fc7dd0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 26 Mar 2023 17:28:35 +1100 Subject: [PATCH 1160/2020] Upgrade CI to use sccache v0.4.0 for caching (#934) Remove `mozilla-actions/sccache-action@v0.0.2` and instead use `taiki-ie/install-action` to install `sccache`, since we already use `taiki-e/install-action` for installing crates. This PR also refactor just-setup.yml and use pass `GITHUB_TOKEN` to `taiki-e/install-action` which uses `cargo-binstall` for installing `cargo-auditable` and `sccache`. Signed-off-by: Jiahao XU --- .github/actions/just-setup/action.yml | 38 ++++++++++++++++++++------- .github/workflows/ci.yml | 16 +++++++++++ .github/workflows/release-build.yml | 4 +++ 3 files changed, 48 insertions(+), 10 deletions(-) diff --git a/.github/actions/just-setup/action.yml b/.github/actions/just-setup/action.yml index 0d1405be..2da88d50 100644 --- a/.github/actions/just-setup/action.yml +++ b/.github/actions/just-setup/action.yml @@ -18,19 +18,30 @@ inputs: description: Suffix for cache key required: false default: "" + runs: using: composite steps: - - if: inputs.tools == '' - name: Install just + - name: Add just to tools to install + run: echo "tools=just" >>$GITHUB_ENV + shell: bash + + - if: inputs.buildcache + name: Add sccache to tools to install + run: echo "tools=$tools,sccache" >>$GITHUB_ENV + shell: bash + + - name: Add inputs.tools to tools to install + if: inputs.tools != '' + env: + inputs_tools: ${{ inputs.tools }} + run: echo "tools=$tools,$inputs_tools" >>$GITHUB_ENV + shell: bash + + - name: Install tools uses: taiki-e/install-action@v2 with: - tool: just - - if: inputs.tools != '' - name: Install just and tools - uses: taiki-e/install-action@v2 - with: - tool: just,${{ inputs.tools }} + tool: ${{ env.tools }} - if: inputs.indexcache name: Configure index cache @@ -55,9 +66,11 @@ runs: - if: inputs.buildcache name: Configure sccache - uses: mozilla-actions/sccache-action@v0.0.2 + uses: actions/github-script@v6 with: - version: "v0.4.0-pre.10" + script: | + core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - if: inputs.buildcache name: Export env for sccache to work @@ -66,3 +79,8 @@ runs: echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV + + - uses: webiny/action-post-run@3.0.0 + id: post-run-command + with: + run: sccache --show-stats diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2370a3c2..74d8e596 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -52,6 +52,10 @@ jobs: - uses: ./.github/actions/just-setup with: cache-suffix: ${{ env.CARGO_BUILD_TARGET }} + env: + # just-setup use binstall to install sccache, + # which works better when we provide it with GITHUB_TOKEN. + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: just ci-install-deps - run: just test @@ -78,6 +82,10 @@ jobs: - uses: ./.github/actions/just-setup with: cache-suffix: ${{ env.CARGO_BUILD_TARGET }} + env: + # just-setup use binstall to install sccache, + # which works better when we provide it with GITHUB_TOKEN. + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: just ci-install-deps - run: just check @@ -92,6 +100,10 @@ jobs: - uses: ./.github/actions/just-setup with: cache-suffix: ${{ env.CARGO_BUILD_TARGET }} + env: + # just-setup use binstall to install sccache, + # which works better when we provide it with GITHUB_TOKEN. + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: just check @@ -105,6 +117,10 @@ jobs: - uses: ./.github/actions/just-setup with: cache-suffix: ${{ env.CARGO_BUILD_TARGET }} + env: + # just-setup use binstall to install sccache, + # which works better when we provide it with GITHUB_TOKEN. + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: just check diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 93ba0d59..0455d84d 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -45,6 +45,10 @@ jobs: with: cache-suffix: release-${{ matrix.t }} tools: cargo-auditable + env: + # just-setup use binstall to install sccache and cargo-auditable, + # which works better when we provide it with GITHUB_TOKEN. + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: just toolchain rust-src - run: just ci-install-deps From f1d6731e7ad3c7702ed2aa12d320461009ec3157 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 02:44:29 +0000 Subject: [PATCH 1161/2020] Bump async-trait from 0.1.67 to 0.1.68 (#950) --- Cargo.lock | 14 +++++++------- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 49ac3c13..bbab5f74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -78,13 +78,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.67" +version = "0.1.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ea188f25f0255d8f92797797c97ebf5631fa88178beb1a46fdf5622c9a00e4" +checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.5", + "syn 2.0.10", ] [[package]] @@ -2085,7 +2085,7 @@ checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad" dependencies = [ "proc-macro2", "quote", - "syn 2.0.5", + "syn 2.0.10", ] [[package]] @@ -2260,9 +2260,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.5" +version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89c2d1c76a26822187a1fbb5964e3fff108bc208f02e820ab9dac1234f6b388a" +checksum = "5aad1363ed6d37b84299588d62d3a7d95b5a5c2d9aad5c85609fda12afaa1f40" dependencies = [ "proc-macro2", "quote", @@ -2335,7 +2335,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.5", + "syn 2.0.10", ] [[package]] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 234595b0..34122684 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0" [dependencies] -async-trait = "0.1.67" +async-trait = "0.1.68" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.12", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } binstalk-types = { version = "0.3.0", path = "../binstalk-types" } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index a5533a97..aa31975c 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0" [dependencies] -async-trait = "0.1.67" +async-trait = "0.1.68" binstalk-downloader = { version = "0.4.2", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.3.0", path = "../binstalk-types" } cargo_toml = "0.15.2" From 4af092f84859c0945dc35786575415602e7a4ac4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 03:12:08 +0000 Subject: [PATCH 1162/2020] Bump embed-resource from 1.8.0 to 2.0.0 (#948) --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- crates/bin/build.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bbab5f74..8edb5652 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -664,9 +664,9 @@ checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "embed-resource" -version = "1.8.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e62abb876c07e4754fae5c14cafa77937841f01740637e17d78dc04352f32a5e" +checksum = "dfa45bbf655db75e0be9c80a9d6ed2f5f58d321a623af660f74fd83e0eec07f0" dependencies = [ "cc", "rustc_version", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 63cfd0f9..084de3de 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -46,7 +46,7 @@ tracing-log = { version = "0.1.3", default-features = false } tracing-subscriber = { version = "0.3.16", features = ["fmt", "json", "ansi"], default-features = false } [build-dependencies] -embed-resource = "1.8.0" +embed-resource = "2.0.0" [features] default = ["static", "rustls", "trust-dns", "fancy-no-backtrace", "zstd-thin"] diff --git a/crates/bin/build.rs b/crates/bin/build.rs index 526d5bbc..9a654904 100644 --- a/crates/bin/build.rs +++ b/crates/bin/build.rs @@ -3,5 +3,5 @@ fn main() { println!("cargo:rerun-if-changed=manifest.rc"); println!("cargo:rerun-if-changed=windows.manifest"); - embed_resource::compile("manifest.rc"); + embed_resource::compile("manifest.rc", embed_resource::NONE); } From 875747f7ef23d19a78b17e0411640c729d5aa6ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 27 Mar 2023 14:44:03 +1100 Subject: [PATCH 1163/2020] Bump async_zip from 0.0.12 to 0.0.13 (#949) * Bump async_zip from 0.0.12 to 0.0.13 Bumps [async_zip](https://github.com/Majored/rs-async-zip) from 0.0.12 to 0.0.13. - [Release notes](https://github.com/Majored/rs-async-zip/releases) - [Commits](https://github.com/Majored/rs-async-zip/commits) --- updated-dependencies: - dependency-name: async_zip dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Fix compilation Signed-off-by: Jiahao XU --------- Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU --- Cargo.lock | 9 +++++++-- crates/binstalk-downloader/Cargo.toml | 3 ++- .../src/download/async_extracter.rs | 2 +- .../src/download/zip_extraction.rs | 12 +++++++----- 4 files changed, 17 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8edb5652..f4ee5cb1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -68,6 +68,7 @@ dependencies = [ "bzip2", "flate2", "futures-core", + "futures-io", "memchr", "pin-project-lite", "tokio", @@ -89,16 +90,18 @@ dependencies = [ [[package]] name = "async_zip" -version = "0.0.12" +version = "0.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2105142db9c6203b9dadc83b0553394589a6cb31b1449a3b46b42f47c3434d0" +checksum = "79eaa2b44cfdce59cfff6cb013c96900635085fe7c28fbcbe926c9e5ad0ddfbc" dependencies = [ "async-compression", "crc32fast", + "futures-util", "log", "pin-project", "thiserror", "tokio", + "tokio-util", ] [[package]] @@ -201,6 +204,7 @@ dependencies = [ "digest", "flate2", "futures-lite", + "futures-util", "generic-array", "httpdate", "reqwest", @@ -2459,6 +2463,7 @@ checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" dependencies = [ "bytes", "futures-core", + "futures-io", "futures-sink", "pin-project-lite", "tokio", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 34122684..f1eaa33b 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.68" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } -async_zip = { version = "0.0.12", features = ["deflate", "bzip2", "lzma", "zstd", "xz"] } +async_zip = { version = "0.0.13", features = ["deflate", "bzip2", "lzma", "zstd", "xz", "tokio"] } binstalk-types = { version = "0.3.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" @@ -20,6 +20,7 @@ compact_str = "0.7.0" digest = "0.10.6" flate2 = { version = "1.0.25", default-features = false } futures-lite = { version = "1.12.0", default-features = false } +futures-util = "0.3.27" generic-array = "0.14.6" httpdate = "1.0.2" reqwest = { version = "0.11.15", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } diff --git a/crates/binstalk-downloader/src/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs index c04675a2..c6319f8e 100644 --- a/crates/binstalk-downloader/src/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -6,7 +6,7 @@ use std::{ path::{Component, Path, PathBuf}, }; -use async_zip::read::stream::ZipFileReader; +use async_zip::tokio::read::stream::ZipFileReader; use bytes::{Bytes, BytesMut}; use futures_lite::stream::Stream; use tokio::sync::mpsc; diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index 824088d4..558d7ba9 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -3,14 +3,16 @@ use std::{ path::{Component, Path, PathBuf}, }; -use async_zip::read::stream::{Reading, ZipFileReader}; +use async_zip::{base::read::stream::Reading, tokio::read::stream::ZipFileReader}; use bytes::{Bytes, BytesMut}; use futures_lite::future::try_zip as try_join; +use futures_util::io::Take; use thiserror::Error as ThisError; use tokio::{ - io::{AsyncRead, AsyncReadExt, Take}, + io::{AsyncRead, AsyncReadExt}, sync::mpsc, }; +use tokio_util::compat::{Compat, FuturesAsyncReadCompatExt}; use super::{DownloadError, ExtractedFiles}; use crate::utils::asyncify; @@ -35,7 +37,7 @@ impl ZipError { } pub(super) async fn extract_zip_entry( - zip_reader: &mut ZipFileReader>>, + zip_reader: &mut ZipFileReader>>>, path: &Path, buf: &mut BytesMut, extracted_files: &mut ExtractedFiles, @@ -113,7 +115,7 @@ where Ok(()) }); - let read_task = copy_file_to_mpsc(zip_reader.reader(), tx, buf); + let read_task = copy_file_to_mpsc(zip_reader.reader().compat(), tx, buf); try_join( async move { write_task.await.map_err(From::from) }, @@ -131,7 +133,7 @@ where } async fn copy_file_to_mpsc( - entry_reader: &mut R, + mut entry_reader: R, tx: mpsc::Sender, buf: &mut BytesMut, ) -> Result<(), async_zip::error::ZipError> From 7ee1489d9c21c941a2b38279367e2b8819677196 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:44:27 +1100 Subject: [PATCH 1164/2020] Bump reqwest from 0.11.15 to 0.11.16 (#956) Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.15 to 0.11.16. - [Release notes](https://github.com/seanmonstar/reqwest/releases) - [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md) - [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.15...v0.11.16) --- updated-dependencies: - dependency-name: reqwest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f4ee5cb1..c04eaedf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1831,9 +1831,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "reqwest" -version = "0.11.15" +version = "0.11.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ba30cc2c0cd02af1222ed216ba659cdb2f879dfe3181852fe7c50b1d0005949" +checksum = "27b71749df584b7f4cac2c426c127a7c785a5106cc98f7a8feb044115f0fa254" dependencies = [ "async-compression", "base64 0.21.0", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index f1eaa33b..0613e6bf 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -23,7 +23,7 @@ futures-lite = { version = "1.12.0", default-features = false } futures-util = "0.3.27" generic-array = "0.14.6" httpdate = "1.0.2" -reqwest = { version = "0.11.15", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } +reqwest = { version = "0.11.16", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } serde = { version = "1.0.157", features = ["derive"], optional = true } serde_json = { version = "1.0.94", optional = true } # Use a fork here since we need PAX support, but the upstream From 24c39c1af541c2c1c0d66caa38174e1015c03d5f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:44:51 +1100 Subject: [PATCH 1165/2020] Bump serde_json from 1.0.94 to 1.0.95 (#955) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.94 to 1.0.95. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.94...v1.0.95) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c04eaedf..9c5bd0da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2094,9 +2094,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" +checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" dependencies = [ "itoa", "ryu", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 0613e6bf..f6633f6b 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -25,7 +25,7 @@ generic-array = "0.14.6" httpdate = "1.0.2" reqwest = { version = "0.11.16", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } serde = { version = "1.0.157", features = ["derive"], optional = true } -serde_json = { version = "1.0.94", optional = true } +serde_json = { version = "1.0.95", optional = true } # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. # diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index b2beec94..65ff7cf4 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -19,7 +19,7 @@ miette = "5.6.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.157", features = ["derive"] } serde-tuple-vec-map = "1.0.1" -serde_json = "1.0.94" +serde_json = "1.0.95" thiserror = "1.0.40" toml_edit = { version = "0.19.8", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } From 96482c9dab8a7652ec4a8d8cbc1a7ed3d41de5e9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:45:36 +1100 Subject: [PATCH 1166/2020] Bump tokio from 1.26.0 to 1.27.0 (#953) Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.26.0 to 1.27.0. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.26.0...tokio-1.27.0) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 11 +++++------ crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 4 ++-- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9c5bd0da..11a184fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2379,14 +2379,13 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.26.0" +version = "1.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03201d01c3c27a29c8a5cee5b55a93ddae1ccf6f08f65365c2c918f8c1b76f64" +checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" dependencies = [ "autocfg", "bytes", "libc", - "memchr", "mio", "num_cpus", "parking_lot", @@ -2399,13 +2398,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "1.8.2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d266c00fde287f55d3f1c3e96c500c362a2b8c695076ec180f27918820bc6df8" +checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.10", ] [[package]] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 084de3de..dbc5f9b3 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -39,7 +39,7 @@ strum = "0.24.1" strum_macros = "0.24.3" supports-color = "2.0.0" tempfile = "3.4.0" -tokio = { version = "1.26.0", features = ["rt-multi-thread"], default-features = false } +tokio = { version = "1.27.0", features = ["rt-multi-thread"], default-features = false } tracing-core = "0.1.30" tracing = { version = "0.1.37", default-features = false } tracing-log = { version = "0.1.3", default-features = false } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index f6633f6b..175eb7e9 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -33,7 +33,7 @@ serde_json = { version = "1.0.95", optional = true } tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.4.0" thiserror = "1.0.40" -tokio = { version = "1.26.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } +tokio = { version = "1.27.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.7", features = ["io"] } tower = { version = "0.4.13", features = ["limit", "util"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index aa31975c..a059e787 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -32,7 +32,7 @@ strum = "0.24.1" tempfile = "3.4.0" thiserror = "1.0.40" # parking_lot for `tokio::sync::OnceCell::const_new` -tokio = { version = "1.26.0", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } +tokio = { version = "1.27.0", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } tracing = "0.1.37" url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index ce6a3074..55d066ba 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -10,9 +10,9 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -tokio = { version = "1.26.0", features = ["rt", "process", "sync"], default-features = false } +tokio = { version = "1.27.0", features = ["rt", "process", "sync"], default-features = false } cfg-if = "1.0.0" guess_host_triple = "0.1.3" [dev-dependencies] -tokio = { version = "1.26.0", features = ["macros"], default-features = false } +tokio = { version = "1.27.0", features = ["macros"], default-features = false } From 8109289e815de4483df959a71b3657dd35d54395 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Mar 2023 05:58:21 +0000 Subject: [PATCH 1167/2020] Bump clap from 4.1.11 to 4.1.14 (#952) --- Cargo.lock | 81 +++++++++++++++--------------------------- crates/bin/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 3 files changed, 30 insertions(+), 55 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 11a184fa..7c854b52 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -275,12 +275,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "bitflags" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487f1e0fcbe47deb8b0574e646def1c903389d95241dd1bbcc6ce4a715dfc0c1" - [[package]] name = "block-buffer" version = "0.10.4" @@ -356,7 +350,7 @@ version = "0.22.0" dependencies = [ "binstalk", "binstalk-manifests", - "clap 4.1.11", + "clap 4.1.14", "compact_str", "dirs", "embed-resource", @@ -452,7 +446,7 @@ version = "3.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" dependencies = [ - "bitflags 1.3.2", + "bitflags", "clap_lex 0.2.4", "indexmap", "textwrap 0.16.0", @@ -460,30 +454,38 @@ dependencies = [ [[package]] name = "clap" -version = "4.1.11" +version = "4.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42dfd32784433290c51d92c438bb72ea5063797fc3cc9a21a8c4346bebbb2098" +checksum = "906f7fe1da4185b7a282b2bc90172a496f9def1aca4545fe7526810741591e14" dependencies = [ - "bitflags 2.0.2", + "clap_builder", "clap_derive", - "clap_lex 0.3.3", - "is-terminal", "once_cell", +] + +[[package]] +name = "clap_builder" +version = "4.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "351f9ad9688141ed83dfd8f5fb998a06225ef444b48ff4dc43de6d409b7fd10b" +dependencies = [ + "bitflags", + "clap_lex 0.4.0", + "is-terminal", "strsim", "termcolor", ] [[package]] name = "clap_derive" -version = "4.1.9" +version = "4.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fddf67631444a3a3e3e5ac51c36a5e01335302de677bd78759eaa90ab1f46644" +checksum = "81d7dc0031c3a59a04fc2ba395c8e2dd463cba1859275f065d225f6122221b45" dependencies = [ "heck", - "proc-macro-error", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.10", ] [[package]] @@ -497,12 +499,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "033f6b7a4acb1f358c742aaca805c939ee73b4c6209ae4318ec7aca81c42e646" -dependencies = [ - "os_str_bytes", -] +checksum = "4f0807fb6f644c83f3e4ec014fec9858c1c8b26a7db8eb5f0bde5817df9c1df7" [[package]] name = "cmake" @@ -1256,7 +1255,7 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" name = "leon" version = "1.0.0" dependencies = [ - "clap 4.1.11", + "clap 4.1.14", "criterion", "miette", "serde", @@ -1465,7 +1464,7 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" dependencies = [ - "bitflags 1.3.2", + "bitflags", "cfg-if", "libc", "static_assertions", @@ -1531,7 +1530,7 @@ version = "0.10.47" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d8b277f87dacc05a6b709965d1cbafac4649d6ce9f3ce9ceb88508b5666dfec9" dependencies = [ - "bitflags 1.3.2", + "bitflags", "cfg-if", "foreign-types", "libc", @@ -1661,30 +1660,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[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.109", - "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", -] - [[package]] name = "proc-macro2" version = "1.0.53" @@ -1798,7 +1773,7 @@ version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags 1.3.2", + "bitflags", ] [[package]] @@ -1921,7 +1896,7 @@ version = "0.35.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9" dependencies = [ - "bitflags 1.3.2", + "bitflags", "errno", "io-lifetimes 0.7.5", "libc", @@ -1935,7 +1910,7 @@ version = "0.36.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" dependencies = [ - "bitflags 1.3.2", + "bitflags", "errno", "io-lifetimes 1.0.9", "libc", @@ -2037,7 +2012,7 @@ version = "2.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" dependencies = [ - "bitflags 1.3.2", + "bitflags", "core-foundation", "core-foundation-sys", "libc", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index dbc5f9b3..0f177d95 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.11.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.4.1" } -clap = { version = "4.1.11", features = ["derive", "env"] } +clap = { version = "4.1.14", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.0" file-format = { version = "0.15.0", default-features = false } diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 7e0cc17e..986ea57b 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -clap = { version = "4.1.4", features = ["derive"], optional = true } +clap = { version = "4.1.14", features = ["derive"], optional = true } miette = { version = "5.5.0", default-features = false, optional = true } thiserror = "1.0.38" From 0fa729d742bac80836f911bb4e21afd12d2de72a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 28 Mar 2023 16:59:24 +1100 Subject: [PATCH 1168/2020] Bump generic-array from 0.14.6 to 0.14.7 (#954) Bumps [generic-array](https://github.com/fizyk20/generic-array) from 0.14.6 to 0.14.7. - [Release notes](https://github.com/fizyk20/generic-array/releases) - [Changelog](https://github.com/fizyk20/generic-array/blob/master/CHANGELOG.md) - [Commits](https://github.com/fizyk20/generic-array/commits) --- updated-dependencies: - dependency-name: generic-array dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7c854b52..308bced0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -888,9 +888,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", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 175eb7e9..03c4eacd 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -21,7 +21,7 @@ digest = "0.10.6" flate2 = { version = "1.0.25", default-features = false } futures-lite = { version = "1.12.0", default-features = false } futures-util = "0.3.27" -generic-array = "0.14.6" +generic-array = "0.14.7" httpdate = "1.0.2" reqwest = { version = "0.11.16", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } serde = { version = "1.0.157", features = ["derive"], optional = true } From 3a29ecaa36c7125838e651b7f7ea8d8fe5209ac6 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 28 Mar 2023 20:20:11 +1100 Subject: [PATCH 1169/2020] Support GitHub fine-grained personal access token (#957) Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/gh_api_client.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/binstalk-downloader/src/gh_api_client.rs b/crates/binstalk-downloader/src/gh_api_client.rs index 649817a6..a2c70658 100644 --- a/crates/binstalk-downloader/src/gh_api_client.rs +++ b/crates/binstalk-downloader/src/gh_api_client.rs @@ -99,6 +99,7 @@ pub struct GhApiClient(Arc); fn gh_prefixed(token: &str) -> bool { matches!((token.get(0..2), token.get(3..4)), (Some("gh"), Some("_"))) + || token.starts_with("github_") } impl GhApiClient { @@ -107,7 +108,7 @@ impl GhApiClient { if gh_prefixed(&auth_token) { Some(auth_token) } else { - warn!("Invalid auth_token, expected 'gh*_', fallback to unauthorized mode"); + warn!("Invalid auth_token, expected 'gh*_' or `github_*`, fallback to unauthorized mode"); None } }); From 57cb1f94ec1b30b726196e6b16b3581c374104f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Mar 2023 23:10:55 +1100 Subject: [PATCH 1170/2020] Bump clap from 4.1.14 to 4.2.0 (#961) --- Cargo.lock | 90 +++++++++++++++++++++++++++++++++--------- crates/bin/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 3 files changed, 73 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 308bced0..ca48ebfc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -58,6 +58,46 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" +[[package]] +name = "anstream" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "342258dd14006105c2b75ab1bd7543a03bdf0cfc94383303ac212a04939dff6f" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-wincon", + "concolor-override", + "concolor-query", + "is-terminal", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23ea9e81bd02e310c216d080f6223c179012256e5151c41db88d12c88a1684d2" + +[[package]] +name = "anstyle-parse" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7d1bb534e9efed14f3e5f44e7dd1a4f709384023a4165199a4241e18dff0116" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-wincon" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3127af6145b149f3287bb9a0d10ad9c5692dba8c53ad48285e5bec4063834fa" +dependencies = [ + "anstyle", + "windows-sys 0.45.0", +] + [[package]] name = "async-compression" version = "0.3.15" @@ -350,7 +390,7 @@ version = "0.22.0" dependencies = [ "binstalk", "binstalk-manifests", - "clap 4.1.14", + "clap 4.2.0", "compact_str", "dirs", "embed-resource", @@ -454,9 +494,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.1.14" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "906f7fe1da4185b7a282b2bc90172a496f9def1aca4545fe7526810741591e14" +checksum = "6efb5f0a41b5ef5b50c5da28c07609c20091df0c1fc33d418fa2a7e693c2b624" dependencies = [ "clap_builder", "clap_derive", @@ -465,22 +505,22 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.1.14" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "351f9ad9688141ed83dfd8f5fb998a06225ef444b48ff4dc43de6d409b7fd10b" +checksum = "671fcaa5debda4b9a84aa7fde49c907c8986c0e6ab927e04217c9cb74e7c8bc9" dependencies = [ + "anstream", + "anstyle", "bitflags", "clap_lex 0.4.0", - "is-terminal", "strsim", - "termcolor", ] [[package]] name = "clap_derive" -version = "4.1.14" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81d7dc0031c3a59a04fc2ba395c8e2dd463cba1859275f065d225f6122221b45" +checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" dependencies = [ "heck", "proc-macro2", @@ -538,6 +578,21 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "concolor-override" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a855d4a1978dc52fb0536a04d384c2c0c1aa273597f08b77c8c4d3b2eec6037f" + +[[package]] +name = "concolor-query" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d11d52c3d7ca2e6d0040212be9e4dbbcd78b6447f535b6b561f449427944cf" +dependencies = [ + "windows-sys 0.45.0", +] + [[package]] name = "core-foundation" version = "0.9.3" @@ -1255,7 +1310,7 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" name = "leon" version = "1.0.0" dependencies = [ - "clap 4.1.14", + "clap 4.2.0", "criterion", "miette", "serde", @@ -2261,15 +2316,6 @@ dependencies = [ "windows-sys 0.42.0", ] -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - [[package]] name = "terminal_size" version = "0.1.17" @@ -2720,6 +2766,12 @@ dependencies = [ "serde", ] +[[package]] +name = "utf8parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" + [[package]] name = "valuable" version = "0.1.0" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 0f177d95..4a864951 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.11.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.4.1" } -clap = { version = "4.1.14", features = ["derive", "env"] } +clap = { version = "4.2.0", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.0" file-format = { version = "0.15.0", default-features = false } diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 986ea57b..626291d9 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -clap = { version = "4.1.14", features = ["derive"], optional = true } +clap = { version = "4.2.0", features = ["derive"], optional = true } miette = { version = "5.5.0", default-features = false, optional = true } thiserror = "1.0.38" From 877606ef40a5084c6f1e8ef0dad72e316257310c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Mar 2023 23:11:34 +1100 Subject: [PATCH 1171/2020] Bump file-format from 0.15.0 to 0.16.0 (#960) --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ca48ebfc..7c056823 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -786,9 +786,9 @@ dependencies = [ [[package]] name = "file-format" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbe20e5f282c61432e5cf0e33185e5dde032b2c2e4281c4735c31ce5b455a869" +checksum = "71a5df8a0f4b423e8bc25526b39852bf64dfb7bd734ed99ed343c5925762c9c8" [[package]] name = "filetime" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 4a864951..34aa1f2f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -27,7 +27,7 @@ binstalk-manifests = { path = "../binstalk-manifests", version = "0.4.1" } clap = { version = "4.2.0", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.0" -file-format = { version = "0.15.0", default-features = false } +file-format = { version = "0.16.0", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } gh-token = "0.1.1" log = { version = "0.4.17", features = ["std"] } From b645cc6286d71eb915f7591bbd5fcd931d4fd5aa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 29 Mar 2023 23:12:31 +1100 Subject: [PATCH 1172/2020] Bump serde from 1.0.158 to 1.0.159 (#959) --- Cargo.lock | 8 ++++---- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7c056823..a80e0612 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2095,9 +2095,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.158" +version = "1.0.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771d4d9c4163ee138805e12c710dd365e4f44be8be0503cb1bb9eb989425d9c9" +checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" dependencies = [ "serde_derive", ] @@ -2113,9 +2113,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.158" +version = "1.0.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad" +checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 03c4eacd..950bebb8 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -24,7 +24,7 @@ futures-util = "0.3.27" generic-array = "0.14.7" httpdate = "1.0.2" reqwest = { version = "0.11.16", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } -serde = { version = "1.0.157", features = ["derive"], optional = true } +serde = { version = "1.0.159", features = ["derive"], optional = true } serde_json = { version = "1.0.95", optional = true } # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 65ff7cf4..cc2b5feb 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -17,7 +17,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" miette = "5.6.0" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.157", features = ["derive"] } +serde = { version = "1.0.159", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.95" thiserror = "1.0.40" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 1ade18d0..d3f23e81 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -14,7 +14,7 @@ compact_str = { version = "0.7.0", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.17.1" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.157", features = ["derive"] } +serde = { version = "1.0.159", features = ["derive"] } strum = "0.24.1" strum_macros = "0.24.3" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index a059e787..dbee5035 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -27,7 +27,7 @@ miette = "5.6.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.17.1" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.157", features = ["derive"] } +serde = { version = "1.0.159", features = ["derive"] } strum = "0.24.1" tempfile = "3.4.0" thiserror = "1.0.40" diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 626291d9..76a849aa 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -21,7 +21,7 @@ miette = ["dep:miette"] [dev-dependencies] criterion = { version = "0.4.0", default-features = false, features = ["cargo_bench_support"] } -serde = { version = "1.0.152", features = ["derive"] } +serde = { version = "1.0.159", features = ["derive"] } tinytemplate = "1.2.1" [[bench]] From 9a33ec7bd5187d0addd678c0ab315995789d6ded Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Mar 2023 02:38:11 +0000 Subject: [PATCH 1173/2020] Bump embed-resource from 2.0.0 to 2.1.1 (#965) --- Cargo.lock | 33 +++++++++++++++++---------------- crates/bin/Cargo.toml | 2 +- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a80e0612..b86244c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -420,7 +420,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f83bc2e401ed041b7057345ebc488c005efa0341d5541ce7004d30458d0090b" dependencies = [ "serde", - "toml 0.7.3", + "toml", ] [[package]] @@ -722,15 +722,15 @@ checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "embed-resource" -version = "2.0.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfa45bbf655db75e0be9c80a9d6ed2f5f58d321a623af660f74fd83e0eec07f0" +checksum = "80663502655af01a2902dff3f06869330782267924bf1788410b74edcd93770a" dependencies = [ "cc", "rustc_version", - "toml 0.5.11", + "toml", "vswhom", - "winreg", + "winreg 0.11.0", ] [[package]] @@ -1226,7 +1226,7 @@ dependencies = [ "socket2", "widestring", "winapi", - "winreg", + "winreg 0.10.1", ] [[package]] @@ -1902,7 +1902,7 @@ dependencies = [ "wasm-streams", "web-sys", "webpki-roots", - "winreg", + "winreg 0.10.1", ] [[package]] @@ -2490,15 +2490,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "toml" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" -dependencies = [ - "serde", -] - [[package]] name = "toml" version = "0.7.3" @@ -3089,6 +3080,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "winreg" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76a1a57ff50e9b408431e8f97d5456f2807f8eb2a2cd79b06068fc87f8ecf189" +dependencies = [ + "cfg-if", + "winapi", +] + [[package]] name = "xattr" version = "0.2.3" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 34aa1f2f..f7bbd278 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -46,7 +46,7 @@ tracing-log = { version = "0.1.3", default-features = false } tracing-subscriber = { version = "0.3.16", features = ["fmt", "json", "ansi"], default-features = false } [build-dependencies] -embed-resource = "2.0.0" +embed-resource = "2.1.1" [features] default = ["static", "rustls", "trust-dns", "fancy-no-backtrace", "zstd-thin"] From f46b0eab187e8366f1cc73eaaf552ca2d984e8f2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Mar 2023 02:49:38 +0000 Subject: [PATCH 1174/2020] Bump tempfile from 3.4.0 to 3.5.0 (#967) --- Cargo.lock | 64 ++++++++++++++++++++++----- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-wasi/Cargo.toml | 2 +- 6 files changed, 57 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b86244c3..4015281a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -765,6 +765,17 @@ dependencies = [ "winapi", ] +[[package]] +name = "errno" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" +dependencies = [ + "errno-dragonfly", + "libc", + "windows-sys 0.45.0", +] + [[package]] name = "errno-dragonfly" version = "0.1.2" @@ -798,7 +809,7 @@ checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "windows-sys 0.45.0", ] @@ -986,7 +997,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b35a8ce923c7490629d84e12fa2f75e1733f1ec692a47c264f9b7fd632855afc" dependencies = [ - "errno", + "errno 0.2.8", "libc", "log", "winapi", @@ -1362,6 +1373,12 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" +[[package]] +name = "linux-raw-sys" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd550e73688e6d578f0ac2119e32b797a327631a42f9433e59d02e139c8df60d" + [[package]] name = "lock_api" version = "0.4.9" @@ -1660,7 +1677,7 @@ checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" dependencies = [ "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "smallvec", "windows-sys 0.45.0", ] @@ -1831,6 +1848,15 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + [[package]] name = "redox_users" version = "0.4.3" @@ -1838,7 +1864,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ "getrandom", - "redox_syscall", + "redox_syscall 0.2.16", "thiserror", ] @@ -1952,7 +1978,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9" dependencies = [ "bitflags", - "errno", + "errno 0.2.8", "io-lifetimes 0.7.5", "libc", "linux-raw-sys 0.0.46", @@ -1966,13 +1992,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" dependencies = [ "bitflags", - "errno", + "errno 0.2.8", "io-lifetimes 1.0.9", "libc", "linux-raw-sys 0.1.4", "windows-sys 0.45.0", ] +[[package]] +name = "rustix" +version = "0.37.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e78cc525325c06b4a7ff02db283472f3c042b7ff0c391f96c6d5ac6f4f91b75" +dependencies = [ + "bitflags", + "errno 0.3.0", + "io-lifetimes 1.0.9", + "libc", + "linux-raw-sys 0.3.0", + "windows-sys 0.45.0", +] + [[package]] name = "rustls" version = "0.20.8" @@ -2305,15 +2345,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" +checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" dependencies = [ "cfg-if", "fastrand", - "redox_syscall", - "rustix 0.36.11", - "windows-sys 0.42.0", + "redox_syscall 0.3.5", + "rustix 0.37.5", + "windows-sys 0.45.0", ] [[package]] @@ -2469,7 +2509,7 @@ dependencies = [ "filetime", "futures-core", "libc", - "redox_syscall", + "redox_syscall 0.2.16", "tokio", "tokio-stream", "xattr", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index f7bbd278..3afe3fc1 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -38,7 +38,7 @@ semver = "1.0.17" strum = "0.24.1" strum_macros = "0.24.3" supports-color = "2.0.0" -tempfile = "3.4.0" +tempfile = "3.5.0" tokio = { version = "1.27.0", features = ["rt-multi-thread"], default-features = false } tracing-core = "0.1.30" tracing = { version = "0.1.37", default-features = false } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 950bebb8..fc51cdb0 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -31,7 +31,7 @@ serde_json = { version = "1.0.95", optional = true } # #tar = "0.4.38" tar = { package = "binstall-tar", version = "0.4.39" } -tempfile = "3.4.0" +tempfile = "3.5.0" thiserror = "1.0.40" tokio = { version = "1.27.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index cc2b5feb..7a327817 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -26,4 +26,4 @@ url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] detect-targets = { version = "0.1.7", path = "../detect-targets" } -tempfile = "3.4.0" +tempfile = "3.5.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index dbee5035..a3affb05 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -29,7 +29,7 @@ once_cell = "1.17.1" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.159", features = ["derive"] } strum = "0.24.1" -tempfile = "3.4.0" +tempfile = "3.5.0" thiserror = "1.0.40" # parking_lot for `tokio::sync::OnceCell::const_new` tokio = { version = "1.27.0", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index c1b561e1..88ad5a18 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -tempfile = "3.4.0" +tempfile = "3.5.0" [package.metadata.binstall] pkg-url = "{ repo }/releases/download/v{ version }/cargo-binstall-{ target }.full.{ archive-format }" From 6bdfa0ee3cdf8dcc70f196ddfa859ad2d36a3eeb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Mar 2023 03:21:21 +0000 Subject: [PATCH 1175/2020] Bump clap from 4.2.0 to 4.2.1 (#966) --- Cargo.lock | 12 ++++++------ crates/bin/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4015281a..fe0832e0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -390,7 +390,7 @@ version = "0.22.0" dependencies = [ "binstalk", "binstalk-manifests", - "clap 4.2.0", + "clap 4.2.1", "compact_str", "dirs", "embed-resource", @@ -494,9 +494,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.2.0" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6efb5f0a41b5ef5b50c5da28c07609c20091df0c1fc33d418fa2a7e693c2b624" +checksum = "046ae530c528f252094e4a77886ee1374437744b2bff1497aa898bbddbbb29b3" dependencies = [ "clap_builder", "clap_derive", @@ -505,9 +505,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.2.0" +version = "4.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "671fcaa5debda4b9a84aa7fde49c907c8986c0e6ab927e04217c9cb74e7c8bc9" +checksum = "223163f58c9a40c3b0a43e1c4b50a9ce09f007ea2cb1ec258a687945b4b7929f" dependencies = [ "anstream", "anstyle", @@ -1321,7 +1321,7 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" name = "leon" version = "1.0.0" dependencies = [ - "clap 4.2.0", + "clap 4.2.1", "criterion", "miette", "serde", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 3afe3fc1..a9ded6cb 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.11.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.4.1" } -clap = { version = "4.2.0", features = ["derive", "env"] } +clap = { version = "4.2.1", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.0" file-format = { version = "0.16.0", default-features = false } diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 76a849aa..5ee13c78 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -clap = { version = "4.2.0", features = ["derive"], optional = true } +clap = { version = "4.2.1", features = ["derive"], optional = true } miette = { version = "5.5.0", default-features = false, optional = true } thiserror = "1.0.38" From 10e350af8d6f9f420caff71e5f4d428d46410295 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 30 Mar 2023 03:29:23 +0000 Subject: [PATCH 1176/2020] Bump windows from 0.46.0 to 0.47.0 (#964) --- Cargo.lock | 93 ++++++++++++++++++++++++++++++-------- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 76 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fe0832e0..26b7ff5d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3014,11 +3014,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25" +checksum = "2649ff315bee4c98757f15dac226efe3d81927adbb6e882084bb1ee3e0c330a7" dependencies = [ - "windows-targets", + "windows-targets 0.47.0", ] [[package]] @@ -3027,13 +3027,13 @@ version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.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", ] [[package]] @@ -3042,7 +3042,7 @@ version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" dependencies = [ - "windows-targets", + "windows-targets 0.42.2", ] [[package]] @@ -3051,13 +3051,28 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "windows_aarch64_gnullvm 0.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", +] + +[[package]] +name = "windows-targets" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f8996d3f43b4b2d44327cd71b7b0efd1284ab60e6e9d0e8b630e18555d87d3e" +dependencies = [ + "windows_aarch64_gnullvm 0.47.0", + "windows_aarch64_msvc 0.47.0", + "windows_i686_gnu 0.47.0", + "windows_i686_msvc 0.47.0", + "windows_x86_64_gnu 0.47.0", + "windows_x86_64_gnullvm 0.47.0", + "windows_x86_64_msvc 0.47.0", ] [[package]] @@ -3066,42 +3081,84 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831d567d53d4f3cb1db332b68e6e2b6260228eb4d99a777d8b2e8ed794027c90" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +[[package]] +name = "windows_aarch64_msvc" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a42d54a417c60ce4f0e31661eed628f0fa5aca73448c093ec4d45fab4c51cdf" + [[package]] name = "windows_i686_gnu" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +[[package]] +name = "windows_i686_gnu" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1925beafdbb22201a53a483db861a5644123157c1c3cee83323a2ed565d71e3" + [[package]] name = "windows_i686_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +[[package]] +name = "windows_i686_msvc" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a8ef8f2f1711b223947d9b69b596cf5a4e452c930fb58b6fc3fdae7d0ec6b31" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +[[package]] +name = "windows_x86_64_gnu" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7acaa0c2cf0d2ef99b61c308a0c3dbae430a51b7345dedec470bd8f53f5a3642" + [[package]] name = "windows_x86_64_gnullvm" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a0628f71be1d11e17ca4a0e9e15b3a5180f6fbf1c2d55e3ba3f850378052c1" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +[[package]] +name = "windows_x86_64_msvc" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d6e62c256dc6d40b8c8707df17df8d774e60e39db723675241e7c15e910bce7" + [[package]] name = "winnow" version = "0.4.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index a3affb05..12fde244 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -38,7 +38,7 @@ url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" [target.'cfg(target_os = "windows")'.dependencies] -windows = { version = "0.46.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } +windows = { version = "0.47.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } [features] default = ["static", "rustls"] From 885da90e387edafdee091e0cf1b2c62d323add98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 31 Mar 2023 02:24:28 +0000 Subject: [PATCH 1177/2020] Bump futures-util from 0.3.27 to 0.3.28 (#968) --- Cargo.lock | 26 +++++++++++++------------- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 26b7ff5d..d4ec10d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -883,15 +883,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-io" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-lite" @@ -905,32 +905,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb14ed937631bd8b8b8977f2c198443447a8355b6e3ca599f38c975e5a963b6" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.10", ] [[package]] name = "futures-sink" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-util" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-core", "futures-io", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index fc51cdb0..febe6060 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -20,7 +20,7 @@ compact_str = "0.7.0" digest = "0.10.6" flate2 = { version = "1.0.25", default-features = false } futures-lite = { version = "1.12.0", default-features = false } -futures-util = "0.3.27" +futures-util = "0.3.28" generic-array = "0.14.7" httpdate = "1.0.2" reqwest = { version = "0.11.16", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } From b3abfab7fd7ff640db2ee2a093465c1e8a2a2163 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 02:39:33 +0000 Subject: [PATCH 1178/2020] Bump mimalloc from 0.1.34 to 0.1.35 (#972) --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d4ec10d0..07f28143 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1337,9 +1337,9 @@ checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" [[package]] name = "libmimalloc-sys" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8c7cbf8b89019683667e347572e6d55a7df7ea36b0c4ce69961b0cde67b174" +checksum = "ef2c45001fb108f37d41bed8efd715769acb14674c1ce3e266ef0e317ef5f877" dependencies = [ "cc", "libc", @@ -1478,9 +1478,9 @@ dependencies = [ [[package]] name = "mimalloc" -version = "0.1.34" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dcb174b18635f7561a0c6c9fc2ce57218ac7523cf72c50af80e2d79ab8f3ba1" +checksum = "92666043c712f7f5c756d07443469ddcda6dd971cc15258bb7f3c3216fd1b7aa" dependencies = [ "libmimalloc-sys", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index a9ded6cb..8d591d27 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -32,7 +32,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } gh-token = "0.1.1" log = { version = "0.4.17", features = ["std"] } miette = "5.6.0" -mimalloc = { version = "0.1.34", default-features = false, optional = true } +mimalloc = { version = "0.1.35", default-features = false, optional = true } once_cell = "1.17.1" semver = "1.0.17" strum = "0.24.1" From d7441e4675b773f672a88f86a1d9a43a6cf42e7f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 02:49:53 +0000 Subject: [PATCH 1179/2020] Bump windows from 0.47.0 to 0.48.0 (#974) --- Cargo.lock | 52 +++++++++++++++++++------------------- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 07f28143..d6b402be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3014,11 +3014,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.47.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2649ff315bee4c98757f15dac226efe3d81927adbb6e882084bb1ee3e0c330a7" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.47.0", + "windows-targets 0.48.0", ] [[package]] @@ -3062,17 +3062,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.47.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f8996d3f43b4b2d44327cd71b7b0efd1284ab60e6e9d0e8b630e18555d87d3e" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" dependencies = [ - "windows_aarch64_gnullvm 0.47.0", - "windows_aarch64_msvc 0.47.0", - "windows_i686_gnu 0.47.0", - "windows_i686_msvc 0.47.0", - "windows_x86_64_gnu 0.47.0", - "windows_x86_64_gnullvm 0.47.0", - "windows_x86_64_msvc 0.47.0", + "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", ] [[package]] @@ -3083,9 +3083,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.47.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "831d567d53d4f3cb1db332b68e6e2b6260228eb4d99a777d8b2e8ed794027c90" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" [[package]] name = "windows_aarch64_msvc" @@ -3095,9 +3095,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.47.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a42d54a417c60ce4f0e31661eed628f0fa5aca73448c093ec4d45fab4c51cdf" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" [[package]] name = "windows_i686_gnu" @@ -3107,9 +3107,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.47.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1925beafdbb22201a53a483db861a5644123157c1c3cee83323a2ed565d71e3" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" [[package]] name = "windows_i686_msvc" @@ -3119,9 +3119,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.47.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8ef8f2f1711b223947d9b69b596cf5a4e452c930fb58b6fc3fdae7d0ec6b31" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" [[package]] name = "windows_x86_64_gnu" @@ -3131,9 +3131,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.47.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acaa0c2cf0d2ef99b61c308a0c3dbae430a51b7345dedec470bd8f53f5a3642" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" [[package]] name = "windows_x86_64_gnullvm" @@ -3143,9 +3143,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.47.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5a0628f71be1d11e17ca4a0e9e15b3a5180f6fbf1c2d55e3ba3f850378052c1" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" [[package]] name = "windows_x86_64_msvc" @@ -3155,9 +3155,9 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.47.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6e62c256dc6d40b8c8707df17df8d774e60e39db723675241e7c15e910bce7" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 12fde244..15b9369a 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -38,7 +38,7 @@ url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" [target.'cfg(target_os = "windows")'.dependencies] -windows = { version = "0.47.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } +windows = { version = "0.48.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } [features] default = ["static", "rustls"] From 363dbc650ae54894facea1d9e7b630eb7702c4f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 3 Apr 2023 03:06:19 +0000 Subject: [PATCH 1180/2020] Bump miette from 5.6.0 to 5.7.0 (#973) --- Cargo.lock | 40 +++++++++++++++++----------- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 5 files changed, 29 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d6b402be..04e85101 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -125,7 +125,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.10", + "syn 2.0.13", ] [[package]] @@ -176,6 +176,15 @@ dependencies = [ "rustc-demangle", ] +[[package]] +name = "backtrace-ext" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "537beee3be4a18fb023b570f80e3ae28003db9167a751266b259926e25539d50" +dependencies = [ + "backtrace", +] + [[package]] name = "base64" version = "0.13.1" @@ -525,7 +534,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.10", + "syn 2.0.13", ] [[package]] @@ -911,7 +920,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.10", + "syn 2.0.13", ] [[package]] @@ -1447,11 +1456,12 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "miette" -version = "5.6.0" +version = "5.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07749fb52853e739208049fb513287c6f448de9103dfa78b05ae01f2fc5809bb" +checksum = "7abdc09c381c9336b9f2e9bd6067a9a5290d20e2d2e2296f275456121c33ae89" dependencies = [ "backtrace", + "backtrace-ext", "is-terminal", "miette-derive", "once_cell", @@ -1467,13 +1477,13 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.6.0" +version = "5.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a07ad93a80d1b92bb44cb42d7c49b49c9aab1778befefad49cceb5e4c5bf460" +checksum = "8842972f23939443013dfd3720f46772b743e86f1a81d120d4b6fb090f87de1c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.13", ] [[package]] @@ -1734,9 +1744,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.53" +version = "1.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba466839c78239c09faf015484e5cc04860f88242cff4d03eb038f04b4699b73" +checksum = "1d0dd4be24fcdcfeaa12a432d588dc59bbad6cad3510c67e74a2b6b2fc950564" dependencies = [ "unicode-ident", ] @@ -2159,7 +2169,7 @@ checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" dependencies = [ "proc-macro2", "quote", - "syn 2.0.10", + "syn 2.0.13", ] [[package]] @@ -2334,9 +2344,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.10" +version = "2.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aad1363ed6d37b84299588d62d3a7d95b5a5c2d9aad5c85609fda12afaa1f40" +checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" dependencies = [ "proc-macro2", "quote", @@ -2400,7 +2410,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.10", + "syn 2.0.13", ] [[package]] @@ -2465,7 +2475,7 @@ checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.10", + "syn 2.0.13", ] [[package]] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 8d591d27..e7f5f0f1 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -31,7 +31,7 @@ file-format = { version = "0.16.0", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } gh-token = "0.1.1" log = { version = "0.4.17", features = ["std"] } -miette = "5.6.0" +miette = "5.7.0" mimalloc = { version = "0.1.35", default-features = false, optional = true } once_cell = "1.17.1" semver = "1.0.17" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 7a327817..6629bfd7 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -15,7 +15,7 @@ binstalk-types = { version = "0.3.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" -miette = "5.6.0" +miette = "5.7.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.159", features = ["derive"] } serde-tuple-vec-map = "1.0.1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 15b9369a..e1fb1bec 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -23,7 +23,7 @@ itertools = "0.10.5" jobslot = { version = "0.2.10", features = ["tokio"] } leon = { version = "1.0.0", path = "../leon" } maybe-owned = "0.3.4" -miette = "5.6.0" +miette = "5.7.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.17.1" semver = { version = "1.0.17", features = ["serde"] } diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 5ee13c78..1f7cf864 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] clap = { version = "4.2.1", features = ["derive"], optional = true } -miette = { version = "5.5.0", default-features = false, optional = true } +miette = { version = "5.7.0", default-features = false, optional = true } thiserror = "1.0.38" [features] From 6a224da9ee6e23325185aeacfa375c9e293741c1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 4 Apr 2023 01:40:01 +1000 Subject: [PATCH 1181/2020] Run unit tests in `release-build.yml` (#977) Since release build enables a lot of optimization, disable debug assert and possibly change the code to be run, it's better to run the tests again. Signed-off-by: Jiahao XU --- .github/workflows/release-build.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 0455d84d..efecdc8e 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -58,6 +58,12 @@ jobs: - if: runner.os != 'Windows' run: ls -shal packages/ + - name: Run unit tests in release build + if: "matrix.r" + run: just unit-tests + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Ensure release binary is runnable if: "matrix.r" run: just e2e-tests From 24634b2de158197b6a8e4252bb3dbacffd721acc Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 4 Apr 2023 01:40:13 +1000 Subject: [PATCH 1182/2020] Speedup workflow lipo in `release-build.yml` (#975) Speedup workflow lipo in release-build Signed-off-by: Jiahao XU --- .github/workflows/release-build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index efecdc8e..94fe2475 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -96,10 +96,10 @@ jobs: steps: - uses: actions/checkout@v3 - - uses: ./.github/actions/just-setup + + - uses: taiki-e/install-action@v2 with: - indexcache: false - buildcache: false + tool: just - uses: actions/download-artifact@v3 with: From 8dd7aa568887a9382e34c6e2eadc47e2e40e02ed Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 4 Apr 2023 01:40:26 +1000 Subject: [PATCH 1183/2020] Speedup `ci.yml`: Do not run tests on x86_64-unknown-linux-musl (#976) Speedup ci.yml: Do not run tests on x86_64-unknown-linux-musl Since we already run test on x86_64-unknown-linux-musl in release-build.yml and x86_64-unknown-linux-musl is almost identical to x86_64-unknown-linux-gnu except for the libc, there's no need to run the tests in ci.yml Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 74d8e596..a6a8abe9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,16 +36,12 @@ jobs: os: macos-latest - target: x86_64-unknown-linux-gnu os: ubuntu-latest - - target: x86_64-unknown-linux-musl - os: ubuntu-latest - c: true - target: x86_64-pc-windows-msvc os: windows-latest runs-on: ${{ matrix.os }} env: CARGO_BUILD_TARGET: ${{ matrix.target }} - JUST_USE_CARGO_ZIGBUILD: ${{ matrix.c }} steps: - uses: actions/checkout@v3 @@ -71,6 +67,7 @@ jobs: - armv7-unknown-linux-gnueabihf - aarch64-unknown-linux-musl - aarch64-unknown-linux-gnu + - x86_64-unknown-linux-musl runs-on: ubuntu-latest env: From f384088fd1017d89abd9e931f60c125e7347649a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 4 Apr 2023 01:51:13 +1000 Subject: [PATCH 1184/2020] Avoid checking dev-deps for jobs `*-check` and `lint` in workflow `ci.yml` (#978) Avoid checking dev-deps for jobs `*-check` and lint in workflow `ci.yml` We just want to make sure cargo-binstall can compile for the target, we don't want to pull in the extra dependencies. Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 4 ++++ justfile | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6a8abe9..ee205af2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,6 +85,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: just ci-install-deps + - run: just avoid-dev-deps - run: just check apple-m1-check: @@ -102,6 +103,7 @@ jobs: # which works better when we provide it with GITHUB_TOKEN. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: just avoid-dev-deps - run: just check windows-aarch64-check: @@ -119,6 +121,7 @@ jobs: # which works better when we provide it with GITHUB_TOKEN. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: just avoid-dev-deps - run: just check lint: @@ -142,6 +145,7 @@ jobs: - run: just toolchain rustfmt,clippy - run: just ci-install-deps + - run: just avoid-dev-deps - run: just lint # Dummy job to have a stable name for the "all tests pass" requirement diff --git a/justfile b/justfile index fe6488b0..ae973e6d 100644 --- a/justfile +++ b/justfile @@ -220,6 +220,14 @@ fmt-check: fmt lint: clippy fmt-check +# Some dev-dependencies require a newer version of Rust, but it doesn't matter for MSRV check +# This is a workaround for the cargo nightly option `-Z avoid-dev-deps` +avoid-dev-deps: + for crate in ./crates/*; do \ + sed 's/\[dev-dependencies\]/[workaround-avoid-dev-deps]/g' "$crate/Cargo.toml" >"$crate/Cargo.toml.tmp"; \ + mv "$crate/Cargo.toml.tmp" "$crate/Cargo.toml" \ + ; done + package-dir: rm -rf packages/prep mkdir -p packages/prep From 6c01968ce95cddd4eb83aad7e893cf473cbf654b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 5 Apr 2023 13:04:01 +1000 Subject: [PATCH 1185/2020] Bump mimalloc from 0.1.35 to 0.1.36 (#979) Bumps [mimalloc](https://github.com/purpleprotocol/mimalloc_rust) from 0.1.35 to 0.1.36. - [Release notes](https://github.com/purpleprotocol/mimalloc_rust/releases) - [Commits](https://github.com/purpleprotocol/mimalloc_rust/compare/v0.1.35...v0.1.36) --- updated-dependencies: - dependency-name: mimalloc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 04e85101..d48c1a86 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1346,9 +1346,9 @@ checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" [[package]] name = "libmimalloc-sys" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef2c45001fb108f37d41bed8efd715769acb14674c1ce3e266ef0e317ef5f877" +checksum = "43a558e3d911bc3c7bfc8c78bc580b404d6e51c1cefbf656e176a94b49b0df40" dependencies = [ "cc", "libc", @@ -1488,9 +1488,9 @@ dependencies = [ [[package]] name = "mimalloc" -version = "0.1.35" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92666043c712f7f5c756d07443469ddcda6dd971cc15258bb7f3c3216fd1b7aa" +checksum = "3d88dad3f985ec267a3fcb7a1726f5cb1a7e8cad8b646e70a84f967210df23da" dependencies = [ "libmimalloc-sys", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index e7f5f0f1..974a05b1 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -32,7 +32,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } gh-token = "0.1.1" log = { version = "0.4.17", features = ["std"] } miette = "5.7.0" -mimalloc = { version = "0.1.35", default-features = false, optional = true } +mimalloc = { version = "0.1.36", default-features = false, optional = true } once_cell = "1.17.1" semver = "1.0.17" strum = "0.24.1" From 0de3b2100460e0419a681be33e03477244b32aa7 Mon Sep 17 00:00:00 2001 From: David Weis Date: Thu, 6 Apr 2023 01:31:28 +0100 Subject: [PATCH 1186/2020] Fix download link for armv7 release in readme (#980 Fix download link for armv7 in readme --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index bc8de9c3..8618d5cc 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ We recommend using the pre-compiled ones because we optimize those more than a s | OS | Arch | URL | | ------- | ------- | ------------------------------------------------------------ | | linux | x86\_64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz | -| linux | armv7 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz | +| linux | armv7 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-armv7-unknown-linux-musleabihf.tgz | | linux | arm64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-unknown-linux-musl.tgz | | macos | x86\_64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-apple-darwin.zip | | macos | m1 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-apple-darwin.zip | From f134df548d3430e3ab20dcb8ba846c0efbb86c69 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 6 Apr 2023 16:19:15 +1000 Subject: [PATCH 1187/2020] Optimize `release-build.yml`: Avoid building benchmark dependencies (#981) Signed-off-by: Jiahao XU --- .github/workflows/release-build.yml | 4 +++- justfile | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 94fe2475..97a67cce 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -60,7 +60,9 @@ jobs: - name: Run unit tests in release build if: "matrix.r" - run: just unit-tests + run: | + just avoid-benchmark-deps + just unit-tests env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/justfile b/justfile index ae973e6d..c7dd34d4 100644 --- a/justfile +++ b/justfile @@ -220,7 +220,7 @@ fmt-check: fmt lint: clippy fmt-check -# Some dev-dependencies require a newer version of Rust, but it doesn't matter for MSRV check +# Rm dev-dependencies for `cargo-check` and clippy to speedup compilation. # This is a workaround for the cargo nightly option `-Z avoid-dev-deps` avoid-dev-deps: for crate in ./crates/*; do \ @@ -228,6 +228,12 @@ avoid-dev-deps: mv "$crate/Cargo.toml.tmp" "$crate/Cargo.toml" \ ; done +# leon dev-dependencies pulls in crates for benchmark but not used in test. +# This is a workaround for the lack of `benchmark-dependencies`. +avoid-benchmark-deps: + sed 's/\[dev-dependencies\]/[workaround-avoid-dev-deps]/g' ./crates/leon/Cargo.toml >./crates/leon/Cargo.toml.tmp + mv ./crates/leon/Cargo.toml.tmp ./crates/leon/Cargo.toml + package-dir: rm -rf packages/prep mkdir -p packages/prep From 35b32c43e0c3244033e284428b6a24dfd8d42f69 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 6 Apr 2023 18:08:14 +1000 Subject: [PATCH 1188/2020] Run `release-build.yml` unconditionally for consistency & inc cache hits (#982) Since it is run on PR anyway, we should also run it on main just in case it fails, i.e. merging of PRs without rebasing against main to test out latest changes. It will now also be run on draft PR so that they can test out the changes and find out bugs before making it ready to review. This change will also increase cache hits on PR, thus speeding up the CI. Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee205af2..b040c73a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -163,9 +163,9 @@ jobs: # fail if ANY dependency has failed or been skipped or cancelled - if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled')" run: exit 1 + # Wait for 30s before release build to avoid overloading GitHub. + - run: sleep 30 - # if everything succeeds and PR is ready for review, test the release/package process release-builds: - if: (github.event_name == 'pull_request' && github.event.pull_request.draft == false) || github.event_name == 'workflow_dispatch' needs: tests-pass uses: ./.github/workflows/release-build.yml From 8ccb6c887a6bd51d353b131aae3bf7be0c38a836 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Apr 2023 12:54:49 +1000 Subject: [PATCH 1189/2020] Bump futures-lite from 1.12.0 to 1.13.0 (#983) Bumps [futures-lite](https://github.com/smol-rs/futures-lite) from 1.12.0 to 1.13.0. - [Release notes](https://github.com/smol-rs/futures-lite/releases) - [Changelog](https://github.com/smol-rs/futures-lite/blob/master/CHANGELOG.md) - [Commits](https://github.com/smol-rs/futures-lite/compare/v1.12.0...v1.13.0) --- updated-dependencies: - dependency-name: futures-lite dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d48c1a86..fba5f498 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -904,9 +904,9 @@ checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-lite" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" dependencies = [ "futures-core", "pin-project-lite", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index febe6060..48ed7621 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -19,7 +19,7 @@ bzip2 = "0.4.4" compact_str = "0.7.0" digest = "0.10.6" flate2 = { version = "1.0.25", default-features = false } -futures-lite = { version = "1.12.0", default-features = false } +futures-lite = { version = "1.13.0", default-features = false } futures-util = "0.3.28" generic-array = "0.14.7" httpdate = "1.0.2" From 75f48cce3ec932d846bae5187896f457d64535dc Mon Sep 17 00:00:00 2001 From: Milo Moisson Date: Mon, 10 Apr 2023 16:48:01 +0200 Subject: [PATCH 1190/2020] feat: pretty print .crates.toml manifest to match cargo behaviour (#984) Fixed #970 --- crates/binstalk-manifests/src/cargo_crates_v1.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/binstalk-manifests/src/cargo_crates_v1.rs b/crates/binstalk-manifests/src/cargo_crates_v1.rs index 5cffb4e0..8c57299b 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1.rs @@ -89,8 +89,8 @@ impl CratesToml<'_> { this: &CratesToml<'_>, writer: &mut dyn io::Write, ) -> Result<(), CratesTomlParseError> { - let data = toml_edit::ser::to_vec(&this)?; - writer.write_all(&data)?; + let data = toml_edit::ser::to_string_pretty(&this)?; + writer.write_all(data.as_bytes())?; Ok(()) } From 067af4ea256dab8d7108dbfe71b31dc1cf9de8d2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 12 Apr 2023 13:35:00 +1000 Subject: [PATCH 1191/2020] Bump serde from 1.0.159 to 1.0.160 (#985) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.159 to 1.0.160. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.159...v1.0.160) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fba5f498..e682267c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2145,9 +2145,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.159" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c04e8343c3daeec41f58990b9d77068df31209f2af111e059e9fe9646693065" +checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" dependencies = [ "serde_derive", ] @@ -2163,9 +2163,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.159" +version = "1.0.160" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c614d17805b093df4b147b51339e7e44bf05ef59fba1e45d83500bcfb4d8585" +checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 48ed7621..31184184 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -24,7 +24,7 @@ futures-util = "0.3.28" generic-array = "0.14.7" httpdate = "1.0.2" reqwest = { version = "0.11.16", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } -serde = { version = "1.0.159", features = ["derive"], optional = true } +serde = { version = "1.0.160", features = ["derive"], optional = true } serde_json = { version = "1.0.95", optional = true } # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 6629bfd7..f2f6f1ea 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -17,7 +17,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" miette = "5.7.0" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.159", features = ["derive"] } +serde = { version = "1.0.160", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.95" thiserror = "1.0.40" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index d3f23e81..6ecde975 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -14,7 +14,7 @@ compact_str = { version = "0.7.0", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.17.1" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.159", features = ["derive"] } +serde = { version = "1.0.160", features = ["derive"] } strum = "0.24.1" strum_macros = "0.24.3" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index e1fb1bec..6074002e 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -27,7 +27,7 @@ miette = "5.7.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.17.1" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.159", features = ["derive"] } +serde = { version = "1.0.160", features = ["derive"] } strum = "0.24.1" tempfile = "3.5.0" thiserror = "1.0.40" diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 1f7cf864..aeef5e4b 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -21,7 +21,7 @@ miette = ["dep:miette"] [dev-dependencies] criterion = { version = "0.4.0", default-features = false, features = ["cargo_bench_support"] } -serde = { version = "1.0.159", features = ["derive"] } +serde = { version = "1.0.160", features = ["derive"] } tinytemplate = "1.2.1" [[bench]] From da59f0b707284e1681e2da45faeb6d41c1346af5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 13 Apr 2023 13:17:30 +1000 Subject: [PATCH 1192/2020] Bump serde_json from 1.0.95 to 1.0.96 (#986) Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.95 to 1.0.96. - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.95...v1.0.96) --- updated-dependencies: - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e682267c..68ccea33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2174,9 +2174,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d721eca97ac802aa7777b701877c8004d950fc142651367300d21c1cc0194744" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" dependencies = [ "itoa", "ryu", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 31184184..1a8c2287 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -25,7 +25,7 @@ generic-array = "0.14.7" httpdate = "1.0.2" reqwest = { version = "0.11.16", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } serde = { version = "1.0.160", features = ["derive"], optional = true } -serde_json = { version = "1.0.95", optional = true } +serde_json = { version = "1.0.96", optional = true } # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. # diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index f2f6f1ea..ffe895a0 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -19,7 +19,7 @@ miette = "5.7.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.160", features = ["derive"] } serde-tuple-vec-map = "1.0.1" -serde_json = "1.0.95" +serde_json = "1.0.96" thiserror = "1.0.40" toml_edit = { version = "0.19.8", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } From a5bf45abe9da59c5abadca139af520273edc6f97 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 14 Apr 2023 02:24:24 +0000 Subject: [PATCH 1193/2020] Bump clap from 4.2.1 to 4.2.2 (#987) --- Cargo.lock | 75 +++++++++++++++++++++++------------------- crates/bin/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 3 files changed, 44 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 68ccea33..61583ed6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -60,42 +60,51 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.2.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "342258dd14006105c2b75ab1bd7543a03bdf0cfc94383303ac212a04939dff6f" +checksum = "9e579a7752471abc2a8268df8b20005e3eadd975f585398f17efcfd8d4927371" dependencies = [ "anstyle", "anstyle-parse", + "anstyle-query", "anstyle-wincon", - "concolor-override", - "concolor-query", + "colorchoice", "is-terminal", "utf8parse", ] [[package]] name = "anstyle" -version = "0.3.5" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23ea9e81bd02e310c216d080f6223c179012256e5151c41db88d12c88a1684d2" +checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" [[package]] name = "anstyle-parse" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7d1bb534e9efed14f3e5f44e7dd1a4f709384023a4165199a4241e18dff0116" +checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" dependencies = [ "utf8parse", ] [[package]] -name = "anstyle-wincon" -version = "0.2.0" +name = "anstyle-query" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3127af6145b149f3287bb9a0d10ad9c5692dba8c53ad48285e5bec4063834fa" +checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +dependencies = [ + "windows-sys 0.48.0", +] + +[[package]] +name = "anstyle-wincon" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcd8291a340dd8ac70e18878bc4501dd7b4ff970cfa21c207d36ece51ea88fd" dependencies = [ "anstyle", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -399,7 +408,7 @@ version = "0.22.0" dependencies = [ "binstalk", "binstalk-manifests", - "clap 4.2.1", + "clap 4.2.2", "compact_str", "dirs", "embed-resource", @@ -503,9 +512,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.2.1" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046ae530c528f252094e4a77886ee1374437744b2bff1497aa898bbddbbb29b3" +checksum = "9b802d85aaf3a1cdb02b224ba472ebdea62014fccfcb269b95a4d76443b5ee5a" dependencies = [ "clap_builder", "clap_derive", @@ -514,9 +523,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.2.1" +version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "223163f58c9a40c3b0a43e1c4b50a9ce09f007ea2cb1ec258a687945b4b7929f" +checksum = "14a1a858f532119338887a4b8e1af9c60de8249cd7bafd68036a489e261e37b6" dependencies = [ "anstream", "anstyle", @@ -561,6 +570,12 @@ dependencies = [ "cc", ] +[[package]] +name = "colorchoice" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" + [[package]] name = "command-group" version = "2.1.0" @@ -587,21 +602,6 @@ dependencies = [ "static_assertions", ] -[[package]] -name = "concolor-override" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a855d4a1978dc52fb0536a04d384c2c0c1aa273597f08b77c8c4d3b2eec6037f" - -[[package]] -name = "concolor-query" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d11d52c3d7ca2e6d0040212be9e4dbbcd78b6447f535b6b561f449427944cf" -dependencies = [ - "windows-sys 0.45.0", -] - [[package]] name = "core-foundation" version = "0.9.3" @@ -1330,7 +1330,7 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" name = "leon" version = "1.0.0" dependencies = [ - "clap 4.2.1", + "clap 4.2.2", "criterion", "miette", "serde", @@ -3055,6 +3055,15 @@ dependencies = [ "windows-targets 0.42.2", ] +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + [[package]] name = "windows-targets" version = "0.42.2" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 974a05b1..72b1de3b 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.11.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.4.1" } -clap = { version = "4.2.1", features = ["derive", "env"] } +clap = { version = "4.2.2", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.0" file-format = { version = "0.16.0", default-features = false } diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index aeef5e4b..cb9cdbb9 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -clap = { version = "4.2.1", features = ["derive"], optional = true } +clap = { version = "4.2.2", features = ["derive"], optional = true } miette = { version = "5.7.0", default-features = false, optional = true } thiserror = "1.0.38" From 345c14d7ba568706f276b646cdff662379623203 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Apr 2023 12:43:48 +1000 Subject: [PATCH 1194/2020] Bump jobslot from 0.2.10 to 0.2.11 (#989) Bumps [jobslot](https://github.com/cargo-bins/jobslot) from 0.2.10 to 0.2.11. - [Release notes](https://github.com/cargo-bins/jobslot/releases) - [Commits](https://github.com/cargo-bins/jobslot/compare/v0.2.10...v0.2.11) --- updated-dependencies: - dependency-name: jobslot dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 6 +++--- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 61583ed6..ea8e558e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1299,16 +1299,16 @@ dependencies = [ [[package]] name = "jobslot" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6650f8f817795211f076e9923ba9f35e66aad1946ac19c960ef5b114cd75c727" +checksum = "f0953ea85c43ff26a6e5bd84152363d694a3a82435df66be0880bef38913cce9" dependencies = [ "cfg-if", "getrandom", "libc", "scopeguard", "tokio", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 6074002e..62fdacc7 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -20,7 +20,7 @@ detect-targets = { version = "0.1.7", path = "../detect-targets" } either = "1.8.1" home = "0.5.4" itertools = "0.10.5" -jobslot = { version = "0.2.10", features = ["tokio"] } +jobslot = { version = "0.2.11", features = ["tokio"] } leon = { version = "1.0.0", path = "../leon" } maybe-owned = "0.3.4" miette = "5.7.0" From fa0455a417d404ffd3ca078bf51cc5388699e466 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 17 Apr 2023 13:42:53 +1000 Subject: [PATCH 1195/2020] Update transitive dependencies (#990) Signed-off-by: Jiahao XU --- Cargo.lock | 175 +++++++++++++++++++++++------------------------------ 1 file changed, 77 insertions(+), 98 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ea8e558e..0dd1b4b7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -134,7 +134,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -530,7 +530,7 @@ dependencies = [ "anstream", "anstyle", "bitflags", - "clap_lex 0.4.0", + "clap_lex 0.4.1", "strsim", ] @@ -543,7 +543,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -557,15 +557,15 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f0807fb6f644c83f3e4ec014fec9858c1c8b26a7db8eb5f0bde5817df9c1df7" +checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" [[package]] name = "cmake" -version = "0.1.49" +version = "0.1.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db34956e100b30725f2eb215f90d4871051239535632f84fea3bc92722c66b7c" +checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" dependencies = [ "cc", ] @@ -614,9 +614,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "crc32fast" @@ -776,13 +776,13 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d6a0976c999d473fe89ad888d5a284e55366d9dc9038b1ba2aa15128c4afa0" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" dependencies = [ "errno-dragonfly", "libc", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -812,14 +812,14 @@ checksum = "71a5df8a0f4b423e8bc25526b39852bf64dfb7bd734ed99ed343c5925762c9c8" [[package]] name = "filetime" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a3de6e8d11b22ff9edc6d916f890800597d60f8b2da1caf2955c274638d6412" +checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" dependencies = [ "cfg-if", "libc", "redox_syscall 0.2.16", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -883,9 +883,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", ] @@ -920,7 +920,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -973,9 +973,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" dependencies = [ "cfg-if", "libc", @@ -1014,9 +1014,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be7b54589b581f624f566bf5d8eb2bab1db736c51528720b6bd36b96b55924d" +checksum = "66b91535aa35fea1523ad1b86cb6b53c28e0ae566ba4a460f4457e936cad7c6f" dependencies = [ "bytes", "fnv", @@ -1132,9 +1132,9 @@ checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" [[package]] name = "hyper" -version = "0.14.25" +version = "0.14.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc5e554ff619822309ffd57d8734d77cd5ce6238bc956f037ea06c58238c9899" +checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" dependencies = [ "bytes", "futures-channel", @@ -1203,9 +1203,9 @@ 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", @@ -1228,13 +1228,13 @@ checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" [[package]] name = "io-lifetimes" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09270fd4fa1111bc614ed2246c7ef56239a3063d5be0d1ec3b589c505d400aeb" +checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" dependencies = [ "hermit-abi 0.3.1", "libc", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -1251,20 +1251,20 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e22bd8629359895450b59ea7a776c850561b96a3b1d31321c1949d9e6c9146" +checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" [[package]] name = "is-terminal" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8687c819457e979cc940d09cb16e42a1bf70aa6b60a549de6d3a62a0ee90c69e" +checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" dependencies = [ "hermit-abi 0.3.1", - "io-lifetimes 1.0.9", - "rustix 0.36.11", - "windows-sys 0.45.0", + "io-lifetimes 1.0.10", + "rustix 0.37.11", + "windows-sys 0.48.0", ] [[package]] @@ -1340,9 +1340,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.140" +version = "0.2.141" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" +checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" [[package]] name = "libmimalloc-sys" @@ -1378,15 +1378,9 @@ checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" [[package]] name = "linux-raw-sys" -version = "0.1.4" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" - -[[package]] -name = "linux-raw-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd550e73688e6d578f0ac2119e32b797a327631a42f9433e59d02e139c8df60d" +checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" [[package]] name = "lock_api" @@ -1483,7 +1477,7 @@ checksum = "8842972f23939443013dfd3720f46772b743e86f1a81d120d4b6fb090f87de1c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -1608,9 +1602,9 @@ checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" [[package]] name = "openssl" -version = "0.10.47" +version = "0.10.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b277f87dacc05a6b709965d1cbafac4649d6ce9f3ce9ceb88508b5666dfec9" +checksum = "7e30d8bc91859781f0a943411186324d580f2bbeb71b452fe91ae344806af3f1" dependencies = [ "bitflags", "cfg-if", @@ -1623,13 +1617,13 @@ dependencies = [ [[package]] name = "openssl-macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b501e44f11665960c7e7fcf062c7d96a14ade4aa98116c004b2e37b5be7d736c" +checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.15", ] [[package]] @@ -1640,11 +1634,10 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.82" +version = "0.9.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a95792af3c4e0153c3914df2261bedd30a98476f94dc892b67dfe1d89d433a04" +checksum = "0d3d193fb1488ad46ffe3aaabc912cc931d02ee8518fe2959aea8ef52718b0c0" dependencies = [ - "autocfg", "cc", "libc", "pkg-config", @@ -1744,9 +1737,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.55" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d0dd4be24fcdcfeaa12a432d588dc59bbad6cad3510c67e74a2b6b2fc950564" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" dependencies = [ "unicode-ident", ] @@ -1880,9 +1873,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.2" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cce168fea28d3e05f158bda4576cf0c844d5045bc2cc3620fa0292ed5bb5814c" +checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" dependencies = [ "aho-corasick", "memchr", @@ -1968,9 +1961,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" [[package]] name = "rustc_version" @@ -1997,30 +1990,16 @@ dependencies = [ [[package]] name = "rustix" -version = "0.36.11" +version = "0.37.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4165c9963ab29e422d6c26fbc1d37f15bace6b2810221f9d925023480fcf0e" +checksum = "85597d61f83914ddeba6a47b3b8ffe7365107221c2e557ed94426489fefb5f77" dependencies = [ "bitflags", - "errno 0.2.8", - "io-lifetimes 1.0.9", + "errno 0.3.1", + "io-lifetimes 1.0.10", "libc", - "linux-raw-sys 0.1.4", - "windows-sys 0.45.0", -] - -[[package]] -name = "rustix" -version = "0.37.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e78cc525325c06b4a7ff02db283472f3c042b7ff0c391f96c6d5ac6f4f91b75" -dependencies = [ - "bitflags", - "errno 0.3.0", - "io-lifetimes 1.0.9", - "libc", - "linux-raw-sys 0.3.0", - "windows-sys 0.45.0", + "linux-raw-sys 0.3.1", + "windows-sys 0.48.0", ] [[package]] @@ -2169,7 +2148,7 @@ checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -2206,9 +2185,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.19" +version = "0.9.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82e6c8c047aa50a7328632d067bcae6ef38772a79e28daf32f735e0e4f3dd10" +checksum = "d9d684e3ec7de3bf5466b32bd75303ac16f0736426e5a4e0d6e489559ce1249c" dependencies = [ "indexmap", "itoa", @@ -2344,9 +2323,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.13" +version = "2.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c9da457c5285ac1f936ebd076af6dac17a61cfe7826f2076b4d015cf47bc8ec" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" dependencies = [ "proc-macro2", "quote", @@ -2362,7 +2341,7 @@ dependencies = [ "cfg-if", "fastrand", "redox_syscall 0.3.5", - "rustix 0.37.5", + "rustix 0.37.11", "windows-sys 0.45.0", ] @@ -2410,7 +2389,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -2475,7 +2454,7 @@ checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.13", + "syn 2.0.15", ] [[package]] @@ -2785,9 +2764,9 @@ checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "unsafe-libyaml" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad2024452afd3874bf539695e04af6732ba06517424dbf958fdb16a01f3bef6c" +checksum = "1865806a559042e51ab5414598446a5871b561d21b6764f2eabb0dd481d880a6" [[package]] name = "untrusted" @@ -3180,9 +3159,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deac0939bd6e4f24ab5919fbf751c97a8cfc8543bb083a305ed5c0c10bb241d1" +checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28" dependencies = [ "memchr", ] @@ -3239,7 +3218,7 @@ version = "0.12.3+zstd.1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" dependencies = [ - "zstd-safe 6.0.4+zstd.1.5.4", + "zstd-safe 6.0.5+zstd.1.5.4", ] [[package]] @@ -3254,9 +3233,9 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "6.0.4+zstd.1.5.4" +version = "6.0.5+zstd.1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7afb4b54b8910cf5447638cb54bf4e8a65cbedd783af98b98c62ffe91f185543" +checksum = "d56d9e60b4b1758206c238a10165fbcae3ca37b01744e394c463463f6529d23b" dependencies = [ "libc", "zstd-sys", @@ -3264,9 +3243,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.7+zstd.1.5.4" +version = "2.0.8+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94509c3ba2fe55294d752b79842c530ccfab760192521df74a081a78d2b3c7f5" +checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" dependencies = [ "cc", "libc", From 5683ca247656409e2a15e73b2a2ad1fad0e92431 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 17 Apr 2023 14:50:58 +1000 Subject: [PATCH 1196/2020] Add new crate `leon-macros` that provide `template!` with identical syntax as runtime parsing (#946) `leon_macros::template!` can parse template at compile-time. It accepts a utf-8 string literal and uses `leon` internally to parse it, then generate code that evaluates to `Template<'static>`. - Exclude fuzz from crate leon when publishing - Impl fn-like proc-macro `leon_macros::template!` - Add dep `leon-macros` to binstalk - Use `leon_macros::template!` in `binstalk::fetchers::gh_crate_meta::hosting` - Add doc for `leon-macros` in `leon` - Improve `std::fmt::Display` impl for `leon::ParseError` - Fixed broken infra link in leon Signed-off-by: Jiahao XU --- .github/dependabot.yml | 4 + .github/workflows/release-pr.yml | 1 + Cargo.lock | 11 ++ Cargo.toml | 1 + crates/bin/src/args.rs | 2 +- crates/binstalk/Cargo.toml | 1 + .../src/fetchers/gh_crate_meta/hosting.rs | 63 ++----- .../binstalk/src/helpers/futures_resolver.rs | 2 +- crates/leon-macros/Cargo.toml | 19 ++ crates/leon-macros/LICENSE-APACHE | 176 ++++++++++++++++++ crates/leon-macros/LICENSE-MIT | 23 +++ crates/leon-macros/src/lib.rs | 36 ++++ crates/leon-macros/tests/parsing.rs | 21 +++ crates/leon/Cargo.toml | 1 + crates/leon/src/error.rs | 86 +++++---- crates/leon/src/lib.rs | 13 +- crates/leon/src/macros.rs | 2 +- crates/leon/src/template.rs | 2 +- 18 files changed, 373 insertions(+), 91 deletions(-) create mode 100644 crates/leon-macros/Cargo.toml create mode 100644 crates/leon-macros/LICENSE-APACHE create mode 100644 crates/leon-macros/LICENSE-MIT create mode 100644 crates/leon-macros/src/lib.rs create mode 100644 crates/leon-macros/tests/parsing.rs diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2d36099e..8547ce2a 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -52,3 +52,7 @@ updates: directory: "/crates/leon" schedule: interval: "daily" + - package-ecosystem: "cargo" + directory: "/crates/leon-macros" + schedule: + interval: "daily" diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 899fb7ae..5d949d64 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -17,6 +17,7 @@ on: - fs-lock - normalize-path - leon + - leon-macros version: description: Version to release required: true diff --git a/Cargo.lock b/Cargo.lock index 0dd1b4b7..72e75d9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -231,6 +231,7 @@ dependencies = [ "itertools", "jobslot", "leon", + "leon-macros", "maybe-owned", "miette", "normalize-path", @@ -1338,6 +1339,16 @@ dependencies = [ "tinytemplate", ] +[[package]] +name = "leon-macros" +version = "0.0.0" +dependencies = [ + "leon", + "proc-macro2", + "quote", + "syn 2.0.15", +] + [[package]] name = "libc" version = "0.2.141" diff --git a/Cargo.toml b/Cargo.toml index c4fd9e9c..e9cfe47a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ members = [ "crates/normalize-path", "crates/detect-targets", "crates/leon", + "crates/leon-macros", ] [profile.release] diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index cedab272..cb914561 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -31,7 +31,7 @@ use strum_macros::EnumCount; pub struct Args { /// Packages to install. /// - /// Syntax: crate[@version] + /// Syntax: `crate[@version]` /// /// Each value is either a crate name alone, or a crate name followed by @ and the version to /// install. The version syntax is as with the --version option. diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 62fdacc7..ebaf997e 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -22,6 +22,7 @@ home = "0.5.4" itertools = "0.10.5" jobslot = { version = "0.2.11", features = ["tokio"] } leon = { version = "1.0.0", path = "../leon" } +leon-macros = { version = "0.0.0", path = "../leon-macros" } maybe-owned = "0.3.4" miette = "5.7.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } diff --git a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs index e6a7ed91..df26071c 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs @@ -1,5 +1,6 @@ use itertools::Itertools; -use leon::{template, Item, Template}; +use leon::{Item, Template}; +use leon_macros::template; use url::Url; use crate::errors::BinstallError; @@ -16,62 +17,36 @@ pub enum RepositoryHost { /// Make sure to update possible_dirs in `bins::infer_bin_dir_template` /// if you modified FULL_FILENAMES or NOVERSION_FILENAMES. pub const FULL_FILENAMES: &[Template<'_>] = &[ - template!("/", { "name" }, "-", { "target" }, "-v", { "version" }, { - "archive-suffix" - }), - template!("/", { "name" }, "-", { "target" }, "-", { "version" }, { - "archive-suffix" - }), - template!("/", { "name" }, "-", { "version" }, "-", { "target" }, { - "archive-suffix" - }), - template!("/", { "name" }, "-v", { "version" }, "-", { "target" }, { - "archive-suffix" - }), - template!("/", { "name" }, "_", { "target" }, "_v", { "version" }, { - "archive-suffix" - }), - template!("/", { "name" }, "_", { "target" }, "_", { "version" }, { - "archive-suffix" - }), - template!("/", { "name" }, "_", { "version" }, "_", { "target" }, { - "archive-suffix" - }), - template!("/", { "name" }, "_v", { "version" }, "_", { "target" }, { - "archive-suffix" - }), + template!("/{ name }-{ target }-v{ version }{ archive-suffix }"), + template!("/{ name }-{ target }-{ version }{ archive-suffix }"), + template!("/{ name }-{ version }-{ target }{ archive-suffix }"), + template!("/{ name }-v{ version }-{ target }{ archive-suffix }"), + template!("/{ name }_{ target }_v{ version }{ archive-suffix }"), + template!("/{ name }_{ target }_{ version }{ archive-suffix }"), + template!("/{ name }_{ version }_{ target }{ archive-suffix }"), + template!("/{ name }_v{ version }_{ target }{ archive-suffix }"), ]; pub const NOVERSION_FILENAMES: &[Template<'_>] = &[ - template!("/", { "name" }, "-", { "target" }, { "archive-suffix" }), - template!("/", { "name" }, "_", { "target" }, { "archive-suffix" }), + template!("/{ name }-{ target }{ archive-suffix }"), + template!("/{ name }_{ target }{ archive-suffix }"), ]; const GITHUB_RELEASE_PATHS: &[Template<'_>] = &[ - template!({ "repo" }, "/releases/download/", { "version" }), - template!({ "repo" }, "/releases/download/v", { "version" }), + template!("{ repo }/releases/download/{ version }"), + template!("{ repo }/releases/download/v{ version }"), ]; const GITLAB_RELEASE_PATHS: &[Template<'_>] = &[ - template!( - { "repo" }, - "/-/releases/", - { "version" }, - "/downloads/binaries" - ), - template!( - { "repo" }, - "/-/releases/v", - { "version" }, - "/downloads/binaries" - ), + template!("{ repo }/-/releases/{ version }/downloads/binaries"), + template!("{ repo }/-/releases/v{ version }/downloads/binaries"), ]; -const BITBUCKET_RELEASE_PATHS: &[Template<'_>] = &[template!({ "repo" }, "/downloads")]; +const BITBUCKET_RELEASE_PATHS: &[Template<'_>] = &[template!("{ repo }/downloads")]; const SOURCEFORGE_RELEASE_PATHS: &[Template<'_>] = &[ - template!({ "repo" }, "/files/binaries/", { "version" }), - template!({ "repo" }, "/files/binaries/v", { "version" }), + template!("{ repo }/files/binaries/{ version }"), + template!("{ repo }/files/binaries/v{ version }"), ]; impl RepositoryHost { diff --git a/crates/binstalk/src/helpers/futures_resolver.rs b/crates/binstalk/src/helpers/futures_resolver.rs index 38b4eb98..0a550519 100644 --- a/crates/binstalk/src/helpers/futures_resolver.rs +++ b/crates/binstalk/src/helpers/futures_resolver.rs @@ -1,7 +1,7 @@ use std::{future::Future, pin::Pin}; use tokio::sync::mpsc; -/// Given multiple futures with output = Result, E>, +/// Given multiple futures with output = `Result, E>`, /// returns the the first one that returns either `Err(_)` or /// `Ok(Some(_))`. pub struct FuturesResolver { diff --git a/crates/leon-macros/Cargo.toml b/crates/leon-macros/Cargo.toml new file mode 100644 index 00000000..803cbc49 --- /dev/null +++ b/crates/leon-macros/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "leon-macros" +version = "0.0.0" +edition = "2021" +description = "Proc macros for crate leon" +repository = "https://github.com/cargo-bins/cargo-binstall" +documentation = "https://docs.rs/leon-macros" +rust-version = "1.61.0" +authors = ["Félix Saparelli ", "Jiahao XU Jiahao_XU@outlook"] +license = "Apache-2.0 OR MIT" + +[lib] +proc-macro = true + +[dependencies] +leon = { version = "1.0.0", path = "../leon", default-features = false } +proc-macro2 = "1.0.56" +syn = { version = "2.0.15", default-features = false, features = ["proc-macro", "parsing"] } +quote = "1.0.26" diff --git a/crates/leon-macros/LICENSE-APACHE b/crates/leon-macros/LICENSE-APACHE new file mode 100644 index 00000000..1b5ec8b7 --- /dev/null +++ b/crates/leon-macros/LICENSE-APACHE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/crates/leon-macros/LICENSE-MIT b/crates/leon-macros/LICENSE-MIT new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/crates/leon-macros/LICENSE-MIT @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/crates/leon-macros/src/lib.rs b/crates/leon-macros/src/lib.rs new file mode 100644 index 00000000..2f6a3389 --- /dev/null +++ b/crates/leon-macros/src/lib.rs @@ -0,0 +1,36 @@ +use leon::{Item, Template}; +use quote::quote; +use syn::{parse_macro_input, LitStr}; + +#[proc_macro] +pub fn template(input: proc_macro::TokenStream) -> proc_macro::TokenStream { + let input = parse_macro_input!(input as LitStr).value(); + + #[allow(clippy::unnecessary_to_owned)] + let items = Template::parse(&input) + .unwrap() + .items + .into_owned() + .into_iter() + .map(|item| match item { + Item::Text(text) => quote! { + ::leon::Item::Text(#text) + }, + Item::Key(key) => quote! { + ::leon::Item::Key(#key) + }, + }); + + quote! { + ::leon::Template::new( + { + const ITEMS: &'static [::leon::Item<'static>] = &[ + #(#items),* + ]; + ITEMS + }, + ::core::option::Option::None, + ) + } + .into() +} diff --git a/crates/leon-macros/tests/parsing.rs b/crates/leon-macros/tests/parsing.rs new file mode 100644 index 00000000..c8dbf8b0 --- /dev/null +++ b/crates/leon-macros/tests/parsing.rs @@ -0,0 +1,21 @@ +use leon::{Item, Template}; + +#[test] +fn test() { + assert_eq!(leon_macros::template!(""), Template::new(&[], None),); + + assert_eq!( + leon_macros::template!("a"), + Template::new(&[Item::Text("a")], None), + ); + + assert_eq!( + leon_macros::template!("{1}"), + Template::new(&[Item::Key("1")], None), + ); + + assert_eq!( + leon_macros::template!("a{ 1 } c"), + Template::new(&[Item::Text("a"), Item::Key("1"), Item::Text(" c")], None), + ); +} diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index cb9cdbb9..442e7a45 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -8,6 +8,7 @@ rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" license = "Apache-2.0 OR MIT" +exclude = ["fuzz"] [dependencies] clap = { version = "4.2.2", features = ["derive"], optional = true } diff --git a/crates/leon/src/error.rs b/crates/leon/src/error.rs index 6e064e2f..93923cf2 100644 --- a/crates/leon/src/error.rs +++ b/crates/leon/src/error.rs @@ -1,11 +1,13 @@ -#[derive(Debug, thiserror::Error)] +use thiserror::Error as ThisError; + +#[derive(Debug, ThisError)] #[cfg_attr(feature = "miette", derive(miette::Diagnostic))] pub enum RenderError { /// A key was missing from the provided values. #[error("missing key `{0}`")] MissingKey(String), - /// An I/O error passed through from [`Template::render_into`]. + /// An I/O error passed through from [`Template::render_into`](crate::Template::render_into). #[error("write failed: {0}")] Io(#[from] std::io::Error), } @@ -15,71 +17,73 @@ pub enum RenderError { /// When the `miette` feature is enabled, this is a rich miette-powered error /// which will highlight the source of the error in the template when output /// (with miette's `fancy` feature). With `miette` disabled, this is opaque. -#[derive(Clone, Debug, thiserror::Error, PartialEq, Eq)] +#[derive(Clone, Debug, ThisError, PartialEq, Eq)] #[cfg_attr(feature = "miette", derive(miette::Diagnostic))] #[cfg_attr(feature = "miette", diagnostic(transparent))] #[error(transparent)] pub struct ParseError(Box); /// The inner (unboxed) type of [`ParseError`]. -#[derive(Clone, Debug, thiserror::Error, PartialEq, Eq)] -#[cfg_attr(feature = "miette", derive(miette::Diagnostic))] -#[error("template parse failed")] +#[derive(Clone, Debug, ThisError, PartialEq, Eq)] +#[error("{kind} at span start = {offset}, len = {len}: {src}")] struct InnerParseError { - #[cfg_attr(feature = "miette", source_code)] src: String, + offset: usize, + len: usize, + kind: ErrorKind, +} - #[cfg_attr(feature = "miette", label("This bracket is not opening or closing anything. Try removing it, or escaping it with a backslash."))] - unbalanced: Option<(usize, usize)>, +#[cfg(feature = "miette")] +impl miette::Diagnostic for InnerParseError { + fn source_code(&self) -> Option<&dyn miette::SourceCode> { + Some(&self.src) + } - #[cfg_attr(feature = "miette", label("This escape is malformed."))] - escape: Option<(usize, usize)>, + fn labels(&self) -> Option + '_>> { + Some(Box::new(std::iter::once_with(|| { + miette::LabeledSpan::new(Some(self.kind.to_string()), self.offset, self.len) + }))) + } +} - #[cfg_attr(feature = "miette", label("A key cannot be empty."))] - key_empty: Option<(usize, usize)>, +#[derive(Clone, Debug, ThisError, PartialEq, Eq)] +enum ErrorKind { + #[error("This bracket is not opening or closing anything. Try removing it, or escaping it with a backslash.")] + Unbalanced, - #[cfg_attr(feature = "miette", label("Escapes are not allowed in keys."))] - key_escape: Option<(usize, usize)>, + #[error("This escape is malformed.")] + Escape, + + #[error("A key cannot be empty.")] + KeyEmpty, + + #[error("Escapes are not allowed in keys.")] + KeyEscape, } impl ParseError { - pub(crate) fn unbalanced(src: &str, start: usize, end: usize) -> Self { + fn new(src: &str, start: usize, end: usize, kind: ErrorKind) -> Self { Self(Box::new(InnerParseError { src: String::from(src), - unbalanced: Some((start, end.saturating_sub(start) + 1)), - escape: None, - key_empty: None, - key_escape: None, + offset: start, + len: end.saturating_sub(start) + 1, + kind, })) } + pub(crate) fn unbalanced(src: &str, start: usize, end: usize) -> Self { + Self::new(src, start, end, ErrorKind::Unbalanced) + } + pub(crate) fn escape(src: &str, start: usize, end: usize) -> Self { - Self(Box::new(InnerParseError { - src: String::from(src), - unbalanced: None, - escape: Some((start, end.saturating_sub(start) + 1)), - key_empty: None, - key_escape: None, - })) + Self::new(src, start, end, ErrorKind::Escape) } pub(crate) fn key_empty(src: &str, start: usize, end: usize) -> Self { - Self(Box::new(InnerParseError { - src: String::from(src), - unbalanced: None, - escape: None, - key_empty: Some((start, end.saturating_sub(start) + 1)), - key_escape: None, - })) + Self::new(src, start, end, ErrorKind::KeyEmpty) } pub(crate) fn key_escape(src: &str, start: usize, end: usize) -> Self { - Self(Box::new(InnerParseError { - src: String::from(src), - unbalanced: None, - escape: None, - key_empty: None, - key_escape: Some((start, end.saturating_sub(start) + 1)), - })) + Self::new(src, start, end, ErrorKind::KeyEscape) } } diff --git a/crates/leon/src/lib.rs b/crates/leon/src/lib.rs index e58e41e8..a6ef467e 100644 --- a/crates/leon/src/lib.rs +++ b/crates/leon/src/lib.rs @@ -121,12 +121,21 @@ //! assert_eq!(template.render(&values).unwrap().as_str(), "hello pontifex"); //! ``` //! +//! # Compile-time parsing +//! +//! You can either use [`leon-macros`](https://docs.rs/leon-macros)'s +//! [`template!`](https://docs.rs/leon-macros/latest/leon_macros/macro.template.html), +//! a proc-macro, with the exact same syntax as the normal parser, or this +//! crate's [`template!`] rules-macro, which requires a slightly different +//! syntax but doesn't bring in additional dependencies. In either case, +//! the leon library is required as a runtime dependency. +//! //! # Errors //! -//! Leon will return a [`LeonError::InvalidTemplate`] if the template fails to +//! Leon will return a [`ParseError`] if the template fails to //! parse. This can happen if there are unbalanced braces, or if a key is empty. //! -//! Leon will return a [`LeonError::MissingKey`] if a key is missing from keyed +//! Leon will return a [`RenderError::MissingKey`] if a key is missing from keyed //! values passed to [`Template::render()`], unless a default value is provided //! with [`Template.default`]. //! diff --git a/crates/leon/src/macros.rs b/crates/leon/src/macros.rs index c489765d..1de4fda6 100644 --- a/crates/leon/src/macros.rs +++ b/crates/leon/src/macros.rs @@ -29,7 +29,7 @@ macro_rules! __template_impl { } /// Construct a template constant using syntax similar to the template to be -/// passed to [`Template::parse`]. +/// passed to [`Template::parse`](crate::Template::parse). /// /// This is essentially a shorthand for: /// diff --git a/crates/leon/src/template.rs b/crates/leon/src/template.rs index 67a4466b..bc0f4fe6 100644 --- a/crates/leon/src/template.rs +++ b/crates/leon/src/template.rs @@ -47,7 +47,7 @@ impl<'s> Template<'s> { /// assert_eq!(TEMPLATE.render(&[("unrelated", "value")]).unwrap(), "Hello world"); /// ``` /// - /// For an even more ergonomic syntax, see the [`leon::template!`] macro. + /// For an even more ergonomic syntax, see the [`leon::template!`](crate::template!) macro. pub const fn new(items: &'s [Item<'s>], default: Option<&'s str>) -> Template<'s> { Template { items: Cow::Borrowed(items), From 913ec83918fa8d47775ac9352ee31e5afb4d7f93 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Apr 2023 13:46:25 +1000 Subject: [PATCH 1197/2020] Bump miette from 5.7.0 to 5.8.0 (#993) Bumps [miette](https://github.com/zkat/miette) from 5.7.0 to 5.8.0. - [Release notes](https://github.com/zkat/miette/releases) - [Changelog](https://github.com/zkat/miette/blob/main/CHANGELOG.md) - [Commits](https://github.com/zkat/miette/compare/miette-derive-v5.7.0...miette-derive-v5.8.0) --- updated-dependencies: - dependency-name: miette dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 72e75d9e..62584f58 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1461,9 +1461,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "miette" -version = "5.7.0" +version = "5.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abdc09c381c9336b9f2e9bd6067a9a5290d20e2d2e2296f275456121c33ae89" +checksum = "92a992891d5579caa9efd8e601f82e30a1caa79a27a5db075dde30ecb9eab357" dependencies = [ "backtrace", "backtrace-ext", @@ -1482,9 +1482,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.7.0" +version = "5.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8842972f23939443013dfd3720f46772b743e86f1a81d120d4b6fb090f87de1c" +checksum = "4c65c625186a9bcce6699394bee511e1b1aec689aa7e3be1bf4e996e75834153" dependencies = [ "proc-macro2", "quote", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 72b1de3b..3b0af7ab 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -31,7 +31,7 @@ file-format = { version = "0.16.0", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } gh-token = "0.1.1" log = { version = "0.4.17", features = ["std"] } -miette = "5.7.0" +miette = "5.8.0" mimalloc = { version = "0.1.36", default-features = false, optional = true } once_cell = "1.17.1" semver = "1.0.17" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index ffe895a0..1771e078 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -15,7 +15,7 @@ binstalk-types = { version = "0.3.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.4" -miette = "5.7.0" +miette = "5.8.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.160", features = ["derive"] } serde-tuple-vec-map = "1.0.1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index ebaf997e..8f9cf707 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -24,7 +24,7 @@ jobslot = { version = "0.2.11", features = ["tokio"] } leon = { version = "1.0.0", path = "../leon" } leon-macros = { version = "0.0.0", path = "../leon-macros" } maybe-owned = "0.3.4" -miette = "5.7.0" +miette = "5.8.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.17.1" semver = { version = "1.0.17", features = ["serde"] } diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 442e7a45..03196978 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -12,7 +12,7 @@ exclude = ["fuzz"] [dependencies] clap = { version = "4.2.2", features = ["derive"], optional = true } -miette = { version = "5.7.0", default-features = false, optional = true } +miette = { version = "5.8.0", default-features = false, optional = true } thiserror = "1.0.38" [features] From 3903b1f6e278b766289fbcf662b77c0f13592327 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Apr 2023 04:13:01 +0000 Subject: [PATCH 1198/2020] Bump clap from 4.2.2 to 4.2.3 (#992) --- Cargo.lock | 12 ++++++------ crates/bin/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 62584f58..64b8b4e2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -409,7 +409,7 @@ version = "0.22.0" dependencies = [ "binstalk", "binstalk-manifests", - "clap 4.2.2", + "clap 4.2.3", "compact_str", "dirs", "embed-resource", @@ -513,9 +513,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.2.2" +version = "4.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b802d85aaf3a1cdb02b224ba472ebdea62014fccfcb269b95a4d76443b5ee5a" +checksum = "49f9152d70e42172fdb87de2efd7327160beee37886027cf86f30a233d5b30b4" dependencies = [ "clap_builder", "clap_derive", @@ -524,9 +524,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.2.2" +version = "4.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14a1a858f532119338887a4b8e1af9c60de8249cd7bafd68036a489e261e37b6" +checksum = "e067b220911598876eb55d52725ddcc201ffe3f0904018195973bc5b012ea2ca" dependencies = [ "anstream", "anstyle", @@ -1331,7 +1331,7 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" name = "leon" version = "1.0.0" dependencies = [ - "clap 4.2.2", + "clap 4.2.3", "criterion", "miette", "serde", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 3b0af7ab..09ad931a 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.11.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.4.1" } -clap = { version = "4.2.2", features = ["derive", "env"] } +clap = { version = "4.2.3", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.0" file-format = { version = "0.16.0", default-features = false } diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 03196978..6315c93c 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" exclude = ["fuzz"] [dependencies] -clap = { version = "4.2.2", features = ["derive"], optional = true } +clap = { version = "4.2.3", features = ["derive"], optional = true } miette = { version = "5.8.0", default-features = false, optional = true } thiserror = "1.0.38" From 6d9bf0ef2194496200fea30a60aec4133de44282 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Apr 2023 02:25:32 +0000 Subject: [PATCH 1199/2020] Bump clap from 4.2.3 to 4.2.4 (#994) --- Cargo.lock | 12 ++++++------ crates/bin/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 64b8b4e2..fd3c9fdf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -409,7 +409,7 @@ version = "0.22.0" dependencies = [ "binstalk", "binstalk-manifests", - "clap 4.2.3", + "clap 4.2.4", "compact_str", "dirs", "embed-resource", @@ -513,9 +513,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.2.3" +version = "4.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f9152d70e42172fdb87de2efd7327160beee37886027cf86f30a233d5b30b4" +checksum = "956ac1f6381d8d82ab4684768f89c0ea3afe66925ceadb4eeb3fc452ffc55d62" dependencies = [ "clap_builder", "clap_derive", @@ -524,9 +524,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.2.3" +version = "4.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e067b220911598876eb55d52725ddcc201ffe3f0904018195973bc5b012ea2ca" +checksum = "84080e799e54cff944f4b4a4b0e71630b0e0443b25b985175c7dddc1a859b749" dependencies = [ "anstream", "anstyle", @@ -1331,7 +1331,7 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" name = "leon" version = "1.0.0" dependencies = [ - "clap 4.2.3", + "clap 4.2.4", "criterion", "miette", "serde", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 09ad931a..d16650d1 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.11.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.4.1" } -clap = { version = "4.2.3", features = ["derive", "env"] } +clap = { version = "4.2.4", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.0" file-format = { version = "0.16.0", default-features = false } diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 6315c93c..d0d85143 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" exclude = ["fuzz"] [dependencies] -clap = { version = "4.2.3", features = ["derive"], optional = true } +clap = { version = "4.2.4", features = ["derive"], optional = true } miette = { version = "5.8.0", default-features = false, optional = true } thiserror = "1.0.38" From 3e443f3360858ac21e0c6a8121c6f7f43613bc3a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Apr 2023 03:52:17 +0000 Subject: [PATCH 1200/2020] Bump tracing-subscriber from 0.3.16 to 0.3.17 (#995) --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fd3c9fdf..a350c07b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2650,9 +2650,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" +checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" dependencies = [ "nu-ansi-term", "serde", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index d16650d1..d52a40aa 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -43,7 +43,7 @@ tokio = { version = "1.27.0", features = ["rt-multi-thread"], default-features = tracing-core = "0.1.30" tracing = { version = "0.1.37", default-features = false } tracing-log = { version = "0.1.3", default-features = false } -tracing-subscriber = { version = "0.3.16", features = ["fmt", "json", "ansi"], default-features = false } +tracing-subscriber = { version = "0.3.17", features = ["fmt", "json", "ansi"], default-features = false } [build-dependencies] embed-resource = "2.1.1" From 5e269193c08b6e1fb236cfe8917f17ce7ae9baa0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 24 Apr 2023 17:49:25 +1000 Subject: [PATCH 1201/2020] Add comment to `src/binstalk-downloader/Cargo.toml` (#996) Add comment to binstalk-downloader/Cargo.toml Signed-off-by: Jiahao XU --- crates/binstalk-downloader/Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 1a8c2287..3cf57acf 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -38,6 +38,7 @@ tokio-tar = "0.3.0" tokio-util = { version = "0.7.7", features = ["io"] } tower = { version = "0.4.13", features = ["limit", "util"] } tracing = "0.1.37" +# trust-dns-resolver must be kept in sync with the version reqwest uses trust-dns-resolver = { version = "0.22.0", optional = true, default-features = false, features = ["dnssec-ring"] } url = "2.3.1" From 0261d12d9dd8ab5b61b3c73e1eac1c2563ea1bbb Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 24 Apr 2023 19:41:20 +1000 Subject: [PATCH 1202/2020] Support subcrate in repo (#991) Fixed #838 - Add new key `subcrate` for rendering `pkg-url` - Add new release paths in GitHub, GitLab & SourceForge using key `subcrate` for auto-detection - Add subcrate detection for GitHub and GitLab - Add `debug!` when using gh api token in `GhApiClient::new` - Add subcrate testing to `e2e-tests/subcrate.sh` - Bump cargo-release to 0.24.9 in e2e-tests/live.sh to fix test failure on MacOS without libssl installed in `/usr/local/`. - Optimize GhCrateMeta: Detect subcrate and repo-host in `Data::get_repo_info` to cache the result and avoid duplicate works, this also makes the code more ergonomic by removing the need to some `unwrap()` plus making it more efficient since we don't need to clone the url just to modify it. - Add instrument to `Data::get_repo_info` - Fix `shellcheck` err in `e2e-tests/*.sh` Signed-off-by: Jiahao XU --- .../binstalk-downloader/src/gh_api_client.rs | 3 +- crates/binstalk/src/fetchers.rs | 138 +++++++++++++++++- crates/binstalk/src/fetchers/gh_crate_meta.rs | 58 ++++++-- .../src/fetchers/gh_crate_meta/hosting.rs | 25 ++-- e2e-tests/live.sh | 5 +- e2e-tests/manifest-path.sh | 3 +- e2e-tests/other-repos.sh | 3 +- e2e-tests/self-upgrade-no-symlink.sh | 3 +- e2e-tests/strategies.sh | 3 +- e2e-tests/subcrate.sh | 18 +++ e2e-tests/tls.sh | 3 +- e2e-tests/uninstall.sh | 3 +- e2e-tests/upgrade.sh | 3 +- e2e-tests/version-syntax.sh | 3 +- justfile | 3 +- 15 files changed, 234 insertions(+), 40 deletions(-) create mode 100755 e2e-tests/subcrate.sh diff --git a/crates/binstalk-downloader/src/gh_api_client.rs b/crates/binstalk-downloader/src/gh_api_client.rs index a2c70658..722e0074 100644 --- a/crates/binstalk-downloader/src/gh_api_client.rs +++ b/crates/binstalk-downloader/src/gh_api_client.rs @@ -7,7 +7,7 @@ use std::{ use compact_str::{CompactString, ToCompactString}; use tokio::sync::OnceCell; -use tracing::warn; +use tracing::{debug, warn}; use crate::remote; @@ -106,6 +106,7 @@ impl GhApiClient { pub fn new(client: remote::Client, auth_token: Option) -> Self { let auth_token = auth_token.and_then(|auth_token| { if gh_prefixed(&auth_token) { + debug!("Using gh api token"); Some(auth_token) } else { warn!("Invalid auth_token, expected 'gh*_' or `github_*`, fallback to unauthorized mode"); diff --git a/crates/binstalk/src/fetchers.rs b/crates/binstalk/src/fetchers.rs index 0b53b346..03822e7b 100644 --- a/crates/binstalk/src/fetchers.rs +++ b/crates/binstalk/src/fetchers.rs @@ -4,6 +4,7 @@ use compact_str::CompactString; pub use gh_crate_meta::*; pub use quickinstall::*; use tokio::sync::OnceCell; +use tracing::{debug, instrument}; use url::Url; use crate::{ @@ -18,6 +19,8 @@ use crate::{ pub(crate) mod gh_crate_meta; pub(crate) mod quickinstall; +use gh_crate_meta::hosting::RepositoryHost; + #[async_trait::async_trait] pub trait Fetcher: Send + Sync { /// Create a new fetcher from some data @@ -71,13 +74,20 @@ pub trait Fetcher: Send + Sync { fn target(&self) -> &str; } +#[derive(Clone, Debug)] +struct RepoInfo { + repo: Url, + repository_host: RepositoryHost, + subcrate: Option, +} + /// Data required to fetch a package #[derive(Clone, Debug)] pub struct Data { name: CompactString, version: CompactString, repo: Option, - repo_final_url: OnceCell>, + repo_info: OnceCell>, } impl Data { @@ -86,18 +96,28 @@ impl Data { name, version, repo, - repo_final_url: OnceCell::new(), + repo_info: OnceCell::new(), } } - async fn resolve_final_repo_url(&self, client: &Client) -> Result<&Option, BinstallError> { - self.repo_final_url + #[instrument(level = "debug")] + async fn get_repo_info(&self, client: &Client) -> Result<&Option, BinstallError> { + self.repo_info .get_or_try_init(move || { Box::pin(async move { if let Some(repo) = self.repo.as_deref() { - Ok(Some( - client.get_redirected_final_url(Url::parse(repo)?).await?, - )) + let mut repo = client.get_redirected_final_url(Url::parse(repo)?).await?; + let repository_host = RepositoryHost::guess_git_hosting_services(&repo); + + let repo_info = RepoInfo { + subcrate: RepoInfo::detect_subcrate(&mut repo, repository_host), + repo, + repository_host, + }; + + debug!("Resolved repo_info = {repo_info:#?}"); + + Ok(Some(repo_info)) } else { Ok(None) } @@ -107,9 +127,113 @@ impl Data { } } +impl RepoInfo { + /// If `repo` contains a subcrate, then extracts and returns it. + /// It will also remove that subcrate path from `repo` to match + /// `scheme:/{repo_owner}/{repo_name}` + fn detect_subcrate(repo: &mut Url, repository_host: RepositoryHost) -> Option { + match repository_host { + RepositoryHost::GitHub => Self::detect_subcrate_common(repo, &["tree"]), + RepositoryHost::GitLab => Self::detect_subcrate_common(repo, &["-", "blob"]), + _ => None, + } + } + + fn detect_subcrate_common(repo: &mut Url, seps: &[&str]) -> Option { + let mut path_segments = repo.path_segments()?; + + let _repo_owner = path_segments.next()?; + let _repo_name = path_segments.next()?; + + // Skip separators + for sep in seps.iter().copied() { + if path_segments.next()? != sep { + return None; + } + } + + // Skip branch name + let _branch_name = path_segments.next()?; + + let subcrate = path_segments.next()?; + + if path_segments.next().is_some() { + // A subcrate url should not contain anything more. + None + } else { + let subcrate = subcrate.to_string(); + + // Pop subcrate path to match regular repo style: + // + // scheme:/{addr}/{repo_owner}/{repo_name} + // + // path_segments() succeeds, so path_segments_mut() + // must also succeeds. + let mut paths = repo.path_segments_mut().unwrap(); + + paths.pop(); // pop subcrate + paths.pop(); // pop branch name + seps.iter().for_each(|_| { + paths.pop(); + }); // pop separators + + Some(subcrate) + } + } +} + /// Target specific data required to fetch a package #[derive(Clone, Debug)] pub struct TargetData { pub target: String, pub meta: PkgMeta, } + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn test_detect_subcrate_github() { + let urls = [ + "https://github.com/RustSec/rustsec/tree/main/cargo-audit", + "https://github.com/RustSec/rustsec/tree/master/cargo-audit", + ]; + for url in urls { + let mut repo = Url::parse(url).unwrap(); + + let repository_host = RepositoryHost::guess_git_hosting_services(&repo); + assert_eq!(repository_host, RepositoryHost::GitHub); + + let subcrate_prefix = RepoInfo::detect_subcrate(&mut repo, repository_host).unwrap(); + assert_eq!(subcrate_prefix, "cargo-audit"); + + assert_eq!( + repo, + Url::parse("https://github.com/RustSec/rustsec").unwrap() + ); + } + } + + #[test] + fn test_detect_subcrate_gitlab() { + let urls = [ + "https://gitlab.kitware.com/NobodyXu/hello/-/blob/main/cargo-binstall", + "https://gitlab.kitware.com/NobodyXu/hello/-/blob/master/cargo-binstall", + ]; + for url in urls { + let mut repo = Url::parse(url).unwrap(); + + let repository_host = RepositoryHost::guess_git_hosting_services(&repo); + assert_eq!(repository_host, RepositoryHost::GitLab); + + let subcrate_prefix = RepoInfo::detect_subcrate(&mut repo, repository_host).unwrap(); + assert_eq!(subcrate_prefix, "cargo-binstall"); + + assert_eq!( + repo, + Url::parse("https://gitlab.kitware.com/NobodyXu/hello").unwrap() + ); + } + } +} diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index 1fb193a5..aa5a3d9e 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -20,10 +20,9 @@ use crate::{ manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; -use super::{Data, TargetData}; +use super::{Data, RepoInfo, TargetData}; pub(crate) mod hosting; -use hosting::RepositoryHost; pub struct GhCrateMeta { client: Client, @@ -40,9 +39,16 @@ impl GhCrateMeta { pkg_fmt: PkgFmt, pkg_url: &Template<'_>, repo: Option<&str>, + subcrate: Option<&str>, ) { let render_url = |ext| { - let ctx = Context::from_data_with_repo(&self.data, &self.target_data.target, ext, repo); + let ctx = Context::from_data_with_repo( + &self.data, + &self.target_data.target, + ext, + repo, + subcrate, + ); match ctx.render_url_with_compiled_tt(pkg_url) { Ok(url) => Some(url), Err(err) => { @@ -99,7 +105,10 @@ impl super::Fetcher for GhCrateMeta { fn find(self: Arc) -> AutoAbortJoinHandle> { AutoAbortJoinHandle::spawn(async move { - let repo = self.data.resolve_final_repo_url(&self.client).await?; + let info = self.data.get_repo_info(&self.client).await?.as_ref(); + + let repo = info.map(|info| &info.repo); + let subcrate = info.and_then(|info| info.subcrate.as_deref()); let mut pkg_fmt = self.target_data.meta.pkg_fmt; @@ -143,11 +152,23 @@ impl super::Fetcher for GhCrateMeta { } Either::Left(iter::once(template)) - } else if let Some(repo) = repo.as_ref() { - if let Some(pkg_urls) = - RepositoryHost::guess_git_hosting_services(repo)?.get_default_pkg_url_template() - { - Either::Right(pkg_urls.map(Template::cast)) + } else if let Some(RepoInfo { + repo, + repository_host, + .. + }) = info + { + if let Some(pkg_urls) = repository_host.get_default_pkg_url_template() { + let has_subcrate = subcrate.is_some(); + + Either::Right( + pkg_urls + .map(Template::cast) + // If subcrate is Some, then all templates will be included. + // Otherwise, only templates without key "subcrate" will be + // included. + .filter(move |template| has_subcrate || !template.has_key("subcrate")), + ) } else { warn!( concat!( @@ -172,7 +193,7 @@ impl super::Fetcher for GhCrateMeta { }; // Convert Option to Option to reduce size of future. - let repo = repo.as_ref().map(|u| u.as_str().trim_end_matches('/')); + let repo = repo.map(|u| u.as_str().trim_end_matches('/')); // Use reference to self to fix error of closure // launch_baseline_find_tasks which moves `this` @@ -193,7 +214,7 @@ impl super::Fetcher for GhCrateMeta { // basically cartesian product. // | for pkg_fmt in pkg_fmts.clone() { - this.launch_baseline_find_tasks(&resolver, pkg_fmt, &pkg_url, repo); + this.launch_baseline_find_tasks(&resolver, pkg_fmt, &pkg_url, repo, subcrate); } } @@ -271,6 +292,9 @@ struct Context<'c> { /// Filename extension on the binary, i.e. .exe on Windows, nothing otherwise pub binary_ext: &'c str, + + /// Workspace of the crate inside the repository. + pub subcrate: Option<&'c str>, } impl leon::Values for Context<'_> { @@ -290,6 +314,8 @@ impl leon::Values for Context<'_> { "binary-ext" => Some(Cow::Borrowed(self.binary_ext)), + "subcrate" => self.subcrate.map(Cow::Borrowed), + _ => None, } } @@ -301,6 +327,7 @@ impl<'c> Context<'c> { target: &'c str, archive_suffix: Option<&'c str>, repo: Option<&'c str>, + subcrate: Option<&'c str>, ) -> Self { let archive_format = archive_suffix.map(|archive_suffix| { if archive_suffix.is_empty() { @@ -325,12 +352,19 @@ impl<'c> Context<'c> { } else { "" }, + subcrate, } } #[cfg(test)] pub(self) fn from_data(data: &'c Data, target: &'c str, archive_format: &'c str) -> Self { - Self::from_data_with_repo(data, target, Some(archive_format), data.repo.as_deref()) + Self::from_data_with_repo( + data, + target, + Some(archive_format), + data.repo.as_deref(), + None, + ) } /// * `tt` - must have added a template named "pkg_url". diff --git a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs index df26071c..779208f9 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs @@ -3,9 +3,7 @@ use leon::{Item, Template}; use leon_macros::template; use url::Url; -use crate::errors::BinstallError; - -#[derive(Copy, Clone, Debug)] +#[derive(Copy, Clone, Debug, Eq, PartialEq)] pub enum RepositoryHost { GitHub, GitLab, @@ -35,11 +33,17 @@ pub const NOVERSION_FILENAMES: &[Template<'_>] = &[ const GITHUB_RELEASE_PATHS: &[Template<'_>] = &[ template!("{ repo }/releases/download/{ version }"), template!("{ repo }/releases/download/v{ version }"), + // %2F is escaped form of '/' + template!("{ repo }/releases/download/{ subcrate }%2F{ version }"), + template!("{ repo }/releases/download/{ subcrate }%2Fv{ version }"), ]; const GITLAB_RELEASE_PATHS: &[Template<'_>] = &[ template!("{ repo }/-/releases/{ version }/downloads/binaries"), template!("{ repo }/-/releases/v{ version }/downloads/binaries"), + // %2F is escaped form of '/' + template!("{ repo }/-/releases/{ subcrate }%2F{ version }/downloads/binaries"), + template!("{ repo }/-/releases/{ subcrate }%2Fv{ version }/downloads/binaries"), ]; const BITBUCKET_RELEASE_PATHS: &[Template<'_>] = &[template!("{ repo }/downloads")]; @@ -47,18 +51,21 @@ const BITBUCKET_RELEASE_PATHS: &[Template<'_>] = &[template!("{ repo }/downloads const SOURCEFORGE_RELEASE_PATHS: &[Template<'_>] = &[ template!("{ repo }/files/binaries/{ version }"), template!("{ repo }/files/binaries/v{ version }"), + // %2F is escaped form of '/' + template!("{ repo }/files/binaries/{ subcrate }%2F{ version }"), + template!("{ repo }/files/binaries/{ subcrate }%2Fv{ version }"), ]; impl RepositoryHost { - pub fn guess_git_hosting_services(repo: &Url) -> Result { + pub fn guess_git_hosting_services(repo: &Url) -> Self { use RepositoryHost::*; match repo.domain() { - Some(domain) if domain.starts_with("github") => Ok(GitHub), - Some(domain) if domain.starts_with("gitlab") => Ok(GitLab), - Some(domain) if domain == "bitbucket.org" => Ok(BitBucket), - Some(domain) if domain == "sourceforge.net" => Ok(SourceForge), - _ => Ok(Unknown), + Some(domain) if domain.starts_with("github") => GitHub, + Some(domain) if domain.starts_with("gitlab") => GitLab, + Some(domain) if domain == "bitbucket.org" => BitBucket, + Some(domain) if domain == "sourceforge.net" => SourceForge, + _ => Unknown, } } diff --git a/e2e-tests/live.sh b/e2e-tests/live.sh index 0361f7c4..1c8779eb 100755 --- a/e2e-tests/live.sh +++ b/e2e-tests/live.sh @@ -4,9 +4,10 @@ set -euxo pipefail unset CARGO_INSTALL_ROOT -crates="b3sum@1.3.3 cargo-release@0.24.5 cargo-binstall@0.20.1 cargo-watch@8.4.0 miniserve@0.23.0 sccache@0.3.3" +crates="b3sum@1.3.3 cargo-release@0.24.9 cargo-binstall@0.20.1 cargo-watch@8.4.0 miniserve@0.23.0 sccache@0.3.3" -export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export CARGO_HOME othertmpdir=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-test') export PATH="$CARGO_HOME/bin:$othertmpdir/bin:$PATH" diff --git a/e2e-tests/manifest-path.sh b/e2e-tests/manifest-path.sh index 9818eef1..a353100c 100755 --- a/e2e-tests/manifest-path.sh +++ b/e2e-tests/manifest-path.sh @@ -4,7 +4,8 @@ set -euxo pipefail unset CARGO_INSTALL_ROOT -export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export CARGO_HOME export PATH="$CARGO_HOME/bin:$PATH" # Install binaries using `--manifest-path` diff --git a/e2e-tests/other-repos.sh b/e2e-tests/other-repos.sh index 4e932d75..f88b3966 100755 --- a/e2e-tests/other-repos.sh +++ b/e2e-tests/other-repos.sh @@ -4,7 +4,8 @@ set -euxo pipefail unset CARGO_INSTALL_ROOT -export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export CARGO_HOME export PATH="$CARGO_HOME/bin:$PATH" # Test default GitLab pkg-url templates diff --git a/e2e-tests/self-upgrade-no-symlink.sh b/e2e-tests/self-upgrade-no-symlink.sh index 3521c6a3..d00cca88 100644 --- a/e2e-tests/self-upgrade-no-symlink.sh +++ b/e2e-tests/self-upgrade-no-symlink.sh @@ -4,7 +4,8 @@ set -euxo pipefail unset CARGO_INSTALL_ROOT -export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export CARGO_HOME export PATH="$CARGO_HOME/bin:$PATH" # first boostrap-install into the CARGO_HOME diff --git a/e2e-tests/strategies.sh b/e2e-tests/strategies.sh index c992757f..355a3f92 100755 --- a/e2e-tests/strategies.sh +++ b/e2e-tests/strategies.sh @@ -4,7 +4,8 @@ set -uxo pipefail unset CARGO_INSTALL_ROOT -export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export CARGO_HOME export PATH="$CARGO_HOME/bin:$PATH" ## Test --disable-strategies diff --git a/e2e-tests/subcrate.sh b/e2e-tests/subcrate.sh new file mode 100755 index 00000000..f7b5dfc9 --- /dev/null +++ b/e2e-tests/subcrate.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +set -euxo pipefail + +unset CARGO_INSTALL_ROOT + +CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export CARGO_HOME +othertmpdir=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-test') +export PATH="$CARGO_HOME/bin:$othertmpdir/bin:$PATH" + +mkdir -p "$othertmpdir/bin" +# Copy it to bin to test use of env var `CARGO` +cp "./$1" "$othertmpdir/bin/" + +cargo binstall --no-confirm cargo-audit@0.17.5 --strategies crate-meta-data + +cargo audit --version diff --git a/e2e-tests/tls.sh b/e2e-tests/tls.sh index f891fb0f..b54ab9c7 100755 --- a/e2e-tests/tls.sh +++ b/e2e-tests/tls.sh @@ -4,7 +4,8 @@ set -euxo pipefail unset CARGO_INSTALL_ROOT -export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export CARGO_HOME export PATH="$CARGO_HOME/bin:$PATH" "./$1" binstall \ diff --git a/e2e-tests/uninstall.sh b/e2e-tests/uninstall.sh index ff4c78e1..3cfd8cbc 100644 --- a/e2e-tests/uninstall.sh +++ b/e2e-tests/uninstall.sh @@ -4,7 +4,8 @@ set -euxo pipefail unset CARGO_INSTALL_ROOT -export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export CARGO_HOME othertmpdir=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-test') export PATH="$CARGO_HOME/bin:$othertmpdir/bin:$PATH" diff --git a/e2e-tests/upgrade.sh b/e2e-tests/upgrade.sh index 83db3d12..affdab73 100755 --- a/e2e-tests/upgrade.sh +++ b/e2e-tests/upgrade.sh @@ -4,7 +4,8 @@ set -euxo pipefail unset CARGO_INSTALL_ROOT -export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export CARGO_HOME export PATH="$CARGO_HOME/bin:$PATH" # Test skip when installed diff --git a/e2e-tests/version-syntax.sh b/e2e-tests/version-syntax.sh index e4096dab..c9551c51 100755 --- a/e2e-tests/version-syntax.sh +++ b/e2e-tests/version-syntax.sh @@ -4,7 +4,8 @@ set -euxo pipefail unset CARGO_INSTALL_ROOT -export CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export CARGO_HOME export PATH="$CARGO_HOME/bin:$PATH" # Test --version diff --git a/justfile b/justfile index c7dd34d4..2fe19972 100644 --- a/justfile +++ b/justfile @@ -188,6 +188,7 @@ e2e-test file *arguments: (get-binary "e2e-tests") cd e2e-tests && env -u RUSTFLAGS bash {{file}}.sh {{output-filename}} {{arguments}} e2e-test-live: (e2e-test "live") +e2e-test-subcrate: (e2e-test "subcrate") e2e-test-manifest-path: (e2e-test "manifest-path") e2e-test-other-repos: (e2e-test "other-repos") e2e-test-strategies: (e2e-test "strategies") @@ -203,7 +204,7 @@ e2e-test-tls: (e2e-test "tls" "1.2") [macos] e2e-test-tls: (e2e-test "tls" "1.2") (e2e-test "tls" "1.3") -e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall +e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate unit-tests: print-env {{cargo-bin}} test {{cargo-build-args}} From c65e1269a06d990697291f5e2762d820ccf9b445 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 25 Apr 2023 07:48:44 +1000 Subject: [PATCH 1203/2020] Test building doc in `ci.yml`/lint (#999) --- justfile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/justfile b/justfile index 2fe19972..a0424679 100644 --- a/justfile +++ b/justfile @@ -214,12 +214,15 @@ test: unit-tests build e2e-tests clippy: print-env {{cargo-bin}} clippy --no-deps -- -D clippy::all +doc: print-env + cargo doc --no-deps --workspace + fmt: print-env cargo fmt --all -- --check fmt-check: fmt -lint: clippy fmt-check +lint: clippy fmt-check doc # Rm dev-dependencies for `cargo-check` and clippy to speedup compilation. # This is a workaround for the cargo nightly option `-Z avoid-dev-deps` From 02fe3d4f27cecb34c0995014701b6c138e69ef5d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 26 Apr 2023 13:17:41 +1000 Subject: [PATCH 1204/2020] Fix `leon::ValuesFn`: impl for `Fn(&str) -> Option>` (#998) If we impl it for `<'f> Fn(&str) -> Option> + 'f`, then it would somehow imply it to `'static` when using it in `benches/values.rs` and `benches/others.rs`, thus I decided to simplify it back to only implement it for `'static` string. Users who wants more flexibility should implement `Values` themselves. This commit also extracts `benches` as a separate crate in an independent workspace to avoid building criterion and tinytemplate in CI, which makes it much slower as more crates need to be built and criterion actually pulls in clap, and a whole lots of other crates. In additional to that, it: - Impl `leon::Values` for `Arc` & `Rc` where T: `Values` - Enable lto, abort on panic, stripping, set `codege-units` to 1 for `leon/benches` - Move into closure of criterion benchmark loop to reduce indirections which also reduce sizes of the closure since the Fns used in `ValuesFn` are zero-size. This also means that the compiler can now assumes `no-alias`. Signed-off-by: Jiahao XU --- Cargo.lock | 196 +-------- crates/leon/Cargo.toml | 15 +- crates/leon/benches/.gitignore | 1 + crates/leon/benches/Cargo.lock | 431 ++++++++++++++++++++ crates/leon/benches/Cargo.toml | 30 ++ crates/leon/benches/{ => benches}/others.rs | 16 +- crates/leon/benches/{ => benches}/values.rs | 19 +- crates/leon/benches/src/lib.rs | 0 crates/leon/src/values.rs | 47 ++- 9 files changed, 525 insertions(+), 230 deletions(-) create mode 100644 crates/leon/benches/.gitignore create mode 100644 crates/leon/benches/Cargo.lock create mode 100644 crates/leon/benches/Cargo.toml rename crates/leon/benches/{ => benches}/others.rs (87%) rename crates/leon/benches/{ => benches}/values.rs (94%) create mode 100644 crates/leon/benches/src/lib.rs diff --git a/Cargo.lock b/Cargo.lock index a350c07b..72b49ace 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -52,12 +52,6 @@ dependencies = [ "alloc-no-stdlib", ] -[[package]] -name = "anes" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" - [[package]] name = "anstream" version = "0.3.0" @@ -153,17 +147,6 @@ dependencies = [ "tokio-util", ] -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi 0.1.19", - "libc", - "winapi", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -409,7 +392,7 @@ version = "0.22.0" dependencies = [ "binstalk", "binstalk-manifests", - "clap 4.2.4", + "clap", "compact_str", "dirs", "embed-resource", @@ -442,12 +425,6 @@ dependencies = [ "toml", ] -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - [[package]] name = "castaway" version = "0.2.2" @@ -472,45 +449,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "ciborium" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" - -[[package]] -name = "ciborium-ll" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clap" -version = "3.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" -dependencies = [ - "bitflags", - "clap_lex 0.2.4", - "indexmap", - "textwrap 0.16.0", -] - [[package]] name = "clap" version = "4.2.4" @@ -531,7 +469,7 @@ dependencies = [ "anstream", "anstyle", "bitflags", - "clap_lex 0.4.1", + "clap_lex", "strsim", ] @@ -547,15 +485,6 @@ dependencies = [ "syn 2.0.15", ] -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] - [[package]] name = "clap_lex" version = "0.4.1" @@ -628,40 +557,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "criterion" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" -dependencies = [ - "anes", - "atty", - "cast", - "ciborium", - "clap 3.2.23", - "criterion-plot", - "itertools", - "lazy_static", - "num-traits", - "oorandom", - "regex", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "criterion-plot" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" -dependencies = [ - "cast", - "itertools", -] - [[package]] name = "crypto-common" version = "0.1.6" @@ -1032,12 +927,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "half" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - [[package]] name = "hashbrown" version = "0.12.3" @@ -1053,15 +942,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.2.6" @@ -1331,12 +1211,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" name = "leon" version = "1.0.0" dependencies = [ - "clap 4.2.4", - "criterion", + "clap", "miette", - "serde", "thiserror", - "tinytemplate", ] [[package]] @@ -1475,7 +1352,7 @@ dependencies = [ "supports-hyperlinks", "supports-unicode", "terminal_size", - "textwrap 0.15.2", + "textwrap", "thiserror", "unicode-width", ] @@ -1571,15 +1448,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - [[package]] name = "num_cpus" version = "1.15.0" @@ -1605,12 +1473,6 @@ version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - [[package]] name = "openssl" version = "0.10.50" @@ -1655,12 +1517,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "os_str_bytes" -version = "6.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" - [[package]] name = "overload" version = "0.1.1" @@ -2067,15 +1923,6 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - [[package]] name = "schannel" version = "0.1.21" @@ -2377,12 +2224,6 @@ dependencies = [ "unicode-width", ] -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - [[package]] name = "thiserror" version = "1.0.40" @@ -2413,16 +2254,6 @@ dependencies = [ "once_cell", ] -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -2841,16 +2672,6 @@ dependencies = [ "libc", ] -[[package]] -name = "walkdir" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" -dependencies = [ - "same-file", - "winapi-util", -] - [[package]] name = "want" version = "0.3.0" @@ -2997,15 +2818,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" diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index d0d85143..c30a8cdd 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -8,7 +8,7 @@ rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" license = "Apache-2.0 OR MIT" -exclude = ["fuzz"] +exclude = ["fuzz", "benches"] [dependencies] clap = { version = "4.2.4", features = ["derive"], optional = true } @@ -19,16 +19,3 @@ thiserror = "1.0.38" default = ["miette"] cli = ["dep:clap", "miette?/fancy-no-backtrace"] miette = ["dep:miette"] - -[dev-dependencies] -criterion = { version = "0.4.0", default-features = false, features = ["cargo_bench_support"] } -serde = { version = "1.0.160", features = ["derive"] } -tinytemplate = "1.2.1" - -[[bench]] -name = "values" -harness = false - -[[bench]] -name = "others" -harness = false diff --git a/crates/leon/benches/.gitignore b/crates/leon/benches/.gitignore new file mode 100644 index 00000000..eb5a316c --- /dev/null +++ b/crates/leon/benches/.gitignore @@ -0,0 +1 @@ +target diff --git a/crates/leon/benches/Cargo.lock b/crates/leon/benches/Cargo.lock new file mode 100644 index 00000000..b2fe1571 --- /dev/null +++ b/crates/leon/benches/Cargo.lock @@ -0,0 +1,431 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "anes" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "cast" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" + +[[package]] +name = "ciborium" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f" +dependencies = [ + "ciborium-io", + "ciborium-ll", + "serde", +] + +[[package]] +name = "ciborium-io" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" + +[[package]] +name = "ciborium-ll" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b" +dependencies = [ + "ciborium-io", + "half", +] + +[[package]] +name = "clap" +version = "3.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +dependencies = [ + "bitflags", + "clap_lex", + "indexmap", + "textwrap", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "criterion" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" +dependencies = [ + "anes", + "atty", + "cast", + "ciborium", + "clap", + "criterion-plot", + "itertools", + "lazy_static", + "num-traits", + "oorandom", + "regex", + "serde", + "serde_derive", + "serde_json", + "tinytemplate", + "walkdir", +] + +[[package]] +name = "criterion-plot" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" +dependencies = [ + "cast", + "itertools", +] + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "half" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "leon" +version = "1.0.0" +dependencies = [ + "miette", + "thiserror", +] + +[[package]] +name = "leon-benches" +version = "0.0.0" +dependencies = [ + "criterion", + "leon", + "serde", + "tinytemplate", +] + +[[package]] +name = "libc" +version = "0.2.142" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" + +[[package]] +name = "miette" +version = "5.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92a992891d5579caa9efd8e601f82e30a1caa79a27a5db075dde30ecb9eab357" +dependencies = [ + "miette-derive", + "once_cell", + "thiserror", + "unicode-width", +] + +[[package]] +name = "miette-derive" +version = "5.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c65c625186a9bcce6699394bee511e1b1aec689aa7e3be1bf4e996e75834153" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "oorandom" +version = "11.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" + +[[package]] +name = "os_str_bytes" +version = "6.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" + +[[package]] +name = "proc-macro2" +version = "1.0.56" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "regex" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" +dependencies = [ + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "serde" +version = "1.0.160" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.160" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.96" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "syn" +version = "2.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + +[[package]] +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" + +[[package]] +name = "unicode-width" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" + +[[package]] +name = "walkdir" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/crates/leon/benches/Cargo.toml b/crates/leon/benches/Cargo.toml new file mode 100644 index 00000000..acd07206 --- /dev/null +++ b/crates/leon/benches/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "leon-benches" +version = "0.0.0" +publish = false +edition = "2021" + +[dependencies] +leon = { path = ".." } +criterion = { version = "0.4.0", default-features = false, features = ["cargo_bench_support"] } +serde = { version = "1.0.160", features = ["derive"] } +tinytemplate = "1.2.1" + +# Prevent this from interfering with workspaces +[workspace] +members = ["."] + +[[bench]] +name = "values" +harness = false + +[[bench]] +name = "others" +harness = false + +[profile.release] +opt-level = 3 +lto = true +codegen-units = 1 +panic = "abort" +strip = "symbols" diff --git a/crates/leon/benches/others.rs b/crates/leon/benches/benches/others.rs similarity index 87% rename from crates/leon/benches/others.rs rename to crates/leon/benches/benches/others.rs index 9b48f871..92267a9e 100644 --- a/crates/leon/benches/others.rs +++ b/crates/leon/benches/benches/others.rs @@ -7,7 +7,7 @@ use tinytemplate::TinyTemplate; fn compare_impls(c: &mut Criterion) { const TEMPLATE: &str = "hello {name}! i am {age} years old. my goal is to {goal}. i like: {flower}, {music}, {animal}, {color}, {food}. i'm drinking {drink}"; - fn replace_fn<'s>(key: &'s str) -> Option> { + fn replace_fn(key: &str) -> Option> { Some(Cow::Borrowed(match key { "name" => "marcus", "age" => "42", @@ -22,7 +22,7 @@ fn compare_impls(c: &mut Criterion) { })) } - #[derive(Serialize)] + #[derive(Copy, Clone, Serialize)] struct Context<'c> { name: &'c str, age: u8, @@ -47,16 +47,16 @@ fn compare_impls(c: &mut Criterion) { drink: "coffee", }; - c.bench_function("leon", |b| { - b.iter(|| { + c.bench_function("leon", move |b| { + b.iter(move || { let template = Template::parse(black_box(TEMPLATE)).unwrap(); let output = template.render(&vals(replace_fn)).unwrap(); black_box(output); }) }); - c.bench_function("std, string replaces", |b| { - b.iter(|| { + c.bench_function("std, string replaces", move |b| { + b.iter(move || { let mut output = black_box(TEMPLATE).to_string(); for (key, value) in [ ("name", "marcus"), @@ -75,8 +75,8 @@ fn compare_impls(c: &mut Criterion) { }) }); - c.bench_function("tiny template", |b| { - b.iter(|| { + c.bench_function("tiny template", move |b| { + b.iter(move || { let mut tt = TinyTemplate::new(); tt.add_template("tmp", black_box(TEMPLATE)).unwrap(); let output = tt.render("tmp", &tt_context).unwrap(); diff --git a/crates/leon/benches/values.rs b/crates/leon/benches/benches/values.rs similarity index 94% rename from crates/leon/benches/values.rs rename to crates/leon/benches/benches/values.rs index b4fd7944..e2e645bd 100644 --- a/crates/leon/benches/values.rs +++ b/crates/leon/benches/benches/values.rs @@ -1,4 +1,4 @@ -use std::{borrow::Cow, collections::HashMap}; +use std::{borrow::Cow, collections::HashMap, sync::Arc}; use criterion::{black_box, criterion_group, criterion_main, Criterion}; use leon::{vals, Template, Values, ValuesFn}; @@ -270,22 +270,25 @@ fn inner_bench( hashmap: HashMap<&str, &str>, slice: &[(&str, &str)], ) where - F: for<'s> Fn(&'s str) -> Option> + Send + 'static, + F: Fn(&str) -> Option> + Send + Clone + 'static, { - c.bench_function(&format!("{name}, fn"), |b| { - b.iter(|| { + c.bench_function(&format!("{name}, fn"), move |b| { + let vals = vals.clone(); + b.iter(move || { let template = Template::parse(black_box(template_str)).unwrap(); black_box(template.render(&vals).unwrap()); }) }); - c.bench_function(&format!("{name}, hashmap"), |b| { - b.iter(|| { + let hashmap = Arc::new(hashmap); + c.bench_function(&format!("{name}, hashmap"), move |b| { + let hashmap = Arc::clone(&hashmap); + b.iter(move || { let template = Template::parse(black_box(template_str)).unwrap(); black_box(template.render(&hashmap).unwrap()); }) }); - c.bench_function(&format!("{name}, slice"), |b| { - b.iter(|| { + c.bench_function(&format!("{name}, slice"), move |b| { + b.iter(move || { let template = Template::parse(black_box(template_str)).unwrap(); black_box(template.render(&slice as &dyn Values).unwrap()); }) diff --git a/crates/leon/benches/src/lib.rs b/crates/leon/benches/src/lib.rs new file mode 100644 index 00000000..e69de29b diff --git a/crates/leon/src/values.rs b/crates/leon/src/values.rs index 7641d8a8..f5255272 100644 --- a/crates/leon/src/values.rs +++ b/crates/leon/src/values.rs @@ -2,6 +2,9 @@ use std::{ borrow::{Borrow, Cow}, collections::{BTreeMap, HashMap}, hash::{BuildHasher, Hash}, + ops::Deref, + rc::Rc, + sync::Arc, }; pub trait Values { @@ -17,6 +20,24 @@ where } } +impl Values for Arc +where + T: Values, +{ + fn get_value(&self, key: &str) -> Option> { + T::get_value(self.deref(), key) + } +} + +impl Values for Rc +where + T: Values, +{ + fn get_value(&self, key: &str) -> Option> { + T::get_value(self.deref(), key) + } +} + impl Values for [(K, V)] where K: AsRef, @@ -87,31 +108,41 @@ where /// Workaround to allow using functions as [`Values`]. /// /// As this isn't constructible you'll want to use [`vals()`] instead. +#[derive(Copy, Clone, Debug)] pub struct ValuesFn { inner: F, } -impl<'s, F> Values for &'s ValuesFn +impl Values for ValuesFn where - F: Fn(&str) -> Option> + 's, + F: Fn(&str) -> Option>, { fn get_value(&self, key: &str) -> Option> { (self.inner)(key) } } -impl<'f, F> From for ValuesFn +/// See doc of [`vals`] +impl From for ValuesFn where - F: Fn(&str) -> Option> + 'f, + F: Fn(&str) -> Option>, { fn from(inner: F) -> Self { Self { inner } } } -/// Workaround to allow using functions as [`Values`]. +/// Wraps your function so it implements [`Values`], +/// though it only works if your function returns `Cow<'static, str>`. /// -/// Wraps your function so it implements [`Values`]. +/// Since regular function pointers cannot return anything other than +/// `Cow<'static, str>` and closure in Rust currently does not support +/// returning borrows of captured data, supporting anything other than +/// `Cow<'static, str>` for functions is pointless and would only cause +/// more confusion and compile-time errors. +/// +/// To return `&str` owned by the values itself, please create a newtype +/// and implement [`Values`] on it manually instead of using this function. /// /// # Example /// @@ -122,9 +153,9 @@ where /// /// use_values(&vals(|_| Some("hello".into()))); /// ``` -pub const fn vals<'f, F>(func: F) -> ValuesFn +pub const fn vals(func: F) -> ValuesFn where - F: Fn(&str) -> Option> + 'f, + F: Fn(&str) -> Option>, { ValuesFn { inner: func } } From bb68d67df1a92e781cac7b8ff3921eeb69c0fd2e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Apr 2023 13:28:27 +1000 Subject: [PATCH 1205/2020] Bump home from 0.5.4 to 0.5.5 (#1003) Bumps [home](https://github.com/rust-lang/cargo) from 0.5.4 to 0.5.5. - [Release notes](https://github.com/rust-lang/cargo/releases) - [Changelog](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/cargo/compare/home-0.5.4...home-0.5.5) --- updated-dependencies: - dependency-name: home dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 6 +++--- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 72b49ace..b74adae0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -959,11 +959,11 @@ checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" [[package]] name = "home" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747309b4b440c06d57b0b25f2aee03ee9b5e5397d288c60e21fc709bb98a7408" +checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" dependencies = [ - "winapi", + "windows-sys 0.48.0", ] [[package]] diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 1771e078..1453bbc7 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -14,7 +14,7 @@ beef = { version = "0.5.2", features = ["impl_serde"] } binstalk-types = { version = "0.3.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } -home = "0.5.4" +home = "0.5.5" miette = "5.8.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.160", features = ["derive"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 8f9cf707..714c2d79 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -18,7 +18,7 @@ command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.7", path = "../detect-targets" } either = "1.8.1" -home = "0.5.4" +home = "0.5.5" itertools = "0.10.5" jobslot = { version = "0.2.11", features = ["tokio"] } leon = { version = "1.0.0", path = "../leon" } From 815231a426377aa28bcfa8e9fa6db31ce2dec27c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Apr 2023 13:40:05 +1000 Subject: [PATCH 1206/2020] Bump mimalloc from 0.1.36 to 0.1.37 (#1004) Bumps [mimalloc](https://github.com/purpleprotocol/mimalloc_rust) from 0.1.36 to 0.1.37. - [Release notes](https://github.com/purpleprotocol/mimalloc_rust/releases) - [Commits](https://github.com/purpleprotocol/mimalloc_rust/compare/v0.1.36...v0.1.37) --- updated-dependencies: - dependency-name: mimalloc dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b74adae0..18b19a9f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1234,9 +1234,9 @@ checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" [[package]] name = "libmimalloc-sys" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a558e3d911bc3c7bfc8c78bc580b404d6e51c1cefbf656e176a94b49b0df40" +checksum = "f4ac0e912c8ef1b735e92369695618dc5b1819f5a7bf3f167301a3ba1cea515e" dependencies = [ "cc", "libc", @@ -1370,9 +1370,9 @@ dependencies = [ [[package]] name = "mimalloc" -version = "0.1.36" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d88dad3f985ec267a3fcb7a1726f5cb1a7e8cad8b646e70a84f967210df23da" +checksum = "4e2894987a3459f3ffb755608bd82188f8ed00d0ae077f1edea29c068d639d98" dependencies = [ "libmimalloc-sys", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index d52a40aa..bff4b6a7 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -32,7 +32,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } gh-token = "0.1.1" log = { version = "0.4.17", features = ["std"] } miette = "5.8.0" -mimalloc = { version = "0.1.36", default-features = false, optional = true } +mimalloc = { version = "0.1.37", default-features = false, optional = true } once_cell = "1.17.1" semver = "1.0.17" strum = "0.24.1" From a47ca441008c349dba6ab92edcfb994cd763eba4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Apr 2023 04:09:29 +0000 Subject: [PATCH 1207/2020] Bump tokio from 1.27.0 to 1.28.0 (#1001) --- Cargo.lock | 10 +++++----- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 18b19a9f..1a5a0425 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2271,9 +2271,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.27.0" +version = "1.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0de47a4eecbe11f498978a9b29d792f0d2692d1dd003650c24c76510e3bc001" +checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f" dependencies = [ "autocfg", "bytes", @@ -2285,14 +2285,14 @@ dependencies = [ "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a573bdc87985e9d6ddeed1b3d864e8a302c847e40d647746df2f1de209d1ce" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index bff4b6a7..94dc3172 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -39,7 +39,7 @@ strum = "0.24.1" strum_macros = "0.24.3" supports-color = "2.0.0" tempfile = "3.5.0" -tokio = { version = "1.27.0", features = ["rt-multi-thread"], default-features = false } +tokio = { version = "1.28.0", features = ["rt-multi-thread"], default-features = false } tracing-core = "0.1.30" tracing = { version = "0.1.37", default-features = false } tracing-log = { version = "0.1.3", default-features = false } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 3cf57acf..235c95f3 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -33,7 +33,7 @@ serde_json = { version = "1.0.96", optional = true } tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.5.0" thiserror = "1.0.40" -tokio = { version = "1.27.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } +tokio = { version = "1.28.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.7", features = ["io"] } tower = { version = "0.4.13", features = ["limit", "util"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 714c2d79..d7af3f43 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -33,7 +33,7 @@ strum = "0.24.1" tempfile = "3.5.0" thiserror = "1.0.40" # parking_lot for `tokio::sync::OnceCell::const_new` -tokio = { version = "1.27.0", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } +tokio = { version = "1.28.0", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } tracing = "0.1.37" url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 55d066ba..5808e4fd 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -10,9 +10,9 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -tokio = { version = "1.27.0", features = ["rt", "process", "sync"], default-features = false } +tokio = { version = "1.28.0", features = ["rt", "process", "sync"], default-features = false } cfg-if = "1.0.0" guess_host_triple = "0.1.3" [dev-dependencies] -tokio = { version = "1.27.0", features = ["macros"], default-features = false } +tokio = { version = "1.28.0", features = ["macros"], default-features = false } From e4d88310edaecb2e2db0052f3f99ba1df3d1bf4a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Apr 2023 04:39:51 +0000 Subject: [PATCH 1208/2020] Bump tracing from 0.1.37 to 0.1.38 (#1005) --- Cargo.lock | 11 +++++------ crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1a5a0425..ee5cf7fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2426,11 +2426,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "cf9cf6a813d3f40c88b0b6b6f29a5c95c6cdbf97c1f9cc53fb820200f5ad814d" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -2439,13 +2438,13 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" +checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.15", ] [[package]] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 94dc3172..df51264d 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -41,7 +41,7 @@ supports-color = "2.0.0" tempfile = "3.5.0" tokio = { version = "1.28.0", features = ["rt-multi-thread"], default-features = false } tracing-core = "0.1.30" -tracing = { version = "0.1.37", default-features = false } +tracing = { version = "0.1.38", default-features = false } tracing-log = { version = "0.1.3", default-features = false } tracing-subscriber = { version = "0.3.17", features = ["fmt", "json", "ansi"], default-features = false } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 235c95f3..feda8c80 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -37,7 +37,7 @@ tokio = { version = "1.28.0", features = ["macros", "rt-multi-thread", "sync", " tokio-tar = "0.3.0" tokio-util = { version = "0.7.7", features = ["io"] } tower = { version = "0.4.13", features = ["limit", "util"] } -tracing = "0.1.37" +tracing = "0.1.38" # trust-dns-resolver must be kept in sync with the version reqwest uses trust-dns-resolver = { version = "0.22.0", optional = true, default-features = false, features = ["dnssec-ring"] } url = "2.3.1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index d7af3f43..23f69787 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -34,7 +34,7 @@ tempfile = "3.5.0" thiserror = "1.0.40" # parking_lot for `tokio::sync::OnceCell::const_new` tokio = { version = "1.28.0", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } -tracing = "0.1.37" +tracing = "0.1.38" url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" From 7ca0edf0044b948199e585c87b57708b61cd6491 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 26 Apr 2023 05:43:55 +0000 Subject: [PATCH 1209/2020] Bump tokio-util from 0.7.7 to 0.7.8 (#1002) --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ee5cf7fc..12414bf4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2348,9 +2348,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5427d89453009325de0d8f342c9490009f76e999cb7672d77e46267448f7e6b2" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" dependencies = [ "bytes", "futures-core", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index feda8c80..640deb8b 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -35,7 +35,7 @@ tempfile = "3.5.0" thiserror = "1.0.40" tokio = { version = "1.28.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" -tokio-util = { version = "0.7.7", features = ["io"] } +tokio-util = { version = "0.7.8", features = ["io"] } tower = { version = "0.4.13", features = ["limit", "util"] } tracing = "0.1.38" # trust-dns-resolver must be kept in sync with the version reqwest uses From d6ec063a5d1294f4d82396dda84b18f5b60a521b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 26 Apr 2023 16:50:16 +1000 Subject: [PATCH 1210/2020] Update transitive dependencies (#1006) Signed-off-by: Jiahao XU --- Cargo.lock | 62 +++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 12414bf4..4a692e87 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,9 +30,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "0.7.20" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" dependencies = [ "memchr", ] @@ -54,9 +54,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e579a7752471abc2a8268df8b20005e3eadd975f585398f17efcfd8d4927371" +checksum = "6342bd4f5a1205d7f41e94a41a901f5647c938cdfa96036338e8533c9d6c2450" dependencies = [ "anstyle", "anstyle-parse", @@ -93,9 +93,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcd8291a340dd8ac70e18878bc4501dd7b4ff970cfa21c207d36ece51ea88fd" +checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" dependencies = [ "anstyle", "windows-sys 0.48.0", @@ -349,9 +349,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.0" +version = "3.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" +checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" [[package]] name = "byteorder" @@ -910,9 +910,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66b91535aa35fea1523ad1b86cb6b53c28e0ae566ba4a460f4457e936cad7c6f" +checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" dependencies = [ "bytes", "fnv", @@ -1144,7 +1144,7 @@ checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" dependencies = [ "hermit-abi 0.3.1", "io-lifetimes 1.0.10", - "rustix 0.37.11", + "rustix 0.37.15", "windows-sys 0.48.0", ] @@ -1228,9 +1228,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.141" +version = "0.2.142" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3304a64d199bb964be99741b7a14d26972741915b3649639149b2479bb46f4b5" +checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" [[package]] name = "libmimalloc-sys" @@ -1266,9 +1266,9 @@ checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" [[package]] name = "linux-raw-sys" -version = "0.3.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59d8c75012853d2e872fb56bc8a2e53718e2cafe1a4c823143141c6d90c322f" +checksum = "36eb31c1778188ae1e64398743890d0877fef36d11521ac60406b42016e8c2cf" [[package]] name = "lock_api" @@ -1475,9 +1475,9 @@ checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "openssl" -version = "0.10.50" +version = "0.10.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e30d8bc91859781f0a943411186324d580f2bbeb71b452fe91ae344806af3f1" +checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56" dependencies = [ "bitflags", "cfg-if", @@ -1507,9 +1507,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.85" +version = "0.9.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d3d193fb1488ad46ffe3aaabc912cc931d02ee8518fe2959aea8ef52718b0c0" +checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e" dependencies = [ "cc", "libc", @@ -1740,9 +1740,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.7.3" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b1f693b24f6ac912f4893ef08244d70b6067480d2f1a46e950c9691e6749d1d" +checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" dependencies = [ "aho-corasick", "memchr", @@ -1751,9 +1751,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.29" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" +checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" [[package]] name = "reqwest" @@ -1857,15 +1857,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.11" +version = "0.37.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85597d61f83914ddeba6a47b3b8ffe7365107221c2e557ed94426489fefb5f77" +checksum = "a0661814f891c57c930a610266415528da53c4933e6dea5fb350cbfe048a9ece" dependencies = [ "bitflags", "errno 0.3.1", "io-lifetimes 1.0.10", "libc", - "linux-raw-sys 0.3.1", + "linux-raw-sys 0.3.4", "windows-sys 0.48.0", ] @@ -2152,9 +2152,9 @@ dependencies = [ [[package]] name = "supports-hyperlinks" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b4806e0b03b9906e76b018a5d821ebf198c8e9dc0829ed3328eeeb5094aed60" +checksum = "f84231692eb0d4d41e4cdd0cabfdd2e6cd9e255e65f80c9aa7c98dd502b4233d" dependencies = [ "is-terminal", ] @@ -2199,7 +2199,7 @@ dependencies = [ "cfg-if", "fastrand", "redox_syscall 0.3.5", - "rustix 0.37.11", + "rustix 0.37.15", "windows-sys 0.45.0", ] @@ -2322,9 +2322,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb52b74f05dbf495a8fba459fdc331812b96aa086d9eb78101fa0d4569c3313" +checksum = "76cd2598a37719e3cd4c28af93f978506a97a2920ef4d96e4b12e38b8cbc8940" dependencies = [ "futures-core", "pin-project-lite", From 613aae2b1eaecd920811538643c69e1e3fec95bb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 26 Apr 2023 17:30:24 +1000 Subject: [PATCH 1211/2020] release: leon v2.0.0 (#1007) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/leon-macros/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4a692e87..822c663b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1209,7 +1209,7 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "leon" -version = "1.0.0" +version = "2.0.0" dependencies = [ "clap", "miette", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 23f69787..63be4d7f 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -21,7 +21,7 @@ either = "1.8.1" home = "0.5.5" itertools = "0.10.5" jobslot = { version = "0.2.11", features = ["tokio"] } -leon = { version = "1.0.0", path = "../leon" } +leon = { version = "2.0.0", path = "../leon" } leon-macros = { version = "0.0.0", path = "../leon-macros" } maybe-owned = "0.3.4" miette = "5.8.0" diff --git a/crates/leon-macros/Cargo.toml b/crates/leon-macros/Cargo.toml index 803cbc49..6584688f 100644 --- a/crates/leon-macros/Cargo.toml +++ b/crates/leon-macros/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" proc-macro = true [dependencies] -leon = { version = "1.0.0", path = "../leon", default-features = false } +leon = { version = "2.0.0", path = "../leon", default-features = false } proc-macro2 = "1.0.56" syn = { version = "2.0.15", default-features = false, features = ["proc-macro", "parsing"] } quote = "1.0.26" diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index c30a8cdd..36569498 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -3,7 +3,7 @@ name = "leon" description = "Dead-simple string templating" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/leon" -version = "1.0.0" +version = "2.0.0" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From 5b0268c76808b37a81ca86f4d1247ca15d8157a6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 26 Apr 2023 17:31:21 +1000 Subject: [PATCH 1212/2020] release: binstalk-types v0.4.0 (#1008) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 822c663b..3fa37c35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -288,7 +288,7 @@ dependencies = [ [[package]] name = "binstalk-types" -version = "0.3.0" +version = "0.4.0" dependencies = [ "compact_str", "maybe-owned", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 640deb8b..7121d736 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0" async-trait = "0.1.68" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.13", features = ["deflate", "bzip2", "lzma", "zstd", "xz", "tokio"] } -binstalk-types = { version = "0.3.0", path = "../binstalk-types" } +binstalk-types = { version = "0.4.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" compact_str = "0.7.0" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 1453bbc7..053e97b7 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] beef = { version = "0.5.2", features = ["impl_serde"] } -binstalk-types = { version = "0.3.0", path = "../binstalk-types" } +binstalk-types = { version = "0.4.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.5" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 6ecde975..fb1cb53a 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-types" description = "The binstall toolkit that contains basic types for binstalk crates" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-types" -version = "0.3.0" +version = "0.4.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 63be4d7f..f5eea053 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.68" binstalk-downloader = { version = "0.4.2", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } -binstalk-types = { version = "0.3.0", path = "../binstalk-types" } +binstalk-types = { version = "0.4.0", path = "../binstalk-types" } cargo_toml = "0.15.2" command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } From 1a94a36311d770ae171fb0355d2065db7ba58c9c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 26 Apr 2023 18:05:14 +1000 Subject: [PATCH 1213/2020] release: leon-macros v1.0.0 (#1009) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/leon-macros/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3fa37c35..07901a23 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1218,7 +1218,7 @@ dependencies = [ [[package]] name = "leon-macros" -version = "0.0.0" +version = "1.0.0" dependencies = [ "leon", "proc-macro2", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index f5eea053..bb700c8c 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -22,7 +22,7 @@ home = "0.5.5" itertools = "0.10.5" jobslot = { version = "0.2.11", features = ["tokio"] } leon = { version = "2.0.0", path = "../leon" } -leon-macros = { version = "0.0.0", path = "../leon-macros" } +leon-macros = { version = "1.0.0", path = "../leon-macros" } maybe-owned = "0.3.4" miette = "5.8.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } diff --git a/crates/leon-macros/Cargo.toml b/crates/leon-macros/Cargo.toml index 6584688f..89f6de86 100644 --- a/crates/leon-macros/Cargo.toml +++ b/crates/leon-macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "leon-macros" -version = "0.0.0" +version = "1.0.0" edition = "2021" description = "Proc macros for crate leon" repository = "https://github.com/cargo-bins/cargo-binstall" From f683b4075d393fad876e0a53a1d2940bd65d90e7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 26 Apr 2023 18:44:23 +1000 Subject: [PATCH 1214/2020] release: binstalk-downloader v0.5.0 (#1011) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 07901a23..99669dc2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -233,7 +233,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.4.2" +version = "0.5.0" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 7121d736..8e80113e 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.4.2" +version = "0.5.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index bb700c8c..aabd9704 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.4.2", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.5.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.4.0", path = "../binstalk-types" } cargo_toml = "0.15.2" command-group = { version = "2.1.0", features = ["with-tokio"] } From 1d97b8191dd2a80a74c2cf9ef56adb7a449c6134 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 26 Apr 2023 18:44:31 +1000 Subject: [PATCH 1215/2020] release: binstalk-manifests v0.5.0 (#1012) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 99669dc2..cc1dffdf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -267,7 +267,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.4.1" +version = "0.5.0" dependencies = [ "beef", "binstalk-types", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index df51264d..a0b5f611 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.11.0", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.4.1" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.5.0" } clap = { version = "4.2.4", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.0" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 053e97b7..0d7e8016 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.4.1" +version = "0.5.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From 6516805f107b9af087f7ab8c8c7f4d597a5d5934 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 26 Apr 2023 19:57:48 +1000 Subject: [PATCH 1216/2020] Speedup `release-build.yml`: Do not run `unit-tests` (#1015) `cargo-test` cannot share its artifacts with `cargo-build` and vice versa, plus running `e2e-tests` in release build is enough to find out potential miscompilation. Signed-off-by: Jiahao XU --- .github/workflows/release-build.yml | 9 +-------- justfile | 6 ------ 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 97a67cce..0ee34acf 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -52,20 +52,13 @@ jobs: - run: just toolchain rust-src - run: just ci-install-deps + - run: just package - if: runner.os == 'Windows' run: Get-ChildItem packages/ - if: runner.os != 'Windows' run: ls -shal packages/ - - name: Run unit tests in release build - if: "matrix.r" - run: | - just avoid-benchmark-deps - just unit-tests - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Ensure release binary is runnable if: "matrix.r" run: just e2e-tests diff --git a/justfile b/justfile index a0424679..1c77d2e1 100644 --- a/justfile +++ b/justfile @@ -232,12 +232,6 @@ avoid-dev-deps: mv "$crate/Cargo.toml.tmp" "$crate/Cargo.toml" \ ; done -# leon dev-dependencies pulls in crates for benchmark but not used in test. -# This is a workaround for the lack of `benchmark-dependencies`. -avoid-benchmark-deps: - sed 's/\[dev-dependencies\]/[workaround-avoid-dev-deps]/g' ./crates/leon/Cargo.toml >./crates/leon/Cargo.toml.tmp - mv ./crates/leon/Cargo.toml.tmp ./crates/leon/Cargo.toml - package-dir: rm -rf packages/prep mkdir -p packages/prep From 8cc1430ca6cc620be3e2053e2de4ca51e00aca24 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 26 Apr 2023 19:57:57 +1000 Subject: [PATCH 1217/2020] release: binstalk v0.12.0 (#1013) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cc1dffdf..a64ed220 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -200,7 +200,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.11.0" +version = "0.12.0" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index a0b5f611..4ab149dc 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.11.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.12.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.5.0" } clap = { version = "4.2.4", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index aabd9704..10a83ee5 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.11.0" +version = "0.12.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From 2103fdee2c1d4b60ba4655940e4ef6b43ad6ef23 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 26 Apr 2023 21:12:37 +1000 Subject: [PATCH 1218/2020] release: cargo-binstall v0.23.0 (#1014) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a64ed220..dc6ccac1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.22.0" +version = "0.23.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 4ab149dc..348ecc4e 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.22.0" +version = "0.23.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index a6c1ee66..5167943f 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From b1b4394d80a8021c8f8980cacb10c6c3f22e01b0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 26 Apr 2023 23:06:16 +1000 Subject: [PATCH 1219/2020] Add & Enable new feat `log_max_level_debug` to speedup debug build (#1016) Signed-off-by: Jiahao XU --- crates/bin/Cargo.toml | 3 +++ justfile | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 348ecc4e..c1f761c8 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -69,5 +69,8 @@ cross-lang-fat-lto = ["binstalk/cross-lang-fat-lto"] fancy-no-backtrace = ["miette/fancy-no-backtrace"] fancy-with-backtrace = ["fancy-no-backtrace", "miette/fancy"] +log_max_level_info = ["log/max_level_info", "tracing/max_level_info", "log_release_max_level_info"] +log_max_level_debug = ["log/max_level_debug", "tracing/max_level_debug", "log_release_max_level_debug"] + log_release_max_level_info = ["log/release_max_level_info", "tracing/release_max_level_info"] log_release_max_level_debug = ["log/release_max_level_debug", "tracing/release_max_level_debug"] diff --git a/justfile b/justfile index 1c77d2e1..ccc5a6f7 100644 --- a/justfile +++ b/justfile @@ -73,7 +73,7 @@ support-pkg-config := if target == target-host { } else { "" } cargo-features := trim_end_match(if override-features != "" { override-features - } else if (cargo-profile / ci-or-no) == "dev/ci" { "rustls,fancy-with-backtrace,zstd-thin,log_release_max_level_debug" + (if support-pkg-config != "" { ",pkg-config" } else { "" }) + extra-features + } else if (cargo-profile / ci-or-no) == "dev/ci" { "rustls,fancy-with-backtrace,zstd-thin,log_max_level_debug" + (if support-pkg-config != "" { ",pkg-config" } else { "" }) + extra-features } else if (cargo-profile / ci-or-no) == "release/ci" { "static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug,cross-lang-fat-lto" + extra-features } else { extra-features }, ",") From 56b3360b17336df7dd2ff06474bca6cf1897aff7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 28 Apr 2023 15:27:45 +1000 Subject: [PATCH 1220/2020] Bump clap from 4.2.4 to 4.2.5 (#1017) --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dc6ccac1..283a1818 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -451,9 +451,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.2.4" +version = "4.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956ac1f6381d8d82ab4684768f89c0ea3afe66925ceadb4eeb3fc452ffc55d62" +checksum = "8a1f23fa97e1d1641371b51f35535cb26959b8e27ab50d167a8b996b5bada819" dependencies = [ "clap_builder", "clap_derive", @@ -462,9 +462,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.2.4" +version = "4.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84080e799e54cff944f4b4a4b0e71630b0e0443b25b985175c7dddc1a859b749" +checksum = "0fdc5d93c358224b4d6867ef1356d740de2303e9892edc06c5340daeccd96bab" dependencies = [ "anstream", "anstyle", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index c1f761c8..329279df 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.12.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.5.0" } -clap = { version = "4.2.4", features = ["derive", "env"] } +clap = { version = "4.2.5", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.0" file-format = { version = "0.16.0", default-features = false } diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 36569498..722e0d50 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" exclude = ["fuzz", "benches"] [dependencies] -clap = { version = "4.2.4", features = ["derive"], optional = true } +clap = { version = "4.2.5", features = ["derive"], optional = true } miette = { version = "5.8.0", default-features = false, optional = true } thiserror = "1.0.38" From 2bb1869bc50729827d399adacffb69dff388dbe6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 May 2023 18:25:04 +1000 Subject: [PATCH 1221/2020] Bump dirs from 5.0.0 to 5.0.1 (#1023) Bumps [dirs](https://github.com/soc/dirs-rs) from 5.0.0 to 5.0.1. - [Release notes](https://github.com/soc/dirs-rs/releases) - [Commits](https://github.com/soc/dirs-rs/commits) --- updated-dependencies: - dependency-name: dirs dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 17 ++++++++++++----- crates/bin/Cargo.toml | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 283a1818..44dbe9a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -601,22 +601,23 @@ dependencies = [ [[package]] name = "dirs" -version = "5.0.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dece029acd3353e3a58ac2e3eb3c8d6c35827a892edc6cc4138ef9c33df46ecd" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04414300db88f70d74c5ff54e50f9e1d1737d9a5b90f53fcf2e95ca2a9ab554b" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" dependencies = [ "libc", + "option-ext", "redox_users", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -1517,6 +1518,12 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "overload" version = "0.1.1" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 329279df..af6987ab 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -26,7 +26,7 @@ binstalk = { path = "../binstalk", version = "0.12.0", default-features = false binstalk-manifests = { path = "../binstalk-manifests", version = "0.5.0" } clap = { version = "4.2.5", features = ["derive", "env"] } compact_str = "0.7.0" -dirs = "5.0.0" +dirs = "5.0.1" file-format = { version = "0.16.0", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } gh-token = "0.1.1" From ac1808eef647d665aeb670fad93de6f09101d86f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 May 2023 18:26:17 +1000 Subject: [PATCH 1222/2020] Bump flate2 from 1.0.25 to 1.0.26 (#1020) Bumps [flate2](https://github.com/rust-lang/flate2-rs) from 1.0.25 to 1.0.26. - [Release notes](https://github.com/rust-lang/flate2-rs/releases) - [Commits](https://github.com/rust-lang/flate2-rs/commits) --- updated-dependencies: - dependency-name: flate2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 17 +++++++++++++---- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 44dbe9a7..437cb737 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -163,7 +163,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.6.2", "object", "rustc-demangle", ] @@ -721,13 +721,13 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" +checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" dependencies = [ "crc32fast", "libz-ng-sys", - "miniz_oxide", + "miniz_oxide 0.7.1", ] [[package]] @@ -1393,6 +1393,15 @@ 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.6" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 8e80113e..3741e7e1 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -18,7 +18,7 @@ bytes = "1.4.0" bzip2 = "0.4.4" compact_str = "0.7.0" digest = "0.10.6" -flate2 = { version = "1.0.25", default-features = false } +flate2 = { version = "1.0.26", default-features = false } futures-lite = { version = "1.13.0", default-features = false } futures-util = "0.3.28" generic-array = "0.14.7" From 52e2368e6cbde232515e7e563180e8898ed5c58f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 May 2023 18:27:00 +1000 Subject: [PATCH 1223/2020] Bump reqwest from 0.11.16 to 0.11.17 (#1021) Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.16 to 0.11.17. - [Release notes](https://github.com/seanmonstar/reqwest/releases) - [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md) - [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.16...v0.11.17) --- updated-dependencies: - dependency-name: reqwest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 437cb737..471fd635 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1773,9 +1773,9 @@ checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" [[package]] name = "reqwest" -version = "0.11.16" +version = "0.11.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b71749df584b7f4cac2c426c127a7c785a5106cc98f7a8feb044115f0fa254" +checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" dependencies = [ "async-compression", "base64 0.21.0", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 3741e7e1..26c68221 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -23,7 +23,7 @@ futures-lite = { version = "1.13.0", default-features = false } futures-util = "0.3.28" generic-array = "0.14.7" httpdate = "1.0.2" -reqwest = { version = "0.11.16", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } +reqwest = { version = "0.11.17", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } serde = { version = "1.0.160", features = ["derive"], optional = true } serde_json = { version = "1.0.96", optional = true } # Use a fork here since we need PAX support, but the upstream From 763ddd0427f6d1c857fef2723810f9950d88679f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 1 May 2023 21:23:43 +1000 Subject: [PATCH 1224/2020] Bump async_zip from 0.0.13 to 0.0.15 (#1022) * Bump async_zip from 0.0.13 to 0.0.15 Bumps [async_zip](https://github.com/Majored/rs-async-zip) from 0.0.13 to 0.0.15. - [Release notes](https://github.com/Majored/rs-async-zip/releases) - [Commits](https://github.com/Majored/rs-async-zip/commits) --- updated-dependencies: - dependency-name: async_zip dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Fix build error Signed-off-by: Jiahao XU --------- Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU --- Cargo.lock | 4 +- crates/binstalk-downloader/Cargo.toml | 2 +- .../src/download/async_extracter.rs | 14 ++++-- .../src/download/zip_extraction.rs | 48 ++++++++++++++----- 4 files changed, 48 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 471fd635..8749bd43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -133,9 +133,9 @@ dependencies = [ [[package]] name = "async_zip" -version = "0.0.13" +version = "0.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79eaa2b44cfdce59cfff6cb013c96900635085fe7c28fbcbe926c9e5ad0ddfbc" +checksum = "795310de3218cde15219fc98c1cf7d8fe9db4865aab27fcf1d535d6cb61c6b54" dependencies = [ "async-compression", "crc32fast", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 26c68221..bdcd56b0 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.68" async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } -async_zip = { version = "0.0.13", features = ["deflate", "bzip2", "lzma", "zstd", "xz", "tokio"] } +async_zip = { version = "0.0.15", features = ["deflate", "bzip2", "lzma", "zstd", "xz", "tokio"] } binstalk-types = { version = "0.4.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" diff --git a/crates/binstalk-downloader/src/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs index c6319f8e..09a42837 100644 --- a/crates/binstalk-downloader/src/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -6,7 +6,7 @@ use std::{ path::{Component, Path, PathBuf}, }; -use async_zip::tokio::read::stream::ZipFileReader; +use async_zip::base::read::stream::ZipFileReader; use bytes::{Bytes, BytesMut}; use futures_lite::stream::Stream; use tokio::sync::mpsc; @@ -50,12 +50,18 @@ where debug!("Decompressing from zip archive to `{}`", path.display()); let reader = StreamReader::new(stream); - let mut zip = ZipFileReader::new(reader); + let mut zip = ZipFileReader::with_tokio(reader); let mut buf = BytesMut::with_capacity(4 * 4096); let mut extracted_files = ExtractedFiles::new(); - while let Some(mut zip_reader) = zip.next_entry().await.map_err(ZipError::from_inner)? { - extract_zip_entry(&mut zip_reader, path, &mut buf, &mut extracted_files).await?; + while let Some(mut zip_reader) = zip.next_with_entry().await.map_err(ZipError::from_inner)? { + extract_zip_entry( + zip_reader.reader_mut(), + path, + &mut buf, + &mut extracted_files, + ) + .await?; // extract_zip_entry would read the zip_reader until read the file until // eof unless extract_zip itself is cancelled or an error is raised. diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index 558d7ba9..b581b5f7 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -1,9 +1,13 @@ use std::{ + borrow::Cow, io::Write, path::{Component, Path, PathBuf}, }; -use async_zip::{base::read::stream::Reading, tokio::read::stream::ZipFileReader}; +use async_zip::{ + base::{read::WithEntry, read::ZipEntryReader}, + ZipString, +}; use bytes::{Bytes, BytesMut}; use futures_lite::future::try_zip as try_join; use futures_util::io::Take; @@ -37,7 +41,7 @@ impl ZipError { } pub(super) async fn extract_zip_entry( - zip_reader: &mut ZipFileReader>>>, + zip_reader: &mut ZipEntryReader<'_, Take>, WithEntry<'_>>, path: &Path, buf: &mut BytesMut, extracted_files: &mut ExtractedFiles, @@ -47,8 +51,7 @@ where { // Sanitize filename let raw_filename = zip_reader.entry().filename(); - let filename = check_filename_and_normalize(raw_filename) - .ok_or_else(|| ZipError(ZipErrorInner::InvalidFilePath(raw_filename.into())))?; + let (filename, is_dir) = check_filename_and_normalize(raw_filename)?; // Calculates the outpath let outpath = path.join(&filename); @@ -57,8 +60,6 @@ where #[cfg_attr(not(unix), allow(unused_mut))] let mut perms = None; - let is_dir = raw_filename.ends_with('/'); - #[cfg(unix)] { use std::{fs::Permissions, os::unix::fs::PermissionsExt}; @@ -115,7 +116,17 @@ where Ok(()) }); - let read_task = copy_file_to_mpsc(zip_reader.reader().compat(), tx, buf); + let read_task = async move { + // Read everything into `tx` + copy_file_to_mpsc(zip_reader.compat(), tx, buf).await?; + // Check crc32 checksum. + // + // NOTE that since everything is alread read into the channel, + // this function should not read any byte into the `Vec` and + // should return `0`. + assert_eq!(zip_reader.read_to_end_checked(&mut Vec::new()).await?, 0); + Ok(()) + }; try_join( async move { write_task.await.map_err(From::from) }, @@ -183,29 +194,40 @@ where /// to path-based exploits. /// /// This function is adapted from `zip::ZipFile::enclosed_name`. -fn check_filename_and_normalize(filename: &str) -> Option { +fn check_filename_and_normalize(filename: &ZipString) -> Result<(PathBuf, bool), DownloadError> { + let filename = filename + .as_str() + .map(Cow::Borrowed) + .unwrap_or_else(|_| String::from_utf8_lossy(filename.as_bytes())); + + let bail = |filename: Cow<'_, str>| { + Err(ZipError(ZipErrorInner::InvalidFilePath( + filename.into_owned().into(), + ))) + }; + if filename.contains('\0') { - return None; + return bail(filename)?; } let mut path = PathBuf::new(); // The following loop is adapted from // `normalize_path::NormalizePath::normalize`. - for component in Path::new(filename).components() { + for component in Path::new(&*filename).components() { match component { - Component::Prefix(_) | Component::RootDir => return None, + Component::Prefix(_) | Component::RootDir => return bail(filename)?, Component::CurDir => (), Component::ParentDir => { if !path.pop() { // `PathBuf::pop` returns false if there is no parent. // which means the path is invalid. - return None; + return bail(filename)?; } } Component::Normal(c) => path.push(c), } } - Some(path) + Ok((path, filename.ends_with('/'))) } From f2703e396a6694889287484c464dd4aa15176115 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 May 2023 04:10:00 +0000 Subject: [PATCH 1225/2020] Bump clap from 4.2.5 to 4.2.7 (#1024) --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8749bd43..1892905a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -451,9 +451,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.2.5" +version = "4.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a1f23fa97e1d1641371b51f35535cb26959b8e27ab50d167a8b996b5bada819" +checksum = "34d21f9bf1b425d2968943631ec91202fe5e837264063503708b83013f8fc938" dependencies = [ "clap_builder", "clap_derive", @@ -462,9 +462,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.2.5" +version = "4.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fdc5d93c358224b4d6867ef1356d740de2303e9892edc06c5340daeccd96bab" +checksum = "914c8c79fb560f238ef6429439a30023c862f7a28e688c58f7203f12b29970bd" dependencies = [ "anstream", "anstyle", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index af6987ab..07051833 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.12.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.5.0" } -clap = { version = "4.2.5", features = ["derive", "env"] } +clap = { version = "4.2.7", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" file-format = { version = "0.16.0", default-features = false } diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 722e0d50..49d338cf 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" exclude = ["fuzz", "benches"] [dependencies] -clap = { version = "4.2.5", features = ["derive"], optional = true } +clap = { version = "4.2.7", features = ["derive"], optional = true } miette = { version = "5.8.0", default-features = false, optional = true } thiserror = "1.0.38" From 492f8ee59dcffba3ef93d1374ee7af79155a570b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 3 May 2023 20:05:27 +1000 Subject: [PATCH 1226/2020] dependabot: Update deps of direct deps & simplify config (#1025) Signed-off-by: Jiahao XU --- .github/dependabot.yml | 48 ++++-------------------------------------- 1 file changed, 4 insertions(+), 44 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 8547ce2a..13f25eb4 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,47 +12,7 @@ updates: directory: "/" schedule: interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/bin" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/binstalk-manifests" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/binstalk-types" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/binstalk" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/binstalk-downloader" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/detect-wasi" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/fs-lock" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/normalize-path" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/detect-targets" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/leon" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/leon-macros" - schedule: - interval: "daily" + allow: + - dependency-name: "*" + # Update all dependencies, including the dependencies of direct dependencies. + dependency-type: "all" From d92d60491917e84900bf4a283eee78ebdb267582 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 May 2023 10:41:45 +0000 Subject: [PATCH 1227/2020] Bump anstream from 0.3.1 to 0.3.2 (#1026) --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1892905a..048aaa84 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -54,9 +54,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6342bd4f5a1205d7f41e94a41a901f5647c938cdfa96036338e8533c9d6c2450" +checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" dependencies = [ "anstyle", "anstyle-parse", From ba2d2e17cbd477e720b2e58bde40dc45ce05331c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 May 2023 20:44:13 +1000 Subject: [PATCH 1228/2020] Bump winnow from 0.4.1 to 0.4.6 (#1027) Bumps [winnow](https://github.com/winnow-rs/winnow) from 0.4.1 to 0.4.6. - [Release notes](https://github.com/winnow-rs/winnow/releases) - [Changelog](https://github.com/winnow-rs/winnow/blob/main/CHANGELOG.md) - [Commits](https://github.com/winnow-rs/winnow/compare/v0.4.1...v0.4.6) --- updated-dependencies: - dependency-name: winnow dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 048aaa84..c1c6301b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2997,9 +2997,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.1" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8970b36c66498d8ff1d66685dc86b91b29db0c7739899012f63a63814b4b28" +checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" dependencies = [ "memchr", ] From 1a98cdce2e62439a3fe827bff21fc53cde8c2ecd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 May 2023 10:51:35 +0000 Subject: [PATCH 1229/2020] Bump libz-ng-sys from 1.1.8 to 1.1.9 (#1029) --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c1c6301b..99ffd4fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1245,9 +1245,9 @@ dependencies = [ [[package]] name = "libz-ng-sys" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4399ae96a9966bf581e726de86969f803a81b7ce795fcd5480e640589457e0f2" +checksum = "2468756f34903b582fe7154dc1ffdebd89d0562c4a43b53c621bb0f1b1043ccb" dependencies = [ "cmake", "libc", From 47588940f9b752ad88b68ecbf1c4586d791d0099 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 3 May 2023 22:02:18 +1000 Subject: [PATCH 1230/2020] Bump tokio-stream from 0.1.13 to 0.1.14 (#1028) Bumps [tokio-stream](https://github.com/tokio-rs/tokio) from 0.1.13 to 0.1.14. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Changelog](https://github.com/tokio-rs/tokio/blob/tokio-0.1.14/CHANGELOG.md) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-stream-0.1.13...tokio-0.1.14) --- updated-dependencies: - dependency-name: tokio-stream dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 99ffd4fc..c6695f47 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2338,9 +2338,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76cd2598a37719e3cd4c28af93f978506a97a2920ef4d96e4b12e38b8cbc8940" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" dependencies = [ "futures-core", "pin-project-lite", From 024db639bc4f440ae8f1a13ba163a65542906fc5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 4 May 2023 13:36:33 +1000 Subject: [PATCH 1231/2020] Bump pkg-config from 0.3.26 to 0.3.27 (#1030) Bumps [pkg-config](https://github.com/rust-lang/pkg-config-rs) from 0.3.26 to 0.3.27. - [Release notes](https://github.com/rust-lang/pkg-config-rs/releases) - [Changelog](https://github.com/rust-lang/pkg-config-rs/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/pkg-config-rs/compare/0.3.26...0.3.27) --- updated-dependencies: - dependency-name: pkg-config dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c6695f47..264b669b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1608,9 +1608,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.26" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ac9a59f73473f1b8d852421e59e64809f025994837ef743615c6d0c5b305160" +checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" [[package]] name = "ppv-lite86" From e9c7405081ed6c5d0ee300b43f10139e1b11c3f6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 May 2023 15:04:51 +1000 Subject: [PATCH 1232/2020] Bump fs4 from 0.6.3 to 0.6.4 (#1031) Bumps [fs4](https://github.com/al8n/fs4-rs) from 0.6.3 to 0.6.4. - [Commits](https://github.com/al8n/fs4-rs/commits) --- updated-dependencies: - dependency-name: fs4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 45 ++++++++------------------------------- crates/fs-lock/Cargo.toml | 2 +- 2 files changed, 10 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 264b669b..cb9fd445 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -769,13 +769,12 @@ dependencies = [ [[package]] name = "fs4" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea55201cc351fdb478217c0fb641b59813da9b4efe4c414a9d8f989a657d149" +checksum = "a7f5b6908aecca5812a4569056285e58c666588c9573ee59765bf1d3692699e2" dependencies = [ - "libc", - "rustix 0.35.13", - "winapi", + "rustix", + "windows-sys 0.48.0", ] [[package]] @@ -1102,12 +1101,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "io-lifetimes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59ce5ef949d49ee85593fc4d3f3f95ad61657076395cbbce23e2121fc5542074" - [[package]] name = "io-lifetimes" version = "1.0.10" @@ -1144,8 +1137,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" dependencies = [ "hermit-abi 0.3.1", - "io-lifetimes 1.0.10", - "rustix 0.37.15", + "io-lifetimes", + "rustix", "windows-sys 0.48.0", ] @@ -1259,12 +1252,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "linux-raw-sys" -version = "0.0.46" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4d2456c373231a208ad294c33dc5bff30051eafd954cd4caae83a712b12854d" - [[package]] name = "linux-raw-sys" version = "0.3.4" @@ -1857,20 +1844,6 @@ dependencies = [ "semver", ] -[[package]] -name = "rustix" -version = "0.35.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "727a1a6d65f786ec22df8a81ca3121107f235970dc1705ed681d3e6e8b9cd5f9" -dependencies = [ - "bitflags", - "errno 0.2.8", - "io-lifetimes 0.7.5", - "libc", - "linux-raw-sys 0.0.46", - "windows-sys 0.42.0", -] - [[package]] name = "rustix" version = "0.37.15" @@ -1879,9 +1852,9 @@ checksum = "a0661814f891c57c930a610266415528da53c4933e6dea5fb350cbfe048a9ece" dependencies = [ "bitflags", "errno 0.3.1", - "io-lifetimes 1.0.10", + "io-lifetimes", "libc", - "linux-raw-sys 0.3.4", + "linux-raw-sys", "windows-sys 0.48.0", ] @@ -2215,7 +2188,7 @@ dependencies = [ "cfg-if", "fastrand", "redox_syscall 0.3.5", - "rustix 0.37.15", + "rustix", "windows-sys 0.45.0", ] diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 62327306..38319798 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -10,4 +10,4 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -fs4 = "0.6.3" +fs4 = "0.6.4" From cb906ae0bf4dc5c313b7b89218a92ef831b31286 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 5 May 2023 15:05:53 +1000 Subject: [PATCH 1233/2020] Bump serde from 1.0.160 to 1.0.162 (#1032) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.160 to 1.0.162. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.160...1.0.162) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cb9fd445..aa8a2479 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1971,9 +1971,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.160" +version = "1.0.162" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" +checksum = "71b2f6e1ab5c2b98c05f0f35b236b22e8df7ead6ffbf51d7808da7f8817e7ab6" dependencies = [ "serde_derive", ] @@ -1989,9 +1989,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.160" +version = "1.0.162" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" +checksum = "a2a0814352fd64b58489904a44ea8d90cb1a91dcb6b4f5ebabc32c8318e93cb6" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index bdcd56b0..ed7128b5 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -24,7 +24,7 @@ futures-util = "0.3.28" generic-array = "0.14.7" httpdate = "1.0.2" reqwest = { version = "0.11.17", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } -serde = { version = "1.0.160", features = ["derive"], optional = true } +serde = { version = "1.0.162", features = ["derive"], optional = true } serde_json = { version = "1.0.96", optional = true } # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 0d7e8016..eca26022 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -17,7 +17,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.5" miette = "5.8.0" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.160", features = ["derive"] } +serde = { version = "1.0.162", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.96" thiserror = "1.0.40" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index fb1cb53a..2c4f98d0 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -14,7 +14,7 @@ compact_str = { version = "0.7.0", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.17.1" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.160", features = ["derive"] } +serde = { version = "1.0.162", features = ["derive"] } strum = "0.24.1" strum_macros = "0.24.3" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 10a83ee5..e5cead23 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -28,7 +28,7 @@ miette = "5.8.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.17.1" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.160", features = ["derive"] } +serde = { version = "1.0.162", features = ["derive"] } strum = "0.24.1" tempfile = "3.5.0" thiserror = "1.0.40" From 9867b6f7be74306db97e02045c02a7c0018a6a14 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 15:00:01 +1000 Subject: [PATCH 1234/2020] Bump linux-raw-sys from 0.3.4 to 0.3.7 (#1033) Bumps [linux-raw-sys](https://github.com/sunfishcode/linux-raw-sys) from 0.3.4 to 0.3.7. - [Commits](https://github.com/sunfishcode/linux-raw-sys/compare/v0.3.4...v0.3.7) --- updated-dependencies: - dependency-name: linux-raw-sys dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aa8a2479..05ed48ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1254,9 +1254,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.3.4" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36eb31c1778188ae1e64398743890d0877fef36d11521ac60406b42016e8c2cf" +checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f" [[package]] name = "lock_api" From 46fb0c08a8e66655d0a4a0dc4fe3f40379ada264 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 15:02:08 +1000 Subject: [PATCH 1235/2020] Bump libc from 0.2.142 to 0.2.143 (#1035) Bumps [libc](https://github.com/rust-lang/libc) from 0.2.142 to 0.2.143. - [Release notes](https://github.com/rust-lang/libc/releases) - [Commits](https://github.com/rust-lang/libc/compare/0.2.142...0.2.143) --- updated-dependencies: - dependency-name: libc dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 05ed48ee..eadae07d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1222,9 +1222,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.142" +version = "0.2.143" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" +checksum = "edc207893e85c5d6be840e969b496b53d94cec8be2d501b214f50daa97fa8024" [[package]] name = "libmimalloc-sys" From ff1625161e4780b42f81eb088a88a154e9e12384 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 8 May 2023 15:09:22 +1000 Subject: [PATCH 1236/2020] Bump rustix from 0.37.15 to 0.37.19 (#1034) Bumps [rustix](https://github.com/bytecodealliance/rustix) from 0.37.15 to 0.37.19. - [Release notes](https://github.com/bytecodealliance/rustix/releases) - [Commits](https://github.com/bytecodealliance/rustix/compare/v0.37.15...v0.37.19) --- updated-dependencies: - dependency-name: rustix dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eadae07d..9b5323d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1846,9 +1846,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.15" +version = "0.37.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0661814f891c57c930a610266415528da53c4933e6dea5fb350cbfe048a9ece" +checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" dependencies = [ "bitflags", "errno 0.3.1", From c2e0ae02a8be01f169f846134460fd37ca057080 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 May 2023 19:15:42 +1000 Subject: [PATCH 1237/2020] Bump quote from 1.0.26 to 1.0.27 (#1037) Bumps [quote](https://github.com/dtolnay/quote) from 1.0.26 to 1.0.27. - [Release notes](https://github.com/dtolnay/quote/releases) - [Commits](https://github.com/dtolnay/quote/compare/1.0.26...1.0.27) --- updated-dependencies: - dependency-name: quote dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/leon-macros/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9b5323d1..b7ce989c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1675,9 +1675,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" dependencies = [ "proc-macro2", ] diff --git a/crates/leon-macros/Cargo.toml b/crates/leon-macros/Cargo.toml index 89f6de86..0caee6c6 100644 --- a/crates/leon-macros/Cargo.toml +++ b/crates/leon-macros/Cargo.toml @@ -16,4 +16,4 @@ proc-macro = true leon = { version = "2.0.0", path = "../leon", default-features = false } proc-macro2 = "1.0.56" syn = { version = "2.0.15", default-features = false, features = ["proc-macro", "parsing"] } -quote = "1.0.26" +quote = "1.0.27" From c4d0f3885d43860f9aadc16e55c1b05d908f0041 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 9 May 2023 19:16:28 +1000 Subject: [PATCH 1238/2020] Bump libc from 0.2.143 to 0.2.144 (#1036) Bumps [libc](https://github.com/rust-lang/libc) from 0.2.143 to 0.2.144. - [Release notes](https://github.com/rust-lang/libc/releases) - [Commits](https://github.com/rust-lang/libc/compare/0.2.143...0.2.144) --- updated-dependencies: - dependency-name: libc dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b7ce989c..38b27319 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1222,9 +1222,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.143" +version = "0.2.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edc207893e85c5d6be840e969b496b53d94cec8be2d501b214f50daa97fa8024" +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" [[package]] name = "libmimalloc-sys" From 645ede257c2d5d84952e37fa3ee999946a486724 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 May 2023 14:10:33 +1000 Subject: [PATCH 1239/2020] Bump wasm-bindgen from 0.2.84 to 0.2.85 (#1041) Bumps [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen) from 0.2.84 to 0.2.85. - [Release notes](https://github.com/rustwasm/wasm-bindgen/releases) - [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustwasm/wasm-bindgen/compare/0.2.84...0.2.85) --- updated-dependencies: - dependency-name: wasm-bindgen dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 38b27319..bcf6f5ea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2678,9 +2678,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.84" +version = "0.2.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +checksum = "5b6cb788c4e39112fbe1822277ef6fb3c55cd86b95cb3d3c4c1c9597e4ac74b4" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2688,16 +2688,16 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.84" +version = "0.2.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +checksum = "35e522ed4105a9d626d885b35d62501b30d9666283a5c8be12c14a8bdafe7822" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.15", "wasm-bindgen-shared", ] @@ -2715,9 +2715,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.84" +version = "0.2.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +checksum = "358a79a0cb89d21db8120cbfb91392335913e4890665b1a7981d9e956903b434" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2725,22 +2725,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.84" +version = "0.2.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +checksum = "4783ce29f09b9d93134d41297aded3a712b7b979e9c6f28c32cb88c973a94869" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.15", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.84" +version = "0.2.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" +checksum = "a901d592cafaa4d711bc324edfaff879ac700b19c3dfd60058d2b445be2691eb" [[package]] name = "wasm-streams" From ada76f63190c059b1af321b70c2ef6511a6ddb3c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 May 2023 14:11:11 +1000 Subject: [PATCH 1240/2020] Bump bumpalo from 3.12.1 to 3.12.2 (#1040) Bumps [bumpalo](https://github.com/fitzgen/bumpalo) from 3.12.1 to 3.12.2. - [Changelog](https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md) - [Commits](https://github.com/fitzgen/bumpalo/compare/3.12.1...3.12.2) --- updated-dependencies: - dependency-name: bumpalo dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bcf6f5ea..8f618de6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -349,9 +349,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.1" +version = "3.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b1ce199063694f33ffb7dd4e0ee620741495c32833cde5aa08f02a0bf96f0c8" +checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b" [[package]] name = "byteorder" From 164f2e5bde3ee0c36ae2514e3f01cc986cc18618 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 May 2023 14:11:59 +1000 Subject: [PATCH 1241/2020] Bump js-sys from 0.3.61 to 0.3.62 (#1039) Bumps [js-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.61 to 0.3.62. - [Release notes](https://github.com/rustwasm/wasm-bindgen/releases) - [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustwasm/wasm-bindgen/commits) --- updated-dependencies: - dependency-name: js-sys dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8f618de6..bb9038f6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1188,9 +1188,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.61" +version = "0.3.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +checksum = "68c16e1bfd491478ab155fd8b4896b86f9ede344949b641e61501e07c2b8b4d5" dependencies = [ "wasm-bindgen", ] From 62c59beca6cdff80ea83859af147157f4cf33915 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 May 2023 13:37:55 +1000 Subject: [PATCH 1242/2020] Bump tokio from 1.28.0 to 1.28.1 (#1042) Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.28.0 to 1.28.1. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.28.0...tokio-1.28.1) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bb9038f6..fc1fb7ac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2260,9 +2260,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.28.0" +version = "1.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f" +checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" dependencies = [ "autocfg", "bytes", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 07051833..ab36cf60 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -39,7 +39,7 @@ strum = "0.24.1" strum_macros = "0.24.3" supports-color = "2.0.0" tempfile = "3.5.0" -tokio = { version = "1.28.0", features = ["rt-multi-thread"], default-features = false } +tokio = { version = "1.28.1", features = ["rt-multi-thread"], default-features = false } tracing-core = "0.1.30" tracing = { version = "0.1.38", default-features = false } tracing-log = { version = "0.1.3", default-features = false } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index ed7128b5..c23bef75 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -33,7 +33,7 @@ serde_json = { version = "1.0.96", optional = true } tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.5.0" thiserror = "1.0.40" -tokio = { version = "1.28.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } +tokio = { version = "1.28.1", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.8", features = ["io"] } tower = { version = "0.4.13", features = ["limit", "util"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index e5cead23..f7c0d565 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -33,7 +33,7 @@ strum = "0.24.1" tempfile = "3.5.0" thiserror = "1.0.40" # parking_lot for `tokio::sync::OnceCell::const_new` -tokio = { version = "1.28.0", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } +tokio = { version = "1.28.1", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } tracing = "0.1.38" url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 5808e4fd..95e625c4 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -10,9 +10,9 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -tokio = { version = "1.28.0", features = ["rt", "process", "sync"], default-features = false } +tokio = { version = "1.28.1", features = ["rt", "process", "sync"], default-features = false } cfg-if = "1.0.0" guess_host_triple = "0.1.3" [dev-dependencies] -tokio = { version = "1.28.0", features = ["macros"], default-features = false } +tokio = { version = "1.28.1", features = ["macros"], default-features = false } From 10af9394c40e6505fafd59a81643291de81896ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 May 2023 13:39:17 +1000 Subject: [PATCH 1243/2020] Bump async-compression from 0.3.15 to 0.4.0 (#1043) Bumps [async-compression](https://github.com/Nullus157/async-compression) from 0.3.15 to 0.4.0. - [Release notes](https://github.com/Nullus157/async-compression/releases) - [Changelog](https://github.com/Nullus157/async-compression/blob/main/CHANGELOG.md) - [Commits](https://github.com/Nullus157/async-compression/compare/0.3.15...async-compression-v0.4.0) --- updated-dependencies: - dependency-name: async-compression dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 23 ++++++++++++++++++++--- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fc1fb7ac..49409cdb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -120,6 +120,23 @@ dependencies = [ "zstd-safe 5.0.2+zstd.1.5.2", ] +[[package]] +name = "async-compression" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0122885821398cc923ece939e24d1056a2384ee719432397fa9db87230ff11" +dependencies = [ + "bzip2", + "flate2", + "futures-core", + "memchr", + "pin-project-lite", + "tokio", + "xz2", + "zstd 0.12.3+zstd.1.5.2", + "zstd-safe 6.0.5+zstd.1.5.4", +] + [[package]] name = "async-trait" version = "0.1.68" @@ -137,7 +154,7 @@ version = "0.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "795310de3218cde15219fc98c1cf7d8fe9db4865aab27fcf1d535d6cb61c6b54" dependencies = [ - "async-compression", + "async-compression 0.3.15", "crc32fast", "futures-util", "log", @@ -235,7 +252,7 @@ dependencies = [ name = "binstalk-downloader" version = "0.5.0" dependencies = [ - "async-compression", + "async-compression 0.4.0", "async-trait", "async_zip", "binstalk-types", @@ -1764,7 +1781,7 @@ version = "0.11.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" dependencies = [ - "async-compression", + "async-compression 0.3.15", "base64 0.21.0", "bytes", "encoding_rs", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index c23bef75..5c7ad6f6 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.68" -async-compression = { version = "0.3.15", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } +async-compression = { version = "0.4.0", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.15", features = ["deflate", "bzip2", "lzma", "zstd", "xz", "tokio"] } binstalk-types = { version = "0.4.0", path = "../binstalk-types" } bytes = "1.4.0" From 3650510b076b29d286d71edb53b4e7abb7475dce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 May 2023 03:46:01 +0000 Subject: [PATCH 1244/2020] Bump wasm-bindgen-futures from 0.4.34 to 0.4.35 (#1044) --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 49409cdb..2d7083a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2720,9 +2720,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.34" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" +checksum = "083abe15c5d88556b77bdf7aef403625be9e327ad37c62c4e4129af740168163" dependencies = [ "cfg-if", "js-sys", From 0f5b9f1df0a8a425c7b8231dd42c05f275ac2751 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 11 May 2023 03:59:40 +0000 Subject: [PATCH 1245/2020] Bump web-sys from 0.3.61 to 0.3.62 (#1045) --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2d7083a6..d64220bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2774,9 +2774,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.61" +version = "0.3.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" +checksum = "16b5f940c7edfdc6d12126d98c9ef4d1b3d470011c47c76a6581df47ad9ba721" dependencies = [ "js-sys", "wasm-bindgen", From 9a26c187632c7a431c1c24670c0fb407e07d0665 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Fri, 12 May 2023 15:52:34 +1200 Subject: [PATCH 1246/2020] Enable merge queue (#1047) --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b040c73a..9ca7b302 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,7 @@ name: CI on: workflow_dispatch: + merge_group: pull_request: types: - opened From aa19ea453a11c89938a424431a4858846ddf198b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 May 2023 13:54:37 +1000 Subject: [PATCH 1247/2020] Bump tracing-core from 0.1.30 to 0.1.31 (#1049) Bumps [tracing-core](https://github.com/tokio-rs/tracing) from 0.1.30 to 0.1.31. - [Release notes](https://github.com/tokio-rs/tracing/releases) - [Commits](https://github.com/tokio-rs/tracing/compare/tracing-core-0.1.30...tracing-core-0.1.31) --- updated-dependencies: - dependency-name: tracing-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d64220bd..cec3cb3c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2455,9 +2455,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" dependencies = [ "once_cell", "valuable", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index ab36cf60..af9f17c3 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -40,7 +40,7 @@ strum_macros = "0.24.3" supports-color = "2.0.0" tempfile = "3.5.0" tokio = { version = "1.28.1", features = ["rt-multi-thread"], default-features = false } -tracing-core = "0.1.30" +tracing-core = "0.1.31" tracing = { version = "0.1.38", default-features = false } tracing-log = { version = "0.1.3", default-features = false } tracing-subscriber = { version = "0.3.17", features = ["fmt", "json", "ansi"], default-features = false } From 9a7445a88f55d851b33afaac9c3b299f54dbb745 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 May 2023 13:55:08 +1000 Subject: [PATCH 1248/2020] Bump serde from 1.0.162 to 1.0.163 (#1048) Bumps [serde](https://github.com/serde-rs/serde) from 1.0.162 to 1.0.163. - [Release notes](https://github.com/serde-rs/serde/releases) - [Commits](https://github.com/serde-rs/serde/compare/v1.0.162...v1.0.163) --- updated-dependencies: - dependency-name: serde dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cec3cb3c..32bfa947 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1988,9 +1988,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.162" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71b2f6e1ab5c2b98c05f0f35b236b22e8df7ead6ffbf51d7808da7f8817e7ab6" +checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" dependencies = [ "serde_derive", ] @@ -2006,9 +2006,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.162" +version = "1.0.163" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a0814352fd64b58489904a44ea8d90cb1a91dcb6b4f5ebabc32c8318e93cb6" +checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 5c7ad6f6..ee34b2bb 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -24,7 +24,7 @@ futures-util = "0.3.28" generic-array = "0.14.7" httpdate = "1.0.2" reqwest = { version = "0.11.17", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } -serde = { version = "1.0.162", features = ["derive"], optional = true } +serde = { version = "1.0.163", features = ["derive"], optional = true } serde_json = { version = "1.0.96", optional = true } # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index eca26022..04a81ebc 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -17,7 +17,7 @@ fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.5" miette = "5.8.0" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.162", features = ["derive"] } +serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.96" thiserror = "1.0.40" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 2c4f98d0..2af8511c 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -14,7 +14,7 @@ compact_str = { version = "0.7.0", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.17.1" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.162", features = ["derive"] } +serde = { version = "1.0.163", features = ["derive"] } strum = "0.24.1" strum_macros = "0.24.3" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index f7c0d565..34c6b9f9 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -28,7 +28,7 @@ miette = "5.8.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.17.1" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.162", features = ["derive"] } +serde = { version = "1.0.163", features = ["derive"] } strum = "0.24.1" tempfile = "3.5.0" thiserror = "1.0.40" From 9103a661f1cbdbf1e6dafbe390f0d45b8b39081f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 14 May 2023 20:26:48 +1000 Subject: [PATCH 1249/2020] Simplify `profile` overrides in `Cargo.toml` using `inherits` (#1051) Signed-off-by: Jiahao XU --- Cargo.toml | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e9cfe47a..677752a3 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,18 +20,20 @@ codegen-units = 1 panic = "abort" strip = "symbols" -[profile.dev.build-override] +[profile.dev] opt-level = 0 +debug = true +lto = false +debug-assertions = true +overflow-checks = true codegen-units = 1024 + +[profile.dev.build-override] +inherits = "dev" debug = false debug-assertions = false overflow-checks = false incremental = false [profile.release.build-override] -opt-level = 0 -codegen-units = 1024 -debug = false -debug-assertions = false -overflow-checks = false -incremental = false +inherits = "dev.build-override" From cedcd551c2a8c4c04b5970f91fcdb7111a7c7cfb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 May 2023 13:26:52 +1000 Subject: [PATCH 1250/2020] Bump gh-token from 0.1.1 to 0.1.2 (#1056) Bumps [gh-token](https://github.com/dtolnay/star-history) from 0.1.1 to 0.1.2. - [Release notes](https://github.com/dtolnay/star-history/releases) - [Commits](https://github.com/dtolnay/star-history/compare/0.1.1...0.1.2) --- updated-dependencies: - dependency-name: gh-token dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 32bfa947..5a025b7b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -897,9 +897,9 @@ dependencies = [ [[package]] name = "gh-token" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f7f3953b155f5df52140de17556ed1464c9d3c9092e2dc0adf2b55211fd10d" +checksum = "cf1ff8db6b58b68c39ec14a0922cad141fee0e350324eb01ee45e3898f780d46" dependencies = [ "home", "serde", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index af9f17c3..107288d8 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -29,7 +29,7 @@ compact_str = "0.7.0" dirs = "5.0.1" file-format = { version = "0.16.0", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } -gh-token = "0.1.1" +gh-token = "0.1.2" log = { version = "0.4.17", features = ["std"] } miette = "5.8.0" mimalloc = { version = "0.1.37", default-features = false, optional = true } From 5115d2a19d560d5e7a63d0e6d6b6c57f8b7c6a1f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 May 2023 13:27:18 +1000 Subject: [PATCH 1251/2020] Bump pin-project from 1.0.12 to 1.1.0 (#1055) Bumps [pin-project](https://github.com/taiki-e/pin-project) from 1.0.12 to 1.1.0. - [Release notes](https://github.com/taiki-e/pin-project/releases) - [Changelog](https://github.com/taiki-e/pin-project/blob/main/CHANGELOG.md) - [Commits](https://github.com/taiki-e/pin-project/compare/v1.0.12...v1.1.0) --- updated-dependencies: - dependency-name: pin-project dependency-type: indirect update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a025b7b..8ca9e767 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1580,22 +1580,22 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" [[package]] name = "pin-project" -version = "1.0.12" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.0.12" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.15", ] [[package]] From a8abd934860a7260e93d4e6eeddddb0ac162f920 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 May 2023 13:28:49 +1000 Subject: [PATCH 1252/2020] Bump security-framework-sys from 2.8.0 to 2.9.0 (#1052) Bumps [security-framework-sys](https://github.com/kornelski/rust-security-framework) from 2.8.0 to 2.9.0. - [Release notes](https://github.com/kornelski/rust-security-framework/releases) - [Commits](https://github.com/kornelski/rust-security-framework/compare/v2.8.0...v2.9.0) --- updated-dependencies: - dependency-name: security-framework-sys dependency-type: indirect update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8ca9e767..0dc071fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1969,9 +1969,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c9bb296072e961fcbd8853511dd39c2d8be2deb1e17c6860b1d30732b323b4" +checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" dependencies = [ "core-foundation-sys", "libc", From 74681da01ed0eb1800230272087b2b70c0972e34 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 May 2023 04:08:19 +0000 Subject: [PATCH 1253/2020] Bump syn from 2.0.15 to 2.0.16 (#1054) Bumps [syn](https://github.com/dtolnay/syn) from 2.0.15 to 2.0.16. - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.15...2.0.16) --- updated-dependencies: - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 30 +++++++++++++++--------------- crates/leon-macros/Cargo.toml | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0dc071fa..1711a9ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -145,7 +145,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -499,7 +499,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -833,7 +833,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -1234,7 +1234,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -1370,7 +1370,7 @@ checksum = "4c65c625186a9bcce6699394bee511e1b1aec689aa7e3be1bf4e996e75834153" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -1510,7 +1510,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -1595,7 +1595,7 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -2012,7 +2012,7 @@ checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -2187,9 +2187,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.15" +version = "2.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" +checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01" dependencies = [ "proc-macro2", "quote", @@ -2247,7 +2247,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -2302,7 +2302,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -2450,7 +2450,7 @@ checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", ] [[package]] @@ -2714,7 +2714,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", "wasm-bindgen-shared", ] @@ -2748,7 +2748,7 @@ checksum = "4783ce29f09b9d93134d41297aded3a712b7b979e9c6f28c32cb88c973a94869" dependencies = [ "proc-macro2", "quote", - "syn 2.0.15", + "syn 2.0.16", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/crates/leon-macros/Cargo.toml b/crates/leon-macros/Cargo.toml index 0caee6c6..ccc55b48 100644 --- a/crates/leon-macros/Cargo.toml +++ b/crates/leon-macros/Cargo.toml @@ -15,5 +15,5 @@ proc-macro = true [dependencies] leon = { version = "2.0.0", path = "../leon", default-features = false } proc-macro2 = "1.0.56" -syn = { version = "2.0.15", default-features = false, features = ["proc-macro", "parsing"] } +syn = { version = "2.0.16", default-features = false, features = ["proc-macro", "parsing"] } quote = "1.0.27" From b16d78d67e825ab256b677ae922d75deb0187087 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 15 May 2023 14:59:09 +1000 Subject: [PATCH 1254/2020] Bump h2 from 0.3.18 to 0.3.19 (#1053) Bumps [h2](https://github.com/hyperium/h2) from 0.3.18 to 0.3.19. - [Release notes](https://github.com/hyperium/h2/releases) - [Changelog](https://github.com/hyperium/h2/blob/master/CHANGELOG.md) - [Commits](https://github.com/hyperium/h2/compare/v0.3.18...v0.3.19) --- updated-dependencies: - dependency-name: h2 dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1711a9ff..8c29df43 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -927,9 +927,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f8a914c2987b688368b5138aa05321db91f4090cf26118185672ad588bce21" +checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" dependencies = [ "bytes", "fnv", From ca25f3875cdac52c02f9b055bbad00df5c845f6e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 12:20:22 +1000 Subject: [PATCH 1255/2020] Bump wasm-bindgen from 0.2.85 to 0.2.86 (#1058) Bumps [wasm-bindgen](https://github.com/rustwasm/wasm-bindgen) from 0.2.85 to 0.2.86. - [Release notes](https://github.com/rustwasm/wasm-bindgen/releases) - [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustwasm/wasm-bindgen/compare/0.2.85...0.2.86) --- updated-dependencies: - dependency-name: wasm-bindgen dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8c29df43..5623988d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2695,9 +2695,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b6cb788c4e39112fbe1822277ef6fb3c55cd86b95cb3d3c4c1c9597e4ac74b4" +checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2705,9 +2705,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e522ed4105a9d626d885b35d62501b30d9666283a5c8be12c14a8bdafe7822" +checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" dependencies = [ "bumpalo", "log", @@ -2732,9 +2732,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "358a79a0cb89d21db8120cbfb91392335913e4890665b1a7981d9e956903b434" +checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2742,9 +2742,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4783ce29f09b9d93134d41297aded3a712b7b979e9c6f28c32cb88c973a94869" +checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", @@ -2755,9 +2755,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.85" +version = "0.2.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a901d592cafaa4d711bc324edfaff879ac700b19c3dfd60058d2b445be2691eb" +checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" [[package]] name = "wasm-streams" From 3e0b0a9760f8ed5d6b33a002c448552a179eb7a0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 12:22:24 +1000 Subject: [PATCH 1256/2020] Bump js-sys from 0.3.62 to 0.3.63 (#1060) Bumps [js-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.62 to 0.3.63. - [Release notes](https://github.com/rustwasm/wasm-bindgen/releases) - [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustwasm/wasm-bindgen/commits) --- updated-dependencies: - dependency-name: js-sys dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5623988d..38ceb7da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1205,9 +1205,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.62" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68c16e1bfd491478ab155fd8b4896b86f9ede344949b641e61501e07c2b8b4d5" +checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" dependencies = [ "wasm-bindgen", ] From ec59445a98f0839cffbf49f594754474c8149b76 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 12:24:10 +1000 Subject: [PATCH 1257/2020] Bump security-framework from 2.8.2 to 2.9.0 (#1059) Bumps [security-framework](https://github.com/kornelski/rust-security-framework) from 2.8.2 to 2.9.0. - [Release notes](https://github.com/kornelski/rust-security-framework/releases) - [Commits](https://github.com/kornelski/rust-security-framework/compare/v2.8.2...v2.9.0) --- updated-dependencies: - dependency-name: security-framework dependency-type: indirect update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 38ceb7da..c58803a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1956,9 +1956,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.8.2" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a332be01508d814fed64bf28f798a146d73792121129962fdf335bb3c49a4254" +checksum = "ca2855b3715770894e67cbfa3df957790aa0c9edc3bf06efa1a84d77fa0839d1" dependencies = [ "bitflags", "core-foundation", From 249e4c46343e46fdcc17e67ac091547b65c046a5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 16 May 2023 03:01:54 +0000 Subject: [PATCH 1258/2020] Bump proc-macro2 from 1.0.56 to 1.0.57 (#1061) Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.56 to 1.0.57. - [Release notes](https://github.com/dtolnay/proc-macro2/releases) - [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.56...1.0.57) --- updated-dependencies: - dependency-name: proc-macro2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/leon-macros/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c58803a0..2872fdc7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1624,9 +1624,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" +checksum = "c4ec6d5fe0b140acb27c9a0444118cf55bfbb4e0b259739429abb4521dd67c16" dependencies = [ "unicode-ident", ] diff --git a/crates/leon-macros/Cargo.toml b/crates/leon-macros/Cargo.toml index ccc55b48..44d224b9 100644 --- a/crates/leon-macros/Cargo.toml +++ b/crates/leon-macros/Cargo.toml @@ -14,6 +14,6 @@ proc-macro = true [dependencies] leon = { version = "2.0.0", path = "../leon", default-features = false } -proc-macro2 = "1.0.56" +proc-macro2 = "1.0.57" syn = { version = "2.0.16", default-features = false, features = ["proc-macro", "parsing"] } quote = "1.0.27" From 71d864b4ccd6b95612853187333e68583a18ddaf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 May 2023 12:39:10 +1000 Subject: [PATCH 1259/2020] Bump reqwest from 0.11.17 to 0.11.18 (#1062) Bumps [reqwest](https://github.com/seanmonstar/reqwest) from 0.11.17 to 0.11.18. - [Release notes](https://github.com/seanmonstar/reqwest/releases) - [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md) - [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.17...v0.11.18) --- updated-dependencies: - dependency-name: reqwest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 67 ++++++++++++++++++++------- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 50 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2872fdc7..0759ef2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -107,14 +107,12 @@ version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" dependencies = [ - "brotli", "bzip2", "flate2", "futures-core", "futures-io", "memchr", "pin-project-lite", - "tokio", "xz2", "zstd 0.11.2+zstd.1.5.2", "zstd-safe 5.0.2+zstd.1.5.2", @@ -126,6 +124,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b0122885821398cc923ece939e24d1056a2384ee719432397fa9db87230ff11" dependencies = [ + "brotli", "bzip2", "flate2", "futures-core", @@ -1054,15 +1053,15 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.23.2" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1788965e61b367cd03a62950836d5cd41560c3577d90e40e0819373194d1661c" +checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" dependencies = [ "http", "hyper", - "rustls", + "rustls 0.21.1", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.0", ] [[package]] @@ -1649,7 +1648,7 @@ dependencies = [ "fxhash", "quinn-proto", "quinn-udp", - "rustls", + "rustls 0.20.8", "thiserror", "tokio", "tracing", @@ -1666,7 +1665,7 @@ dependencies = [ "fxhash", "rand", "ring", - "rustls", + "rustls 0.20.8", "rustls-native-certs", "rustls-pemfile 0.2.1", "slab", @@ -1777,11 +1776,11 @@ checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" [[package]] name = "reqwest" -version = "0.11.17" +version = "0.11.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13293b639a097af28fc8a90f22add145a9c954e49d77da06263d58cf44d5fb91" +checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" dependencies = [ - "async-compression 0.3.15", + "async-compression 0.4.0", "base64 0.21.0", "bytes", "encoding_rs", @@ -1801,14 +1800,14 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls", + "rustls 0.21.1", "rustls-pemfile 1.0.2", "serde", "serde_json", "serde_urlencoded", "tokio", "tokio-native-tls", - "tokio-rustls", + "tokio-rustls 0.24.0", "tokio-util", "tower-service", "trust-dns-resolver", @@ -1887,6 +1886,18 @@ dependencies = [ "webpki", ] +[[package]] +name = "rustls" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c911ba11bc8433e811ce56fde130ccf32f5127cab0e0194e9c68c5a5b671791e" +dependencies = [ + "log", + "ring", + "rustls-webpki", + "sct", +] + [[package]] name = "rustls-native-certs" version = "0.6.2" @@ -1917,6 +1928,16 @@ dependencies = [ "base64 0.21.0", ] +[[package]] +name = "rustls-webpki" +version = "0.100.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +dependencies = [ + "ring", + "untrusted", +] + [[package]] name = "rustversion" version = "1.0.12" @@ -2321,11 +2342,21 @@ version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls", + "rustls 0.20.8", "tokio", "webpki", ] +[[package]] +name = "tokio-rustls" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0d409377ff5b1e3ca6437aa86c1eb7d40c134bfec254e44c830defa92669db5" +dependencies = [ + "rustls 0.21.1", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.14" @@ -2522,14 +2553,14 @@ dependencies = [ "quinn", "rand", "ring", - "rustls", + "rustls 0.20.8", "rustls-pemfile 1.0.2", "smallvec", "thiserror", "tinyvec", "tokio", "tokio-native-tls", - "tokio-rustls", + "tokio-rustls 0.23.4", "tracing", "url", "webpki", @@ -2549,12 +2580,12 @@ dependencies = [ "lru-cache", "parking_lot", "resolv-conf", - "rustls", + "rustls 0.20.8", "smallvec", "thiserror", "tokio", "tokio-native-tls", - "tokio-rustls", + "tokio-rustls 0.23.4", "tracing", "trust-dns-proto", "webpki-roots", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index ee34b2bb..204bca82 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -23,7 +23,7 @@ futures-lite = { version = "1.13.0", default-features = false } futures-util = "0.3.28" generic-array = "0.14.7" httpdate = "1.0.2" -reqwest = { version = "0.11.17", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } +reqwest = { version = "0.11.18", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } serde = { version = "1.0.163", features = ["derive"], optional = true } serde_json = { version = "1.0.96", optional = true } # Use a fork here since we need PAX support, but the upstream From 08814a113ec0a125d582ab7fb9d85bfb9c2c7831 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 May 2023 02:39:53 +0000 Subject: [PATCH 1260/2020] Bump wasm-bindgen-futures from 0.4.35 to 0.4.36 (#1063) Bumps [wasm-bindgen-futures](https://github.com/rustwasm/wasm-bindgen) from 0.4.35 to 0.4.36. - [Release notes](https://github.com/rustwasm/wasm-bindgen/releases) - [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustwasm/wasm-bindgen/commits) --- updated-dependencies: - dependency-name: wasm-bindgen-futures dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0759ef2c..ad535843 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2751,9 +2751,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.35" +version = "0.4.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "083abe15c5d88556b77bdf7aef403625be9e327ad37c62c4e4129af740168163" +checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e" dependencies = [ "cfg-if", "js-sys", From eb4984d2718d5422af80a246eb82d2fa3f2ab814 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 May 2023 13:05:10 +1000 Subject: [PATCH 1261/2020] Bump web-sys from 0.3.62 to 0.3.63 (#1064) Bumps [web-sys](https://github.com/rustwasm/wasm-bindgen) from 0.3.62 to 0.3.63. - [Release notes](https://github.com/rustwasm/wasm-bindgen/releases) - [Changelog](https://github.com/rustwasm/wasm-bindgen/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustwasm/wasm-bindgen/commits) --- updated-dependencies: - dependency-name: web-sys dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ad535843..ed4a87cc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2805,9 +2805,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.62" +version = "0.3.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b5f940c7edfdc6d12126d98c9ef4d1b3d470011c47c76a6581df47ad9ba721" +checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" dependencies = [ "js-sys", "wasm-bindgen", From b101d38134d4341fff7cdeb8f0e0bfca50e42adf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 18 May 2023 12:19:24 +1000 Subject: [PATCH 1262/2020] Bump proc-macro2 from 1.0.57 to 1.0.58 (#1065) Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.57 to 1.0.58. - [Release notes](https://github.com/dtolnay/proc-macro2/releases) - [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.57...1.0.58) --- updated-dependencies: - dependency-name: proc-macro2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/leon-macros/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ed4a87cc..b516f638 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1623,9 +1623,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4ec6d5fe0b140acb27c9a0444118cf55bfbb4e0b259739429abb4521dd67c16" +checksum = "fa1fb82fc0c281dd9671101b66b771ebbe1eaf967b96ac8740dcba4b70005ca8" dependencies = [ "unicode-ident", ] diff --git a/crates/leon-macros/Cargo.toml b/crates/leon-macros/Cargo.toml index 44d224b9..bdd50324 100644 --- a/crates/leon-macros/Cargo.toml +++ b/crates/leon-macros/Cargo.toml @@ -14,6 +14,6 @@ proc-macro = true [dependencies] leon = { version = "2.0.0", path = "../leon", default-features = false } -proc-macro2 = "1.0.57" +proc-macro2 = "1.0.58" syn = { version = "2.0.16", default-features = false, features = ["proc-macro", "parsing"] } quote = "1.0.27" From 2667ccf6d9805737659c8fb3697c5b569061bd51 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 May 2023 12:44:16 +1000 Subject: [PATCH 1263/2020] Bump toml_edit from 0.19.8 to 0.19.9 (#1068) Bumps [toml_edit](https://github.com/toml-rs/toml) from 0.19.8 to 0.19.9. - [Commits](https://github.com/toml-rs/toml/compare/v0.19.8...v0.19.9) --- updated-dependencies: - dependency-name: toml_edit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 12 ++++++------ crates/binstalk-manifests/Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b516f638..fd566729 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2049,9 +2049,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0efd8caf556a6cebd3b285caf480045fcc1ac04f6bd786b09a6f11af30c4fcf4" +checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" dependencies = [ "serde", ] @@ -2412,18 +2412,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab8ed2edee10b50132aed5f331333428b011c99402b5a534154ed15746f9622" +checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.8" +version = "0.19.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239410c8609e8125456927e6707163a3b1fdb40561e4b803bc041f466ccfdc13" +checksum = "92d964908cec0d030b812013af25a0e57fddfadb1e066ecc6681d86253129d4f" dependencies = [ "indexmap", "serde", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 04a81ebc..218457dc 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.96" thiserror = "1.0.40" -toml_edit = { version = "0.19.8", features = ["serde"] } +toml_edit = { version = "0.19.9", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] From f2ac44757ab479dd35932e6383d201028d281f20 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 May 2023 02:45:22 +0000 Subject: [PATCH 1264/2020] Bump miette from 5.8.0 to 5.9.0 (#1071) Bumps [miette](https://github.com/zkat/miette) from 5.8.0 to 5.9.0. - [Release notes](https://github.com/zkat/miette/releases) - [Changelog](https://github.com/zkat/miette/blob/main/CHANGELOG.md) - [Commits](https://github.com/zkat/miette/compare/miette-derive-v5.8.0...miette-derive-v5.9.0) --- updated-dependencies: - dependency-name: miette dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fd566729..da030d2c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1342,9 +1342,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "miette" -version = "5.8.0" +version = "5.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92a992891d5579caa9efd8e601f82e30a1caa79a27a5db075dde30ecb9eab357" +checksum = "a236ff270093b0b67451bc50a509bd1bad302cb1d3c7d37d5efe931238581fa9" dependencies = [ "backtrace", "backtrace-ext", @@ -1363,9 +1363,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.8.0" +version = "5.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c65c625186a9bcce6699394bee511e1b1aec689aa7e3be1bf4e996e75834153" +checksum = "4901771e1d44ddb37964565c654a3223ba41a594d02b8da471cc4464912b5cfa" dependencies = [ "proc-macro2", "quote", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 107288d8..bebfe8ef 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -31,7 +31,7 @@ file-format = { version = "0.16.0", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } gh-token = "0.1.2" log = { version = "0.4.17", features = ["std"] } -miette = "5.8.0" +miette = "5.9.0" mimalloc = { version = "0.1.37", default-features = false, optional = true } once_cell = "1.17.1" semver = "1.0.17" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 218457dc..0632db8a 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -15,7 +15,7 @@ binstalk-types = { version = "0.4.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.5" -miette = "5.8.0" +miette = "5.9.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 34c6b9f9..654a35da 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -24,7 +24,7 @@ jobslot = { version = "0.2.11", features = ["tokio"] } leon = { version = "2.0.0", path = "../leon" } leon-macros = { version = "1.0.0", path = "../leon-macros" } maybe-owned = "0.3.4" -miette = "5.8.0" +miette = "5.9.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.17.1" semver = { version = "1.0.17", features = ["serde"] } diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 49d338cf..2a6ceb10 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -12,7 +12,7 @@ exclude = ["fuzz", "benches"] [dependencies] clap = { version = "4.2.7", features = ["derive"], optional = true } -miette = { version = "5.8.0", default-features = false, optional = true } +miette = { version = "5.9.0", default-features = false, optional = true } thiserror = "1.0.38" [features] From 6e752c8201d16c1e75dfe73bd67cea6e339c165b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 19 May 2023 02:45:50 +0000 Subject: [PATCH 1265/2020] Bump security-framework from 2.9.0 to 2.9.1 (#1067) Bumps [security-framework](https://github.com/kornelski/rust-security-framework) from 2.9.0 to 2.9.1. - [Release notes](https://github.com/kornelski/rust-security-framework/releases) - [Commits](https://github.com/kornelski/rust-security-framework/compare/v2.9.0...v2.9.1) --- updated-dependencies: - dependency-name: security-framework dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index da030d2c..fc625334 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1977,9 +1977,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2855b3715770894e67cbfa3df957790aa0c9edc3bf06efa1a84d77fa0839d1" +checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" dependencies = [ "bitflags", "core-foundation", From 1c3f5ff5e276f02af3140bc99514c41da0f51b8f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 19 May 2023 13:07:58 +1000 Subject: [PATCH 1266/2020] Switch binstalk-downloader license to "Apache-2.0 OR MIT" (#542) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Switch binstalk-downloader license to Apache-2.0 OR MIT Signed-off-by: ryan kurte ryan+gh@kurte.nz Signed-off-by: Jiahao XU Signed-off-by: Félix Saparelli Signed-off-by: Ryo Yamashita Signed-off-by: ryan kurte ryan+gh@kurte.nz --- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-downloader/LICENSE-APACHE | 176 ++++++++++++++++++++++ crates/binstalk-downloader/LICENSE-MIT | 23 +++ 3 files changed, 200 insertions(+), 1 deletion(-) create mode 100644 crates/binstalk-downloader/LICENSE-APACHE create mode 100644 crates/binstalk-downloader/LICENSE-MIT diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 204bca82..bc2ab78e 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -7,7 +7,7 @@ version = "0.5.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" -license = "GPL-3.0" +license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" diff --git a/crates/binstalk-downloader/LICENSE-APACHE b/crates/binstalk-downloader/LICENSE-APACHE new file mode 100644 index 00000000..1b5ec8b7 --- /dev/null +++ b/crates/binstalk-downloader/LICENSE-APACHE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/crates/binstalk-downloader/LICENSE-MIT b/crates/binstalk-downloader/LICENSE-MIT new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/crates/binstalk-downloader/LICENSE-MIT @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. From d2abdf14e027adb8b3387ab710715e780e83a462 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 May 2023 02:34:23 +0000 Subject: [PATCH 1267/2020] Bump digest from 0.10.6 to 0.10.7 (#1077) Bumps [digest](https://github.com/RustCrypto/traits) from 0.10.6 to 0.10.7. - [Commits](https://github.com/RustCrypto/traits/compare/digest-v0.10.6...digest-v0.10.7) --- updated-dependencies: - dependency-name: digest dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fc625334..08ec735c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -607,9 +607,9 @@ dependencies = [ [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index bc2ab78e..34913e9e 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -17,7 +17,7 @@ binstalk-types = { version = "0.4.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" compact_str = "0.7.0" -digest = "0.10.6" +digest = "0.10.7" flate2 = { version = "1.0.26", default-features = false } futures-lite = { version = "1.13.0", default-features = false } futures-util = "0.3.28" From d2f792ffae53bf3873930c913fec19ff51cb07dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 May 2023 02:35:41 +0000 Subject: [PATCH 1268/2020] Bump clap from 4.2.7 to 4.3.0 (#1076) Bumps [clap](https://github.com/clap-rs/clap) from 4.2.7 to 4.3.0. - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.2.7...clap_complete-v4.3.0) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 16 ++++++++-------- crates/bin/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 08ec735c..0661bb18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -467,9 +467,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.2.7" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34d21f9bf1b425d2968943631ec91202fe5e837264063503708b83013f8fc938" +checksum = "93aae7a4192245f70fe75dd9157fc7b4a5bf53e88d30bd4396f7d8f9284d5acc" dependencies = [ "clap_builder", "clap_derive", @@ -478,9 +478,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.2.7" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914c8c79fb560f238ef6429439a30023c862f7a28e688c58f7203f12b29970bd" +checksum = "4f423e341edefb78c9caba2d9c7f7687d0e72e89df3ce3394554754393ac3990" dependencies = [ "anstream", "anstyle", @@ -491,9 +491,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.2.0" +version = "4.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" +checksum = "191d9573962933b4027f932c600cd252ce27a8ad5979418fe78e43c07996f27b" dependencies = [ "heck", "proc-macro2", @@ -503,9 +503,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" +checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" [[package]] name = "cmake" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index bebfe8ef..b3a8f926 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.12.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.5.0" } -clap = { version = "4.2.7", features = ["derive", "env"] } +clap = { version = "4.3.0", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" file-format = { version = "0.16.0", default-features = false } diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 2a6ceb10..10722d34 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" exclude = ["fuzz", "benches"] [dependencies] -clap = { version = "4.2.7", features = ["derive"], optional = true } +clap = { version = "4.3.0", features = ["derive"], optional = true } miette = { version = "5.9.0", default-features = false, optional = true } thiserror = "1.0.38" From 94643a1688d400d44b92d10275f2b50466822bbb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 May 2023 02:36:38 +0000 Subject: [PATCH 1269/2020] Bump linux-raw-sys from 0.3.7 to 0.3.8 (#1075) Bumps [linux-raw-sys](https://github.com/sunfishcode/linux-raw-sys) from 0.3.7 to 0.3.8. - [Commits](https://github.com/sunfishcode/linux-raw-sys/compare/v0.3.7...v0.3.8) --- updated-dependencies: - dependency-name: linux-raw-sys dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0661bb18..d23b9b23 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1270,9 +1270,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "lock_api" From 811283df5692a1503618c596aee2a9e93ddd77a7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 May 2023 13:38:29 +1000 Subject: [PATCH 1270/2020] Bump toml from 0.7.3 to 0.7.4 (#1079) Bumps [toml](https://github.com/toml-rs/toml) from 0.7.3 to 0.7.4. - [Commits](https://github.com/toml-rs/toml/compare/toml-v0.7.3...toml-v0.7.4) --- updated-dependencies: - dependency-name: toml dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d23b9b23..c4db67ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2400,9 +2400,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b403acf6f2bb0859c93c7f0d967cb4a75a7ac552100f9322faf64dc047669b21" +checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" dependencies = [ "serde", "serde_spanned", From f694a9a356e50808854adb337be4008689493875 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 22 May 2023 13:40:02 +1000 Subject: [PATCH 1271/2020] Bump data-encoding from 2.3.3 to 2.4.0 (#1078) Bumps [data-encoding](https://github.com/ia0/data-encoding) from 2.3.3 to 2.4.0. - [Commits](https://github.com/ia0/data-encoding/commits/v2.4.0) --- updated-dependencies: - dependency-name: data-encoding dependency-type: indirect update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c4db67ed..bf5d9937 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -585,9 +585,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" +checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "detect-targets" From 73a3dc9da6d2f4cf25e391f0a06b19df7883db70 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 May 2023 02:26:58 +0000 Subject: [PATCH 1272/2020] Bump bumpalo from 3.12.2 to 3.13.0 (#1083) Bumps [bumpalo](https://github.com/fitzgen/bumpalo) from 3.12.2 to 3.13.0. - [Changelog](https://github.com/fitzgen/bumpalo/blob/main/CHANGELOG.md) - [Commits](https://github.com/fitzgen/bumpalo/compare/3.12.2...3.13.0) --- updated-dependencies: - dependency-name: bumpalo dependency-type: indirect update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bf5d9937..ae701401 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -365,9 +365,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.2" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b" +checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" [[package]] name = "byteorder" From 1cbac85f6da9b777c8a5dd6802376b9444276f73 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 May 2023 03:04:57 +0000 Subject: [PATCH 1273/2020] Bump regex from 1.8.1 to 1.8.2 (#1082) Bumps [regex](https://github.com/rust-lang/regex) from 1.8.1 to 1.8.2. - [Release notes](https://github.com/rust-lang/regex/releases) - [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/regex/compare/1.8.1...1.8.2) --- updated-dependencies: - dependency-name: regex dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ae701401..0510b144 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1759,9 +1759,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" +checksum = "d1a59b5d8e97dee33696bf13c5ba8ab85341c002922fba050069326b9c498974" dependencies = [ "aho-corasick", "memchr", @@ -1770,9 +1770,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" +checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" [[package]] name = "reqwest" From 306f5d7e3db521026f4a11dfb06614ca24022828 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 24 May 2023 12:29:53 +1000 Subject: [PATCH 1274/2020] Bump toml_edit from 0.19.9 to 0.19.10 (#1084) Bumps [toml_edit](https://github.com/toml-rs/toml) from 0.19.9 to 0.19.10. - [Commits](https://github.com/toml-rs/toml/compare/v0.19.9...v0.19.10) --- updated-dependencies: - dependency-name: toml_edit dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk-manifests/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0510b144..d78acc08 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2421,9 +2421,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.9" +version = "0.19.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d964908cec0d030b812013af25a0e57fddfadb1e066ecc6681d86253129d4f" +checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" dependencies = [ "indexmap", "serde", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 0632db8a..c08063f1 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.96" thiserror = "1.0.40" -toml_edit = { version = "0.19.9", features = ["serde"] } +toml_edit = { version = "0.19.10", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] From c9806cce78990942b87bd38a2bca479cfbb13cea Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 24 May 2023 18:22:41 +1000 Subject: [PATCH 1275/2020] Add one-liner for installing `cargo-binstall` on Linux/MacOS (#1074) Fixed #1073 Signed-off-by: Jiahao XU --- README.md | 6 ++++++ install-from-binstall-release.sh | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100755 install-from-binstall-release.sh diff --git a/README.md b/README.md index 8618d5cc..d34a419c 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,12 @@ You probably want to **[see this page as it was when the latest version was publ ## Installation +Here are the one-liners for installing pre-compiled `cargo-binstall` binary from release on Linux and acOS: + +``` +curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash +``` + To get started _using_ `cargo-binstall` first install the binary (either via `cargo install cargo-binstall` or by downloading a pre-compiled [release](https://github.com/cargo-bins/cargo-binstall/releases)), then extract it using `tar` or `unzip` and move it into `$HOME/.cargo/bin`. We recommend using the pre-compiled ones because we optimize those more than a standard source build does. diff --git a/install-from-binstall-release.sh b/install-from-binstall-release.sh new file mode 100755 index 00000000..0163b9f7 --- /dev/null +++ b/install-from-binstall-release.sh @@ -0,0 +1,34 @@ +#!/bin/bash + +set -euxo pipefail + +cd "$(mktemp -d)" + +base_url="https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-" + +os="$(uname -o)" +if [ "$os" == "Darwin" ]; then + url="${base_url}universal-apple-darwin.zip" + curl -LO --proto '=https' --tlsv1.2 -sSf "$url" + unzip cargo-binstall-universal-apple-darwin.zip +elif [ "$os" == "GNU/Linux" ]; then + machine="$(uname -m)" + target="${machine}-unknown-linux-musl" + if [ "$machine" == "armv7" ]; then + target="${target}eabihf" + fi + + url="${base_url}${target}.tgz" + curl -L --proto '=https' --tlsv1.2 -sSf "$url" | tar -xvzf - +else + echo "Unupporteed OS ${os}" + exit 1 +fi + +./cargo-binstall -y --force cargo-binstall + +if ! [[ ":$PATH:" == *":$HOME/.cargo/bin:"* ]]; then + echo + printf "\033[0;31mYour path is missing ~/.cargo/bin, you might want to add it.\033[0m\n" + echo +fi From f8255b1b8144d48cc6628094920da69484e5a7cc Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 25 May 2023 00:27:05 +1000 Subject: [PATCH 1276/2020] dep: Downgrade tracing from v0.1.38 => v0.1.37 due to yanking (#1085) Fixed #1019 Signed-off-by: Jiahao XU --- Cargo.lock | 5 +++-- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d78acc08..87f1dc2a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2463,10 +2463,11 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.38" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9cf6a813d3f40c88b0b6b6f29a5c95c6cdbf97c1f9cc53fb820200f5ad814d" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ + "cfg-if", "log", "pin-project-lite", "tracing-attributes", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index b3a8f926..301aacbb 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -41,7 +41,7 @@ supports-color = "2.0.0" tempfile = "3.5.0" tokio = { version = "1.28.1", features = ["rt-multi-thread"], default-features = false } tracing-core = "0.1.31" -tracing = { version = "0.1.38", default-features = false } +tracing = { version = "0.1.37", default-features = false } tracing-log = { version = "0.1.3", default-features = false } tracing-subscriber = { version = "0.3.17", features = ["fmt", "json", "ansi"], default-features = false } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 34913e9e..ec4da2a0 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -37,7 +37,7 @@ tokio = { version = "1.28.1", features = ["macros", "rt-multi-thread", "sync", " tokio-tar = "0.3.0" tokio-util = { version = "0.7.8", features = ["io"] } tower = { version = "0.4.13", features = ["limit", "util"] } -tracing = "0.1.38" +tracing = "0.1.37" # trust-dns-resolver must be kept in sync with the version reqwest uses trust-dns-resolver = { version = "0.22.0", optional = true, default-features = false, features = ["dnssec-ring"] } url = "2.3.1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 654a35da..8711d8e1 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -34,7 +34,7 @@ tempfile = "3.5.0" thiserror = "1.0.40" # parking_lot for `tokio::sync::OnceCell::const_new` tokio = { version = "1.28.1", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } -tracing = "0.1.38" +tracing = "0.1.37" url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" From 420015d6ce1fcc440c1d9dfb1a617880fa34a95f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 May 2023 13:21:40 +1000 Subject: [PATCH 1277/2020] Bump unicode-ident from 1.0.8 to 1.0.9 (#1086) Bumps [unicode-ident](https://github.com/dtolnay/unicode-ident) from 1.0.8 to 1.0.9. - [Release notes](https://github.com/dtolnay/unicode-ident/releases) - [Commits](https://github.com/dtolnay/unicode-ident/compare/1.0.8...1.0.9) --- updated-dependencies: - dependency-name: unicode-ident dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 87f1dc2a..a326c78c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2612,9 +2612,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" [[package]] name = "unicode-linebreak" From 8e04ee15a3437b0233f746f732942e1f64eb5284 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 25 May 2023 03:22:17 +0000 Subject: [PATCH 1278/2020] Bump io-lifetimes from 1.0.10 to 1.0.11 (#1087) Bumps [io-lifetimes](https://github.com/sunfishcode/io-lifetimes) from 1.0.10 to 1.0.11. - [Commits](https://github.com/sunfishcode/io-lifetimes/compare/v1.0.10...v1.0.11) --- updated-dependencies: - dependency-name: io-lifetimes dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a326c78c..5d80b5bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1119,9 +1119,9 @@ dependencies = [ [[package]] name = "io-lifetimes" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ "hermit-abi 0.3.1", "libc", From 256fb36e7435ae38a30fb58da8a509a61804d1d1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 25 May 2023 22:49:06 +1000 Subject: [PATCH 1279/2020] Require job `release-builds` to pass for merging (#1088) Fixed #1072 Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ca7b302..e38454cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -149,6 +149,9 @@ jobs: - run: just avoid-dev-deps - run: just lint + release-builds: + uses: ./.github/workflows/release-build.yml + # Dummy job to have a stable name for the "all tests pass" requirement tests-pass: name: Tests pass @@ -158,15 +161,11 @@ jobs: - apple-m1-check - lint - windows-aarch64-check + - release-builds if: always() # always run even if dependencies fail runs-on: ubuntu-latest steps: # fail if ANY dependency has failed or been skipped or cancelled - if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled')" run: exit 1 - # Wait for 30s before release build to avoid overloading GitHub. - - run: sleep 30 - - release-builds: - needs: tests-pass - uses: ./.github/workflows/release-build.yml + - run: exit 0 From e96477a1162023eaed2daae71354c2ec756e5220 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 25 May 2023 22:56:31 +1000 Subject: [PATCH 1280/2020] Optimize `fetch_crate_cratesio` for exact version (#1089) If `version_req` requests a specific version instead of a range, then there is no need to pull all versions available from https://crates.io/api/v1/crates Signed-off-by: Jiahao XU --- crates/binstalk/src/drivers/crates_io.rs | 132 +++++++++++++++++------ 1 file changed, 102 insertions(+), 30 deletions(-) diff --git a/crates/binstalk/src/drivers/crates_io.rs b/crates/binstalk/src/drivers/crates_io.rs index 28816597..441a44a1 100644 --- a/crates/binstalk/src/drivers/crates_io.rs +++ b/crates/binstalk/src/drivers/crates_io.rs @@ -1,8 +1,8 @@ use std::path::PathBuf; use cargo_toml::Manifest; -use compact_str::CompactString; -use semver::VersionReq; +use compact_str::{CompactString, ToCompactString}; +use semver::{Comparator, Op as ComparatorOp, Version as SemVersion, VersionReq}; use serde::Deserialize; use tracing::debug; @@ -21,38 +21,68 @@ mod vfs; mod visitor; use visitor::ManifestVisitor; -#[derive(Deserialize)] -struct CrateInfo { - #[serde(rename = "crate")] - inner: CrateInfoInner, +async fn is_crate_yanked( + client: &Client, + name: &str, + version: &str, +) -> Result { + #[derive(Deserialize)] + struct CrateInfo { + version: Inner, + } + + #[derive(Deserialize)] + struct Inner { + yanked: bool, + } + + // Fetch / update index + debug!("Looking up crate information"); + + let response = client + .get(Url::parse(&format!( + "https://crates.io/api/v1/crates/{name}/{version}" + ))?) + .send(true) + .await + .map_err(|err| { + BinstallError::CratesIoApi(Box::new(CratesIoApiError { + crate_name: name.into(), + err, + })) + })?; + + let info: CrateInfo = response.json().await?; + + Ok(info.version.yanked) } -#[derive(Deserialize)] -struct CrateInfoInner { - max_stable_version: CompactString, -} - -#[derive(Deserialize)] -struct Versions { - versions: Vec, -} - -#[derive(Deserialize)] -struct Version { - num: CompactString, - yanked: bool, -} - -/// Find the crate by name, get its latest stable version matches `version_req`, -/// retrieve its Cargo.toml and infer all its bins. -pub async fn fetch_crate_cratesio( - client: Client, +async fn fetch_crate_cratesio_version_matched( + client: &Client, name: &str, version_req: &VersionReq, - crates_io_rate_limit: &CratesIoRateLimit, -) -> Result, BinstallError> { - // Wait until we can make another request to crates.io - crates_io_rate_limit.tick().await; +) -> Result { + #[derive(Deserialize)] + struct CrateInfo { + #[serde(rename = "crate")] + inner: CrateInfoInner, + } + + #[derive(Deserialize)] + struct CrateInfoInner { + max_stable_version: CompactString, + } + + #[derive(Deserialize)] + struct Versions { + versions: Vec, + } + + #[derive(Deserialize)] + struct Version { + num: CompactString, + yanked: bool, + } // Fetch / update index debug!("Looking up crate information"); @@ -106,6 +136,48 @@ pub async fn fetch_crate_cratesio( debug!("Found information for crate version: '{version}'"); + Ok(version) +} + +/// Find the crate by name, get its latest stable version matches `version_req`, +/// retrieve its Cargo.toml and infer all its bins. +pub async fn fetch_crate_cratesio( + client: Client, + name: &str, + version_req: &VersionReq, + crates_io_rate_limit: &CratesIoRateLimit, +) -> Result, BinstallError> { + // Wait until we can make another request to crates.io + crates_io_rate_limit.tick().await; + + let version = match version_req.comparators.as_slice() { + [Comparator { + op: ComparatorOp::Exact, + major, + minor: Some(minor), + patch: Some(patch), + pre, + }] => { + let version = SemVersion { + major: *major, + minor: *minor, + patch: *patch, + pre: pre.clone(), + build: Default::default(), + } + .to_compact_string(); + + if is_crate_yanked(&client, name, &version).await? { + return Err(BinstallError::VersionMismatch { + req: version_req.clone(), + }); + } + + version + } + _ => fetch_crate_cratesio_version_matched(&client, name, version_req).await?, + }; + // Download crate to temporary dir (crates.io or git?) let crate_url = format!("https://crates.io/api/v1/crates/{name}/{version}/download"); From 316dc50dfff8fce16291527de7aa60ff9edbf961 Mon Sep 17 00:00:00 2001 From: xxchan Date: Fri, 26 May 2023 04:25:13 +0200 Subject: [PATCH 1281/2020] fix typo (#1090) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index d34a419c..28da9e6f 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ You probably want to **[see this page as it was when the latest version was publ ## Installation -Here are the one-liners for installing pre-compiled `cargo-binstall` binary from release on Linux and acOS: +Here are the one-liners for installing pre-compiled `cargo-binstall` binary from release on Linux and macOS: ``` curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash From 32053e65ea562b56eeed140a1c081fd5aa879e65 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 May 2023 02:20:05 +0000 Subject: [PATCH 1282/2020] Bump regex from 1.8.2 to 1.8.3 (#1091) Bumps [regex](https://github.com/rust-lang/regex) from 1.8.2 to 1.8.3. - [Release notes](https://github.com/rust-lang/regex/releases) - [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/regex/compare/1.8.2...1.8.3) --- updated-dependencies: - dependency-name: regex dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5d80b5bc..2b7473fb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1759,9 +1759,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.2" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1a59b5d8e97dee33696bf13c5ba8ab85341c002922fba050069326b9c498974" +checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" dependencies = [ "aho-corasick", "memchr", From a61f45fb6331c2e2e19f24833fe7650f8b4432a6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 May 2023 02:20:14 +0000 Subject: [PATCH 1283/2020] Bump proc-macro2 from 1.0.58 to 1.0.59 (#1092) Bumps [proc-macro2](https://github.com/dtolnay/proc-macro2) from 1.0.58 to 1.0.59. - [Release notes](https://github.com/dtolnay/proc-macro2/releases) - [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.58...1.0.59) --- updated-dependencies: - dependency-name: proc-macro2 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/leon-macros/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2b7473fb..eda1c75c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1623,9 +1623,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa1fb82fc0c281dd9671101b66b771ebbe1eaf967b96ac8740dcba4b70005ca8" +checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" dependencies = [ "unicode-ident", ] diff --git a/crates/leon-macros/Cargo.toml b/crates/leon-macros/Cargo.toml index bdd50324..2502d5c6 100644 --- a/crates/leon-macros/Cargo.toml +++ b/crates/leon-macros/Cargo.toml @@ -14,6 +14,6 @@ proc-macro = true [dependencies] leon = { version = "2.0.0", path = "../leon", default-features = false } -proc-macro2 = "1.0.58" +proc-macro2 = "1.0.59" syn = { version = "2.0.16", default-features = false, features = ["proc-macro", "parsing"] } quote = "1.0.27" From 201ae15311859fee844f4935e16908c4565530d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 26 May 2023 14:33:00 +1000 Subject: [PATCH 1284/2020] Bump quote from 1.0.27 to 1.0.28 (#1093) Bumps [quote](https://github.com/dtolnay/quote) from 1.0.27 to 1.0.28. - [Release notes](https://github.com/dtolnay/quote/releases) - [Commits](https://github.com/dtolnay/quote/compare/1.0.27...1.0.28) --- updated-dependencies: - dependency-name: quote dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/leon-macros/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eda1c75c..693c9560 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1691,9 +1691,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" +checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" dependencies = [ "proc-macro2", ] diff --git a/crates/leon-macros/Cargo.toml b/crates/leon-macros/Cargo.toml index 2502d5c6..6d7c021c 100644 --- a/crates/leon-macros/Cargo.toml +++ b/crates/leon-macros/Cargo.toml @@ -16,4 +16,4 @@ proc-macro = true leon = { version = "2.0.0", path = "../leon", default-features = false } proc-macro2 = "1.0.59" syn = { version = "2.0.16", default-features = false, features = ["proc-macro", "parsing"] } -quote = "1.0.27" +quote = "1.0.28" From 47dbc995553c2f91c90d9c87994a40d1d1958820 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 26 May 2023 15:47:43 +0000 Subject: [PATCH 1285/2020] release: binstalk v0.12.1 (#1096) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 693c9560..232a10d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -216,7 +216,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.12.0" +version = "0.12.1" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 301aacbb..254cc72b 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.12.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.12.1", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.5.0" } clap = { version = "4.3.0", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 8711d8e1..828ba1f9 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.12.0" +version = "0.12.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From 62ca508e891aa801877f4e0e87d18a788fff6dee Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 26 May 2023 15:57:45 +0000 Subject: [PATCH 1286/2020] release: cargo-binstall v0.23.1 (#1097) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 232a10d8..b02e0f70 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -404,7 +404,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.23.0" +version = "0.23.1" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 254cc72b..8580c256 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.23.0" +version = "0.23.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 5167943f..47e07895 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 39748ecadf86dd3c34e03c640b75120a469f1af6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 27 May 2023 02:06:51 +1000 Subject: [PATCH 1287/2020] release: binstalk-downloader v0.5.1 (#1095) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b02e0f70..876dc10f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -249,7 +249,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.5.0" +version = "0.5.1" dependencies = [ "async-compression 0.4.0", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index ec4da2a0..96e6d2c4 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.5.0" +version = "0.5.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 828ba1f9..b2fdcc63 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.5.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.5.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.4.0", path = "../binstalk-types" } cargo_toml = "0.15.2" command-group = { version = "2.1.0", features = ["with-tokio"] } From b23598ed85b33f8f9125fdaa0c7cfbb5fc2e5cb4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 May 2023 03:02:20 +0000 Subject: [PATCH 1288/2020] Bump tokio from 1.28.1 to 1.28.2 (#1100) Bumps [tokio](https://github.com/tokio-rs/tokio) from 1.28.1 to 1.28.2. - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.28.1...tokio-1.28.2) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 876dc10f..d082b133 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2298,9 +2298,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.28.1" +version = "1.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aa32867d44e6f2ce3385e89dceb990188b8bb0fb25b0cf576647a6f98ac5105" +checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" dependencies = [ "autocfg", "bytes", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 8580c256..96c1a77b 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -39,7 +39,7 @@ strum = "0.24.1" strum_macros = "0.24.3" supports-color = "2.0.0" tempfile = "3.5.0" -tokio = { version = "1.28.1", features = ["rt-multi-thread"], default-features = false } +tokio = { version = "1.28.2", features = ["rt-multi-thread"], default-features = false } tracing-core = "0.1.31" tracing = { version = "0.1.37", default-features = false } tracing-log = { version = "0.1.3", default-features = false } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 96e6d2c4..7d2ca12f 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -33,7 +33,7 @@ serde_json = { version = "1.0.96", optional = true } tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.5.0" thiserror = "1.0.40" -tokio = { version = "1.28.1", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } +tokio = { version = "1.28.2", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.8", features = ["io"] } tower = { version = "0.4.13", features = ["limit", "util"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index b2fdcc63..e7bec03f 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -33,7 +33,7 @@ strum = "0.24.1" tempfile = "3.5.0" thiserror = "1.0.40" # parking_lot for `tokio::sync::OnceCell::const_new` -tokio = { version = "1.28.1", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } +tokio = { version = "1.28.2", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } tracing = "0.1.37" url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 95e625c4..1f5d7a58 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -10,9 +10,9 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -tokio = { version = "1.28.1", features = ["rt", "process", "sync"], default-features = false } +tokio = { version = "1.28.2", features = ["rt", "process", "sync"], default-features = false } cfg-if = "1.0.0" guess_host_triple = "0.1.3" [dev-dependencies] -tokio = { version = "1.28.1", features = ["macros"], default-features = false } +tokio = { version = "1.28.2", features = ["macros"], default-features = false } From 12346e21e8af460ab234740fcb450ead01a086f5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 May 2023 03:03:09 +0000 Subject: [PATCH 1289/2020] Bump mio from 0.8.6 to 0.8.7 (#1102) Bumps [mio](https://github.com/tokio-rs/mio) from 0.8.6 to 0.8.7. - [Release notes](https://github.com/tokio-rs/mio/releases) - [Changelog](https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md) - [Commits](https://github.com/tokio-rs/mio/commits) --- updated-dependencies: - dependency-name: mio dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d082b133..b62877aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1407,14 +1407,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "eebffdb73fe72e917997fad08bdbf31ac50b0fa91cec93e69a0662e4264d454c" dependencies = [ "libc", "log", "wasi", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] From f3c665a31326ba8e69869073074c2d0f3a4eec98 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 May 2023 04:22:16 +0000 Subject: [PATCH 1290/2020] Bump syn from 2.0.16 to 2.0.18 (#1104) Bumps [syn](https://github.com/dtolnay/syn) from 2.0.16 to 2.0.18. - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.16...2.0.18) --- updated-dependencies: - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 30 +++++++++++++++--------------- crates/leon-macros/Cargo.toml | 2 +- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b62877aa..ebc01fcf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -144,7 +144,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -498,7 +498,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -832,7 +832,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -1233,7 +1233,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -1369,7 +1369,7 @@ checksum = "4901771e1d44ddb37964565c654a3223ba41a594d02b8da471cc4464912b5cfa" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -1509,7 +1509,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -1594,7 +1594,7 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -2033,7 +2033,7 @@ checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -2208,9 +2208,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.16" +version = "2.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01" +checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" dependencies = [ "proc-macro2", "quote", @@ -2268,7 +2268,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -2323,7 +2323,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -2482,7 +2482,7 @@ checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", ] [[package]] @@ -2746,7 +2746,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", "wasm-bindgen-shared", ] @@ -2780,7 +2780,7 @@ checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn 2.0.18", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/crates/leon-macros/Cargo.toml b/crates/leon-macros/Cargo.toml index 6d7c021c..56a36f00 100644 --- a/crates/leon-macros/Cargo.toml +++ b/crates/leon-macros/Cargo.toml @@ -15,5 +15,5 @@ proc-macro = true [dependencies] leon = { version = "2.0.0", path = "../leon", default-features = false } proc-macro2 = "1.0.59" -syn = { version = "2.0.16", default-features = false, features = ["proc-macro", "parsing"] } +syn = { version = "2.0.18", default-features = false, features = ["proc-macro", "parsing"] } quote = "1.0.28" From 02ca4b6e123bc1ed35080e94e162f84947266bee Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 29 May 2023 04:22:23 +0000 Subject: [PATCH 1291/2020] Bump log from 0.4.17 to 0.4.18 (#1103) Bumps [log](https://github.com/rust-lang/log) from 0.4.17 to 0.4.18. - [Release notes](https://github.com/rust-lang/log/releases) - [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/log/compare/0.4.17...0.4.18) --- updated-dependencies: - dependency-name: log dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 7 ++----- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ebc01fcf..49e57cc3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1286,12 +1286,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" [[package]] name = "lru-cache" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 96c1a77b..f84f02ba 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -30,7 +30,7 @@ dirs = "5.0.1" file-format = { version = "0.16.0", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } gh-token = "0.1.2" -log = { version = "0.4.17", features = ["std"] } +log = { version = "0.4.18", features = ["std"] } miette = "5.9.0" mimalloc = { version = "0.1.37", default-features = false, optional = true } once_cell = "1.17.1" From dbb0893f4e7bfb5c1e3f0fae20b57b9ddc3acb7d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 May 2023 13:53:14 +1000 Subject: [PATCH 1292/2020] Bump openssl from 0.10.52 to 0.10.53 (#1105) Bumps [openssl](https://github.com/sfackler/rust-openssl) from 0.10.52 to 0.10.53. - [Release notes](https://github.com/sfackler/rust-openssl/releases) - [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.52...openssl-v0.10.53) --- updated-dependencies: - dependency-name: openssl dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 49e57cc3..818a24ba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1409,7 +1409,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eebffdb73fe72e917997fad08bdbf31ac50b0fa91cec93e69a0662e4264d454c" dependencies = [ "libc", - "log", "wasi", "windows-sys 0.48.0", ] @@ -1485,9 +1484,9 @@ checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "openssl" -version = "0.10.52" +version = "0.10.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01b8574602df80f7b85fdfc5392fa884a4e3b3f4f35402c070ab34c3d3f78d56" +checksum = "12df40a956736488b7b44fe79fe12d4f245bb5b3f5a1f6095e499760015be392" dependencies = [ "bitflags", "cfg-if", @@ -1517,9 +1516,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.87" +version = "0.9.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e17f59264b2809d77ae94f0e1ebabc434773f370d6ca667bd223ea10e06cc7e" +checksum = "c2ce0f250f34a308dcfdbb351f511359857d4ed2134ba715a4eadd46e1ffd617" dependencies = [ "cc", "libc", From e7890642898e99b3bf67ac1962c5c9836586150d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 May 2023 14:06:18 +1000 Subject: [PATCH 1293/2020] Bump once_cell from 1.17.1 to 1.17.2 (#1106) Bumps [once_cell](https://github.com/matklad/once_cell) from 1.17.1 to 1.17.2. - [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md) - [Commits](https://github.com/matklad/once_cell/compare/v1.17.1...v1.17.2) --- updated-dependencies: - dependency-name: once_cell dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 818a24ba..31d96264 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1478,9 +1478,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.1" +version = "1.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" [[package]] name = "openssl" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index f84f02ba..aaab3817 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -33,7 +33,7 @@ gh-token = "0.1.2" log = { version = "0.4.18", features = ["std"] } miette = "5.9.0" mimalloc = { version = "0.1.37", default-features = false, optional = true } -once_cell = "1.17.1" +once_cell = "1.17.2" semver = "1.0.17" strum = "0.24.1" strum_macros = "0.24.3" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 2af8511c..5a19bc9e 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -12,7 +12,7 @@ license = "Apache-2.0 OR MIT" [dependencies] compact_str = { version = "0.7.0", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } -once_cell = "1.17.1" +once_cell = "1.17.2" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } strum = "0.24.1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index e7bec03f..c3fce8b6 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ leon-macros = { version = "1.0.0", path = "../leon-macros" } maybe-owned = "0.3.4" miette = "5.9.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } -once_cell = "1.17.1" +once_cell = "1.17.2" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } strum = "0.24.1" From 7d11a379c4a511514dc4f77000b83edf80c9d0e5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 May 2023 13:48:44 +1000 Subject: [PATCH 1294/2020] Bump mio from 0.8.7 to 0.8.8 (#1109) Bumps [mio](https://github.com/tokio-rs/mio) from 0.8.7 to 0.8.8. - [Release notes](https://github.com/tokio-rs/mio/releases) - [Changelog](https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md) - [Commits](https://github.com/tokio-rs/mio/commits) --- updated-dependencies: - dependency-name: mio dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 31d96264..5b8a3561 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1404,9 +1404,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eebffdb73fe72e917997fad08bdbf31ac50b0fa91cec93e69a0662e4264d454c" +checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", "wasi", From e79bb2ab107b1b8064d97253d860e32add077820 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 1 Jun 2023 13:58:11 +1000 Subject: [PATCH 1295/2020] Include `cargo-timings` report in release build (#1110) Signed-off-by: Jiahao XU --- .github/workflows/release-build.yml | 8 ++++++++ justfile | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 0ee34acf..e8a8dc73 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -12,6 +12,7 @@ on: env: CARGO_TERM_COLOR: always CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse + JUST_TIMINGS: true jobs: build: @@ -82,6 +83,13 @@ jobs: path: packages/cargo-binstall-* retention-days: 1 + - name: Upload timings + uses: actions/upload-artifact@v3 + with: + name: ${{ matrix.t }}-cargo-timings + path: target/cargo-timings + retention-days: 1 + lipo: needs: build name: universal-apple-darwin diff --git a/justfile b/justfile index ccc5a6f7..9ed37dc5 100644 --- a/justfile +++ b/justfile @@ -9,6 +9,7 @@ default-features := env_var_or_default("JUST_DEFAULT_FEATURES", "") override-features := env_var_or_default("JUST_OVERRIDE_FEATURES", "") glibc-version := env_var_or_default("GLIBC_VERSION", "") use-auditable := env_var_or_default("JUST_USE_AUDITABLE", "") +timings := env_var_or_default("JUST_TIMINGS", "") export BINSTALL_LOG_LEVEL := if env_var_or_default("RUNNER_DEBUG", "0") == "1" { "debug" } else { "info" } @@ -145,7 +146,7 @@ target-glibc-ver-postfix := if glibc-version != "" { "" } -cargo-build-args := (if for-release != "" { " --release" } else { "" }) + (" --target ") + (target) + (target-glibc-ver-postfix) + (cargo-buildstd) + (if extra-build-args != "" { " " + extra-build-args } else { "" }) + (cargo-no-default-features) + (cargo-split-debuginfo) + (if cargo-features != "" { " --features " + cargo-features } else { "" }) + (win-arm64-ring16) +cargo-build-args := (if for-release != "" { " --release" } else { "" }) + (" --target ") + (target) + (target-glibc-ver-postfix) + (cargo-buildstd) + (if extra-build-args != "" { " " + extra-build-args } else { "" }) + (cargo-no-default-features) + (cargo-split-debuginfo) + (if cargo-features != "" { " --features " + cargo-features } else { "" }) + (win-arm64-ring16) + (if timings != "" { " --timings" } else { "" }) export RUSTFLAGS := (linker-plugin-lto) + (rustc-gcclibs) + (rustc-miropt) + (rust-lld) + (rustc-icf) From 92fdefbc9e5f740f4f7fdc6920e015cb7407d591 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 1 Jun 2023 04:02:01 +0000 Subject: [PATCH 1296/2020] Bump fs4 from 0.6.4 to 0.6.5 (#1112) Bumps [fs4](https://github.com/al8n/fs4-rs) from 0.6.4 to 0.6.5. - [Commits](https://github.com/al8n/fs4-rs/commits) --- updated-dependencies: - dependency-name: fs4 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/fs-lock/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5b8a3561..18b9e65a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -785,9 +785,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7f5b6908aecca5812a4569056285e58c666588c9573ee59765bf1d3692699e2" +checksum = "7672706608ecb74ab2e055c68327ffc25ae4cac1e12349204fd5fb0f3487cce2" dependencies = [ "rustix", "windows-sys 0.48.0", diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 38319798..2472ba4e 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -10,4 +10,4 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -fs4 = "0.6.4" +fs4 = "0.6.5" From db6f3d2bfdfff906bb36a0a3f157f6c5e97c1a57 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 1 Jun 2023 19:48:00 +1000 Subject: [PATCH 1297/2020] ci: Disable lto for `ci.yml` job release-builds (#1114) LTO takes way too long and it is mature enough that it usually does not have any miscompilation. Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 3 +++ .github/workflows/release-build.yml | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e38454cb..44d1b72b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -151,6 +151,9 @@ jobs: release-builds: uses: ./.github/workflows/release-build.yml + with: + CARGO_PROFILE_RELEASE_LTO: no + CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1024 # Dummy job to have a stable name for the "all tests pass" requirement tests-pass: diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index e8a8dc73..507cd373 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -8,6 +8,14 @@ on: description: "Set to the release metadata JSON to publish the release" required: false type: string + CARGO_PROFILE_RELEASE_LTO: + description: "Set to override default release profile lto settings" + required: false + type: string + CARGO_PROFILE_RELEASE_CODEGEN_UNITS: + description: "Set to override default release profile codegen-units settings" + required: false + type: string env: CARGO_TERM_COLOR: always @@ -54,6 +62,14 @@ jobs: - run: just toolchain rust-src - run: just ci-install-deps + - name: Override release profile lto settings + if: inputs.CARGO_PROFILE_RELEASE_LTO + run: echo "CARGO_PROFILE_RELEASE_LTO=${{ inputs.CARGO_PROFILE_RELEASE_LTO }}" >> "$GITHUB_ENV" + + - name: Override release profile codegen-units settings + if: inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS + run: echo "CARGO_PROFILE_RELEASE_CODEGEN_UNITS=${{ inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS }}" >> "$GITHUB_ENV" + - run: just package - if: runner.os == 'Windows' run: Get-ChildItem packages/ From 9ecfce410476dc6b3db2d7c73ec6e18a84cb146f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 2 Jun 2023 07:25:24 +1000 Subject: [PATCH 1298/2020] Fallback to pull_request num or commit sha if `github.ref` is not available (#1115) Signed-off-by: Jiahao XU --- .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 44d1b72b..d0be157f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ on: - SUPPORT.md concurrency: - group: ${{ github.workflow }}-${{ github.ref || github.run_id }} + group: ${{ github.workflow }}-${{ github.ref || github.event.pull_request.number || github.sha }} cancel-in-progress: true env: From b69c082160bc4746fe2425eea2166541d6f93aa2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 2 Jun 2023 14:03:29 +1000 Subject: [PATCH 1299/2020] ci: Switch to `Swatinem/rust-cache@v2` (#1113) Fixed #1038 sccache is not very effective at caching dependencies, the external C/C++ is recompiled in every ci and it takes a lot of time. Compilation of other Rust dependencies also takes quite some time and sccache is not helping at all, so I decided to switch to `Swatinem/rust-cache@v2`. The downside of the new caching method is that a new cache conntaining part of the `.cargo/` and `target/` will be created whenver `Cargo.lock`/`Cargo.toml` changes, but it can still reuse the old cache to create new caching. This is acceptable given that `sccache` often fails to reuse cache due to rate limiting from GHA, since it is not designed for use like a s3 object pool, and `sccache` will create a lot of new cache artifacts for a given branch that cannot be reused in main and would have to cleanup via a cronjob. Edit: rust 1.70 uses llvm 16.0, however ubuntu-latest still uses llvm 15.0 As such, during release-build, cross-lang-lto failed due to llvm is too old. Temporarily disable linker-plugin-lto to fix this. Signed-off-by: Jiahao XU --- .github/actions/just-setup/action.yml | 55 +++++++-------------------- .github/workflows/ci.yml | 10 ----- .github/workflows/release-build.yml | 1 - justfile | 11 ++++-- 4 files changed, 22 insertions(+), 55 deletions(-) diff --git a/.github/actions/just-setup/action.yml b/.github/actions/just-setup/action.yml index 2da88d50..0187304f 100644 --- a/.github/actions/just-setup/action.yml +++ b/.github/actions/just-setup/action.yml @@ -14,10 +14,6 @@ inputs: required: true default: true type: boolean - cache-suffix: - description: Suffix for cache key - required: false - default: "" runs: using: composite @@ -26,11 +22,6 @@ runs: run: echo "tools=just" >>$GITHUB_ENV shell: bash - - if: inputs.buildcache - name: Add sccache to tools to install - run: echo "tools=$tools,sccache" >>$GITHUB_ENV - shell: bash - - name: Add inputs.tools to tools to install if: inputs.tools != '' env: @@ -43,44 +34,26 @@ runs: with: tool: ${{ env.tools }} - - if: inputs.indexcache - name: Configure index cache - uses: actions/cache@v3 - with: - path: | - ~/.cargo/registry/index/ - ~/.cargo/registry/cache/ - ~/.cargo/git/db/ - key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}-${{ inputs.cache-suffix }} - restore-keys: | - ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}- - ${{ runner.os }}-cargo-index- - - name: Install rust toolchains run: just toolchain shell: bash - name: rustc version - run: rustc -vV | tee rustc-version + run: rustc -vV shell: bash - - if: inputs.buildcache - name: Configure sccache - uses: actions/github-script@v6 - with: - script: | - core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || ''); - core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || ''); - - - if: inputs.buildcache - name: Export env for sccache to work - shell: bash + - name: Retrieve RUSTFLAGS for caching + if: inputs.indexcache || inputs.buildcache + id: retrieve-rustflags run: | - echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV - echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV - echo "CARGO_INCREMENTAL=0" >> $GITHUB_ENV + if [ -n "${{ inputs.buildcache }}" ]; then + echo RUSTFLAGS="$(just print-rustflags)" >> "$GITHUB_OUTPUT" + else + echo RUSTFLAGS= >> "$GITHUB_OUTPUT" + fi + shell: bash - - uses: webiny/action-post-run@3.0.0 - id: post-run-command - with: - run: sccache --show-stats + - if: inputs.indexcache || inputs.buildcache + uses: Swatinem/rust-cache@v2 + env: + RUSTFLAGS: ${{ steps.retrieve-rustflags.outputs.RUSTFLAGS }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d0be157f..85942374 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,8 +47,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/actions/just-setup - with: - cache-suffix: ${{ env.CARGO_BUILD_TARGET }} env: # just-setup use binstall to install sccache, # which works better when we provide it with GITHUB_TOKEN. @@ -78,8 +76,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/actions/just-setup - with: - cache-suffix: ${{ env.CARGO_BUILD_TARGET }} env: # just-setup use binstall to install sccache, # which works better when we provide it with GITHUB_TOKEN. @@ -97,8 +93,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/actions/just-setup - with: - cache-suffix: ${{ env.CARGO_BUILD_TARGET }} env: # just-setup use binstall to install sccache, # which works better when we provide it with GITHUB_TOKEN. @@ -115,8 +109,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/actions/just-setup - with: - cache-suffix: ${{ env.CARGO_BUILD_TARGET }} env: # just-setup use binstall to install sccache, # which works better when we provide it with GITHUB_TOKEN. @@ -141,8 +133,6 @@ jobs: steps: - uses: actions/checkout@v3 - uses: ./.github/actions/just-setup - with: - cache-suffix: ${{ matrix.target }} - run: just toolchain rustfmt,clippy - run: just ci-install-deps diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 507cd373..20ab47f3 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -52,7 +52,6 @@ jobs: - uses: actions/checkout@v3 - uses: ./.github/actions/just-setup with: - cache-suffix: release-${{ matrix.t }} tools: cargo-auditable env: # just-setup use binstall to install sccache and cargo-auditable, diff --git a/justfile b/justfile index 9ed37dc5..383ddf4f 100644 --- a/justfile +++ b/justfile @@ -128,10 +128,12 @@ rustc-icf := if for-release != "" { # Only enable linker-plugin-lto for release # Also disable this on windows since it uses msvc. +# +# Temporarily disable this on linux due to mismatch llvm version +# } else if target-os == "linux" { +# "-C linker-plugin-lto " linker-plugin-lto := if for-release == "" { "" -} else if target-os == "linux" { - "-C linker-plugin-lto " } else { "" } @@ -169,7 +171,10 @@ toolchain components="": {{ if target != "" { "rustup target add " + target } else { "" } }} print-env: - echo "env RUSTFLAGS='$RUSTFLAGS', CARGO='$CARGO'" + @echo "env RUSTFLAGS='$RUSTFLAGS', CARGO='$CARGO'" + +print-rustflags: + @echo "$RUSTFLAGS" build: print-env {{cargo-bin}} build {{cargo-build-args}} From d9a2dd0177ee16528c90278e55dcb869c6c074dc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Jun 2023 04:35:28 +0000 Subject: [PATCH 1300/2020] Bump openssl from 0.10.53 to 0.10.54 (#1117) Bumps [openssl](https://github.com/sfackler/rust-openssl) from 0.10.53 to 0.10.54. - [Release notes](https://github.com/sfackler/rust-openssl/releases) - [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.53...openssl-v0.10.54) --- updated-dependencies: - dependency-name: openssl dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 18b9e65a..f31e2f1e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1484,9 +1484,9 @@ checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" [[package]] name = "openssl" -version = "0.10.53" +version = "0.10.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12df40a956736488b7b44fe79fe12d4f245bb5b3f5a1f6095e499760015be392" +checksum = "69b3f656a17a6cbc115b5c7a40c616947d213ba182135b014d6051b73ab6f019" dependencies = [ "bitflags", "cfg-if", From f1bfe236722711bda9bd407a97bfff9b716cdb6d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 2 Jun 2023 04:40:31 +0000 Subject: [PATCH 1301/2020] Bump cargo_toml from 0.15.2 to 0.15.3 (#1116) Bumps [cargo_toml](https://gitlab.com/crates.rs/cargo_toml) from 0.15.2 to 0.15.3. - [Commits](https://gitlab.com/crates.rs/cargo_toml/compare/v0.15.2...v0.15.3) --- updated-dependencies: - dependency-name: cargo_toml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f31e2f1e..1084ae56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -433,9 +433,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.15.2" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f83bc2e401ed041b7057345ebc488c005efa0341d5541ce7004d30458d0090b" +checksum = "599aa35200ffff8f04c1925aa1acc92fa2e08874379ef42e210a80e527e60838" dependencies = [ "serde", "toml", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index c3fce8b6..6d794014 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0" async-trait = "0.1.68" binstalk-downloader = { version = "0.5.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.4.0", path = "../binstalk-types" } -cargo_toml = "0.15.2" +cargo_toml = "0.15.3" command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.7", path = "../detect-targets" } From b876bdc8c7dbd43490dd00b74bf395782987fedf Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 3 Jun 2023 18:28:44 +1000 Subject: [PATCH 1302/2020] e2e-tests: Check version of installed crates (#1119) and also test `fetch_crate_cratesio_version_matched` in `e2e-tests/live.sh`. Signed-off-by: Jiahao XU --- e2e-tests/live.sh | 37 ++++++++++++++++++++++++++++++++----- e2e-tests/manifest-path.sh | 6 ++++++ e2e-tests/other-repos.sh | 16 ++++++++++++++++ e2e-tests/strategies.sh | 10 +++++++++- e2e-tests/subcrate.sh | 5 ++++- 5 files changed, 67 insertions(+), 7 deletions(-) diff --git a/e2e-tests/live.sh b/e2e-tests/live.sh index 1c8779eb..afeb092b 100755 --- a/e2e-tests/live.sh +++ b/e2e-tests/live.sh @@ -4,7 +4,11 @@ set -euxo pipefail unset CARGO_INSTALL_ROOT -crates="b3sum@1.3.3 cargo-release@0.24.9 cargo-binstall@0.20.1 cargo-watch@8.4.0 miniserve@0.23.0 sccache@0.3.3" +# - `b3sum@<=1.3.3` would test `fetch_crate_cratesio_version_matched` ability +# to find versions matching <= 1.3.3 +# - `cargo-quickinstall` would test `fetch_crate_cratesio_version_matched` ability +# to find latest stable version. +crates="b3sum@<=1.3.3 cargo-release@0.24.9 cargo-binstall@0.20.1 cargo-watch@8.4.0 miniserve@0.23.0 sccache@0.3.3 cargo-quickinstall" CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') export CARGO_HOME @@ -22,9 +26,32 @@ cargo binstall --no-confirm $crates rm -r "$othertmpdir" # Test that the installed binaries can be run -b3sum --version -cargo-release release --version +b3sum_version="$(b3sum --version)" +echo "$b3sum_version" + +[ "$b3sum_version" = "b3sum 1.3.3" ] + +cargo_release_version="$(cargo-release release --version)" +echo "$cargo_release_version" + +[ "$cargo_release_version" = "cargo-release 0.24.9" ] + cargo-binstall --help >/dev/null cargo binstall --help >/dev/null -cargo watch -V -miniserve -V + +cargo_binstall_version="$(cargo-binstall -V)" +echo "cargo-binstall version $cargo_binstall_version" + +[ "$cargo_binstall_version" = "0.20.1" ] + +cargo_watch_version="$(cargo watch -V)" +echo "$cargo_watch_version" + +[ "$cargo_watch_version" = "cargo-watch 8.4.0" ] + +miniserve_version="$(miniserve -V)" +echo "$miniserve_version" + +[ "$miniserve_version" = "miniserve 0.23.0" ] + +cargo-quickinstall -V diff --git a/e2e-tests/manifest-path.sh b/e2e-tests/manifest-path.sh index a353100c..88cefad6 100755 --- a/e2e-tests/manifest-path.sh +++ b/e2e-tests/manifest-path.sh @@ -11,5 +11,11 @@ export PATH="$CARGO_HOME/bin:$PATH" # Install binaries using `--manifest-path` # Also test default github template "./$1" binstall --force --manifest-path "manifests/github-test-Cargo.toml" --no-confirm cargo-binstall + # Test that the installed binaries can be run cargo binstall --help >/dev/null + +cargo_binstall_version="$(cargo binstall -V)" +echo "$cargo_binstall_version" + +[ "$cargo_binstall_version" = "cargo-binstall 0.12.0" ] diff --git a/e2e-tests/other-repos.sh b/e2e-tests/other-repos.sh index f88b3966..917a21aa 100755 --- a/e2e-tests/other-repos.sh +++ b/e2e-tests/other-repos.sh @@ -24,6 +24,14 @@ export PATH="$CARGO_HOME/bin:$PATH" --disable-strategies compile \ cargo-binstall +# Test that the installed binaries can be run +cargo binstall --help >/dev/null + +cargo_binstall_version="$(cargo binstall -V)" +echo "$cargo_binstall_version" + +[ "$cargo_binstall_version" = "cargo-binstall 0.12.0" ] + # Test default Github pkg-url templates, # with bin-dir provided "./$1" binstall \ @@ -32,3 +40,11 @@ export PATH="$CARGO_HOME/bin:$PATH" --no-confirm \ --disable-strategies compile \ cargo-binstall + +# Test that the installed binaries can be run +cargo binstall --help >/dev/null + +cargo_binstall_version="$(cargo binstall -V)" +echo "$cargo_binstall_version" + +[ "$cargo_binstall_version" = "cargo-binstall 0.12.0" ] diff --git a/e2e-tests/strategies.sh b/e2e-tests/strategies.sh index 355a3f92..1a91c894 100755 --- a/e2e-tests/strategies.sh +++ b/e2e-tests/strategies.sh @@ -1,6 +1,6 @@ #!/bin/bash -set -uxo pipefail +set -euxo pipefail unset CARGO_INSTALL_ROOT @@ -9,18 +9,26 @@ export CARGO_HOME export PATH="$CARGO_HOME/bin:$PATH" ## Test --disable-strategies +set +e + "./$1" binstall --no-confirm --disable-strategies quick-install,compile cargo-update@11.1.2 exit_code="$?" +set -e + if [ "$exit_code" != 94 ]; then echo "Expected exit code 94, but actual exit code $exit_code" exit 1 fi ## Test --strategies +set +e + "./$1" binstall --no-confirm --strategies crate-meta-data cargo-update@11.1.2 exit_code="$?" +set -e + if [ "$exit_code" != 94 ]; then echo "Expected exit code 94, but actual exit code $exit_code" exit 1 diff --git a/e2e-tests/subcrate.sh b/e2e-tests/subcrate.sh index f7b5dfc9..acaa96e0 100755 --- a/e2e-tests/subcrate.sh +++ b/e2e-tests/subcrate.sh @@ -15,4 +15,7 @@ cp "./$1" "$othertmpdir/bin/" cargo binstall --no-confirm cargo-audit@0.17.5 --strategies crate-meta-data -cargo audit --version +cargo_audit_version="$(cargo audit --version)" +echo "$cargo_audit_version" + +[ "$cargo_audit_version" = "cargo-audit 0.17.5" ] From a849db3ef400e38cbc1b0cf51a362e47b539fcf5 Mon Sep 17 00:00:00 2001 From: Aadi Desai <21363892+supleed2@users.noreply.github.com> Date: Sat, 3 Jun 2023 10:15:11 +0100 Subject: [PATCH 1303/2020] Add one-liner for installing `cargo-binstall` on Windows (#1099) * Add one-liner for installing `cargo-binstall` on Windows * Change command separator to semicolon `&&` was added in Powershell 7 * Update win install script to exit on error and trace --- README.md | 6 ++++++ install-from-binstall-release.ps1 | 25 +++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 install-from-binstall-release.ps1 diff --git a/README.md b/README.md index 28da9e6f..a70ef72f 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,12 @@ Here are the one-liners for installing pre-compiled `cargo-binstall` binary from curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash ``` +And the one-liner for installing a pre-compiled `cargo-binstall` binary from release on Windows (x86_64 and aarch64): + +``` +Set-ExecutionPolicy Unrestricted -Scope Process; iex (iwr "https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.ps1").Content +``` + To get started _using_ `cargo-binstall` first install the binary (either via `cargo install cargo-binstall` or by downloading a pre-compiled [release](https://github.com/cargo-bins/cargo-binstall/releases)), then extract it using `tar` or `unzip` and move it into `$HOME/.cargo/bin`. We recommend using the pre-compiled ones because we optimize those more than a standard source build does. diff --git a/install-from-binstall-release.ps1 b/install-from-binstall-release.ps1 new file mode 100644 index 00000000..f4fad50c --- /dev/null +++ b/install-from-binstall-release.ps1 @@ -0,0 +1,25 @@ +$ErrorActionPreference = "Stop" +Set-PSDebug -Trace 1 +$tmpdir = $Env:TEMP +$base_url = "https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-" +$type = (Get-ComputerInfo).CsSystemType.ToLower() +if ($type.StartsWith("x64")) { + $arch = "x86_64" +} elseif ($type.StartsWith("arm64")) { + $arch = "aarch64" +} else { + Write-Host "Unsupported Architecture: $type" -ForegroundColor Red + [Environment]::Exit(1) +} +$url = "$base_url$arch-pc-windows-msvc.zip" +Invoke-WebRequest $url -OutFile $tmpdir\cargo-binstall.zip +Expand-Archive -Force $tmpdir\cargo-binstall.zip $tmpdir\cargo-binstall +Write-Host "" +Invoke-Expression "$tmpdir\cargo-binstall\cargo-binstall.exe -y --force cargo-binstall" +Remove-Item -Force $tmpdir\cargo-binstall.zip +Remove-Item -Recurse -Force $tmpdir\cargo-binstall +if ($Env:Path -split ";" -notcontains "$HOME\.cargo\bin") { + Write-Host "" + Write-Host "Your path is missing $HOME\.cargo\bin, you might want to add it." -ForegroundColor Red + Write-Host "" +} From 1432093dcc39f3abcee9432ba48f4cf0310933cb Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 3 Jun 2023 19:15:18 +1000 Subject: [PATCH 1304/2020] feat: Add new cmdline option `--no-track` (#1111) Same as `cargo-install`'s `--no-track`. It is also passed to `cargo-install` if it is invoked. Also fixed `fs::atomic_symlink_file` which on Windows could fallback to non-atomic install if symlinking failed. Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 15 +++ crates/bin/src/entry.rs | 8 +- crates/binstalk/src/bins.rs | 53 +++++++-- crates/binstalk/src/fs.rs | 110 +++++++++++++----- crates/binstalk/src/ops.rs | 1 + crates/binstalk/src/ops/resolve/resolution.rs | 19 ++- e2e-tests/no-track.sh | 28 +++++ justfile | 3 +- 8 files changed, 194 insertions(+), 43 deletions(-) create mode 100644 e2e-tests/no-track.sh diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index cb914561..7c27588c 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -172,6 +172,21 @@ pub struct Args { #[clap(help_heading = "Options", long)] pub no_cleanup: bool, + /// By default, binstall keeps track of the installed packages with metadata files + /// stored in the installation root directory. + /// + /// This flag tells binstall not to use or create that file. + /// + /// With this flag, binstall will refuse to overwrite any existing files unless the + /// `--force` flag is used. + /// + /// This also disables binstall’s ability to protect against multiple concurrent + /// invocations of binstall installing at the same time. + /// + /// This flag will also be passed to `cargo-install` if it is invoked. + #[clap(help_heading = "Options", long)] + pub no_track: bool, + /// Install binaries in a custom location. /// /// By default, binaries are installed to the global location `$CARGO_HOME/bin`, and global diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 1eb7b61b..5818ae3c 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -59,7 +59,7 @@ pub fn install_crates( // Compute paths let cargo_root = args.root; let (install_path, mut manifests, temp_dir) = - compute_paths_and_load_manifests(cargo_root.clone(), args.install_path)?; + compute_paths_and_load_manifests(cargo_root.clone(), args.install_path, args.no_track)?; // Remove installed crates let mut crate_names = @@ -101,6 +101,7 @@ pub fn install_crates( force: args.force, quiet: args.log_level == Some(LevelFilter::Off), locked: args.locked, + no_track: args.no_track, version_req: args.version_req, manifest_path: args.manifest_path, @@ -234,6 +235,7 @@ fn read_root_certs(root_certificate_paths: Vec) -> impl Iterator, install_path: Option, + no_track: bool, ) -> Result<(PathBuf, Option, tempfile::TempDir)> { // Compute cargo_roots let cargo_roots = install_path::get_cargo_roots_path(roots).ok_or_else(|| { @@ -251,8 +253,10 @@ fn compute_paths_and_load_manifests( fs::create_dir_all(&install_path).map_err(BinstallError::Io)?; debug!("Using install path: {}", install_path.display()); + let no_manifests = no_track || custom_install_path; + // Load manifests - let manifests = if !custom_install_path { + let manifests = if !no_manifests { Some(Manifests::open_exclusive(&cargo_roots)?) } else { None diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 0b95ef76..939afb96 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -11,7 +11,10 @@ use tracing::debug; use crate::{ errors::BinstallError, - fs::{atomic_install, atomic_symlink_file}, + fs::{ + atomic_install, atomic_install_noclobber, atomic_symlink_file, + atomic_symlink_file_noclobber, + }, helpers::download::ExtractedFiles, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; @@ -180,28 +183,48 @@ impl BinFile { } } - pub fn install_bin(&self) -> Result<(), BinstallError> { + fn pre_install_bin(&self) -> Result<(), BinstallError> { if !self.source.try_exists()? { return Err(BinstallError::BinFileNotFound(self.source.clone())); } - debug!( - "Atomically install file from '{}' to '{}'", - self.source.display(), - self.dest.display() - ); - #[cfg(unix)] std::fs::set_permissions( &self.source, std::os::unix::fs::PermissionsExt::from_mode(0o755), )?; + Ok(()) + } + + pub fn install_bin(&self) -> Result<(), BinstallError> { + self.pre_install_bin()?; + + debug!( + "Atomically install file from '{}' to '{}'", + self.source.display(), + self.dest.display() + ); + atomic_install(&self.source, &self.dest)?; Ok(()) } + pub fn install_bin_noclobber(&self) -> Result<(), BinstallError> { + self.pre_install_bin()?; + + debug!( + "Installing file from '{}' to '{}' only if dst not exists", + self.source.display(), + self.dest.display() + ); + + atomic_install_noclobber(&self.source, &self.dest)?; + + Ok(()) + } + pub fn install_link(&self) -> Result<(), BinstallError> { if let Some(link) = &self.link { let dest = self.link_dest(); @@ -216,6 +239,20 @@ impl BinFile { Ok(()) } + pub fn install_link_noclobber(&self) -> Result<(), BinstallError> { + if let Some(link) = &self.link { + let dest = self.link_dest(); + debug!( + "Create link '{}' pointing to '{}' only if dst not exists", + link.display(), + dest.display() + ); + atomic_symlink_file_noclobber(dest, link)?; + } + + Ok(()) + } + fn link_dest(&self) -> &Path { if cfg!(target_family = "unix") { Path::new(self.dest.file_name().unwrap()) diff --git a/crates/binstalk/src/fs.rs b/crates/binstalk/src/fs.rs index abf5c959..7681c569 100644 --- a/crates/binstalk/src/fs.rs +++ b/crates/binstalk/src/fs.rs @@ -3,6 +3,54 @@ use std::{fs, io, path::Path}; use tempfile::{NamedTempFile, TempPath}; use tracing::{debug, warn}; +fn copy_to_tempfile(src: &Path, dst: &Path) -> io::Result { + let mut src_file = fs::File::open(src)?; + + let parent = dst.parent().unwrap(); + debug!("Creating named tempfile at '{}'", parent.display()); + let mut tempfile = NamedTempFile::new_in(parent)?; + + debug!( + "Copying from '{}' to '{}'", + src.display(), + tempfile.path().display() + ); + io::copy(&mut src_file, tempfile.as_file_mut())?; + + debug!("Retrieving permissions of '{}'", src.display()); + let permissions = src_file.metadata()?.permissions(); + + debug!( + "Setting permissions of '{}' to '{permissions:#?}'", + tempfile.path().display() + ); + tempfile.as_file().set_permissions(permissions)?; + + Ok(tempfile) +} + +/// Install a file. +/// +/// This is a blocking function, must be called in `block_in_place` mode. +pub fn atomic_install_noclobber(src: &Path, dst: &Path) -> io::Result<()> { + debug!( + "Attempting to rename from '{}' to '{}'.", + src.display(), + dst.display() + ); + + let tempfile = copy_to_tempfile(src, dst)?; + + debug!( + "Persisting '{}' to '{}', fail if dst already exists", + tempfile.path().display(), + dst.display() + ); + tempfile.persist_noclobber(dst)?; + + Ok(()) +} + /// Atomically install a file. /// /// This is a blocking function, must be called in `block_in_place` mode. @@ -33,29 +81,7 @@ pub fn atomic_install(src: &Path, dst: &Path) -> io::Result<()> { // Fallback to creating NamedTempFile on the parent dir of // dst. - let mut src_file = fs::File::open(src)?; - - let parent = dst.parent().unwrap(); - debug!("Creating named tempfile at '{}'", parent.display()); - let mut tempfile = NamedTempFile::new_in(parent)?; - - debug!( - "Copying from '{}' to '{}'", - src.display(), - tempfile.path().display() - ); - io::copy(&mut src_file, tempfile.as_file_mut())?; - - debug!("Retrieving permissions of '{}'", src.display()); - let permissions = src_file.metadata()?.permissions(); - - debug!( - "Setting permissions of '{}' to '{permissions:#?}'", - tempfile.path().display() - ); - tempfile.as_file().set_permissions(permissions)?; - - persist(tempfile.into_temp_path(), dst)?; + persist(copy_to_tempfile(src, dst)?.into_temp_path(), dst)?; } else { debug!("Attempting at atomically succeeded."); } @@ -63,17 +89,30 @@ pub fn atomic_install(src: &Path, dst: &Path) -> io::Result<()> { Ok(()) } -fn symlink_file(original: &Path, link: &Path) -> io::Result<()> { +fn symlink_file_inner(dest: &Path, link: &Path) -> io::Result<()> { #[cfg(target_family = "unix")] - std::os::unix::fs::symlink(original, link)?; + std::os::unix::fs::symlink(dest, link)?; - // Symlinks on Windows are disabled in some editions, so creating one is unreliable. #[cfg(target_family = "windows")] - std::os::windows::fs::symlink_file(original, link) - .or_else(|_| std::fs::copy(original, link).map(drop))?; + std::os::windows::fs::symlink_file(dest, link)?; + Ok(()) } +pub fn atomic_symlink_file_noclobber(dest: &Path, link: &Path) -> io::Result<()> { + match symlink_file_inner(dest, link) { + Ok(_) => Ok(()), + + #[cfg(target_family = "windows")] + // Symlinks on Windows are disabled in some editions, so creating one is unreliable. + // Fallback to copy if it fails. + Err(_) => atomic_install_noclobber(dest, link), + + #[cfg(not(target_family = "windows"))] + Err(err) => Err(err), + } +} + /// Atomically install symlink "link" to a file "dst". /// /// This is a blocking function, must be called in `block_in_place` mode. @@ -82,6 +121,8 @@ pub fn atomic_symlink_file(dest: &Path, link: &Path) -> io::Result<()> { debug!("Creating tempPath at '{}'", parent.display()); let temp_path = NamedTempFile::new_in(parent)?.into_temp_path(); + // Remove this file so that we can create a symlink + // with the name. fs::remove_file(&temp_path)?; debug!( @@ -89,9 +130,18 @@ pub fn atomic_symlink_file(dest: &Path, link: &Path) -> io::Result<()> { temp_path.display(), dest.display() ); - symlink_file(dest, &temp_path)?; - persist(temp_path, link) + match symlink_file_inner(dest, &temp_path) { + Ok(_) => persist(temp_path, link), + + #[cfg(target_family = "windows")] + // Symlinks on Windows are disabled in some editions, so creating one is unreliable. + // Fallback to copy if it fails. + Err(_) => atomic_install(dest, link), + + #[cfg(not(target_family = "windows"))] + Err(err) => Err(err), + } } fn persist(temp_path: TempPath, to: &Path) -> io::Result<()> { diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index 67b33a38..58affa67 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -25,6 +25,7 @@ pub struct Options { pub force: bool, pub quiet: bool, pub locked: bool, + pub no_track: bool, pub version_req: Option, pub manifest_path: Option, diff --git a/crates/binstalk/src/ops/resolve/resolution.rs b/crates/binstalk/src/ops/resolve/resolution.rs index 1a0b2ea6..968c7403 100644 --- a/crates/binstalk/src/ops/resolve/resolution.rs +++ b/crates/binstalk/src/ops/resolve/resolution.rs @@ -51,15 +51,26 @@ impl Resolution { impl ResolutionFetch { pub fn install(self, opts: &Options) -> Result { + type InstallFp = fn(&bins::BinFile) -> Result<(), BinstallError>; + + let (install_bin, install_link): (InstallFp, InstallFp) = match (opts.no_track, opts.force) + { + (true, true) | (false, _) => (bins::BinFile::install_bin, bins::BinFile::install_link), + (true, false) => ( + bins::BinFile::install_bin_noclobber, + bins::BinFile::install_link_noclobber, + ), + }; + info!("Installing binaries..."); for file in &self.bin_files { - file.install_bin()?; + install_bin(file)?; } // Generate symlinks if !opts.no_symlinks { for file in &self.bin_files { - file.install_link()?; + install_link(file)?; } } @@ -158,6 +169,10 @@ impl ResolutionSource { cmd.arg("--root").arg(cargo_root); } + if opts.no_track { + cmd.arg("--no-track"); + } + if !opts.dry_run { let mut child = opts .jobserver_client diff --git a/e2e-tests/no-track.sh b/e2e-tests/no-track.sh new file mode 100644 index 00000000..18cc91e2 --- /dev/null +++ b/e2e-tests/no-track.sh @@ -0,0 +1,28 @@ +#!/bin/bash + +set -euxo pipefail + +unset CARGO_INSTALL_ROOT + +CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export CARGO_HOME +export PATH="$CARGO_HOME/bin:$PATH" + +"./$1" binstall -y cargo-binstall@0.20.1 +cargo-binstall --help >/dev/null + +set +e + +"./$1" binstall -y --no-track cargo-binstall@0.20.1 +exit_code="$?" + +set -e + +if [ "$exit_code" != 74 ]; then + echo "Expected exit code 74 Io Error, but actual exit code $exit_code" + exit 1 +fi + + +"./$1" binstall -y --no-track --force cargo-binstall@0.20.1 +cargo-binstall --help >/dev/null diff --git a/justfile b/justfile index 383ddf4f..3a1d3f06 100644 --- a/justfile +++ b/justfile @@ -202,6 +202,7 @@ e2e-test-version-syntax: (e2e-test "version-syntax") e2e-test-upgrade: (e2e-test "upgrade") e2e-test-self-upgrade-no-symlink: (e2e-test "self-upgrade-no-symlink") e2e-test-uninstall: (e2e-test "uninstall") +e2e-test-no-track: (e2e-test "no-track") # WinTLS (Windows in CI) does not have TLS 1.3 support [windows] @@ -210,7 +211,7 @@ e2e-test-tls: (e2e-test "tls" "1.2") [macos] e2e-test-tls: (e2e-test "tls" "1.2") (e2e-test "tls" "1.3") -e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate +e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate e2e-test-no-track unit-tests: print-env {{cargo-bin}} test {{cargo-build-args}} From 351b9d074a1ab2589971ac232be9e23177bf44e1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 3 Jun 2023 20:42:00 +1000 Subject: [PATCH 1305/2020] dep: Update base64 and clap (#1120) - base64 v0.21.0 -> v0.21.2, rollback msrv to 1.57 - clap v4.3.0 -> v4.3.1, (derive) Reduce the amount of generated code - clap_builder v4.3.0 -> v4.3.1 - clap_derive v4.3.0 -> v4.3.1 Signed-off-by: Jiahao XU --- Cargo.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1084ae56..b72f6821 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -201,9 +201,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.0" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" +checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" [[package]] name = "beef" @@ -467,9 +467,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.0" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93aae7a4192245f70fe75dd9157fc7b4a5bf53e88d30bd4396f7d8f9284d5acc" +checksum = "b4ed2379f8603fa2b7509891660e802b88c70a79a6427a70abb5968054de2c28" dependencies = [ "clap_builder", "clap_derive", @@ -478,9 +478,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.0" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f423e341edefb78c9caba2d9c7f7687d0e72e89df3ce3394554754393ac3990" +checksum = "72394f3339a76daf211e57d4bcb374410f3965dcc606dd0e03738c7888766980" dependencies = [ "anstream", "anstyle", @@ -491,9 +491,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.0" +version = "4.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "191d9573962933b4027f932c600cd252ce27a8ad5979418fe78e43c07996f27b" +checksum = "59e9ef9a08ee1c0e1f2e162121665ac45ac3783b0f897db7244ae75ad9a8f65b" dependencies = [ "heck", "proc-macro2", @@ -1777,7 +1777,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" dependencies = [ "async-compression 0.4.0", - "base64 0.21.0", + "base64 0.21.2", "bytes", "encoding_rs", "futures-core", @@ -1921,7 +1921,7 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" dependencies = [ - "base64 0.21.0", + "base64 0.21.2", ] [[package]] From 2acba14b41455e803797abfcf4b223d16fa9a788 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 4 Jun 2023 12:29:42 +1000 Subject: [PATCH 1306/2020] `GhApiClient`: Fallback to unauthorized mode if auth token is invalid (#1121) Fixed #850 Signed-off-by: Jiahao XU --- .../binstalk-downloader/src/gh_api_client.rs | 94 ++++++++++++------- .../src/gh_api_client/request.rs | 2 +- 2 files changed, 61 insertions(+), 35 deletions(-) diff --git a/crates/binstalk-downloader/src/gh_api_client.rs b/crates/binstalk-downloader/src/gh_api_client.rs index 722e0074..014b2320 100644 --- a/crates/binstalk-downloader/src/gh_api_client.rs +++ b/crates/binstalk-downloader/src/gh_api_client.rs @@ -1,7 +1,10 @@ use std::{ collections::HashMap, ops::Deref, - sync::{Arc, Mutex, RwLock}, + sync::{ + atomic::{AtomicBool, Ordering::Relaxed}, + Arc, Mutex, RwLock, + }, time::{Duration, Instant}, }; @@ -87,9 +90,11 @@ where #[derive(Debug)] struct Inner { client: remote::Client, - auth_token: Option, release_artifacts: Map>>, retry_after: Mutex>, + + auth_token: Option, + is_auth_token_valid: AtomicBool, } /// Github API client for querying whether a release artifact exitsts. @@ -116,11 +121,47 @@ impl GhApiClient { Self(Arc::new(Inner { client, - auth_token, release_artifacts: Default::default(), retry_after: Default::default(), + + auth_token, + is_auth_token_valid: AtomicBool::new(true), })) } +} + +enum FetchReleaseArtifactError { + Error(GhApiError), + RateLimit { retry_after: Instant }, + Unauthorized, +} + +impl GhApiClient { + async fn do_fetch_release_artifacts( + &self, + release: &GhRelease, + auth_token: Option<&str>, + ) -> Result, FetchReleaseArtifactError> { + use request::FetchReleaseRet::*; + use FetchReleaseArtifactError as Error; + + match request::fetch_release_artifacts(&self.0.client, release, auth_token).await { + Ok(ReleaseNotFound) => Ok(None), + Ok(Artifacts(artifacts)) => Ok(Some(artifacts)), + Ok(ReachedRateLimit { retry_after }) => { + let retry_after = retry_after.unwrap_or(DEFAULT_RETRY_DURATION); + + let now = Instant::now(); + let retry_after = now + .checked_add(retry_after) + .unwrap_or_else(|| now + DEFAULT_RETRY_DURATION); + + Err(Error::RateLimit { retry_after }) + } + Ok(Unauthorized) => Err(Error::Unauthorized), + Err(err) => Err(Error::Error(err)), + } + } /// The returned future is guaranteed to be pointer size. pub async fn has_release_artifact( @@ -130,24 +171,18 @@ impl GhApiClient { artifact_name, }: GhReleaseArtifact, ) -> Result { - enum Failure { - Error(GhApiError), - RateLimit { retry_after: Instant }, - Unauthorized, - } + use FetchReleaseArtifactError as Error; let once_cell = self.0.release_artifacts.get(release.clone()); let res = once_cell .get_or_try_init(|| { Box::pin(async { - use request::FetchReleaseRet::*; - { let mut guard = self.0.retry_after.lock().unwrap(); if let Some(retry_after) = *guard { if retry_after.elapsed().is_zero() { - return Err(Failure::RateLimit { retry_after }); + return Err(Error::RateLimit { retry_after }); } else { // Instant retry_after is already reached. *guard = None; @@ -155,28 +190,19 @@ impl GhApiClient { }; } - match request::fetch_release_artifacts( - &self.0.client, - release, - self.0.auth_token.as_deref(), - ) - .await - { - Ok(ReleaseNotFound) => Ok::<_, Failure>(None), - Ok(Artifacts(artifacts)) => Ok(Some(artifacts)), - Ok(ReachedRateLimit { retry_after }) => { - let retry_after = retry_after.unwrap_or(DEFAULT_RETRY_DURATION); - - let now = Instant::now(); - let retry_after = now - .checked_add(retry_after) - .unwrap_or_else(|| now + DEFAULT_RETRY_DURATION); - - Err(Failure::RateLimit { retry_after }) + if self.0.is_auth_token_valid.load(Relaxed) { + match self + .do_fetch_release_artifacts(&release, self.0.auth_token.as_deref()) + .await + { + Err(Error::Unauthorized) => { + self.0.is_auth_token_valid.store(false, Relaxed); + } + res => return res, } - Ok(Unauthorized) => Err(Failure::Unauthorized), - Err(err) => Err(Failure::Error(err)), } + + self.do_fetch_release_artifacts(&release, None).await }) }) .await; @@ -191,13 +217,13 @@ impl GhApiClient { }) } Ok(None) => Ok(HasReleaseArtifact::NoSuchRelease), - Err(Failure::Unauthorized) => Ok(HasReleaseArtifact::Unauthorized), - Err(Failure::RateLimit { retry_after }) => { + Err(Error::Unauthorized) => Ok(HasReleaseArtifact::Unauthorized), + Err(Error::RateLimit { retry_after }) => { *self.0.retry_after.lock().unwrap() = Some(retry_after); Ok(HasReleaseArtifact::RateLimit { retry_after }) } - Err(Failure::Error(err)) => Err(err), + Err(Error::Error(err)) => Err(err), } } } diff --git a/crates/binstalk-downloader/src/gh_api_client/request.rs b/crates/binstalk-downloader/src/gh_api_client/request.rs index 98999449..a4e9363b 100644 --- a/crates/binstalk-downloader/src/gh_api_client/request.rs +++ b/crates/binstalk-downloader/src/gh_api_client/request.rs @@ -83,7 +83,7 @@ pub(super) enum FetchReleaseRet { /// Returns 404 if not found pub(super) async fn fetch_release_artifacts( client: &remote::Client, - GhRelease { owner, repo, tag }: GhRelease, + GhRelease { owner, repo, tag }: &GhRelease, auth_token: Option<&str>, ) -> Result { let mut request_builder = client From e87e3534a8102353be4f90b0ce35f72dfb563d5c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 4 Jun 2023 13:58:05 +1000 Subject: [PATCH 1307/2020] detect-targets: Add fallback to windows (#650) Fixed #642 * Add new dep windows-sys v0.42.0 for win only * Add new dep windows-dll v0.4.1 for win only * Add x86_64 fallback targets for windows * Add x86 fallback targets for windows * Add arm32 fallback targets for windows * Add arm64 fallback targets for windows * Add gnu/gnu-llvm fallback targets for windows Signed-off-by: Jiahao XU --- Cargo.lock | 81 +++++++++++++- crates/detect-targets/Cargo.toml | 4 + crates/detect-targets/src/detect/windows.rs | 113 +++++++++++++++++++- 3 files changed, 193 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b72f6821..a2f8b950 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -243,7 +243,7 @@ dependencies = [ "tokio", "tracing", "url", - "windows", + "windows 0.48.0", "xz2", ] @@ -596,6 +596,8 @@ dependencies = [ "cfg-if", "guess_host_triple", "tokio", + "windows-dll", + "windows-sys 0.42.0", ] [[package]] @@ -1617,6 +1619,16 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit", +] + [[package]] name = "proc-macro2" version = "1.0.59" @@ -2857,6 +2869,19 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08746b4b7ac95f708b3cccceb97b7f9a21a8916dd47fc99b0e6aaf7208f26fd7" +dependencies = [ + "windows_aarch64_msvc 0.35.0", + "windows_i686_gnu 0.35.0", + "windows_i686_msvc 0.35.0", + "windows_x86_64_gnu 0.35.0", + "windows_x86_64_msvc 0.35.0", +] + [[package]] name = "windows" version = "0.48.0" @@ -2866,6 +2891,30 @@ dependencies = [ "windows-targets 0.48.0", ] +[[package]] +name = "windows-dll" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0895e287d32aad509d5720ea1975e5d22b2fa51fc3e1f94163cdb73b185b5555" +dependencies = [ + "once_cell", + "thiserror", + "windows 0.35.0", + "windows-dll-codegen", +] + +[[package]] +name = "windows-dll-codegen" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7c2f703a1e16b2447f1ce6c6a7c9231535fef0ca2e260f4bc69ecc8e06b208b" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "windows-sys" version = "0.42.0" @@ -2941,6 +2990,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db3bc5134e8ce0da5d64dcec3529793f1d33aee5a51fc2b4662e0f881dd463e6" + [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -2953,6 +3008,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +[[package]] +name = "windows_i686_gnu" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0343a6f35bf43a07b009b8591b78b10ea03de86b06f48e28c96206cd0f453b50" + [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -2965,6 +3026,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +[[package]] +name = "windows_i686_msvc" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1acdcbf4ca63d8e7a501be86fee744347186275ec2754d129ddeab7a1e3a02e4" + [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -2977,6 +3044,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +[[package]] +name = "windows_x86_64_gnu" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "893c0924c5a990ec73cd2264d1c0cba1773a929e1a3f5dbccffd769f8c4edebb" + [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -3001,6 +3074,12 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +[[package]] +name = "windows_x86_64_msvc" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a29bd61f32889c822c99a8fdf2e93378bd2fae4d7efd2693fab09fcaaf7eff4b" + [[package]] name = "windows_x86_64_msvc" version = "0.42.2" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 1f5d7a58..56d49dc5 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -14,5 +14,9 @@ tokio = { version = "1.28.2", features = ["rt", "process", "sync"], default-feat cfg-if = "1.0.0" guess_host_triple = "0.1.3" +[target.'cfg(target_os = "windows")'.dependencies] +windows-sys = { version = "0.42.0", features = ["Win32_System_Threading", "Win32_System_SystemInformation", "Win32_Foundation"] } +windows-dll = { version = "0.4.1", features = ["windows"], default-features = false } + [dev-dependencies] tokio = { version = "1.28.2", features = ["macros"], default-features = false } diff --git a/crates/detect-targets/src/detect/windows.rs b/crates/detect-targets/src/detect/windows.rs index 04e86428..e4178796 100644 --- a/crates/detect-targets/src/detect/windows.rs +++ b/crates/detect-targets/src/detect/windows.rs @@ -1,6 +1,111 @@ -pub(super) fn detect_alternative_targets(target: &str) -> Option { - let (prefix, abi) = target.rsplit_once('-')?; +use std::mem; +use windows_dll::dll; +use windows_sys::{ + core::HRESULT, + Win32::System::{ + SystemInformation::{ + IMAGE_FILE_MACHINE, IMAGE_FILE_MACHINE_AMD64, IMAGE_FILE_MACHINE_ARM, + IMAGE_FILE_MACHINE_ARM64, IMAGE_FILE_MACHINE_I386, + }, + Threading::{UserEnabled, Wow64Container, MACHINE_ATTRIBUTES}, + }, +}; - // detect abi in ["gnu", "gnullvm", ...] - (abi != "msvc").then(|| format!("{prefix}-msvc")) +#[dll("Kernel32")] +extern "system" { + #[allow(non_snake_case)] + #[fallible] + fn GetMachineTypeAttributes( + machine: IMAGE_FILE_MACHINE, + machine_attributes: *mut MACHINE_ATTRIBUTES, + ) -> HRESULT; +} + +fn is_arch_supported(arch: IMAGE_FILE_MACHINE) -> bool { + let mut machine_attributes = mem::MaybeUninit::uninit(); + + // SAFETY: GetMachineTypeAttributes takes type IMAGE_FILE_MACHINE + // plus it takes a pointer to machine_attributes which is only + // written to. + match unsafe { GetMachineTypeAttributes(arch, machine_attributes.as_mut_ptr()) } { + Ok(0) => { + // SAFETY: Symbol GetMachineTypeAttributes exists and calls to it + // succceeds. + // + // Thus, machine_attributes is initialized. + let machine_attributes = unsafe { machine_attributes.assume_init() }; + + (machine_attributes & (Wow64Container | UserEnabled)) != 0 + } + _ => false, + } +} + +pub(super) fn detect_alternative_targets(target: &str) -> impl Iterator { + let (prefix, abi) = target + .rsplit_once('-') + .expect("unwrap: target always has a -"); + + let arch = prefix + .split_once('-') + .expect("unwrap: target always has at least two -") + .0; + + let msvc_fallback_target = (abi != "msvc").then(|| format!("{prefix}-msvc")); + + let gnu_fallback_targets = (abi == "msvc") + .then(|| [format!("{prefix}-gnu"), format!("{prefix}-gnullvm")]) + .into_iter() + .flatten(); + + let x64_fallback_targets = (arch != "x86_64" && is_arch_supported(IMAGE_FILE_MACHINE_AMD64)) + .then_some([ + "x86_64-pc-windows-msvc", + "x86_64-pc-windows-gnu", + "x86_64-pc-windows-gnullvm", + ]) + .into_iter() + .flatten() + .map(ToString::to_string); + + let x86_fallback_targets = (arch != "x86" && is_arch_supported(IMAGE_FILE_MACHINE_I386)) + .then_some([ + "i586-pc-windows-msvc", + "i586-pc-windows-gnu", + "i586-pc-windows-gnullvm", + "i686-pc-windows-msvc", + "i686-pc-windows-gnu", + "i686-pc-windows-gnullvm", + ]) + .into_iter() + .flatten() + .map(ToString::to_string); + + let arm32_fallback_targets = (arch != "thumbv7a" && is_arch_supported(IMAGE_FILE_MACHINE_ARM)) + .then_some([ + "thumbv7a-pc-windows-msvc", + "thumbv7a-pc-windows-gnu", + "thumbv7a-pc-windows-gnullvm", + ]) + .into_iter() + .flatten() + .map(ToString::to_string); + + let arm64_fallback_targets = (arch != "aarch64" && is_arch_supported(IMAGE_FILE_MACHINE_ARM64)) + .then_some([ + "aarch64-pc-windows-msvc", + "aarch64-pc-windows-gnu", + "aarch64-pc-windows-gnullvm", + ]) + .into_iter() + .flatten() + .map(ToString::to_string); + + msvc_fallback_target + .into_iter() + .chain(gnu_fallback_targets) + .chain(x64_fallback_targets) + .chain(x86_fallback_targets) + .chain(arm32_fallback_targets) + .chain(arm64_fallback_targets) } From 22b3419fce1ca40933ebaeaa5b7e70dcb4ae8cbf Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 5 Jun 2023 00:09:49 +1000 Subject: [PATCH 1308/2020] feat: Add GraphQL support to `GhApiClient` (#1124) Fixed #868 - Add new fn `remote::Client::post` - Add new fn `remote::RequestBuilder::body` - Re-export `reqwest::Body` in `remote` - Add dep percent-encoding v2.2.0 to binstalk-downloader - Add dep serde-tuple-vec-map v1.0.1 to binstalk-downloader - Add GraphQL to `GhApiClient`, fallback to Restful API if token is not provided or authorization failed. - Fixed `GhReleaseArtifact::try_extract_artifact_from_str`: decode percent encoded http url path and add regression tests - Added variant `GhApiError::Context` & `GhApiContextError` - Added variant `GhApiError::GraphQLErrors` & `GhGraphQLErrors` Signed-off-by: Jiahao XU --- Cargo.lock | 2 + crates/binstalk-downloader/Cargo.toml | 2 + .../binstalk-downloader/src/gh_api_client.rs | 205 +++++++--- .../src/gh_api_client/request.rs | 376 ++++++++++++++++-- crates/binstalk-downloader/src/remote.rs | 9 +- .../src/remote/request_builder.rs | 13 +- crates/binstalk/src/errors.rs | 8 +- crates/binstalk/src/helpers/remote.rs | 2 +- 8 files changed, 518 insertions(+), 99 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a2f8b950..08eb78b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -265,8 +265,10 @@ dependencies = [ "futures-util", "generic-array", "httpdate", + "percent-encoding", "reqwest", "serde", + "serde-tuple-vec-map", "serde_json", "tempfile", "thiserror", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 7d2ca12f..742a905d 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -24,7 +24,9 @@ futures-util = "0.3.28" generic-array = "0.14.7" httpdate = "1.0.2" reqwest = { version = "0.11.18", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } +percent-encoding = "2.2.0" serde = { version = "1.0.163", features = ["derive"], optional = true } +serde-tuple-vec-map = "1.0.1" serde_json = { version = "1.0.96", optional = true } # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. diff --git a/crates/binstalk-downloader/src/gh_api_client.rs b/crates/binstalk-downloader/src/gh_api_client.rs index 014b2320..a9e63f26 100644 --- a/crates/binstalk-downloader/src/gh_api_client.rs +++ b/crates/binstalk-downloader/src/gh_api_client.rs @@ -8,18 +8,43 @@ use std::{ time::{Duration, Instant}, }; -use compact_str::{CompactString, ToCompactString}; +use compact_str::CompactString; +use percent_encoding::{ + percent_decode_str, utf8_percent_encode, AsciiSet, PercentEncode, CONTROLS, +}; use tokio::sync::OnceCell; use tracing::{debug, warn}; use crate::remote; mod request; -pub use request::GhApiError; +pub use request::{GhApiContextError, GhApiError, GhGraphQLErrors}; /// default retry duration if x-ratelimit-reset is not found in response header const DEFAULT_RETRY_DURATION: Duration = Duration::from_secs(3); +fn percent_encode_http_url_path(path: &str) -> PercentEncode<'_> { + /// https://url.spec.whatwg.org/#fragment-percent-encode-set + const FRAGMENT: &AsciiSet = &CONTROLS.add(b' ').add(b'"').add(b'<').add(b'>').add(b'`'); + + /// https://url.spec.whatwg.org/#path-percent-encode-set + const PATH: &AsciiSet = &FRAGMENT.add(b'#').add(b'?').add(b'{').add(b'}'); + + const PATH_SEGMENT: &AsciiSet = &PATH.add(b'/').add(b'%'); + + // The backslash (\) character is treated as a path separator in special URLs + // so it needs to be additionally escaped in that case. + // + // http is considered to have special path. + const SPECIAL_PATH_SEGMENT: &AsciiSet = &PATH_SEGMENT.add(b'\\'); + + utf8_percent_encode(path, SPECIAL_PATH_SEGMENT) +} + +fn percent_decode_http_url_path(input: &str) -> CompactString { + percent_decode_str(input).decode_utf8_lossy().into() +} + /// The keys required to identify a github release. #[derive(Clone, Eq, PartialEq, Hash, Debug)] pub struct GhRelease { @@ -57,11 +82,11 @@ impl GhReleaseArtifact { (path_segments.next().is_none() && url.fragment().is_none() && url.query().is_none()).then( || Self { release: GhRelease { - owner: owner.to_compact_string(), - repo: repo.to_compact_string(), - tag: tag.to_compact_string(), + owner: percent_decode_http_url_path(owner), + repo: percent_decode_http_url_path(repo), + tag: percent_decode_http_url_path(tag), }, - artifact_name: artifact_name.to_compact_string(), + artifact_name: percent_decode_http_url_path(artifact_name), }, ) } @@ -258,6 +283,8 @@ pub enum HasReleaseArtifact { #[cfg(test)] mod test { use super::*; + use compact_str::{CompactString, ToCompactString}; + use std::env; mod cargo_binstall_v0_20_1 { use super::{CompactString, GhRelease}; @@ -347,35 +374,52 @@ mod test { /// Mark this as an async fn so that you won't accidentally use it in /// sync context. - async fn create_client() -> GhApiClient { - GhApiClient::new( - remote::Client::new( - concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), - None, - Duration::from_millis(10), - 1.try_into().unwrap(), - [], - ) - .unwrap(), + async fn create_client() -> Vec { + let client = remote::Client::new( + concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), None, + Duration::from_millis(10), + 1.try_into().unwrap(), + [], ) + .unwrap(); + + let mut gh_clients = vec![GhApiClient::new(client.clone(), None)]; + + if let Ok(token) = env::var("GITHUB_TOKEN") { + gh_clients.push(GhApiClient::new(client, Some(token.into()))); + } + + gh_clients } - #[tokio::test] - async fn test_gh_api_client_cargo_binstall_v0_20_1() { - let client = create_client().await; + async fn test_specific_release(release: &GhRelease, artifacts: &[&str]) { + for client in create_client().await { + eprintln!("In client {client:?}"); - let release = cargo_binstall_v0_20_1::RELEASE; + for artifact_name in artifacts { + let ret = client + .has_release_artifact(GhReleaseArtifact { + release: release.clone(), + artifact_name: artifact_name.to_compact_string(), + }) + .await + .unwrap(); - let artifacts = cargo_binstall_v0_20_1::ARTIFACTS - .iter() - .map(ToCompactString::to_compact_string); + assert!( + matches!( + ret, + HasReleaseArtifact::Yes | HasReleaseArtifact::RateLimit { .. } + ), + "for '{artifact_name}': answer is {:#?}", + ret + ); + } - for artifact_name in artifacts { let ret = client .has_release_artifact(GhReleaseArtifact { release: release.clone(), - artifact_name, + artifact_name: "123z".to_compact_string(), }) .await .unwrap(); @@ -383,58 +427,91 @@ mod test { assert!( matches!( ret, - HasReleaseArtifact::Yes | HasReleaseArtifact::RateLimit { .. } + HasReleaseArtifact::No | HasReleaseArtifact::RateLimit { .. } ), "ret = {:#?}", ret ); } + } - let ret = client - .has_release_artifact(GhReleaseArtifact { - release, - artifact_name: "123z".to_compact_string(), - }) - .await - .unwrap(); - - assert!( - matches!( - ret, - HasReleaseArtifact::No | HasReleaseArtifact::RateLimit { .. } - ), - "ret = {:#?}", - ret - ); + #[tokio::test] + async fn test_gh_api_client_cargo_binstall_v0_20_1() { + test_specific_release( + &cargo_binstall_v0_20_1::RELEASE, + cargo_binstall_v0_20_1::ARTIFACTS, + ) + .await } #[tokio::test] async fn test_gh_api_client_cargo_binstall_no_such_release() { - let client = create_client().await; + for client in create_client().await { + let release = GhRelease { + owner: "cargo-bins".to_compact_string(), + repo: "cargo-binstall".to_compact_string(), + // We are currently at v0.20.1 and we would never release + // anything older than v0.20.1 + tag: "v0.18.2".to_compact_string(), + }; - let release = GhRelease { - owner: "cargo-bins".to_compact_string(), - repo: "cargo-binstall".to_compact_string(), - // We are currently at v0.20.1 and we would never release - // anything older than v0.20.1 - tag: "v0.18.2".to_compact_string(), + let ret = client + .has_release_artifact(GhReleaseArtifact { + release, + artifact_name: "1234".to_compact_string(), + }) + .await + .unwrap(); + + assert!( + matches!( + ret, + HasReleaseArtifact::NoSuchRelease | HasReleaseArtifact::RateLimit { .. } + ), + "ret = {:#?}", + ret + ); + } + } + + mod cargo_audit_v_0_17_6 { + use super::*; + + const RELEASE: GhRelease = GhRelease { + owner: CompactString::new_inline("rustsec"), + repo: CompactString::new_inline("rustsec"), + tag: CompactString::new_inline("cargo-audit/v0.17.6"), }; - let ret = client - .has_release_artifact(GhReleaseArtifact { - release, - artifact_name: "1234".to_compact_string(), - }) - .await - .unwrap(); + const ARTIFACTS: &[&str] = &[ + "cargo-audit-aarch64-unknown-linux-gnu-v0.17.6.tgz", + "cargo-audit-armv7-unknown-linux-gnueabihf-v0.17.6.tgz", + "cargo-audit-x86_64-apple-darwin-v0.17.6.tgz", + "cargo-audit-x86_64-pc-windows-msvc-v0.17.6.zip", + "cargo-audit-x86_64-unknown-linux-gnu-v0.17.6.tgz", + "cargo-audit-x86_64-unknown-linux-gnu-v0.17.6.tgz", + ]; - assert!( - matches!( - ret, - HasReleaseArtifact::NoSuchRelease | HasReleaseArtifact::RateLimit { .. } - ), - "ret = {:#?}", - ret - ); + #[test] + fn extract_with_escaped_characters() { + let release_artifact = try_extract_artifact_from_str( +"https://github.com/rustsec/rustsec/releases/download/cargo-audit%2Fv0.17.6/cargo-audit-aarch64-unknown-linux-gnu-v0.17.6.tgz" + ).unwrap(); + + assert_eq!( + release_artifact, + GhReleaseArtifact { + release: RELEASE, + artifact_name: CompactString::from( + "cargo-audit-aarch64-unknown-linux-gnu-v0.17.6.tgz", + ) + } + ); + } + + #[tokio::test] + async fn test_gh_api_client_cargo_audit_v_0_17_6() { + test_specific_release(&RELEASE, ARTIFACTS).await + } } } diff --git a/crates/binstalk-downloader/src/gh_api_client/request.rs b/crates/binstalk-downloader/src/gh_api_client/request.rs index a4e9363b..8b5e9291 100644 --- a/crates/binstalk-downloader/src/gh_api_client/request.rs +++ b/crates/binstalk-downloader/src/gh_api_client/request.rs @@ -1,17 +1,30 @@ use std::{ borrow::Borrow, collections::HashSet, + error, fmt, hash::{Hash, Hasher}, io, + sync::OnceLock, time::Duration, }; -use compact_str::CompactString; -use serde::Deserialize; +use compact_str::{CompactString, ToCompactString}; +use reqwest::{header::HeaderMap, StatusCode}; +use serde::{de::Deserializer, Deserialize, Serialize}; +use serde_json::to_string as to_json_string; use thiserror::Error as ThisError; +use tracing::debug; use url::Url; -use super::{remote, GhRelease}; +use super::{percent_encode_http_url_path, remote, GhRelease}; + +#[derive(ThisError, Debug)] +#[error("Context: '{context}', err: '{err}'")] +pub struct GhApiContextError { + context: CompactString, + #[source] + err: GhApiError, +} #[derive(ThisError, Debug)] #[non_exhaustive] @@ -24,6 +37,23 @@ pub enum GhApiError { #[error("Failed to parse url: {0}")] InvalidUrl(#[from] url::ParseError), + + /// A wrapped error providing the context the error is about. + #[error(transparent)] + Context(Box), + + #[error("Remote failed to process GraphQL query: {0}")] + GraphQLErrors(#[from] GhGraphQLErrors), +} + +impl GhApiError { + /// Attach context to [`GhApiError`] + pub fn context(self, context: impl fmt::Display) -> Self { + Self::Context(Box::new(GhApiContextError { + context: context.to_compact_string(), + err: self, + })) + } } // Only include fields we do care about @@ -62,7 +92,7 @@ impl Borrow for Artifact { } } -#[derive(Debug, Deserialize)] +#[derive(Debug, Default, Deserialize)] pub(super) struct Artifacts { assets: HashSet, } @@ -80,15 +110,43 @@ pub(super) enum FetchReleaseRet { Unauthorized, } -/// Returns 404 if not found -pub(super) async fn fetch_release_artifacts( +fn check_for_status(status: StatusCode, headers: &HeaderMap) -> Option { + if status == remote::StatusCode::FORBIDDEN + && headers + .get("x-ratelimit-remaining") + .map(|val| val == "0") + .unwrap_or(false) + { + return Some(FetchReleaseRet::ReachedRateLimit { + retry_after: headers.get("x-ratelimit-reset").and_then(|value| { + let secs = value.to_str().ok()?.parse().ok()?; + Some(Duration::from_secs(secs)) + }), + }); + } + + if status == remote::StatusCode::UNAUTHORIZED { + return Some(FetchReleaseRet::Unauthorized); + } + + if status == remote::StatusCode::NOT_FOUND { + return Some(FetchReleaseRet::ReleaseNotFound); + } + + None +} + +async fn fetch_release_artifacts_restful_api( client: &remote::Client, GhRelease { owner, repo, tag }: &GhRelease, auth_token: Option<&str>, ) -> Result { let mut request_builder = client .get(Url::parse(&format!( - "https://api.github.com/repos/{owner}/{repo}/releases/tags/{tag}" + "https://api.github.com/repos/{owner}/{repo}/releases/tags/{tag}", + owner = percent_encode_http_url_path(owner), + repo = percent_encode_http_url_path(repo), + tag = percent_encode_http_url_path(tag), ))?) .header("Accept", "application/vnd.github+json") .header("X-GitHub-Api-Version", "2022-11-28"); @@ -102,27 +160,291 @@ pub(super) async fn fetch_release_artifacts( let status = response.status(); let headers = response.headers(); - if status == remote::StatusCode::FORBIDDEN - && headers - .get("x-ratelimit-remaining") - .map(|val| val == "0") - .unwrap_or(false) - { - return Ok(FetchReleaseRet::ReachedRateLimit { - retry_after: headers.get("x-ratelimit-reset").and_then(|value| { - let secs = value.to_str().ok()?.parse().ok()?; - Some(Duration::from_secs(secs)) - }), - }); - } - - if status == remote::StatusCode::UNAUTHORIZED { - return Ok(FetchReleaseRet::Unauthorized); - } - - if status == remote::StatusCode::NOT_FOUND { - return Ok(FetchReleaseRet::ReleaseNotFound); + if let Some(ret) = check_for_status(status, headers) { + return Ok(ret); } Ok(FetchReleaseRet::Artifacts(response.json().await?)) } + +#[derive(Deserialize)] +enum GraphQLResponse { + #[serde(rename = "data")] + Data(GraphQLData), + + #[serde(rename = "errors")] + Errors(GhGraphQLErrors), +} + +#[derive(Debug, Deserialize)] +pub struct GhGraphQLErrors(Box<[GraphQLError]>); + +impl GhGraphQLErrors { + fn is_rate_limited(&self) -> bool { + self.0 + .iter() + .any(|error| matches!(error.error_type, GraphQLErrorType::RateLimited)) + } +} + +impl error::Error for GhGraphQLErrors {} + +impl fmt::Display for GhGraphQLErrors { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let last_error_index = self.0.len() - 1; + + for (i, error) in self.0.iter().enumerate() { + write!( + f, + "type: '{error_type}', msg: '{msg}'", + error_type = error.error_type, + msg = error.message, + )?; + + for location in error.locations.as_deref().into_iter().flatten() { + write!( + f, + ", occured on query line {line} col {col}", + line = location.line, + col = location.column + )?; + } + + for (k, v) in &error.others { + write!(f, ", {k}: {v}")?; + } + + if i < last_error_index { + f.write_str("\n")?; + } + } + + Ok(()) + } +} + +#[derive(Debug, Deserialize)] +struct GraphQLError { + message: CompactString, + locations: Option>, + + #[serde(rename = "type")] + error_type: GraphQLErrorType, + + #[serde(flatten, with = "tuple_vec_map")] + others: Vec<(CompactString, serde_json::Value)>, +} + +#[derive(Debug)] +enum GraphQLErrorType { + RateLimited, + Other(CompactString), +} + +impl fmt::Display for GraphQLErrorType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(match self { + GraphQLErrorType::RateLimited => "RATE_LIMITED", + GraphQLErrorType::Other(s) => s, + }) + } +} + +impl<'de> Deserialize<'de> for GraphQLErrorType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s = CompactString::deserialize(deserializer)?; + Ok(match &*s { + "RATE_LIMITED" => GraphQLErrorType::RateLimited, + _ => GraphQLErrorType::Other(s), + }) + } +} + +#[derive(Debug, Deserialize)] +struct GraphQLLocation { + line: u64, + column: u64, +} + +#[derive(Deserialize)] +struct GraphQLData { + repository: Option, +} + +#[derive(Deserialize)] +struct GraphQLRepo { + release: Option, +} + +#[derive(Deserialize)] +struct GraphQLRelease { + #[serde(rename = "releaseAssets")] + assets: GraphQLReleaseAssets, +} + +#[derive(Deserialize)] +struct GraphQLReleaseAssets { + nodes: Vec, + #[serde(rename = "pageInfo")] + page_info: GraphQLPageInfo, +} + +#[derive(Deserialize)] +struct GraphQLPageInfo { + #[serde(rename = "endCursor")] + end_cursor: CompactString, + #[serde(rename = "hasNextPage")] + has_next_page: bool, +} + +enum FilterCondition { + Init, + After(CompactString), +} + +impl fmt::Display for FilterCondition { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + // GitHub imposes a limit of 100 for the value passed to param "first" + FilterCondition::Init => f.write_str("first:100"), + FilterCondition::After(end_cursor) => write!(f, r#"first:100,after:"{end_cursor}""#), + } + } +} + +#[derive(Serialize)] +struct GraphQLQuery { + query: String, +} + +async fn fetch_release_artifacts_graphql_api( + client: &remote::Client, + GhRelease { owner, repo, tag }: &GhRelease, + auth_token: &str, +) -> Result { + static GRAPHQL_ENDPOINT: OnceLock = OnceLock::new(); + + let graphql_endpoint = GRAPHQL_ENDPOINT.get_or_init(|| { + Url::parse("https://api.github.com/graphql").expect("Literal provided must be a valid url") + }); + + let mut artifacts = Artifacts::default(); + let mut cond = FilterCondition::Init; + + loop { + let query = format!( + r#" +query {{ + repository(owner:"{owner}",name:"{repo}") {{ + release(tagName:"{tag}") {{ + releaseAssets({cond}) {{ + nodes {{ name }} + pageInfo {{ endCursor hasNextPage }} + }} + }} + }} +}}"# + ); + + let graphql_query = to_json_string(&GraphQLQuery { query }).map_err(remote::Error::from)?; + + debug!("Sending graphql query to https://api.github.com/graphql: '{graphql_query}'"); + + let request_builder = client + .post(graphql_endpoint.clone(), graphql_query) + .header("Accept", "application/vnd.github+json") + .bearer_auth(&auth_token); + + let response = request_builder.send(false).await?; + + if let Some(ret) = check_for_status(response.status(), response.headers()) { + return Ok(ret); + } + + let response: GraphQLResponse = response.json().await?; + + let data = match response { + GraphQLResponse::Data(data) => data, + GraphQLResponse::Errors(errors) if errors.is_rate_limited() => { + return Ok(FetchReleaseRet::ReachedRateLimit { retry_after: None }) + } + GraphQLResponse::Errors(errors) => return Err(errors.into()), + }; + + let assets = data + .repository + .and_then(|repository| repository.release) + .map(|release| release.assets); + + if let Some(assets) = assets { + artifacts.assets.extend(assets.nodes); + + let page_info = assets.page_info; + if !page_info.has_next_page { + break Ok(FetchReleaseRet::Artifacts(artifacts)); + } else { + cond = FilterCondition::After(page_info.end_cursor); + } + } else { + break Ok(FetchReleaseRet::ReleaseNotFound); + } + } +} + +pub(super) async fn fetch_release_artifacts( + client: &remote::Client, + release: &GhRelease, + auth_token: Option<&str>, +) -> Result { + if let Some(auth_token) = auth_token { + let res = fetch_release_artifacts_graphql_api(client, release, auth_token) + .await + .map_err(|err| err.context("GraphQL API")); + + match res { + // Fallback to Restful API + Ok(FetchReleaseRet::Unauthorized) => (), + res => return res, + } + } + + fetch_release_artifacts_restful_api(client, release, auth_token) + .await + .map_err(|err| err.context("Restful API")) +} + +#[cfg(test)] +mod test { + use super::*; + use serde::de::value::{BorrowedStrDeserializer, Error}; + + macro_rules! assert_matches { + ($expression:expr, $pattern:pat $(if $guard:expr)? $(,)?) => { + match $expression { + $pattern $(if $guard)? => true, + expr => { + panic!( + "assertion failed: `{expr:?}` does not match `{}`", + stringify!($pattern $(if $guard)?) + ) + } + } + } + } + + #[test] + fn test_graph_ql_error_type() { + let deserialize = |input: &str| { + GraphQLErrorType::deserialize(BorrowedStrDeserializer::<'_, Error>::new(input)).unwrap() + }; + + assert_matches!(deserialize("RATE_LIMITED"), GraphQLErrorType::RateLimited); + assert_matches!( + deserialize("rATE_LIMITED"), + GraphQLErrorType::Other(val) if val == CompactString::new("rATE_LIMITED") + ); + } +} diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 24e18a5b..5091be72 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -26,7 +26,7 @@ mod certificate; pub use certificate::Certificate; mod request_builder; -pub use request_builder::{RequestBuilder, Response}; +pub use request_builder::{Body, RequestBuilder, Response}; #[cfg(feature = "json")] pub use request_builder::JsonError; @@ -303,6 +303,7 @@ impl Client { Ok(self.get(url).send(true).await?.bytes_stream()) } + /// Create a new request. pub fn request(&self, method: Method, url: Url) -> RequestBuilder { RequestBuilder { client: self.clone(), @@ -310,9 +311,15 @@ impl Client { } } + /// Create a new GET request. pub fn get(&self, url: Url) -> RequestBuilder { self.request(Method::GET, url) } + + /// Create a new POST request. + pub fn post(&self, url: Url, body: impl Into) -> RequestBuilder { + self.request(Method::POST, url).body(body.into()) + } } fn parse_header_retry_after(headers: &HeaderMap) -> Option { diff --git a/crates/binstalk-downloader/src/remote/request_builder.rs b/crates/binstalk-downloader/src/remote/request_builder.rs index fbb74a61..cc0175a6 100644 --- a/crates/binstalk-downloader/src/remote/request_builder.rs +++ b/crates/binstalk-downloader/src/remote/request_builder.rs @@ -6,6 +6,8 @@ use reqwest::Method; use super::{header, Client, Error, HttpError, StatusCode, Url}; +pub use reqwest::Body; + #[cfg(feature = "json")] pub use serde_json::Error as JsonError; @@ -16,20 +18,27 @@ pub struct RequestBuilder { } impl RequestBuilder { - pub fn bearer_auth(self, token: &dyn fmt::Display) -> RequestBuilder { + pub fn bearer_auth(self, token: &dyn fmt::Display) -> Self { Self { client: self.client, inner: self.inner.bearer_auth(token), } } - pub fn header(self, key: &str, value: &str) -> RequestBuilder { + pub fn header(self, key: &str, value: &str) -> Self { Self { client: self.client, inner: self.inner.header(key, value), } } + pub fn body(self, body: impl Into) -> Self { + Self { + client: self.client, + inner: self.inner.body(body.into()), + } + } + pub async fn send(self, error_for_status: bool) -> Result { let request = self.inner.build()?; let method = request.method().clone(); diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index 8fb1f3dd..d01d6a22 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -306,12 +306,12 @@ pub enum BinstallError { #[diagnostic(severity(error), code(binstall::invalid_pkg_fmt))] InvalidPkgFmt(Box), - /// Request to GitHub Restful API failed + /// Request to GitHub API failed /// - /// - Code: `binstall::gh_restful_api_failure` + /// - Code: `binstall::gh_api_failure` /// - Exit: 96 - #[error("Request to GitHub Restful API failed: {0}")] - #[diagnostic(severity(error), code(binstall::gh_restful_api_failure))] + #[error("Request to GitHub API failed: {0}")] + #[diagnostic(severity(error), code(binstall::gh_api_failure))] GhApiErr(#[source] Box), /// A wrapped error providing the context of which crate the error is about. diff --git a/crates/binstalk/src/helpers/remote.rs b/crates/binstalk/src/helpers/remote.rs index 1d46f793..b03a9c3c 100644 --- a/crates/binstalk/src/helpers/remote.rs +++ b/crates/binstalk/src/helpers/remote.rs @@ -15,7 +15,7 @@ pub async fn does_url_exist( debug!("Checking for package at: '{url}'"); if let Some(artifact) = GhReleaseArtifact::try_extract_from_url(url) { - debug!("Using GitHub Restful API to check for existence of artifact, which will also cache the API response"); + debug!("Using GitHub API to check for existence of artifact, which will also cache the API response"); // The future returned has the same size as a pointer match gh_api_client.has_release_artifact(artifact).await? { From f0a62754ade302ca2dc400bd9de43c51df815c59 Mon Sep 17 00:00:00 2001 From: Zanie Adkins Date: Sun, 4 Jun 2023 14:32:41 -0500 Subject: [PATCH 1309/2020] Use `uname -s` for install script compatibility with outdated macOS GNU utils (#1123) --- install-from-binstall-release.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install-from-binstall-release.sh b/install-from-binstall-release.sh index 0163b9f7..a9f5c99b 100755 --- a/install-from-binstall-release.sh +++ b/install-from-binstall-release.sh @@ -6,12 +6,12 @@ cd "$(mktemp -d)" base_url="https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-" -os="$(uname -o)" +os="$(uname -s)" if [ "$os" == "Darwin" ]; then url="${base_url}universal-apple-darwin.zip" curl -LO --proto '=https' --tlsv1.2 -sSf "$url" unzip cargo-binstall-universal-apple-darwin.zip -elif [ "$os" == "GNU/Linux" ]; then +elif [ "$os" == "Linux" ]; then machine="$(uname -m)" target="${machine}-unknown-linux-musl" if [ "$machine" == "armv7" ]; then From bf4686214020d7a6bd9cc83197f351e78718785f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 12:29:41 +1000 Subject: [PATCH 1310/2020] build(deps): bump once_cell from 1.17.2 to 1.18.0 (#1127) Bumps [once_cell](https://github.com/matklad/once_cell) from 1.17.2 to 1.18.0. - [Changelog](https://github.com/matklad/once_cell/blob/master/CHANGELOG.md) - [Commits](https://github.com/matklad/once_cell/compare/v1.17.2...v1.18.0) --- updated-dependencies: - dependency-name: once_cell dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 08eb78b6..771b829e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1482,9 +1482,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.17.2" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9670a07f94779e00908f3e686eab508878ebb390ba6e604d3a284c00e8d0487b" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "openssl" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index aaab3817..35c74e96 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -33,7 +33,7 @@ gh-token = "0.1.2" log = { version = "0.4.18", features = ["std"] } miette = "5.9.0" mimalloc = { version = "0.1.37", default-features = false, optional = true } -once_cell = "1.17.2" +once_cell = "1.18.0" semver = "1.0.17" strum = "0.24.1" strum_macros = "0.24.3" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 5a19bc9e..a9193a57 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -12,7 +12,7 @@ license = "Apache-2.0 OR MIT" [dependencies] compact_str = { version = "0.7.0", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } -once_cell = "1.17.2" +once_cell = "1.18.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } strum = "0.24.1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 6d794014..0d75203e 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ leon-macros = { version = "1.0.0", path = "../leon-macros" } maybe-owned = "0.3.4" miette = "5.9.0" normalize-path = { version = "0.2.0", path = "../normalize-path" } -once_cell = "1.17.2" +once_cell = "1.18.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } strum = "0.24.1" From 34e02d9f0fa16d6ef56f76d9888bfc7fae4dba6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 14:06:49 +1000 Subject: [PATCH 1311/2020] build(deps): bump libc from 0.2.144 to 0.2.145 (#1128) Bumps [libc](https://github.com/rust-lang/libc) from 0.2.144 to 0.2.145. - [Release notes](https://github.com/rust-lang/libc/releases) - [Commits](https://github.com/rust-lang/libc/compare/0.2.144...0.2.145) --- updated-dependencies: - dependency-name: libc dependency-type: indirect update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 771b829e..a47d1cdd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1242,9 +1242,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.144" +version = "0.2.145" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" +checksum = "fc86cde3ff845662b8f4ef6cb50ea0e20c524eb3d29ae048287e06a1b3fa6a81" [[package]] name = "libmimalloc-sys" From 3cf2528273d376d5974ae573b98beac9af633342 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 5 Jun 2023 14:06:58 +1000 Subject: [PATCH 1312/2020] build(deps): bump windows-sys from 0.42.0 to 0.48.0 (#1125) Bumps [windows-sys](https://github.com/microsoft/windows-rs) from 0.42.0 to 0.48.0. - [Release notes](https://github.com/microsoft/windows-rs/releases) - [Commits](https://github.com/microsoft/windows-rs/compare/0.42.0...0.48.0) --- updated-dependencies: - dependency-name: windows-sys dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 2 +- crates/detect-targets/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a47d1cdd..c4f94eec 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -599,7 +599,7 @@ dependencies = [ "guess_host_triple", "tokio", "windows-dll", - "windows-sys 0.42.0", + "windows-sys 0.48.0", ] [[package]] diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 56d49dc5..fd259b16 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -15,7 +15,7 @@ cfg-if = "1.0.0" guess_host_triple = "0.1.3" [target.'cfg(target_os = "windows")'.dependencies] -windows-sys = { version = "0.42.0", features = ["Win32_System_Threading", "Win32_System_SystemInformation", "Win32_Foundation"] } +windows-sys = { version = "0.48.0", features = ["Win32_System_Threading", "Win32_System_SystemInformation", "Win32_Foundation"] } windows-dll = { version = "0.4.1", features = ["windows"], default-features = false } [dev-dependencies] From cc87fe062da81e7f1b8f905ef5a6adbc7a8b1587 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 5 Jun 2023 22:54:01 +1000 Subject: [PATCH 1313/2020] ci: Rm merge queue cache in `cache-cleanup.yml` (#1129) since they cannot be reused Signed-off-by: Jiahao XU --- .github/workflows/cache-cleanup.yml | 12 ++++++++++++ cleanup-cache.sh | 4 +--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cache-cleanup.yml b/.github/workflows/cache-cleanup.yml index 1e8da6ba..2a9ad231 100644 --- a/.github/workflows/cache-cleanup.yml +++ b/.github/workflows/cache-cleanup.yml @@ -15,14 +15,26 @@ jobs: - uses: actions/checkout@v3 - name: Cleanup run: | + set -euxo pipefail + gh extension install actions/gh-actions-cache export REPO="${{ github.repository }}" + # Setting this to not fail the workflow while deleting cache keys. + set +e + + # Remove pull requests cache, since they cannot be reused gh pr list --state closed -L 20 --json number --jq '.[]|.number' | ( while IFS='$\n' read -r closed_pr; do BRANCH="refs/pull/${closed_pr}/merge" ./cleanup-cache.sh done ) + # Remove merge queue cache, since they cannot be reused + gh actions-cache list -L 100 | cut -f 3 | grep 'gh-readonly-queue' | sort -u | ( + while IFS='$\n' read -r branch; do + BRANCH="$branch" ./cleanup-cache.sh + done + ) env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/cleanup-cache.sh b/cleanup-cache.sh index 5c38d86a..4fcbf6d3 100755 --- a/cleanup-cache.sh +++ b/cleanup-cache.sh @@ -7,14 +7,12 @@ BRANCH="${BRANCH?}" while true; do echo "Fetching list of cache key for $BRANCH" - cacheKeysForPR="$(gh actions-cache list -R "$REPO" -B "$BRANCH" -L 100 | cut -f 1 )" + cacheKeysForPR="$(gh actions-cache list -R "$REPO" -B "$BRANCH" -L 100 | cut -f 1)" if [ -z "$cacheKeysForPR" ]; then break fi - ## Setting this to not fail the workflow while deleting cache keys. - set +e echo "Deleting caches..." for cacheKey in $cacheKeysForPR do From 76cd4d62c27dcb6ad4fb513f6b9782ad9baaf877 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 6 Jun 2023 00:09:42 +1000 Subject: [PATCH 1314/2020] dep: Add new workflow `upgrade-transitive-deps.yml` (#1130) for upgrading transitive dependencies. While dependabot is great, it opens one PR for each of these transitive dependencies, which makes merging harder: - have to approve every PR - have to click merge when ci is done it also creates merge queue runs and commits to main, thus creates a lot of unused caches and unnecessary CI runs. This PR creates `upgrade-transitive-deps.yml` that creates one PR for all transitive change per-day. It also configures dependabot to only `increase-if-necessary`, same as library crates. Since we have several library crates in our workspace, this would mean that we would have less unnecessary deps bump on these library crates. Signed-off-by: Jiahao XU --- .github/dependabot.yml | 5 +- .github/workflows/upgrade-transitive-deps.yml | 48 +++++++++++++++++++ 2 files changed, 49 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/upgrade-transitive-deps.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 13f25eb4..00dcb8bd 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,7 +12,4 @@ updates: directory: "/" schedule: interval: "daily" - allow: - - dependency-name: "*" - # Update all dependencies, including the dependencies of direct dependencies. - dependency-type: "all" + versioning-strategy: increase-if-necessary diff --git a/.github/workflows/upgrade-transitive-deps.yml b/.github/workflows/upgrade-transitive-deps.yml new file mode 100644 index 00000000..62e795d0 --- /dev/null +++ b/.github/workflows/upgrade-transitive-deps.yml @@ -0,0 +1,48 @@ +name: Upgrade transitive dependencies + +on: + workflow_dispatch: # Allow running on-demand + schedule: + - cron: '0 3 * * *' + +jobs: + upgrade: + name: Upgrade & Open Pull Request + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + persist-credentials: true + + - name: Generate branch name + run: | + git checkout -b deps/transitive/${{ github.run_id }} + + - name: Install rust + run: | + rustup toolchain install stable --no-self-update --profile minimal + + - name: Upgrade transitive dependencies + run: cargo update --aggressive + + - name: Detect changes + id: changes + run: + # This output boolean tells us if the dependencies have actually changed + echo "count=$(git status --porcelain=v1 | wc -l)" >> $GITHUB_OUTPUT + + - name: Commit and push changes + # Only push if changes exist + if: steps.changes.outputs.count > 0 + run: | + git config user.name github-actions + git config user.email github-actions@github.com + git commit -am "dep: Upgrade transitive dependencies" + git push origin HEAD + + - name: Open pull request if needed + if: steps.changes.outputs.count > 0 + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh pr create --base main --fill --label 'PR: dependencies' From abf5a8e84225652dddd6418e08b1563396dd104e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 12:47:25 +1000 Subject: [PATCH 1315/2020] build(deps): bump file-format from 0.16.0 to 0.17.0 (#1135) Bumps [file-format](https://github.com/mmalecot/file-format) from 0.16.0 to 0.17.0. - [Release notes](https://github.com/mmalecot/file-format/releases) - [Changelog](https://github.com/mmalecot/file-format/blob/main/CHANGELOG.md) - [Commits](https://github.com/mmalecot/file-format/compare/v0.16.0...v0.17.0) --- updated-dependencies: - dependency-name: file-format dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c4f94eec..a1185de5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -723,9 +723,9 @@ dependencies = [ [[package]] name = "file-format" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71a5df8a0f4b423e8bc25526b39852bf64dfb7bd734ed99ed343c5925762c9c8" +checksum = "aaa6044018c8e916dc6720c7ae31c6f02ed7f13064aa6a8260ec94869d6790de" [[package]] name = "filetime" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 35c74e96..2b6c3733 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -27,7 +27,7 @@ binstalk-manifests = { path = "../binstalk-manifests", version = "0.5.0" } clap = { version = "4.3.0", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" -file-format = { version = "0.16.0", default-features = false } +file-format = { version = "0.17.0", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } gh-token = "0.1.2" log = { version = "0.4.18", features = ["std"] } From e62049d59dba72f46c22b9b0185bf1b55b5acfd2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 6 Jun 2023 14:09:05 +1000 Subject: [PATCH 1316/2020] ci: Fix `cache-cleanup.yml` non-zero exit status (#1136) ci: Fix `cache-cleanup.yml` `cut` non-zero exit status Signed-off-by: Jiahao XU --- .github/workflows/cache-cleanup.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cache-cleanup.yml b/.github/workflows/cache-cleanup.yml index 2a9ad231..9af601fb 100644 --- a/.github/workflows/cache-cleanup.yml +++ b/.github/workflows/cache-cleanup.yml @@ -31,7 +31,7 @@ jobs: done ) # Remove merge queue cache, since they cannot be reused - gh actions-cache list -L 100 | cut -f 3 | grep 'gh-readonly-queue' | sort -u | ( + gh actions-cache list -L 100 | cut -f 3 | (grep 'gh-readonly-queue' || true) | sort -u | ( while IFS='$\n' read -r branch; do BRANCH="$branch" ./cleanup-cache.sh done From 1d754ef5b50536c45e401f114ed1043af8cf98d2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 6 Jun 2023 15:31:32 +1000 Subject: [PATCH 1317/2020] dep: Upgrade transitive dependencies (#1137) Co-authored-by: github-actions --- Cargo.lock | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a1185de5..31aea558 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -30,9 +30,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67fc08ce920c31afb70f013dcce1bfc3a3195de6a228474e45e1f145b36f8d04" +checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" dependencies = [ "memchr", ] @@ -469,9 +469,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.1" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ed2379f8603fa2b7509891660e802b88c70a79a6427a70abb5968054de2c28" +checksum = "401a4694d2bf92537b6867d94de48c4842089645fdcdf6c71865b175d836e9c2" dependencies = [ "clap_builder", "clap_derive", @@ -493,9 +493,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.1" +version = "4.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e9ef9a08ee1c0e1f2e162121665ac45ac3783b0f897db7244ae75ad9a8f65b" +checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" dependencies = [ "heck", "proc-macro2", @@ -773,9 +773,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9c384f161156f5260c24a097c56119f9be8c798586aecc13afbcbe7b7e26bf8" +checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" dependencies = [ "percent-encoding", ] @@ -1094,9 +1094,9 @@ dependencies = [ [[package]] name = "idna" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e14ddfc70884202db2244c223200c204c2bda1bc6e0998d11b5e024d657209e6" +checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" dependencies = [ "unicode-bidi", "unicode-normalization", @@ -1280,9 +1280,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" dependencies = [ "autocfg", "scopeguard", @@ -1473,9 +1473,9 @@ dependencies = [ [[package]] name = "object" -version = "0.30.3" +version = "0.30.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" +checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" dependencies = [ "memchr", ] @@ -1560,22 +1560,22 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.7" +version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", + "redox_syscall 0.3.5", "smallvec", - "windows-sys 0.45.0", + "windows-targets 0.48.0", ] [[package]] name = "percent-encoding" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" +checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pin-project" @@ -1769,9 +1769,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.3" +version = "1.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81ca098a9821bd52d6b24fd8b10bd081f47d39c22778cafaa75a2857a62c6390" +checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" dependencies = [ "aho-corasick", "memchr", @@ -2665,12 +2665,12 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.3.1" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d68c799ae75762b8c3fe375feb6600ef5602c883c5d21eb51c09f22b83c4643" +checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" dependencies = [ "form_urlencoded", - "idna 0.3.0", + "idna 0.4.0", "percent-encoding", "serde", ] From 16be14a07da6dda4792013d0859002d2d0682304 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 6 Jun 2023 21:46:47 +1000 Subject: [PATCH 1318/2020] dependabot: Only create PR for incompatible updates (#1138) for direct dependencies since compatible updates is already covered by `update-transitive-deps.yml`. Signed-off-by: Jiahao XU --- .github/dependabot.yml | 49 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 47 insertions(+), 2 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 00dcb8bd..89dd3eb3 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,8 +8,53 @@ updates: directory: "/" schedule: interval: "daily" + # If we include `/`, then dependabot would also create PR + # for every compatible updates. + # + # We only want incompatible updates for direct dependencies + # from dependabot since compatible updates is covered by + # `update-transitive-deps.yml` - package-ecosystem: "cargo" - directory: "/" + directory: "/bin" + schedule: + interval: "daily" + - package-ecosystem: "cargo" + directory: "/binstalk" + schedule: + interval: "daily" + - package-ecosystem: "cargo" + directory: "/binstalk-downloader" + schedule: + interval: "daily" + - package-ecosystem: "cargo" + directory: "/binstalk-manifests" + schedule: + interval: "daily" + - package-ecosystem: "cargo" + directory: "/binstalk-types" + schedule: + interval: "daily" + - package-ecosystem: "cargo" + directory: "/detect-targets" + schedule: + interval: "daily" + - package-ecosystem: "cargo" + directory: "/detect-wasi" + schedule: + interval: "daily" + - package-ecosystem: "cargo" + directory: "/fs-lock" + schedule: + interval: "daily" + - package-ecosystem: "cargo" + directory: "/leon" + schedule: + interval: "daily" + - package-ecosystem: "cargo" + directory: "/leon-macros" + schedule: + interval: "daily" + - package-ecosystem: "cargo" + directory: "/normalize-path" schedule: interval: "daily" - versioning-strategy: increase-if-necessary From 6b5384608e19df3bd31944cfa4331eb2b01f0be0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 7 Jun 2023 11:02:29 +1000 Subject: [PATCH 1319/2020] `GhApiClient` misc improvements (#1139) - Increase `DEFAULT_RETRY_DURATION` to 5 minutes, since GitHub enforces rate limit on an hourly basis. - Refactor `check_for_status` & `fetch_release_artifacts_restful_api` - Optimize `percent_decode_http_url_path`: Avoid `percent_decode_str` if there is no `%` in the `input`. Signed-off-by: Jiahao XU --- .../binstalk-downloader/src/gh_api_client.rs | 9 +++- .../src/gh_api_client/request.rs | 48 ++++++++----------- 2 files changed, 28 insertions(+), 29 deletions(-) diff --git a/crates/binstalk-downloader/src/gh_api_client.rs b/crates/binstalk-downloader/src/gh_api_client.rs index a9e63f26..10bedf6f 100644 --- a/crates/binstalk-downloader/src/gh_api_client.rs +++ b/crates/binstalk-downloader/src/gh_api_client.rs @@ -21,7 +21,7 @@ mod request; pub use request::{GhApiContextError, GhApiError, GhGraphQLErrors}; /// default retry duration if x-ratelimit-reset is not found in response header -const DEFAULT_RETRY_DURATION: Duration = Duration::from_secs(3); +const DEFAULT_RETRY_DURATION: Duration = Duration::from_secs(5 * 60); fn percent_encode_http_url_path(path: &str) -> PercentEncode<'_> { /// https://url.spec.whatwg.org/#fragment-percent-encode-set @@ -42,7 +42,12 @@ fn percent_encode_http_url_path(path: &str) -> PercentEncode<'_> { } fn percent_decode_http_url_path(input: &str) -> CompactString { - percent_decode_str(input).decode_utf8_lossy().into() + if input.contains('%') { + percent_decode_str(input).decode_utf8_lossy().into() + } else { + // No '%', no need to decode. + CompactString::new(input) + } } /// The keys required to identify a github release. diff --git a/crates/binstalk-downloader/src/gh_api_client/request.rs b/crates/binstalk-downloader/src/gh_api_client/request.rs index 8b5e9291..2289566c 100644 --- a/crates/binstalk-downloader/src/gh_api_client/request.rs +++ b/crates/binstalk-downloader/src/gh_api_client/request.rs @@ -111,29 +111,26 @@ pub(super) enum FetchReleaseRet { } fn check_for_status(status: StatusCode, headers: &HeaderMap) -> Option { - if status == remote::StatusCode::FORBIDDEN - && headers - .get("x-ratelimit-remaining") - .map(|val| val == "0") - .unwrap_or(false) - { - return Some(FetchReleaseRet::ReachedRateLimit { - retry_after: headers.get("x-ratelimit-reset").and_then(|value| { - let secs = value.to_str().ok()?.parse().ok()?; - Some(Duration::from_secs(secs)) - }), - }); - } + match status { + remote::StatusCode::FORBIDDEN + if headers + .get("x-ratelimit-remaining") + .map(|val| val == "0") + .unwrap_or(false) => + { + Some(FetchReleaseRet::ReachedRateLimit { + retry_after: headers.get("x-ratelimit-reset").and_then(|value| { + let secs = value.to_str().ok()?.parse().ok()?; + Some(Duration::from_secs(secs)) + }), + }) + } - if status == remote::StatusCode::UNAUTHORIZED { - return Some(FetchReleaseRet::Unauthorized); - } + remote::StatusCode::UNAUTHORIZED => Some(FetchReleaseRet::Unauthorized), + remote::StatusCode::NOT_FOUND => Some(FetchReleaseRet::ReleaseNotFound), - if status == remote::StatusCode::NOT_FOUND { - return Some(FetchReleaseRet::ReleaseNotFound); + _ => None, } - - None } async fn fetch_release_artifacts_restful_api( @@ -157,14 +154,11 @@ async fn fetch_release_artifacts_restful_api( let response = request_builder.send(false).await?; - let status = response.status(); - let headers = response.headers(); - - if let Some(ret) = check_for_status(status, headers) { - return Ok(ret); + if let Some(ret) = check_for_status(response.status(), response.headers()) { + Ok(ret) + } else { + Ok(FetchReleaseRet::Artifacts(response.json().await?)) } - - Ok(FetchReleaseRet::Artifacts(response.json().await?)) } #[derive(Deserialize)] From 4e3b460a46b7046b6e2c9351fb250db5fb03de62 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 7 Jun 2023 04:28:25 +0000 Subject: [PATCH 1320/2020] dep: Upgrade transitive dependencies (#1140) Co-authored-by: github-actions --- Cargo.lock | 85 ++++++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 44 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 31aea558..a58f0304 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -889,9 +889,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "libc", @@ -1048,7 +1048,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2", + "socket2 0.4.9", "tokio", "tower-service", "tracing", @@ -1134,14 +1134,14 @@ dependencies = [ [[package]] name = "ipconfig" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd302af1b90f2463a98fa5ad469fc212c8e3175a41c3068601bfa2727591c5be" +checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2", + "socket2 0.5.3", "widestring", - "winapi", - "winreg 0.10.1", + "windows-sys 0.48.0", + "winreg 0.50.0", ] [[package]] @@ -1242,9 +1242,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.145" +version = "0.2.146" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc86cde3ff845662b8f4ef6cb50ea0e20c524eb3d29ae048287e06a1b3fa6a81" +checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" [[package]] name = "libmimalloc-sys" @@ -1568,7 +1568,7 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec", - "windows-targets 0.48.0", + "windows-targets", ] [[package]] @@ -1694,7 +1694,7 @@ dependencies = [ "futures-util", "libc", "quinn-proto", - "socket2", + "socket2 0.4.9", "tokio", "tracing", ] @@ -2140,6 +2140,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "socket2" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +dependencies = [ + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "spin" version = "0.5.2" @@ -2229,15 +2239,16 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.5.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9fbec84f381d5795b08656e4912bec604d162bff9291d6189a78f4c8ab87998" +checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" dependencies = [ + "autocfg", "cfg-if", "fastrand", "redox_syscall 0.3.5", "rustix", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] @@ -2320,7 +2331,7 @@ dependencies = [ "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2", + "socket2 0.4.9", "tokio-macros", "windows-sys 0.48.0", ] @@ -2845,9 +2856,9 @@ dependencies = [ [[package]] name = "widestring" -version = "0.5.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" +checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" [[package]] name = "winapi" @@ -2890,7 +2901,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets 0.48.0", + "windows-targets", ] [[package]] @@ -2932,37 +2943,13 @@ dependencies = [ "windows_x86_64_msvc 0.42.2", ] -[[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" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.0", -] - -[[package]] -name = "windows-targets" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" -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", ] [[package]] @@ -3122,6 +3109,16 @@ dependencies = [ "winapi", ] +[[package]] +name = "winreg" +version = "0.50.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +dependencies = [ + "cfg-if", + "windows-sys 0.48.0", +] + [[package]] name = "xattr" version = "0.2.3" From ce06c70d4ccd885a2e394b8f369b9c30680fdf2d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 9 Jun 2023 03:41:09 +0000 Subject: [PATCH 1321/2020] dep: Upgrade transitive dependencies (#1142) Co-authored-by: github-actions --- Cargo.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a58f0304..1f3e1d2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -723,9 +723,9 @@ dependencies = [ [[package]] name = "file-format" -version = "0.17.0" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaa6044018c8e916dc6720c7ae31c6f02ed7f13064aa6a8260ec94869d6790de" +checksum = "e44efc8ce1e05c66fa0f68a65e3e6ae01b1515ea623e234b194bdc568a5c7bc9" [[package]] name = "filetime" @@ -1633,9 +1633,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.59" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b" +checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" dependencies = [ "unicode-ident", ] @@ -2019,9 +2019,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.163" +version = "1.0.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" dependencies = [ "serde_derive", ] @@ -2037,9 +2037,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.163" +version = "1.0.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" dependencies = [ "proc-macro2", "quote", From 879f400d2cf36c641a24994ccd0b202d3fe2907c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 10 Jun 2023 08:08:03 +0000 Subject: [PATCH 1322/2020] dep: Upgrade transitive dependencies (#1143) Co-authored-by: github-actions --- Cargo.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1f3e1d2e..32b812a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -469,9 +469,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.2" +version = "4.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "401a4694d2bf92537b6867d94de48c4842089645fdcdf6c71865b175d836e9c2" +checksum = "ca8f255e4b8027970e78db75e78831229c9815fdbfa67eb1a1b777a62e24b4a0" dependencies = [ "clap_builder", "clap_derive", @@ -480,9 +480,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.1" +version = "4.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72394f3339a76daf211e57d4bcb374410f3965dcc606dd0e03738c7888766980" +checksum = "acd4f3c17c83b0ba34ffbc4f8bbd74f079413f747f84a6f89292f138057e36ab" dependencies = [ "anstream", "anstyle", @@ -1065,7 +1065,7 @@ dependencies = [ "hyper", "rustls 0.21.1", "tokio", - "tokio-rustls 0.24.0", + "tokio-rustls 0.24.1", ] [[package]] @@ -1817,7 +1817,7 @@ dependencies = [ "serde_urlencoded", "tokio", "tokio-native-tls", - "tokio-rustls 0.24.0", + "tokio-rustls 0.24.1", "tokio-util", "tower-service", "trust-dns-resolver", @@ -2370,9 +2370,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0d409377ff5b1e3ca6437aa86c1eb7d40c134bfec254e44c830defa92669db5" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ "rustls 0.21.1", "tokio", From fba862a4e855f906bbfeeb056f4f127b2d7b93ea Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 11 Jun 2023 04:08:37 +0000 Subject: [PATCH 1323/2020] dep: Upgrade transitive dependencies (#1144) Co-authored-by: github-actions --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 32b812a9..b004947c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -723,9 +723,9 @@ dependencies = [ [[package]] name = "file-format" -version = "0.17.2" +version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e44efc8ce1e05c66fa0f68a65e3e6ae01b1515ea623e234b194bdc568a5c7bc9" +checksum = "805eab5eeca901cbdfabf3f54adb2f27464073617279fd4e14eedb2a0757222e" [[package]] name = "filetime" @@ -1290,9 +1290,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.18" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de" +checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" [[package]] name = "lru-cache" From d390d320e9f356f3f24421deffdc08b94ab6518f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 12 Jun 2023 11:23:12 +1000 Subject: [PATCH 1324/2020] Set `upgrade-transitive-deps.yml` to run on every Fri (#1145) To avoid unnecessary PRs. Signed-off-by: Jiahao XU --- .github/workflows/upgrade-transitive-deps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upgrade-transitive-deps.yml b/.github/workflows/upgrade-transitive-deps.yml index 62e795d0..a235906b 100644 --- a/.github/workflows/upgrade-transitive-deps.yml +++ b/.github/workflows/upgrade-transitive-deps.yml @@ -3,7 +3,7 @@ name: Upgrade transitive dependencies on: workflow_dispatch: # Allow running on-demand schedule: - - cron: '0 3 * * *' + - cron: '0 3 * * 5' jobs: upgrade: From a08703874ded2ed96088bba2c227f75d3507acc7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 16 Jun 2023 13:46:16 +1000 Subject: [PATCH 1325/2020] dep: Upgrade transitive dependencies (#1146) Co-authored-by: github-actions --- Cargo.lock | 71 +++++++++++++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b004947c..4967112c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -469,9 +469,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.3" +version = "4.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8f255e4b8027970e78db75e78831229c9815fdbfa67eb1a1b777a62e24b4a0" +checksum = "80672091db20273a15cf9fdd4e47ed43b5091ec9841bf4c6145c9dfbbcae09ed" dependencies = [ "clap_builder", "clap_derive", @@ -480,9 +480,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.3" +version = "4.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acd4f3c17c83b0ba34ffbc4f8bbd74f079413f747f84a6f89292f138057e36ab" +checksum = "c1458a1df40e1e2afebb7ab60ce55c1fa8f431146205aa5f4887e0b111c27636" dependencies = [ "anstream", "anstyle", @@ -912,9 +912,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" +checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "guess_host_triple" @@ -1063,7 +1063,7 @@ checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" dependencies = [ "http", "hyper", - "rustls 0.21.1", + "rustls 0.21.2", "tokio", "tokio-rustls 0.24.1", ] @@ -1208,9 +1208,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.63" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" +checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" dependencies = [ "wasm-bindgen", ] @@ -1810,7 +1810,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.1", + "rustls 0.21.2", "rustls-pemfile 1.0.2", "serde", "serde_json", @@ -1872,9 +1872,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.19" +version = "0.37.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" dependencies = [ "bitflags", "errno 0.3.1", @@ -1898,9 +1898,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.1" +version = "0.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c911ba11bc8433e811ce56fde130ccf32f5127cab0e0194e9c68c5a5b671791e" +checksum = "e32ca28af694bc1bbf399c33a516dbdf1c90090b8ab23c2bc24f834aa2247f5f" dependencies = [ "log", "ring", @@ -1910,9 +1910,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0167bac7a9f490495f3c33013e7722b53cb087ecbe082fb0c6387c96f634ea50" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", "rustls-pemfile 1.0.2", @@ -2374,7 +2374,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.1", + "rustls 0.21.2", "tokio", ] @@ -2732,11 +2732,10 @@ dependencies = [ [[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", ] @@ -2748,9 +2747,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" +checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -2758,9 +2757,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" +checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" dependencies = [ "bumpalo", "log", @@ -2773,9 +2772,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.36" +version = "0.4.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d1985d03709c53167ce907ff394f5316aa22cb4e12761295c5dc57dacb6297e" +checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" dependencies = [ "cfg-if", "js-sys", @@ -2785,9 +2784,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" +checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2795,9 +2794,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" +checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", @@ -2808,9 +2807,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.86" +version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" +checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-streams" @@ -2827,9 +2826,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.63" +version = "0.3.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" dependencies = [ "js-sys", "wasm-bindgen", @@ -3083,9 +3082,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61de7bac303dc551fe038e2b3cef0f571087a47571ea6e79a87692ac99b99699" +checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" dependencies = [ "memchr", ] From cd7431e195016af4348016efa3846b47cfc585cf Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 17 Jun 2023 15:51:56 +1000 Subject: [PATCH 1326/2020] Add `rust-toolchain.toml` (#1147) to fix dependabot Signed-off-by: Jiahao XU --- rust-toolchain.toml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 rust-toolchain.toml diff --git a/rust-toolchain.toml b/rust-toolchain.toml new file mode 100644 index 00000000..2fc3eef2 --- /dev/null +++ b/rust-toolchain.toml @@ -0,0 +1,3 @@ +[toolchain] +channel = "stable" +profile = "minimal" From 1369eea8027e665b2d51cb58739da65701ab6e5f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 17 Jun 2023 19:22:09 +1000 Subject: [PATCH 1327/2020] fix dependabot path to crates (#1148) Signed-off-by: Jiahao XU --- .github/dependabot.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 89dd3eb3..bde33386 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -15,46 +15,46 @@ updates: # from dependabot since compatible updates is covered by # `update-transitive-deps.yml` - package-ecosystem: "cargo" - directory: "/bin" + directory: "/crates/bin" schedule: interval: "daily" - package-ecosystem: "cargo" - directory: "/binstalk" + directory: "/crates/binstalk" schedule: interval: "daily" - package-ecosystem: "cargo" - directory: "/binstalk-downloader" + directory: "/crates/binstalk-downloader" schedule: interval: "daily" - package-ecosystem: "cargo" - directory: "/binstalk-manifests" + directory: "/crates/binstalk-manifests" schedule: interval: "daily" - package-ecosystem: "cargo" - directory: "/binstalk-types" + directory: "/crates/binstalk-types" schedule: interval: "daily" - package-ecosystem: "cargo" - directory: "/detect-targets" + directory: "/crates/detect-targets" schedule: interval: "daily" - package-ecosystem: "cargo" - directory: "/detect-wasi" + directory: "/crates/detect-wasi" schedule: interval: "daily" - package-ecosystem: "cargo" - directory: "/fs-lock" + directory: "/crates/fs-lock" schedule: interval: "daily" - package-ecosystem: "cargo" - directory: "/leon" + directory: "/crates/leon" schedule: interval: "daily" - package-ecosystem: "cargo" - directory: "/leon-macros" + directory: "/crates/leon-macros" schedule: interval: "daily" - package-ecosystem: "cargo" - directory: "/normalize-path" + directory: "/crates/normalize-path" schedule: interval: "daily" From a255e74fc9ecadccd16f2d88ff3d63182a350336 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 17 Jun 2023 22:16:25 +1200 Subject: [PATCH 1328/2020] Show license and source in long help (#1149) * Show license and source in long help Ref https://github.com/oeb25/binswap/issues/2 * Typo --- crates/bin/src/args.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 7c27588c..9a90551d 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -24,6 +24,7 @@ use strum_macros::EnumCount; #[clap( version, about = "Install a Rust binary... from binaries!", + after_long_help = "License: GPLv3. Source available at https://github.com/cargo-bins/cargo-binstall", arg_required_else_help(true), // Avoid conflict with version_req disable_version_flag(true), From bea66d04b59346a902fb680833b1a818986123e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 17 Jun 2023 22:17:24 +1200 Subject: [PATCH 1329/2020] Fix PR CI triggers (#1150) - Remove trigger on "auto merge" enablement, which is just annoying now with the merge queue and was only ever an additional workaround for the release PRs. - Always run the PR CIs, don't ignore markdown files. That made it impossible to merge PRs that only touched those files (without bypassing requirements). --- .github/workflows/ci.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 85942374..9e2c6ee9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,10 +8,6 @@ on: - opened - reopened - synchronize - - auto_merge_enabled - paths-ignore: - - README.md - - SUPPORT.md push: branches: - main From 5c4a542de583ac620c5a6417173e8d4071a090be Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 17 Jun 2023 23:58:14 +1000 Subject: [PATCH 1330/2020] Remove unused `.cargo/config` (#1151) Signed-off-by: Jiahao XU --- .cargo/config | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .cargo/config diff --git a/.cargo/config b/.cargo/config deleted file mode 100644 index 3eec48fd..00000000 --- a/.cargo/config +++ /dev/null @@ -1,11 +0,0 @@ -[target.armv7-unknown-linux-gnueabihf] -linker = "arm-linux-gnueabihf-gcc" - -[target.armv7-unknown-linux-musleabihf] -linker = "arm-linux-musleabihf-gcc" - -[target.aarch64-unknown-linux-gnu] -linker = "aarch64-linux-gnu-gcc" - -[target.aarch64-unknown-linux-musl] -linker = "aarch64-linux-musl-gcc" From 40efe02e34a181606b9699be693317b8fe7b41e7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 19 Jun 2023 12:22:09 +1000 Subject: [PATCH 1331/2020] fix `leon` & `binstalk-downloader` bug relating to features (#1153) - ci: Check feat powerset of leon & binstalk-downloader in `ci.yml` - fix leon feature `cli`: Enable dep `miette` in feature `cli` - fix binstalk-downloader when default feature is disabled and no other tls related feature is enabled (breaking change due to replace of `tls::Version` with newtype `TLSVersion`). Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 70 +++++++------------ crates/bin/src/args.rs | 8 +-- crates/binstalk-downloader/Cargo.toml | 8 ++- crates/binstalk-downloader/src/remote.rs | 30 +++++--- .../src/remote/certificate.rs | 12 +++- .../src/remote/tls_version.rs | 37 ++++++++++ crates/leon/Cargo.toml | 2 +- justfile | 9 ++- 8 files changed, 111 insertions(+), 65 deletions(-) create mode 100644 crates/binstalk-downloader/src/remote/tls_version.rs diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9e2c6ee9..81dd0a35 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,66 +53,46 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - linux-cross-check: + cross-check: strategy: fail-fast: false matrix: - target: - - armv7-unknown-linux-musleabihf - - armv7-unknown-linux-gnueabihf - - aarch64-unknown-linux-musl - - aarch64-unknown-linux-gnu - - x86_64-unknown-linux-musl - - runs-on: ubuntu-latest + include: + - target: armv7-unknown-linux-musleabihf + os: ubuntu-latest + - target: armv7-unknown-linux-gnueabihf + os: ubuntu-latest + - target: aarch64-unknown-linux-musl + os: ubuntu-latest + - target: aarch64-unknown-linux-gnu + os: ubuntu-latest + - target: x86_64-unknown-linux-musl + os: ubuntu-latest + - target: aarch64-apple-darwin + os: macos-latest + - target: aarch64-pc-windows-msvc + os: windows-latest + runs-on: ${{ matrix.os }} env: CARGO_BUILD_TARGET: ${{ matrix.target }} - JUST_USE_CARGO_ZIGBUILD: true - steps: - uses: actions/checkout@v3 - uses: ./.github/actions/just-setup + with: + tools: cargo-hack env: # just-setup use binstall to install sccache, # which works better when we provide it with GITHUB_TOKEN. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Enable cargo-zigbuild + if: matrix.os == 'ubuntu-latest' + run: echo JUST_USE_CARGO_ZIGBUILD=true >> "$GITHUB_ENV" + - run: just ci-install-deps - run: just avoid-dev-deps - run: just check - apple-m1-check: - runs-on: macos-latest - env: - CARGO_BUILD_TARGET: aarch64-apple-darwin - - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/just-setup - env: - # just-setup use binstall to install sccache, - # which works better when we provide it with GITHUB_TOKEN. - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - run: just avoid-dev-deps - - run: just check - - windows-aarch64-check: - runs-on: windows-latest - env: - CARGO_BUILD_TARGET: aarch64-pc-windows-msvc - - steps: - - uses: actions/checkout@v3 - - uses: ./.github/actions/just-setup - env: - # just-setup use binstall to install sccache, - # which works better when we provide it with GITHUB_TOKEN. - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - run: just avoid-dev-deps - - run: just check - lint: strategy: fail-fast: false @@ -146,10 +126,8 @@ jobs: name: Tests pass needs: - test - - linux-cross-check - - apple-m1-check + - cross-check - lint - - windows-aarch64-check - release-builds if: always() # always run even if dependencies fail runs-on: ubuntu-latest diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 9a90551d..814d2705 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -8,7 +8,7 @@ use std::{ }; use binstalk::{ - helpers::remote::tls::Version, + helpers::remote, manifests::cargo_toml_binstall::PkgFmt, ops::resolve::{CrateName, VersionReqExt}, }; @@ -293,11 +293,11 @@ pub enum TLSVersion { Tls1_3, } -impl From for Version { +impl From for remote::TLSVersion { fn from(ver: TLSVersion) -> Self { match ver { - TLSVersion::Tls1_2 => Version::TLS_1_2, - TLSVersion::Tls1_3 => Version::TLS_1_3, + TLSVersion::Tls1_2 => remote::TLSVersion::TLS_1_2, + TLSVersion::Tls1_3 => remote::TLSVersion::TLS_1_3, } } } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 742a905d..c6edfa6a 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -60,7 +60,13 @@ pkg-config = ["zstd/pkg-config"] zlib-ng = ["flate2/zlib-ng"] +# Dummy feature, enabled if rustls or native-tls is enabled. +# Used to avoid compilation error when no feature is enabled. +__tls = [] + rustls = [ + "__tls", + "reqwest/rustls-tls", # Enable the following features only if trust-dns-resolver is enabled. @@ -69,7 +75,7 @@ rustls = [ "trust-dns-resolver?/dns-over-https-rustls", "trust-dns-resolver?/dns-over-quic", ] -native-tls = ["reqwest/native-tls", "trust-dns-resolver?/dns-over-native-tls"] +native-tls = ["__tls", "reqwest/native-tls", "trust-dns-resolver?/dns-over-native-tls"] # Enable trust-dns-resolver so that features on it will also be enabled. trust-dns = ["trust-dns-resolver", "reqwest/trust-dns"] diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 5091be72..2de06d75 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -16,7 +16,7 @@ use thiserror::Error as ThisError; use tower::{limit::rate::RateLimit, Service, ServiceBuilder, ServiceExt}; use tracing::{debug, info}; -pub use reqwest::{header, tls, Error as ReqwestError, Method, StatusCode}; +pub use reqwest::{header, Error as ReqwestError, Method, StatusCode}; pub use url::Url; mod delay_request; @@ -28,6 +28,9 @@ pub use certificate::Certificate; mod request_builder; pub use request_builder::{Body, RequestBuilder, Response}; +mod tls_version; +pub use tls_version::TLSVersion; + #[cfg(feature = "json")] pub use request_builder::JsonError; @@ -35,7 +38,7 @@ const MAX_RETRY_DURATION: Duration = Duration::from_secs(120); const MAX_RETRY_COUNT: u8 = 3; const DEFAULT_RETRY_DURATION_FOR_RATE_LIMIT: Duration = Duration::from_millis(200); const RETRY_DURATION_FOR_TIMEOUT: Duration = Duration::from_millis(200); -const DEFAULT_MIN_TLS: tls::Version = tls::Version::TLS_1_2; +const DEFAULT_MIN_TLS: TLSVersion = TLSVersion::TLS_1_2; #[derive(Debug, ThisError)] #[non_exhaustive] @@ -69,6 +72,7 @@ struct Inner { #[derive(Clone, Debug)] pub struct Client(Arc); +#[cfg_attr(not(feature = "__tls"), allow(unused_variables, unused_mut))] impl Client { /// * `per` - must not be 0. /// * `num_request` - maximum number of requests to be processed for @@ -77,30 +81,34 @@ impl Client { /// The Client created would use at least tls 1.2 pub fn new( user_agent: impl AsRef, - min_tls: Option, + min_tls: Option, per: Duration, num_request: NonZeroU64, certificates: impl IntoIterator, ) -> Result { fn inner( user_agent: &str, - min_tls: Option, + min_tls: Option, per: Duration, num_request: NonZeroU64, certificates: &mut dyn Iterator, ) -> Result { - let tls_ver = min_tls - .map(|tls| tls.max(DEFAULT_MIN_TLS)) - .unwrap_or(DEFAULT_MIN_TLS); - let mut builder = reqwest::ClientBuilder::new() .user_agent(user_agent) .https_only(true) - .min_tls_version(tls_ver) .tcp_nodelay(false); - for certificate in certificates { - builder = builder.add_root_certificate(certificate.0); + #[cfg(feature = "__tls")] + { + let tls_ver = min_tls + .map(|tls| tls.max(DEFAULT_MIN_TLS)) + .unwrap_or(DEFAULT_MIN_TLS); + + builder = builder.min_tls_version(tls_ver.into()); + + for certificate in certificates { + builder = builder.add_root_certificate(certificate.0); + } } let client = builder.build()?; diff --git a/crates/binstalk-downloader/src/remote/certificate.rs b/crates/binstalk-downloader/src/remote/certificate.rs index b5dd8259..29e9b93f 100644 --- a/crates/binstalk-downloader/src/remote/certificate.rs +++ b/crates/binstalk-downloader/src/remote/certificate.rs @@ -1,13 +1,19 @@ +#[cfg(feature = "__tls")] use reqwest::tls; use super::Error; #[derive(Clone, Debug)] -pub struct Certificate(pub(super) tls::Certificate); +pub struct Certificate(#[cfg(feature = "__tls")] pub(super) tls::Certificate); +#[cfg_attr(not(feature = "__tls"), allow(unused_variables))] impl Certificate { /// Create a Certificate from a binary DER encoded certificate pub fn from_der(der: impl AsRef<[u8]>) -> Result { + #[cfg(not(feature = "__tls"))] + return Ok(Self()); + + #[cfg(feature = "__tls")] tls::Certificate::from_der(der.as_ref()) .map(Self) .map_err(Error::from) @@ -15,6 +21,10 @@ impl Certificate { /// Create a Certificate from a PEM encoded certificate pub fn from_pem(pem: impl AsRef<[u8]>) -> Result { + #[cfg(not(feature = "__tls"))] + return Ok(Self()); + + #[cfg(feature = "__tls")] tls::Certificate::from_pem(pem.as_ref()) .map(Self) .map_err(Error::from) diff --git a/crates/binstalk-downloader/src/remote/tls_version.rs b/crates/binstalk-downloader/src/remote/tls_version.rs new file mode 100644 index 00000000..06bbedff --- /dev/null +++ b/crates/binstalk-downloader/src/remote/tls_version.rs @@ -0,0 +1,37 @@ +#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)] +enum Inner { + Tls1_2 = 0, + Tls1_3 = 1, +} + +/// TLS version for [`crate::remote::Client`]. +#[derive(Debug, Copy, Clone, PartialEq, Eq, PartialOrd, Ord)] +pub struct TLSVersion(Inner); + +impl TLSVersion { + pub const TLS_1_2: TLSVersion = TLSVersion(Inner::Tls1_2); + pub const TLS_1_3: TLSVersion = TLSVersion(Inner::Tls1_3); +} + +#[cfg(feature = "__tls")] +impl From for reqwest::tls::Version { + fn from(ver: TLSVersion) -> reqwest::tls::Version { + use reqwest::tls::Version; + use Inner::*; + + match ver.0 { + Tls1_2 => Version::TLS_1_2, + Tls1_3 => Version::TLS_1_3, + } + } +} + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn test_tls_version_order() { + assert!(TLSVersion::TLS_1_2 < TLSVersion::TLS_1_3); + } +} diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 10722d34..d3ff8eb9 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -17,5 +17,5 @@ thiserror = "1.0.38" [features] default = ["miette"] -cli = ["dep:clap", "miette?/fancy-no-backtrace"] +cli = ["dep:clap", "miette", "miette?/fancy-no-backtrace"] miette = ["dep:miette"] diff --git a/justfile b/justfile index 3a1d3f06..58a05e6e 100644 --- a/justfile +++ b/justfile @@ -148,7 +148,8 @@ target-glibc-ver-postfix := if glibc-version != "" { "" } -cargo-build-args := (if for-release != "" { " --release" } else { "" }) + (" --target ") + (target) + (target-glibc-ver-postfix) + (cargo-buildstd) + (if extra-build-args != "" { " " + extra-build-args } else { "" }) + (cargo-no-default-features) + (cargo-split-debuginfo) + (if cargo-features != "" { " --features " + cargo-features } else { "" }) + (win-arm64-ring16) + (if timings != "" { " --timings" } else { "" }) +cargo-check-args := (" --target ") + (target) + (target-glibc-ver-postfix) + (cargo-buildstd) + (if extra-build-args != "" { " " + extra-build-args } else { "" }) + (cargo-split-debuginfo) + (win-arm64-ring16) +cargo-build-args := (if for-release != "" { " --release" } else { "" }) + (cargo-check-args) + (cargo-no-default-features) + (if cargo-features != "" { " --features " + cargo-features } else { "" }) + (if timings != "" { " --timings" } else { "" }) export RUSTFLAGS := (linker-plugin-lto) + (rustc-gcclibs) + (rustc-miropt) + (rust-lld) + (rustc-icf) @@ -181,6 +182,12 @@ build: print-env check: print-env {{cargo-bin}} check {{cargo-build-args}} + cargo-hack hack check --feature-powerset -p leon {{cargo-check-args}} + {{cargo-bin}} check -p binstalk-downloader --no-default-features + cargo-hack hack check -p binstalk-downloader \ + --feature-powerset \ + --include-features default,json,gh-api-client \ + {{cargo-check-args}} get-output file outdir=".": test -d "{{outdir}}" || mkdir -p {{outdir}} From 181b5293e73cfe16f7a79c5b3a4339bd522d31f3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 20 Jun 2023 10:16:10 +1000 Subject: [PATCH 1332/2020] dep: Bump strum v0.24.1 => v0.25.0 (#1159) Also bump strum_macros v0.24.3 => v0.25.0 [strum and strum_macros v0.25.0 changelog][1] [1]: https://github.com/Peternator7/strum/blob/master/CHANGELOG.md Signed-off-by: Jiahao XU --- Cargo.lock | 10 +++++----- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-types/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4967112c..b9a89566 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2170,21 +2170,21 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strum" -version = "0.24.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" +checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" [[package]] name = "strum_macros" -version = "0.24.3" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" +checksum = "fe9f3bd7d2e45dcc5e265fbb88d6513e4747d8ef9444cf01a533119bce28a157" dependencies = [ "heck", "proc-macro2", "quote", "rustversion", - "syn 1.0.109", + "syn 2.0.18", ] [[package]] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 2b6c3733..b4bf6531 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -35,8 +35,8 @@ miette = "5.9.0" mimalloc = { version = "0.1.37", default-features = false, optional = true } once_cell = "1.18.0" semver = "1.0.17" -strum = "0.24.1" -strum_macros = "0.24.3" +strum = "0.25.0" +strum_macros = "0.25.0" supports-color = "2.0.0" tempfile = "3.5.0" tokio = { version = "1.28.2", features = ["rt-multi-thread"], default-features = false } diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index a9193a57..64bfc4be 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -15,6 +15,6 @@ maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.18.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } -strum = "0.24.1" -strum_macros = "0.24.3" +strum = "0.25.0" +strum_macros = "0.25.0" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 0d75203e..4b926224 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -29,7 +29,7 @@ normalize-path = { version = "0.2.0", path = "../normalize-path" } once_cell = "1.18.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } -strum = "0.24.1" +strum = "0.25.0" tempfile = "3.5.0" thiserror = "1.0.40" # parking_lot for `tokio::sync::OnceCell::const_new` From d8419ea5a2059a6a2b6b1c1c4bd6ebf0e25016ad Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 21 Jun 2023 08:05:13 +1000 Subject: [PATCH 1333/2020] feat: Add more variables for template (#1160) Fixed #775 - Add dep target-lexicon v0.12.7 - Add `target-{family, arch, libc, vendor}` to `package.metadata.binstall`. For `{universal, universal2}-apple-darwin`, the `target-arch` is set to `universal`. Signed-off-by: Jiahao XU --- Cargo.lock | 7 + crates/binstalk/Cargo.toml | 1 + crates/binstalk/src/bins.rs | 10 +- crates/binstalk/src/errors.rs | 16 ++ crates/binstalk/src/fetchers.rs | 5 +- crates/binstalk/src/fetchers/gh_crate_meta.rs | 201 +++++++++--------- crates/binstalk/src/fetchers/quickinstall.rs | 9 +- crates/binstalk/src/helpers.rs | 5 + crates/binstalk/src/helpers/target_triple.rs | 54 +++++ crates/binstalk/src/ops/resolve.rs | 17 +- 10 files changed, 210 insertions(+), 115 deletions(-) create mode 100644 crates/binstalk/src/helpers/target_triple.rs diff --git a/Cargo.lock b/Cargo.lock index b9a89566..7f82f6ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -238,6 +238,7 @@ dependencies = [ "semver", "serde", "strum", + "target-lexicon", "tempfile", "thiserror", "tokio", @@ -2237,6 +2238,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "target-lexicon" +version = "0.12.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5" + [[package]] name = "tempfile" version = "3.6.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 4b926224..30e1d0a4 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -30,6 +30,7 @@ once_cell = "1.18.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } strum = "0.25.0" +target-lexicon = { version = "0.12.7", features = ["std"] } tempfile = "3.5.0" thiserror = "1.0.40" # parking_lot for `tokio::sync::OnceCell::const_new` diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 939afb96..980069f2 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -15,7 +15,7 @@ use crate::{ atomic_install, atomic_install_noclobber, atomic_symlink_file, atomic_symlink_file_noclobber, }, - helpers::download::ExtractedFiles, + helpers::{download::ExtractedFiles, target_triple::TargetTriple}, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; @@ -98,6 +98,8 @@ impl BinFile { version: data.version, bin: base_name, binary_ext, + + triple: data.triple, }; let (source, archive_source_path) = if data.meta.pkg_fmt == Some(PkgFmt::Bin) { @@ -271,6 +273,7 @@ pub struct Data<'a> { pub meta: PkgMeta, pub bin_path: &'a Path, pub install_path: &'a Path, + pub triple: &'a TargetTriple, } #[derive(Clone, Debug)] @@ -283,6 +286,8 @@ struct Context<'c> { /// Filename extension on the binary, i.e. .exe on Windows, nothing otherwise pub binary_ext: &'c str, + + pub triple: &'c TargetTriple, } impl leon::Values for Context<'_> { @@ -296,7 +301,8 @@ impl leon::Values for Context<'_> { "binary-ext" => Some(Cow::Borrowed(self.binary_ext)), // Soft-deprecated alias for binary-ext "format" => Some(Cow::Borrowed(self.binary_ext)), - _ => None, + + key => self.triple.get_value(key), } } } diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index d01d6a22..bc637947 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -10,6 +10,7 @@ use binstalk_downloader::{ use cargo_toml::Error as CargoTomlError; use compact_str::CompactString; use miette::{Diagnostic, Report}; +use target_lexicon::ParseError as TargetTripleParseError; use thiserror::Error; use tokio::task; use tracing::{error, warn}; @@ -314,6 +315,14 @@ pub enum BinstallError { #[diagnostic(severity(error), code(binstall::gh_api_failure))] GhApiErr(#[source] Box), + /// Failed to parse target triple + /// + /// - Code: `binstall::target_triple_parse_error` + /// - Exit: 97 + #[error("Failed to parse target triple: {0}")] + #[diagnostic(severity(error), code(binstall::target_triple_parse_error))] + TargetTripleParseError(#[source] Box), + /// A wrapped error providing the context of which crate the error is about. #[error(transparent)] #[diagnostic(transparent)] @@ -348,6 +357,7 @@ impl BinstallError { NoFallbackToCargoInstall => 94, InvalidPkgFmt(..) => 95, GhApiErr(..) => 96, + TargetTripleParseError(..) => 97, CrateContext(context) => context.err.exit_number(), }; @@ -441,3 +451,9 @@ impl From for BinstallError { BinstallError::GhApiErr(Box::new(e)) } } + +impl From for BinstallError { + fn from(e: target_lexicon::ParseError) -> Self { + BinstallError::TargetTripleParseError(Box::new(e)) + } +} diff --git a/crates/binstalk/src/fetchers.rs b/crates/binstalk/src/fetchers.rs index 03822e7b..194a96c5 100644 --- a/crates/binstalk/src/fetchers.rs +++ b/crates/binstalk/src/fetchers.rs @@ -11,7 +11,7 @@ use crate::{ errors::BinstallError, helpers::{ download::ExtractedFiles, gh_api_client::GhApiClient, remote::Client, - tasks::AutoAbortJoinHandle, + target_triple::TargetTriple, tasks::AutoAbortJoinHandle, }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; @@ -72,6 +72,8 @@ pub trait Fetcher: Send + Sync { /// Return the target for this fetcher fn target(&self) -> &str; + + fn target_data(&self) -> &Arc; } #[derive(Clone, Debug)] @@ -186,6 +188,7 @@ impl RepoInfo { #[derive(Clone, Debug)] pub struct TargetData { pub target: String, + pub triple: TargetTriple, pub meta: PkgMeta, } diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk/src/fetchers/gh_crate_meta.rs index aa5a3d9e..33d732c2 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk/src/fetchers/gh_crate_meta.rs @@ -15,6 +15,7 @@ use crate::{ futures_resolver::FuturesResolver, gh_api_client::GhApiClient, remote::{does_url_exist, Client}, + target_triple::TargetTriple, tasks::AutoAbortJoinHandle, }, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, @@ -45,6 +46,7 @@ impl GhCrateMeta { let ctx = Context::from_data_with_repo( &self.data, &self.target_data.target, + &self.target_data.triple, ext, repo, subcrate, @@ -275,6 +277,10 @@ impl super::Fetcher for GhCrateMeta { fn target(&self) -> &str { &self.target_data.target } + + fn target_data(&self) -> &Arc { + &self.target_data + } } /// Template for constructing download paths @@ -295,6 +301,8 @@ struct Context<'c> { /// Workspace of the crate inside the repository. pub subcrate: Option<&'c str>, + + pub triple: &'c TargetTriple, } impl leon::Values for Context<'_> { @@ -316,15 +324,16 @@ impl leon::Values for Context<'_> { "subcrate" => self.subcrate.map(Cow::Borrowed), - _ => None, + key => self.triple.get_value(key), } } } impl<'c> Context<'c> { - pub(self) fn from_data_with_repo( + fn from_data_with_repo( data: &'c Data, target: &'c str, + triple: &'c TargetTriple, archive_suffix: Option<&'c str>, repo: Option<&'c str>, subcrate: Option<&'c str>, @@ -344,6 +353,7 @@ impl<'c> Context<'c> { name: &data.name, repo, target, + version: &data.version, archive_format, archive_suffix, @@ -353,18 +363,9 @@ impl<'c> Context<'c> { "" }, subcrate, - } - } - #[cfg(test)] - pub(self) fn from_data(data: &'c Data, target: &'c str, archive_format: &'c str) -> Self { - Self::from_data_with_repo( - data, - target, - Some(archive_format), - data.repo.as_deref(), - None, - ) + triple, + } } /// * `tt` - must have added a template named "pkg_url". @@ -388,132 +389,124 @@ impl<'c> Context<'c> { #[cfg(test)] mod test { - use crate::manifests::cargo_toml_binstall::PkgMeta; - use super::{super::Data, Context}; + use std::str::FromStr; + + use super::{super::Data, Context, TargetTriple}; use compact_str::ToCompactString; use url::Url; const DEFAULT_PKG_URL: &str = "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }.{ archive-format }"; - fn url(s: &str) -> Url { - Url::parse(s).unwrap() + fn assert_context_rendering( + data: &Data, + target: &str, + archive_format: &str, + template: &str, + expected_url: &str, + ) { + let triple = &TargetTriple::from_str(target).unwrap(); + + let ctx = Context::from_data_with_repo( + data, + target, + triple, + Some(archive_format), + data.repo.as_deref(), + None, + ); + + let expected_url = Url::parse(expected_url).unwrap(); + assert_eq!(ctx.render_url(template).unwrap(), expected_url); } #[test] fn defaults() { - let data = Data::new( - "cargo-binstall".to_compact_string(), - "1.2.3".to_compact_string(), - Some("https://github.com/ryankurte/cargo-binstall".to_string()), + assert_context_rendering( + &Data::new( + "cargo-binstall".to_compact_string(), + "1.2.3".to_compact_string(), + Some("https://github.com/ryankurte/cargo-binstall".to_string()), + ), + "x86_64-unknown-linux-gnu", + ".tgz", + DEFAULT_PKG_URL, + "https://github.com/ryankurte/cargo-binstall/releases/download/v1.2.3/cargo-binstall-x86_64-unknown-linux-gnu-v1.2.3.tgz" ); - - let ctx = Context::from_data(&data, "x86_64-unknown-linux-gnu", ".tgz"); - assert_eq!( - ctx.render_url(DEFAULT_PKG_URL).unwrap(), - url("https://github.com/ryankurte/cargo-binstall/releases/download/v1.2.3/cargo-binstall-x86_64-unknown-linux-gnu-v1.2.3.tgz") - ); - } - - #[test] - #[should_panic] - fn no_repo() { - let meta = PkgMeta::default(); - let data = Data::new( - "cargo-binstall".to_compact_string(), - "1.2.3".to_compact_string(), - None, - ); - - let ctx = Context::from_data(&data, "x86_64-unknown-linux-gnu", ".tgz"); - ctx.render_url(meta.pkg_url.as_deref().unwrap()).unwrap(); } #[test] fn no_repo_but_full_url() { - let pkg_url = &format!("https://example.com{}", &DEFAULT_PKG_URL[8..]); - - let data = Data::new( - "cargo-binstall".to_compact_string(), - "1.2.3".to_compact_string(), - None, - ); - - let ctx = Context::from_data(&data, "x86_64-unknown-linux-gnu", ".tgz"); - assert_eq!( - ctx.render_url(pkg_url).unwrap(), - url("https://example.com/releases/download/v1.2.3/cargo-binstall-x86_64-unknown-linux-gnu-v1.2.3.tgz") + assert_context_rendering( + &Data::new( + "cargo-binstall".to_compact_string(), + "1.2.3".to_compact_string(), + None, + ), + "x86_64-unknown-linux-gnu", + ".tgz", + &format!("https://example.com{}", &DEFAULT_PKG_URL[8..]), + "https://example.com/releases/download/v1.2.3/cargo-binstall-x86_64-unknown-linux-gnu-v1.2.3.tgz" ); } #[test] fn different_url() { - let pkg_url = - "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ archive-format }"; - - let data = Data::new( - "radio-sx128x".to_compact_string(), - "0.14.1-alpha.5".to_compact_string(), - Some("https://github.com/rust-iot/rust-radio-sx128x".to_string()), - ); - - let ctx = Context::from_data(&data, "x86_64-unknown-linux-gnu", ".tgz"); - assert_eq!( - ctx.render_url(pkg_url).unwrap(), - url("https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz") + assert_context_rendering( + &Data::new( + "radio-sx128x".to_compact_string(), + "0.14.1-alpha.5".to_compact_string(), + Some("https://github.com/rust-iot/rust-radio-sx128x".to_string()), + ), + "x86_64-unknown-linux-gnu", + ".tgz", + "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ archive-format }", + "https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz" ); } #[test] fn deprecated_format() { - let pkg_url = "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ format }"; - - let data = Data::new( - "radio-sx128x".to_compact_string(), - "0.14.1-alpha.5".to_compact_string(), - Some("https://github.com/rust-iot/rust-radio-sx128x".to_string()), - ); - - let ctx = Context::from_data(&data, "x86_64-unknown-linux-gnu", ".tgz"); - assert_eq!( - ctx.render_url(pkg_url).unwrap(), - url("https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz") + assert_context_rendering( + &Data::new( + "radio-sx128x".to_compact_string(), + "0.14.1-alpha.5".to_compact_string(), + Some("https://github.com/rust-iot/rust-radio-sx128x".to_string()), + ), + "x86_64-unknown-linux-gnu", + ".tgz", + "{ repo }/releases/download/v{ version }/sx128x-util-{ target }-v{ version }.{ format }", + "https://github.com/rust-iot/rust-radio-sx128x/releases/download/v0.14.1-alpha.5/sx128x-util-x86_64-unknown-linux-gnu-v0.14.1-alpha.5.tgz" ); } #[test] fn different_ext() { - let pkg_url = - "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }.tar.xz"; - - let data = Data::new( - "cargo-watch".to_compact_string(), - "9.0.0".to_compact_string(), - Some("https://github.com/watchexec/cargo-watch".to_string()), - ); - - let ctx = Context::from_data(&data, "aarch64-apple-darwin", ".txz"); - assert_eq!( - ctx.render_url(pkg_url).unwrap(), - url("https://github.com/watchexec/cargo-watch/releases/download/v9.0.0/cargo-watch-v9.0.0-aarch64-apple-darwin.tar.xz") + assert_context_rendering( + &Data::new( + "cargo-watch".to_compact_string(), + "9.0.0".to_compact_string(), + Some("https://github.com/watchexec/cargo-watch".to_string()), + ), + "aarch64-apple-darwin", + ".txz", + "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }.tar.xz", + "https://github.com/watchexec/cargo-watch/releases/download/v9.0.0/cargo-watch-v9.0.0-aarch64-apple-darwin.tar.xz" ); } #[test] fn no_archive() { - let pkg_url = "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }{ binary-ext }" - ; - - let data = Data::new( - "cargo-watch".to_compact_string(), - "9.0.0".to_compact_string(), - Some("https://github.com/watchexec/cargo-watch".to_string()), - ); - - let ctx = Context::from_data(&data, "aarch64-pc-windows-msvc", ".bin"); - assert_eq!( - ctx.render_url(pkg_url).unwrap(), - url("https://github.com/watchexec/cargo-watch/releases/download/v9.0.0/cargo-watch-v9.0.0-aarch64-pc-windows-msvc.exe") + assert_context_rendering( + &Data::new( + "cargo-watch".to_compact_string(), + "9.0.0".to_compact_string(), + Some("https://github.com/watchexec/cargo-watch".to_string()), + ), + "aarch64-pc-windows-msvc", + ".bin", + "{ repo }/releases/download/v{ version }/{ name }-v{ version }-{ target }{ binary-ext }", + "https://github.com/watchexec/cargo-watch/releases/download/v9.0.0/cargo-watch-v9.0.0-aarch64-pc-windows-msvc.exe" ); } } diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs index cb071c6b..a6850f5f 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk/src/fetchers/quickinstall.rs @@ -9,6 +9,7 @@ use crate::{ helpers::{ download::{Download, ExtractedFiles}, gh_api_client::GhApiClient, + is_universal_macos, remote::{does_url_exist, Client, Method}, tasks::AutoAbortJoinHandle, }, @@ -20,10 +21,6 @@ use super::{Data, TargetData}; const BASE_URL: &str = "https://github.com/cargo-bins/cargo-quickinstall/releases/download"; const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; -fn is_universal_macos(target: &str) -> bool { - ["universal-apple-darwin", "universal2-apple-darwin"].contains(&target) -} - pub struct QuickInstall { client: Client, gh_api_client: GhApiClient, @@ -136,6 +133,10 @@ by rust officially."#, fn target(&self) -> &str { &self.target_data.target } + + fn target_data(&self) -> &Arc { + &self.target_data + } } impl QuickInstall { diff --git a/crates/binstalk/src/helpers.rs b/crates/binstalk/src/helpers.rs index bfc42460..23ed00ef 100644 --- a/crates/binstalk/src/helpers.rs +++ b/crates/binstalk/src/helpers.rs @@ -2,6 +2,11 @@ pub mod futures_resolver; pub mod jobserver_client; pub mod remote; pub mod signal; +pub mod target_triple; pub mod tasks; pub use binstalk_downloader::{download, gh_api_client}; + +pub fn is_universal_macos(target: &str) -> bool { + ["universal-apple-darwin", "universal2-apple-darwin"].contains(&target) +} diff --git a/crates/binstalk/src/helpers/target_triple.rs b/crates/binstalk/src/helpers/target_triple.rs new file mode 100644 index 00000000..c4cb10d6 --- /dev/null +++ b/crates/binstalk/src/helpers/target_triple.rs @@ -0,0 +1,54 @@ +use std::{borrow::Cow, str::FromStr}; + +use compact_str::{CompactString, ToCompactString}; +use target_lexicon::Triple; + +use crate::{errors::BinstallError, helpers::is_universal_macos}; + +#[derive(Clone, Debug)] +pub struct TargetTriple { + // TODO: Once https://github.com/bytecodealliance/target-lexicon/pull/90 + // lands, consider replacing use of CompactString with `Cow<'_, str>`. + pub target_family: CompactString, + pub target_arch: CompactString, + pub target_libc: CompactString, + pub target_vendor: CompactString, +} + +impl FromStr for TargetTriple { + type Err = BinstallError; + + fn from_str(mut s: &str) -> Result { + let is_universal_macos = is_universal_macos(s); + + if is_universal_macos { + s = "x86_64-apple-darwin"; + } + + let triple = Triple::from_str(s)?; + + Ok(Self { + target_family: triple.operating_system.to_compact_string(), + target_arch: if is_universal_macos { + "universal".to_compact_string() + } else { + triple.architecture.to_compact_string() + }, + target_libc: triple.environment.to_compact_string(), + target_vendor: triple.vendor.to_compact_string(), + }) + } +} + +impl leon::Values for TargetTriple { + fn get_value<'s>(&'s self, key: &str) -> Option> { + match key { + "target-family" => Some(Cow::Borrowed(&self.target_family)), + "target-arch" => Some(Cow::Borrowed(&self.target_arch)), + "target-libc" => Some(Cow::Borrowed(&self.target_libc)), + "target-vendor" => Some(Cow::Borrowed(&self.target_vendor)), + + _ => None, + } + } +} diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 0c98a6f3..f38246bf 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -3,6 +3,7 @@ use std::{ collections::{BTreeMap, BTreeSet}, iter, mem, path::Path, + str::FromStr, sync::Arc, }; @@ -21,7 +22,7 @@ use crate::{ drivers::fetch_crate_cratesio, errors::{BinstallError, VersionParseError}, fetchers::{Data, Fetcher, TargetData}, - helpers::{download::ExtractedFiles, remote::Client}, + helpers::{download::ExtractedFiles, remote::Client, target_triple::TargetTriple}, manifests::cargo_toml_binstall::{Meta, PkgMeta, PkgOverride}, }; @@ -76,7 +77,13 @@ async fn resolve_inner( return Ok(Resolution::AlreadyUpToDate) }; - let desired_targets = opts.desired_targets.get().await; + let desired_targets = opts + .desired_targets + .get() + .await + .iter() + .map(|target| TargetTriple::from_str(target).map(|triple| (triple, target))) + .collect::, _>>()?; let resolvers = &opts.resolvers; let mut handles: Vec<(Arc, _)> = @@ -90,8 +97,8 @@ async fn resolve_inner( handles.extend( desired_targets - .iter() - .map(|target| { + .into_iter() + .map(|(triple, target)| { debug!("Building metadata for target: {target}"); let target_meta = package_info.meta.merge_overrides( @@ -102,6 +109,7 @@ async fn resolve_inner( Arc::new(TargetData { target: target.clone(), + triple, meta: target_meta, }) }) @@ -295,6 +303,7 @@ fn collect_bin_files( meta, bin_path, install_path, + triple: &fetcher.target_data().triple, }; let bin_dir = bin_data From abecd9ae14f5b55d1a75da87d5a12684bf71d7a5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 21 Jun 2023 20:04:09 +1000 Subject: [PATCH 1334/2020] ci: Publish to crates.io in `release.yml` after tagging (#1152) Fixed #1046 so that we don't have to manually run `cargo-publish` after the CI is merged. Signed-off-by: Jiahao XU --- .github/scripts/release-pr-template.ejs | 23 ++++------------------- .github/workflows/ci.yml | 1 + .github/workflows/release.yml | 14 +++++++++++++- 3 files changed, 18 insertions(+), 20 deletions(-) diff --git a/.github/scripts/release-pr-template.ejs b/.github/scripts/release-pr-template.ejs index aa5482fc..d94c008b 100644 --- a/.github/scripts/release-pr-template.ejs +++ b/.github/scripts/release-pr-template.ejs @@ -13,26 +13,11 @@ This is a release PR for **<%= crate.name %>** version **<%= version.actual %>** **Use squash merge.** <% if (crate.name == "cargo-binstall") { %> -Upon merging, this will automatically create the tag `v<%= version.actual %>`, build the CLI, and create a GitHub release with the release notes below. -You will still need to manually publish the cargo crate: - -``` -$ git switch main -$ git pull -$ git switch --detach v<%= version.actual %> -$ cargo publish -p <%= crate.name %> -``` +Upon merging, this will automatically create the tag `v<%= version.actual %>`, build the CLI, +create a GitHub release with the release notes below <% } else { %> -Upon merging, this will create the tag `<%= crate.name %>-v<%= version.actual %>`. -You will still need to manually publish the cargo crate: - -``` -$ git switch main -$ git pull -$ git switch --detach <%= crate.name %>-v<%= version.actual %> -$ cargo publish -p <%= crate.name %> -``` -<% } %> +Upon merging, this will create the tag `<%= crate.name %>-v<%= version.actual %>` +<% } %>, and CI will publish to crates.io on merge of this PR. **To trigger builds initially, close and then immediately re-open this PR once.** diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81dd0a35..e1537371 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -2,6 +2,7 @@ name: CI on: workflow_dispatch: + workflow_call: merge_group: pull_request: types: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bc054982..6ff5a160 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,9 +22,16 @@ jobs: event-data: ${{ toJSON(github.event) }} extract-notes-under: '### Release notes' - tag: + test: if: needs.info.outputs.is-release == 'true' needs: info + uses: ./.github/workflows/ci.yml + + tag: + if: needs.info.outputs.is-release == 'true' + needs: + - info + - test runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -42,6 +49,11 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} custom_tag: ${{ needs.info.outputs.version }} tag_prefix: v + - name: Publish to crates.io + run: | + cargo publish --no-verify -p '${{ needs.info.outputs.crate }}' + env: + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} package: if: needs.info.outputs.is-release == 'true' && needs.info.outputs.crate == 'cargo-binstall' From 138112cd6e7f775d5778e80cbfb41960722ca91e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 21 Jun 2023 20:05:19 +1000 Subject: [PATCH 1335/2020] Optimize `TargetTriple`: Use `Cow<'static, str>` (#1161) instead of `CompactString` since `target_lexicon::{OperatingSystem, Architecture, Environment}::into_str()` will return a `&'static str` most of the time. Also updated `SUPPORT.md`. Signed-off-by: Jiahao XU --- Cargo.lock | 4 ++-- SUPPORT.md | 14 +++++++++++++- crates/binstalk/Cargo.toml | 2 +- crates/binstalk/src/helpers/target_triple.rs | 16 +++++++--------- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7f82f6ee..7a804314 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2240,9 +2240,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.7" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd1ba337640d60c3e96bc6f0638a939b9c9a7f2c316a1598c279828b3d1dc8c5" +checksum = "1b1c7f239eb94671427157bd93b3694320f3668d4e1eff08c7285366fd777fac" [[package]] name = "tempfile" diff --git a/SUPPORT.md b/SUPPORT.md index 0e567279..b5487ee4 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -24,7 +24,9 @@ With the following configuration keys: `pkg-url` and `bin-dir` are templated to support different names for different versions / architectures / etc. -Template variables use the format `{ VAR }` where `VAR` is the name of the variable, with the following variables available: +Template variables use the format `{ VAR }` where `VAR` is the name of the variable, +`\{` for literal `{`, `\}` for literal `}` and `\\` for literal `\`, +with the following variables available: - `name` is the name of the crate/package - `version` is the crate version (per `--version` and the crate manifest) - `repo` is the repository linked in `Cargo.toml` @@ -34,6 +36,16 @@ Template variables use the format `{ VAR }` where `VAR` is the name of the varia - `archive-format` is the soft-deprecated filename extension of the package archive format that does not include the prefix `.`, e.g. `tgz` for tgz or `exe`/`""` for bin. - `binary-ext` is the string `.exe` if the `target` is for Windows, or the empty string otherwise - `format` is a soft-deprecated alias for `archive-format` in `pkg-url`, and alias for `binary-ext` in `bin-dir`; in the future, this may warn at install time. +- `target-family`: Operating system of the target from [`target_lexicon::OperatingSystem`] +- `target-arch`: Architecture of the target, `universal` on `{universal, universal2}-apple-darwin`, + otherwise from [`target_lexicon::Architecture`] +- `target-libc`: ABI environment of the target from [`target_lexicon::Environment`] +- `target-vendor`: Vendor of the target from [`target_lexicon::Vendor`] + +[`target_lexicon::OperatingSystem`]: https://docs.rs/target-lexicon/latest/target_lexicon/enum.OperatingSystem.html +[`target_lexicon::Architecture`]: https://docs.rs/target-lexicon/latest/target_lexicon/enum.Architecture.html +[`target_lexicon::Environment`]: https://docs.rs/target-lexicon/latest/target_lexicon/enum.Environment.html +[`target_lexicon::Vendor`]: https://docs.rs/target-lexicon/latest/target_lexicon/enum.Vendor.html `pkg-url`, `pkg-fmt` and `bin-dir` can be overridden on a per-target basis if required, for example, if your `x86_64-pc-windows-msvc` builds use `zip` archives this could be set via: diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 30e1d0a4..849c3b56 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -30,7 +30,7 @@ once_cell = "1.18.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } strum = "0.25.0" -target-lexicon = { version = "0.12.7", features = ["std"] } +target-lexicon = { version = "0.12.8", features = ["std"] } tempfile = "3.5.0" thiserror = "1.0.40" # parking_lot for `tokio::sync::OnceCell::const_new` diff --git a/crates/binstalk/src/helpers/target_triple.rs b/crates/binstalk/src/helpers/target_triple.rs index c4cb10d6..260deac4 100644 --- a/crates/binstalk/src/helpers/target_triple.rs +++ b/crates/binstalk/src/helpers/target_triple.rs @@ -7,11 +7,9 @@ use crate::{errors::BinstallError, helpers::is_universal_macos}; #[derive(Clone, Debug)] pub struct TargetTriple { - // TODO: Once https://github.com/bytecodealliance/target-lexicon/pull/90 - // lands, consider replacing use of CompactString with `Cow<'_, str>`. - pub target_family: CompactString, - pub target_arch: CompactString, - pub target_libc: CompactString, + pub target_family: Cow<'static, str>, + pub target_arch: Cow<'static, str>, + pub target_libc: Cow<'static, str>, pub target_vendor: CompactString, } @@ -28,13 +26,13 @@ impl FromStr for TargetTriple { let triple = Triple::from_str(s)?; Ok(Self { - target_family: triple.operating_system.to_compact_string(), + target_family: triple.operating_system.into_str(), target_arch: if is_universal_macos { - "universal".to_compact_string() + Cow::Borrowed("universal") } else { - triple.architecture.to_compact_string() + triple.architecture.into_str() }, - target_libc: triple.environment.to_compact_string(), + target_libc: triple.environment.into_str(), target_vendor: triple.vendor.to_compact_string(), }) } From 12c1160a4150cfa8831bde961c5aed0958e33906 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 23 Jun 2023 14:24:06 +1000 Subject: [PATCH 1336/2020] dep: Upgrade transitive dependencies (#1164) Co-authored-by: github-actions --- Cargo.lock | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7a804314..99cfdc09 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -69,15 +69,15 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" +checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" [[package]] name = "anstyle-parse" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" dependencies = [ "utf8parse", ] @@ -470,9 +470,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.4" +version = "4.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80672091db20273a15cf9fdd4e47ed43b5091ec9841bf4c6145c9dfbbcae09ed" +checksum = "2686c4115cb0810d9a984776e197823d08ec94f176549a89a9efded477c456dc" dependencies = [ "clap_builder", "clap_derive", @@ -481,9 +481,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.4" +version = "4.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1458a1df40e1e2afebb7ab60ce55c1fa8f431146205aa5f4887e0b111c27636" +checksum = "2e53afce1efce6ed1f633cf0e57612fe51db54a1ee4fd8f8503d078fe02d69ae" dependencies = [ "anstream", "anstyle", @@ -539,9 +539,9 @@ dependencies = [ [[package]] name = "compact_str" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff0805f79ecb1b35163f3957a6934ea8d04fcd36ef98b52e7316f63e72e73d1" +checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" dependencies = [ "castaway", "cfg-if", @@ -1489,9 +1489,9 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "openssl" -version = "0.10.54" +version = "0.10.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69b3f656a17a6cbc115b5c7a40c616947d213ba182135b014d6051b73ab6f019" +checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" dependencies = [ "bitflags", "cfg-if", @@ -1521,9 +1521,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.88" +version = "0.9.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2ce0f250f34a308dcfdbb351f511359857d4ed2134ba715a4eadd46e1ffd617" +checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" dependencies = [ "cc", "libc", @@ -2049,9 +2049,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "bdf3bf93142acad5821c99197022e170842cdbc1c30482b98750c688c640842a" dependencies = [ "itoa", "ryu", @@ -2504,9 +2504,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", From dd35fba232b56f3255fd30b86dce00ecf2c442c4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 23 Jun 2023 14:24:08 +1000 Subject: [PATCH 1337/2020] build(deps): update itertools requirement from 0.10.5 to 0.11.0 in /crates/binstalk (#1163) build(deps): update itertools requirement in /crates/binstalk Updates the requirements on [itertools](https://github.com/rust-itertools/itertools) to permit the latest version. - [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-itertools/itertools/compare/v0.10.5...v0.11.0) --- updated-dependencies: - dependency-name: itertools dependency-type: direct:production ... Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 99cfdc09..94e48135 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1171,9 +1171,9 @@ checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" [[package]] name = "itertools" -version = "0.10.5" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" dependencies = [ "either", ] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 849c3b56..0750456e 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -19,7 +19,7 @@ compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.7", path = "../detect-targets" } either = "1.8.1" home = "0.5.5" -itertools = "0.10.5" +itertools = "0.11.0" jobslot = { version = "0.2.11", features = ["tokio"] } leon = { version = "2.0.0", path = "../leon" } leon-macros = { version = "1.0.0", path = "../leon-macros" } From ca00cbaccc0fd5f6b07babce2af5507b18390c2a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 24 Jun 2023 11:01:31 +1000 Subject: [PATCH 1338/2020] feat: Support install directly from git repo (#1162) Fixed #3 Signed-off-by: Jiahao XU --- Cargo.lock | 1076 ++++++++++++++++- crates/bin/Cargo.toml | 7 +- crates/bin/src/args.rs | 39 +- crates/bin/src/entry.rs | 17 +- crates/bin/src/lib.rs | 2 + crates/binstalk/Cargo.toml | 9 +- crates/binstalk/src/errors.rs | 22 + crates/binstalk/src/helpers.rs | 3 + .../src/helpers/cargo_toml_workspace.rs | 263 ++++ crates/binstalk/src/helpers/git.rs | 89 ++ .../src/helpers/git/progress_tracing.rs | 144 +++ crates/binstalk/src/lib.rs | 2 + crates/binstalk/src/ops.rs | 13 +- crates/binstalk/src/ops/resolve.rs | 26 +- crates/normalize-path/src/lib.rs | 26 + e2e-tests/git.sh | 61 + e2e-tests/manifests/workspace/Cargo.toml | 3 + .../manifests/workspace/b/c/d/e/f/Cargo.toml | 13 + .../a/b/c/d/e/cargo-binstall/Cargo.toml | 8 + .../crates/a/b/c/d/e/cargo-watch/Cargo.toml | 7 + .../crates/a/b/c/d/e/cargo-watch/src/main.rs | 0 justfile | 8 +- 22 files changed, 1810 insertions(+), 28 deletions(-) create mode 100644 crates/binstalk/src/helpers/cargo_toml_workspace.rs create mode 100644 crates/binstalk/src/helpers/git.rs create mode 100644 crates/binstalk/src/helpers/git/progress_tracing.rs create mode 100644 e2e-tests/git.sh create mode 100644 e2e-tests/manifests/workspace/Cargo.toml create mode 100644 e2e-tests/manifests/workspace/b/c/d/e/f/Cargo.toml create mode 100644 e2e-tests/manifests/workspace/crates/a/b/c/d/e/cargo-binstall/Cargo.toml create mode 100644 e2e-tests/manifests/workspace/crates/a/b/c/d/e/cargo-watch/Cargo.toml create mode 100644 e2e-tests/manifests/workspace/crates/a/b/c/d/e/cargo-watch/src/main.rs diff --git a/Cargo.lock b/Cargo.lock index 94e48135..d9a56104 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,6 +28,18 @@ dependencies = [ "version_check", ] +[[package]] +name = "ahash" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" +dependencies = [ + "cfg-if", + "getrandom", + "once_cell", + "version_check", +] + [[package]] name = "aho-corasick" version = "1.0.2" @@ -101,6 +113,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "arc-swap" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" + +[[package]] +name = "arrayvec" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" + [[package]] name = "async-compression" version = "0.3.15" @@ -226,6 +250,8 @@ dependencies = [ "compact_str", "detect-targets", "either", + "gix", + "glob", "home", "itertools", "jobslot", @@ -336,6 +362,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbe3c979c178231552ecba20214a8272df4e09f232a87aef4320cf06539aded" + [[package]] name = "block-buffer" version = "0.10.4" @@ -366,6 +398,27 @@ dependencies = [ "alloc-stdlib", ] +[[package]] +name = "bstr" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a246e68bb43f6cd9db24bea052a53e40405417c5fb372e3d1a8a7f770a564ef5" +dependencies = [ + "memchr", + "once_cell", + "regex-automata", + "serde", +] + +[[package]] +name = "btoi" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd6407f73a9b8b6162d8a2ef999fe6afd7cc15902ebf42c5cd296addf17e0ad" +dependencies = [ + "num-traits", +] + [[package]] name = "bumpalo" version = "3.13.0" @@ -384,6 +437,12 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +[[package]] +name = "bytesize" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38fcc2979eff34a4b84e1cf9a1e3da42a7d44b3b690a40cdcb23e3d556cfb2e5" + [[package]] name = "bzip2" version = "0.4.4" @@ -487,7 +546,7 @@ checksum = "2e53afce1efce6ed1f633cf0e57612fe51db54a1ee4fd8f8503d078fe02d69ae" dependencies = [ "anstream", "anstyle", - "bitflags", + "bitflags 1.3.2", "clap_lex", "strsim", ] @@ -510,6 +569,12 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +[[package]] +name = "clru" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8191fa7302e03607ff0e237d4246cc043ff5b3cb9409d995172ba3bea16b807" + [[package]] name = "cmake" version = "0.1.50" @@ -576,6 +641,73 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crossbeam" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2801af0d36612ae591caa9568261fddce32ce6e08a7275ea334a06a4ad021a2c" +dependencies = [ + "cfg-if", + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-channel" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", + "scopeguard", +] + +[[package]] +name = "crossbeam-queue" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +dependencies = [ + "cfg-if", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +dependencies = [ + "cfg-if", +] + [[package]] name = "crypto-common" version = "0.1.6" @@ -641,6 +773,12 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "dunce" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" + [[package]] name = "either" version = "1.8.1" @@ -917,6 +1055,678 @@ version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +[[package]] +name = "gix" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10f5281c55e0a7415877d91a15fae4a10ec7444615d64d78e48c07f20bcfcd9b" +dependencies = [ + "gix-actor", + "gix-attributes", + "gix-commitgraph", + "gix-config", + "gix-credentials", + "gix-date", + "gix-diff", + "gix-discover", + "gix-features", + "gix-fs", + "gix-glob", + "gix-hash", + "gix-hashtable", + "gix-ignore", + "gix-index", + "gix-lock", + "gix-mailmap", + "gix-negotiate", + "gix-object", + "gix-odb", + "gix-pack", + "gix-path", + "gix-prompt", + "gix-protocol", + "gix-ref", + "gix-refspec", + "gix-revision", + "gix-sec", + "gix-tempfile", + "gix-trace", + "gix-transport", + "gix-traverse", + "gix-url", + "gix-utils", + "gix-validate", + "gix-worktree", + "log", + "once_cell", + "reqwest", + "signal-hook", + "smallvec", + "thiserror", + "unicode-normalization", +] + +[[package]] +name = "gix-actor" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b70d0d809ee387113df810ab4ebe585a076e35ae6ed59b5b280072146955a3ff" +dependencies = [ + "bstr", + "btoi", + "gix-date", + "itoa", + "nom", + "thiserror", +] + +[[package]] +name = "gix-attributes" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d7006cc5a508514207154046e18c3c39d98ba98f865ada83b6f3f3886543bb" +dependencies = [ + "bstr", + "gix-glob", + "gix-path", + "gix-quote", + "kstring", + "log", + "smallvec", + "thiserror", + "unicode-bom", +] + +[[package]] +name = "gix-bitmap" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "311e2fa997be6560c564b070c5da2d56d038b645a94e1e5796d5d85a350da33c" +dependencies = [ + "thiserror", +] + +[[package]] +name = "gix-chunk" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39db5ed0fc0a2e9b1b8265993f7efdbc30379dec268f3b91b7af0c2de4672fdd" +dependencies = [ + "thiserror", +] + +[[package]] +name = "gix-command" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb49ab557a37b0abb2415bca2b10e541277dff0565deb5bd5e99fd95f93f51eb" +dependencies = [ + "bstr", +] + +[[package]] +name = "gix-commitgraph" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e498e98d0b477d6a1c1608bee39db201e7a38873460a130a97ce88b4d95b6e1" +dependencies = [ + "bstr", + "gix-chunk", + "gix-features", + "gix-hash", + "memmap2", + "thiserror", +] + +[[package]] +name = "gix-config" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b32541232a2c626849df7843e05b50cb43ac38a4f675abbe2f661874fc1e9d" +dependencies = [ + "bstr", + "gix-config-value", + "gix-features", + "gix-glob", + "gix-path", + "gix-ref", + "gix-sec", + "log", + "memchr", + "nom", + "once_cell", + "smallvec", + "thiserror", + "unicode-bom", +] + +[[package]] +name = "gix-config-value" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4783caa23062f86acfd1bc9e72c62250923d1673171ce1a524d9486f8a4556a8" +dependencies = [ + "bitflags 2.3.2", + "bstr", + "gix-path", + "libc", + "thiserror", +] + +[[package]] +name = "gix-credentials" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dcec518a8db5b2e342ea7a2e785f46fd176b1b689ddd3f43052701bf3fa8ee3" +dependencies = [ + "bstr", + "gix-command", + "gix-config-value", + "gix-path", + "gix-prompt", + "gix-sec", + "gix-url", + "thiserror", +] + +[[package]] +name = "gix-date" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0213f923d63c2c7d10799c1977f42df38ec586ebbf1d14fd00dfa363ac994c2b" +dependencies = [ + "bstr", + "itoa", + "thiserror", + "time", +] + +[[package]] +name = "gix-diff" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5049dd5a60d5608912da0ab184f35064901f192f4adf737716789715faffa080" +dependencies = [ + "gix-hash", + "gix-object", + "imara-diff", + "thiserror", +] + +[[package]] +name = "gix-discover" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c14865cb9c6eb817d6a8d53595f1051239d2d31feae7a5e5b2f00910c94a8eb4" +dependencies = [ + "bstr", + "dunce", + "gix-hash", + "gix-path", + "gix-ref", + "gix-sec", + "thiserror", +] + +[[package]] +name = "gix-features" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae82dfceec06c034728c530399ee449f97b1e542e191247c52c169ca6af1fd89" +dependencies = [ + "bytes", + "bytesize", + "crc32fast", + "crossbeam-channel", + "flate2", + "gix-hash", + "gix-trace", + "jwalk", + "libc", + "once_cell", + "parking_lot", + "prodash", + "sha1_smol", + "thiserror", + "walkdir", +] + +[[package]] +name = "gix-fs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb15956bc0256594c62a2399fcf6958a02a11724217eddfdc2b49b21b6292496" +dependencies = [ + "gix-features", +] + +[[package]] +name = "gix-glob" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f45cd7ab22faf154db0a9f5a8011ba9cda8b298b61b7299f43a21bbaf0b3f208" +dependencies = [ + "bitflags 2.3.2", + "bstr", + "gix-features", + "gix-path", +] + +[[package]] +name = "gix-hash" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0dd58cdbe7ffa4032fc111864c80d5f8cecd9a2c9736c97ae7e5be834188272" +dependencies = [ + "hex", + "thiserror", +] + +[[package]] +name = "gix-hashtable" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cfd7f4ea905c13579565e3c264ca2c4103d192bd5fce2300c5a884cf1977d61" +dependencies = [ + "gix-hash", + "hashbrown 0.13.2", + "parking_lot", +] + +[[package]] +name = "gix-ignore" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27e82dec6975012b710837c6cd56353c3111d2308e016118bfc59275fcc8b5d0" +dependencies = [ + "bstr", + "gix-glob", + "gix-path", + "unicode-bom", +] + +[[package]] +name = "gix-index" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ef2fa392d351e62ac3a6309146f61880abfbe0c07474e075d3b2ac78a6834a5" +dependencies = [ + "bitflags 2.3.2", + "bstr", + "btoi", + "filetime", + "gix-bitmap", + "gix-features", + "gix-hash", + "gix-lock", + "gix-object", + "gix-traverse", + "itoa", + "memmap2", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-lock" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "328f50aad713ab606caeaf834459ef915ccdfbb9133ac6cd54616d601aa9249f" +dependencies = [ + "gix-tempfile", + "gix-utils", + "thiserror", +] + +[[package]] +name = "gix-mailmap" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0bef8d360a6a9fc5a6d872471588d8ca7db77b940e48ff20c3b4706ad5f481d" +dependencies = [ + "bstr", + "gix-actor", + "gix-date", + "thiserror", +] + +[[package]] +name = "gix-negotiate" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b626aafb9f4088058f1baa5d2029b2191820c84f6c81e43535ba70bfdc7b7d56" +dependencies = [ + "bitflags 2.3.2", + "gix-commitgraph", + "gix-date", + "gix-hash", + "gix-object", + "gix-revwalk", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-object" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "255e477ae4cc8d10778238f011e6125b01cc0e7067dc8df87acd67a428a81f20" +dependencies = [ + "bstr", + "btoi", + "gix-actor", + "gix-date", + "gix-features", + "gix-hash", + "gix-validate", + "hex", + "itoa", + "nom", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-odb" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b73469f145d1e6afbcfd0ab6499a366fbbcb958c2999d41d283d6c7b94024b9" +dependencies = [ + "arc-swap", + "gix-date", + "gix-features", + "gix-hash", + "gix-object", + "gix-pack", + "gix-path", + "gix-quote", + "parking_lot", + "tempfile", + "thiserror", +] + +[[package]] +name = "gix-pack" +version = "0.38.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a1f3bcd1aaa72aea7163b147d2bde2480a01eadefc774a479d38f29920f7f1c8" +dependencies = [ + "clru", + "gix-chunk", + "gix-diff", + "gix-features", + "gix-hash", + "gix-hashtable", + "gix-object", + "gix-path", + "gix-tempfile", + "gix-traverse", + "memmap2", + "parking_lot", + "smallvec", + "thiserror", + "uluru", +] + +[[package]] +name = "gix-packetline" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0158e98f4afb8f2da69a325c3e8b6674093a0eab2c91cc59f1522a3bc062a012" +dependencies = [ + "bstr", + "hex", + "thiserror", +] + +[[package]] +name = "gix-path" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea2a19d82dd55e5fad1d606b8a1ad2f7a804e10caa2efbb169cd37e0a07ede0" +dependencies = [ + "bstr", + "gix-trace", + "home", + "once_cell", + "thiserror", +] + +[[package]] +name = "gix-prompt" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dfd363fd89a40c1e7bff9c9c1b136cd2002480f724b0c627c1bc771cd5480ec" +dependencies = [ + "gix-command", + "gix-config-value", + "parking_lot", + "rustix", + "thiserror", +] + +[[package]] +name = "gix-protocol" +version = "0.34.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27e93c9343860c45c025e09bc26772d15cec690250d04b36822bd528dd3c44f8" +dependencies = [ + "bstr", + "btoi", + "gix-credentials", + "gix-date", + "gix-features", + "gix-hash", + "gix-transport", + "maybe-async", + "nom", + "thiserror", +] + +[[package]] +name = "gix-quote" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3874de636c2526de26a3405b8024b23ef1a327bebf4845d770d00d48700b6a40" +dependencies = [ + "bstr", + "btoi", + "thiserror", +] + +[[package]] +name = "gix-ref" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b6c74873a9d8ff5d1310f2325f09164c15a91402ab5cde4d479ae12ff55ed69" +dependencies = [ + "gix-actor", + "gix-date", + "gix-features", + "gix-fs", + "gix-hash", + "gix-lock", + "gix-object", + "gix-path", + "gix-tempfile", + "gix-validate", + "memmap2", + "nom", + "thiserror", +] + +[[package]] +name = "gix-refspec" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca1bc6c40bad62570683d642fcb04e977433ac8f76b674860ef7b1483c1f8990" +dependencies = [ + "bstr", + "gix-hash", + "gix-revision", + "gix-validate", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-revision" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3751d6643d731fc5829d2f43ca049f4333c968f30908220ba0783c9dfe5010c" +dependencies = [ + "bstr", + "gix-date", + "gix-hash", + "gix-hashtable", + "gix-object", + "gix-revwalk", + "thiserror", +] + +[[package]] +name = "gix-revwalk" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "144995229c6e5788b1c7386f8a3f7146ace3745c9a6b56cef9123a7d83b110c5" +dependencies = [ + "gix-commitgraph", + "gix-date", + "gix-hash", + "gix-hashtable", + "gix-object", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-sec" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47f09860e2ddc7b13119e410c46d8e9f870acc7933fb53ae65817af83a8c9f80" +dependencies = [ + "bitflags 2.3.2", + "gix-path", + "libc", + "windows 0.48.0", +] + +[[package]] +name = "gix-tempfile" +version = "7.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fac8310c17406ea619af72f42ee46dac795110f68f41b4f4fa231b69889c6a2" +dependencies = [ + "gix-fs", + "libc", + "once_cell", + "parking_lot", + "signal-hook", + "signal-hook-registry", + "tempfile", +] + +[[package]] +name = "gix-trace" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ff8a60073500f4d6edd181432ee11394d843db7dcf05756aa137a1233b1cbf6" + +[[package]] +name = "gix-transport" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "435013c7ce6983fd2cfa9a740873c31c048c042e47d92714e43d75d861f0eedf" +dependencies = [ + "base64 0.21.2", + "bstr", + "gix-command", + "gix-credentials", + "gix-features", + "gix-packetline", + "gix-quote", + "gix-sec", + "gix-url", + "reqwest", + "thiserror", +] + +[[package]] +name = "gix-traverse" +version = "0.28.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3f6bba1686bfbc7e0e93d4932bc6e14d479c9c9524f7c8d65b25d2a9446a99e" +dependencies = [ + "gix-commitgraph", + "gix-date", + "gix-hash", + "gix-hashtable", + "gix-object", + "gix-revwalk", + "smallvec", + "thiserror", +] + +[[package]] +name = "gix-url" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff1f984816338039b151a9f5dae6100e1e51e438cf61242ea8136fedc574d825" +dependencies = [ + "bstr", + "gix-features", + "gix-path", + "home", + "thiserror", + "url", +] + +[[package]] +name = "gix-utils" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca284c260845bc0724050aec59c7a596407678342614cdf5a1d69e044f29a36" +dependencies = [ + "fastrand", +] + +[[package]] +name = "gix-validate" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d092b594c8af00a3a31fe526d363ee8a51a6f29d8496cdb991ed2f01ec0ec13" +dependencies = [ + "bstr", + "thiserror", +] + +[[package]] +name = "gix-worktree" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee22549d6723189366235e1c6959ccdac73b58197cdbb437684eaa2169edcb9" +dependencies = [ + "bstr", + "filetime", + "gix-attributes", + "gix-features", + "gix-fs", + "gix-glob", + "gix-hash", + "gix-ignore", + "gix-index", + "gix-object", + "gix-path", + "io-close", + "thiserror", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "guess_host_triple" version = "0.1.3" @@ -954,9 +1764,15 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash", + "ahash 0.7.6", ] +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" + [[package]] name = "heck" version = "0.4.1" @@ -978,6 +1794,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + [[package]] name = "home" version = "0.5.5" @@ -1032,6 +1854,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" +[[package]] +name = "human_format" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86cce260d758a9aa3d7c4b99d55c815a540f8a37514ba6046ab6be402a157cb0" + [[package]] name = "hyper" version = "0.14.26" @@ -1103,6 +1931,16 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "imara-diff" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e98c1d0ad70fc91b8b9654b1f33db55e59579d3b3de2bffdced0fdb810570cb8" +dependencies = [ + "ahash 0.8.3", + "hashbrown 0.12.3", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -1110,7 +1948,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -1122,6 +1960,16 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "io-close" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cadcf447f06744f8ce713d2d6239bb5bde2c357a452397a9ed90c625da390bc" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "io-lifetimes" version = "1.0.11" @@ -1216,6 +2064,25 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "jwalk" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2735847566356cd2179a2a38264839308f7079fa96e6bd5a42d740460e003c56" +dependencies = [ + "crossbeam", + "rayon", +] + +[[package]] +name = "kstring" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3066350882a1cd6d950d055997f379ac37fd39f81cd4d8ed186032eb3c5747" +dependencies = [ + "static_assertions", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -1327,6 +2194,17 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" +[[package]] +name = "maybe-async" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f1b8c13cb1f814b634a96b2c725449fe7ed464a7b8781de8688be5ffbd3f305" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "maybe-owned" version = "0.3.4" @@ -1342,6 +2220,24 @@ version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +[[package]] +name = "memmap2" +version = "0.5.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +dependencies = [ + "libc", +] + +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + [[package]] name = "miette" version = "5.9.0" @@ -1389,6 +2285,12 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.6.2" @@ -1442,12 +2344,22 @@ 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", "static_assertions", ] +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "normalize-path" version = "0.2.0" @@ -1462,6 +2374,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + [[package]] name = "num_cpus" version = "1.15.0" @@ -1472,6 +2393,15 @@ dependencies = [ "libc", ] +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + [[package]] name = "object" version = "0.30.4" @@ -1493,7 +2423,7 @@ version = "0.10.55" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" dependencies = [ - "bitflags", + "bitflags 1.3.2", "cfg-if", "foreign-types", "libc", @@ -1641,6 +2571,16 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "prodash" +version = "25.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3236ce1618b6da4c7b618e0143c4d5b5dc190f75f81c49f248221382f7e9e9ae" +dependencies = [ + "bytesize", + "human_format", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -1739,13 +2679,35 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rayon" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + [[package]] name = "redox_syscall" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1754,7 +2716,7 @@ version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" dependencies = [ - "bitflags", + "bitflags 1.3.2", ] [[package]] @@ -1779,6 +2741,12 @@ dependencies = [ "regex-syntax", ] +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" + [[package]] name = "regex-syntax" version = "0.7.2" @@ -1877,7 +2845,7 @@ version = "0.37.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" dependencies = [ - "bitflags", + "bitflags 1.3.2", "errno 0.3.1", "io-lifetimes", "libc", @@ -1961,6 +2929,15 @@ version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + [[package]] name = "schannel" version = "0.1.21" @@ -1992,7 +2969,7 @@ version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" dependencies = [ - "bitflags", + "bitflags 1.3.2", "core-foundation", "core-foundation-sys", "libc", @@ -2092,6 +3069,12 @@ dependencies = [ "unsafe-libyaml", ] +[[package]] +name = "sha1_smol" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" + [[package]] name = "sharded-slab" version = "0.1.4" @@ -2101,6 +3084,16 @@ 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.1" @@ -2309,6 +3302,35 @@ dependencies = [ "once_cell", ] +[[package]] +name = "time" +version = "0.3.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" +dependencies = [ + "itoa", + "libc", + "num_threads", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" + +[[package]] +name = "time-macros" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +dependencies = [ + "time-core", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -2632,12 +3654,27 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +[[package]] +name = "uluru" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "794a32261a1f5eb6a4462c81b59cec87b5c27d5deea7dd1ac8fc781c41d226db" +dependencies = [ + "arrayvec", +] + [[package]] name = "unicode-bidi" version = "0.3.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +[[package]] +name = "unicode-bom" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98e90c70c9f0d4d1ee6d0a7d04aa06cb9bbd53d8cfbdd62a0269a7c2eb640552" + [[package]] name = "unicode-ident" version = "1.0.9" @@ -2650,7 +3687,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5faade31a542b8b35855fff6e8def199853b2da8da256da52f52f1316ee3137" dependencies = [ - "hashbrown", + "hashbrown 0.12.3", "regex", ] @@ -2737,6 +3774,16 @@ dependencies = [ "libc", ] +[[package]] +name = "walkdir" +version = "2.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +dependencies = [ + "same-file", + "winapi-util", +] + [[package]] name = "want" version = "0.3.1" @@ -2882,6 +3929,15 @@ 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" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index b4bf6531..aae1f939 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -49,7 +49,9 @@ tracing-subscriber = { version = "0.3.17", features = ["fmt", "json", "ansi"], d embed-resource = "2.1.1" [features] -default = ["static", "rustls", "trust-dns", "fancy-no-backtrace", "zstd-thin"] +default = ["static", "rustls", "trust-dns", "fancy-no-backtrace", "zstd-thin", "git"] + +git = ["binstalk/git"] mimalloc = ["dep:mimalloc"] @@ -74,3 +76,6 @@ log_max_level_debug = ["log/max_level_debug", "tracing/max_level_debug", "log_re log_release_max_level_info = ["log/release_max_level_info", "tracing/release_max_level_info"] log_release_max_level_debug = ["log/release_max_level_debug", "tracing/release_max_level_debug"] + +[package.metadata.docs.rs] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 814d2705..fa3a1958 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -38,7 +38,7 @@ pub struct Args { /// install. The version syntax is as with the --version option. /// /// When multiple names are provided, the --version option and override option - /// `manifest_path` is unavailable due to ambiguity. + /// `--manifest-path` and `--git` are unavailable due to ambiguity. /// /// If duplicate names are provided, the last one (and their version requirement) /// is kept. @@ -88,9 +88,21 @@ pub struct Args { /// This skips searching crates.io for a manifest and uses the specified path directly, useful /// for debugging and when adding Binstall support. This may be either the path to the folder /// containing a Cargo.toml file, or the Cargo.toml file itself. + /// + /// This option cannot be used with `--git`. #[clap(help_heading = "Overrides", long)] pub manifest_path: Option, + #[cfg(feature = "git")] + /// Override how to fetch Cargo.toml package manifest. + /// + /// This skip searching crates.io and instead clone the repository specified and + /// runs as if `--manifest-path $cloned_repo` is passed to binstall. + /// + /// This option cannot be used with `--manifest-path`. + #[clap(help_heading = "Overrides", long)] + pub git: Option, + /// Override Cargo.toml package manifest bin-dir. #[clap(help_heading = "Overrides", long)] pub bin_dir: Option, @@ -391,13 +403,36 @@ pub fn parse() -> Args { // Ensure no conflict let mut command = Args::command(); + #[cfg(feature = "git")] + if opts.manifest_path.is_some() && opts.git.is_some() { + command + .error( + ErrorKind::ArgumentConflict, + format_args!( + r#"Multiple override options for Cargo.toml fetching. +You cannot use --manifest-path and --git. Do one or the other."# + ), + ) + .exit(); + } + if opts.crate_names.len() > 1 { let option = if opts.version_req.is_some() { "version" } else if opts.manifest_path.is_some() { "manifest-path" } else { - "" + #[cfg(not(feature = "git"))] + { + "" + } + + #[cfg(feature = "git")] + if opts.git.is_some() { + "git" + } else { + "" + } }; if !option.is_empty() { diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 5818ae3c..3b7b2736 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -19,7 +19,7 @@ use binstalk::{ ops::{ self, resolve::{CrateName, Resolution, ResolutionFetch, VersionReqExt}, - Resolver, + CargoTomlFetchOverride, Options, Resolver, }, }; use binstalk_manifests::cargo_toml_binstall::PkgOverride; @@ -95,7 +95,7 @@ pub fn install_crates( let gh_api_client = GhApiClient::new(client.clone(), args.github_token); // Create binstall_opts - let binstall_opts = Arc::new(ops::Options { + let binstall_opts = Arc::new(Options { no_symlinks: args.no_symlinks, dry_run: args.dry_run, force: args.force, @@ -104,7 +104,16 @@ pub fn install_crates( no_track: args.no_track, version_req: args.version_req, - manifest_path: args.manifest_path, + #[cfg(feature = "git")] + cargo_toml_fetch_override: match (args.manifest_path, args.git) { + (Some(manifest_path), None) => Some(CargoTomlFetchOverride::Path(manifest_path)), + (None, Some(git_url)) => Some(CargoTomlFetchOverride::Git(git_url)), + (None, None) => None, + _ => unreachable!("manifest_path and git cannot be specified at the same time"), + }, + + #[cfg(not(feature = "git"))] + cargo_toml_fetch_override: args.manifest_path.map(CargoTomlFetchOverride::Path), cli_overrides, desired_targets, @@ -326,7 +335,7 @@ fn do_install_fetches( resolution_fetchs: Vec>, // Take manifests by value to drop the `FileLock`. manifests: Option, - binstall_opts: &ops::Options, + binstall_opts: &Options, dry_run: bool, temp_dir: tempfile::TempDir, no_cleanup: bool, diff --git a/crates/bin/src/lib.rs b/crates/bin/src/lib.rs index 57299fe9..5e19e4d6 100644 --- a/crates/bin/src/lib.rs +++ b/crates/bin/src/lib.rs @@ -1,3 +1,5 @@ +#![cfg_attr(docsrs, feature(doc_auto_cfg))] + pub mod args; pub mod bin_util; pub mod entry; diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 0750456e..494a6598 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -18,6 +18,8 @@ command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.7", path = "../detect-targets" } either = "1.8.1" +gix = { version = "0.47.0", features = ["blocking-http-transport-reqwest-rust-tls"], optional = true } +glob = "0.3.1" home = "0.5.5" itertools = "0.11.0" jobslot = { version = "0.2.11", features = ["tokio"] } @@ -43,7 +45,9 @@ xz2 = "0.1.7" windows = { version = "0.48.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } [features] -default = ["static", "rustls"] +default = ["static", "rustls", "git"] + +git = ["dep:gix"] static = ["binstalk-downloader/static"] pkg-config = ["binstalk-downloader/pkg-config"] @@ -57,3 +61,6 @@ trust-dns = ["binstalk-downloader/trust-dns"] zstd-thin = ["binstalk-downloader/zstd-thin"] cross-lang-fat-lto = ["binstalk-downloader/cross-lang-fat-lto"] + +[package.metadata.docs.rs] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index bc637947..aa14d953 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -15,6 +15,8 @@ use thiserror::Error; use tokio::task; use tracing::{error, warn}; +use crate::helpers::cargo_toml_workspace::LoadManifestFromWSError; + #[derive(Debug, Error)] #[error("crates.io API error for {crate_name}: {err}")] pub struct CratesIoApiError { @@ -323,6 +325,23 @@ pub enum BinstallError { #[diagnostic(severity(error), code(binstall::target_triple_parse_error))] TargetTripleParseError(#[source] Box), + /// Failed to shallow clone git repository + /// + /// - Code: `binstall::git` + /// - Exit: 98 + #[cfg(feature = "git")] + #[error("Failed to shallow clone git repository: {0}")] + #[diagnostic(severity(error), code(binstall::git))] + GitError(#[from] crate::helpers::git::GitError), + + /// Failed to load manifest from workspace + /// + /// - Code: `binstall::load_manifest_from_workspace` + /// - Exit: 99 + #[error(transparent)] + #[diagnostic(severity(error), code(binstall::load_manifest_from_workspace))] + LoadManifestFromWSError(#[from] Box), + /// A wrapped error providing the context of which crate the error is about. #[error(transparent)] #[diagnostic(transparent)] @@ -358,6 +377,9 @@ impl BinstallError { InvalidPkgFmt(..) => 95, GhApiErr(..) => 96, TargetTripleParseError(..) => 97, + #[cfg(feature = "git")] + GitError(_) => 98, + LoadManifestFromWSError(_) => 99, CrateContext(context) => context.err.exit_number(), }; diff --git a/crates/binstalk/src/helpers.rs b/crates/binstalk/src/helpers.rs index 23ed00ef..34da60e0 100644 --- a/crates/binstalk/src/helpers.rs +++ b/crates/binstalk/src/helpers.rs @@ -1,4 +1,7 @@ +pub mod cargo_toml_workspace; pub mod futures_resolver; +#[cfg(feature = "git")] +pub mod git; pub mod jobserver_client; pub mod remote; pub mod signal; diff --git a/crates/binstalk/src/helpers/cargo_toml_workspace.rs b/crates/binstalk/src/helpers/cargo_toml_workspace.rs new file mode 100644 index 00000000..3360e55e --- /dev/null +++ b/crates/binstalk/src/helpers/cargo_toml_workspace.rs @@ -0,0 +1,263 @@ +use std::{ + io, mem, + path::{Path, PathBuf}, +}; + +use cargo_toml::{Error as CargoTomlError, Manifest}; +use compact_str::CompactString; +use glob::PatternError; +use normalize_path::NormalizePath; +use thiserror::Error as ThisError; +use tracing::{debug, instrument, warn}; + +use crate::{errors::BinstallError, manifests::cargo_toml_binstall::Meta}; + +/// Load binstall metadata `Cargo.toml` from workspace at the provided path +/// +/// WARNING: This is a blocking operation. +/// +/// * `workspace_path` - should be a directory +pub fn load_manifest_from_workspace( + workspace_path: impl AsRef, + crate_name: impl AsRef, +) -> Result, BinstallError> { + fn inner(workspace_path: &Path, crate_name: &str) -> Result, BinstallError> { + load_manifest_from_workspace_inner(workspace_path, crate_name).map_err(|inner| { + Box::new(LoadManifestFromWSError { + workspace_path: workspace_path.into(), + crate_name: crate_name.into(), + inner, + }) + .into() + }) + } + + inner(workspace_path.as_ref(), crate_name.as_ref()) +} + +#[derive(Debug, ThisError)] +#[error("Failed to load {crate_name} from {}: {inner}", workspace_path.display())] +pub struct LoadManifestFromWSError { + workspace_path: Box, + crate_name: CompactString, + #[source] + inner: LoadManifestFromWSErrorInner, +} + +#[derive(Debug, ThisError)] +enum LoadManifestFromWSErrorInner { + #[error("Invalid pattern in workspace.members or workspace.exclude: {0}")] + PatternError(#[from] PatternError), + + #[error("Invalid pattern `{0}`: It must be relative and point within current dir")] + InvalidPatternError(CompactString), + + #[error("Failed to parse cargo manifest: {0}")] + CargoManifest(#[from] CargoTomlError), + + #[error("I/O error: {0}")] + Io(#[from] io::Error), + + #[error("Not found")] + NotFound, +} + +#[instrument] +fn load_manifest_from_workspace_inner( + workspace_path: &Path, + crate_name: &str, +) -> Result, LoadManifestFromWSErrorInner> { + debug!( + "Loading manifest of crate {crate_name} from workspace: {}", + workspace_path.display() + ); + + let mut workspace_paths = vec![workspace_path.to_owned()]; + + while let Some(workspace_path) = workspace_paths.pop() { + let p = workspace_path.join("Cargo.toml"); + let manifest = Manifest::::from_path_with_metadata(&p)?; + + let name = manifest.package.as_ref().map(|p| &*p.name); + debug!( + "Loading from {}, manifest.package.name = {:#?}", + p.display(), + name + ); + + if name == Some(crate_name) { + return Ok(manifest); + } + + if let Some(ws) = manifest.workspace { + let excludes = ws.exclude; + let members = ws.members; + + if members.is_empty() { + continue; + } + + let exclude_patterns = excludes + .into_iter() + .map(|pat| Pattern::new(&pat)) + .collect::, _>>()?; + + for member in members { + for path in Pattern::new(&member)?.glob_dirs(&workspace_path)? { + if !exclude_patterns + .iter() + .any(|exclude| exclude.matches_with_trailing(&path)) + { + workspace_paths.push(workspace_path.join(path)); + } + } + } + } + } + + Err(LoadManifestFromWSErrorInner::NotFound) +} + +struct Pattern(Vec); + +impl Pattern { + fn new(pat: &str) -> Result { + Path::new(pat) + .try_normalize() + .ok_or_else(|| LoadManifestFromWSErrorInner::InvalidPatternError(pat.into()))? + .iter() + .map(|c| glob::Pattern::new(c.to_str().unwrap())) + .collect::, _>>() + .map_err(Into::into) + .map(Self) + } + + /// * `glob_path` - path to dir to glob for + /// return paths relative to `glob_path`. + fn glob_dirs(&self, glob_path: &Path) -> Result, LoadManifestFromWSErrorInner> { + let mut paths = vec![PathBuf::new()]; + + for pattern in &self.0 { + if paths.is_empty() { + break; + } + + for path in mem::take(&mut paths) { + let p = glob_path.join(&path); + let res = p.read_dir(); + if res.is_err() && !p.is_dir() { + continue; + } + drop(p); + + for res in res? { + let entry = res?; + + let is_dir = entry + .file_type() + .map(|file_type| file_type.is_dir() || file_type.is_symlink()) + .unwrap_or(false); + if !is_dir { + continue; + } + + let filename = entry.file_name(); + if filename != "." // Ignore current dir + && filename != ".." // Ignore parent dir + && pattern.matches(&filename.to_string_lossy()) + { + paths.push(path.join(filename)); + } + } + } + } + + Ok(paths) + } + + /// Return `true` if `path` matches the pattern. + /// It will still return `true` even if there are some trailing components. + fn matches_with_trailing(&self, path: &Path) -> bool { + let mut iter = path.iter().map(|os_str| os_str.to_string_lossy()); + for pattern in &self.0 { + match iter.next() { + Some(s) if pattern.matches(&s) => (), + _ => return false, + } + } + true + } +} + +#[cfg(test)] +mod test { + use std::fs::create_dir_all as mkdir; + + use tempfile::TempDir; + + use super::*; + + #[test] + fn test_glob_dirs() { + let pattern = Pattern::new("*/*/q/*").unwrap(); + let tempdir = TempDir::new().unwrap(); + + mkdir(tempdir.as_ref().join("a/b/c/efe")).unwrap(); + mkdir(tempdir.as_ref().join("a/b/q/ww")).unwrap(); + mkdir(tempdir.as_ref().join("d/233/q/d")).unwrap(); + + let mut paths = pattern.glob_dirs(tempdir.as_ref()).unwrap(); + paths.sort_unstable(); + assert_eq!( + paths, + vec![PathBuf::from("a/b/q/ww"), PathBuf::from("d/233/q/d")] + ); + } + + #[test] + fn test_matches_with_trailing() { + let pattern = Pattern::new("*/*/q/*").unwrap(); + + assert!(pattern.matches_with_trailing(Path::new("a/b/q/d/"))); + assert!(pattern.matches_with_trailing(Path::new("a/b/q/d"))); + assert!(pattern.matches_with_trailing(Path::new("a/b/q/d/234"))); + assert!(pattern.matches_with_trailing(Path::new("a/234/q/d/234"))); + + assert!(!pattern.matches_with_trailing(Path::new(""))); + assert!(!pattern.matches_with_trailing(Path::new("a/"))); + assert!(!pattern.matches_with_trailing(Path::new("a/234"))); + assert!(!pattern.matches_with_trailing(Path::new("a/234/q"))); + } + + #[test] + fn test_load() { + let p = Path::new(env!("CARGO_MANIFEST_DIR")) + .parent() + .unwrap() + .parent() + .unwrap() + .join("e2e-tests/manifests/workspace"); + + let manifest = load_manifest_from_workspace(&p, "cargo-binstall").unwrap(); + let package = manifest.package.unwrap(); + assert_eq!(package.name, "cargo-binstall"); + assert_eq!(package.version.as_ref().unwrap(), "0.12.0"); + assert_eq!(manifest.bin.len(), 1); + assert_eq!(manifest.bin[0].name.as_deref().unwrap(), "cargo-binstall"); + assert_eq!(manifest.bin[0].path.as_deref().unwrap(), "src/main.rs"); + + let err = load_manifest_from_workspace_inner(&p, "cargo-binstall2").unwrap_err(); + assert!( + matches!(err, LoadManifestFromWSErrorInner::NotFound), + "{:#?}", + err + ); + + let manifest = load_manifest_from_workspace(&p, "cargo-watch").unwrap(); + let package = manifest.package.unwrap(); + assert_eq!(package.name, "cargo-watch"); + assert_eq!(package.version.as_ref().unwrap(), "8.4.0"); + assert_eq!(manifest.bin.len(), 1); + assert_eq!(manifest.bin[0].name.as_deref().unwrap(), "cargo-watch"); + } +} diff --git a/crates/binstalk/src/helpers/git.rs b/crates/binstalk/src/helpers/git.rs new file mode 100644 index 00000000..1509182f --- /dev/null +++ b/crates/binstalk/src/helpers/git.rs @@ -0,0 +1,89 @@ +use std::{num::NonZeroU32, path::Path, str::FromStr, sync::atomic::AtomicBool}; + +use compact_str::CompactString; +use gix::{clone, create, open, remote, Url}; +use thiserror::Error as ThisError; +use tracing::debug; + +mod progress_tracing; +use progress_tracing::TracingProgress; + +#[derive(Debug, ThisError)] +#[non_exhaustive] +pub enum GitError { + #[error("Failed to prepare for fetch: {0}")] + PrepareFetchError(#[source] Box), + + #[error("Failed to fetch: {0}")] + FetchError(#[source] Box), + + #[error("Failed to checkout: {0}")] + CheckOutError(#[source] Box), +} + +impl From for GitError { + fn from(e: clone::Error) -> Self { + Self::PrepareFetchError(Box::new(e)) + } +} + +impl From for GitError { + fn from(e: clone::fetch::Error) -> Self { + Self::FetchError(Box::new(e)) + } +} + +impl From for GitError { + fn from(e: clone::checkout::main_worktree::Error) -> Self { + Self::CheckOutError(Box::new(e)) + } +} + +#[derive(Clone, Debug)] +pub struct GitUrl(Url); + +impl FromStr for GitUrl { + type Err = gix::url::parse::Error; + + fn from_str(s: &str) -> Result { + Url::try_from(s).map(Self) + } +} + +#[derive(Debug)] +pub struct Repository(gix::Repository); + +impl Repository { + /// WARNING: This is a blocking operation, if you want to use it in + /// async context then you must wrap the call in [`tokio::task::spawn_blocking`]. + /// + /// WARNING: This function must be called after tokio runtime is initialized. + pub fn shallow_clone(url: GitUrl, path: &Path) -> Result { + let url_bstr = url.0.to_bstring(); + let url_str = String::from_utf8_lossy(&url_bstr); + + debug!("Shallow cloning {url_str} to {}", path.display()); + + let mut progress = TracingProgress::new(CompactString::new("Cloning")); + + Ok(Self( + clone::PrepareFetch::new( + url.0, + path, + create::Kind::WithWorktree, + create::Options { + destination_must_be_empty: true, + ..Default::default() + }, + open::Options::isolated(), + )? + .with_shallow(remote::fetch::Shallow::DepthAtRemote( + NonZeroU32::new(1).unwrap(), + )) + .fetch_then_checkout(&mut progress, &AtomicBool::new(false))? + .0 + .main_worktree(&mut progress, &AtomicBool::new(false))? + .0, + )) + } +} diff --git a/crates/binstalk/src/helpers/git/progress_tracing.rs b/crates/binstalk/src/helpers/git/progress_tracing.rs new file mode 100644 index 00000000..67ebe562 --- /dev/null +++ b/crates/binstalk/src/helpers/git/progress_tracing.rs @@ -0,0 +1,144 @@ +use std::{ + sync::{ + atomic::{AtomicBool, Ordering}, + Arc, + }, + time::Duration, +}; + +use compact_str::{format_compact, CompactString}; +use gix::progress::{ + prodash::messages::MessageLevel, Id, Progress, Step, StepShared, Unit, UNKNOWN, +}; +use tokio::time; +use tracing::{error, info}; + +pub(super) struct TracingProgress { + name: CompactString, + id: Id, + max: Option, + unit: Option, + step: usize, + trigger: Arc, +} + +const EMIT_LOG_EVERY_S: f32 = 0.5; +const SEP: &str = "::"; + +impl TracingProgress { + /// Create a new instanCompactce from `name`. + pub fn new(name: CompactString) -> Self { + let trigger = Arc::new(AtomicBool::new(true)); + tokio::spawn({ + let mut interval = time::interval(Duration::from_secs_f32(EMIT_LOG_EVERY_S)); + interval.set_missed_tick_behavior(time::MissedTickBehavior::Skip); + + let trigger = Arc::clone(&trigger); + async move { + while Arc::strong_count(&trigger) > 1 { + trigger.store(true, Ordering::Relaxed); + + interval.tick().await; + } + } + }); + Self { + name, + id: UNKNOWN, + max: None, + step: 0, + unit: None, + trigger, + } + } +} + +impl Progress for TracingProgress { + type SubProgress = TracingProgress; + + fn add_child(&mut self, name: impl Into) -> Self::SubProgress { + self.add_child_with_id(name, UNKNOWN) + } + + fn add_child_with_id(&mut self, name: impl Into, id: Id) -> Self::SubProgress { + Self { + name: format_compact!("{}{}{}", self.name, SEP, Into::::into(name)), + id, + step: 0, + max: None, + unit: None, + trigger: Arc::clone(&self.trigger), + } + } + + fn init(&mut self, max: Option, unit: Option) { + self.max = max; + self.unit = unit; + } + + fn set(&mut self, step: usize) { + self.step = step; + if self.trigger.swap(false, Ordering::Relaxed) { + match (self.max, &self.unit) { + (max, Some(unit)) => { + info!("{} → {}", self.name, unit.display(step, max, None)) + } + (Some(max), None) => info!("{} → {} / {}", self.name, step, max), + (None, None) => info!("{} → {}", self.name, step), + } + } + } + + fn unit(&self) -> Option { + self.unit.clone() + } + + fn max(&self) -> Option { + self.max + } + + fn set_max(&mut self, max: Option) -> Option { + let prev = self.max; + self.max = max; + prev + } + + fn step(&self) -> usize { + self.step + } + + fn inc_by(&mut self, step: usize) { + self.set(self.step + step) + } + + fn set_name(&mut self, name: impl Into) { + let name = name.into(); + self.name = self + .name + .split("::") + .next() + .map(|parent| format_compact!("{}{}{}", parent.to_owned(), SEP, name)) + .unwrap_or_else(|| name.into()); + } + + fn name(&self) -> Option { + self.name.split(SEP).nth(1).map(ToOwned::to_owned) + } + + fn id(&self) -> Id { + self.id + } + + fn message(&self, level: MessageLevel, message: impl Into) { + let message: String = message.into(); + match level { + MessageLevel::Info => info!("ℹ{} → {}", self.name, message), + MessageLevel::Failure => error!("𐄂{} → {}", self.name, message), + MessageLevel::Success => info!("✓{} → {}", self.name, message), + } + } + + fn counter(&self) -> Option { + None + } +} diff --git a/crates/binstalk/src/lib.rs b/crates/binstalk/src/lib.rs index b4c67f0b..a32de76f 100644 --- a/crates/binstalk/src/lib.rs +++ b/crates/binstalk/src/lib.rs @@ -1,3 +1,5 @@ +#![cfg_attr(docsrs, feature(doc_auto_cfg))] + pub mod bins; pub mod drivers; pub mod errors; diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index 58affa67..382d3fc5 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -10,7 +10,9 @@ use tokio::{ use crate::{ fetchers::{Data, Fetcher, TargetData}, - helpers::{gh_api_client::GhApiClient, jobserver_client::LazyJobserverClient, remote::Client}, + helpers::{ + self, gh_api_client::GhApiClient, jobserver_client::LazyJobserverClient, remote::Client, + }, manifests::cargo_toml_binstall::PkgOverride, DesiredTargets, }; @@ -19,6 +21,13 @@ pub mod resolve; pub type Resolver = fn(Client, GhApiClient, Arc, Arc) -> Arc; +#[non_exhaustive] +pub enum CargoTomlFetchOverride { + #[cfg(feature = "git")] + Git(helpers::git::GitUrl), + Path(PathBuf), +} + pub struct Options { pub no_symlinks: bool, pub dry_run: bool, @@ -28,7 +37,7 @@ pub struct Options { pub no_track: bool, pub version_req: Option, - pub manifest_path: Option, + pub cargo_toml_fetch_override: Option, pub cli_overrides: PkgOverride, pub desired_targets: DesiredTargets, diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index f38246bf..6bc87ad2 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -13,17 +13,18 @@ use itertools::Itertools; use leon::Template; use maybe_owned::MaybeOwned; use semver::{Version, VersionReq}; -use tokio::task::block_in_place; +use tempfile::TempDir; +use tokio::task::{block_in_place, spawn_blocking}; use tracing::{debug, info, instrument, warn}; -use super::Options; use crate::{ bins, drivers::fetch_crate_cratesio, errors::{BinstallError, VersionParseError}, fetchers::{Data, Fetcher, TargetData}, - helpers::{download::ExtractedFiles, remote::Client, target_triple::TargetTriple}, + helpers::{self, download::ExtractedFiles, remote::Client, target_triple::TargetTriple}, manifests::cargo_toml_binstall::{Meta, PkgMeta, PkgOverride}, + ops::{CargoTomlFetchOverride, Options}, }; mod crate_name; @@ -359,9 +360,24 @@ impl PackageInfo { version_req: &VersionReq, client: Client, ) -> Result, BinstallError> { + use CargoTomlFetchOverride::*; + // Fetch crate via crates.io, git, or use a local manifest path - let manifest = match opts.manifest_path.as_ref() { - Some(manifest_path) => load_manifest_path(manifest_path)?, + let manifest = match opts.cargo_toml_fetch_override.as_ref() { + Some(Path(manifest_path)) => load_manifest_path(manifest_path)?, + #[cfg(feature = "git")] + Some(Git(git_url)) => { + let git_url = git_url.clone(); + let name = name.clone(); + + spawn_blocking(move || { + let dir = TempDir::new()?; + helpers::git::Repository::shallow_clone(git_url, dir.as_ref())?; + + helpers::cargo_toml_workspace::load_manifest_from_workspace(dir.as_ref(), &name) + }) + .await?? + } None => { Box::pin(fetch_crate_cratesio( client, diff --git a/crates/normalize-path/src/lib.rs b/crates/normalize-path/src/lib.rs index 42e2b8ec..cf65d025 100644 --- a/crates/normalize-path/src/lib.rs +++ b/crates/normalize-path/src/lib.rs @@ -29,6 +29,11 @@ pub trait NormalizePath { /// However, this does not resolve links. fn normalize(&self) -> PathBuf; + /// Same as [`NormalizePath::normalize`] except that if + /// `Component::Prefix`/`Component::RootDir` is encountered, + /// or if the path points outside of current dir, returns `None`. + fn try_normalize(&self) -> Option; + /// Return `true` if the path is normalized. /// /// # Quirk @@ -68,6 +73,27 @@ impl NormalizePath for Path { ret } + fn try_normalize(&self) -> Option { + let mut ret = PathBuf::new(); + + for component in self.components() { + match component { + Component::Prefix(..) | Component::RootDir => return None, + Component::CurDir => {} + Component::ParentDir => { + if !ret.pop() { + return None; + } + } + Component::Normal(c) => { + ret.push(c); + } + } + } + + Some(ret) + } + fn is_normalized(&self) -> bool { for component in self.components() { match component { diff --git a/e2e-tests/git.sh b/e2e-tests/git.sh new file mode 100644 index 00000000..8058d49c --- /dev/null +++ b/e2e-tests/git.sh @@ -0,0 +1,61 @@ +#!/bin/bash + +set -euxo pipefail + +test_cargo_binstall_install() { + # Test that the installed binaries can be run + cargo binstall --help >/dev/null + + cargo_binstall_version="$(cargo binstall -V)" + echo "$cargo_binstall_version" + + [ "$cargo_binstall_version" = "cargo-binstall 0.12.0" ] +} + +unset CARGO_INSTALL_ROOT + +CARGO_HOME="$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')" +export CARGO_HOME +export PATH="$CARGO_HOME/bin:$PATH" + +GIT="$(mktemp -d 2>/dev/null || mktemp -d -t 'git')" +if [ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ]; then + # Convert it to windows path so `--git "file://$GIT"` would work + # on windows. + GIT="$(cygpath -w "$GIT")" +fi + +git init "$GIT" +cp manifests/github-test-Cargo.toml "$GIT/Cargo.toml" +( + cd "$GIT" + git config user.email 'test@example.com' + git config user.name 'test' + git add Cargo.toml + git commit -m "Add Cargo.toml" +) + +# Install binaries using `--git` +"./$1" binstall --force --git "file://$GIT" --no-confirm cargo-binstall + +test_cargo_binstall_install + +cp -r manifests/workspace/* "$GIT" +( + cd "$GIT" + git add . + git commit -m 'Update to workspace' +) + +# Install binaries using `--git` +"./$1" binstall --force --git "file://$GIT" --no-confirm cargo-binstall + +test_cargo_binstall_install + +# Install binaries using `--git` +"./$1" binstall --force --git "file://$GIT" --no-confirm cargo-watch + +cargo_watch_version="$(cargo watch -V)" +echo "$cargo_watch_version" + +[ "$cargo_watch_version" = "cargo-watch 8.4.0" ] diff --git a/e2e-tests/manifests/workspace/Cargo.toml b/e2e-tests/manifests/workspace/Cargo.toml new file mode 100644 index 00000000..6e98755f --- /dev/null +++ b/e2e-tests/manifests/workspace/Cargo.toml @@ -0,0 +1,3 @@ +[workspace] +members = ["crates/*/*/*/*/*/*", "b/*/*/*/*"] +exclude = ["b/c/d/e/*"] diff --git a/e2e-tests/manifests/workspace/b/c/d/e/f/Cargo.toml b/e2e-tests/manifests/workspace/b/c/d/e/f/Cargo.toml new file mode 100644 index 00000000..176f7044 --- /dev/null +++ b/e2e-tests/manifests/workspace/b/c/d/e/f/Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "cargo-binstall2" +description = "Rust binary package installer for CI integration" +repository = "https://bitbucket.org/nobodyxusdcdc/hello-world" +version = "0.0.0" +rust-version = "1.61.0" +authors = ["ryan "] +edition = "2021" +license = "GPL-3.0" + +[[bin]] +name = "cargo-binstall" +path = "src/main.rs" diff --git a/e2e-tests/manifests/workspace/crates/a/b/c/d/e/cargo-binstall/Cargo.toml b/e2e-tests/manifests/workspace/crates/a/b/c/d/e/cargo-binstall/Cargo.toml new file mode 100644 index 00000000..d5435856 --- /dev/null +++ b/e2e-tests/manifests/workspace/crates/a/b/c/d/e/cargo-binstall/Cargo.toml @@ -0,0 +1,8 @@ +[package] +name = "cargo-binstall" +version = "0.12.0" +repository = "https://github.com/cargo-bins/cargo-binstall" + +[[bin]] +name = "cargo-binstall" +path = "src/main.rs" diff --git a/e2e-tests/manifests/workspace/crates/a/b/c/d/e/cargo-watch/Cargo.toml b/e2e-tests/manifests/workspace/crates/a/b/c/d/e/cargo-watch/Cargo.toml new file mode 100644 index 00000000..71d35971 --- /dev/null +++ b/e2e-tests/manifests/workspace/crates/a/b/c/d/e/cargo-watch/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "cargo-watch" +version = "8.4.0" +repository = "https://github.com/watchexec/cargo-watch" + +[[bin]] +name = "cargo-watch" diff --git a/e2e-tests/manifests/workspace/crates/a/b/c/d/e/cargo-watch/src/main.rs b/e2e-tests/manifests/workspace/crates/a/b/c/d/e/cargo-watch/src/main.rs new file mode 100644 index 00000000..e69de29b diff --git a/justfile b/justfile index 58a05e6e..4afb5687 100644 --- a/justfile +++ b/justfile @@ -74,8 +74,8 @@ support-pkg-config := if target == target-host { } else { "" } cargo-features := trim_end_match(if override-features != "" { override-features - } else if (cargo-profile / ci-or-no) == "dev/ci" { "rustls,fancy-with-backtrace,zstd-thin,log_max_level_debug" + (if support-pkg-config != "" { ",pkg-config" } else { "" }) + extra-features - } else if (cargo-profile / ci-or-no) == "release/ci" { "static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug,cross-lang-fat-lto" + extra-features + } else if (cargo-profile / ci-or-no) == "dev/ci" { "git,rustls,fancy-with-backtrace,zstd-thin,log_max_level_debug" + (if support-pkg-config != "" { ",pkg-config" } else { "" }) + extra-features + } else if (cargo-profile / ci-or-no) == "release/ci" { "git,static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug,cross-lang-fat-lto" + extra-features } else { extra-features }, ",") @@ -184,6 +184,7 @@ check: print-env {{cargo-bin}} check {{cargo-build-args}} cargo-hack hack check --feature-powerset -p leon {{cargo-check-args}} {{cargo-bin}} check -p binstalk-downloader --no-default-features + {{cargo-bin}} check -p cargo-binstall --no-default-features --features rustls {{cargo-check-args}} cargo-hack hack check -p binstalk-downloader \ --feature-powerset \ --include-features default,json,gh-api-client \ @@ -210,6 +211,7 @@ e2e-test-upgrade: (e2e-test "upgrade") e2e-test-self-upgrade-no-symlink: (e2e-test "self-upgrade-no-symlink") e2e-test-uninstall: (e2e-test "uninstall") e2e-test-no-track: (e2e-test "no-track") +e2e-test-git: (e2e-test "git") # WinTLS (Windows in CI) does not have TLS 1.3 support [windows] @@ -218,7 +220,7 @@ e2e-test-tls: (e2e-test "tls" "1.2") [macos] e2e-test-tls: (e2e-test "tls" "1.2") (e2e-test "tls" "1.3") -e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate e2e-test-no-track +e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-git e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate e2e-test-no-track unit-tests: print-env {{cargo-bin}} test {{cargo-build-args}} From 4ddd860c012d42998b81fe2eba5b1ba54f21ce97 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 25 Jun 2023 01:23:15 +1000 Subject: [PATCH 1339/2020] ci: Verify before publishing (#1167) Run `cargo-publish` without `--no-verify` to verify the publish is valid and does not depend on unpublished crates in job tag of workflow `release.yml`, which could be caused by incorrect merge order. Also enabled `check-semver` to `cargo-bins/release-pr@v2` and install `cargo-semver-checks` using `taiki-e/install-action@v2` in job make-release-pr of workflow `release-pr.yml`, since `release-pr` would try to use `cargo-binstall` for installing `cargo-semver-checks` used in `check-semver`, but we did not explicitly require `taiki-e/install-actions@v2` to install `cargo-binstall`, so `release-pr` could fallback to `cargo-install` which is just too slow. Signed-off-by: Jiahao XU --- .github/workflows/release-pr.yml | 3 ++- .github/workflows/release.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 5d949d64..c1adea79 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -41,7 +41,7 @@ jobs: - name: Install cargo-release uses: taiki-e/install-action@v2 with: - tool: cargo-release + tool: cargo-release,cargo-semver-checks - uses: cargo-bins/release-pr@v2 with: @@ -51,3 +51,4 @@ jobs: pr-label: release pr-release-notes: ${{ inputs.crate == 'bin' }} pr-template-file: .github/scripts/release-pr-template.ejs + check-semver: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6ff5a160..06552072 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -51,7 +51,7 @@ jobs: tag_prefix: v - name: Publish to crates.io run: | - cargo publish --no-verify -p '${{ needs.info.outputs.crate }}' + cargo publish -p '${{ needs.info.outputs.crate }}' env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} From cd0939dcf5c544812ef4a4c6f2f681760e8dbfda Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 00:01:09 +1000 Subject: [PATCH 1340/2020] dep: Upgrade transitive dependencies (#1169) Co-authored-by: github-actions --- Cargo.lock | 96 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 59 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d9a56104..cb3742ea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -168,7 +168,7 @@ checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -529,9 +529,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.5" +version = "4.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2686c4115cb0810d9a984776e197823d08ec94f176549a89a9efded477c456dc" +checksum = "d9394150f5b4273a1763355bd1c2ec54cc5a2593f790587bcd6b2c947cfa9211" dependencies = [ "clap_builder", "clap_derive", @@ -540,9 +540,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.5" +version = "4.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e53afce1efce6ed1f633cf0e57612fe51db54a1ee4fd8f8503d078fe02d69ae" +checksum = "9a78fbdd3cc2914ddf37ba444114bc7765bbdcb55ec9cbe6fa054f0137400717" dependencies = [ "anstream", "anstyle", @@ -560,7 +560,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -819,6 +819,12 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "equivalent" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" + [[package]] name = "errno" version = "0.2.8" @@ -975,7 +981,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -1751,7 +1757,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap", + "indexmap 1.9.3", "slab", "tokio", "tokio-util", @@ -1773,6 +1779,12 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +[[package]] +name = "hashbrown" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" + [[package]] name = "heck" version = "0.4.1" @@ -1951,6 +1963,16 @@ dependencies = [ "hashbrown 0.12.3", ] +[[package]] +name = "indexmap" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +dependencies = [ + "equivalent", + "hashbrown 0.14.0", +] + [[package]] name = "instant" version = "0.1.12" @@ -2105,7 +2127,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -2267,7 +2289,7 @@ checksum = "4901771e1d44ddb37964565c654a3223ba41a594d02b8da471cc4464912b5cfa" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -2440,7 +2462,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -2525,7 +2547,7 @@ checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -2564,9 +2586,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.60" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dec2b086b7a862cf4de201096214fa870344cf922b2b30c167badb3af3195406" +checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" dependencies = [ "unicode-ident", ] @@ -3021,14 +3043,14 @@ checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] name = "serde_json" -version = "1.0.97" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdf3bf93142acad5821c99197022e170842cdbc1c30482b98750c688c640842a" +checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3" dependencies = [ "itoa", "ryu", @@ -3037,9 +3059,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93107647184f6027e3b7dcb2e11034cf95ffa1e3a682c67951963ac69c1c007d" +checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" dependencies = [ "serde", ] @@ -3058,11 +3080,11 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.21" +version = "0.9.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9d684e3ec7de3bf5466b32bd75303ac16f0736426e5a4e0d6e489559ce1249c" +checksum = "452e67b9c20c37fa79df53201dc03839651086ed9bbe92b3ca585ca9fdaa7d85" dependencies = [ - "indexmap", + "indexmap 2.0.0", "itoa", "ryu", "serde", @@ -3178,7 +3200,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -3222,9 +3244,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.18" +version = "2.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e" +checksum = "2efbeae7acf4eabd6bcdcbd11c92f45231ddda7539edc7806bd1a04a03b24616" dependencies = [ "proc-macro2", "quote", @@ -3289,7 +3311,7 @@ checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -3373,7 +3395,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -3450,9 +3472,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6135d499e69981f9ff0ef2167955a5333c35e36f6937d382974566b3d5b94ec" +checksum = "1ebafdf5ad1220cb59e7d17cf4d2c72015297b75b19a10472f99b89225089240" dependencies = [ "serde", "serde_spanned", @@ -3462,20 +3484,20 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a76a9312f5ba4c2dec6b9161fdf25d87ad8a09256ccea5a556fef03c706a10f" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.19.10" +version = "0.19.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380d56e8670370eee6566b0bfd4265f65b3f432e8c6d85623f728d4fa31f739" +checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7" dependencies = [ - "indexmap", + "indexmap 2.0.0", "serde", "serde_spanned", "toml_datetime", @@ -3532,7 +3554,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", ] [[package]] @@ -3820,7 +3842,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", "wasm-bindgen-shared", ] @@ -3854,7 +3876,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.18", + "syn 2.0.22", "wasm-bindgen-backend", "wasm-bindgen-shared", ] From 2f890cc34405b4bf0fae5e52fc4adb6a8de713ed Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 26 Jun 2023 11:42:35 +1000 Subject: [PATCH 1341/2020] ci: Check package publish in `release-pr.yml` (#1170) before creating the release PR. Signed-off-by: Jiahao XU --- .github/workflows/release-pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index c1adea79..2967a306 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -52,3 +52,4 @@ jobs: pr-release-notes: ${{ inputs.crate == 'bin' }} pr-template-file: .github/scripts/release-pr-template.ejs check-semver: true + check-package: true From 887f7593d3a3695c1a419a15f6e07f11abb4f966 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 13:33:28 +1000 Subject: [PATCH 1342/2020] dep: Upgrade transitive dependencies (#1171) Co-authored-by: github-actions --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cb3742ea..2a78e464 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2132,9 +2132,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.146" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libmimalloc-sys" From 88c7df6ea08cf9b30630bb183c36f39031c0a524 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 15:10:30 +1000 Subject: [PATCH 1343/2020] release: leon v2.0.1 (#1172) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/leon-macros/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2a78e464..1ec05b84 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2113,7 +2113,7 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "leon" -version = "2.0.0" +version = "2.0.1" dependencies = [ "clap", "miette", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 494a6598..8132e7f2 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -23,7 +23,7 @@ glob = "0.3.1" home = "0.5.5" itertools = "0.11.0" jobslot = { version = "0.2.11", features = ["tokio"] } -leon = { version = "2.0.0", path = "../leon" } +leon = { version = "2.0.1", path = "../leon" } leon-macros = { version = "1.0.0", path = "../leon-macros" } maybe-owned = "0.3.4" miette = "5.9.0" diff --git a/crates/leon-macros/Cargo.toml b/crates/leon-macros/Cargo.toml index 56a36f00..30594a58 100644 --- a/crates/leon-macros/Cargo.toml +++ b/crates/leon-macros/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" proc-macro = true [dependencies] -leon = { version = "2.0.0", path = "../leon", default-features = false } +leon = { version = "2.0.1", path = "../leon", default-features = false } proc-macro2 = "1.0.59" syn = { version = "2.0.18", default-features = false, features = ["proc-macro", "parsing"] } quote = "1.0.28" diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index d3ff8eb9..f564f456 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -3,7 +3,7 @@ name = "leon" description = "Dead-simple string templating" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/leon" -version = "2.0.0" +version = "2.0.1" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From c917f94f28f198599f1de44d23676d2499c057f1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 18:22:39 +1000 Subject: [PATCH 1344/2020] release: normalize-path v0.2.1 (#1173) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/normalize-path/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1ec05b84..df9bb1d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2384,7 +2384,7 @@ dependencies = [ [[package]] name = "normalize-path" -version = "0.2.0" +version = "0.2.1" [[package]] name = "nu-ansi-term" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 8132e7f2..2c2cad65 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -27,7 +27,7 @@ leon = { version = "2.0.1", path = "../leon" } leon-macros = { version = "1.0.0", path = "../leon-macros" } maybe-owned = "0.3.4" miette = "5.9.0" -normalize-path = { version = "0.2.0", path = "../normalize-path" } +normalize-path = { version = "0.2.1", path = "../normalize-path" } once_cell = "1.18.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } diff --git a/crates/normalize-path/Cargo.toml b/crates/normalize-path/Cargo.toml index fb744501..7d781312 100644 --- a/crates/normalize-path/Cargo.toml +++ b/crates/normalize-path/Cargo.toml @@ -3,7 +3,7 @@ name = "normalize-path" description = "Like canonicalize, but without performing I/O" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/normalize-path" -version = "0.2.0" +version = "0.2.1" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From ff7867a6a61e856293eb04d061002a1017e74e39 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 20:23:31 +1000 Subject: [PATCH 1345/2020] release: detect-targets v0.1.8 (#1174) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index df9bb1d7..090325bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -726,7 +726,7 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "detect-targets" -version = "0.1.7" +version = "0.1.8" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index c08063f1..4e38343f 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -25,5 +25,5 @@ toml_edit = { version = "0.19.10", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.7", path = "../detect-targets" } +detect-targets = { version = "0.1.8", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 2c2cad65..812a5ffb 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -16,7 +16,7 @@ binstalk-types = { version = "0.4.0", path = "../binstalk-types" } cargo_toml = "0.15.3" command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } -detect-targets = { version = "0.1.7", path = "../detect-targets" } +detect-targets = { version = "0.1.8", path = "../detect-targets" } either = "1.8.1" gix = { version = "0.47.0", features = ["blocking-http-transport-reqwest-rust-tls"], optional = true } glob = "0.3.1" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index fd259b16..288b143d 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.7" +version = "0.1.8" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From c816f33ac07c4fcdd648ca8e41ed5f92e7037f55 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 22:27:56 +1000 Subject: [PATCH 1346/2020] release: binstalk-types v0.5.0 (#1175) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 090325bb..9455f15d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -333,7 +333,7 @@ dependencies = [ [[package]] name = "binstalk-types" -version = "0.4.0" +version = "0.5.0" dependencies = [ "compact_str", "maybe-owned", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index c6edfa6a..77c6e360 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" async-trait = "0.1.68" async-compression = { version = "0.4.0", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.15", features = ["deflate", "bzip2", "lzma", "zstd", "xz", "tokio"] } -binstalk-types = { version = "0.4.0", path = "../binstalk-types" } +binstalk-types = { version = "0.5.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" compact_str = "0.7.0" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 4e38343f..a4ca096b 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] beef = { version = "0.5.2", features = ["impl_serde"] } -binstalk-types = { version = "0.4.0", path = "../binstalk-types" } +binstalk-types = { version = "0.5.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.5" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 64bfc4be..29b061b2 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-types" description = "The binstall toolkit that contains basic types for binstalk crates" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-types" -version = "0.4.0" +version = "0.5.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 812a5ffb..17d06b2d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.68" binstalk-downloader = { version = "0.5.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } -binstalk-types = { version = "0.4.0", path = "../binstalk-types" } +binstalk-types = { version = "0.5.0", path = "../binstalk-types" } cargo_toml = "0.15.3" command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } From beb826e6aec7735503db4537b18ef866bc398665 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 26 Jun 2023 23:44:34 +1000 Subject: [PATCH 1347/2020] release: binstalk-manifests v0.6.0 (#1176) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9455f15d..0d5eda39 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -312,7 +312,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.5.0" +version = "0.6.0" dependencies = [ "beef", "binstalk-types", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index aae1f939..8045a275 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.12.1", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.5.0" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.6.0" } clap = { version = "4.3.0", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index a4ca096b..1b094733 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.5.0" +version = "0.6.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From 583860fbc6fa59311a96418124596edba4c3a63d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 27 Jun 2023 00:17:53 +1000 Subject: [PATCH 1348/2020] release: binstalk-downloader v0.6.0 (#1177) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d5eda39..5a0c41f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -276,7 +276,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.5.1" +version = "0.6.0" dependencies = [ "async-compression 0.4.0", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 77c6e360..e30acc62 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.5.1" +version = "0.6.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 17d06b2d..0d8340b4 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.5.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.6.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } cargo_toml = "0.15.3" command-group = { version = "2.1.0", features = ["with-tokio"] } From d2e4fef060ad5a49cc9461ca5c3fd630ae79e6e7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 27 Jun 2023 11:52:53 +1000 Subject: [PATCH 1349/2020] release: binstalk v0.13.0 (#1178) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a0c41f7..08f61d61 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -240,7 +240,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.12.1" +version = "0.13.0" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 8045a275..350eb164 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.12.1", default-features = false } +binstalk = { path = "../binstalk", version = "0.13.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.6.0" } clap = { version = "4.3.0", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 0d8340b4..2bcfe8fe 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.12.1" +version = "0.13.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From f231f939769a4746e7d59561e0bb14f37a956739 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 27 Jun 2023 13:42:37 +1000 Subject: [PATCH 1350/2020] release: cargo-binstall v1.0.0 (#1179) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 08f61d61..b74f6e30 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -466,7 +466,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "0.23.1" +version = "1.0.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 350eb164..2c75727c 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "0.23.1" +version = "1.0.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 47e07895..1979291f 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 3d81c147bee68b4148351ce8f97eb28007ecb188 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 27 Jun 2023 16:25:38 +1000 Subject: [PATCH 1351/2020] fix `release-build.yml`: Explicitly set release_name to the same as tag (#1181) Fixed #699 Signed-off-by: Jiahao XU --- .github/workflows/release-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 20ab47f3..18ed7535 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -86,6 +86,7 @@ jobs: uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} + release_name: v${{ fromJSON(inputs.publish).version }} tag: v${{ fromJSON(inputs.publish).version }} body: ${{ fromJSON(inputs.publish).notes }} file: packages/cargo-binstall-* From f0c3d1e724d288c9ec5f3c6476560db8541108d8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 27 Jun 2023 16:25:57 +1000 Subject: [PATCH 1352/2020] fix `release-build.yml`: Fix cache key for `Swatinem/rust-cache@v2` (#1180) Set `CARGO_*` env before caching is done. Signed-off-by: Jiahao XU --- .github/workflows/release-build.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 18ed7535..0cad549c 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -50,6 +50,15 @@ jobs: steps: - uses: actions/checkout@v3 + + - name: Override release profile lto settings + if: inputs.CARGO_PROFILE_RELEASE_LTO + run: echo "CARGO_PROFILE_RELEASE_LTO=${{ inputs.CARGO_PROFILE_RELEASE_LTO }}" >> "$GITHUB_ENV" + + - name: Override release profile codegen-units settings + if: inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS + run: echo "CARGO_PROFILE_RELEASE_CODEGEN_UNITS=${{ inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS }}" >> "$GITHUB_ENV" + - uses: ./.github/actions/just-setup with: tools: cargo-auditable @@ -61,14 +70,6 @@ jobs: - run: just toolchain rust-src - run: just ci-install-deps - - name: Override release profile lto settings - if: inputs.CARGO_PROFILE_RELEASE_LTO - run: echo "CARGO_PROFILE_RELEASE_LTO=${{ inputs.CARGO_PROFILE_RELEASE_LTO }}" >> "$GITHUB_ENV" - - - name: Override release profile codegen-units settings - if: inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS - run: echo "CARGO_PROFILE_RELEASE_CODEGEN_UNITS=${{ inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS }}" >> "$GITHUB_ENV" - - run: just package - if: runner.os == 'Windows' run: Get-ChildItem packages/ From 59c0d5dea9970578e01aeef205da586169dd4213 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 29 Jun 2023 22:52:48 +1000 Subject: [PATCH 1353/2020] build(deps): update gix requirement from 0.47.0 to 0.48.0 in /crates/binstalk (#1185) build(deps): update gix requirement in /crates/binstalk Updates the requirements on [gix](https://github.com/Byron/gitoxide) to permit the latest version. - [Release notes](https://github.com/Byron/gitoxide/releases) - [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md) - [Commits](https://github.com/Byron/gitoxide/compare/gix-v0.47.0...gix-v0.48.0) --- updated-dependencies: - dependency-name: gix dependency-type: direct:production ... - Also updated other dependencies to latest compatible version. Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 215 +++++++++++++++++++------------------ crates/binstalk/Cargo.toml | 2 +- 2 files changed, 109 insertions(+), 108 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b74f6e30..59f75e7d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -364,9 +364,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.2" +version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbe3c979c178231552ecba20214a8272df4e09f232a87aef4320cf06539aded" +checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" [[package]] name = "block-buffer" @@ -529,9 +529,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.8" +version = "4.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9394150f5b4273a1763355bd1c2ec54cc5a2593f790587bcd6b2c947cfa9211" +checksum = "bba77a07e4489fb41bd90e8d4201c3eb246b3c2c9ea2ba0bddd6c1d1df87db7d" dependencies = [ "clap_builder", "clap_derive", @@ -540,9 +540,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.8" +version = "4.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a78fbdd3cc2914ddf37ba444114bc7765bbdcb55ec9cbe6fa054f0137400717" +checksum = "2c9b4a88bb4bc35d3d6f65a21b0f0bafe9c894fa00978de242c555ec28bea1c0" dependencies = [ "anstream", "anstyle", @@ -866,6 +866,12 @@ dependencies = [ "instant", ] +[[package]] +name = "fastrand" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" + [[package]] name = "file-format" version = "0.17.3" @@ -1063,9 +1069,9 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "gix" -version = "0.47.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f5281c55e0a7415877d91a15fae4a10ec7444615d64d78e48c07f20bcfcd9b" +checksum = "c1e74cea676de7f53a79f3c0365812b11f6814b81e671b8ee4abae6ca09c7881" dependencies = [ "gix-actor", "gix-attributes", @@ -1114,9 +1120,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b70d0d809ee387113df810ab4ebe585a076e35ae6ed59b5b280072146955a3ff" +checksum = "1969b77b9ee4cc1755c841987ec6f7622aaca95e952bcafb76973ae59d1b8716" dependencies = [ "bstr", "btoi", @@ -1128,9 +1134,9 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03d7006cc5a508514207154046e18c3c39d98ba98f865ada83b6f3f3886543bb" +checksum = "e3772b0129dcd1fc73e985bbd08a1482d082097d2915cb1ee31ce8092b8e4434" dependencies = [ "bstr", "gix-glob", @@ -1172,9 +1178,9 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.17.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e498e98d0b477d6a1c1608bee39db201e7a38873460a130a97ce88b4d95b6e1" +checksum = "ed42baa50075d41c1a0931074ce1a97c5797c7c6fe7591d9f1f2dcd448532c26" dependencies = [ "bstr", "gix-chunk", @@ -1186,9 +1192,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.24.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33b32541232a2c626849df7843e05b50cb43ac38a4f675abbe2f661874fc1e9d" +checksum = "817688c7005a716d9363e267913526adea402dabd947f4ba63842d10cc5132af" dependencies = [ "bstr", "gix-config-value", @@ -1208,11 +1214,11 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4783caa23062f86acfd1bc9e72c62250923d1673171ce1a524d9486f8a4556a8" +checksum = "83960be5e99266bcf55dae5a24731bbd39f643bfb68f27e939d6b06836b5b87d" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.3.3", "bstr", "gix-path", "libc", @@ -1221,9 +1227,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dcec518a8db5b2e342ea7a2e785f46fd176b1b689ddd3f43052701bf3fa8ee3" +checksum = "75a75565e0e6e7f80cfa4eb1b05cc448c6846ddd48dcf413a28875fbc11ee9af" dependencies = [ "bstr", "gix-command", @@ -1237,9 +1243,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0213f923d63c2c7d10799c1977f42df38ec586ebbf1d14fd00dfa363ac994c2b" +checksum = "8e9a04a1d2387c955ec91059d56b673000dd24f3c07cad08ed253e36381782bf" dependencies = [ "bstr", "itoa", @@ -1249,9 +1255,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5049dd5a60d5608912da0ab184f35064901f192f4adf737716789715faffa080" +checksum = "aaf5d9b9b521b284ebe53ee69eee33341835ec70edc314f36b2100ea81396121" dependencies = [ "gix-hash", "gix-object", @@ -1261,9 +1267,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.20.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c14865cb9c6eb817d6a8d53595f1051239d2d31feae7a5e5b2f00910c94a8eb4" +checksum = "272aad20dc63dedba76615373dd8885fb5aebe4795e5b5b0aa2a24e63c82085c" dependencies = [ "bstr", "dunce", @@ -1276,9 +1282,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae82dfceec06c034728c530399ee449f97b1e542e191247c52c169ca6af1fd89" +checksum = "06142d8cff5d17509399b04052b64d2f9b3a311d5cff0b1a32b220f62cd0d595" dependencies = [ "bytes", "bytesize", @@ -1308,11 +1314,11 @@ dependencies = [ [[package]] name = "gix-glob" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f45cd7ab22faf154db0a9f5a8011ba9cda8b298b61b7299f43a21bbaf0b3f208" +checksum = "c18bdff83143d61e7d60da6183b87542a870d026b2a2d0b30170b8e9c0cd321a" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.3.3", "bstr", "gix-features", "gix-path", @@ -1330,20 +1336,20 @@ dependencies = [ [[package]] name = "gix-hashtable" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfd7f4ea905c13579565e3c264ca2c4103d192bd5fce2300c5a884cf1977d61" +checksum = "9e133bc56d938eaec1c675af7c681a51de9662b0ada779f45607b967a10da77a" dependencies = [ "gix-hash", - "hashbrown 0.13.2", + "hashbrown 0.14.0", "parking_lot", ] [[package]] name = "gix-ignore" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27e82dec6975012b710837c6cd56353c3111d2308e016118bfc59275fcc8b5d0" +checksum = "ca801f2d0535210f77b33e2c067d565aedecacc82f1b3dbce26da1388ebc4634" dependencies = [ "bstr", "gix-glob", @@ -1353,11 +1359,11 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ef2fa392d351e62ac3a6309146f61880abfbe0c07474e075d3b2ac78a6834a5" +checksum = "68099abdf6ee50ae3c897e8b05de96871cbe54d52a37cdf559101f911b883562" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.3.3", "bstr", "btoi", "filetime", @@ -1375,9 +1381,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "7.0.0" +version = "7.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "328f50aad713ab606caeaf834459ef915ccdfbb9133ac6cd54616d601aa9249f" +checksum = "714bcb13627995ac33716e9c5e4d25612b19947845395f64d2a9cbe6007728e4" dependencies = [ "gix-tempfile", "gix-utils", @@ -1386,9 +1392,9 @@ dependencies = [ [[package]] name = "gix-mailmap" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0bef8d360a6a9fc5a6d872471588d8ca7db77b940e48ff20c3b4706ad5f481d" +checksum = "1787e3c37fc43b1f7c0e3be6196c6837b3ba5f869190dfeaa444b816f0a7f34b" dependencies = [ "bstr", "gix-actor", @@ -1398,11 +1404,11 @@ dependencies = [ [[package]] name = "gix-negotiate" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b626aafb9f4088058f1baa5d2029b2191820c84f6c81e43535ba70bfdc7b7d56" +checksum = "4e7bce64d4452dd609f44d04b14b29da2e0ad2c45fcdf4ce1472a5f5f8ec21c2" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.3.3", "gix-commitgraph", "gix-date", "gix-hash", @@ -1414,9 +1420,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "255e477ae4cc8d10778238f011e6125b01cc0e7067dc8df87acd67a428a81f20" +checksum = "a953f3d7ffad16734aa3ab1d05807972c80e339d1bd9dde03e0198716b99e2a6" dependencies = [ "bstr", "btoi", @@ -1434,9 +1440,9 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.48.0" +version = "0.49.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b73469f145d1e6afbcfd0ab6499a366fbbcb958c2999d41d283d6c7b94024b9" +checksum = "f6418cff00ecc2713b58c8e04bff30dda808fbba1a080e7248b299d069894a01" dependencies = [ "arc-swap", "gix-date", @@ -1453,9 +1459,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.38.0" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f3bcd1aaa72aea7163b147d2bde2480a01eadefc774a479d38f29920f7f1c8" +checksum = "414935138d90043ea5898de7a93f02c2558e52652492719470e203ef26a8fd0a" dependencies = [ "clru", "gix-chunk", @@ -1487,9 +1493,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ea2a19d82dd55e5fad1d606b8a1ad2f7a804e10caa2efbb169cd37e0a07ede0" +checksum = "dfca182d2575ded2ed38280f1ebf75cd5d3790b77e0872de07854cf085821fbe" dependencies = [ "bstr", "gix-trace", @@ -1513,9 +1519,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27e93c9343860c45c025e09bc26772d15cec690250d04b36822bd528dd3c44f8" +checksum = "ed7069fac7eb23b043b4bd7890df1e244cb370c3fe8b2ff482203d36b4fd4099" dependencies = [ "bstr", "btoi", @@ -1542,9 +1548,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.31.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6c74873a9d8ff5d1310f2325f09164c15a91402ab5cde4d479ae12ff55ed69" +checksum = "39453f4e5f23cddc2e6e4cca2ba20adfdbec29379e3ca829714dfe98ae068ccd" dependencies = [ "gix-actor", "gix-date", @@ -1563,9 +1569,9 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca1bc6c40bad62570683d642fcb04e977433ac8f76b674860ef7b1483c1f8990" +checksum = "b8e76ff1f82fba295a121e31ab02f69642994e532c45c0c899aa393f4b740302" dependencies = [ "bstr", "gix-hash", @@ -1577,9 +1583,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3751d6643d731fc5829d2f43ca049f4333c968f30908220ba0783c9dfe5010c" +checksum = "237428a7d3978e8572964e1e45d984027c2acc94df47e594baa6c4b0da7c9922" dependencies = [ "bstr", "gix-date", @@ -1592,9 +1598,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "144995229c6e5788b1c7386f8a3f7146ace3745c9a6b56cef9123a7d83b110c5" +checksum = "028d50fcaf8326a8f79a359490d9ca9fb4e2b51ac9ac86503560d0bcc888d2eb" dependencies = [ "gix-commitgraph", "gix-date", @@ -1607,11 +1613,11 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47f09860e2ddc7b13119e410c46d8e9f870acc7933fb53ae65817af83a8c9f80" +checksum = "ede298863db2a0574a14070991710551e76d1f47c9783b62d4fcbca17f56371c" dependencies = [ - "bitflags 2.3.2", + "bitflags 2.3.3", "gix-path", "libc", "windows 0.48.0", @@ -1634,15 +1640,15 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff8a60073500f4d6edd181432ee11394d843db7dcf05756aa137a1233b1cbf6" +checksum = "103eac621617be3ebe0605c9065ca51a223279a23218aaf67d10daa6e452f663" [[package]] name = "gix-transport" -version = "0.33.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435013c7ce6983fd2cfa9a740873c31c048c042e47d92714e43d75d861f0eedf" +checksum = "0929bb80a07c04033edd4585091c4db9ea458cb932e883bf22efb146ebfbdc89" dependencies = [ "base64 0.21.2", "bstr", @@ -1659,9 +1665,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3f6bba1686bfbc7e0e93d4932bc6e14d479c9c9524f7c8d65b25d2a9446a99e" +checksum = "e3cdfd54598db4fae57d5ae6f52958422b2d13382d2745796bfe5c8015ffa86e" dependencies = [ "gix-commitgraph", "gix-date", @@ -1675,9 +1681,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1f984816338039b151a9f5dae6100e1e51e438cf61242ea8136fedc574d825" +checksum = "beaede6dbc83f408b19adfd95bb52f1dbf01fb8862c3faf6c6243e2e67fcdfa1" dependencies = [ "bstr", "gix-features", @@ -1689,11 +1695,11 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ca284c260845bc0724050aec59c7a596407678342614cdf5a1d69e044f29a36" +checksum = "7058c94f4164fcf5b8457d35f6d8f6e1007f9f7f938c9c7684a7e01d23c6ddde" dependencies = [ - "fastrand", + "fastrand 2.0.0", ] [[package]] @@ -1708,9 +1714,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.20.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee22549d6723189366235e1c6959ccdac73b58197cdbb437684eaa2169edcb9" +checksum = "c1363b9aa66b9e14412ac04e1f759827203f491729d92172535a8ce6cde02efa" dependencies = [ "bstr", "filetime", @@ -1747,9 +1753,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d357c7ae988e7d2182f7d7871d0b963962420b0678b0997ce7de72001aeab782" +checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" dependencies = [ "bytes", "fnv", @@ -1773,12 +1779,6 @@ dependencies = [ "ahash 0.7.6", ] -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" - [[package]] name = "hashbrown" version = "0.14.0" @@ -1874,9 +1874,9 @@ checksum = "86cce260d758a9aa3d7c4b99d55c815a540f8a37514ba6046ab6be402a157cb0" [[package]] name = "hyper" -version = "0.14.26" +version = "0.14.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab302d72a6f11a3b910431ff93aae7e773078c769f0a3ef15fb9ec692ed147d4" +checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" dependencies = [ "bytes", "futures-channel", @@ -2017,9 +2017,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.7.2" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" +checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" @@ -2244,9 +2244,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memmap2" -version = "0.5.10" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" +checksum = "f49388d20533534cd19360ad3d6a7dadc885944aa802ba3995040c5ec11288c6" dependencies = [ "libc", ] @@ -2664,9 +2664,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.28" +version = "1.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488" +checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" dependencies = [ "proc-macro2", ] @@ -2802,7 +2802,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "rustls 0.21.2", - "rustls-pemfile 1.0.2", + "rustls-pemfile 1.0.3", "serde", "serde_json", "serde_urlencoded", @@ -2906,7 +2906,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" dependencies = [ "openssl-probe", - "rustls-pemfile 1.0.2", + "rustls-pemfile 1.0.3", "schannel", "security-framework", ] @@ -2922,9 +2922,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ "base64 0.21.2", ] @@ -3267,7 +3267,7 @@ checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" dependencies = [ "autocfg", "cfg-if", - "fastrand", + "fastrand 1.9.0", "redox_syscall 0.3.5", "rustix", "windows-sys 0.48.0", @@ -3370,11 +3370,12 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.28.2" +version = "1.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2" +checksum = "374442f06ee49c3a28a8fc9f01a2596fed7559c6b99b31279c3261778e77d84f" dependencies = [ "autocfg", + "backtrace", "bytes", "libc", "mio", @@ -3627,7 +3628,7 @@ dependencies = [ "rand", "ring", "rustls 0.20.8", - "rustls-pemfile 1.0.2", + "rustls-pemfile 1.0.3", "smallvec", "thiserror", "tinyvec", @@ -4038,9 +4039,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" dependencies = [ "windows_aarch64_gnullvm 0.48.0", "windows_aarch64_msvc 0.48.0", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 2bcfe8fe..cac37220 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -18,7 +18,7 @@ command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.8", path = "../detect-targets" } either = "1.8.1" -gix = { version = "0.47.0", features = ["blocking-http-transport-reqwest-rust-tls"], optional = true } +gix = { version = "0.48.0", features = ["blocking-http-transport-reqwest-rust-tls"], optional = true } glob = "0.3.1" home = "0.5.5" itertools = "0.11.0" From d4ffc6812931a1672d80047471f72a5852c7c53b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 30 Jun 2023 13:52:19 +1000 Subject: [PATCH 1354/2020] dep: Upgrade transitive dependencies (#1187) Co-authored-by: github-actions --- Cargo.lock | 103 ++++++++++++++++++++++++++--------------------------- 1 file changed, 51 insertions(+), 52 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 59f75e7d..5965313a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" dependencies = [ "gimli", ] @@ -195,15 +195,15 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" dependencies = [ "addr2line", "cc", "cfg-if", "libc", - "miniz_oxide 0.6.2", + "miniz_oxide", "object", "rustc-demangle", ] @@ -529,9 +529,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.9" +version = "4.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bba77a07e4489fb41bd90e8d4201c3eb246b3c2c9ea2ba0bddd6c1d1df87db7d" +checksum = "384e169cc618c613d5e3ca6404dda77a8685a63e08660dcc64abaf7da7cb0c7a" dependencies = [ "clap_builder", "clap_derive", @@ -540,13 +540,12 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.9" +version = "4.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9b4a88bb4bc35d3d6f65a21b0f0bafe9c894fa00978de242c555ec28bea1c0" +checksum = "ef137bbe35aab78bdb468ccfba75a5f4d8321ae011d34063770780545176af2d" dependencies = [ "anstream", "anstyle", - "bitflags 1.3.2", "clap_lex", "strsim", ] @@ -898,7 +897,7 @@ checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" dependencies = [ "crc32fast", "libz-ng-sys", - "miniz_oxide 0.7.1", + "miniz_oxide", ] [[package]] @@ -944,7 +943,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7672706608ecb74ab2e055c68327ffc25ae4cac1e12349204fd5fb0f3487cce2" dependencies = [ - "rustix", + "rustix 0.37.21", "windows-sys 0.48.0", ] @@ -1513,7 +1512,7 @@ dependencies = [ "gix-command", "gix-config-value", "parking_lot", - "rustix", + "rustix 0.37.21", "thiserror", ] @@ -1791,15 +1790,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" -[[package]] -name = "hermit-abi" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - [[package]] name = "hermit-abi" version = "0.3.1" @@ -1998,7 +1988,7 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.1", + "hermit-abi", "libc", "windows-sys 0.48.0", ] @@ -2023,13 +2013,12 @@ checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" +checksum = "24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb" dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", - "rustix", + "hermit-abi", + "rustix 0.38.1", "windows-sys 0.48.0", ] @@ -2168,6 +2157,12 @@ version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" +[[package]] +name = "linux-raw-sys" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" + [[package]] name = "lock_api" version = "0.4.10" @@ -2313,15 +2308,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" -[[package]] -name = "miniz_oxide" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.7.1" @@ -2407,11 +2393,11 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi", "libc", ] @@ -2426,9 +2412,9 @@ dependencies = [ [[package]] name = "object" -version = "0.30.4" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b4680b86d9cfafba8fc491dc9b6df26b68cf40e9e6cd73909194759a63c385" +checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" dependencies = [ "memchr", ] @@ -2532,18 +2518,18 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pin-project" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" +checksum = "6e138fdd8263907a2b0e1b4e80b7e58c721126479b6e6eedfb1b402acea7b9bd" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" +checksum = "d1fef411b303e3e12d534fb6e7852de82da56edd937d895125821fb7c09436c7" dependencies = [ "proc-macro2", "quote", @@ -2863,15 +2849,28 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.20" +version = "0.37.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b96e891d04aa506a6d1f318d2771bcb1c7dfda84e126660ace067c9b474bb2c0" +checksum = "62f25693a73057a1b4cb56179dd3c7ea21a7c6c5ee7d85781f5749b46f34b79c" dependencies = [ "bitflags 1.3.2", "errno 0.3.1", "io-lifetimes", "libc", - "linux-raw-sys", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + +[[package]] +name = "rustix" +version = "0.38.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc6396159432b5c8490d4e301d8c705f61860b8b6c863bf79942ce5401968f3" +dependencies = [ + "bitflags 2.3.3", + "errno 0.3.1", + "libc", + "linux-raw-sys 0.4.3", "windows-sys 0.48.0", ] @@ -3269,7 +3268,7 @@ dependencies = [ "cfg-if", "fastrand 1.9.0", "redox_syscall 0.3.5", - "rustix", + "rustix 0.37.21", "windows-sys 0.48.0", ] @@ -3370,9 +3369,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.0" +version = "1.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374442f06ee49c3a28a8fc9f01a2596fed7559c6b99b31279c3261778e77d84f" +checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" dependencies = [ "autocfg", "backtrace", From 01a87ac606bf600848f90a1a12957301cac184e8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 30 Jun 2023 13:52:40 +1000 Subject: [PATCH 1355/2020] feat: Impl support for alternative registries (#1184) Fixed #1168 Signed-off-by: Jiahao XU --- Cargo.lock | 2 + crates/bin/src/args.rs | 5 + crates/bin/src/entry.rs | 2 +- crates/binstalk-downloader/src/remote.rs | 7 + crates/binstalk/Cargo.toml | 4 + crates/binstalk/src/drivers.rs | 10 +- crates/binstalk/src/drivers/registry.rs | 252 ++++++++++++++++++ .../binstalk/src/drivers/registry/common.rs | 168 ++++++++++++ .../crates_io_registry.rs} | 138 +++++----- .../src/drivers/registry/git_registry.rs | 136 ++++++++++ .../src/drivers/registry/sparse_registry.rs | 109 ++++++++ .../drivers/{crates_io => registry}/vfs.rs | 0 .../{crates_io => registry}/visitor.rs | 0 crates/binstalk/src/errors.rs | 28 +- crates/binstalk/src/helpers/git.rs | 4 +- crates/binstalk/src/helpers/remote.rs | 1 + crates/binstalk/src/ops.rs | 34 +-- crates/binstalk/src/ops/resolve.rs | 11 +- 18 files changed, 779 insertions(+), 132 deletions(-) create mode 100644 crates/binstalk/src/drivers/registry.rs create mode 100644 crates/binstalk/src/drivers/registry/common.rs rename crates/binstalk/src/drivers/{crates_io.rs => registry/crates_io_registry.rs} (55%) create mode 100644 crates/binstalk/src/drivers/registry/git_registry.rs create mode 100644 crates/binstalk/src/drivers/registry/sparse_registry.rs rename crates/binstalk/src/drivers/{crates_io => registry}/vfs.rs (100%) rename crates/binstalk/src/drivers/{crates_io => registry}/visitor.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 5965313a..63ce28c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -263,11 +263,13 @@ dependencies = [ "once_cell", "semver", "serde", + "serde_json", "strum", "target-lexicon", "tempfile", "thiserror", "tokio", + "toml_edit", "tracing", "url", "windows 0.48.0", diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index fa3a1958..1f9f40b8 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -8,6 +8,7 @@ use std::{ }; use binstalk::{ + drivers::Registry, helpers::remote, manifests::cargo_toml_binstall::PkgFmt, ops::resolve::{CrateName, VersionReqExt}, @@ -222,6 +223,10 @@ pub struct Args { #[clap(help_heading = "Options", long, alias = "roots")] pub root: Option, + /// The URL of the registry index to use + #[clap(help_heading = "Options", long)] + pub index: Option, + /// This option will be passed through to all `cargo-install` invocations. /// /// It will require `Cargo.lock` to be up to date. diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 3b7b2736..3ffa7026 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -127,7 +127,7 @@ pub fn install_crates( client, gh_api_client, jobserver_client, - crates_io_rate_limit: Default::default(), + registry: args.index.unwrap_or_default(), }); // Destruct args before any async function to reduce size of the future diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 2de06d75..abda9d66 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -63,6 +63,13 @@ pub struct HttpError { err: reqwest::Error, } +impl HttpError { + /// Returns true if the error is from [`Response::error_for_status`]. + pub fn is_status(&self) -> bool { + self.err.is_status() + } +} + #[derive(Debug)] struct Inner { client: reqwest::Client, diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index cac37220..d55fa9ac 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -31,6 +31,7 @@ normalize-path = { version = "0.2.1", path = "../normalize-path" } once_cell = "1.18.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } +serde_json = "1.0.99" strum = "0.25.0" target-lexicon = { version = "0.12.8", features = ["std"] } tempfile = "3.5.0" @@ -41,6 +42,9 @@ tracing = "0.1.37" url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" +[dev-dependencies] +toml_edit = { version = "0.19.11", features = ["serde"] } + [target.'cfg(target_os = "windows")'.dependencies] windows = { version = "0.48.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } diff --git a/crates/binstalk/src/drivers.rs b/crates/binstalk/src/drivers.rs index 16d43f03..1f07c099 100644 --- a/crates/binstalk/src/drivers.rs +++ b/crates/binstalk/src/drivers.rs @@ -1,2 +1,8 @@ -mod crates_io; -pub use crates_io::fetch_crate_cratesio; +mod registry; +pub use registry::{ + fetch_crate_cratesio, CratesIoRateLimit, InvalidRegistryError, Registry, RegistryError, + SparseRegistry, +}; + +#[cfg(feature = "git")] +pub use registry::GitRegistry; diff --git a/crates/binstalk/src/drivers/registry.rs b/crates/binstalk/src/drivers/registry.rs new file mode 100644 index 00000000..2e137e17 --- /dev/null +++ b/crates/binstalk/src/drivers/registry.rs @@ -0,0 +1,252 @@ +use std::{str::FromStr, sync::Arc}; + +use cargo_toml::Manifest; +use compact_str::CompactString; +use leon::{ParseError, RenderError}; +use miette::Diagnostic; +use semver::VersionReq; +use serde_json::Error as JsonError; +use thiserror::Error as ThisError; + +use crate::{ + errors::BinstallError, + helpers::remote::{Client, Error as RemoteError, Url, UrlParseError}, + manifests::cargo_toml_binstall::Meta, +}; + +#[cfg(feature = "git")] +use crate::helpers::git::{GitUrl, GitUrlParseError}; + +mod vfs; + +mod visitor; + +mod common; +use common::*; + +#[cfg(feature = "git")] +mod git_registry; +#[cfg(feature = "git")] +pub use git_registry::GitRegistry; + +mod crates_io_registry; +pub use crates_io_registry::{fetch_crate_cratesio, CratesIoRateLimit}; + +mod sparse_registry; +pub use sparse_registry::SparseRegistry; + +#[derive(Debug, ThisError, Diagnostic)] +#[diagnostic(severity(error), code(binstall::cargo_registry))] +#[non_exhaustive] +pub enum RegistryError { + #[error(transparent)] + Remote(#[from] RemoteError), + + #[error("{0} is not found")] + #[diagnostic( + help("Check that the crate name you provided is correct.\nYou can also search for a matching crate at: https://lib.rs/search?q={0}") + )] + NotFound(CompactString), + + #[error(transparent)] + Json(#[from] JsonError), + + #[error("Failed to parse dl config: {0}")] + ParseDlConfig(#[from] ParseError), + + #[error("Failed to render dl config: {0}")] + RenderDlConfig(#[from] RenderError), +} + +#[derive(Clone, Debug)] +#[non_exhaustive] +pub enum Registry { + CratesIo(Arc), + + Sparse(Arc), + + #[cfg(feature = "git")] + Git(GitRegistry), +} + +impl Default for Registry { + fn default() -> Self { + Self::CratesIo(Default::default()) + } +} + +#[derive(Debug, ThisError)] +#[error("Invalid registry `{src}`, {inner}")] +pub struct InvalidRegistryError { + src: CompactString, + #[source] + inner: InvalidRegistryErrorInner, +} + +#[derive(Debug, ThisError)] +enum InvalidRegistryErrorInner { + #[cfg(feature = "git")] + #[error("failed to parse git url {0}")] + GitUrlParseErr(#[from] Box), + + #[error("failed to parse sparse registry url: {0}")] + UrlParseErr(#[from] UrlParseError), + + #[error("expected protocol http(s), actual protocl {0}")] + InvalidScheme(CompactString), + + #[cfg(not(feature = "git"))] + #[error("git registry not supported")] + GitRegistryNotSupported, +} + +impl Registry { + fn from_str_inner(s: &str) -> Result { + if let Some(s) = s.strip_prefix("sparse+") { + let url = Url::parse(s)?; + + let scheme = url.scheme(); + if scheme != "http" && scheme != "https" { + Err(InvalidRegistryErrorInner::InvalidScheme(scheme.into())) + } else { + Ok(Self::Sparse(Arc::new(SparseRegistry::new(url)))) + } + } else { + #[cfg(not(feature = "git"))] + { + Err(InvalidRegistryErrorInner::GitRegistryNotSupported) + } + #[cfg(feature = "git")] + { + let url = GitUrl::from_str(s).map_err(Box::new)?; + Ok(Self::Git(GitRegistry::new(url))) + } + } + } + + /// Fetch the latest crate with `crate_name` and with version matching + /// `version_req`. + pub async fn fetch_crate_matched( + &self, + client: Client, + crate_name: &str, + version_req: &VersionReq, + ) -> Result, BinstallError> { + match self { + Self::CratesIo(rate_limit) => { + fetch_crate_cratesio(client, crate_name, version_req, rate_limit).await + } + Self::Sparse(sparse_registry) => { + sparse_registry + .fetch_crate_matched(client, crate_name, version_req) + .await + } + #[cfg(feature = "git")] + Self::Git(git_registry) => { + git_registry + .fetch_crate_matched(client, crate_name, version_req) + .await + } + } + } +} + +impl FromStr for Registry { + type Err = InvalidRegistryError; + + fn from_str(s: &str) -> Result { + Self::from_str_inner(s).map_err(|inner| InvalidRegistryError { + src: s.into(), + inner, + }) + } +} + +#[cfg(test)] +mod test { + use std::time::Duration; + + use toml_edit::ser::to_string; + + use super::*; + + /// Mark this as an async fn so that you won't accidentally use it in + /// sync context. + async fn create_client() -> Client { + Client::new( + concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), + None, + Duration::from_millis(10), + 1.try_into().unwrap(), + [], + ) + .unwrap() + } + + #[tokio::test] + async fn test_crates_io_sparse_registry() { + let client = create_client().await; + + let sparse_registry: Registry = "sparse+https://index.crates.io/".parse().unwrap(); + assert!( + matches!(sparse_registry, Registry::Sparse(_)), + "{:?}", + sparse_registry + ); + + let crate_name = "cargo-binstall"; + let version_req = &VersionReq::parse("=1.0.0").unwrap(); + let manifest_from_sparse = sparse_registry + .fetch_crate_matched(client.clone(), crate_name, version_req) + .await + .unwrap(); + + let manifest_from_cratesio_api = Registry::default() + .fetch_crate_matched(client, crate_name, version_req) + .await + .unwrap(); + + let serialized_manifest_from_sparse = to_string(&manifest_from_sparse).unwrap(); + let serialized_manifest_from_cratesio_api = to_string(&manifest_from_cratesio_api).unwrap(); + + assert_eq!( + serialized_manifest_from_sparse, + serialized_manifest_from_cratesio_api + ); + } + + #[cfg(feature = "git")] + #[tokio::test] + async fn test_crates_io_git_registry() { + let client = create_client().await; + + let git_registry: Registry = "https://github.com/rust-lang/crates.io-index" + .parse() + .unwrap(); + assert!( + matches!(git_registry, Registry::Git(_)), + "{:?}", + git_registry + ); + + let crate_name = "cargo-binstall"; + let version_req = &VersionReq::parse("=1.0.0").unwrap(); + let manifest_from_git = git_registry + .fetch_crate_matched(client.clone(), crate_name, version_req) + .await + .unwrap(); + + let manifest_from_cratesio_api = Registry::default() + .fetch_crate_matched(client, crate_name, version_req) + .await + .unwrap(); + + let serialized_manifest_from_git = to_string(&manifest_from_git).unwrap(); + let serialized_manifest_from_cratesio_api = to_string(&manifest_from_cratesio_api).unwrap(); + + assert_eq!( + serialized_manifest_from_git, + serialized_manifest_from_cratesio_api + ); + } +} diff --git a/crates/binstalk/src/drivers/registry/common.rs b/crates/binstalk/src/drivers/registry/common.rs new file mode 100644 index 00000000..54d64fa7 --- /dev/null +++ b/crates/binstalk/src/drivers/registry/common.rs @@ -0,0 +1,168 @@ +use std::{borrow::Cow, path::PathBuf}; + +use cargo_toml::Manifest; +use compact_str::{format_compact, CompactString, ToCompactString}; +use leon::{Template, Values}; +use semver::{Version, VersionReq}; +use serde::Deserialize; +use serde_json::Error as JsonError; +use tracing::debug; + +use crate::{ + drivers::registry::{visitor::ManifestVisitor, RegistryError}, + errors::BinstallError, + helpers::{ + download::Download, + remote::{Client, Url}, + }, + manifests::cargo_toml_binstall::{Meta, TarBasedFmt}, +}; + +#[derive(Deserialize)] +pub(super) struct RegistryConfig { + pub(super) dl: CompactString, +} + +pub(super) async fn parse_manifest( + client: Client, + crate_name: &str, + version: &str, + crate_url: Url, +) -> Result, BinstallError> { + debug!("Fetching crate from: {crate_url} and extracting Cargo.toml from it"); + + let manifest_dir_path: PathBuf = format!("{crate_name}-{version}").into(); + + let mut manifest_visitor = ManifestVisitor::new(manifest_dir_path); + + Download::new(client, crate_url) + .and_visit_tar(TarBasedFmt::Tgz, &mut manifest_visitor) + .await?; + + manifest_visitor.load_manifest() +} + +/// Return components of crate prefix +pub(super) fn crate_prefix_components( + crate_name: &str, +) -> Result<(CompactString, Option), RegistryError> { + let mut chars = crate_name.chars(); + + match (chars.next(), chars.next(), chars.next(), chars.next()) { + (None, None, None, None) => Err(RegistryError::NotFound(crate_name.into())), + (Some(_), None, None, None) => Ok((CompactString::new("1"), None)), + (Some(_), Some(_), None, None) => Ok((CompactString::new("2"), None)), + (Some(ch), Some(_), Some(_), None) => Ok(( + CompactString::new("3"), + Some(ch.to_lowercase().to_compact_string()), + )), + (Some(a), Some(b), Some(c), Some(d)) => Ok(( + format_compact!("{}{}", a.to_lowercase(), b.to_lowercase()), + Some(format_compact!("{}{}", c.to_lowercase(), d.to_lowercase())), + )), + _ => unreachable!(), + } +} + +pub(super) fn render_dl_template( + dl_template: &str, + crate_name: &str, + (c1, c2): &(CompactString, Option), + version: &str, + cksum: &str, +) -> Result { + let template = Template::parse(dl_template)?; + if template.keys().next().is_some() { + let mut crate_prefix = c1.clone(); + if let Some(c2) = c2 { + crate_prefix.push('/'); + crate_prefix.push_str(c2); + } + + struct Context<'a> { + crate_name: &'a str, + crate_prefix: CompactString, + crate_lowerprefix: String, + version: &'a str, + cksum: &'a str, + } + impl Values for Context<'_> { + fn get_value(&self, key: &str) -> Option> { + match key { + "crate" => Some(Cow::Borrowed(self.crate_name)), + "version" => Some(Cow::Borrowed(self.version)), + "prefix" => Some(Cow::Borrowed(&self.crate_prefix)), + "lowerprefix" => Some(Cow::Borrowed(&self.crate_lowerprefix)), + "sha256-checksum" => Some(Cow::Borrowed(self.cksum)), + _ => None, + } + } + } + Ok(template.render(&Context { + crate_name, + crate_lowerprefix: crate_prefix.to_lowercase(), + crate_prefix, + version, + cksum, + })?) + } else { + Ok(format!("{dl_template}/{crate_name}/{version}/download")) + } +} + +#[derive(Deserialize)] +pub(super) struct RegistryIndexEntry { + vers: CompactString, + yanked: bool, + cksum: CompactString, +} + +pub(super) struct MatchedVersion { + pub(super) version: CompactString, + pub(super) cksum: CompactString, +} + +impl MatchedVersion { + pub(super) fn find( + it: &mut dyn Iterator>, + version_req: &VersionReq, + ) -> Result { + let mut ret = Option::<(Self, Version)>::None; + + for res in it { + let entry = res.map_err(RegistryError::from)?; + + if entry.yanked { + continue; + } + + let num = entry.vers; + + // Parse out version + let Ok(ver) = Version::parse(&num) else { continue }; + + // Filter by version match + if !version_req.matches(&ver) { + continue; + } + + let matched = Self { + version: num, + cksum: entry.cksum, + }; + + if let Some((_, max_ver)) = &ret { + if ver > *max_ver { + ret = Some((matched, ver)); + } + } else { + ret = Some((matched, ver)); + } + } + + ret.map(|(num, _)| num) + .ok_or_else(|| BinstallError::VersionMismatch { + req: version_req.clone(), + }) + } +} diff --git a/crates/binstalk/src/drivers/crates_io.rs b/crates/binstalk/src/drivers/registry/crates_io_registry.rs similarity index 55% rename from crates/binstalk/src/drivers/crates_io.rs rename to crates/binstalk/src/drivers/registry/crates_io_registry.rs index 441a44a1..b2fa25ec 100644 --- a/crates/binstalk/src/drivers/crates_io.rs +++ b/crates/binstalk/src/drivers/registry/crates_io_registry.rs @@ -1,31 +1,49 @@ -use std::path::PathBuf; - +use binstalk_downloader::remote::Error as RemoteError; use cargo_toml::Manifest; use compact_str::{CompactString, ToCompactString}; use semver::{Comparator, Op as ComparatorOp, Version as SemVersion, VersionReq}; use serde::Deserialize; +use tokio::{ + sync::Mutex, + time::{interval, Duration, Interval, MissedTickBehavior}, +}; use tracing::debug; use crate::{ - errors::{BinstallError, CratesIoApiError}, - helpers::{ - download::Download, - remote::{Client, Url}, - }, - manifests::cargo_toml_binstall::{Meta, TarBasedFmt}, - ops::CratesIoRateLimit, + drivers::registry::{parse_manifest, RegistryError}, + errors::BinstallError, + helpers::remote::{Client, Url}, + manifests::cargo_toml_binstall::Meta, }; -mod vfs; +#[derive(Debug)] +pub struct CratesIoRateLimit(Mutex); -mod visitor; -use visitor::ManifestVisitor; +impl Default for CratesIoRateLimit { + fn default() -> Self { + let mut interval = interval(Duration::from_secs(1)); + // If somehow one tick is delayed, then next tick should be at least + // 1s later than the current tick. + // + // Other MissedTickBehavior including Burst (default), which will + // tick as fast as possible to catch up, and Skip, which will + // skip the current tick for the next one. + // + // Both Burst and Skip is not the expected behavior for rate limit: + // ticking as fast as possible would violate crates.io crawler + // policy, and skipping the current one will slow down the resolution + // process. + interval.set_missed_tick_behavior(MissedTickBehavior::Delay); + Self(Mutex::new(interval)) + } +} -async fn is_crate_yanked( - client: &Client, - name: &str, - version: &str, -) -> Result { +impl CratesIoRateLimit { + pub(super) async fn tick(&self) { + self.0.lock().await.tick().await; + } +} +async fn is_crate_yanked(client: &Client, url: Url) -> Result { #[derive(Deserialize)] struct CrateInfo { version: Inner, @@ -39,29 +57,16 @@ async fn is_crate_yanked( // Fetch / update index debug!("Looking up crate information"); - let response = client - .get(Url::parse(&format!( - "https://crates.io/api/v1/crates/{name}/{version}" - ))?) - .send(true) - .await - .map_err(|err| { - BinstallError::CratesIoApi(Box::new(CratesIoApiError { - crate_name: name.into(), - err, - })) - })?; - - let info: CrateInfo = response.json().await?; + let info: CrateInfo = client.get(url).send(true).await?.json().await?; Ok(info.version.yanked) } async fn fetch_crate_cratesio_version_matched( client: &Client, - name: &str, + url: Url, version_req: &VersionReq, -) -> Result { +) -> Result, RemoteError> { #[derive(Deserialize)] struct CrateInfo { #[serde(rename = "crate")] @@ -87,22 +92,11 @@ async fn fetch_crate_cratesio_version_matched( // Fetch / update index debug!("Looking up crate information"); - let response = client - .get(Url::parse(&format!( - "https://crates.io/api/v1/crates/{name}" - ))?) - .send(true) - .await - .map_err(|err| { - BinstallError::CratesIoApi(Box::new(CratesIoApiError { - crate_name: name.into(), - err, - })) - })?; + let response = client.get(url).send(true).await?; let version = if version_req == &VersionReq::STAR { let crate_info: CrateInfo = response.json().await?; - crate_info.inner.max_stable_version + Some(crate_info.inner.max_stable_version) } else { let response: Versions = response.json().await?; response @@ -128,14 +122,9 @@ async fn fetch_crate_cratesio_version_matched( }) // Return highest version .max_by(|(_ver_str_x, ver_x), (_ver_str_y, ver_y)| ver_x.cmp(ver_y)) - .ok_or_else(|| BinstallError::VersionMismatch { - req: version_req.clone(), - })? - .0 + .map(|(ver_str, _)| ver_str) }; - debug!("Found information for crate version: '{version}'"); - Ok(version) } @@ -150,6 +139,8 @@ pub async fn fetch_crate_cratesio( // Wait until we can make another request to crates.io crates_io_rate_limit.tick().await; + let url = Url::parse(&format!("https://crates.io/api/v1/crates/{name}"))?; + let version = match version_req.comparators.as_slice() { [Comparator { op: ComparatorOp::Exact, @@ -167,29 +158,32 @@ pub async fn fetch_crate_cratesio( } .to_compact_string(); - if is_crate_yanked(&client, name, &version).await? { - return Err(BinstallError::VersionMismatch { - req: version_req.clone(), - }); - } + let mut url = url.clone(); + url.path_segments_mut().unwrap().push(&version); - version + is_crate_yanked(&client, url) + .await + .map(|yanked| (!yanked).then_some(version)) } - _ => fetch_crate_cratesio_version_matched(&client, name, version_req).await?, - }; + _ => fetch_crate_cratesio_version_matched(&client, url.clone(), version_req).await, + } + .map_err(|e| match e { + RemoteError::Http(e) if e.is_status() => RegistryError::NotFound(name.into()), + e => e.into(), + })? + .ok_or_else(|| BinstallError::VersionMismatch { + req: version_req.clone(), + })?; + + debug!("Found information for crate version: '{version}'"); // Download crate to temporary dir (crates.io or git?) - let crate_url = format!("https://crates.io/api/v1/crates/{name}/{version}/download"); + let mut crate_url = url; + crate_url + .path_segments_mut() + .unwrap() + .push(&version) + .push("download"); - debug!("Fetching crate from: {crate_url} and extracting Cargo.toml from it"); - - let manifest_dir_path: PathBuf = format!("{name}-{version}").into(); - - let mut manifest_visitor = ManifestVisitor::new(manifest_dir_path); - - Download::new(client, Url::parse(&crate_url)?) - .and_visit_tar(TarBasedFmt::Tgz, &mut manifest_visitor) - .await?; - - manifest_visitor.load_manifest() + parse_manifest(client, name, &version, crate_url).await } diff --git a/crates/binstalk/src/drivers/registry/git_registry.rs b/crates/binstalk/src/drivers/registry/git_registry.rs new file mode 100644 index 00000000..3922bbd0 --- /dev/null +++ b/crates/binstalk/src/drivers/registry/git_registry.rs @@ -0,0 +1,136 @@ +use std::{ + fs::File, + io::{self, BufReader, Read}, + path::PathBuf, + sync::Arc, +}; + +use cargo_toml::Manifest; +use compact_str::{CompactString, ToCompactString}; +use once_cell::sync::OnceCell; +use semver::VersionReq; +use serde_json::{from_slice as json_from_slice, Deserializer as JsonDeserializer}; +use tempfile::TempDir; +use tokio::task::spawn_blocking; +use url::Url; + +use crate::{ + drivers::registry::{ + crate_prefix_components, parse_manifest, render_dl_template, MatchedVersion, + RegistryConfig, RegistryError, + }, + errors::BinstallError, + helpers::{ + git::{GitUrl, Repository}, + remote::Client, + }, + manifests::cargo_toml_binstall::Meta, +}; + +#[derive(Debug)] +struct GitIndex { + path: TempDir, + dl_template: CompactString, +} + +impl GitIndex { + fn new(url: GitUrl) -> Result { + let tempdir = TempDir::new()?; + + Repository::shallow_clone(url, tempdir.as_ref())?; + + let mut v = Vec::with_capacity(100); + File::open(tempdir.as_ref().join("config.json"))?.read_to_end(&mut v)?; + + let config: RegistryConfig = json_from_slice(&v).map_err(RegistryError::from)?; + + Ok(Self { + path: tempdir, + dl_template: config.dl, + }) + } +} + +#[derive(Debug)] +struct GitRegistryInner { + url: GitUrl, + git_index: OnceCell, +} + +#[derive(Clone, Debug)] +pub struct GitRegistry(Arc); + +impl GitRegistry { + pub fn new(url: GitUrl) -> Self { + Self(Arc::new(GitRegistryInner { + url, + git_index: Default::default(), + })) + } + + /// WARNING: This is a blocking operation. + fn find_crate_matched_ver( + mut path: PathBuf, + crate_name: &str, + (c1, c2): &(CompactString, Option), + version_req: &VersionReq, + ) -> Result { + path.push(&**c1); + if let Some(c2) = c2 { + path.push(&**c2); + } + + path.push(&*crate_name.to_lowercase()); + + let f = File::open(path) + .map_err(|e| match e.kind() { + io::ErrorKind::NotFound => RegistryError::NotFound(crate_name.into()).into(), + _ => BinstallError::from(e), + }) + .map(BufReader::new)?; + + MatchedVersion::find( + &mut JsonDeserializer::from_reader(f).into_iter(), + version_req, + ) + } + + pub async fn fetch_crate_matched( + &self, + client: Client, + name: &str, + version_req: &VersionReq, + ) -> Result, BinstallError> { + let crate_prefix = crate_prefix_components(name)?; + let crate_name = name.to_compact_string(); + let version_req = version_req.clone(); + let this = self.clone(); + + let (version, dl_url) = spawn_blocking(move || { + let GitIndex { path, dl_template } = this + .0 + .git_index + .get_or_try_init(|| GitIndex::new(this.0.url.clone()))?; + + let MatchedVersion { version, cksum } = Self::find_crate_matched_ver( + path.as_ref().to_owned(), + &crate_name, + &crate_prefix, + &version_req, + )?; + + let url = Url::parse(&render_dl_template( + dl_template, + &crate_name, + &crate_prefix, + &version, + &cksum, + )?)?; + + Ok::<_, BinstallError>((version, url)) + }) + .await??; + + parse_manifest(client, name, &version, dl_url).await + } +} diff --git a/crates/binstalk/src/drivers/registry/sparse_registry.rs b/crates/binstalk/src/drivers/registry/sparse_registry.rs new file mode 100644 index 00000000..13acb057 --- /dev/null +++ b/crates/binstalk/src/drivers/registry/sparse_registry.rs @@ -0,0 +1,109 @@ +use cargo_toml::Manifest; +use compact_str::CompactString; +use semver::VersionReq; +use serde_json::Deserializer as JsonDeserializer; +use tokio::sync::OnceCell; +use url::Url; + +use crate::{ + drivers::registry::{ + crate_prefix_components, parse_manifest, render_dl_template, MatchedVersion, + RegistryConfig, RegistryError, + }, + errors::BinstallError, + helpers::remote::{Client, Error as RemoteError}, + manifests::cargo_toml_binstall::Meta, +}; + +#[derive(Debug)] +pub struct SparseRegistry { + url: Url, + dl_template: OnceCell, +} + +impl SparseRegistry { + /// * `url` - `url.cannot_be_a_base()` must be `false` + pub fn new(url: Url) -> Self { + Self { + url, + dl_template: Default::default(), + } + } + + async fn get_dl_template(&self, client: &Client) -> Result<&str, RegistryError> { + self.dl_template + .get_or_try_init(|| { + Box::pin(async { + let mut url = self.url.clone(); + url.path_segments_mut().unwrap().push("config.json"); + let config: RegistryConfig = client.get(url).send(true).await?.json().await?; + Ok(config.dl) + }) + }) + .await + .map(AsRef::as_ref) + } + + /// `url` must be a valid http(s) url. + async fn find_crate_matched_ver( + client: &Client, + mut url: Url, + crate_name: &str, + (c1, c2): &(CompactString, Option), + version_req: &VersionReq, + ) -> Result { + { + let mut path = url.path_segments_mut().unwrap(); + + path.push(c1); + if let Some(c2) = c2 { + path.push(c2); + } + + path.push(&crate_name.to_lowercase()); + } + + let body = client + .get(url) + .send(true) + .await + .map_err(|e| match e { + RemoteError::Http(e) if e.is_status() => RegistryError::NotFound(crate_name.into()), + e => e.into(), + })? + .bytes() + .await + .map_err(RegistryError::from)?; + MatchedVersion::find( + &mut JsonDeserializer::from_slice(&body).into_iter(), + version_req, + ) + } + + pub async fn fetch_crate_matched( + &self, + client: Client, + crate_name: &str, + version_req: &VersionReq, + ) -> Result, BinstallError> { + let crate_prefix = crate_prefix_components(crate_name)?; + let dl_template = self.get_dl_template(&client).await?; + let MatchedVersion { version, cksum } = Self::find_crate_matched_ver( + &client, + self.url.clone(), + crate_name, + &crate_prefix, + version_req, + ) + .await?; + let dl_url = Url::parse(&render_dl_template( + dl_template, + crate_name, + &crate_prefix, + &version, + &cksum, + )?)?; + + parse_manifest(client, crate_name, &version, dl_url).await + } +} diff --git a/crates/binstalk/src/drivers/crates_io/vfs.rs b/crates/binstalk/src/drivers/registry/vfs.rs similarity index 100% rename from crates/binstalk/src/drivers/crates_io/vfs.rs rename to crates/binstalk/src/drivers/registry/vfs.rs diff --git a/crates/binstalk/src/drivers/crates_io/visitor.rs b/crates/binstalk/src/drivers/registry/visitor.rs similarity index 100% rename from crates/binstalk/src/drivers/crates_io/visitor.rs rename to crates/binstalk/src/drivers/registry/visitor.rs diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index aa14d953..fa050304 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -15,15 +15,7 @@ use thiserror::Error; use tokio::task; use tracing::{error, warn}; -use crate::helpers::cargo_toml_workspace::LoadManifestFromWSError; - -#[derive(Debug, Error)] -#[error("crates.io API error for {crate_name}: {err}")] -pub struct CratesIoApiError { - pub crate_name: CompactString, - #[source] - pub err: RemoteError, -} +use crate::{drivers::RegistryError, helpers::cargo_toml_workspace::LoadManifestFromWSError}; #[derive(Debug, Error)] #[error("version string '{v}' is not semver: {err}")] @@ -145,15 +137,11 @@ pub enum BinstallError { /// /// This could either be a "not found" or a server/transport error. /// - /// - Code: `binstall::crates_io_api` + /// - Code: `binstall::cargo_registry` /// - Exit: 76 #[error(transparent)] - #[diagnostic( - severity(error), - code(binstall::crates_io_api), - help("Check that the crate name you provided is correct.\nYou can also search for a matching crate at: https://lib.rs/search?q={}", .0.crate_name) - )] - CratesIoApi(#[from] Box), + #[diagnostic(transparent)] + RegistryError(#[from] Box), /// The override path to the cargo manifest is invalid or cannot be resolved. /// @@ -360,7 +348,7 @@ impl BinstallError { Download(_) => 68, SubProcess { .. } => 70, Io(_) => 74, - CratesIoApi { .. } => 76, + RegistryError { .. } => 76, CargoManifestPath => 77, CargoManifest { .. } => 78, VersionParse { .. } => 80, @@ -479,3 +467,9 @@ impl From for BinstallError { BinstallError::TargetTripleParseError(Box::new(e)) } } + +impl From for BinstallError { + fn from(e: RegistryError) -> Self { + BinstallError::RegistryError(Box::new(e)) + } +} diff --git a/crates/binstalk/src/helpers/git.rs b/crates/binstalk/src/helpers/git.rs index 1509182f..f4ebb85b 100644 --- a/crates/binstalk/src/helpers/git.rs +++ b/crates/binstalk/src/helpers/git.rs @@ -8,6 +8,8 @@ use tracing::debug; mod progress_tracing; use progress_tracing::TracingProgress; +pub use gix::url::parse::Error as GitUrlParseError; + #[derive(Debug, ThisError)] #[non_exhaustive] pub enum GitError { @@ -43,7 +45,7 @@ impl From for GitError { pub struct GitUrl(Url); impl FromStr for GitUrl { - type Err = gix::url::parse::Error; + type Err = GitUrlParseError; fn from_str(s: &str) -> Result { Url::try_from(s).map(Self) diff --git a/crates/binstalk/src/helpers/remote.rs b/crates/binstalk/src/helpers/remote.rs index b03a9c3c..e794c744 100644 --- a/crates/binstalk/src/helpers/remote.rs +++ b/crates/binstalk/src/helpers/remote.rs @@ -1,4 +1,5 @@ pub use binstalk_downloader::remote::*; +pub use url::ParseError as UrlParseError; use binstalk_downloader::gh_api_client::{GhApiClient, GhReleaseArtifact, HasReleaseArtifact}; use tracing::{debug, warn}; diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index 382d3fc5..c28ee280 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -3,12 +3,9 @@ use std::{path::PathBuf, sync::Arc}; use semver::VersionReq; -use tokio::{ - sync::Mutex, - time::{interval, Duration, Interval, MissedTickBehavior}, -}; use crate::{ + drivers::Registry, fetchers::{Data, Fetcher, TargetData}, helpers::{ self, gh_api_client::GhApiClient, jobserver_client::LazyJobserverClient, remote::Client, @@ -51,32 +48,5 @@ pub struct Options { pub client: Client, pub gh_api_client: GhApiClient, pub jobserver_client: LazyJobserverClient, - pub crates_io_rate_limit: CratesIoRateLimit, -} - -pub struct CratesIoRateLimit(Mutex); - -impl Default for CratesIoRateLimit { - fn default() -> Self { - let mut interval = interval(Duration::from_secs(1)); - // If somehow one tick is delayed, then next tick should be at least - // 1s later than the current tick. - // - // Other MissedTickBehavior including Burst (default), which will - // tick as fast as possible to catch up, and Skip, which will - // skip the current tick for the next one. - // - // Both Burst and Skip is not the expected behavior for rate limit: - // ticking as fast as possible would violate crates.io crawler - // policy, and skipping the current one will slow down the resolution - // process. - interval.set_missed_tick_behavior(MissedTickBehavior::Delay); - Self(Mutex::new(interval)) - } -} - -impl CratesIoRateLimit { - pub(super) async fn tick(&self) { - self.0.lock().await.tick().await; - } + pub registry: Registry, } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 6bc87ad2..47b1d359 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -19,7 +19,6 @@ use tracing::{debug, info, instrument, warn}; use crate::{ bins, - drivers::fetch_crate_cratesio, errors::{BinstallError, VersionParseError}, fetchers::{Data, Fetcher, TargetData}, helpers::{self, download::ExtractedFiles, remote::Client, target_triple::TargetTriple}, @@ -379,12 +378,10 @@ impl PackageInfo { .await?? } None => { - Box::pin(fetch_crate_cratesio( - client, - &name, - version_req, - &opts.crates_io_rate_limit, - )) + Box::pin( + opts.registry + .fetch_crate_matched(client, &name, version_req), + ) .await? } }; From f2f0cd2de63070b96f8cd468ceb7bd309f6f8fc3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 7 Jul 2023 14:16:44 +1000 Subject: [PATCH 1356/2020] dep: Upgrade transitive dependencies (#1191) Co-authored-by: github-actions --- Cargo.lock | 299 ++++++++++++++++++++++------------------------------- 1 file changed, 124 insertions(+), 175 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 63ce28c1..c4420933 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -100,7 +100,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" dependencies = [ - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -110,7 +110,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -162,13 +162,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.68" +version = "0.1.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ccdd8f2a161be9bd5c023df56f1b2a0bd1d83872ae53b71a84a12c9bf6e842" +checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.23", ] [[package]] @@ -402,12 +402,11 @@ dependencies = [ [[package]] name = "bstr" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a246e68bb43f6cd9db24bea052a53e40405417c5fb372e3d1a8a7f770a564ef5" +checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" dependencies = [ "memchr", - "once_cell", "regex-automata", "serde", ] @@ -531,9 +530,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.10" +version = "4.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "384e169cc618c613d5e3ca6404dda77a8685a63e08660dcc64abaf7da7cb0c7a" +checksum = "1640e5cc7fb47dbb8338fd471b105e7ed6c3cb2aeb00c2e067127ffd3764a05d" dependencies = [ "clap_builder", "clap_derive", @@ -542,9 +541,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.10" +version = "4.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef137bbe35aab78bdb468ccfba75a5f4d8321ae011d34063770780545176af2d" +checksum = "98c59138d527eeaf9b53f35a77fcc1fad9d883116070c63d5de1c7dc7b00c72b" dependencies = [ "anstream", "anstyle", @@ -561,7 +560,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.23", ] [[package]] @@ -733,7 +732,7 @@ dependencies = [ "guess_host_triple", "tokio", "windows-dll", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -771,7 +770,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -788,9 +787,9 @@ checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "embed-resource" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80663502655af01a2902dff3f06869330782267924bf1788410b74edcd93770a" +checksum = "f7f1e82a60222fc67bfd50d752a9c89da5cce4c39ed39decc84a443b07bbd69a" dependencies = [ "cc", "rustc_version", @@ -845,7 +844,7 @@ checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" dependencies = [ "errno-dragonfly", "libc", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -888,7 +887,7 @@ dependencies = [ "cfg-if", "libc", "redox_syscall 0.2.16", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -941,12 +940,12 @@ dependencies = [ [[package]] name = "fs4" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7672706608ecb74ab2e055c68327ffc25ae4cac1e12349204fd5fb0f3487cce2" +checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" dependencies = [ - "rustix 0.37.21", - "windows-sys 0.48.0", + "rustix 0.38.3", + "windows-sys", ] [[package]] @@ -988,7 +987,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.23", ] [[package]] @@ -1514,7 +1513,7 @@ dependencies = [ "gix-command", "gix-config-value", "parking_lot", - "rustix 0.37.21", + "rustix 0.37.23", "thiserror", ] @@ -1794,9 +1793,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" [[package]] name = "hex" @@ -1810,7 +1809,7 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" dependencies = [ - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -1890,13 +1889,14 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0646026eb1b3eea4cd9ba47912ea5ce9cc07713d105b1a14698f4e6433d348b7" +checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" dependencies = [ + "futures-util", "http", "hyper", - "rustls 0.21.2", + "rustls 0.21.3", "tokio", "tokio-rustls 0.24.1", ] @@ -1992,7 +1992,7 @@ checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ "hermit-abi", "libc", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -2003,7 +2003,7 @@ checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ "socket2 0.5.3", "widestring", - "windows-sys 0.48.0", + "windows-sys", "winreg 0.50.0", ] @@ -2015,13 +2015,13 @@ checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" [[package]] name = "is-terminal" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24fddda5af7e54bf7da53067d6e802dbcc381d0a8eef629df528e3ebf68755cb" +checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi", - "rustix 0.38.1", - "windows-sys 0.48.0", + "rustix 0.38.3", + "windows-sys", ] [[package]] @@ -2041,9 +2041,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" [[package]] name = "jobserver" @@ -2065,7 +2065,7 @@ dependencies = [ "libc", "scopeguard", "tokio", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -2118,7 +2118,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.23", ] [[package]] @@ -2286,7 +2286,7 @@ checksum = "4901771e1d44ddb37964565c654a3223ba41a594d02b8da471cc4464912b5cfa" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.23", ] [[package]] @@ -2327,7 +2327,7 @@ checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" dependencies = [ "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -2450,7 +2450,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.23", ] [[package]] @@ -2520,29 +2520,29 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pin-project" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e138fdd8263907a2b0e1b4e80b7e58c721126479b6e6eedfb1b402acea7b9bd" +checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1fef411b303e3e12d534fb6e7852de82da56edd937d895125821fb7c09436c7" +checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.23", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" [[package]] name = "pin-utils" @@ -2742,26 +2742,32 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.4" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0ab3ca65655bb1e41f2a8c8cd662eb4fb035e67c3f78da1d61dffe89d07300f" +checksum = "89089e897c013b3deb627116ae56a6955a72b8bed395c9526af31c9fe528b484" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa250384981ea14565685dea16a9ccc4d1c541a13f82b9c168572264d1df8c56" dependencies = [ "aho-corasick", "memchr", "regex-syntax", ] -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" - [[package]] name = "regex-syntax" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "436b050e76ed2903236f032a59761c1eb99e1b0aead2c257922771dab1fc8c78" +checksum = "2ab07dc67230e4a4718e70fd5c20055a4334b121f1f9db8fe63ef39ce9b8c846" [[package]] name = "reqwest" @@ -2789,7 +2795,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.2", + "rustls 0.21.3", "rustls-pemfile 1.0.3", "serde", "serde_json", @@ -2851,29 +2857,29 @@ dependencies = [ [[package]] name = "rustix" -version = "0.37.21" +version = "0.37.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25693a73057a1b4cb56179dd3c7ea21a7c6c5ee7d85781f5749b46f34b79c" +checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" dependencies = [ "bitflags 1.3.2", "errno 0.3.1", "io-lifetimes", "libc", "linux-raw-sys 0.3.8", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] name = "rustix" -version = "0.38.1" +version = "0.38.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc6396159432b5c8490d4e301d8c705f61860b8b6c863bf79942ce5401968f3" +checksum = "ac5ffa1efe7548069688cd7028f32591853cd7b5b756d41bcffd2353e4fc75b4" dependencies = [ "bitflags 2.3.3", "errno 0.3.1", "libc", "linux-raw-sys 0.4.3", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -2890,9 +2896,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.2" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e32ca28af694bc1bbf399c33a516dbdf1c90090b8ab23c2bc24f834aa2247f5f" +checksum = "b19faa85ecb5197342b54f987b142fb3e30d0c90da40f80ef4fa9a726e6676ed" dependencies = [ "log", "ring", @@ -2932,9 +2938,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.100.1" +version = "0.101.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6207cd5ed3d8dca7816f8f3725513a34609c0c765bf652b8c3cb4cfd87db46b" +checksum = "15f36a6828982f422756984e47912a7a51dcbc2a197aa791158f8ca61cd8204e" dependencies = [ "ring", "untrusted", @@ -2942,15 +2948,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f3208ce4d8448b3f3e7d168a73f5e0c43a61e32930de3bceeccedb388b6bf06" +checksum = "dc31bd9b61a32c31f9650d18add92aa83a49ba979c143eefd27fe7177b05bd5f" [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" [[package]] name = "same-file" @@ -2963,11 +2969,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713cfb06c7059f3588fb8044c0fad1d09e3c01d225e25b9220dbfdcf16dbb1b3" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys 0.42.0", + "windows-sys", ] [[package]] @@ -3020,9 +3026,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.164" +version = "1.0.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8c8cf938e98f769bc164923b06dce91cea1751522f46f8466461af04c9027d" +checksum = "7daf513456463b42aa1d94cff7e0c24d682b429f020b9afa4f5ba5c40a22b237" dependencies = [ "serde_derive", ] @@ -3038,20 +3044,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.164" +version = "1.0.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9735b638ccc51c28bf6914d90a2e9725b377144fc612c49a611fddd1b631d68" +checksum = "b69b106b68bc8054f0e974e70d19984040f8a5cf9215ca82626ea4853f82c4b9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.23", ] [[package]] name = "serde_json" -version = "1.0.99" +version = "1.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46266871c240a00b8f503b877622fe33430b3c7d963bdc0f2adc511e54a1eae3" +checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" dependencies = [ "itoa", "ryu", @@ -3137,9 +3143,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" [[package]] name = "smawk" @@ -3164,7 +3170,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -3193,15 +3199,15 @@ checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" [[package]] name = "strum_macros" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9f3bd7d2e45dcc5e265fbb88d6513e4747d8ef9444cf01a533119bce28a157" +checksum = "6069ca09d878a33f883cc06aaa9718ede171841d3832450354410b718b097232" dependencies = [ "heck", "proc-macro2", "quote", "rustversion", - "syn 2.0.22", + "syn 2.0.23", ] [[package]] @@ -3245,9 +3251,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.22" +version = "2.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2efbeae7acf4eabd6bcdcbd11c92f45231ddda7539edc7806bd1a04a03b24616" +checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" dependencies = [ "proc-macro2", "quote", @@ -3270,8 +3276,8 @@ dependencies = [ "cfg-if", "fastrand 1.9.0", "redox_syscall 0.3.5", - "rustix 0.37.21", - "windows-sys 0.48.0", + "rustix 0.37.23", + "windows-sys", ] [[package]] @@ -3297,22 +3303,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.23", ] [[package]] @@ -3386,7 +3392,7 @@ dependencies = [ "signal-hook-registry", "socket2 0.4.9", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] @@ -3397,7 +3403,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.23", ] [[package]] @@ -3427,7 +3433,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.2", + "rustls 0.21.3", "tokio", ] @@ -3474,9 +3480,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebafdf5ad1220cb59e7d17cf4d2c72015297b75b19a10472f99b89225089240" +checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" dependencies = [ "serde", "serde_spanned", @@ -3495,9 +3501,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.11" +version = "0.19.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266f016b7f039eec8a1a80dfe6156b633d208b9fccca5e4db1d6775b0c4e34a7" +checksum = "c500344a19072298cd05a7224b3c0c629348b78692bf48466c5238656e315a78" dependencies = [ "indexmap 2.0.0", "serde", @@ -3556,7 +3562,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.23", ] [[package]] @@ -3701,9 +3707,9 @@ checksum = "98e90c70c9f0d4d1ee6d0a7d04aa06cb9bbd53d8cfbdd62a0269a7c2eb640552" [[package]] name = "unicode-ident" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0" +checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" [[package]] name = "unicode-linebreak" @@ -3844,7 +3850,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.23", "wasm-bindgen-shared", ] @@ -3878,7 +3884,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.22", + "syn 2.0.23", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4014,21 +4020,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "windows-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -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", -] - [[package]] name = "windows-sys" version = "0.48.0" @@ -4044,21 +4035,15 @@ version = "0.48.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_gnullvm", "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_gnullvm", "windows_x86_64_msvc 0.48.0", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.0" @@ -4071,12 +4056,6 @@ version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db3bc5134e8ce0da5d64dcec3529793f1d33aee5a51fc2b4662e0f881dd463e6" -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" - [[package]] name = "windows_aarch64_msvc" version = "0.48.0" @@ -4089,12 +4068,6 @@ version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0343a6f35bf43a07b009b8591b78b10ea03de86b06f48e28c96206cd0f453b50" -[[package]] -name = "windows_i686_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" - [[package]] name = "windows_i686_gnu" version = "0.48.0" @@ -4107,12 +4080,6 @@ version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1acdcbf4ca63d8e7a501be86fee744347186275ec2754d129ddeab7a1e3a02e4" -[[package]] -name = "windows_i686_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" - [[package]] name = "windows_i686_msvc" version = "0.48.0" @@ -4125,24 +4092,12 @@ version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "893c0924c5a990ec73cd2264d1c0cba1773a929e1a3f5dbccffd769f8c4edebb" -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" - [[package]] name = "windows_x86_64_gnu" version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.0" @@ -4155,12 +4110,6 @@ version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a29bd61f32889c822c99a8fdf2e93378bd2fae4d7efd2693fab09fcaaf7eff4b" -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" - [[package]] name = "windows_x86_64_msvc" version = "0.48.0" @@ -4169,9 +4118,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0ace3845f0d96209f0375e6d367e3eb87eb65d27d445bdc9f1843a26f39448" +checksum = "a9482fe6ceabdf32f3966bfdd350ba69256a97c30253dc616fe0005af24f164e" dependencies = [ "memchr", ] @@ -4202,7 +4151,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ "cfg-if", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] From 0813e804389fe4b25e955e5aa001b0af84abbd75 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 7 Jul 2023 17:24:05 +1000 Subject: [PATCH 1357/2020] Fix GPL-3.0 license identifier (#1192) Fixed #1189 Signed-off-by: Jiahao XU --- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 2c75727c..d2ed63dc 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -7,7 +7,7 @@ version = "1.0.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" -license = "GPL-3.0" +license = "GPL-3.0-only" readme = "../../README.md" # These MUST remain even if they're not needed in recent versions because diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index d55fa9ac..852d0229 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -7,7 +7,7 @@ version = "0.13.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" -license = "GPL-3.0" +license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" From c4b6921314c10d8747078b729812e61d94af43fb Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 9 Jul 2023 20:39:18 +1000 Subject: [PATCH 1358/2020] fix `binstalk_downloader::GhApiClient` json deser error (#1193) When installing `cargo-expand` v1.0.59, I got an error message: ``` Failed to parse http response body as Json: invalid type: null, expected a string at line 1 column 90 ``` This is because `GraphQLPageInfo::end_cursor` can actually be `null`, so I change its type to `Option`. Signed-off-by: Jiahao XU --- .../src/gh_api_client/request.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/crates/binstalk-downloader/src/gh_api_client/request.rs b/crates/binstalk-downloader/src/gh_api_client/request.rs index 2289566c..59e0d140 100644 --- a/crates/binstalk-downloader/src/gh_api_client/request.rs +++ b/crates/binstalk-downloader/src/gh_api_client/request.rs @@ -289,7 +289,7 @@ struct GraphQLReleaseAssets { #[derive(Deserialize)] struct GraphQLPageInfo { #[serde(rename = "endCursor")] - end_cursor: CompactString, + end_cursor: Option, #[serde(rename = "hasNextPage")] has_next_page: bool, } @@ -376,11 +376,14 @@ query {{ if let Some(assets) = assets { artifacts.assets.extend(assets.nodes); - let page_info = assets.page_info; - if !page_info.has_next_page { - break Ok(FetchReleaseRet::Artifacts(artifacts)); - } else { - cond = FilterCondition::After(page_info.end_cursor); + match assets.page_info { + GraphQLPageInfo { + end_cursor: Some(end_cursor), + has_next_page: true, + } => { + cond = FilterCondition::After(end_cursor); + } + _ => break Ok(FetchReleaseRet::Artifacts(artifacts)), } } else { break Ok(FetchReleaseRet::ReleaseNotFound); From d280e122ca09163ce0a79b5190cd4414c350bba0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 9 Jul 2023 22:06:04 +1000 Subject: [PATCH 1359/2020] Speedup prebuilt binary (#1188) After the merge of #1184, CI now takes 11m just to shallow clone crates.io git index, which means that our user using alternative git index would also be quite slow. This commit speeds it up by building all dependencies with `-O3` in dev and release build, in release build we build everything with `-O3`. Signed-off-by: Jiahao XU --- Cargo.toml | 23 ++++++++++++++++++++--- justfile | 9 +++++---- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 677752a3..f194f831 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,12 +14,15 @@ members = [ ] [profile.release] -opt-level = "z" +opt-level = 3 lto = true codegen-units = 1 panic = "abort" strip = "symbols" +[profile.release.build-override] +inherits = "dev.build-override" + [profile.dev] opt-level = 0 debug = true @@ -28,6 +31,10 @@ debug-assertions = true overflow-checks = true codegen-units = 1024 +# Set the default for dependencies on debug. +[profile.dev.package."*"] +opt-level = 3 + [profile.dev.build-override] inherits = "dev" debug = false @@ -35,5 +42,15 @@ debug-assertions = false overflow-checks = false incremental = false -[profile.release.build-override] -inherits = "dev.build-override" +[profile.check-only] +inherits = "dev" +debug = false +debug-assertions = false +overflow-checks = false +panic = "abort" + +[profile.check-only.build-override] +inherits = "check-only" + +[profile.check-only.package."*"] +inherits = "check-only" diff --git a/justfile b/justfile index 4afb5687..17b9a51a 100644 --- a/justfile +++ b/justfile @@ -181,13 +181,14 @@ build: print-env {{cargo-bin}} build {{cargo-build-args}} check: print-env - {{cargo-bin}} check {{cargo-build-args}} - cargo-hack hack check --feature-powerset -p leon {{cargo-check-args}} - {{cargo-bin}} check -p binstalk-downloader --no-default-features - {{cargo-bin}} check -p cargo-binstall --no-default-features --features rustls {{cargo-check-args}} + {{cargo-bin}} check {{cargo-build-args}} --profile check-only + cargo-hack hack check --feature-powerset -p leon {{cargo-check-args}} --profile check-only + {{cargo-bin}} check -p binstalk-downloader --no-default-features --profile check-only + {{cargo-bin}} check -p cargo-binstall --no-default-features --features rustls {{cargo-check-args}} --profile check-only cargo-hack hack check -p binstalk-downloader \ --feature-powerset \ --include-features default,json,gh-api-client \ + --profile check-only \ {{cargo-check-args}} get-output file outdir=".": From 7dea40a99a79c843b153b6a4d8efad1f71c71ef4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 10 Jul 2023 13:37:41 +1000 Subject: [PATCH 1360/2020] Support `--registry` and more options from `.cargo/config.toml` (#1195) Fixed #885 Now we can take advantage of new argument `--registry` and env overrides: - `CARGO_REGISTRIES_DEFAULT` if `--registry` is not specified - `CARGO_REGISTRIES_{registry_name}_INDEX` for the registry index url We can also read from `.cargo/config.toml` for: - default registry and registries configurations - additional CA bundle `http.cainfo` Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 32 +++- crates/bin/src/entry.rs | 62 ++++++-- crates/bin/src/install_path.rs | 29 ++-- crates/binstalk-manifests/src/cargo_config.rs | 143 ++++++++++++++---- crates/binstalk/src/errors.rs | 29 +++- e2e-tests/registries.sh | 62 ++++++++ justfile | 3 +- 7 files changed, 297 insertions(+), 63 deletions(-) create mode 100644 e2e-tests/registries.sh diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 1f9f40b8..74584025 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -223,10 +223,28 @@ pub struct Args { #[clap(help_heading = "Options", long, alias = "roots")] pub root: Option, - /// The URL of the registry index to use + /// The URL of the registry index to use. + /// + /// Cannot be used with `--registry`. #[clap(help_heading = "Options", long)] pub index: Option, + /// Name of the registry to use. Registry names are defined in Cargo config + /// files . + /// + /// If not specified in cmdline or via environment variable, the default + /// registry is used, which is defined by the + /// `registry.default` config key in `.cargo/config.toml` which defaults + /// to crates-io. + /// + /// If it is set, then it will try to read environment variable + /// `CARGO_REGISTRIES_{registry_name}_INDEX` for index url and fallback to + /// reading from `registries..index`. + /// + /// Cannot be used with `--index`. + #[clap(help_heading = "Options", long, env = "CARGO_REGISTRY_DEFAULT")] + pub registry: Option, + /// This option will be passed through to all `cargo-install` invocations. /// /// It will require `Cargo.lock` to be up to date. @@ -421,6 +439,18 @@ You cannot use --manifest-path and --git. Do one or the other."# .exit(); } + if opts.index.is_some() && opts.registry.is_some() { + command + .error( + ErrorKind::ArgumentConflict, + format_args!( + r#"Multiple override options for registry. +You cannot use --index and --registry. Do one or the other."# + ), + ) + .exit(); + } + if opts.crate_names.len() > 1 { let option = if opts.version_req.is_some() { "version" diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 3ffa7026..4fa03672 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -1,4 +1,5 @@ use std::{ + borrow::Cow, env, fs, future::Future, path::{Path, PathBuf}, @@ -16,12 +17,14 @@ use binstalk::{ remote::{Certificate, Client}, tasks::AutoAbortJoinHandle, }, + home::cargo_home, ops::{ self, resolve::{CrateName, Resolution, ResolutionFetch, VersionReqExt}, CargoTomlFetchOverride, Options, Resolver, }, }; +use binstalk_manifests::cargo_config::Config; use binstalk_manifests::cargo_toml_binstall::PkgOverride; use file_format::FileFormat; use log::LevelFilter; @@ -56,10 +59,19 @@ pub fn install_crates( }) .collect(); + // Load .cargo/config.toml + let cargo_home = cargo_home().map_err(BinstallError::from)?; + let mut config = Config::load_from_path(cargo_home.join("config.toml"))?; + // Compute paths let cargo_root = args.root; - let (install_path, mut manifests, temp_dir) = - compute_paths_and_load_manifests(cargo_root.clone(), args.install_path, args.no_track)?; + let (install_path, mut manifests, temp_dir) = compute_paths_and_load_manifests( + cargo_root.clone(), + args.install_path, + args.no_track, + cargo_home, + &mut config, + )?; // Remove installed crates let mut crate_names = @@ -83,12 +95,17 @@ pub fn install_crates( // Initialize reqwest client let rate_limit = args.rate_limit; + let mut http = config.http.take(); + let client = Client::new( concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), args.min_tls_version.map(|v| v.into()), Duration::from_millis(rate_limit.duration.get()), rate_limit.request_count, - read_root_certs(args.root_certificates), + read_root_certs( + args.root_certificates, + http.as_mut().and_then(|http| http.cainfo.take()), + ), ) .map_err(BinstallError::from)?; @@ -127,7 +144,27 @@ pub fn install_crates( client, gh_api_client, jobserver_client, - registry: args.index.unwrap_or_default(), + registry: if let Some(index) = args.index { + index + } else if let Some(registry_name) = args + .registry + .or_else(|| config.registry.map(|registry| registry.default)) + { + env::var(format!("CARGO_REGISTRIES_{registry_name}_INDEX")) + .map(Cow::Owned) + .or_else(|_| { + config + .registries + .as_ref() + .and_then(|registries| registries.get(®istry_name)) + .map(|registry| Cow::Borrowed(registry.index.as_str())) + .ok_or_else(|| BinstallError::UnknownRegistryName(registry_name)) + })? + .parse() + .map_err(BinstallError::from)? + } else { + Default::default() + }, }); // Destruct args before any async function to reduce size of the future @@ -225,9 +262,13 @@ fn do_read_root_cert(path: &Path) -> Result, BinstallError> open_cert(&buffer).map_err(From::from).map(Some) } -fn read_root_certs(root_certificate_paths: Vec) -> impl Iterator { +fn read_root_certs( + root_certificate_paths: Vec, + config_cainfo: Option, +) -> impl Iterator { root_certificate_paths .into_iter() + .chain(config_cainfo) .filter_map(|path| match do_read_root_cert(&path) { Ok(optional_cert) => optional_cert, Err(err) => { @@ -245,12 +286,15 @@ fn compute_paths_and_load_manifests( roots: Option, install_path: Option, no_track: bool, + cargo_home: PathBuf, + config: &mut Config, ) -> Result<(PathBuf, Option, tempfile::TempDir)> { // Compute cargo_roots - let cargo_roots = install_path::get_cargo_roots_path(roots).ok_or_else(|| { - error!("No viable cargo roots path found of specified, try `--roots`"); - miette!("No cargo roots path found or specified") - })?; + let cargo_roots = + install_path::get_cargo_roots_path(roots, cargo_home, config).ok_or_else(|| { + error!("No viable cargo roots path found of specified, try `--roots`"); + miette!("No cargo roots path found or specified") + })?; // Compute install directory let (install_path, custom_install_path) = diff --git a/crates/bin/src/install_path.rs b/crates/bin/src/install_path.rs index f37313fc..b5dea041 100644 --- a/crates/bin/src/install_path.rs +++ b/crates/bin/src/install_path.rs @@ -3,11 +3,14 @@ use std::{ path::{Path, PathBuf}, }; -use binstalk::home::cargo_home; use binstalk_manifests::cargo_config::Config; use tracing::debug; -pub fn get_cargo_roots_path(cargo_roots: Option) -> Option { +pub fn get_cargo_roots_path( + cargo_roots: Option, + cargo_home: PathBuf, + config: &mut Config, +) -> Option { if let Some(p) = cargo_roots { Some(p) } else if let Some(p) = var_os("CARGO_INSTALL_ROOT") { @@ -15,24 +18,12 @@ pub fn get_cargo_roots_path(cargo_roots: Option) -> Option { let p = PathBuf::from(p); debug!("using CARGO_INSTALL_ROOT ({})", p.display()); Some(p) - } else if let Ok(cargo_home) = cargo_home() { - let config_path = cargo_home.join("config.toml"); - if let Some(root) = Config::load_from_path(&config_path) - .ok() - .and_then(|config| config.install.root) - { - debug!( - "using `install.root` {} from config {}", - root.display(), - config_path.display() - ); - Some(root) - } else { - debug!("using ({}) as cargo home", cargo_home.display()); - Some(cargo_home) - } + } else if let Some(root) = config.install.take().and_then(|install| install.root) { + debug!("using `install.root` {} from cargo config", root.display()); + Some(root) } else { - None + debug!("using ({}) as cargo home", cargo_home.display()); + Some(cargo_home) } } diff --git a/crates/binstalk-manifests/src/cargo_config.rs b/crates/binstalk-manifests/src/cargo_config.rs index f84b1887..195650eb 100644 --- a/crates/binstalk-manifests/src/cargo_config.rs +++ b/crates/binstalk-manifests/src/cargo_config.rs @@ -5,6 +5,8 @@ //! Binstall reads from them to be compatible with `cargo-install`'s behavior. use std::{ + borrow::Cow, + collections::BTreeMap, fs::File, io, path::{Path, PathBuf}, @@ -17,39 +19,57 @@ use miette::Diagnostic; use serde::Deserialize; use thiserror::Error; -#[derive(Debug, Default, Deserialize)] +#[derive(Debug, Deserialize)] pub struct Install { /// `cargo install` destination directory pub root: Option, } -#[derive(Debug, Default, Deserialize)] +#[derive(Debug, Deserialize)] pub struct Http { /// HTTP proxy in libcurl format: "host:port" + /// + /// env: CARGO_HTTP_PROXY or HTTPS_PROXY or https_proxy or http_proxy pub proxy: Option, /// timeout for each HTTP request, in seconds + /// + /// env: CARGO_HTTP_TIMEOUT or HTTP_TIMEOUT pub timeout: Option, /// path to Certificate Authority (CA) bundle pub cainfo: Option, - // TODO: - // Support field ssl-version, ssl-version.max, ssl-version.min, - // which needs `toml_edit::Item`. +} + +#[derive(Eq, PartialEq, Debug, Deserialize)] +#[serde(untagged)] +pub enum Env { + Value(CompactString), + WithOptions { + value: CompactString, + force: Option, + relative: Option, + }, +} + +#[derive(Debug, Deserialize)] +pub struct Registry { + pub index: CompactString, +} + +#[derive(Debug, Deserialize)] +pub struct DefaultRegistry { + pub default: CompactString, } #[derive(Debug, Default, Deserialize)] pub struct Config { - pub install: Install, - pub http: Http, - // TODO: - // Add support for section patch, source and registry for alternative - // crates.io registry. - - // TODO: - // Add field env for specifying env vars - // which needs `toml_edit::Item`. + pub install: Option, + pub http: Option, + pub env: Option>, + pub registries: Option>, + pub registry: Option, } -fn join_if_relative(path: &mut Option, dir: &Path) { +fn join_if_relative(path: Option<&mut PathBuf>, dir: &Path) { match path { Some(path) if path.is_relative() => *path = dir.join(&path), _ => (), @@ -81,8 +101,32 @@ impl Config { Ok(Default::default()) } else { let mut config: Config = toml_edit::de::from_slice(&vec)?; - join_if_relative(&mut config.install.root, dir); - join_if_relative(&mut config.http.cainfo, dir); + join_if_relative( + config + .install + .as_mut() + .and_then(|install| install.root.as_mut()), + dir, + ); + join_if_relative( + config.http.as_mut().and_then(|http| http.cainfo.as_mut()), + dir, + ); + if let Some(envs) = config.env.as_mut() { + for env in envs.values_mut() { + if let Env::WithOptions { + value, + relative: Some(true), + .. + } = env + { + let path = Cow::Borrowed(Path::new(&value)); + if path.is_relative() { + *value = dir.join(&path).to_string_lossy().into(); + } + } + } + } Ok(config) } } @@ -91,10 +135,19 @@ impl Config { } pub fn load_from_path(path: impl AsRef) -> Result { - let path = path.as_ref(); - let file = FileLock::new_shared(File::open(path)?)?; - // Any regular file must have a parent dir - Self::load_from_reader(file, path.parent().unwrap()) + fn inner(path: &Path) -> Result { + match File::open(path) { + Ok(file) => { + let file = FileLock::new_shared(file)?; + // Any regular file must have a parent dir + Config::load_from_reader(file, path.parent().unwrap()) + } + Err(err) if err.kind() == io::ErrorKind::NotFound => Ok(Default::default()), + Err(err) => Err(err.into()), + } + } + + inner(path.as_ref()) } } @@ -114,11 +167,19 @@ impl From for ConfigLoadError { } } +impl From for ConfigLoadError { + fn from(e: toml_edit::TomlError) -> Self { + ConfigLoadError::TomlParse(Box::new(e.into())) + } +} + #[cfg(test)] mod tests { use super::*; - use std::io::Cursor; + use std::{io::Cursor, path::MAIN_SEPARATOR}; + + use compact_str::format_compact; const CONFIG: &str = r#" [env] @@ -127,7 +188,7 @@ ENV_VAR_NAME = "value" # Set even if already present in environment ENV_VAR_NAME_2 = { value = "value", force = true } # Value is relative to .cargo directory containing `config.toml`, make absolute -ENV_VAR_NAME_3 = { value = "relative/path", relative = true } +ENV_VAR_NAME_3 = { value = "relative-path", relative = true } [http] debug = false # HTTP debugging @@ -141,21 +202,39 @@ root = "/some/path" # `cargo install` destination directory #[test] fn test_loading() { - let config = Config::load_from_reader(Cursor::new(&CONFIG), Path::new("/root")).unwrap(); + let config = Config::load_from_reader(Cursor::new(&CONFIG), Path::new("root")).unwrap(); assert_eq!( - config.install.root.as_deref().unwrap(), + config.install.unwrap().root.as_deref().unwrap(), Path::new("/some/path") ); - assert_eq!( - config.http.proxy, - Some(CompactString::new_inline("host:port")) - ); - assert_eq!(config.http.timeout, Some(30)); + let http = config.http.unwrap(); + assert_eq!(http.proxy.unwrap(), CompactString::new_inline("host:port")); + assert_eq!(http.timeout.unwrap(), 30); + assert_eq!(http.cainfo.unwrap(), Path::new("root").join("cert.pem")); + + let env = config.env.unwrap(); + assert_eq!(env.len(), 3); assert_eq!( - config.http.cainfo.as_deref().unwrap(), - Path::new("/root/cert.pem") + env.get("ENV_VAR_NAME").unwrap(), + &Env::Value(CompactString::new("value")) + ); + assert_eq!( + env.get("ENV_VAR_NAME_2").unwrap(), + &Env::WithOptions { + value: CompactString::new("value"), + force: Some(true), + relative: None, + } + ); + assert_eq!( + env.get("ENV_VAR_NAME_3").unwrap(), + &Env::WithOptions { + value: format_compact!("root{MAIN_SEPARATOR}relative-path"), + force: None, + relative: Some(true), + } ); } } diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index fa050304..86db0c61 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -15,7 +15,10 @@ use thiserror::Error; use tokio::task; use tracing::{error, warn}; -use crate::{drivers::RegistryError, helpers::cargo_toml_workspace::LoadManifestFromWSError}; +use crate::{ + drivers::{InvalidRegistryError, RegistryError}, + helpers::cargo_toml_workspace::LoadManifestFromWSError, +}; #[derive(Debug, Error)] #[error("version string '{v}' is not semver: {err}")] @@ -133,6 +136,14 @@ pub enum BinstallError { #[diagnostic(severity(error), code(binstall::io))] Io(io::Error), + /// Unknown registry name + /// + /// - Code: `binstall::cargo_registry` + /// - Exit: 75 + #[error("Unknown registry name {0}, env `CARGO_REGISTRIES_{0}_INDEX` nor is it in .cargo/config.toml")] + #[diagnostic(severity(error), code(binstall::cargo_registry))] + UnknownRegistryName(CompactString), + /// An error interacting with the crates.io API. /// /// This could either be a "not found" or a server/transport error. @@ -167,6 +178,14 @@ pub enum BinstallError { )] CargoManifest(Box), + /// Failure to parse registry index url + /// + /// - Code: `binstall::cargo_registry` + /// - Exit: 79 + #[error(transparent)] + #[diagnostic(severity(error), code(binstall::cargo_registry))] + RegistryParseError(#[from] Box), + /// A version is not valid semver. /// /// Note that we use the [`semver`] crate, which parses Cargo version syntax; this may be @@ -348,9 +367,11 @@ impl BinstallError { Download(_) => 68, SubProcess { .. } => 70, Io(_) => 74, + UnknownRegistryName(_) => 75, RegistryError { .. } => 76, CargoManifestPath => 77, CargoManifest { .. } => 78, + RegistryParseError(..) => 79, VersionParse { .. } => 80, VersionMismatch { .. } => 82, SuperfluousVersionOption => 84, @@ -473,3 +494,9 @@ impl From for BinstallError { BinstallError::RegistryError(Box::new(e)) } } + +impl From for BinstallError { + fn from(e: InvalidRegistryError) -> Self { + BinstallError::RegistryParseError(Box::new(e)) + } +} diff --git a/e2e-tests/registries.sh b/e2e-tests/registries.sh new file mode 100644 index 00000000..7eb3f041 --- /dev/null +++ b/e2e-tests/registries.sh @@ -0,0 +1,62 @@ +#!/bin/bash + +set -euxo pipefail + +test_cargo_binstall_install() { + # Test that the installed binaries can be run + cargo binstall --help >/dev/null + + cargo_binstall_version="$(cargo binstall -V)" + echo "$cargo_binstall_version" + + [ "$cargo_binstall_version" = "cargo-binstall 0.12.0" ] +} + +unset CARGO_INSTALL_ROOT + +CARGO_HOME="$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')" +export CARGO_HOME +export PATH="$CARGO_HOME/bin:$PATH" + +# Testing conflicts of `--index` and `--registry` +set +e + +"./$1" binstall --index 'sparse+https://index.crates.io/' --registry t1 cargo-binstall +exit_code="$?" + +set -e + +if [ "$exit_code" != 2 ]; then + echo "Expected exit code 2, but actual exit code $exit_code" + exit 1 +fi + +cat >"$CARGO_HOME/config.toml" << EOF +[registries] +t1 = { index = "https://github.com/rust-lang/crates.io-index" } +t2 = { index = "sparse+https://index.crates.io/" } + +[registry] +default = "t1" +EOF + +# Install binaries using default registry in config +"./$1" binstall --force -y cargo-binstall@0.12.0 + +test_cargo_binstall_install + +# Install binaries using registry t2 in config +"./$1" binstall --force --registry t2 -y cargo-binstall@0.12.0 + +test_cargo_binstall_install + +# Install binaries using registry t3 in env +CARGO_REGISTRIES_t3_INDEX='sparse+https://index.crates.io/' "./$1" binstall --force --registry t3 -y cargo-binstall@0.12.0 + +test_cargo_binstall_install + + +# Install binaries using index directly +"./$1" binstall --force --index 'sparse+https://index.crates.io/' -y cargo-binstall@0.12.0 + +test_cargo_binstall_install diff --git a/justfile b/justfile index 17b9a51a..7b5109f7 100644 --- a/justfile +++ b/justfile @@ -213,6 +213,7 @@ e2e-test-self-upgrade-no-symlink: (e2e-test "self-upgrade-no-symlink") e2e-test-uninstall: (e2e-test "uninstall") e2e-test-no-track: (e2e-test "no-track") e2e-test-git: (e2e-test "git") +e2e-test-registries: (e2e-test "registries") # WinTLS (Windows in CI) does not have TLS 1.3 support [windows] @@ -221,7 +222,7 @@ e2e-test-tls: (e2e-test "tls" "1.2") [macos] e2e-test-tls: (e2e-test "tls" "1.2") (e2e-test "tls" "1.3") -e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-git e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate e2e-test-no-track +e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-git e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate e2e-test-no-track e2e-test-registries unit-tests: print-env {{cargo-bin}} test {{cargo-build-args}} From 9d4694219b9402853ecdab84889c2cd69574e05e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 10 Jul 2023 16:18:15 +1000 Subject: [PATCH 1361/2020] speedup git shallow cloning: Enable `gix/max-performance` (#1186) for targets: - x86_64-apple-darwin - aarch64-apple-darwin - x86_64-unknown-linux-gnu - x86_64-unknown-linux-musl which will use `zlib-ng` to speedup decompression and use assembly version for sha1 checksum calculation on supported CPU. Also enable feature `zlib-ng` on windows and - aarch64-unknown-linux-gnu - aarch64-unknown-linux-musl Signed-off-by: Jiahao XU --- Cargo.lock | 31 +++++++++++++++++++++++++++++++ crates/bin/Cargo.toml | 1 + crates/binstalk/Cargo.toml | 1 + justfile | 27 +++++++++++++++++++++++++-- 4 files changed, 58 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c4420933..aa08a7c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -632,6 +632,15 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +[[package]] +name = "cpufeatures" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" +dependencies = [ + "libc", +] + [[package]] name = "crc32fast" version = "1.3.2" @@ -1298,6 +1307,7 @@ dependencies = [ "once_cell", "parking_lot", "prodash", + "sha1", "sha1_smol", "thiserror", "walkdir", @@ -3098,6 +3108,27 @@ dependencies = [ "unsafe-libyaml", ] +[[package]] +name = "sha1" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", + "sha1-asm", +] + +[[package]] +name = "sha1-asm" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "563d4f7100bc3fce234e5f37bbf63dc2752558964505ba6ac3f7204bdc59eaac" +dependencies = [ + "cc", +] + [[package]] name = "sha1_smol" version = "1.0.0" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index d2ed63dc..6299abda 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -52,6 +52,7 @@ embed-resource = "2.1.1" default = ["static", "rustls", "trust-dns", "fancy-no-backtrace", "zstd-thin", "git"] git = ["binstalk/git"] +git-max-perf = ["binstalk/git-max-perf"] mimalloc = ["dep:mimalloc"] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 852d0229..527766d8 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -52,6 +52,7 @@ windows = { version = "0.48.0", features = ["Win32_Storage_FileSystem", "Win32_F default = ["static", "rustls", "git"] git = ["dep:gix"] +git-max-perf = ["gix?/max-performance"] static = ["binstalk-downloader/static"] pkg-config = ["binstalk-downloader/pkg-config"] diff --git a/justfile b/justfile index 7b5109f7..fcf361c7 100644 --- a/justfile +++ b/justfile @@ -73,9 +73,32 @@ support-pkg-config := if target == target-host { if target-os == "linux" { "true" } else { "" } } else { "" } +enable-git-max-perf-feature := if target == "x86_64-apple-darwin" { + "true" +} else if target == "aarch64-apple-darwin" { + "true" +} else if target == "x86_64-unknown-linux-gnu" { + "true" +} else if target == "x86_64-unknown-linux-musl" { + "true" +} else { + "false" +} +git-max-perf-feature := if enable-git-max-perf-feature == "true" { + ",git-max-perf" +} else if target-os == "windows" { + ",zlib-ng" +} else if target == "aarch64-unknown-linux-gnu" { + ",zlib-ng" +} else if target == "aarch64-unknown-linux-musl" { + ",zlib-ng" +} else { + "" +} + cargo-features := trim_end_match(if override-features != "" { override-features - } else if (cargo-profile / ci-or-no) == "dev/ci" { "git,rustls,fancy-with-backtrace,zstd-thin,log_max_level_debug" + (if support-pkg-config != "" { ",pkg-config" } else { "" }) + extra-features - } else if (cargo-profile / ci-or-no) == "release/ci" { "git,static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug,cross-lang-fat-lto" + extra-features + } else if (cargo-profile / ci-or-no) == "dev/ci" { "git,rustls,fancy-with-backtrace,zstd-thin,log_max_level_debug" + git-max-perf-feature + (if support-pkg-config != "" { ",pkg-config" } else { "" }) + extra-features + } else if (cargo-profile / ci-or-no) == "release/ci" { "git,static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug,cross-lang-fat-lto" + git-max-perf-feature + extra-features } else { extra-features }, ",") From 65670224b8b43c6f8d13a1b321fd47ce868258ba Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 11 Jul 2023 23:20:51 +1000 Subject: [PATCH 1362/2020] Simplify `args::parse` using `clap::Arg::conflicts_with` (#1198) Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 34 +++++++--------------------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 74584025..137f2d50 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -101,7 +101,7 @@ pub struct Args { /// runs as if `--manifest-path $cloned_repo` is passed to binstall. /// /// This option cannot be used with `--manifest-path`. - #[clap(help_heading = "Overrides", long)] + #[clap(help_heading = "Overrides", long, conflicts_with("manifest_path"))] pub git: Option, /// Override Cargo.toml package manifest bin-dir. @@ -242,7 +242,12 @@ pub struct Args { /// reading from `registries..index`. /// /// Cannot be used with `--index`. - #[clap(help_heading = "Options", long, env = "CARGO_REGISTRY_DEFAULT")] + #[clap( + help_heading = "Options", + long, + env = "CARGO_REGISTRY_DEFAULT", + conflicts_with("index") + )] pub registry: Option, /// This option will be passed through to all `cargo-install` invocations. @@ -426,31 +431,6 @@ pub fn parse() -> Args { // Ensure no conflict let mut command = Args::command(); - #[cfg(feature = "git")] - if opts.manifest_path.is_some() && opts.git.is_some() { - command - .error( - ErrorKind::ArgumentConflict, - format_args!( - r#"Multiple override options for Cargo.toml fetching. -You cannot use --manifest-path and --git. Do one or the other."# - ), - ) - .exit(); - } - - if opts.index.is_some() && opts.registry.is_some() { - command - .error( - ErrorKind::ArgumentConflict, - format_args!( - r#"Multiple override options for registry. -You cannot use --index and --registry. Do one or the other."# - ), - ) - .exit(); - } - if opts.crate_names.len() > 1 { let option = if opts.version_req.is_some() { "version" From d1fe5c7155d902a5949526fbb6dc6a72396ea28d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 16 Jul 2023 13:50:04 +1000 Subject: [PATCH 1363/2020] Fix clippy warning in `binstalk_downloader` (#1204) Replace use of `PhantomData::default()` in `src/download.rs` with `PhantomData` since it is a unit struct. Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/download.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index bebd7bce..ae3138d2 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -83,7 +83,7 @@ impl Download { Self { client, url, - _digest: PhantomData::default(), + _digest: PhantomData, _checksum: Vec::new(), } } @@ -158,7 +158,7 @@ impl Download { Self { client, url, - _digest: PhantomData::default(), + _digest: PhantomData, _checksum: checksum, } } From 9746ce9ca3d87785ece3b3b9d195c4b2d1d8a43e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 17 Jul 2023 00:47:40 +1000 Subject: [PATCH 1364/2020] Set opt-level for `{binstall, tokio}-tar` to `"z"` (#1203) Trying to fix #1196 Signed-off-by: Jiahao XU --- Cargo.toml | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index f194f831..fa656bd6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -23,6 +23,12 @@ strip = "symbols" [profile.release.build-override] inherits = "dev.build-override" +[profile.release.package."tokio-tar"] +opt-level = "z" + +[profile.release.package."binstall-tar"] +opt-level = "z" + [profile.dev] opt-level = 0 debug = true @@ -35,6 +41,12 @@ codegen-units = 1024 [profile.dev.package."*"] opt-level = 3 +[profile.dev.package."tokio-tar"] +opt-level = "z" + +[profile.dev.package."binstall-tar"] +opt-level = "z" + [profile.dev.build-override] inherits = "dev" debug = false From b3b682a1af93699b337c5c71af7df7034d015c36 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 17 Jul 2023 00:48:12 +1000 Subject: [PATCH 1365/2020] Optimize `profile.dev`: Set `codege-units` to 32 (#1199) Splitting too many codege-units would actually takes longer to compile due to overhead of parallelism in backend. Also, our CI does not have that many CPU cores to take advantages of. Signed-off-by: Jiahao XU --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index fa656bd6..1ad5788a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -35,7 +35,7 @@ debug = true lto = false debug-assertions = true overflow-checks = true -codegen-units = 1024 +codegen-units = 32 # Set the default for dependencies on debug. [profile.dev.package."*"] From 963e9e97add0a681f117fe21c6b3fde074706ac7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 17 Jul 2023 11:56:10 +1000 Subject: [PATCH 1366/2020] Use `reflink_copy::reflink_or_copy` in `fs::atomic_install*` (#1197) to speedup copy operation `atomic_install*`. Signed-off-by: Jiahao XU --- Cargo.lock | 19 +++++++++++++++++++ crates/binstalk/Cargo.toml | 1 + crates/binstalk/src/fs.rs | 13 ++++++++----- 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aa08a7c3..55391984 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -261,6 +261,7 @@ dependencies = [ "miette", "normalize-path", "once_cell", + "reflink-copy", "semver", "serde", "serde_json", @@ -2005,6 +2006,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "ioctl-sys" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8bd11f3a29434026f5ff98c730b668ba74b1033637b8817940b54d040696133c" + [[package]] name = "ipconfig" version = "0.3.2" @@ -2750,6 +2757,18 @@ dependencies = [ "thiserror", ] +[[package]] +name = "reflink-copy" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9c6f4912869a1c9abaf4038e7051d88544960da7c9560b8baeaabfa3c95e05b" +dependencies = [ + "cfg-if", + "ioctl-sys", + "libc", + "windows 0.48.0", +] + [[package]] name = "regex" version = "1.9.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 527766d8..bc5c9cd4 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -29,6 +29,7 @@ maybe-owned = "0.3.4" miette = "5.9.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } once_cell = "1.18.0" +reflink-copy = "0.1.5" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde_json = "1.0.99" diff --git a/crates/binstalk/src/fs.rs b/crates/binstalk/src/fs.rs index 7681c569..87d9ed28 100644 --- a/crates/binstalk/src/fs.rs +++ b/crates/binstalk/src/fs.rs @@ -1,24 +1,27 @@ use std::{fs, io, path::Path}; +use reflink_copy::reflink_or_copy; use tempfile::{NamedTempFile, TempPath}; use tracing::{debug, warn}; fn copy_to_tempfile(src: &Path, dst: &Path) -> io::Result { - let mut src_file = fs::File::open(src)?; - let parent = dst.parent().unwrap(); debug!("Creating named tempfile at '{}'", parent.display()); - let mut tempfile = NamedTempFile::new_in(parent)?; + let tempfile = NamedTempFile::new_in(parent)?; debug!( "Copying from '{}' to '{}'", src.display(), tempfile.path().display() ); - io::copy(&mut src_file, tempfile.as_file_mut())?; + // src and dst is likely to be on the same filesystem. + // Uses reflink if the fs support it, or fallback to + // `fs::copy` if it doesn't support it or it is not on the + // same filesystem. + reflink_or_copy(src, tempfile.path())?; debug!("Retrieving permissions of '{}'", src.display()); - let permissions = src_file.metadata()?.permissions(); + let permissions = src.metadata()?.permissions(); debug!( "Setting permissions of '{}' to '{permissions:#?}'", From ad5857314338880aafdf9acc1bd3ef4d6d099429 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 17 Jul 2023 13:07:15 +1000 Subject: [PATCH 1367/2020] feat: Read `--rate-limit` from env `BINSTALL_RATE_LIMIT` as a fallback (#1201) feat: Scrap `--rate-limit` from env `BINSTALL_RATE_LIMIT` as a fallback and set `BINSTALL_RATE_LIMIT` to `100/1` on CI. Fixed #1196 Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 2 +- justfile | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 137f2d50..2d3aa496 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -144,7 +144,7 @@ pub struct Args { /// allows 2 requests per 6ms. /// /// Both duration and request count must not be 0. - #[clap(help_heading = "Overrides", long, default_value_t = RateLimit::default())] + #[clap(help_heading = "Overrides", long, default_value_t = RateLimit::default(), env = "BINSTALL_RATE_LIMIT")] pub rate_limit: RateLimit, /// Specify the strategies to be used, diff --git a/justfile b/justfile index fcf361c7..611d0040 100644 --- a/justfile +++ b/justfile @@ -12,6 +12,7 @@ use-auditable := env_var_or_default("JUST_USE_AUDITABLE", "") timings := env_var_or_default("JUST_TIMINGS", "") export BINSTALL_LOG_LEVEL := if env_var_or_default("RUNNER_DEBUG", "0") == "1" { "debug" } else { "info" } +export BINSTALL_RATE_LIMIT := "100/1" cargo := if use-cargo-zigbuild != "" { "cargo-zigbuild" } else if use-cross != "" { "cross" } else { "cargo" } export CARGO := cargo From 9af17de9c3a9e4a0faf57e63d96c039cfea6b015 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 14:51:46 +1000 Subject: [PATCH 1368/2020] build(deps): update file-format requirement from 0.17.0 to 0.18.0 in /crates/bin (#1205) build(deps): update file-format requirement in /crates/bin Updates the requirements on [file-format](https://github.com/mmalecot/file-format) to permit the latest version. - [Release notes](https://github.com/mmalecot/file-format/releases) - [Changelog](https://github.com/mmalecot/file-format/blob/main/CHANGELOG.md) - [Commits](https://github.com/mmalecot/file-format/compare/v0.17.0...v0.18.0) --- updated-dependencies: - dependency-name: file-format dependency-type: direct:production ... Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 55391984..9e01593d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -884,9 +884,9 @@ checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" [[package]] name = "file-format" -version = "0.17.3" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "805eab5eeca901cbdfabf3f54adb2f27464073617279fd4e14eedb2a0757222e" +checksum = "fd991bcfc01ee8f9ed83108da842aeddfca8a9550962cbffc9579050109c2aa9" [[package]] name = "filetime" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 6299abda..1f93a31b 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -27,7 +27,7 @@ binstalk-manifests = { path = "../binstalk-manifests", version = "0.6.0" } clap = { version = "4.3.0", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" -file-format = { version = "0.17.0", default-features = false } +file-format = { version = "0.18.0", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } gh-token = "0.1.2" log = { version = "0.4.18", features = ["std"] } From ef4e6d7cbf1f83d34a69d3abe70143bf4bfe1b89 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 17:02:13 +1000 Subject: [PATCH 1369/2020] dep: Upgrade transitive dependencies (#1202) Co-authored-by: github-actions --- Cargo.lock | 114 ++++++++++++++++++++++++++--------------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9e01593d..d7681084 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -144,9 +144,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0122885821398cc923ece939e24d1056a2384ee719432397fa9db87230ff11" +checksum = "62b74f44609f0f91493e3082d3734d98497e094777144380ea4db9f9905dd5b6" dependencies = [ "brotli", "bzip2", @@ -168,7 +168,7 @@ checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -281,7 +281,7 @@ dependencies = [ name = "binstalk-downloader" version = "0.6.0" dependencies = [ - "async-compression 0.4.0", + "async-compression 0.4.1", "async-trait", "async_zip", "binstalk-types", @@ -561,7 +561,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -635,9 +635,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e69e28e9f7f77debdedbaafa2866e1de9ba56df55a8bd7cfc724c25a09987c" +checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" dependencies = [ "libc", ] @@ -831,9 +831,9 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88bffebc5d80432c9b140ee17875ff173a8ab62faad5b257da912bd2f6c1c0a1" +checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" @@ -954,7 +954,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" dependencies = [ - "rustix 0.38.3", + "rustix 0.38.4", "windows-sys", ] @@ -997,7 +997,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -1907,7 +1907,7 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls 0.21.3", + "rustls 0.21.5", "tokio", "tokio-rustls 0.24.1", ] @@ -2037,7 +2037,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi", - "rustix 0.38.3", + "rustix 0.38.4", "windows-sys", ] @@ -2135,7 +2135,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -2303,7 +2303,7 @@ checksum = "4901771e1d44ddb37964565c654a3223ba41a594d02b8da471cc4464912b5cfa" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -2467,7 +2467,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -2552,7 +2552,7 @@ checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -2591,9 +2591,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b368fba921b0dce7e60f5e04ec15e565b3303972b42bcfde1d0713b881959eb" +checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" dependencies = [ "unicode-ident", ] @@ -2771,9 +2771,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.9.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89089e897c013b3deb627116ae56a6955a72b8bed395c9526af31c9fe528b484" +checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" dependencies = [ "aho-corasick", "memchr", @@ -2783,9 +2783,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.0" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa250384981ea14565685dea16a9ccc4d1c541a13f82b9c168572264d1df8c56" +checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" dependencies = [ "aho-corasick", "memchr", @@ -2794,9 +2794,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab07dc67230e4a4718e70fd5c20055a4334b121f1f9db8fe63ef39ce9b8c846" +checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "reqwest" @@ -2804,7 +2804,7 @@ version = "0.11.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" dependencies = [ - "async-compression 0.4.0", + "async-compression 0.4.1", "base64 0.21.2", "bytes", "encoding_rs", @@ -2824,7 +2824,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.3", + "rustls 0.21.5", "rustls-pemfile 1.0.3", "serde", "serde_json", @@ -2900,9 +2900,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.3" +version = "0.38.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac5ffa1efe7548069688cd7028f32591853cd7b5b756d41bcffd2353e4fc75b4" +checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" dependencies = [ "bitflags 2.3.3", "errno 0.3.1", @@ -2925,9 +2925,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.3" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b19faa85ecb5197342b54f987b142fb3e30d0c90da40f80ef4fa9a726e6676ed" +checksum = "79ea77c539259495ce8ca47f53e66ae0330a8819f67e23ac96ca02f50e7b7d36" dependencies = [ "log", "ring", @@ -3055,9 +3055,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.167" +version = "1.0.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daf513456463b42aa1d94cff7e0c24d682b429f020b9afa4f5ba5c40a22b237" +checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" dependencies = [ "serde_derive", ] @@ -3073,20 +3073,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.167" +version = "1.0.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b69b106b68bc8054f0e974e70d19984040f8a5cf9215ca82626ea4853f82c4b9" +checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] name = "serde_json" -version = "1.0.100" +version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1e14e89be7aa4c4b78bdbdc9eb5bf8517829a600ae8eaa39a6e1d960b5185c" +checksum = "b5062a995d481b2308b6064e9af76011f2921c35f97b0468811ed9f6cd91dfed" dependencies = [ "itoa", "ryu", @@ -3257,7 +3257,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -3301,9 +3301,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.23" +version = "2.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59fb7d6d8281a51045d62b8eb3a7d1ce347b76f312af50cd3dc0af39c87c1737" +checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2" dependencies = [ "proc-macro2", "quote", @@ -3312,9 +3312,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.8" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1c7f239eb94671427157bd93b3694320f3668d4e1eff08c7285366fd777fac" +checksum = "df8e77cb757a61f51b947ec4a7e3646efd825b73561db1c232a8ccb639e611a0" [[package]] name = "tempfile" @@ -3368,7 +3368,7 @@ checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -3383,9 +3383,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.22" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea9e1b3cf1243ae005d9e74085d4d542f3125458f3a81af210d901dcd7411efd" +checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" dependencies = [ "itoa", "libc", @@ -3403,9 +3403,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "372950940a5f07bf38dbe211d7283c9e6d7327df53794992d293e534c733d09b" +checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" dependencies = [ "time-core", ] @@ -3453,7 +3453,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -3483,7 +3483,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.3", + "rustls 0.21.5", "tokio", ] @@ -3551,9 +3551,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.12" +version = "0.19.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c500344a19072298cd05a7224b3c0c629348b78692bf48466c5238656e315a78" +checksum = "5f8751d9c1b03c6500c387e96f81f815a4f8e72d142d2d4a9ffa6fedd51ddee7" dependencies = [ "indexmap 2.0.0", "serde", @@ -3612,7 +3612,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", ] [[package]] @@ -3900,7 +3900,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", "wasm-bindgen-shared", ] @@ -3934,7 +3934,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.23", + "syn 2.0.25", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4168,9 +4168,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.4.8" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9482fe6ceabdf32f3966bfdd350ba69256a97c30253dc616fe0005af24f164e" +checksum = "81fac9742fd1ad1bd9643b991319f72dd031016d44b77039a26977eb667141e7" dependencies = [ "memchr", ] From b08849b7ceff1a505fe38bfcc5eaca6a7b8c3140 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 17 Jul 2023 19:22:25 +1000 Subject: [PATCH 1370/2020] dep: Upgrade transitive dependencies (#1206) Co-authored-by: github-actions --- Cargo.lock | 123 ++++++++++++++++++++++++++++------------------------- 1 file changed, 66 insertions(+), 57 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d7681084..b3d291f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -168,7 +168,7 @@ checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -356,7 +356,7 @@ checksum = "01db907e07c37309ea816c183ffe548daaa66ef640a291408f232d6ca4089dbb" dependencies = [ "filetime", "libc", - "xattr", + "xattr 0.2.3", ] [[package]] @@ -531,9 +531,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.11" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1640e5cc7fb47dbb8338fd471b105e7ed6c3cb2aeb00c2e067127ffd3764a05d" +checksum = "3eab9e8ceb9afdade1ab3f0fd8dbce5b1b2f468ad653baf10e771781b2b67b73" dependencies = [ "clap_builder", "clap_derive", @@ -542,9 +542,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.11" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c59138d527eeaf9b53f35a77fcc1fad9d883116070c63d5de1c7dc7b00c72b" +checksum = "9f2763db829349bf00cfc06251268865ed4363b93a943174f638daf3ecdba2cd" dependencies = [ "anstream", "anstyle", @@ -554,14 +554,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.2" +version = "4.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8cd2b2a819ad6eec39e8f1d6b53001af1e5469f8c177579cdaeb313115b825f" +checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -997,7 +997,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -2058,9 +2058,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" @@ -2135,7 +2135,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -2276,9 +2276,9 @@ dependencies = [ [[package]] name = "miette" -version = "5.9.0" +version = "5.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a236ff270093b0b67451bc50a509bd1bad302cb1d3c7d37d5efe931238581fa9" +checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" dependencies = [ "backtrace", "backtrace-ext", @@ -2297,13 +2297,13 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.9.0" +version = "5.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4901771e1d44ddb37964565c654a3223ba41a594d02b8da471cc4464912b5cfa" +checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -2467,7 +2467,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -2552,7 +2552,7 @@ checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -2591,18 +2591,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.64" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] [[package]] name = "prodash" -version = "25.0.0" +version = "25.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3236ce1618b6da4c7b618e0143c4d5b5dc190f75f81c49f248221382f7e9e9ae" +checksum = "c236e70b7f9b9ea00d33c69f63ec1ae6e9ae96118923cd37bd4e9c7396f0b107" dependencies = [ "bytesize", "human_format", @@ -2669,9 +2669,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.29" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" +checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" dependencies = [ "proc-macro2", ] @@ -2977,15 +2977,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc31bd9b61a32c31f9650d18add92aa83a49ba979c143eefd27fe7177b05bd5f" +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "same-file" @@ -3046,9 +3046,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" dependencies = [ "serde", ] @@ -3079,14 +3079,14 @@ checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] name = "serde_json" -version = "1.0.102" +version = "1.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5062a995d481b2308b6064e9af76011f2921c35f97b0468811ed9f6cd91dfed" +checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" dependencies = [ "itoa", "ryu", @@ -3116,9 +3116,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.22" +version = "0.9.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "452e67b9c20c37fa79df53201dc03839651086ed9bbe92b3ca585ca9fdaa7d85" +checksum = "da6075b41c7e3b079e5f246eb6094a44850d3a4c25a67c581c80796c80134012" dependencies = [ "indexmap 2.0.0", "itoa", @@ -3165,9 +3165,9 @@ dependencies = [ [[package]] name = "signal-hook" -version = "0.3.15" +version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "732768f1176d21d09e076c23a93123d40bba92d50c4058da34d45c8de8e682b9" +checksum = "b824b6e687aff278cdbf3b36f07aa52d4bd4099699324d5da86a2ebce3aa00b3" dependencies = [ "libc", "signal-hook-registry", @@ -3257,7 +3257,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -3301,9 +3301,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.25" +version = "2.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2" +checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" dependencies = [ "proc-macro2", "quote", @@ -3368,7 +3368,7 @@ checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -3453,7 +3453,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -3500,17 +3500,17 @@ dependencies = [ [[package]] name = "tokio-tar" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a50188549787c32c1c3d9c8c71ad7e003ccf2f102489c5a96e385c84760477f4" +checksum = "9d5714c010ca3e5c27114c1cdeb9d14641ace49874aa5626d7149e47aedace75" dependencies = [ "filetime", "futures-core", "libc", - "redox_syscall 0.2.16", + "redox_syscall 0.3.5", "tokio", "tokio-stream", - "xattr", + "xattr 1.0.0", ] [[package]] @@ -3551,9 +3551,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.13" +version = "0.19.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f8751d9c1b03c6500c387e96f81f815a4f8e72d142d2d4a9ffa6fedd51ddee7" +checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" dependencies = [ "indexmap 2.0.0", "serde", @@ -3612,7 +3612,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", ] [[package]] @@ -3757,9 +3757,9 @@ checksum = "98e90c70c9f0d4d1ee6d0a7d04aa06cb9bbd53d8cfbdd62a0269a7c2eb640552" [[package]] name = "unicode-ident" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-linebreak" @@ -3788,9 +3788,9 @@ checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" [[package]] name = "unsafe-libyaml" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1865806a559042e51ab5414598446a5871b561d21b6764f2eabb0dd481d880a6" +checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" [[package]] name = "untrusted" @@ -3900,7 +3900,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", "wasm-bindgen-shared", ] @@ -3934,7 +3934,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn 2.0.26", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4213,6 +4213,15 @@ dependencies = [ "libc", ] +[[package]] +name = "xattr" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea263437ca03c1522846a4ddafbca2542d0ad5ed9b784909d4b27b76f62bc34a" +dependencies = [ + "libc", +] + [[package]] name = "xz2" version = "0.1.7" From 5acfda9379c43c9b8fda32f36fb8baed79ad5ef1 Mon Sep 17 00:00:00 2001 From: Sebastian Thiel Date: Mon, 17 Jul 2023 17:46:12 +0200 Subject: [PATCH 1371/2020] avoid worktree checkouts (#1207) * perform a bare git cloen to avoid worktree checkouts This will be way faster on windows * feat: use the git repository directly to obtain crate information * Apply code review changes Signed-off-by: Jiahao XU * Impl `fmt::Display` for `helpers::git::GitUrl` and also refactor implementation of `git::Repository::{shallow_clone, shallow_clone_bare}`. Signed-off-by: Jiahao XU * Fix clippy lint warnings Signed-off-by: Jiahao XU * Fix typo Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU Co-authored-by: Jiahao XU --- .../src/drivers/registry/git_registry.rs | 58 ++++---- crates/binstalk/src/helpers/git.rs | 130 ++++++++++++++---- 2 files changed, 137 insertions(+), 51 deletions(-) diff --git a/crates/binstalk/src/drivers/registry/git_registry.rs b/crates/binstalk/src/drivers/registry/git_registry.rs index 3922bbd0..f551f5b8 100644 --- a/crates/binstalk/src/drivers/registry/git_registry.rs +++ b/crates/binstalk/src/drivers/registry/git_registry.rs @@ -1,9 +1,4 @@ -use std::{ - fs::File, - io::{self, BufReader, Read}, - path::PathBuf, - sync::Arc, -}; +use std::{io, path::PathBuf, sync::Arc}; use cargo_toml::Manifest; use compact_str::{CompactString, ToCompactString}; @@ -29,7 +24,8 @@ use crate::{ #[derive(Debug)] struct GitIndex { - path: TempDir, + _tempdir: TempDir, + repo: Repository, dl_template: CompactString, } @@ -37,15 +33,24 @@ impl GitIndex { fn new(url: GitUrl) -> Result { let tempdir = TempDir::new()?; - Repository::shallow_clone(url, tempdir.as_ref())?; + let repo = Repository::shallow_clone_bare(url.clone(), tempdir.as_ref())?; - let mut v = Vec::with_capacity(100); - File::open(tempdir.as_ref().join("config.json"))?.read_to_end(&mut v)?; + let config: RegistryConfig = { + let config = repo + .get_head_commit_entry_data_by_path("config.json")? + .ok_or_else(|| { + io::Error::new( + io::ErrorKind::NotFound, + format!("config.json not found in repository `{url}`"), + ) + })?; - let config: RegistryConfig = json_from_slice(&v).map_err(RegistryError::from)?; + json_from_slice(&config).map_err(RegistryError::from)? + }; Ok(Self { - path: tempdir, + _tempdir: tempdir, + repo, dl_template: config.dl, }) } @@ -70,27 +75,24 @@ impl GitRegistry { /// WARNING: This is a blocking operation. fn find_crate_matched_ver( - mut path: PathBuf, + repo: &Repository, crate_name: &str, (c1, c2): &(CompactString, Option), version_req: &VersionReq, ) -> Result { + let mut path = PathBuf::with_capacity(128); path.push(&**c1); if let Some(c2) = c2 { path.push(&**c2); } path.push(&*crate_name.to_lowercase()); - - let f = File::open(path) - .map_err(|e| match e.kind() { - io::ErrorKind::NotFound => RegistryError::NotFound(crate_name.into()).into(), - _ => BinstallError::from(e), - }) - .map(BufReader::new)?; + let crate_versions = repo + .get_head_commit_entry_data_by_path(path)? + .ok_or_else(|| RegistryError::NotFound(crate_name.into()))?; MatchedVersion::find( - &mut JsonDeserializer::from_reader(f).into_iter(), + &mut JsonDeserializer::from_slice(&crate_versions).into_iter(), version_req, ) } @@ -107,17 +109,17 @@ impl GitRegistry { let this = self.clone(); let (version, dl_url) = spawn_blocking(move || { - let GitIndex { path, dl_template } = this + let GitIndex { + _tempdir: _, + repo, + dl_template, + } = this .0 .git_index .get_or_try_init(|| GitIndex::new(this.0.url.clone()))?; - let MatchedVersion { version, cksum } = Self::find_crate_matched_ver( - path.as_ref().to_owned(), - &crate_name, - &crate_prefix, - &version_req, - )?; + let MatchedVersion { version, cksum } = + Self::find_crate_matched_ver(repo, &crate_name, &crate_prefix, &version_req)?; let url = Url::parse(&render_dl_template( dl_template, diff --git a/crates/binstalk/src/helpers/git.rs b/crates/binstalk/src/helpers/git.rs index f4ebb85b..b84519a4 100644 --- a/crates/binstalk/src/helpers/git.rs +++ b/crates/binstalk/src/helpers/git.rs @@ -1,4 +1,4 @@ -use std::{num::NonZeroU32, path::Path, str::FromStr, sync::atomic::AtomicBool}; +use std::{fmt, mem, num::NonZeroU32, path::Path, str::FromStr, sync::atomic::AtomicBool}; use compact_str::CompactString; use gix::{clone, create, open, remote, Url}; @@ -21,6 +21,15 @@ pub enum GitError { #[error("Failed to checkout: {0}")] CheckOutError(#[source] Box), + + #[error("HEAD ref was corrupt in crates-io index repository clone")] + HeadCommit(#[source] Box), + + #[error("tree of head commit wasn't present in crates-io index repository clone")] + GetTreeOfCommit(#[source] Box), + + #[error("An object was missing in the crates-io index repository clone")] + ObjectLookup(#[source] Box), } impl From for GitError { @@ -41,9 +50,36 @@ impl From for GitError { } } +impl From for GitError { + fn from(e: gix::reference::head_commit::Error) -> Self { + Self::HeadCommit(Box::new(e)) + } +} + +impl From for GitError { + fn from(e: gix::object::commit::Error) -> Self { + Self::GetTreeOfCommit(Box::new(e)) + } +} + +impl From for GitError { + fn from(e: gix::object::find::existing::Error) -> Self { + Self::ObjectLookup(Box::new(e)) + } +} + #[derive(Clone, Debug)] pub struct GitUrl(Url); +impl fmt::Display for GitUrl { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let url_bstr = self.0.to_bstring(); + let url_str = String::from_utf8_lossy(&url_bstr); + + f.write_str(&url_str) + } +} + impl FromStr for GitUrl { type Err = GitUrlParseError; @@ -53,39 +89,87 @@ impl FromStr for GitUrl { } #[derive(Debug)] -pub struct Repository(gix::Repository); +pub struct Repository(gix::ThreadSafeRepository); impl Repository { + fn prepare_fetch( + url: GitUrl, + path: &Path, + kind: create::Kind, + ) -> Result { + Ok(clone::PrepareFetch::new( + url.0, + path, + kind, + create::Options { + destination_must_be_empty: true, + ..Default::default() + }, + open::Options::isolated(), + )? + .with_shallow(remote::fetch::Shallow::DepthAtRemote( + NonZeroU32::new(1).unwrap(), + ))) + } + + /// WARNING: This is a blocking operation, if you want to use it in + /// async context then you must wrap the call in [`tokio::task::spawn_blocking`]. + /// + /// WARNING: This function must be called after tokio runtime is initialized. + pub fn shallow_clone_bare(url: GitUrl, path: &Path) -> Result { + debug!("Shallow cloning {url} to {}", path.display()); + + Ok(Self( + Self::prepare_fetch(url, path, create::Kind::Bare)? + .fetch_only( + &mut TracingProgress::new(CompactString::new("Cloning")), + &AtomicBool::new(false), + )? + .0 + .into(), + )) + } + /// WARNING: This is a blocking operation, if you want to use it in /// async context then you must wrap the call in [`tokio::task::spawn_blocking`]. /// /// WARNING: This function must be called after tokio runtime is initialized. pub fn shallow_clone(url: GitUrl, path: &Path) -> Result { - let url_bstr = url.0.to_bstring(); - let url_str = String::from_utf8_lossy(&url_bstr); - - debug!("Shallow cloning {url_str} to {}", path.display()); + debug!("Shallow cloning {url} to {} with worktree", path.display()); let mut progress = TracingProgress::new(CompactString::new("Cloning")); Ok(Self( - clone::PrepareFetch::new( - url.0, - path, - create::Kind::WithWorktree, - create::Options { - destination_must_be_empty: true, - ..Default::default() - }, - open::Options::isolated(), - )? - .with_shallow(remote::fetch::Shallow::DepthAtRemote( - NonZeroU32::new(1).unwrap(), - )) - .fetch_then_checkout(&mut progress, &AtomicBool::new(false))? - .0 - .main_worktree(&mut progress, &AtomicBool::new(false))? - .0, + Self::prepare_fetch(url, path, create::Kind::WithWorktree)? + .fetch_then_checkout(&mut progress, &AtomicBool::new(false))? + .0 + .main_worktree(&mut progress, &AtomicBool::new(false))? + .0 + .into(), )) } + + #[inline(always)] + pub fn get_head_commit_entry_data_by_path( + &self, + path: impl AsRef, + ) -> Result>, GitError> { + fn inner(this: &Repository, path: &Path) -> Result>, GitError> { + Ok( + if let Some(entry) = this + .0 + .to_thread_local() + .head_commit()? + .tree()? + .lookup_entry_by_path(path)? + { + Some(mem::take(&mut entry.object()?.data)) + } else { + None + }, + ) + } + + inner(self, path.as_ref()) + } } From c11261b88f73b7ec63534a2cd346d6be45ecbda4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 18 Jul 2023 06:19:50 +1000 Subject: [PATCH 1372/2020] CI: Relax rate limit to `30/1` (#1209) `100/1` slows CI down to a snail when getting rate limited by GitHub. Signed-off-by: Jiahao XU --- justfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/justfile b/justfile index 611d0040..8814d409 100644 --- a/justfile +++ b/justfile @@ -12,7 +12,7 @@ use-auditable := env_var_or_default("JUST_USE_AUDITABLE", "") timings := env_var_or_default("JUST_TIMINGS", "") export BINSTALL_LOG_LEVEL := if env_var_or_default("RUNNER_DEBUG", "0") == "1" { "debug" } else { "info" } -export BINSTALL_RATE_LIMIT := "100/1" +export BINSTALL_RATE_LIMIT := "30/1" cargo := if use-cargo-zigbuild != "" { "cargo-zigbuild" } else if use-cross != "" { "cross" } else { "cargo" } export CARGO := cargo From 0c5b7f115dac7d049bf41ee15057b424e644635d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 18 Jul 2023 15:22:41 +1000 Subject: [PATCH 1373/2020] feat: Support `--verbose --version`/`-vV` (#1182) that provides more information: ``` cargo-binstall: 1.0.0 build-date: 2023-07-18 build-target: aarch64-apple-darwin build-features: default,fancy_no_backtrace,git,rustls,static,trust_dns,zstd_thin build-commit-hash: 39d8cfc07f2253080ce997e620406c2994dced25 build-commit-date: 2023-07-18 rustc-version: 1.71.0 rustc-commit-hash: 8ede3aae28fe6e4d52b38157d7bfe0d3bceef225 rustc-llvm-version: 16.0 ``` Fixed #627 Signed-off-by: Jiahao XU --- Cargo.lock | 19 +++++++++++++++ crates/bin/Cargo.toml | 1 + crates/bin/build.rs | 47 ++++++++++++++++++++++++++++++++++---- crates/bin/src/args.rs | 4 ++++ crates/bin/src/main.rs | 30 ++++++++++++++++++++++-- crates/binstalk/src/lib.rs | 2 +- 6 files changed, 95 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b3d291f4..a0643eb1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -113,6 +113,12 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "anyhow" +version = "1.0.72" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" + [[package]] name = "arc-swap" version = "1.6.0" @@ -493,6 +499,7 @@ dependencies = [ "tracing-core", "tracing-log", "tracing-subscriber", + "vergen", ] [[package]] @@ -3828,6 +3835,18 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +[[package]] +name = "vergen" +version = "8.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbc5ad0d9d26b2c49a5ab7da76c3e79d3ee37e7821799f8223fcb8f2f391a2e7" +dependencies = [ + "anyhow", + "rustc_version", + "rustversion", + "time", +] + [[package]] name = "version_check" version = "0.9.4" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 1f93a31b..f0f91c28 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -47,6 +47,7 @@ tracing-subscriber = { version = "0.3.17", features = ["fmt", "json", "ansi"], d [build-dependencies] embed-resource = "2.1.1" +vergen = { version = "8.2.4", features = ["build", "cargo", "git", "gitcl", "rustc"] } [features] default = ["static", "rustls", "trust-dns", "fancy-no-backtrace", "zstd-thin", "git"] diff --git a/crates/bin/build.rs b/crates/bin/build.rs index 9a654904..e51d1dd2 100644 --- a/crates/bin/build.rs +++ b/crates/bin/build.rs @@ -1,7 +1,44 @@ -fn main() { - println!("cargo:rerun-if-changed=build.rs"); - println!("cargo:rerun-if-changed=manifest.rc"); - println!("cargo:rerun-if-changed=windows.manifest"); +use std::{ + io, + path::Path, + process::{Child, Command}, + thread, +}; - embed_resource::compile("manifest.rc", embed_resource::NONE); +fn succeeds(res: io::Result) -> bool { + res.and_then(|mut child| child.wait()) + .map(|status| status.success()) + .unwrap_or(false) +} + +fn main() { + let handle = thread::spawn(|| { + println!("cargo:rerun-if-changed=build.rs"); + println!("cargo:rerun-if-changed=manifest.rc"); + println!("cargo:rerun-if-changed=windows.manifest"); + + embed_resource::compile("manifest.rc", embed_resource::NONE); + }); + + let git = Command::new("git").arg("--version").spawn(); + + // .git is usually a dir, but it also can be a file containing + // path to another .git if it is a submodule. + // + // If build.rs is run on a git repository, then ../../.git + // should exists. + let is_git_repo = Path::new("../../.git").exists(); + + let mut builder = vergen::EmitBuilder::builder(); + builder.all_build().all_cargo().all_rustc(); + + if is_git_repo && succeeds(git) { + builder.all_git(); + } else { + builder.disable_git(); + } + + builder.emit().unwrap(); + + handle.join().unwrap(); } diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 2d3aa496..b3189a94 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -318,6 +318,10 @@ pub struct Args { #[clap(help_heading = "Meta", long, value_name = "LEVEL")] pub log_level: Option, + /// Used with `--version` to print out verbose information. + #[clap(help_heading = "Meta", short, long, default_value_t = false)] + pub verbose: bool, + /// Equivalent to setting `log_level` to `off`. /// /// This would override the `log_level`. diff --git a/crates/bin/src/main.rs b/crates/bin/src/main.rs index 49c90ad9..2fa221df 100644 --- a/crates/bin/src/main.rs +++ b/crates/bin/src/main.rs @@ -1,6 +1,6 @@ use std::time::Instant; -use binstalk::helpers::jobserver_client::LazyJobserverClient; +use binstalk::{helpers::jobserver_client::LazyJobserverClient, TARGET}; use log::LevelFilter; use tracing::debug; @@ -22,7 +22,33 @@ fn main() -> MainExit { let args = args::parse(); if args.version { - println!("{}", env!("CARGO_PKG_VERSION")); + let cargo_binstall_version = env!("CARGO_PKG_VERSION"); + if args.verbose { + let build_date = env!("VERGEN_BUILD_DATE"); + + let features = env!("VERGEN_CARGO_FEATURES"); + + let git_sha = option_env!("VERGEN_GIT_SHA").unwrap_or("UNKNOWN"); + let git_commit_date = option_env!("VERGEN_GIT_COMMIT_DATE").unwrap_or("UNKNOWN"); + + let rustc_semver = env!("VERGEN_RUSTC_SEMVER"); + let rustc_commit_hash = env!("VERGEN_RUSTC_COMMIT_HASH"); + let rustc_llvm_version = env!("VERGEN_RUSTC_LLVM_VERSION"); + + println!( + r#"cargo-binstall: {cargo_binstall_version} +build-date: {build_date} +build-target: {TARGET} +build-features: {features} +build-commit-hash: {git_sha} +build-commit-date: {git_commit_date} +rustc-version: {rustc_semver} +rustc-commit-hash: {rustc_commit_hash} +rustc-llvm-version: {rustc_llvm_version}"# + ); + } else { + println!("{cargo_binstall_version}"); + } MainExit::Success(None) } else { logging( diff --git a/crates/binstalk/src/lib.rs b/crates/binstalk/src/lib.rs index a32de76f..e1b64b89 100644 --- a/crates/binstalk/src/lib.rs +++ b/crates/binstalk/src/lib.rs @@ -9,5 +9,5 @@ pub mod helpers; pub mod ops; pub use binstalk_types as manifests; -pub use detect_targets::{get_desired_targets, DesiredTargets}; +pub use detect_targets::{get_desired_targets, DesiredTargets, TARGET}; pub use home; From c842defd57d55b908fa9df1113ed269ff1bcdb47 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 18 Jul 2023 17:08:33 +1000 Subject: [PATCH 1374/2020] dep: Upgrade transitive dependencies (#1210) Co-authored-by: github-actions --- Cargo.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a0643eb1..cc069084 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -538,9 +538,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.12" +version = "4.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eab9e8ceb9afdade1ab3f0fd8dbce5b1b2f468ad653baf10e771781b2b67b73" +checksum = "8f644d0dac522c8b05ddc39aaaccc5b136d5dc4ff216610c5641e3be5becf56c" dependencies = [ "clap_builder", "clap_derive", @@ -549,9 +549,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.12" +version = "4.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f2763db829349bf00cfc06251268865ed4363b93a943174f638daf3ecdba2cd" +checksum = "af410122b9778e024f9e0fb35682cc09cc3f85cad5e8d3ba8f47a9702df6e73d" dependencies = [ "anstream", "anstyle", @@ -3014,9 +3014,9 @@ dependencies = [ [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" @@ -3123,9 +3123,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.23" +version = "0.9.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da6075b41c7e3b079e5f246eb6094a44850d3a4c25a67c581c80796c80134012" +checksum = "bd5f51e3fdb5b9cdd1577e1cb7a733474191b1aca6a72c2e50913241632c1180" dependencies = [ "indexmap 2.0.0", "itoa", From 8fa5e51ca0ecc945730a54e2506bb24ed6d1d87e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 18 Jul 2023 09:36:12 +0000 Subject: [PATCH 1375/2020] release: binstalk-manifests v0.7.0 (#1211) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cc069084..a40543a8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -321,7 +321,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.6.0" +version = "0.7.0" dependencies = [ "beef", "binstalk-types", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index f0f91c28..8c243f1d 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.13.0", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.6.0" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.7.0" } clap = { version = "4.3.0", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 1b094733..70b3e02a 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.6.0" +version = "0.7.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From 65d01f3199d88f0666a3b0ae77c71bfd4e7c1813 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 18 Jul 2023 09:42:38 +0000 Subject: [PATCH 1376/2020] release: binstalk-downloader v0.6.1 (#1212) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a40543a8..1e0ab8e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -285,7 +285,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.6.0" +version = "0.6.1" dependencies = [ "async-compression 0.4.1", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index e30acc62..25eb22e4 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.6.0" +version = "0.6.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index bc5c9cd4..da007196 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.6.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.6.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } cargo_toml = "0.15.3" command-group = { version = "2.1.0", features = ["with-tokio"] } From 61fdf16d7e297a6271f4a794e4f235dd3f983352 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 18 Jul 2023 11:30:43 +0000 Subject: [PATCH 1377/2020] release: binstalk v0.14.0 (#1213) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1e0ab8e4..b2e4f1e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -246,7 +246,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.13.0" +version = "0.14.0" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 8c243f1d..aee8f779 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.13.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.14.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.7.0" } clap = { version = "4.3.0", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index da007196..3bb22025 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.13.0" +version = "0.14.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From 83fdd053bff4684530d5a2581edaeab3dd0adb38 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 18 Jul 2023 22:56:33 +1000 Subject: [PATCH 1378/2020] Fix `release-pr.yml`: Do not `check-semver` for cargo-binstall release (#1214) Signed-off-by: Jiahao XU --- .github/workflows/release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 2967a306..fa624477 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -51,5 +51,5 @@ jobs: pr-label: release pr-release-notes: ${{ inputs.crate == 'bin' }} pr-template-file: .github/scripts/release-pr-template.ejs - check-semver: true + check-semver: ${{ inputs.crate != 'bin' }} check-package: true From 07bc44e059aa6c6bf53e35f4a367358e1d1edce6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 Jul 2023 00:13:32 +1000 Subject: [PATCH 1379/2020] release: cargo-binstall v1.1.0 (#1215) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b2e4f1e4..c520ff79 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -474,7 +474,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.0.0" +version = "1.1.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index aee8f779..5b57825d 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.0.0" +version = "1.1.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 1979291f..70808e07 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 47f79a966063be0605504906604f97dae0c12e99 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 19 Jul 2023 12:15:57 +1000 Subject: [PATCH 1380/2020] Fix loading `.cargo/config.toml` (#1217) Fixed #1216 Signed-off-by: Jiahao XU --- crates/bin/src/entry.rs | 4 ++-- crates/binstalk-manifests/src/cargo_config.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 4fa03672..a51f16b3 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -148,7 +148,7 @@ pub fn install_crates( index } else if let Some(registry_name) = args .registry - .or_else(|| config.registry.map(|registry| registry.default)) + .or_else(|| config.registry.and_then(|registry| registry.default)) { env::var(format!("CARGO_REGISTRIES_{registry_name}_INDEX")) .map(Cow::Owned) @@ -157,7 +157,7 @@ pub fn install_crates( .registries .as_ref() .and_then(|registries| registries.get(®istry_name)) - .map(|registry| Cow::Borrowed(registry.index.as_str())) + .and_then(|registry| registry.index.as_deref().map(Cow::Borrowed)) .ok_or_else(|| BinstallError::UnknownRegistryName(registry_name)) })? .parse() diff --git a/crates/binstalk-manifests/src/cargo_config.rs b/crates/binstalk-manifests/src/cargo_config.rs index 195650eb..21fac013 100644 --- a/crates/binstalk-manifests/src/cargo_config.rs +++ b/crates/binstalk-manifests/src/cargo_config.rs @@ -52,12 +52,12 @@ pub enum Env { #[derive(Debug, Deserialize)] pub struct Registry { - pub index: CompactString, + pub index: Option, } #[derive(Debug, Deserialize)] pub struct DefaultRegistry { - pub default: CompactString, + pub default: Option, } #[derive(Debug, Default, Deserialize)] From 494ff844e698d1590c61ab02eee8cf9b3fac0e70 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 Jul 2023 03:46:01 +0000 Subject: [PATCH 1381/2020] release: binstalk-manifests v0.8.0 (#1218) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c520ff79..6d43c1aa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -321,7 +321,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.7.0" +version = "0.8.0" dependencies = [ "beef", "binstalk-types", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 5b57825d..7c87b1a3 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.14.0", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.7.0" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.8.0" } clap = { version = "4.3.0", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 70b3e02a..dd75f57c 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.7.0" +version = "0.8.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From 3d6a93fe8e648214a52d9821fcbaf41aa4eea904 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 Jul 2023 05:07:52 +0000 Subject: [PATCH 1382/2020] release: cargo-binstall v1.1.1 (#1219) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6d43c1aa..84d5123c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -474,7 +474,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.1.0" +version = "1.1.1" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 7c87b1a3..00164393 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.1.0" +version = "1.1.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 70808e07..17381b1d 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From da1be0ab45990c2faf8e23a64d01ec1527eae4ff Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 20 Jul 2023 12:25:47 +1000 Subject: [PATCH 1383/2020] build(deps): update gix requirement from 0.48.0 to 0.49.1 in /crates/binstalk (#1220) build(deps): update gix requirement in /crates/binstalk Updates the requirements on [gix](https://github.com/Byron/gitoxide) to permit the latest version. - [Release notes](https://github.com/Byron/gitoxide/releases) - [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md) - [Commits](https://github.com/Byron/gitoxide/compare/gix-v0.48.0...gix-v0.49.1) --- updated-dependencies: - dependency-name: gix dependency-type: direct:production ... Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 203 +++++++++++++++++++++++-------------- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 129 insertions(+), 76 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 84d5123c..5355118b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1086,9 +1086,9 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "gix" -version = "0.48.0" +version = "0.49.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e74cea676de7f53a79f3c0365812b11f6814b81e671b8ee4abae6ca09c7881" +checksum = "3eb22530188fa1a6921b9f1aed3183357936e450ed060d65e578b46cd1c66a33" dependencies = [ "gix-actor", "gix-attributes", @@ -1098,8 +1098,9 @@ dependencies = [ "gix-date", "gix-diff", "gix-discover", - "gix-features", - "gix-fs", + "gix-features 0.32.0", + "gix-filter", + "gix-fs 0.4.0", "gix-glob", "gix-hash", "gix-hashtable", @@ -1137,9 +1138,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1969b77b9ee4cc1755c841987ec6f7622aaca95e952bcafb76973ae59d1b8716" +checksum = "1b2ec47eabd8edbb375e1c5cf11a2673805ae2ee02f797923fcefc3106d39f3b" dependencies = [ "bstr", "btoi", @@ -1151,9 +1152,9 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.14.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3772b0129dcd1fc73e985bbd08a1482d082097d2915cb1ee31ce8092b8e4434" +checksum = "f97977acd02cb3369833a428b38d74960fa90dc6f58312e54e9388f293b0d93b" dependencies = [ "bstr", "gix-glob", @@ -1186,22 +1187,22 @@ dependencies = [ [[package]] name = "gix-command" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb49ab557a37b0abb2415bca2b10e541277dff0565deb5bd5e99fd95f93f51eb" +checksum = "378d6a93c87616a58f2c5b40ed0ca554255ba4ce3aa35cf1d597b270d06756a7" dependencies = [ "bstr", ] [[package]] name = "gix-commitgraph" -version = "0.17.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed42baa50075d41c1a0931074ce1a97c5797c7c6fe7591d9f1f2dcd448532c26" +checksum = "c9792d974e0a54e4655b676058e0b84a76e380fa82405f296734c1f943c5c8a5" dependencies = [ "bstr", "gix-chunk", - "gix-features", + "gix-features 0.32.0", "gix-hash", "memmap2", "thiserror", @@ -1209,13 +1210,13 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "817688c7005a716d9363e267913526adea402dabd947f4ba63842d10cc5132af" +checksum = "cfc134ddb07881832e50620f4b3dc0e5cb6734b80509d582a0c2bd31869f8f7f" dependencies = [ "bstr", "gix-config-value", - "gix-features", + "gix-features 0.32.0", "gix-glob", "gix-path", "gix-ref", @@ -1231,9 +1232,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83960be5e99266bcf55dae5a24731bbd39f643bfb68f27e939d6b06836b5b87d" +checksum = "731170f6ada8932ddd990548f98354cc1d027509caddfdf0c8e2c0c5e94d7d1b" dependencies = [ "bitflags 2.3.3", "bstr", @@ -1244,9 +1245,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.16.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75a75565e0e6e7f80cfa4eb1b05cc448c6846ddd48dcf413a28875fbc11ee9af" +checksum = "0696fcd658b6526beff1c2716d3c94466eb2dbfaf1ecf8d961883884b687ce6d" dependencies = [ "bstr", "gix-command", @@ -1272,9 +1273,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf5d9b9b521b284ebe53ee69eee33341835ec70edc314f36b2100ea81396121" +checksum = "accf7bfad64777ab5297bd918431f359fb39eb1d519743c2059ba5af7a513229" dependencies = [ "gix-hash", "gix-object", @@ -1284,9 +1285,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.21.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "272aad20dc63dedba76615373dd8885fb5aebe4795e5b5b0aa2a24e63c82085c" +checksum = "78ddcd031c607da6acb52f6c8e3c0a50cc444ed03d444d22c6a2a772ea70a051" dependencies = [ "bstr", "dunce", @@ -1302,6 +1303,17 @@ name = "gix-features" version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06142d8cff5d17509399b04052b64d2f9b3a311d5cff0b1a32b220f62cd0d595" +dependencies = [ + "gix-hash", + "gix-trace", + "libc", +] + +[[package]] +name = "gix-features" +version = "0.32.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f708dc9875d1b3e05c1cbadfd22e5b543c733c511191798587ec479115664221" dependencies = [ "bytes", "bytesize", @@ -1321,24 +1333,53 @@ dependencies = [ "walkdir", ] +[[package]] +name = "gix-filter" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8c9b3fc103a4976e4991ad949a9929fe6da5499e9f788b7f207471ec21763c7" +dependencies = [ + "bstr", + "encoding_rs", + "gix-attributes", + "gix-command", + "gix-hash", + "gix-object", + "gix-packetline-blocking", + "gix-path", + "gix-quote", + "gix-trace", + "smallvec", + "thiserror", +] + [[package]] name = "gix-fs" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb15956bc0256594c62a2399fcf6958a02a11724217eddfdc2b49b21b6292496" dependencies = [ - "gix-features", + "gix-features 0.31.1", +] + +[[package]] +name = "gix-fs" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ca81d3888c5b0ac908cbe6ee975451b117b475324987f8aecf42bc5d9e4279" +dependencies = [ + "gix-features 0.32.0", ] [[package]] name = "gix-glob" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c18bdff83143d61e7d60da6183b87542a870d026b2a2d0b30170b8e9c0cd321a" +checksum = "b1ddc03b04f2ef410e156c90d05080651e06f617a2d083030a5daff5e6fe0b88" dependencies = [ "bitflags 2.3.3", "bstr", - "gix-features", + "gix-features 0.32.0", "gix-path", ] @@ -1365,9 +1406,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca801f2d0535210f77b33e2c067d565aedecacc82f1b3dbce26da1388ebc4634" +checksum = "65ffd8e8860fd2eff53038101828fe8d19e5aad9dc869d9f1fbea825cf2830cf" dependencies = [ "bstr", "gix-glob", @@ -1377,16 +1418,16 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68099abdf6ee50ae3c897e8b05de96871cbe54d52a37cdf559101f911b883562" +checksum = "e447ecb5c8365cdd1d8fe55d6cb047279657ef1747c4347755a4b64ff3b2f0d6" dependencies = [ "bitflags 2.3.3", "bstr", "btoi", "filetime", "gix-bitmap", - "gix-features", + "gix-features 0.32.0", "gix-hash", "gix-lock", "gix-object", @@ -1410,9 +1451,9 @@ dependencies = [ [[package]] name = "gix-mailmap" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1787e3c37fc43b1f7c0e3be6196c6837b3ba5f869190dfeaa444b816f0a7f34b" +checksum = "fe5a913fd8f56ea21cbd3b8bf813e0b410771682a065a14a4e9dede1012cd532" dependencies = [ "bstr", "gix-actor", @@ -1422,9 +1463,9 @@ dependencies = [ [[package]] name = "gix-negotiate" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e7bce64d4452dd609f44d04b14b29da2e0ad2c45fcdf4ce1472a5f5f8ec21c2" +checksum = "945302d90a0519a31acc42e7584d1e08156ef59b179e3bbf1fd9c0e40d819e64" dependencies = [ "bitflags 2.3.3", "gix-commitgraph", @@ -1438,15 +1479,15 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953f3d7ffad16734aa3ab1d05807972c80e339d1bd9dde03e0198716b99e2a6" +checksum = "bf32d43ccbeb9f2f54a74ee0a4b6a37143b0ba18a22288f4b790869cce232c46" dependencies = [ "bstr", "btoi", "gix-actor", "gix-date", - "gix-features", + "gix-features 0.32.0", "gix-hash", "gix-validate", "hex", @@ -1458,13 +1499,13 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.49.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6418cff00ecc2713b58c8e04bff30dda808fbba1a080e7248b299d069894a01" +checksum = "892c87273faa345ea12438c4ce2b89be15ae4abfda383035b8a3950965327d97" dependencies = [ "arc-swap", "gix-date", - "gix-features", + "gix-features 0.32.0", "gix-hash", "gix-object", "gix-pack", @@ -1477,14 +1518,14 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.39.1" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414935138d90043ea5898de7a93f02c2558e52652492719470e203ef26a8fd0a" +checksum = "3163c2bdbb1ec45a717b5bbab69d715b2a5711c19f91f9a3045c6f805cc59c83" dependencies = [ "clru", "gix-chunk", "gix-diff", - "gix-features", + "gix-features 0.32.0", "gix-hash", "gix-hashtable", "gix-object", @@ -1509,6 +1550,17 @@ dependencies = [ "thiserror", ] +[[package]] +name = "gix-packetline-blocking" +version = "0.16.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aef45b51fba629b588c3c50b57c815edebd5dddf7daa33736c33f160f9a64f34" +dependencies = [ + "bstr", + "hex", + "thiserror", +] + [[package]] name = "gix-path" version = "0.8.3" @@ -1524,28 +1576,28 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dfd363fd89a40c1e7bff9c9c1b136cd2002480f724b0c627c1bc771cd5480ec" +checksum = "abe84674ac2473f98dea1832f727ddb16acbff3262dbf226f0a9be188b9a922b" dependencies = [ "gix-command", "gix-config-value", "parking_lot", - "rustix 0.37.23", + "rustix 0.38.4", "thiserror", ] [[package]] name = "gix-protocol" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed7069fac7eb23b043b4bd7890df1e244cb370c3fe8b2ff482203d36b4fd4099" +checksum = "f543b1c3079db3b04524da66ecca3dc304a426726506ac2493fcbe4d7eccc94e" dependencies = [ "bstr", "btoi", "gix-credentials", "gix-date", - "gix-features", + "gix-features 0.32.0", "gix-hash", "gix-transport", "maybe-async", @@ -1566,14 +1618,14 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39453f4e5f23cddc2e6e4cca2ba20adfdbec29379e3ca829714dfe98ae068ccd" +checksum = "e368f5368279e97148a6214ec534bfebd1f29a0fe344947d92f488397bb27a08" dependencies = [ "gix-actor", "gix-date", - "gix-features", - "gix-fs", + "gix-features 0.32.0", + "gix-fs 0.4.0", "gix-hash", "gix-lock", "gix-object", @@ -1587,9 +1639,9 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e76ff1f82fba295a121e31ab02f69642994e532c45c0c899aa393f4b740302" +checksum = "df521f8fc9cbd82d9abb01b8047b653de1e58c9b4b919d63218d7da2a9cd91d7" dependencies = [ "bstr", "gix-hash", @@ -1601,9 +1653,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237428a7d3978e8572964e1e45d984027c2acc94df47e594baa6c4b0da7c9922" +checksum = "1503e94badcbb9d8dc6ea3063522798913ead8f37f564f2cc335eff572208178" dependencies = [ "bstr", "gix-date", @@ -1616,9 +1668,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "028d50fcaf8326a8f79a359490d9ca9fb4e2b51ac9ac86503560d0bcc888d2eb" +checksum = "3f43049c861d0de876d9022f61fddca4081f17c51d4dc5f7541621a076cb3218" dependencies = [ "gix-commitgraph", "gix-date", @@ -1647,7 +1699,7 @@ version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fac8310c17406ea619af72f42ee46dac795110f68f41b4f4fa231b69889c6a2" dependencies = [ - "gix-fs", + "gix-fs 0.3.0", "libc", "once_cell", "parking_lot", @@ -1664,15 +1716,15 @@ checksum = "103eac621617be3ebe0605c9065ca51a223279a23218aaf67d10daa6e452f663" [[package]] name = "gix-transport" -version = "0.33.1" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0929bb80a07c04033edd4585091c4db9ea458cb932e883bf22efb146ebfbdc89" +checksum = "ae8694dcc1719cea69a0a8306c983e122787234911bdec3048c4b1c7f5245006" dependencies = [ "base64 0.21.2", "bstr", "gix-command", "gix-credentials", - "gix-features", + "gix-features 0.32.0", "gix-packetline", "gix-quote", "gix-sec", @@ -1683,9 +1735,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3cdfd54598db4fae57d5ae6f52958422b2d13382d2745796bfe5c8015ffa86e" +checksum = "be19057a9ddef95af02d32b8b8d953cf974c4d378918e5e97d7345b843e0c271" dependencies = [ "gix-commitgraph", "gix-date", @@ -1699,12 +1751,12 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beaede6dbc83f408b19adfd95bb52f1dbf01fb8862c3faf6c6243e2e67fcdfa1" +checksum = "092d3f8f4040ee1b82830224e9002fff69248348af27dfdbcc8536db80283945" dependencies = [ "bstr", - "gix-features", + "gix-features 0.32.0", "gix-path", "home", "thiserror", @@ -1732,15 +1784,16 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.21.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1363b9aa66b9e14412ac04e1f759827203f491729d92172535a8ce6cde02efa" +checksum = "07b773e8e249c13fce5757b15e2620078adfec9dcfbfc7d243fbabf5bb49f121" dependencies = [ "bstr", "filetime", "gix-attributes", - "gix-features", - "gix-fs", + "gix-features 0.32.0", + "gix-filter", + "gix-fs 0.4.0", "gix-glob", "gix-hash", "gix-ignore", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 3bb22025..48451c6e 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -18,7 +18,7 @@ command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.8", path = "../detect-targets" } either = "1.8.1" -gix = { version = "0.48.0", features = ["blocking-http-transport-reqwest-rust-tls"], optional = true } +gix = { version = "0.49.1", features = ["blocking-http-transport-reqwest-rust-tls"], optional = true } glob = "0.3.1" home = "0.5.5" itertools = "0.11.0" From af9a57473848540ca3d42ba112a021ef971c7a5f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 21 Jul 2023 14:12:46 +1000 Subject: [PATCH 1384/2020] dep: Upgrade transitive dependencies (#1223) Co-authored-by: github-actions --- Cargo.lock | 208 ++++++++++++++++++----------------------------------- 1 file changed, 69 insertions(+), 139 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5355118b..b99f4720 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -162,8 +162,8 @@ dependencies = [ "pin-project-lite", "tokio", "xz2", - "zstd 0.12.3+zstd.1.5.2", - "zstd-safe 6.0.5+zstd.1.5.4", + "zstd 0.12.4", + "zstd-safe 6.0.6", ] [[package]] @@ -174,7 +174,7 @@ checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.27", ] [[package]] @@ -316,7 +316,7 @@ dependencies = [ "trust-dns-resolver", "url", "xz2", - "zstd 0.12.3+zstd.1.5.2", + "zstd 0.12.4", ] [[package]] @@ -538,9 +538,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.15" +version = "4.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f644d0dac522c8b05ddc39aaaccc5b136d5dc4ff216610c5641e3be5becf56c" +checksum = "5b0827b011f6f8ab38590295339817b0d26f344aa4932c3ced71b45b0c54b4a9" dependencies = [ "clap_builder", "clap_derive", @@ -549,9 +549,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.15" +version = "4.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af410122b9778e024f9e0fb35682cc09cc3f85cad5e8d3ba8f47a9702df6e73d" +checksum = "9441b403be87be858db6a23edb493e7f694761acdc3343d5a0fcaafd304cbc9e" dependencies = [ "anstream", "anstyle", @@ -568,7 +568,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.27", ] [[package]] @@ -874,15 +874,6 @@ dependencies = [ "libc", ] -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - [[package]] name = "fastrand" version = "2.0.0" @@ -961,7 +952,7 @@ version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" dependencies = [ - "rustix 0.38.4", + "rustix", "windows-sys", ] @@ -1004,7 +995,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.27", ] [[package]] @@ -1098,9 +1089,9 @@ dependencies = [ "gix-date", "gix-diff", "gix-discover", - "gix-features 0.32.0", + "gix-features", "gix-filter", - "gix-fs 0.4.0", + "gix-fs", "gix-glob", "gix-hash", "gix-hashtable", @@ -1202,7 +1193,7 @@ checksum = "c9792d974e0a54e4655b676058e0b84a76e380fa82405f296734c1f943c5c8a5" dependencies = [ "bstr", "gix-chunk", - "gix-features 0.32.0", + "gix-features", "gix-hash", "memmap2", "thiserror", @@ -1216,7 +1207,7 @@ checksum = "cfc134ddb07881832e50620f4b3dc0e5cb6734b80509d582a0c2bd31869f8f7f" dependencies = [ "bstr", "gix-config-value", - "gix-features 0.32.0", + "gix-features", "gix-glob", "gix-path", "gix-ref", @@ -1298,17 +1289,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "gix-features" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06142d8cff5d17509399b04052b64d2f9b3a311d5cff0b1a32b220f62cd0d595" -dependencies = [ - "gix-hash", - "gix-trace", - "libc", -] - [[package]] name = "gix-features" version = "0.32.0" @@ -1353,22 +1333,13 @@ dependencies = [ "thiserror", ] -[[package]] -name = "gix-fs" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb15956bc0256594c62a2399fcf6958a02a11724217eddfdc2b49b21b6292496" -dependencies = [ - "gix-features 0.31.1", -] - [[package]] name = "gix-fs" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86ca81d3888c5b0ac908cbe6ee975451b117b475324987f8aecf42bc5d9e4279" dependencies = [ - "gix-features 0.32.0", + "gix-features", ] [[package]] @@ -1379,7 +1350,7 @@ checksum = "b1ddc03b04f2ef410e156c90d05080651e06f617a2d083030a5daff5e6fe0b88" dependencies = [ "bitflags 2.3.3", "bstr", - "gix-features 0.32.0", + "gix-features", "gix-path", ] @@ -1427,7 +1398,7 @@ dependencies = [ "btoi", "filetime", "gix-bitmap", - "gix-features 0.32.0", + "gix-features", "gix-hash", "gix-lock", "gix-object", @@ -1487,7 +1458,7 @@ dependencies = [ "btoi", "gix-actor", "gix-date", - "gix-features 0.32.0", + "gix-features", "gix-hash", "gix-validate", "hex", @@ -1505,7 +1476,7 @@ checksum = "892c87273faa345ea12438c4ce2b89be15ae4abfda383035b8a3950965327d97" dependencies = [ "arc-swap", "gix-date", - "gix-features 0.32.0", + "gix-features", "gix-hash", "gix-object", "gix-pack", @@ -1525,7 +1496,7 @@ dependencies = [ "clru", "gix-chunk", "gix-diff", - "gix-features 0.32.0", + "gix-features", "gix-hash", "gix-hashtable", "gix-object", @@ -1583,7 +1554,7 @@ dependencies = [ "gix-command", "gix-config-value", "parking_lot", - "rustix 0.38.4", + "rustix", "thiserror", ] @@ -1597,7 +1568,7 @@ dependencies = [ "btoi", "gix-credentials", "gix-date", - "gix-features 0.32.0", + "gix-features", "gix-hash", "gix-transport", "maybe-async", @@ -1624,8 +1595,8 @@ checksum = "e368f5368279e97148a6214ec534bfebd1f29a0fe344947d92f488397bb27a08" dependencies = [ "gix-actor", "gix-date", - "gix-features 0.32.0", - "gix-fs 0.4.0", + "gix-features", + "gix-fs", "gix-hash", "gix-lock", "gix-object", @@ -1695,11 +1666,11 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "7.0.0" +version = "7.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fac8310c17406ea619af72f42ee46dac795110f68f41b4f4fa231b69889c6a2" +checksum = "ce3aa96fec73f19aeec8f46c71bf3c00dd82e0668558930b3b914c0d98dabd65" dependencies = [ - "gix-fs 0.3.0", + "gix-fs", "libc", "once_cell", "parking_lot", @@ -1724,7 +1695,7 @@ dependencies = [ "bstr", "gix-command", "gix-credentials", - "gix-features 0.32.0", + "gix-features", "gix-packetline", "gix-quote", "gix-sec", @@ -1756,7 +1727,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "092d3f8f4040ee1b82830224e9002fff69248348af27dfdbcc8536db80283945" dependencies = [ "bstr", - "gix-features 0.32.0", + "gix-features", "gix-path", "home", "thiserror", @@ -1769,7 +1740,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7058c94f4164fcf5b8457d35f6d8f6e1007f9f7f938c9c7684a7e01d23c6ddde" dependencies = [ - "fastrand 2.0.0", + "fastrand", ] [[package]] @@ -1791,9 +1762,9 @@ dependencies = [ "bstr", "filetime", "gix-attributes", - "gix-features 0.32.0", + "gix-features", "gix-filter", - "gix-fs 0.4.0", + "gix-fs", "gix-glob", "gix-hash", "gix-ignore", @@ -2036,15 +2007,6 @@ dependencies = [ "hashbrown 0.14.0", ] -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - [[package]] name = "io-close" version = "0.3.7" @@ -2055,17 +2017,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys", -] - [[package]] name = "ioctl-sys" version = "0.8.0" @@ -2097,7 +2048,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi", - "rustix 0.38.4", + "rustix", "windows-sys", ] @@ -2195,7 +2146,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.27", ] [[package]] @@ -2230,12 +2181,6 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - [[package]] name = "linux-raw-sys" version = "0.4.3" @@ -2363,7 +2308,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.27", ] [[package]] @@ -2463,9 +2408,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", ] @@ -2527,7 +2472,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.27", ] [[package]] @@ -2612,7 +2557,7 @@ checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.27", ] [[package]] @@ -2944,20 +2889,6 @@ dependencies = [ "semver", ] -[[package]] -name = "rustix" -version = "0.37.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" -dependencies = [ - "bitflags 1.3.2", - "errno 0.3.1", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys", -] - [[package]] name = "rustix" version = "0.38.4" @@ -2967,7 +2898,7 @@ dependencies = [ "bitflags 2.3.3", "errno 0.3.1", "libc", - "linux-raw-sys 0.4.3", + "linux-raw-sys", "windows-sys", ] @@ -3115,9 +3046,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.171" +version = "1.0.173" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" +checksum = "e91f70896d6720bc714a4a57d22fc91f1db634680e65c8efe13323f1fa38d53f" dependencies = [ "serde_derive", ] @@ -3133,13 +3064,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.171" +version = "1.0.173" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" +checksum = "a6250dde8342e0232232be9ca3db7aa40aceb5a3e5dd9bddbc00d99a007cde49" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.27", ] [[package]] @@ -3176,9 +3107,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.9.24" +version = "0.9.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5f51e3fdb5b9cdd1577e1cb7a733474191b1aca6a72c2e50913241632c1180" +checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" dependencies = [ "indexmap 2.0.0", "itoa", @@ -3225,9 +3156,9 @@ dependencies = [ [[package]] name = "signal-hook" -version = "0.3.16" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b824b6e687aff278cdbf3b36f07aa52d4bd4099699324d5da86a2ebce3aa00b3" +checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" dependencies = [ "libc", "signal-hook-registry", @@ -3317,7 +3248,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.26", + "syn 2.0.27", ] [[package]] @@ -3361,9 +3292,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.26" +version = "2.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c3457aacde3c65315de5031ec191ce46604304d2446e803d71ade03308d970" +checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" dependencies = [ "proc-macro2", "quote", @@ -3372,21 +3303,20 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.9" +version = "0.12.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df8e77cb757a61f51b947ec4a7e3646efd825b73561db1c232a8ccb639e611a0" +checksum = "1d2faeef5759ab89935255b1a4cd98e0baf99d1085e37d36599c625dac49ae8e" [[package]] name = "tempfile" -version = "3.6.0" +version = "3.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" dependencies = [ - "autocfg", "cfg-if", - "fastrand 1.9.0", + "fastrand", "redox_syscall 0.3.5", - "rustix 0.37.23", + "rustix", "windows-sys", ] @@ -3428,7 +3358,7 @@ checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.27", ] [[package]] @@ -3513,7 +3443,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.27", ] [[package]] @@ -3672,7 +3602,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.27", ] [[package]] @@ -3972,7 +3902,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.27", "wasm-bindgen-shared", ] @@ -4006,7 +3936,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.26", + "syn 2.0.27", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4314,11 +4244,11 @@ dependencies = [ [[package]] name = "zstd" -version = "0.12.3+zstd.1.5.2" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76eea132fb024e0e13fd9c2f5d5d595d8a967aa72382ac2f9d39fcc95afd0806" +checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" dependencies = [ - "zstd-safe 6.0.5+zstd.1.5.4", + "zstd-safe 6.0.6", ] [[package]] @@ -4333,9 +4263,9 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "6.0.5+zstd.1.5.4" +version = "6.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d56d9e60b4b1758206c238a10165fbcae3ca37b01744e394c463463f6529d23b" +checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" dependencies = [ "libc", "zstd-sys", From 306f7619731aec977d6370da8c0c8f32192fb77a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 21 Jul 2023 15:41:09 +1000 Subject: [PATCH 1385/2020] Fix failure to send quickinstall report (#1224) Fixed #1222 by fetching lists of supported targets from quickinstall repository. Signed-off-by: Jiahao XU --- crates/binstalk/src/fetchers/quickinstall.rs | 104 ++++++++++++++++++- 1 file changed, 102 insertions(+), 2 deletions(-) diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs index a6850f5f..273fd720 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk/src/fetchers/quickinstall.rs @@ -1,6 +1,7 @@ use std::{path::Path, sync::Arc}; use compact_str::CompactString; +use tokio::sync::OnceCell; use tracing::{debug, warn}; use url::Url; @@ -21,9 +22,39 @@ use super::{Data, TargetData}; const BASE_URL: &str = "https://github.com/cargo-bins/cargo-quickinstall/releases/download"; const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; +const QUICKINSTALL_SUPPORTED_TARGETS_URL: &str = + "https://raw.githubusercontent.com/cargo-bins/cargo-quickinstall/main/supported-targets"; + +async fn get_quickinstall_supported_targets( + client: &Client, +) -> Result<&'static [CompactString], BinstallError> { + static SUPPORTED_TARGETS: OnceCell> = OnceCell::const_new(); + + SUPPORTED_TARGETS + .get_or_try_init(|| async { + let bytes = client + .get(Url::parse(QUICKINSTALL_SUPPORTED_TARGETS_URL)?) + .send(true) + .await? + .bytes() + .await?; + + let mut v: Vec = String::from_utf8_lossy(&bytes) + .split_whitespace() + .map(CompactString::new) + .collect(); + v.sort_unstable(); + v.dedup(); + Ok(v.into()) + }) + .await + .map(Box::as_ref) +} + pub struct QuickInstall { client: Client, gh_api_client: GhApiClient, + is_supported_v: OnceCell, package: String, package_url: Url, @@ -32,6 +63,20 @@ pub struct QuickInstall { target_data: Arc, } +impl QuickInstall { + async fn is_supported(&self) -> Result { + self.is_supported_v + .get_or_try_init(|| async { + Ok(get_quickinstall_supported_targets(&self.client) + .await? + .binary_search(&CompactString::new(&self.target_data.target)) + .is_ok()) + }) + .await + .copied() + } +} + #[async_trait::async_trait] impl super::Fetcher for QuickInstall { fn new( @@ -49,6 +94,7 @@ impl super::Fetcher for QuickInstall { Arc::new(Self { client, gh_api_client, + is_supported_v: OnceCell::new(), package_url: Url::parse(&format!( "{BASE_URL}/{crate_name}-{version}/{package}.tar.gz", @@ -64,7 +110,7 @@ impl super::Fetcher for QuickInstall { fn find(self: Arc) -> AutoAbortJoinHandle> { AutoAbortJoinHandle::spawn(async move { - if is_universal_macos(&self.target_data.target) { + if !self.is_supported().await? { return Ok(false); } @@ -87,7 +133,7 @@ and universal2-apple-darwin. Quickinstall does not support these targets, it only supports targets supported by rust officially."#, ); - } else { + } else if self.is_supported_v.get().copied() != Some(false) { tokio::spawn(async move { if let Err(err) = self.report().await { warn!( @@ -141,6 +187,15 @@ by rust officially."#, impl QuickInstall { pub async fn report(&self) -> Result<(), BinstallError> { + if !self.is_supported().await? { + debug!( + "Not sending quickinstall report for {} since Quickinstall does not support these targets.", + self.target_data.target + ); + + return Ok(()); + } + let url = self.stats_url.clone(); debug!("Sending installation report to quickinstall ({url})"); @@ -149,3 +204,48 @@ impl QuickInstall { Ok(()) } } + +#[cfg(test)] +mod test { + use super::{get_quickinstall_supported_targets, Client, CompactString}; + use std::time::Duration; + + /// Mark this as an async fn so that you won't accidentally use it in + /// sync context. + async fn create_client() -> Client { + Client::new( + concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), + None, + Duration::from_millis(10), + 1.try_into().unwrap(), + [], + ) + .unwrap() + } + + #[tokio::test] + async fn test_get_quickinstall_supported_targets() { + let supported_targets = get_quickinstall_supported_targets(&create_client().await) + .await + .unwrap(); + + [ + "x86_64-pc-windows-msvc", + "x86_64-apple-darwin", + "aarch64-apple-darwin", + "x86_64-unknown-linux-gnu", + "x86_64-unknown-linux-musl", + "aarch64-unknown-linux-gnu", + "aarch64-unknown-linux-musl", + "aarch64-pc-windows-msvc", + "armv7-unknown-linux-musleabihf", + "armv7-unknown-linux-gnueabihf", + ] + .into_iter() + .for_each(|known_supported_target| { + supported_targets + .binary_search(&CompactString::new(known_supported_target)) + .unwrap(); + }); + } +} From 992ac08dfc02d0184d6ae4bfd05199d53b989644 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 21 Jul 2023 07:57:28 +0000 Subject: [PATCH 1386/2020] release: binstalk v0.14.1 (#1226) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b99f4720..7beb7f24 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -246,7 +246,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.14.0" +version = "0.14.1" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 00164393..87ff4ecb 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.14.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.14.1", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.8.0" } clap = { version = "4.3.0", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 48451c6e..c973e605 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.14.0" +version = "0.14.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From 38d37c69b24972477426c65f7a5adce24b27b20a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 21 Jul 2023 10:14:47 +0000 Subject: [PATCH 1387/2020] release: cargo-binstall v1.1.2 (#1227) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7beb7f24..b95493df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -474,7 +474,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.1.1" +version = "1.1.2" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 87ff4ecb..851362c1 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.1.1" +version = "1.1.2" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 17381b1d..bcb726e6 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 129331410058e5d66b3955201c53e76ff8b61386 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 23 Jul 2023 14:28:59 +1000 Subject: [PATCH 1388/2020] feature: Add fallback `x86_64h-apple-darwin` and fallback for it (#1228) Now `detect_targets` would fallback to `x86_64h-apple-darwin` on `aarch64-apple-darwin`. It also provides fallback to `x86_64h-apple-darwin` to `x86_64-apple-darwin` and universal targets. Signed-off-by: Jiahao XU --- crates/detect-targets/src/detect/macos.rs | 38 +++++++++++++++++------ 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/crates/detect-targets/src/detect/macos.rs b/crates/detect-targets/src/detect/macos.rs index dccd6b65..289483f1 100644 --- a/crates/detect-targets/src/detect/macos.rs +++ b/crates/detect-targets/src/detect/macos.rs @@ -4,6 +4,20 @@ use tokio::process::Command; const AARCH64: &str = "aarch64-apple-darwin"; const X86: &str = "x86_64-apple-darwin"; +/// https://doc.rust-lang.org/nightly/rustc/platform-support/x86_64h-apple-darwin.html +/// +/// This target is an x86_64 target that only supports Apple's late-gen +/// (Haswell-compatible) Intel chips. +/// +/// It enables a set of target features available on these chips (AVX2 and similar), +/// and MachO binaries built with this target may be used as the x86_64h entry in +/// universal binaries ("fat" MachO binaries), and will fail to load on machines +/// that do not support this. +/// +/// It is similar to x86_64-apple-darwin in nearly all respects, although +/// the minimum supported OS version is slightly higher (it requires 10.8 +/// rather than x86_64-apple-darwin's 10.7). +const X86H: &str = "x86_64h-apple-darwin"; const UNIVERSAL: &str = "universal-apple-darwin"; const UNIVERSAL2: &str = "universal2-apple-darwin"; @@ -13,8 +27,7 @@ async fn is_x86_64_supported() -> io::Result { .stdin(Stdio::null()) .stdout(Stdio::null()) .stderr(Stdio::null()) - .spawn()? - .wait() + .status() .await?; Ok(exit_status.success()) @@ -22,13 +35,20 @@ async fn is_x86_64_supported() -> io::Result { pub(super) async fn detect_alternative_targets(target: &str) -> impl Iterator { match target { - AARCH64 => [ - is_x86_64_supported().await.unwrap_or(false).then_some(X86), - Some(UNIVERSAL), - Some(UNIVERSAL2), - ], - X86 => [Some(UNIVERSAL), Some(UNIVERSAL2), None], - _ => [None, None, None], + AARCH64 => { + let is_x86_64_supported = is_x86_64_supported().await.unwrap_or(false); + [ + // Prefer universal as it provides native arm executable + Some(UNIVERSAL), + Some(UNIVERSAL2), + // Prefer x86h since it is more optimized + is_x86_64_supported.then_some(X86H), + is_x86_64_supported.then_some(X86), + ] + } + X86 => [Some(UNIVERSAL), Some(UNIVERSAL2), None, None], + X86H => [Some(X86), Some(UNIVERSAL), Some(UNIVERSAL2), None], + _ => [None, None, None, None], } .into_iter() .flatten() From ec494261c63f034bb0258fcc6073c7e52aa8a777 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 24 Jul 2023 17:13:55 +1000 Subject: [PATCH 1389/2020] build(deps): update gix requirement from 0.49.1 to 0.50.0 in /crates/binstalk (#1230) build(deps): update gix requirement in /crates/binstalk Updates the requirements on [gix](https://github.com/Byron/gitoxide) to permit the latest version. - [Release notes](https://github.com/Byron/gitoxide/releases) - [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md) - [Commits](https://github.com/Byron/gitoxide/compare/gix-v0.49.1...gix-v0.50.0) --- updated-dependencies: - dependency-name: gix dependency-type: direct:production ... Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 212 +++++++++++++++++------------ crates/binstalk/Cargo.toml | 2 +- crates/binstalk/src/helpers/git.rs | 2 +- 3 files changed, 125 insertions(+), 91 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b95493df..1c7b675f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1077,11 +1077,12 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "gix" -version = "0.49.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb22530188fa1a6921b9f1aed3183357936e450ed060d65e578b46cd1c66a33" +checksum = "41e278c81b66e27876235fe5415da6fa709b2c8c82e1d1387c30c426982aa6a7" dependencies = [ "gix-actor", + "gix-archive", "gix-attributes", "gix-commitgraph", "gix-config", @@ -1118,6 +1119,7 @@ dependencies = [ "gix-utils", "gix-validate", "gix-worktree", + "gix-worktree-stream", "log", "once_cell", "reqwest", @@ -1129,9 +1131,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b2ec47eabd8edbb375e1c5cf11a2673805ae2ee02f797923fcefc3106d39f3b" +checksum = "c7606482631d56cc6bfba3394ae42fc64927635024298befbb7923b6144774e8" dependencies = [ "bstr", "btoi", @@ -1142,10 +1144,23 @@ dependencies = [ ] [[package]] -name = "gix-attributes" -version = "0.15.0" +name = "gix-archive" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f97977acd02cb3369833a428b38d74960fa90dc6f58312e54e9388f293b0d93b" +checksum = "238218ac18c1a82cc63d229db3707fb26171b87656e3b9c7f701cf336c35c483" +dependencies = [ + "bstr", + "gix-date", + "gix-object", + "gix-worktree-stream", + "thiserror", +] + +[[package]] +name = "gix-attributes" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63a134a674e39e238bd273326a9815296cc71f867ad5466518da71392cff98ce" dependencies = [ "bstr", "gix-glob", @@ -1160,36 +1175,36 @@ dependencies = [ [[package]] name = "gix-bitmap" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "311e2fa997be6560c564b070c5da2d56d038b645a94e1e5796d5d85a350da33c" +checksum = "0aa8bbde7551a9e3e783a2871f53bbb0f50aac7a77db5680c8709f69e8ce724f" dependencies = [ "thiserror", ] [[package]] name = "gix-chunk" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39db5ed0fc0a2e9b1b8265993f7efdbc30379dec268f3b91b7af0c2de4672fdd" +checksum = "5b42ea64420f7994000130328f3c7a2038f639120518870436d31b8bde704493" dependencies = [ "thiserror", ] [[package]] name = "gix-command" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "378d6a93c87616a58f2c5b40ed0ca554255ba4ce3aa35cf1d597b270d06756a7" +checksum = "2783ad148fb16bf9cfd46423706ba552a62a4d4a18fda5dd07648eb0228862dd" dependencies = [ "bstr", ] [[package]] name = "gix-commitgraph" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9792d974e0a54e4655b676058e0b84a76e380fa82405f296734c1f943c5c8a5" +checksum = "c4c2d5ce99eba59fe9477a9e3037b0e1d0266d53925cc4b322bc06c566589b99" dependencies = [ "bstr", "gix-chunk", @@ -1201,9 +1216,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfc134ddb07881832e50620f4b3dc0e5cb6734b80509d582a0c2bd31869f8f7f" +checksum = "b51e83bd9d08118e0ff06ea14be953c418b4c056e57d93c8103e777584e48b0a" dependencies = [ "bstr", "gix-config-value", @@ -1223,9 +1238,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "731170f6ada8932ddd990548f98354cc1d027509caddfdf0c8e2c0c5e94d7d1b" +checksum = "6e874f41437441c02991dcea76990b9058fadfc54b02ab4dd06ab2218af43897" dependencies = [ "bitflags 2.3.3", "bstr", @@ -1236,9 +1251,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.17.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0696fcd658b6526beff1c2716d3c94466eb2dbfaf1ecf8d961883884b687ce6d" +checksum = "307d91ec5f7c8e9bfaa217fe30c2e0099101cbe83dbed27a222dbb6def38725f" dependencies = [ "bstr", "gix-command", @@ -1252,9 +1267,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9a04a1d2387c955ec91059d56b673000dd24f3c07cad08ed253e36381782bf" +checksum = "56b0312dba1ad003d9b8c502bed52fbcf106f8de3a9a26bfa7b45642a6f94b72" dependencies = [ "bstr", "itoa", @@ -1264,9 +1279,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.33.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accf7bfad64777ab5297bd918431f359fb39eb1d519743c2059ba5af7a513229" +checksum = "9a49d7a9a9ed5ec3428c3061da45d0fc5f50b3c07b91ea4e7ec4959668f25f6c" dependencies = [ "gix-hash", "gix-object", @@ -1276,9 +1291,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddcd031c607da6acb52f6c8e3c0a50cc444ed03d444d22c6a2a772ea70a051" +checksum = "041480eb03d8aa0894d9b73d25d182d51bc4d0ea8925a6ee0c971262bbc7715e" dependencies = [ "bstr", "dunce", @@ -1291,9 +1306,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f708dc9875d1b3e05c1cbadfd22e5b543c733c511191798587ec479115664221" +checksum = "882695cccf38da4c3cc7ee687bdb412cf25e37932d7f8f2c306112ea712449f1" dependencies = [ "bytes", "bytesize", @@ -1315,9 +1330,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8c9b3fc103a4976e4991ad949a9929fe6da5499e9f788b7f207471ec21763c7" +checksum = "ef4d4d61f2ab07de4612f8e078d7f1a443c7ab5c40f382784c8eacdf0fd172b9" dependencies = [ "bstr", "encoding_rs", @@ -1335,18 +1350,18 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86ca81d3888c5b0ac908cbe6ee975451b117b475324987f8aecf42bc5d9e4279" +checksum = "4d5b6e9d34a2c61ea4a02bbca94c409ab6dbbca1348cbb67298cd7fed8758761" dependencies = [ "gix-features", ] [[package]] name = "gix-glob" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1ddc03b04f2ef410e156c90d05080651e06f617a2d083030a5daff5e6fe0b88" +checksum = "d7c79b881a18d89a75876ba277476d5a2bad5b19f03759c7a07e0808dfe08212" dependencies = [ "bitflags 2.3.3", "bstr", @@ -1356,9 +1371,9 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.11.3" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0dd58cdbe7ffa4032fc111864c80d5f8cecd9a2c9736c97ae7e5be834188272" +checksum = "4b422ff2ad9a0628baaad6da468cf05385bf3f5ab495ad5a33cce99b9f41092f" dependencies = [ "hex", "thiserror", @@ -1366,9 +1381,9 @@ dependencies = [ [[package]] name = "gix-hashtable" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e133bc56d938eaec1c675af7c681a51de9662b0ada779f45607b967a10da77a" +checksum = "385f4ce6ecf3692d313ca3aa9bd3b3d8490de53368d6d94bedff3af8b6d9c58d" dependencies = [ "gix-hash", "hashbrown 0.14.0", @@ -1377,9 +1392,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65ffd8e8860fd2eff53038101828fe8d19e5aad9dc869d9f1fbea825cf2830cf" +checksum = "a88b95ceb3bc45abcab6eb55ef4e0053e58b4df0712d3f9aec7d0ca990952603" dependencies = [ "bstr", "gix-glob", @@ -1389,9 +1404,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e447ecb5c8365cdd1d8fe55d6cb047279657ef1747c4347755a4b64ff3b2f0d6" +checksum = "732f61ec71576bd443a3c24f4716dc7eac180d8929e7bb8603c7310161507106" dependencies = [ "bitflags 2.3.3", "bstr", @@ -1399,6 +1414,7 @@ dependencies = [ "filetime", "gix-bitmap", "gix-features", + "gix-fs", "gix-hash", "gix-lock", "gix-object", @@ -1422,9 +1438,9 @@ dependencies = [ [[package]] name = "gix-mailmap" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe5a913fd8f56ea21cbd3b8bf813e0b410771682a065a14a4e9dede1012cd532" +checksum = "7fc0dbbf35d29639770af68d7ff55924d83786c8924b0e6a1766af1a98b7d58b" dependencies = [ "bstr", "gix-actor", @@ -1434,9 +1450,9 @@ dependencies = [ [[package]] name = "gix-negotiate" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "945302d90a0519a31acc42e7584d1e08156ef59b179e3bbf1fd9c0e40d819e64" +checksum = "ce0061b7ae867e830c77b1ecfc5875f0d042aebb3d7e6014d04fd86ca6c71d59" dependencies = [ "bitflags 2.3.3", "gix-commitgraph", @@ -1450,9 +1466,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.33.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf32d43ccbeb9f2f54a74ee0a4b6a37143b0ba18a22288f4b790869cce232c46" +checksum = "70f18b688854af4440695b943e705877f94171325b8bcacaee2d898ecf2766d2" dependencies = [ "bstr", "btoi", @@ -1470,9 +1486,9 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.50.0" +version = "0.50.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "892c87273faa345ea12438c4ce2b89be15ae4abfda383035b8a3950965327d97" +checksum = "7dc2129d25313b594adfb5a71f2a617aaa2c3c4cfd3b2943823692db12fbc1db" dependencies = [ "arc-swap", "gix-date", @@ -1489,9 +1505,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.40.0" +version = "0.40.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3163c2bdbb1ec45a717b5bbab69d715b2a5711c19f91f9a3045c6f805cc59c83" +checksum = "4805d23741f5c3642332a665d4fbfa15ffe666e6252d6a72f0923c506dc35eb8" dependencies = [ "clru", "gix-chunk", @@ -1512,9 +1528,9 @@ dependencies = [ [[package]] name = "gix-packetline" -version = "0.16.3" +version = "0.16.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0158e98f4afb8f2da69a325c3e8b6674093a0eab2c91cc59f1522a3bc062a012" +checksum = "eb532b34627186a9a2705a360f64f6a8feb34c42344b127f9f230687d85358bd" dependencies = [ "bstr", "hex", @@ -1523,9 +1539,9 @@ dependencies = [ [[package]] name = "gix-packetline-blocking" -version = "0.16.3" +version = "0.16.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aef45b51fba629b588c3c50b57c815edebd5dddf7daa33736c33f160f9a64f34" +checksum = "20276373def40fc3be7a86d09e1bb607d33dd6bf83e3504e83cd594e51438667" dependencies = [ "bstr", "hex", @@ -1534,9 +1550,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfca182d2575ded2ed38280f1ebf75cd5d3790b77e0872de07854cf085821fbe" +checksum = "18609c8cbec8508ea97c64938c33cd305b75dfc04a78d0c3b78b8b3fd618a77c" dependencies = [ "bstr", "gix-trace", @@ -1547,9 +1563,9 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abe84674ac2473f98dea1832f727ddb16acbff3262dbf226f0a9be188b9a922b" +checksum = "2f755e8eb83ee9a06642a8fbd3009b033db2b5bd774f3aaf3de0b07f9b6ebdc5" dependencies = [ "gix-command", "gix-config-value", @@ -1560,9 +1576,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.36.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f543b1c3079db3b04524da66ecca3dc304a426726506ac2493fcbe4d7eccc94e" +checksum = "0f8cf8b48ad5510a6ea3c8b529f51fd0f31009a2e46579f3a0ed917669035170" dependencies = [ "bstr", "btoi", @@ -1578,9 +1594,9 @@ dependencies = [ [[package]] name = "gix-quote" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3874de636c2526de26a3405b8024b23ef1a327bebf4845d770d00d48700b6a40" +checksum = "dfd80d3d0c733508df9449b1d3795da36083807e31d851d7d61d29af13bd4b0a" dependencies = [ "bstr", "btoi", @@ -1589,9 +1605,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.33.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e368f5368279e97148a6214ec534bfebd1f29a0fe344947d92f488397bb27a08" +checksum = "d564f1cc4c5074b84d6cdd260862f9095775c07c93656e4ae67bd5bfa0b091fe" dependencies = [ "gix-actor", "gix-date", @@ -1610,9 +1626,9 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df521f8fc9cbd82d9abb01b8047b653de1e58c9b4b919d63218d7da2a9cd91d7" +checksum = "d19a02bf740b326d6c082a7d6f754ebe56eef900986c5e91be7cf000df9ea18d" dependencies = [ "bstr", "gix-hash", @@ -1624,9 +1640,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1503e94badcbb9d8dc6ea3063522798913ead8f37f564f2cc335eff572208178" +checksum = "38a13500890435e3b9e7746bceda248646bfc69e259210884c98e29bb7a1aa6f" dependencies = [ "bstr", "gix-date", @@ -1639,9 +1655,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f43049c861d0de876d9022f61fddca4081f17c51d4dc5f7541621a076cb3218" +checksum = "71d4cbaf3cfbfde2b81b5ee8b469aff42c34693ce0fe17fc3c244d5085307f2c" dependencies = [ "gix-commitgraph", "gix-date", @@ -1654,9 +1670,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ede298863db2a0574a14070991710551e76d1f47c9783b62d4fcbca17f56371c" +checksum = "9615cbd6b456898aeb942cd75e5810c382fbfc48dbbff2fa23ebd2d33dcbe9c7" dependencies = [ "bitflags 2.3.3", "gix-path", @@ -1681,15 +1697,15 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "103eac621617be3ebe0605c9065ca51a223279a23218aaf67d10daa6e452f663" +checksum = "96b6d623a1152c3facb79067d6e2ecdae48130030cf27d6eb21109f13bd7b836" [[package]] name = "gix-transport" -version = "0.34.0" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae8694dcc1719cea69a0a8306c983e122787234911bdec3048c4b1c7f5245006" +checksum = "99fffe5a95a522200ad47b97c19c9b0c204fc415dffa4a993d727394e6d59ef8" dependencies = [ "base64 0.21.2", "bstr", @@ -1706,9 +1722,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.30.0" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be19057a9ddef95af02d32b8b8d953cf974c4d378918e5e97d7345b843e0c271" +checksum = "e12e0fe428394226c37dd686ad64b09a04b569fe157d638b125b4a4c1e7e2df0" dependencies = [ "gix-commitgraph", "gix-date", @@ -1722,9 +1738,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "092d3f8f4040ee1b82830224e9002fff69248348af27dfdbcc8536db80283945" +checksum = "4411bdbd1d46b35ae50e84c191660d437f89974e4236627785024be0b577170a" dependencies = [ "bstr", "gix-features", @@ -1736,18 +1752,18 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7058c94f4164fcf5b8457d35f6d8f6e1007f9f7f938c9c7684a7e01d23c6ddde" +checksum = "b85d89dc728613e26e0ed952a19583744e7f5240fcd4aa30d6c824ffd8b52f0f" dependencies = [ "fastrand", ] [[package]] name = "gix-validate" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d092b594c8af00a3a31fe526d363ee8a51a6f29d8496cdb991ed2f01ec0ec13" +checksum = "ba9b3737b2cef3dcd014633485f0034b0f1a931ee54aeb7d8f87f177f3c89040" dependencies = [ "bstr", "thiserror", @@ -1755,9 +1771,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b773e8e249c13fce5757b15e2620078adfec9dcfbfc7d243fbabf5bb49f121" +checksum = "8fd60b32d15287aef77e4fb1955627e0db1f13e40bf9a3481100223a51791f5f" dependencies = [ "bstr", "filetime", @@ -1775,6 +1791,24 @@ dependencies = [ "thiserror", ] +[[package]] +name = "gix-worktree-stream" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb2a0fa070db8f3c0f7e9d5e8f189df7f8fdbb0fed331c79dae4c3410d7106dd" +dependencies = [ + "gix-attributes", + "gix-features", + "gix-filter", + "gix-fs", + "gix-hash", + "gix-object", + "gix-path", + "gix-traverse", + "parking_lot", + "thiserror", +] + [[package]] name = "glob" version = "0.3.1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index c973e605..8e0d7052 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -18,7 +18,7 @@ command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.8", path = "../detect-targets" } either = "1.8.1" -gix = { version = "0.49.1", features = ["blocking-http-transport-reqwest-rust-tls"], optional = true } +gix = { version = "0.50.0", features = ["blocking-http-transport-reqwest-rust-tls"], optional = true } glob = "0.3.1" home = "0.5.5" itertools = "0.11.0" diff --git a/crates/binstalk/src/helpers/git.rs b/crates/binstalk/src/helpers/git.rs index b84519a4..2f9ba0a8 100644 --- a/crates/binstalk/src/helpers/git.rs +++ b/crates/binstalk/src/helpers/git.rs @@ -161,7 +161,7 @@ impl Repository { .to_thread_local() .head_commit()? .tree()? - .lookup_entry_by_path(path)? + .peel_to_entry_by_path(path)? { Some(mem::take(&mut entry.object()?.data)) } else { From 333c1805e1c2575d12d6e5558a4368acd9dab794 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 28 Jul 2023 16:05:56 +1000 Subject: [PATCH 1390/2020] dep: Upgrade transitive dependencies (#1232) Co-authored-by: github-actions --- Cargo.lock | 144 +++++++++++++++++------------------------------------ 1 file changed, 47 insertions(+), 97 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1c7b675f..86bc5c16 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,17 +17,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - [[package]] name = "ahash" version = "0.8.3" @@ -40,15 +29,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "aho-corasick" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" -dependencies = [ - "memchr", -] - [[package]] name = "alloc-no-stdlib" version = "2.0.4" @@ -168,9 +148,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.71" +version = "0.1.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" +checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" dependencies = [ "proc-macro2", "quote", @@ -538,9 +518,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.17" +version = "4.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0827b011f6f8ab38590295339817b0d26f344aa4932c3ced71b45b0c54b4a9" +checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d" dependencies = [ "clap_builder", "clap_derive", @@ -549,9 +529,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.17" +version = "4.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9441b403be87be858db6a23edb493e7f694761acdc3343d5a0fcaafd304cbc9e" +checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1" dependencies = [ "anstream", "anstyle", @@ -798,9 +778,9 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "either" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "embed-resource" @@ -1059,9 +1039,9 @@ dependencies = [ [[package]] name = "gh-token" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1ff8db6b58b68c39ec14a0922cad141fee0e350324eb01ee45e3898f780d46" +checksum = "af48f86426da13e6afda11767aac00deaa9de5948b2a2cfe7d0c5505bd6844aa" dependencies = [ "home", "serde", @@ -1077,9 +1057,9 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "gix" -version = "0.50.0" +version = "0.50.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41e278c81b66e27876235fe5415da6fa709b2c8c82e1d1387c30c426982aa6a7" +checksum = "275b1bfa0d6f6ed31a2e2e878a4539f4994eac8840546283ab3aebbd8fcaa42d" dependencies = [ "gix-actor", "gix-archive", @@ -1145,9 +1125,9 @@ dependencies = [ [[package]] name = "gix-archive" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "238218ac18c1a82cc63d229db3707fb26171b87656e3b9c7f701cf336c35c483" +checksum = "fc89a798842b519048e947339a9c9f3cfd8fb9c2d9b66b6ebcb0c3cc8fe5874d" dependencies = [ "bstr", "gix-date", @@ -1427,9 +1407,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "7.0.1" +version = "7.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "714bcb13627995ac33716e9c5e4d25612b19947845395f64d2a9cbe6007728e4" +checksum = "7e82ec23c8a281f91044bf3ed126063b91b59f9c9340bf0ae746f385cc85a6fa" dependencies = [ "gix-tempfile", "gix-utils", @@ -1505,9 +1485,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.40.1" +version = "0.40.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4805d23741f5c3642332a665d4fbfa15ffe666e6252d6a72f0923c506dc35eb8" +checksum = "46f029a4dce9ac91da35c968c3abdcae573b3e52c123be86cbab3011599de533" dependencies = [ "clru", "gix-chunk", @@ -1605,9 +1585,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.33.1" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d564f1cc4c5074b84d6cdd260862f9095775c07c93656e4ae67bd5bfa0b091fe" +checksum = "c16776eab78f4a918464064fa9c0f640014e8f1c3f9d1d366e929251c7193b2c" dependencies = [ "gix-actor", "gix-date", @@ -1682,9 +1662,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "7.0.1" +version = "7.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce3aa96fec73f19aeec8f46c71bf3c00dd82e0668558930b3b914c0d98dabd65" +checksum = "fa28d567848cec8fdd77d36ad4f5f78ecfaba7d78f647d4f63c8ae1a2cec7243" dependencies = [ "gix-fs", "libc", @@ -1851,9 +1831,6 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.6", -] [[package]] name = "hashbrown" @@ -2017,7 +1994,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e98c1d0ad70fc91b8b9654b1f33db55e59579d3b3de2bffdced0fdb810570cb8" dependencies = [ - "ahash 0.8.3", + "ahash", "hashbrown 0.12.3", ] @@ -2201,9 +2178,9 @@ dependencies = [ [[package]] name = "libz-ng-sys" -version = "1.1.9" +version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2468756f34903b582fe7154dc1ffdebd89d0562c4a43b53c621bb0f1b1043ccb" +checksum = "3dd9f43e75536a46ee0f92b758f6b63846e594e86638c61a9251338a65baea63" dependencies = [ "cmake", "libc", @@ -2708,9 +2685,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.31" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fe8a65d69dd0808184ebb5f836ab526bb259db23c657efa38711b1072ee47f0" +checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" dependencies = [ "proc-macro2", ] @@ -2808,34 +2785,11 @@ dependencies = [ "windows 0.48.0", ] -[[package]] -name = "regex" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax", -] - [[package]] name = "regex-automata" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" [[package]] name = "reqwest" @@ -2992,9 +2946,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.1" +version = "0.101.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f36a6828982f422756984e47912a7a51dcbc2a197aa791158f8ca61cd8204e" +checksum = "513722fd73ad80a71f72b61009ea1b584bcfa1483ca93949c8f290298837fa59" dependencies = [ "ring", "untrusted", @@ -3048,9 +3002,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.1" +version = "2.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" +checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -3061,9 +3015,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" +checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" dependencies = [ "core-foundation-sys", "libc", @@ -3080,9 +3034,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.173" +version = "1.0.177" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91f70896d6720bc714a4a57d22fc91f1db634680e65c8efe13323f1fa38d53f" +checksum = "63ba2516aa6bf82e0b19ca8b50019d52df58455d3cf9bdaf6315225fdd0c560a" dependencies = [ "serde_derive", ] @@ -3098,9 +3052,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.173" +version = "1.0.177" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6250dde8342e0232232be9ca3db7aa40aceb5a3e5dd9bddbc00d99a007cde49" +checksum = "401797fe7833d72109fedec6bfcbe67c0eed9b99772f26eb8afd261f0abc6fd3" dependencies = [ "proc-macro2", "quote", @@ -3109,9 +3063,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.103" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d03b412469450d4404fe8499a268edd7f8b79fecb074b0d812ad64ca21f4031b" +checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" dependencies = [ "itoa", "ryu", @@ -3377,18 +3331,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.43" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" +checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.43" +version = "1.0.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" +checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2", "quote", @@ -3787,13 +3741,9 @@ checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "unicode-linebreak" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5faade31a542b8b35855fff6e8def199853b2da8da256da52f52f1316ee3137" -dependencies = [ - "hashbrown 0.12.3", - "regex", -] +checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" [[package]] name = "unicode-normalization" @@ -4204,9 +4154,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fac9742fd1ad1bd9643b991319f72dd031016d44b77039a26977eb667141e7" +checksum = "25b5872fa2e10bd067ae946f927e726d7d603eaeb6e02fa6a350e0722d2b8c11" dependencies = [ "memchr", ] From d5549ce99ebc82b1ceee93a41375137b7dbd1a1f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 28 Jul 2023 17:59:23 +1000 Subject: [PATCH 1391/2020] detect-targets: Add fallback to x86_64-apple-darwin (#1233) Fallback to `x86_64h-apple-darwin` if supported. Signed-off-by: Jiahao XU --- crates/detect-targets/src/detect/macos.rs | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/crates/detect-targets/src/detect/macos.rs b/crates/detect-targets/src/detect/macos.rs index 289483f1..e202770f 100644 --- a/crates/detect-targets/src/detect/macos.rs +++ b/crates/detect-targets/src/detect/macos.rs @@ -1,4 +1,4 @@ -use std::{io, process::Stdio}; +use std::process::Stdio; use tokio::process::Command; @@ -21,22 +21,22 @@ const X86H: &str = "x86_64h-apple-darwin"; const UNIVERSAL: &str = "universal-apple-darwin"; const UNIVERSAL2: &str = "universal2-apple-darwin"; -async fn is_x86_64_supported() -> io::Result { - let exit_status = Command::new("arch") - .args(["-arch", "x86_64", "/usr/bin/true"]) +async fn is_arch_supported(arch_name: &str) -> bool { + Command::new("arch") + .args(["-arch", arch_name, "/usr/bin/true"]) .stdin(Stdio::null()) .stdout(Stdio::null()) .stderr(Stdio::null()) .status() - .await?; - - Ok(exit_status.success()) + .await + .map(|exit_status| exit_status.success()) + .unwrap_or(false) } pub(super) async fn detect_alternative_targets(target: &str) -> impl Iterator { match target { AARCH64 => { - let is_x86_64_supported = is_x86_64_supported().await.unwrap_or(false); + let is_x86_64_supported = is_arch_supported("x86_64").await; [ // Prefer universal as it provides native arm executable Some(UNIVERSAL), @@ -46,7 +46,12 @@ pub(super) async fn detect_alternative_targets(target: &str) -> impl Iterator [Some(UNIVERSAL), Some(UNIVERSAL2), None, None], + X86 => [ + is_arch_supported("x86_64h").await.then_some(X86H), + Some(UNIVERSAL), + Some(UNIVERSAL2), + None, + ], X86H => [Some(X86), Some(UNIVERSAL), Some(UNIVERSAL2), None], _ => [None, None, None, None], } From 3a831a34c62611b8cbc4789b92eae3738a4e0cca Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 1 Aug 2023 12:34:41 +1000 Subject: [PATCH 1392/2020] Bump dep target-lexicon to v0.12.11 (#1235) To support new target x86h-apple-darwin Signed-off-by: Jiahao XU --- crates/binstalk/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 8e0d7052..0698cf3d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -34,7 +34,7 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde_json = "1.0.99" strum = "0.25.0" -target-lexicon = { version = "0.12.8", features = ["std"] } +target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" thiserror = "1.0.40" # parking_lot for `tokio::sync::OnceCell::const_new` From d4e1f30e8f64456cf726225ef9fcb485979429e1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 1 Aug 2023 21:33:57 +1000 Subject: [PATCH 1393/2020] Disable `sha1-asm` or `zlib-ng` on x86_64 linux (#1236) Try to fix recent `Illegal instructions` happened in CI. Signed-off-by: Jiahao XU --- justfile | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/justfile b/justfile index 8814d409..04cd854a 100644 --- a/justfile +++ b/justfile @@ -74,19 +74,14 @@ support-pkg-config := if target == target-host { if target-os == "linux" { "true" } else { "" } } else { "" } -enable-git-max-perf-feature := if target == "x86_64-apple-darwin" { - "true" +#} else if target == "x86_64-unknown-linux-gnu" { +# ",zlib-ng" +#} else if target == "x86_64-unknown-linux-musl" { +# ",zlib-ng" +git-max-perf-feature := if target == "x86_64-apple-darwin" { + ",zlib-ng" } else if target == "aarch64-apple-darwin" { - "true" -} else if target == "x86_64-unknown-linux-gnu" { - "true" -} else if target == "x86_64-unknown-linux-musl" { - "true" -} else { - "false" -} -git-max-perf-feature := if enable-git-max-perf-feature == "true" { - ",git-max-perf" + ",zlib-ng" } else if target-os == "windows" { ",zlib-ng" } else if target == "aarch64-unknown-linux-gnu" { From b70cb9be64048a8ada1cfe29c2430b4524892b29 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 2 Aug 2023 01:14:24 +0000 Subject: [PATCH 1394/2020] dep: Upgrade transitive dependencies (#1237) Co-authored-by: github-actions --- Cargo.lock | 88 +++++++++++++++++++++++++++++------------------------- 1 file changed, 48 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 86bc5c16..dd9f50cc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -154,7 +154,7 @@ checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.28", ] [[package]] @@ -503,11 +503,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "51f1226cd9da55587234753d1245dd5b132343ea240f26b6a9003d68706141ba" dependencies = [ "jobserver", + "libc", ] [[package]] @@ -548,7 +549,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.28", ] [[package]] @@ -721,6 +722,12 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +[[package]] +name = "deranged" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8810e7e2cf385b1e9b50d68264908ec367ba642c96d02edfe61c39e88e2a3c01" + [[package]] name = "detect-targets" version = "0.1.8" @@ -835,9 +842,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" +checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" dependencies = [ "errno-dragonfly", "libc", @@ -975,7 +982,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.28", ] [[package]] @@ -2157,7 +2164,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.28", ] [[package]] @@ -2194,9 +2201,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" +checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" [[package]] name = "lock_api" @@ -2319,7 +2326,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.28", ] [[package]] @@ -2483,7 +2490,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.28", ] [[package]] @@ -2568,7 +2575,7 @@ checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.28", ] [[package]] @@ -2787,9 +2794,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39354c10dd07468c2e73926b23bb9c2caca74c5501e38a35da70406f1d923310" +checksum = "b7b6d6190b7594385f61bd3911cd1be99dfddcfc365a4160cc2ab5bff4aed294" [[package]] name = "reqwest" @@ -2884,7 +2891,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" dependencies = [ "bitflags 2.3.3", - "errno 0.3.1", + "errno 0.3.2", "libc", "linux-raw-sys", "windows-sys", @@ -3034,9 +3041,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.177" +version = "1.0.180" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63ba2516aa6bf82e0b19ca8b50019d52df58455d3cf9bdaf6315225fdd0c560a" +checksum = "0ea67f183f058fe88a4e3ec6e2788e003840893b91bac4559cabedd00863b3ed" dependencies = [ "serde_derive", ] @@ -3052,13 +3059,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.177" +version = "1.0.180" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "401797fe7833d72109fedec6bfcbe67c0eed9b99772f26eb8afd261f0abc6fd3" +checksum = "24e744d7782b686ab3b73267ef05697159cc0e5abbed3f47f9933165e5219036" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.28", ] [[package]] @@ -3236,7 +3243,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.27", + "syn 2.0.28", ] [[package]] @@ -3280,9 +3287,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.27" +version = "2.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b60f673f44a8255b9c8c657daf66a596d435f2da81a555b06dc644d080ba45e0" +checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" dependencies = [ "proc-macro2", "quote", @@ -3291,9 +3298,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.10" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2faeef5759ab89935255b1a4cd98e0baf99d1085e37d36599c625dac49ae8e" +checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "tempfile" @@ -3346,7 +3353,7 @@ checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.28", ] [[package]] @@ -3361,10 +3368,11 @@ dependencies = [ [[package]] name = "time" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e399c068f43a5d116fedaf73b203fa4f9c519f17e2b34f63221d3792f81446" +checksum = "b79eabcd964882a646b3584543ccabeae7869e9ac32a46f6f22b7a5bd405308b" dependencies = [ + "deranged", "itoa", "libc", "num_threads", @@ -3381,9 +3389,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ba15a897f3c86766b757e5ac7221554c6750054d74d5b28844fce5fb36a6c4" +checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd" dependencies = [ "time-core", ] @@ -3431,7 +3439,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.28", ] [[package]] @@ -3488,7 +3496,7 @@ dependencies = [ "redox_syscall 0.3.5", "tokio", "tokio-stream", - "xattr 1.0.0", + "xattr 1.0.1", ] [[package]] @@ -3590,7 +3598,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.28", ] [[package]] @@ -3886,7 +3894,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.28", "wasm-bindgen-shared", ] @@ -3920,7 +3928,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.27", + "syn 2.0.28", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4154,9 +4162,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.5.1" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25b5872fa2e10bd067ae946f927e726d7d603eaeb6e02fa6a350e0722d2b8c11" +checksum = "f46aab759304e4d7b2075a9aecba26228bb073ee8c50db796b2c72c676b5d807" dependencies = [ "memchr", ] @@ -4201,9 +4209,9 @@ dependencies = [ [[package]] name = "xattr" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea263437ca03c1522846a4ddafbca2542d0ad5ed9b784909d4b27b76f62bc34a" +checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" dependencies = [ "libc", ] From 8756e39537dda7cb40f5f3a3fc587085a308be68 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 2 Aug 2023 12:22:16 +1000 Subject: [PATCH 1395/2020] CI: Add release build for x86_64h-apple-darwin (#1234) Signed-off-by: Jiahao XU --- .github/workflows/release-build.yml | 1 + justfile | 24 +++++++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 0cad549c..fc66cb71 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -29,6 +29,7 @@ jobs: matrix: include: - { o: macos-latest, t: x86_64-apple-darwin, r: true } + - { o: macos-latest, t: x86_64h-apple-darwin, } - { o: macos-latest, t: aarch64-apple-darwin } - { o: ubuntu-latest, t: x86_64-unknown-linux-gnu, g: 2.17, r: true, c: true } - { o: ubuntu-latest, t: armv7-unknown-linux-gnueabihf, g: 2.17, c: true } diff --git a/justfile b/justfile index 04cd854a..f60ba4f7 100644 --- a/justfile +++ b/justfile @@ -10,6 +10,7 @@ override-features := env_var_or_default("JUST_OVERRIDE_FEATURES", "") glibc-version := env_var_or_default("GLIBC_VERSION", "") use-auditable := env_var_or_default("JUST_USE_AUDITABLE", "") timings := env_var_or_default("JUST_TIMINGS", "") +build-std := env_var_or_default("JUST_BUILD_STD", "") export BINSTALL_LOG_LEVEL := if env_var_or_default("RUNNER_DEBUG", "0") == "1" { "debug" } else { "info" } export BINSTALL_RATE_LIMIT := "30/1" @@ -55,9 +56,11 @@ ci-or-no := if ci != "" { "ci" } else { "noci" } # In release builds in CI, build the std library ourselves so it uses our # compile profile, and optimise panic messages out with immediate abort. -cargo-buildstd := "" #if (cargo-profile / ci-or-no) == "release/ci" { -#" -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort" -#} else { "" } +cargo-buildstd := if build-std != "" { + " -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort" +} else if target == "x86_64h-apple-darwin" { + " -Z build-std=std,panic_abort -Z build-std-features=panic_immediate_abort" +} else { "" } # In musl release builds in CI, statically link gcclibs. rustc-gcclibs := if (cargo-profile / ci-or-no / target-libc) == "release/ci/musl" { @@ -80,6 +83,8 @@ support-pkg-config := if target == target-host { # ",zlib-ng" git-max-perf-feature := if target == "x86_64-apple-darwin" { ",zlib-ng" +} else if target == "x86_64h-apple-darwin" { + ",zlib-ng" } else if target == "aarch64-apple-darwin" { ",zlib-ng" } else if target-os == "windows" { @@ -185,10 +190,15 @@ ci-install-deps: [windows] ci-install-deps: -toolchain components="": - rustup toolchain install stable {{ if components != "" { "--component " + components } else { "" } }} --no-self-update --profile minimal - {{ if ci != "" { "rustup default stable" } else { "rustup override set stable" } }} - {{ if target != "" { "rustup target add " + target } else { "" } }} +toolchain-name := if cargo-buildstd != "" { "nightly" } else { "stable" } +# x86_64h-apple-darwin does not contain pre-built libstd, instead we will +# install rust-src and use build-std to build it. +target-name := if target == "x86_64h-apple-darwin" { "" } else { target } +default-components := if cargo-buildstd != "" { "rust-src" } else { "" } + +toolchain components=default-components: + rustup toolchain install {{toolchain-name}} {{ if components != "" { "--component " + components } else { "" } }} --no-self-update --profile minimal {{ if target-name != "" { "--target " + target-name } else { "" } }} + rustup override set {{toolchain-name}} print-env: @echo "env RUSTFLAGS='$RUSTFLAGS', CARGO='$CARGO'" From 855ca88477b92f73e18d91b004dd290501f925bc Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 2 Aug 2023 13:37:21 +1000 Subject: [PATCH 1396/2020] ci: Build MacOS universal exe from x86_64h-apple-darwin (#1238) instead of `x86_64-apple-darwin` for better optimization since any machine that support universal support x86_64h. Signed-off-by: Jiahao XU --- .github/workflows/release-build.yml | 2 +- justfile | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index fc66cb71..742e7288 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -124,7 +124,7 @@ jobs: - uses: actions/download-artifact@v3 with: - name: x86_64-apple-darwin + name: x86_64h-apple-darwin path: packages/ - uses: actions/download-artifact@v3 with: diff --git a/justfile b/justfile index f60ba4f7..96ec99dc 100644 --- a/justfile +++ b/justfile @@ -318,14 +318,14 @@ package-prepare: build package-dir [macos] lipo-prepare: package-dir just target=aarch64-apple-darwin build get-binary packages/prep/arm64 - just target=x86_64-apple-darwin build get-binary packages/prep/x64 + just target=x86_64h-apple-darwin build get-binary packages/prep/x64 just target=aarch64-apple-darwin get-binary packages/prep/arm64 - just target=x86_64-apple-darwin get-binary packages/prep/x64 + just target=x86_64h-apple-darwin get-binary packages/prep/x64 lipo -create -output packages/prep/{{output-filename}} packages/prep/{arm64,x64}/{{output-filename}} just target=aarch64-apple-darwin get-output detect-wasi{{output-ext}} packages/prep/arm64 - just target=x86_64-apple-darwin get-output detect-wasi{{output-ext}} packages/prep/x64 + just target=x86_64h-apple-darwin get-output detect-wasi{{output-ext}} packages/prep/x64 lipo -create -output packages/prep/detect-wasi{{output-ext}} packages/prep/{arm64,x64}/detect-wasi{{output-ext}} rm -rf packages/prep/{arm64,x64} @@ -355,7 +355,7 @@ package-lipo: lipo-prepare [macos] repackage-lipo: package-dir mkdir -p packages/prep/{arm64,x64} - cd packages/prep/x64 && unzip -o "../../cargo-binstall-x86_64-apple-darwin.full.zip" + cd packages/prep/x64 && unzip -o "../../cargo-binstall-x86_64h-apple-darwin.full.zip" cd packages/prep/arm64 && unzip -o "../../cargo-binstall-aarch64-apple-darwin.full.zip" lipo -create -output packages/prep/{{output-filename}} packages/prep/{arm64,x64}/{{output-filename}} From 7c2ddd9a0cd80ca4ce967f6f648db24f312583b6 Mon Sep 17 00:00:00 2001 From: Asger Hautop Drewsen Date: Wed, 2 Aug 2023 13:34:43 +0200 Subject: [PATCH 1397/2020] Don't show warning if $CARGO_HOME/bin is in $PATH (#1239) --- install-from-binstall-release.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/install-from-binstall-release.sh b/install-from-binstall-release.sh index a9f5c99b..7dafe318 100755 --- a/install-from-binstall-release.sh +++ b/install-from-binstall-release.sh @@ -27,8 +27,11 @@ fi ./cargo-binstall -y --force cargo-binstall -if ! [[ ":$PATH:" == *":$HOME/.cargo/bin:"* ]]; then +if ! [[ $CARGO_HOME ]]; then + CARGO_HOME=$HOME/.cargo +fi +if ! [[ ":$PATH:" == *":$CARGO_HOME/bin:"* ]]; then echo - printf "\033[0;31mYour path is missing ~/.cargo/bin, you might want to add it.\033[0m\n" + printf "\033[0;31mYour path is missing %s, you might want to add it.\033[0m\n" "$CARGO_HOME/bin" echo fi From 6ed7ea8b5203ca8c7d3f870b560349af70f6cecb Mon Sep 17 00:00:00 2001 From: "NAKASHIMA, Makoto" Date: Wed, 2 Aug 2023 22:40:32 +0900 Subject: [PATCH 1398/2020] install-from-binstall-release.sh: Fix unbound variable error (#1241) fixes #1240 --- install-from-binstall-release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-from-binstall-release.sh b/install-from-binstall-release.sh index 7dafe318..5ebf4f3d 100755 --- a/install-from-binstall-release.sh +++ b/install-from-binstall-release.sh @@ -27,7 +27,7 @@ fi ./cargo-binstall -y --force cargo-binstall -if ! [[ $CARGO_HOME ]]; then +if ! [[ -v CARGO_HOME ]]; then CARGO_HOME=$HOME/.cargo fi if ! [[ ":$PATH:" == *":$CARGO_HOME/bin:"* ]]; then From b4cf580e4f743d86326258abc10b469b26f1af5f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 3 Aug 2023 04:54:51 +0000 Subject: [PATCH 1399/2020] build(deps): update gix requirement from 0.50.0 to 0.51.0 in /crates/binstalk (#1242) build(deps): update gix requirement in /crates/binstalk Updates the requirements on [gix](https://github.com/Byron/gitoxide) to permit the latest version. - [Release notes](https://github.com/Byron/gitoxide/releases) - [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md) - [Commits](https://github.com/Byron/gitoxide/compare/gix-v0.50.0...gix-v0.51.0) --- updated-dependencies: - dependency-name: gix dependency-type: direct:production ... Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 42 +++++++++++++++++++------------------- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dd9f50cc..0a6f0635 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1064,9 +1064,9 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "gix" -version = "0.50.1" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "275b1bfa0d6f6ed31a2e2e878a4539f4994eac8840546283ab3aebbd8fcaa42d" +checksum = "4ce5c049b1afcae9bb9e10c0f6dd8eb1335e8647fb7fd34732a66133ca3b9886" dependencies = [ "gix-actor", "gix-archive", @@ -1118,9 +1118,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7606482631d56cc6bfba3394ae42fc64927635024298befbb7923b6144774e8" +checksum = "abd2566c12095a584716f2c16f051850bd8987f57556f1fef4a7cce0300b83d0" dependencies = [ "bstr", "btoi", @@ -1203,9 +1203,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b51e83bd9d08118e0ff06ea14be953c418b4c056e57d93c8103e777584e48b0a" +checksum = "2135b921a699a4c36167148193bea23c653a16ef0686f6a280e383469709a773" dependencies = [ "bstr", "gix-config-value", @@ -1216,11 +1216,11 @@ dependencies = [ "gix-sec", "log", "memchr", - "nom", "once_cell", "smallvec", "thiserror", "unicode-bom", + "winnow", ] [[package]] @@ -1453,9 +1453,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.33.1" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f18b688854af4440695b943e705877f94171325b8bcacaee2d898ecf2766d2" +checksum = "bfdd87520c71a19afecfa616863a4b761621074878f5a3999243b3e37e233943" dependencies = [ "bstr", "btoi", @@ -1473,9 +1473,9 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.50.1" +version = "0.50.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dc2129d25313b594adfb5a71f2a617aaa2c3c4cfd3b2943823692db12fbc1db" +checksum = "e827dbda6d3dabadb94cd437d0e0fe8c314a60d136a3235fc6f5bf7b96b976ac" dependencies = [ "arc-swap", "gix-date", @@ -1550,9 +1550,9 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f755e8eb83ee9a06642a8fbd3009b033db2b5bd774f3aaf3de0b07f9b6ebdc5" +checksum = "2c22decaf4a063ccae2b2108820c8630c01bd6756656df3fe464b32b8958a5ea" dependencies = [ "gix-command", "gix-config-value", @@ -1563,9 +1563,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.36.1" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f8cf8b48ad5510a6ea3c8b529f51fd0f31009a2e46579f3a0ed917669035170" +checksum = "53c7627b8c54349b93f2a89218effc7c13a5506d2abc2571e0baaf1562a9c105" dependencies = [ "bstr", "btoi", @@ -1592,9 +1592,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.33.2" +version = "0.33.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c16776eab78f4a918464064fa9c0f640014e8f1c3f9d1d366e929251c7193b2c" +checksum = "25db11edd78bf33043d1969fff51c567a4b30edd77ab44f6f8eb460a4c14985d" dependencies = [ "gix-actor", "gix-date", @@ -1690,9 +1690,9 @@ checksum = "96b6d623a1152c3facb79067d6e2ecdae48130030cf27d6eb21109f13bd7b836" [[package]] name = "gix-transport" -version = "0.34.1" +version = "0.34.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fffe5a95a522200ad47b97c19c9b0c204fc415dffa4a993d727394e6d59ef8" +checksum = "640cf03acc506e0350bc434dd6d7093d91343ed508d2c2166a41da856ab6e5e3" dependencies = [ "base64 0.21.2", "bstr", @@ -1758,9 +1758,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.23.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fd60b32d15287aef77e4fb1955627e0db1f13e40bf9a3481100223a51791f5f" +checksum = "9f8bb6dd57dc6c9dfa03cc2cf2cc0942edae405eb6dfd1c34dbd2be00a90cab2" dependencies = [ "bstr", "filetime", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 0698cf3d..469eeb30 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -18,7 +18,7 @@ command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.8", path = "../detect-targets" } either = "1.8.1" -gix = { version = "0.50.0", features = ["blocking-http-transport-reqwest-rust-tls"], optional = true } +gix = { version = "0.51.0", features = ["blocking-http-transport-reqwest-rust-tls"], optional = true } glob = "0.3.1" home = "0.5.5" itertools = "0.11.0" From aeacebcf83c85e3aa9bdd766363b20145b3fd86b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 4 Aug 2023 07:12:06 +1000 Subject: [PATCH 1400/2020] feat: Support passing workspace to `--manifest-path` (#1246) Previously it will load the root `Cargo.toml` and treat it as the manifest for the crate, now it will check its `package.name` and would search for the workspace if the `package.name` does not match the crate name. Signed-off-by: Jiahao XU --- .../src/helpers/cargo_toml_workspace.rs | 24 +++++++---- crates/binstalk/src/ops/resolve.rs | 41 ++++++++++--------- crates/binstalk/tests/parse-meta.rs | 8 ++-- 3 files changed, 43 insertions(+), 30 deletions(-) diff --git a/crates/binstalk/src/helpers/cargo_toml_workspace.rs b/crates/binstalk/src/helpers/cargo_toml_workspace.rs index 3360e55e..61f9d293 100644 --- a/crates/binstalk/src/helpers/cargo_toml_workspace.rs +++ b/crates/binstalk/src/helpers/cargo_toml_workspace.rs @@ -16,7 +16,8 @@ use crate::{errors::BinstallError, manifests::cargo_toml_binstall::Meta}; /// /// WARNING: This is a blocking operation. /// -/// * `workspace_path` - should be a directory +/// * `workspace_path` - can be a directory (path to workspace) or +/// a file (path to `Cargo.toml`). pub fn load_manifest_from_workspace( workspace_path: impl AsRef, crate_name: impl AsRef, @@ -72,16 +73,21 @@ fn load_manifest_from_workspace_inner( workspace_path.display() ); - let mut workspace_paths = vec![workspace_path.to_owned()]; + let manifest_path = if workspace_path.is_file() { + workspace_path.to_owned() + } else { + workspace_path.join("Cargo.toml") + }; - while let Some(workspace_path) = workspace_paths.pop() { - let p = workspace_path.join("Cargo.toml"); - let manifest = Manifest::::from_path_with_metadata(&p)?; + let mut manifest_paths = vec![manifest_path]; + + while let Some(manifest_path) = manifest_paths.pop() { + let manifest = Manifest::::from_path_with_metadata(&manifest_path)?; let name = manifest.package.as_ref().map(|p| &*p.name); debug!( "Loading from {}, manifest.package.name = {:#?}", - p.display(), + manifest_path.display(), name ); @@ -102,13 +108,15 @@ fn load_manifest_from_workspace_inner( .map(|pat| Pattern::new(&pat)) .collect::, _>>()?; + let workspace_path = manifest_path.parent().unwrap(); + for member in members { - for path in Pattern::new(&member)?.glob_dirs(&workspace_path)? { + for path in Pattern::new(&member)?.glob_dirs(workspace_path)? { if !exclude_patterns .iter() .any(|exclude| exclude.matches_with_trailing(&path)) { - workspace_paths.push(workspace_path.join(path)); + manifest_paths.push(workspace_path.join(path).join("Cargo.toml")); } } } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 47b1d359..84abca11 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -14,14 +14,17 @@ use leon::Template; use maybe_owned::MaybeOwned; use semver::{Version, VersionReq}; use tempfile::TempDir; -use tokio::task::{block_in_place, spawn_blocking}; +use tokio::task::spawn_blocking; use tracing::{debug, info, instrument, warn}; use crate::{ bins, errors::{BinstallError, VersionParseError}, fetchers::{Data, Fetcher, TargetData}, - helpers::{self, download::ExtractedFiles, remote::Client, target_triple::TargetTriple}, + helpers::{ + self, cargo_toml_workspace::load_manifest_from_workspace, download::ExtractedFiles, + remote::Client, target_triple::TargetTriple, + }, manifests::cargo_toml_binstall::{Meta, PkgMeta, PkgOverride}, ops::{CargoTomlFetchOverride, Options}, }; @@ -363,7 +366,12 @@ impl PackageInfo { // Fetch crate via crates.io, git, or use a local manifest path let manifest = match opts.cargo_toml_fetch_override.as_ref() { - Some(Path(manifest_path)) => load_manifest_path(manifest_path)?, + Some(Path(manifest_path)) => { + let manifest_path = manifest_path.clone(); + let name = name.clone(); + + spawn_blocking(move || load_manifest_path(manifest_path, &name)).await?? + } #[cfg(feature = "git")] Some(Git(git_url)) => { let git_url = git_url.clone(); @@ -373,7 +381,7 @@ impl PackageInfo { let dir = TempDir::new()?; helpers::git::Repository::shallow_clone(git_url, dir.as_ref())?; - helpers::cargo_toml_workspace::load_manifest_from_workspace(dir.as_ref(), &name) + load_manifest_from_workspace(dir.as_ref(), &name) }) .await?? } @@ -448,29 +456,24 @@ impl PackageInfo { } /// Load binstall metadata from the crate `Cargo.toml` at the provided path -pub fn load_manifest_path>( +/// +/// This is a blocking function. +pub fn load_manifest_path, N: AsRef>( manifest_path: P, + name: N, ) -> Result, BinstallError> { - let manifest_path = manifest_path.as_ref(); - - block_in_place(|| { - let manifest_path = if manifest_path.is_dir() { - Cow::Owned(manifest_path.join("Cargo.toml")) - } else if manifest_path.is_file() { - Cow::Borrowed(manifest_path) - } else { - return Err(BinstallError::CargoManifestPath); - }; - + fn inner(manifest_path: &Path, crate_name: &str) -> Result, BinstallError> { debug!( - "Reading manifest at local path: {}", + "Reading crate {crate_name} manifest at local path: {}", manifest_path.display() ); // Load and parse manifest (this checks file system for binary output names) - let manifest = Manifest::::from_path_with_metadata(manifest_path)?; + let manifest = load_manifest_from_workspace(manifest_path, crate_name)?; // Return metadata Ok(manifest) - }) + } + + inner(manifest_path.as_ref(), name.as_ref()) } diff --git a/crates/binstalk/tests/parse-meta.rs b/crates/binstalk/tests/parse-meta.rs index a76bedf5..4443bd57 100644 --- a/crates/binstalk/tests/parse-meta.rs +++ b/crates/binstalk/tests/parse-meta.rs @@ -1,12 +1,14 @@ use binstalk::ops::resolve::load_manifest_path; use cargo_toml::Product; +use std::path::PathBuf; #[test] fn parse_meta() { - let mut manifest_dir = std::env::var("CARGO_MANIFEST_DIR").unwrap(); - manifest_dir.push_str("/tests/parse-meta.Cargo.toml"); + let mut manifest_dir = PathBuf::from(std::env::var_os("CARGO_MANIFEST_DIR").unwrap()); + manifest_dir.push("tests/parse-meta.Cargo.toml"); - let manifest = load_manifest_path(&manifest_dir).expect("Error parsing metadata"); + let manifest = + load_manifest_path(&manifest_dir, "cargo-binstall-test").expect("Error parsing metadata"); let package = manifest.package.unwrap(); let meta = package.metadata.and_then(|m| m.binstall).unwrap(); From 812fb9b0aff4d44bb384ff7ff1272e52bb419b69 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 4 Aug 2023 07:14:36 +1000 Subject: [PATCH 1401/2020] Fix subcrate resolution for `wasm-bindgen-cli` (#1245) Fixed #1244 Signed-off-by: Jiahao XU --- crates/binstalk/src/fetchers.rs | 39 ++++++++++++++++++++++++++++----- e2e-tests/subcrate.sh | 1 + 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/crates/binstalk/src/fetchers.rs b/crates/binstalk/src/fetchers.rs index 194a96c5..aaf0e5ac 100644 --- a/crates/binstalk/src/fetchers.rs +++ b/crates/binstalk/src/fetchers.rs @@ -80,7 +80,7 @@ pub trait Fetcher: Send + Sync { struct RepoInfo { repo: Url, repository_host: RepositoryHost, - subcrate: Option, + subcrate: Option, } /// Data required to fetch a package @@ -133,7 +133,7 @@ impl RepoInfo { /// If `repo` contains a subcrate, then extracts and returns it. /// It will also remove that subcrate path from `repo` to match /// `scheme:/{repo_owner}/{repo_name}` - fn detect_subcrate(repo: &mut Url, repository_host: RepositoryHost) -> Option { + fn detect_subcrate(repo: &mut Url, repository_host: RepositoryHost) -> Option { match repository_host { RepositoryHost::GitHub => Self::detect_subcrate_common(repo, &["tree"]), RepositoryHost::GitLab => Self::detect_subcrate_common(repo, &["-", "blob"]), @@ -141,7 +141,7 @@ impl RepoInfo { } } - fn detect_subcrate_common(repo: &mut Url, seps: &[&str]) -> Option { + fn detect_subcrate_common(repo: &mut Url, seps: &[&str]) -> Option { let mut path_segments = repo.path_segments()?; let _repo_owner = path_segments.next()?; @@ -157,13 +157,18 @@ impl RepoInfo { // Skip branch name let _branch_name = path_segments.next()?; - let subcrate = path_segments.next()?; + let (subcrate, is_crate_present) = match path_segments.next()? { + // subcrate url is of path /crates/$subcrate_name, e.g. wasm-bindgen-cli + "crates" => (path_segments.next()?, true), + // subcrate url is of path $subcrate_name, e.g. cargo-audit + subcrate => (subcrate, false), + }; if path_segments.next().is_some() { // A subcrate url should not contain anything more. None } else { - let subcrate = subcrate.to_string(); + let subcrate = subcrate.into(); // Pop subcrate path to match regular repo style: // @@ -174,6 +179,9 @@ impl RepoInfo { let mut paths = repo.path_segments_mut().unwrap(); paths.pop(); // pop subcrate + if is_crate_present { + paths.pop(); // pop crate + } paths.pop(); // pop branch name seps.iter().for_each(|_| { paths.pop(); @@ -198,6 +206,7 @@ mod test { #[test] fn test_detect_subcrate_github() { + // cargo-audit let urls = [ "https://github.com/RustSec/rustsec/tree/main/cargo-audit", "https://github.com/RustSec/rustsec/tree/master/cargo-audit", @@ -216,6 +225,26 @@ mod test { Url::parse("https://github.com/RustSec/rustsec").unwrap() ); } + + // wasm-bindgen-cli + let urls = [ + "https://github.com/rustwasm/wasm-bindgen/tree/main/crates/cli", + "https://github.com/rustwasm/wasm-bindgen/tree/master/crates/cli", + ]; + for url in urls { + let mut repo = Url::parse(url).unwrap(); + + let repository_host = RepositoryHost::guess_git_hosting_services(&repo); + assert_eq!(repository_host, RepositoryHost::GitHub); + + let subcrate_prefix = RepoInfo::detect_subcrate(&mut repo, repository_host).unwrap(); + assert_eq!(subcrate_prefix, "cli"); + + assert_eq!( + repo, + Url::parse("https://github.com/rustwasm/wasm-bindgen").unwrap() + ); + } } #[test] diff --git a/e2e-tests/subcrate.sh b/e2e-tests/subcrate.sh index acaa96e0..90e0fcd2 100755 --- a/e2e-tests/subcrate.sh +++ b/e2e-tests/subcrate.sh @@ -13,6 +13,7 @@ mkdir -p "$othertmpdir/bin" # Copy it to bin to test use of env var `CARGO` cp "./$1" "$othertmpdir/bin/" +# cargo-audit cargo binstall --no-confirm cargo-audit@0.17.5 --strategies crate-meta-data cargo_audit_version="$(cargo audit --version)" From c8d82fea0fe1ab894517682dd30fcfc021136bb4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 4 Aug 2023 14:11:27 +1000 Subject: [PATCH 1402/2020] dep: Upgrade transitive dependencies (#1247) Co-authored-by: github-actions --- Cargo.lock | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0a6f0635..d970cdfb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -503,9 +503,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f1226cd9da55587234753d1245dd5b132343ea240f26b6a9003d68706141ba" +checksum = "6c6b2562119bf28c3439f7f02db99faf0aa1a8cdfe5772a2ee155d32227239f0" dependencies = [ "jobserver", "libc", @@ -724,9 +724,9 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "deranged" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8810e7e2cf385b1e9b50d68264908ec367ba642c96d02edfe61c39e88e2a3c01" +checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" [[package]] name = "detect-targets" @@ -1046,9 +1046,9 @@ dependencies = [ [[package]] name = "gh-token" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af48f86426da13e6afda11767aac00deaa9de5948b2a2cfe7d0c5505bd6844aa" +checksum = "c29796559a0962994fcc5994ff97a18e68618508d3f0d8de794475a5045caf09" dependencies = [ "home", "serde", @@ -1956,7 +1956,7 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls 0.21.5", + "rustls 0.21.6", "tokio", "tokio-rustls 0.24.1", ] @@ -2824,7 +2824,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.21.5", + "rustls 0.21.6", "rustls-pemfile 1.0.3", "serde", "serde_json", @@ -2886,9 +2886,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.4" +version = "0.38.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a962918ea88d644592894bc6dc55acc6c0956488adcebbfb6e273506b7fd6e5" +checksum = "1ee020b1716f0a80e2ace9b03441a749e402e86712f15f16fe8a8f75afac732f" dependencies = [ "bitflags 2.3.3", "errno 0.3.2", @@ -2911,9 +2911,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.5" +version = "0.21.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79ea77c539259495ce8ca47f53e66ae0330a8819f67e23ac96ca02f50e7b7d36" +checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" dependencies = [ "log", "ring", @@ -3041,9 +3041,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.180" +version = "1.0.181" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea67f183f058fe88a4e3ec6e2788e003840893b91bac4559cabedd00863b3ed" +checksum = "6d3e73c93c3240c0bda063c239298e633114c69a888c3e37ca8bb33f343e9890" dependencies = [ "serde_derive", ] @@ -3059,9 +3059,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.180" +version = "1.0.181" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24e744d7782b686ab3b73267ef05697159cc0e5abbed3f47f9933165e5219036" +checksum = "be02f6cb0cd3a5ec20bbcfbcbd749f57daddb1a0882dc2e46a6c236c90b977ed" dependencies = [ "proc-macro2", "quote", @@ -3368,9 +3368,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b79eabcd964882a646b3584543ccabeae7869e9ac32a46f6f22b7a5bd405308b" +checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" dependencies = [ "deranged", "itoa", @@ -3469,7 +3469,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.5", + "rustls 0.21.6", "tokio", ] From 3181e16e36d27b9aa949d0202d63a99f03eb572d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 6 Aug 2023 14:53:47 +1000 Subject: [PATCH 1403/2020] Fix CI: Require ziglang < 0.11 (#1250) ziglang 0.11 causes link failure in our CI Signed-off-by: Jiahao XU --- justfile | 2 +- zigbuild-requirements.txt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 zigbuild-requirements.txt diff --git a/justfile b/justfile index 96ec99dc..1bdf106c 100644 --- a/justfile +++ b/justfile @@ -184,7 +184,7 @@ ci-apt-deps := if target == "x86_64-unknown-linux-gnu" { "liblzma-dev libzip-dev [linux] ci-install-deps: if [ -n "{{ci-apt-deps}}" ]; then sudo apt update && sudo apt install -y --no-install-recommends {{ci-apt-deps}}; fi - if [ -n "{{use-cargo-zigbuild}}" ]; then pip3 install cargo-zigbuild; fi + if [ -n "{{use-cargo-zigbuild}}" ]; then pip3 install -r zigbuild-requirements.txt; fi [macos] [windows] diff --git a/zigbuild-requirements.txt b/zigbuild-requirements.txt new file mode 100644 index 00000000..41ba0c5e --- /dev/null +++ b/zigbuild-requirements.txt @@ -0,0 +1,5 @@ +###### Requirements without Version Specifiers ###### +cargo-zigbuild + +###### Requirements with Version Specifiers ###### +ziglang < 0.11 # zig 0.11 causes link failure in our CI From e4c776f403dd357f60b9d8377f4b2dad3897e804 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 6 Aug 2023 15:56:02 +1000 Subject: [PATCH 1404/2020] feat: Support data verification in `Download` (#1248) By accepting `&mut dyn DataVerifier` for users to pass any callback that uses `digest::Digest`/`digest::Mac`, `sigstore` or whatever they want. Signed-off-by: Jiahao XU --- Cargo.lock | 1 - crates/binstalk-downloader/Cargo.toml | 1 - crates/binstalk-downloader/src/download.rs | 139 +++++++++++------- .../src/download/async_extracter.rs | 8 +- crates/binstalk-downloader/src/utils.rs | 4 +- 5 files changed, 92 insertions(+), 61 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d970cdfb..306b54da 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -275,7 +275,6 @@ dependencies = [ "bytes", "bzip2", "compact_str", - "digest", "flate2", "futures-lite", "futures-util", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 25eb22e4..9fe0372d 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -17,7 +17,6 @@ binstalk-types = { version = "0.5.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" compact_str = "0.7.0" -digest = "0.10.7" flate2 = { version = "1.0.26", default-features = false } futures-lite = { version = "1.13.0", default-features = false } futures-util = "0.3.28" diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index ae3138d2..e70095b9 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -1,8 +1,8 @@ -use std::{fmt::Debug, io, marker::PhantomData, path::Path}; +use std::{fmt, io, marker::PhantomData, path::Path}; use binstalk_types::cargo_toml_binstall::PkgFmtDecomposed; -use digest::{Digest, FixedOutput, HashMarker, Output, OutputSizeUser, Update}; -use futures_lite::stream::StreamExt; +use bytes::Bytes; +use futures_lite::stream::{Stream, StreamExt}; use thiserror::Error as ThisError; use tracing::{debug, instrument}; @@ -70,24 +70,95 @@ impl From for io::Error { } } -#[derive(Debug)] -pub struct Download { - client: Client, - url: Url, - _digest: PhantomData, - _checksum: Vec, +pub trait DataVerifier: Send + Sync { + /// Digest input data. + /// + /// This method can be called repeatedly for use with streaming messages, + /// it will be called in the order of the message received. + fn update(&mut self, data: &Bytes); } -impl Download { +impl DataVerifier for T +where + T: FnMut(&Bytes) + Send + Sync, +{ + fn update(&mut self, data: &Bytes) { + (*self)(data) + } +} + +pub struct Download<'a> { + client: Client, + url: Url, + data_verifier: Option<&'a mut dyn DataVerifier>, +} + +impl fmt::Debug for Download<'_> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + #[allow(dead_code, clippy::type_complexity)] + #[derive(Debug)] + struct Download<'a> { + client: &'a Client, + url: &'a Url, + data_verifier: Option>, + } + + fmt::Debug::fmt( + &Download { + client: &self.client, + url: &self.url, + data_verifier: self.data_verifier.as_ref().map(|_| PhantomData), + }, + f, + ) + } +} + +impl Download<'static> { pub fn new(client: Client, url: Url) -> Self { Self { client, url, - _digest: PhantomData, - _checksum: Vec::new(), + data_verifier: None, } } +} +impl<'a> Download<'a> { + pub fn new_with_data_verifier( + client: Client, + url: Url, + data_verifier: &'a mut dyn DataVerifier, + ) -> Self { + Self { + client, + url, + data_verifier: Some(data_verifier), + } + } +} + +impl<'a> Download<'a> { + async fn get_stream( + self, + ) -> Result< + impl Stream> + Send + Sync + Unpin + 'a, + DownloadError, + > { + let mut data_verifier = self.data_verifier; + Ok(self.client.get_stream(self.url).await?.map(move |res| { + let bytes = res?; + + if let Some(data_verifier) = &mut data_verifier { + data_verifier.update(&bytes); + } + + Ok(bytes) + })) + } +} + +impl Download<'_> { /// Download a file from the provided URL and process them in memory. /// /// This does not support verifying a checksum due to the partial extraction @@ -101,11 +172,7 @@ impl Download { fmt: TarBasedFmt, visitor: &mut dyn TarEntriesVisitor, ) -> Result<(), DownloadError> { - let stream = self - .client - .get_stream(self.url) - .await? - .map(|res| res.map_err(DownloadError::from)); + let stream = self.get_stream().await?; debug!("Downloading and extracting then in-memory processing"); @@ -126,15 +193,11 @@ impl Download { path: impl AsRef, ) -> Result { async fn inner( - this: Download, + this: Download<'_>, fmt: PkgFmt, path: &Path, ) -> Result { - let stream = this - .client - .get_stream(this.url) - .await? - .map(|res| res.map_err(DownloadError::from)); + let stream = this.get_stream().await?; debug!("Downloading and extracting to: '{}'", path.display()); @@ -153,36 +216,6 @@ impl Download { } } -impl Download { - pub fn new_with_checksum(client: Client, url: Url, checksum: Vec) -> Self { - Self { - client, - url, - _digest: PhantomData, - _checksum: checksum, - } - } - - // TODO: implement checking the sum, may involve bringing (parts of) and_extract() back in here -} - -#[derive(Clone, Copy, Debug, Default)] -pub struct NoDigest; - -impl FixedOutput for NoDigest { - fn finalize_into(self, _out: &mut Output) {} -} - -impl OutputSizeUser for NoDigest { - type OutputSize = generic_array::typenum::U0; -} - -impl Update for NoDigest { - fn update(&mut self, _data: &[u8]) {} -} - -impl HashMarker for NoDigest {} - #[cfg(test)] mod test { use super::*; diff --git a/crates/binstalk-downloader/src/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs index 09a42837..e7a95c63 100644 --- a/crates/binstalk-downloader/src/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -21,7 +21,7 @@ use crate::utils::{extract_with_blocking_task, StreamReadable}; pub async fn extract_bin(stream: S, path: &Path) -> Result where - S: Stream> + Send + Sync + Unpin + 'static, + S: Stream> + Send + Sync + Unpin, { debug!("Writing to `{}`", path.display()); @@ -45,7 +45,7 @@ where pub async fn extract_zip(stream: S, path: &Path) -> Result where - S: Stream> + Unpin + Send + Sync + 'static, + S: Stream> + Unpin + Send + Sync, { debug!("Decompressing from zip archive to `{}`", path.display()); @@ -79,7 +79,7 @@ pub async fn extract_tar_based_stream( fmt: TarBasedFmt, ) -> Result where - S: Stream> + Send + Sync + Unpin + 'static, + S: Stream> + Send + Sync + Unpin, { debug!("Extracting from {fmt} archive to {}", dst.display()); @@ -162,7 +162,7 @@ fn extract_with_blocking_decoder( f: F, ) -> impl Future> where - S: Stream> + Send + Sync + Unpin + 'static, + S: Stream> + Send + Sync + Unpin, F: FnOnce(mpsc::Receiver, &Path) -> io::Result + Send + Sync + 'static, T: Send + 'static, { diff --git a/crates/binstalk-downloader/src/utils.rs b/crates/binstalk-downloader/src/utils.rs index 2b3c833b..2a47d858 100644 --- a/crates/binstalk-downloader/src/utils.rs +++ b/crates/binstalk-downloader/src/utils.rs @@ -18,7 +18,7 @@ where T: Send + 'static, E: From, E: From, - S: Stream> + Send + Sync + Unpin + 'static, + S: Stream> + Send + Sync + Unpin, F: FnOnce(mpsc::Receiver) -> io::Result + Send + Sync + 'static, { async fn inner( @@ -31,7 +31,7 @@ where E: From, // We do not use trait object for S since there will only be one // S used with this function. - S: Stream> + Send + Sync + Unpin + 'static, + S: Stream> + Send + Sync + Unpin, // asyncify would always return the same future, so no need to // use trait object here. Fut: Future> + Send + Sync, From 435df675b3ff241092f982e631f47157b68dfb55 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 8 Aug 2023 10:53:15 +1000 Subject: [PATCH 1405/2020] Fix too many 429 response (#1231) Fixed #1229 Signed-off-by: Jiahao XU --- Cargo.lock | 25 -- crates/bin/src/args.rs | 6 +- crates/bin/src/entry.rs | 3 +- crates/binstalk-downloader/Cargo.toml | 1 - crates/binstalk-downloader/src/download.rs | 3 +- .../binstalk-downloader/src/gh_api_client.rs | 6 +- crates/binstalk-downloader/src/remote.rs | 25 +- .../src/remote/delay_request.rs | 241 +++++++++++++----- crates/binstalk/src/drivers/registry.rs | 4 +- crates/binstalk/src/fetchers/quickinstall.rs | 4 +- crates/binstalk/src/helpers/remote.rs | 42 ++- 11 files changed, 228 insertions(+), 132 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 306b54da..df3815f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -290,7 +290,6 @@ dependencies = [ "tokio", "tokio-tar", "tokio-util", - "tower", "tracing", "trust-dns-resolver", "url", @@ -3547,29 +3546,6 @@ dependencies = [ "winnow", ] -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - [[package]] name = "tower-service" version = "0.3.2" @@ -3583,7 +3559,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", - "log", "pin-project-lite", "tracing-attributes", "tracing-core", diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index b3189a94..b2e4f60d 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -2,7 +2,7 @@ use std::{ env, ffi::OsString, fmt, - num::{NonZeroU64, ParseIntError}, + num::{NonZeroU16, NonZeroU64, ParseIntError}, path::PathBuf, str::FromStr, }; @@ -348,7 +348,7 @@ impl From for remote::TLSVersion { #[derive(Copy, Clone, Debug)] pub struct RateLimit { - pub duration: NonZeroU64, + pub duration: NonZeroU16, pub request_count: NonZeroU64, } @@ -379,7 +379,7 @@ impl FromStr for RateLimit { impl Default for RateLimit { fn default() -> Self { Self { - duration: NonZeroU64::new(10).unwrap(), + duration: NonZeroU16::new(10).unwrap(), request_count: NonZeroU64::new(1).unwrap(), } } diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index a51f16b3..1005b390 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -4,7 +4,6 @@ use std::{ future::Future, path::{Path, PathBuf}, sync::Arc, - time::Duration, }; use binstalk::{ @@ -100,7 +99,7 @@ pub fn install_crates( let client = Client::new( concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), args.min_tls_version.map(|v| v.into()), - Duration::from_millis(rate_limit.duration.get()), + rate_limit.duration, rate_limit.request_count, read_root_certs( args.root_certificates, diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 9fe0372d..abf561fd 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -37,7 +37,6 @@ thiserror = "1.0.40" tokio = { version = "1.28.2", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.8", features = ["io"] } -tower = { version = "0.4.13", features = ["limit", "util"] } tracing = "0.1.37" # trust-dns-resolver must be kept in sync with the version reqwest uses trust-dns-resolver = { version = "0.22.0", optional = true, default-features = false, features = ["dnssec-ring"] } diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index e70095b9..30388808 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -223,6 +223,7 @@ mod test { use std::{ collections::{HashMap, HashSet}, ffi::OsStr, + num::NonZeroU16, }; use tempfile::tempdir; @@ -231,7 +232,7 @@ mod test { let client = crate::remote::Client::new( concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), None, - std::time::Duration::from_millis(10), + NonZeroU16::new(10).unwrap(), 1.try_into().unwrap(), [], ) diff --git a/crates/binstalk-downloader/src/gh_api_client.rs b/crates/binstalk-downloader/src/gh_api_client.rs index 10bedf6f..1439b2d5 100644 --- a/crates/binstalk-downloader/src/gh_api_client.rs +++ b/crates/binstalk-downloader/src/gh_api_client.rs @@ -21,7 +21,7 @@ mod request; pub use request::{GhApiContextError, GhApiError, GhGraphQLErrors}; /// default retry duration if x-ratelimit-reset is not found in response header -const DEFAULT_RETRY_DURATION: Duration = Duration::from_secs(5 * 60); +const DEFAULT_RETRY_DURATION: Duration = Duration::from_secs(10 * 60); fn percent_encode_http_url_path(path: &str) -> PercentEncode<'_> { /// https://url.spec.whatwg.org/#fragment-percent-encode-set @@ -289,7 +289,7 @@ pub enum HasReleaseArtifact { mod test { use super::*; use compact_str::{CompactString, ToCompactString}; - use std::env; + use std::{env, num::NonZeroU16}; mod cargo_binstall_v0_20_1 { use super::{CompactString, GhRelease}; @@ -383,7 +383,7 @@ mod test { let client = remote::Client::new( concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), None, - Duration::from_millis(10), + NonZeroU16::new(10).unwrap(), 1.try_into().unwrap(), [], ) diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index abda9d66..7d9eceb7 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -1,5 +1,5 @@ use std::{ - num::{NonZeroU64, NonZeroU8}, + num::{NonZeroU16, NonZeroU64, NonZeroU8}, ops::ControlFlow, sync::Arc, time::{Duration, SystemTime}, @@ -13,7 +13,6 @@ use reqwest::{ Request, }; use thiserror::Error as ThisError; -use tower::{limit::rate::RateLimit, Service, ServiceBuilder, ServiceExt}; use tracing::{debug, info}; pub use reqwest::{header, Error as ReqwestError, Method, StatusCode}; @@ -73,7 +72,7 @@ impl HttpError { #[derive(Debug)] struct Inner { client: reqwest::Client, - service: DelayRequest>, + service: DelayRequest, } #[derive(Clone, Debug)] @@ -81,7 +80,9 @@ pub struct Client(Arc); #[cfg_attr(not(feature = "__tls"), allow(unused_variables, unused_mut))] impl Client { - /// * `per` - must not be 0. + /// * `per_millis` - The duration (in millisecond) for which at most + /// `num_request` can be sent, itcould be increased if rate-limit + /// happens. /// * `num_request` - maximum number of requests to be processed for /// each `per` duration. /// @@ -89,14 +90,14 @@ impl Client { pub fn new( user_agent: impl AsRef, min_tls: Option, - per: Duration, + per_millis: NonZeroU16, num_request: NonZeroU64, certificates: impl IntoIterator, ) -> Result { fn inner( user_agent: &str, min_tls: Option, - per: Duration, + per_millis: NonZeroU16, num_request: NonZeroU64, certificates: &mut dyn Iterator, ) -> Result { @@ -123,9 +124,9 @@ impl Client { Ok(Client(Arc::new(Inner { client: client.clone(), service: DelayRequest::new( - ServiceBuilder::new() - .rate_limit(num_request.get(), per) - .service(client), + num_request, + Duration::from_millis(per_millis.get() as u64), + client, ), }))) } @@ -133,7 +134,7 @@ impl Client { inner( user_agent.as_ref(), min_tls, - per, + per_millis, num_request, &mut certificates.into_iter(), ) @@ -159,9 +160,7 @@ impl Client { url: &Url, ) -> Result>, ReqwestError> { - let future = (&self.0.service).ready().await?.call(request); - - let response = match future.await { + let response = match self.0.service.call(request).await { Err(err) if err.is_timeout() || err.is_connect() => { let duration = RETRY_DURATION_FOR_TIMEOUT; diff --git a/crates/binstalk-downloader/src/remote/delay_request.rs b/crates/binstalk-downloader/src/remote/delay_request.rs index 8e20682b..3feb804d 100644 --- a/crates/binstalk-downloader/src/remote/delay_request.rs +++ b/crates/binstalk-downloader/src/remote/delay_request.rs @@ -1,19 +1,14 @@ use std::{ - collections::HashMap, - future::Future, - iter::Peekable, - pin::Pin, + collections::HashMap, future::Future, iter::Peekable, num::NonZeroU64, ops::ControlFlow, sync::Mutex, - task::{Context, Poll}, }; use compact_str::{CompactString, ToCompactString}; use reqwest::{Request, Url}; -use tokio::{ - sync::Mutex as AsyncMutex, - time::{sleep_until, Duration, Instant}, -}; -use tower::{Service, ServiceExt}; +use tokio::time::{sleep_until, Duration, Instant}; +use tracing::debug; + +pub(super) type RequestResult = Result; trait IterExt: Iterator { fn dedup(self) -> Dedup @@ -47,15 +42,107 @@ where } #[derive(Debug)] -pub(super) struct DelayRequest { - inner: AsyncMutex, +struct Inner { + client: reqwest::Client, + num_request: NonZeroU64, + per: Duration, + until: Instant, + state: State, +} + +#[derive(Debug)] +enum State { + Limited, + Ready { rem: NonZeroU64 }, +} + +impl Inner { + fn new(num_request: NonZeroU64, per: Duration, client: reqwest::Client) -> Self { + Inner { + client, + per, + num_request, + until: Instant::now() + per, + state: State::Ready { rem: num_request }, + } + } + + fn inc_rate_limit(&mut self) { + if let Some(num_request) = NonZeroU64::new(self.num_request.get() / 2) { + // If self.num_request.get() > 1, then cut it by half + self.num_request = num_request; + if let State::Ready { rem, .. } = &mut self.state { + *rem = num_request.min(*rem) + } + } + + let per = self.per; + if per < Duration::from_millis(700) { + self.per = per.mul_f32(1.2); + self.until += self.per - per; + } + } + + fn ready(&mut self) -> Readiness { + match self.state { + State::Ready { .. } => Readiness::Ready, + State::Limited => { + if self.until.elapsed().is_zero() { + Readiness::Limited(self.until) + } else { + // rate limit can be reset now and is ready + self.until = Instant::now() + self.per; + self.state = State::Ready { + rem: self.num_request, + }; + + Readiness::Ready + } + } + } + } + + fn call(&mut self, req: Request) -> impl Future { + match &mut self.state { + State::Ready { rem } => { + let now = Instant::now(); + + // If the period has elapsed, reset it. + if now >= self.until { + self.until = now + self.per; + *rem = self.num_request; + } + + if let Some(new_rem) = NonZeroU64::new(rem.get() - 1) { + *rem = new_rem; + } else { + // The service is disabled until further notice + self.state = State::Limited; + } + + // Call the inner future + self.client.execute(req) + } + State::Limited => panic!("service not ready; poll_ready must be called first"), + } + } +} + +enum Readiness { + Limited(Instant), + Ready, +} + +#[derive(Debug)] +pub(super) struct DelayRequest { + inner: Mutex, hosts_to_delay: Mutex>, } -impl DelayRequest { - pub(super) fn new(inner: S) -> Self { +impl DelayRequest { + pub(super) fn new(num_request: NonZeroU64, per: Duration, client: reqwest::Client) -> Self { Self { - inner: AsyncMutex::new(inner), + inner: Mutex::new(Inner::new(num_request, per, client)), hosts_to_delay: Default::default(), } } @@ -78,61 +165,81 @@ impl DelayRequest { }); } - fn wait_until_available(&self, url: &Url) -> impl Future + Send + 'static { + fn get_delay_until(&self, host: &str) -> Option { let mut hosts_to_delay = self.hosts_to_delay.lock().unwrap(); - let deadline = url - .host_str() - .and_then(|host| hosts_to_delay.get(host).map(|deadline| (*deadline, host))) - .and_then(|(deadline, host)| { - if deadline.elapsed().is_zero() { - Some(deadline) - } else { - // We have already gone past the deadline, - // so we should remove it instead. - hosts_to_delay.remove(host); - None - } - }); - - async move { - if let Some(deadline) = deadline { - sleep_until(deadline).await; + hosts_to_delay.get(host).copied().and_then(|until| { + if until.elapsed().is_zero() { + Some(until) + } else { + // We have already gone past the deadline, + // so we should remove it instead. + hosts_to_delay.remove(host); + None } - } - } -} - -impl<'this, S> Service for &'this DelayRequest -where - S: Service + Send, - S::Future: Send, -{ - type Response = S::Response; - type Error = S::Error; - // TODO: Replace this with `type_alias_impl_trait` once it stablises - // https://github.com/rust-lang/rust/issues/63063 - type Future = Pin> + Send + 'this>>; - - fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { - Poll::Ready(Ok(())) - } - - fn call(&mut self, req: Request) -> Self::Future { - let this = *self; - - Box::pin(async move { - this.wait_until_available(req.url()).await; - - // Reduce critical section: - // - Construct the request before locking - // - Once it is ready, call it and obtain - // the future, then release the lock before - // polling the future, which performs network I/O that could - // take really long. - let future = this.inner.lock().await.ready().await?.call(req); - - future.await }) } + + // Define a new function so that the guard will be dropped ASAP and not + // included in the future. + fn call_inner( + &self, + counter: &mut u32, + req: &mut Option, + ) -> ControlFlow, Instant> { + // Wait until we are ready to send next requests + // (client-side rate-limit throttler). + let mut guard = self.inner.lock().unwrap(); + + if let Readiness::Limited(until) = guard.ready() { + ControlFlow::Continue(until) + } else if let Some(until) = req + .as_ref() + .unwrap() + .url() + .host_str() + .and_then(|host| self.get_delay_until(host)) + { + // If the host rate-limit us, then wait until then + // and try again (server-side rate-limit throttler). + + // Try increasing client-side rate-limit throttler to prevent + // rate-limit in the future. + guard.inc_rate_limit(); + + let additional_delay = + Duration::from_millis(200) + Duration::from_millis(100) * 20.min(*counter); + + *counter += 1; + + debug!("server-side rate limit exceeded; sleeping."); + ControlFlow::Continue(until + additional_delay) + } else { + ControlFlow::Break(guard.call(req.take().unwrap())) + } + } + + pub(super) async fn call(&self, req: Request) -> RequestResult { + // Put all variables in a block so that will be dropped before polling + // the future returned by reqwest. + { + let mut counter = 0; + // Use Option here so that we don't have to move entire `Request` + // twice when calling `self.call_inner` while retain the ability to + // take its value without boxing. + // + // This will be taken when `ControlFlow::Break` is then it will + // break the loop, so it will never call `self.call_inner` with + // a `None`. + let mut req = Some(req); + + loop { + match self.call_inner(&mut counter, &mut req) { + ControlFlow::Continue(until) => sleep_until(until).await, + ControlFlow::Break(future) => break future, + } + } + } + .await + } } diff --git a/crates/binstalk/src/drivers/registry.rs b/crates/binstalk/src/drivers/registry.rs index 2e137e17..7938d98a 100644 --- a/crates/binstalk/src/drivers/registry.rs +++ b/crates/binstalk/src/drivers/registry.rs @@ -164,7 +164,7 @@ impl FromStr for Registry { #[cfg(test)] mod test { - use std::time::Duration; + use std::num::NonZeroU16; use toml_edit::ser::to_string; @@ -176,7 +176,7 @@ mod test { Client::new( concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), None, - Duration::from_millis(10), + NonZeroU16::new(10).unwrap(), 1.try_into().unwrap(), [], ) diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk/src/fetchers/quickinstall.rs index 273fd720..157ae679 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk/src/fetchers/quickinstall.rs @@ -208,7 +208,7 @@ impl QuickInstall { #[cfg(test)] mod test { use super::{get_quickinstall_supported_targets, Client, CompactString}; - use std::time::Duration; + use std::num::NonZeroU16; /// Mark this as an async fn so that you won't accidentally use it in /// sync context. @@ -216,7 +216,7 @@ mod test { Client::new( concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), None, - Duration::from_millis(10), + NonZeroU16::new(10).unwrap(), 1.try_into().unwrap(), [], ) diff --git a/crates/binstalk/src/helpers/remote.rs b/crates/binstalk/src/helpers/remote.rs index e794c744..24635b89 100644 --- a/crates/binstalk/src/helpers/remote.rs +++ b/crates/binstalk/src/helpers/remote.rs @@ -2,6 +2,10 @@ pub use binstalk_downloader::remote::*; pub use url::ParseError as UrlParseError; use binstalk_downloader::gh_api_client::{GhApiClient, GhReleaseArtifact, HasReleaseArtifact}; +use std::sync::{ + atomic::{AtomicBool, Ordering::Relaxed}, + Once, +}; use tracing::{debug, warn}; use crate::errors::BinstallError; @@ -13,24 +17,36 @@ pub async fn does_url_exist( gh_api_client: GhApiClient, url: &Url, ) -> Result { + static GH_API_CLIENT_FAILED: AtomicBool = AtomicBool::new(false); + static WARN_RATE_LIMIT_ONCE: Once = Once::new(); + static WARN_UNAUTHORIZED_ONCE: Once = Once::new(); + debug!("Checking for package at: '{url}'"); - if let Some(artifact) = GhReleaseArtifact::try_extract_from_url(url) { - debug!("Using GitHub API to check for existence of artifact, which will also cache the API response"); + if !GH_API_CLIENT_FAILED.load(Relaxed) { + if let Some(artifact) = GhReleaseArtifact::try_extract_from_url(url) { + debug!("Using GitHub API to check for existence of artifact, which will also cache the API response"); - // The future returned has the same size as a pointer - match gh_api_client.has_release_artifact(artifact).await? { - HasReleaseArtifact::Yes => return Ok(true), - HasReleaseArtifact::No | HasReleaseArtifact::NoSuchRelease => return Ok(false), + // The future returned has the same size as a pointer + match gh_api_client.has_release_artifact(artifact).await? { + HasReleaseArtifact::Yes => return Ok(true), + HasReleaseArtifact::No | HasReleaseArtifact::NoSuchRelease => return Ok(false), - HasReleaseArtifact::RateLimit { retry_after } => { - warn!("Your GitHub API token (if any) has reached its rate limit and cannot be used again until {retry_after:?}, so we will fallback to HEAD/GET on the url."); - warn!("If you did not supply a github token, consider doing so: GitHub limits unauthorized users to 60 requests per hour per origin IP address."); - } - HasReleaseArtifact::Unauthorized => { - warn!("GitHub API somehow requires a token for the API access, so we will fallback to HEAD/GET on the url."); - warn!("Please consider supplying a token to cargo-binstall to speedup resolution."); + HasReleaseArtifact::RateLimit { retry_after } => { + WARN_RATE_LIMIT_ONCE.call_once(|| { + warn!("Your GitHub API token (if any) has reached its rate limit and cannot be used again until {retry_after:?}, so we will fallback to HEAD/GET on the url."); + warn!("If you did not supply a github token, consider doing so: GitHub limits unauthorized users to 60 requests per hour per origin IP address."); + }); + } + HasReleaseArtifact::Unauthorized => { + WARN_UNAUTHORIZED_ONCE.call_once(|| { + warn!("GitHub API somehow requires a token for the API access, so we will fallback to HEAD/GET on the url."); + warn!("Please consider supplying a token to cargo-binstall to speedup resolution."); + }); + } } + + GH_API_CLIENT_FAILED.store(true, Relaxed); } } From 1e4e0d166d2aa1a9679090ae6b98e4a486849217 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 8 Aug 2023 10:53:36 +1000 Subject: [PATCH 1406/2020] Use `rust-lld` in CI (#1253) Which guarantees: - faster linking on all targets when `cargo-zigbuild` is not used - allow cross-lang-lto to be enabled Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 17 +++++++++++++++++ .github/workflows/release-build.yml | 8 ++++++++ 2 files changed, 25 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1537371..edbef9e9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,11 +38,18 @@ jobs: os: windows-latest runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash env: CARGO_BUILD_TARGET: ${{ matrix.target }} steps: - uses: actions/checkout@v3 + - name: Use rust-lld + run: | + echo "CARGO_TARGET_${CARGO_BUILD_TARGET}_LINKER=rust-lld" >> "$GITHUB_ENV" + - uses: ./.github/actions/just-setup env: # just-setup use binstall to install sccache, @@ -74,10 +81,17 @@ jobs: - target: aarch64-pc-windows-msvc os: windows-latest runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash env: CARGO_BUILD_TARGET: ${{ matrix.target }} steps: - uses: actions/checkout@v3 + - name: Use rust-lld + run: | + echo "CARGO_TARGET_${CARGO_BUILD_TARGET}_LINKER=rust-lld" >> "$GITHUB_ENV" + - uses: ./.github/actions/just-setup with: tools: cargo-hack @@ -107,6 +121,9 @@ jobs: os: windows-latest runs-on: ${{ matrix.os }} + defaults: + run: + shell: bash steps: - uses: actions/checkout@v3 - uses: ./.github/actions/just-setup diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 742e7288..a319e0db 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -42,6 +42,9 @@ jobs: name: ${{ matrix.t }} runs-on: ${{ matrix.o }} + defaults: + run: + shell: bash env: CARGO_BUILD_TARGET: ${{ matrix.t }} GLIBC_VERSION: ${{ matrix.g }} @@ -60,6 +63,10 @@ jobs: if: inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS run: echo "CARGO_PROFILE_RELEASE_CODEGEN_UNITS=${{ inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS }}" >> "$GITHUB_ENV" + - name: Use rust-lld + run: | + echo "CARGO_TARGET_${CARGO_BUILD_TARGET}_LINKER=rust-lld" >> "$GITHUB_ENV" + - uses: ./.github/actions/just-setup with: tools: cargo-auditable @@ -73,6 +80,7 @@ jobs: - run: just package - if: runner.os == 'Windows' + shell: pwsh run: Get-ChildItem packages/ - if: runner.os != 'Windows' run: ls -shal packages/ From 87cfac4bdf89dbff1c392d0d8ba022cf49894f00 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 8 Aug 2023 02:33:17 +0000 Subject: [PATCH 1407/2020] dep: Upgrade transitive dependencies (#1255) Co-authored-by: github-actions --- Cargo.lock | 82 +++++++++++++++++++++++++++--------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index df3815f9..797e70b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -501,9 +501,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c6b2562119bf28c3439f7f02db99faf0aa1a8cdfe5772a2ee155d32227239f0" +checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" dependencies = [ "jobserver", "libc", @@ -517,9 +517,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.19" +version = "4.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fd304a20bff958a57f04c4e96a2e7594cc4490a0e809cbd48bb6437edaa452d" +checksum = "c27cdf28c0f604ba3f512b0c9a409f8de8513e4816705deb0498b627e7c3a3fd" dependencies = [ "clap_builder", "clap_derive", @@ -528,9 +528,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.19" +version = "4.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01c6a3f08f1fe5662a35cfe393aec09c4df95f60ee93b7556505260f75eee9e1" +checksum = "08a9f1ab5e9f01a9b81f202e8562eb9a10de70abf9eaeac1be465c28b75aa4aa" dependencies = [ "anstream", "anstyle", @@ -873,13 +873,13 @@ checksum = "fd991bcfc01ee8f9ed83108da842aeddfca8a9550962cbffc9579050109c2aa9" [[package]] name = "filetime" -version = "0.2.21" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cbc844cecaee9d4443931972e1289c8ff485cb4cc2767cb03ca139ed6885153" +checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.2.16", + "redox_syscall 0.3.5", "windows-sys", ] @@ -1187,9 +1187,9 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4c2d5ce99eba59fe9477a9e3037b0e1d0266d53925cc4b322bc06c566589b99" +checksum = "8219fe6f39588a29dbfb8d1c244b07ee653126edc5b6f3860752c3b5454fa10b" dependencies = [ "bstr", "gix-chunk", @@ -1252,9 +1252,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56b0312dba1ad003d9b8c502bed52fbcf106f8de3a9a26bfa7b45642a6f94b72" +checksum = "e4f7c76578a69b736c3f0770f14757e9027354011d24c56d79207add9d7d1be6" dependencies = [ "bstr", "itoa", @@ -1344,9 +1344,9 @@ dependencies = [ [[package]] name = "gix-glob" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7c79b881a18d89a75876ba277476d5a2bad5b19f03759c7a07e0808dfe08212" +checksum = "b7255c717f49a556fa5029f6d9f2b3c008b4dd016c87f23c2ab8ca9636d5fade" dependencies = [ "bitflags 2.3.3", "bstr", @@ -2467,9 +2467,9 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "openssl" -version = "0.10.55" +version = "0.10.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" +checksum = "729b745ad4a5575dd06a3e1af1414bd330ee561c01b3899eb584baeaa8def17e" dependencies = [ "bitflags 1.3.2", "cfg-if", @@ -2499,9 +2499,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.90" +version = "0.9.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" +checksum = "866b5f16f90776b9bb8dc1e1802ac6f0513de3a7a7465867bfbc563dc737faac" dependencies = [ "cc", "libc", @@ -2558,18 +2558,18 @@ checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" [[package]] name = "pin-project" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", @@ -2578,9 +2578,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" +checksum = "2c516611246607d0c04186886dbb3a754368ef82c79e9827a802c6d836dd111c" [[package]] name = "pin-utils" @@ -2792,9 +2792,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.4" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7b6d6190b7594385f61bd3911cd1be99dfddcfc365a4160cc2ab5bff4aed294" +checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" [[package]] name = "reqwest" @@ -2884,9 +2884,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.6" +version = "0.38.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee020b1716f0a80e2ace9b03441a749e402e86712f15f16fe8a8f75afac732f" +checksum = "172891ebdceb05aa0005f533a6cbfca599ddd7d966f6f5d4d9b2e70478e70399" dependencies = [ "bitflags 2.3.3", "errno 0.3.2", @@ -3039,9 +3039,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.181" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d3e73c93c3240c0bda063c239298e633114c69a888c3e37ca8bb33f343e9890" +checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" dependencies = [ "serde_derive", ] @@ -3057,9 +3057,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.181" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be02f6cb0cd3a5ec20bbcfbcbd749f57daddb1a0882dc2e46a6c236c90b977ed" +checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" dependencies = [ "proc-macro2", "quote", @@ -3125,9 +3125,9 @@ dependencies = [ [[package]] name = "sha1-asm" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "563d4f7100bc3fce234e5f37bbf63dc2752558964505ba6ac3f7204bdc59eaac" +checksum = "2ba6947745e7f86be3b8af00b7355857085dbdf8901393c89514510eb61f4e21" dependencies = [ "cc", ] @@ -3233,9 +3233,9 @@ checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" [[package]] name = "strum_macros" -version = "0.25.1" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6069ca09d878a33f883cc06aaa9718ede171841d3832450354410b718b097232" +checksum = "ad8d03b598d3d0fff69bf533ee3ef19b8eeb342729596df84bcc7e1f96ec4059" dependencies = [ "heck", "proc-macro2", @@ -3302,9 +3302,9 @@ checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "tempfile" -version = "3.7.0" +version = "3.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5486094ee78b2e5038a6382ed7645bc084dc2ec433426ca4c3cb61e2007b8998" +checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" dependencies = [ "cfg-if", "fastrand", @@ -4136,9 +4136,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46aab759304e4d7b2075a9aecba26228bb073ee8c50db796b2c72c676b5d807" +checksum = "acaaa1190073b2b101e15083c38ee8ec891b5e05cbee516521e94ec008f61e64" dependencies = [ "memchr", ] From 2fbcf188a70386862d799d8c016ac07d15b2f08a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 8 Aug 2023 20:45:40 +1000 Subject: [PATCH 1408/2020] Revert "Use `rust-lld` in CI" (#1257) Revert "Use `rust-lld` in CI (#1253)" This reverts commit 1e4e0d166d2aa1a9679090ae6b98e4a486849217. Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 17 ----------------- .github/workflows/release-build.yml | 8 -------- 2 files changed, 25 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index edbef9e9..e1537371 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,18 +38,11 @@ jobs: os: windows-latest runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash env: CARGO_BUILD_TARGET: ${{ matrix.target }} steps: - uses: actions/checkout@v3 - - name: Use rust-lld - run: | - echo "CARGO_TARGET_${CARGO_BUILD_TARGET}_LINKER=rust-lld" >> "$GITHUB_ENV" - - uses: ./.github/actions/just-setup env: # just-setup use binstall to install sccache, @@ -81,17 +74,10 @@ jobs: - target: aarch64-pc-windows-msvc os: windows-latest runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash env: CARGO_BUILD_TARGET: ${{ matrix.target }} steps: - uses: actions/checkout@v3 - - name: Use rust-lld - run: | - echo "CARGO_TARGET_${CARGO_BUILD_TARGET}_LINKER=rust-lld" >> "$GITHUB_ENV" - - uses: ./.github/actions/just-setup with: tools: cargo-hack @@ -121,9 +107,6 @@ jobs: os: windows-latest runs-on: ${{ matrix.os }} - defaults: - run: - shell: bash steps: - uses: actions/checkout@v3 - uses: ./.github/actions/just-setup diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index a319e0db..742e7288 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -42,9 +42,6 @@ jobs: name: ${{ matrix.t }} runs-on: ${{ matrix.o }} - defaults: - run: - shell: bash env: CARGO_BUILD_TARGET: ${{ matrix.t }} GLIBC_VERSION: ${{ matrix.g }} @@ -63,10 +60,6 @@ jobs: if: inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS run: echo "CARGO_PROFILE_RELEASE_CODEGEN_UNITS=${{ inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS }}" >> "$GITHUB_ENV" - - name: Use rust-lld - run: | - echo "CARGO_TARGET_${CARGO_BUILD_TARGET}_LINKER=rust-lld" >> "$GITHUB_ENV" - - uses: ./.github/actions/just-setup with: tools: cargo-auditable @@ -80,7 +73,6 @@ jobs: - run: just package - if: runner.os == 'Windows' - shell: pwsh run: Get-ChildItem packages/ - if: runner.os != 'Windows' run: ls -shal packages/ From ac012bdcb27d1b092af056c74dc0bc773f527095 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 8 Aug 2023 20:48:12 +1000 Subject: [PATCH 1409/2020] Remove dep `futures-lite` from `binstalk-downloader` (#1259) I planned to replace `futures-util` with `futures-lite`, but it turns out that `reqwest` actually depends on `futures-util`, so there is no point removing it and introduce yet another dependency. Signed-off-by: Jiahao XU --- Cargo.lock | 11 ----------- crates/binstalk-downloader/Cargo.toml | 1 - crates/binstalk-downloader/src/download.rs | 2 +- .../src/download/async_extracter.rs | 2 +- .../src/download/async_tar_visitor.rs | 2 +- .../src/download/zip_extraction.rs | 2 +- crates/binstalk-downloader/src/remote.rs | 2 +- .../binstalk-downloader/src/remote/request_builder.rs | 2 +- crates/binstalk-downloader/src/utils.rs | 7 ++----- 9 files changed, 8 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 797e70b0..357a6f28 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -276,7 +276,6 @@ dependencies = [ "bzip2", "compact_str", "flate2", - "futures-lite", "futures-util", "generic-array", "httpdate", @@ -962,16 +961,6 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" -[[package]] -name = "futures-lite" -version = "1.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" -dependencies = [ - "futures-core", - "pin-project-lite", -] - [[package]] name = "futures-macro" version = "0.3.28" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index abf561fd..7fa4b3c8 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -18,7 +18,6 @@ bytes = "1.4.0" bzip2 = "0.4.4" compact_str = "0.7.0" flate2 = { version = "1.0.26", default-features = false } -futures-lite = { version = "1.13.0", default-features = false } futures-util = "0.3.28" generic-array = "0.14.7" httpdate = "1.0.2" diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index 30388808..04891398 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -2,7 +2,7 @@ use std::{fmt, io, marker::PhantomData, path::Path}; use binstalk_types::cargo_toml_binstall::PkgFmtDecomposed; use bytes::Bytes; -use futures_lite::stream::{Stream, StreamExt}; +use futures_util::{Stream, StreamExt}; use thiserror::Error as ThisError; use tracing::{debug, instrument}; diff --git a/crates/binstalk-downloader/src/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs index e7a95c63..6add5830 100644 --- a/crates/binstalk-downloader/src/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -8,7 +8,7 @@ use std::{ use async_zip::base::read::stream::ZipFileReader; use bytes::{Bytes, BytesMut}; -use futures_lite::stream::Stream; +use futures_util::Stream; use tokio::sync::mpsc; use tokio_util::io::StreamReader; use tracing::debug; diff --git a/crates/binstalk-downloader/src/download/async_tar_visitor.rs b/crates/binstalk-downloader/src/download/async_tar_visitor.rs index af1abba2..b6cdfa7d 100644 --- a/crates/binstalk-downloader/src/download/async_tar_visitor.rs +++ b/crates/binstalk-downloader/src/download/async_tar_visitor.rs @@ -2,7 +2,7 @@ use std::{borrow::Cow, fmt::Debug, io, path::Path, pin::Pin}; use async_compression::tokio::bufread; use bytes::Bytes; -use futures_lite::stream::{Stream, StreamExt}; +use futures_util::{Stream, StreamExt}; use tokio::io::{copy, sink, AsyncRead}; use tokio_tar::{Archive, Entry, EntryType}; use tokio_util::io::StreamReader; diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index b581b5f7..7242626c 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -9,7 +9,7 @@ use async_zip::{ ZipString, }; use bytes::{Bytes, BytesMut}; -use futures_lite::future::try_zip as try_join; +use futures_util::future::try_join; use futures_util::io::Take; use thiserror::Error as ThisError; use tokio::{ diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 7d9eceb7..6d7e7713 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -6,7 +6,7 @@ use std::{ }; use bytes::Bytes; -use futures_lite::stream::Stream; +use futures_util::Stream; use httpdate::parse_http_date; use reqwest::{ header::{HeaderMap, RETRY_AFTER}, diff --git a/crates/binstalk-downloader/src/remote/request_builder.rs b/crates/binstalk-downloader/src/remote/request_builder.rs index cc0175a6..4dfacd30 100644 --- a/crates/binstalk-downloader/src/remote/request_builder.rs +++ b/crates/binstalk-downloader/src/remote/request_builder.rs @@ -1,7 +1,7 @@ use std::fmt; use bytes::Bytes; -use futures_lite::stream::{Stream, StreamExt}; +use futures_util::{Stream, StreamExt}; use reqwest::Method; use super::{header, Client, Error, HttpError, StatusCode, Url}; diff --git a/crates/binstalk-downloader/src/utils.rs b/crates/binstalk-downloader/src/utils.rs index 2a47d858..65f38918 100644 --- a/crates/binstalk-downloader/src/utils.rs +++ b/crates/binstalk-downloader/src/utils.rs @@ -4,10 +4,7 @@ use std::{ }; use bytes::{Buf, Bytes}; -use futures_lite::{ - future::poll_once, - stream::{Stream, StreamExt}, -}; +use futures_util::{FutureExt, Stream, StreamExt}; use tokio::{sync::mpsc, task}; pub(super) fn extract_with_blocking_task( @@ -77,7 +74,7 @@ where res = &mut task_fut => { // The task finishes before the read task, return early // after checking for errors in read_fut. - if let Some(Err(err)) = poll_once(read_fut).await { + if let Some(Err(err)) = read_fut.now_or_never() { Err(err) } else { res From 939c9b43b268eec44001cce4d2a0687686fc57e0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 05:07:46 +0000 Subject: [PATCH 1410/2020] dep: Upgrade transitive dependencies (#1266) Co-authored-by: github-actions --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 357a6f28..36588b25 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2940,9 +2940,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.2" +version = "0.101.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "513722fd73ad80a71f72b61009ea1b584bcfa1483ca93949c8f290298837fa59" +checksum = "261e9e0888cba427c3316e6322805653c9425240b6fd96cee7cb671ab70ab8d0" dependencies = [ "ring", "untrusted", From a9e2ef11f19c3322cf0ae85379c0ae24a1ca0c4e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 9 Aug 2023 17:41:20 +1000 Subject: [PATCH 1411/2020] Fix reading env `CARGO_REGISTRIES_{registry_name}_INDEX` (#1258) Try bogth original and upper-case version. Signed-off-by: Jiahao XU --- crates/bin/src/entry.rs | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 1005b390..7bb6fa32 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -149,18 +149,29 @@ pub fn install_crates( .registry .or_else(|| config.registry.and_then(|registry| registry.default)) { - env::var(format!("CARGO_REGISTRIES_{registry_name}_INDEX")) - .map(Cow::Owned) - .or_else(|_| { - config - .registries - .as_ref() - .and_then(|registries| registries.get(®istry_name)) - .and_then(|registry| registry.index.as_deref().map(Cow::Borrowed)) - .ok_or_else(|| BinstallError::UnknownRegistryName(registry_name)) - })? - .parse() - .map_err(BinstallError::from)? + let registry_name_lowercase = registry_name.to_lowercase(); + + let v = env::vars().find_map(|(k, v)| { + let name_lowercase = k + .strip_prefix("CARGO_REGISTRIES_")? + .strip_suffix("_INDEX")? + .to_lowercase(); + + (name_lowercase == registry_name_lowercase).then_some(v) + }); + + if let Some(v) = &v { + v + } else { + config + .registries + .as_ref() + .and_then(|registries| registries.get(®istry_name)) + .and_then(|registry| registry.index.as_deref()) + .ok_or_else(|| BinstallError::UnknownRegistryName(registry_name))? + } + .parse() + .map_err(BinstallError::from)? } else { Default::default() }, From 9c521d162aaca815e66a35ed5642331f2885ea89 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 9 Aug 2023 17:44:10 +1000 Subject: [PATCH 1412/2020] Enable unstable feature `reqwest/http3` in CI (#1261) For dev and release build, so that pre-built binaries of `cargo-binstall` can utilize http3 protocol. Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 1 + .github/workflows/release-build.yml | 1 + Cargo.lock | 143 ++++++++++++++++++++++++-- crates/bin/Cargo.toml | 4 + crates/binstalk-downloader/Cargo.toml | 7 ++ crates/binstalk/Cargo.toml | 4 + justfile | 14 ++- 7 files changed, 163 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e1537371..14358719 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,6 +23,7 @@ concurrency: env: CARGO_TERM_COLOR: always CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse + JUST_ENABLE_H3: true jobs: test: diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 742e7288..e9e4d4cb 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -48,6 +48,7 @@ jobs: JUST_USE_CARGO_ZIGBUILD: ${{ matrix.c }} JUST_FOR_RELEASE: true JUST_USE_AUDITABLE: true + JUST_ENABLE_H3: true steps: - uses: actions/checkout@v3 diff --git a/Cargo.lock b/Cargo.lock index 36588b25..5cf51c81 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -858,6 +858,15 @@ dependencies = [ "libc", ] +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + [[package]] name = "fastrand" version = "2.0.0" @@ -940,6 +949,21 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "futures" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + [[package]] name = "futures-channel" version = "0.3.28" @@ -947,6 +971,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", + "futures-sink", ] [[package]] @@ -955,6 +980,17 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +[[package]] +name = "futures-executor" +version = "0.3.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + [[package]] name = "futures-io" version = "0.3.28" @@ -990,6 +1026,7 @@ version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ + "futures-channel", "futures-core", "futures-io", "futures-macro", @@ -1730,7 +1767,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b85d89dc728613e26e0ed952a19583744e7f5240fcd4aa30d6c824ffd8b52f0f" dependencies = [ - "fastrand", + "fastrand 2.0.0", ] [[package]] @@ -1820,6 +1857,34 @@ dependencies = [ "tracing", ] +[[package]] +name = "h3" +version = "0.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6de6ca43eed186fd055214af06967b0a7a68336cefec7e8a4004e96efeaccb9e" +dependencies = [ + "bytes", + "fastrand 1.9.0", + "futures-util", + "http", + "tokio", + "tracing", +] + +[[package]] +name = "h3-quinn" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d4a1a1763e4f3e82ee9f1ecf2cf862b22cc7316ebe14684e42f94532b5ec64d" +dependencies = [ + "bytes", + "futures", + "h3", + "quinn 0.10.2", + "quinn-proto 0.10.2", + "tokio-util", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -2012,6 +2077,15 @@ dependencies = [ "hashbrown 0.14.0", ] +[[package]] +name = "instant" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +dependencies = [ + "cfg-if", +] + [[package]] name = "io-close" version = "0.3.7" @@ -2634,8 +2708,8 @@ dependencies = [ "futures-channel", "futures-util", "fxhash", - "quinn-proto", - "quinn-udp", + "quinn-proto 0.8.4", + "quinn-udp 0.1.4", "rustls 0.20.8", "thiserror", "tokio", @@ -2643,6 +2717,23 @@ dependencies = [ "webpki", ] +[[package]] +name = "quinn" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" +dependencies = [ + "bytes", + "pin-project-lite", + "quinn-proto 0.10.2", + "quinn-udp 0.4.0", + "rustc-hash", + "rustls 0.21.6", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "quinn-proto" version = "0.8.4" @@ -2663,6 +2754,23 @@ dependencies = [ "webpki", ] +[[package]] +name = "quinn-proto" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8c8bb234e70c863204303507d841e7fa2295e95c822b2bb4ca8ebf57f17b1cb" +dependencies = [ + "bytes", + "rand", + "ring", + "rustc-hash", + "rustls 0.21.6", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + [[package]] name = "quinn-udp" version = "0.1.4" @@ -2671,12 +2779,25 @@ checksum = "b07946277141531aea269befd949ed16b2c85a780ba1043244eda0969e538e54" dependencies = [ "futures-util", "libc", - "quinn-proto", + "quinn-proto 0.8.4", "socket2 0.4.9", "tokio", "tracing", ] +[[package]] +name = "quinn-udp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6df19e284d93757a9fb91d63672f7741b129246a669db09d1c0063071debc0c0" +dependencies = [ + "bytes", + "libc", + "socket2 0.5.3", + "tracing", + "windows-sys", +] + [[package]] name = "quote" version = "1.0.32" @@ -2795,9 +2916,12 @@ dependencies = [ "base64 0.21.2", "bytes", "encoding_rs", + "futures-channel", "futures-core", "futures-util", "h2", + "h3", + "h3-quinn", "http", "http-body", "hyper", @@ -2811,6 +2935,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "quinn 0.10.2", "rustls 0.21.6", "rustls-pemfile 1.0.3", "serde", @@ -2862,6 +2987,12 @@ version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.4.0" @@ -3296,7 +3427,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" dependencies = [ "cfg-if", - "fastrand", + "fastrand 2.0.0", "redox_syscall 0.3.5", "rustix", "windows-sys", @@ -3630,7 +3761,7 @@ dependencies = [ "ipnet", "lazy_static", "native-tls", - "quinn", + "quinn 0.8.5", "rand", "ring", "rustls 0.20.8", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 851362c1..1e226507 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -67,6 +67,10 @@ native-tls = ["binstalk/native-tls"] trust-dns = ["binstalk/trust-dns"] +# Experimental HTTP/3 client, this would require `--cfg reqwest_unstable` +# to be passed to `rustc`. +http3 = ["binstalk/http3"] + zstd-thin = ["binstalk/zstd-thin"] cross-lang-fat-lto = ["binstalk/cross-lang-fat-lto"] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 7fa4b3c8..6c6d873d 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -23,6 +23,9 @@ generic-array = "0.14.7" httpdate = "1.0.2" reqwest = { version = "0.11.18", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } percent-encoding = "2.2.0" +# Pull in due to https://github.com/seanmonstar/reqwest/pull/1846 , please +# remove this once new reqwest release is out. +quinn = { version = "0.10", default-features = false, features = ["runtime-tokio"], optional = true } serde = { version = "1.0.163", features = ["derive"], optional = true } serde-tuple-vec-map = "1.0.1" serde_json = { version = "1.0.96", optional = true } @@ -77,6 +80,10 @@ native-tls = ["__tls", "reqwest/native-tls", "trust-dns-resolver?/dns-over-nativ # Enable trust-dns-resolver so that features on it will also be enabled. trust-dns = ["trust-dns-resolver", "reqwest/trust-dns"] +# Experimental HTTP/3 client, this would require `--cfg reqwest_unstable` +# to be passed to `rustc`. +http3 = ["reqwest/http3", "dep:quinn"] + zstd-thin = ["zstd/thin"] cross-lang-fat-lto = ["zstd/fat-lto"] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 469eeb30..d7130803 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -65,6 +65,10 @@ native-tls = ["binstalk-downloader/native-tls"] trust-dns = ["binstalk-downloader/trust-dns"] +# Experimental HTTP/3 client, this would require `--cfg reqwest_unstable` +# to be passed to `rustc`. +http3 = ["binstalk-downloader/http3"] + zstd-thin = ["binstalk-downloader/zstd-thin"] cross-lang-fat-lto = ["binstalk-downloader/cross-lang-fat-lto"] diff --git a/justfile b/justfile index 1bdf106c..3c2ad504 100644 --- a/justfile +++ b/justfile @@ -11,6 +11,7 @@ glibc-version := env_var_or_default("GLIBC_VERSION", "") use-auditable := env_var_or_default("JUST_USE_AUDITABLE", "") timings := env_var_or_default("JUST_TIMINGS", "") build-std := env_var_or_default("JUST_BUILD_STD", "") +enable-h3 := env_var_or_default("JUST_ENABLE_H3", "") export BINSTALL_LOG_LEVEL := if env_var_or_default("RUNNER_DEBUG", "0") == "1" { "debug" } else { "info" } export BINSTALL_RATE_LIMIT := "30/1" @@ -97,10 +98,13 @@ git-max-perf-feature := if target == "x86_64-apple-darwin" { "" } -cargo-features := trim_end_match(if override-features != "" { override-features - } else if (cargo-profile / ci-or-no) == "dev/ci" { "git,rustls,fancy-with-backtrace,zstd-thin,log_max_level_debug" + git-max-perf-feature + (if support-pkg-config != "" { ",pkg-config" } else { "" }) + extra-features - } else if (cargo-profile / ci-or-no) == "release/ci" { "git,static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug,cross-lang-fat-lto" + git-max-perf-feature + extra-features - } else { extra-features +h3-features := if enable-h3 != "" { ",http3" } else { "" } +cargo-features := trim_end_match(if override-features != "" { override-features + h3-features + } else if (cargo-profile / ci-or-no) == "dev/ci" { "git,rustls,fancy-with-backtrace,zstd-thin,log_max_level_debug" + git-max-perf-feature + (if support-pkg-config != "" { ",pkg-config" } else { "" }) + h3-features + extra-features + } else if (cargo-profile / ci-or-no) == "release/ci" { "git,static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug,cross-lang-fat-lto" + git-max-perf-feature + h3-features + extra-features + } else if extra-features != "" { extra-features + h3-features + } else if enable-h3 != "" { "http3" + } else { "" }, ",") # it seems we can't split debuginfo for non-buildstd builds @@ -174,7 +178,7 @@ target-glibc-ver-postfix := if glibc-version != "" { cargo-check-args := (" --target ") + (target) + (target-glibc-ver-postfix) + (cargo-buildstd) + (if extra-build-args != "" { " " + extra-build-args } else { "" }) + (cargo-split-debuginfo) + (win-arm64-ring16) cargo-build-args := (if for-release != "" { " --release" } else { "" }) + (cargo-check-args) + (cargo-no-default-features) + (if cargo-features != "" { " --features " + cargo-features } else { "" }) + (if timings != "" { " --timings" } else { "" }) -export RUSTFLAGS := (linker-plugin-lto) + (rustc-gcclibs) + (rustc-miropt) + (rust-lld) + (rustc-icf) +export RUSTFLAGS := (linker-plugin-lto) + (rustc-gcclibs) + (rustc-miropt) + (rust-lld) + (rustc-icf) + (if enable-h3 != "" { " --cfg reqwest_unstable" } else { "" }) # libblocksruntime-dev provides compiler-rt From 7f1ddd1dd76aca5ab27fb6076430366c3f973a07 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 9 Aug 2023 17:46:12 +1000 Subject: [PATCH 1413/2020] Reduce public interface of `binstalk` (#1265) To reduce amount of breaking changes. Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 2 +- crates/binstalk/src/drivers.rs | 2 +- crates/binstalk/src/drivers/registry.rs | 2 +- crates/binstalk/src/helpers.rs | 13 +++++++------ crates/binstalk/src/lib.rs | 2 +- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index b2e4f60d..10243723 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -102,7 +102,7 @@ pub struct Args { /// /// This option cannot be used with `--manifest-path`. #[clap(help_heading = "Overrides", long, conflicts_with("manifest_path"))] - pub git: Option, + pub git: Option, /// Override Cargo.toml package manifest bin-dir. #[clap(help_heading = "Overrides", long)] diff --git a/crates/binstalk/src/drivers.rs b/crates/binstalk/src/drivers.rs index 1f07c099..15604fea 100644 --- a/crates/binstalk/src/drivers.rs +++ b/crates/binstalk/src/drivers.rs @@ -5,4 +5,4 @@ pub use registry::{ }; #[cfg(feature = "git")] -pub use registry::GitRegistry; +pub use registry::{GitRegistry, GitUrl, GitUrlParseError}; diff --git a/crates/binstalk/src/drivers/registry.rs b/crates/binstalk/src/drivers/registry.rs index 7938d98a..ebc67a6f 100644 --- a/crates/binstalk/src/drivers/registry.rs +++ b/crates/binstalk/src/drivers/registry.rs @@ -15,7 +15,7 @@ use crate::{ }; #[cfg(feature = "git")] -use crate::helpers::git::{GitUrl, GitUrlParseError}; +pub use crate::helpers::git::{GitUrl, GitUrlParseError}; mod vfs; diff --git a/crates/binstalk/src/helpers.rs b/crates/binstalk/src/helpers.rs index 34da60e0..723cb724 100644 --- a/crates/binstalk/src/helpers.rs +++ b/crates/binstalk/src/helpers.rs @@ -1,15 +1,16 @@ -pub mod cargo_toml_workspace; -pub mod futures_resolver; +pub(crate) mod cargo_toml_workspace; +pub(crate) mod futures_resolver; #[cfg(feature = "git")] -pub mod git; +pub(crate) mod git; pub mod jobserver_client; pub mod remote; pub mod signal; -pub mod target_triple; +pub(crate) mod target_triple; pub mod tasks; -pub use binstalk_downloader::{download, gh_api_client}; +pub(crate) use binstalk_downloader::download; +pub use binstalk_downloader::gh_api_client; -pub fn is_universal_macos(target: &str) -> bool { +pub(crate) fn is_universal_macos(target: &str) -> bool { ["universal-apple-darwin", "universal2-apple-darwin"].contains(&target) } diff --git a/crates/binstalk/src/lib.rs b/crates/binstalk/src/lib.rs index e1b64b89..e36c14e7 100644 --- a/crates/binstalk/src/lib.rs +++ b/crates/binstalk/src/lib.rs @@ -4,7 +4,7 @@ pub mod bins; pub mod drivers; pub mod errors; pub mod fetchers; -pub mod fs; +pub(crate) mod fs; pub mod helpers; pub mod ops; From 1c886d8897bc1fa27a46849f029e1f01cd46e904 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 9 Aug 2023 19:37:26 +1000 Subject: [PATCH 1414/2020] Fix installation script on MacOS (#1263) Fixed #1254 and also add CI for installation script and shellcheck. Signed-off-by: Jiahao XU --- .github/workflows/install-script.yml | 84 ++++++++++++++++++++++++++++ .github/workflows/shellcheck.yml | 32 +++++++++++ install-from-binstall-release.sh | 5 +- 3 files changed, 118 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/install-script.yml create mode 100644 .github/workflows/shellcheck.yml diff --git a/.github/workflows/install-script.yml b/.github/workflows/install-script.yml new file mode 100644 index 00000000..2f2cb1c7 --- /dev/null +++ b/.github/workflows/install-script.yml @@ -0,0 +1,84 @@ +name: Test install-script + +on: + merge_group: + pull_request: + types: + - opened + - reopened + - synchronize + paths: + - install-from-binstall-release.ps1 + - install-from-binstall-release.sh + push: + branches: + - main + paths: + - install-from-binstall-release.ps1 + - install-from-binstall-release.sh + +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +env: + CARGO_TERM_COLOR: always + +jobs: + unix: + strategy: + fail-fast: false + matrix: + os: [macos-latest, ubuntu-latest] + set_cargo_home: [t, f] + + runs-on: ${{ matrix.os }} + + steps: + - uses: actions/checkout@v3 + + - name: Set `CARGO_HOME` + if: matrix.set_cargo_home == 't' + run: | + CARGO_HOME="$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')" + mkdir -p "${CARGO_HOME}/bin" + echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" + echo "${CARGO_HOME}/bin" >> $GITHUB_PATH + + - name: Install `cargo-binstall` using scripts + run: ./install-from-binstall-release.sh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Verify `cargo-binstall` installation + run: | + which cargo-binstall + cargo binstall -vV + + windows: + strategy: + fail-fast: false + matrix: + set_cargo_home: [t, f] + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + + - name: Set `CARGO_HOME` + if: matrix.set_cargo_home == 't' + shell: bash + run: | + CARGO_HOME="$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')" + mkdir -p "${CARGO_HOME}/bin" + echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" + echo "${CARGO_HOME}/bin" >> $GITHUB_PATH + + - name: Install `cargo-binstall` using scripts + run: ./install-from-binstall-release.ps1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Verify `cargo-binstall` installation + run: cargo binstall -vV diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml new file mode 100644 index 00000000..6a8ba778 --- /dev/null +++ b/.github/workflows/shellcheck.yml @@ -0,0 +1,32 @@ +name: Shellcheck + +on: + merge_group: + pull_request: + types: + - opened + - reopened + - synchronize + paths: + - '**.sh' + push: + branches: + - main + paths: + - '**.sh' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref || github.event.pull_request.number || github.sha }} + cancel-in-progress: true + +jobs: + shellcheck: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + - uses: taiki-e/install-action@v2 + with: + tool: fd-find + - name: shellcheck + run: fd -e sh -t f -X shellcheck diff --git a/install-from-binstall-release.sh b/install-from-binstall-release.sh index 5ebf4f3d..eacb8477 100755 --- a/install-from-binstall-release.sh +++ b/install-from-binstall-release.sh @@ -27,9 +27,8 @@ fi ./cargo-binstall -y --force cargo-binstall -if ! [[ -v CARGO_HOME ]]; then - CARGO_HOME=$HOME/.cargo -fi +CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" + if ! [[ ":$PATH:" == *":$CARGO_HOME/bin:"* ]]; then echo printf "\033[0;31mYour path is missing %s, you might want to add it.\033[0m\n" "$CARGO_HOME/bin" From 3e80b1274889942cd3cd4f94815145bacd1a4092 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 9 Aug 2023 20:57:47 +1000 Subject: [PATCH 1415/2020] feat: Verify cksum of crate tarball from cargo registry (#1260) Fixed #1183 Since the crate tarball could be downloaded from a different set of servers than where the cargo registry is hosted, verifying the checksum is necessary to verify its integrity. Signed-off-by: Jiahao XU --- Cargo.lock | 20 +++++++ crates/bin/src/entry.rs | 1 - crates/binstalk-downloader/src/lib.rs | 2 + crates/binstalk/Cargo.toml | 2 + crates/binstalk/src/drivers/registry.rs | 7 +++ .../binstalk/src/drivers/registry/common.rs | 50 +++++++++++++---- .../drivers/registry/crates_io_registry.rs | 55 +++++++++++-------- .../src/drivers/registry/git_registry.rs | 11 ++-- .../src/drivers/registry/sparse_registry.rs | 7 +-- crates/binstalk/src/helpers.rs | 2 +- 10 files changed, 112 insertions(+), 45 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5cf51c81..37e95042 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -203,6 +203,12 @@ dependencies = [ "backtrace", ] +[[package]] +name = "base16" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d27c3610c36aee21ce8ac510e6224498de4228ad772a171ed65643a24693a5a8" + [[package]] name = "base64" version = "0.13.1" @@ -229,6 +235,7 @@ name = "binstalk" version = "0.14.1" dependencies = [ "async-trait", + "base16", "binstalk-downloader", "binstalk-types", "cargo_toml", @@ -251,6 +258,7 @@ dependencies = [ "semver", "serde", "serde_json", + "sha2", "strum", "target-lexicon", "tempfile", @@ -280,6 +288,7 @@ dependencies = [ "generic-array", "httpdate", "percent-encoding", + "quinn 0.10.2", "reqwest", "serde", "serde-tuple-vec-map", @@ -3258,6 +3267,17 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" +[[package]] +name = "sha2" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + [[package]] name = "sharded-slab" version = "0.1.4" diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 7bb6fa32..78d7a6af 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -1,5 +1,4 @@ use std::{ - borrow::Cow, env, fs, future::Future, path::{Path, PathBuf}, diff --git a/crates/binstalk-downloader/src/lib.rs b/crates/binstalk-downloader/src/lib.rs index e4d6ddbd..c4a23c84 100644 --- a/crates/binstalk-downloader/src/lib.rs +++ b/crates/binstalk-downloader/src/lib.rs @@ -1,5 +1,7 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] +pub use bytes; + pub mod download; /// Github API client. diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index d7130803..53354a85 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,6 +11,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" +base16 = "0.2.1" binstalk-downloader = { version = "0.6.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } cargo_toml = "0.15.3" @@ -33,6 +34,7 @@ reflink-copy = "0.1.5" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde_json = "1.0.99" +sha2 = "0.10.7" strum = "0.25.0" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" diff --git a/crates/binstalk/src/drivers/registry.rs b/crates/binstalk/src/drivers/registry.rs index ebc67a6f..a0b3f0ca 100644 --- a/crates/binstalk/src/drivers/registry.rs +++ b/crates/binstalk/src/drivers/registry.rs @@ -1,5 +1,6 @@ use std::{str::FromStr, sync::Arc}; +use base16::DecodeError as Base16DecodeError; use cargo_toml::Manifest; use compact_str::CompactString; use leon::{ParseError, RenderError}; @@ -56,6 +57,12 @@ pub enum RegistryError { #[error("Failed to render dl config: {0}")] RenderDlConfig(#[from] RenderError), + + #[error("Failed to parse checksum encoded in hex: {0}")] + InvalidHex(#[from] Base16DecodeError), + + #[error("Expected checksum `{expected}`, actual checksum `{actual}`")] + UnmatchedChecksum { expected: String, actual: String }, } #[derive(Clone, Debug)] diff --git a/crates/binstalk/src/drivers/registry/common.rs b/crates/binstalk/src/drivers/registry/common.rs index 54d64fa7..afc5ec3b 100644 --- a/crates/binstalk/src/drivers/registry/common.rs +++ b/crates/binstalk/src/drivers/registry/common.rs @@ -1,18 +1,21 @@ -use std::{borrow::Cow, path::PathBuf}; +use std::borrow::Cow; +use base16::{decode as decode_base16, encode_lower as encode_base16}; use cargo_toml::Manifest; use compact_str::{format_compact, CompactString, ToCompactString}; use leon::{Template, Values}; use semver::{Version, VersionReq}; use serde::Deserialize; use serde_json::Error as JsonError; +use sha2::{Digest, Sha256}; use tracing::debug; use crate::{ drivers::registry::{visitor::ManifestVisitor, RegistryError}, errors::BinstallError, helpers::{ - download::Download, + bytes::Bytes, + download::{DataVerifier, Download}, remote::{Client, Url}, }, manifests::cargo_toml_binstall::{Meta, TarBasedFmt}, @@ -23,23 +26,48 @@ pub(super) struct RegistryConfig { pub(super) dl: CompactString, } +struct Sha256Digest(Sha256); + +impl Default for Sha256Digest { + fn default() -> Self { + Sha256Digest(Sha256::new()) + } +} + +impl DataVerifier for Sha256Digest { + fn update(&mut self, data: &Bytes) { + self.0.update(data); + } +} + pub(super) async fn parse_manifest( client: Client, crate_name: &str, - version: &str, crate_url: Url, + MatchedVersion { version, cksum }: MatchedVersion, ) -> Result, BinstallError> { debug!("Fetching crate from: {crate_url} and extracting Cargo.toml from it"); - let manifest_dir_path: PathBuf = format!("{crate_name}-{version}").into(); + let mut manifest_visitor = ManifestVisitor::new(format!("{crate_name}-{version}").into()); - let mut manifest_visitor = ManifestVisitor::new(manifest_dir_path); + let checksum = decode_base16(cksum.as_bytes()).map_err(RegistryError::from)?; + let mut sha256_digest = Sha256Digest::default(); - Download::new(client, crate_url) + Download::new_with_data_verifier(client, crate_url, &mut sha256_digest) .and_visit_tar(TarBasedFmt::Tgz, &mut manifest_visitor) .await?; - manifest_visitor.load_manifest() + let digest_checksum = sha256_digest.0.finalize(); + + if digest_checksum.as_slice() != checksum.as_slice() { + Err(RegistryError::UnmatchedChecksum { + expected: cksum, + actual: encode_base16(digest_checksum.as_slice()), + } + .into()) + } else { + manifest_visitor.load_manifest() + } } /// Return components of crate prefix @@ -68,8 +96,7 @@ pub(super) fn render_dl_template( dl_template: &str, crate_name: &str, (c1, c2): &(CompactString, Option), - version: &str, - cksum: &str, + MatchedVersion { version, cksum }: &MatchedVersion, ) -> Result { let template = Template::parse(dl_template)?; if template.keys().next().is_some() { @@ -114,12 +141,13 @@ pub(super) fn render_dl_template( pub(super) struct RegistryIndexEntry { vers: CompactString, yanked: bool, - cksum: CompactString, + cksum: String, } pub(super) struct MatchedVersion { pub(super) version: CompactString, - pub(super) cksum: CompactString, + /// sha256 checksum encoded in base16 + pub(super) cksum: String, } impl MatchedVersion { diff --git a/crates/binstalk/src/drivers/registry/crates_io_registry.rs b/crates/binstalk/src/drivers/registry/crates_io_registry.rs index b2fa25ec..d66d3998 100644 --- a/crates/binstalk/src/drivers/registry/crates_io_registry.rs +++ b/crates/binstalk/src/drivers/registry/crates_io_registry.rs @@ -10,7 +10,7 @@ use tokio::{ use tracing::debug; use crate::{ - drivers::registry::{parse_manifest, RegistryError}, + drivers::registry::{parse_manifest, MatchedVersion, RegistryError}, errors::BinstallError, helpers::remote::{Client, Url}, manifests::cargo_toml_binstall::Meta, @@ -43,7 +43,9 @@ impl CratesIoRateLimit { self.0.lock().await.tick().await; } } -async fn is_crate_yanked(client: &Client, url: Url) -> Result { + +/// Return `Some(checksum)` if the version is not yanked, otherwise `None`. +async fn is_crate_yanked(client: &Client, url: Url) -> Result, RemoteError> { #[derive(Deserialize)] struct CrateInfo { version: Inner, @@ -52,25 +54,29 @@ async fn is_crate_yanked(client: &Client, url: Url) -> Result #[derive(Deserialize)] struct Inner { yanked: bool, + checksum: String, } // Fetch / update index debug!("Looking up crate information"); let info: CrateInfo = client.get(url).send(true).await?.json().await?; + let version = info.version; - Ok(info.version.yanked) + Ok((!version.yanked).then_some(version.checksum)) } async fn fetch_crate_cratesio_version_matched( client: &Client, url: Url, version_req: &VersionReq, -) -> Result, RemoteError> { +) -> Result, RemoteError> { #[derive(Deserialize)] struct CrateInfo { #[serde(rename = "crate")] inner: CrateInfoInner, + + versions: Vec, } #[derive(Deserialize)] @@ -78,28 +84,27 @@ async fn fetch_crate_cratesio_version_matched( max_stable_version: CompactString, } - #[derive(Deserialize)] - struct Versions { - versions: Vec, - } - #[derive(Deserialize)] struct Version { num: CompactString, yanked: bool, + checksum: String, } // Fetch / update index debug!("Looking up crate information"); - let response = client.get(url).send(true).await?; + let crate_info: CrateInfo = client.get(url).send(true).await?.json().await?; - let version = if version_req == &VersionReq::STAR { - let crate_info: CrateInfo = response.json().await?; - Some(crate_info.inner.max_stable_version) + let version_with_checksum = if version_req == &VersionReq::STAR { + let version = crate_info.inner.max_stable_version; + crate_info + .versions + .into_iter() + .find_map(|v| (v.num.as_str() == version.as_str()).then_some(v.checksum)) + .map(|checksum| (version, checksum)) } else { - let response: Versions = response.json().await?; - response + crate_info .versions .into_iter() .filter_map(|item| { @@ -115,17 +120,23 @@ async fn fetch_crate_cratesio_version_matched( let ver = semver::Version::parse(&num).ok()?; // Filter by version match - version_req.matches(&ver).then_some((num, ver)) + version_req + .matches(&ver) + .then_some((num, ver, item.checksum)) } else { None } }) // Return highest version - .max_by(|(_ver_str_x, ver_x), (_ver_str_y, ver_y)| ver_x.cmp(ver_y)) - .map(|(ver_str, _)| ver_str) + .max_by( + |(_ver_str_x, ver_x, _checksum_x), (_ver_str_y, ver_y, _checksum_y)| { + ver_x.cmp(ver_y) + }, + ) + .map(|(ver_str, _, checksum)| (ver_str, checksum)) }; - Ok(version) + Ok(version_with_checksum) } /// Find the crate by name, get its latest stable version matches `version_req`, @@ -141,7 +152,7 @@ pub async fn fetch_crate_cratesio( let url = Url::parse(&format!("https://crates.io/api/v1/crates/{name}"))?; - let version = match version_req.comparators.as_slice() { + let (version, cksum) = match version_req.comparators.as_slice() { [Comparator { op: ComparatorOp::Exact, major, @@ -163,7 +174,7 @@ pub async fn fetch_crate_cratesio( is_crate_yanked(&client, url) .await - .map(|yanked| (!yanked).then_some(version)) + .map(|ret| ret.map(|checksum| (version, checksum))) } _ => fetch_crate_cratesio_version_matched(&client, url.clone(), version_req).await, } @@ -185,5 +196,5 @@ pub async fn fetch_crate_cratesio( .push(&version) .push("download"); - parse_manifest(client, name, &version, crate_url).await + parse_manifest(client, name, crate_url, MatchedVersion { version, cksum }).await } diff --git a/crates/binstalk/src/drivers/registry/git_registry.rs b/crates/binstalk/src/drivers/registry/git_registry.rs index f551f5b8..b301cc6b 100644 --- a/crates/binstalk/src/drivers/registry/git_registry.rs +++ b/crates/binstalk/src/drivers/registry/git_registry.rs @@ -108,7 +108,7 @@ impl GitRegistry { let version_req = version_req.clone(); let this = self.clone(); - let (version, dl_url) = spawn_blocking(move || { + let (matched_version, dl_url) = spawn_blocking(move || { let GitIndex { _tempdir: _, repo, @@ -118,21 +118,20 @@ impl GitRegistry { .git_index .get_or_try_init(|| GitIndex::new(this.0.url.clone()))?; - let MatchedVersion { version, cksum } = + let matched_version = Self::find_crate_matched_ver(repo, &crate_name, &crate_prefix, &version_req)?; let url = Url::parse(&render_dl_template( dl_template, &crate_name, &crate_prefix, - &version, - &cksum, + &matched_version, )?)?; - Ok::<_, BinstallError>((version, url)) + Ok::<_, BinstallError>((matched_version, url)) }) .await??; - parse_manifest(client, name, &version, dl_url).await + parse_manifest(client, name, dl_url, matched_version).await } } diff --git a/crates/binstalk/src/drivers/registry/sparse_registry.rs b/crates/binstalk/src/drivers/registry/sparse_registry.rs index 13acb057..8b4e9de2 100644 --- a/crates/binstalk/src/drivers/registry/sparse_registry.rs +++ b/crates/binstalk/src/drivers/registry/sparse_registry.rs @@ -88,7 +88,7 @@ impl SparseRegistry { ) -> Result, BinstallError> { let crate_prefix = crate_prefix_components(crate_name)?; let dl_template = self.get_dl_template(&client).await?; - let MatchedVersion { version, cksum } = Self::find_crate_matched_ver( + let matched_version = Self::find_crate_matched_ver( &client, self.url.clone(), crate_name, @@ -100,10 +100,9 @@ impl SparseRegistry { dl_template, crate_name, &crate_prefix, - &version, - &cksum, + &matched_version, )?)?; - parse_manifest(client, crate_name, &version, dl_url).await + parse_manifest(client, crate_name, dl_url, matched_version).await } } diff --git a/crates/binstalk/src/helpers.rs b/crates/binstalk/src/helpers.rs index 723cb724..fb137fa5 100644 --- a/crates/binstalk/src/helpers.rs +++ b/crates/binstalk/src/helpers.rs @@ -8,8 +8,8 @@ pub mod signal; pub(crate) mod target_triple; pub mod tasks; -pub(crate) use binstalk_downloader::download; pub use binstalk_downloader::gh_api_client; +pub(crate) use binstalk_downloader::{bytes, download}; pub(crate) fn is_universal_macos(target: &str) -> bool { ["universal-apple-darwin", "universal2-apple-darwin"].contains(&target) From 000c87bcee6d7399978188c5faf0295465b2ea56 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 21:02:53 +1000 Subject: [PATCH 1416/2020] release: detect-targets v0.1.9 (#1268) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 37e95042..69d2c633 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -736,7 +736,7 @@ checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" [[package]] name = "detect-targets" -version = "0.1.8" +version = "0.1.9" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index dd75f57c..a03bd222 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -25,5 +25,5 @@ toml_edit = { version = "0.19.10", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.8", path = "../detect-targets" } +detect-targets = { version = "0.1.9", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 53354a85..5a8d9ac3 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -17,7 +17,7 @@ binstalk-types = { version = "0.5.0", path = "../binstalk-types" } cargo_toml = "0.15.3" command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } -detect-targets = { version = "0.1.8", path = "../detect-targets" } +detect-targets = { version = "0.1.9", path = "../detect-targets" } either = "1.8.1" gix = { version = "0.51.0", features = ["blocking-http-transport-reqwest-rust-tls"], optional = true } glob = "0.3.1" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 288b143d..ad6d10a4 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.8" +version = "0.1.9" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From 8e6dcc57ff6a2f8a7a31cf708a47f8333efcd4c5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 10 Aug 2023 06:14:34 +1000 Subject: [PATCH 1417/2020] Fix `release-pr.yml`: Set `RUSTFLAGS=--cfg reqwest_unstable` (#1270) for `binsalk-downloader` since its feature `http3` require this. Signed-off-by: Jiahao XU --- .github/workflows/release-pr.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index fa624477..040a9d26 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -53,3 +53,5 @@ jobs: pr-template-file: .github/scripts/release-pr-template.ejs check-semver: ${{ inputs.crate != 'bin' }} check-package: true + env: + RUSTFLAGS: --cfg reqwest_unstable From 42dddd972db0e4c6cd8e30e9c7d0dc0c7dfea5db Mon Sep 17 00:00:00 2001 From: Marcin Nowak-Liebiediew Date: Wed, 9 Aug 2023 22:50:16 +0200 Subject: [PATCH 1418/2020] Add GitHub Action declaration for installing `cargo-binstall` (#1269) add action.yml and test it --- .github/workflows/gh-action.yml | 36 +++++++++++++++++++++++++++++++++ README.md | 4 ++++ action.yml | 14 +++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 .github/workflows/gh-action.yml create mode 100644 action.yml diff --git a/.github/workflows/gh-action.yml b/.github/workflows/gh-action.yml new file mode 100644 index 00000000..b09f1841 --- /dev/null +++ b/.github/workflows/gh-action.yml @@ -0,0 +1,36 @@ +name: Test GitHub Action installer +on: + merge_group: + pull_request: + paths: + - install-from-binstall-release.ps1 + - install-from-binstall-release.sh + - action.yml + push: + branches: + - main + paths: + - install-from-binstall-release.ps1 + - install-from-binstall-release.sh + - action.yml + +jobs: + test-gha-installer: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ macos-latest, ubuntu-latest, windows-latest ] + steps: + - uses: actions/checkout@v3 + + - name: Install cargo-binstall + uses: ./ # uses action.yml from root of the repo + + - name: Verify successful installation - display cargo-binstall's help + run: cargo binstall --help + + - name: Verify successful installation - install example binary using cargo-binstall + run: cargo binstall -y ripgrep + + - name: Verify successful installation - display help of installed binary + run: rg --help diff --git a/README.md b/README.md index a70ef72f..b4144bf6 100644 --- a/README.md +++ b/README.md @@ -107,6 +107,10 @@ Supported crates such as `cargo-binstall` itself can also be updated with `cargo - You can find a full description of errors including exit codes here: - Can I use it in CI? - Yes! For GitHub Actions, we recommend the excellent [taiki-e/install-action](https://github.com/marketplace/actions/install-development-tools), which has explicit support for selected tools and uses `cargo-binstall` for everything else. + - Additionally, we provide a minimal GitHub Action that installs `cargo-binstall`: + ```yml + - uses: cargo-bins/cargo-binstall@main + ``` - Are debug symbols available? - Yes! Extra pre-built packages with a `.full` suffix are available and contain split debuginfo, documentation files, and extra binaries like the `detect-wasi` utility. diff --git a/action.yml b/action.yml new file mode 100644 index 00000000..3c3b1663 --- /dev/null +++ b/action.yml @@ -0,0 +1,14 @@ +name: 'Install cargo-binstall' +description: 'Install the latest version of cargo-binstall tool' + +runs: + using: composite + steps: + - name: Install cargo-binstall + if: runner.os != 'Windows' + shell: sh + run: curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash + - name: Install cargo-binstall + if: runner.os == 'Windows' + run: Set-ExecutionPolicy Unrestricted -Scope Process; iex (iwr "https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.ps1").Content + shell: powershell From 070537076dd0155d0ba49daeee05b0632e4108b1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 9 Aug 2023 21:00:48 +0000 Subject: [PATCH 1419/2020] release: binstalk-downloader v0.7.0 (#1272) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 69d2c633..37785dd4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -273,7 +273,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.6.1" +version = "0.7.0" dependencies = [ "async-compression 0.4.1", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 6c6d873d..46a27a24 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.6.1" +version = "0.7.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 5a8d9ac3..44e684e8 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.6.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } cargo_toml = "0.15.3" command-group = { version = "2.1.0", features = ["with-tokio"] } From cf2a8a5287fb48d93ae184cc903b6b81ba28bd88 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 10 Aug 2023 17:17:40 +1000 Subject: [PATCH 1420/2020] dep: Bump tokio to v1.30.0 & disable feat `parking_lot` (#1273) In tokio v1.30.0, MSRV is bumped to rust 1.63 and all `const_new` methods in `tokio::sync` are now always available, so there is no need to enable feat `parking_lot`. Signed-off-by: Jiahao XU --- Cargo.lock | 8 +++----- crates/binstalk/Cargo.toml | 3 +-- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 37785dd4..57ec26a6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3551,20 +3551,18 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.29.1" +version = "1.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "2d3ce25f50619af8b0aec2eb23deebe84249e19e2ddd393a6e16e3300a6dadfd" dependencies = [ - "autocfg", "backtrace", "bytes", "libc", "mio", "num_cpus", - "parking_lot", "pin-project-lite", "signal-hook-registry", - "socket2 0.4.9", + "socket2 0.5.3", "tokio-macros", "windows-sys", ] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 44e684e8..98ffdf83 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -39,8 +39,7 @@ strum = "0.25.0" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" thiserror = "1.0.40" -# parking_lot for `tokio::sync::OnceCell::const_new` -tokio = { version = "1.28.2", features = ["rt", "process", "sync", "signal", "parking_lot"], default-features = false } +tokio = { version = "1.30.0", features = ["rt", "process", "sync", "signal"], default-features = false } tracing = "0.1.37" url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" From cf3e3c25b008060d83ec9f47467a96477cb1ed28 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 10 Aug 2023 17:54:29 +1000 Subject: [PATCH 1421/2020] release: binstalk v0.15.0 (#1274) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 57ec26a6..18cb7918 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -232,7 +232,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.14.1" +version = "0.15.0" dependencies = [ "async-trait", "base16", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 1e226507..de2a9540 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.14.1", default-features = false } +binstalk = { path = "../binstalk", version = "0.15.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.8.0" } clap = { version = "4.3.0", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 98ffdf83..6ec4adca 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.14.1" +version = "0.15.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From ea1a34b4a12bc2f34cf759c4910e6e138dd0dd59 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 10 Aug 2023 21:33:39 +1000 Subject: [PATCH 1422/2020] release: cargo-binstall v1.2.0 (#1275) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 18cb7918..6bd1fdb5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -460,7 +460,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.1.2" +version = "1.2.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index de2a9540..9c03f989 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.1.2" +version = "1.2.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index bcb726e6..7b59f9fc 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From a84844938d17deb5446d591b78540ad35361dbcc Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 11 Aug 2023 11:02:03 +1000 Subject: [PATCH 1423/2020] Fix `aarch64-apple-darwin` fallback to `x86_64h` (#1278) Run `arch -arch x86_64h /usr/bin/true` to decides whether fallback is feasible. Signed-off-by: Jiahao XU --- crates/detect-targets/src/detect/macos.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/crates/detect-targets/src/detect/macos.rs b/crates/detect-targets/src/detect/macos.rs index e202770f..ceafb6a7 100644 --- a/crates/detect-targets/src/detect/macos.rs +++ b/crates/detect-targets/src/detect/macos.rs @@ -36,14 +36,20 @@ async fn is_arch_supported(arch_name: &str) -> bool { pub(super) async fn detect_alternative_targets(target: &str) -> impl Iterator { match target { AARCH64 => { - let is_x86_64_supported = is_arch_supported("x86_64").await; + // Spawn `arch` in parallel (probably from different threads if + // mutlti-thread runtime is used). + // + // These two tasks are never cancelled, so it can only fail due to + // panic, in which cause we would propagate by also panic here. + let x86_64h_task = tokio::spawn(is_arch_supported("x86_64h")); + let x86_64_task = tokio::spawn(is_arch_supported("x86_64")); [ // Prefer universal as it provides native arm executable Some(UNIVERSAL), Some(UNIVERSAL2), // Prefer x86h since it is more optimized - is_x86_64_supported.then_some(X86H), - is_x86_64_supported.then_some(X86), + x86_64h_task.await.unwrap().then_some(X86H), + x86_64_task.await.unwrap().then_some(X86), ] } X86 => [ From c4bb0fd77afe5384362d166b7b1e294891def828 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 11 Aug 2023 12:04:43 +1000 Subject: [PATCH 1424/2020] Include `x86_64` & `x86_64h` in universal apple pre-built binary (#1279) To makre sure it can run on pre-haswell Intel CPUs. Fixed #1277 Signed-off-by: Jiahao XU --- .github/workflows/release-build.yml | 4 ++++ justfile | 30 ++++++++++++++++++----------- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index e9e4d4cb..feba7004 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -127,6 +127,10 @@ jobs: with: name: x86_64h-apple-darwin path: packages/ + - uses: actions/download-artifact@v3 + with: + name: x86_64-apple-darwin + path: packages/ - uses: actions/download-artifact@v3 with: name: aarch64-apple-darwin diff --git a/justfile b/justfile index 3c2ad504..11b1d1f7 100644 --- a/justfile +++ b/justfile @@ -322,17 +322,20 @@ package-prepare: build package-dir [macos] lipo-prepare: package-dir just target=aarch64-apple-darwin build get-binary packages/prep/arm64 - just target=x86_64h-apple-darwin build get-binary packages/prep/x64 + just target=x86_64-apple-darwin build get-binary packages/prep/x64 + just target=x86_64h-apple-darwin build get-binary packages/prep/x64h just target=aarch64-apple-darwin get-binary packages/prep/arm64 - just target=x86_64h-apple-darwin get-binary packages/prep/x64 - lipo -create -output packages/prep/{{output-filename}} packages/prep/{arm64,x64}/{{output-filename}} + just target=x86_64-apple-darwin get-binary packages/prep/x64 + just target=x86_64h-apple-darwin get-binary packages/prep/x64h + lipo -create -output packages/prep/{{output-filename}} packages/prep/{arm64,x64,x64h}/{{output-filename}} just target=aarch64-apple-darwin get-output detect-wasi{{output-ext}} packages/prep/arm64 - just target=x86_64h-apple-darwin get-output detect-wasi{{output-ext}} packages/prep/x64 - lipo -create -output packages/prep/detect-wasi{{output-ext}} packages/prep/{arm64,x64}/detect-wasi{{output-ext}} + just target=x86_64-apple-darwin get-output detect-wasi{{output-ext}} packages/prep/x64 + just target=x86_64h-apple-darwin get-output detect-wasi{{output-ext}} packages/prep/x64h + lipo -create -output packages/prep/detect-wasi{{output-ext}} packages/prep/{arm64,x64,x64h}/detect-wasi{{output-ext}} - rm -rf packages/prep/{arm64,x64} + rm -rf packages/prep/{arm64,x64,x64h} [linux] @@ -358,13 +361,18 @@ package-lipo: lipo-prepare # assuming x64 and arm64 packages are already built, extract and lipo them [macos] repackage-lipo: package-dir - mkdir -p packages/prep/{arm64,x64} - cd packages/prep/x64 && unzip -o "../../cargo-binstall-x86_64h-apple-darwin.full.zip" + set -euxo pipefail + + mkdir -p packages/prep/{arm64,x64,x64h} + cd packages/prep/x64 && unzip -o "../../cargo-binstall-x86_64-apple-darwin.full.zip" + cd packages/prep/x64h && unzip -o "../../cargo-binstall-x86_64h-apple-darwin.full.zip" cd packages/prep/arm64 && unzip -o "../../cargo-binstall-aarch64-apple-darwin.full.zip" - lipo -create -output packages/prep/{{output-filename}} packages/prep/{arm64,x64}/{{output-filename}} - lipo -create -output packages/prep/detect-wasi packages/prep/{arm64,x64}/detect-wasi + lipo -create -output packages/prep/{{output-filename}} packages/prep/{arm64,x64,x64h}/{{output-filename}} + lipo -create -output packages/prep/detect-wasi packages/prep/{arm64,x64,x64h}/detect-wasi - rm -rf packages/prep/{arm64,x64} + ./packages/prep/{{output-filename}} -vV + + rm -rf packages/prep/{arm64,x64,x64h} cd packages/prep && zip -9 "../cargo-binstall-universal-apple-darwin.zip" {{output-filename}} cd packages/prep && zip -9 "../cargo-binstall-universal-apple-darwin.full.zip" * From 9e901c6b84d774657e91dcd42e1ee2aca70ee6fa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 11 Aug 2023 02:22:13 +0000 Subject: [PATCH 1425/2020] release: detect-targets v0.1.10 (#1280) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6bd1fdb5..0b5cb3d2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -736,7 +736,7 @@ checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" [[package]] name = "detect-targets" -version = "0.1.9" +version = "0.1.10" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index a03bd222..45d585c7 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -25,5 +25,5 @@ toml_edit = { version = "0.19.10", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.9", path = "../detect-targets" } +detect-targets = { version = "0.1.10", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 6ec4adca..cc3e0cba 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -17,7 +17,7 @@ binstalk-types = { version = "0.5.0", path = "../binstalk-types" } cargo_toml = "0.15.3" command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } -detect-targets = { version = "0.1.9", path = "../detect-targets" } +detect-targets = { version = "0.1.10", path = "../detect-targets" } either = "1.8.1" gix = { version = "0.51.0", features = ["blocking-http-transport-reqwest-rust-tls"], optional = true } glob = "0.3.1" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index ad6d10a4..38a6bfce 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.9" +version = "0.1.10" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From ba87a4af7062a411dbeb3a66851de8acc18f4691 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 11 Aug 2023 13:46:27 +1000 Subject: [PATCH 1426/2020] Speedup `ci.yml`: Set codegen-units to 4 (#1283) Set `CARGO_PROFILE_RELEASE_CODEGEN_UNITS` to 4 since 1024 units are too many and our CI only have 2-3 cores. Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 14358719..b1921bc2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,6 +24,9 @@ env: CARGO_TERM_COLOR: always CARGO_REGISTRIES_CRATES_IO_PROTOCOL: sparse JUST_ENABLE_H3: true + CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 4 + CARGO_PROFILE_DEV_CODEGEN_UNITS: 4 + CARGO_PROFILE_CHECK_ONLY_CODEGEN_UNITS: 4 jobs: test: @@ -121,7 +124,7 @@ jobs: uses: ./.github/workflows/release-build.yml with: CARGO_PROFILE_RELEASE_LTO: no - CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 1024 + CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 4 # Dummy job to have a stable name for the "all tests pass" requirement tests-pass: From b05abd862e7c501922cc60a5b58709bb7ee84561 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 11 Aug 2023 16:39:09 +1000 Subject: [PATCH 1427/2020] dep: Upgrade transitive dependencies (#1281) Co-authored-by: github-actions --- Cargo.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0b5cb3d2..b3101ecf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -85,9 +85,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "c677ab05e09154296dd37acecd46420c17b9713e8366facafa8fc0885167cf4c" dependencies = [ "anstyle", "windows-sys", @@ -2650,9 +2650,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c516611246607d0c04186886dbb3a754368ef82c79e9827a802c6d836dd111c" +checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" [[package]] name = "pin-utils" @@ -3013,9 +3013,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.7" +version = "0.38.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "172891ebdceb05aa0005f533a6cbfca599ddd7d966f6f5d4d9b2e70478e70399" +checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" dependencies = [ "bitflags 2.3.3", "errno 0.3.2", @@ -4274,9 +4274,9 @@ checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" [[package]] name = "winnow" -version = "0.5.4" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acaaa1190073b2b101e15083c38ee8ec891b5e05cbee516521e94ec008f61e64" +checksum = "19f495880723d0999eb3500a9064d8dbcf836460b24c17df80ea7b5794053aac" dependencies = [ "memchr", ] From 6a1d317fde11fb98caf5ab463145f3740d84a2e8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 11 Aug 2023 16:44:15 +1000 Subject: [PATCH 1428/2020] release: cargo-binstall v1.2.1 (#1282) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b3101ecf..00823806 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -460,7 +460,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.2.0" +version = "1.2.1" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 9c03f989..c9582f53 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.2.0" +version = "1.2.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 7b59f9fc..078e888e 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From c57356e87039c23faa929bd69b1dafed5dfea833 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 12 Aug 2023 17:20:26 +1000 Subject: [PATCH 1429/2020] Refactor: Move mod `git` into `binstalk-downloader` (#1285) To speedup codegen time for `binstalk`, also fixed the docs.rs build for `binstalk-downloader`. Signed-off-by: Jiahao XU --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 6 +++++- .../src/helpers => binstalk-downloader/src}/git.rs | 0 .../src}/git/progress_tracing.rs | 0 crates/binstalk-downloader/src/lib.rs | 3 +++ crates/binstalk/Cargo.toml | 5 ++--- crates/binstalk/src/helpers.rs | 5 +++-- 7 files changed, 14 insertions(+), 7 deletions(-) rename crates/{binstalk/src/helpers => binstalk-downloader/src}/git.rs (100%) rename crates/{binstalk/src/helpers => binstalk-downloader/src}/git/progress_tracing.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 00823806..52d55f17 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -243,7 +243,6 @@ dependencies = [ "compact_str", "detect-targets", "either", - "gix", "glob", "home", "itertools", @@ -286,6 +285,7 @@ dependencies = [ "flate2", "futures-util", "generic-array", + "gix", "httpdate", "percent-encoding", "quinn 0.10.2", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 46a27a24..bf54fcdd 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -20,6 +20,7 @@ compact_str = "0.7.0" flate2 = { version = "1.0.26", default-features = false } futures-util = "0.3.28" generic-array = "0.14.7" +gix = { version = "0.51.0", features = ["blocking-http-transport-reqwest-rust-tls"], optional = true } httpdate = "1.0.2" reqwest = { version = "0.11.18", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } percent-encoding = "2.2.0" @@ -91,6 +92,9 @@ cross-lang-fat-lto = ["zstd/fat-lto"] gh-api-client = ["json"] json = ["serde", "serde_json"] +git = ["dep:gix"] +git-max-perf = ["gix?/max-performance"] + [package.metadata.docs.rs] -all-features = true +features = ["gh-api-client", "git"] rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/binstalk/src/helpers/git.rs b/crates/binstalk-downloader/src/git.rs similarity index 100% rename from crates/binstalk/src/helpers/git.rs rename to crates/binstalk-downloader/src/git.rs diff --git a/crates/binstalk/src/helpers/git/progress_tracing.rs b/crates/binstalk-downloader/src/git/progress_tracing.rs similarity index 100% rename from crates/binstalk/src/helpers/git/progress_tracing.rs rename to crates/binstalk-downloader/src/git/progress_tracing.rs diff --git a/crates/binstalk-downloader/src/lib.rs b/crates/binstalk-downloader/src/lib.rs index c4a23c84..970cbb12 100644 --- a/crates/binstalk-downloader/src/lib.rs +++ b/crates/binstalk-downloader/src/lib.rs @@ -12,4 +12,7 @@ pub mod gh_api_client; pub mod remote; +#[cfg(feature = "git")] +pub mod git; + mod utils; diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index cc3e0cba..89e2058b 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -19,7 +19,6 @@ command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.10", path = "../detect-targets" } either = "1.8.1" -gix = { version = "0.51.0", features = ["blocking-http-transport-reqwest-rust-tls"], optional = true } glob = "0.3.1" home = "0.5.5" itertools = "0.11.0" @@ -53,8 +52,8 @@ windows = { version = "0.48.0", features = ["Win32_Storage_FileSystem", "Win32_F [features] default = ["static", "rustls", "git"] -git = ["dep:gix"] -git-max-perf = ["gix?/max-performance"] +git = ["binstalk-downloader/git"] +git-max-perf = ["binstalk-downloader/git-max-perf"] static = ["binstalk-downloader/static"] pkg-config = ["binstalk-downloader/pkg-config"] diff --git a/crates/binstalk/src/helpers.rs b/crates/binstalk/src/helpers.rs index fb137fa5..f0b4bdc4 100644 --- a/crates/binstalk/src/helpers.rs +++ b/crates/binstalk/src/helpers.rs @@ -1,7 +1,5 @@ pub(crate) mod cargo_toml_workspace; pub(crate) mod futures_resolver; -#[cfg(feature = "git")] -pub(crate) mod git; pub mod jobserver_client; pub mod remote; pub mod signal; @@ -11,6 +9,9 @@ pub mod tasks; pub use binstalk_downloader::gh_api_client; pub(crate) use binstalk_downloader::{bytes, download}; +#[cfg(feature = "git")] +pub(crate) use binstalk_downloader::git; + pub(crate) fn is_universal_macos(target: &str) -> bool { ["universal-apple-darwin", "universal2-apple-darwin"].contains(&target) } From 8ff13c1b360a3687072fcc967b014dc58ce16a13 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 12 Aug 2023 22:05:10 +1000 Subject: [PATCH 1430/2020] Refactor: Extract `cargo_toml_workspace` as a new crate (#1287) To reduce codegen time of `binstalk` and also enable others to reuse this crate. Signed-off-by: Jiahao XU --- Cargo.lock | 17 +- Cargo.toml | 1 + crates/bin/src/logging.rs | 1 + crates/binstalk/Cargo.toml | 3 +- crates/binstalk/src/drivers/registry.rs | 6 +- .../binstalk/src/drivers/registry/common.rs | 2 +- .../drivers/registry/crates_io_registry.rs | 6 +- .../src/drivers/registry/git_registry.rs | 2 +- .../src/drivers/registry/sparse_registry.rs | 6 +- crates/binstalk/src/drivers/registry/vfs.rs | 2 +- .../binstalk/src/drivers/registry/visitor.rs | 6 +- crates/binstalk/src/errors.rs | 11 +- crates/binstalk/src/helpers.rs | 2 +- crates/binstalk/src/ops/resolve.rs | 7 +- crates/binstalk/tests/parse-meta.rs | 4 +- crates/cargo-toml-workspace/Cargo.toml | 22 +++ crates/cargo-toml-workspace/LICENSE-APACHE | 176 ++++++++++++++++++ crates/cargo-toml-workspace/LICENSE-MIT | 23 +++ .../src/lib.rs} | 40 ++-- 19 files changed, 290 insertions(+), 47 deletions(-) create mode 100644 crates/cargo-toml-workspace/Cargo.toml create mode 100644 crates/cargo-toml-workspace/LICENSE-APACHE create mode 100644 crates/cargo-toml-workspace/LICENSE-MIT rename crates/{binstalk/src/helpers/cargo_toml_workspace.rs => cargo-toml-workspace/src/lib.rs} (89%) diff --git a/Cargo.lock b/Cargo.lock index 52d55f17..f4118394 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -238,12 +238,11 @@ dependencies = [ "base16", "binstalk-downloader", "binstalk-types", - "cargo_toml", + "cargo-toml-workspace", "command-group", "compact_str", "detect-targets", "either", - "glob", "home", "itertools", "jobslot", @@ -488,6 +487,20 @@ dependencies = [ "vergen", ] +[[package]] +name = "cargo-toml-workspace" +version = "0.0.0" +dependencies = [ + "binstalk-types", + "cargo_toml", + "compact_str", + "glob", + "normalize-path", + "tempfile", + "thiserror", + "tracing", +] + [[package]] name = "cargo_toml" version = "0.15.3" diff --git a/Cargo.toml b/Cargo.toml index 1ad5788a..58e8c2a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -5,6 +5,7 @@ members = [ "crates/binstalk-manifests", "crates/binstalk-types", "crates/binstalk-downloader", + "crates/cargo-toml-workspace", "crates/detect-wasi", "crates/fs-lock", "crates/normalize-path", diff --git a/crates/bin/src/logging.rs b/crates/bin/src/logging.rs index acda166f..1c821623 100644 --- a/crates/bin/src/logging.rs +++ b/crates/bin/src/logging.rs @@ -197,6 +197,7 @@ pub fn logging(log_level: LevelFilter, json_output: bool) { "binstalk", "binstalk_downloader", "cargo_binstall", + "cargo_toml_workspace", ]); // Forward log to tracing diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 89e2058b..a357b50d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -14,12 +14,11 @@ async-trait = "0.1.68" base16 = "0.2.1" binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } -cargo_toml = "0.15.3" +cargo-toml-workspace = { version = "0.0.0", path = "../cargo-toml-workspace" } command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.10", path = "../detect-targets" } either = "1.8.1" -glob = "0.3.1" home = "0.5.5" itertools = "0.11.0" jobslot = { version = "0.2.11", features = ["tokio"] } diff --git a/crates/binstalk/src/drivers/registry.rs b/crates/binstalk/src/drivers/registry.rs index a0b3f0ca..b010a198 100644 --- a/crates/binstalk/src/drivers/registry.rs +++ b/crates/binstalk/src/drivers/registry.rs @@ -1,7 +1,6 @@ use std::{str::FromStr, sync::Arc}; use base16::DecodeError as Base16DecodeError; -use cargo_toml::Manifest; use compact_str::CompactString; use leon::{ParseError, RenderError}; use miette::Diagnostic; @@ -11,7 +10,10 @@ use thiserror::Error as ThisError; use crate::{ errors::BinstallError, - helpers::remote::{Client, Error as RemoteError, Url, UrlParseError}, + helpers::{ + cargo_toml::Manifest, + remote::{Client, Error as RemoteError, Url, UrlParseError}, + }, manifests::cargo_toml_binstall::Meta, }; diff --git a/crates/binstalk/src/drivers/registry/common.rs b/crates/binstalk/src/drivers/registry/common.rs index afc5ec3b..a471ffed 100644 --- a/crates/binstalk/src/drivers/registry/common.rs +++ b/crates/binstalk/src/drivers/registry/common.rs @@ -1,7 +1,6 @@ use std::borrow::Cow; use base16::{decode as decode_base16, encode_lower as encode_base16}; -use cargo_toml::Manifest; use compact_str::{format_compact, CompactString, ToCompactString}; use leon::{Template, Values}; use semver::{Version, VersionReq}; @@ -15,6 +14,7 @@ use crate::{ errors::BinstallError, helpers::{ bytes::Bytes, + cargo_toml::Manifest, download::{DataVerifier, Download}, remote::{Client, Url}, }, diff --git a/crates/binstalk/src/drivers/registry/crates_io_registry.rs b/crates/binstalk/src/drivers/registry/crates_io_registry.rs index d66d3998..8649a331 100644 --- a/crates/binstalk/src/drivers/registry/crates_io_registry.rs +++ b/crates/binstalk/src/drivers/registry/crates_io_registry.rs @@ -1,5 +1,4 @@ use binstalk_downloader::remote::Error as RemoteError; -use cargo_toml::Manifest; use compact_str::{CompactString, ToCompactString}; use semver::{Comparator, Op as ComparatorOp, Version as SemVersion, VersionReq}; use serde::Deserialize; @@ -12,7 +11,10 @@ use tracing::debug; use crate::{ drivers::registry::{parse_manifest, MatchedVersion, RegistryError}, errors::BinstallError, - helpers::remote::{Client, Url}, + helpers::{ + cargo_toml::Manifest, + remote::{Client, Url}, + }, manifests::cargo_toml_binstall::Meta, }; diff --git a/crates/binstalk/src/drivers/registry/git_registry.rs b/crates/binstalk/src/drivers/registry/git_registry.rs index b301cc6b..3f98a3ea 100644 --- a/crates/binstalk/src/drivers/registry/git_registry.rs +++ b/crates/binstalk/src/drivers/registry/git_registry.rs @@ -1,6 +1,5 @@ use std::{io, path::PathBuf, sync::Arc}; -use cargo_toml::Manifest; use compact_str::{CompactString, ToCompactString}; use once_cell::sync::OnceCell; use semver::VersionReq; @@ -16,6 +15,7 @@ use crate::{ }, errors::BinstallError, helpers::{ + cargo_toml::Manifest, git::{GitUrl, Repository}, remote::Client, }, diff --git a/crates/binstalk/src/drivers/registry/sparse_registry.rs b/crates/binstalk/src/drivers/registry/sparse_registry.rs index 8b4e9de2..18bcf91d 100644 --- a/crates/binstalk/src/drivers/registry/sparse_registry.rs +++ b/crates/binstalk/src/drivers/registry/sparse_registry.rs @@ -1,4 +1,3 @@ -use cargo_toml::Manifest; use compact_str::CompactString; use semver::VersionReq; use serde_json::Deserializer as JsonDeserializer; @@ -11,7 +10,10 @@ use crate::{ RegistryConfig, RegistryError, }, errors::BinstallError, - helpers::remote::{Client, Error as RemoteError}, + helpers::{ + cargo_toml::Manifest, + remote::{Client, Error as RemoteError}, + }, manifests::cargo_toml_binstall::Meta, }; diff --git a/crates/binstalk/src/drivers/registry/vfs.rs b/crates/binstalk/src/drivers/registry/vfs.rs index 3919b5ed..420be92a 100644 --- a/crates/binstalk/src/drivers/registry/vfs.rs +++ b/crates/binstalk/src/drivers/registry/vfs.rs @@ -4,7 +4,7 @@ use std::{ path::Path, }; -use cargo_toml::AbstractFilesystem; +use crate::helpers::cargo_toml::AbstractFilesystem; use normalize_path::NormalizePath; /// This type stores the filesystem structure for the crate tarball diff --git a/crates/binstalk/src/drivers/registry/visitor.rs b/crates/binstalk/src/drivers/registry/visitor.rs index f86b3d6b..ff5a0eff 100644 --- a/crates/binstalk/src/drivers/registry/visitor.rs +++ b/crates/binstalk/src/drivers/registry/visitor.rs @@ -1,6 +1,5 @@ use std::path::{Path, PathBuf}; -use cargo_toml::{Manifest, Value}; use normalize_path::NormalizePath; use tokio::io::AsyncReadExt; use tracing::debug; @@ -8,7 +7,10 @@ use tracing::debug; use super::vfs::Vfs; use crate::{ errors::BinstallError, - helpers::download::{DownloadError, TarEntriesVisitor, TarEntry}, + helpers::{ + cargo_toml::{Manifest, Value}, + download::{DownloadError, TarEntriesVisitor, TarEntry}, + }, manifests::cargo_toml_binstall::Meta, }; diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index 86db0c61..8f73be6c 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -7,7 +7,6 @@ use std::{ use binstalk_downloader::{ download::DownloadError, gh_api_client::GhApiError, remote::Error as RemoteError, }; -use cargo_toml::Error as CargoTomlError; use compact_str::CompactString; use miette::{Diagnostic, Report}; use target_lexicon::ParseError as TargetTripleParseError; @@ -17,7 +16,9 @@ use tracing::{error, warn}; use crate::{ drivers::{InvalidRegistryError, RegistryError}, - helpers::cargo_toml_workspace::LoadManifestFromWSError, + helpers::{ + cargo_toml::Error as CargoTomlError, cargo_toml_workspace::Error as LoadManifestFromWSError, + }, }; #[derive(Debug, Error)] @@ -500,3 +501,9 @@ impl From for BinstallError { BinstallError::RegistryParseError(Box::new(e)) } } + +impl From for BinstallError { + fn from(e: LoadManifestFromWSError) -> Self { + BinstallError::LoadManifestFromWSError(Box::new(e)) + } +} diff --git a/crates/binstalk/src/helpers.rs b/crates/binstalk/src/helpers.rs index f0b4bdc4..e37eb8dc 100644 --- a/crates/binstalk/src/helpers.rs +++ b/crates/binstalk/src/helpers.rs @@ -1,4 +1,3 @@ -pub(crate) mod cargo_toml_workspace; pub(crate) mod futures_resolver; pub mod jobserver_client; pub mod remote; @@ -11,6 +10,7 @@ pub(crate) use binstalk_downloader::{bytes, download}; #[cfg(feature = "git")] pub(crate) use binstalk_downloader::git; +pub(crate) use cargo_toml_workspace::{self, cargo_toml}; pub(crate) fn is_universal_macos(target: &str) -> bool { ["universal-apple-darwin", "universal2-apple-darwin"].contains(&target) diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 84abca11..f9f031cb 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -7,7 +7,6 @@ use std::{ sync::Arc, }; -use cargo_toml::Manifest; use compact_str::{CompactString, ToCompactString}; use itertools::Itertools; use leon::Template; @@ -22,8 +21,8 @@ use crate::{ errors::{BinstallError, VersionParseError}, fetchers::{Data, Fetcher, TargetData}, helpers::{ - self, cargo_toml_workspace::load_manifest_from_workspace, download::ExtractedFiles, - remote::Client, target_triple::TargetTriple, + self, cargo_toml::Manifest, cargo_toml_workspace::load_manifest_from_workspace, + download::ExtractedFiles, remote::Client, target_triple::TargetTriple, }, manifests::cargo_toml_binstall::{Meta, PkgMeta, PkgOverride}, ops::{CargoTomlFetchOverride, Options}, @@ -381,7 +380,7 @@ impl PackageInfo { let dir = TempDir::new()?; helpers::git::Repository::shallow_clone(git_url, dir.as_ref())?; - load_manifest_from_workspace(dir.as_ref(), &name) + load_manifest_from_workspace(dir.as_ref(), &name).map_err(BinstallError::from) }) .await?? } diff --git a/crates/binstalk/tests/parse-meta.rs b/crates/binstalk/tests/parse-meta.rs index 4443bd57..5d47aae4 100644 --- a/crates/binstalk/tests/parse-meta.rs +++ b/crates/binstalk/tests/parse-meta.rs @@ -1,5 +1,5 @@ use binstalk::ops::resolve::load_manifest_path; -use cargo_toml::Product; +use cargo_toml_workspace::cargo_toml::{Edition, Product}; use std::path::PathBuf; #[test] @@ -24,7 +24,7 @@ fn parse_meta() { &[Product { name: Some("cargo-binstall".to_string()), path: Some("src/main.rs".to_string()), - edition: cargo_toml::Edition::E2021, + edition: Edition::E2021, ..Default::default() },], ); diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml new file mode 100644 index 00000000..79a2f906 --- /dev/null +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "cargo-toml-workspace" +version = "0.0.0" +edition = "2021" +description = "Parse cargo workspace and load specific crate" +repository = "https://github.com/cargo-bins/cargo-binstall" +documentation = "https://docs.rs/cargo-toml-workspace" +rust-version = "1.65.0" +authors = ["Jiahao XU "] +license = "Apache-2.0 OR MIT" + +[dependencies] +binstalk-types = { version = "0.5.0", path = "../binstalk-types" } +cargo_toml = "0.15.3" +compact_str = { version = "0.7.0", features = ["serde"] } +glob = "0.3.1" +normalize-path = { version = "0.2.1", path = "../normalize-path" } +thiserror = "1.0.40" +tracing = "0.1.37" + +[dev-dependencies] +tempfile = "3.5.0" diff --git a/crates/cargo-toml-workspace/LICENSE-APACHE b/crates/cargo-toml-workspace/LICENSE-APACHE new file mode 100644 index 00000000..1b5ec8b7 --- /dev/null +++ b/crates/cargo-toml-workspace/LICENSE-APACHE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/crates/cargo-toml-workspace/LICENSE-MIT b/crates/cargo-toml-workspace/LICENSE-MIT new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/crates/cargo-toml-workspace/LICENSE-MIT @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/crates/binstalk/src/helpers/cargo_toml_workspace.rs b/crates/cargo-toml-workspace/src/lib.rs similarity index 89% rename from crates/binstalk/src/helpers/cargo_toml_workspace.rs rename to crates/cargo-toml-workspace/src/lib.rs index 61f9d293..61ed3f7e 100644 --- a/crates/binstalk/src/helpers/cargo_toml_workspace.rs +++ b/crates/cargo-toml-workspace/src/lib.rs @@ -3,6 +3,7 @@ use std::{ path::{Path, PathBuf}, }; +use binstalk_types::cargo_toml_binstall::Meta; use cargo_toml::{Error as CargoTomlError, Manifest}; use compact_str::CompactString; use glob::PatternError; @@ -10,7 +11,7 @@ use normalize_path::NormalizePath; use thiserror::Error as ThisError; use tracing::{debug, instrument, warn}; -use crate::{errors::BinstallError, manifests::cargo_toml_binstall::Meta}; +pub use cargo_toml; /// Load binstall metadata `Cargo.toml` from workspace at the provided path /// @@ -21,15 +22,12 @@ use crate::{errors::BinstallError, manifests::cargo_toml_binstall::Meta}; pub fn load_manifest_from_workspace( workspace_path: impl AsRef, crate_name: impl AsRef, -) -> Result, BinstallError> { - fn inner(workspace_path: &Path, crate_name: &str) -> Result, BinstallError> { - load_manifest_from_workspace_inner(workspace_path, crate_name).map_err(|inner| { - Box::new(LoadManifestFromWSError { - workspace_path: workspace_path.into(), - crate_name: crate_name.into(), - inner, - }) - .into() +) -> Result, Error> { + fn inner(workspace_path: &Path, crate_name: &str) -> Result, Error> { + load_manifest_from_workspace_inner(workspace_path, crate_name).map_err(|inner| Error { + workspace_path: workspace_path.into(), + crate_name: crate_name.into(), + inner, }) } @@ -38,15 +36,15 @@ pub fn load_manifest_from_workspace( #[derive(Debug, ThisError)] #[error("Failed to load {crate_name} from {}: {inner}", workspace_path.display())] -pub struct LoadManifestFromWSError { +pub struct Error { workspace_path: Box, crate_name: CompactString, #[source] - inner: LoadManifestFromWSErrorInner, + inner: ErrorInner, } #[derive(Debug, ThisError)] -enum LoadManifestFromWSErrorInner { +enum ErrorInner { #[error("Invalid pattern in workspace.members or workspace.exclude: {0}")] PatternError(#[from] PatternError), @@ -67,7 +65,7 @@ enum LoadManifestFromWSErrorInner { fn load_manifest_from_workspace_inner( workspace_path: &Path, crate_name: &str, -) -> Result, LoadManifestFromWSErrorInner> { +) -> Result, ErrorInner> { debug!( "Loading manifest of crate {crate_name} from workspace: {}", workspace_path.display() @@ -123,16 +121,16 @@ fn load_manifest_from_workspace_inner( } } - Err(LoadManifestFromWSErrorInner::NotFound) + Err(ErrorInner::NotFound) } struct Pattern(Vec); impl Pattern { - fn new(pat: &str) -> Result { + fn new(pat: &str) -> Result { Path::new(pat) .try_normalize() - .ok_or_else(|| LoadManifestFromWSErrorInner::InvalidPatternError(pat.into()))? + .ok_or_else(|| ErrorInner::InvalidPatternError(pat.into()))? .iter() .map(|c| glob::Pattern::new(c.to_str().unwrap())) .collect::, _>>() @@ -142,7 +140,7 @@ impl Pattern { /// * `glob_path` - path to dir to glob for /// return paths relative to `glob_path`. - fn glob_dirs(&self, glob_path: &Path) -> Result, LoadManifestFromWSErrorInner> { + fn glob_dirs(&self, glob_path: &Path) -> Result, ErrorInner> { let mut paths = vec![PathBuf::new()]; for pattern in &self.0 { @@ -255,11 +253,7 @@ mod test { assert_eq!(manifest.bin[0].path.as_deref().unwrap(), "src/main.rs"); let err = load_manifest_from_workspace_inner(&p, "cargo-binstall2").unwrap_err(); - assert!( - matches!(err, LoadManifestFromWSErrorInner::NotFound), - "{:#?}", - err - ); + assert!(matches!(err, ErrorInner::NotFound), "{:#?}", err); let manifest = load_manifest_from_workspace(&p, "cargo-watch").unwrap(); let package = manifest.package.unwrap(); From ef99dd795f9d5d8eee461cd8637a2a990b18be0b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 12 Aug 2023 23:24:26 +1000 Subject: [PATCH 1431/2020] Refactor: Extract mod `fs` as crate `atomic-file-install` (#1286) Refactor: Extract mod `fs` as crate `atomic-install` To speedup codegen of `binstalk` and also publish a new crate that could be reused. Signed-off-by: Jiahao XU --- Cargo.lock | 13 +- Cargo.toml | 1 + crates/atomic-file-install/Cargo.toml | 18 ++ crates/atomic-file-install/LICENSE-APACHE | 176 ++++++++++++++++++ crates/atomic-file-install/LICENSE-MIT | 23 +++ .../fs.rs => atomic-file-install/src/lib.rs} | 53 +++--- crates/bin/src/logging.rs | 1 + crates/binstalk/Cargo.toml | 5 +- crates/binstalk/src/lib.rs | 2 +- 9 files changed, 261 insertions(+), 31 deletions(-) create mode 100644 crates/atomic-file-install/Cargo.toml create mode 100644 crates/atomic-file-install/LICENSE-APACHE create mode 100644 crates/atomic-file-install/LICENSE-MIT rename crates/{binstalk/src/fs.rs => atomic-file-install/src/lib.rs} (83%) diff --git a/Cargo.lock b/Cargo.lock index f4118394..5b29eca5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -173,6 +173,16 @@ dependencies = [ "tokio-util", ] +[[package]] +name = "atomic-file-install" +version = "0.0.0" +dependencies = [ + "reflink-copy", + "tempfile", + "tracing", + "windows 0.48.0", +] + [[package]] name = "autocfg" version = "1.1.0" @@ -235,6 +245,7 @@ name = "binstalk" version = "0.15.0" dependencies = [ "async-trait", + "atomic-file-install", "base16", "binstalk-downloader", "binstalk-types", @@ -252,7 +263,6 @@ dependencies = [ "miette", "normalize-path", "once_cell", - "reflink-copy", "semver", "serde", "serde_json", @@ -265,7 +275,6 @@ dependencies = [ "toml_edit", "tracing", "url", - "windows 0.48.0", "xz2", ] diff --git a/Cargo.toml b/Cargo.toml index 58e8c2a7..365c1fdd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,6 @@ [workspace] members = [ + "crates/atomic-file-install", "crates/bin", "crates/binstalk", "crates/binstalk-manifests", diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml new file mode 100644 index 00000000..976515ea --- /dev/null +++ b/crates/atomic-file-install/Cargo.toml @@ -0,0 +1,18 @@ +[package] +name = "atomic-file-install" +version = "0.0.0" +edition = "2021" +description = "For atomically installing a file or a symlink." +repository = "https://github.com/cargo-bins/cargo-binstall" +documentation = "https://docs.rs/atomic-install" +authors = ["Jiahao XU "] +license = "Apache-2.0 OR MIT" +rust-version = "1.65.0" + +[dependencies] +reflink-copy = "0.1.5" +tempfile = "3.5.0" +tracing = "0.1.37" + +[target.'cfg(windows)'.dependencies] +windows = { version = "0.48.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } diff --git a/crates/atomic-file-install/LICENSE-APACHE b/crates/atomic-file-install/LICENSE-APACHE new file mode 100644 index 00000000..1b5ec8b7 --- /dev/null +++ b/crates/atomic-file-install/LICENSE-APACHE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/crates/atomic-file-install/LICENSE-MIT b/crates/atomic-file-install/LICENSE-MIT new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/crates/atomic-file-install/LICENSE-MIT @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/crates/binstalk/src/fs.rs b/crates/atomic-file-install/src/lib.rs similarity index 83% rename from crates/binstalk/src/fs.rs rename to crates/atomic-file-install/src/lib.rs index 87d9ed28..bd7c44ee 100644 --- a/crates/binstalk/src/fs.rs +++ b/crates/atomic-file-install/src/lib.rs @@ -1,9 +1,19 @@ +//! Atomically install a regular file or a symlink to destination, +//! can be either noclobber (fail if destination already exists) or +//! replacing it atomically if it exists. + use std::{fs, io, path::Path}; use reflink_copy::reflink_or_copy; use tempfile::{NamedTempFile, TempPath}; use tracing::{debug, warn}; +#[cfg(unix)] +use std::os::unix::fs::symlink as symlink_file_inner; + +#[cfg(windows)] +use std::os::windows::fs::symlink_file as symlink_file_inner; + fn copy_to_tempfile(src: &Path, dst: &Path) -> io::Result { let parent = dst.parent().unwrap(); debug!("Creating named tempfile at '{}'", parent.display()); @@ -32,7 +42,7 @@ fn copy_to_tempfile(src: &Path, dst: &Path) -> io::Result { Ok(tempfile) } -/// Install a file. +/// Install a file, this fails if the `dst` already exists. /// /// This is a blocking function, must be called in `block_in_place` mode. pub fn atomic_install_noclobber(src: &Path, dst: &Path) -> io::Result<()> { @@ -54,7 +64,7 @@ pub fn atomic_install_noclobber(src: &Path, dst: &Path) -> io::Result<()> { Ok(()) } -/// Atomically install a file. +/// Atomically install a file, this atomically replace `dst` if it exists. /// /// This is a blocking function, must be called in `block_in_place` mode. pub fn atomic_install(src: &Path, dst: &Path) -> io::Result<()> { @@ -65,17 +75,17 @@ pub fn atomic_install(src: &Path, dst: &Path) -> io::Result<()> { ); if let Err(err) = fs::rename(src, dst) { - warn!("Attempting at atomic rename failed: {err:#?}, fallback to other methods."); + warn!("Attempting at atomic rename failed: {err}, fallback to other methods."); - #[cfg(target_os = "windows")] + #[cfg(windows)] { match win::replace_file(src, dst) { Ok(()) => { - debug!("ReplaceFileW succeeded.",); + debug!("ReplaceFileW succeeded."); return Ok(()); } Err(err) => { - warn!("ReplaceFileW failed: {err}, fallback to using tempfile plus rename",); + warn!("ReplaceFileW failed: {err}, fallback to using tempfile plus rename") } } } @@ -92,31 +102,26 @@ pub fn atomic_install(src: &Path, dst: &Path) -> io::Result<()> { Ok(()) } -fn symlink_file_inner(dest: &Path, link: &Path) -> io::Result<()> { - #[cfg(target_family = "unix")] - std::os::unix::fs::symlink(dest, link)?; - - #[cfg(target_family = "windows")] - std::os::windows::fs::symlink_file(dest, link)?; - - Ok(()) -} - +/// Create a symlink at `link` to `dest`, this fails if the `link` +/// already exists. +/// +/// This is a blocking function, must be called in `block_in_place` mode. pub fn atomic_symlink_file_noclobber(dest: &Path, link: &Path) -> io::Result<()> { match symlink_file_inner(dest, link) { Ok(_) => Ok(()), - #[cfg(target_family = "windows")] + #[cfg(windows)] // Symlinks on Windows are disabled in some editions, so creating one is unreliable. // Fallback to copy if it fails. Err(_) => atomic_install_noclobber(dest, link), - #[cfg(not(target_family = "windows"))] + #[cfg(not(windows))] Err(err) => Err(err), } } -/// Atomically install symlink "link" to a file "dst". +/// Atomically create a symlink at `link` to `dest`, this atomically replace +/// `link` if it already exists. /// /// This is a blocking function, must be called in `block_in_place` mode. pub fn atomic_symlink_file(dest: &Path, link: &Path) -> io::Result<()> { @@ -137,12 +142,12 @@ pub fn atomic_symlink_file(dest: &Path, link: &Path) -> io::Result<()> { match symlink_file_inner(dest, &temp_path) { Ok(_) => persist(temp_path, link), - #[cfg(target_family = "windows")] + #[cfg(windows)] // Symlinks on Windows are disabled in some editions, so creating one is unreliable. // Fallback to copy if it fails. Err(_) => atomic_install(dest, link), - #[cfg(not(target_family = "windows"))] + #[cfg(not(windows))] Err(err) => Err(err), } } @@ -151,7 +156,7 @@ fn persist(temp_path: TempPath, to: &Path) -> io::Result<()> { debug!("Persisting '{}' to '{}'", temp_path.display(), to.display()); match temp_path.persist(to) { Ok(()) => Ok(()), - #[cfg(target_os = "windows")] + #[cfg(windows)] Err(tempfile::PathPersistError { error, path: temp_path, @@ -163,12 +168,12 @@ fn persist(temp_path: TempPath, to: &Path) -> io::Result<()> { ); win::replace_file(&temp_path, to).map_err(io::Error::from) } - #[cfg(not(target_os = "windows"))] + #[cfg(not(windows))] Err(err) => Err(err.into()), } } -#[cfg(target_os = "windows")] +#[cfg(windows)] mod win { use std::{os::windows::ffi::OsStrExt, path::Path}; diff --git a/crates/bin/src/logging.rs b/crates/bin/src/logging.rs index 1c821623..787f07f4 100644 --- a/crates/bin/src/logging.rs +++ b/crates/bin/src/logging.rs @@ -194,6 +194,7 @@ pub fn logging(log_level: LevelFilter, json_output: bool) { let log_level = min(log_level, STATIC_MAX_LEVEL); let allowed_targets = (log_level != LevelFilter::Trace).then_some([ + "atomic_file_install", "binstalk", "binstalk_downloader", "cargo_binstall", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index a357b50d..dc37db50 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,6 +11,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" +atomic-file-install = { version = "0.0.0", path = "../atomic-file-install" } base16 = "0.2.1" binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } @@ -28,7 +29,6 @@ maybe-owned = "0.3.4" miette = "5.9.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } once_cell = "1.18.0" -reflink-copy = "0.1.5" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde_json = "1.0.99" @@ -45,9 +45,6 @@ xz2 = "0.1.7" [dev-dependencies] toml_edit = { version = "0.19.11", features = ["serde"] } -[target.'cfg(target_os = "windows")'.dependencies] -windows = { version = "0.48.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } - [features] default = ["static", "rustls", "git"] diff --git a/crates/binstalk/src/lib.rs b/crates/binstalk/src/lib.rs index e36c14e7..4f605634 100644 --- a/crates/binstalk/src/lib.rs +++ b/crates/binstalk/src/lib.rs @@ -4,10 +4,10 @@ pub mod bins; pub mod drivers; pub mod errors; pub mod fetchers; -pub(crate) mod fs; pub mod helpers; pub mod ops; +use atomic_file_install as fs; pub use binstalk_types as manifests; pub use detect_targets::{get_desired_targets, DesiredTargets, TARGET}; pub use home; From fbed317df5d0ed4b4a90c7c03c74ebb2e5f6cb9e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 13 Aug 2023 00:18:02 +1000 Subject: [PATCH 1432/2020] feat: `git::Repository` cancellation support (#1288) feat: `git::Repository` support cancellation. To make sure users can cancel git operation via signal, e.g. when the git operation fail or users no longer want to install. Signed-off-by: Jiahao XU --- Cargo.lock | 12 +++++ crates/binstalk-downloader/Cargo.toml | 1 + crates/binstalk-downloader/src/git.rs | 33 +++++++++++--- .../src/git/cancellation_token.rs | 44 +++++++++++++++++++ .../src/git/progress_tracing.rs | 4 +- .../src/drivers/registry/git_registry.rs | 19 ++++++-- crates/binstalk/src/ops/resolve.rs | 16 +++++-- 7 files changed, 113 insertions(+), 16 deletions(-) create mode 100644 crates/binstalk-downloader/src/git/cancellation_token.rs diff --git a/Cargo.lock b/Cargo.lock index 5b29eca5..058ca20d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -290,6 +290,7 @@ dependencies = [ "bytes", "bzip2", "compact_str", + "derive_destructure2", "flate2", "futures-util", "generic-array", @@ -756,6 +757,17 @@ version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" +[[package]] +name = "derive_destructure2" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35cb7e5875e1028a73e551747d6d0118f25c3d6dbba2dadf97cc0f4d0c53f2f5" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "detect-targets" version = "0.1.10" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index bf54fcdd..8036aaba 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -17,6 +17,7 @@ binstalk-types = { version = "0.5.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" compact_str = "0.7.0" +derive_destructure2 = "0.1" flate2 = { version = "1.0.26", default-features = false } futures-util = "0.3.28" generic-array = "0.14.7" diff --git a/crates/binstalk-downloader/src/git.rs b/crates/binstalk-downloader/src/git.rs index 2f9ba0a8..8ff64e39 100644 --- a/crates/binstalk-downloader/src/git.rs +++ b/crates/binstalk-downloader/src/git.rs @@ -1,6 +1,5 @@ use std::{fmt, mem, num::NonZeroU32, path::Path, str::FromStr, sync::atomic::AtomicBool}; -use compact_str::CompactString; use gix::{clone, create, open, remote, Url}; use thiserror::Error as ThisError; use tracing::debug; @@ -8,6 +7,9 @@ use tracing::debug; mod progress_tracing; use progress_tracing::TracingProgress; +mod cancellation_token; +pub use cancellation_token::{GitCancelOnDrop, GitCancellationToken}; + pub use gix::url::parse::Error as GitUrlParseError; #[derive(Debug, ThisError)] @@ -116,14 +118,21 @@ impl Repository { /// async context then you must wrap the call in [`tokio::task::spawn_blocking`]. /// /// WARNING: This function must be called after tokio runtime is initialized. - pub fn shallow_clone_bare(url: GitUrl, path: &Path) -> Result { + pub fn shallow_clone_bare( + url: GitUrl, + path: &Path, + cancellation_token: Option, + ) -> Result { debug!("Shallow cloning {url} to {}", path.display()); Ok(Self( Self::prepare_fetch(url, path, create::Kind::Bare)? .fetch_only( - &mut TracingProgress::new(CompactString::new("Cloning")), - &AtomicBool::new(false), + &mut TracingProgress::new("Cloning bare"), + cancellation_token + .as_ref() + .map(GitCancellationToken::get_atomic) + .unwrap_or(&AtomicBool::new(false)), )? .0 .into(), @@ -134,16 +143,26 @@ impl Repository { /// async context then you must wrap the call in [`tokio::task::spawn_blocking`]. /// /// WARNING: This function must be called after tokio runtime is initialized. - pub fn shallow_clone(url: GitUrl, path: &Path) -> Result { + pub fn shallow_clone( + url: GitUrl, + path: &Path, + cancellation_token: Option, + ) -> Result { debug!("Shallow cloning {url} to {} with worktree", path.display()); - let mut progress = TracingProgress::new(CompactString::new("Cloning")); + let mut progress = TracingProgress::new("Cloning with worktree"); Ok(Self( Self::prepare_fetch(url, path, create::Kind::WithWorktree)? .fetch_then_checkout(&mut progress, &AtomicBool::new(false))? .0 - .main_worktree(&mut progress, &AtomicBool::new(false))? + .main_worktree( + &mut progress, + cancellation_token + .as_ref() + .map(GitCancellationToken::get_atomic) + .unwrap_or(&AtomicBool::new(false)), + )? .0 .into(), )) diff --git a/crates/binstalk-downloader/src/git/cancellation_token.rs b/crates/binstalk-downloader/src/git/cancellation_token.rs new file mode 100644 index 00000000..97e65e52 --- /dev/null +++ b/crates/binstalk-downloader/src/git/cancellation_token.rs @@ -0,0 +1,44 @@ +use std::sync::{ + atomic::{AtomicBool, Ordering::Relaxed}, + Arc, +}; + +use derive_destructure2::destructure; + +/// Token that can be used to cancel git operation. +#[derive(Clone, Debug, Default)] +pub struct GitCancellationToken(Arc); + +impl GitCancellationToken { + /// Create a guard that cancel the git operation on drop. + #[must_use = "You must assign the guard to a variable, \ +otherwise it is equivalent to `GitCancellationToken::cancel()`"] + pub fn cancel_on_drop(self) -> GitCancelOnDrop { + GitCancelOnDrop(self) + } + + /// Cancel the git operation. + pub fn cancel(&self) { + self.0.store(true, Relaxed) + } + + pub(super) fn get_atomic(&self) -> &AtomicBool { + &self.0 + } +} + +/// Guard used to cancel git operation on drop +#[derive(Debug, destructure)] +pub struct GitCancelOnDrop(GitCancellationToken); + +impl Drop for GitCancelOnDrop { + fn drop(&mut self) { + self.0.cancel() + } +} +impl GitCancelOnDrop { + /// Disarm the guard, return the token. + pub fn disarm(self) -> GitCancellationToken { + self.destructure().0 + } +} diff --git a/crates/binstalk-downloader/src/git/progress_tracing.rs b/crates/binstalk-downloader/src/git/progress_tracing.rs index 67ebe562..b88af701 100644 --- a/crates/binstalk-downloader/src/git/progress_tracing.rs +++ b/crates/binstalk-downloader/src/git/progress_tracing.rs @@ -27,7 +27,7 @@ const SEP: &str = "::"; impl TracingProgress { /// Create a new instanCompactce from `name`. - pub fn new(name: CompactString) -> Self { + pub fn new(name: &str) -> Self { let trigger = Arc::new(AtomicBool::new(true)); tokio::spawn({ let mut interval = time::interval(Duration::from_secs_f32(EMIT_LOG_EVERY_S)); @@ -43,7 +43,7 @@ impl TracingProgress { } }); Self { - name, + name: CompactString::new(name), id: UNKNOWN, max: None, step: 0, diff --git a/crates/binstalk/src/drivers/registry/git_registry.rs b/crates/binstalk/src/drivers/registry/git_registry.rs index 3f98a3ea..c72b504a 100644 --- a/crates/binstalk/src/drivers/registry/git_registry.rs +++ b/crates/binstalk/src/drivers/registry/git_registry.rs @@ -16,7 +16,7 @@ use crate::{ errors::BinstallError, helpers::{ cargo_toml::Manifest, - git::{GitUrl, Repository}, + git::{GitCancellationToken, GitUrl, Repository}, remote::Client, }, manifests::cargo_toml_binstall::Meta, @@ -30,10 +30,14 @@ struct GitIndex { } impl GitIndex { - fn new(url: GitUrl) -> Result { + fn new(url: GitUrl, cancellation_token: GitCancellationToken) -> Result { let tempdir = TempDir::new()?; - let repo = Repository::shallow_clone_bare(url.clone(), tempdir.as_ref())?; + let repo = Repository::shallow_clone_bare( + url.clone(), + tempdir.as_ref(), + Some(cancellation_token), + )?; let config: RegistryConfig = { let config = repo @@ -108,6 +112,10 @@ impl GitRegistry { let version_req = version_req.clone(); let this = self.clone(); + let cancellation_token = GitCancellationToken::default(); + // Cancel git operation if the future is cancelled (dropped). + let cancel_on_drop = cancellation_token.clone().cancel_on_drop(); + let (matched_version, dl_url) = spawn_blocking(move || { let GitIndex { _tempdir: _, @@ -116,7 +124,7 @@ impl GitRegistry { } = this .0 .git_index - .get_or_try_init(|| GitIndex::new(this.0.url.clone()))?; + .get_or_try_init(|| GitIndex::new(this.0.url.clone(), cancellation_token))?; let matched_version = Self::find_crate_matched_ver(repo, &crate_name, &crate_prefix, &version_req)?; @@ -132,6 +140,9 @@ impl GitRegistry { }) .await??; + // Git operation done, disarm it + cancel_on_drop.disarm(); + parse_manifest(client, name, dl_url, matched_version).await } } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index f9f031cb..fdf3414a 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -373,16 +373,26 @@ impl PackageInfo { } #[cfg(feature = "git")] Some(Git(git_url)) => { + use helpers::git::{GitCancellationToken, Repository as GitRepository}; + let git_url = git_url.clone(); let name = name.clone(); + let cancellation_token = GitCancellationToken::default(); + // Cancel git operation if the future is cancelled (dropped). + let cancel_on_drop = cancellation_token.clone().cancel_on_drop(); - spawn_blocking(move || { + let ret = spawn_blocking(move || { let dir = TempDir::new()?; - helpers::git::Repository::shallow_clone(git_url, dir.as_ref())?; + GitRepository::shallow_clone(git_url, dir.as_ref(), Some(cancellation_token))?; load_manifest_from_workspace(dir.as_ref(), &name).map_err(BinstallError::from) }) - .await?? + .await??; + + // Git operation done, disarm it + cancel_on_drop.disarm(); + + ret } None => { Box::pin( From 2375ba48b6adeb7eaf1d8dd079d127d1ac98bae2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 13 Aug 2023 00:25:41 +1000 Subject: [PATCH 1433/2020] Refactor to reduce compilation time (#1284) - Make `binstalk::bins` private. - Move mod `signal` into `crates/bin` - Make items in `crates/bin/src/lib.rs` private if possible to reduce its API generation time. Signed-off-by: Jiahao XU --- crates/bin/Cargo.toml | 2 +- crates/bin/src/args.rs | 66 +++++++++---------- crates/bin/src/bin_util.rs | 4 +- crates/bin/src/lib.rs | 9 +-- .../src/helpers => bin/src}/signal.rs | 4 +- crates/binstalk/Cargo.toml | 2 +- crates/binstalk/src/helpers.rs | 1 - crates/binstalk/src/lib.rs | 2 +- 8 files changed, 45 insertions(+), 45 deletions(-) rename crates/{binstalk/src/helpers => bin/src}/signal.rs (96%) diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index c9582f53..f0e945f8 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -39,7 +39,7 @@ strum = "0.25.0" strum_macros = "0.25.0" supports-color = "2.0.0" tempfile = "3.5.0" -tokio = { version = "1.28.2", features = ["rt-multi-thread"], default-features = false } +tokio = { version = "1.28.2", features = ["rt-multi-thread", "signal"], default-features = false } tracing-core = "0.1.31" tracing = { version = "0.1.37", default-features = false } tracing-log = { version = "0.1.3", default-features = false } diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 10243723..55162bd0 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -48,7 +48,7 @@ pub struct Args { value_name = "crate[@version]", required_unless_present_any = ["version", "help"], )] - pub crate_names: Vec, + pub(crate) crate_names: Vec, /// Package version to install. /// @@ -62,7 +62,7 @@ pub struct Args { long = "version", value_parser(VersionReq::parse_from_cli) )] - pub version_req: Option, + pub(crate) version_req: Option, /// Override binary target set. /// @@ -82,7 +82,7 @@ pub struct Args { long, value_name = "TRIPLE" )] - pub targets: Option>, + pub(crate) targets: Option>, /// Override Cargo.toml package manifest path. /// @@ -92,7 +92,7 @@ pub struct Args { /// /// This option cannot be used with `--git`. #[clap(help_heading = "Overrides", long)] - pub manifest_path: Option, + pub(crate) manifest_path: Option, #[cfg(feature = "git")] /// Override how to fetch Cargo.toml package manifest. @@ -102,11 +102,11 @@ pub struct Args { /// /// This option cannot be used with `--manifest-path`. #[clap(help_heading = "Overrides", long, conflicts_with("manifest_path"))] - pub git: Option, + pub(crate) git: Option, /// Override Cargo.toml package manifest bin-dir. #[clap(help_heading = "Overrides", long)] - pub bin_dir: Option, + pub(crate) bin_dir: Option, /// Override Cargo.toml package manifest pkg-fmt. /// @@ -126,11 +126,11 @@ pub struct Args { /// /// - bin: Download format is raw / binary #[clap(help_heading = "Overrides", long, value_name = "PKG_FMT")] - pub pkg_fmt: Option, + pub(crate) pkg_fmt: Option, /// Override Cargo.toml package manifest pkg-url. #[clap(help_heading = "Overrides", long)] - pub pkg_url: Option, + pub(crate) pkg_url: Option, /// Override the rate limit duration. /// @@ -145,20 +145,20 @@ pub struct Args { /// /// Both duration and request count must not be 0. #[clap(help_heading = "Overrides", long, default_value_t = RateLimit::default(), env = "BINSTALL_RATE_LIMIT")] - pub rate_limit: RateLimit, + pub(crate) rate_limit: RateLimit, /// Specify the strategies to be used, /// binstall will run the strategies specified in order. /// /// Default value is "crate-meta-data,quick-install,compile". #[clap(help_heading = "Overrides", long, value_delimiter(','))] - pub strategies: Vec, + pub(crate) strategies: Vec, /// Disable the strategies specified. /// If a strategy is specified in `--strategies` and `--disable-strategies`, /// then it will be removed. #[clap(help_heading = "Overrides", long, value_delimiter(','))] - pub disable_strategies: Vec, + pub(crate) disable_strategies: Vec, /// If `--github-token` or environment variable `GITHUB_TOKEN`/`GH_TOKEN` /// is not specified, then cargo-binstall will try to extract github token from @@ -166,25 +166,25 @@ pub struct Args { /// /// This option can be used to disable that behavior. #[clap(help_heading = "Overrides", long)] - pub no_discover_github_token: bool, + pub(crate) no_discover_github_token: bool, /// This flag is now enabled by default thus a no-op. /// /// By default, Binstall will install a binary as-is in the install path. #[clap(help_heading = "Options", long, default_value_t = true)] - pub no_symlinks: bool, + pub(crate) no_symlinks: bool, /// Dry run, fetch and show changes without installing binaries. #[clap(help_heading = "Options", long)] - pub dry_run: bool, + pub(crate) dry_run: bool, /// Disable interactive mode / confirmation prompts. #[clap(help_heading = "Options", short = 'y', long)] - pub no_confirm: bool, + pub(crate) no_confirm: bool, /// Do not cleanup temporary files. #[clap(help_heading = "Options", long)] - pub no_cleanup: bool, + pub(crate) no_cleanup: bool, /// By default, binstall keeps track of the installed packages with metadata files /// stored in the installation root directory. @@ -199,7 +199,7 @@ pub struct Args { /// /// This flag will also be passed to `cargo-install` if it is invoked. #[clap(help_heading = "Options", long)] - pub no_track: bool, + pub(crate) no_track: bool, /// Install binaries in a custom location. /// @@ -208,7 +208,7 @@ pub struct Args { /// switches over to a "local" install, where binaries are installed at the path given, and the /// global metadata files are not updated. #[clap(help_heading = "Options", long)] - pub install_path: Option, + pub(crate) install_path: Option, /// Install binaries with a custom cargo root. /// @@ -221,13 +221,13 @@ pub struct Args { /// /// NOTE that `--install-path` takes precedence over this option. #[clap(help_heading = "Options", long, alias = "roots")] - pub root: Option, + pub(crate) root: Option, /// The URL of the registry index to use. /// /// Cannot be used with `--registry`. #[clap(help_heading = "Options", long)] - pub index: Option, + pub(crate) index: Option, /// Name of the registry to use. Registry names are defined in Cargo config /// files . @@ -248,33 +248,33 @@ pub struct Args { env = "CARGO_REGISTRY_DEFAULT", conflicts_with("index") )] - pub registry: Option, + pub(crate) registry: Option, /// This option will be passed through to all `cargo-install` invocations. /// /// It will require `Cargo.lock` to be up to date. #[clap(help_heading = "Options", long)] - pub locked: bool, + pub(crate) locked: bool, /// Deprecated, here for back-compat only. Secure is now on by default. #[clap(hide(true), long)] - pub secure: bool, + pub(crate) secure: bool, /// Force a crate to be installed even if it is already installed. #[clap(help_heading = "Options", long)] - pub force: bool, + pub(crate) force: bool, /// Require a minimum TLS version from remote endpoints. /// /// The default is not to require any minimum TLS version, and use the negotiated highest /// version available to both this client and the remote server. #[clap(help_heading = "Options", long, value_enum, value_name = "VERSION")] - pub min_tls_version: Option, + pub(crate) min_tls_version: Option, /// Specify the root certificates to use for https connnections, /// in addition to default system-wide ones. #[clap(help_heading = "Options", long, env = "BINSTALL_HTTPS_ROOT_CERTS")] - pub root_certificates: Vec, + pub(crate) root_certificates: Vec, /// Print logs in json format to be parsable. #[clap(help_heading = "Options", long)] @@ -290,7 +290,7 @@ pub struct Args { /// token from `$HOME/.git-credentials` or `$HOME/.config/gh/hosts.yml` /// unless `--no-discover-github-token` is specified. #[clap(help_heading = "Options", long, env = "GITHUB_TOKEN")] - pub github_token: Option, + pub(crate) github_token: Option, /// Print version information #[clap(help_heading = "Meta", short = 'V')] @@ -326,11 +326,11 @@ pub struct Args { /// /// This would override the `log_level`. #[clap(help_heading = "Meta", short, long)] - pub quiet: bool, + pub(crate) quiet: bool, } #[derive(Debug, Copy, Clone, ValueEnum)] -pub enum TLSVersion { +pub(crate) enum TLSVersion { #[clap(name = "1.2")] Tls1_2, #[clap(name = "1.3")] @@ -347,9 +347,9 @@ impl From for remote::TLSVersion { } #[derive(Copy, Clone, Debug)] -pub struct RateLimit { - pub duration: NonZeroU16, - pub request_count: NonZeroU64, +pub(crate) struct RateLimit { + pub(crate) duration: NonZeroU16, + pub(crate) request_count: NonZeroU64, } impl fmt::Display for RateLimit { @@ -388,7 +388,7 @@ impl Default for RateLimit { /// Strategy for installing the package #[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, ValueEnum, EnumCount)] #[repr(u8)] -pub enum Strategy { +pub(crate) enum Strategy { /// Attempt to download official pre-built artifacts using /// information provided in `Cargo.toml`. CrateMetaData, diff --git a/crates/bin/src/bin_util.rs b/crates/bin/src/bin_util.rs index 310f507c..d75445f1 100644 --- a/crates/bin/src/bin_util.rs +++ b/crates/bin/src/bin_util.rs @@ -5,11 +5,13 @@ use std::{ }; use binstalk::errors::BinstallError; -use binstalk::helpers::{signal::cancel_on_user_sig_term, tasks::AutoAbortJoinHandle}; +use binstalk::helpers::tasks::AutoAbortJoinHandle; use miette::Result; use tokio::runtime::Runtime; use tracing::{error, info}; +use crate::signal::cancel_on_user_sig_term; + pub enum MainExit { Success(Option), Error(BinstallError), diff --git a/crates/bin/src/lib.rs b/crates/bin/src/lib.rs index 5e19e4d6..2f9e9057 100644 --- a/crates/bin/src/lib.rs +++ b/crates/bin/src/lib.rs @@ -3,8 +3,9 @@ pub mod args; pub mod bin_util; pub mod entry; -pub mod git_credentials; -pub mod install_path; +mod git_credentials; +mod install_path; pub mod logging; -pub mod manifests; -pub mod ui; +mod manifests; +mod signal; +mod ui; diff --git a/crates/binstalk/src/helpers/signal.rs b/crates/bin/src/signal.rs similarity index 96% rename from crates/binstalk/src/helpers/signal.rs rename to crates/bin/src/signal.rs index 0520a258..907fdfe8 100644 --- a/crates/binstalk/src/helpers/signal.rs +++ b/crates/bin/src/signal.rs @@ -1,8 +1,6 @@ use std::io; -use super::tasks::AutoAbortJoinHandle; -use crate::errors::BinstallError; - +use binstalk::{errors::BinstallError, helpers::tasks::AutoAbortJoinHandle}; use tokio::signal; /// This function will poll the handle while listening for ctrl_c, diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index dc37db50..aebb0b60 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -37,7 +37,7 @@ strum = "0.25.0" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" thiserror = "1.0.40" -tokio = { version = "1.30.0", features = ["rt", "process", "sync", "signal"], default-features = false } +tokio = { version = "1.30.0", features = ["rt", "process", "sync"], default-features = false } tracing = "0.1.37" url = { version = "2.3.1", features = ["serde"] } xz2 = "0.1.7" diff --git a/crates/binstalk/src/helpers.rs b/crates/binstalk/src/helpers.rs index e37eb8dc..2844b8d3 100644 --- a/crates/binstalk/src/helpers.rs +++ b/crates/binstalk/src/helpers.rs @@ -1,7 +1,6 @@ pub(crate) mod futures_resolver; pub mod jobserver_client; pub mod remote; -pub mod signal; pub(crate) mod target_triple; pub mod tasks; diff --git a/crates/binstalk/src/lib.rs b/crates/binstalk/src/lib.rs index 4f605634..35a0b381 100644 --- a/crates/binstalk/src/lib.rs +++ b/crates/binstalk/src/lib.rs @@ -1,6 +1,6 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] -pub mod bins; +mod bins; pub mod drivers; pub mod errors; pub mod fetchers; From 6c801a97ae1a97e538e52f07c29f72b2a1729d5a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 13 Aug 2023 17:14:46 +1000 Subject: [PATCH 1434/2020] Fix panic in `atomic-file-install` (#1290) Do not panic if path does not have a parent, instead return an error. Signed-off-by: Jiahao XU --- crates/atomic-file-install/src/lib.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/crates/atomic-file-install/src/lib.rs b/crates/atomic-file-install/src/lib.rs index bd7c44ee..246ecdf4 100644 --- a/crates/atomic-file-install/src/lib.rs +++ b/crates/atomic-file-install/src/lib.rs @@ -14,8 +14,17 @@ use std::os::unix::fs::symlink as symlink_file_inner; #[cfg(windows)] use std::os::windows::fs::symlink_file as symlink_file_inner; +fn parent(p: &Path) -> io::Result<&Path> { + p.parent().ok_or_else(|| { + io::Error::new( + io::ErrorKind::InvalidData, + format!("`{}` does not have a parent", p.display()), + ) + }) +} + fn copy_to_tempfile(src: &Path, dst: &Path) -> io::Result { - let parent = dst.parent().unwrap(); + let parent = parent(dst)?; debug!("Creating named tempfile at '{}'", parent.display()); let tempfile = NamedTempFile::new_in(parent)?; @@ -125,7 +134,7 @@ pub fn atomic_symlink_file_noclobber(dest: &Path, link: &Path) -> io::Result<()> /// /// This is a blocking function, must be called in `block_in_place` mode. pub fn atomic_symlink_file(dest: &Path, link: &Path) -> io::Result<()> { - let parent = link.parent().unwrap(); + let parent = parent(link)?; debug!("Creating tempPath at '{}'", parent.display()); let temp_path = NamedTempFile::new_in(parent)?.into_temp_path(); From 623f7ff4ed0eaacbf2920b31a5d289bdf177bd52 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 13 Aug 2023 17:16:53 +1000 Subject: [PATCH 1435/2020] Refactor: Extract new crate `binstalk-registry` (#1289) To speedup codegen of `binstalk` and enable it to be reused. Signed-off-by: Jiahao XU --- Cargo.lock | 33 +++- Cargo.toml | 1 + crates/bin/src/args.rs | 4 +- crates/binstalk-downloader/src/remote.rs | 1 + crates/binstalk-registry/Cargo.toml | 42 +++++ crates/binstalk-registry/LICENSE-APACHE | 176 ++++++++++++++++++ crates/binstalk-registry/LICENSE-MIT | 23 +++ .../src}/common.rs | 32 ++-- .../src}/crates_io_registry.rs | 18 +- .../src}/git_registry.rs | 27 ++- .../src/lib.rs} | 65 +++++-- .../src}/sparse_registry.rs | 19 +- .../registry => binstalk-registry/src}/vfs.rs | 2 +- .../src}/visitor.rs | 15 +- crates/binstalk/Cargo.toml | 13 +- crates/binstalk/src/drivers.rs | 8 - crates/binstalk/src/errors.rs | 15 +- crates/binstalk/src/helpers.rs | 2 +- crates/binstalk/src/lib.rs | 2 +- crates/binstalk/src/ops.rs | 2 +- 20 files changed, 373 insertions(+), 127 deletions(-) create mode 100644 crates/binstalk-registry/Cargo.toml create mode 100644 crates/binstalk-registry/LICENSE-APACHE create mode 100644 crates/binstalk-registry/LICENSE-MIT rename crates/{binstalk/src/drivers/registry => binstalk-registry/src}/common.rs (90%) rename crates/{binstalk/src/drivers/registry => binstalk-registry/src}/crates_io_registry.rs (93%) rename crates/{binstalk/src/drivers/registry => binstalk-registry/src}/git_registry.rs (87%) rename crates/{binstalk/src/drivers/registry.rs => binstalk-registry/src/lib.rs} (81%) rename crates/{binstalk/src/drivers/registry => binstalk-registry/src}/sparse_registry.rs (86%) rename crates/{binstalk/src/drivers/registry => binstalk-registry/src}/vfs.rs (95%) rename crates/{binstalk/src/drivers/registry => binstalk-registry/src}/visitor.rs (90%) delete mode 100644 crates/binstalk/src/drivers.rs diff --git a/Cargo.lock b/Cargo.lock index 058ca20d..cf16d38f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -246,8 +246,8 @@ version = "0.15.0" dependencies = [ "async-trait", "atomic-file-install", - "base16", "binstalk-downloader", + "binstalk-registry", "binstalk-types", "cargo-toml-workspace", "command-group", @@ -264,18 +264,13 @@ dependencies = [ "normalize-path", "once_cell", "semver", - "serde", - "serde_json", - "sha2", "strum", "target-lexicon", "tempfile", "thiserror", "tokio", - "toml_edit", "tracing", "url", - "xz2", ] [[package]] @@ -335,6 +330,32 @@ dependencies = [ "url", ] +[[package]] +name = "binstalk-registry" +version = "0.0.0" +dependencies = [ + "async-trait", + "base16", + "binstalk-downloader", + "binstalk-types", + "cargo-toml-workspace", + "compact_str", + "leon", + "miette", + "normalize-path", + "once_cell", + "semver", + "serde", + "serde_json", + "sha2", + "tempfile", + "thiserror", + "tokio", + "toml_edit", + "tracing", + "url", +] + [[package]] name = "binstalk-types" version = "0.5.0" diff --git a/Cargo.toml b/Cargo.toml index 365c1fdd..39c2e512 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ members = [ "crates/atomic-file-install", "crates/bin", "crates/binstalk", + "crates/binstalk-registry", "crates/binstalk-manifests", "crates/binstalk-types", "crates/binstalk-downloader", diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 55162bd0..31ef8885 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -8,10 +8,10 @@ use std::{ }; use binstalk::{ - drivers::Registry, helpers::remote, manifests::cargo_toml_binstall::PkgFmt, ops::resolve::{CrateName, VersionReqExt}, + registry::Registry, }; use clap::{error::ErrorKind, CommandFactory, Parser, ValueEnum}; use compact_str::CompactString; @@ -102,7 +102,7 @@ pub struct Args { /// /// This option cannot be used with `--manifest-path`. #[clap(help_heading = "Overrides", long, conflicts_with("manifest_path"))] - pub(crate) git: Option, + pub(crate) git: Option, /// Override Cargo.toml package manifest bin-dir. #[clap(help_heading = "Overrides", long)] diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 6d7e7713..e32a4ab8 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -37,6 +37,7 @@ const MAX_RETRY_DURATION: Duration = Duration::from_secs(120); const MAX_RETRY_COUNT: u8 = 3; const DEFAULT_RETRY_DURATION_FOR_RATE_LIMIT: Duration = Duration::from_millis(200); const RETRY_DURATION_FOR_TIMEOUT: Duration = Duration::from_millis(200); +#[allow(dead_code)] const DEFAULT_MIN_TLS: TLSVersion = TLSVersion::TLS_1_2; #[derive(Debug, ThisError)] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml new file mode 100644 index 00000000..a021c8d0 --- /dev/null +++ b/crates/binstalk-registry/Cargo.toml @@ -0,0 +1,42 @@ +[package] +name = "binstalk-registry" +version = "0.0.0" +edition = "2021" +rust-version = "1.65.0" + +description = "The binstall toolkit for fetching package from arbitrary registry" +repository = "https://github.com/cargo-bins/cargo-binstall" +documentation = "https://docs.rs/binstalk-registry" +authors = ["Jiahao_XU@outlook "] +license = "Apache-2.0 OR MIT" + +[dependencies] +async-trait = "0.1.68" +base16 = "0.2.1" +binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader", default-features = false, features = ["json"] } +binstalk-types = { version = "0.5.0", path = "../binstalk-types" } +cargo-toml-workspace = { version = "0.0.0", path = "../cargo-toml-workspace" } +compact_str = { version = "0.7.0", features = ["serde"] } +leon = { version = "2.0.1", path = "../leon" } +miette = "5.9.0" +normalize-path = { version = "0.2.1", path = "../normalize-path" } +once_cell = "1.18.0" +semver = { version = "1.0.17", features = ["serde"] } +serde = { version = "1.0.163", features = ["derive"] } +serde_json = "1.0.99" +sha2 = "0.10.7" +tempfile = "3.5.0" +thiserror = "1.0.40" +tokio = { version = "1.30.0", features = ["rt", "sync", "time"], default-features = false } +tracing = "0.1.37" +url = "2.3.1" + +[dev-dependencies] +tokio = { version = "1", features = ["rt-multi-thread", "macros"] } +toml_edit = { version = "0.19.11", features = ["serde"] } + +[features] +git = ["binstalk-downloader/git"] + +[package.metadata.docs.rs] +rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/binstalk-registry/LICENSE-APACHE b/crates/binstalk-registry/LICENSE-APACHE new file mode 100644 index 00000000..1b5ec8b7 --- /dev/null +++ b/crates/binstalk-registry/LICENSE-APACHE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/crates/binstalk-registry/LICENSE-MIT b/crates/binstalk-registry/LICENSE-MIT new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/crates/binstalk-registry/LICENSE-MIT @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/crates/binstalk/src/drivers/registry/common.rs b/crates/binstalk-registry/src/common.rs similarity index 90% rename from crates/binstalk/src/drivers/registry/common.rs rename to crates/binstalk-registry/src/common.rs index a471ffed..c5574e46 100644 --- a/crates/binstalk/src/drivers/registry/common.rs +++ b/crates/binstalk-registry/src/common.rs @@ -1,6 +1,13 @@ use std::borrow::Cow; use base16::{decode as decode_base16, encode_lower as encode_base16}; +use binstalk_downloader::{ + bytes::Bytes, + download::{DataVerifier, Download}, + remote::{Client, Url}, +}; +use binstalk_types::cargo_toml_binstall::{Meta, TarBasedFmt}; +use cargo_toml_workspace::cargo_toml::Manifest; use compact_str::{format_compact, CompactString, ToCompactString}; use leon::{Template, Values}; use semver::{Version, VersionReq}; @@ -9,17 +16,7 @@ use serde_json::Error as JsonError; use sha2::{Digest, Sha256}; use tracing::debug; -use crate::{ - drivers::registry::{visitor::ManifestVisitor, RegistryError}, - errors::BinstallError, - helpers::{ - bytes::Bytes, - cargo_toml::Manifest, - download::{DataVerifier, Download}, - remote::{Client, Url}, - }, - manifests::cargo_toml_binstall::{Meta, TarBasedFmt}, -}; +use crate::{visitor::ManifestVisitor, RegistryError}; #[derive(Deserialize)] pub(super) struct RegistryConfig { @@ -45,7 +42,7 @@ pub(super) async fn parse_manifest( crate_name: &str, crate_url: Url, MatchedVersion { version, cksum }: MatchedVersion, -) -> Result, BinstallError> { +) -> Result, RegistryError> { debug!("Fetching crate from: {crate_url} and extracting Cargo.toml from it"); let mut manifest_visitor = ManifestVisitor::new(format!("{crate_name}-{version}").into()); @@ -61,10 +58,9 @@ pub(super) async fn parse_manifest( if digest_checksum.as_slice() != checksum.as_slice() { Err(RegistryError::UnmatchedChecksum { - expected: cksum, - actual: encode_base16(digest_checksum.as_slice()), - } - .into()) + expected: cksum.into(), + actual: encode_base16(digest_checksum.as_slice()).into(), + }) } else { manifest_visitor.load_manifest() } @@ -154,7 +150,7 @@ impl MatchedVersion { pub(super) fn find( it: &mut dyn Iterator>, version_req: &VersionReq, - ) -> Result { + ) -> Result { let mut ret = Option::<(Self, Version)>::None; for res in it { @@ -189,7 +185,7 @@ impl MatchedVersion { } ret.map(|(num, _)| num) - .ok_or_else(|| BinstallError::VersionMismatch { + .ok_or_else(|| RegistryError::VersionMismatch { req: version_req.clone(), }) } diff --git a/crates/binstalk/src/drivers/registry/crates_io_registry.rs b/crates/binstalk-registry/src/crates_io_registry.rs similarity index 93% rename from crates/binstalk/src/drivers/registry/crates_io_registry.rs rename to crates/binstalk-registry/src/crates_io_registry.rs index 8649a331..31859df3 100644 --- a/crates/binstalk/src/drivers/registry/crates_io_registry.rs +++ b/crates/binstalk-registry/src/crates_io_registry.rs @@ -1,4 +1,6 @@ -use binstalk_downloader::remote::Error as RemoteError; +use binstalk_downloader::remote::{Client, Error as RemoteError, Url}; +use binstalk_types::cargo_toml_binstall::Meta; +use cargo_toml_workspace::cargo_toml::Manifest; use compact_str::{CompactString, ToCompactString}; use semver::{Comparator, Op as ComparatorOp, Version as SemVersion, VersionReq}; use serde::Deserialize; @@ -8,15 +10,7 @@ use tokio::{ }; use tracing::debug; -use crate::{ - drivers::registry::{parse_manifest, MatchedVersion, RegistryError}, - errors::BinstallError, - helpers::{ - cargo_toml::Manifest, - remote::{Client, Url}, - }, - manifests::cargo_toml_binstall::Meta, -}; +use crate::{parse_manifest, MatchedVersion, RegistryError}; #[derive(Debug)] pub struct CratesIoRateLimit(Mutex); @@ -148,7 +142,7 @@ pub async fn fetch_crate_cratesio( name: &str, version_req: &VersionReq, crates_io_rate_limit: &CratesIoRateLimit, -) -> Result, BinstallError> { +) -> Result, RegistryError> { // Wait until we can make another request to crates.io crates_io_rate_limit.tick().await; @@ -184,7 +178,7 @@ pub async fn fetch_crate_cratesio( RemoteError::Http(e) if e.is_status() => RegistryError::NotFound(name.into()), e => e.into(), })? - .ok_or_else(|| BinstallError::VersionMismatch { + .ok_or_else(|| RegistryError::VersionMismatch { req: version_req.clone(), })?; diff --git a/crates/binstalk/src/drivers/registry/git_registry.rs b/crates/binstalk-registry/src/git_registry.rs similarity index 87% rename from crates/binstalk/src/drivers/registry/git_registry.rs rename to crates/binstalk-registry/src/git_registry.rs index c72b504a..511d59f0 100644 --- a/crates/binstalk/src/drivers/registry/git_registry.rs +++ b/crates/binstalk-registry/src/git_registry.rs @@ -1,5 +1,11 @@ use std::{io, path::PathBuf, sync::Arc}; +use binstalk_downloader::{ + git::{GitCancellationToken, GitUrl, Repository}, + remote::Client, +}; +use binstalk_types::cargo_toml_binstall::Meta; +use cargo_toml_workspace::cargo_toml::Manifest; use compact_str::{CompactString, ToCompactString}; use once_cell::sync::OnceCell; use semver::VersionReq; @@ -9,17 +15,8 @@ use tokio::task::spawn_blocking; use url::Url; use crate::{ - drivers::registry::{ - crate_prefix_components, parse_manifest, render_dl_template, MatchedVersion, - RegistryConfig, RegistryError, - }, - errors::BinstallError, - helpers::{ - cargo_toml::Manifest, - git::{GitCancellationToken, GitUrl, Repository}, - remote::Client, - }, - manifests::cargo_toml_binstall::Meta, + crate_prefix_components, parse_manifest, render_dl_template, MatchedVersion, RegistryConfig, + RegistryError, }; #[derive(Debug)] @@ -30,7 +27,7 @@ struct GitIndex { } impl GitIndex { - fn new(url: GitUrl, cancellation_token: GitCancellationToken) -> Result { + fn new(url: GitUrl, cancellation_token: GitCancellationToken) -> Result { let tempdir = TempDir::new()?; let repo = Repository::shallow_clone_bare( @@ -83,7 +80,7 @@ impl GitRegistry { crate_name: &str, (c1, c2): &(CompactString, Option), version_req: &VersionReq, - ) -> Result { + ) -> Result { let mut path = PathBuf::with_capacity(128); path.push(&**c1); if let Some(c2) = c2 { @@ -106,7 +103,7 @@ impl GitRegistry { client: Client, name: &str, version_req: &VersionReq, - ) -> Result, BinstallError> { + ) -> Result, RegistryError> { let crate_prefix = crate_prefix_components(name)?; let crate_name = name.to_compact_string(); let version_req = version_req.clone(); @@ -136,7 +133,7 @@ impl GitRegistry { &matched_version, )?)?; - Ok::<_, BinstallError>((matched_version, url)) + Ok::<_, RegistryError>((matched_version, url)) }) .await??; diff --git a/crates/binstalk/src/drivers/registry.rs b/crates/binstalk-registry/src/lib.rs similarity index 81% rename from crates/binstalk/src/drivers/registry.rs rename to crates/binstalk-registry/src/lib.rs index b010a198..eb273b22 100644 --- a/crates/binstalk/src/drivers/registry.rs +++ b/crates/binstalk-registry/src/lib.rs @@ -1,24 +1,25 @@ -use std::{str::FromStr, sync::Arc}; +#![cfg_attr(docsrs, feature(doc_auto_cfg))] + +use std::{io, str::FromStr, sync::Arc}; use base16::DecodeError as Base16DecodeError; +use binstalk_downloader::{ + download::DownloadError, + remote::{Client, Error as RemoteError}, +}; +use binstalk_types::cargo_toml_binstall::Meta; +use cargo_toml_workspace::cargo_toml::{Error as CargoTomlError, Manifest}; use compact_str::CompactString; use leon::{ParseError, RenderError}; use miette::Diagnostic; use semver::VersionReq; use serde_json::Error as JsonError; use thiserror::Error as ThisError; - -use crate::{ - errors::BinstallError, - helpers::{ - cargo_toml::Manifest, - remote::{Client, Error as RemoteError, Url, UrlParseError}, - }, - manifests::cargo_toml_binstall::Meta, -}; +use tokio::task; +use url::{ParseError as UrlParseError, Url}; #[cfg(feature = "git")] -pub use crate::helpers::git::{GitUrl, GitUrlParseError}; +pub use binstalk_downloader::git::{GitError, GitUrl, GitUrlParseError}; mod vfs; @@ -64,7 +65,39 @@ pub enum RegistryError { InvalidHex(#[from] Base16DecodeError), #[error("Expected checksum `{expected}`, actual checksum `{actual}`")] - UnmatchedChecksum { expected: String, actual: String }, + UnmatchedChecksum { + expected: Box, + actual: Box, + }, + + #[error("no version matching requirement '{req}'")] + VersionMismatch { req: semver::VersionReq }, + + #[error("Failed to parse cargo manifest: {0}")] + #[diagnostic(help("If you used --manifest-path, check the Cargo.toml syntax."))] + CargoManifest(#[from] Box), + + #[error("Failed to parse url: {0}")] + UrlParse(#[from] url::ParseError), + + #[error(transparent)] + Download(#[from] DownloadError), + + #[error("I/O Error: {0}")] + Io(#[from] io::Error), + + #[error(transparent)] + TaskJoinError(#[from] task::JoinError), + + #[cfg(feature = "git")] + #[error("Failed to shallow clone git repository: {0}")] + GitError(#[from] GitError), +} + +impl From for RegistryError { + fn from(e: CargoTomlError) -> Self { + Self::from(Box::new(e)) + } } #[derive(Clone, Debug)] @@ -101,8 +134,8 @@ enum InvalidRegistryErrorInner { #[error("failed to parse sparse registry url: {0}")] UrlParseErr(#[from] UrlParseError), - #[error("expected protocol http(s), actual protocl {0}")] - InvalidScheme(CompactString), + #[error("expected protocol http(s), actual url `{0}`")] + InvalidScheme(Box), #[cfg(not(feature = "git"))] #[error("git registry not supported")] @@ -116,7 +149,7 @@ impl Registry { let scheme = url.scheme(); if scheme != "http" && scheme != "https" { - Err(InvalidRegistryErrorInner::InvalidScheme(scheme.into())) + Err(InvalidRegistryErrorInner::InvalidScheme(Box::new(url))) } else { Ok(Self::Sparse(Arc::new(SparseRegistry::new(url)))) } @@ -140,7 +173,7 @@ impl Registry { client: Client, crate_name: &str, version_req: &VersionReq, - ) -> Result, BinstallError> { + ) -> Result, RegistryError> { match self { Self::CratesIo(rate_limit) => { fetch_crate_cratesio(client, crate_name, version_req, rate_limit).await diff --git a/crates/binstalk/src/drivers/registry/sparse_registry.rs b/crates/binstalk-registry/src/sparse_registry.rs similarity index 86% rename from crates/binstalk/src/drivers/registry/sparse_registry.rs rename to crates/binstalk-registry/src/sparse_registry.rs index 18bcf91d..e03197ad 100644 --- a/crates/binstalk/src/drivers/registry/sparse_registry.rs +++ b/crates/binstalk-registry/src/sparse_registry.rs @@ -1,3 +1,6 @@ +use binstalk_downloader::remote::{Client, Error as RemoteError}; +use binstalk_types::cargo_toml_binstall::Meta; +use cargo_toml_workspace::cargo_toml::Manifest; use compact_str::CompactString; use semver::VersionReq; use serde_json::Deserializer as JsonDeserializer; @@ -5,16 +8,8 @@ use tokio::sync::OnceCell; use url::Url; use crate::{ - drivers::registry::{ - crate_prefix_components, parse_manifest, render_dl_template, MatchedVersion, - RegistryConfig, RegistryError, - }, - errors::BinstallError, - helpers::{ - cargo_toml::Manifest, - remote::{Client, Error as RemoteError}, - }, - manifests::cargo_toml_binstall::Meta, + crate_prefix_components, parse_manifest, render_dl_template, MatchedVersion, RegistryConfig, + RegistryError, }; #[derive(Debug)] @@ -53,7 +48,7 @@ impl SparseRegistry { crate_name: &str, (c1, c2): &(CompactString, Option), version_req: &VersionReq, - ) -> Result { + ) -> Result { { let mut path = url.path_segments_mut().unwrap(); @@ -87,7 +82,7 @@ impl SparseRegistry { client: Client, crate_name: &str, version_req: &VersionReq, - ) -> Result, BinstallError> { + ) -> Result, RegistryError> { let crate_prefix = crate_prefix_components(crate_name)?; let dl_template = self.get_dl_template(&client).await?; let matched_version = Self::find_crate_matched_ver( diff --git a/crates/binstalk/src/drivers/registry/vfs.rs b/crates/binstalk-registry/src/vfs.rs similarity index 95% rename from crates/binstalk/src/drivers/registry/vfs.rs rename to crates/binstalk-registry/src/vfs.rs index 420be92a..b3339a81 100644 --- a/crates/binstalk/src/drivers/registry/vfs.rs +++ b/crates/binstalk-registry/src/vfs.rs @@ -4,7 +4,7 @@ use std::{ path::Path, }; -use crate::helpers::cargo_toml::AbstractFilesystem; +use cargo_toml_workspace::cargo_toml::AbstractFilesystem; use normalize_path::NormalizePath; /// This type stores the filesystem structure for the crate tarball diff --git a/crates/binstalk/src/drivers/registry/visitor.rs b/crates/binstalk-registry/src/visitor.rs similarity index 90% rename from crates/binstalk/src/drivers/registry/visitor.rs rename to crates/binstalk-registry/src/visitor.rs index ff5a0eff..717ec57f 100644 --- a/crates/binstalk/src/drivers/registry/visitor.rs +++ b/crates/binstalk-registry/src/visitor.rs @@ -1,18 +1,13 @@ use std::path::{Path, PathBuf}; +use binstalk_downloader::download::{DownloadError, TarEntriesVisitor, TarEntry}; +use binstalk_types::cargo_toml_binstall::Meta; +use cargo_toml_workspace::cargo_toml::{Manifest, Value}; use normalize_path::NormalizePath; use tokio::io::AsyncReadExt; use tracing::debug; -use super::vfs::Vfs; -use crate::{ - errors::BinstallError, - helpers::{ - cargo_toml::{Manifest, Value}, - download::{DownloadError, TarEntriesVisitor, TarEntry}, - }, - manifests::cargo_toml_binstall::Meta, -}; +use crate::{vfs::Vfs, RegistryError}; #[derive(Debug)] pub(super) struct ManifestVisitor { @@ -71,7 +66,7 @@ impl TarEntriesVisitor for ManifestVisitor { impl ManifestVisitor { /// Load binstall metadata using the extracted information stored in memory. - pub(super) fn load_manifest(self) -> Result, BinstallError> { + pub(super) fn load_manifest(self) -> Result, RegistryError> { debug!("Loading manifest directly from extracted file"); // Load and parse manifest diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index aebb0b60..2e70281e 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,8 +12,8 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" atomic-file-install = { version = "0.0.0", path = "../atomic-file-install" } -base16 = "0.2.1" binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-registry = { version = "0.0.0", path = "../binstalk-registry" } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "0.0.0", path = "../cargo-toml-workspace" } command-group = { version = "2.1.0", features = ["with-tokio"] } @@ -30,9 +30,6 @@ miette = "5.9.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } once_cell = "1.18.0" semver = { version = "1.0.17", features = ["serde"] } -serde = { version = "1.0.163", features = ["derive"] } -serde_json = "1.0.99" -sha2 = "0.10.7" strum = "0.25.0" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" @@ -40,16 +37,12 @@ thiserror = "1.0.40" tokio = { version = "1.30.0", features = ["rt", "process", "sync"], default-features = false } tracing = "0.1.37" url = { version = "2.3.1", features = ["serde"] } -xz2 = "0.1.7" - -[dev-dependencies] -toml_edit = { version = "0.19.11", features = ["serde"] } [features] default = ["static", "rustls", "git"] -git = ["binstalk-downloader/git"] -git-max-perf = ["binstalk-downloader/git-max-perf"] +git = ["binstalk-registry/git"] +git-max-perf = ["git", "binstalk-downloader/git-max-perf"] static = ["binstalk-downloader/static"] pkg-config = ["binstalk-downloader/pkg-config"] diff --git a/crates/binstalk/src/drivers.rs b/crates/binstalk/src/drivers.rs deleted file mode 100644 index 15604fea..00000000 --- a/crates/binstalk/src/drivers.rs +++ /dev/null @@ -1,8 +0,0 @@ -mod registry; -pub use registry::{ - fetch_crate_cratesio, CratesIoRateLimit, InvalidRegistryError, Registry, RegistryError, - SparseRegistry, -}; - -#[cfg(feature = "git")] -pub use registry::{GitRegistry, GitUrl, GitUrlParseError}; diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index 8f73be6c..db2e19cd 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -15,10 +15,10 @@ use tokio::task; use tracing::{error, warn}; use crate::{ - drivers::{InvalidRegistryError, RegistryError}, helpers::{ cargo_toml::Error as CargoTomlError, cargo_toml_workspace::Error as LoadManifestFromWSError, }, + registry::{InvalidRegistryError, RegistryError}, }; #[derive(Debug, Error)] @@ -198,18 +198,6 @@ pub enum BinstallError { #[diagnostic(severity(error), code(binstall::version::parse))] VersionParse(#[from] Box), - /// No available version matches the requirements. - /// - /// This may be the case when using the `--version` option. - /// - /// Note that using `--version 1.2.3` is interpreted as the requirement `=1.2.3`. - /// - /// - Code: `binstall::version::mismatch` - /// - Exit: 82 - #[error("no version matching requirement '{req}'")] - #[diagnostic(severity(error), code(binstall::version::mismatch))] - VersionMismatch { req: semver::VersionReq }, - /// The crate@version syntax was used at the same time as the --version option. /// /// You can't do that as it's ambiguous which should apply. @@ -374,7 +362,6 @@ impl BinstallError { CargoManifest { .. } => 78, RegistryParseError(..) => 79, VersionParse { .. } => 80, - VersionMismatch { .. } => 82, SuperfluousVersionOption => 84, UnspecifiedBinaries => 86, NoViableTargets => 87, diff --git a/crates/binstalk/src/helpers.rs b/crates/binstalk/src/helpers.rs index 2844b8d3..bbe9411e 100644 --- a/crates/binstalk/src/helpers.rs +++ b/crates/binstalk/src/helpers.rs @@ -4,8 +4,8 @@ pub mod remote; pub(crate) mod target_triple; pub mod tasks; +pub(crate) use binstalk_downloader::download; pub use binstalk_downloader::gh_api_client; -pub(crate) use binstalk_downloader::{bytes, download}; #[cfg(feature = "git")] pub(crate) use binstalk_downloader::git; diff --git a/crates/binstalk/src/lib.rs b/crates/binstalk/src/lib.rs index 35a0b381..c3b467ff 100644 --- a/crates/binstalk/src/lib.rs +++ b/crates/binstalk/src/lib.rs @@ -1,13 +1,13 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] mod bins; -pub mod drivers; pub mod errors; pub mod fetchers; pub mod helpers; pub mod ops; use atomic_file_install as fs; +pub use binstalk_registry as registry; pub use binstalk_types as manifests; pub use detect_targets::{get_desired_targets, DesiredTargets, TARGET}; pub use home; diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index c28ee280..d996e4d0 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -5,12 +5,12 @@ use std::{path::PathBuf, sync::Arc}; use semver::VersionReq; use crate::{ - drivers::Registry, fetchers::{Data, Fetcher, TargetData}, helpers::{ self, gh_api_client::GhApiClient, jobserver_client::LazyJobserverClient, remote::Client, }, manifests::cargo_toml_binstall::PkgOverride, + registry::Registry, DesiredTargets, }; From 76c72469eb1259f2ddd4a467b99d68f689833300 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 14 Aug 2023 13:20:34 +1000 Subject: [PATCH 1436/2020] Refactor: Extract new crate `binstalk-fetchers` (#1291) To reduce `binstalk` codegen and enable better reuse. Signed-off-by: Jiahao XU --- Cargo.lock | 25 +- Cargo.toml | 1 + crates/bin/src/logging.rs | 2 + crates/binstalk-fetchers/Cargo.toml | 31 + crates/binstalk-fetchers/LICENSE | 674 ++++++++++++++++++ crates/binstalk-fetchers/src/common.rs | 60 ++ .../src}/futures_resolver.rs | 0 .../src}/gh_crate_meta.rs | 127 ++-- .../src}/gh_crate_meta/hosting.rs | 0 .../src/lib.rs} | 99 ++- .../src}/quickinstall.rs | 39 +- crates/binstalk/Cargo.toml | 4 +- crates/binstalk/src/bins.rs | 29 +- crates/binstalk/src/errors.rs | 18 + crates/binstalk/src/helpers.rs | 1 - crates/binstalk/src/helpers/tasks.rs | 7 +- crates/binstalk/src/lib.rs | 2 +- crates/binstalk/src/ops.rs | 4 +- crates/binstalk/src/ops/resolve.rs | 7 +- 19 files changed, 1008 insertions(+), 122 deletions(-) create mode 100644 crates/binstalk-fetchers/Cargo.toml create mode 100644 crates/binstalk-fetchers/LICENSE create mode 100644 crates/binstalk-fetchers/src/common.rs rename crates/{binstalk/src/helpers => binstalk-fetchers/src}/futures_resolver.rs (100%) rename crates/{binstalk/src/fetchers => binstalk-fetchers/src}/gh_crate_meta.rs (84%) rename crates/{binstalk/src/fetchers => binstalk-fetchers/src}/gh_crate_meta/hosting.rs (100%) rename crates/{binstalk/src/fetchers.rs => binstalk-fetchers/src/lib.rs} (79%) rename crates/{binstalk/src/fetchers => binstalk-fetchers/src}/quickinstall.rs (88%) diff --git a/Cargo.lock b/Cargo.lock index cf16d38f..e90cf835 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -244,9 +244,9 @@ dependencies = [ name = "binstalk" version = "0.15.0" dependencies = [ - "async-trait", "atomic-file-install", "binstalk-downloader", + "binstalk-fetchers", "binstalk-registry", "binstalk-types", "cargo-toml-workspace", @@ -258,11 +258,9 @@ dependencies = [ "itertools", "jobslot", "leon", - "leon-macros", "maybe-owned", "miette", "normalize-path", - "once_cell", "semver", "strum", "target-lexicon", @@ -309,6 +307,27 @@ dependencies = [ "zstd 0.12.4", ] +[[package]] +name = "binstalk-fetchers" +version = "0.0.0" +dependencies = [ + "async-trait", + "binstalk-downloader", + "binstalk-types", + "compact_str", + "either", + "itertools", + "leon", + "leon-macros", + "miette", + "once_cell", + "strum", + "thiserror", + "tokio", + "tracing", + "url", +] + [[package]] name = "binstalk-manifests" version = "0.8.0" diff --git a/Cargo.toml b/Cargo.toml index 39c2e512..03fee99c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ members = [ "crates/atomic-file-install", "crates/bin", "crates/binstalk", + "crates/binstalk-fetchers", "crates/binstalk-registry", "crates/binstalk-manifests", "crates/binstalk-types", diff --git a/crates/bin/src/logging.rs b/crates/bin/src/logging.rs index 787f07f4..2b5e4dbd 100644 --- a/crates/bin/src/logging.rs +++ b/crates/bin/src/logging.rs @@ -197,6 +197,8 @@ pub fn logging(log_level: LevelFilter, json_output: bool) { "atomic_file_install", "binstalk", "binstalk_downloader", + "binstalk_fetchers", + "binstalk_registry", "cargo_binstall", "cargo_toml_workspace", ]); diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml new file mode 100644 index 00000000..89f26da6 --- /dev/null +++ b/crates/binstalk-fetchers/Cargo.toml @@ -0,0 +1,31 @@ +[package] +name = "binstalk-fetchers" +version = "0.0.0" +edition = "2021" + +description = "The binstall fetchers" +repository = "https://github.com/cargo-bins/cargo-binstall" +documentation = "https://docs.rs/binstalk-fetchers" +rust-version = "1.65.0" +authors = ["Jiahao XU "] +license = "GPL-3.0-only" + +[dependencies] +async-trait = "0.1.68" +binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-types = { version = "0.5.0", path = "../binstalk-types" } +compact_str = { version = "0.7.0" } +either = "1.8.1" +itertools = "0.11.0" +leon = { version = "2.0.1", path = "../leon", features = ["miette"] } +leon-macros = { version = "1.0.0", path = "../leon-macros" } +miette = "5.9.0" +once_cell = "1.18.0" +strum = "0.25.0" +thiserror = "1.0.40" +tokio = { version = "1.30.0", features = ["rt", "sync"], default-features = false } +tracing = "0.1.37" +url = "2.3.1" + +[dev-dependencies] +binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader" } diff --git a/crates/binstalk-fetchers/LICENSE b/crates/binstalk-fetchers/LICENSE new file mode 100644 index 00000000..f288702d --- /dev/null +++ b/crates/binstalk-fetchers/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/crates/binstalk-fetchers/src/common.rs b/crates/binstalk-fetchers/src/common.rs new file mode 100644 index 00000000..c748b101 --- /dev/null +++ b/crates/binstalk-fetchers/src/common.rs @@ -0,0 +1,60 @@ +use std::sync::{ + atomic::{AtomicBool, Ordering::Relaxed}, + Once, +}; + +use binstalk_downloader::gh_api_client::{GhReleaseArtifact, HasReleaseArtifact}; +pub(super) use binstalk_downloader::{ + download::{Download, ExtractedFiles}, + gh_api_client::GhApiClient, + remote::{Client, Method, Url}, +}; +pub(super) use binstalk_types::cargo_toml_binstall::{PkgFmt, PkgMeta}; +pub(super) use compact_str::CompactString; +pub(super) use tokio::task::JoinHandle; +pub(super) use tracing::{debug, instrument, warn}; + +use crate::FetchError; + +/// This function returns a future where its size should be at most size of +/// 2-4 pointers. +pub(super) async fn does_url_exist( + client: Client, + gh_api_client: GhApiClient, + url: &Url, +) -> Result { + static GH_API_CLIENT_FAILED: AtomicBool = AtomicBool::new(false); + static WARN_RATE_LIMIT_ONCE: Once = Once::new(); + static WARN_UNAUTHORIZED_ONCE: Once = Once::new(); + + debug!("Checking for package at: '{url}'"); + + if !GH_API_CLIENT_FAILED.load(Relaxed) { + if let Some(artifact) = GhReleaseArtifact::try_extract_from_url(url) { + debug!("Using GitHub API to check for existence of artifact, which will also cache the API response"); + + // The future returned has the same size as a pointer + match gh_api_client.has_release_artifact(artifact).await? { + HasReleaseArtifact::Yes => return Ok(true), + HasReleaseArtifact::No | HasReleaseArtifact::NoSuchRelease => return Ok(false), + + HasReleaseArtifact::RateLimit { retry_after } => { + WARN_RATE_LIMIT_ONCE.call_once(|| { + warn!("Your GitHub API token (if any) has reached its rate limit and cannot be used again until {retry_after:?}, so we will fallback to HEAD/GET on the url."); + warn!("If you did not supply a github token, consider doing so: GitHub limits unauthorized users to 60 requests per hour per origin IP address."); + }); + } + HasReleaseArtifact::Unauthorized => { + WARN_UNAUTHORIZED_ONCE.call_once(|| { + warn!("GitHub API somehow requires a token for the API access, so we will fallback to HEAD/GET on the url."); + warn!("Please consider supplying a token to cargo-binstall to speedup resolution."); + }); + } + } + + GH_API_CLIENT_FAILED.store(true, Relaxed); + } + } + + Ok(Box::pin(client.remote_gettable(url.clone())).await?) +} diff --git a/crates/binstalk/src/helpers/futures_resolver.rs b/crates/binstalk-fetchers/src/futures_resolver.rs similarity index 100% rename from crates/binstalk/src/helpers/futures_resolver.rs rename to crates/binstalk-fetchers/src/futures_resolver.rs diff --git a/crates/binstalk/src/fetchers/gh_crate_meta.rs b/crates/binstalk-fetchers/src/gh_crate_meta.rs similarity index 84% rename from crates/binstalk/src/fetchers/gh_crate_meta.rs rename to crates/binstalk-fetchers/src/gh_crate_meta.rs index 33d732c2..9c0d949f 100644 --- a/crates/binstalk/src/fetchers/gh_crate_meta.rs +++ b/crates/binstalk-fetchers/src/gh_crate_meta.rs @@ -1,4 +1,4 @@ -use std::{borrow::Cow, iter, path::Path, sync::Arc}; +use std::{borrow::Cow, fmt, iter, marker::PhantomData, path::Path, sync::Arc}; use compact_str::{CompactString, ToCompactString}; use either::Either; @@ -9,34 +9,24 @@ use tracing::{debug, warn}; use url::Url; use crate::{ - errors::{BinstallError, InvalidPkgFmtError}, - helpers::{ - download::{Download, ExtractedFiles}, - futures_resolver::FuturesResolver, - gh_api_client::GhApiClient, - remote::{does_url_exist, Client}, - target_triple::TargetTriple, - tasks::AutoAbortJoinHandle, - }, - manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, + common::*, futures_resolver::FuturesResolver, Data, FetchError, InvalidPkgFmtError, RepoInfo, + TargetDataErased, }; -use super::{Data, RepoInfo, TargetData}; - pub(crate) mod hosting; pub struct GhCrateMeta { client: Client, gh_api_client: GhApiClient, data: Arc, - target_data: Arc, + target_data: Arc, resolution: OnceCell<(Url, PkgFmt)>, } impl GhCrateMeta { fn launch_baseline_find_tasks( &self, - futures_resolver: &FuturesResolver<(Url, PkgFmt), BinstallError>, + futures_resolver: &FuturesResolver<(Url, PkgFmt), FetchError>, pkg_fmt: PkgFmt, pkg_url: &Template<'_>, repo: Option<&str>, @@ -46,7 +36,7 @@ impl GhCrateMeta { let ctx = Context::from_data_with_repo( &self.data, &self.target_data.target, - &self.target_data.triple, + &self.target_data.target_related_info, ext, repo, subcrate, @@ -94,7 +84,7 @@ impl super::Fetcher for GhCrateMeta { client: Client, gh_api_client: GhApiClient, data: Arc, - target_data: Arc, + target_data: Arc, ) -> Arc { Arc::new(Self { client, @@ -105,8 +95,8 @@ impl super::Fetcher for GhCrateMeta { }) } - fn find(self: Arc) -> AutoAbortJoinHandle> { - AutoAbortJoinHandle::spawn(async move { + fn find(self: Arc) -> JoinHandle> { + tokio::spawn(async move { let info = self.data.get_repo_info(&self.client).await?.as_ref(); let repo = info.map(|info| &info.repo); @@ -137,9 +127,11 @@ impl super::Fetcher for GhCrateMeta { return Err(InvalidPkgFmtError { crate_name: crate_name.clone(), version: version.clone(), - target: target.clone(), - pkg_url: pkg_url.to_string(), - reason: "pkg-fmt is not specified, yet pkg-url does not contain format, archive-format or archive-suffix which is required for automatically deducing pkg-fmt", + target: target.into(), + pkg_url: pkg_url.into(), + reason: + &"pkg-fmt is not specified, yet pkg-url does not contain format, \ +archive-format or archive-suffix which is required for automatically deducing pkg-fmt", } .into()); } @@ -230,7 +222,7 @@ impl super::Fetcher for GhCrateMeta { }) } - async fn fetch_and_extract(&self, dst: &Path) -> Result { + async fn fetch_and_extract(&self, dst: &Path) -> Result { let (url, pkg_fmt) = self.resolution.get().unwrap(); // find() is called first debug!( "Downloading package from: '{url}' dst:{} fmt:{pkg_fmt:?}", @@ -278,31 +270,74 @@ impl super::Fetcher for GhCrateMeta { &self.target_data.target } - fn target_data(&self) -> &Arc { + fn target_data(&self) -> &Arc { &self.target_data } } /// Template for constructing download paths -#[derive(Clone, Debug)] +#[derive(Clone)] struct Context<'c> { - pub name: &'c str, - pub repo: Option<&'c str>, - pub target: &'c str, - pub version: &'c str, + name: &'c str, + repo: Option<&'c str>, + target: &'c str, + version: &'c str, /// Archive format e.g. tar.gz, zip - pub archive_format: Option<&'c str>, + archive_format: Option<&'c str>, - pub archive_suffix: Option<&'c str>, + archive_suffix: Option<&'c str>, /// Filename extension on the binary, i.e. .exe on Windows, nothing otherwise - pub binary_ext: &'c str, + binary_ext: &'c str, /// Workspace of the crate inside the repository. - pub subcrate: Option<&'c str>, + subcrate: Option<&'c str>, - pub triple: &'c TargetTriple, + target_related_info: &'c dyn leon::Values, +} + +impl fmt::Debug for Context<'_> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + #[allow(dead_code)] + #[derive(Debug)] + struct Context<'c> { + name: &'c str, + repo: Option<&'c str>, + target: &'c str, + version: &'c str, + + archive_format: Option<&'c str>, + + archive_suffix: Option<&'c str>, + + binary_ext: &'c str, + + subcrate: Option<&'c str>, + + target_related_info: PhantomData<&'c dyn leon::Values>, + } + + fmt::Debug::fmt( + &Context { + name: self.name, + repo: self.repo, + target: self.target, + version: self.version, + + archive_format: self.archive_format, + + archive_suffix: self.archive_suffix, + + binary_ext: self.binary_ext, + + subcrate: self.subcrate, + + target_related_info: PhantomData, + }, + f, + ) + } } impl leon::Values for Context<'_> { @@ -324,7 +359,7 @@ impl leon::Values for Context<'_> { "subcrate" => self.subcrate.map(Cow::Borrowed), - key => self.triple.get_value(key), + key => self.target_related_info.get_value(key), } } } @@ -333,7 +368,7 @@ impl<'c> Context<'c> { fn from_data_with_repo( data: &'c Data, target: &'c str, - triple: &'c TargetTriple, + target_related_info: &'c dyn leon::Values, archive_suffix: Option<&'c str>, repo: Option<&'c str>, subcrate: Option<&'c str>, @@ -364,22 +399,19 @@ impl<'c> Context<'c> { }, subcrate, - triple, + target_related_info, } } /// * `tt` - must have added a template named "pkg_url". - pub(self) fn render_url_with_compiled_tt( - &self, - tt: &Template<'_>, - ) -> Result { + fn render_url_with_compiled_tt(&self, tt: &Template<'_>) -> Result { debug!("Render {tt:#?} using context: {self:?}"); Ok(Url::parse(&tt.render(self)?)?) } #[cfg(test)] - pub(self) fn render_url(&self, template: &str) -> Result { + fn render_url(&self, template: &str) -> Result { debug!("Render {template} using context in render_url: {self:?}"); let tt = Template::parse(template)?; @@ -389,10 +421,7 @@ impl<'c> Context<'c> { #[cfg(test)] mod test { - - use std::str::FromStr; - - use super::{super::Data, Context, TargetTriple}; + use super::{super::Data, Context}; use compact_str::ToCompactString; use url::Url; @@ -405,12 +434,14 @@ mod test { template: &str, expected_url: &str, ) { - let triple = &TargetTriple::from_str(target).unwrap(); + // The template provided doesn't need this, so just returning None + // is OK. + let target_info = leon::vals(|_| None); let ctx = Context::from_data_with_repo( data, target, - triple, + &target_info, Some(archive_format), data.repo.as_deref(), None, diff --git a/crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs b/crates/binstalk-fetchers/src/gh_crate_meta/hosting.rs similarity index 100% rename from crates/binstalk/src/fetchers/gh_crate_meta/hosting.rs rename to crates/binstalk-fetchers/src/gh_crate_meta/hosting.rs diff --git a/crates/binstalk/src/fetchers.rs b/crates/binstalk-fetchers/src/lib.rs similarity index 79% rename from crates/binstalk/src/fetchers.rs rename to crates/binstalk-fetchers/src/lib.rs index aaf0e5ac..12396579 100644 --- a/crates/binstalk/src/fetchers.rs +++ b/crates/binstalk-fetchers/src/lib.rs @@ -1,26 +1,72 @@ use std::{path::Path, sync::Arc}; -use compact_str::CompactString; -pub use gh_crate_meta::*; -pub use quickinstall::*; -use tokio::sync::OnceCell; -use tracing::{debug, instrument}; -use url::Url; - -use crate::{ - errors::BinstallError, - helpers::{ - download::ExtractedFiles, gh_api_client::GhApiClient, remote::Client, - target_triple::TargetTriple, tasks::AutoAbortJoinHandle, - }, - manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, +use binstalk_downloader::{ + download::DownloadError, gh_api_client::GhApiError, remote::Error as RemoteError, }; +use thiserror::Error as ThisError; +use tokio::sync::OnceCell; +pub use url::ParseError as UrlParseError; -pub(crate) mod gh_crate_meta; -pub(crate) mod quickinstall; +mod gh_crate_meta; +pub use gh_crate_meta::*; + +mod quickinstall; +pub use quickinstall::*; + +mod common; +use common::*; + +mod futures_resolver; use gh_crate_meta::hosting::RepositoryHost; +#[derive(Debug, ThisError)] +#[error("Invalid pkg-url {pkg_url} for {crate_name}@{version} on {target}: {reason}")] +pub struct InvalidPkgFmtError { + pub crate_name: CompactString, + pub version: CompactString, + pub target: CompactString, + pub pkg_url: Box, + pub reason: &'static &'static str, +} + +#[derive(Debug, ThisError, miette::Diagnostic)] +#[non_exhaustive] +#[cfg_attr(feature = "miette", derive(miette::Diagnostic))] +pub enum FetchError { + #[error(transparent)] + Download(#[from] DownloadError), + + #[error("Failed to parse template: {0}")] + #[diagnostic(transparent)] + TemplateParse(#[from] leon::ParseError), + + #[error("Failed to render template: {0}")] + #[diagnostic(transparent)] + TemplateRender(#[from] leon::RenderError), + + #[error("Failed to render template: {0}")] + GhApi(#[from] GhApiError), + + #[error(transparent)] + InvalidPkgFmt(Box), + + #[error("Failed to parse url: {0}")] + UrlParse(#[from] UrlParseError), +} + +impl From for FetchError { + fn from(e: RemoteError) -> Self { + DownloadError::from(e).into() + } +} + +impl From for FetchError { + fn from(e: InvalidPkgFmtError) -> Self { + Self::InvalidPkgFmt(Box::new(e)) + } +} + #[async_trait::async_trait] pub trait Fetcher: Send + Sync { /// Create a new fetcher from some data @@ -29,13 +75,13 @@ pub trait Fetcher: Send + Sync { client: Client, gh_api_client: GhApiClient, data: Arc, - target_data: Arc, + target_data: Arc, ) -> Arc where Self: Sized; /// Fetch a package and extract - async fn fetch_and_extract(&self, dst: &Path) -> Result; + async fn fetch_and_extract(&self, dst: &Path) -> Result; /// Find the package, if it is available for download /// @@ -45,7 +91,7 @@ pub trait Fetcher: Send + Sync { /// /// Must return `true` if a package is available, `false` if none is, and reserve errors to /// fatal conditions only. - fn find(self: Arc) -> AutoAbortJoinHandle>; + fn find(self: Arc) -> JoinHandle>; /// Report to upstream that cargo-binstall tries to use this fetcher. /// Currently it is only overriden by [`quickinstall::QuickInstall`]. @@ -73,7 +119,7 @@ pub trait Fetcher: Send + Sync { /// Return the target for this fetcher fn target(&self) -> &str; - fn target_data(&self) -> &Arc; + fn target_data(&self) -> &Arc; } #[derive(Clone, Debug)] @@ -103,7 +149,7 @@ impl Data { } #[instrument(level = "debug")] - async fn get_repo_info(&self, client: &Client) -> Result<&Option, BinstallError> { + async fn get_repo_info(&self, client: &Client) -> Result<&Option, FetchError> { self.repo_info .get_or_try_init(move || { Box::pin(async move { @@ -194,12 +240,19 @@ impl RepoInfo { /// Target specific data required to fetch a package #[derive(Clone, Debug)] -pub struct TargetData { +pub struct TargetData { pub target: String, - pub triple: TargetTriple, pub meta: PkgMeta, + /// More target related info, it's recommend to provide the following keys: + /// - target_family, + /// - target_arch + /// - target_libc + /// - target_vendor + pub target_related_info: T, } +pub type TargetDataErased = TargetData; + #[cfg(test)] mod test { use super::*; diff --git a/crates/binstalk/src/fetchers/quickinstall.rs b/crates/binstalk-fetchers/src/quickinstall.rs similarity index 88% rename from crates/binstalk/src/fetchers/quickinstall.rs rename to crates/binstalk-fetchers/src/quickinstall.rs index 157ae679..f0ffae25 100644 --- a/crates/binstalk/src/fetchers/quickinstall.rs +++ b/crates/binstalk-fetchers/src/quickinstall.rs @@ -1,23 +1,10 @@ use std::{path::Path, sync::Arc}; -use compact_str::CompactString; +use binstalk_types::cargo_toml_binstall::{PkgFmt, PkgMeta}; use tokio::sync::OnceCell; -use tracing::{debug, warn}; use url::Url; -use crate::{ - errors::BinstallError, - helpers::{ - download::{Download, ExtractedFiles}, - gh_api_client::GhApiClient, - is_universal_macos, - remote::{does_url_exist, Client, Method}, - tasks::AutoAbortJoinHandle, - }, - manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, -}; - -use super::{Data, TargetData}; +use crate::{common::*, Data, FetchError, TargetDataErased}; const BASE_URL: &str = "https://github.com/cargo-bins/cargo-quickinstall/releases/download"; const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; @@ -25,9 +12,13 @@ const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; const QUICKINSTALL_SUPPORTED_TARGETS_URL: &str = "https://raw.githubusercontent.com/cargo-bins/cargo-quickinstall/main/supported-targets"; +fn is_universal_macos(target: &str) -> bool { + ["universal-apple-darwin", "universal2-apple-darwin"].contains(&target) +} + async fn get_quickinstall_supported_targets( client: &Client, -) -> Result<&'static [CompactString], BinstallError> { +) -> Result<&'static [CompactString], FetchError> { static SUPPORTED_TARGETS: OnceCell> = OnceCell::const_new(); SUPPORTED_TARGETS @@ -60,11 +51,11 @@ pub struct QuickInstall { package_url: Url, stats_url: Url, - target_data: Arc, + target_data: Arc, } impl QuickInstall { - async fn is_supported(&self) -> Result { + async fn is_supported(&self) -> Result { self.is_supported_v .get_or_try_init(|| async { Ok(get_quickinstall_supported_targets(&self.client) @@ -83,7 +74,7 @@ impl super::Fetcher for QuickInstall { client: Client, gh_api_client: GhApiClient, data: Arc, - target_data: Arc, + target_data: Arc, ) -> Arc { let crate_name = &data.name; let version = &data.version; @@ -108,8 +99,8 @@ impl super::Fetcher for QuickInstall { }) } - fn find(self: Arc) -> AutoAbortJoinHandle> { - AutoAbortJoinHandle::spawn(async move { + fn find(self: Arc) -> JoinHandle> { + tokio::spawn(async move { if !self.is_supported().await? { return Ok(false); } @@ -145,7 +136,7 @@ by rust officially."#, } } - async fn fetch_and_extract(&self, dst: &Path) -> Result { + async fn fetch_and_extract(&self, dst: &Path) -> Result { let url = &self.package_url; debug!("Downloading package from: '{url}'"); Ok(Download::new(self.client.clone(), url.clone()) @@ -180,13 +171,13 @@ by rust officially."#, &self.target_data.target } - fn target_data(&self) -> &Arc { + fn target_data(&self) -> &Arc { &self.target_data } } impl QuickInstall { - pub async fn report(&self) -> Result<(), BinstallError> { + pub async fn report(&self) -> Result<(), FetchError> { if !self.is_supported().await? { debug!( "Not sending quickinstall report for {} since Quickinstall does not support these targets.", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 2e70281e..26413227 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -10,9 +10,9 @@ edition = "2021" license = "GPL-3.0-only" [dependencies] -async-trait = "0.1.68" atomic-file-install = { version = "0.0.0", path = "../atomic-file-install" } binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-fetchers = { version = "0.0.0", path = "../binstalk-fetchers" } binstalk-registry = { version = "0.0.0", path = "../binstalk-registry" } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "0.0.0", path = "../cargo-toml-workspace" } @@ -24,11 +24,9 @@ home = "0.5.5" itertools = "0.11.0" jobslot = { version = "0.2.11", features = ["tokio"] } leon = { version = "2.0.1", path = "../leon" } -leon-macros = { version = "1.0.0", path = "../leon-macros" } maybe-owned = "0.3.4" miette = "5.9.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } -once_cell = "1.18.0" semver = { version = "1.0.17", features = ["serde"] } strum = "0.25.0" target-lexicon = { version = "0.12.11", features = ["std"] } diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk/src/bins.rs index 980069f2..5136552c 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk/src/bins.rs @@ -15,7 +15,7 @@ use crate::{ atomic_install, atomic_install_noclobber, atomic_symlink_file, atomic_symlink_file_noclobber, }, - helpers::{download::ExtractedFiles, target_triple::TargetTriple}, + helpers::download::ExtractedFiles, manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, }; @@ -99,7 +99,7 @@ impl BinFile { bin: base_name, binary_ext, - triple: data.triple, + target_related_info: data.target_related_info, }; let (source, archive_source_path) = if data.meta.pkg_fmt == Some(PkgFmt::Bin) { @@ -273,21 +273,26 @@ pub struct Data<'a> { pub meta: PkgMeta, pub bin_path: &'a Path, pub install_path: &'a Path, - pub triple: &'a TargetTriple, + /// More target related info, it's recommend to provide the following keys: + /// - target_family, + /// - target_arch + /// - target_libc + /// - target_vendor + pub target_related_info: &'a dyn leon::Values, } -#[derive(Clone, Debug)] +#[derive(Clone)] struct Context<'c> { - pub name: &'c str, - pub repo: Option<&'c str>, - pub target: &'c str, - pub version: &'c str, - pub bin: &'c str, + name: &'c str, + repo: Option<&'c str>, + target: &'c str, + version: &'c str, + bin: &'c str, /// Filename extension on the binary, i.e. .exe on Windows, nothing otherwise - pub binary_ext: &'c str, + binary_ext: &'c str, - pub triple: &'c TargetTriple, + target_related_info: &'c dyn leon::Values, } impl leon::Values for Context<'_> { @@ -302,7 +307,7 @@ impl leon::Values for Context<'_> { // Soft-deprecated alias for binary-ext "format" => Some(Cow::Borrowed(self.binary_ext)), - key => self.triple.get_value(key), + key => self.target_related_info.get_value(key), } } } diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index db2e19cd..750e6507 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -7,6 +7,7 @@ use std::{ use binstalk_downloader::{ download::DownloadError, gh_api_client::GhApiError, remote::Error as RemoteError, }; +use binstalk_fetchers::FetchError; use compact_str::CompactString; use miette::{Diagnostic, Report}; use target_lexicon::ParseError as TargetTripleParseError; @@ -94,6 +95,16 @@ pub enum BinstallError { leon::ParseError, ), + /// Failed to fetch pre-built binaries. + /// + /// - Code: `binstall::fetch` + /// - Exit: 68 + #[error(transparent)] + #[diagnostic(severity(error), code(binstall::fetch))] + #[source_code(transparent)] + #[label(transparent)] + FetchError(Box), + /// Failed to render template. /// /// - Code: `binstall::template` @@ -352,6 +363,7 @@ impl BinstallError { UserAbort => 32, UrlParse(_) => 65, TemplateParseError(..) => 67, + FetchError(..) => 68, TemplateRenderError(..) => 69, Download(_) => 68, SubProcess { .. } => 70, @@ -494,3 +506,9 @@ impl From for BinstallError { BinstallError::LoadManifestFromWSError(Box::new(e)) } } + +impl From for BinstallError { + fn from(e: FetchError) -> Self { + BinstallError::FetchError(Box::new(e)) + } +} diff --git a/crates/binstalk/src/helpers.rs b/crates/binstalk/src/helpers.rs index bbe9411e..019fd7a9 100644 --- a/crates/binstalk/src/helpers.rs +++ b/crates/binstalk/src/helpers.rs @@ -1,4 +1,3 @@ -pub(crate) mod futures_resolver; pub mod jobserver_client; pub mod remote; pub(crate) mod target_triple; diff --git a/crates/binstalk/src/helpers/tasks.rs b/crates/binstalk/src/helpers/tasks.rs index 47bee796..6530c444 100644 --- a/crates/binstalk/src/helpers/tasks.rs +++ b/crates/binstalk/src/helpers/tasks.rs @@ -60,8 +60,11 @@ impl Future for AutoAbortJoinHandle { } } -impl AutoAbortJoinHandle> { +impl AutoAbortJoinHandle> +where + E: Into, +{ pub async fn flattened_join(self) -> Result { - self.await? + self.await?.map_err(Into::into) } } diff --git a/crates/binstalk/src/lib.rs b/crates/binstalk/src/lib.rs index c3b467ff..295e6bfd 100644 --- a/crates/binstalk/src/lib.rs +++ b/crates/binstalk/src/lib.rs @@ -2,11 +2,11 @@ mod bins; pub mod errors; -pub mod fetchers; pub mod helpers; pub mod ops; use atomic_file_install as fs; +pub use binstalk_fetchers as fetchers; pub use binstalk_registry as registry; pub use binstalk_types as manifests; pub use detect_targets::{get_desired_targets, DesiredTargets, TARGET}; diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index d996e4d0..eb75b724 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -5,7 +5,7 @@ use std::{path::PathBuf, sync::Arc}; use semver::VersionReq; use crate::{ - fetchers::{Data, Fetcher, TargetData}, + fetchers::{Data, Fetcher, TargetDataErased}, helpers::{ self, gh_api_client::GhApiClient, jobserver_client::LazyJobserverClient, remote::Client, }, @@ -16,7 +16,7 @@ use crate::{ pub mod resolve; -pub type Resolver = fn(Client, GhApiClient, Arc, Arc) -> Arc; +pub type Resolver = fn(Client, GhApiClient, Arc, Arc) -> Arc; #[non_exhaustive] pub enum CargoTomlFetchOverride { diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index fdf3414a..d6c73149 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -23,6 +23,7 @@ use crate::{ helpers::{ self, cargo_toml::Manifest, cargo_toml_workspace::load_manifest_from_workspace, download::ExtractedFiles, remote::Client, target_triple::TargetTriple, + tasks::AutoAbortJoinHandle, }, manifests::cargo_toml_binstall::{Meta, PkgMeta, PkgOverride}, ops::{CargoTomlFetchOverride, Options}, @@ -111,8 +112,8 @@ async fn resolve_inner( Arc::new(TargetData { target: target.clone(), - triple, meta: target_meta, + target_related_info: triple, }) }) .cartesian_product(resolvers) @@ -123,7 +124,7 @@ async fn resolve_inner( data.clone(), target_data, ); - (fetcher.clone(), fetcher.find()) + (fetcher.clone(), AutoAbortJoinHandle::new(fetcher.find())) }), ); @@ -305,7 +306,7 @@ fn collect_bin_files( meta, bin_path, install_path, - triple: &fetcher.target_data().triple, + target_related_info: &fetcher.target_data().target_related_info, }; let bin_dir = bin_data From 0c5a65fb3583d601cf727403bd7b8ab4f9c1eb99 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 16 Aug 2023 07:48:42 +1000 Subject: [PATCH 1437/2020] Refactor: Extract new crate `binstalk-bins` (#1294) To reduce `binstalk` codegen and enable reuse of it. Signed-off-by: Jiahao XU --- Cargo.lock | 19 ++++- Cargo.toml | 1 + crates/bin/Cargo.toml | 1 + crates/bin/src/entry.rs | 2 +- crates/bin/src/logging.rs | 1 + crates/binstalk-bins/Cargo.toml | 21 +++++ .../src/bins.rs => binstalk-bins/src/lib.rs} | 76 ++++++++++++------- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 4 +- crates/binstalk/src/errors.rs | 53 +++---------- crates/binstalk/src/lib.rs | 4 +- crates/binstalk/src/ops/resolve.rs | 11 ++- crates/binstalk/src/ops/resolve/resolution.rs | 2 +- e2e-tests/no-track.sh | 4 +- 14 files changed, 114 insertions(+), 87 deletions(-) create mode 100644 crates/binstalk-bins/Cargo.toml rename crates/{binstalk/src/bins.rs => binstalk-bins/src/lib.rs} (82%) diff --git a/Cargo.lock b/Cargo.lock index e90cf835..dc483cb3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -244,7 +244,7 @@ dependencies = [ name = "binstalk" version = "0.15.0" dependencies = [ - "atomic-file-install", + "binstalk-bins", "binstalk-downloader", "binstalk-fetchers", "binstalk-registry", @@ -254,13 +254,11 @@ dependencies = [ "compact_str", "detect-targets", "either", - "home", "itertools", "jobslot", "leon", "maybe-owned", "miette", - "normalize-path", "semver", "strum", "target-lexicon", @@ -271,6 +269,20 @@ dependencies = [ "url", ] +[[package]] +name = "binstalk-bins" +version = "0.0.0" +dependencies = [ + "atomic-file-install", + "binstalk-types", + "compact_str", + "leon", + "miette", + "normalize-path", + "thiserror", + "tracing", +] + [[package]] name = "binstalk-downloader" version = "0.7.0" @@ -520,6 +532,7 @@ dependencies = [ "file-format", "fs-lock", "gh-token", + "home", "log", "miette", "mimalloc", diff --git a/Cargo.toml b/Cargo.toml index 03fee99c..db25c340 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ members = [ "crates/atomic-file-install", "crates/bin", "crates/binstalk", + "crates/binstalk-bins", "crates/binstalk-fetchers", "crates/binstalk-registry", "crates/binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index f0e945f8..03e6e4fe 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -30,6 +30,7 @@ dirs = "5.0.1" file-format = { version = "0.18.0", default-features = false } fs-lock = { version = "0.1.0", path = "../fs-lock" } gh-token = "0.1.2" +home = "0.5.5" log = { version = "0.4.18", features = ["std"] } miette = "5.9.0" mimalloc = { version = "0.1.37", default-features = false, optional = true } diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 78d7a6af..6aec09f5 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -15,7 +15,6 @@ use binstalk::{ remote::{Certificate, Client}, tasks::AutoAbortJoinHandle, }, - home::cargo_home, ops::{ self, resolve::{CrateName, Resolution, ResolutionFetch, VersionReqExt}, @@ -25,6 +24,7 @@ use binstalk::{ use binstalk_manifests::cargo_config::Config; use binstalk_manifests::cargo_toml_binstall::PkgOverride; use file_format::FileFormat; +use home::cargo_home; use log::LevelFilter; use miette::{miette, Result, WrapErr}; use tokio::task::block_in_place; diff --git a/crates/bin/src/logging.rs b/crates/bin/src/logging.rs index 2b5e4dbd..3033266b 100644 --- a/crates/bin/src/logging.rs +++ b/crates/bin/src/logging.rs @@ -196,6 +196,7 @@ pub fn logging(log_level: LevelFilter, json_output: bool) { let allowed_targets = (log_level != LevelFilter::Trace).then_some([ "atomic_file_install", "binstalk", + "binstalk_bins", "binstalk_downloader", "binstalk_fetchers", "binstalk_registry", diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml new file mode 100644 index 00000000..12d6d558 --- /dev/null +++ b/crates/binstalk-bins/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "binstalk-bins" +version = "0.0.0" +edition = "2021" + +description = "The binstall binaries discovery and installation crate." +repository = "https://github.com/cargo-bins/cargo-binstall" +documentation = "https://docs.rs/binstalk-bins" +rust-version = "1.65.0" +authors = ["Jiahao XU "] +license = "GPL-3.0-only" + +[dependencies] +atomic-file-install = { version = "0.0.0", path = "../atomic-file-install" } +binstalk-types = { version = "0.5.0", path = "../binstalk-types" } +compact_str = { version = "0.7.0", features = ["serde"] } +leon = { version = "2.0.1", path = "../leon" } +miette = "5.9.0" +normalize-path = { version = "0.2.1", path = "../normalize-path" } +thiserror = "1.0.40" +tracing = "0.1.37" diff --git a/crates/binstalk/src/bins.rs b/crates/binstalk-bins/src/lib.rs similarity index 82% rename from crates/binstalk/src/bins.rs rename to crates/binstalk-bins/src/lib.rs index 5136552c..2b99ad64 100644 --- a/crates/binstalk/src/bins.rs +++ b/crates/binstalk-bins/src/lib.rs @@ -1,23 +1,44 @@ use std::{ borrow::Cow, - fmt, + fmt, io, path::{self, Component, Path, PathBuf}, }; +use atomic_file_install::{ + atomic_install, atomic_install_noclobber, atomic_symlink_file, atomic_symlink_file_noclobber, +}; +use binstalk_types::cargo_toml_binstall::{PkgFmt, PkgMeta}; use compact_str::{format_compact, CompactString}; use leon::Template; +use miette::Diagnostic; use normalize_path::NormalizePath; +use thiserror::Error as ThisError; use tracing::debug; -use crate::{ - errors::BinstallError, - fs::{ - atomic_install, atomic_install_noclobber, atomic_symlink_file, - atomic_symlink_file_noclobber, - }, - helpers::download::ExtractedFiles, - manifests::cargo_toml_binstall::{PkgFmt, PkgMeta}, -}; +#[derive(Debug, ThisError, Diagnostic)] +pub enum Error { + /// bin-dir configuration provided generates source path outside + /// of the temporary dir. + #[error( + "bin-dir configuration provided generates source path outside of the temporary dir: {}", .0.display() + )] + InvalidSourceFilePath(Box), + + /// bin-dir configuration provided generates empty source path. + #[error("bin-dir configuration provided generates empty source path")] + EmptySourceFilePath, + + /// Bin file is not found. + #[error("bin file {} not found", .0.display())] + BinFileNotFound(Box), + + #[error(transparent)] + Io(#[from] io::Error), + + #[error("Failed to render template: {0}")] + #[diagnostic(transparent)] + TemplateRender(#[from] leon::RenderError), +} /// Return true if the path does not look outside of current dir /// @@ -33,7 +54,10 @@ fn is_valid_path(path: &Path) -> bool { /// Must be called after the archive is downloaded and extracted. /// This function might uses blocking I/O. -pub fn infer_bin_dir_template(data: &Data, extracted_files: &ExtractedFiles) -> Cow<'static, str> { +pub fn infer_bin_dir_template( + data: &Data, + has_dir: &mut dyn FnMut(&Path) -> bool, +) -> Cow<'static, str> { let name = data.name; let target = data.target; let version = data.version; @@ -58,7 +82,7 @@ pub fn infer_bin_dir_template(data: &Data, extracted_files: &ExtractedFiles) -> gen_possible_dirs .into_iter() .map(|gen_possible_dir| gen_possible_dir(name, target, version)) - .find(|dirname| extracted_files.get_dir(Path::new(&dirname)).is_some()) + .find(|dirname| has_dir(Path::new(&dirname))) .map(|mut dir| { dir.reserve_exact(1 + default_bin_dir_template.len()); dir += "/"; @@ -84,7 +108,7 @@ impl BinFile { base_name: &str, tt: &Template<'_>, no_symlinks: bool, - ) -> Result { + ) -> Result { let binary_ext = if data.target.contains("windows") { ".exe" } else { @@ -115,13 +139,11 @@ impl BinFile { let path_normalized = Path::new(&path).normalize(); if path_normalized.components().next().is_none() { - return Err(BinstallError::EmptySourceFilePath); + return Err(Error::EmptySourceFilePath); } if !is_valid_path(&path_normalized) { - return Err(BinstallError::InvalidSourceFilePath { - path: path_normalized, - }); + return Err(Error::InvalidSourceFilePath(path_normalized.into())); } (data.bin_path.join(&path_normalized), path_normalized) @@ -176,18 +198,18 @@ impl BinFile { /// Return `Ok` if the source exists, otherwise `Err`. pub fn check_source_exists( &self, - extracted_files: &ExtractedFiles, - ) -> Result<(), BinstallError> { - if extracted_files.has_file(&self.archive_source_path) { + has_file: &mut dyn FnMut(&Path) -> bool, + ) -> Result<(), Error> { + if has_file(&self.archive_source_path) { Ok(()) } else { - Err(BinstallError::BinFileNotFound(self.source.clone())) + Err(Error::BinFileNotFound((&*self.source).into())) } } - fn pre_install_bin(&self) -> Result<(), BinstallError> { + fn pre_install_bin(&self) -> Result<(), Error> { if !self.source.try_exists()? { - return Err(BinstallError::BinFileNotFound(self.source.clone())); + return Err(Error::BinFileNotFound((&*self.source).into())); } #[cfg(unix)] @@ -199,7 +221,7 @@ impl BinFile { Ok(()) } - pub fn install_bin(&self) -> Result<(), BinstallError> { + pub fn install_bin(&self) -> Result<(), Error> { self.pre_install_bin()?; debug!( @@ -213,7 +235,7 @@ impl BinFile { Ok(()) } - pub fn install_bin_noclobber(&self) -> Result<(), BinstallError> { + pub fn install_bin_noclobber(&self) -> Result<(), Error> { self.pre_install_bin()?; debug!( @@ -227,7 +249,7 @@ impl BinFile { Ok(()) } - pub fn install_link(&self) -> Result<(), BinstallError> { + pub fn install_link(&self) -> Result<(), Error> { if let Some(link) = &self.link { let dest = self.link_dest(); debug!( @@ -241,7 +263,7 @@ impl BinFile { Ok(()) } - pub fn install_link_noclobber(&self) -> Result<(), BinstallError> { + pub fn install_link_noclobber(&self) -> Result<(), Error> { if let Some(link) = &self.link { let dest = self.link_dest(); debug!( diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 89f26da6..1401dba0 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -17,7 +17,7 @@ binstalk-types = { version = "0.5.0", path = "../binstalk-types" } compact_str = { version = "0.7.0" } either = "1.8.1" itertools = "0.11.0" -leon = { version = "2.0.1", path = "../leon", features = ["miette"] } +leon = { version = "2.0.1", path = "../leon" } leon-macros = { version = "1.0.0", path = "../leon-macros" } miette = "5.9.0" once_cell = "1.18.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 26413227..91c08ee1 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0-only" [dependencies] -atomic-file-install = { version = "0.0.0", path = "../atomic-file-install" } +binstalk-bins = { version = "0.0.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.0.0", path = "../binstalk-fetchers" } binstalk-registry = { version = "0.0.0", path = "../binstalk-registry" } @@ -20,13 +20,11 @@ command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.10", path = "../detect-targets" } either = "1.8.1" -home = "0.5.5" itertools = "0.11.0" jobslot = { version = "0.2.11", features = ["tokio"] } leon = { version = "2.0.1", path = "../leon" } maybe-owned = "0.3.4" miette = "5.9.0" -normalize-path = { version = "0.2.1", path = "../normalize-path" } semver = { version = "1.0.17", features = ["serde"] } strum = "0.25.0" target-lexicon = { version = "0.12.11", features = ["std"] } diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index 750e6507..3e56b122 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -16,6 +16,7 @@ use tokio::task; use tracing::{error, warn}; use crate::{ + bins, helpers::{ cargo_toml::Error as CargoTomlError, cargo_toml_workspace::Error as LoadManifestFromWSError, }, @@ -105,20 +106,6 @@ pub enum BinstallError { #[label(transparent)] FetchError(Box), - /// Failed to render template. - /// - /// - Code: `binstall::template` - /// - Exit: 69 - #[error("Failed to render template: {0}")] - #[diagnostic(severity(error), code(binstall::template))] - #[source_code(transparent)] - #[label(transparent)] - TemplateRenderError( - #[from] - #[diagnostic_source] - leon::RenderError, - ), - /// Failed to download or failed to decode the body. /// /// - Code: `binstall::download` @@ -257,13 +244,17 @@ pub enum BinstallError { )] NoViableTargets, - /// Bin file is not found. + /// Failed to find or install binaries. /// - /// - Code: `binstall::binfile` + /// - Code: `binstall::bins` /// - Exit: 88 - #[error("bin file {0} not found")] - #[diagnostic(severity(error), code(binstall::binfile))] - BinFileNotFound(PathBuf), + #[error("failed to find or install binaries: {0}")] + #[diagnostic( + severity(error), + code(binstall::targets::none_host), + help("Try to specify --target") + )] + BinFile(#[from] bins::Error), /// `Cargo.toml` of the crate does not have section "Package". /// @@ -281,25 +272,6 @@ pub enum BinstallError { #[diagnostic(severity(error), code(binstall::SourceFilePath))] DuplicateSourceFilePath { path: PathBuf }, - /// bin-dir configuration provided generates source path outside - /// of the temporary dir. - /// - /// - Code: `binstall::cargo_manifest` - /// - Exit: 91 - #[error( - "bin-dir configuration provided generates source path outside of the temporary dir: {path}" - )] - #[diagnostic(severity(error), code(binstall::SourceFilePath))] - InvalidSourceFilePath { path: PathBuf }, - - /// bin-dir configuration provided generates empty source path. - /// - /// - Code: `binstall::cargo_manifest` - /// - Exit: 92 - #[error("bin-dir configuration provided generates empty source path")] - #[diagnostic(severity(error), code(binstall::SourceFilePath))] - EmptySourceFilePath, - /// Fallback to `cargo-install` is disabled. /// /// - Code: `binstall::no_fallback_to_cargo_install` @@ -364,7 +336,6 @@ impl BinstallError { UrlParse(_) => 65, TemplateParseError(..) => 67, FetchError(..) => 68, - TemplateRenderError(..) => 69, Download(_) => 68, SubProcess { .. } => 70, Io(_) => 74, @@ -377,11 +348,9 @@ impl BinstallError { SuperfluousVersionOption => 84, UnspecifiedBinaries => 86, NoViableTargets => 87, - BinFileNotFound(_) => 88, + BinFile(_) => 88, CargoTomlMissingPackage(_) => 89, DuplicateSourceFilePath { .. } => 90, - InvalidSourceFilePath { .. } => 91, - EmptySourceFilePath => 92, NoFallbackToCargoInstall => 94, InvalidPkgFmt(..) => 95, GhApiErr(..) => 96, diff --git a/crates/binstalk/src/lib.rs b/crates/binstalk/src/lib.rs index 295e6bfd..1aa934df 100644 --- a/crates/binstalk/src/lib.rs +++ b/crates/binstalk/src/lib.rs @@ -1,13 +1,11 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] -mod bins; pub mod errors; pub mod helpers; pub mod ops; -use atomic_file_install as fs; +use binstalk_bins as bins; pub use binstalk_fetchers as fetchers; pub use binstalk_registry as registry; pub use binstalk_types as manifests; pub use detect_targets::{get_desired_targets, DesiredTargets, TARGET}; -pub use home; diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index d6c73149..1261574a 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -261,7 +261,7 @@ async fn download_extract_and_verify( .iter() .zip(bin_files) .filter_map(|(bin, bin_file)| { - match bin_file.check_source_exists(&extracted_files) { + match bin_file.check_source_exists(&mut |p| extracted_files.has_file(p)) { Ok(()) => Some(Ok(bin_file)), // This binary is optional @@ -284,7 +284,8 @@ async fn download_extract_and_verify( } } }) - .collect::, BinstallError>>() + .collect::, bins::Error>>() + .map_err(BinstallError::from) } fn collect_bin_files( @@ -314,7 +315,9 @@ fn collect_bin_files( .bin_dir .as_deref() .map(Cow::Borrowed) - .unwrap_or_else(|| bins::infer_bin_dir_template(&bin_data, extracted_files)); + .unwrap_or_else(|| { + bins::infer_bin_dir_template(&bin_data, &mut |p| extracted_files.get_dir(p).is_some()) + }); let template = Template::parse(&bin_dir)?; @@ -323,7 +326,7 @@ fn collect_bin_files( .binaries .iter() .map(|bin| bins::BinFile::new(&bin_data, bin.name.as_str(), &template, no_symlinks)) - .collect::, BinstallError>>()?; + .collect::, bins::Error>>()?; let mut source_set = BTreeSet::new(); diff --git a/crates/binstalk/src/ops/resolve/resolution.rs b/crates/binstalk/src/ops/resolve/resolution.rs index 968c7403..5125a343 100644 --- a/crates/binstalk/src/ops/resolve/resolution.rs +++ b/crates/binstalk/src/ops/resolve/resolution.rs @@ -51,7 +51,7 @@ impl Resolution { impl ResolutionFetch { pub fn install(self, opts: &Options) -> Result { - type InstallFp = fn(&bins::BinFile) -> Result<(), BinstallError>; + type InstallFp = fn(&bins::BinFile) -> Result<(), bins::Error>; let (install_bin, install_link): (InstallFp, InstallFp) = match (opts.no_track, opts.force) { diff --git a/e2e-tests/no-track.sh b/e2e-tests/no-track.sh index 18cc91e2..28f1bd74 100644 --- a/e2e-tests/no-track.sh +++ b/e2e-tests/no-track.sh @@ -18,8 +18,8 @@ exit_code="$?" set -e -if [ "$exit_code" != 74 ]; then - echo "Expected exit code 74 Io Error, but actual exit code $exit_code" +if [ "$exit_code" != 88 ]; then + echo "Expected exit code 88 BinFile Error, but actual exit code $exit_code" exit 1 fi From 2215682e763bd7213cc53e6ed65a120889f1ea13 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 17 Aug 2023 07:16:05 +1000 Subject: [PATCH 1438/2020] Update CI & dependabot: Add new crates (#1296) and also add missing `crates/binstalk-bins/LICENSE` Signed-off-by: Jiahao XU --- .github/dependabot.yml | 20 + .github/workflows/release-pr.yml | 5 + crates/binstalk-bins/LICENSE | 674 +++++++++++++++++++++++++++++++ 3 files changed, 699 insertions(+) create mode 100644 crates/binstalk-bins/LICENSE diff --git a/.github/dependabot.yml b/.github/dependabot.yml index bde33386..722ff0fa 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -14,6 +14,10 @@ updates: # We only want incompatible updates for direct dependencies # from dependabot since compatible updates is covered by # `update-transitive-deps.yml` + - package-ecosystem: "cargo" + directory: "/crates/atomic-file-install" + schedule: + interval: "daily" - package-ecosystem: "cargo" directory: "/crates/bin" schedule: @@ -22,6 +26,18 @@ updates: directory: "/crates/binstalk" schedule: interval: "daily" + - package-ecosystem: "cargo" + directory: "/crates/binstalk-bins" + schedule: + interval: "daily" + - package-ecosystem: "cargo" + directory: "/crates/binstalk-fetchers" + schedule: + interval: "daily" + - package-ecosystem: "cargo" + directory: "/crates/binstalk-registry" + schedule: + interval: "daily" - package-ecosystem: "cargo" directory: "/crates/binstalk-downloader" schedule: @@ -34,6 +50,10 @@ updates: directory: "/crates/binstalk-types" schedule: interval: "daily" + - package-ecosystem: "cargo" + directory: "/crates/cargo-toml-workspace" + schedule: + interval: "daily" - package-ecosystem: "cargo" directory: "/crates/detect-targets" schedule: diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 040a9d26..ed4e867f 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -7,11 +7,16 @@ on: required: true type: choice options: + - atomic-file-install - bin - binstalk + - binstalk-bins + - binstalk-fetchers + - binstalk-registry - binstalk-manifests - binstalk-types - binstalk-downloader + - cargo-toml-workspace - detect-targets - detect-wasi - fs-lock diff --git a/crates/binstalk-bins/LICENSE b/crates/binstalk-bins/LICENSE new file mode 100644 index 00000000..f288702d --- /dev/null +++ b/crates/binstalk-bins/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. From f0f0c2bd1424105bbb5405f0c3af23952f7df8a5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 17 Aug 2023 07:18:41 +1000 Subject: [PATCH 1439/2020] `binstalk-registry`: Rm rate-limit for crates.io registry (#1299) Fixed #1295 The 1 request per second rate-limit is too strict and it makes `cargo-binstall` very slow when resolving many crates in parallel. Relying on the rate-limit in `binstalk_downloader::remote::Client` should be good enough. Signed-off-by: Jiahao XU --- crates/binstalk-registry/Cargo.toml | 2 +- .../src/crates_io_registry.rs | 36 ------------------- crates/binstalk-registry/src/lib.rs | 17 +++------ 3 files changed, 6 insertions(+), 49 deletions(-) diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index a021c8d0..a4696869 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -27,7 +27,7 @@ serde_json = "1.0.99" sha2 = "0.10.7" tempfile = "3.5.0" thiserror = "1.0.40" -tokio = { version = "1.30.0", features = ["rt", "sync", "time"], default-features = false } +tokio = { version = "1.30.0", features = ["rt", "sync"], default-features = false } tracing = "0.1.37" url = "2.3.1" diff --git a/crates/binstalk-registry/src/crates_io_registry.rs b/crates/binstalk-registry/src/crates_io_registry.rs index 31859df3..ce8bbdcd 100644 --- a/crates/binstalk-registry/src/crates_io_registry.rs +++ b/crates/binstalk-registry/src/crates_io_registry.rs @@ -4,42 +4,10 @@ use cargo_toml_workspace::cargo_toml::Manifest; use compact_str::{CompactString, ToCompactString}; use semver::{Comparator, Op as ComparatorOp, Version as SemVersion, VersionReq}; use serde::Deserialize; -use tokio::{ - sync::Mutex, - time::{interval, Duration, Interval, MissedTickBehavior}, -}; use tracing::debug; use crate::{parse_manifest, MatchedVersion, RegistryError}; -#[derive(Debug)] -pub struct CratesIoRateLimit(Mutex); - -impl Default for CratesIoRateLimit { - fn default() -> Self { - let mut interval = interval(Duration::from_secs(1)); - // If somehow one tick is delayed, then next tick should be at least - // 1s later than the current tick. - // - // Other MissedTickBehavior including Burst (default), which will - // tick as fast as possible to catch up, and Skip, which will - // skip the current tick for the next one. - // - // Both Burst and Skip is not the expected behavior for rate limit: - // ticking as fast as possible would violate crates.io crawler - // policy, and skipping the current one will slow down the resolution - // process. - interval.set_missed_tick_behavior(MissedTickBehavior::Delay); - Self(Mutex::new(interval)) - } -} - -impl CratesIoRateLimit { - pub(super) async fn tick(&self) { - self.0.lock().await.tick().await; - } -} - /// Return `Some(checksum)` if the version is not yanked, otherwise `None`. async fn is_crate_yanked(client: &Client, url: Url) -> Result, RemoteError> { #[derive(Deserialize)] @@ -141,11 +109,7 @@ pub async fn fetch_crate_cratesio( client: Client, name: &str, version_req: &VersionReq, - crates_io_rate_limit: &CratesIoRateLimit, ) -> Result, RegistryError> { - // Wait until we can make another request to crates.io - crates_io_rate_limit.tick().await; - let url = Url::parse(&format!("https://crates.io/api/v1/crates/{name}"))?; let (version, cksum) = match version_req.comparators.as_slice() { diff --git a/crates/binstalk-registry/src/lib.rs b/crates/binstalk-registry/src/lib.rs index eb273b22..00f5d563 100644 --- a/crates/binstalk-registry/src/lib.rs +++ b/crates/binstalk-registry/src/lib.rs @@ -34,7 +34,7 @@ mod git_registry; pub use git_registry::GitRegistry; mod crates_io_registry; -pub use crates_io_registry::{fetch_crate_cratesio, CratesIoRateLimit}; +pub use crates_io_registry::fetch_crate_cratesio; mod sparse_registry; pub use sparse_registry::SparseRegistry; @@ -100,10 +100,11 @@ impl From for RegistryError { } } -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Default)] #[non_exhaustive] pub enum Registry { - CratesIo(Arc), + #[default] + CratesIo, Sparse(Arc), @@ -111,12 +112,6 @@ pub enum Registry { Git(GitRegistry), } -impl Default for Registry { - fn default() -> Self { - Self::CratesIo(Default::default()) - } -} - #[derive(Debug, ThisError)] #[error("Invalid registry `{src}`, {inner}")] pub struct InvalidRegistryError { @@ -175,9 +170,7 @@ impl Registry { version_req: &VersionReq, ) -> Result, RegistryError> { match self { - Self::CratesIo(rate_limit) => { - fetch_crate_cratesio(client, crate_name, version_req, rate_limit).await - } + Self::CratesIo => fetch_crate_cratesio(client, crate_name, version_req).await, Self::Sparse(sparse_registry) => { sparse_registry .fetch_crate_matched(client, crate_name, version_req) From 146d3f8f4321e9b0c7e242686b7896f25206df8a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 17 Aug 2023 08:34:03 +1000 Subject: [PATCH 1440/2020] Fix `binstalk-downloader` feature activation (#1297) Fix use of `native-tls` and `git`, make sure that `gix` actually uses `native-tls` in this scenario. Signed-off-by: Jiahao XU --- crates/binstalk-downloader/Cargo.toml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 8036aaba..52d1abc0 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -21,7 +21,7 @@ derive_destructure2 = "0.1" flate2 = { version = "1.0.26", default-features = false } futures-util = "0.3.28" generic-array = "0.14.7" -gix = { version = "0.51.0", features = ["blocking-http-transport-reqwest-rust-tls"], optional = true } +gix = { version = "0.51.0", features = ["blocking-http-transport-reqwest"], optional = true } httpdate = "1.0.2" reqwest = { version = "0.11.18", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } percent-encoding = "2.2.0" @@ -76,8 +76,16 @@ rustls = [ # trust-dns-resolver currently supports https with rustls "trust-dns-resolver?/dns-over-https-rustls", "trust-dns-resolver?/dns-over-quic", + + "gix?/blocking-http-transport-reqwest-rust-tls", +] +native-tls = [ + "__tls", + "reqwest/native-tls", + "trust-dns-resolver?/dns-over-native-tls", + + "gix?/blocking-http-transport-reqwest-native-tls", ] -native-tls = ["__tls", "reqwest/native-tls", "trust-dns-resolver?/dns-over-native-tls"] # Enable trust-dns-resolver so that features on it will also be enabled. trust-dns = ["trust-dns-resolver", "reqwest/trust-dns"] From 0f7828569a893559373f7994c2a6a243b1fbe65f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 17 Aug 2023 09:13:21 +1000 Subject: [PATCH 1441/2020] Add `error` logging if achieve doesn't contain bin required (#1298) * Add `error` logging if achieve doesn't contain bin required So that users know that this is an upstream issue and will report to upstream. Signed-off-by: Jiahao XU * Update crates/binstalk/src/ops/resolve.rs --------- Signed-off-by: Jiahao XU --- crates/binstalk/src/ops/resolve.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 1261574a..3ca6c902 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -14,7 +14,7 @@ use maybe_owned::MaybeOwned; use semver::{Version, VersionReq}; use tempfile::TempDir; use tokio::task::spawn_blocking; -use tracing::{debug, info, instrument, warn}; +use tracing::{debug, error, info, instrument, warn}; use crate::{ bins, @@ -267,17 +267,22 @@ async fn download_extract_and_verify( // This binary is optional Err(err) => { let required_features = &bin.required_features; + let bin_name = bin.name.as_str(); if required_features.is_empty() { + error!( + "When resolving {name} bin {bin_name} is not found.\ +This binary is not optional so it must be included in the archive, please contact with\ +upstream to fix this issue." + ); // This bin is not optional, error Some(Err(err)) } else { // Optional, print a warning and continue. - let bin_name = bin.name.as_str(); let features = required_features.iter().format(","); warn!( "When resolving {name} bin {bin_name} is not found. \ - But since it requies features {features}, this bin is ignored." +But since it requies features {features}, this bin is ignored." ); None } From 4e73d0095f7a02091e3bc572d078ecdfd2d4b509 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 17 Aug 2023 12:46:57 +0000 Subject: [PATCH 1442/2020] build(deps): update windows requirement from 0.48.0 to 0.51.0 in /crates/atomic-file-install (#1301) build(deps): update windows requirement in /crates/atomic-file-install Updates the requirements on [windows](https://github.com/microsoft/windows-rs) to permit the latest version. - [Release notes](https://github.com/microsoft/windows-rs/releases) - [Commits](https://github.com/microsoft/windows-rs/compare/windows-targets-0.48.1...0.51.0) --- updated-dependencies: - dependency-name: windows dependency-type: direct:production ... Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 63 +++++++++++++++++---------- crates/atomic-file-install/Cargo.toml | 2 +- crates/atomic-file-install/src/lib.rs | 1 - 3 files changed, 42 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dc483cb3..47aea5ea 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -180,7 +180,7 @@ dependencies = [ "reflink-copy", "tempfile", "tracing", - "windows 0.48.0", + "windows 0.51.0", ] [[package]] @@ -4239,6 +4239,25 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "windows" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9763fb813068e9f4ab70a92a0c6ad61ff6b342f693b1ed0e5387c854386e670" +dependencies = [ + "windows-core", + "windows-targets", +] + +[[package]] +name = "windows-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b81650771e76355778637954dc9d7eb8d991cd89ad64ba26f21eeb3c22d8d836" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-dll" version = "0.4.1" @@ -4274,24 +4293,24 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "d1eeca1c172a285ee6c2c84c341ccea837e7c01b12fbb2d0fe3c9e550ce49ec8" dependencies = [ "windows_aarch64_gnullvm", - "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_aarch64_msvc 0.48.2", + "windows_i686_gnu 0.48.2", + "windows_i686_msvc 0.48.2", + "windows_x86_64_gnu 0.48.2", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.48.0", + "windows_x86_64_msvc 0.48.2", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "b10d0c968ba7f6166195e13d593af609ec2e3d24f916f081690695cf5eaffb2f" [[package]] name = "windows_aarch64_msvc" @@ -4301,9 +4320,9 @@ checksum = "db3bc5134e8ce0da5d64dcec3529793f1d33aee5a51fc2b4662e0f881dd463e6" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "571d8d4e62f26d4932099a9efe89660e8bd5087775a2ab5cdd8b747b811f1058" [[package]] name = "windows_i686_gnu" @@ -4313,9 +4332,9 @@ checksum = "0343a6f35bf43a07b009b8591b78b10ea03de86b06f48e28c96206cd0f453b50" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "2229ad223e178db5fbbc8bd8d3835e51e566b8474bfca58d2e6150c48bb723cd" [[package]] name = "windows_i686_msvc" @@ -4325,9 +4344,9 @@ checksum = "1acdcbf4ca63d8e7a501be86fee744347186275ec2754d129ddeab7a1e3a02e4" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "600956e2d840c194eedfc5d18f8242bc2e17c7775b6684488af3a9fff6fe3287" [[package]] name = "windows_x86_64_gnu" @@ -4337,15 +4356,15 @@ checksum = "893c0924c5a990ec73cd2264d1c0cba1773a929e1a3f5dbccffd769f8c4edebb" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "ea99ff3f8b49fb7a8e0d305e5aec485bd068c2ba691b6e277d29eaeac945868a" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "8f1a05a1ece9a7a0d5a7ccf30ba2c33e3a61a30e042ffd247567d1de1d94120d" [[package]] name = "windows_x86_64_msvc" @@ -4355,9 +4374,9 @@ checksum = "a29bd61f32889c822c99a8fdf2e93378bd2fae4d7efd2693fab09fcaaf7eff4b" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "d419259aba16b663966e29e6d7c6ecfa0bb8425818bb96f6f1f3c3eb71a6e7b9" [[package]] name = "winnow" diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index 976515ea..e43c71a6 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -15,4 +15,4 @@ tempfile = "3.5.0" tracing = "0.1.37" [target.'cfg(windows)'.dependencies] -windows = { version = "0.48.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } +windows = { version = "0.51.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } diff --git a/crates/atomic-file-install/src/lib.rs b/crates/atomic-file-install/src/lib.rs index 246ecdf4..63ad812a 100644 --- a/crates/atomic-file-install/src/lib.rs +++ b/crates/atomic-file-install/src/lib.rs @@ -214,6 +214,5 @@ mod win { None, // lpreserved, unused ) } - .ok() } } From 43973d7e86444c1a5b32a4c79d8e8d41babacf23 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 18 Aug 2023 11:59:48 +1000 Subject: [PATCH 1443/2020] Refactor `cargo-binstall` (#1302) - Move implementation of `main` into the library part of `cargo-binstall` to speedup codegen. - Move `manifests.rs` into `binstalk-manifests` Signed-off-by: Jiahao XU --- Cargo.lock | 1 - crates/bin/Cargo.toml | 1 - crates/bin/src/entry.rs | 6 +- crates/bin/src/lib.rs | 12 ++-- crates/bin/src/main.rs | 65 ++--------------- crates/bin/src/main_impl.rs | 64 +++++++++++++++++ .../src/crates_manifests.rs} | 72 ++++++++++--------- crates/binstalk-manifests/src/lib.rs | 2 + 8 files changed, 120 insertions(+), 103 deletions(-) create mode 100644 crates/bin/src/main_impl.rs rename crates/{bin/src/manifests.rs => binstalk-manifests/src/crates_manifests.rs} (51%) diff --git a/Cargo.lock b/Cargo.lock index 47aea5ea..8d43afb0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -530,7 +530,6 @@ dependencies = [ "dirs", "embed-resource", "file-format", - "fs-lock", "gh-token", "home", "log", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 03e6e4fe..2c2d09ad 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -28,7 +28,6 @@ clap = { version = "4.3.0", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" file-format = { version = "0.18.0", default-features = false } -fs-lock = { version = "0.1.0", path = "../fs-lock" } gh-token = "0.1.2" home = "0.5.5" log = { version = "0.4.18", features = ["std"] } diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 6aec09f5..8c265285 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -21,8 +21,9 @@ use binstalk::{ CargoTomlFetchOverride, Options, Resolver, }, }; -use binstalk_manifests::cargo_config::Config; -use binstalk_manifests::cargo_toml_binstall::PkgOverride; +use binstalk_manifests::{ + cargo_config::Config, cargo_toml_binstall::PkgOverride, crates_manifests::Manifests, +}; use file_format::FileFormat; use home::cargo_home; use log::LevelFilter; @@ -33,7 +34,6 @@ use tracing::{debug, error, info, warn}; use crate::{ args::{Args, Strategy}, install_path, - manifests::Manifests, ui::confirm, }; diff --git a/crates/bin/src/lib.rs b/crates/bin/src/lib.rs index 2f9e9057..4475363a 100644 --- a/crates/bin/src/lib.rs +++ b/crates/bin/src/lib.rs @@ -1,11 +1,13 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] -pub mod args; -pub mod bin_util; -pub mod entry; +mod args; +mod bin_util; +mod entry; mod git_credentials; mod install_path; -pub mod logging; -mod manifests; +mod logging; +mod main_impl; mod signal; mod ui; + +pub use main_impl::do_main; diff --git a/crates/bin/src/main.rs b/crates/bin/src/main.rs index 2fa221df..7733f5df 100644 --- a/crates/bin/src/main.rs +++ b/crates/bin/src/main.rs @@ -1,68 +1,11 @@ -use std::time::Instant; +use std::process::Termination; -use binstalk::{helpers::jobserver_client::LazyJobserverClient, TARGET}; -use log::LevelFilter; -use tracing::debug; - -use cargo_binstall::{ - args, - bin_util::{run_tokio_main, MainExit}, - entry, - logging::logging, -}; +use cargo_binstall::do_main; #[cfg(feature = "mimalloc")] #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; -fn main() -> MainExit { - // This must be the very first thing to happen - let jobserver_client = LazyJobserverClient::new(); - - let args = args::parse(); - - if args.version { - let cargo_binstall_version = env!("CARGO_PKG_VERSION"); - if args.verbose { - let build_date = env!("VERGEN_BUILD_DATE"); - - let features = env!("VERGEN_CARGO_FEATURES"); - - let git_sha = option_env!("VERGEN_GIT_SHA").unwrap_or("UNKNOWN"); - let git_commit_date = option_env!("VERGEN_GIT_COMMIT_DATE").unwrap_or("UNKNOWN"); - - let rustc_semver = env!("VERGEN_RUSTC_SEMVER"); - let rustc_commit_hash = env!("VERGEN_RUSTC_COMMIT_HASH"); - let rustc_llvm_version = env!("VERGEN_RUSTC_LLVM_VERSION"); - - println!( - r#"cargo-binstall: {cargo_binstall_version} -build-date: {build_date} -build-target: {TARGET} -build-features: {features} -build-commit-hash: {git_sha} -build-commit-date: {git_commit_date} -rustc-version: {rustc_semver} -rustc-commit-hash: {rustc_commit_hash} -rustc-llvm-version: {rustc_llvm_version}"# - ); - } else { - println!("{cargo_binstall_version}"); - } - MainExit::Success(None) - } else { - logging( - args.log_level.unwrap_or(LevelFilter::Info), - args.json_output, - ); - - let start = Instant::now(); - - let result = run_tokio_main(|| entry::install_crates(args, jobserver_client)); - - let done = start.elapsed(); - debug!("run time: {done:?}"); - - MainExit::new(result, done) - } +fn main() -> impl Termination { + do_main() } diff --git a/crates/bin/src/main_impl.rs b/crates/bin/src/main_impl.rs new file mode 100644 index 00000000..14a3dbd8 --- /dev/null +++ b/crates/bin/src/main_impl.rs @@ -0,0 +1,64 @@ +use std::{process::Termination, time::Instant}; + +use binstalk::{helpers::jobserver_client::LazyJobserverClient, TARGET}; +use log::LevelFilter; +use tracing::debug; + +use crate::{ + args, + bin_util::{run_tokio_main, MainExit}, + entry, + logging::logging, +}; + +pub fn do_main() -> impl Termination { + // This must be the very first thing to happen + let jobserver_client = LazyJobserverClient::new(); + + let args = args::parse(); + + if args.version { + let cargo_binstall_version = env!("CARGO_PKG_VERSION"); + if args.verbose { + let build_date = env!("VERGEN_BUILD_DATE"); + + let features = env!("VERGEN_CARGO_FEATURES"); + + let git_sha = option_env!("VERGEN_GIT_SHA").unwrap_or("UNKNOWN"); + let git_commit_date = option_env!("VERGEN_GIT_COMMIT_DATE").unwrap_or("UNKNOWN"); + + let rustc_semver = env!("VERGEN_RUSTC_SEMVER"); + let rustc_commit_hash = env!("VERGEN_RUSTC_COMMIT_HASH"); + let rustc_llvm_version = env!("VERGEN_RUSTC_LLVM_VERSION"); + + println!( + r#"cargo-binstall: {cargo_binstall_version} +build-date: {build_date} +build-target: {TARGET} +build-features: {features} +build-commit-hash: {git_sha} +build-commit-date: {git_commit_date} +rustc-version: {rustc_semver} +rustc-commit-hash: {rustc_commit_hash} +rustc-llvm-version: {rustc_llvm_version}"# + ); + } else { + println!("{cargo_binstall_version}"); + } + MainExit::Success(None) + } else { + logging( + args.log_level.unwrap_or(LevelFilter::Info), + args.json_output, + ); + + let start = Instant::now(); + + let result = run_tokio_main(|| entry::install_crates(args, jobserver_client)); + + let done = start.elapsed(); + debug!("run time: {done:?}"); + + MainExit::new(result, done) + } +} diff --git a/crates/bin/src/manifests.rs b/crates/binstalk-manifests/src/crates_manifests.rs similarity index 51% rename from crates/bin/src/manifests.rs rename to crates/binstalk-manifests/src/crates_manifests.rs index 609fa250..dc5636a1 100644 --- a/crates/bin/src/manifests.rs +++ b/crates/binstalk-manifests/src/crates_manifests.rs @@ -1,13 +1,35 @@ -use std::{collections::BTreeMap, fs, io::Seek, path::Path}; - -use binstalk::errors::BinstallError; -use binstalk_manifests::{ - binstall_crates_v1::Records as BinstallCratesV1Records, cargo_crates_v1::CratesToml, - crate_info::CrateInfo, CompactString, Version, +use std::{ + collections::BTreeMap, + fs, + io::{self, Seek}, + path::Path, }; + use fs_lock::FileLock; -use miette::{Error, Result}; -use tracing::debug; +use miette::Diagnostic; +use thiserror::Error as ThisError; + +use crate::{ + binstall_crates_v1::{Error as BinstallCratesV1Error, Records as BinstallCratesV1Records}, + cargo_crates_v1::{CratesToml, CratesTomlParseError}, + crate_info::CrateInfo, + CompactString, Version, +}; + +#[derive(Debug, Diagnostic, ThisError)] +#[non_exhaustive] +pub enum ManifestsError { + #[error("failed to parse binstall crates-v1 manifest: {0}")] + #[diagnostic(transparent)] + BinstallCratesV1(#[from] BinstallCratesV1Error), + + #[error("failed to parse cargo v1 manifest: {0}")] + #[diagnostic(transparent)] + CargoManifestV1(#[from] CratesTomlParseError), + + #[error("I/O error: {0}")] + Io(#[from] io::Error), +} pub struct Manifests { binstall: BinstallCratesV1Records, @@ -15,33 +37,22 @@ pub struct Manifests { } impl Manifests { - pub fn open_exclusive(cargo_roots: &Path) -> Result { + pub fn open_exclusive(cargo_roots: &Path) -> Result { // Read cargo_binstall_metadata let metadata_path = cargo_roots.join("binstall/crates-v1.json"); - fs::create_dir_all(metadata_path.parent().unwrap()).map_err(BinstallError::Io)?; - - debug!( - "Reading binstall metadata from {} and obtaining exclusive lock", - metadata_path.display() - ); + fs::create_dir_all(metadata_path.parent().unwrap())?; let binstall = BinstallCratesV1Records::load_from_path(&metadata_path)?; // Read cargo_install_v1_metadata let manifest_path = cargo_roots.join(".crates.toml"); - debug!( - "Obtaining exclusive lock of cargo install v1 metadata in path {}", - manifest_path.display() - ); - let cargo_crates_v1 = fs::File::options() .read(true) .write(true) .create(true) .open(manifest_path) - .and_then(FileLock::new_exclusive) - .map_err(BinstallError::Io)?; + .and_then(FileLock::new_exclusive)?; Ok(Self { binstall, @@ -49,32 +60,29 @@ impl Manifests { }) } - fn rewind_cargo_crates_v1(&mut self) -> Result<()> { - self.cargo_crates_v1 - .rewind() - .map_err(BinstallError::Io) - .map_err(Error::from) + fn rewind_cargo_crates_v1(&mut self) -> Result<(), ManifestsError> { + self.cargo_crates_v1.rewind().map_err(ManifestsError::from) } /// `cargo-uninstall` can be called to uninstall crates, /// but it only updates .crates.toml. /// /// So here we will honour .crates.toml only. - pub fn load_installed_crates(&mut self) -> Result> { + pub fn load_installed_crates( + &mut self, + ) -> Result, ManifestsError> { self.rewind_cargo_crates_v1()?; CratesToml::load_from_reader(&mut self.cargo_crates_v1) .and_then(CratesToml::collect_into_crates_versions) - .map_err(Error::from) + .map_err(ManifestsError::from) } - pub fn update(mut self, metadata_vec: Vec) -> Result<()> { + pub fn update(mut self, metadata_vec: Vec) -> Result<(), ManifestsError> { self.rewind_cargo_crates_v1()?; - debug!("Writing .crates.toml"); CratesToml::append_to_file(&mut self.cargo_crates_v1, &metadata_vec)?; - debug!("Writing binstall/crates-v1.json"); for metadata in metadata_vec { self.binstall.replace(metadata); } diff --git a/crates/binstalk-manifests/src/lib.rs b/crates/binstalk-manifests/src/lib.rs index f3befa80..c61b5181 100644 --- a/crates/binstalk-manifests/src/lib.rs +++ b/crates/binstalk-manifests/src/lib.rs @@ -13,6 +13,8 @@ mod helpers; pub mod binstall_crates_v1; pub mod cargo_config; pub mod cargo_crates_v1; +/// Contains both [`binstall_crates_v1`] and [`cargo_crates_v1`]. +pub mod crates_manifests; pub use binstalk_types::{cargo_toml_binstall, crate_info}; pub use compact_str::CompactString; From 20a57a9a9b3306a77c4fab382bb9ba22eb353fbb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 18 Aug 2023 05:05:22 +0000 Subject: [PATCH 1444/2020] dep: Upgrade transitive dependencies (#1303) Co-authored-by: github-actions --- Cargo.lock | 158 ++++++++++++++++++++++++++--------------------------- 1 file changed, 79 insertions(+), 79 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8d43afb0..014c8f3c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -95,9 +95,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.72" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b13c32d80ecc7ab747b80c3784bce54ee8a7a0cc4fbda9bf4cda2cf6fe90854" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "arc-swap" @@ -148,13 +148,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.72" +version = "0.1.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09" +checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -180,7 +180,7 @@ dependencies = [ "reflink-copy", "tempfile", "tracing", - "windows 0.51.0", + "windows 0.51.1", ] [[package]] @@ -420,9 +420,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630be753d4e58660abd17930c71b647fe46c27ea6b63cc59e1e3851406972e42" +checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" [[package]] name = "block-buffer" @@ -600,9 +600,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.21" +version = "4.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c27cdf28c0f604ba3f512b0c9a409f8de8513e4816705deb0498b627e7c3a3fd" +checksum = "b417ae4361bca3f5de378294fc7472d3c4ed86a5ef9f49e93ae722f432aae8d2" dependencies = [ "clap_builder", "clap_derive", @@ -611,9 +611,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.21" +version = "4.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08a9f1ab5e9f01a9b81f202e8562eb9a10de70abf9eaeac1be465c28b75aa4aa" +checksum = "9c90dc0f0e42c64bff177ca9d7be6fcc9ddb0f26a6e062174a61c84dd6c644d4" dependencies = [ "anstream", "anstyle", @@ -630,7 +630,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -811,13 +811,13 @@ checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" [[package]] name = "derive_destructure2" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35cb7e5875e1028a73e551747d6d0118f25c3d6dbba2dadf97cc0f4d0c53f2f5" +checksum = "ac4b68190bad25c00b64ea19767b2321a037fc0e5bea7563d5d8e35e04b19c95" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.29", ] [[package]] @@ -988,9 +988,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.26" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b9429470923de8e8cbd4d2dc513535400b4b3fef0319fb5c4e1f520a7bef743" +checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" dependencies = [ "crc32fast", "libz-ng-sys", @@ -1100,7 +1100,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -1348,7 +1348,7 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e874f41437441c02991dcea76990b9058fadfc54b02ab4dd06ab2218af43897" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "bstr", "gix-path", "libc", @@ -1469,7 +1469,7 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7255c717f49a556fa5029f6d9f2b3c008b4dd016c87f23c2ab8ca9636d5fade" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "bstr", "gix-features", "gix-path", @@ -1514,7 +1514,7 @@ version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "732f61ec71576bd443a3c24f4716dc7eac180d8929e7bb8603c7310161507106" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "bstr", "btoi", "filetime", @@ -1560,7 +1560,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce0061b7ae867e830c77b1ecfc5875f0d042aebb3d7e6014d04fd86ca6c71d59" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "gix-commitgraph", "gix-date", "gix-hash", @@ -1780,7 +1780,7 @@ version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9615cbd6b456898aeb942cd75e5810c382fbfc48dbbff2fa23ebd2d33dcbe9c7" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "gix-path", "libc", "windows 0.48.0", @@ -2060,9 +2060,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 = "human_format" @@ -2320,7 +2320,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -2373,9 +2373,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.19" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "lru-cache" @@ -2482,7 +2482,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -2646,7 +2646,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -2731,7 +2731,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -2895,9 +2895,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.32" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f3b39ccfb720540debaa0164757101c08ecb8d326b15358ce76a62c7e85965" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -3103,7 +3103,7 @@ version = "0.38.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" dependencies = [ - "bitflags 2.3.3", + "bitflags 2.4.0", "errno 0.3.2", "libc", "linux-raw-sys", @@ -3278,14 +3278,14 @@ checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] name = "serde_json" -version = "1.0.104" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "076066c5f1078eac5b722a31827a8832fe108bed65dfa75e233c89f8206e976c" +checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" dependencies = [ "itoa", "ryu", @@ -3467,7 +3467,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -3511,9 +3511,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.28" +version = "2.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04361975b3f5e348b2189d8dc55bc942f278b2d482a6a0365de5bdd62d351567" +checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" dependencies = [ "proc-macro2", "quote", @@ -3562,22 +3562,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.44" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611040a08a0439f8248d1990b111c95baa9c704c805fa1f62104b39655fd7f90" +checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.44" +version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "090198534930841fab3a5d1bb637cde49e339654e606195f8d9c76eeb081dc96" +checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -3637,9 +3637,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.30.0" +version = "1.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3ce25f50619af8b0aec2eb23deebe84249e19e2ddd393a6e16e3300a6dadfd" +checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" dependencies = [ "backtrace", "bytes", @@ -3661,7 +3661,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -3796,7 +3796,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", ] [[package]] @@ -4092,7 +4092,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", "wasm-bindgen-shared", ] @@ -4126,7 +4126,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.28", + "syn 2.0.29", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4240,9 +4240,9 @@ dependencies = [ [[package]] name = "windows" -version = "0.51.0" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9763fb813068e9f4ab70a92a0c6ad61ff6b342f693b1ed0e5387c854386e670" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ "windows-core", "windows-targets", @@ -4250,9 +4250,9 @@ dependencies = [ [[package]] name = "windows-core" -version = "0.51.0" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b81650771e76355778637954dc9d7eb8d991cd89ad64ba26f21eeb3c22d8d836" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" dependencies = [ "windows-targets", ] @@ -4292,24 +4292,24 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.2" +version = "0.48.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1eeca1c172a285ee6c2c84c341ccea837e7c01b12fbb2d0fe3c9e550ce49ec8" +checksum = "27f51fb4c64f8b770a823c043c7fad036323e1c48f55287b7bbb7987b2fcdf3b" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.48.2", - "windows_i686_gnu 0.48.2", - "windows_i686_msvc 0.48.2", - "windows_x86_64_gnu 0.48.2", + "windows_aarch64_msvc 0.48.3", + "windows_i686_gnu 0.48.3", + "windows_i686_msvc 0.48.3", + "windows_x86_64_gnu 0.48.3", "windows_x86_64_gnullvm", - "windows_x86_64_msvc 0.48.2", + "windows_x86_64_msvc 0.48.3", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.2" +version = "0.48.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b10d0c968ba7f6166195e13d593af609ec2e3d24f916f081690695cf5eaffb2f" +checksum = "fde1bb55ae4ce76a597a8566d82c57432bc69c039449d61572a7a353da28f68c" [[package]] name = "windows_aarch64_msvc" @@ -4319,9 +4319,9 @@ checksum = "db3bc5134e8ce0da5d64dcec3529793f1d33aee5a51fc2b4662e0f881dd463e6" [[package]] name = "windows_aarch64_msvc" -version = "0.48.2" +version = "0.48.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571d8d4e62f26d4932099a9efe89660e8bd5087775a2ab5cdd8b747b811f1058" +checksum = "1513e8d48365a78adad7322fd6b5e4c4e99d92a69db8df2d435b25b1f1f286d4" [[package]] name = "windows_i686_gnu" @@ -4331,9 +4331,9 @@ checksum = "0343a6f35bf43a07b009b8591b78b10ea03de86b06f48e28c96206cd0f453b50" [[package]] name = "windows_i686_gnu" -version = "0.48.2" +version = "0.48.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2229ad223e178db5fbbc8bd8d3835e51e566b8474bfca58d2e6150c48bb723cd" +checksum = "60587c0265d2b842298f5858e1a5d79d146f9ee0c37be5782e92a6eb5e1d7a83" [[package]] name = "windows_i686_msvc" @@ -4343,9 +4343,9 @@ checksum = "1acdcbf4ca63d8e7a501be86fee744347186275ec2754d129ddeab7a1e3a02e4" [[package]] name = "windows_i686_msvc" -version = "0.48.2" +version = "0.48.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "600956e2d840c194eedfc5d18f8242bc2e17c7775b6684488af3a9fff6fe3287" +checksum = "224fe0e0ffff5d2ea6a29f82026c8f43870038a0ffc247aa95a52b47df381ac4" [[package]] name = "windows_x86_64_gnu" @@ -4355,15 +4355,15 @@ checksum = "893c0924c5a990ec73cd2264d1c0cba1773a929e1a3f5dbccffd769f8c4edebb" [[package]] name = "windows_x86_64_gnu" -version = "0.48.2" +version = "0.48.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea99ff3f8b49fb7a8e0d305e5aec485bd068c2ba691b6e277d29eaeac945868a" +checksum = "62fc52a0f50a088de499712cbc012df7ebd94e2d6eb948435449d76a6287e7ad" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.2" +version = "0.48.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1a05a1ece9a7a0d5a7ccf30ba2c33e3a61a30e042ffd247567d1de1d94120d" +checksum = "2093925509d91ea3d69bcd20238f4c2ecdb1a29d3c281d026a09705d0dd35f3d" [[package]] name = "windows_x86_64_msvc" @@ -4373,15 +4373,15 @@ checksum = "a29bd61f32889c822c99a8fdf2e93378bd2fae4d7efd2693fab09fcaaf7eff4b" [[package]] name = "windows_x86_64_msvc" -version = "0.48.2" +version = "0.48.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d419259aba16b663966e29e6d7c6ecfa0bb8425818bb96f6f1f3c3eb71a6e7b9" +checksum = "b6ade45bc8bf02ae2aa34a9d54ba660a1a58204da34ba793c00d83ca3730b5f1" [[package]] name = "winnow" -version = "0.5.7" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19f495880723d0999eb3500a9064d8dbcf836460b24c17df80ea7b5794053aac" +checksum = "d09770118a7eb1ccaf4a594a221334119a44a814fcb0d31c5b85e83e97227a97" dependencies = [ "memchr", ] From dc77a1ab93461dcddec01946ae7997b9a4c067da Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 19 Aug 2023 11:08:55 +1000 Subject: [PATCH 1445/2020] Refactor: Extract new crate `simple-git` (#1304) `binstalk-downloader` contains stuff about http(s) before the git code is moved into it and now it becomes http and git. While git indeed uses http stuff, which is why I decided to put it into binstalk-downloader, it is more than just downloading since it is stateful (can be cached locally and updated) where as http is stateless. Also `binstalk-downloader`'s codegen time now increases dramatically and it also creates extra dependencies for binstalk-fetchers, delaying its execution. The git code also don't use anything from `binstalk-downloader` at all, it makes sense to be an independent crate. Signed-off-by: Jiahao XU --- .github/dependabot.yml | 4 + .github/workflows/release-pr.yml | 1 + Cargo.lock | 16 +- Cargo.toml | 1 + crates/binstalk-downloader/Cargo.toml | 9 - crates/binstalk-downloader/src/lib.rs | 3 - crates/binstalk-registry/Cargo.toml | 3 +- crates/binstalk-registry/src/git_registry.rs | 6 +- crates/binstalk-registry/src/lib.rs | 2 +- crates/binstalk/Cargo.toml | 5 +- crates/binstalk/src/helpers.rs | 4 +- crates/simple-git/Cargo.toml | 29 +++ crates/simple-git/LICENSE-APACHE | 176 ++++++++++++++++++ crates/simple-git/LICENSE-MIT | 23 +++ .../src}/cancellation_token.rs | 0 .../src/git.rs => simple-git/src/lib.rs} | 0 .../src}/progress_tracing.rs | 0 17 files changed, 258 insertions(+), 24 deletions(-) create mode 100644 crates/simple-git/Cargo.toml create mode 100644 crates/simple-git/LICENSE-APACHE create mode 100644 crates/simple-git/LICENSE-MIT rename crates/{binstalk-downloader/src/git => simple-git/src}/cancellation_token.rs (100%) rename crates/{binstalk-downloader/src/git.rs => simple-git/src/lib.rs} (100%) rename crates/{binstalk-downloader/src/git => simple-git/src}/progress_tracing.rs (100%) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 722ff0fa..cbd995cd 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -78,3 +78,7 @@ updates: directory: "/crates/normalize-path" schedule: interval: "daily" + - package-ecosystem: "cargo" + directory: "/crates/simple-git" + schedule: + interval: "daily" diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index ed4e867f..4baceb36 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -23,6 +23,7 @@ on: - normalize-path - leon - leon-macros + - simple-git version: description: Version to release required: true diff --git a/Cargo.lock b/Cargo.lock index 014c8f3c..402d1137 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -260,6 +260,7 @@ dependencies = [ "maybe-owned", "miette", "semver", + "simple-git", "strum", "target-lexicon", "tempfile", @@ -295,11 +296,9 @@ dependencies = [ "bytes", "bzip2", "compact_str", - "derive_destructure2", "flate2", "futures-util", "generic-array", - "gix", "httpdate", "percent-encoding", "quinn 0.10.2", @@ -379,6 +378,7 @@ dependencies = [ "serde", "serde_json", "sha2", + "simple-git", "tempfile", "thiserror", "tokio", @@ -3392,6 +3392,18 @@ dependencies = [ "libc", ] +[[package]] +name = "simple-git" +version = "0.0.0" +dependencies = [ + "compact_str", + "derive_destructure2", + "gix", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "slab" version = "0.4.8" diff --git a/Cargo.toml b/Cargo.toml index db25c340..cd74b184 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ members = [ "crates/detect-wasi", "crates/fs-lock", "crates/normalize-path", + "crates/simple-git", "crates/detect-targets", "crates/leon", "crates/leon-macros", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 52d1abc0..0ba07876 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -17,11 +17,9 @@ binstalk-types = { version = "0.5.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" compact_str = "0.7.0" -derive_destructure2 = "0.1" flate2 = { version = "1.0.26", default-features = false } futures-util = "0.3.28" generic-array = "0.14.7" -gix = { version = "0.51.0", features = ["blocking-http-transport-reqwest"], optional = true } httpdate = "1.0.2" reqwest = { version = "0.11.18", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } percent-encoding = "2.2.0" @@ -76,15 +74,11 @@ rustls = [ # trust-dns-resolver currently supports https with rustls "trust-dns-resolver?/dns-over-https-rustls", "trust-dns-resolver?/dns-over-quic", - - "gix?/blocking-http-transport-reqwest-rust-tls", ] native-tls = [ "__tls", "reqwest/native-tls", "trust-dns-resolver?/dns-over-native-tls", - - "gix?/blocking-http-transport-reqwest-native-tls", ] # Enable trust-dns-resolver so that features on it will also be enabled. @@ -101,9 +95,6 @@ cross-lang-fat-lto = ["zstd/fat-lto"] gh-api-client = ["json"] json = ["serde", "serde_json"] -git = ["dep:gix"] -git-max-perf = ["gix?/max-performance"] - [package.metadata.docs.rs] features = ["gh-api-client", "git"] rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/binstalk-downloader/src/lib.rs b/crates/binstalk-downloader/src/lib.rs index 970cbb12..c4a23c84 100644 --- a/crates/binstalk-downloader/src/lib.rs +++ b/crates/binstalk-downloader/src/lib.rs @@ -12,7 +12,4 @@ pub mod gh_api_client; pub mod remote; -#[cfg(feature = "git")] -pub mod git; - mod utils; diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index a4696869..34615a6d 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -25,6 +25,7 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde_json = "1.0.99" sha2 = "0.10.7" +simple-git = { version = "0.0.0", path = "../simple-git", optional = true } tempfile = "3.5.0" thiserror = "1.0.40" tokio = { version = "1.30.0", features = ["rt", "sync"], default-features = false } @@ -36,7 +37,7 @@ tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.19.11", features = ["serde"] } [features] -git = ["binstalk-downloader/git"] +git = ["simple-git"] [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/binstalk-registry/src/git_registry.rs b/crates/binstalk-registry/src/git_registry.rs index 511d59f0..be158567 100644 --- a/crates/binstalk-registry/src/git_registry.rs +++ b/crates/binstalk-registry/src/git_registry.rs @@ -1,15 +1,13 @@ use std::{io, path::PathBuf, sync::Arc}; -use binstalk_downloader::{ - git::{GitCancellationToken, GitUrl, Repository}, - remote::Client, -}; +use binstalk_downloader::remote::Client; use binstalk_types::cargo_toml_binstall::Meta; use cargo_toml_workspace::cargo_toml::Manifest; use compact_str::{CompactString, ToCompactString}; use once_cell::sync::OnceCell; use semver::VersionReq; use serde_json::{from_slice as json_from_slice, Deserializer as JsonDeserializer}; +use simple_git::{GitCancellationToken, GitUrl, Repository}; use tempfile::TempDir; use tokio::task::spawn_blocking; use url::Url; diff --git a/crates/binstalk-registry/src/lib.rs b/crates/binstalk-registry/src/lib.rs index 00f5d563..f3cebc85 100644 --- a/crates/binstalk-registry/src/lib.rs +++ b/crates/binstalk-registry/src/lib.rs @@ -19,7 +19,7 @@ use tokio::task; use url::{ParseError as UrlParseError, Url}; #[cfg(feature = "git")] -pub use binstalk_downloader::git::{GitError, GitUrl, GitUrlParseError}; +pub use simple_git::{GitError, GitUrl, GitUrlParseError}; mod vfs; diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 91c08ee1..58d70fc7 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,6 +26,7 @@ leon = { version = "2.0.1", path = "../leon" } maybe-owned = "0.3.4" miette = "5.9.0" semver = { version = "1.0.17", features = ["serde"] } +simple-git = { version = "0.0.0", path = "../simple-git", optional = true } strum = "0.25.0" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" @@ -37,8 +38,8 @@ url = { version = "2.3.1", features = ["serde"] } [features] default = ["static", "rustls", "git"] -git = ["binstalk-registry/git"] -git-max-perf = ["git", "binstalk-downloader/git-max-perf"] +git = ["binstalk-registry/git", "simple-git"] +git-max-perf = ["git", "simple-git/git-max-perf"] static = ["binstalk-downloader/static"] pkg-config = ["binstalk-downloader/pkg-config"] diff --git a/crates/binstalk/src/helpers.rs b/crates/binstalk/src/helpers.rs index 019fd7a9..058813de 100644 --- a/crates/binstalk/src/helpers.rs +++ b/crates/binstalk/src/helpers.rs @@ -6,9 +6,9 @@ pub mod tasks; pub(crate) use binstalk_downloader::download; pub use binstalk_downloader::gh_api_client; -#[cfg(feature = "git")] -pub(crate) use binstalk_downloader::git; pub(crate) use cargo_toml_workspace::{self, cargo_toml}; +#[cfg(feature = "git")] +pub(crate) use simple_git as git; pub(crate) fn is_universal_macos(target: &str) -> bool { ["universal-apple-darwin", "universal2-apple-darwin"].contains(&target) diff --git a/crates/simple-git/Cargo.toml b/crates/simple-git/Cargo.toml new file mode 100644 index 00000000..4c3de4a7 --- /dev/null +++ b/crates/simple-git/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "simple-git" +version = "0.0.0" +edition = "2021" + +description = "The simple git interface for gix suitable for async context (with tokio)" +repository = "https://github.com/cargo-bins/cargo-binstall" +documentation = "https://docs.rs/simple-git" +rust-version = "1.65.0" +authors = ["Jiahao XU "] +license = "Apache-2.0 OR MIT" + +[dependencies] +compact_str = "0.7.0" +derive_destructure2 = "0.1" +gix = { version = "0.51.0", features = ["blocking-http-transport-reqwest"] } +thiserror = "1.0.40" +tokio = { version = "1.30.0", features = ["rt", "time"], default-features = false } +tracing = "0.1.37" + +[features] +rustls = [ + "gix/blocking-http-transport-reqwest-rust-tls", +] +native-tls = [ + "gix/blocking-http-transport-reqwest-native-tls", +] + +git-max-perf = ["gix/max-performance"] diff --git a/crates/simple-git/LICENSE-APACHE b/crates/simple-git/LICENSE-APACHE new file mode 100644 index 00000000..1b5ec8b7 --- /dev/null +++ b/crates/simple-git/LICENSE-APACHE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/crates/simple-git/LICENSE-MIT b/crates/simple-git/LICENSE-MIT new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/crates/simple-git/LICENSE-MIT @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/crates/binstalk-downloader/src/git/cancellation_token.rs b/crates/simple-git/src/cancellation_token.rs similarity index 100% rename from crates/binstalk-downloader/src/git/cancellation_token.rs rename to crates/simple-git/src/cancellation_token.rs diff --git a/crates/binstalk-downloader/src/git.rs b/crates/simple-git/src/lib.rs similarity index 100% rename from crates/binstalk-downloader/src/git.rs rename to crates/simple-git/src/lib.rs diff --git a/crates/binstalk-downloader/src/git/progress_tracing.rs b/crates/simple-git/src/progress_tracing.rs similarity index 100% rename from crates/binstalk-downloader/src/git/progress_tracing.rs rename to crates/simple-git/src/progress_tracing.rs From 251434408ab7c9fefcce06a89c7af7a3b28a0713 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 19 Aug 2023 16:50:39 +1200 Subject: [PATCH 1446/2020] release: atomic-file-install v1.0.0 (#1305) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/atomic-file-install/Cargo.toml | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 402d1137..0c033849 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -175,7 +175,7 @@ dependencies = [ [[package]] name = "atomic-file-install" -version = "0.0.0" +version = "1.0.0" dependencies = [ "reflink-copy", "tempfile", diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index e43c71a6..5d3d586d 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "atomic-file-install" -version = "0.0.0" +version = "1.0.0" edition = "2021" description = "For atomically installing a file or a symlink." repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 12d6d558..5b1b27ab 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -11,7 +11,7 @@ authors = ["Jiahao XU "] license = "GPL-3.0-only" [dependencies] -atomic-file-install = { version = "0.0.0", path = "../atomic-file-install" } +atomic-file-install = { version = "1.0.0", path = "../atomic-file-install" } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } leon = { version = "2.0.1", path = "../leon" } From 382b32a3802a5d0b3721889584971220ff7a8949 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 19 Aug 2023 16:51:04 +1200 Subject: [PATCH 1447/2020] release: cargo-toml-workspace v1.0.0 (#1306) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c033849..90b4be21 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -551,7 +551,7 @@ dependencies = [ [[package]] name = "cargo-toml-workspace" -version = "0.0.0" +version = "1.0.0" dependencies = [ "binstalk-types", "cargo_toml", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 34615a6d..c0fc653e 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -15,7 +15,7 @@ async-trait = "0.1.68" base16 = "0.2.1" binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader", default-features = false, features = ["json"] } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } -cargo-toml-workspace = { version = "0.0.0", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "1.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } leon = { version = "2.0.1", path = "../leon" } miette = "5.9.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 58d70fc7..71f623ad 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -15,7 +15,7 @@ binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader", defa binstalk-fetchers = { version = "0.0.0", path = "../binstalk-fetchers" } binstalk-registry = { version = "0.0.0", path = "../binstalk-registry" } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } -cargo-toml-workspace = { version = "0.0.0", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "1.0.0", path = "../cargo-toml-workspace" } command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.10", path = "../detect-targets" } diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 79a2f906..513e5189 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-toml-workspace" -version = "0.0.0" +version = "1.0.0" edition = "2021" description = "Parse cargo workspace and load specific crate" repository = "https://github.com/cargo-bins/cargo-binstall" From c19ee50130a7090a9e569576655a546ee3e2ed9d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 21 Aug 2023 23:10:20 +1000 Subject: [PATCH 1448/2020] build(deps): update file-format requirement from 0.18.0 to 0.19.0 in /crates/bin (#1307) build(deps): update file-format requirement in /crates/bin Updates the requirements on [file-format](https://github.com/mmalecot/file-format) to permit the latest version. - [Release notes](https://github.com/mmalecot/file-format/releases) - [Changelog](https://github.com/mmalecot/file-format/blob/main/CHANGELOG.md) - [Commits](https://github.com/mmalecot/file-format/compare/v0.18.0...v0.19.0) --- updated-dependencies: - dependency-name: file-format dependency-type: direct:production ... Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 90b4be21..e386f9ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -970,9 +970,9 @@ checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" [[package]] name = "file-format" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd991bcfc01ee8f9ed83108da842aeddfca8a9550962cbffc9579050109c2aa9" +checksum = "c2c4bd83e5092ecd961fe2cfba1fa3922347823eeb92bed5eb7e2a09ffe9d2db" [[package]] name = "filetime" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 2c2d09ad..4fb9fb16 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -27,7 +27,7 @@ binstalk-manifests = { path = "../binstalk-manifests", version = "0.8.0" } clap = { version = "4.3.0", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" -file-format = { version = "0.18.0", default-features = false } +file-format = { version = "0.19.0", default-features = false } gh-token = "0.1.2" home = "0.5.5" log = { version = "0.4.18", features = ["std"] } From e1f2c4e41fb5689aebffd6d5d0d4d27fdd749b25 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 22 Aug 2023 22:01:37 +1000 Subject: [PATCH 1449/2020] dep: Bump gix to v0.52.0 Signed-off-by: Jiahao XU --- Cargo.lock | 267 +++++++++++++++++++++-------------- crates/simple-git/Cargo.toml | 2 +- 2 files changed, 161 insertions(+), 108 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e386f9ed..9033f88d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -953,6 +953,15 @@ dependencies = [ "libc", ] +[[package]] +name = "faster-hex" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e9042d281a5eec0f2387f8c3ea6c4514e2cf2732c90a85aaf383b761ee3b290d" +dependencies = [ + "serde", +] + [[package]] name = "fastrand" version = "1.9.0" @@ -1183,9 +1192,9 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "gix" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ce5c049b1afcae9bb9e10c0f6dd8eb1335e8647fb7fd34732a66133ca3b9886" +checksum = "a35ed1401a11506b45361746507a7c94c546574ddd7dfc2717f8941e30070254" dependencies = [ "gix-actor", "gix-archive", @@ -1211,12 +1220,14 @@ dependencies = [ "gix-odb", "gix-pack", "gix-path", + "gix-pathspec", "gix-prompt", "gix-protocol", "gix-ref", "gix-refspec", "gix-revision", "gix-sec", + "gix-submodule", "gix-tempfile", "gix-trace", "gix-transport", @@ -1225,9 +1236,11 @@ dependencies = [ "gix-utils", "gix-validate", "gix-worktree", + "gix-worktree-state", "gix-worktree-stream", "log", "once_cell", + "parking_lot", "reqwest", "signal-hook", "smallvec", @@ -1237,23 +1250,23 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.24.2" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abd2566c12095a584716f2c16f051850bd8987f57556f1fef4a7cce0300b83d0" +checksum = "8f8a773b5385e9d2f88bd879fb763ec1212585f6d630ebe13adb7bac93bce975" dependencies = [ "bstr", "btoi", "gix-date", "itoa", - "nom", "thiserror", + "winnow", ] [[package]] name = "gix-archive" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc89a798842b519048e947339a9c9f3cfd8fb9c2d9b66b6ebcb0c3cc8fe5874d" +checksum = "5e560a446515b9890fbd84a4d6ec23b52f040a801d9623505cb860c077b021ea" dependencies = [ "bstr", "gix-date", @@ -1264,9 +1277,9 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63a134a674e39e238bd273326a9815296cc71f867ad5466518da71392cff98ce" +checksum = "b1ecae08f2625d8abcd27570fa2f9c2fcf01a1cd968a8d90858e63f8e08211a3" dependencies = [ "bstr", "gix-glob", @@ -1281,9 +1294,9 @@ dependencies = [ [[package]] name = "gix-bitmap" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aa8bbde7551a9e3e783a2871f53bbb0f50aac7a77db5680c8709f69e8ce724f" +checksum = "0ccab4bc576844ddb51b78d81b4a42d73e6229660fa614dfc3d3999c874d1959" dependencies = [ "thiserror", ] @@ -1299,18 +1312,18 @@ dependencies = [ [[package]] name = "gix-command" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2783ad148fb16bf9cfd46423706ba552a62a4d4a18fda5dd07648eb0228862dd" +checksum = "0f28f654184b5f725c5737c7e4f466cbd8f0102ac352d5257eeab19647ee4256" dependencies = [ "bstr", ] [[package]] name = "gix-commitgraph" -version = "0.18.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8219fe6f39588a29dbfb8d1c244b07ee653126edc5b6f3860752c3b5454fa10b" +checksum = "3845b3c8722a0e97d9d593c05d384bb1275a5865f1cd967523a3780ffc93168e" dependencies = [ "bstr", "gix-chunk", @@ -1322,9 +1335,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.26.2" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2135b921a699a4c36167148193bea23c653a16ef0686f6a280e383469709a773" +checksum = "9a312d120231dc8d5a2e34928a9a2098c1d3dbad76f0660ee38d0b1a87de5271" dependencies = [ "bstr", "gix-config-value", @@ -1344,9 +1357,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.12.5" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e874f41437441c02991dcea76990b9058fadfc54b02ab4dd06ab2218af43897" +checksum = "901e184f3d4f99bf015ca13b5ccacb09e26b400f198fe2066651089e2c490680" dependencies = [ "bitflags 2.4.0", "bstr", @@ -1357,9 +1370,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.17.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307d91ec5f7c8e9bfaa217fe30c2e0099101cbe83dbed27a222dbb6def38725f" +checksum = "2988e917f7ee4a99072354d5885ca14c9e7039de8246e96e300ab3e5060cad19" dependencies = [ "bstr", "gix-command", @@ -1373,9 +1386,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4f7c76578a69b736c3f0770f14757e9027354011d24c56d79207add9d7d1be6" +checksum = "01e476b4e156f6044d35bf1ce2079d97b7207515cfb5a2bb6fcd489bb697d700" dependencies = [ "bstr", "itoa", @@ -1385,9 +1398,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.33.1" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a49d7a9a9ed5ec3428c3061da45d0fc5f50b3c07b91ea4e7ec4959668f25f6c" +checksum = "016be5f0789da595b61d15a862476be0cbae8fd29e2c91d66770fdd8df145773" dependencies = [ "gix-hash", "gix-object", @@ -1397,9 +1410,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.22.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "041480eb03d8aa0894d9b73d25d182d51bc4d0ea8925a6ee0c971262bbc7715e" +checksum = "2b74760d912716b287357dae5654ad84be12a2a75a721f00b58ecdd65496e024" dependencies = [ "bstr", "dunce", @@ -1412,9 +1425,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "882695cccf38da4c3cc7ee687bdb412cf25e37932d7f8f2c306112ea712449f1" +checksum = "7f77decb545f63a52852578ef5f66ecd71017ffc1983d551d5fa2328d6d9817f" dependencies = [ "bytes", "bytesize", @@ -1436,9 +1449,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef4d4d61f2ab07de4612f8e078d7f1a443c7ab5c40f382784c8eacdf0fd172b9" +checksum = "5f5495cdd54f4c3bb05b35a525cd39df1643362d917a7e03f112564c2825feb4" dependencies = [ "bstr", "encoding_rs", @@ -1456,18 +1469,18 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d5b6e9d34a2c61ea4a02bbca94c409ab6dbbca1348cbb67298cd7fed8758761" +checksum = "53d5089f3338647776733a75a800a664ab046f56f21c515fa4722e395f877ef8" dependencies = [ "gix-features", ] [[package]] name = "gix-glob" -version = "0.10.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7255c717f49a556fa5029f6d9f2b3c008b4dd016c87f23c2ab8ca9636d5fade" +checksum = "c753299d14a29ca06d7adc8464c16f1786eb97bc9a44a796ad0a37f57235a494" dependencies = [ "bitflags 2.4.0", "bstr", @@ -1477,19 +1490,19 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.11.4" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b422ff2ad9a0628baaad6da468cf05385bf3f5ab495ad5a33cce99b9f41092f" +checksum = "7d4796bac3aaf0c2f8bea152ca924ae3bdc5f135caefe6431116bcd67e98eab9" dependencies = [ - "hex", + "faster-hex", "thiserror", ] [[package]] name = "gix-hashtable" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "385f4ce6ecf3692d313ca3aa9bd3b3d8490de53368d6d94bedff3af8b6d9c58d" +checksum = "45ad1b70efd1e77c32729d5a522f0c855e9827242feb10318e1acaf2259222c0" dependencies = [ "gix-hash", "hashbrown 0.14.0", @@ -1498,9 +1511,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88b95ceb3bc45abcab6eb55ef4e0053e58b4df0712d3f9aec7d0ca990952603" +checksum = "b355098421f5cc91a0e5f1ef3600ae250c13b7c3c472b18c361897c6081bfbb1" dependencies = [ "bstr", "gix-glob", @@ -1510,9 +1523,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.21.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "732f61ec71576bd443a3c24f4716dc7eac180d8929e7bb8603c7310161507106" +checksum = "a9738fc58ca30e232c7b1be8e8ab52b072979acb9bf3fa97662b5b23c0c6fbca" dependencies = [ "bitflags 2.4.0", "bstr", @@ -1533,9 +1546,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "7.0.2" +version = "8.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e82ec23c8a281f91044bf3ed126063b91b59f9c9340bf0ae746f385cc85a6fa" +checksum = "de4363023577b31906b476b34eefbf76931363ec574f88b5c7b6027789f1e3ce" dependencies = [ "gix-tempfile", "gix-utils", @@ -1544,9 +1557,9 @@ dependencies = [ [[package]] name = "gix-mailmap" -version = "0.16.1" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc0dbbf35d29639770af68d7ff55924d83786c8924b0e6a1766af1a98b7d58b" +checksum = "244a4a6f08e8104110675de649ccd20fe1d1116783063920e19aa7da197a4ad0" dependencies = [ "bstr", "gix-actor", @@ -1556,9 +1569,9 @@ dependencies = [ [[package]] name = "gix-negotiate" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce0061b7ae867e830c77b1ecfc5875f0d042aebb3d7e6014d04fd86ca6c71d59" +checksum = "a0b0ea711559f843b8286cdf71ea421560c072120fae35a949bcf6b068b73745" dependencies = [ "bitflags 2.4.0", "gix-commitgraph", @@ -1572,9 +1585,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.33.2" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdd87520c71a19afecfa616863a4b761621074878f5a3999243b3e37e233943" +checksum = "c4283b7b5e9438afe2e3183e9acd1c77e750800937bb56c06b750822d2ff6d95" dependencies = [ "bstr", "btoi", @@ -1583,18 +1596,17 @@ dependencies = [ "gix-features", "gix-hash", "gix-validate", - "hex", "itoa", - "nom", "smallvec", "thiserror", + "winnow", ] [[package]] name = "gix-odb" -version = "0.50.2" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e827dbda6d3dabadb94cd437d0e0fe8c314a60d136a3235fc6f5bf7b96b976ac" +checksum = "c1dd295ca055d8270de23b6037176b03782de753f75c84dabb7713f7d7e229fd" dependencies = [ "arc-swap", "gix-date", @@ -1611,9 +1623,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.40.2" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f029a4dce9ac91da35c968c3abdcae573b3e52c123be86cbab3011599de533" +checksum = "e2e645c38138216b9de2f6279bfb1b8567de6f4539f8fa2761eea961d991f448" dependencies = [ "clru", "gix-chunk", @@ -1634,31 +1646,31 @@ dependencies = [ [[package]] name = "gix-packetline" -version = "0.16.4" +version = "0.16.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb532b34627186a9a2705a360f64f6a8feb34c42344b127f9f230687d85358bd" +checksum = "2a374cb5eba089e3c123df4d996eb00da411bb90ec92cb35bffeeb2d22ee106a" dependencies = [ "bstr", - "hex", + "faster-hex", "thiserror", ] [[package]] name = "gix-packetline-blocking" -version = "0.16.4" +version = "0.16.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20276373def40fc3be7a86d09e1bb607d33dd6bf83e3504e83cd594e51438667" +checksum = "e39142400d3faa7057680ed3947c3b70e46b6a0b16a7c242ec8f0249e37518ba" dependencies = [ "bstr", - "hex", + "faster-hex", "thiserror", ] [[package]] name = "gix-path" -version = "0.8.4" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18609c8cbec8508ea97c64938c33cd305b75dfc04a78d0c3b78b8b3fd618a77c" +checksum = "764b31ac54472e796f08be376eaeea3e30800949650566620809659d39969dbd" dependencies = [ "bstr", "gix-trace", @@ -1668,10 +1680,25 @@ dependencies = [ ] [[package]] -name = "gix-prompt" -version = "0.5.5" +name = "gix-pathspec" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c22decaf4a063ccae2b2108820c8630c01bd6756656df3fe464b32b8958a5ea" +checksum = "b4ba6662a29a6332926494542f6144ee87a59df3c70a4c680ebd235b646d7866" +dependencies = [ + "bitflags 2.4.0", + "bstr", + "gix-attributes", + "gix-config-value", + "gix-glob", + "gix-path", + "thiserror", +] + +[[package]] +name = "gix-prompt" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ebf6f126413908bfbdc27bf69f6f8b94b674457546fab8ba613be22b917d33" dependencies = [ "gix-command", "gix-config-value", @@ -1682,9 +1709,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53c7627b8c54349b93f2a89218effc7c13a5506d2abc2571e0baaf1562a9c105" +checksum = "9ea9a0acfb928bc0cccd6d9e4778ba367328098fe6553ab39d5763f128794bad" dependencies = [ "bstr", "btoi", @@ -1700,9 +1727,9 @@ dependencies = [ [[package]] name = "gix-quote" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfd80d3d0c733508df9449b1d3795da36083807e31d851d7d61d29af13bd4b0a" +checksum = "475c86a97dd0127ba4465fbb239abac9ea10e68301470c9791a6dd5351cdc905" dependencies = [ "bstr", "btoi", @@ -1711,9 +1738,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.33.3" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25db11edd78bf33043d1969fff51c567a4b30edd77ab44f6f8eb460a4c14985d" +checksum = "993ce5c448a94038b8da1a8969c0facd6c1fbac509fa013344c580458f41527d" dependencies = [ "gix-actor", "gix-date", @@ -1726,15 +1753,15 @@ dependencies = [ "gix-tempfile", "gix-validate", "memmap2", - "nom", "thiserror", + "winnow", ] [[package]] name = "gix-refspec" -version = "0.14.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19a02bf740b326d6c082a7d6f754ebe56eef900986c5e91be7cf000df9ea18d" +checksum = "f3171923a0f9075feae790bb81d824c0c1f91a899df51508705d4957bacd006e" dependencies = [ "bstr", "gix-hash", @@ -1746,9 +1773,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.18.1" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38a13500890435e3b9e7746bceda248646bfc69e259210884c98e29bb7a1aa6f" +checksum = "2443886b7c55e73a813f203fe8603b94ac5deb3dfad8812d25e731b81f569f27" dependencies = [ "bstr", "gix-date", @@ -1756,14 +1783,15 @@ dependencies = [ "gix-hashtable", "gix-object", "gix-revwalk", + "gix-trace", "thiserror", ] [[package]] name = "gix-revwalk" -version = "0.4.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d4cbaf3cfbfde2b81b5ee8b469aff42c34693ce0fe17fc3c244d5085307f2c" +checksum = "362f71e173364f67d02899388c4b3d2f6bac7c16c0f3a9bbc04683f984f59daa" dependencies = [ "gix-commitgraph", "gix-date", @@ -1776,9 +1804,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.8.4" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9615cbd6b456898aeb942cd75e5810c382fbfc48dbbff2fa23ebd2d33dcbe9c7" +checksum = "0debc2e70613a077c257c2bb45ab4f652a550ae1d00bdca356633ea9de88a230" dependencies = [ "bitflags 2.4.0", "gix-path", @@ -1787,10 +1815,25 @@ dependencies = [ ] [[package]] -name = "gix-tempfile" -version = "7.0.2" +name = "gix-submodule" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa28d567848cec8fdd77d36ad4f5f78ecfaba7d78f647d4f63c8ae1a2cec7243" +checksum = "71cc3ecd5e2387102aa275fc88fcf36e0f0b9df23a1335bf6255327abbb9bb3f" +dependencies = [ + "bstr", + "gix-config", + "gix-path", + "gix-pathspec", + "gix-refspec", + "gix-url", + "thiserror", +] + +[[package]] +name = "gix-tempfile" +version = "8.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cea558d3daf3b1d0001052b12218c66c8f84788852791333b633d7eeb6999db1" dependencies = [ "gix-fs", "libc", @@ -1809,9 +1852,9 @@ checksum = "96b6d623a1152c3facb79067d6e2ecdae48130030cf27d6eb21109f13bd7b836" [[package]] name = "gix-transport" -version = "0.34.2" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "640cf03acc506e0350bc434dd6d7093d91343ed508d2c2166a41da856ab6e5e3" +checksum = "3521e96c5d7d65c1d6bd632820362ac30f66391108126a4a56adb0a5cfe85d77" dependencies = [ "base64 0.21.2", "bstr", @@ -1828,9 +1871,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.30.1" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e12e0fe428394226c37dd686ad64b09a04b569fe157d638b125b4a4c1e7e2df0" +checksum = "beecf2e4d8924cbe0cace0bd396f9b037fdf7db9799d5695fe70dcad959ed067" dependencies = [ "gix-commitgraph", "gix-date", @@ -1844,9 +1887,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.21.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4411bdbd1d46b35ae50e84c191660d437f89974e4236627785024be0b577170a" +checksum = "6059e15828df32027a7db9097e5a9baf320d2dcc10a4e1598ffe05be8dfd1fa6" dependencies = [ "bstr", "gix-features", @@ -1867,9 +1910,9 @@ dependencies = [ [[package]] name = "gix-validate" -version = "0.7.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba9b3737b2cef3dcd014633485f0034b0f1a931ee54aeb7d8f87f177f3c89040" +checksum = "e05cab2b03a45b866156e052aa38619f4ece4adcb2f79978bfc249bc3b21b8c5" dependencies = [ "bstr", "thiserror", @@ -1877,15 +1920,13 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.23.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f8bb6dd57dc6c9dfa03cc2cf2cc0942edae405eb6dfd1c34dbd2be00a90cab2" +checksum = "a38eab0fdd752ecfa50130c127c9f42bd329bf7f4e52872f4ac24c12bbc02baf" dependencies = [ "bstr", - "filetime", "gix-attributes", "gix-features", - "gix-filter", "gix-fs", "gix-glob", "gix-hash", @@ -1893,15 +1934,33 @@ dependencies = [ "gix-index", "gix-object", "gix-path", +] + +[[package]] +name = "gix-worktree-state" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44629a04d238493f0da657a0eee4d60086f0172c364ca4a71398b1898fda32a6" +dependencies = [ + "bstr", + "gix-features", + "gix-filter", + "gix-fs", + "gix-glob", + "gix-hash", + "gix-index", + "gix-object", + "gix-path", + "gix-worktree", "io-close", "thiserror", ] [[package]] name = "gix-worktree-stream" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb2a0fa070db8f3c0f7e9d5e8f189df7f8fdbb0fed331c79dae4c3410d7106dd" +checksum = "4a9582aa0875d19d188501dc0d6beb38259a5842777b0755d1c208b38a10aa5a" dependencies = [ "gix-attributes", "gix-features", @@ -2004,12 +2063,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - [[package]] name = "home" version = "0.5.5" diff --git a/crates/simple-git/Cargo.toml b/crates/simple-git/Cargo.toml index 4c3de4a7..481a47a9 100644 --- a/crates/simple-git/Cargo.toml +++ b/crates/simple-git/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] compact_str = "0.7.0" derive_destructure2 = "0.1" -gix = { version = "0.51.0", features = ["blocking-http-transport-reqwest"] } +gix = { version = "0.52.0", features = ["blocking-http-transport-reqwest"] } thiserror = "1.0.40" tokio = { version = "1.30.0", features = ["rt", "time"], default-features = false } tracing = "0.1.37" From c99b83b7209a93f83bcc34c6d25cdc647d1054d4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 22 Aug 2023 23:45:37 +1000 Subject: [PATCH 1450/2020] dep: Bump reqwest to v0.11.19 (#1308) Fixed #1292 Signed-off-by: Jiahao XU --- Cargo.lock | 32 ++++++++++++--------------- crates/binstalk-downloader/Cargo.toml | 7 ++---- 2 files changed, 16 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9033f88d..fcc7ab9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -301,7 +301,6 @@ dependencies = [ "generic-array", "httpdate", "percent-encoding", - "quinn 0.10.2", "reqwest", "serde", "serde-tuple-vec-map", @@ -3056,9 +3055,9 @@ checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" [[package]] name = "reqwest" -version = "0.11.18" +version = "0.11.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" +checksum = "20b9b67e2ca7dd9e9f9285b759de30ff538aab981abaaf7bc9bd90b84a0126c3" dependencies = [ "async-compression 0.4.1", "base64 0.21.2", @@ -3100,8 +3099,8 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots", - "winreg 0.10.1", + "webpki-roots 0.25.2", + "winreg 0.50.0", ] [[package]] @@ -3944,7 +3943,7 @@ dependencies = [ "tracing", "url", "webpki", - "webpki-roots", + "webpki-roots 0.22.6", ] [[package]] @@ -3968,7 +3967,7 @@ dependencies = [ "tokio-rustls 0.23.4", "tracing", "trust-dns-proto", - "webpki-roots", + "webpki-roots 0.22.6", ] [[package]] @@ -4204,9 +4203,9 @@ checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" [[package]] name = "wasm-streams" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bbae3363c08332cadccd13b67db371814cd214c2524020932f0804b8cf7c078" +checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" dependencies = [ "futures-util", "js-sys", @@ -4244,6 +4243,12 @@ dependencies = [ "webpki", ] +[[package]] +name = "webpki-roots" +version = "0.25.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" + [[package]] name = "widestring" version = "1.0.2" @@ -4451,15 +4456,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winreg" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" -dependencies = [ - "winapi", -] - [[package]] name = "winreg" version = "0.11.0" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 0ba07876..fc8779cd 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -21,11 +21,8 @@ flate2 = { version = "1.0.26", default-features = false } futures-util = "0.3.28" generic-array = "0.14.7" httpdate = "1.0.2" -reqwest = { version = "0.11.18", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } +reqwest = { version = "0.11.19", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } percent-encoding = "2.2.0" -# Pull in due to https://github.com/seanmonstar/reqwest/pull/1846 , please -# remove this once new reqwest release is out. -quinn = { version = "0.10", default-features = false, features = ["runtime-tokio"], optional = true } serde = { version = "1.0.163", features = ["derive"], optional = true } serde-tuple-vec-map = "1.0.1" serde_json = { version = "1.0.96", optional = true } @@ -86,7 +83,7 @@ trust-dns = ["trust-dns-resolver", "reqwest/trust-dns"] # Experimental HTTP/3 client, this would require `--cfg reqwest_unstable` # to be passed to `rustc`. -http3 = ["reqwest/http3", "dep:quinn"] +http3 = ["reqwest/http3"] zstd-thin = ["zstd/thin"] From 0a71b39c90c4850d702f9cd91558acb9620b1b38 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 24 Aug 2023 10:03:15 +1000 Subject: [PATCH 1451/2020] ci: Fix `release.yml` being cancelled due to `ci.yml` (#1316) Add a unique value to `concurrency.group` in `ci.yml` to prevent it from being cancelled when releasing crates. Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 7 ++++++- .github/workflows/release.yml | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b1921bc2..8fb1186b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,6 +3,11 @@ name: CI on: workflow_dispatch: workflow_call: + inputs: + additional_key: + required: true + type: string + default: "" merge_group: pull_request: types: @@ -17,7 +22,7 @@ on: - SUPPORT.md concurrency: - group: ${{ github.workflow }}-${{ github.ref || github.event.pull_request.number || github.sha }} + group: ${{ github.workflow }}-${{ github.ref || github.event.pull_request.number || github.sha }}-${{ inputs.additional_key }} cancel-in-progress: true env: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 06552072..03e859e5 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,6 +26,8 @@ jobs: if: needs.info.outputs.is-release == 'true' needs: info uses: ./.github/workflows/ci.yml + with: + additional_key: ${{ github.run_id }} tag: if: needs.info.outputs.is-release == 'true' From b9adaa006fa3d99ffa6ca36ae4790df69d9d138d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 24 Aug 2023 10:04:06 +1000 Subject: [PATCH 1452/2020] binstalk-registry: Use crates.io sparse index by default (#1314) Fixed #1310 Also add rename `fetch_crate_cratesio` => `fetch_crate_cratesio_api` and put it behind a new feature `crates_io_api`. Signed-off-by: Jiahao XU --- crates/binstalk-registry/Cargo.toml | 3 ++ .../src/crates_io_registry.rs | 2 +- crates/binstalk-registry/src/lib.rs | 28 +++++++++++++------ 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index c0fc653e..91f0c4ab 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -35,9 +35,12 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.19.11", features = ["serde"] } +binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } [features] git = ["simple-git"] +crates_io_api = [] + [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/binstalk-registry/src/crates_io_registry.rs b/crates/binstalk-registry/src/crates_io_registry.rs index ce8bbdcd..179b91fd 100644 --- a/crates/binstalk-registry/src/crates_io_registry.rs +++ b/crates/binstalk-registry/src/crates_io_registry.rs @@ -105,7 +105,7 @@ async fn fetch_crate_cratesio_version_matched( /// Find the crate by name, get its latest stable version matches `version_req`, /// retrieve its Cargo.toml and infer all its bins. -pub async fn fetch_crate_cratesio( +pub async fn fetch_crate_cratesio_api( client: Client, name: &str, version_req: &VersionReq, diff --git a/crates/binstalk-registry/src/lib.rs b/crates/binstalk-registry/src/lib.rs index f3cebc85..30923f6a 100644 --- a/crates/binstalk-registry/src/lib.rs +++ b/crates/binstalk-registry/src/lib.rs @@ -33,8 +33,10 @@ mod git_registry; #[cfg(feature = "git")] pub use git_registry::GitRegistry; +#[cfg(any(feature = "crates_io_api", test))] mod crates_io_registry; -pub use crates_io_registry::fetch_crate_cratesio; +#[cfg(any(feature = "crates_io_api", test))] +pub use crates_io_registry::fetch_crate_cratesio_api; mod sparse_registry; pub use sparse_registry::SparseRegistry; @@ -100,18 +102,21 @@ impl From for RegistryError { } } -#[derive(Clone, Debug, Default)] +#[derive(Clone, Debug)] #[non_exhaustive] pub enum Registry { - #[default] - CratesIo, - Sparse(Arc), #[cfg(feature = "git")] Git(GitRegistry), } +impl Default for Registry { + fn default() -> Self { + Self::crates_io_sparse_registry() + } +} + #[derive(Debug, ThisError)] #[error("Invalid registry `{src}`, {inner}")] pub struct InvalidRegistryError { @@ -138,6 +143,13 @@ enum InvalidRegistryErrorInner { } impl Registry { + /// Return a crates.io sparse registry + pub fn crates_io_sparse_registry() -> Self { + Self::Sparse(Arc::new(SparseRegistry::new( + Url::parse("https://index.crates.io/").unwrap(), + ))) + } + fn from_str_inner(s: &str) -> Result { if let Some(s) = s.strip_prefix("sparse+") { let url = Url::parse(s)?; @@ -170,7 +182,6 @@ impl Registry { version_req: &VersionReq, ) -> Result, RegistryError> { match self { - Self::CratesIo => fetch_crate_cratesio(client, crate_name, version_req).await, Self::Sparse(sparse_registry) => { sparse_registry .fetch_crate_matched(client, crate_name, version_req) @@ -222,7 +233,7 @@ mod test { async fn test_crates_io_sparse_registry() { let client = create_client().await; - let sparse_registry: Registry = "sparse+https://index.crates.io/".parse().unwrap(); + let sparse_registry: Registry = Registry::crates_io_sparse_registry(); assert!( matches!(sparse_registry, Registry::Sparse(_)), "{:?}", @@ -236,8 +247,7 @@ mod test { .await .unwrap(); - let manifest_from_cratesio_api = Registry::default() - .fetch_crate_matched(client, crate_name, version_req) + let manifest_from_cratesio_api = fetch_crate_cratesio_api(client, crate_name, version_req) .await .unwrap(); From cb9cb0e9371f8cafbb9c0f3c03dcf7b1571fe2de Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 24 Aug 2023 10:04:57 +1000 Subject: [PATCH 1453/2020] Fix `binstalk_downloader::Download` for data-verifier (#1313) To make sure the `data_verifier` consumes the entire file and produces the correct checksum. Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/download.rs | 91 ++++++++++++++++------ 1 file changed, 67 insertions(+), 24 deletions(-) diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index 04891398..94162b56 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -2,9 +2,9 @@ use std::{fmt, io, marker::PhantomData, path::Path}; use binstalk_types::cargo_toml_binstall::PkgFmtDecomposed; use bytes::Bytes; -use futures_util::{Stream, StreamExt}; +use futures_util::{stream::FusedStream, Stream, StreamExt}; use thiserror::Error as ThisError; -use tracing::{debug, instrument}; +use tracing::{debug, error, instrument}; pub use binstalk_types::cargo_toml_binstall::{PkgFmt, TarBasedFmt}; @@ -142,19 +142,42 @@ impl<'a> Download<'a> { async fn get_stream( self, ) -> Result< - impl Stream> + Send + Sync + Unpin + 'a, + impl Stream> + FusedStream + Send + Sync + Unpin + 'a, DownloadError, > { let mut data_verifier = self.data_verifier; - Ok(self.client.get_stream(self.url).await?.map(move |res| { - let bytes = res?; + Ok(self + .client + .get_stream(self.url) + .await? + .map(move |res| { + let bytes = res?; - if let Some(data_verifier) = &mut data_verifier { - data_verifier.update(&bytes); - } + if let Some(data_verifier) = &mut data_verifier { + data_verifier.update(&bytes); + } - Ok(bytes) - })) + Ok(bytes) + }) + // Call `fuse` at the end to make sure `data_verifier` is only + // called when the stream still has elements left. + .fuse()) + } +} + +/// Make sure `stream` is an alias instead of taking the value to avoid +/// exploding size of the future generated. +/// +/// Accept `FusedStream` only since the `stream` could be already consumed. +async fn consume_stream(stream: &mut S) +where + S: Stream> + FusedStream + Unpin, +{ + while let Some(res) = stream.next().await { + if let Err(err) = res { + error!(?err, "failed to consume stream"); + break; + } } } @@ -172,15 +195,23 @@ impl Download<'_> { fmt: TarBasedFmt, visitor: &mut dyn TarEntriesVisitor, ) -> Result<(), DownloadError> { - let stream = self.get_stream().await?; + let has_data_verifier = self.data_verifier.is_some(); + let mut stream = self.get_stream().await?; debug!("Downloading and extracting then in-memory processing"); - extract_tar_based_stream_and_visit(stream, fmt, visitor).await?; - - debug!("Download, extraction and in-memory procession OK"); - - Ok(()) + match extract_tar_based_stream_and_visit(&mut stream, fmt, visitor).await { + Ok(()) => { + debug!("Download, extraction and in-memory procession OK"); + Ok(()) + } + Err(err) => { + if has_data_verifier { + consume_stream(&mut stream).await; + } + Err(err) + } + } } /// Download a file from the provided URL and extract it to the provided path. @@ -197,19 +228,31 @@ impl Download<'_> { fmt: PkgFmt, path: &Path, ) -> Result { - let stream = this.get_stream().await?; + let has_data_verifier = this.data_verifier.is_some(); + let mut stream = this.get_stream().await?; debug!("Downloading and extracting to: '{}'", path.display()); - let extracted_files = match fmt.decompose() { - PkgFmtDecomposed::Tar(fmt) => extract_tar_based_stream(stream, path, fmt).await?, - PkgFmtDecomposed::Bin => extract_bin(stream, path).await?, - PkgFmtDecomposed::Zip => extract_zip(stream, path).await?, + let res = match fmt.decompose() { + PkgFmtDecomposed::Tar(fmt) => { + extract_tar_based_stream(&mut stream, path, fmt).await + } + PkgFmtDecomposed::Bin => extract_bin(&mut stream, path).await, + PkgFmtDecomposed::Zip => extract_zip(&mut stream, path).await, }; - debug!("Download OK, extracted to: '{}'", path.display()); - - Ok(extracted_files) + match res { + Ok(extracted_files) => { + debug!("Download OK, extracted to: '{}'", path.display()); + Ok(extracted_files) + } + Err(err) => { + if has_data_verifier { + consume_stream(&mut stream).await; + } + Err(err) + } + } } inner(self, fmt, path.as_ref()).await From 6cc22b2c51d409bfa03512722ace946cbeecdf80 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 24 Aug 2023 10:05:27 +1000 Subject: [PATCH 1454/2020] binstalk-fetchers: Add feature quickinstall (#1315) Also fixed `package.metadata.docs.rs` for `binstalk-registry`. Signed-off-by: Jiahao XU --- crates/binstalk-fetchers/Cargo.toml | 7 +++++++ crates/binstalk-fetchers/src/common.rs | 2 +- crates/binstalk-fetchers/src/lib.rs | 4 ++++ crates/binstalk-fetchers/src/quickinstall.rs | 1 + crates/binstalk-registry/Cargo.toml | 1 + crates/binstalk/Cargo.toml | 2 +- 6 files changed, 15 insertions(+), 2 deletions(-) diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 1401dba0..3f14c58a 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -29,3 +29,10 @@ url = "2.3.1" [dev-dependencies] binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader" } + +[features] +quickinstall = [] + +[package.metadata.docs.rs] +rustdoc-args = ["--cfg", "docsrs"] +all-features = true diff --git a/crates/binstalk-fetchers/src/common.rs b/crates/binstalk-fetchers/src/common.rs index c748b101..ae789929 100644 --- a/crates/binstalk-fetchers/src/common.rs +++ b/crates/binstalk-fetchers/src/common.rs @@ -7,7 +7,7 @@ use binstalk_downloader::gh_api_client::{GhReleaseArtifact, HasReleaseArtifact}; pub(super) use binstalk_downloader::{ download::{Download, ExtractedFiles}, gh_api_client::GhApiClient, - remote::{Client, Method, Url}, + remote::{Client, Url}, }; pub(super) use binstalk_types::cargo_toml_binstall::{PkgFmt, PkgMeta}; pub(super) use compact_str::CompactString; diff --git a/crates/binstalk-fetchers/src/lib.rs b/crates/binstalk-fetchers/src/lib.rs index 12396579..4a99495f 100644 --- a/crates/binstalk-fetchers/src/lib.rs +++ b/crates/binstalk-fetchers/src/lib.rs @@ -1,3 +1,5 @@ +#![cfg_attr(docsrs, feature(doc_auto_cfg))] + use std::{path::Path, sync::Arc}; use binstalk_downloader::{ @@ -10,7 +12,9 @@ pub use url::ParseError as UrlParseError; mod gh_crate_meta; pub use gh_crate_meta::*; +#[cfg(feature = "quickinstall")] mod quickinstall; +#[cfg(feature = "quickinstall")] pub use quickinstall::*; mod common; diff --git a/crates/binstalk-fetchers/src/quickinstall.rs b/crates/binstalk-fetchers/src/quickinstall.rs index f0ffae25..8262d408 100644 --- a/crates/binstalk-fetchers/src/quickinstall.rs +++ b/crates/binstalk-fetchers/src/quickinstall.rs @@ -1,5 +1,6 @@ use std::{path::Path, sync::Arc}; +use binstalk_downloader::remote::Method; use binstalk_types::cargo_toml_binstall::{PkgFmt, PkgMeta}; use tokio::sync::OnceCell; use url::Url; diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 91f0c4ab..a6e90eb4 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -44,3 +44,4 @@ crates_io_api = [] [package.metadata.docs.rs] rustdoc-args = ["--cfg", "docsrs"] +all-features = true diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 71f623ad..e2b5a73a 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.0.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } -binstalk-fetchers = { version = "0.0.0", path = "../binstalk-fetchers" } +binstalk-fetchers = { version = "0.0.0", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.0.0", path = "../binstalk-registry" } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "1.0.0", path = "../cargo-toml-workspace" } From a28b1a8092e6e589397c01d1fc0a7e25a7413881 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 24 Aug 2023 11:21:14 +1000 Subject: [PATCH 1455/2020] dep: Rm unused dep `generic-array` in `binstalk-downloader` (#1312) Signed-off-by: Jiahao XU --- Cargo.lock | 1 - crates/binstalk-downloader/Cargo.toml | 1 - 2 files changed, 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fcc7ab9e..b34edb10 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -298,7 +298,6 @@ dependencies = [ "compact_str", "flate2", "futures-util", - "generic-array", "httpdate", "percent-encoding", "reqwest", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index fc8779cd..c2647f99 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -19,7 +19,6 @@ bzip2 = "0.4.4" compact_str = "0.7.0" flate2 = { version = "1.0.26", default-features = false } futures-util = "0.3.28" -generic-array = "0.14.7" httpdate = "1.0.2" reqwest = { version = "0.11.19", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } percent-encoding = "2.2.0" From 94ac906caa8e3bbbe8ee8b120028dbedb4a8acba Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 15:28:59 +1000 Subject: [PATCH 1456/2020] release: binstalk-downloader v0.7.1 (#1320) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b34edb10..d2ea9c31 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -286,7 +286,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.7.0" +version = "0.7.1" dependencies = [ "async-compression 0.4.1", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index c2647f99..f7b220a3 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.7.0" +version = "0.7.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 3f14c58a..81114804 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.7.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } compact_str = { version = "0.7.0" } either = "1.8.1" @@ -28,7 +28,7 @@ tracing = "0.1.37" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.7.1", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index a6e90eb4..b542ab2e 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader", default-features = false, features = ["json"] } +binstalk-downloader = { version = "0.7.1", path = "../binstalk-downloader", default-features = false, features = ["json"] } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "1.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } @@ -35,7 +35,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.19.11", features = ["serde"] } -binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } +binstalk-downloader = { version = "0.7.1", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } [features] git = ["simple-git"] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index e2b5a73a..193d1cb2 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.0.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.7.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.7.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.0.0", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.0.0", path = "../binstalk-registry" } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } From a440b0e4a23d23dbfcc8eeed99778b4d93ae8af4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 15:29:13 +1000 Subject: [PATCH 1457/2020] release: simple-git v0.1.0 (#1318) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/simple-git/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d2ea9c31..cf7e05ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3445,7 +3445,7 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.0.0" +version = "0.1.0" dependencies = [ "compact_str", "derive_destructure2", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index b542ab2e..b24e1ec4 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -25,7 +25,7 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde_json = "1.0.99" sha2 = "0.10.7" -simple-git = { version = "0.0.0", path = "../simple-git", optional = true } +simple-git = { version = "0.1.0", path = "../simple-git", optional = true } tempfile = "3.5.0" thiserror = "1.0.40" tokio = { version = "1.30.0", features = ["rt", "sync"], default-features = false } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 193d1cb2..aaf47333 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ leon = { version = "2.0.1", path = "../leon" } maybe-owned = "0.3.4" miette = "5.9.0" semver = { version = "1.0.17", features = ["serde"] } -simple-git = { version = "0.0.0", path = "../simple-git", optional = true } +simple-git = { version = "0.1.0", path = "../simple-git", optional = true } strum = "0.25.0" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" diff --git a/crates/simple-git/Cargo.toml b/crates/simple-git/Cargo.toml index 481a47a9..49369c33 100644 --- a/crates/simple-git/Cargo.toml +++ b/crates/simple-git/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "simple-git" -version = "0.0.0" +version = "0.1.0" edition = "2021" description = "The simple git interface for gix suitable for async context (with tokio)" From 187a016468e6fbb13e27d87a051f373e6da3ecaf Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 05:30:01 +0000 Subject: [PATCH 1458/2020] release: binstalk-manifests v0.8.1 (#1317) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cf7e05ff..b6d10c9a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -339,7 +339,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.8.0" +version = "0.8.1" dependencies = [ "beef", "binstalk-types", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 4fb9fb16..76b0069a 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.15.0", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.8.0" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.8.1" } clap = { version = "4.3.0", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 45d585c7..980e4788 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.8.0" +version = "0.8.1" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From 8a9fbfa502edee6fc6b14e530870908e4091e535 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 07:57:10 +0000 Subject: [PATCH 1459/2020] release: binstalk-bins v0.1.0 (#1319) chore: Release Co-authored-by: github-actions Co-authored-by: Jiahao XU --- Cargo.lock | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b6d10c9a..52bcd8ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -272,7 +272,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.0.0" +version = "0.1.0" dependencies = [ "atomic-file-install", "binstalk-types", diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 5b1b27ab..6bf18e5e 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.0.0" +version = "0.1.0" edition = "2021" description = "The binstall binaries discovery and installation crate." diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index aaf47333..22ab9caf 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.0.0", path = "../binstalk-bins" } +binstalk-bins = { version = "0.1.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.7.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.0.0", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.0.0", path = "../binstalk-registry" } From 0d90f515c1016391d6c1b5209e9bac2b3f18763b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 09:26:49 +0000 Subject: [PATCH 1460/2020] release: binstalk-registry v0.1.0 (#1321) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 52bcd8ad..39d5fdf0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -360,7 +360,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.0.0" +version = "0.1.0" dependencies = [ "async-trait", "base16", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index b24e1ec4..c02fc812 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.0.0" +version = "0.1.0" edition = "2021" rust-version = "1.65.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 22ab9caf..84206900 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" binstalk-bins = { version = "0.1.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.7.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.0.0", path = "../binstalk-fetchers", features = ["quickinstall"] } -binstalk-registry = { version = "0.0.0", path = "../binstalk-registry" } +binstalk-registry = { version = "0.1.0", path = "../binstalk-registry" } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "1.0.0", path = "../cargo-toml-workspace" } command-group = { version = "2.1.0", features = ["with-tokio"] } From 52b81aad2bb7c551fe4c0c1b7505044dac4199a7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 10:24:07 +0000 Subject: [PATCH 1461/2020] release: binstalk-fetchers v0.1.0 (#1322) chore: Release Co-authored-by: github-actions Co-authored-by: Jiahao XU --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 39d5fdf0..3edf125f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -318,7 +318,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.0.0" +version = "0.1.0" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 81114804..1562c96a 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.0.0" +version = "0.1.0" edition = "2021" description = "The binstall fetchers" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 84206900..e2a288d2 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.1.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.7.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } -binstalk-fetchers = { version = "0.0.0", path = "../binstalk-fetchers", features = ["quickinstall"] } +binstalk-fetchers = { version = "0.1.0", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.1.0", path = "../binstalk-registry" } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "1.0.0", path = "../cargo-toml-workspace" } From 58799cbe6fbf181ab42f3e98f58641f0dce95eb7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 11:00:32 +0000 Subject: [PATCH 1462/2020] dep: Upgrade transitive dependencies (#1323) Co-authored-by: github-actions --- Cargo.lock | 146 ++++++++++++++++++++++++++--------------------------- 1 file changed, 73 insertions(+), 73 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3edf125f..64206eda 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" +checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" dependencies = [ "gimli", ] @@ -61,9 +61,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a30da5c5f2d5e72842e00bcb57657162cdabef0931f40e2deb9b4140440cecd" +checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" [[package]] name = "anstyle-parse" @@ -191,9 +191,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" +checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" dependencies = [ "addr2line", "cc", @@ -492,9 +492,9 @@ checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "bytesize" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38fcc2979eff34a4b84e1cf9a1e3da42a7d44b3b690a40cdcb23e3d556cfb2e5" +checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" [[package]] name = "bzip2" @@ -582,9 +582,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "305fe645edc1442a0fa8b6726ba61d422798d37a52e12eaecf4b022ebbb88f01" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", "libc", @@ -598,9 +598,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.22" +version = "4.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b417ae4361bca3f5de378294fc7472d3c4ed86a5ef9f49e93ae722f432aae8d2" +checksum = "fb690e81c7840c0d7aade59f242ea3b41b9bc27bcd5997890e7702ae4b32e487" dependencies = [ "clap_builder", "clap_derive", @@ -609,9 +609,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.22" +version = "4.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c90dc0f0e42c64bff177ca9d7be6fcc9ddb0f26a6e062174a61c84dd6c644d4" +checksum = "5ed2e96bc16d8d740f6f48d663eddf4b8a0983e79210fd55479b7bcd0a69860e" dependencies = [ "anstream", "anstyle", @@ -803,9 +803,9 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "deranged" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7684a49fb1af197853ef7b2ee694bc1f5b4179556f1e5710e1760c5db6f5e929" +checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" [[package]] name = "derive_destructure2" @@ -894,9 +894,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.32" +version = "0.8.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" dependencies = [ "cfg-if", ] @@ -1184,9 +1184,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.27.3" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "gix" @@ -1992,9 +1992,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.20" +version = "0.3.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" +checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" dependencies = [ "bytes", "fnv", @@ -2033,7 +2033,7 @@ dependencies = [ "futures", "h3", "quinn 0.10.2", - "quinn-proto 0.10.2", + "quinn-proto 0.10.4", "tokio-util", ] @@ -2661,9 +2661,9 @@ dependencies = [ [[package]] name = "object" -version = "0.31.1" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" +checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe" dependencies = [ "memchr", ] @@ -2830,9 +2830,9 @@ dependencies = [ [[package]] name = "prodash" -version = "25.0.1" +version = "25.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c236e70b7f9b9ea00d33c69f63ec1ae6e9ae96118923cd37bd4e9c7396f0b107" +checksum = "1d67eb4220992a4a052a4bb03cf776e493ecb1a3a36bab551804153d63486af7" dependencies = [ "bytesize", "human_format", @@ -2871,8 +2871,8 @@ checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ "bytes", "pin-project-lite", - "quinn-proto 0.10.2", - "quinn-udp 0.4.0", + "quinn-proto 0.10.4", + "quinn-udp 0.4.1", "rustc-hash", "rustls 0.21.6", "thiserror", @@ -2902,9 +2902,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.10.2" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c8bb234e70c863204303507d841e7fa2295e95c822b2bb4ca8ebf57f17b1cb" +checksum = "e13f81c9a9d574310b8351f8666f5a93ac3b0069c45c28ad52c10291389a7cf9" dependencies = [ "bytes", "rand", @@ -2933,9 +2933,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6df19e284d93757a9fb91d63672f7741b129246a669db09d1c0063071debc0c0" +checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ "bytes", "libc", @@ -3036,14 +3036,14 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9c6f4912869a1c9abaf4038e7051d88544960da7c9560b8baeaabfa3c95e05b" +checksum = "84b9fdc4b74744920661b70bc8daa091791c1f6940d7f9a90338754532237c29" dependencies = [ "cfg-if", "ioctl-sys", "libc", - "windows 0.48.0", + "windows 0.51.1", ] [[package]] @@ -3054,9 +3054,9 @@ checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" [[package]] name = "reqwest" -version = "0.11.19" +version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20b9b67e2ca7dd9e9f9285b759de30ff538aab981abaaf7bc9bd90b84a0126c3" +checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ "async-compression 0.4.1", "base64 0.21.2", @@ -3217,9 +3217,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.3" +version = "0.101.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261e9e0888cba427c3316e6322805653c9425240b6fd96cee7cb671ab70ab8d0" +checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" dependencies = [ "ring", "untrusted", @@ -3305,9 +3305,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.183" +version = "1.0.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" +checksum = "9f5db24220c009de9bd45e69fb2938f4b6d2df856aa9304ce377b3180f83b7c1" dependencies = [ "serde_derive", ] @@ -3323,9 +3323,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.183" +version = "1.0.186" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" +checksum = "5ad697f7e0b65af4983a4ce8f56ed5b357e8d3c36651bf6a7e13639c17b8e670" dependencies = [ "proc-macro2", "quote", @@ -3457,9 +3457,9 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" +checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67" dependencies = [ "autocfg", ] @@ -3591,9 +3591,9 @@ checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" [[package]] name = "tempfile" -version = "3.7.1" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc02fddf48964c42031a0b3fe0428320ecf3a73c401040fc0096f97794310651" +checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if", "fastrand 2.0.0", @@ -3655,9 +3655,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.25" +version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" +checksum = "0bb39ee79a6d8de55f48f2293a830e040392f1c5f16e336bdd1788cd0aadce07" dependencies = [ "deranged", "itoa", @@ -3676,9 +3676,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.11" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd" +checksum = "733d258752e9303d392b94b75230d07b0b9c489350c69b851fc6c065fde3e8f9" dependencies = [ "time-core", ] @@ -4361,24 +4361,24 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27f51fb4c64f8b770a823c043c7fad036323e1c48f55287b7bbb7987b2fcdf3b" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ "windows_aarch64_gnullvm", - "windows_aarch64_msvc 0.48.3", - "windows_i686_gnu 0.48.3", - "windows_i686_msvc 0.48.3", - "windows_x86_64_gnu 0.48.3", + "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", - "windows_x86_64_msvc 0.48.3", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fde1bb55ae4ce76a597a8566d82c57432bc69c039449d61572a7a353da28f68c" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -4388,9 +4388,9 @@ checksum = "db3bc5134e8ce0da5d64dcec3529793f1d33aee5a51fc2b4662e0f881dd463e6" [[package]] name = "windows_aarch64_msvc" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1513e8d48365a78adad7322fd6b5e4c4e99d92a69db8df2d435b25b1f1f286d4" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -4400,9 +4400,9 @@ checksum = "0343a6f35bf43a07b009b8591b78b10ea03de86b06f48e28c96206cd0f453b50" [[package]] name = "windows_i686_gnu" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60587c0265d2b842298f5858e1a5d79d146f9ee0c37be5782e92a6eb5e1d7a83" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -4412,9 +4412,9 @@ checksum = "1acdcbf4ca63d8e7a501be86fee744347186275ec2754d129ddeab7a1e3a02e4" [[package]] name = "windows_i686_msvc" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "224fe0e0ffff5d2ea6a29f82026c8f43870038a0ffc247aa95a52b47df381ac4" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -4424,15 +4424,15 @@ checksum = "893c0924c5a990ec73cd2264d1c0cba1773a929e1a3f5dbccffd769f8c4edebb" [[package]] name = "windows_x86_64_gnu" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62fc52a0f50a088de499712cbc012df7ebd94e2d6eb948435449d76a6287e7ad" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2093925509d91ea3d69bcd20238f4c2ecdb1a29d3c281d026a09705d0dd35f3d" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -4442,9 +4442,9 @@ checksum = "a29bd61f32889c822c99a8fdf2e93378bd2fae4d7efd2693fab09fcaaf7eff4b" [[package]] name = "windows_x86_64_msvc" -version = "0.48.3" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6ade45bc8bf02ae2aa34a9d54ba660a1a58204da34ba793c00d83ca3730b5f1" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" From 84004a71a96bab892f9a643e6dba054954f1a6bf Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 24 Aug 2023 22:51:28 +1000 Subject: [PATCH 1463/2020] ci: Speedup `release.yml` by removing job `test` (#1325) Since the merge_queue requires every PR to be tested, there is no need to run the test again in `release.yml`. Signed-off-by: Jiahao XU --- .github/workflows/release.yml | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 03e859e5..8b97fbe6 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,18 +22,9 @@ jobs: event-data: ${{ toJSON(github.event) }} extract-notes-under: '### Release notes' - test: - if: needs.info.outputs.is-release == 'true' - needs: info - uses: ./.github/workflows/ci.yml - with: - additional_key: ${{ github.run_id }} - tag: if: needs.info.outputs.is-release == 'true' - needs: - - info - - test + needs: info runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 From d768b8c029a2affab3dc2698b7c539eee15d46a3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 24 Aug 2023 22:51:55 +1000 Subject: [PATCH 1464/2020] release: binstalk v0.16.0 (#1324) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 64206eda..86635f98 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -242,7 +242,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.15.0" +version = "0.16.0" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 76b0069a..3b555997 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.15.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.16.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.8.1" } clap = { version = "4.3.0", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index e2a288d2..1c74f1a7 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.15.0" +version = "0.16.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From e5567ae526db0d3942c76bc9a2d2fa50d04fa130 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 25 Aug 2023 18:53:50 +1000 Subject: [PATCH 1465/2020] Fix clippy lint and format (#1328) Signed-off-by: Jiahao XU --- crates/binstalk-registry/src/common.rs | 4 +++- crates/binstalk/src/ops/resolve.rs | 9 ++++++--- crates/leon/src/template.rs | 2 +- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/crates/binstalk-registry/src/common.rs b/crates/binstalk-registry/src/common.rs index c5574e46..f3713b1d 100644 --- a/crates/binstalk-registry/src/common.rs +++ b/crates/binstalk-registry/src/common.rs @@ -163,7 +163,9 @@ impl MatchedVersion { let num = entry.vers; // Parse out version - let Ok(ver) = Version::parse(&num) else { continue }; + let Ok(ver) = Version::parse(&num) else { + continue; + }; // Filter by version match if !version_req.matches(&ver) { diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 3ca6c902..8ab5ec3c 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -71,13 +71,16 @@ async fn resolve_inner( let version_req_str = version_req.to_compact_string(); - let Some(package_info) = PackageInfo::resolve(&opts, + let Some(package_info) = PackageInfo::resolve( + &opts, crate_name.name, curr_version, &version_req, - opts.client.clone()).await? + opts.client.clone(), + ) + .await? else { - return Ok(Resolution::AlreadyUpToDate) + return Ok(Resolution::AlreadyUpToDate); }; let desired_targets = opts diff --git a/crates/leon/src/template.rs b/crates/leon/src/template.rs index bc0f4fe6..e24b8aca 100644 --- a/crates/leon/src/template.rs +++ b/crates/leon/src/template.rs @@ -196,7 +196,7 @@ impl<'s, 'rhs: 's> ops::AddAssign> for Template<'s> { fn add_assign(&mut self, rhs: Template<'rhs>) { match rhs.items { Cow::Borrowed(items) => self.items.to_mut().extend(items.iter().cloned()), - Cow::Owned(items) => self.items.to_mut().extend(items.into_iter()), + Cow::Owned(items) => self.items.to_mut().extend(items), } if let Some(default) = rhs.default { From accfb7af4edeef7d6f24731e915cff8a7282d5ec Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 25 Aug 2023 10:06:31 +0000 Subject: [PATCH 1466/2020] dep: Upgrade transitive dependencies (#1327) Co-authored-by: github-actions --- Cargo.lock | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 86635f98..6ad9f067 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -46,16 +46,15 @@ dependencies = [ [[package]] name = "anstream" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", "utf8parse", ] @@ -85,9 +84,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "1.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c677ab05e09154296dd37acecd46420c17b9713e8366facafa8fc0885167cf4c" +checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" dependencies = [ "anstyle", "windows-sys", @@ -598,9 +597,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.3.24" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb690e81c7840c0d7aade59f242ea3b41b9bc27bcd5997890e7702ae4b32e487" +checksum = "1d5f1946157a96594eb2d2c10eb7ad9a2b27518cb3000209dec700c35df9197d" dependencies = [ "clap_builder", "clap_derive", @@ -609,9 +608,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.3.24" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ed2e96bc16d8d740f6f48d663eddf4b8a0983e79210fd55479b7bcd0a69860e" +checksum = "78116e32a042dd73c2901f0dc30790d20ff3447f3e3472fad359e8c3d282bcd6" dependencies = [ "anstream", "anstyle", @@ -621,9 +620,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.3.12" +version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a9bb5758fc5dfe728d1019941681eccaf0cf8a4189b692a0ee2f2ecf90a050" +checksum = "c9fd1a5729c4548118d7d70ff234a44868d00489a4b6597b0b020918a0e91a1a" dependencies = [ "heck", "proc-macro2", @@ -633,9 +632,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da6da31387c7e4ef160ffab6d5e7f00c42626fe39aea70a7b0f1773f7dd6c1b" +checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" [[package]] name = "clru" @@ -4448,9 +4447,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.14" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d09770118a7eb1ccaf4a594a221334119a44a814fcb0d31c5b85e83e97227a97" +checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" dependencies = [ "memchr", ] From d2c337738815485b0e0286003f099a6536df1b10 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 25 Aug 2023 20:52:36 +1000 Subject: [PATCH 1467/2020] release: cargo-binstall v1.3.0 (#1326) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6ad9f067..d07dd3b6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -518,7 +518,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.2.1" +version = "1.3.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 3b555997..21fd059e 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.2.1" +version = "1.3.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 078e888e..849f13f3 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 88702011c6e059ddffd976389f83539e390a8ac1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 26 Aug 2023 17:33:04 +1000 Subject: [PATCH 1468/2020] Use resolver 2 for cargo workspace (#1330) Since some of our workspace crates still uses edition 2018, we need to explicitly specify the resolver. Signed-off-by: Jiahao XU --- Cargo.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/Cargo.toml b/Cargo.toml index cd74b184..7ea291db 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "crates/atomic-file-install", "crates/bin", From 0ca38ab0e38e295fa6c17a6da16ce666cdbb5a56 Mon Sep 17 00:00:00 2001 From: xd009642 Date: Thu, 31 Aug 2023 22:40:33 +0100 Subject: [PATCH 1469/2020] Fix binstalk-downloader test: duplicated gnu cargo audit (#1337) Fix duplicated gnu cargo audit The gnu cargo audit release was duplicated instead of the gnu and musl releases both being represented. --- crates/binstalk-downloader/src/gh_api_client.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/binstalk-downloader/src/gh_api_client.rs b/crates/binstalk-downloader/src/gh_api_client.rs index 1439b2d5..af96863c 100644 --- a/crates/binstalk-downloader/src/gh_api_client.rs +++ b/crates/binstalk-downloader/src/gh_api_client.rs @@ -494,7 +494,7 @@ mod test { "cargo-audit-x86_64-apple-darwin-v0.17.6.tgz", "cargo-audit-x86_64-pc-windows-msvc-v0.17.6.zip", "cargo-audit-x86_64-unknown-linux-gnu-v0.17.6.tgz", - "cargo-audit-x86_64-unknown-linux-gnu-v0.17.6.tgz", + "cargo-audit-x86_64-unknown-linux-musl-v0.17.6.tgz", ]; #[test] From 8a08cdda6f7b1e739c8c0f6be02588f274c47497 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 1 Sep 2023 11:14:59 +1000 Subject: [PATCH 1470/2020] Fix GitHub token auto discovery (#1335) * Fix GitHub token auto discovery Fixed #1333 - Rm dep `gh-token` since it is broken and we can simply run `gh auth token` in `cargo-binstall` instead. - binstalk-downloader: Make sure GitHub token is at least 40B long and other than the `_`, composes of only alphanumeric characters. - Warn on failure to read `git/credential` files - Optimize `try_from_home` to avoid heap allocation of `PathBuf` Signed-off-by: Jiahao XU * Fix typo and clippy Signed-off-by: Jiahao XU * Simplify `is_valid_gh_token` & `is_ascii_alphanumeric` impl Signed-off-by: Jiahao XU * Improve err msg in `get_inner` Signed-off-by: Jiahao XU * Improve err msg of `cargo_binstall::gh_token::get` Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- Cargo.lock | 32 ---------------- crates/bin/Cargo.toml | 1 - crates/bin/src/args.rs | 6 --- crates/bin/src/entry.rs | 13 ++++++- crates/bin/src/gh_token.rs | 38 +++++++++++++++++++ crates/bin/src/git_credentials.rs | 27 +++++++++---- crates/bin/src/lib.rs | 1 + .../binstalk-downloader/src/gh_api_client.rs | 20 +++++++--- 8 files changed, 85 insertions(+), 53 deletions(-) create mode 100644 crates/bin/src/gh_token.rs diff --git a/Cargo.lock b/Cargo.lock index d07dd3b6..b81bf971 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -527,7 +527,6 @@ dependencies = [ "dirs", "embed-resource", "file-format", - "gh-token", "home", "log", "miette", @@ -1169,18 +1168,6 @@ dependencies = [ "wasi", ] -[[package]] -name = "gh-token" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c29796559a0962994fcc5994ff97a18e68618508d3f0d8de794475a5045caf09" -dependencies = [ - "home", - "serde", - "serde_derive", - "serde_yaml", -] - [[package]] name = "gimli" version = "0.28.0" @@ -3363,19 +3350,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_yaml" -version = "0.9.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a49e178e4452f45cb61d0cd8cebc1b0fafd3e41929e996cef79aa3aca91f574" -dependencies = [ - "indexmap 2.0.0", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - [[package]] name = "sha1" version = "0.10.5" @@ -4028,12 +4002,6 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" -[[package]] -name = "unsafe-libyaml" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" - [[package]] name = "untrusted" version = "0.7.1" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 21fd059e..367fd09b 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -28,7 +28,6 @@ clap = { version = "4.3.0", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" file-format = { version = "0.19.0", default-features = false } -gh-token = "0.1.2" home = "0.5.5" log = { version = "0.4.18", features = ["std"] } miette = "5.9.0" diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 31ef8885..b42adaca 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -538,12 +538,6 @@ You cannot use --{option} and specify multiple packages at the same time. Do one if opts.github_token.is_none() { if let Ok(github_token) = env::var("GH_TOKEN") { opts.github_token = Some(github_token.into()); - } else if !opts.no_discover_github_token { - if let Some(github_token) = crate::git_credentials::try_from_home() { - opts.github_token = Some(github_token); - } else if let Ok(github_token) = gh_token::get() { - opts.github_token = Some(github_token.into()); - } } } diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 8c265285..d6c7ff3c 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -33,7 +33,7 @@ use tracing::{debug, error, info, warn}; use crate::{ args::{Args, Strategy}, - install_path, + gh_token, git_credentials, install_path, ui::confirm, }; @@ -107,7 +107,16 @@ pub fn install_crates( ) .map_err(BinstallError::from)?; - let gh_api_client = GhApiClient::new(client.clone(), args.github_token); + let gh_api_client = GhApiClient::new( + client.clone(), + args.github_token.or_else(|| { + if args.no_discover_github_token { + None + } else { + git_credentials::try_from_home().or_else(gh_token::get) + } + }), + ); // Create binstall_opts let binstall_opts = Arc::new(Options { diff --git a/crates/bin/src/gh_token.rs b/crates/bin/src/gh_token.rs new file mode 100644 index 00000000..3cfb3563 --- /dev/null +++ b/crates/bin/src/gh_token.rs @@ -0,0 +1,38 @@ +use std::{io, process}; + +use compact_str::CompactString; +use tracing::warn; + +fn get_inner() -> io::Result { + let process::Output { status, stdout, .. } = process::Command::new("gh") + .args(["auth", "token"]) + .stdin(process::Stdio::null()) + .stdout(process::Stdio::piped()) + .stderr(process::Stdio::null()) + .output()?; + + if !status.success() { + return Err(io::Error::new( + io::ErrorKind::Other, + format!("process exited with `{status}`"), + )); + } + + // Use String here instead of CompactString here since + // `CompactString::from_utf8` allocates if it's longer than 24B. + let s = String::from_utf8(stdout).map_err(|_err| { + io::Error::new(io::ErrorKind::InvalidData, "Invalid output, expected utf8") + })?; + + Ok(s.trim().into()) +} + +pub(super) fn get() -> Option { + match get_inner() { + Ok(token) => Some(token), + Err(err) => { + warn!(?err, "Failed to retrieve token from `gh auth token`"); + None + } + } +} diff --git a/crates/bin/src/git_credentials.rs b/crates/bin/src/git_credentials.rs index 7accd935..613b3732 100644 --- a/crates/bin/src/git_credentials.rs +++ b/crates/bin/src/git_credentials.rs @@ -1,10 +1,8 @@ -use std::{ - env, fs, - path::{Path, PathBuf}, -}; +use std::{env, fs, path::PathBuf}; use compact_str::CompactString; use dirs::home_dir; +use tracing::warn; pub fn try_from_home() -> Option { if let Some(mut home) = home_dir() { @@ -15,7 +13,9 @@ pub fn try_from_home() -> Option { } if let Some(home) = env::var_os("XDG_CONFIG_HOME") { - let home = Path::new(&home).join("git/credentials"); + let mut home = PathBuf::from(home); + home.push("git/credentials"); + if let Some(cred) = from_file(home) { return Some(cred); } @@ -25,8 +25,7 @@ pub fn try_from_home() -> Option { } fn from_file(path: PathBuf) -> Option { - fs::read_to_string(path) - .ok()? + read_cred_file(path)? .lines() .find_map(from_line) .map(CompactString::from) @@ -41,6 +40,20 @@ fn from_line(line: &str) -> Option<&str> { Some(cred.split_once(':')?.1) } +fn read_cred_file(path: PathBuf) -> Option { + match fs::read_to_string(&path) { + Ok(s) => Some(s), + Err(err) => { + warn!( + ?err, + "Failed to read git credential file {}", + path.display() + ); + None + } + } +} + #[cfg(test)] mod test { use super::*; diff --git a/crates/bin/src/lib.rs b/crates/bin/src/lib.rs index 4475363a..1e25d408 100644 --- a/crates/bin/src/lib.rs +++ b/crates/bin/src/lib.rs @@ -3,6 +3,7 @@ mod args; mod bin_util; mod entry; +mod gh_token; mod git_credentials; mod install_path; mod logging; diff --git a/crates/binstalk-downloader/src/gh_api_client.rs b/crates/binstalk-downloader/src/gh_api_client.rs index af96863c..9c8f3f52 100644 --- a/crates/binstalk-downloader/src/gh_api_client.rs +++ b/crates/binstalk-downloader/src/gh_api_client.rs @@ -132,19 +132,29 @@ struct Inner { #[derive(Clone, Debug)] pub struct GhApiClient(Arc); -fn gh_prefixed(token: &str) -> bool { - matches!((token.get(0..2), token.get(3..4)), (Some("gh"), Some("_"))) - || token.starts_with("github_") +fn is_ascii_alphanumeric(s: &[u8]) -> bool { + s.iter().all(|byte| byte.is_ascii_alphanumeric()) +} + +fn is_valid_gh_token(token: &str) -> bool { + let token = token.as_bytes(); + + token.len() >= 40 + && ((&token[0..2] == b"gh" + && token[2].is_ascii_alphanumeric() + && token[3] == b'_' + && is_ascii_alphanumeric(&token[4..])) + || (token.starts_with(b"github_") && is_ascii_alphanumeric(&token[7..]))) } impl GhApiClient { pub fn new(client: remote::Client, auth_token: Option) -> Self { let auth_token = auth_token.and_then(|auth_token| { - if gh_prefixed(&auth_token) { + if is_valid_gh_token(&auth_token) { debug!("Using gh api token"); Some(auth_token) } else { - warn!("Invalid auth_token, expected 'gh*_' or `github_*`, fallback to unauthorized mode"); + warn!("Invalid auth_token, expected 'gh*_' or `github_*` with [A-Za-z0-9], fallback to unauthorized mode"); None } }); From b4b85c631470272dbc4d9170a6dfee2cef5209a4 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 1 Sep 2023 11:18:52 +1000 Subject: [PATCH 1471/2020] Fixed binstalk-downloader docs.rs build (#1334) Feature git is removed from binstalk-downloader, however we still enable it on docs.rs build. --- crates/binstalk-downloader/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index f7b220a3..822ba896 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -92,5 +92,5 @@ gh-api-client = ["json"] json = ["serde", "serde_json"] [package.metadata.docs.rs] -features = ["gh-api-client", "git"] +features = ["gh-api-client"] rustdoc-args = ["--cfg", "docsrs"] From 214163c434e94e881a20195217afe9d9fb01e592 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 1 Sep 2023 14:08:59 +1000 Subject: [PATCH 1472/2020] dep: Upgrade transitive dependencies (#1338) Co-authored-by: github-actions --- Cargo.lock | 148 ++++++++++++++++++++++++++--------------------------- 1 file changed, 73 insertions(+), 75 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b81bf971..8f13e432 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -129,9 +129,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b74f44609f0f91493e3082d3734d98497e094777144380ea4db9f9905dd5b6" +checksum = "d495b6dc0184693324491a5ac05f559acc97bf937ab31d7a1c33dd0016be6d2b" dependencies = [ "brotli", "bzip2", @@ -226,9 +226,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.2" +version = "0.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" +checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" [[package]] name = "beef" @@ -287,7 +287,7 @@ dependencies = [ name = "binstalk-downloader" version = "0.7.1" dependencies = [ - "async-compression 0.4.1", + "async-compression 0.4.2", "async-trait", "async_zip", "binstalk-types", @@ -453,9 +453,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.6.0" +version = "1.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6798148dccfbff0fae41c7574d2fa8f1ef3492fba0face179de5d8d447d67b05" +checksum = "4c2f7349907b712260e64b0afe2f84692af14a454be26187d9df565c7f69266a" dependencies = [ "memchr", "regex-automata", @@ -596,20 +596,19 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d5f1946157a96594eb2d2c10eb7ad9a2b27518cb3000209dec700c35df9197d" +checksum = "6a13b88d2c62ff462f88e4a121f17a82c1af05693a2f192b5c38d14de73c19f6" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78116e32a042dd73c2901f0dc30790d20ff3447f3e3472fad359e8c3d282bcd6" +checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" dependencies = [ "anstream", "anstyle", @@ -619,9 +618,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.0" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9fd1a5729c4548118d7d70ff234a44868d00489a4b6597b0b020918a0e91a1a" +checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" dependencies = [ "heck", "proc-macro2", @@ -879,15 +878,15 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "embed-resource" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7f1e82a60222fc67bfd50d752a9c89da5cce4c39ed39decc84a443b07bbd69a" +checksum = "fd0a2c9b742a980060d22545a7a83b573acd6b73045b9de6370c9530ce652f27" dependencies = [ "cc", "rustc_version", "toml", "vswhom", - "winreg 0.11.0", + "winreg 0.51.0", ] [[package]] @@ -930,9 +929,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b30f669a7961ef1631673d2766cc92f52d64f7ef354d4fe0ddfd30ed52f0f4f" +checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" dependencies = [ "errno-dragonfly", "libc", @@ -1840,7 +1839,7 @@ version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3521e96c5d7d65c1d6bd632820362ac30f66391108126a4a56adb0a5cfe85d77" dependencies = [ - "base64 0.21.2", + "base64 0.21.3", "bstr", "gix-command", "gix-credentials", @@ -2140,7 +2139,7 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls 0.21.6", + "rustls 0.21.7", "tokio", "tokio-rustls 0.24.1", ] @@ -2368,9 +2367,9 @@ checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libmimalloc-sys" -version = "0.1.33" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4ac0e912c8ef1b735e92369695618dc5b1819f5a7bf3f167301a3ba1cea515e" +checksum = "25d058a81af0d1c22d7a1c948576bee6d673f7af3c0f35564abd6c81122f513d" dependencies = [ "cc", "libc", @@ -2468,9 +2467,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.5.0" +version = "2.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" +checksum = "5486aed0026218e61b8a01d5fbd5a0a134649abb71a0e53b7bc088529dced86e" [[package]] name = "memmap2" @@ -2524,9 +2523,9 @@ dependencies = [ [[package]] name = "mimalloc" -version = "0.1.37" +version = "0.1.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2894987a3459f3ffb755608bd82188f8ed00d0ae077f1edea29c068d639d98" +checksum = "972e5f23f6716f62665760b0f4cbf592576a80c7b879ba9beaafc0e558894127" dependencies = [ "libmimalloc-sys", ] @@ -2583,14 +2582,13 @@ 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", - "static_assertions", ] [[package]] @@ -2662,11 +2660,11 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "openssl" -version = "0.10.56" +version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729b745ad4a5575dd06a3e1af1414bd330ee561c01b3899eb584baeaa8def17e" +checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.0", "cfg-if", "foreign-types", "libc", @@ -2694,9 +2692,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.91" +version = "0.9.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "866b5f16f90776b9bb8dc1e1802ac6f0513de3a7a7465867bfbc563dc737faac" +checksum = "db7e971c2c2bba161b2d2fdf37080177eff520b3bc044787c7f1f5f9e78d869b" dependencies = [ "cc", "libc", @@ -2773,9 +2771,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12cc1b0bf1727a77a54b6654e7b5f1af8604923edc8b81885f8ec92f9e3f0a05" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -2842,7 +2840,7 @@ dependencies = [ "fxhash", "quinn-proto 0.8.4", "quinn-udp 0.1.4", - "rustls 0.20.8", + "rustls 0.20.9", "thiserror", "tokio", "tracing", @@ -2860,7 +2858,7 @@ dependencies = [ "quinn-proto 0.10.4", "quinn-udp 0.4.1", "rustc-hash", - "rustls 0.21.6", + "rustls 0.21.7", "thiserror", "tokio", "tracing", @@ -2876,7 +2874,7 @@ dependencies = [ "fxhash", "rand", "ring", - "rustls 0.20.8", + "rustls 0.20.9", "rustls-native-certs", "rustls-pemfile 0.2.1", "slab", @@ -2896,7 +2894,7 @@ dependencies = [ "rand", "ring", "rustc-hash", - "rustls 0.21.6", + "rustls 0.21.7", "slab", "thiserror", "tinyvec", @@ -3034,9 +3032,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed1ceff11a1dddaee50c9dc8e4938bd106e9d89ae372f192311e7da498e3b69" +checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" [[package]] name = "reqwest" @@ -3044,8 +3042,8 @@ version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ - "async-compression 0.4.1", - "base64 0.21.2", + "async-compression 0.4.2", + "base64 0.21.3", "bytes", "encoding_rs", "futures-channel", @@ -3068,7 +3066,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn 0.10.2", - "rustls 0.21.6", + "rustls 0.21.7", "rustls-pemfile 1.0.3", "serde", "serde_json", @@ -3136,12 +3134,12 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.8" +version = "0.38.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ed4fa021d81c8392ce04db050a3da9a60299050b7ae1cf482d862b54a7218f" +checksum = "c0c3dde1fc030af041adc40e79c0e7fbcf431dd24870053d187d7c66e4b87453" dependencies = [ "bitflags 2.4.0", - "errno 0.3.2", + "errno 0.3.3", "libc", "linux-raw-sys", "windows-sys", @@ -3149,9 +3147,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.20.8" +version = "0.20.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" +checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" dependencies = [ "log", "ring", @@ -3161,9 +3159,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.6" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1feddffcfcc0b33f5c6ce9a29e341e4cd59c3f78e7ee45f4a40c038b1d6cbb" +checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" dependencies = [ "log", "ring", @@ -3198,7 +3196,7 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.2", + "base64 0.21.3", ] [[package]] @@ -3291,9 +3289,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.186" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f5db24220c009de9bd45e69fb2938f4b6d2df856aa9304ce377b3180f83b7c1" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] @@ -3309,9 +3307,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.186" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad697f7e0b65af4983a4ce8f56ed5b357e8d3c36651bf6a7e13639c17b8e670" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", @@ -3628,9 +3626,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb39ee79a6d8de55f48f2293a830e040392f1c5f16e336bdd1788cd0aadce07" +checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" dependencies = [ "deranged", "itoa", @@ -3649,9 +3647,9 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "733d258752e9303d392b94b75230d07b0b9c489350c69b851fc6c065fde3e8f9" +checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" dependencies = [ "time-core", ] @@ -3716,7 +3714,7 @@ version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls 0.20.8", + "rustls 0.20.9", "tokio", "webpki", ] @@ -3727,7 +3725,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.6", + "rustls 0.21.7", "tokio", ] @@ -3904,7 +3902,7 @@ dependencies = [ "quinn 0.8.5", "rand", "ring", - "rustls 0.20.8", + "rustls 0.20.9", "rustls-pemfile 1.0.3", "smallvec", "thiserror", @@ -3931,7 +3929,7 @@ dependencies = [ "lru-cache", "parking_lot", "resolv-conf", - "rustls 0.20.8", + "rustls 0.20.9", "smallvec", "thiserror", "tokio", @@ -4010,9 +4008,9 @@ checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" [[package]] name = "url" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" +checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", "idna 0.4.0", @@ -4192,9 +4190,9 @@ dependencies = [ [[package]] name = "webpki" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "f0e74f82d49d545ad128049b7e88f6576df2da6b02e9ce565c6f533be576957e" dependencies = [ "ring", "untrusted", @@ -4424,19 +4422,19 @@ dependencies = [ [[package]] name = "winreg" -version = "0.11.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76a1a57ff50e9b408431e8f97d5456f2807f8eb2a2cd79b06068fc87f8ecf189" +checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ "cfg-if", - "winapi", + "windows-sys", ] [[package]] name = "winreg" -version = "0.50.0" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" +checksum = "937f3df7948156640f46aacef17a70db0de5917bda9c92b0f751f3a955b588fc" dependencies = [ "cfg-if", "windows-sys", From 3c5641610a236dc7fbb37ce618a0d8dc3959e652 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 2 Sep 2023 19:38:24 +1000 Subject: [PATCH 1473/2020] feat: Improve resolution logging and verbose logging (#1341) * feat: Improve resolution logging Fixed #1336 Log target of the pre-built binaries which will be installed. Signed-off-by: Jiahao XU * Fix args parsing: `quiet` & `verbose` cannot be set at the same time Signed-off-by: Jiahao XU * feat: Implies `--log-level debug` if `--verbose` is set Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 25 +++++++++++-------- crates/binstalk/src/ops/resolve/resolution.rs | 6 ++--- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index b42adaca..cd3bd1b6 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -318,14 +318,15 @@ pub struct Args { #[clap(help_heading = "Meta", long, value_name = "LEVEL")] pub log_level: Option, - /// Used with `--version` to print out verbose information. - #[clap(help_heading = "Meta", short, long, default_value_t = false)] + /// Implies `--log-level debug` and it can also be used with `--version` + /// to print out verbose information, + #[clap(help_heading = "Meta", short, long)] pub verbose: bool, /// Equivalent to setting `log_level` to `off`. /// /// This would override the `log_level`. - #[clap(help_heading = "Meta", short, long)] + #[clap(help_heading = "Meta", short, long, conflicts_with("verbose"))] pub(crate) quiet: bool, } @@ -421,15 +422,17 @@ pub fn parse() -> Args { // Load options let mut opts = Args::parse_from(args); - if let (true, Some(log)) = ( - opts.log_level.is_none(), - env::var("BINSTALL_LOG_LEVEL") + if opts.log_level.is_none() { + if let Some(log) = env::var("BINSTALL_LOG_LEVEL") .ok() - .and_then(|s| s.parse().ok()), - ) { - opts.log_level = Some(log); - } else if opts.quiet { - opts.log_level = Some(LevelFilter::Off); + .and_then(|s| s.parse().ok()) + { + opts.log_level = Some(log); + } else if opts.quiet { + opts.log_level = Some(LevelFilter::Off); + } else if opts.verbose { + opts.log_level = Some(LevelFilter::Debug); + } } // Ensure no conflict diff --git a/crates/binstalk/src/ops/resolve/resolution.rs b/crates/binstalk/src/ops/resolve/resolution.rs index 5125a343..8862faea 100644 --- a/crates/binstalk/src/ops/resolve/resolution.rs +++ b/crates/binstalk/src/ops/resolve/resolution.rs @@ -93,15 +93,15 @@ impl ResolutionFetch { let bin_files = &self.bin_files; let name = &self.name; let new_version = &self.new_version; + let target = fetcher.target(); debug!( - "Found a binary install source: {} ({})", + "Found a binary install source: {} ({target})", fetcher.source_name(), - fetcher.target() ); warn!( - "The package {name} v{new_version} will be downloaded from {}{}", + "The package {name} v{new_version} ({target}) has been downloaded from {}{}", if fetcher.is_third_party() { "third-party source " } else { From 3e67e3624a980702cb08e8ad7e4b801e1083c2ae Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 2 Sep 2023 19:38:27 +1000 Subject: [PATCH 1474/2020] feat: Add more logging to `binstalk-{downloader, registry}` (#1340) for debugging purposes. Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/remote.rs | 9 +++++---- crates/binstalk-registry/src/common.rs | 3 ++- crates/binstalk-registry/src/crates_io_registry.rs | 3 ++- crates/binstalk-registry/src/git_registry.rs | 2 ++ crates/binstalk-registry/src/sparse_registry.rs | 2 ++ 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index e32a4ab8..98486a6e 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -13,7 +13,7 @@ use reqwest::{ Request, }; use thiserror::Error as ThisError; -use tracing::{debug, info}; +use tracing::{debug, info, instrument}; pub use reqwest::{header, Error as ReqwestError, Method, StatusCode}; pub use url::Url; @@ -155,6 +155,7 @@ impl Client { /// /// Return `Ok(ControlFlow::Break(response))` when succeeds and no need /// to retry. + #[instrument] async fn do_send_request( &self, request: Request, @@ -177,7 +178,7 @@ impl Client { let status = response.status(); let add_delay_and_continue = |response: reqwest::Response, duration| { - info!("Receiver status code {status}, will wait for {duration:#?} and retry"); + info!("Received status code {status}, will wait for {duration:#?} and retry"); self.0 .service @@ -237,6 +238,8 @@ impl Client { request: Request, error_for_status: bool, ) -> Result { + debug!("Downloading from: '{}'", request.url()); + self.send_request_inner(&request) .await .and_then(|response| { @@ -313,8 +316,6 @@ impl Client { &self, url: Url, ) -> Result>, Error> { - debug!("Downloading from: '{url}'"); - Ok(self.get(url).send(true).await?.bytes_stream()) } diff --git a/crates/binstalk-registry/src/common.rs b/crates/binstalk-registry/src/common.rs index f3713b1d..7d4a719a 100644 --- a/crates/binstalk-registry/src/common.rs +++ b/crates/binstalk-registry/src/common.rs @@ -14,7 +14,7 @@ use semver::{Version, VersionReq}; use serde::Deserialize; use serde_json::Error as JsonError; use sha2::{Digest, Sha256}; -use tracing::debug; +use tracing::{debug, instrument}; use crate::{visitor::ManifestVisitor, RegistryError}; @@ -37,6 +37,7 @@ impl DataVerifier for Sha256Digest { } } +#[instrument] pub(super) async fn parse_manifest( client: Client, crate_name: &str, diff --git a/crates/binstalk-registry/src/crates_io_registry.rs b/crates/binstalk-registry/src/crates_io_registry.rs index 179b91fd..9857a610 100644 --- a/crates/binstalk-registry/src/crates_io_registry.rs +++ b/crates/binstalk-registry/src/crates_io_registry.rs @@ -4,7 +4,7 @@ use cargo_toml_workspace::cargo_toml::Manifest; use compact_str::{CompactString, ToCompactString}; use semver::{Comparator, Op as ComparatorOp, Version as SemVersion, VersionReq}; use serde::Deserialize; -use tracing::debug; +use tracing::{debug, instrument}; use crate::{parse_manifest, MatchedVersion, RegistryError}; @@ -105,6 +105,7 @@ async fn fetch_crate_cratesio_version_matched( /// Find the crate by name, get its latest stable version matches `version_req`, /// retrieve its Cargo.toml and infer all its bins. +#[instrument] pub async fn fetch_crate_cratesio_api( client: Client, name: &str, diff --git a/crates/binstalk-registry/src/git_registry.rs b/crates/binstalk-registry/src/git_registry.rs index be158567..c68ff1da 100644 --- a/crates/binstalk-registry/src/git_registry.rs +++ b/crates/binstalk-registry/src/git_registry.rs @@ -10,6 +10,7 @@ use serde_json::{from_slice as json_from_slice, Deserializer as JsonDeserializer use simple_git::{GitCancellationToken, GitUrl, Repository}; use tempfile::TempDir; use tokio::task::spawn_blocking; +use tracing::instrument; use url::Url; use crate::{ @@ -96,6 +97,7 @@ impl GitRegistry { ) } + #[instrument] pub async fn fetch_crate_matched( &self, client: Client, diff --git a/crates/binstalk-registry/src/sparse_registry.rs b/crates/binstalk-registry/src/sparse_registry.rs index e03197ad..c30a0fe5 100644 --- a/crates/binstalk-registry/src/sparse_registry.rs +++ b/crates/binstalk-registry/src/sparse_registry.rs @@ -5,6 +5,7 @@ use compact_str::CompactString; use semver::VersionReq; use serde_json::Deserializer as JsonDeserializer; use tokio::sync::OnceCell; +use tracing::instrument; use url::Url; use crate::{ @@ -77,6 +78,7 @@ impl SparseRegistry { ) } + #[instrument] pub async fn fetch_crate_matched( &self, client: Client, From 0fa315758be1694050714b365fd35209dd7d1668 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 3 Sep 2023 09:19:34 +1000 Subject: [PATCH 1475/2020] feat `detect-targets`: Improve support of non-std glibc/musl (#1343) * feat `detect-targets`: Improve support of non-std glibc/musl Fixed #1329 - Refactor: Create `linux::detect_alternative_targets` to reuse code from other targets - Run `/lib/ld-linux-{cpu_arch}.so.1 --version` for checking glibc support instead of running `ldd --version` since it could be non-std glibc installation and does not provide `/lib/ld-linux-{cpu_arch}.so.1` - Check for non-std glibc and add fallback target `{cpu_arch}-{distro_name}-linux-gnu{abi}` - Add `{cpu_arch}-{distro_name}-linux-musl{abi}` fallback for musl libc, specially for Alpine since it has a `/lib/ld-musl-{cpu_arch}.so.1` - For unknown libc flavor, check for the target provided before fallback to musl Signed-off-by: Jiahao XU * feat `detect-targets`: Support glibc on musl target Signed-off-by: Jiahao XU * feat `detect-targets`: Unify `Libc::{Gnu, Musl}` checks since we can't really tell if we are on gnu or musl Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- crates/detect-targets/src/detect.rs | 46 +++---- crates/detect-targets/src/detect/linux.rs | 147 ++++++++++++++++------ 2 files changed, 124 insertions(+), 69 deletions(-) diff --git a/crates/detect-targets/src/detect.rs b/crates/detect-targets/src/detect.rs index a7863e6c..1850be0a 100644 --- a/crates/detect-targets/src/detect.rs +++ b/crates/detect-targets/src/detect.rs @@ -32,43 +32,25 @@ cfg_if! { /// Check [this issue](https://github.com/ryankurte/cargo-binstall/issues/155) /// for more information. pub async fn detect_targets() -> Vec { - #[cfg(target_os = "linux")] - { - if let Some(target) = get_target_from_rustc().await { - let mut targets = vec![target]; + let target = get_target_from_rustc().await.unwrap_or_else(|| { + guess_host_triple::guess_host_triple() + .unwrap_or(crate::TARGET) + .to_string() + }); - if targets[0].contains("gnu") { - targets.push(targets[0].replace("gnu", "musl")); - } else if targets[0].contains("android") { - targets.push(targets[0].replace("android", "musl")); - } + let mut targets = vec![target]; - targets - } else { - linux::detect_targets_linux().await + cfg_if! { + if #[cfg(target_os = "macos")] { + targets.extend(macos::detect_alternative_targets(&targets[0]).await); + } else if #[cfg(target_os = "windows")] { + targets.extend(windows::detect_alternative_targets(&targets[0])); + } else if #[cfg(target_os = "linux")] { + targets.extend(linux::detect_alternative_targets(&targets[0]).await); } } - #[cfg(not(target_os = "linux"))] - { - let target = get_target_from_rustc().await.unwrap_or_else(|| { - guess_host_triple::guess_host_triple() - .unwrap_or(crate::TARGET) - .to_string() - }); - - let mut targets = vec![target]; - - cfg_if! { - if #[cfg(target_os = "macos")] { - targets.extend(macos::detect_alternative_targets(&targets[0]).await); - } else if #[cfg(target_os = "windows")] { - targets.extend(windows::detect_alternative_targets(&targets[0])); - } - } - - targets - } + targets } /// Figure out what the host target is using `rustc`. diff --git a/crates/detect-targets/src/detect/linux.rs b/crates/detect-targets/src/detect/linux.rs index bedbc775..ea7f4bc0 100644 --- a/crates/detect-targets/src/detect/linux.rs +++ b/crates/detect-targets/src/detect/linux.rs @@ -1,13 +1,12 @@ -use crate::TARGET; +use std::{ + fs, + path::Path, + process::{Output, Stdio}, +}; -use std::process::{Output, Stdio}; - -use guess_host_triple::guess_host_triple; -use tokio::process::Command; - -pub(super) async fn detect_targets_linux() -> Vec { - let target = guess_host_triple().unwrap_or(TARGET); +use tokio::{process::Command, task}; +pub(super) async fn detect_alternative_targets(target: &str) -> impl Iterator { let (prefix, postfix) = target .rsplit_once('-') .expect("unwrap: target always has a -"); @@ -25,51 +24,125 @@ pub(super) async fn detect_targets_linux() -> Vec { let musl_fallback_target = || format!("{prefix}-{}{abi}", "musl"); match libc { - Libc::Gnu => { - // guess_host_triple cannot detect whether the system is using glibc, - // musl libc or other libc. - // - // As such, we need to launch the test ourselves. - if supports_gnu().await { - vec![target.to_string(), musl_fallback_target()] - } else { - vec![musl_fallback_target()] - } - } - Libc::Android => vec![target.to_string(), musl_fallback_target()], + // guess_host_triple cannot detect whether the system is using glibc, + // musl libc or other libc. + // + // On Alpine, you can use `apk add gcompat` to install glibc + // and run glibc programs. + // + // As such, we need to launch the test ourselves. + Libc::Gnu | Libc::Musl => { + let cpu_arch = target + .split_once('-') + .expect("unwrap: target always has a - for cpu_arch") + .0; - _ => vec![target.to_string()], + let has_glibc = task::spawn({ + let glibc_path = format!("/lib/ld-linux-{cpu_arch}.so.1"); + async move { is_gnu_ld(&glibc_path).await } + }); + + let distro_if_has_non_std_glibc = task::spawn(async { + if is_gnu_ld("/usr/bin/ldd").await { + get_distro_name().await + } else { + None + } + }); + + let distro_if_has_musl_dynlib = if get_ld_flavor(&format!( + "/lib/ld-musl-{cpu_arch}.so.1" + )) + .await + == Some(Libc::Musl) + { + get_distro_name().await + } else { + None + }; + + [ + has_glibc + .await + .unwrap_or(false) + .then(|| format!("{cpu_arch}-unknown-linux-gnu{abi}")), + distro_if_has_non_std_glibc + .await + .ok() + .flatten() + .map(|distro_name| format!("{cpu_arch}-{distro_name}-linux-gnu{abi}")), + // Fallback for Linux flavors like Alpine, which has a musl dyn libc + distro_if_has_musl_dynlib + .map(|distro_name| format!("{cpu_arch}-{distro_name}-linux-musl{abi}")), + Some(musl_fallback_target()), + ] + } + Libc::Android | Libc::Unknown => [ + Some(target.to_string()), + Some(musl_fallback_target()), + None, + None, + ], } + .into_iter() + .flatten() } -async fn supports_gnu() -> bool { - Command::new("ldd") +async fn is_gnu_ld(cmd: &str) -> bool { + get_ld_flavor(cmd).await == Some(Libc::Gnu) +} + +async fn get_ld_flavor(cmd: &str) -> Option { + Command::new(cmd) .arg("--version") .stdin(Stdio::null()) .output() .await .ok() .and_then(|Output { stdout, stderr, .. }| { - parse_libc_version_from_ldd_output(&stdout) - .or_else(|| parse_libc_version_from_ldd_output(&stderr)) + Libc::parse(&stdout).or_else(|| Libc::parse(&stderr)) }) - == Some("gnu") -} - -fn parse_libc_version_from_ldd_output(output: &[u8]) -> Option<&'static str> { - let s = String::from_utf8_lossy(output); - if s.contains("musl libc") { - Some("musl") - } else if s.contains("GLIBC") { - Some("gnu") - } else { - None - } } +#[derive(Eq, PartialEq)] enum Libc { Gnu, Musl, Android, Unknown, } + +impl Libc { + fn parse(output: &[u8]) -> Option { + let s = String::from_utf8_lossy(output); + if s.contains("musl libc") { + Some(Self::Musl) + } else if s.contains("GLIBC") { + Some(Self::Gnu) + } else { + None + } + } +} + +async fn get_distro_name() -> Option { + task::spawn_blocking(get_distro_name_blocking) + .await + .ok() + .flatten() +} + +fn get_distro_name_blocking() -> Option { + match fs::read_to_string("/etc/os-release") { + Ok(os_release) => os_release + .lines() + .find_map(|line| line.strip_prefix("ID=\"")?.strip_suffix('"')) + .map(ToString::to_string), + Err(_) => (Path::new("/etc/nix/nix.conf").is_file() + && ["/nix/store", "/nix/var/profiles"] + .into_iter() + .map(Path::new) + .all(Path::is_dir)) + .then_some("nixos".to_string()), + } +} From d657fbe5186cc90a6b6f1a29f0760da929e57074 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Sep 2023 02:10:48 +0000 Subject: [PATCH 1476/2020] build(deps): bump actions/checkout from 3 to 4 (#1346) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/cache-cleanup.yml | 2 +- .github/workflows/ci.yml | 6 +++--- .github/workflows/gh-action.yml | 2 +- .github/workflows/install-script.yml | 4 ++-- .github/workflows/release-build.yml | 4 ++-- .github/workflows/release-pr.yml | 2 +- .github/workflows/release.yml | 2 +- .github/workflows/shellcheck.yml | 2 +- .github/workflows/upgrade-transitive-deps.yml | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/cache-cleanup.yml b/.github/workflows/cache-cleanup.yml index 9af601fb..92f430b8 100644 --- a/.github/workflows/cache-cleanup.yml +++ b/.github/workflows/cache-cleanup.yml @@ -12,7 +12,7 @@ jobs: cleanup: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Cleanup run: | set -euxo pipefail diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8fb1186b..0238e24a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: CARGO_BUILD_TARGET: ${{ matrix.target }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/actions/just-setup env: # just-setup use binstall to install sccache, @@ -86,7 +86,7 @@ jobs: env: CARGO_BUILD_TARGET: ${{ matrix.target }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/actions/just-setup with: tools: cargo-hack @@ -117,7 +117,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: ./.github/actions/just-setup - run: just toolchain rustfmt,clippy diff --git a/.github/workflows/gh-action.yml b/.github/workflows/gh-action.yml index b09f1841..ae86c47e 100644 --- a/.github/workflows/gh-action.yml +++ b/.github/workflows/gh-action.yml @@ -21,7 +21,7 @@ jobs: matrix: os: [ macos-latest, ubuntu-latest, windows-latest ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install cargo-binstall uses: ./ # uses action.yml from root of the repo diff --git a/.github/workflows/install-script.yml b/.github/workflows/install-script.yml index 2f2cb1c7..26f68e22 100644 --- a/.github/workflows/install-script.yml +++ b/.github/workflows/install-script.yml @@ -35,7 +35,7 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set `CARGO_HOME` if: matrix.set_cargo_home == 't' @@ -64,7 +64,7 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set `CARGO_HOME` if: matrix.set_cargo_home == 't' diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index feba7004..64c6796d 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -51,7 +51,7 @@ jobs: JUST_ENABLE_H3: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Override release profile lto settings if: inputs.CARGO_PROFILE_RELEASE_LTO @@ -117,7 +117,7 @@ jobs: JUST_FOR_RELEASE: true steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: taiki-e/install-action@v2 with: diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 4baceb36..9518882a 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -38,7 +38,7 @@ jobs: contents: write runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Configure toolchain run: | rustup toolchain install --profile minimal --no-self-update nightly diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8b97fbe6..e82ab9a4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -27,7 +27,7 @@ jobs: needs: info runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Push lib release tag if: needs.info.outputs.crate != 'cargo-binstall' uses: mathieudutour/github-tag-action@v6.1 diff --git a/.github/workflows/shellcheck.yml b/.github/workflows/shellcheck.yml index 6a8ba778..b7145e64 100644 --- a/.github/workflows/shellcheck.yml +++ b/.github/workflows/shellcheck.yml @@ -24,7 +24,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: taiki-e/install-action@v2 with: tool: fd-find diff --git a/.github/workflows/upgrade-transitive-deps.yml b/.github/workflows/upgrade-transitive-deps.yml index a235906b..76779b3d 100644 --- a/.github/workflows/upgrade-transitive-deps.yml +++ b/.github/workflows/upgrade-transitive-deps.yml @@ -10,7 +10,7 @@ jobs: name: Upgrade & Open Pull Request runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: persist-credentials: true From 76a692224dbad106047988b6df82b8bf98b3d4c3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 7 Sep 2023 00:17:43 +1000 Subject: [PATCH 1477/2020] Fix `detect-targets` on Linux and add CI testing (#1344) * Testing: Add `detect-targets/src/main.rs` Signed-off-by: Jiahao XU * Fix `detect-targets` linux: `guess_host_triple` could return wrong libc info so it has to check it manually instead of simply providing alternatives like other OSes. Signed-off-by: Jiahao XU * Fix `get_ld_flavor` for Alpine's gcompat glibc Its output is different from regular glibc, so we need to hardcode that particular cases. Signed-off-by: Jiahao XU * Fix detection of alpine specific musl target Signed-off-by: Jiahao XU * Add ci testing for Alpine Signed-off-by: Jiahao XU * Add CI test for detect-targets on ubuntu Signed-off-by: Jiahao XU * Refactor `get_ld_flavor` Signed-off-by: Jiahao XU * Fix shellcheck Signed-off-by: Jiahao XU * Add more CI test for ubuntu and fixed typo in it Signed-off-by: Jiahao XU * Rm distro specific target as it breaks `cargo-install` fallback Signed-off-by: Jiahao XU * Make sure all binaries are built in CI Signed-off-by: Jiahao XU * Add `package.metadata.binstall` for `detect-targets` Signed-off-by: Jiahao XU * Fix justfile Signed-off-by: Jiahao XU * Fix `detect-targets-{alpine, ubuntu}-test` Signed-off-by: Jiahao XU * Fix `detect-targets-ubuntu-test` Signed-off-by: Jiahao XU * Fix `debug-targets-ubuntu-test` Signed-off-by: Jiahao XU * `set -exuo pipefail` in `detect-targets-ubuntu-test` Signed-off-by: Jiahao XU * Simplify `detect-targets-*-test`: Use `Swatinem/rust-cache@v2` directly instead of using `just-setup` Signed-off-by: Jiahao XU * Rm dup steps in `detect-targets-ubuntu-test` Signed-off-by: Jiahao XU * Add `ls` to detect-targets-alpine-test for debugging Signed-off-by: Jiahao XU * FIx `detect-targets-alpine-test` Signed-off-by: Jiahao XU * Fix `get_ld_flavor` Signed-off-by: Jiahao XU * Fix `linux::detect_targets` on ubuntu & glibc system Signed-off-by: Jiahao XU * FIx `linux::detect_targets` glibc checking Check dynlib suffix Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 35 ++++++ crates/detect-targets/Cargo.toml | 3 + crates/detect-targets/src/detect.rs | 12 +- crates/detect-targets/src/detect/linux.rs | 142 ++++++++++------------ crates/detect-targets/src/main.rs | 17 +++ justfile | 15 +++ test-detect-targets-musl.sh | 20 +++ 7 files changed, 159 insertions(+), 85 deletions(-) create mode 100644 crates/detect-targets/src/main.rs create mode 100755 test-detect-targets-musl.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0238e24a..442be421 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -131,6 +131,39 @@ jobs: CARGO_PROFILE_RELEASE_LTO: no CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 4 + detect-targets-alpine-test: + runs-on: ubuntu-latest + env: + CARGO_BUILD_TARGET: x86_64-unknown-linux-musl + TARGET: x86_64-unknown-linux-musl + steps: + - uses: actions/checkout@v3 + - name: Install x86_64-unknown-linux-musl target + run: rustup target add $TARGET + - uses: Swatinem/rust-cache@v2 + - name: Build detect-targets + run: | + pip3 install -r zigbuild-requirements.txt + cd crates/detect-targets && cargo zigbuild --target $TARGET + - name: Run test in alpine + run: | + docker run --rm \ + --mount src="$PWD/target/$TARGET/debug/detect-targets",dst=/usr/local/bin/detect-targets,type=bind \ + --mount src="$PWD/test-detect-targets-musl.sh",dst=/usr/local/bin/test.sh,type=bind \ + alpine test.sh "$TARGET" + + detect-targets-ubuntu-test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: Swatinem/rust-cache@v2 + - name: Build detect-targets + run: cargo build --bin detect-targets + - name: Run test in ubuntu + run: | + set -exuo pipefail + [ "$(./target/debug/detect-targets)" = "$(printf '%s\n%s' x86_64-unknown-linux-gnu x86_64-unknown-linux-musl)" ] + # Dummy job to have a stable name for the "all tests pass" requirement tests-pass: name: Tests pass @@ -139,6 +172,8 @@ jobs: - cross-check - lint - release-builds + - detect-targets-alpine-test + - detect-targets-ubuntu-test if: always() # always run even if dependencies fail runs-on: ubuntu-latest steps: diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 38a6bfce..37b5049d 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -20,3 +20,6 @@ windows-dll = { version = "0.4.1", features = ["windows"], default-features = fa [dev-dependencies] tokio = { version = "1.28.2", features = ["macros"], default-features = false } + +[package.metadata.binstall] +pkg-url = "{ repo }/releases/download/v{ version }/cargo-binstall-{ target }.full.{ archive-format }" diff --git a/crates/detect-targets/src/detect.rs b/crates/detect-targets/src/detect.rs index 1850be0a..d9fb9df6 100644 --- a/crates/detect-targets/src/detect.rs +++ b/crates/detect-targets/src/detect.rs @@ -38,19 +38,21 @@ pub async fn detect_targets() -> Vec { .to_string() }); - let mut targets = vec![target]; - cfg_if! { if #[cfg(target_os = "macos")] { + let mut targets = vec![target]; targets.extend(macos::detect_alternative_targets(&targets[0]).await); + targets } else if #[cfg(target_os = "windows")] { + let mut targets = vec![target]; targets.extend(windows::detect_alternative_targets(&targets[0])); + targets } else if #[cfg(target_os = "linux")] { - targets.extend(linux::detect_alternative_targets(&targets[0]).await); + // Linux is a bit special, since the result from `guess_host_triple` + // might be wrong about whether glibc or musl is used. + linux::detect_targets(target).await } } - - targets } /// Figure out what the host target is using `rustc`. diff --git a/crates/detect-targets/src/detect/linux.rs b/crates/detect-targets/src/detect/linux.rs index ea7f4bc0..b2c2756f 100644 --- a/crates/detect-targets/src/detect/linux.rs +++ b/crates/detect-targets/src/detect/linux.rs @@ -1,12 +1,11 @@ use std::{ - fs, - path::Path, process::{Output, Stdio}, + str, }; use tokio::{process::Command, task}; -pub(super) async fn detect_alternative_targets(target: &str) -> impl Iterator { +pub(super) async fn detect_targets(target: String) -> Vec { let (prefix, postfix) = target .rsplit_once('-') .expect("unwrap: target always has a -"); @@ -37,71 +36,81 @@ pub(super) async fn detect_alternative_targets(target: &str) -> impl Iterator = [ + format!("/lib/ld-linux-{cpu_arch_suffix}.so.2"), + format!("/lib/{cpu_arch}-linux-gnu/ld-linux-{cpu_arch_suffix}.so.2"), + format!("/usr/lib/{cpu_arch}-linux-gnu/ld-linux-{cpu_arch_suffix}.so.2"), + ] + .into_iter() + .map(|p| AutoAbortHandle(tokio::spawn(is_gnu_ld(p)))) + .collect(); + + let has_glibc = async move { + for mut handle in handles { + if let Ok(true) = (&mut handle.0).await { + return true; + } } - }); - let distro_if_has_musl_dynlib = if get_ld_flavor(&format!( - "/lib/ld-musl-{cpu_arch}.so.1" - )) - .await - == Some(Libc::Musl) - { - get_distro_name().await - } else { - None - }; + false + } + .await; [ - has_glibc - .await - .unwrap_or(false) - .then(|| format!("{cpu_arch}-unknown-linux-gnu{abi}")), - distro_if_has_non_std_glibc - .await - .ok() - .flatten() - .map(|distro_name| format!("{cpu_arch}-{distro_name}-linux-gnu{abi}")), - // Fallback for Linux flavors like Alpine, which has a musl dyn libc - distro_if_has_musl_dynlib - .map(|distro_name| format!("{cpu_arch}-{distro_name}-linux-musl{abi}")), + has_glibc.then(|| format!("{cpu_arch}-unknown-linux-gnu{abi}")), Some(musl_fallback_target()), ] } - Libc::Android | Libc::Unknown => [ - Some(target.to_string()), - Some(musl_fallback_target()), - None, - None, - ], + Libc::Android | Libc::Unknown => [Some(target.clone()), Some(musl_fallback_target())], } .into_iter() .flatten() + .collect() } -async fn is_gnu_ld(cmd: &str) -> bool { - get_ld_flavor(cmd).await == Some(Libc::Gnu) +async fn is_gnu_ld(cmd: String) -> bool { + get_ld_flavor(&cmd).await == Some(Libc::Gnu) } async fn get_ld_flavor(cmd: &str) -> Option { - Command::new(cmd) + let Output { + status, + stdout, + stderr, + } = Command::new(cmd) .arg("--version") .stdin(Stdio::null()) .output() .await - .ok() - .and_then(|Output { stdout, stderr, .. }| { - Libc::parse(&stdout).or_else(|| Libc::parse(&stderr)) - }) + .ok()?; + + const ALPINE_GCOMPAT: &str = r#"This is the gcompat ELF interpreter stub. +You are not meant to run this directly. +"#; + + if status.success() { + // Executing glibc ldd or /lib/ld-linux-{cpu_arch}.so.1 will always + // succeeds. + String::from_utf8_lossy(&stdout) + .contains("GLIBC") + .then_some(Libc::Gnu) + } else if status.code() == Some(1) { + // On Alpine, executing both the gcompat glibc and the ldd and + // /lib/ld-musl-{cpu_arch}.so.1 will fail with exit status 1. + if str::from_utf8(&stdout).as_deref() == Ok(ALPINE_GCOMPAT) { + // Alpine's gcompat package will output ALPINE_GCOMPAT to stdout + Some(Libc::Gnu) + } else if String::from_utf8_lossy(&stderr).contains("musl libc") { + // Alpine/s ldd and musl dynlib will output to stderr + Some(Libc::Musl) + } else { + None + } + } else { + None + } } #[derive(Eq, PartialEq)] @@ -112,37 +121,10 @@ enum Libc { Unknown, } -impl Libc { - fn parse(output: &[u8]) -> Option { - let s = String::from_utf8_lossy(output); - if s.contains("musl libc") { - Some(Self::Musl) - } else if s.contains("GLIBC") { - Some(Self::Gnu) - } else { - None - } - } -} - -async fn get_distro_name() -> Option { - task::spawn_blocking(get_distro_name_blocking) - .await - .ok() - .flatten() -} - -fn get_distro_name_blocking() -> Option { - match fs::read_to_string("/etc/os-release") { - Ok(os_release) => os_release - .lines() - .find_map(|line| line.strip_prefix("ID=\"")?.strip_suffix('"')) - .map(ToString::to_string), - Err(_) => (Path::new("/etc/nix/nix.conf").is_file() - && ["/nix/store", "/nix/var/profiles"] - .into_iter() - .map(Path::new) - .all(Path::is_dir)) - .then_some("nixos".to_string()), +struct AutoAbortHandle(task::JoinHandle); + +impl Drop for AutoAbortHandle { + fn drop(&mut self) { + self.0.abort(); } } diff --git a/crates/detect-targets/src/main.rs b/crates/detect-targets/src/main.rs new file mode 100644 index 00000000..fbaa187f --- /dev/null +++ b/crates/detect-targets/src/main.rs @@ -0,0 +1,17 @@ +use std::io; + +use detect_targets::detect_targets; +use tokio::runtime; + +fn main() -> io::Result<()> { + let targets = runtime::Builder::new_current_thread() + .enable_all() + .build()? + .block_on(detect_targets()); + + for target in targets { + println!("{target}"); + } + + Ok(()) +} diff --git a/justfile b/justfile index 11b1d1f7..e493a0c7 100644 --- a/justfile +++ b/justfile @@ -297,6 +297,9 @@ package-prepare: build package-dir just get-output detect-wasi{{output-ext}} packages/prep -just get-output detect-wasi.dSYM packages/prep + just get-output detect-targets{{output-ext}} packages/prep + -just get-output detect-targets.dSYM packages/prep + # when https://github.com/rust-lang/cargo/pull/11384 lands, we can use # -just get-output cargo_binstall.dwp packages/prep # underscored dwp name needs to remain for debuggers to find the file properly @@ -308,6 +311,9 @@ package-prepare: build package-dir just get-output detect-wasi packages/prep -cp {{output-folder}}/deps/detect_wasi-*.dwp packages/prep/detect_wasi.dwp + just get-output detect-targets packages/prep + -cp {{output-folder}}/deps/detect_target-*.dwp packages/prep/detect_target.dwp + # underscored pdb name needs to remain for debuggers to find the file properly # read from deps because sometimes cargo doesn't copy the pdb to the output folder [windows] @@ -318,6 +324,9 @@ package-prepare: build package-dir just get-output detect-wasi.exe packages/prep -just get-output deps/detect_wasi.pdb packages/prep + just get-output detect-targets.exe packages/prep + -just get-output deps/detect_target.pdb packages/prep + # we don't get dSYM bundles for universal binaries; unsure if it's even a thing [macos] lipo-prepare: package-dir @@ -335,6 +344,11 @@ lipo-prepare: package-dir just target=x86_64h-apple-darwin get-output detect-wasi{{output-ext}} packages/prep/x64h lipo -create -output packages/prep/detect-wasi{{output-ext}} packages/prep/{arm64,x64,x64h}/detect-wasi{{output-ext}} + just target=aarch64-apple-darwin get-output detect-targets{{output-ext}} packages/prep/arm64 + just target=x86_64-apple-darwin get-output detect-targets{{output-ext}} packages/prep/x64 + just target=x86_64h-apple-darwin get-output detect-targets{{output-ext}} packages/prep/x64h + lipo -create -output packages/prep/detect-targets{{output-ext}} packages/prep/{arm64,x64,x64h}/detect-targets{{output-ext}} + rm -rf packages/prep/{arm64,x64,x64h} @@ -370,6 +384,7 @@ repackage-lipo: package-dir lipo -create -output packages/prep/{{output-filename}} packages/prep/{arm64,x64,x64h}/{{output-filename}} lipo -create -output packages/prep/detect-wasi packages/prep/{arm64,x64,x64h}/detect-wasi + lipo -create -output packages/prep/detect-targets packages/prep/{arm64,x64,x64h}/detect-targets ./packages/prep/{{output-filename}} -vV diff --git a/test-detect-targets-musl.sh b/test-detect-targets-musl.sh new file mode 100755 index 00000000..9613120f --- /dev/null +++ b/test-detect-targets-musl.sh @@ -0,0 +1,20 @@ +#!/bin/ash + +# shellcheck shell=dash + +set -exuo pipefail + +TARGET=${1?} + +[ "$(detect-targets)" = "$TARGET" ] + +apk update +apk add gcompat + +ls -lsha /lib + +GNU_TARGET=$(echo "$TARGET" | sed 's/musl/gnu/') + +[ "$(detect-targets)" = "$(printf '%s\n%s' "$GNU_TARGET" "$TARGET")" ] + +echo From b36674a1c4f14211e70998bde91b23e7d7f1d15d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 7 Sep 2023 01:25:18 +0000 Subject: [PATCH 1478/2020] build(deps): bump actions/checkout from 3 to 4 (#1348) Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/checkout dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 442be421..c90073e3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,7 +137,7 @@ jobs: CARGO_BUILD_TARGET: x86_64-unknown-linux-musl TARGET: x86_64-unknown-linux-musl steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Install x86_64-unknown-linux-musl target run: rustup target add $TARGET - uses: Swatinem/rust-cache@v2 @@ -155,7 +155,7 @@ jobs: detect-targets-ubuntu-test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 - name: Build detect-targets run: cargo build --bin detect-targets From c6c36316fde9efcd6f93526fade496904722a84e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 8 Sep 2023 14:08:18 +1000 Subject: [PATCH 1479/2020] build(deps): update file-format requirement from 0.19.0 to 0.20.0 in /crates/bin (#1349) build(deps): update file-format requirement in /crates/bin Updates the requirements on [file-format](https://github.com/mmalecot/file-format) to permit the latest version. - [Release notes](https://github.com/mmalecot/file-format/releases) - [Changelog](https://github.com/mmalecot/file-format/blob/main/CHANGELOG.md) - [Commits](https://github.com/mmalecot/file-format/compare/v0.19.0...v0.20.0) --- updated-dependencies: - dependency-name: file-format dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- crates/bin/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 367fd09b..8a09d2ec 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -27,7 +27,7 @@ binstalk-manifests = { path = "../binstalk-manifests", version = "0.8.1" } clap = { version = "4.3.0", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" -file-format = { version = "0.19.0", default-features = false } +file-format = { version = "0.20.0", default-features = false } home = "0.5.5" log = { version = "0.4.18", features = ["std"] } miette = "5.9.0" From 984a2ef938834fd1479d83227022c1b74cd7b075 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 8 Sep 2023 05:26:56 +0000 Subject: [PATCH 1480/2020] dep: Upgrade transitive dependencies (#1351) Co-authored-by: github-actions --- Cargo.lock | 86 +++++++++++++++++++++++++++--------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8f13e432..15c4c1b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -153,7 +153,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -485,9 +485,9 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "bytesize" @@ -625,7 +625,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -812,7 +812,7 @@ checksum = "ac4b68190bad25c00b64ea19767b2321a037fc0e5bea7563d5d8e35e04b19c95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -950,9 +950,9 @@ dependencies = [ [[package]] name = "faster-hex" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9042d281a5eec0f2387f8c3ea6c4514e2cf2732c90a85aaf383b761ee3b290d" +checksum = "239f7bfb930f820ab16a9cd95afc26f88264cf6905c960b340a615384aa3338a" dependencies = [ "serde", ] @@ -974,9 +974,9 @@ checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" [[package]] name = "file-format" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2c4bd83e5092ecd961fe2cfba1fa3922347823eeb92bed5eb7e2a09ffe9d2db" +checksum = "3cfd758182d326b9360a94cb47b10907b83cb1967235f4f20688ac3ef0e40651" [[package]] name = "filetime" @@ -1104,7 +1104,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -1369,9 +1369,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01e476b4e156f6044d35bf1ce2079d97b7207515cfb5a2bb6fcd489bb697d700" +checksum = "0a825babda995d788e30d306a49dacd1e93d5f5d33d53c7682d0347cef40333c" dependencies = [ "bstr", "itoa", @@ -2356,7 +2356,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -2467,9 +2467,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.2" +version = "2.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5486aed0026218e61b8a01d5fbd5a0a134649abb71a0e53b7bc088529dced86e" +checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" [[package]] name = "memmap2" @@ -2518,7 +2518,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -2645,9 +2645,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ac5bbd07aea88c60a577a1ce218075ffd59208b2d7ca97adf9bfc5aeb21ebe" +checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" dependencies = [ "memchr", ] @@ -2681,7 +2681,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -2692,9 +2692,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.92" +version = "0.9.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db7e971c2c2bba161b2d2fdf37080177eff520b3bc044787c7f1f5f9e78d869b" +checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" dependencies = [ "cc", "libc", @@ -2766,7 +2766,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -3032,9 +3032,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" +checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" [[package]] name = "reqwest" @@ -3313,7 +3313,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -3501,7 +3501,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -3545,9 +3545,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.29" +version = "2.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" dependencies = [ "proc-macro2", "quote", @@ -3596,22 +3596,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.47" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a802ec30afc17eee47b2855fc72e0c4cd62be9b4efe6591edde0ec5bd68d8f" +checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.47" +version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bb623b56e39ab7dcd4b1b98bb6c8f8d907ed255b18de254088016b27a8ee19b" +checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -3695,7 +3695,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -3772,9 +3772,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" +checksum = "de0a3ab2091e52d7299a39d098e200114a972df0a7724add02a273aa9aada592" dependencies = [ "serde", "serde_spanned", @@ -3793,9 +3793,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.19.14" +version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.0.0", "serde", @@ -3830,7 +3830,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", ] [[package]] @@ -4076,9 +4076,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.3.3" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" dependencies = [ "same-file", "winapi-util", @@ -4120,7 +4120,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", "wasm-bindgen-shared", ] @@ -4154,7 +4154,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.29", + "syn 2.0.31", "wasm-bindgen-backend", "wasm-bindgen-shared", ] From cdb864fcb5efafd68042f1e2d77a57055a088c4a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Sep 2023 13:07:36 +1000 Subject: [PATCH 1481/2020] build(deps): update toml_edit requirement from 0.19.10 to 0.20.0 in /crates/binstalk-manifests (#1355) build(deps): update toml_edit requirement in /crates/binstalk-manifests Updates the requirements on [toml_edit](https://github.com/toml-rs/toml) to permit the latest version. - [Commits](https://github.com/toml-rs/toml/compare/v0.19.10...v0.20.0) --- updated-dependencies: - dependency-name: toml_edit dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- crates/binstalk-manifests/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 980e4788..b9c1ebca 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.96" thiserror = "1.0.40" -toml_edit = { version = "0.19.10", features = ["serde"] } +toml_edit = { version = "0.20.0", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] From f26ab41961766b497c6f60e90670fdd35db83c32 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Sep 2023 13:07:40 +1000 Subject: [PATCH 1482/2020] build(deps): update toml_edit requirement from 0.19.11 to 0.20.0 in /crates/binstalk-registry (#1356) build(deps): update toml_edit requirement in /crates/binstalk-registry Updates the requirements on [toml_edit](https://github.com/toml-rs/toml) to permit the latest version. - [Commits](https://github.com/toml-rs/toml/compare/v0.19.11...v0.20.0) --- updated-dependencies: - dependency-name: toml_edit dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- crates/binstalk-registry/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index c02fc812..1116b3f4 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -34,7 +34,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } -toml_edit = { version = "0.19.11", features = ["serde"] } +toml_edit = { version = "0.20.0", features = ["serde"] } binstalk-downloader = { version = "0.7.1", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } [features] From f31db762b410432a4315c158aca209c5facd4c55 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 14 Sep 2023 23:31:00 +1000 Subject: [PATCH 1483/2020] dep: Bump gix from v0.52.0 => v0.53.1 (#1354) * dep: Bump gix from v0.52.0 => v0.53.1 Signed-off-by: Jiahao XU * Fix `gix` compilation: Enable `gix/max-performance-safe` without this feature, `ThreadSafeRepository` does not implement `Sync`, causes the `binstalk-registry` compilation to fail. Signed-off-by: Jiahao XU * Enable `gix/comfort` for progress tracing Signed-off-by: Jiahao XU * Fixed gix progress tracking: Enable `gix/progress-tree` Signed-off-by: Jiahao XU * Rm feature `gix/{comfort, progress-tree}` Since they do not enable progress support and merely adds bloat. Signed-off-by: Jiahao XU * Fix gix progress logging: Allow logging from simple-git Signed-off-by: Jiahao XU * Re-enable feature `gix/comfort` for more readable logging Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- Cargo.lock | 277 ++++++++-------------- crates/bin/src/logging.rs | 1 + crates/simple-git/Cargo.toml | 11 +- crates/simple-git/src/progress_tracing.rs | 106 +++++---- 4 files changed, 164 insertions(+), 231 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 15c4c1b5..c93f0198 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,18 +17,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" -[[package]] -name = "ahash" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" -dependencies = [ - "cfg-if", - "getrandom", - "once_cell", - "version_check", -] - [[package]] name = "alloc-no-stdlib" version = "2.0.4" @@ -1175,12 +1163,11 @@ checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "gix" -version = "0.52.0" +version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35ed1401a11506b45361746507a7c94c546574ddd7dfc2717f8941e30070254" +checksum = "06a8c9f9452078f474fecd2880de84819b8c77224ab62273275b646bf785f906" dependencies = [ "gix-actor", - "gix-archive", "gix-attributes", "gix-commitgraph", "gix-config", @@ -1197,7 +1184,7 @@ dependencies = [ "gix-ignore", "gix-index", "gix-lock", - "gix-mailmap", + "gix-macros", "gix-negotiate", "gix-object", "gix-odb", @@ -1209,6 +1196,7 @@ dependencies = [ "gix-ref", "gix-refspec", "gix-revision", + "gix-revwalk", "gix-sec", "gix-submodule", "gix-tempfile", @@ -1220,12 +1208,9 @@ dependencies = [ "gix-validate", "gix-worktree", "gix-worktree-state", - "gix-worktree-stream", - "log", "once_cell", "parking_lot", "reqwest", - "signal-hook", "smallvec", "thiserror", "unicode-normalization", @@ -1233,9 +1218,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f8a773b5385e9d2f88bd879fb763ec1212585f6d630ebe13adb7bac93bce975" +checksum = "8e8c6778cc03bca978b2575a03e04e5ba6f430a9dd9b0f1259f0a8a9a5e5cc66" dependencies = [ "bstr", "btoi", @@ -1245,31 +1230,18 @@ dependencies = [ "winnow", ] -[[package]] -name = "gix-archive" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e560a446515b9890fbd84a4d6ec23b52f040a801d9623505cb860c077b021ea" -dependencies = [ - "bstr", - "gix-date", - "gix-object", - "gix-worktree-stream", - "thiserror", -] - [[package]] name = "gix-attributes" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1ecae08f2625d8abcd27570fa2f9c2fcf01a1cd968a8d90858e63f8e08211a3" +checksum = "d3548b76829d33a7160a4685134df16de0cc3b77418302e8a9969f0b662e698f" dependencies = [ "bstr", "gix-glob", "gix-path", "gix-quote", + "gix-trace", "kstring", - "log", "smallvec", "thiserror", "unicode-bom", @@ -1304,9 +1276,9 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3845b3c8722a0e97d9d593c05d384bb1275a5865f1cd967523a3780ffc93168e" +checksum = "4676ede3a7d37e7028e2889830349a6aca22efc1d2f2dd9fa3351c1a8ddb0c6a" dependencies = [ "bstr", "gix-chunk", @@ -1318,9 +1290,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a312d120231dc8d5a2e34928a9a2098c1d3dbad76f0660ee38d0b1a87de5271" +checksum = "1108c4ac88248dd25cc8ab0d0dae796e619fb72d92f88e30e00b29d61bb93cc4" dependencies = [ "bstr", "gix-config-value", @@ -1329,7 +1301,6 @@ dependencies = [ "gix-path", "gix-ref", "gix-sec", - "log", "memchr", "once_cell", "smallvec", @@ -1340,9 +1311,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901e184f3d4f99bf015ca13b5ccacb09e26b400f198fe2066651089e2c490680" +checksum = "ea7505b97f4d8e7933e29735a568ba2f86d8de466669d9f0e8321384f9972f47" dependencies = [ "bitflags 2.4.0", "bstr", @@ -1353,9 +1324,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2988e917f7ee4a99072354d5885ca14c9e7039de8246e96e300ab3e5060cad19" +checksum = "363e16428096b7311c380afe972831ea8b58fc1a1d1621dbdd865caf34921a54" dependencies = [ "bstr", "gix-command", @@ -1369,9 +1340,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a825babda995d788e30d306a49dacd1e93d5f5d33d53c7682d0347cef40333c" +checksum = "fc7df669639582dc7c02737642f76890b03b5544e141caba68a7d6b4eb551e0d" dependencies = [ "bstr", "itoa", @@ -1381,21 +1352,20 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "016be5f0789da595b61d15a862476be0cbae8fd29e2c91d66770fdd8df145773" +checksum = "b45e342d148373bd9070d557e6fb1280aeae29a3e05e32506682d027278501eb" dependencies = [ "gix-hash", "gix-object", - "imara-diff", "thiserror", ] [[package]] name = "gix-discover" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b74760d912716b287357dae5654ad84be12a2a75a721f00b58ecdd65496e024" +checksum = "da4cacda5ee9dd1b38b0e2506834e40e66c08cf050ef55c344334c76745f277b" dependencies = [ "bstr", "dunce", @@ -1408,9 +1378,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f77decb545f63a52852578ef5f66ecd71017ffc1983d551d5fa2328d6d9817f" +checksum = "f414c99e1a7abc69b21f3225a6539d203b0513f1d1d448607c4ea81cdcf9ee59" dependencies = [ "bytes", "bytesize", @@ -1432,9 +1402,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5495cdd54f4c3bb05b35a525cd39df1643362d917a7e03f112564c2825feb4" +checksum = "afbdb2ffae9e595d70f8c7b40953a82706d536bb8107874c258fe6368389832b" dependencies = [ "bstr", "encoding_rs", @@ -1452,18 +1422,18 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d5089f3338647776733a75a800a664ab046f56f21c515fa4722e395f877ef8" +checksum = "404795da3d4c660c9ab6c3b2ad76d459636d1e1e4b37b0c7ff68eee898c298d4" dependencies = [ "gix-features", ] [[package]] name = "gix-glob" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c753299d14a29ca06d7adc8464c16f1786eb97bc9a44a796ad0a37f57235a494" +checksum = "e3ac79c444193b0660fe0c0925d338bd338bd643e32138784dccfb12c628b892" dependencies = [ "bitflags 2.4.0", "bstr", @@ -1473,9 +1443,9 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d4796bac3aaf0c2f8bea152ca924ae3bdc5f135caefe6431116bcd67e98eab9" +checksum = "2ccf425543779cddaa4a7c62aba3fa9d90ea135b160be0a72dd93c063121ad4a" dependencies = [ "faster-hex", "thiserror", @@ -1483,9 +1453,9 @@ dependencies = [ [[package]] name = "gix-hashtable" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45ad1b70efd1e77c32729d5a522f0c855e9827242feb10318e1acaf2259222c0" +checksum = "409268480841ad008e81c17ca5a293393fbf9f2b6c2f85b8ab9de1f0c5176a16" dependencies = [ "gix-hash", "hashbrown 0.14.0", @@ -1494,9 +1464,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b355098421f5cc91a0e5f1ef3600ae250c13b7c3c472b18c361897c6081bfbb1" +checksum = "04ff3ec0fd9fb5bb0ae36b252976b0bc94b45ba969b1639f7402425d9d6baf67" dependencies = [ "bstr", "gix-glob", @@ -1506,9 +1476,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.22.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9738fc58ca30e232c7b1be8e8ab52b072979acb9bf3fa97662b5b23c0c6fbca" +checksum = "0e9599fc30b3d6aad231687a403f85dfa36ae37ccf1b68ee1f621ad5b7fc7a0d" dependencies = [ "bitflags 2.4.0", "bstr", @@ -1529,9 +1499,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "8.0.0" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de4363023577b31906b476b34eefbf76931363ec574f88b5c7b6027789f1e3ce" +checksum = "1568c3d90594c60d52670f325f5db88c2d572e85c8dd45fabc23d91cadb0fd52" dependencies = [ "gix-tempfile", "gix-utils", @@ -1539,22 +1509,21 @@ dependencies = [ ] [[package]] -name = "gix-mailmap" -version = "0.17.0" +name = "gix-macros" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "244a4a6f08e8104110675de649ccd20fe1d1116783063920e19aa7da197a4ad0" +checksum = "9d8acb5ee668d55f0f2d19a320a3f9ef67a6999ad483e11135abcc2464ed18b6" dependencies = [ - "bstr", - "gix-actor", - "gix-date", - "thiserror", + "proc-macro2", + "quote", + "syn 2.0.31", ] [[package]] name = "gix-negotiate" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0b0ea711559f843b8286cdf71ea421560c072120fae35a949bcf6b068b73745" +checksum = "208b25af0e59d04e7313479fc949bd68e11a065b51718995139cefac498e24df" dependencies = [ "bitflags 2.4.0", "gix-commitgraph", @@ -1568,9 +1537,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4283b7b5e9438afe2e3183e9acd1c77e750800937bb56c06b750822d2ff6d95" +checksum = "3e5528d5b2c984044d547e696e44a8c45fa122e83cd8c2ac1da69bd474336be8" dependencies = [ "bstr", "btoi", @@ -1587,9 +1556,9 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dd295ca055d8270de23b6037176b03782de753f75c84dabb7713f7d7e229fd" +checksum = "d0446eca295459deb3d6dd6ed7d44a631479f1b7381d8087166605c7a9f717c6" dependencies = [ "arc-swap", "gix-date", @@ -1606,20 +1575,18 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.41.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e645c38138216b9de2f6279bfb1b8567de6f4539f8fa2761eea961d991f448" +checksum = "be19ee650300d7cbac5829b637685ec44a8d921a7c2eaff8a245d8f2f008870c" dependencies = [ "clru", "gix-chunk", - "gix-diff", "gix-features", "gix-hash", "gix-hashtable", "gix-object", "gix-path", "gix-tempfile", - "gix-traverse", "memmap2", "parking_lot", "smallvec", @@ -1629,9 +1596,9 @@ dependencies = [ [[package]] name = "gix-packetline" -version = "0.16.5" +version = "0.16.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a374cb5eba089e3c123df4d996eb00da411bb90ec92cb35bffeeb2d22ee106a" +checksum = "d6df0b75361353e7c0a6d72d49617a37379a7a22cba4569ae33a7720a4c8755a" dependencies = [ "bstr", "faster-hex", @@ -1640,9 +1607,9 @@ dependencies = [ [[package]] name = "gix-packetline-blocking" -version = "0.16.5" +version = "0.16.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e39142400d3faa7057680ed3947c3b70e46b6a0b16a7c242ec8f0249e37518ba" +checksum = "7d8395f7501c84d6a1fe902035fdfd8cd86d89e2dd6be0200ec1a72fd3c92d39" dependencies = [ "bstr", "faster-hex", @@ -1651,9 +1618,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "764b31ac54472e796f08be376eaeea3e30800949650566620809659d39969dbd" +checksum = "6a1d370115171e3ae03c5c6d4f7d096f2981a40ddccb98dfd704c773530ba73b" dependencies = [ "bstr", "gix-trace", @@ -1664,9 +1631,9 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ba6662a29a6332926494542f6144ee87a59df3c70a4c680ebd235b646d7866" +checksum = "90a7885b4ccdc8c80740e465747bf961a8110043fdc1fda3ee80bc81885f42df" dependencies = [ "bitflags 2.4.0", "bstr", @@ -1679,9 +1646,9 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ebf6f126413908bfbdc27bf69f6f8b94b674457546fab8ba613be22b917d33" +checksum = "5c9a913769516f5e9d937afac206fb76428e3d7238e538845842887fda584678" dependencies = [ "gix-command", "gix-config-value", @@ -1692,9 +1659,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea9a0acfb928bc0cccd6d9e4778ba367328098fe6553ab39d5763f128794bad" +checksum = "5d6ee7fc3f80140ea0651d483ecb9e680403be244849c16237fce45ac80163df" dependencies = [ "bstr", "btoi", @@ -1704,8 +1671,8 @@ dependencies = [ "gix-hash", "gix-transport", "maybe-async", - "nom", "thiserror", + "winnow", ] [[package]] @@ -1721,9 +1688,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "993ce5c448a94038b8da1a8969c0facd6c1fbac509fa013344c580458f41527d" +checksum = "3cccbfa8d5cd9b86465f27a521e0c017de54b92d9fd37c143e49c658a2f04f3a" dependencies = [ "gix-actor", "gix-date", @@ -1742,9 +1709,9 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3171923a0f9075feae790bb81d824c0c1f91a899df51508705d4957bacd006e" +checksum = "678ba30d95baa5462df9875628ed40655d5f5b8aba7028de86ed57f36e762c6c" dependencies = [ "bstr", "gix-hash", @@ -1756,9 +1723,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2443886b7c55e73a813f203fe8603b94ac5deb3dfad8812d25e731b81f569f27" +checksum = "b3e80a5992ae446fe1745dd26523b86084e3f1b6b3e35377fe09b4f35ac8f151" dependencies = [ "bstr", "gix-date", @@ -1772,9 +1739,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "362f71e173364f67d02899388c4b3d2f6bac7c16c0f3a9bbc04683f984f59daa" +checksum = "b806349bc1f668e09035800e07ac8045da4e39a8925a245d93142c4802224ec1" dependencies = [ "gix-commitgraph", "gix-date", @@ -1787,9 +1754,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0debc2e70613a077c257c2bb45ab4f652a550ae1d00bdca356633ea9de88a230" +checksum = "92b9542ac025a8c02ed5d17b3fc031a111a384e859d0be3532ec4d58c40a0f28" dependencies = [ "bitflags 2.4.0", "gix-path", @@ -1799,9 +1766,9 @@ dependencies = [ [[package]] name = "gix-submodule" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71cc3ecd5e2387102aa275fc88fcf36e0f0b9df23a1335bf6255327abbb9bb3f" +checksum = "5ff6b99d735842a3a7fb162b660fa97acec39d576c0ca1700d9eff9344f8625d" dependencies = [ "bstr", "gix-config", @@ -1814,16 +1781,14 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "8.0.0" +version = "9.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cea558d3daf3b1d0001052b12218c66c8f84788852791333b633d7eeb6999db1" +checksum = "2762b91ff95e27ff3ea95758c0d4efacd7435a1be3629622928b8276de0f72a8" dependencies = [ "gix-fs", "libc", "once_cell", "parking_lot", - "signal-hook", - "signal-hook-registry", "tempfile", ] @@ -1835,9 +1800,9 @@ checksum = "96b6d623a1152c3facb79067d6e2ecdae48130030cf27d6eb21109f13bd7b836" [[package]] name = "gix-transport" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3521e96c5d7d65c1d6bd632820362ac30f66391108126a4a56adb0a5cfe85d77" +checksum = "9a8d976844844f8b42e70a2c2e60d68407f7055ff7e37553d1e7f2718acc3547" dependencies = [ "base64 0.21.3", "bstr", @@ -1854,9 +1819,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beecf2e4d8924cbe0cace0bd396f9b037fdf7db9799d5695fe70dcad959ed067" +checksum = "3ec6358f8373fb018af8fc96c9d2ec6a5b66999e2377dc40b7801351fec409ed" dependencies = [ "gix-commitgraph", "gix-date", @@ -1870,9 +1835,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6059e15828df32027a7db9097e5a9baf320d2dcc10a4e1598ffe05be8dfd1fa6" +checksum = "1c79d595b99a6c7ab274f3c991735a0c0f5a816a3da460f513c48edf1c7bf2cc" dependencies = [ "bstr", "gix-features", @@ -1903,9 +1868,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38eab0fdd752ecfa50130c127c9f42bd329bf7f4e52872f4ac24c12bbc02baf" +checksum = "addabd470ca4ce3ab893e32a5743971a530b8fc0eee5c23844849abf3c9ea6d6" dependencies = [ "bstr", "gix-attributes", @@ -1921,9 +1886,9 @@ dependencies = [ [[package]] name = "gix-worktree-state" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44629a04d238493f0da657a0eee4d60086f0172c364ca4a71398b1898fda32a6" +checksum = "02daf5a1d381280e3c5803a3745ee2abf09d2873118136aaadc0ed96ed438aeb" dependencies = [ "bstr", "gix-features", @@ -1939,24 +1904,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "gix-worktree-stream" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9582aa0875d19d188501dc0d6beb38259a5842777b0755d1c208b38a10aa5a" -dependencies = [ - "gix-attributes", - "gix-features", - "gix-filter", - "gix-fs", - "gix-hash", - "gix-object", - "gix-path", - "gix-traverse", - "parking_lot", - "thiserror", -] - [[package]] name = "glob" version = "0.3.1" @@ -2178,16 +2125,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "imara-diff" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e98c1d0ad70fc91b8b9654b1f33db55e59579d3b3de2bffdced0fdb810570cb8" -dependencies = [ - "ahash", - "hashbrown 0.12.3", -] - [[package]] name = "indexmap" version = "1.9.3" @@ -2536,12 +2473,6 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - [[package]] name = "miniz_oxide" version = "0.7.1" @@ -2591,16 +2522,6 @@ dependencies = [ "libc", ] -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - [[package]] name = "normalize-path" version = "0.2.1" @@ -2814,9 +2735,9 @@ dependencies = [ [[package]] name = "prodash" -version = "25.0.2" +version = "26.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d67eb4220992a4a052a4bb03cf776e493ecb1a3a36bab551804153d63486af7" +checksum = "794b5bf8e2d19b53dcdcec3e4bba628e20f5b6062503ba89281fa7037dd7bbcf" dependencies = [ "bytesize", "human_format", @@ -3395,16 +3316,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "signal-hook" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" -dependencies = [ - "libc", - "signal-hook-registry", -] - [[package]] name = "signal-hook-registry" version = "1.4.1" diff --git a/crates/bin/src/logging.rs b/crates/bin/src/logging.rs index 3033266b..267fb8d6 100644 --- a/crates/bin/src/logging.rs +++ b/crates/bin/src/logging.rs @@ -202,6 +202,7 @@ pub fn logging(log_level: LevelFilter, json_output: bool) { "binstalk_registry", "cargo_binstall", "cargo_toml_workspace", + "simple_git", ]); // Forward log to tracing diff --git a/crates/simple-git/Cargo.toml b/crates/simple-git/Cargo.toml index 49369c33..cc40005e 100644 --- a/crates/simple-git/Cargo.toml +++ b/crates/simple-git/Cargo.toml @@ -13,11 +13,20 @@ license = "Apache-2.0 OR MIT" [dependencies] compact_str = "0.7.0" derive_destructure2 = "0.1" -gix = { version = "0.52.0", features = ["blocking-http-transport-reqwest"] } thiserror = "1.0.40" tokio = { version = "1.30.0", features = ["rt", "time"], default-features = false } tracing = "0.1.37" +[dependencies.gix] +version = "0.53.1" +default-features = false +features = [ + "comfort", + "blocking-http-transport-reqwest", + "max-performance-safe", + "worktree-mutation", +] + [features] rustls = [ "gix/blocking-http-transport-reqwest-rust-tls", diff --git a/crates/simple-git/src/progress_tracing.rs b/crates/simple-git/src/progress_tracing.rs index b88af701..5ffc9dfe 100644 --- a/crates/simple-git/src/progress_tracing.rs +++ b/crates/simple-git/src/progress_tracing.rs @@ -8,7 +8,8 @@ use std::{ use compact_str::{format_compact, CompactString}; use gix::progress::{ - prodash::messages::MessageLevel, Id, Progress, Step, StepShared, Unit, UNKNOWN, + prodash::messages::MessageLevel, Count, Id, NestedProgress, Progress, Step, StepShared, Unit, + UNKNOWN, }; use tokio::time; use tracing::{error, info}; @@ -18,7 +19,7 @@ pub(super) struct TracingProgress { id: Id, max: Option, unit: Option, - step: usize, + step: StepShared, trigger: Arc, } @@ -46,38 +47,13 @@ impl TracingProgress { name: CompactString::new(name), id: UNKNOWN, max: None, - step: 0, + step: Default::default(), unit: None, trigger, } } -} -impl Progress for TracingProgress { - type SubProgress = TracingProgress; - - fn add_child(&mut self, name: impl Into) -> Self::SubProgress { - self.add_child_with_id(name, UNKNOWN) - } - - fn add_child_with_id(&mut self, name: impl Into, id: Id) -> Self::SubProgress { - Self { - name: format_compact!("{}{}{}", self.name, SEP, Into::::into(name)), - id, - step: 0, - max: None, - unit: None, - trigger: Arc::clone(&self.trigger), - } - } - - fn init(&mut self, max: Option, unit: Option) { - self.max = max; - self.unit = unit; - } - - fn set(&mut self, step: usize) { - self.step = step; + fn log_progress(&self, step: Step) { if self.trigger.swap(false, Ordering::Relaxed) { match (self.max, &self.unit) { (max, Some(unit)) => { @@ -88,6 +64,36 @@ impl Progress for TracingProgress { } } } +} + +impl Count for TracingProgress { + fn set(&self, step: Step) { + self.step.store(step, Ordering::Relaxed); + self.log_progress(step); + } + + fn step(&self) -> Step { + self.step.load(Ordering::Relaxed) + } + + fn inc_by(&self, step_to_inc: Step) { + self.log_progress( + self.step + .fetch_add(step_to_inc, Ordering::Relaxed) + .wrapping_add(step_to_inc), + ); + } + + fn counter(&self) -> StepShared { + Arc::clone(&self.step) + } +} + +impl Progress for TracingProgress { + fn init(&mut self, max: Option, unit: Option) { + self.max = max; + self.unit = unit; + } fn unit(&self) -> Option { self.unit.clone() @@ -103,21 +109,12 @@ impl Progress for TracingProgress { prev } - fn step(&self) -> usize { - self.step - } - - fn inc_by(&mut self, step: usize) { - self.set(self.step + step) - } - - fn set_name(&mut self, name: impl Into) { - let name = name.into(); + fn set_name(&mut self, name: String) { self.name = self .name .split("::") .next() - .map(|parent| format_compact!("{}{}{}", parent.to_owned(), SEP, name)) + .map(|parent| format_compact!("{parent}{SEP}{name}")) .unwrap_or_else(|| name.into()); } @@ -129,16 +126,31 @@ impl Progress for TracingProgress { self.id } - fn message(&self, level: MessageLevel, message: impl Into) { - let message: String = message.into(); + fn message(&self, level: MessageLevel, message: String) { + let name = &self.name; match level { - MessageLevel::Info => info!("ℹ{} → {}", self.name, message), - MessageLevel::Failure => error!("𐄂{} → {}", self.name, message), - MessageLevel::Success => info!("✓{} → {}", self.name, message), + MessageLevel::Info => info!("ℹ{name} → {message}"), + MessageLevel::Failure => error!("𐄂{name} → {message}"), + MessageLevel::Success => info!("✓{name} → {message}"), } } +} - fn counter(&self) -> Option { - None +impl NestedProgress for TracingProgress { + type SubProgress = TracingProgress; + + fn add_child(&mut self, name: impl Into) -> Self::SubProgress { + self.add_child_with_id(name, UNKNOWN) + } + + fn add_child_with_id(&mut self, name: impl Into, id: Id) -> Self::SubProgress { + Self { + name: format_compact!("{}{}{}", self.name, SEP, Into::::into(name)), + id, + step: Arc::default(), + max: None, + unit: None, + trigger: Arc::clone(&self.trigger), + } } } From 4c339d9a2b06175d7328325e47172a33e34e49ab Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 15 Sep 2023 00:09:19 +1000 Subject: [PATCH 1484/2020] Add GitHub sponsor for maintainer NobodyXu (#1358) Signed-off-by: Jiahao XU --- .github/FUNDING.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..632f801f --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1 @@ +github: [NobodyXu] From c02350e94cbf8e4b017c883a63723edd34a2db0a Mon Sep 17 00:00:00 2001 From: haitrungle <89031637+haitrungle@users.noreply.github.com> Date: Fri, 15 Sep 2023 05:40:22 +0800 Subject: [PATCH 1485/2020] Fix typo in install-from-binstall-release.sh (#1359) --- install-from-binstall-release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-from-binstall-release.sh b/install-from-binstall-release.sh index eacb8477..7630eeb4 100755 --- a/install-from-binstall-release.sh +++ b/install-from-binstall-release.sh @@ -21,7 +21,7 @@ elif [ "$os" == "Linux" ]; then url="${base_url}${target}.tgz" curl -L --proto '=https' --tlsv1.2 -sSf "$url" | tar -xvzf - else - echo "Unupporteed OS ${os}" + echo "Unsupported OS ${os}" exit 1 fi From 11d4a80eba2864864b2e9a8a16177d002e12489b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 15 Sep 2023 07:51:36 +1000 Subject: [PATCH 1486/2020] Fixed and simplify dependabot configuration (#1357) Fixed #1353 Merge all dependabot configuration for cargo into one, with directory setting to `/` so that it will check for dep updates for entire workspace while also updating lockfile in PR. To prevent it from opening too many PRs, it's configured to run on every Saturday, after `upgrade-transitive-deps.yml` is run. It will also group all dependencies into one PR to prevent opening too many PRs. Signed-off-by: Jiahao XU --- .github/dependabot.yml | 81 +++++------------------------------------- 1 file changed, 9 insertions(+), 72 deletions(-) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index cbd995cd..8239740f 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -8,77 +8,14 @@ updates: directory: "/" schedule: interval: "daily" - # If we include `/`, then dependabot would also create PR - # for every compatible updates. - # - # We only want incompatible updates for direct dependencies - # from dependabot since compatible updates is covered by - # `update-transitive-deps.yml` - package-ecosystem: "cargo" - directory: "/crates/atomic-file-install" + directory: "/" schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/bin" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/binstalk" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/binstalk-bins" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/binstalk-fetchers" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/binstalk-registry" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/binstalk-downloader" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/binstalk-manifests" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/binstalk-types" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/cargo-toml-workspace" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/detect-targets" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/detect-wasi" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/fs-lock" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/leon" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/leon-macros" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/normalize-path" - schedule: - interval: "daily" - - package-ecosystem: "cargo" - directory: "/crates/simple-git" - schedule: - interval: "daily" + # Only run dependabot after all compatible upgrades and transitive deps + # are done to reduce amount of PRs opened. + interval: "weekly" + day: "saturday" + groups: + deps: + patterns: + - "*" From e711bcd4040c09f316615039a41bece662174054 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 14 Sep 2023 23:11:33 +0000 Subject: [PATCH 1487/2020] build(deps): bump the deps group with 8 updates (#1361) Bumps the deps group with 8 updates: | Package | From | To | | --- | --- | --- | | [clap](https://github.com/clap-rs/clap) | `4.4.2` | `4.4.3` | | [mimalloc](https://github.com/purpleprotocol/mimalloc_rust) | `0.1.38` | `0.1.39` | | [vergen](https://github.com/rustyhorde/vergen) | `8.2.4` | `8.2.5` | | [serde_json](https://github.com/serde-rs/json) | `1.0.105` | `1.0.107` | | [async-compression](https://github.com/Nullus157/async-compression) | `0.4.2` | `0.4.3` | | [cargo_toml](https://gitlab.com/lib.rs/cargo_toml) | `0.15.3` | `0.16.0` | | [proc-macro2](https://github.com/dtolnay/proc-macro2) | `1.0.66` | `1.0.67` | | [syn](https://github.com/dtolnay/syn) | `2.0.31` | `2.0.33` | Updates `clap` from 4.4.2 to 4.4.3 - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.4.2...v4.4.3) Updates `mimalloc` from 0.1.38 to 0.1.39 - [Release notes](https://github.com/purpleprotocol/mimalloc_rust/releases) - [Commits](https://github.com/purpleprotocol/mimalloc_rust/compare/v0.1.38...v0.1.39) Updates `vergen` from 8.2.4 to 8.2.5 - [Release notes](https://github.com/rustyhorde/vergen/releases) - [Commits](https://github.com/rustyhorde/vergen/compare/8.2.4...8.2.5) Updates `serde_json` from 1.0.105 to 1.0.107 - [Release notes](https://github.com/serde-rs/json/releases) - [Commits](https://github.com/serde-rs/json/compare/v1.0.105...v1.0.107) Updates `async-compression` from 0.4.2 to 0.4.3 - [Release notes](https://github.com/Nullus157/async-compression/releases) - [Changelog](https://github.com/Nullus157/async-compression/blob/main/CHANGELOG.md) - [Commits](https://github.com/Nullus157/async-compression/compare/async-compression-v0.4.2...async-compression-v0.4.3) Updates `cargo_toml` from 0.15.3 to 0.16.0 - [Commits](https://gitlab.com/lib.rs/cargo_toml/commits/main) Updates `proc-macro2` from 1.0.66 to 1.0.67 - [Release notes](https://github.com/dtolnay/proc-macro2/releases) - [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.66...1.0.67) Updates `syn` from 2.0.31 to 2.0.33 - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.31...2.0.33) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: mimalloc dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: vergen dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: serde_json dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: async-compression dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: cargo_toml dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: proc-macro2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 109 +++++++++++++++---------- crates/bin/Cargo.toml | 6 +- crates/binstalk-downloader/Cargo.toml | 4 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- crates/leon-macros/Cargo.toml | 4 +- crates/leon/Cargo.toml | 2 +- 8 files changed, 78 insertions(+), 53 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c93f0198..3d57c31b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -117,9 +117,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.2" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d495b6dc0184693324491a5ac05f559acc97bf937ab31d7a1c33dd0016be6d2b" +checksum = "bb42b2197bf15ccb092b62c74515dbd8b86d0effd934795f6687c93b6e679a2c" dependencies = [ "brotli", "bzip2", @@ -141,7 +141,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -275,7 +275,7 @@ dependencies = [ name = "binstalk-downloader" version = "0.7.1" dependencies = [ - "async-compression 0.4.2", + "async-compression 0.4.3", "async-trait", "async_zip", "binstalk-types", @@ -341,7 +341,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror", - "toml_edit", + "toml_edit 0.20.0", "url", ] @@ -367,7 +367,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", - "toml_edit", + "toml_edit 0.20.0", "tracing", "url", ] @@ -549,12 +549,12 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.15.3" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "599aa35200ffff8f04c1925aa1acc92fa2e08874379ef42e210a80e527e60838" +checksum = "adf89139afbf0eac9d3f07080b14f5a739f44a916196af8c0a280baa080c20b8" dependencies = [ "serde", - "toml", + "toml 0.8.0", ] [[package]] @@ -584,9 +584,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.2" +version = "4.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a13b88d2c62ff462f88e4a121f17a82c1af05693a2f192b5c38d14de73c19f6" +checksum = "84ed82781cea27b43c9b106a979fe450a13a31aab0500595fb3fc06616de08e6" dependencies = [ "clap_builder", "clap_derive", @@ -613,7 +613,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -800,7 +800,7 @@ checksum = "ac4b68190bad25c00b64ea19767b2321a037fc0e5bea7563d5d8e35e04b19c95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -872,7 +872,7 @@ checksum = "fd0a2c9b742a980060d22545a7a83b573acd6b73045b9de6370c9530ce652f27" dependencies = [ "cc", "rustc_version", - "toml", + "toml 0.7.7", "vswhom", "winreg 0.51.0", ] @@ -1092,7 +1092,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -1516,7 +1516,7 @@ checksum = "9d8acb5ee668d55f0f2d19a320a3f9ef67a6999ad483e11135abcc2464ed18b6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -2293,7 +2293,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -2304,9 +2304,9 @@ checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libmimalloc-sys" -version = "0.1.34" +version = "0.1.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25d058a81af0d1c22d7a1c948576bee6d673f7af3c0f35564abd6c81122f513d" +checksum = "3979b5c37ece694f1f5e51e7ecc871fdb0f517ed04ee45f88d15d6d553cb9664" dependencies = [ "cc", "libc", @@ -2455,14 +2455,14 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] name = "mimalloc" -version = "0.1.38" +version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "972e5f23f6716f62665760b0f4cbf592576a80c7b879ba9beaafc0e558894127" +checksum = "fa01922b5ea280a911e323e4d2fd24b7fe5cc4042e0d2cda3c40775cdc4bdc9c" dependencies = [ "libmimalloc-sys", ] @@ -2602,7 +2602,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -2687,7 +2687,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -2721,14 +2721,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" dependencies = [ "once_cell", - "toml_edit", + "toml_edit 0.19.15", ] [[package]] name = "proc-macro2" -version = "1.0.66" +version = "1.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" +checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" dependencies = [ "unicode-ident", ] @@ -2963,7 +2963,7 @@ version = "0.11.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ - "async-compression 0.4.2", + "async-compression 0.4.3", "base64 0.21.3", "bytes", "encoding_rs", @@ -3234,14 +3234,14 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] name = "serde_json" -version = "1.0.105" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" +checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" dependencies = [ "itoa", "ryu", @@ -3412,7 +3412,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -3456,9 +3456,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.31" +version = "2.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718fa2415bcb8d8bd775917a1bf12a7931b6dfa890753378538118181e0cb398" +checksum = "9caece70c63bfba29ec2fed841a09851b14a235c60010fa4de58089b6c025668" dependencies = [ "proc-macro2", "quote", @@ -3522,7 +3522,7 @@ checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -3606,7 +3606,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -3690,7 +3690,19 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit", + "toml_edit 0.19.15", +] + +[[package]] +name = "toml" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c226a7bba6d859b63c92c4b4fe69c5b6b72d0cb897dbc8e6012298e6154cb56e" +dependencies = [ + "serde", + "serde_spanned", + "toml_datetime", + "toml_edit 0.20.0", ] [[package]] @@ -3715,6 +3727,19 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_edit" +version = "0.20.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ff63e60a958cefbb518ae1fd6566af80d9d4be430a33f3723dfc47d1d411d95" +dependencies = [ + "indexmap 2.0.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + [[package]] name = "tower-service" version = "0.3.2" @@ -3741,7 +3766,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", ] [[package]] @@ -3949,9 +3974,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vergen" -version = "8.2.4" +version = "8.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbc5ad0d9d26b2c49a5ab7da76c3e79d3ee37e7821799f8223fcb8f2f391a2e7" +checksum = "85e7dc29b3c54a2ea67ef4f953d5ec0c4085035c0ae2d325be1c0d2144bd9f16" dependencies = [ "anyhow", "rustc_version", @@ -4031,7 +4056,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", "wasm-bindgen-shared", ] @@ -4065,7 +4090,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.31", + "syn 2.0.33", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 8a09d2ec..c398f13f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,14 +24,14 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.16.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.8.1" } -clap = { version = "4.3.0", features = ["derive", "env"] } +clap = { version = "4.4.3", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" file-format = { version = "0.20.0", default-features = false } home = "0.5.5" log = { version = "0.4.18", features = ["std"] } miette = "5.9.0" -mimalloc = { version = "0.1.37", default-features = false, optional = true } +mimalloc = { version = "0.1.39", default-features = false, optional = true } once_cell = "1.18.0" semver = "1.0.17" strum = "0.25.0" @@ -46,7 +46,7 @@ tracing-subscriber = { version = "0.3.17", features = ["fmt", "json", "ansi"], d [build-dependencies] embed-resource = "2.1.1" -vergen = { version = "8.2.4", features = ["build", "cargo", "git", "gitcl", "rustc"] } +vergen = { version = "8.2.5", features = ["build", "cargo", "git", "gitcl", "rustc"] } [features] default = ["static", "rustls", "trust-dns", "fancy-no-backtrace", "zstd-thin", "git"] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 822ba896..d6503e35 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" -async-compression = { version = "0.4.0", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } +async-compression = { version = "0.4.3", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.15", features = ["deflate", "bzip2", "lzma", "zstd", "xz", "tokio"] } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } bytes = "1.4.0" @@ -24,7 +24,7 @@ reqwest = { version = "0.11.19", features = ["stream", "gzip", "brotli", "deflat percent-encoding = "2.2.0" serde = { version = "1.0.163", features = ["derive"], optional = true } serde-tuple-vec-map = "1.0.1" -serde_json = { version = "1.0.96", optional = true } +serde_json = { version = "1.0.107", optional = true } # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. # diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index b9c1ebca..93af1f85 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -19,7 +19,7 @@ miette = "5.9.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" -serde_json = "1.0.96" +serde_json = "1.0.107" thiserror = "1.0.40" toml_edit = { version = "0.20.0", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 1116b3f4..0ca274f6 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -23,7 +23,7 @@ normalize-path = { version = "0.2.1", path = "../normalize-path" } once_cell = "1.18.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } -serde_json = "1.0.99" +serde_json = "1.0.107" sha2 = "0.10.7" simple-git = { version = "0.1.0", path = "../simple-git", optional = true } tempfile = "3.5.0" diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 513e5189..b4afb44b 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] binstalk-types = { version = "0.5.0", path = "../binstalk-types" } -cargo_toml = "0.15.3" +cargo_toml = "0.16.0" compact_str = { version = "0.7.0", features = ["serde"] } glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } diff --git a/crates/leon-macros/Cargo.toml b/crates/leon-macros/Cargo.toml index 30594a58..0ea06917 100644 --- a/crates/leon-macros/Cargo.toml +++ b/crates/leon-macros/Cargo.toml @@ -14,6 +14,6 @@ proc-macro = true [dependencies] leon = { version = "2.0.1", path = "../leon", default-features = false } -proc-macro2 = "1.0.59" -syn = { version = "2.0.18", default-features = false, features = ["proc-macro", "parsing"] } +proc-macro2 = "1.0.67" +syn = { version = "2.0.33", default-features = false, features = ["proc-macro", "parsing"] } quote = "1.0.28" diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index f564f456..74b2c103 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" exclude = ["fuzz", "benches"] [dependencies] -clap = { version = "4.3.0", features = ["derive"], optional = true } +clap = { version = "4.4.3", features = ["derive"], optional = true } miette = { version = "5.9.0", default-features = false, optional = true } thiserror = "1.0.38" From ac8b8132d2c435546493fd75017aecfd4c6a9e06 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 15 Sep 2023 11:43:33 +0000 Subject: [PATCH 1488/2020] dep: Upgrade transitive dependencies (#1362) Co-authored-by: github-actions --- Cargo.lock | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3d57c31b..7c663424 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -48,9 +48,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c4c2c83f81532e5845a733998b6971faca23490340a418e9b72a3ec9de12ea" +checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" [[package]] name = "anstyle-parse" @@ -214,9 +214,9 @@ checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" [[package]] name = "base64" -version = "0.21.3" +version = "0.21.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414dcefbc63d77c526a76b3afcf6fbb9b5e2791c19c3aa2297733208750c6e53" +checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" [[package]] name = "beef" @@ -461,9 +461,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byteorder" @@ -872,7 +872,7 @@ checksum = "fd0a2c9b742a980060d22545a7a83b573acd6b73045b9de6370c9530ce652f27" dependencies = [ "cc", "rustc_version", - "toml 0.7.7", + "toml 0.7.8", "vswhom", "winreg 0.51.0", ] @@ -1804,7 +1804,7 @@ version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a8d976844844f8b42e70a2c2e60d68407f7055ff7e37553d1e7f2718acc3547" dependencies = [ - "base64 0.21.3", + "base64 0.21.4", "bstr", "gix-command", "gix-credentials", @@ -2176,7 +2176,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.3", + "socket2 0.5.4", "widestring", "windows-sys", "winreg 0.50.0", @@ -2298,9 +2298,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.147" +version = "0.2.148" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" [[package]] name = "libmimalloc-sys" @@ -2330,9 +2330,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.5" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" +checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" [[package]] name = "lock_api" @@ -2844,7 +2844,7 @@ checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ "bytes", "libc", - "socket2 0.5.3", + "socket2 0.5.4", "tracing", "windows-sys", ] @@ -2964,7 +2964,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ "async-compression 0.4.3", - "base64 0.21.3", + "base64 0.21.4", "bytes", "encoding_rs", "futures-channel", @@ -3055,9 +3055,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.11" +version = "0.38.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0c3dde1fc030af041adc40e79c0e7fbcf431dd24870053d187d7c66e4b87453" +checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" dependencies = [ "bitflags 2.4.0", "errno 0.3.3", @@ -3117,14 +3117,14 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.3", + "base64 0.21.4", ] [[package]] name = "rustls-webpki" -version = "0.101.4" +version = "0.101.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d93931baf2d282fff8d3a532bbfd7653f734643161b87e3e01e59a04439bf0d" +checksum = "45a27e3b59326c16e23d30aeb7a36a24cc0d29e71d68ff611cdfb4a01d013bed" dependencies = [ "ring", "untrusted", @@ -3370,9 +3370,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" dependencies = [ "libc", "windows-sys", @@ -3593,7 +3593,7 @@ dependencies = [ "num_cpus", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.3", + "socket2 0.5.4", "tokio-macros", "windows-sys", ] @@ -3683,9 +3683,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.7.7" +version = "0.7.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0a3ab2091e52d7299a39d098e200114a972df0a7724add02a273aa9aada592" +checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" dependencies = [ "serde", "serde_spanned", @@ -3911,9 +3911,9 @@ checksum = "98e90c70c9f0d4d1ee6d0a7d04aa06cb9bbd53d8cfbdd62a0269a7c2eb640552" [[package]] name = "unicode-ident" -version = "1.0.11" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "unicode-linebreak" From 04c5c006697630ea340f8ce4148e5c5776e07ab9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 16 Sep 2023 01:35:20 +0000 Subject: [PATCH 1489/2020] build(deps): bump the deps group with 2 updates (#1363) Bumps the deps group with 2 updates: [reflink-copy](https://github.com/cargo-bins/reflink-copy) and [syn](https://github.com/dtolnay/syn). Updates `reflink-copy` from 0.1.6 to 0.1.7 - [Commits](https://github.com/cargo-bins/reflink-copy/commits) Updates `syn` from 2.0.33 to 2.0.35 - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.33...2.0.35) --- updated-dependencies: - dependency-name: reflink-copy dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 40 +++++++++++++-------------- crates/atomic-file-install/Cargo.toml | 2 +- crates/leon-macros/Cargo.toml | 2 +- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7c663424..0018e5cd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -141,7 +141,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.35", ] [[package]] @@ -613,7 +613,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.35", ] [[package]] @@ -800,7 +800,7 @@ checksum = "ac4b68190bad25c00b64ea19767b2321a037fc0e5bea7563d5d8e35e04b19c95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.35", ] [[package]] @@ -1092,7 +1092,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.35", ] [[package]] @@ -1516,7 +1516,7 @@ checksum = "9d8acb5ee668d55f0f2d19a320a3f9ef67a6999ad483e11135abcc2464ed18b6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.35", ] [[package]] @@ -2293,7 +2293,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.35", ] [[package]] @@ -2455,7 +2455,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.35", ] [[package]] @@ -2602,7 +2602,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.35", ] [[package]] @@ -2687,7 +2687,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.35", ] [[package]] @@ -2941,9 +2941,9 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84b9fdc4b74744920661b70bc8daa091791c1f6940d7f9a90338754532237c29" +checksum = "7e062faffd49af27131ed7fa8fcb8a777dec096932c4f1751bc1c0e61c797907" dependencies = [ "cfg-if", "ioctl-sys", @@ -3234,7 +3234,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.35", ] [[package]] @@ -3412,7 +3412,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.33", + "syn 2.0.35", ] [[package]] @@ -3456,9 +3456,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.33" +version = "2.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9caece70c63bfba29ec2fed841a09851b14a235c60010fa4de58089b6c025668" +checksum = "59bf04c28bee9043ed9ea1e41afc0552288d3aba9c6efdd78903b802926f4879" dependencies = [ "proc-macro2", "quote", @@ -3522,7 +3522,7 @@ checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.35", ] [[package]] @@ -3606,7 +3606,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.35", ] [[package]] @@ -3766,7 +3766,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.35", ] [[package]] @@ -4056,7 +4056,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.35", "wasm-bindgen-shared", ] @@ -4090,7 +4090,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.33", + "syn 2.0.35", "wasm-bindgen-backend", "wasm-bindgen-shared", ] diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index 5d3d586d..ccaf3a4d 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -10,7 +10,7 @@ license = "Apache-2.0 OR MIT" rust-version = "1.65.0" [dependencies] -reflink-copy = "0.1.5" +reflink-copy = "0.1.7" tempfile = "3.5.0" tracing = "0.1.37" diff --git a/crates/leon-macros/Cargo.toml b/crates/leon-macros/Cargo.toml index 0ea06917..b01caba4 100644 --- a/crates/leon-macros/Cargo.toml +++ b/crates/leon-macros/Cargo.toml @@ -15,5 +15,5 @@ proc-macro = true [dependencies] leon = { version = "2.0.1", path = "../leon", default-features = false } proc-macro2 = "1.0.67" -syn = { version = "2.0.33", default-features = false, features = ["proc-macro", "parsing"] } +syn = { version = "2.0.35", default-features = false, features = ["proc-macro", "parsing"] } quote = "1.0.28" From 6560225c0362092f62dae33fe9c25a2ad5553f3f Mon Sep 17 00:00:00 2001 From: Sculas Date: Sun, 17 Sep 2023 01:51:07 +0200 Subject: [PATCH 1490/2020] fix: use custom DNS resolver (#1364) * add DefaultResolver * style: fmt * chore: remove unused feature Co-authored-by: Jiahao XU * chore: remove unused `ipconfig/computer` feature Co-authored-by: Jiahao XU * chore: update `trust-dns-resolver` * refactor: apply requested changes * chore: revert `trust-dns-resolver` upgrade I mistakenly thought `reqwest` already updated to the newest version, but it hasn't! (no release was made yet) * refactor: cleanup --------- Co-authored-by: GNQG Co-authored-by: Jiahao XU --- Cargo.lock | 113 +++++++++++++++++++++ crates/binstalk-downloader/Cargo.toml | 10 +- crates/binstalk-downloader/src/lib.rs | 3 + crates/binstalk-downloader/src/remote.rs | 8 ++ crates/binstalk-downloader/src/resolver.rs | 64 ++++++++++++ 5 files changed, 196 insertions(+), 2 deletions(-) create mode 100644 crates/binstalk-downloader/src/resolver.rs diff --git a/Cargo.lock b/Cargo.lock index 0018e5cd..ea18945f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -283,9 +283,13 @@ dependencies = [ "bytes", "bzip2", "compact_str", + "default-net", "flate2", "futures-util", "httpdate", + "hyper", + "ipconfig", + "once_cell", "percent-encoding", "reqwest", "serde", @@ -786,6 +790,23 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +[[package]] +name = "default-net" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5d1b93f7700c45c26856522aed3982b685edb0532e4dbdd3a4ec84bb4185526" +dependencies = [ + "dlopen2", + "libc", + "memalloc", + "netlink-packet-core", + "netlink-packet-route", + "netlink-sys", + "once_cell", + "system-configuration", + "windows 0.48.0", +] + [[package]] name = "deranged" version = "0.3.8" @@ -852,6 +873,17 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "dlopen2" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b4f5f101177ff01b8ec4ecc81eead416a8aa42819a2869311b3420fa114ffa" +dependencies = [ + "libc", + "once_cell", + "winapi", +] + [[package]] name = "dunce" version = "1.0.4" @@ -2402,6 +2434,12 @@ dependencies = [ "serde", ] +[[package]] +name = "memalloc" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df39d232f5c40b0891c10216992c2f250c054105cb1e56f0fc9032db6203ecc1" + [[package]] name = "memchr" version = "2.6.3" @@ -2511,6 +2549,54 @@ dependencies = [ "tempfile", ] +[[package]] +name = "netlink-packet-core" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72724faf704479d67b388da142b186f916188505e7e0b26719019c525882eda4" +dependencies = [ + "anyhow", + "byteorder", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-route" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053998cea5a306971f88580d0829e90f270f940befd7cf928da179d4187a5a66" +dependencies = [ + "anyhow", + "bitflags 1.3.2", + "byteorder", + "libc", + "netlink-packet-core", + "netlink-packet-utils", +] + +[[package]] +name = "netlink-packet-utils" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ede8a08c71ad5a95cdd0e4e52facd37190977039a4704eb82a283f713747d34" +dependencies = [ + "anyhow", + "byteorder", + "paste", + "thiserror", +] + +[[package]] +name = "netlink-sys" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" +dependencies = [ + "bytes", + "libc", + "log", +] + [[package]] name = "nix" version = "0.26.4" @@ -2664,6 +2750,12 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + [[package]] name = "percent-encoding" version = "2.3.0" @@ -3465,6 +3557,27 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "system-configuration" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" +dependencies = [ + "bitflags 1.3.2", + "core-foundation", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75fb188eb626b924683e3b95e3a48e63551fcfb51949de2f06a9d91dbee93c9" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "target-lexicon" version = "0.12.11" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index d6503e35..8f441233 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -37,7 +37,9 @@ tokio-tar = "0.3.0" tokio-util = { version = "0.7.8", features = ["io"] } tracing = "0.1.37" # trust-dns-resolver must be kept in sync with the version reqwest uses -trust-dns-resolver = { version = "0.22.0", optional = true, default-features = false, features = ["dnssec-ring"] } +trust-dns-resolver = { version = "0.22.0", optional = true, features = ["dnssec-ring"] } +hyper = { version = "0.14.27", optional = true } +once_cell = { version = "1.18.0", optional = true } url = "2.3.1" xz2 = "0.1.7" @@ -78,7 +80,7 @@ native-tls = [ ] # Enable trust-dns-resolver so that features on it will also be enabled. -trust-dns = ["trust-dns-resolver", "reqwest/trust-dns"] +trust-dns = ["trust-dns-resolver", "default-net", "ipconfig", "hyper", "once_cell"] # Experimental HTTP/3 client, this would require `--cfg reqwest_unstable` # to be passed to `rustc`. @@ -91,6 +93,10 @@ cross-lang-fat-lto = ["zstd/fat-lto"] gh-api-client = ["json"] json = ["serde", "serde_json"] +[target."cfg(windows)".dependencies] +default-net = { version = "0.17.0", optional = true } +ipconfig = { version = "0.3.2", optional = true, default-features = false } + [package.metadata.docs.rs] features = ["gh-api-client"] rustdoc-args = ["--cfg", "docsrs"] diff --git a/crates/binstalk-downloader/src/lib.rs b/crates/binstalk-downloader/src/lib.rs index c4a23c84..94f5434d 100644 --- a/crates/binstalk-downloader/src/lib.rs +++ b/crates/binstalk-downloader/src/lib.rs @@ -12,4 +12,7 @@ pub mod gh_api_client; pub mod remote; +#[cfg(feature = "trust-dns")] +mod resolver; + mod utils; diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 98486a6e..9da79e3b 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -18,6 +18,9 @@ use tracing::{debug, info, instrument}; pub use reqwest::{header, Error as ReqwestError, Method, StatusCode}; pub use url::Url; +#[cfg(feature = "trust-dns")] +use crate::resolver::TrustDnsResolver; + mod delay_request; use delay_request::DelayRequest; @@ -107,6 +110,11 @@ impl Client { .https_only(true) .tcp_nodelay(false); + #[cfg(feature = "trust-dns")] + { + builder = builder.dns_resolver(Arc::new(TrustDnsResolver::default())); + } + #[cfg(feature = "__tls")] { let tls_ver = min_tls diff --git a/crates/binstalk-downloader/src/resolver.rs b/crates/binstalk-downloader/src/resolver.rs new file mode 100644 index 00000000..b0f331e7 --- /dev/null +++ b/crates/binstalk-downloader/src/resolver.rs @@ -0,0 +1,64 @@ +use std::{net::SocketAddr, sync::Arc}; + +use hyper::client::connect::dns::Name; +use once_cell::sync::OnceCell; +use reqwest::dns::{Addrs, Resolve}; +use trust_dns_resolver::config::{NameServerConfig, Protocol, ResolverConfig, ResolverOpts}; +use trust_dns_resolver::TokioAsyncResolver; + +#[derive(Debug, Default, Clone)] +pub struct TrustDnsResolver(Arc>); + +impl Resolve for TrustDnsResolver { + fn resolve(&self, name: Name) -> reqwest::dns::Resolving { + let resolver = self.clone(); + Box::pin(async move { + let resolver = resolver.0.get_or_try_init(new_resolver)?; + + let lookup = resolver.lookup_ip(name.as_str()).await?; + let addrs: Addrs = Box::new(lookup.into_iter().map(|ip| SocketAddr::new(ip, 0))); + Ok(addrs) + }) + } +} + +fn new_resolver() -> Result> { + #[cfg(unix)] + { + let (config, opts) = trust_dns_resolver::system_conf::read_system_conf()?; + Ok(TokioAsyncResolver::tokio(config, opts)?) + } + #[cfg(windows)] + { + let mut config = ResolverConfig::new(); + let opts = ResolverOpts::default(); + + let current_interface = default_net::get_default_interface()?; + ipconfig::get_adapters()? + .iter() + .filter_map(|adapter| { + if adapter.adapter_name() == current_interface.name { + Some(adapter.dns_servers()) + } else { + None + } + }) + .flatten() + .for_each(|addr| { + let socket_addr = SocketAddr::new(*addr, 53); + for protocol in [Protocol::Udp, Protocol::Tcp] { + config.add_name_server(NameServerConfig { + socket_addr, + protocol, + tls_dns_name: None, + trust_nx_responses: false, + #[cfg(feature = "rustls")] + tls_config: None, + bind_addr: None, + }) + } + }); + + Ok(TokioAsyncResolver::tokio(config, opts)?) + } +} From 9c4e3a66423e24a7153959bcfedcf68dbcbc0835 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 17 Sep 2023 11:06:15 +1000 Subject: [PATCH 1491/2020] Minor refactor for `binstalk-downloader` (#1365) - Mv `resolver.rs` => `remote/resolver.rs` - Fix clippy warnings in `resolver.rs` on unix Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/lib.rs | 3 --- crates/binstalk-downloader/src/remote.rs | 8 +++++--- crates/binstalk-downloader/src/{ => remote}/resolver.rs | 1 + 3 files changed, 6 insertions(+), 6 deletions(-) rename crates/binstalk-downloader/src/{ => remote}/resolver.rs (99%) diff --git a/crates/binstalk-downloader/src/lib.rs b/crates/binstalk-downloader/src/lib.rs index 94f5434d..c4a23c84 100644 --- a/crates/binstalk-downloader/src/lib.rs +++ b/crates/binstalk-downloader/src/lib.rs @@ -12,7 +12,4 @@ pub mod gh_api_client; pub mod remote; -#[cfg(feature = "trust-dns")] -mod resolver; - mod utils; diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 9da79e3b..096f7dd4 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -18,9 +18,6 @@ use tracing::{debug, info, instrument}; pub use reqwest::{header, Error as ReqwestError, Method, StatusCode}; pub use url::Url; -#[cfg(feature = "trust-dns")] -use crate::resolver::TrustDnsResolver; - mod delay_request; use delay_request::DelayRequest; @@ -33,6 +30,11 @@ pub use request_builder::{Body, RequestBuilder, Response}; mod tls_version; pub use tls_version::TLSVersion; +#[cfg(feature = "trust-dns")] +mod resolver; +#[cfg(feature = "trust-dns")] +use resolver::TrustDnsResolver; + #[cfg(feature = "json")] pub use request_builder::JsonError; diff --git a/crates/binstalk-downloader/src/resolver.rs b/crates/binstalk-downloader/src/remote/resolver.rs similarity index 99% rename from crates/binstalk-downloader/src/resolver.rs rename to crates/binstalk-downloader/src/remote/resolver.rs index b0f331e7..62350ea6 100644 --- a/crates/binstalk-downloader/src/resolver.rs +++ b/crates/binstalk-downloader/src/remote/resolver.rs @@ -3,6 +3,7 @@ use std::{net::SocketAddr, sync::Arc}; use hyper::client::connect::dns::Name; use once_cell::sync::OnceCell; use reqwest::dns::{Addrs, Resolve}; +#[cfg(windows)] use trust_dns_resolver::config::{NameServerConfig, Protocol, ResolverConfig, ResolverOpts}; use trust_dns_resolver::TokioAsyncResolver; From 390879c5d8bad4a28c280c80598a62f6ef626c36 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 17 Sep 2023 01:26:28 +0000 Subject: [PATCH 1492/2020] dep: Upgrade transitive dependencies (#1366) Co-authored-by: github-actions --- Cargo.lock | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ea18945f..037f9df7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -141,7 +141,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.35", + "syn 2.0.36", ] [[package]] @@ -617,7 +617,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.35", + "syn 2.0.36", ] [[package]] @@ -821,7 +821,7 @@ checksum = "ac4b68190bad25c00b64ea19767b2321a037fc0e5bea7563d5d8e35e04b19c95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.35", + "syn 2.0.36", ] [[package]] @@ -1124,7 +1124,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.35", + "syn 2.0.36", ] [[package]] @@ -1548,7 +1548,7 @@ checksum = "9d8acb5ee668d55f0f2d19a320a3f9ef67a6999ad483e11135abcc2464ed18b6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.35", + "syn 2.0.36", ] [[package]] @@ -2263,9 +2263,9 @@ dependencies = [ [[package]] name = "jobslot" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0953ea85c43ff26a6e5bd84152363d694a3a82435df66be0880bef38913cce9" +checksum = "9d03a2fc28c7a19e689b7e8c3f209c77dac23133d235a80cd9c3f400ecd9a73f" dependencies = [ "cfg-if", "getrandom", @@ -2325,7 +2325,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.35", + "syn 2.0.36", ] [[package]] @@ -2493,7 +2493,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.35", + "syn 2.0.36", ] [[package]] @@ -2688,7 +2688,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.35", + "syn 2.0.36", ] [[package]] @@ -2779,7 +2779,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.35", + "syn 2.0.36", ] [[package]] @@ -3326,7 +3326,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.35", + "syn 2.0.36", ] [[package]] @@ -3504,7 +3504,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.35", + "syn 2.0.36", ] [[package]] @@ -3548,9 +3548,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.35" +version = "2.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59bf04c28bee9043ed9ea1e41afc0552288d3aba9c6efdd78903b802926f4879" +checksum = "91e02e55d62894af2a08aca894c6577281f76769ba47c94d5756bec8ac6e7373" dependencies = [ "proc-macro2", "quote", @@ -3635,7 +3635,7 @@ checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.35", + "syn 2.0.36", ] [[package]] @@ -3719,7 +3719,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.35", + "syn 2.0.36", ] [[package]] @@ -3879,7 +3879,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.35", + "syn 2.0.36", ] [[package]] @@ -3997,9 +3997,9 @@ checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "uluru" @@ -4169,7 +4169,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.35", + "syn 2.0.36", "wasm-bindgen-shared", ] @@ -4203,7 +4203,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.35", + "syn 2.0.36", "wasm-bindgen-backend", "wasm-bindgen-shared", ] From b78276c03eb1f9ebd5d1dc9902f8a0dadff05875 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 17 Sep 2023 01:39:04 +0000 Subject: [PATCH 1493/2020] release: detect-targets v0.1.11 (#1367) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 037f9df7..20d32cdb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -826,7 +826,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.10" +version = "0.1.11" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 93af1f85..1dc84d38 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -25,5 +25,5 @@ toml_edit = { version = "0.20.0", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.10", path = "../detect-targets" } +detect-targets = { version = "0.1.11", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 1c74f1a7..c4e2ec80 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -18,7 +18,7 @@ binstalk-types = { version = "0.5.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "1.0.0", path = "../cargo-toml-workspace" } command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } -detect-targets = { version = "0.1.10", path = "../detect-targets" } +detect-targets = { version = "0.1.11", path = "../detect-targets" } either = "1.8.1" itertools = "0.11.0" jobslot = { version = "0.2.11", features = ["tokio"] } diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 37b5049d..9e3613ba 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.10" +version = "0.1.11" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From 2c81b749ef417a4611b45e86afad222e91d24a38 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 17 Sep 2023 01:53:04 +0000 Subject: [PATCH 1494/2020] release: binstalk-manifests v0.9.0 (#1368) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 20d32cdb..13c19cd3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -330,7 +330,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.8.1" +version = "0.9.0" dependencies = [ "beef", "binstalk-types", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index c398f13f..89d76d7f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.16.0", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.8.1" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.9.0" } clap = { version = "4.4.3", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 1dc84d38..5ef4b4a6 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.8.1" +version = "0.9.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From 53234e81ab57df2942a0f45108e3614bedb578d9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 17 Sep 2023 03:53:11 +0000 Subject: [PATCH 1495/2020] release: binstalk-downloader v0.8.0 (#1369) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 13c19cd3..a3bd8aa1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -273,7 +273,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.7.1" +version = "0.8.0" dependencies = [ "async-compression 0.4.3", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 8f441233..b7bfb01f 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.7.1" +version = "0.8.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 1562c96a..b77d5f3e 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.7.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.8.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } compact_str = { version = "0.7.0" } either = "1.8.1" @@ -28,7 +28,7 @@ tracing = "0.1.37" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.7.1", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.8.0", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 0ca274f6..886af2b8 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.7.1", path = "../binstalk-downloader", default-features = false, features = ["json"] } +binstalk-downloader = { version = "0.8.0", path = "../binstalk-downloader", default-features = false, features = ["json"] } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "1.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } @@ -35,7 +35,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.20.0", features = ["serde"] } -binstalk-downloader = { version = "0.7.1", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } +binstalk-downloader = { version = "0.8.0", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } [features] git = ["simple-git"] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index c4e2ec80..63d37972 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.1.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.7.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.8.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.1.0", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.1.0", path = "../binstalk-registry" } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } From 3f3fdd565dda010e9cec3d7b46b2e33a37838fda Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 17 Sep 2023 06:04:55 +0000 Subject: [PATCH 1496/2020] release: binstalk-fetchers v0.1.1 (#1370) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a3bd8aa1..3290e375 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -309,7 +309,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.1.0" +version = "0.1.1" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index b77d5f3e..35157b13 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.1.0" +version = "0.1.1" edition = "2021" description = "The binstall fetchers" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 63d37972..acdc8d81 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.1.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.8.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } -binstalk-fetchers = { version = "0.1.0", path = "../binstalk-fetchers", features = ["quickinstall"] } +binstalk-fetchers = { version = "0.1.1", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.1.0", path = "../binstalk-registry" } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "1.0.0", path = "../cargo-toml-workspace" } From b2602b81fc1e2c80460cfa049eb9405b366ad0c2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 17 Sep 2023 06:57:16 +0000 Subject: [PATCH 1497/2020] release: binstalk-registry v0.1.1 (#1372) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3290e375..a35ff968 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -351,7 +351,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.1.0" +version = "0.1.1" dependencies = [ "async-trait", "base16", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 886af2b8..e8159230 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.1.0" +version = "0.1.1" edition = "2021" rust-version = "1.65.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index acdc8d81..f9140145 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" binstalk-bins = { version = "0.1.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.8.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.1.1", path = "../binstalk-fetchers", features = ["quickinstall"] } -binstalk-registry = { version = "0.1.0", path = "../binstalk-registry" } +binstalk-registry = { version = "0.1.1", path = "../binstalk-registry" } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "1.0.0", path = "../cargo-toml-workspace" } command-group = { version = "2.1.0", features = ["with-tokio"] } From e4d4b15536fff200823a0813891738859d80d508 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 17 Sep 2023 07:53:35 +0000 Subject: [PATCH 1498/2020] release: binstalk v0.16.1 (#1373) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a35ff968..07d0dd46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -229,7 +229,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.16.0" +version = "0.16.1" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 89d76d7f..0d110c14 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.16.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.16.1", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.9.0" } clap = { version = "4.4.3", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index f9140145..affb6196 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.16.0" +version = "0.16.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From 82e5fc4781666bf57476d025f1b6e7a5719da4c9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 17 Sep 2023 20:16:35 +1000 Subject: [PATCH 1499/2020] release: cargo-binstall v1.3.1 (#1374) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 07d0dd46..11f66b72 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -510,7 +510,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.3.0" +version = "1.3.1" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 0d110c14..1b0d62c9 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.3.0" +version = "1.3.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 849f13f3..afd1f81e 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From f6e6a2f899ba1fccc14ce2ba47a14170c4d33e23 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 22 Sep 2023 04:12:28 +0000 Subject: [PATCH 1500/2020] dep: Upgrade transitive dependencies (#1377) Co-authored-by: github-actions --- Cargo.lock | 106 ++++++++++++++++++++++++++--------------------------- 1 file changed, 52 insertions(+), 54 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 11f66b72..bcd978d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -141,7 +141,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.36", + "syn 2.0.37", ] [[package]] @@ -553,9 +553,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.16.0" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adf89139afbf0eac9d3f07080b14f5a739f44a916196af8c0a280baa080c20b8" +checksum = "70a1f1117a8ff2f3547295da90f473c392d8d1107c90cea1ea82b1a544a97a4a" dependencies = [ "serde", "toml 0.8.0", @@ -588,9 +588,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.3" +version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84ed82781cea27b43c9b106a979fe450a13a31aab0500595fb3fc06616de08e6" +checksum = "b1d7b8d5ec32af0fadc644bf1fd509a688c2103b185644bb1e29d164e0703136" dependencies = [ "clap_builder", "clap_derive", @@ -598,9 +598,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.2" +version = "4.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bb9faaa7c2ef94b2743a21f5a29e6f0010dff4caa69ac8e9d6cf8b6fa74da08" +checksum = "5179bb514e4d7c2051749d8fcefa2ed6d06a9f4e6d69faf3805f5d80b8cf8d56" dependencies = [ "anstream", "anstyle", @@ -617,7 +617,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.36", + "syn 2.0.37", ] [[package]] @@ -821,7 +821,7 @@ checksum = "ac4b68190bad25c00b64ea19767b2321a037fc0e5bea7563d5d8e35e04b19c95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.36", + "syn 2.0.37", ] [[package]] @@ -1124,7 +1124,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.36", + "syn 2.0.37", ] [[package]] @@ -1548,7 +1548,7 @@ checksum = "9d8acb5ee668d55f0f2d19a320a3f9ef67a6999ad483e11135abcc2464ed18b6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.36", + "syn 2.0.37", ] [[package]] @@ -1997,7 +1997,7 @@ dependencies = [ "futures", "h3", "quinn 0.10.2", - "quinn-proto 0.10.4", + "quinn-proto 0.10.5", "tokio-util", ] @@ -2021,9 +2021,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "home" @@ -2325,7 +2325,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.36", + "syn 2.0.37", ] [[package]] @@ -2493,7 +2493,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.36", + "syn 2.0.37", ] [[package]] @@ -2688,7 +2688,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.36", + "syn 2.0.37", ] [[package]] @@ -2779,7 +2779,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.36", + "syn 2.0.37", ] [[package]] @@ -2868,7 +2868,7 @@ checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ "bytes", "pin-project-lite", - "quinn-proto 0.10.4", + "quinn-proto 0.10.5", "quinn-udp 0.4.1", "rustc-hash", "rustls 0.21.7", @@ -2899,9 +2899,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.10.4" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13f81c9a9d574310b8351f8666f5a93ac3b0069c45c28ad52c10291389a7cf9" +checksum = "2c78e758510582acc40acb90458401172d41f1016f8c9dde89e49677afb7eec1" dependencies = [ "bytes", "rand", @@ -2982,9 +2982,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2df5196e37bcc87abebc0053e20787d73847bb33134a69841207dd0a47f03b" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ "either", "rayon-core", @@ -2992,14 +2992,12 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b8f95bd6966f5c87776639160a66bd8ab9895d9d4ab01ddba9fc60661aebe8d" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "crossbeam-channel", "crossbeam-deque", "crossbeam-utils", - "num_cpus", ] [[package]] @@ -3147,9 +3145,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.13" +version = "0.38.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7db8590df6dfcd144d22afd1b83b36c21a18d7cbc1dc4bb5295a8712e9eb662" +checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f" dependencies = [ "bitflags 2.4.0", "errno 0.3.3", @@ -3214,9 +3212,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.5" +version = "0.101.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45a27e3b59326c16e23d30aeb7a36a24cc0d29e71d68ff611cdfb4a01d013bed" +checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" dependencies = [ "ring", "untrusted", @@ -3326,7 +3324,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.36", + "syn 2.0.37", ] [[package]] @@ -3363,9 +3361,9 @@ dependencies = [ [[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", @@ -3440,15 +3438,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" [[package]] name = "smawk" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f67ad224767faa3c7d8b6d91985b78e70a1324408abcb1cfcc2be4c06bc06043" +checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" [[package]] name = "socket2" @@ -3504,14 +3502,14 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.36", + "syn 2.0.37", ] [[package]] name = "supports-color" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4950e7174bffabe99455511c39707310e7e9b440364a2fcb1cc21521be57b354" +checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" dependencies = [ "is-terminal", "is_ci", @@ -3548,9 +3546,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.36" +version = "2.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e02e55d62894af2a08aca894c6577281f76769ba47c94d5756bec8ac6e7373" +checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" dependencies = [ "proc-macro2", "quote", @@ -3635,7 +3633,7 @@ checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" dependencies = [ "proc-macro2", "quote", - "syn 2.0.36", + "syn 2.0.37", ] [[package]] @@ -3719,7 +3717,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.36", + "syn 2.0.37", ] [[package]] @@ -3781,9 +3779,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.8" +version = "0.7.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" dependencies = [ "bytes", "futures-core", @@ -3879,7 +3877,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.36", + "syn 2.0.37", ] [[package]] @@ -4045,9 +4043,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" +checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "untrusted" @@ -4169,7 +4167,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.36", + "syn 2.0.37", "wasm-bindgen-shared", ] @@ -4203,7 +4201,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.36", + "syn 2.0.37", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4286,9 +4284,9 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" dependencies = [ "winapi", ] From efbd20857baf3bbd40631d34b89aa509c6f62627 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Sep 2023 09:55:12 +1000 Subject: [PATCH 1501/2020] Fix `detect-targets` on ubuntu 20.04, glibc 2.31 (#1379) * Fix `detect-targets` on ubuntu 20.04, glibc 2.31 Fixed #1375 and fixed #1378 glibc 2.31 does not support `--version`, so we need to detect and fallback to passing an executable linked with that glibc to check if it is indeed glibc. Signed-off-by: Jiahao XU * Fix compilation faillure on ubuntu-20.04 Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 10 +++++++++- crates/detect-targets/src/detect/linux.rs | 13 +++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c90073e3..0c10c8f3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,10 +153,18 @@ jobs: alpine test.sh "$TARGET" detect-targets-ubuntu-test: - runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + os: + - ubuntu-20.04 + - ubuntu-latest + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 - uses: Swatinem/rust-cache@v2 + with: + key: ${{ matrix.os }} - name: Build detect-targets run: cargo build --bin detect-targets - name: Run test in ubuntu diff --git a/crates/detect-targets/src/detect/linux.rs b/crates/detect-targets/src/detect/linux.rs index b2c2756f..a945c881 100644 --- a/crates/detect-targets/src/detect/linux.rs +++ b/crates/detect-targets/src/detect/linux.rs @@ -108,6 +108,19 @@ You are not meant to run this directly. } else { None } + } else if status.code() == Some(127) { + // On Ubuntu 20.04 (glibc 2.31), the `--version` flag is not supported + // and it will exit with status 127. + let status = Command::new(cmd) + .arg("/bin/true") + .stdin(Stdio::null()) + .stdout(Stdio::null()) + .stderr(Stdio::null()) + .status() + .await + .ok()?; + + status.success().then_some(Libc::Gnu) } else { None } From 32beba507b3464bed9594d12ec9dbfe4fd55aa3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 23 Sep 2023 16:02:56 +1200 Subject: [PATCH 1502/2020] Initial signing support (#1345) * Add CLI options * Add manifest types * Thread signature policy through to fetchers * Thread signing section through from metadata * Implement signing validation * Clippy * Attempt testing * Yes and * Why * fmt * Update crates/bin/src/args.rs Co-authored-by: Jiahao XU * Update crates/binstalk-fetchers/src/gh_crate_meta.rs Co-authored-by: Jiahao XU * Update crates/bin/src/args.rs Co-authored-by: Jiahao XU * Update crates/binstalk-fetchers/src/signing.rs Co-authored-by: Jiahao XU * Update crates/binstalk-fetchers/src/signing.rs Co-authored-by: Jiahao XU * Update crates/binstalk-fetchers/src/signing.rs Co-authored-by: Jiahao XU * Update crates/binstalk-fetchers/src/signing.rs Co-authored-by: Jiahao XU * fixes * Finish feature * Document * Include all fields in the signing.file template * Readme document * Review fixes * Fail on non-utf8 sig * Thank goodness for tests * Run test in ci * Add rsign2 commands * Log utf8 error * Update e2e-tests/signing.sh Co-authored-by: Jiahao XU * Fix `e2e-tests/signing.sh` MacOS CI failure Move the tls cert creation into `signing.sh` and sleep for 10s to wait for https server to start. Signed-off-by: Jiahao XU * Refactor e2e-tests-signing files - Use a tempdir generated by `mktemp` for all certificates-related files - Put other checked-in files into `e2e-tests/signing` Signed-off-by: Jiahao XU * Fixed `e2e-tests-signing` connection err in MacOS CI Wait for server to start up by trying to connect to it. Signed-off-by: Jiahao XU * Fix `e2e-tests-signing` passing `-subj` to `openssl` on Windows Use single quote instead of double quote to avoid automatic expansion from bash Signed-off-by: Jiahao XU * Fix `e2e-tests-signing` waiting for server to startup Remove `timeout` since it is not supported on MacOS. Signed-off-by: Jiahao XU * Try to fix windows CI by setting `MSYS_NO_PATHCONV=1` on `openssl` cmds Signed-off-by: Jiahao XU * Fixed `e2e-tests-signing` on windows By using double `//` for the value passed to option `-subj` Signed-off-by: Jiahao XU * Fixed infinite loop in `signing/wait-for-server` on Windows Pass `--ssl-revoke-best-effort` to prevent schannel from checking ssl revocation status. Signed-off-by: Jiahao XU * Add cap on retry attempt in `signing/wait-for-server.sh` Signed-off-by: Jiahao XU * Let `singing/server.py` print output to stderr so that we can see the error message there. Signed-off-by: Jiahao XU * Fix running `signing/server.py` on MacOS CI use `python3` since macos-latest still has python2 installed and `python` is a symlink to `python2` there. Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU Co-authored-by: Jiahao XU --- Cargo.lock | 8 + README.md | 62 ++++-- SIGNING.md | 95 +++++++++ SUPPORT.md | 1 - crates/bin/src/args.rs | 19 +- crates/bin/src/entry.rs | 11 +- crates/binstalk-downloader/src/download.rs | 30 ++- crates/binstalk-fetchers/Cargo.toml | 2 + crates/binstalk-fetchers/src/gh_crate_meta.rs | 199 +++++++++++------- crates/binstalk-fetchers/src/lib.rs | 27 +++ crates/binstalk-fetchers/src/quickinstall.rs | 10 +- crates/binstalk-fetchers/src/signing.rs | 91 ++++++++ crates/binstalk-registry/src/common.rs | 40 ++-- .../binstalk-types/src/cargo_toml_binstall.rs | 39 +++- crates/binstalk/src/errors.rs | 21 ++ .../binstalk/src/helpers/jobserver_client.rs | 1 + crates/binstalk/src/ops.rs | 9 +- crates/binstalk/src/ops/resolve.rs | 34 +-- e2e-tests/manifests/signing-Cargo.toml | 19 ++ e2e-tests/signing.sh | 33 +++ e2e-tests/signing/minisign.key | 2 + e2e-tests/signing/minisign.pub | 2 + e2e-tests/signing/server.ext | 6 + e2e-tests/signing/server.py | 15 ++ e2e-tests/signing/signing-test.exe.nasm | 74 +++++++ e2e-tests/signing/signing-test.tar | Bin 0 -> 10240 bytes e2e-tests/signing/signing-test.tar.sig | 4 + e2e-tests/signing/wait-for-server.sh | 16 ++ justfile | 3 +- 29 files changed, 723 insertions(+), 150 deletions(-) create mode 100644 SIGNING.md create mode 100644 crates/binstalk-fetchers/src/signing.rs create mode 100644 e2e-tests/manifests/signing-Cargo.toml create mode 100755 e2e-tests/signing.sh create mode 100644 e2e-tests/signing/minisign.key create mode 100644 e2e-tests/signing/minisign.pub create mode 100644 e2e-tests/signing/server.ext create mode 100644 e2e-tests/signing/server.py create mode 100644 e2e-tests/signing/signing-test.exe.nasm create mode 100644 e2e-tests/signing/signing-test.tar create mode 100644 e2e-tests/signing/signing-test.tar.sig create mode 100755 e2e-tests/signing/wait-for-server.sh diff --git a/Cargo.lock b/Cargo.lock index bcd978d7..6fb46ca3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -314,12 +314,14 @@ dependencies = [ "async-trait", "binstalk-downloader", "binstalk-types", + "bytes", "compact_str", "either", "itertools", "leon", "leon-macros", "miette", + "minisign-verify", "once_cell", "strum", "thiserror", @@ -2511,6 +2513,12 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "minisign-verify" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "933dca44d65cdd53b355d0b73d380a2ff5da71f87f036053188bf1eab6a19881" + [[package]] name = "miniz_oxide" version = "0.7.1" diff --git a/README.md b/README.md index b4144bf6..52db9ecb 100644 --- a/README.md +++ b/README.md @@ -91,28 +91,50 @@ The most ergonomic way to upgrade the installed crates is with [`cargo-update`]( Supported crates such as `cargo-binstall` itself can also be updated with `cargo-binstall` as in the example in [Installation](#installation) above. +## Signatures + +We have initial, limited [support](./SIGNING.md) for maintainers to specify a signing public key and where to find package signatures. +With this enabled, Binstall will download and verify signatures for that package. + +You can use `--only-signed` to refuse to install packages if they're not signed. + +If you like to live dangerously (please don't use this outside testing), you can use `--skip-signatures` to disable checking or even downloading signatures at all. + ## FAQ -- Why use this? - - Because `wget`-ing releases is frustrating, `cargo install` takes a not inconsequential portion of forever on constrained devices, - and often putting together actual _packages_ is overkill. -- Why use the cargo manifest? - - Crates already have these, and they already contain a significant portion of the required information. - Also, there's this great and woefully underused (IMO) `[package.metadata]` field. -- Is this secure? - - Yes and also no? We're not (yet? [#1](https://github.com/cargo-bins/cargo-binstall/issues/1)) doing anything to verify the CI binaries are produced by the right person/organization. - However, we're pulling data from crates.io and the cargo manifest, both of which are _already_ trusted entities, and this is - functionally a replacement for `curl ... | bash` or `wget`-ing the same files, so, things can be improved but it's also fairly moot -- What do the error codes mean? - - You can find a full description of errors including exit codes here: -- Can I use it in CI? - - Yes! For GitHub Actions, we recommend the excellent [taiki-e/install-action](https://github.com/marketplace/actions/install-development-tools), which has explicit support for selected tools and uses `cargo-binstall` for everything else. - - Additionally, we provide a minimal GitHub Action that installs `cargo-binstall`: - ```yml - - uses: cargo-bins/cargo-binstall@main - ``` -- Are debug symbols available? - - Yes! Extra pre-built packages with a `.full` suffix are available and contain split debuginfo, documentation files, and extra binaries like the `detect-wasi` utility. +### Why use this? +Because `wget`-ing releases is frustrating, `cargo install` takes a not inconsequential portion of forever on constrained devices, and often putting together actual _packages_ is overkill. + +### Why use the cargo manifest? +Crates already have these, and they already contain a significant portion of the required information. +Also, there's this great and woefully underused (IMO) `[package.metadata]` field. + +### Is this secure? +Yes and also no? + +We have [initial support](./SIGNING.md) for verifying signatures, but not a lot of the ecosystem produces signatures at the moment. +See [#1](https://github.com/cargo-bins/cargo-binstall/issues/1) to discuss more on this. + +We always pull the metadata from crates.io over HTTPS, and verify the checksum of the crate tar. +We also enforce using HTTPS with TLS >= 1.2 for the actual download of the package files. + +Compared to something like a `curl ... | sh` script, we're not running arbitrary code, but of course the crate you're downloading a package for might itself be malicious! + +### What do the error codes mean? +You can find a full description of errors including exit codes here: + +### Can I use it in CI? +Yes! We have two options, both for GitHub Actions: + +1. For full featured use, we recommend the excellent [taiki-e/install-action](https://github.com/marketplace/actions/install-development-tools), which has explicit support for selected tools and uses `cargo-binstall` for everything else. +2. We provide a first-party, minimal action that _only_ installs the tool: +```yml + - uses: cargo-bins/cargo-binstall@main +``` + +### Are debug symbols available? +Yes! +Extra pre-built packages with a `.full` suffix are available and contain split debuginfo, documentation files, and extra binaries like the `detect-wasi` utility. --- diff --git a/SIGNING.md b/SIGNING.md new file mode 100644 index 00000000..02927aa7 --- /dev/null +++ b/SIGNING.md @@ -0,0 +1,95 @@ +# Signature support + +Binstall supports verifying signatures of downloaded files. +At the moment, only one algorithm is supported, but this is expected to improve as time goes. + +This feature requires adding to the Cargo.toml metadata: no autodiscovery here! + +## Minimal example + +Generate a [minisign](https://jedisct1.github.io/minisign/) keypair: + +```console +minisign -G -p signing.pub -s signing.key + +# or with rsign2: +rsign generate -p signing.pub -s signing.key +``` + +In your Cargo.toml, put: + +```toml +[package.metadata.binstall.signing] +algorithm = "minisign" +pubkey = "RWRnmBcLmQbXVcEPWo2OOKMI36kki4GiI7gcBgIaPLwvxe14Wtxm9acX" +``` + +Replace the value of `pubkey` with the public key in your `signing.pub`. + +Save the `signing.key` as a secret in your CI, then use it when building packages: + +```console +tar cvf package-name.tar.zst your-files # or however + +minisign -S -s signing.key -x package-name.tar.zst.sig -m package-name.tar.zst + +# or with rsign2: +rsign sign -s signing.key -x package-name.tar.zst.sig package-name.tar.zst +``` + +Upload both your package and the matching `.sig`. + +Now when binstall downloads your packages, it will also download the `.sig` file and use the `pubkey` in the Cargo.toml to verify the signature. +If the signature has a trusted comment, it will print it at install time. + +## Reference + +- `algorithm`: required, see below. +- `pubkey`: required, must be the public key. +- `file`: optional, a template to specify the URL of the signature file. Defaults to `{ url }.sig` where `{ url }` is the download URL of the package. + +### Minisign + +`algorithm` must be `"minisign"`. + +The legacy signature format is not supported. + +The `pubkey` must be in the same format as minisign generates. +It may or may not include the untrusted comment; it's ignored by Binstall so we recommend not. + +## Just-in-time signing + +To reduce the risk of a key being stolen, this scheme supports just-in-time signing. +The idea is to generate a keypair when releasing, use it for signing the packages, save the key in the Cargo.toml before publishing to a registry, and then discard the private key when it's done. +That way, there's no key to steal nor to store securely, and every release is signed by a different key. +And because crates.io is immutable, it's impossible to overwrite the key. + +There is one caveat to keep in mind: with the scheme as described above, Binstalling with `--git` may not work: + +- If the Cargo.toml in the source contains a partially-filled `[...signing]` section, Binstall will fail. +- If the section contains a different key than the ephemeral one used to sign the packages, Binstall will refuse to install what it sees as corrupt packages. +- If the section is missing entirely, Binstall will work, but of course signatures won't be checked. + +The solution here is either: + +- Commit the Cargo.toml with the ephemeral public key to the repo when publishing. +- Omit the `[...signing]` section in the source, and write the entire section on publish instead of just filling in the `pubkey`; signatures won't be checked for `--git` installs. +- Instruct your users to use `--skip-signatures` if they want to install with `--git`. + +## Why not X? (Sigstore, GPG, signify, with SSH keys, ...) + +We're open to pull requests adding algorithms! +We're especially interested in Sigstore for a better implementation of "just-in-time" signing (which it calls "keyless"). +We chose minisign as the first supported algorithm as it's lightweight, fairly popular, and has zero options to choose from. + +## There's a competing project that does package signature verification differently! + +[Tell use about it](https://github.com/cargo-bins/cargo-binstall/issues/1)! +We're not looking to fracture the ecosystem here, and will gladly implement support if something exists already. + +We'll also work with others in the space to eventually formalise this beyond Binstall, for example around the `cargo-dist.json` metadata format. + +## What's the relationship to crate/registry signing? + +There isn't one. +Crate signing is something we're also interested in, and if/when it materialises we'll add support in Binstall for the bits that concern us, but by nature package signing is not related to (source) crate signing. diff --git a/SUPPORT.md b/SUPPORT.md index b5487ee4..b88b5517 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -1,6 +1,5 @@ # Support for `cargo binstall` - `binstall` works with existing CI-built binary outputs, with configuration via `[package.metadata.binstall]` keys in the relevant crate manifest. When configuring `binstall` you can test against a local manifest with `--manifest-path=PATH` argument to use the crate and manifest at the provided `PATH`, skipping crate discovery and download. diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index cd3bd1b6..d5fb5e5e 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -286,12 +286,29 @@ pub struct Args { /// specified (which is also shown by clap's auto generated doc below), or /// try environment variable `GH_TOKEN`, which is also used by `gh` cli. /// - /// If none of them is present, then binstal will try to extract github + /// If none of them is present, then binstall will try to extract github /// token from `$HOME/.git-credentials` or `$HOME/.config/gh/hosts.yml` /// unless `--no-discover-github-token` is specified. #[clap(help_heading = "Options", long, env = "GITHUB_TOKEN")] pub(crate) github_token: Option, + /// Only install packages that are signed + /// + /// The default is to verify signatures if they are available, but to allow + /// unsigned packages as well. + #[clap(help_heading = "Options", long)] + pub(crate) only_signed: bool, + + /// Don't check any signatures + /// + /// The default is to verify signatures if they are available. This option + /// disables that behaviour entirely, which will also stop downloading + /// signature files in the first place. + /// + /// Note that this is insecure and not recommended outside of testing. + #[clap(help_heading = "Options", long, conflicts_with = "only_signed")] + pub(crate) skip_signatures: bool, + /// Print version information #[clap(help_heading = "Meta", short = 'V')] pub version: bool, diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index d6c7ff3c..d38ec5b0 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -7,7 +7,7 @@ use std::{ use binstalk::{ errors::BinstallError, - fetchers::{Fetcher, GhCrateMeta, QuickInstall}, + fetchers::{Fetcher, GhCrateMeta, QuickInstall, SignaturePolicy}, get_desired_targets, helpers::{ gh_api_client::GhApiClient, @@ -88,6 +88,7 @@ pub fn install_crates( pkg_url: args.pkg_url, pkg_fmt: args.pkg_fmt, bin_dir: args.bin_dir, + signing: None, }; // Initialize reqwest client @@ -183,6 +184,14 @@ pub fn install_crates( } else { Default::default() }, + + signature_policy: if args.only_signed { + SignaturePolicy::Require + } else if args.skip_signatures { + SignaturePolicy::Ignore + } else { + SignaturePolicy::IfPresent + }, }); // Destruct args before any async function to reduce size of the future diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index 94162b56..53cba008 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -76,14 +76,17 @@ pub trait DataVerifier: Send + Sync { /// This method can be called repeatedly for use with streaming messages, /// it will be called in the order of the message received. fn update(&mut self, data: &Bytes); + + /// Finalise the data verification. + /// + /// Return false if the data is invalid. + fn validate(&mut self) -> bool; } -impl DataVerifier for T -where - T: FnMut(&Bytes) + Send + Sync, -{ - fn update(&mut self, data: &Bytes) { - (*self)(data) +impl DataVerifier for () { + fn update(&mut self, _: &Bytes) {} + fn validate(&mut self) -> bool { + true } } @@ -136,9 +139,7 @@ impl<'a> Download<'a> { data_verifier: Some(data_verifier), } } -} -impl<'a> Download<'a> { async fn get_stream( self, ) -> Result< @@ -182,7 +183,7 @@ where } impl Download<'_> { - /// Download a file from the provided URL and process them in memory. + /// Download a file from the provided URL and process it in memory. /// /// This does not support verifying a checksum due to the partial extraction /// and will ignore one if specified. @@ -216,7 +217,7 @@ impl Download<'_> { /// Download a file from the provided URL and extract it to the provided path. /// - /// NOTE that this would only extract directory and regular files. + /// NOTE that this will only extract directory and regular files. #[instrument(skip(path))] pub async fn and_extract( self, @@ -257,6 +258,15 @@ impl Download<'_> { inner(self, fmt, path.as_ref()).await } + + #[instrument] + pub async fn into_bytes(self) -> Result { + let bytes = self.client.get(self.url).send(true).await?.bytes().await?; + if let Some(verifier) = self.data_verifier { + verifier.update(&bytes); + } + Ok(bytes) + } } #[cfg(test)] diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 35157b13..b6dfa4e7 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -14,12 +14,14 @@ license = "GPL-3.0-only" async-trait = "0.1.68" binstalk-downloader = { version = "0.8.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.5.0", path = "../binstalk-types" } +bytes = "1.4.0" compact_str = { version = "0.7.0" } either = "1.8.1" itertools = "0.11.0" leon = { version = "2.0.1", path = "../leon" } leon-macros = { version = "1.0.0", path = "../leon-macros" } miette = "5.9.0" +minisign-verify = "0.2.1" once_cell = "1.18.0" strum = "0.25.0" thiserror = "1.0.40" diff --git a/crates/binstalk-fetchers/src/gh_crate_meta.rs b/crates/binstalk-fetchers/src/gh_crate_meta.rs index 9c0d949f..43999819 100644 --- a/crates/binstalk-fetchers/src/gh_crate_meta.rs +++ b/crates/binstalk-fetchers/src/gh_crate_meta.rs @@ -1,16 +1,16 @@ -use std::{borrow::Cow, fmt, iter, marker::PhantomData, path::Path, sync::Arc}; +use std::{borrow::Cow, fmt, iter, path::Path, sync::Arc}; use compact_str::{CompactString, ToCompactString}; use either::Either; use leon::Template; use once_cell::sync::OnceCell; use strum::IntoEnumIterator; -use tracing::{debug, warn}; +use tracing::{debug, info, trace, warn}; use url::Url; use crate::{ common::*, futures_resolver::FuturesResolver, Data, FetchError, InvalidPkgFmtError, RepoInfo, - TargetDataErased, + SignaturePolicy, SignatureVerifier, TargetDataErased, }; pub(crate) mod hosting; @@ -20,13 +20,23 @@ pub struct GhCrateMeta { gh_api_client: GhApiClient, data: Arc, target_data: Arc, - resolution: OnceCell<(Url, PkgFmt)>, + signature_policy: SignaturePolicy, + resolution: OnceCell, +} + +#[derive(Debug)] +struct Resolved { + url: Url, + pkg_fmt: PkgFmt, + archive_suffix: Option, + repo: Option, + subcrate: Option, } impl GhCrateMeta { fn launch_baseline_find_tasks( &self, - futures_resolver: &FuturesResolver<(Url, PkgFmt), FetchError>, + futures_resolver: &FuturesResolver, pkg_fmt: PkgFmt, pkg_url: &Template<'_>, repo: Option<&str>, @@ -41,7 +51,7 @@ impl GhCrateMeta { repo, subcrate, ); - match ctx.render_url_with_compiled_tt(pkg_url) { + match ctx.render_url_with(pkg_url) { Ok(url) => Some(url), Err(err) => { warn!("Failed to render url for {ctx:#?}: {err}"); @@ -58,21 +68,30 @@ impl GhCrateMeta { pkg_fmt .extensions(is_windows) .iter() - .filter_map(|ext| render_url(Some(ext))), + .filter_map(|ext| render_url(Some(ext)).map(|url| (url, Some(ext)))), ) } else { - Either::Right(render_url(None).into_iter()) + Either::Right(render_url(None).map(|url| (url, None)).into_iter()) }; // go check all potential URLs at once - futures_resolver.extend(urls.map(move |url| { + futures_resolver.extend(urls.map(move |(url, ext)| { let client = self.client.clone(); let gh_api_client = self.gh_api_client.clone(); + let repo = repo.map(ToString::to_string); + let subcrate = subcrate.map(ToString::to_string); + let archive_suffix = ext.map(ToString::to_string); async move { Ok(does_url_exist(client, gh_api_client, &url) .await? - .then_some((url, pkg_fmt))) + .then_some(Resolved { + url, + pkg_fmt, + repo, + subcrate, + archive_suffix, + })) } })); } @@ -85,12 +104,14 @@ impl super::Fetcher for GhCrateMeta { gh_api_client: GhApiClient, data: Arc, target_data: Arc, + signature_policy: SignaturePolicy, ) -> Arc { Arc::new(Self { client, gh_api_client, data, target_data, + signature_policy, resolution: OnceCell::new(), }) } @@ -131,7 +152,8 @@ impl super::Fetcher for GhCrateMeta { pkg_url: pkg_url.into(), reason: &"pkg-fmt is not specified, yet pkg-url does not contain format, \ -archive-format or archive-suffix which is required for automatically deducing pkg-fmt", + archive-format or archive-suffix which is required for automatically \ + deducing pkg-fmt", } .into()); } @@ -212,9 +234,9 @@ archive-format or archive-suffix which is required for automatically deducing pk } } - if let Some((url, pkg_fmt)) = resolver.resolve().await? { - debug!("Winning URL is {url}, with pkg_fmt {pkg_fmt}"); - self.resolution.set((url, pkg_fmt)).unwrap(); // find() is called first + if let Some(resolved) = resolver.resolve().await? { + debug!(?resolved, "Winning URL found!"); + self.resolution.set(resolved).unwrap(); // find() is called first Ok(true) } else { Ok(false) @@ -223,18 +245,75 @@ archive-format or archive-suffix which is required for automatically deducing pk } async fn fetch_and_extract(&self, dst: &Path) -> Result { - let (url, pkg_fmt) = self.resolution.get().unwrap(); // find() is called first + let resolved = self.resolution.get().unwrap(); // find() is called first + trace!(?resolved, "preparing to fetch"); + + let verifier = match (self.signature_policy, &self.target_data.meta.signing) { + (SignaturePolicy::Ignore, _) | (SignaturePolicy::IfPresent, None) => { + SignatureVerifier::Noop + } + (SignaturePolicy::Require, None) => { + debug_assert!(false, "missing signing section should be caught earlier"); + return Err(FetchError::MissingSignature); + } + (_, Some(config)) => { + let template = match config.file.as_deref() { + Some(file) => Template::parse(file)?, + None => leon_macros::template!("{ url }.sig"), + }; + trace!(?template, "parsed signature file template"); + + let sign_url = Context::from_data_with_repo( + &self.data, + &self.target_data.target, + &self.target_data.target_related_info, + resolved.archive_suffix.as_deref(), + resolved.repo.as_deref(), + resolved.subcrate.as_deref(), + ) + .with_url(&resolved.url) + .render_url_with(&template)?; + + debug!(?sign_url, "Downloading signature"); + let signature = Download::new(self.client.clone(), sign_url) + .into_bytes() + .await?; + trace!(?signature, "got signature contents"); + + SignatureVerifier::new(config, &signature)? + } + }; + debug!( - "Downloading package from: '{url}' dst:{} fmt:{pkg_fmt:?}", - dst.display() + url=%resolved.url, + dst=%dst.display(), + fmt=?resolved.pkg_fmt, + "Downloading package", ); - Ok(Download::new(self.client.clone(), url.clone()) - .and_extract(*pkg_fmt, dst) - .await?) + let mut data_verifier = verifier.data_verifier()?; + let files = Download::new_with_data_verifier( + self.client.clone(), + resolved.url.clone(), + data_verifier.as_mut(), + ) + .and_extract(resolved.pkg_fmt, dst) + .await?; + trace!("validating signature (if any)"); + if data_verifier.validate() { + if let Some(info) = verifier.info() { + info!( + "Verified signature for package '{}': {info}", + self.data.name + ); + } + Ok(files) + } else { + Err(FetchError::InvalidSignature) + } } fn pkg_fmt(&self) -> PkgFmt { - self.resolution.get().unwrap().1 + self.resolution.get().unwrap().pkg_fmt } fn target_meta(&self) -> PkgMeta { @@ -246,13 +325,13 @@ archive-format or archive-suffix which is required for automatically deducing pk fn source_name(&self) -> CompactString { self.resolution .get() - .map(|(url, _pkg_fmt)| { - if let Some(domain) = url.domain() { + .map(|resolved| { + if let Some(domain) = resolved.url.domain() { domain.to_compact_string() - } else if let Some(host) = url.host_str() { + } else if let Some(host) = resolved.url.host_str() { host.to_compact_string() } else { - url.to_compact_string() + resolved.url.to_compact_string() } }) .unwrap_or_else(|| "invalid url".into()) @@ -294,49 +373,24 @@ struct Context<'c> { /// Workspace of the crate inside the repository. subcrate: Option<&'c str>, + /// Url of the file being downloaded (only for signing.file) + url: Option<&'c Url>, + target_related_info: &'c dyn leon::Values, } impl fmt::Debug for Context<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - #[allow(dead_code)] - #[derive(Debug)] - struct Context<'c> { - name: &'c str, - repo: Option<&'c str>, - target: &'c str, - version: &'c str, - - archive_format: Option<&'c str>, - - archive_suffix: Option<&'c str>, - - binary_ext: &'c str, - - subcrate: Option<&'c str>, - - target_related_info: PhantomData<&'c dyn leon::Values>, - } - - fmt::Debug::fmt( - &Context { - name: self.name, - repo: self.repo, - target: self.target, - version: self.version, - - archive_format: self.archive_format, - - archive_suffix: self.archive_suffix, - - binary_ext: self.binary_ext, - - subcrate: self.subcrate, - - target_related_info: PhantomData, - }, - f, - ) + f.debug_struct("Context") + .field("name", &self.name) + .field("repo", &self.repo) + .field("target", &self.target) + .field("version", &self.version) + .field("archive_format", &self.archive_format) + .field("binary_ext", &self.binary_ext) + .field("subcrate", &self.subcrate) + .field("url", &self.url) + .finish_non_exhaustive() } } @@ -359,6 +413,8 @@ impl leon::Values for Context<'_> { "subcrate" => self.subcrate.map(Cow::Borrowed), + "url" => self.url.map(|url| Cow::Borrowed(url.as_str())), + key => self.target_related_info.get_value(key), } } @@ -398,24 +454,25 @@ impl<'c> Context<'c> { "" }, subcrate, + url: None, target_related_info, } } - /// * `tt` - must have added a template named "pkg_url". - fn render_url_with_compiled_tt(&self, tt: &Template<'_>) -> Result { - debug!("Render {tt:#?} using context: {self:?}"); + fn with_url(&mut self, url: &'c Url) -> &mut Self { + self.url = Some(url); + self + } - Ok(Url::parse(&tt.render(self)?)?) + fn render_url_with(&self, template: &Template<'_>) -> Result { + debug!(?template, context=?self, "render url template"); + Ok(Url::parse(&template.render(self)?)?) } #[cfg(test)] fn render_url(&self, template: &str) -> Result { - debug!("Render {template} using context in render_url: {self:?}"); - - let tt = Template::parse(template)?; - self.render_url_with_compiled_tt(&tt) + self.render_url_with(&Template::parse(template)?) } } diff --git a/crates/binstalk-fetchers/src/lib.rs b/crates/binstalk-fetchers/src/lib.rs index 4a99495f..a742e87e 100644 --- a/crates/binstalk-fetchers/src/lib.rs +++ b/crates/binstalk-fetchers/src/lib.rs @@ -5,6 +5,7 @@ use std::{path::Path, sync::Arc}; use binstalk_downloader::{ download::DownloadError, gh_api_client::GhApiError, remote::Error as RemoteError, }; +use binstalk_types::cargo_toml_binstall::SigningAlgorithm; use thiserror::Error as ThisError; use tokio::sync::OnceCell; pub use url::ParseError as UrlParseError; @@ -20,6 +21,9 @@ pub use quickinstall::*; mod common; use common::*; +mod signing; +use signing::*; + mod futures_resolver; use gh_crate_meta::hosting::RepositoryHost; @@ -57,6 +61,15 @@ pub enum FetchError { #[error("Failed to parse url: {0}")] UrlParse(#[from] UrlParseError), + + #[error("Signing algorithm not supported: {0:?}")] + UnsupportedSigningAlgorithm(SigningAlgorithm), + + #[error("No signature present")] + MissingSignature, + + #[error("Failed to verify signature")] + InvalidSignature, } impl From for FetchError { @@ -80,6 +93,7 @@ pub trait Fetcher: Send + Sync { gh_api_client: GhApiClient, data: Arc, target_data: Arc, + signature_policy: SignaturePolicy, ) -> Arc where Self: Sized; @@ -133,6 +147,19 @@ struct RepoInfo { subcrate: Option, } +/// What to do about package signatures +#[derive(Clone, Copy, Debug, Eq, PartialEq)] +pub enum SignaturePolicy { + /// Don't process any signing information at all + Ignore, + + /// Verify and fail if a signature is found, but pass a signature-less package + IfPresent, + + /// Require signatures to be present (and valid) + Require, +} + /// Data required to fetch a package #[derive(Clone, Debug)] pub struct Data { diff --git a/crates/binstalk-fetchers/src/quickinstall.rs b/crates/binstalk-fetchers/src/quickinstall.rs index 8262d408..09942cf3 100644 --- a/crates/binstalk-fetchers/src/quickinstall.rs +++ b/crates/binstalk-fetchers/src/quickinstall.rs @@ -5,7 +5,7 @@ use binstalk_types::cargo_toml_binstall::{PkgFmt, PkgMeta}; use tokio::sync::OnceCell; use url::Url; -use crate::{common::*, Data, FetchError, TargetDataErased}; +use crate::{common::*, Data, FetchError, SignaturePolicy, TargetDataErased}; const BASE_URL: &str = "https://github.com/cargo-bins/cargo-quickinstall/releases/download"; const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; @@ -51,6 +51,7 @@ pub struct QuickInstall { package: String, package_url: Url, stats_url: Url, + signature_policy: SignaturePolicy, target_data: Arc, } @@ -76,6 +77,7 @@ impl super::Fetcher for QuickInstall { gh_api_client: GhApiClient, data: Arc, target_data: Arc, + signature_policy: SignaturePolicy, ) -> Arc { let crate_name = &data.name; let version = &data.version; @@ -95,6 +97,7 @@ impl super::Fetcher for QuickInstall { stats_url: Url::parse(&format!("{STATS_URL}/{package}.tar.gz",)) .expect("stats_url is pre-generated and should never be invalid url"), package, + signature_policy, target_data, }) @@ -102,6 +105,11 @@ impl super::Fetcher for QuickInstall { fn find(self: Arc) -> JoinHandle> { tokio::spawn(async move { + // until quickinstall supports signatures, blanket deny: + if self.signature_policy == SignaturePolicy::Require { + return Err(FetchError::MissingSignature); + } + if !self.is_supported().await? { return Ok(false); } diff --git a/crates/binstalk-fetchers/src/signing.rs b/crates/binstalk-fetchers/src/signing.rs new file mode 100644 index 00000000..8513d180 --- /dev/null +++ b/crates/binstalk-fetchers/src/signing.rs @@ -0,0 +1,91 @@ +use binstalk_downloader::download::DataVerifier; +use binstalk_types::cargo_toml_binstall::{PkgSigning, SigningAlgorithm}; +use bytes::Bytes; +use minisign_verify::{PublicKey, Signature, StreamVerifier}; +use tracing::{error, trace}; + +use crate::FetchError; + +pub enum SignatureVerifier { + Noop, + Minisign(Box), +} + +impl SignatureVerifier { + pub fn new(config: &PkgSigning, signature: &[u8]) -> Result { + match config.algorithm { + SigningAlgorithm::Minisign => MinisignVerifier::new(config, signature) + .map(Box::new) + .map(Self::Minisign), + algorithm => Err(FetchError::UnsupportedSigningAlgorithm(algorithm)), + } + } + + pub fn data_verifier(&self) -> Result, FetchError> { + match self { + Self::Noop => Ok(Box::new(())), + Self::Minisign(v) => v.data_verifier(), + } + } + + pub fn info(&self) -> Option { + match self { + Self::Noop => None, + Self::Minisign(v) => Some(v.signature.trusted_comment().into()), + } + } +} + +pub struct MinisignVerifier { + pubkey: PublicKey, + signature: Signature, +} + +impl MinisignVerifier { + pub fn new(config: &PkgSigning, signature: &[u8]) -> Result { + trace!(key=?config.pubkey, "parsing public key"); + let pubkey = PublicKey::from_base64(&config.pubkey).map_err(|err| { + error!("Package public key is invalid: {err}"); + FetchError::InvalidSignature + })?; + + trace!(?signature, "parsing signature"); + let signature = Signature::decode(std::str::from_utf8(signature).map_err(|err| { + error!(?signature, "Signature file is not UTF-8! {err}"); + FetchError::InvalidSignature + })?) + .map_err(|err| { + error!("Signature file is invalid: {err}"); + FetchError::InvalidSignature + })?; + + Ok(Self { pubkey, signature }) + } + + pub fn data_verifier(&self) -> Result, FetchError> { + self.pubkey + .verify_stream(&self.signature) + .map(|vs| Box::new(MinisignDataVerifier(vs)) as _) + .map_err(|err| { + error!("Failed to setup stream verifier: {err}"); + FetchError::InvalidSignature + }) + } +} + +pub struct MinisignDataVerifier<'a>(StreamVerifier<'a>); + +impl<'a> DataVerifier for MinisignDataVerifier<'a> { + fn update(&mut self, data: &Bytes) { + self.0.update(data); + } + + fn validate(&mut self) -> bool { + if let Err(err) = self.0.finalize() { + error!("Failed to finalize signature verify: {err}"); + false + } else { + true + } + } +} diff --git a/crates/binstalk-registry/src/common.rs b/crates/binstalk-registry/src/common.rs index 7d4a719a..5f14f3e9 100644 --- a/crates/binstalk-registry/src/common.rs +++ b/crates/binstalk-registry/src/common.rs @@ -23,17 +23,35 @@ pub(super) struct RegistryConfig { pub(super) dl: CompactString, } -struct Sha256Digest(Sha256); +struct Sha256Digest { + expected: Vec, + actual: Option>, + state: Option, +} -impl Default for Sha256Digest { - fn default() -> Self { - Sha256Digest(Sha256::new()) +impl Sha256Digest { + fn new(checksum: Vec) -> Self { + Self { + expected: checksum, + actual: None, + state: Some(Sha256::new()), + } } } impl DataVerifier for Sha256Digest { fn update(&mut self, data: &Bytes) { - self.0.update(data); + if let Some(ref mut state) = &mut self.state { + state.update(data); + } + } + + fn validate(&mut self) -> bool { + if let Some(state) = self.state.take() { + self.actual = Some(state.finalize().to_vec()); + } + + self.actual.as_ref().unwrap() == &self.expected } } @@ -49,18 +67,16 @@ pub(super) async fn parse_manifest( let mut manifest_visitor = ManifestVisitor::new(format!("{crate_name}-{version}").into()); let checksum = decode_base16(cksum.as_bytes()).map_err(RegistryError::from)?; - let mut sha256_digest = Sha256Digest::default(); + let mut digest = Sha256Digest::new(checksum); - Download::new_with_data_verifier(client, crate_url, &mut sha256_digest) + Download::new_with_data_verifier(client, crate_url, &mut digest) .and_visit_tar(TarBasedFmt::Tgz, &mut manifest_visitor) .await?; - let digest_checksum = sha256_digest.0.finalize(); - - if digest_checksum.as_slice() != checksum.as_slice() { + if !digest.validate() { Err(RegistryError::UnmatchedChecksum { - expected: cksum.into(), - actual: encode_base16(digest_checksum.as_slice()).into(), + expected: encode_base16(digest.expected.as_slice()).into(), + actual: encode_base16(digest.actual.unwrap().as_slice()).into(), }) } else { manifest_visitor.load_manifest() diff --git a/crates/binstalk-types/src/cargo_toml_binstall.rs b/crates/binstalk-types/src/cargo_toml_binstall.rs index b941d063..4a7a28f4 100644 --- a/crates/binstalk-types/src/cargo_toml_binstall.rs +++ b/crates/binstalk-types/src/cargo_toml_binstall.rs @@ -34,8 +34,8 @@ pub struct PkgMeta { /// Path template for binary files in packages pub bin_dir: Option, - /// Public key for package verification (base64 encoded) - pub pub_key: Option, + /// Package signing configuration + pub signing: Option, /// Target specific overrides pub overrides: BTreeMap, @@ -76,11 +76,16 @@ impl PkgMeta { .or(self.pkg_fmt), bin_dir: pkg_overrides + .clone() .into_iter() .find_map(|pkg_override| pkg_override.bin_dir.clone()) .or_else(|| self.bin_dir.clone()), - pub_key: self.pub_key.clone(), + signing: pkg_overrides + .into_iter() + .find_map(|pkg_override| pkg_override.signing.clone()) + .or_else(|| self.signing.clone()), + overrides: Default::default(), } } @@ -100,6 +105,9 @@ pub struct PkgOverride { /// Path template override for binary files in packages pub bin_dir: Option, + + /// Package signing configuration + pub signing: Option, } #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] @@ -107,6 +115,29 @@ pub struct PkgOverride { pub struct BinMeta { /// Binary name pub name: String, - /// Binary template path (within package) + + /// Binary template (path within package) pub path: String, } + +#[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "kebab-case")] +pub struct PkgSigning { + /// Signing algorithm supported by Binstall. + pub algorithm: SigningAlgorithm, + + /// Signing public key + pub pubkey: String, + + /// Signature file override template (url to download) + #[serde(default)] + pub file: Option, +} + +#[derive(Clone, Copy, Debug, Eq, PartialEq, Serialize, Deserialize)] +#[serde(rename_all = "kebab-case")] +#[non_exhaustive] +pub enum SigningAlgorithm { + /// [minisign](https://jedisct1.github.io/minisign/) + Minisign, +} diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index 3e56b122..c64525e4 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -72,6 +72,25 @@ pub enum BinstallError { #[diagnostic(severity(info), code(binstall::user_abort))] UserAbort, + /// Package is not signed and policy requires it. + /// + /// - Code: `binstall::signature::invalid` + /// - Exit: 40 + #[error("Crate {crate_name} is signed and package {package_name} failed verification")] + #[diagnostic(severity(error), code(binstall::signature::invalid))] + InvalidSignature { + crate_name: CompactString, + package_name: CompactString, + }, + + /// Package is not signed and policy requires it. + /// + /// - Code: `binstall::signature::missing` + /// - Exit: 41 + #[error("Crate {0} does not have signing information")] + #[diagnostic(severity(error), code(binstall::signature::missing))] + MissingSignature(CompactString), + /// A URL is invalid. /// /// This may be the result of a template in a Cargo manifest. @@ -333,6 +352,8 @@ impl BinstallError { let code: u8 = match self { TaskJoinError(_) => 17, UserAbort => 32, + InvalidSignature { .. } => 40, + MissingSignature(_) => 41, UrlParse(_) => 65, TemplateParseError(..) => 67, FetchError(..) => 68, diff --git a/crates/binstalk/src/helpers/jobserver_client.rs b/crates/binstalk/src/helpers/jobserver_client.rs index 5b625d9d..ae9db6b2 100644 --- a/crates/binstalk/src/helpers/jobserver_client.rs +++ b/crates/binstalk/src/helpers/jobserver_client.rs @@ -5,6 +5,7 @@ use tokio::sync::OnceCell; use crate::errors::BinstallError; +#[derive(Debug)] pub struct LazyJobserverClient(OnceCell); impl LazyJobserverClient { diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index eb75b724..2124c14e 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -5,7 +5,7 @@ use std::{path::PathBuf, sync::Arc}; use semver::VersionReq; use crate::{ - fetchers::{Data, Fetcher, TargetDataErased}, + fetchers::{Data, Fetcher, SignaturePolicy, TargetDataErased}, helpers::{ self, gh_api_client::GhApiClient, jobserver_client::LazyJobserverClient, remote::Client, }, @@ -16,8 +16,10 @@ use crate::{ pub mod resolve; -pub type Resolver = fn(Client, GhApiClient, Arc, Arc) -> Arc; +pub type Resolver = + fn(Client, GhApiClient, Arc, Arc, SignaturePolicy) -> Arc; +#[derive(Debug)] #[non_exhaustive] pub enum CargoTomlFetchOverride { #[cfg(feature = "git")] @@ -25,6 +27,7 @@ pub enum CargoTomlFetchOverride { Path(PathBuf), } +#[derive(Debug)] pub struct Options { pub no_symlinks: bool, pub dry_run: bool, @@ -49,4 +52,6 @@ pub struct Options { pub gh_api_client: GhApiClient, pub jobserver_client: LazyJobserverClient, pub registry: Registry, + + pub signature_policy: SignaturePolicy, } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 8ab5ec3c..f2731867 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -19,7 +19,7 @@ use tracing::{debug, error, info, instrument, warn}; use crate::{ bins, errors::{BinstallError, VersionParseError}, - fetchers::{Data, Fetcher, TargetData}, + fetchers::{Data, Fetcher, SignaturePolicy, TargetData}, helpers::{ self, cargo_toml::Manifest, cargo_toml_workspace::load_manifest_from_workspace, download::ExtractedFiles, remote::Client, target_triple::TargetTriple, @@ -83,6 +83,10 @@ async fn resolve_inner( return Ok(Resolution::AlreadyUpToDate); }; + if opts.signature_policy == SignaturePolicy::Require && !package_info.signing { + return Err(BinstallError::MissingSignature(package_info.name)); + } + let desired_targets = opts .desired_targets .get() @@ -126,6 +130,7 @@ async fn resolve_inner( opts.gh_api_client.clone(), data.clone(), target_data, + opts.signature_policy, ); (fetcher.clone(), AutoAbortJoinHandle::new(fetcher.find())) }), @@ -216,36 +221,11 @@ async fn download_extract_and_verify( // Download and extract it. // If that fails, then ignore this fetcher. let extracted_files = fetcher.fetch_and_extract(bin_path).await?; - debug!("extracted_files = {extracted_files:#?}"); // Build final metadata let meta = fetcher.target_meta(); - #[cfg(incomplete)] - { - // Fetch and check package signature if available - if let Some(pub_key) = meta.as_ref().map(|m| m.pub_key.clone()).flatten() { - debug!("Found public key: {pub_key}"); - - // Generate signature file URL - let mut sig_ctx = ctx.clone(); - sig_ctx.format = "sig".to_string(); - let sig_url = sig_ctx.render(&pkg_url)?; - - debug!("Fetching signature file: {sig_url}"); - - // Download signature file - let sig_path = temp_dir.join(format!("{pkg_name}.sig")); - download(&sig_url, &sig_path).await?; - - // TODO: do the signature check - unimplemented!() - } else { - warn!("No public key found, package signature could not be validated"); - } - } - // Verify that all non-optional bin_files exist let bin_files = collect_bin_files( fetcher, @@ -357,6 +337,7 @@ struct PackageInfo { version: Version, repo: Option, overrides: BTreeMap, + signing: bool, } struct Bin { @@ -465,6 +446,7 @@ impl PackageInfo { } else { Ok(Some(Self { overrides: mem::take(&mut meta.overrides), + signing: meta.signing.is_some(), meta, binaries, name, diff --git a/e2e-tests/manifests/signing-Cargo.toml b/e2e-tests/manifests/signing-Cargo.toml new file mode 100644 index 00000000..962416ad --- /dev/null +++ b/e2e-tests/manifests/signing-Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "signing-test" +description = "Rust binary package installer for CI integration" +version = "0.1.0" +authors = ["ryan "] +edition = "2021" +license = "GPL-3.0" + +[[bin]] +name = "signing-test" +path = "src/main.rs" + +[package.metadata.binstall] +pkg-url = "https://localhost:4443/signing-test.tar" +pkg-fmt = "tar" + +[package.metadata.binstall.signing] +algorithm = "minisign" +pubkey = "RWRnmBcLmQbXVcEPWo2OOKMI36kki4GiI7gcBgIaPLwvxe14Wtxm9acX" diff --git a/e2e-tests/signing.sh b/e2e-tests/signing.sh new file mode 100755 index 00000000..66e8e237 --- /dev/null +++ b/e2e-tests/signing.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +set -euxo pipefail + +unset CARGO_INSTALL_ROOT + +CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export CARGO_HOME +export PATH="$CARGO_HOME/bin:$PATH" + +echo Generate tls cert + +CERT_DIR=$(mktemp -d 2>/dev/null || mktemp -d -t 'cert-dir') +export CERT_DIR + +openssl req -newkey rsa:4096 -x509 -sha256 -days 1 -nodes -out "$CERT_DIR/"ca.pem -keyout "$CERT_DIR/"ca.key -subj '//C=UT/CN=ca.localhost' +openssl req -new -newkey rsa:4096 -sha256 -nodes -out "$CERT_DIR/"server.csr -keyout "$CERT_DIR/"server.key -subj '//C=UT/CN=localhost' +openssl x509 -req -in "$CERT_DIR/"server.csr -CA "$CERT_DIR/"ca.pem -CAkey "$CERT_DIR/"ca.key -CAcreateserial -out "$CERT_DIR/"server.pem -days 1 -sha256 -extfile signing/server.ext + +python3 signing/server.py & +server_pid=$! +trap 'kill $server_pid' ERR INT TERM + +export BINSTALL_HTTPS_ROOT_CERTS="$CERT_DIR/ca.pem" + +signing/wait-for-server.sh + +"./$1" binstall --force --manifest-path manifests/signing-Cargo.toml --no-confirm signing-test +"./$1" binstall --force --manifest-path manifests/signing-Cargo.toml --no-confirm --only-signed signing-test +"./$1" binstall --force --manifest-path manifests/signing-Cargo.toml --no-confirm --skip-signatures signing-test + + +kill $server_pid || true diff --git a/e2e-tests/signing/minisign.key b/e2e-tests/signing/minisign.key new file mode 100644 index 00000000..5716be67 --- /dev/null +++ b/e2e-tests/signing/minisign.key @@ -0,0 +1,2 @@ +untrusted comment: minisign encrypted secret key +RWQAAEIyAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZ5gXC5kG11Wu99VVpToebb+yc0MOw4cbWzxSHyOxoSTu6kBrK09z/MEPWo2OOKMI36kki4GiI7gcBgIaPLwvxe14Wtxm9acXAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA= diff --git a/e2e-tests/signing/minisign.pub b/e2e-tests/signing/minisign.pub new file mode 100644 index 00000000..0baa41c7 --- /dev/null +++ b/e2e-tests/signing/minisign.pub @@ -0,0 +1,2 @@ +untrusted comment: minisign public key 55D706990B179867 +RWRnmBcLmQbXVcEPWo2OOKMI36kki4GiI7gcBgIaPLwvxe14Wtxm9acX diff --git a/e2e-tests/signing/server.ext b/e2e-tests/signing/server.ext new file mode 100644 index 00000000..0bba95d3 --- /dev/null +++ b/e2e-tests/signing/server.ext @@ -0,0 +1,6 @@ +authorityKeyIdentifier=keyid,issuer +basicConstraints=CA:FALSE +keyUsage = digitalSignature, nonRepudiation, keyEncipherment, dataEncipherment +subjectAltName = @alt_names +[alt_names] +DNS.1 = localhost diff --git a/e2e-tests/signing/server.py b/e2e-tests/signing/server.py new file mode 100644 index 00000000..79d7749a --- /dev/null +++ b/e2e-tests/signing/server.py @@ -0,0 +1,15 @@ +import http.server +import os +import ssl +from pathlib import Path + +cert_dir = Path(os.environ["CERT_DIR"]) + +os.chdir(os.path.dirname(__file__)) + +server_address = ('', 4443) +httpd = http.server.HTTPServer(server_address, http.server.SimpleHTTPRequestHandler) +ctx = ssl.SSLContext(protocol=ssl.PROTOCOL_TLS_SERVER) +ctx.load_cert_chain(certfile=cert_dir / "server.pem", keyfile=cert_dir / "server.key") +httpd.socket = ctx.wrap_socket(httpd.socket, server_side=True) +httpd.serve_forever() diff --git a/e2e-tests/signing/signing-test.exe.nasm b/e2e-tests/signing/signing-test.exe.nasm new file mode 100644 index 00000000..35b23301 --- /dev/null +++ b/e2e-tests/signing/signing-test.exe.nasm @@ -0,0 +1,74 @@ +; tiny97.asm, copyright Alexander Sotirov + +BITS 32 +; +; MZ header +; The only two fields that matter are e_magic and e_lfanew + +mzhdr: + dw "MZ" ; e_magic + dw 0 ; e_cblp UNUSED + +; PE signature +pesig: + dd "PE" ; e_cp, e_crlc UNUSED ; PE signature + +; PE header +pehdr: + dw 0x014C ; e_cparhdr UNUSED ; Machine (Intel 386) + dw 1 ; e_minalloc UNUSED ; NumberOfSections + +; dd 0xC3582A6A ; e_maxalloc, e_ss UNUSED ; TimeDateStamp UNUSED + +; Entry point +start: + push byte 42 + pop eax + ret + +codesize equ $ - start + + dd 0 ; e_sp, e_csum UNUSED ; PointerToSymbolTable UNUSED + dd 0 ; e_ip, e_cs UNUSED ; NumberOfSymbols UNUSED + dw sections-opthdr ; e_lsarlc UNUSED ; SizeOfOptionalHeader + dw 0x103 ; e_ovno UNUSED ; Characteristics + +; PE optional header +; The debug directory size at offset 0x94 from here must be 0 + +filealign equ 4 +sect_align equ 4 ; must be 4 because of e_lfanew + +%define round(n, r) (((n+(r-1))/r)*r) + +opthdr: + dw 0x10B ; e_res UNUSED ; Magic (PE32) + db 8 ; MajorLinkerVersion UNUSED + db 0 ; MinorLinkerVersion UNUSED + +; PE code section +sections: + dd round(codesize, filealign) ; SizeOfCode UNUSED ; Name UNUSED + dd 0 ; e_oemid, e_oeminfo UNUSED ; SizeOfInitializedData UNUSED + dd codesize ; e_res2 UNUSED ; SizeOfUninitializedData UNUSED ; VirtualSize + dd start ; AddressOfEntryPoint ; VirtualAddress + dd codesize ; BaseOfCode UNUSED ; SizeOfRawData + dd start ; BaseOfData UNUSED ; PointerToRawData + dd 0x400000 ; ImageBase ; PointerToRelocations UNUSED + dd sect_align ; e_lfanew ; SectionAlignment ; PointerToLinenumbers UNUSED + dd filealign ; FileAlignment ; NumberOfRelocations, NumberOfLinenumbers UNUSED + dw 4 ; MajorOperatingSystemVersion UNUSED ; Characteristics UNUSED + dw 0 ; MinorOperatingSystemVersion UNUSED + dw 0 ; MajorImageVersion UNUSED + dw 0 ; MinorImageVersion UNUSED + dw 4 ; MajorSubsystemVersion + dw 0 ; MinorSubsystemVersion UNUSED + dd 0 ; Win32VersionValue UNUSED + dd round(hdrsize, sect_align)+round(codesize,sect_align) ; SizeOfImage + dd round(hdrsize, filealign) ; SizeOfHeaders + dd 0 ; CheckSum UNUSED + db 2 ; Subsystem (Win32 GUI) + +hdrsize equ $ - $$ +filesize equ $ - $$ + diff --git a/e2e-tests/signing/signing-test.tar b/e2e-tests/signing/signing-test.tar new file mode 100644 index 0000000000000000000000000000000000000000..de55cfefa35bfc5875c9213deb4544e156e95bd4 GIT binary patch literal 10240 zcmeIyu};G<5P;zebU=lNNX3Q(wTWG?ENmb#BDR)BZ5RToQ>pLAi{S$z+=-s;{8_)7QL>NW%^%|Q3rJ9Znp z`KB!8V;0acaDCF(x`LqAgNKT9M;!H-r3mPv{@1w}w z_gLro9^Jl9eW`=gPJRMk1Q0*~0R#|0009ILKmY**5I_I{1Q0*~0R#|0009ILKmY** L5I_Kdfdsw)`}{Wb literal 0 HcmV?d00001 diff --git a/e2e-tests/signing/signing-test.tar.sig b/e2e-tests/signing/signing-test.tar.sig new file mode 100644 index 00000000..0f059432 --- /dev/null +++ b/e2e-tests/signing/signing-test.tar.sig @@ -0,0 +1,4 @@ +untrusted comment: signature from minisign secret key +RURnmBcLmQbXVVINqskhik18fjpzn1TTn7UZWPC6TuVNSZc+0CqLiNxJhBvT3aXiFHxiEwiBeQaFipsxXux06C12+rwT9Pozgwo= +trusted comment: timestamp:1693846563 file:signing-test.tar hashed +fQqqvTO6KgHSHf6/n18FQVJgO8azb1dB90jwj2YukbRfwK3QD0rNSDFBmhN73H7Pwxsz9of42OG60dfXA+ldCQ== diff --git a/e2e-tests/signing/wait-for-server.sh b/e2e-tests/signing/wait-for-server.sh new file mode 100755 index 00000000..00d0d25c --- /dev/null +++ b/e2e-tests/signing/wait-for-server.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +set -euxo pipefail + +CERT="${BINSTALL_HTTPS_ROOT_CERTS?}" + +counter=0 + +while ! curl --cacert "$CERT" --ssl-revoke-best-effort -L https://localhost:4443/signing-test.tar | file -; do + counter=$(( counter + 1 )) + if [ "$counter" = "20" ]; then + echo Failed to connect to https server + exit 1; + fi + sleep 10 +done diff --git a/justfile b/justfile index e493a0c7..4c654d72 100644 --- a/justfile +++ b/justfile @@ -247,6 +247,7 @@ e2e-test-uninstall: (e2e-test "uninstall") e2e-test-no-track: (e2e-test "no-track") e2e-test-git: (e2e-test "git") e2e-test-registries: (e2e-test "registries") +e2e-test-signing: (e2e-test "signing") # WinTLS (Windows in CI) does not have TLS 1.3 support [windows] @@ -255,7 +256,7 @@ e2e-test-tls: (e2e-test "tls" "1.2") [macos] e2e-test-tls: (e2e-test "tls" "1.2") (e2e-test "tls" "1.3") -e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-git e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate e2e-test-no-track e2e-test-registries +e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-git e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate e2e-test-no-track e2e-test-registries e2e-test-signing unit-tests: print-env {{cargo-bin}} test {{cargo-build-args}} From ee7fcb3210a85a675c6e9606c8356fbaecc44dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 23 Sep 2023 20:07:19 +1200 Subject: [PATCH 1503/2020] Sign our releases (#1347) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Sign our releases * Use secrets instead of artifacts * And the universal * Apparently we can’t use secrets like that? * Minor fixes to doc * Private key requires untrusted comment * Dogfood one deeper --- .github/scripts/ephemeral-gen.sh | 16 ++++++++++++ .github/scripts/ephemeral-sign.sh | 19 ++++++++++++++ .github/workflows/release-build.yml | 20 +++++++++++++++ .github/workflows/release.yml | 39 +++++++++++++++++++++-------- SIGNING.md | 8 +++--- 5 files changed, 88 insertions(+), 14 deletions(-) create mode 100755 .github/scripts/ephemeral-gen.sh create mode 100755 .github/scripts/ephemeral-sign.sh diff --git a/.github/scripts/ephemeral-gen.sh b/.github/scripts/ephemeral-gen.sh new file mode 100755 index 00000000..065b4673 --- /dev/null +++ b/.github/scripts/ephemeral-gen.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash + +set -euxo pipefail + +cargo binstall -y rsign2 +rsign generate -f -W -p minisign.pub -s minisign.key + +cat >> crates/bin/Cargo.toml <> "$GITHUB_OUTPUT" diff --git a/.github/scripts/ephemeral-sign.sh b/.github/scripts/ephemeral-sign.sh new file mode 100755 index 00000000..a657c915 --- /dev/null +++ b/.github/scripts/ephemeral-sign.sh @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +set -euo pipefail + +echo "untrusted comment: rsign encrypted secret key" > minisign.key +cat >> minisign.key <<< "$SIGNING_KEY" + +set -x + +cargo binstall -y rsign2 + +ts=$(date --utc --iso-8601=seconds) +git=$(git rev-parse HEAD) +comment="gh=$GITHUB_REPOSITORY git=$git ts=$ts run=$GITHUB_RUN_ID" + +for file in "$@"; do + rsign sign -W -s minisign.key -x "$file.sig" -t "$comment" "$file" +done + diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 64c6796d..0b2c20a1 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -16,6 +16,10 @@ on: description: "Set to override default release profile codegen-units settings" required: false type: string + secrets: + signingkey: + description: "Minisign private key. Required when publishing" + required: false env: CARGO_TERM_COLOR: always @@ -84,6 +88,14 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: inputs.publish + uses: cargo-bins/cargo-binstall@main + + - if: inputs.publish + env: + SIGNING_KEY: ${{ secrets.signingkey }} + run: .github/scripts/ephemeral-sign.sh packages/cargo-binstall-* + - if: inputs.publish name: Upload to release uses: svenstaro/upload-release-action@v2 @@ -140,6 +152,14 @@ jobs: - run: just repackage-lipo - run: ls -shal packages/ + - if: inputs.publish + uses: cargo-bins/cargo-binstall@main + + - if: inputs.publish + env: + SIGNING_KEY: ${{ secrets.signingkey }} + run: .github/scripts/ephemeral-sign.sh packages/cargo-binstall-universal-* + - if: inputs.publish name: Upload to release uses: svenstaro/upload-release-action@v2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e82ab9a4..4e694e7d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,8 +22,8 @@ jobs: event-data: ${{ toJSON(github.event) }} extract-notes-under: '### Release notes' - tag: - if: needs.info.outputs.is-release == 'true' + libtag: + if: needs.info.outputs.is-release == 'true' && needs.info.outputs.crate != 'cargo-binstall' needs: info runs-on: ubuntu-latest steps: @@ -35,24 +35,43 @@ jobs: github_token: ${{ secrets.GITHUB_TOKEN }} custom_tag: ${{ needs.info.outputs.version }} tag_prefix: ${{ needs.info.outputs.crate }}-v - - name: Push cli release tag - if: needs.info.outputs.crate == 'cargo-binstall' - uses: mathieudutour/github-tag-action@v6.1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - custom_tag: ${{ needs.info.outputs.version }} - tag_prefix: v - name: Publish to crates.io run: | cargo publish -p '${{ needs.info.outputs.crate }}' env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + clitag: + if: needs.info.outputs.is-release == 'true' && needs.info.outputs.crate == 'cargo-binstall' + needs: info + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Push cli release tag + uses: mathieudutour/github-tag-action@v6.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + custom_tag: ${{ needs.info.outputs.version }} + tag_prefix: v + - uses: cargo-bins/cargo-binstall@main + - name: Create ephemeral keypair + id: keypair + run: .github/scripts/ephemeral-gen.sh + - name: Publish to crates.io + env: + crate: ${{ needs.info.outputs.crate }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + run: cargo publish -p "$crate" + outputs: + signingkey: ${{ steps.keypair.outputs.private }} + package: if: needs.info.outputs.is-release == 'true' && needs.info.outputs.crate == 'cargo-binstall' needs: - info - - tag + - clitag uses: ./.github/workflows/release-build.yml with: publish: ${{ toJSON(needs.info.outputs) }} + secrets: + signingkey: ${{ needs.clitag.signingkey }} diff --git a/SIGNING.md b/SIGNING.md index 02927aa7..d18eff0f 100644 --- a/SIGNING.md +++ b/SIGNING.md @@ -59,7 +59,7 @@ It may or may not include the untrusted comment; it's ignored by Binstall so we ## Just-in-time signing -To reduce the risk of a key being stolen, this scheme supports just-in-time signing. +To reduce the risk of a key being stolen, this scheme supports just-in-time or "keyless" signing. The idea is to generate a keypair when releasing, use it for signing the packages, save the key in the Cargo.toml before publishing to a registry, and then discard the private key when it's done. That way, there's no key to steal nor to store securely, and every release is signed by a different key. And because crates.io is immutable, it's impossible to overwrite the key. @@ -73,7 +73,7 @@ There is one caveat to keep in mind: with the scheme as described above, Binstal The solution here is either: - Commit the Cargo.toml with the ephemeral public key to the repo when publishing. -- Omit the `[...signing]` section in the source, and write the entire section on publish instead of just filling in the `pubkey`; signatures won't be checked for `--git` installs. +- Omit the `[...signing]` section in the source, and write the entire section on publish instead of just filling in the `pubkey`; signatures won't be checked for `--git` installs. Binstall uses this approach. - Instruct your users to use `--skip-signatures` if they want to install with `--git`. ## Why not X? (Sigstore, GPG, signify, with SSH keys, ...) @@ -84,10 +84,10 @@ We chose minisign as the first supported algorithm as it's lightweight, fairly p ## There's a competing project that does package signature verification differently! -[Tell use about it](https://github.com/cargo-bins/cargo-binstall/issues/1)! +[Tell us about it](https://github.com/cargo-bins/cargo-binstall/issues/1)! We're not looking to fracture the ecosystem here, and will gladly implement support if something exists already. -We'll also work with others in the space to eventually formalise this beyond Binstall, for example around the `cargo-dist.json` metadata format. +We'll also work with others in the space to eventually formalise this beyond Binstall, for example around the [`dist-manifest.json`](https://crates.io/crates/cargo-dist-schema) metadata format. ## What's the relationship to crate/registry signing? From 680accd0d388e86f17b70048f51e299c17c82ac7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 23 Sep 2023 20:35:49 +1200 Subject: [PATCH 1504/2020] Check quickinstall signatures (#1382) * Check quickinstall signatures * e2e test * We can no longer check presence of signing section early * Improve UI a little --- crates/binstalk-fetchers/src/gh_crate_meta.rs | 1 - crates/binstalk-fetchers/src/quickinstall.rs | 90 +++++++++++++++---- .../binstalk-types/src/cargo_toml_binstall.rs | 4 +- crates/binstalk/src/ops/resolve.rs | 8 +- e2e-tests/signing.sh | 2 + 5 files changed, 78 insertions(+), 27 deletions(-) diff --git a/crates/binstalk-fetchers/src/gh_crate_meta.rs b/crates/binstalk-fetchers/src/gh_crate_meta.rs index 43999819..68c66f00 100644 --- a/crates/binstalk-fetchers/src/gh_crate_meta.rs +++ b/crates/binstalk-fetchers/src/gh_crate_meta.rs @@ -253,7 +253,6 @@ impl super::Fetcher for GhCrateMeta { SignatureVerifier::Noop } (SignaturePolicy::Require, None) => { - debug_assert!(false, "missing signing section should be caught earlier"); return Err(FetchError::MissingSignature); } (_, Some(config)) => { diff --git a/crates/binstalk-fetchers/src/quickinstall.rs b/crates/binstalk-fetchers/src/quickinstall.rs index 09942cf3..aa9b402a 100644 --- a/crates/binstalk-fetchers/src/quickinstall.rs +++ b/crates/binstalk-fetchers/src/quickinstall.rs @@ -1,15 +1,21 @@ -use std::{path::Path, sync::Arc}; +use std::{borrow::Cow, path::Path, sync::Arc}; use binstalk_downloader::remote::Method; -use binstalk_types::cargo_toml_binstall::{PkgFmt, PkgMeta}; +use binstalk_types::cargo_toml_binstall::{PkgFmt, PkgMeta, PkgSigning}; use tokio::sync::OnceCell; +use tracing::{error, info, trace}; use url::Url; -use crate::{common::*, Data, FetchError, SignaturePolicy, TargetDataErased}; +use crate::{ + common::*, Data, FetchError, SignaturePolicy, SignatureVerifier, SigningAlgorithm, + TargetDataErased, +}; const BASE_URL: &str = "https://github.com/cargo-bins/cargo-quickinstall/releases/download"; const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; +const QUICKINSTALL_SIGN_KEY: Cow<'static, str> = + Cow::Borrowed("RWTdnnab2pAka9OdwgCMYyOE66M/BlQoFWaJ/JjwcPV+f3n24IRTj97t"); const QUICKINSTALL_SUPPORTED_TARGETS_URL: &str = "https://raw.githubusercontent.com/cargo-bins/cargo-quickinstall/main/supported-targets"; @@ -50,6 +56,7 @@ pub struct QuickInstall { package: String, package_url: Url, + signature_url: Url, stats_url: Url, signature_policy: SignaturePolicy, @@ -85,15 +92,17 @@ impl super::Fetcher for QuickInstall { let package = format!("{crate_name}-{version}-{target}"); + let url = format!("{BASE_URL}/{crate_name}-{version}/{package}.tar.gz"); + Arc::new(Self { client, gh_api_client, is_supported_v: OnceCell::new(), - package_url: Url::parse(&format!( - "{BASE_URL}/{crate_name}-{version}/{package}.tar.gz", - )) - .expect("package_url is pre-generated and should never be invalid url"), + package_url: Url::parse(&url) + .expect("package_url is pre-generated and should never be invalid url"), + signature_url: Url::parse(&format!("{url}.sig")) + .expect("signature_url is pre-generated and should never be invalid url"), stats_url: Url::parse(&format!("{STATS_URL}/{package}.tar.gz",)) .expect("stats_url is pre-generated and should never be invalid url"), package, @@ -105,15 +114,20 @@ impl super::Fetcher for QuickInstall { fn find(self: Arc) -> JoinHandle> { tokio::spawn(async move { - // until quickinstall supports signatures, blanket deny: - if self.signature_policy == SignaturePolicy::Require { - return Err(FetchError::MissingSignature); - } - if !self.is_supported().await? { return Ok(false); } + if self.signature_policy == SignaturePolicy::Require { + does_url_exist( + self.client.clone(), + self.gh_api_client.clone(), + &self.signature_url, + ) + .await + .map_err(|_| FetchError::MissingSignature)?; + } + does_url_exist( self.client.clone(), self.gh_api_client.clone(), @@ -146,11 +160,53 @@ by rust officially."#, } async fn fetch_and_extract(&self, dst: &Path) -> Result { - let url = &self.package_url; - debug!("Downloading package from: '{url}'"); - Ok(Download::new(self.client.clone(), url.clone()) - .and_extract(self.pkg_fmt(), dst) - .await?) + let verifier = if self.signature_policy == SignaturePolicy::Ignore { + SignatureVerifier::Noop + } else { + debug!(url=%self.signature_url, "Downloading signature"); + match Download::new(self.client.clone(), self.signature_url.clone()) + .into_bytes() + .await + { + Ok(signature) => { + trace!(?signature, "got signature contents"); + let config = PkgSigning { + algorithm: SigningAlgorithm::Minisign, + pubkey: QUICKINSTALL_SIGN_KEY, + file: None, + }; + SignatureVerifier::new(&config, &signature)? + } + Err(err) => { + if self.signature_policy == SignaturePolicy::Require { + error!("Failed to download signature: {err}"); + return Err(FetchError::MissingSignature); + } + + debug!("Failed to download signature, skipping verification: {err}"); + SignatureVerifier::Noop + } + } + }; + + debug!(url=%self.package_url, "Downloading package"); + let mut data_verifier = verifier.data_verifier()?; + let files = Download::new_with_data_verifier( + self.client.clone(), + self.package_url.clone(), + data_verifier.as_mut(), + ) + .and_extract(self.pkg_fmt(), dst) + .await?; + trace!("validating signature (if any)"); + if data_verifier.validate() { + if let Some(info) = verifier.info() { + info!("Verified signature for package '{}': {info}", self.package); + } + Ok(files) + } else { + Err(FetchError::InvalidSignature) + } } fn pkg_fmt(&self) -> PkgFmt { diff --git a/crates/binstalk-types/src/cargo_toml_binstall.rs b/crates/binstalk-types/src/cargo_toml_binstall.rs index 4a7a28f4..2c9af131 100644 --- a/crates/binstalk-types/src/cargo_toml_binstall.rs +++ b/crates/binstalk-types/src/cargo_toml_binstall.rs @@ -2,7 +2,7 @@ //! //! This manifest defines how a particular binary crate may be installed by Binstall. -use std::collections::BTreeMap; +use std::{borrow::Cow, collections::BTreeMap}; use serde::{Deserialize, Serialize}; @@ -127,7 +127,7 @@ pub struct PkgSigning { pub algorithm: SigningAlgorithm, /// Signing public key - pub pubkey: String, + pub pubkey: Cow<'static, str>, /// Signature file override template (url to download) #[serde(default)] diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index f2731867..f19c96c9 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -19,7 +19,7 @@ use tracing::{debug, error, info, instrument, warn}; use crate::{ bins, errors::{BinstallError, VersionParseError}, - fetchers::{Data, Fetcher, SignaturePolicy, TargetData}, + fetchers::{Data, Fetcher, TargetData}, helpers::{ self, cargo_toml::Manifest, cargo_toml_workspace::load_manifest_from_workspace, download::ExtractedFiles, remote::Client, target_triple::TargetTriple, @@ -83,10 +83,6 @@ async fn resolve_inner( return Ok(Resolution::AlreadyUpToDate); }; - if opts.signature_policy == SignaturePolicy::Require && !package_info.signing { - return Err(BinstallError::MissingSignature(package_info.name)); - } - let desired_targets = opts .desired_targets .get() @@ -337,7 +333,6 @@ struct PackageInfo { version: Version, repo: Option, overrides: BTreeMap, - signing: bool, } struct Bin { @@ -446,7 +441,6 @@ impl PackageInfo { } else { Ok(Some(Self { overrides: mem::take(&mut meta.overrides), - signing: meta.signing.is_some(), meta, binaries, name, diff --git a/e2e-tests/signing.sh b/e2e-tests/signing.sh index 66e8e237..08915c82 100755 --- a/e2e-tests/signing.sh +++ b/e2e-tests/signing.sh @@ -29,5 +29,7 @@ signing/wait-for-server.sh "./$1" binstall --force --manifest-path manifests/signing-Cargo.toml --no-confirm --only-signed signing-test "./$1" binstall --force --manifest-path manifests/signing-Cargo.toml --no-confirm --skip-signatures signing-test +# from quick-install +"./$1" binstall --force --strategies quick-install --no-confirm --only-signed --target x86_64-unknown-linux-musl zellij@0.38.2 kill $server_pid || true From 2db8e254bc690f9f3a6c616f2af544e45e904ba7 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Sat, 23 Sep 2023 06:45:44 -0400 Subject: [PATCH 1505/2020] Investigate incorrect target detection (#1376) * detect-targets: add debug tracing See #1375. * Add new feature `tracing` & `cli-tracing` to `detect-targets Signed-off-by: Jiahao XU * Fix clippy lints Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU Co-authored-by: Jiahao XU --- Cargo.lock | 2 ++ crates/bin/src/logging.rs | 1 + crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 6 +++++ crates/detect-targets/src/detect.rs | 14 ++++++++--- crates/detect-targets/src/detect/linux.rs | 30 +++++++++++++++++------ crates/detect-targets/src/main.rs | 6 +++++ 7 files changed, 49 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6fb46ca3..91b743ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -833,6 +833,8 @@ dependencies = [ "cfg-if", "guess_host_triple", "tokio", + "tracing", + "tracing-subscriber", "windows-dll", "windows-sys", ] diff --git a/crates/bin/src/logging.rs b/crates/bin/src/logging.rs index 267fb8d6..320f266a 100644 --- a/crates/bin/src/logging.rs +++ b/crates/bin/src/logging.rs @@ -202,6 +202,7 @@ pub fn logging(log_level: LevelFilter, json_output: bool) { "binstalk_registry", "cargo_binstall", "cargo_toml_workspace", + "detect_targets", "simple_git", ]); diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index affb6196..8f40bf4f 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -18,7 +18,7 @@ binstalk-types = { version = "0.5.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "1.0.0", path = "../cargo-toml-workspace" } command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } -detect-targets = { version = "0.1.11", path = "../detect-targets" } +detect-targets = { version = "0.1.11", path = "../detect-targets", features = ["tracing"] } either = "1.8.1" itertools = "0.11.0" jobslot = { version = "0.2.11", features = ["tokio"] } diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 9e3613ba..c3528b64 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -11,9 +11,15 @@ license = "Apache-2.0 OR MIT" [dependencies] tokio = { version = "1.28.2", features = ["rt", "process", "sync"], default-features = false } +tracing = { version = "0.1.37", optional = true } +tracing-subscriber = { version = "0.3.17", features = ["fmt"], default-features = false, optional = true } cfg-if = "1.0.0" guess_host_triple = "0.1.3" +[features] +tracing = ["dep:tracing"] +cli-logging = ["tracing", "dep:tracing-subscriber"] + [target.'cfg(target_os = "windows")'.dependencies] windows-sys = { version = "0.48.0", features = ["Win32_System_Threading", "Win32_System_SystemInformation", "Win32_Foundation"] } windows-dll = { version = "0.4.1", features = ["windows"], default-features = false } diff --git a/crates/detect-targets/src/detect.rs b/crates/detect-targets/src/detect.rs index d9fb9df6..15d8a125 100644 --- a/crates/detect-targets/src/detect.rs +++ b/crates/detect-targets/src/detect.rs @@ -7,6 +7,8 @@ use std::{ use cfg_if::cfg_if; use tokio::process::Command; +#[cfg(feature = "tracing")] +use tracing::debug; cfg_if! { if #[cfg(target_os = "linux")] { @@ -32,10 +34,14 @@ cfg_if! { /// Check [this issue](https://github.com/ryankurte/cargo-binstall/issues/155) /// for more information. pub async fn detect_targets() -> Vec { - let target = get_target_from_rustc().await.unwrap_or_else(|| { - guess_host_triple::guess_host_triple() - .unwrap_or(crate::TARGET) - .to_string() + let target = get_target_from_rustc().await; + #[cfg(feature = "tracing")] + debug!("get_target_from_rustc()={target:?}"); + let target = target.unwrap_or_else(|| { + let target = guess_host_triple::guess_host_triple(); + #[cfg(feature = "tracing")] + debug!("guess_host_triple::guess_host_triple()={target:?}"); + target.unwrap_or(crate::TARGET).to_string() }); cfg_if! { diff --git a/crates/detect-targets/src/detect/linux.rs b/crates/detect-targets/src/detect/linux.rs index a945c881..bba7fe60 100644 --- a/crates/detect-targets/src/detect/linux.rs +++ b/crates/detect-targets/src/detect/linux.rs @@ -4,6 +4,8 @@ use std::{ }; use tokio::{process::Command, task}; +#[cfg(feature = "tracing")] +use tracing::debug; pub(super) async fn detect_targets(target: String) -> Vec { let (prefix, postfix) = target @@ -79,12 +81,25 @@ async fn get_ld_flavor(cmd: &str) -> Option { status, stdout, stderr, - } = Command::new(cmd) + } = match Command::new(cmd) .arg("--version") .stdin(Stdio::null()) .output() .await - .ok()?; + { + Ok(output) => output, + Err(_err) => { + #[cfg(feature = "tracing")] + debug!("Running `{cmd} --version`: err={_err:?}"); + return None; + } + }; + + let stdout = String::from_utf8_lossy(&stdout); + let stderr = String::from_utf8_lossy(&stderr); + + #[cfg(feature = "tracing")] + debug!("`{cmd} --version`: status={status}, stdout='{stdout}', stderr='{stderr}'"); const ALPINE_GCOMPAT: &str = r#"This is the gcompat ELF interpreter stub. You are not meant to run this directly. @@ -93,16 +108,14 @@ You are not meant to run this directly. if status.success() { // Executing glibc ldd or /lib/ld-linux-{cpu_arch}.so.1 will always // succeeds. - String::from_utf8_lossy(&stdout) - .contains("GLIBC") - .then_some(Libc::Gnu) + stdout.contains("GLIBC").then_some(Libc::Gnu) } else if status.code() == Some(1) { // On Alpine, executing both the gcompat glibc and the ldd and // /lib/ld-musl-{cpu_arch}.so.1 will fail with exit status 1. - if str::from_utf8(&stdout).as_deref() == Ok(ALPINE_GCOMPAT) { + if stdout == ALPINE_GCOMPAT { // Alpine's gcompat package will output ALPINE_GCOMPAT to stdout Some(Libc::Gnu) - } else if String::from_utf8_lossy(&stderr).contains("musl libc") { + } else if stderr.contains("musl libc") { // Alpine/s ldd and musl dynlib will output to stderr Some(Libc::Musl) } else { @@ -120,6 +133,9 @@ You are not meant to run this directly. .await .ok()?; + #[cfg(feature = "tracing")] + debug!("`{cmd} --version`: status={status}"); + status.success().then_some(Libc::Gnu) } else { None diff --git a/crates/detect-targets/src/main.rs b/crates/detect-targets/src/main.rs index fbaa187f..2623c077 100644 --- a/crates/detect-targets/src/main.rs +++ b/crates/detect-targets/src/main.rs @@ -4,6 +4,12 @@ use detect_targets::detect_targets; use tokio::runtime; fn main() -> io::Result<()> { + #[cfg(feature = "cli-logging")] + tracing_subscriber::fmt::fmt() + .with_max_level(tracing::Level::TRACE) + .with_writer(std::io::stderr) + .init(); + let targets = runtime::Builder::new_current_thread() .enable_all() .build()? From 190ef7b8e70166c2a6f57ba23078496c14e2724b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 23 Sep 2023 23:13:23 +1000 Subject: [PATCH 1506/2020] Doc: Provide solutions for common problems encountered during signing (#1383) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Doc: Provide solutions for common problems encountered during signing Signed-off-by: Jiahao XU * Apply suggestions from code review Co-authored-by: Félix Saparelli --------- Signed-off-by: Jiahao XU Co-authored-by: Félix Saparelli --- SIGNING.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/SIGNING.md b/SIGNING.md index d18eff0f..e8cc2871 100644 --- a/SIGNING.md +++ b/SIGNING.md @@ -42,6 +42,41 @@ Upload both your package and the matching `.sig`. Now when binstall downloads your packages, it will also download the `.sig` file and use the `pubkey` in the Cargo.toml to verify the signature. If the signature has a trusted comment, it will print it at install time. +`minisign` and `rsign2` by default prompt for a password when generating a keypair and signing, which can hinder automation. + +You can: + - Pass `-W` to `minisign` or `rsign2` to generate a password-less private key. + NOTE that you also need to pass this when signing. + - When signing using `minisign`, it reads from stdin for password so you could use + shell redirect to pass the password. + - Use [`expect`] to pass password to `rsign2` (since it reads `/dev/tty` for password): + For generating private key: + ```bash + expect < Date: Mon, 25 Sep 2023 12:31:02 +1000 Subject: [PATCH 1507/2020] release: binstalk-types v0.6.0 (#1384) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 91b743ff..7dc1ab11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -380,7 +380,7 @@ dependencies = [ [[package]] name = "binstalk-types" -version = "0.5.0" +version = "0.6.0" dependencies = [ "compact_str", "maybe-owned", diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 6bf18e5e..54769270 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] atomic-file-install = { version = "1.0.0", path = "../atomic-file-install" } -binstalk-types = { version = "0.5.0", path = "../binstalk-types" } +binstalk-types = { version = "0.6.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } leon = { version = "2.0.1", path = "../leon" } miette = "5.9.0" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index b7bfb01f..831a7693 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" async-trait = "0.1.68" async-compression = { version = "0.4.3", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.15", features = ["deflate", "bzip2", "lzma", "zstd", "xz", "tokio"] } -binstalk-types = { version = "0.5.0", path = "../binstalk-types" } +binstalk-types = { version = "0.6.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" compact_str = "0.7.0" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index b6dfa4e7..f702bc5f 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" binstalk-downloader = { version = "0.8.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } -binstalk-types = { version = "0.5.0", path = "../binstalk-types" } +binstalk-types = { version = "0.6.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } either = "1.8.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 5ef4b4a6..808b3c8f 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] beef = { version = "0.5.2", features = ["impl_serde"] } -binstalk-types = { version = "0.5.0", path = "../binstalk-types" } +binstalk-types = { version = "0.6.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } fs-lock = { version = "0.1.0", path = "../fs-lock" } home = "0.5.5" diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index e8159230..f324fa05 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -14,7 +14,7 @@ license = "Apache-2.0 OR MIT" async-trait = "0.1.68" base16 = "0.2.1" binstalk-downloader = { version = "0.8.0", path = "../binstalk-downloader", default-features = false, features = ["json"] } -binstalk-types = { version = "0.5.0", path = "../binstalk-types" } +binstalk-types = { version = "0.6.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "1.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } leon = { version = "2.0.1", path = "../leon" } diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 29b061b2..ee1f4ad1 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-types" description = "The binstall toolkit that contains basic types for binstalk crates" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-types" -version = "0.5.0" +version = "0.6.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 8f40bf4f..06e2d777 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -14,7 +14,7 @@ binstalk-bins = { version = "0.1.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.8.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.1.1", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.1.1", path = "../binstalk-registry" } -binstalk-types = { version = "0.5.0", path = "../binstalk-types" } +binstalk-types = { version = "0.6.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "1.0.0", path = "../cargo-toml-workspace" } command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index b4afb44b..b8bf31d9 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Jiahao XU "] license = "Apache-2.0 OR MIT" [dependencies] -binstalk-types = { version = "0.5.0", path = "../binstalk-types" } +binstalk-types = { version = "0.6.0", path = "../binstalk-types" } cargo_toml = "0.16.0" compact_str = { version = "0.7.0", features = ["serde"] } glob = "0.3.1" From 4ec44749f1d7b1bba2b3e77ea6c3fc05b8355c7e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 05:32:33 +0000 Subject: [PATCH 1508/2020] release: binstalk-downloader v0.9.0 (#1387) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7dc1ab11..33685585 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -273,7 +273,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.8.0" +version = "0.9.0" dependencies = [ "async-compression 0.4.3", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 831a7693..5f7ec66e 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.8.0" +version = "0.9.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index f702bc5f..f340e387 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.8.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.9.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.6.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } @@ -30,7 +30,7 @@ tracing = "0.1.37" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.8.0", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.9.0", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index f324fa05..b0d57557 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.8.0", path = "../binstalk-downloader", default-features = false, features = ["json"] } +binstalk-downloader = { version = "0.9.0", path = "../binstalk-downloader", default-features = false, features = ["json"] } binstalk-types = { version = "0.6.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "1.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } @@ -35,7 +35,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.20.0", features = ["serde"] } -binstalk-downloader = { version = "0.8.0", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } +binstalk-downloader = { version = "0.9.0", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } [features] git = ["simple-git"] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 06e2d777..dae29e0d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.1.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.8.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.9.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.1.1", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.1.1", path = "../binstalk-registry" } binstalk-types = { version = "0.6.0", path = "../binstalk-types" } From 1fe4702bde1243d6ea32bbb7204bbc2c8003caff Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 25 Sep 2023 15:34:40 +1000 Subject: [PATCH 1509/2020] Refactor `cargo-toml-workspace`: Rm dep on `binstalk-types` (#1386) Signed-off-by: Jiahao XU --- Cargo.lock | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- crates/cargo-toml-workspace/src/lib.rs | 26 ++++++++++++++++---------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 33685585..3a40aa96 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -543,11 +543,11 @@ dependencies = [ name = "cargo-toml-workspace" version = "1.0.0" dependencies = [ - "binstalk-types", "cargo_toml", "compact_str", "glob", "normalize-path", + "serde", "tempfile", "thiserror", "tracing", diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index b8bf31d9..938b6744 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -10,11 +10,11 @@ authors = ["Jiahao XU "] license = "Apache-2.0 OR MIT" [dependencies] -binstalk-types = { version = "0.6.0", path = "../binstalk-types" } cargo_toml = "0.16.0" compact_str = { version = "0.7.0", features = ["serde"] } glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } +serde = "1.0.163" thiserror = "1.0.40" tracing = "0.1.37" diff --git a/crates/cargo-toml-workspace/src/lib.rs b/crates/cargo-toml-workspace/src/lib.rs index 61ed3f7e..87f6e58d 100644 --- a/crates/cargo-toml-workspace/src/lib.rs +++ b/crates/cargo-toml-workspace/src/lib.rs @@ -3,11 +3,11 @@ use std::{ path::{Path, PathBuf}, }; -use binstalk_types::cargo_toml_binstall::Meta; use cargo_toml::{Error as CargoTomlError, Manifest}; use compact_str::CompactString; use glob::PatternError; use normalize_path::NormalizePath; +use serde::de::DeserializeOwned; use thiserror::Error as ThisError; use tracing::{debug, instrument, warn}; @@ -19,11 +19,14 @@ pub use cargo_toml; /// /// * `workspace_path` - can be a directory (path to workspace) or /// a file (path to `Cargo.toml`). -pub fn load_manifest_from_workspace( +pub fn load_manifest_from_workspace( workspace_path: impl AsRef, crate_name: impl AsRef, -) -> Result, Error> { - fn inner(workspace_path: &Path, crate_name: &str) -> Result, Error> { +) -> Result, Error> { + fn inner( + workspace_path: &Path, + crate_name: &str, + ) -> Result, Error> { load_manifest_from_workspace_inner(workspace_path, crate_name).map_err(|inner| Error { workspace_path: workspace_path.into(), crate_name: crate_name.into(), @@ -62,10 +65,10 @@ enum ErrorInner { } #[instrument] -fn load_manifest_from_workspace_inner( +fn load_manifest_from_workspace_inner( workspace_path: &Path, crate_name: &str, -) -> Result, ErrorInner> { +) -> Result, ErrorInner> { debug!( "Loading manifest of crate {crate_name} from workspace: {}", workspace_path.display() @@ -80,7 +83,7 @@ fn load_manifest_from_workspace_inner( let mut manifest_paths = vec![manifest_path]; while let Some(manifest_path) = manifest_paths.pop() { - let manifest = Manifest::::from_path_with_metadata(&manifest_path)?; + let manifest = Manifest::::from_path_with_metadata(&manifest_path)?; let name = manifest.package.as_ref().map(|p| &*p.name); debug!( @@ -244,7 +247,8 @@ mod test { .unwrap() .join("e2e-tests/manifests/workspace"); - let manifest = load_manifest_from_workspace(&p, "cargo-binstall").unwrap(); + let manifest = + load_manifest_from_workspace::(&p, "cargo-binstall").unwrap(); let package = manifest.package.unwrap(); assert_eq!(package.name, "cargo-binstall"); assert_eq!(package.version.as_ref().unwrap(), "0.12.0"); @@ -252,10 +256,12 @@ mod test { assert_eq!(manifest.bin[0].name.as_deref().unwrap(), "cargo-binstall"); assert_eq!(manifest.bin[0].path.as_deref().unwrap(), "src/main.rs"); - let err = load_manifest_from_workspace_inner(&p, "cargo-binstall2").unwrap_err(); + let err = load_manifest_from_workspace_inner::(&p, "cargo-binstall2") + .unwrap_err(); assert!(matches!(err, ErrorInner::NotFound), "{:#?}", err); - let manifest = load_manifest_from_workspace(&p, "cargo-watch").unwrap(); + let manifest = + load_manifest_from_workspace::(&p, "cargo-watch").unwrap(); let package = manifest.package.unwrap(); assert_eq!(package.name, "cargo-watch"); assert_eq!(package.version.as_ref().unwrap(), "8.4.0"); From 1d8dfff3ba4bcfe891e68a7b02273238e3d792b2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 05:49:14 +0000 Subject: [PATCH 1510/2020] release: binstalk-manifests v0.10.0 (#1388) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3a40aa96..0d89748b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -332,7 +332,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.9.0" +version = "0.10.0" dependencies = [ "beef", "binstalk-types", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 1b0d62c9..7815a7aa 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.16.1", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.9.0" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.10.0" } clap = { version = "4.4.3", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 808b3c8f..64af4887 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.9.0" +version = "0.10.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From 3388ab98b983eb68bb04a4db6bf574d0d351c994 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 19:00:47 +1000 Subject: [PATCH 1511/2020] release: cargo-toml-workspace v2.0.0 (#1392) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0d89748b..9d6ee5a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -541,7 +541,7 @@ dependencies = [ [[package]] name = "cargo-toml-workspace" -version = "1.0.0" +version = "2.0.0" dependencies = [ "cargo_toml", "compact_str", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index b0d57557..4e6d816c 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -15,7 +15,7 @@ async-trait = "0.1.68" base16 = "0.2.1" binstalk-downloader = { version = "0.9.0", path = "../binstalk-downloader", default-features = false, features = ["json"] } binstalk-types = { version = "0.6.0", path = "../binstalk-types" } -cargo-toml-workspace = { version = "1.0.0", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "2.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } leon = { version = "2.0.1", path = "../leon" } miette = "5.9.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index dae29e0d..541faf93 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -15,7 +15,7 @@ binstalk-downloader = { version = "0.9.0", path = "../binstalk-downloader", defa binstalk-fetchers = { version = "0.1.1", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.1.1", path = "../binstalk-registry" } binstalk-types = { version = "0.6.0", path = "../binstalk-types" } -cargo-toml-workspace = { version = "1.0.0", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "2.0.0", path = "../cargo-toml-workspace" } command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.11", path = "../detect-targets", features = ["tracing"] } diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 938b6744..1f0a5d75 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-toml-workspace" -version = "1.0.0" +version = "2.0.0" edition = "2021" description = "Parse cargo workspace and load specific crate" repository = "https://github.com/cargo-bins/cargo-binstall" From ac357069a3303685debfa9a7890dc5aa03189936 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 19:00:55 +1000 Subject: [PATCH 1512/2020] release: binstalk-fetchers v0.2.0 (#1390) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9d6ee5a5..5971e530 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -309,7 +309,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.1.1" +version = "0.2.0" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index f340e387..518fd976 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.1.1" +version = "0.2.0" edition = "2021" description = "The binstall fetchers" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 541faf93..c398d2ba 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.1.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.9.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } -binstalk-fetchers = { version = "0.1.1", path = "../binstalk-fetchers", features = ["quickinstall"] } +binstalk-fetchers = { version = "0.2.0", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.1.1", path = "../binstalk-registry" } binstalk-types = { version = "0.6.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "2.0.0", path = "../cargo-toml-workspace" } From 029f767a2700e88a111d6b97057d77c8f941c99b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 09:01:12 +0000 Subject: [PATCH 1513/2020] release: binstalk-bins v0.2.0 (#1389) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5971e530..84f77f23 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -259,7 +259,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.1.0" +version = "0.2.0" dependencies = [ "atomic-file-install", "binstalk-types", diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 54769270..95cd8e03 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.1.0" +version = "0.2.0" edition = "2021" description = "The binstall binaries discovery and installation crate." diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index c398d2ba..72f0a20d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.1.0", path = "../binstalk-bins" } +binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.9.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.2.0", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.1.1", path = "../binstalk-registry" } From c8099a9d8869224c330d8008e4ff4c0e86c100ef Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 10:48:42 +0000 Subject: [PATCH 1514/2020] release: binstalk-registry v0.2.0 (#1393) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 84f77f23..b1865dae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -353,7 +353,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.1.1" +version = "0.2.0" dependencies = [ "async-trait", "base16", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 4e6d816c..584fae78 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.1.1" +version = "0.2.0" edition = "2021" rust-version = "1.65.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 72f0a20d..e28b0055 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.9.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.2.0", path = "../binstalk-fetchers", features = ["quickinstall"] } -binstalk-registry = { version = "0.1.1", path = "../binstalk-registry" } +binstalk-registry = { version = "0.2.0", path = "../binstalk-registry" } binstalk-types = { version = "0.6.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "2.0.0", path = "../cargo-toml-workspace" } command-group = { version = "2.1.0", features = ["with-tokio"] } From f87e0d0b462d81b552896f9051768731b7ba36af Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:19:56 +0000 Subject: [PATCH 1515/2020] dep: Upgrade transitive dependencies (#1394) Co-authored-by: github-actions --- Cargo.lock | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b1865dae..2dd4d88b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1836,9 +1836,9 @@ checksum = "96b6d623a1152c3facb79067d6e2ecdae48130030cf27d6eb21109f13bd7b836" [[package]] name = "gix-transport" -version = "0.36.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8d976844844f8b42e70a2c2e60d68407f7055ff7e37553d1e7f2718acc3547" +checksum = "95892eedefd65a6b4312aa5e166d2f740558adfb6854a2b7de73e82e54ef064c" dependencies = [ "base64 0.21.4", "bstr", @@ -3301,9 +3301,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" +checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" dependencies = [ "serde", ] @@ -3658,9 +3658,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6bb557fd245c28e6411aa56b6403c689ad95061f50e4be16c274e70a17e48" +checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" dependencies = [ "deranged", "itoa", @@ -3673,15 +3673,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a942f44339478ef67935ab2bbaec2fb0322496cf3cbe84b261e06ac3814c572" +checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" dependencies = [ "time-core", ] From df74a0d4f678921275319508bb1103848a8e4555 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:38:37 +0000 Subject: [PATCH 1516/2020] release: detect-targets v0.1.12 (#1395) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2dd4d88b..a7c89ac8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -828,7 +828,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.11" +version = "0.1.12" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 64af4887..bb27d480 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -25,5 +25,5 @@ toml_edit = { version = "0.20.0", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.11", path = "../detect-targets" } +detect-targets = { version = "0.1.12", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index e28b0055..3f50c805 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -18,7 +18,7 @@ binstalk-types = { version = "0.6.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "2.0.0", path = "../cargo-toml-workspace" } command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } -detect-targets = { version = "0.1.11", path = "../detect-targets", features = ["tracing"] } +detect-targets = { version = "0.1.12", path = "../detect-targets", features = ["tracing"] } either = "1.8.1" itertools = "0.11.0" jobslot = { version = "0.2.11", features = ["tokio"] } diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index c3528b64..ecd4d4c0 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.11" +version = "0.1.12" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From bf30d73f5344851438aca7885957158d5997c7f5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 25 Sep 2023 12:29:23 +0000 Subject: [PATCH 1517/2020] release: binstalk v0.17.0 (#1396) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a7c89ac8..198d7f54 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -229,7 +229,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.16.1" +version = "0.17.0" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 7815a7aa..c339cddd 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.16.1", default-features = false } +binstalk = { path = "../binstalk", version = "0.17.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.10.0" } clap = { version = "4.4.3", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 3f50c805..d6ea0b0d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.16.1" +version = "0.17.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From 99e825601808dedbbfd4c2c17360f43ae5e5688c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 26 Sep 2023 13:42:59 +1000 Subject: [PATCH 1518/2020] release: cargo-binstall v1.4.0 (#1397) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 198d7f54..34c625dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -512,7 +512,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.3.1" +version = "1.4.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index c339cddd..0f7ed0af 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.3.1" +version = "1.4.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index afd1f81e..c2146eba 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 49b37ff1e2706f3f979f4dcebbdee7722f0e7d68 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Tue, 26 Sep 2023 19:47:25 +1300 Subject: [PATCH 1519/2020] Revert "release: cargo-binstall v1.4.0" and fix (#1398) * Revert "release: cargo-binstall v1.4.0 (#1397)" This reverts commit 99e825601808dedbbfd4c2c17360f43ae5e5688c. * --allow-dirty on publish * Remove private key file after generation * Write public key file to bin crate and to package * Upload public key file to release --- .github/scripts/ephemeral-gen.sh | 6 ++++++ .github/workflows/release-build.yml | 23 +++++++++++++++++++++++ .github/workflows/release.yml | 12 +++++++++++- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- justfile | 1 + 7 files changed, 44 insertions(+), 4 deletions(-) diff --git a/.github/scripts/ephemeral-gen.sh b/.github/scripts/ephemeral-gen.sh index 065b4673..806cf02c 100755 --- a/.github/scripts/ephemeral-gen.sh +++ b/.github/scripts/ephemeral-gen.sh @@ -11,6 +11,12 @@ algorithm = "minisign" pubkey = "$(tail -n1 minisign.pub)" EOF +echo "public=$(tail -n1 minisign.pub)" >> "$GITHUB_OUTPUT" +cp minisign.pub crates/bin/minisign.pub + set +x echo "::add-mask::$(tail -n1 minisign.key)" echo "private=$(tail -n1 minisign.key)" >> "$GITHUB_OUTPUT" +set -x + +rm minisign.key diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-build.yml index 0b2c20a1..ae7f5f4d 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-build.yml @@ -8,6 +8,10 @@ on: description: "Set to the release metadata JSON to publish the release" required: false type: string + publickey: + description: "Minisign public key. Required when publishing" + required: false + type: string CARGO_PROFILE_RELEASE_LTO: description: "Set to override default release profile lto settings" required: false @@ -65,6 +69,15 @@ jobs: if: inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS run: echo "CARGO_PROFILE_RELEASE_CODEGEN_UNITS=${{ inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS }}" >> "$GITHUB_ENV" + - name: Include public key in package + if: inputs.publickey + env: + PUBLIC_KEY: ${{ inputs.publickey }} + shell: bash + run: | + echo "untrusted comment: minisign public key" > minisign.pub + cat >> minisign.pub <<< "$PUBLIC_KEY" + - uses: ./.github/actions/just-setup with: tools: cargo-auditable @@ -94,6 +107,7 @@ jobs: - if: inputs.publish env: SIGNING_KEY: ${{ secrets.signingkey }} + shell: bash run: .github/scripts/ephemeral-sign.sh packages/cargo-binstall-* - if: inputs.publish @@ -131,6 +145,15 @@ jobs: steps: - uses: actions/checkout@v4 + - name: Include public key in package + if: inputs.publickey + env: + PUBLIC_KEY: ${{ inputs.publickey }} + shell: bash + run: | + echo "untrusted comment: minisign public key" > minisign.pub + cat >> minisign.pub <<< "$PUBLIC_KEY" + - uses: taiki-e/install-action@v2 with: tool: just diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4e694e7d..7b189b2d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -61,8 +61,17 @@ jobs: env: crate: ${{ needs.info.outputs.crate }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - run: cargo publish -p "$crate" + run: cargo publish -p "$crate" --allow-dirty + - name: Upload public key to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + release_name: v${{ needs.info.outputs.version }} + tag: v${{ needs.info.outputs.version }} + body: ${{ needs.info.outputs.notes }} + file: minisign.pub outputs: + publickey: ${{ steps.keypair.outputs.public }} signingkey: ${{ steps.keypair.outputs.private }} package: @@ -73,5 +82,6 @@ jobs: uses: ./.github/workflows/release-build.yml with: publish: ${{ toJSON(needs.info.outputs) }} + publickey: ${{ needs.clitag.publickey }} secrets: signingkey: ${{ needs.clitag.signingkey }} diff --git a/Cargo.lock b/Cargo.lock index 34c625dc..198d7f54 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -512,7 +512,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.4.0" +version = "1.3.1" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 0f7ed0af..c339cddd 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.4.0" +version = "1.3.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index c2146eba..afd1f81e 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ diff --git a/justfile b/justfile index 4c654d72..dada41ef 100644 --- a/justfile +++ b/justfile @@ -289,6 +289,7 @@ package-dir: mkdir -p packages/prep cp crates/bin/LICENSE packages/prep cp README.md packages/prep + -cp minisign.pub packages/prep [macos] package-prepare: build package-dir From 3f29e13e4218b3cc97e7d4d2d41d306725ee7843 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 26 Sep 2023 07:46:42 +0000 Subject: [PATCH 1520/2020] release: cargo-binstall v1.4.0 (#1399) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 198d7f54..34c625dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -512,7 +512,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.3.1" +version = "1.4.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index c339cddd..0f7ed0af 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.3.1" +version = "1.4.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index afd1f81e..c2146eba 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 5d4333d5c8eb39abb27ce8400e5803eafe73dd0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Wed, 27 Sep 2023 00:17:17 +1300 Subject: [PATCH 1521/2020] Fix release build again (#1400) * Fix build again * Recommend (r)age over minisign password * Dry-run the entire release process * Reorg a bit so dry-run works * Fix secret name * Add check on age key * Pass secrets down * Use a cross-platform "date" * Delete signing key artifact to be extra safe * Last little bits --- .github/scripts/ephemeral-crate.sh | 12 ++ .github/scripts/ephemeral-gen.sh | 13 +-- .github/scripts/ephemeral-sign.sh | 10 +- .github/workflows/ci.yml | 14 ++- .github/workflows/release-cli.yml | 108 ++++++++++++++++++ ...release-build.yml => release-packages.yml} | 78 +++++-------- .github/workflows/release.yml | 50 ++------ SIGNING.md | 44 +++---- 8 files changed, 189 insertions(+), 140 deletions(-) create mode 100755 .github/scripts/ephemeral-crate.sh create mode 100644 .github/workflows/release-cli.yml rename .github/workflows/{release-build.yml => release-packages.yml} (76%) diff --git a/.github/scripts/ephemeral-crate.sh b/.github/scripts/ephemeral-crate.sh new file mode 100755 index 00000000..3636ca71 --- /dev/null +++ b/.github/scripts/ephemeral-crate.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -euxo pipefail + +cat >> crates/bin/Cargo.toml <> crates/bin/Cargo.toml <> "$GITHUB_OUTPUT" -cp minisign.pub crates/bin/minisign.pub - set +x echo "::add-mask::$(tail -n1 minisign.key)" -echo "private=$(tail -n1 minisign.key)" >> "$GITHUB_OUTPUT" set -x +rage --encrypt --recipient "$AGE_KEY_PUBLIC" --output minisign.key.age minisign.key rm minisign.key diff --git a/.github/scripts/ephemeral-sign.sh b/.github/scripts/ephemeral-sign.sh index a657c915..ef458e58 100755 --- a/.github/scripts/ephemeral-sign.sh +++ b/.github/scripts/ephemeral-sign.sh @@ -2,14 +2,15 @@ set -euo pipefail -echo "untrusted comment: rsign encrypted secret key" > minisign.key -cat >> minisign.key <<< "$SIGNING_KEY" +[[ -z "$AGE_KEY_SECRET" ]] && { echo "!!! Empty age key secret !!!"; exit 1; } +cat >> age.key <<< "$AGE_KEY_SECRET" set -x -cargo binstall -y rsign2 +cargo binstall -y rsign2 rage +rage --decrypt --identity age.key --output minisign.key minisign.key.age -ts=$(date --utc --iso-8601=seconds) +ts=$(node -e 'console.log((new Date).toISOString())') git=$(git rev-parse HEAD) comment="gh=$GITHUB_REPOSITORY git=$git ts=$ts run=$GITHUB_RUN_ID" @@ -17,3 +18,4 @@ for file in "$@"; do rsign sign -W -s minisign.key -x "$file.sig" -t "$comment" "$file" done +rm age.key minisign.key diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c10c8f3..dd31ba61 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -125,9 +125,17 @@ jobs: - run: just avoid-dev-deps - run: just lint - release-builds: - uses: ./.github/workflows/release-build.yml + release-dry-run: + uses: ./.github/workflows/release-cli.yml + secrets: inherit with: + info: | + { + "is-release": false, + "crate": "cargo-binstall", + "version": "0.0.0", + "notes": "" + } CARGO_PROFILE_RELEASE_LTO: no CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 4 @@ -179,7 +187,7 @@ jobs: - test - cross-check - lint - - release-builds + - release-dry-run - detect-targets-alpine-test - detect-targets-ubuntu-test if: always() # always run even if dependencies fail diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml new file mode 100644 index 00000000..bec98814 --- /dev/null +++ b/.github/workflows/release-cli.yml @@ -0,0 +1,108 @@ +name: Release CLI +on: + workflow_call: + inputs: + info: + description: "The release metadata JSON" + required: true + type: string + CARGO_PROFILE_RELEASE_LTO: + description: "Used to speed up CI" + required: false + type: string + CARGO_PROFILE_RELEASE_CODEGEN_UNITS: + description: "Used to speed up CI" + required: false + type: string + +jobs: + tag: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - if: fromJSON(inputs.info).is-release == 'true' + name: Push cli release tag + uses: mathieudutour/github-tag-action@v6.1 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + custom_tag: ${{ fromJSON(inputs.info).version }} + tag_prefix: v + + keygen: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: cargo-bins/cargo-binstall@main + - name: Create ephemeral keypair + id: keypair + env: + AGE_KEY_PUBLIC: ${{ vars.AGE_KEY_PUBLIC }} + run: .github/scripts/ephemeral-gen.sh + - uses: actions/upload-artifact@v3 + with: + name: minisign.pub + path: minisign.pub + - uses: actions/upload-artifact@v3 + with: + name: minisign.key.age + path: minisign.key.age + retention-days: 1 + - name: Check that key can be decrypted + env: + AGE_KEY_SECRET: ${{ secrets.AGE_KEY_SECRET }} + shell: bash + run: .github/scripts/ephemeral-sign.sh minisign.pub + + package: + needs: + - tag + - keygen + uses: ./.github/workflows/release-packages.yml + secrets: inherit + with: + publish: ${{ inputs.info }} + CARGO_PROFILE_RELEASE_LTO: ${{ inputs.CARGO_PROFILE_RELEASE_LTO }} + CARGO_PROFILE_RELEASE_CODEGEN_UNITS: ${{ inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS }} + + publish: + needs: package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v3 + with: + name: minisign.pub + - run: .github/scripts/ephemeral-crate.sh + + - if: fromJSON(inputs.info).is-release != 'true' + name: DRY-RUN Publish to crates.io + env: + crate: ${{ fromJSON(inputs.info).crate }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + run: cargo publish -p "$crate" --allow-dirty --dry-run + + - if: fromJSON(inputs.info).is-release == 'true' + name: Publish to crates.io + env: + crate: ${{ fromJSON(inputs.info).crate }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} + run: cargo publish -p "$crate" --allow-dirty + + - if: fromJSON(inputs.info).is-release == 'true' + name: Make release latest + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + release_name: v${{ fromJSON(inputs.info).version }} + tag: v${{ fromJSON(inputs.info).version }} + body: ${{ fromJSON(inputs.info).notes }} + promote: true + file: minisign.pub + + - if: fromJSON(inputs.info).is-release == 'true' + name: Delete signing key artifact + uses: geekyeggo/delete-artifact@v2 + with: + name: minisign.key.age + failOnError: false + diff --git a/.github/workflows/release-build.yml b/.github/workflows/release-packages.yml similarity index 76% rename from .github/workflows/release-build.yml rename to .github/workflows/release-packages.yml index ae7f5f4d..ab6839c6 100644 --- a/.github/workflows/release-build.yml +++ b/.github/workflows/release-packages.yml @@ -1,29 +1,20 @@ -name: Build for release +name: Build packages for release on: - workflow_dispatch: # can't publish from dispatch workflow_call: inputs: publish: - description: "Set to the release metadata JSON to publish the release" - required: false - type: string - publickey: - description: "Minisign public key. Required when publishing" - required: false + description: "The release metadata JSON" + required: true type: string CARGO_PROFILE_RELEASE_LTO: - description: "Set to override default release profile lto settings" + description: "Used to speed up CI" required: false type: string CARGO_PROFILE_RELEASE_CODEGEN_UNITS: - description: "Set to override default release profile codegen-units settings" + description: "Used to speed up CI" required: false type: string - secrets: - signingkey: - description: "Minisign private key. Required when publishing" - required: false env: CARGO_TERM_COLOR: always @@ -69,15 +60,7 @@ jobs: if: inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS run: echo "CARGO_PROFILE_RELEASE_CODEGEN_UNITS=${{ inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS }}" >> "$GITHUB_ENV" - - name: Include public key in package - if: inputs.publickey - env: - PUBLIC_KEY: ${{ inputs.publickey }} - shell: bash - run: | - echo "untrusted comment: minisign public key" > minisign.pub - cat >> minisign.pub <<< "$PUBLIC_KEY" - + - uses: cargo-bins/cargo-binstall@main - uses: ./.github/actions/just-setup with: tools: cargo-auditable @@ -89,6 +72,9 @@ jobs: - run: just toolchain rust-src - run: just ci-install-deps + - uses: actions/download-artifact@v3 + with: + name: minisign.pub - run: just package - if: runner.os == 'Windows' run: Get-ChildItem packages/ @@ -101,16 +87,16 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - if: inputs.publish - uses: cargo-bins/cargo-binstall@main - - - if: inputs.publish + - uses: actions/download-artifact@v3 + with: + name: minisign.key.age + - name: Sign package env: - SIGNING_KEY: ${{ secrets.signingkey }} + AGE_KEY_SECRET: ${{ secrets.AGE_KEY_SECRET }} shell: bash run: .github/scripts/ephemeral-sign.sh packages/cargo-binstall-* - - if: inputs.publish + - if: fromJSON(inputs.publish).is-release == 'true' name: Upload to release uses: svenstaro/upload-release-action@v2 with: @@ -120,7 +106,8 @@ jobs: body: ${{ fromJSON(inputs.publish).notes }} file: packages/cargo-binstall-* file_glob: true - - if: "! inputs.publish || runner.os == 'macOS'" + prerelease: true + - if: "fromJSON(inputs.publish).is-release != 'true' || runner.os == 'macOS'" name: Upload artifact uses: actions/upload-artifact@v3 with: @@ -144,16 +131,7 @@ jobs: steps: - uses: actions/checkout@v4 - - - name: Include public key in package - if: inputs.publickey - env: - PUBLIC_KEY: ${{ inputs.publickey }} - shell: bash - run: | - echo "untrusted comment: minisign public key" > minisign.pub - cat >> minisign.pub <<< "$PUBLIC_KEY" - + - uses: cargo-bins/cargo-binstall@main - uses: taiki-e/install-action@v2 with: tool: just @@ -171,19 +149,22 @@ jobs: name: aarch64-apple-darwin path: packages/ + - uses: actions/download-artifact@v3 + with: + name: minisign.pub - run: ls -shalr packages/ - run: just repackage-lipo - run: ls -shal packages/ - - if: inputs.publish - uses: cargo-bins/cargo-binstall@main - - - if: inputs.publish - env: - SIGNING_KEY: ${{ secrets.signingkey }} + - uses: actions/download-artifact@v3 + with: + name: minisign.key.age + - env: + AGE_KEY_SECRET: ${{ secrets.AGE_KEY_SECRET }} + shell: bash run: .github/scripts/ephemeral-sign.sh packages/cargo-binstall-universal-* - - if: inputs.publish + - if: fromJSON(inputs.publish).is-release == 'true' name: Upload to release uses: svenstaro/upload-release-action@v2 with: @@ -194,7 +175,8 @@ jobs: file: packages/cargo-binstall-universal-* file_glob: true overwrite: true - - if: "! inputs.publish" + prerelease: true + - if: fromJSON(inputs.publish).is-release != 'true' name: Upload artifact uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7b189b2d..88f6d0a7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,7 +22,7 @@ jobs: event-data: ${{ toJSON(github.event) }} extract-notes-under: '### Release notes' - libtag: + release-lib: if: needs.info.outputs.is-release == 'true' && needs.info.outputs.crate != 'cargo-binstall' needs: info runs-on: ubuntu-latest @@ -41,47 +41,11 @@ jobs: env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - clitag: - if: needs.info.outputs.is-release == 'true' && needs.info.outputs.crate == 'cargo-binstall' + release-cli: + if: needs.info.outputs.crate == 'cargo-binstall' needs: info - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Push cli release tag - uses: mathieudutour/github-tag-action@v6.1 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - custom_tag: ${{ needs.info.outputs.version }} - tag_prefix: v - - uses: cargo-bins/cargo-binstall@main - - name: Create ephemeral keypair - id: keypair - run: .github/scripts/ephemeral-gen.sh - - name: Publish to crates.io - env: - crate: ${{ needs.info.outputs.crate }} - CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - run: cargo publish -p "$crate" --allow-dirty - - name: Upload public key to release - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - release_name: v${{ needs.info.outputs.version }} - tag: v${{ needs.info.outputs.version }} - body: ${{ needs.info.outputs.notes }} - file: minisign.pub - outputs: - publickey: ${{ steps.keypair.outputs.public }} - signingkey: ${{ steps.keypair.outputs.private }} - - package: - if: needs.info.outputs.is-release == 'true' && needs.info.outputs.crate == 'cargo-binstall' - needs: - - info - - clitag - uses: ./.github/workflows/release-build.yml + uses: ./.github/workflows/release-cli.yml + secrets: inherit with: - publish: ${{ toJSON(needs.info.outputs) }} - publickey: ${{ needs.clitag.publickey }} - secrets: - signingkey: ${{ needs.clitag.signingkey }} + info: ${{ toJSON(needs.info.outputs) }} + diff --git a/SIGNING.md b/SIGNING.md index e8cc2871..29803ce4 100644 --- a/SIGNING.md +++ b/SIGNING.md @@ -10,10 +10,10 @@ This feature requires adding to the Cargo.toml metadata: no autodiscovery here! Generate a [minisign](https://jedisct1.github.io/minisign/) keypair: ```console -minisign -G -p signing.pub -s signing.key +minisign -G -W -p signing.pub -s signing.key # or with rsign2: -rsign generate -p signing.pub -s signing.key +rsign generate -W -p signing.pub -s signing.key ``` In your Cargo.toml, put: @@ -31,10 +31,10 @@ Save the `signing.key` as a secret in your CI, then use it when building package ```console tar cvf package-name.tar.zst your-files # or however -minisign -S -s signing.key -x package-name.tar.zst.sig -m package-name.tar.zst +minisign -S -W -s signing.key -x package-name.tar.zst.sig -m package-name.tar.zst # or with rsign2: -rsign sign -s signing.key -x package-name.tar.zst.sig package-name.tar.zst +rsign sign -W -s signing.key -x package-name.tar.zst.sig package-name.tar.zst ``` Upload both your package and the matching `.sig`. @@ -42,34 +42,16 @@ Upload both your package and the matching `.sig`. Now when binstall downloads your packages, it will also download the `.sig` file and use the `pubkey` in the Cargo.toml to verify the signature. If the signature has a trusted comment, it will print it at install time. -`minisign` and `rsign2` by default prompt for a password when generating a keypair and signing, which can hinder automation. +By default, `minisign` and `rsign2` prompt for a password; above we disable this with `-W`. +While you _can_ set a password, we recommend instead using [age](https://github.com/FiloSottile/age) (or the Rust version [rage](https://github.com/str4d/rage)) to separately encrypt the key, which we find is much better for automation. -You can: - - Pass `-W` to `minisign` or `rsign2` to generate a password-less private key. - NOTE that you also need to pass this when signing. - - When signing using `minisign`, it reads from stdin for password so you could use - shell redirect to pass the password. - - Use [`expect`] to pass password to `rsign2` (since it reads `/dev/tty` for password): - For generating private key: - ```bash - expect < Date: Tue, 26 Sep 2023 13:31:47 +0000 Subject: [PATCH 1522/2020] release: cargo-binstall v1.4.1 (#1403) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 34c625dc..ee64dd17 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -512,7 +512,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.4.0" +version = "1.4.1" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 0f7ed0af..3339b959 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.4.0" +version = "1.4.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index c2146eba..4fab5a9a 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 499e6b07fac7e151e579786ef54898625b7913e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Wed, 27 Sep 2023 02:30:47 +1300 Subject: [PATCH 1523/2020] Upload packaged crate (#1401) Upload packaged crate when not releasing --- .github/workflows/release-cli.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index bec98814..262991d6 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -79,7 +79,16 @@ jobs: env: crate: ${{ fromJSON(inputs.info).crate }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - run: cargo publish -p "$crate" --allow-dirty --dry-run + run: | + set -ex + cargo publish -p "$crate" --allow-dirty --dry-run + cargo package --no-verify -p "$crate" --allow-dirty + - if: fromJSON(inputs.info).is-release != 'true' + name: Upload crate package as artifact + uses: actions/upload-artifact@v3 + with: + name: crate-package + path: target/package/*.crate - if: fromJSON(inputs.info).is-release == 'true' name: Publish to crates.io From 216d548fd42ac23987ad7ce0f3deec4dc10e5d83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Wed, 27 Sep 2023 10:57:51 +1300 Subject: [PATCH 1524/2020] Use explicit write permissions (#1404) * Use explicit write permissions * Revert "release: cargo-binstall v1.4.1 (#1403)" This reverts commit 00941d8b439a993cc9f87d57e454381781d38449. --- .github/workflows/release-cli.yml | 4 ++++ .github/workflows/release-packages.yml | 4 ++++ .github/workflows/release.yml | 2 ++ Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 6 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 262991d6..bf4bb152 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -17,6 +17,8 @@ on: jobs: tag: + permissions: + contents: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -66,6 +68,8 @@ jobs: publish: needs: package + permissions: + contents: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index ab6839c6..b8085961 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -41,6 +41,8 @@ jobs: name: ${{ matrix.t }} runs-on: ${{ matrix.o }} + permissions: + contents: write env: CARGO_BUILD_TARGET: ${{ matrix.t }} GLIBC_VERSION: ${{ matrix.g }} @@ -125,6 +127,8 @@ jobs: lipo: needs: build name: universal-apple-darwin + permissions: + contents: write runs-on: macos-latest env: JUST_FOR_RELEASE: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 88f6d0a7..c3d85d87 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -25,6 +25,8 @@ jobs: release-lib: if: needs.info.outputs.is-release == 'true' && needs.info.outputs.crate != 'cargo-binstall' needs: info + permissions: + contents: write runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 diff --git a/Cargo.lock b/Cargo.lock index ee64dd17..34c625dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -512,7 +512,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.4.1" +version = "1.4.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 3339b959..0f7ed0af 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.4.1" +version = "1.4.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 4fab5a9a..c2146eba 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From e41db2a297aa5408b1d70f85afeb35840695c6cd Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 27 Sep 2023 09:42:26 +1000 Subject: [PATCH 1525/2020] release: cargo-binstall v1.4.1 (#1406) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 34c625dc..ee64dd17 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -512,7 +512,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.4.0" +version = "1.4.1" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 0f7ed0af..3339b959 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.4.0" +version = "1.4.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index c2146eba..4fab5a9a 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From b73c2532752b7b9708b03290a33f7ba278586f9a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 27 Sep 2023 22:02:42 +1000 Subject: [PATCH 1526/2020] Fix `GhApiClient`: Accept any `auth_token` given (#1415) Fixed #1414 There are many different kinds of gh tokens and they can change the format at anytime, so we can't check it based on its formats. Signed-off-by: Jiahao XU --- .../binstalk-downloader/src/gh_api_client.rs | 26 ------------------- 1 file changed, 26 deletions(-) diff --git a/crates/binstalk-downloader/src/gh_api_client.rs b/crates/binstalk-downloader/src/gh_api_client.rs index 9c8f3f52..92dac5f8 100644 --- a/crates/binstalk-downloader/src/gh_api_client.rs +++ b/crates/binstalk-downloader/src/gh_api_client.rs @@ -13,7 +13,6 @@ use percent_encoding::{ percent_decode_str, utf8_percent_encode, AsciiSet, PercentEncode, CONTROLS, }; use tokio::sync::OnceCell; -use tracing::{debug, warn}; use crate::remote; @@ -132,33 +131,8 @@ struct Inner { #[derive(Clone, Debug)] pub struct GhApiClient(Arc); -fn is_ascii_alphanumeric(s: &[u8]) -> bool { - s.iter().all(|byte| byte.is_ascii_alphanumeric()) -} - -fn is_valid_gh_token(token: &str) -> bool { - let token = token.as_bytes(); - - token.len() >= 40 - && ((&token[0..2] == b"gh" - && token[2].is_ascii_alphanumeric() - && token[3] == b'_' - && is_ascii_alphanumeric(&token[4..])) - || (token.starts_with(b"github_") && is_ascii_alphanumeric(&token[7..]))) -} - impl GhApiClient { pub fn new(client: remote::Client, auth_token: Option) -> Self { - let auth_token = auth_token.and_then(|auth_token| { - if is_valid_gh_token(&auth_token) { - debug!("Using gh api token"); - Some(auth_token) - } else { - warn!("Invalid auth_token, expected 'gh*_' or `github_*` with [A-Za-z0-9], fallback to unauthorized mode"); - None - } - }); - Self(Arc::new(Inner { client, release_artifacts: Default::default(), From 434414856693b32990a99f9664342b7b050cd248 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 27 Sep 2023 22:31:01 +0000 Subject: [PATCH 1527/2020] release: binstalk-downloader v0.9.1 (#1416) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ee64dd17..15e43690 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -273,7 +273,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.9.0" +version = "0.9.1" dependencies = [ "async-compression 0.4.3", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 5f7ec66e..0f91526d 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.9.0" +version = "0.9.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 518fd976..cf4c1851 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.9.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.9.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.6.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } @@ -30,7 +30,7 @@ tracing = "0.1.37" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.9.0", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.9.1", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 584fae78..3c170392 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.9.0", path = "../binstalk-downloader", default-features = false, features = ["json"] } +binstalk-downloader = { version = "0.9.1", path = "../binstalk-downloader", default-features = false, features = ["json"] } binstalk-types = { version = "0.6.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "2.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } @@ -35,7 +35,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.20.0", features = ["serde"] } -binstalk-downloader = { version = "0.9.0", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } +binstalk-downloader = { version = "0.9.1", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } [features] git = ["simple-git"] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index d6ea0b0d..631e14a3 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.9.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.9.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.2.0", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.2.0", path = "../binstalk-registry" } binstalk-types = { version = "0.6.0", path = "../binstalk-types" } From 6ce60225d4694ceb62df3fc899937391171471aa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 28 Sep 2023 02:59:25 +0000 Subject: [PATCH 1528/2020] release: cargo-binstall v1.4.2 (#1418) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 15e43690..17b4f25a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -512,7 +512,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.4.1" +version = "1.4.2" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 3339b959..0219a672 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.4.1" +version = "1.4.2" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 4fab5a9a..be22265d 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 3d68641a6d087484ea42d9a97e9e99f61ca49d43 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 29 Sep 2023 12:49:43 +1000 Subject: [PATCH 1529/2020] Fix `release-packages` and `release-cli` workflow (#1422) * Fix `release-packages` and `release-cli` workflow Fixed #1419 Signed-off-by: Jiahao XU * Use `taiki-e/install-action` for `rsign2` & `rage` in `release-packages.yml` Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .github/scripts/ephemeral-gen.sh | 1 - .github/scripts/ephemeral-sign.sh | 1 - .github/workflows/release-cli.yml | 6 ++++++ .github/workflows/release-packages.yml | 11 +++++------ 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.github/scripts/ephemeral-gen.sh b/.github/scripts/ephemeral-gen.sh index fc1e58d6..2fd12ca4 100755 --- a/.github/scripts/ephemeral-gen.sh +++ b/.github/scripts/ephemeral-gen.sh @@ -2,7 +2,6 @@ set -euxo pipefail -cargo binstall -y rsign2 rage rsign generate -f -W -p minisign.pub -s minisign.key set +x diff --git a/.github/scripts/ephemeral-sign.sh b/.github/scripts/ephemeral-sign.sh index ef458e58..ae677d57 100755 --- a/.github/scripts/ephemeral-sign.sh +++ b/.github/scripts/ephemeral-sign.sh @@ -7,7 +7,6 @@ cat >> age.key <<< "$AGE_KEY_SECRET" set -x -cargo binstall -y rsign2 rage rage --decrypt --identity age.key --output minisign.key minisign.key.age ts=$(node -e 'console.log((new Date).toISOString())') diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index bf4bb152..4aaf0322 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -34,7 +34,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - uses: cargo-bins/cargo-binstall@main + - name: Install binaries required + run: cargo binstall -y --force rsign2 rage + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create ephemeral keypair id: keypair env: diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index b8085961..feff50e7 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -62,13 +62,10 @@ jobs: if: inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS run: echo "CARGO_PROFILE_RELEASE_CODEGEN_UNITS=${{ inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS }}" >> "$GITHUB_ENV" - - uses: cargo-bins/cargo-binstall@main - uses: ./.github/actions/just-setup with: - tools: cargo-auditable + tools: cargo-auditable,rsign2,rage env: - # just-setup use binstall to install sccache and cargo-auditable, - # which works better when we provide it with GITHUB_TOKEN. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: just toolchain rust-src @@ -135,10 +132,12 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: cargo-bins/cargo-binstall@main + - uses: taiki-e/install-action@v2 with: - tool: just + tool: just,rsign2,rage + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: actions/download-artifact@v3 with: From 1a244cb0d3a280621a266ad252d771a38d60ae92 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 29 Sep 2023 04:04:23 +0000 Subject: [PATCH 1530/2020] dep: Upgrade transitive dependencies (#1427) Co-authored-by: github-actions --- Cargo.lock | 76 +++++++++++++++++++++++++++--------------------------- 1 file changed, 38 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 17b4f25a..23f2bc59 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,9 +34,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.5.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1f58811cfac344940f1a400b6e6231ce35171f614f26439e80f8c1465c5cc0c" +checksum = "f6cd65a4b849ace0b7f6daeebcc1a1d111282227ca745458c61dbf670e52a597" dependencies = [ "anstyle", "anstyle-parse", @@ -48,15 +48,15 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b84bf0a05bbb2a83e5eb6fa36bb6e87baa08193c35ff52bbf6b38d8af2890e46" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "938874ff5980b03a87c5524b3ae5b59cf99b1d6bc836848df7bc5ada9643c333" +checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" dependencies = [ "utf8parse", ] @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "2.1.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f54d10c6dfa51283a066ceab3ec1ab78d13fae00aa49243a45e4571fb79dfd" +checksum = "0238ca56c96dfa37bdf7c373c8886dd591322500aceeeccdb2216fe06dc2f796" dependencies = [ "anstyle", "windows-sys", @@ -347,7 +347,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror", - "toml_edit 0.20.0", + "toml_edit 0.20.1", "url", ] @@ -373,7 +373,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", - "toml_edit 0.20.0", + "toml_edit 0.20.1", "tracing", "url", ] @@ -555,12 +555,12 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a1f1117a8ff2f3547295da90f473c392d8d1107c90cea1ea82b1a544a97a4a" +checksum = "e3f9629bc6c4388ea699781dc988c2b99766d7679b151c81990b4fa1208fafd3" dependencies = [ "serde", - "toml 0.8.0", + "toml 0.8.1", ] [[package]] @@ -590,9 +590,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.4" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d7b8d5ec32af0fadc644bf1fd509a688c2103b185644bb1e29d164e0703136" +checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" dependencies = [ "clap_builder", "clap_derive", @@ -600,9 +600,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.4" +version = "4.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5179bb514e4d7c2051749d8fcefa2ed6d06a9f4e6d69faf3805f5d80b8cf8d56" +checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" dependencies = [ "anstream", "anstyle", @@ -992,9 +992,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" +checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "file-format" @@ -1889,7 +1889,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b85d89dc728613e26e0ed952a19583744e7f5240fcd4aa30d6c824ffd8b52f0f" dependencies = [ - "fastrand 2.0.0", + "fastrand 2.0.1", ] [[package]] @@ -2173,9 +2173,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" +checksum = "ad227c3af19d4914570ad36d30409928b75967c298feb9ea1969db3a610bb14e" dependencies = [ "equivalent", "hashbrown 0.14.0", @@ -3398,9 +3398,9 @@ checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" [[package]] name = "sha2" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -3409,9 +3409,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "c1b21f559e07218024e7e9f90f96f601825397de0e25420135f7f952453fed0b" dependencies = [ "lazy_static", ] @@ -3599,7 +3599,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" dependencies = [ "cfg-if", - "fastrand 2.0.0", + "fastrand 2.0.1", "redox_syscall 0.3.5", "rustix", "windows-sys", @@ -3628,18 +3628,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.48" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d6d7a740b8a666a7e828dd00da9c0dc290dff53154ea77ac109281de90589b7" +checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.48" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49922ecae66cc8a249b77e68d1d0623c1b2c514f0060c27cdc68bd62a1219d35" +checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", @@ -3816,14 +3816,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c226a7bba6d859b63c92c4b4fe69c5b6b72d0cb897dbc8e6012298e6154cb56e" +checksum = "1bc1433177506450fe920e46a4f9812d0c211f5dd556da10e731a0a3dfa151f0" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.20.0", + "toml_edit 0.20.1", ] [[package]] @@ -3841,7 +3841,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.1", "serde", "serde_spanned", "toml_datetime", @@ -3850,11 +3850,11 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ff63e60a958cefbb518ae1fd6566af80d9d4be430a33f3723dfc47d1d411d95" +checksum = "ca676d9ba1a322c1b64eb8045a5ec5c0cfb0c9d08e15e9ff622589ad5221c8fe" dependencies = [ - "indexmap 2.0.0", + "indexmap 2.0.1", "serde", "serde_spanned", "toml_datetime", From 86060fadc2dd3e59f044ab17e53a4fbc878d4ea3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 29 Sep 2023 15:23:03 +1000 Subject: [PATCH 1531/2020] .github: build detect-targets with cli-logging (#1428) (#1429) Without this we get much less useful output if these tests fail. Co-authored-by: Tamir Duberstein --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd31ba61..38f844c4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,7 +152,7 @@ jobs: - name: Build detect-targets run: | pip3 install -r zigbuild-requirements.txt - cd crates/detect-targets && cargo zigbuild --target $TARGET + cargo zigbuild --bin detect-targets --features cli-logging --target $TARGET - name: Run test in alpine run: | docker run --rm \ @@ -174,7 +174,7 @@ jobs: with: key: ${{ matrix.os }} - name: Build detect-targets - run: cargo build --bin detect-targets + run: cargo build --bin detect-targets --features cli-logging - name: Run test in ubuntu run: | set -exuo pipefail From b56a8c3579e3fe0481ea4ac14f8a3397a26eb9e3 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 30 Sep 2023 09:46:03 +1000 Subject: [PATCH 1532/2020] Fix `detect-targets` glibc detection (#1421) * Fix `detect-targets` glibc detection Fixed #1420 Signed-off-by: Jiahao XU * Fix `detect-targets` glibc detection for Fedora Fedora 37-39 has glibc installed in `/lib64` and `/usr/lib64` instead of `/lib` or `/usr/lib`. Signed-off-by: Jiahao XU * Improve caching in `detect-targets-alpine-test` Make sure it reuses cached artifacts instead of recompiling everything. Signed-off-by: Jiahao XU * Mv `test-detect-targets-musl.sh` into `.github/scripts/` Signed-off-by: Jiahao XU * Refactor `ci.yml`: Extract new job `detect-targets-build` Signed-off-by: Jiahao XU * FIx `detect-targets-ubuntu-test` Signed-off-by: Jiahao XU * Avoid building the entire workspacein `detect-targets-build` Signed-off-by: Jiahao XU * Fix `detect-targets-*-test`: `chmod +x detect-targets` Also fixed testing on Alpine, to make sure it exits with status 1 on assertion failure. Signed-off-by: Jiahao XU * Fix typo Signed-off-by: Jiahao XU * Cache all crates in `detect-targets-build` Since `detect-targets` rarely changes and is quite small, it is also reasonable to cache it. Signed-off-by: Jiahao XU * Add job `detect-targets-more-glibc-test` Signed-off-by: Jiahao XU * Add `detect-targets-nix-test` Signed-off-by: Jiahao XU * Fix `detect-targets-nix-test` executing `detect-targets` Signed-off-by: Jiahao XU * Fix workflow: Add all `detect-targets-*` jobs to be dep of `tests-pass` Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .../scripts/test-detect-targets-musl.sh | 6 +- .github/workflows/ci.yml | 95 ++++++++++++++++--- crates/detect-targets/src/detect/linux.rs | 27 ++++-- 3 files changed, 99 insertions(+), 29 deletions(-) rename test-detect-targets-musl.sh => .github/scripts/test-detect-targets-musl.sh (69%) diff --git a/test-detect-targets-musl.sh b/.github/scripts/test-detect-targets-musl.sh similarity index 69% rename from test-detect-targets-musl.sh rename to .github/scripts/test-detect-targets-musl.sh index 9613120f..e8f404b1 100755 --- a/test-detect-targets-musl.sh +++ b/.github/scripts/test-detect-targets-musl.sh @@ -1,6 +1,4 @@ -#!/bin/ash - -# shellcheck shell=dash +#!/bin/bash set -exuo pipefail @@ -13,7 +11,7 @@ apk add gcompat ls -lsha /lib -GNU_TARGET=$(echo "$TARGET" | sed 's/musl/gnu/') +GNU_TARGET=${TARGET//musl/gnu} [ "$(detect-targets)" = "$(printf '%s\n%s' "$GNU_TARGET" "$TARGET")" ] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 38f844c4..b40f7225 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -139,28 +139,50 @@ jobs: CARGO_PROFILE_RELEASE_LTO: no CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 4 - detect-targets-alpine-test: + detect-targets-build: runs-on: ubuntu-latest env: CARGO_BUILD_TARGET: x86_64-unknown-linux-musl - TARGET: x86_64-unknown-linux-musl steps: - uses: actions/checkout@v4 - - name: Install x86_64-unknown-linux-musl target - run: rustup target add $TARGET + - name: Install ${{ env.CARGO_BUILD_TARGET }} target + run: | + rustup target add $CARGO_BUILD_TARGET + pip3 install -r zigbuild-requirements.txt - uses: Swatinem/rust-cache@v2 + with: + cache-all-crates: true - name: Build detect-targets run: | - pip3 install -r zigbuild-requirements.txt - cargo zigbuild --bin detect-targets --features cli-logging --target $TARGET + cargo zigbuild --features cli-logging --target $CARGO_BUILD_TARGET + # Set working directory here, otherwise `cargo-zigbuild` would download + # and build quite a few unused dependencies. + working-directory: crates/detect-targets + - uses: actions/upload-artifact@v3 + with: + name: detect-targets + path: target/${{ env.CARGO_BUILD_TARGET }}/debug/detect-targets + + detect-targets-alpine-test: + runs-on: ubuntu-latest + needs: detect-targets-build + steps: + - uses: actions/checkout@v4 + + - uses: actions/download-artifact@v3 + with: + name: detect-targets + - run: chmod +x detect-targets + - name: Run test in alpine run: | docker run --rm \ - --mount src="$PWD/target/$TARGET/debug/detect-targets",dst=/usr/local/bin/detect-targets,type=bind \ - --mount src="$PWD/test-detect-targets-musl.sh",dst=/usr/local/bin/test.sh,type=bind \ - alpine test.sh "$TARGET" + --mount src="$PWD/detect-targets",dst=/usr/local/bin/detect-targets,type=bind \ + --mount src="$PWD/.github/scripts/test-detect-targets-musl.sh",dst=/usr/local/bin/test.sh,type=bind \ + alpine /bin/ash -c "apk update && apk add bash && test.sh x86_64-unknown-linux-musl" detect-targets-ubuntu-test: + needs: detect-targets-build strategy: fail-fast: false matrix: @@ -169,16 +191,56 @@ jobs: - ubuntu-latest runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - uses: Swatinem/rust-cache@v2 + - uses: actions/download-artifact@v3 with: - key: ${{ matrix.os }} - - name: Build detect-targets - run: cargo build --bin detect-targets --features cli-logging + name: detect-targets + - run: chmod +x detect-targets + - name: Run test in ubuntu run: | set -exuo pipefail - [ "$(./target/debug/detect-targets)" = "$(printf '%s\n%s' x86_64-unknown-linux-gnu x86_64-unknown-linux-musl)" ] + [ "$(./detect-targets)" = "$(printf 'x86_64-unknown-linux-gnu\nx86_64-unknown-linux-musl')" ] + + detect-targets-more-glibc-test: + needs: detect-targets-build + strategy: + fail-fast: false + matrix: + container: + - archlinux + - fedora:37 + - fedora:38 + - fedora:39 + - fedora + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v3 + with: + name: detect-targets + - run: chmod +x detect-targets + + - name: Run test + run: | + set -exuo pipefail + [ "$(docker run --rm \ + --mount src="$PWD/detect-targets",dst=/usr/local/bin/detect-targets,type=bind \ + ${{ matrix.container }} detect-targets )" = "$(printf 'x86_64-unknown-linux-gnu\nx86_64-unknown-linux-musl')" ] + + detect-targets-nix-test: + needs: detect-targets-build + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v3 + with: + name: detect-targets + - run: chmod +x detect-targets + + - name: Run test + run: | + set -exuo pipefail + [ "$(docker run --rm \ + --mount src="$PWD/detect-targets",dst=/detect-targets,type=bind \ + nixos/nix /detect-targets )" = x86_64-unknown-linux-musl ] # Dummy job to have a stable name for the "all tests pass" requirement tests-pass: @@ -188,8 +250,11 @@ jobs: - cross-check - lint - release-dry-run + - detect-targets-build - detect-targets-alpine-test - detect-targets-ubuntu-test + - detect-targets-more-glibc-test + - detect-targets-nix-test if: always() # always run even if dependencies fail runs-on: ubuntu-latest steps: diff --git a/crates/detect-targets/src/detect/linux.rs b/crates/detect-targets/src/detect/linux.rs index bba7fe60..04a88924 100644 --- a/crates/detect-targets/src/detect/linux.rs +++ b/crates/detect-targets/src/detect/linux.rs @@ -38,16 +38,23 @@ pub(super) async fn detect_targets(target: String) -> Vec { .expect("unwrap: target always has a - for cpu_arch") .0; - let cpu_arch_suffix = cpu_arch.replace('_', "-"); + let handles: Vec<_> = { + let cpu_arch_suffix = cpu_arch.replace('_', "-"); + let filename = format!("ld-linux-{cpu_arch_suffix}.so.2"); + let dirname = format!("{cpu_arch}-linux-gnu"); - let handles: Vec<_> = [ - format!("/lib/ld-linux-{cpu_arch_suffix}.so.2"), - format!("/lib/{cpu_arch}-linux-gnu/ld-linux-{cpu_arch_suffix}.so.2"), - format!("/usr/lib/{cpu_arch}-linux-gnu/ld-linux-{cpu_arch_suffix}.so.2"), - ] - .into_iter() - .map(|p| AutoAbortHandle(tokio::spawn(is_gnu_ld(p)))) - .collect(); + [ + format!("/lib/{filename}"), + format!("/lib64/{filename}"), + format!("/lib/{dirname}/{filename}"), + format!("/lib64/{dirname}/{filename}"), + format!("/usr/lib/{dirname}/{filename}"), + format!("/usr/lib64/{dirname}/{filename}"), + ] + .into_iter() + .map(|p| AutoAbortHandle(tokio::spawn(is_gnu_ld(p)))) + .collect() + }; let has_glibc = async move { for mut handle in handles { @@ -108,7 +115,7 @@ You are not meant to run this directly. if status.success() { // Executing glibc ldd or /lib/ld-linux-{cpu_arch}.so.1 will always // succeeds. - stdout.contains("GLIBC").then_some(Libc::Gnu) + (stdout.contains("GLIBC") || stdout.contains("GNU libc")).then_some(Libc::Gnu) } else if status.code() == Some(1) { // On Alpine, executing both the gcompat glibc and the ldd and // /lib/ld-musl-{cpu_arch}.so.1 will fail with exit status 1. From 8e08c65946647016808eb414844972391dbca75f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 30 Sep 2023 10:22:21 +1000 Subject: [PATCH 1533/2020] Fix fallback to `cargo-install`: Use the default target unless user override (#1430) * Fix fallback to `cargo-install`: Use the default target which is guaranteed to work, instead of providing a custom `--target` from `detect-targets`. The one from `detect-targets` might report musl even if the `rustc` reports gnu, since OSes like NixOS could use a custom glibc location that prevent glibc binaries built for other OSes be run for them. However, if we are compiling the crate and `rustc` defaults to glibc, then it should be guaranteed to work. Signed-off-by: Jiahao XU * Impl fn `DesiredTargets::get_initialized` Signed-off-by: Jiahao XU * Fix fallback to `cargo-install`: Use user-provided override targets Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- crates/binstalk/src/ops/resolve/resolution.rs | 22 +++++++++---------- crates/detect-targets/src/desired_targets.rs | 11 ++++++++++ 2 files changed, 22 insertions(+), 11 deletions(-) diff --git a/crates/binstalk/src/ops/resolve/resolution.rs b/crates/binstalk/src/ops/resolve/resolution.rs index 8862faea..fa06322e 100644 --- a/crates/binstalk/src/ops/resolve/resolution.rs +++ b/crates/binstalk/src/ops/resolve/resolution.rs @@ -126,10 +126,11 @@ impl ResolutionFetch { impl ResolutionSource { pub async fn install(self, opts: Arc) -> Result<(), BinstallError> { - let desired_targets = opts.desired_targets.get().await; - let target = desired_targets - .first() - .ok_or(BinstallError::NoViableTargets)?; + let target = if let Some(targets) = opts.desired_targets.get_initialized() { + Some(targets.first().ok_or(BinstallError::NoViableTargets)?) + } else { + None + }; let name = &self.name; let version = &self.version; @@ -138,21 +139,18 @@ impl ResolutionSource { .map(Cow::Owned) .unwrap_or_else(|| Cow::Borrowed(OsStr::new("cargo"))); - debug!( - "Running `{} install {name} --version {version} --target {target}`", - Path::new(&cargo).display(), - ); - let mut cmd = Command::new(cargo); cmd.arg("install") .arg(name) .arg("--version") .arg(version) - .arg("--target") - .arg(target) .kill_on_drop(true); + if let Some(target) = target { + cmd.arg("--target").arg(target); + } + if opts.quiet { cmd.arg("--quiet"); } @@ -173,6 +171,8 @@ impl ResolutionSource { cmd.arg("--no-track"); } + debug!("Running `{}`", format_cmd(&cmd),); + if !opts.dry_run { let mut child = opts .jobserver_client diff --git a/crates/detect-targets/src/desired_targets.rs b/crates/detect-targets/src/desired_targets.rs index 0f236d7b..36726495 100644 --- a/crates/detect-targets/src/desired_targets.rs +++ b/crates/detect-targets/src/desired_targets.rs @@ -41,6 +41,17 @@ impl DesiredTargets { AutoDetect(once_cell) => once_cell.get_or_init(detect_targets).await, } } + + /// If `DesiredTargets` is provided with a list of desired targets instead + /// of detecting the targets, then this function would return `Some`. + pub fn get_initialized(&self) -> Option<&[String]> { + use DesiredTargetsInner::*; + + match &self.0 { + Initialized(targets) => Some(targets), + AutoDetect(..) => None, + } + } } /// If opts_targets is `Some`, then it will be used. From a69beccf1ab3f3ba5721f210679761141839d111 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 30 Sep 2023 11:12:27 +1000 Subject: [PATCH 1534/2020] Bump dep trust-dns-reslver to v0.23.0 (#1432) * Bump dep trust-dns-reslver to v0.23.0 Since we no longer enables `reqwest/trust-dns-resolver` anymore, we don't need to keep this dependency is sync with upstream `reqwest`. Signed-off-by: Jiahao XU * Fix compilation Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- Cargo.lock | 254 +++++++----------- crates/binstalk-downloader/Cargo.toml | 2 +- .../src/remote/resolver.rs | 7 +- 3 files changed, 95 insertions(+), 168 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 23f2bc59..34596e05 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -206,12 +206,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d27c3610c36aee21ce8ac510e6224498de4228ad772a171ed65643a24693a5a8" -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.4" @@ -301,7 +295,7 @@ dependencies = [ "tokio-tar", "tokio-util", "tracing", - "trust-dns-resolver", + "trust-dns-resolver 0.23.0", "url", "xz2", "zstd 0.12.4", @@ -934,6 +928,18 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "enum-as-inner" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "syn 2.0.37", +] + [[package]] name = "equivalent" version = "1.0.1" @@ -1161,15 +1167,6 @@ dependencies = [ "slab", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -1840,7 +1837,7 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95892eedefd65a6b4312aa5e166d2f740558adfb6854a2b7de73e82e54ef064c" dependencies = [ - "base64 0.21.4", + "base64", "bstr", "gix-command", "gix-credentials", @@ -2000,8 +1997,8 @@ dependencies = [ "bytes", "futures", "h3", - "quinn 0.10.2", - "quinn-proto 0.10.5", + "quinn", + "quinn-proto", "tokio-util", ] @@ -2122,9 +2119,9 @@ dependencies = [ "futures-util", "http", "hyper", - "rustls 0.21.7", + "rustls", "tokio", - "tokio-rustls 0.24.1", + "tokio-rustls", ] [[package]] @@ -2851,25 +2848,6 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" -[[package]] -name = "quinn" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b435e71d9bfa0d8889927231970c51fb89c58fa63bffcab117c9c7a41e5ef8f" -dependencies = [ - "bytes", - "futures-channel", - "futures-util", - "fxhash", - "quinn-proto 0.8.4", - "quinn-udp 0.1.4", - "rustls 0.20.9", - "thiserror", - "tokio", - "tracing", - "webpki", -] - [[package]] name = "quinn" version = "0.10.2" @@ -2878,35 +2856,15 @@ checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ "bytes", "pin-project-lite", - "quinn-proto 0.10.5", - "quinn-udp 0.4.1", + "quinn-proto", + "quinn-udp", "rustc-hash", - "rustls 0.21.7", + "rustls", "thiserror", "tokio", "tracing", ] -[[package]] -name = "quinn-proto" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fce546b9688f767a57530652488420d419a8b1f44a478b451c3d1ab6d992a55" -dependencies = [ - "bytes", - "fxhash", - "rand", - "ring", - "rustls 0.20.9", - "rustls-native-certs", - "rustls-pemfile 0.2.1", - "slab", - "thiserror", - "tinyvec", - "tracing", - "webpki", -] - [[package]] name = "quinn-proto" version = "0.10.5" @@ -2917,27 +2875,13 @@ dependencies = [ "rand", "ring", "rustc-hash", - "rustls 0.21.7", + "rustls", "slab", "thiserror", "tinyvec", "tracing", ] -[[package]] -name = "quinn-udp" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07946277141531aea269befd949ed16b2c85a780ba1043244eda0969e538e54" -dependencies = [ - "futures-util", - "libc", - "quinn-proto 0.8.4", - "socket2 0.4.9", - "tokio", - "tracing", -] - [[package]] name = "quinn-udp" version = "0.4.1" @@ -3064,7 +3008,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" dependencies = [ "async-compression 0.4.3", - "base64 0.21.4", + "base64", "bytes", "encoding_rs", "futures-channel", @@ -3086,24 +3030,24 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "quinn 0.10.2", - "rustls 0.21.7", - "rustls-pemfile 1.0.3", + "quinn", + "rustls", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "tokio", "tokio-native-tls", - "tokio-rustls 0.24.1", + "tokio-rustls", "tokio-util", "tower-service", - "trust-dns-resolver", + "trust-dns-resolver 0.22.0", "url", "wasm-bindgen", "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.25.2", + "webpki-roots", "winreg 0.50.0", ] @@ -3166,18 +3110,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "rustls" -version = "0.20.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b80e3dec595989ea8510028f30c408a4630db12c9cbb8de34203b89d6577e99" -dependencies = [ - "log", - "ring", - "sct", - "webpki", -] - [[package]] name = "rustls" version = "0.21.7" @@ -3190,34 +3122,13 @@ dependencies = [ "sct", ] -[[package]] -name = "rustls-native-certs" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" -dependencies = [ - "openssl-probe", - "rustls-pemfile 1.0.3", - "schannel", - "security-framework", -] - -[[package]] -name = "rustls-pemfile" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" -dependencies = [ - "base64 0.13.1", -] - [[package]] name = "rustls-pemfile" version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "base64 0.21.4", + "base64", ] [[package]] @@ -3740,24 +3651,13 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-rustls" -version = "0.23.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" -dependencies = [ - "rustls 0.20.9", - "tokio", - "webpki", -] - [[package]] name = "tokio-rustls" version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.7", + "rustls", "tokio", ] @@ -3874,6 +3774,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if", + "log", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -3941,36 +3842,61 @@ name = "trust-dns-proto" version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" +dependencies = [ + "async-trait", + "cfg-if", + "data-encoding", + "enum-as-inner 0.5.1", + "futures-channel", + "futures-io", + "futures-util", + "idna 0.2.3", + "ipnet", + "lazy_static", + "rand", + "smallvec", + "thiserror", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "trust-dns-proto" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc775440033cb114085f6f2437682b194fa7546466024b1037e82a48a052a69" dependencies = [ "async-trait", "bytes", "cfg-if", "data-encoding", - "enum-as-inner", + "enum-as-inner 0.6.0", "futures-channel", "futures-io", "futures-util", "h2", "http", - "idna 0.2.3", + "idna 0.4.0", "ipnet", - "lazy_static", "native-tls", - "quinn 0.8.5", + "once_cell", + "quinn", "rand", "ring", - "rustls 0.20.9", - "rustls-pemfile 1.0.3", + "rustls", + "rustls-pemfile", + "rustls-webpki", "smallvec", "thiserror", "tinyvec", "tokio", "tokio-native-tls", - "tokio-rustls 0.23.4", + "tokio-rustls", "tracing", "url", - "webpki", - "webpki-roots 0.22.6", + "webpki-roots", ] [[package]] @@ -3986,15 +3912,36 @@ dependencies = [ "lru-cache", "parking_lot", "resolv-conf", - "rustls 0.20.9", + "smallvec", + "thiserror", + "tokio", + "tracing", + "trust-dns-proto 0.22.0", +] + +[[package]] +name = "trust-dns-resolver" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dff7aed33ef3e8bf2c9966fccdfed93f93d46f432282ea875cd66faabc6ef2f" +dependencies = [ + "cfg-if", + "futures-util", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot", + "rand", + "resolv-conf", + "rustls", "smallvec", "thiserror", "tokio", "tokio-native-tls", - "tokio-rustls 0.23.4", + "tokio-rustls", "tracing", - "trust-dns-proto", - "webpki-roots 0.22.6", + "trust-dns-proto 0.23.0", + "webpki-roots", ] [[package]] @@ -4245,25 +4192,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e74f82d49d545ad128049b7e88f6576df2da6b02e9ce565c6f533be576957e" -dependencies = [ - "ring", - "untrusted", -] - -[[package]] -name = "webpki-roots" -version = "0.22.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" -dependencies = [ - "webpki", -] - [[package]] name = "webpki-roots" version = "0.25.2" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 0f91526d..d0ba2572 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -37,7 +37,7 @@ tokio-tar = "0.3.0" tokio-util = { version = "0.7.8", features = ["io"] } tracing = "0.1.37" # trust-dns-resolver must be kept in sync with the version reqwest uses -trust-dns-resolver = { version = "0.22.0", optional = true, features = ["dnssec-ring"] } +trust-dns-resolver = { version = "0.23.0", optional = true, features = ["dnssec-ring"] } hyper = { version = "0.14.27", optional = true } once_cell = { version = "1.18.0", optional = true } url = "2.3.1" diff --git a/crates/binstalk-downloader/src/remote/resolver.rs b/crates/binstalk-downloader/src/remote/resolver.rs index 62350ea6..d524116b 100644 --- a/crates/binstalk-downloader/src/remote/resolver.rs +++ b/crates/binstalk-downloader/src/remote/resolver.rs @@ -26,8 +26,7 @@ impl Resolve for TrustDnsResolver { fn new_resolver() -> Result> { #[cfg(unix)] { - let (config, opts) = trust_dns_resolver::system_conf::read_system_conf()?; - Ok(TokioAsyncResolver::tokio(config, opts)?) + Ok(TokioAsyncResolver::tokio_from_system_conf()?) } #[cfg(windows)] { @@ -52,7 +51,7 @@ fn new_resolver() -> Result Result Date: Sat, 30 Sep 2023 23:36:23 +1000 Subject: [PATCH 1535/2020] CI: Skip release-dry-run on pull_request (#1435) For PRs opened by contributors who are not part of the cargo-bins team and for PRs opened by dependabot, they cannot access the secrets, thus signing will always fail. Skipping release-dry-run on pull_request would fix that for them, while retaining the signing stage on merge_queue and on main to ensure that the release workflow is working. It will also speedup CI for PR. Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b40f7225..b843cc24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,6 +127,7 @@ jobs: release-dry-run: uses: ./.github/workflows/release-cli.yml + if: github.event_name != 'pull_request' secrets: inherit with: info: | @@ -258,7 +259,7 @@ jobs: if: always() # always run even if dependencies fail runs-on: ubuntu-latest steps: - # fail if ANY dependency has failed or been skipped or cancelled - - if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'skipped') || contains(needs.*.result, 'cancelled')" + # fail if ANY dependency has failed or cancelled + - if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')" run: exit 1 - run: exit 0 From 59963c712f6ea1a43221be92494a126c6feb9974 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 30 Sep 2023 14:08:07 +0000 Subject: [PATCH 1536/2020] build(deps): bump the deps group with 2 updates (#1433) Bumps the deps group with 2 updates: [file-format](https://github.com/mmalecot/file-format) and [gix](https://github.com/Byron/gitoxide). Updates `file-format` from 0.20.0 to 0.21.0 - [Release notes](https://github.com/mmalecot/file-format/releases) - [Changelog](https://github.com/mmalecot/file-format/blob/main/CHANGELOG.md) - [Commits](https://github.com/mmalecot/file-format/compare/v0.20.0...v0.21.0) Updates `gix` from 0.53.1 to 0.54.1 - [Release notes](https://github.com/Byron/gitoxide/releases) - [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md) - [Commits](https://github.com/Byron/gitoxide/compare/gix-v0.53.1...gix-v0.54.1) --- updated-dependencies: - dependency-name: file-format dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: gix dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 149 +++++++++++++++++------------------ crates/bin/Cargo.toml | 2 +- crates/simple-git/Cargo.toml | 2 +- 3 files changed, 75 insertions(+), 78 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 34596e05..cb77e79e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -483,6 +483,12 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" +[[package]] +name = "byteyarn" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7534301c0ea17abb4db06d75efc7b4b0fa360fce8e175a4330d721c71c942ff" + [[package]] name = "bzip2" version = "0.4.4" @@ -1004,9 +1010,9 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "file-format" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cfd758182d326b9360a94cb47b10907b83cb1967235f4f20688ac3ef0e40651" +checksum = "888c5782fda56d3bfa40339d7fc4e2d57191d42fd2708557d9963f5e5e3e9ca0" [[package]] name = "filetime" @@ -1196,9 +1202,9 @@ checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "gix" -version = "0.53.1" +version = "0.54.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06a8c9f9452078f474fecd2880de84819b8c77224ab62273275b646bf785f906" +checksum = "ad6d32e74454459690d57d18ea4ebec1629936e6b130b51d12cb4a81630ac953" dependencies = [ "gix-actor", "gix-attributes", @@ -1251,9 +1257,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e8c6778cc03bca978b2575a03e04e5ba6f430a9dd9b0f1259f0a8a9a5e5cc66" +checksum = "08c60e982c5290897122d4e2622447f014a2dadd5a18cb73d50bb91b31645e27" dependencies = [ "bstr", "btoi", @@ -1265,16 +1271,16 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3548b76829d33a7160a4685134df16de0cc3b77418302e8a9969f0b662e698f" +checksum = "2451665e70709ba4753b623ef97511ee98c4a73816b2c5b5df25678d607ed820" dependencies = [ "bstr", + "byteyarn", "gix-glob", "gix-path", "gix-quote", "gix-trace", - "kstring", "smallvec", "thiserror", "unicode-bom", @@ -1309,9 +1315,9 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4676ede3a7d37e7028e2889830349a6aca22efc1d2f2dd9fa3351c1a8ddb0c6a" +checksum = "e75a975ee22cf0a002bfe9b5d5cb3d2a88e263a8a178cd7509133cff10f4df8a" dependencies = [ "bstr", "gix-chunk", @@ -1323,9 +1329,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1108c4ac88248dd25cc8ab0d0dae796e619fb72d92f88e30e00b29d61bb93cc4" +checksum = "c171514b40487d3f677ae37efc0f45ac980e3169f23c27eb30a70b47fdf88ab5" dependencies = [ "bstr", "gix-config-value", @@ -1357,9 +1363,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "363e16428096b7311c380afe972831ea8b58fc1a1d1621dbdd865caf34921a54" +checksum = "46900b884cc5af6a6c141ee741607c0c651a4e1d33614b8d888a1ba81cc0bc8a" dependencies = [ "bstr", "gix-command", @@ -1385,9 +1391,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45e342d148373bd9070d557e6fb1280aeae29a3e05e32506682d027278501eb" +checksum = "788ddb152c388206e81f36bcbb574e7ed7827c27d8fa62227b34edc333d8928c" dependencies = [ "gix-hash", "gix-object", @@ -1396,9 +1402,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da4cacda5ee9dd1b38b0e2506834e40e66c08cf050ef55c344334c76745f277b" +checksum = "69507643d75a0ea9a402fcf73ced517d2b95cc95385904ac09d03e0b952fde33" dependencies = [ "bstr", "dunce", @@ -1411,9 +1417,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f414c99e1a7abc69b21f3225a6539d203b0513f1d1d448607c4ea81cdcf9ee59" +checksum = "9b9ff423ae4983f762659040d13dd7a5defbd54b6a04ac3cc7347741cec828cd" dependencies = [ "bytes", "bytesize", @@ -1435,9 +1441,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afbdb2ffae9e595d70f8c7b40953a82706d536bb8107874c258fe6368389832b" +checksum = "1be40d28cd41445bb6cd52c4d847d915900e5466f7433eaee6a9e0a3d1d88b08" dependencies = [ "bstr", "encoding_rs", @@ -1455,18 +1461,18 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "404795da3d4c660c9ab6c3b2ad76d459636d1e1e4b37b0c7ff68eee898c298d4" +checksum = "09815faba62fe9b32d918b75a554686c98e43f7d48c43a80df58eb718e5c6635" dependencies = [ "gix-features", ] [[package]] name = "gix-glob" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ac79c444193b0660fe0c0925d338bd338bd643e32138784dccfb12c628b892" +checksum = "a9d76e85f11251dcf751d2c5e918a14f562db5be6f727fd24775245653e9b19d" dependencies = [ "bitflags 2.4.0", "bstr", @@ -1497,9 +1503,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04ff3ec0fd9fb5bb0ae36b252976b0bc94b45ba969b1639f7402425d9d6baf67" +checksum = "b048f443a1f6b02da4205c34d2e287e3fd45d75e8e2f06cfb216630ea9bff5e3" dependencies = [ "bstr", "gix-glob", @@ -1509,9 +1515,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e9599fc30b3d6aad231687a403f85dfa36ae37ccf1b68ee1f621ad5b7fc7a0d" +checksum = "f54d63a9d13c13088f41f5a3accbec284e492ac8f4f707fcc307c139622e17b7" dependencies = [ "bitflags 2.4.0", "bstr", @@ -1532,9 +1538,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "9.0.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1568c3d90594c60d52670f325f5db88c2d572e85c8dd45fabc23d91cadb0fd52" +checksum = "47fc96fa8b6b6d33555021907c81eb3b27635daecf6e630630bdad44f8feaa95" dependencies = [ "gix-tempfile", "gix-utils", @@ -1554,9 +1560,9 @@ dependencies = [ [[package]] name = "gix-negotiate" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "208b25af0e59d04e7313479fc949bd68e11a065b51718995139cefac498e24df" +checksum = "6f1697bf9911c6d1b8d709b9e6ef718cb5ea5821a1b7991520125a8134448004" dependencies = [ "bitflags 2.4.0", "gix-commitgraph", @@ -1570,9 +1576,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5528d5b2c984044d547e696e44a8c45fa122e83cd8c2ac1da69bd474336be8" +checksum = "1e7e19616c67967374137bae83e950e9b518a9ea8a605069bd6716ada357fd6f" dependencies = [ "bstr", "btoi", @@ -1589,9 +1595,9 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.52.0" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0446eca295459deb3d6dd6ed7d44a631479f1b7381d8087166605c7a9f717c6" +checksum = "8d6a392c6ba3a2f133cdc63120e9bc7aec81eef763db372c817de31febfe64bf" dependencies = [ "arc-swap", "gix-date", @@ -1608,9 +1614,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.42.0" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be19ee650300d7cbac5829b637685ec44a8d921a7c2eaff8a245d8f2f008870c" +checksum = "7536203a45b31e1bc5694bbf90ba8da1b736c77040dd6a520db369f371eb1ab3" dependencies = [ "clru", "gix-chunk", @@ -1664,9 +1670,9 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90a7885b4ccdc8c80740e465747bf961a8110043fdc1fda3ee80bc81885f42df" +checksum = "c3e26c9b47c51be73f98d38c84494bd5fb99334c5d6fda14ef5d036d50a9e5fd" dependencies = [ "bitflags 2.4.0", "bstr", @@ -1692,9 +1698,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.39.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d6ee7fc3f80140ea0651d483ecb9e680403be244849c16237fce45ac80163df" +checksum = "cc7b700dc20cc9be8a5130a1fd7e10c34117ffa7068431c8c24d963f0a2e0c9b" dependencies = [ "bstr", "btoi", @@ -1721,9 +1727,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cccbfa8d5cd9b86465f27a521e0c017de54b92d9fd37c143e49c658a2f04f3a" +checksum = "22e6b749660b613641769edc1954132eb8071a13c32224891686091bef078de4" dependencies = [ "gix-actor", "gix-date", @@ -1742,9 +1748,9 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678ba30d95baa5462df9875628ed40655d5f5b8aba7028de86ed57f36e762c6c" +checksum = "0895cb7b1e70f3c3bd4550c329e9f5caf2975f97fcd4238e05754e72208ef61e" dependencies = [ "bstr", "gix-hash", @@ -1756,9 +1762,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e80a5992ae446fe1745dd26523b86084e3f1b6b3e35377fe09b4f35ac8f151" +checksum = "c8c4b15cf2ab7a35f5bcb3ef146187c8d36df0177e171ca061913cbaaa890e89" dependencies = [ "bstr", "gix-date", @@ -1772,9 +1778,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b806349bc1f668e09035800e07ac8045da4e39a8925a245d93142c4802224ec1" +checksum = "e9870c6b1032f2084567710c3b2106ac603377f8d25766b8a6b7c33e6e3ca279" dependencies = [ "gix-commitgraph", "gix-date", @@ -1799,9 +1805,9 @@ dependencies = [ [[package]] name = "gix-submodule" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ff6b99d735842a3a7fb162b660fa97acec39d576c0ca1700d9eff9344f8625d" +checksum = "dd0150e82e9282d3f2ab2dd57a22f9f6c3447b9d9856e5321ac92d38e3e0e2b7" dependencies = [ "bstr", "gix-config", @@ -1814,9 +1820,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "9.0.0" +version = "10.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2762b91ff95e27ff3ea95758c0d4efacd7435a1be3629622928b8276de0f72a8" +checksum = "5ae0978f3e11dc57290ee75ac2477c815bca1ce2fa7ed5dc5f16db067410ac4d" dependencies = [ "gix-fs", "libc", @@ -1833,9 +1839,9 @@ checksum = "96b6d623a1152c3facb79067d6e2ecdae48130030cf27d6eb21109f13bd7b836" [[package]] name = "gix-transport" -version = "0.36.1" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95892eedefd65a6b4312aa5e166d2f740558adfb6854a2b7de73e82e54ef064c" +checksum = "b9ec726e6a245e68ace59a34126a1d679de60360676612985e70b0d3b102fb4e" dependencies = [ "base64", "bstr", @@ -1852,9 +1858,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ec6358f8373fb018af8fc96c9d2ec6a5b66999e2377dc40b7801351fec409ed" +checksum = "22ef04ab3643acba289b5cedd25d6f53c0430770b1d689d1d654511e6fb81ba0" dependencies = [ "gix-commitgraph", "gix-date", @@ -1868,9 +1874,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c79d595b99a6c7ab274f3c991735a0c0f5a816a3da460f513c48edf1c7bf2cc" +checksum = "6125ecf46e8c68bf7202da6cad239831daebf0247ffbab30210d72f3856e420f" dependencies = [ "bstr", "gix-features", @@ -1901,9 +1907,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "addabd470ca4ce3ab893e32a5743971a530b8fc0eee5c23844849abf3c9ea6d6" +checksum = "9f5e32972801bd82d56609e6fc84efc358fa1f11f25c5e83b7807ee2280f14fe" dependencies = [ "bstr", "gix-attributes", @@ -1919,9 +1925,9 @@ dependencies = [ [[package]] name = "gix-worktree-state" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02daf5a1d381280e3c5803a3745ee2abf09d2873118136aaadc0ed96ed438aeb" +checksum = "c3aeb06960f2c5ac9e4cdb6b38eb3c2b99d5e525e68285fef21ed17dfbd597ad" dependencies = [ "bstr", "gix-features", @@ -2295,15 +2301,6 @@ dependencies = [ "rayon", ] -[[package]] -name = "kstring" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3066350882a1cd6d950d055997f379ac37fd39f81cd4d8ed186032eb3c5747" -dependencies = [ - "static_assertions", -] - [[package]] name = "lazy_static" version = "1.4.0" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 0219a672..071445b6 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -27,7 +27,7 @@ binstalk-manifests = { path = "../binstalk-manifests", version = "0.10.0" } clap = { version = "4.4.3", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" -file-format = { version = "0.20.0", default-features = false } +file-format = { version = "0.21.0", default-features = false } home = "0.5.5" log = { version = "0.4.18", features = ["std"] } miette = "5.9.0" diff --git a/crates/simple-git/Cargo.toml b/crates/simple-git/Cargo.toml index cc40005e..f596f224 100644 --- a/crates/simple-git/Cargo.toml +++ b/crates/simple-git/Cargo.toml @@ -18,7 +18,7 @@ tokio = { version = "1.30.0", features = ["rt", "time"], default-features = fals tracing = "0.1.37" [dependencies.gix] -version = "0.53.1" +version = "0.54.1" default-features = false features = [ "comfort", From af04e45b5a516b2944f41a2d2db409c1d8e0f15d Mon Sep 17 00:00:00 2001 From: Sculas Date: Thu, 5 Oct 2023 13:00:07 +0200 Subject: [PATCH 1537/2020] feat: logging for DNS resolver (also fixes #1417) (#1436) * feat: logging for dns resolver * refactor: fix clippy warnings * refactor: actually fix clippy warnings * refactor: apply requested changes --- .../src/remote/resolver.rs | 72 ++++++++++++------- 1 file changed, 46 insertions(+), 26 deletions(-) diff --git a/crates/binstalk-downloader/src/remote/resolver.rs b/crates/binstalk-downloader/src/remote/resolver.rs index d524116b..755bf431 100644 --- a/crates/binstalk-downloader/src/remote/resolver.rs +++ b/crates/binstalk-downloader/src/remote/resolver.rs @@ -3,10 +3,13 @@ use std::{net::SocketAddr, sync::Arc}; use hyper::client::connect::dns::Name; use once_cell::sync::OnceCell; use reqwest::dns::{Addrs, Resolve}; +use tracing::{debug, info, instrument, trace, warn}; #[cfg(windows)] use trust_dns_resolver::config::{NameServerConfig, Protocol, ResolverConfig, ResolverOpts}; use trust_dns_resolver::TokioAsyncResolver; +type BoxError = Box; + #[derive(Debug, Default, Clone)] pub struct TrustDnsResolver(Arc>); @@ -23,42 +26,59 @@ impl Resolve for TrustDnsResolver { } } -fn new_resolver() -> Result> { +#[instrument(level = "trace")] +fn new_resolver() -> Result { #[cfg(unix)] { + info!("Using system DNS resolver configuration"); Ok(TokioAsyncResolver::tokio_from_system_conf()?) } #[cfg(windows)] { + info!("Using custom DNS resolver configuration"); let mut config = ResolverConfig::new(); let opts = ResolverOpts::default(); - let current_interface = default_net::get_default_interface()?; - ipconfig::get_adapters()? - .iter() - .filter_map(|adapter| { - if adapter.adapter_name() == current_interface.name { - Some(adapter.dns_servers()) - } else { - None - } - }) - .flatten() - .for_each(|addr| { - let socket_addr = SocketAddr::new(*addr, 53); - for protocol in [Protocol::Udp, Protocol::Tcp] { - config.add_name_server(NameServerConfig { - socket_addr, - protocol, - tls_dns_name: None, - trust_negative_responses: false, - #[cfg(feature = "rustls")] - tls_config: None, - bind_addr: None, - }) - } - }); + get_adapter()?.dns_servers().iter().for_each(|addr| { + trace!("Adding DNS server: {}", addr); + let socket_addr = SocketAddr::new(*addr, 53); + for protocol in [Protocol::Udp, Protocol::Tcp] { + config.add_name_server(NameServerConfig { + socket_addr, + protocol, + tls_dns_name: None, + trust_negative_responses: false, + #[cfg(feature = "rustls")] + tls_config: None, + bind_addr: None, + }) + } + }); + debug!("Resolver configuration complete"); Ok(TokioAsyncResolver::tokio(config, opts)) } } + +#[cfg(windows)] +#[instrument(level = "trace")] +fn get_adapter() -> Result { + debug!("Retrieving local IP address"); + let local_ip = + default_net::interface::get_local_ipaddr().ok_or("Local IP address not found")?; + debug!("Local IP address: {local_ip}"); + debug!("Retrieving network adapters"); + let adapters = ipconfig::get_adapters()?; + debug!("Found {} network adapters", adapters.len()); + debug!("Searching for adapter with IP address {local_ip}"); + let adapter = adapters + .into_iter() + .find(|adapter| adapter.ip_addresses().contains(&local_ip)) + .ok_or("Adapter not found")?; + debug!( + "Using adapter {} with {} DNS servers", + adapter.friendly_name(), + adapter.dns_servers().len() + ); + Ok(adapter) +} From ceba74870e237d22b2b28228cb1b35015b21d046 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 6 Oct 2023 22:10:42 +1000 Subject: [PATCH 1538/2020] Fix clippy errors in cargo v1.73.0 (#1439) It actually improves the quality of our code! Signed-off-by: Jiahao XU --- .../src/download/extracted_files.rs | 2 +- .../binstalk-downloader/src/download/zip_extraction.rs | 10 +++++----- crates/binstalk-downloader/src/remote/resolver.rs | 7 +++++-- crates/binstalk-fetchers/src/gh_crate_meta/hosting.rs | 4 ++-- crates/binstalk-types/src/crate_info.rs | 2 +- 5 files changed, 14 insertions(+), 11 deletions(-) diff --git a/crates/binstalk-downloader/src/download/extracted_files.rs b/crates/binstalk-downloader/src/download/extracted_files.rs index 87074e00..bf4c0f8a 100644 --- a/crates/binstalk-downloader/src/download/extracted_files.rs +++ b/crates/binstalk-downloader/src/download/extracted_files.rs @@ -16,7 +16,7 @@ impl ExtractedFilesEntry { ExtractedFilesEntry::Dir(Box::new( file_name .map(|file_name| HashSet::from([file_name.into()])) - .unwrap_or_else(HashSet::default), + .unwrap_or_default(), )) } } diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index 7242626c..b545ae14 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -201,13 +201,13 @@ fn check_filename_and_normalize(filename: &ZipString) -> Result<(PathBuf, bool), .unwrap_or_else(|_| String::from_utf8_lossy(filename.as_bytes())); let bail = |filename: Cow<'_, str>| { - Err(ZipError(ZipErrorInner::InvalidFilePath( - filename.into_owned().into(), + Err(DownloadError::from(ZipError( + ZipErrorInner::InvalidFilePath(filename.into_owned().into()), ))) }; if filename.contains('\0') { - return bail(filename)?; + return bail(filename); } let mut path = PathBuf::new(); @@ -216,13 +216,13 @@ fn check_filename_and_normalize(filename: &ZipString) -> Result<(PathBuf, bool), // `normalize_path::NormalizePath::normalize`. for component in Path::new(&*filename).components() { match component { - Component::Prefix(_) | Component::RootDir => return bail(filename)?, + Component::Prefix(_) | Component::RootDir => return bail(filename), Component::CurDir => (), Component::ParentDir => { if !path.pop() { // `PathBuf::pop` returns false if there is no parent. // which means the path is invalid. - return bail(filename)?; + return bail(filename); } } Component::Normal(c) => path.push(c), diff --git a/crates/binstalk-downloader/src/remote/resolver.rs b/crates/binstalk-downloader/src/remote/resolver.rs index 755bf431..67d95ba1 100644 --- a/crates/binstalk-downloader/src/remote/resolver.rs +++ b/crates/binstalk-downloader/src/remote/resolver.rs @@ -3,10 +3,13 @@ use std::{net::SocketAddr, sync::Arc}; use hyper::client::connect::dns::Name; use once_cell::sync::OnceCell; use reqwest::dns::{Addrs, Resolve}; -use tracing::{debug, info, instrument, trace, warn}; +use tracing::{info, instrument, warn}; +use trust_dns_resolver::TokioAsyncResolver; + +#[cfg(windows)] +use tracing::{debug, trace}; #[cfg(windows)] use trust_dns_resolver::config::{NameServerConfig, Protocol, ResolverConfig, ResolverOpts}; -use trust_dns_resolver::TokioAsyncResolver; type BoxError = Box; diff --git a/crates/binstalk-fetchers/src/gh_crate_meta/hosting.rs b/crates/binstalk-fetchers/src/gh_crate_meta/hosting.rs index 779208f9..db8652a9 100644 --- a/crates/binstalk-fetchers/src/gh_crate_meta/hosting.rs +++ b/crates/binstalk-fetchers/src/gh_crate_meta/hosting.rs @@ -63,8 +63,8 @@ impl RepositoryHost { match repo.domain() { Some(domain) if domain.starts_with("github") => GitHub, Some(domain) if domain.starts_with("gitlab") => GitLab, - Some(domain) if domain == "bitbucket.org" => BitBucket, - Some(domain) if domain == "sourceforge.net" => SourceForge, + Some("bitbucket.org") => BitBucket, + Some("sourceforge.net") => SourceForge, _ => Unknown, } } diff --git a/crates/binstalk-types/src/crate_info.rs b/crates/binstalk-types/src/crate_info.rs index eb28750e..9d46d82e 100644 --- a/crates/binstalk-types/src/crate_info.rs +++ b/crates/binstalk-types/src/crate_info.rs @@ -41,7 +41,7 @@ impl Eq for CrateInfo {} impl PartialOrd for CrateInfo { fn partial_cmp(&self, other: &Self) -> Option { - self.name.partial_cmp(&other.name) + Some(self.cmp(other)) } } From 101737e0580812c5b96eee07bb1d45dc0053814c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Oct 2023 13:04:34 +0000 Subject: [PATCH 1539/2020] dep: Upgrade transitive dependencies (#1438) Co-authored-by: github-actions --- Cargo.lock | 216 ++++++++++++++++++----------------------------------- 1 file changed, 71 insertions(+), 145 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cb77e79e..c513e108 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,9 +34,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.1" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6cd65a4b849ace0b7f6daeebcc1a1d111282227ca745458c61dbf670e52a597" +checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" dependencies = [ "anstyle", "anstyle-parse", @@ -72,9 +72,9 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0238ca56c96dfa37bdf7c373c8886dd591322500aceeeccdb2216fe06dc2f796" +checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" dependencies = [ "anstyle", "windows-sys", @@ -141,7 +141,7 @@ checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -295,7 +295,7 @@ dependencies = [ "tokio-tar", "tokio-util", "tracing", - "trust-dns-resolver 0.23.0", + "trust-dns-resolver", "url", "xz2", "zstd 0.12.4", @@ -341,7 +341,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror", - "toml_edit 0.20.1", + "toml_edit 0.20.2", "url", ] @@ -367,7 +367,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", - "toml_edit 0.20.1", + "toml_edit 0.20.2", "tracing", "url", ] @@ -420,9 +420,9 @@ dependencies = [ [[package]] name = "brotli" -version = "3.3.4" +version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a0b1dbcc8ae29329621f8d4f0d835787c1c38bb1401979b49d13b0b305ff68" +checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -431,9 +431,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.3.4" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b6561fd3f895a11e8f72af2cb7d22e08366bebc2b6b57f7744c4bda27034744" +checksum = "da74e2b81409b1b743f8f0c62cc6254afefb8b8e50bbfe3735550f7aeefa3448" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -467,9 +467,9 @@ checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[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" @@ -560,7 +560,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3f9629bc6c4388ea699781dc988c2b99766d7679b151c81990b4fa1208fafd3" dependencies = [ "serde", - "toml 0.8.1", + "toml 0.8.2", ] [[package]] @@ -619,7 +619,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -823,7 +823,7 @@ checksum = "ac4b68190bad25c00b64ea19767b2321a037fc0e5bea7563d5d8e35e04b19c95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -922,18 +922,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "enum-as-inner" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "enum-as-inner" version = "0.6.0" @@ -943,7 +931,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -965,9 +953,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136526188508e25c6fef639d7927dfb3e0e3084488bf202267829cf7fc23dbdd" +checksum = "add4f07d43996f76ef320709726a556a9d4f965d9410d8d0271132d2f8293480" dependencies = [ "errno-dragonfly", "libc", @@ -1140,7 +1128,7 @@ checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -1497,7 +1485,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "409268480841ad008e81c17ca5a293393fbf9f2b6c2f85b8ab9de1f0c5176a16" dependencies = [ "gix-hash", - "hashbrown 0.14.0", + "hashbrown 0.14.1", "parking_lot", ] @@ -1555,7 +1543,7 @@ checksum = "9d8acb5ee668d55f0f2d19a320a3f9ef67a6999ad483e11135abcc2464ed18b6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -2016,9 +2004,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" +checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" [[package]] name = "heck" @@ -2143,17 +2131,6 @@ dependencies = [ "tokio-native-tls", ] -[[package]] -name = "idna" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" -dependencies = [ - "matches", - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.4.0" @@ -2176,12 +2153,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad227c3af19d4914570ad36d30409928b75967c298feb9ea1969db3a610bb14e" +checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.0", + "hashbrown 0.14.1", ] [[package]] @@ -2323,7 +2300,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -2360,9 +2337,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128" +checksum = "3852614a3bd9ca9804678ba6be5e3b8ce76dfc902cae004e3e0c44051b6e88db" [[package]] name = "lock_api" @@ -2406,12 +2383,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" -[[package]] -name = "matches" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5" - [[package]] name = "maybe-async" version = "0.2.7" @@ -2440,9 +2411,9 @@ checksum = "df39d232f5c40b0891c10216992c2f250c054105cb1e56f0fc9032db6203ecc1" [[package]] name = "memchr" -version = "2.6.3" +version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f232d6ef707e1956a43342693d2a31e72989554d58299d7a88738cc95b0d35c" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memmap2" @@ -2491,7 +2462,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -2692,7 +2663,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -2783,7 +2754,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -2982,27 +2953,26 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e062faffd49af27131ed7fa8fcb8a777dec096932c4f1751bc1c0e61c797907" +checksum = "f9e3947399fd46f412918bafde71ec68f9b3505f11ef082eeb80bc7fdf4d7caf" dependencies = [ "cfg-if", "ioctl-sys", - "libc", "windows 0.51.1", ] [[package]] name = "regex-automata" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f401f4955220693b56f8ec66ee9c78abffd8d1c4f23dc41a23839eb88f0795" +checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" [[package]] name = "reqwest" -version = "0.11.20" +version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e9ad3fe7488d7e34558a2033d45a0c90b72d97b4f80705666fea71472e2e6a1" +checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ "async-compression 0.4.3", "base64", @@ -3033,12 +3003,13 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "system-configuration", "tokio", "tokio-native-tls", "tokio-rustls", "tokio-util", "tower-service", - "trust-dns-resolver 0.22.0", + "trust-dns-resolver", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -3096,12 +3067,12 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.14" +version = "0.38.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f" +checksum = "f25469e9ae0f3d0047ca8b93fc56843f38e6774f0914a107ff8b41be8be8e0b7" dependencies = [ "bitflags 2.4.0", - "errno 0.3.3", + "errno 0.3.4", "libc", "linux-raw-sys", "windows-sys", @@ -3242,7 +3213,7 @@ checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -3317,9 +3288,9 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b21f559e07218024e7e9f90f96f601825397de0e25420135f7f952453fed0b" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] @@ -3420,7 +3391,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -3464,9 +3435,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.37" +version = "2.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7303ef2c05cd654186cb250d29049a24840ca25d2747c25c0381c8d9e2f582e8" +checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" dependencies = [ "proc-macro2", "quote", @@ -3551,7 +3522,7 @@ checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -3635,7 +3606,7 @@ checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -3713,14 +3684,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bc1433177506450fe920e46a4f9812d0c211f5dd556da10e731a0a3dfa151f0" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.20.1", + "toml_edit 0.20.2", ] [[package]] @@ -3738,7 +3709,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.1", + "indexmap 2.0.2", "serde", "serde_spanned", "toml_datetime", @@ -3747,11 +3718,11 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca676d9ba1a322c1b64eb8045a5ec5c0cfb0c9d08e15e9ff622589ad5221c8fe" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ - "indexmap 2.0.1", + "indexmap 2.0.2", "serde", "serde_spanned", "toml_datetime", @@ -3785,7 +3756,7 @@ checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", ] [[package]] @@ -3834,31 +3805,6 @@ dependencies = [ "tracing-serde", ] -[[package]] -name = "trust-dns-proto" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner 0.5.1", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.2.3", - "ipnet", - "lazy_static", - "rand", - "smallvec", - "thiserror", - "tinyvec", - "tokio", - "tracing", - "url", -] - [[package]] name = "trust-dns-proto" version = "0.23.0" @@ -3869,13 +3815,13 @@ dependencies = [ "bytes", "cfg-if", "data-encoding", - "enum-as-inner 0.6.0", + "enum-as-inner", "futures-channel", "futures-io", "futures-util", "h2", "http", - "idna 0.4.0", + "idna", "ipnet", "native-tls", "once_cell", @@ -3896,26 +3842,6 @@ dependencies = [ "webpki-roots", ] -[[package]] -name = "trust-dns-resolver" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lazy_static", - "lru-cache", - "parking_lot", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "tracing", - "trust-dns-proto 0.22.0", -] - [[package]] name = "trust-dns-resolver" version = "0.23.0" @@ -3937,7 +3863,7 @@ dependencies = [ "tokio-native-tls", "tokio-rustls", "tracing", - "trust-dns-proto 0.23.0", + "trust-dns-proto", "webpki-roots", ] @@ -4014,7 +3940,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" dependencies = [ "form_urlencoded", - "idna 0.4.0", + "idna", "percent-encoding", "serde", ] @@ -4121,7 +4047,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", "wasm-bindgen-shared", ] @@ -4155,7 +4081,7 @@ checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.37", + "syn 2.0.38", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4395,9 +4321,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.15" +version = "0.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc" +checksum = "037711d82167854aff2018dfd193aa0fef5370f456732f0d5a0c59b0f1b4b907" dependencies = [ "memchr", ] From 49592890f98bea623574593658c6e6aa30d399f9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 7 Oct 2023 13:02:23 +1100 Subject: [PATCH 1540/2020] build(deps): bump the deps group with 2 updates (#1441) Bumps the deps group with 2 updates: [fs4](https://github.com/al8n/fs4-rs) and [proc-macro2](https://github.com/dtolnay/proc-macro2). Updates `fs4` from 0.6.6 to 0.7.0 - [Release notes](https://github.com/al8n/fs4-rs/releases) - [Commits](https://github.com/al8n/fs4-rs/commits/0.7.0) Updates `proc-macro2` from 1.0.67 to 1.0.68 - [Release notes](https://github.com/dtolnay/proc-macro2/releases) - [Commits](https://github.com/dtolnay/proc-macro2/compare/1.0.67...1.0.68) --- updated-dependencies: - dependency-name: fs4 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: proc-macro2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/fs-lock/Cargo.toml | 2 +- crates/leon-macros/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c513e108..7d321a0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1064,9 +1064,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.6.6" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eeb4ed9e12f43b7fa0baae3f9cdda28352770132ef2e09a23760c29cae8bd47" +checksum = "29f9df8a11882c4e3335eb2d18a0137c505d9ca927470b0cac9c6f0ae07d28f7" dependencies = [ "rustix", "windows-sys", @@ -2793,9 +2793,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.67" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d433d9f1a3e8c1263d9456598b16fec66f4acc9a74dacffd35c7bb09b3a1328" +checksum = "5b1106fec09662ec6dd98ccac0f81cef56984d0b49f75c92d8cbad76e20c005c" dependencies = [ "unicode-ident", ] diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 2472ba4e..d9c13e97 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -10,4 +10,4 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -fs4 = "0.6.5" +fs4 = "0.7.0" diff --git a/crates/leon-macros/Cargo.toml b/crates/leon-macros/Cargo.toml index b01caba4..b26e0376 100644 --- a/crates/leon-macros/Cargo.toml +++ b/crates/leon-macros/Cargo.toml @@ -14,6 +14,6 @@ proc-macro = true [dependencies] leon = { version = "2.0.1", path = "../leon", default-features = false } -proc-macro2 = "1.0.67" +proc-macro2 = "1.0.68" syn = { version = "2.0.35", default-features = false, features = ["proc-macro", "parsing"] } quote = "1.0.28" From 63db6686d5f0ec2dbf6bd4b84057443e9038ed7a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 7 Oct 2023 04:58:29 +0000 Subject: [PATCH 1541/2020] dep: Upgrade transitive dependencies (#1442) Co-authored-by: github-actions --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7d321a0c..cf8f0a5e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2305,9 +2305,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.148" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "libmimalloc-sys" @@ -2953,9 +2953,9 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9e3947399fd46f412918bafde71ec68f9b3505f11ef082eeb80bc7fdf4d7caf" +checksum = "d7e3e017e993f86feeddf8a7fb609ca49f89082309e328e27aefd4a25bb317a4" dependencies = [ "cfg-if", "ioctl-sys", From 39d22510b613152115ac18623ccbaa1f9a60353e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 7 Oct 2023 17:09:58 +1100 Subject: [PATCH 1542/2020] release: simple-git v0.1.1 (#1445) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/simple-git/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cf8f0a5e..dc091a21 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3306,7 +3306,7 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.1.0" +version = "0.1.1" dependencies = [ "compact_str", "derive_destructure2", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 3c170392..399e0b4d 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -25,7 +25,7 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde_json = "1.0.107" sha2 = "0.10.7" -simple-git = { version = "0.1.0", path = "../simple-git", optional = true } +simple-git = { version = "0.1.1", path = "../simple-git", optional = true } tempfile = "3.5.0" thiserror = "1.0.40" tokio = { version = "1.30.0", features = ["rt", "sync"], default-features = false } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 631e14a3..f47bb64d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ leon = { version = "2.0.1", path = "../leon" } maybe-owned = "0.3.4" miette = "5.9.0" semver = { version = "1.0.17", features = ["serde"] } -simple-git = { version = "0.1.0", path = "../simple-git", optional = true } +simple-git = { version = "0.1.1", path = "../simple-git", optional = true } strum = "0.25.0" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" diff --git a/crates/simple-git/Cargo.toml b/crates/simple-git/Cargo.toml index f596f224..9974d3a1 100644 --- a/crates/simple-git/Cargo.toml +++ b/crates/simple-git/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "simple-git" -version = "0.1.0" +version = "0.1.1" edition = "2021" description = "The simple git interface for gix suitable for async context (with tokio)" From 45518cb65ec25d49f5e2b3c628f0774e0e1ce730 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 7 Oct 2023 17:10:03 +1100 Subject: [PATCH 1543/2020] release: detect-targets v0.1.13 (#1444) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dc091a21..a054b50a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -828,7 +828,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.12" +version = "0.1.13" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index bb27d480..b0708e36 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -25,5 +25,5 @@ toml_edit = { version = "0.20.0", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.12", path = "../detect-targets" } +detect-targets = { version = "0.1.13", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index f47bb64d..153e5ced 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -18,7 +18,7 @@ binstalk-types = { version = "0.6.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "2.0.0", path = "../cargo-toml-workspace" } command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } -detect-targets = { version = "0.1.12", path = "../detect-targets", features = ["tracing"] } +detect-targets = { version = "0.1.13", path = "../detect-targets", features = ["tracing"] } either = "1.8.1" itertools = "0.11.0" jobslot = { version = "0.2.11", features = ["tokio"] } diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index ecd4d4c0..27664d3b 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.12" +version = "0.1.13" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From 274a1975eb9444836b51687e9611bbb4fb5831a2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 7 Oct 2023 17:10:11 +1100 Subject: [PATCH 1544/2020] release: fs-lock v0.1.1 (#1443) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/fs-lock/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a054b50a..7c376e12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1057,7 +1057,7 @@ dependencies = [ [[package]] name = "fs-lock" -version = "0.1.0" +version = "0.1.1" dependencies = [ "fs4", ] diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index b0708e36..a5006fb4 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" beef = { version = "0.5.2", features = ["impl_serde"] } binstalk-types = { version = "0.6.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } -fs-lock = { version = "0.1.0", path = "../fs-lock" } +fs-lock = { version = "0.1.1", path = "../fs-lock" } home = "0.5.5" miette = "5.9.0" semver = { version = "1.0.17", features = ["serde"] } diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index d9c13e97..57368b18 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -3,7 +3,7 @@ name = "fs-lock" description = "Locked files that can be used like normal File" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/fs-lock" -version = "0.1.0" +version = "0.1.1" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From 71764ca62cbfcd52d732a22de94ec3e1d6f87233 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 7 Oct 2023 07:08:48 +0000 Subject: [PATCH 1545/2020] release: binstalk-types v0.6.1 (#1446) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7c376e12..34c86a13 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -374,7 +374,7 @@ dependencies = [ [[package]] name = "binstalk-types" -version = "0.6.0" +version = "0.6.1" dependencies = [ "compact_str", "maybe-owned", diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 95cd8e03..49245c85 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] atomic-file-install = { version = "1.0.0", path = "../atomic-file-install" } -binstalk-types = { version = "0.6.0", path = "../binstalk-types" } +binstalk-types = { version = "0.6.1", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } leon = { version = "2.0.1", path = "../leon" } miette = "5.9.0" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index d0ba2572..a04960ba 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" async-trait = "0.1.68" async-compression = { version = "0.4.3", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.15", features = ["deflate", "bzip2", "lzma", "zstd", "xz", "tokio"] } -binstalk-types = { version = "0.6.0", path = "../binstalk-types" } +binstalk-types = { version = "0.6.1", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" compact_str = "0.7.0" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index cf4c1851..3b04b9a6 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" binstalk-downloader = { version = "0.9.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } -binstalk-types = { version = "0.6.0", path = "../binstalk-types" } +binstalk-types = { version = "0.6.1", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } either = "1.8.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index a5006fb4..5bc2ce93 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] beef = { version = "0.5.2", features = ["impl_serde"] } -binstalk-types = { version = "0.6.0", path = "../binstalk-types" } +binstalk-types = { version = "0.6.1", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } fs-lock = { version = "0.1.1", path = "../fs-lock" } home = "0.5.5" diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 399e0b4d..6278f16f 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -14,7 +14,7 @@ license = "Apache-2.0 OR MIT" async-trait = "0.1.68" base16 = "0.2.1" binstalk-downloader = { version = "0.9.1", path = "../binstalk-downloader", default-features = false, features = ["json"] } -binstalk-types = { version = "0.6.0", path = "../binstalk-types" } +binstalk-types = { version = "0.6.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "2.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } leon = { version = "2.0.1", path = "../leon" } diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index ee1f4ad1..6c1b168b 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-types" description = "The binstall toolkit that contains basic types for binstalk crates" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-types" -version = "0.6.0" +version = "0.6.1" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 153e5ced..c22fd097 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -14,7 +14,7 @@ binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.9.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.2.0", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.2.0", path = "../binstalk-registry" } -binstalk-types = { version = "0.6.0", path = "../binstalk-types" } +binstalk-types = { version = "0.6.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "2.0.0", path = "../cargo-toml-workspace" } command-group = { version = "2.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } From 113e9d40a3511e9713e81095b7e23f5d5be5f886 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 7 Oct 2023 07:50:55 +0000 Subject: [PATCH 1546/2020] release: binstalk-downloader v0.9.2 (#1447) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 34c86a13..74684d4f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -267,7 +267,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.9.1" +version = "0.9.2" dependencies = [ "async-compression 0.4.3", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index a04960ba..77c0eb25 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.9.1" +version = "0.9.2" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 3b04b9a6..836e418c 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.9.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.9.2", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } @@ -30,7 +30,7 @@ tracing = "0.1.37" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.9.1", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.9.2", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 6278f16f..e385e8be 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.9.1", path = "../binstalk-downloader", default-features = false, features = ["json"] } +binstalk-downloader = { version = "0.9.2", path = "../binstalk-downloader", default-features = false, features = ["json"] } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "2.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } @@ -35,7 +35,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.20.0", features = ["serde"] } -binstalk-downloader = { version = "0.9.1", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } +binstalk-downloader = { version = "0.9.2", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } [features] git = ["simple-git"] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index c22fd097..385400f3 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.9.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.9.2", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.2.0", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.2.0", path = "../binstalk-registry" } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } From 6f6426c247b2e25e6172b632a45f102c50421d45 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 7 Oct 2023 08:39:55 +0000 Subject: [PATCH 1547/2020] release: binstalk-fetchers v0.2.1 (#1448) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 74684d4f..a242c646 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -303,7 +303,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.2.0" +version = "0.2.1" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 836e418c..353fec5f 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.2.0" +version = "0.2.1" edition = "2021" description = "The binstall fetchers" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 385400f3..71ae6905 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.9.2", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } -binstalk-fetchers = { version = "0.2.0", path = "../binstalk-fetchers", features = ["quickinstall"] } +binstalk-fetchers = { version = "0.2.1", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.2.0", path = "../binstalk-registry" } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "2.0.0", path = "../cargo-toml-workspace" } From 3b42aa3d0ff0d75e69fc37b45f11d1b12166d419 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 7 Oct 2023 22:52:35 +1100 Subject: [PATCH 1548/2020] release: binstalk v0.17.1 (#1449) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a242c646..333fadbc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -223,7 +223,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.17.0" +version = "0.17.1" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 071445b6..b26ff48c 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.17.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.17.1", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.10.0" } clap = { version = "4.4.3", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 71ae6905..a660f6a7 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.17.0" +version = "0.17.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From e47b908a057eb4f741950477ea0c4c5aa345d891 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 8 Oct 2023 21:21:00 +1300 Subject: [PATCH 1549/2020] release: cargo-binstall v1.4.3 (#1452) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 333fadbc..afc05d15 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -512,7 +512,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.4.2" +version = "1.4.3" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index b26ff48c..061802d0 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.4.2" +version = "1.4.3" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index be22265d..f992f4bb 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 3cf76cd0a9991af6bf3c64c8a6122d244ab0783f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Tue, 10 Oct 2023 18:51:55 +1300 Subject: [PATCH 1550/2020] Downgrade DNS info! to debug! (#1454) * Downgrade DNS info! to debug! * Update resolver.rs --- crates/binstalk-downloader/src/remote/resolver.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/crates/binstalk-downloader/src/remote/resolver.rs b/crates/binstalk-downloader/src/remote/resolver.rs index 67d95ba1..c0149676 100644 --- a/crates/binstalk-downloader/src/remote/resolver.rs +++ b/crates/binstalk-downloader/src/remote/resolver.rs @@ -3,11 +3,9 @@ use std::{net::SocketAddr, sync::Arc}; use hyper::client::connect::dns::Name; use once_cell::sync::OnceCell; use reqwest::dns::{Addrs, Resolve}; -use tracing::{info, instrument, warn}; +use tracing::{debug, instrument, warn}; use trust_dns_resolver::TokioAsyncResolver; -#[cfg(windows)] -use tracing::{debug, trace}; #[cfg(windows)] use trust_dns_resolver::config::{NameServerConfig, Protocol, ResolverConfig, ResolverOpts}; @@ -33,17 +31,17 @@ impl Resolve for TrustDnsResolver { fn new_resolver() -> Result { #[cfg(unix)] { - info!("Using system DNS resolver configuration"); + debug!("Using system DNS resolver configuration"); Ok(TokioAsyncResolver::tokio_from_system_conf()?) } #[cfg(windows)] { - info!("Using custom DNS resolver configuration"); + debug!("Using custom DNS resolver configuration"); let mut config = ResolverConfig::new(); let opts = ResolverOpts::default(); get_adapter()?.dns_servers().iter().for_each(|addr| { - trace!("Adding DNS server: {}", addr); + tracing::trace!("Adding DNS server: {}", addr); let socket_addr = SocketAddr::new(*addr, 53); for protocol in [Protocol::Udp, Protocol::Tcp] { config.add_name_server(NameServerConfig { From c577893878651e63edd767af7e2e1d4eccea7257 Mon Sep 17 00:00:00 2001 From: George Pollard Date: Fri, 13 Oct 2023 16:10:12 +1300 Subject: [PATCH 1551/2020] Change Powershell architecture detection (#1456) --- install-from-binstall-release.ps1 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install-from-binstall-release.ps1 b/install-from-binstall-release.ps1 index f4fad50c..73bc3564 100644 --- a/install-from-binstall-release.ps1 +++ b/install-from-binstall-release.ps1 @@ -2,10 +2,10 @@ $ErrorActionPreference = "Stop" Set-PSDebug -Trace 1 $tmpdir = $Env:TEMP $base_url = "https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-" -$type = (Get-ComputerInfo).CsSystemType.ToLower() -if ($type.StartsWith("x64")) { +$proc_arch = [Environment]::GetEnvironmentVariable("PROCESSOR_ARCHITECTURE", [EnvironmentVariableTarget]::Machine) +if ($proc_arch -eq "AMD64") { $arch = "x86_64" -} elseif ($type.StartsWith("arm64")) { +} elseif ($proc_arch -eq "ARM64") { $arch = "aarch64" } else { Write-Host "Unsupported Architecture: $type" -ForegroundColor Red From f73d11d0e36fb9df202d4d72b948252e6eb1061b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Oct 2023 07:07:59 +0000 Subject: [PATCH 1552/2020] dep: Upgrade transitive dependencies (#1458) Co-authored-by: github-actions --- Cargo.lock | 90 ++++++++++++++++++++++-------------------------------- 1 file changed, 37 insertions(+), 53 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index afc05d15..4559dcf1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -441,9 +441,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.6.2" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2f7349907b712260e64b0afe2f84692af14a454be26187d9df565c7f69266a" +checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" dependencies = [ "memchr", "regex-automata", @@ -560,7 +560,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3f9629bc6c4388ea699781dc988c2b99766d7679b151c81990b4fa1208fafd3" dependencies = [ "serde", - "toml 0.8.2", + "toml", ] [[package]] @@ -902,13 +902,13 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "embed-resource" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd0a2c9b742a980060d22545a7a83b573acd6b73045b9de6370c9530ce652f27" +checksum = "f54cc3e827ee1c3812239a9a41dede7b4d7d5d5464faa32d71bd7cba28ce2cb2" dependencies = [ "cc", "rustc_version", - "toml 0.7.8", + "toml", "vswhom", "winreg 0.51.0", ] @@ -953,11 +953,10 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "add4f07d43996f76ef320709726a556a9d4f965d9410d8d0271132d2f8293480" +checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" dependencies = [ - "errno-dragonfly", "libc", "windows-sys", ] @@ -1294,9 +1293,9 @@ dependencies = [ [[package]] name = "gix-command" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f28f654184b5f725c5737c7e4f466cbd8f0102ac352d5257eeab19647ee4256" +checksum = "3c576cfbf577f72c097b5f88aedea502cd62952bdc1fb3adcab4531d5525a4c7" dependencies = [ "bstr", ] @@ -1470,9 +1469,9 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ccf425543779cddaa4a7c62aba3fa9d90ea135b160be0a72dd93c063121ad4a" +checksum = "1884c7b41ea0875217c1be9ce91322f90bde433e91d374d0e1276073a51ccc60" dependencies = [ "faster-hex", "thiserror", @@ -1623,9 +1622,9 @@ dependencies = [ [[package]] name = "gix-packetline" -version = "0.16.6" +version = "0.16.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6df0b75361353e7c0a6d72d49617a37379a7a22cba4569ae33a7720a4c8755a" +checksum = "8a8384b1e964151aff0d5632dd9b191059d07dff358b96bd940f1b452600d7ab" dependencies = [ "bstr", "faster-hex", @@ -2238,9 +2237,9 @@ checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" +checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" dependencies = [ "libc", ] @@ -2337,9 +2336,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.8" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3852614a3bd9ca9804678ba6be5e3b8ce76dfc902cae004e3e0c44051b6e88db" +checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "lock_api" @@ -2599,9 +2598,9 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" +checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" dependencies = [ "autocfg", ] @@ -2793,9 +2792,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b1106fec09662ec6dd98ccac0f81cef56984d0b49f75c92d8cbad76e20c005c" +checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" dependencies = [ "unicode-ident", ] @@ -2964,9 +2963,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.3.9" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b23e92ee4318893fa3fe3e6fb365258efbfe6ac6ab30f090cdcbb7aa37efa9" +checksum = "465c6fc0621e4abc4187a2bda0937bfd4f722c2730b29562e19689ea796c9a4b" [[package]] name = "reqwest" @@ -3067,12 +3066,12 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.17" +version = "0.38.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f25469e9ae0f3d0047ca8b93fc56843f38e6774f0914a107ff8b41be8be8e0b7" +checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" dependencies = [ "bitflags 2.4.0", - "errno 0.3.4", + "errno 0.3.5", "libc", "linux-raw-sys", "windows-sys", @@ -3180,18 +3179,18 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0" +checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" +checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" dependencies = [ "serde_derive", ] @@ -3207,9 +3206,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.188" +version = "1.0.189" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" +checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" dependencies = [ "proc-macro2", "quote", @@ -3582,9 +3581,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.32.0" +version = "1.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17ed6077ed6cd6c74735e21f37eb16dc3935f96878b1fe961074089cc80893f9" +checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" dependencies = [ "backtrace", "bytes", @@ -3670,18 +3669,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "toml" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd79e69d3b627db300ff956027cc6c3798cef26d22526befdfcd12feeb6d2257" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit 0.19.15", -] - [[package]] name = "toml" version = "0.8.2" @@ -3710,8 +3697,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap 2.0.2", - "serde", - "serde_spanned", "toml_datetime", "winnow", ] @@ -4415,11 +4400,10 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.8+zstd.1.5.5" +version = "2.0.9+zstd.1.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5556e6ee25d32df2586c098bbfa278803692a20d0ab9565e049480d52707ec8c" +checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" dependencies = [ "cc", - "libc", "pkg-config", ] From 449a3973d9981b391777bd05c39f4c422b987aa2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 14 Oct 2023 02:12:29 +0000 Subject: [PATCH 1553/2020] build(deps): bump tracing-core from 0.1.31 to 0.1.32 (#1461) Bumps [tracing-core](https://github.com/tokio-rs/tracing) from 0.1.31 to 0.1.32. - [Release notes](https://github.com/tokio-rs/tracing/releases) - [Commits](https://github.com/tokio-rs/tracing/compare/tracing-core-0.1.31...tracing-core-0.1.32) --- updated-dependencies: - dependency-name: tracing-core dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4559dcf1..b42799dc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3746,9 +3746,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 061802d0..b8ec8345 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -39,7 +39,7 @@ strum_macros = "0.25.0" supports-color = "2.0.0" tempfile = "3.5.0" tokio = { version = "1.28.2", features = ["rt-multi-thread", "signal"], default-features = false } -tracing-core = "0.1.31" +tracing-core = "0.1.32" tracing = { version = "0.1.37", default-features = false } tracing-log = { version = "0.1.3", default-features = false } tracing-subscriber = { version = "0.3.17", features = ["fmt", "json", "ansi"], default-features = false } From 4de2d0f49c5656fdea397f4bf2db59659ad597f8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 14 Oct 2023 21:01:27 +1100 Subject: [PATCH 1554/2020] build(deps): bump the deps group with 6 updates (#1465) Bumps the deps group with 6 updates: | Package | From | To | | --- | --- | --- | | [tracing](https://github.com/tokio-rs/tracing) | `0.1.37` | `0.1.39` | | [async-compression](https://github.com/Nullus157/async-compression) | `0.4.3` | `0.4.4` | | [flate2](https://github.com/rust-lang/flate2-rs) | `1.0.27` | `1.0.28` | | [zstd](https://github.com/gyscos/zstd-rs) | `0.12.4` | `0.13.0` | | [default-net](https://github.com/shellrow/default-net) | `0.17.0` | `0.18.0` | | [gix](https://github.com/Byron/gitoxide) | `0.54.1` | `0.55.2` | Updates `tracing` from 0.1.37 to 0.1.39 - [Release notes](https://github.com/tokio-rs/tracing/releases) - [Commits](https://github.com/tokio-rs/tracing/compare/tracing-0.1.37...tracing-0.1.39) Updates `async-compression` from 0.4.3 to 0.4.4 - [Release notes](https://github.com/Nullus157/async-compression/releases) - [Changelog](https://github.com/Nullus157/async-compression/blob/main/CHANGELOG.md) - [Commits](https://github.com/Nullus157/async-compression/compare/async-compression-v0.4.3...async-compression-v0.4.4) Updates `flate2` from 1.0.27 to 1.0.28 - [Release notes](https://github.com/rust-lang/flate2-rs/releases) - [Commits](https://github.com/rust-lang/flate2-rs/compare/1.0.27...1.0.28) Updates `zstd` from 0.12.4 to 0.13.0 - [Release notes](https://github.com/gyscos/zstd-rs/releases) - [Commits](https://github.com/gyscos/zstd-rs/compare/v0.12.4...v0.13.0) Updates `default-net` from 0.17.0 to 0.18.0 - [Release notes](https://github.com/shellrow/default-net/releases) - [Commits](https://github.com/shellrow/default-net/compare/v0.17.0...v0.18.0) Updates `gix` from 0.54.1 to 0.55.2 - [Release notes](https://github.com/Byron/gitoxide/releases) - [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md) - [Commits](https://github.com/Byron/gitoxide/compare/gix-v0.54.1...gix-v0.55.2) --- updated-dependencies: - dependency-name: tracing dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: async-compression dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: flate2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: zstd dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: default-net dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: gix dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 187 +++++++++++++------------ crates/atomic-file-install/Cargo.toml | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 10 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 2 +- crates/simple-git/Cargo.toml | 4 +- 11 files changed, 109 insertions(+), 108 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b42799dc..b58ca216 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -117,9 +117,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb42b2197bf15ccb092b62c74515dbd8b86d0effd934795f6687c93b6e679a2c" +checksum = "f658e2baef915ba0f26f1f7c42bfb8e12f532a01f449a090ded75ae7a07e9ba2" dependencies = [ "brotli", "bzip2", @@ -129,8 +129,8 @@ dependencies = [ "pin-project-lite", "tokio", "xz2", - "zstd 0.12.4", - "zstd-safe 6.0.6", + "zstd 0.13.0", + "zstd-safe 7.0.0", ] [[package]] @@ -269,7 +269,7 @@ dependencies = [ name = "binstalk-downloader" version = "0.9.2" dependencies = [ - "async-compression 0.4.3", + "async-compression 0.4.4", "async-trait", "async_zip", "binstalk-types", @@ -298,7 +298,7 @@ dependencies = [ "trust-dns-resolver", "url", "xz2", - "zstd 0.12.4", + "zstd 0.13.0", ] [[package]] @@ -483,12 +483,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" -[[package]] -name = "byteyarn" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7534301c0ea17abb4db06d75efc7b4b0fa360fce8e175a4330d721c71c942ff" - [[package]] name = "bzip2" version = "0.4.4" @@ -794,9 +788,9 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "default-net" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d1b93f7700c45c26856522aed3982b685edb0532e4dbdd3a4ec84bb4185526" +checksum = "267ee644f45fd960bc570bfe62a43485a5378eb44364ab423b8edbf874955038" dependencies = [ "dlopen2", "libc", @@ -1015,9 +1009,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.27" +version = "1.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6c98ee8095e9d1dcbf2fcc6d95acccb90d1c81db1e44725c6a984b1dbdfb010" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" dependencies = [ "crc32fast", "libz-ng-sys", @@ -1189,9 +1183,9 @@ checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" [[package]] name = "gix" -version = "0.54.1" +version = "0.55.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad6d32e74454459690d57d18ea4ebec1629936e6b130b51d12cb4a81630ac953" +checksum = "002667cd1ebb789313d0d0afe3d23b2821cf3b0e91605095f0e6d8751f0ceeea" dependencies = [ "gix-actor", "gix-attributes", @@ -1244,9 +1238,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c60e982c5290897122d4e2622447f014a2dadd5a18cb73d50bb91b31645e27" +checksum = "948a5f9e43559d16faf583694f1c742eb401ce24ce8e6f2238caedea7486433c" dependencies = [ "bstr", "btoi", @@ -1258,16 +1252,16 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2451665e70709ba4753b623ef97511ee98c4a73816b2c5b5df25678d607ed820" +checksum = "dca120f0c6562d2d7cae467f2466e576d9f7f189beec2af2e026145107c729e2" dependencies = [ "bstr", - "byteyarn", "gix-glob", "gix-path", "gix-quote", "gix-trace", + "kstring", "smallvec", "thiserror", "unicode-bom", @@ -1302,9 +1296,9 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e75a975ee22cf0a002bfe9b5d5cb3d2a88e263a8a178cd7509133cff10f4df8a" +checksum = "7e8bc78b1a6328fa6d8b3a53b6c73997af37fd6bfc1d6c49f149e63bda5cbb36" dependencies = [ "bstr", "gix-chunk", @@ -1316,9 +1310,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c171514b40487d3f677ae37efc0f45ac980e3169f23c27eb30a70b47fdf88ab5" +checksum = "5cae98c6b4c66c09379bc35274b172587d6b0ac369a416c39128ad8c6454f9bb" dependencies = [ "bstr", "gix-config-value", @@ -1350,9 +1344,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46900b884cc5af6a6c141ee741607c0c651a4e1d33614b8d888a1ba81cc0bc8a" +checksum = "1c5c5d74069b842a1861e581027ac6b7ad9ff66f5911c89b9f45484d7ebda6a4" dependencies = [ "bstr", "gix-command", @@ -1378,9 +1372,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "788ddb152c388206e81f36bcbb574e7ed7827c27d8fa62227b34edc333d8928c" +checksum = "931394f69fb8c9ed6afc0aae3487bd869e936339bcc13ed8884472af072e0554" dependencies = [ "gix-hash", "gix-object", @@ -1389,9 +1383,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69507643d75a0ea9a402fcf73ced517d2b95cc95385904ac09d03e0b952fde33" +checksum = "a45d5cf0321178883e38705ab2b098f625d609a7d4c391b33ac952eff2c490f2" dependencies = [ "bstr", "dunce", @@ -1404,9 +1398,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b9ff423ae4983f762659040d13dd7a5defbd54b6a04ac3cc7347741cec828cd" +checksum = "51f4365ba17c4f218d7fd9ec102b8d2d3cb0ca200a835e81151ace7778aec827" dependencies = [ "bytes", "bytesize", @@ -1428,9 +1422,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be40d28cd41445bb6cd52c4d847d915900e5466f7433eaee6a9e0a3d1d88b08" +checksum = "92f674d3fdb6b1987b04521ec9a5b7be8650671f2c4bbd17c3c81e2a364242ff" dependencies = [ "bstr", "encoding_rs", @@ -1448,18 +1442,18 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09815faba62fe9b32d918b75a554686c98e43f7d48c43a80df58eb718e5c6635" +checksum = "8cd171c0cae97cd0dc57e7b4601cb1ebf596450e263ef3c02be9107272c877bd" dependencies = [ "gix-features", ] [[package]] name = "gix-glob" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9d76e85f11251dcf751d2c5e918a14f562db5be6f727fd24775245653e9b19d" +checksum = "8fac08925dbc14d414bd02eb45ffb4cecd912d1fce3883f867bd0103c192d3e4" dependencies = [ "bitflags 2.4.0", "bstr", @@ -1490,9 +1484,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048f443a1f6b02da4205c34d2e287e3fd45d75e8e2f06cfb216630ea9bff5e3" +checksum = "1e73c07763a8005ae02cb5cf83040729cea9bb70c7cef68ec6c24159904c499a" dependencies = [ "bstr", "gix-glob", @@ -1502,9 +1496,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f54d63a9d13c13088f41f5a3accbec284e492ac8f4f707fcc307c139622e17b7" +checksum = "c83a4fcc121b2f2e109088f677f89f85e7a8ebf39e8e6659c0ae54d4283b1650" dependencies = [ "bitflags 2.4.0", "bstr", @@ -1525,9 +1519,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "10.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47fc96fa8b6b6d33555021907c81eb3b27635daecf6e630630bdad44f8feaa95" +checksum = "f4feb1dcd304fe384ddc22edba9dd56a42b0800032de6537728cea2f033a4f37" dependencies = [ "gix-tempfile", "gix-utils", @@ -1547,9 +1541,9 @@ dependencies = [ [[package]] name = "gix-negotiate" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f1697bf9911c6d1b8d709b9e6ef718cb5ea5821a1b7991520125a8134448004" +checksum = "2a5cdcf491ecc9ce39dcc227216c540355fe0024ae7c38e94557752ca5ebb67f" dependencies = [ "bitflags 2.4.0", "gix-commitgraph", @@ -1563,9 +1557,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e7e19616c67967374137bae83e950e9b518a9ea8a605069bd6716ada357fd6f" +checksum = "740f2a44267f58770a1cb3a3d01d14e67b089c7136c48d4bddbb3cfd2bf86a51" dependencies = [ "bstr", "btoi", @@ -1582,9 +1576,9 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.53.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d6a392c6ba3a2f133cdc63120e9bc7aec81eef763db372c817de31febfe64bf" +checksum = "8630b56cb80d8fa684d383dad006a66401ee8314e12fbf0e566ddad8c115143b" dependencies = [ "arc-swap", "gix-date", @@ -1601,9 +1595,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.43.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7536203a45b31e1bc5694bbf90ba8da1b736c77040dd6a520db369f371eb1ab3" +checksum = "1431ba2e30deff1405920693d54ab231c88d7c240dd6ccc936ee223d8f8697c3" dependencies = [ "clru", "gix-chunk", @@ -1657,9 +1651,9 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3e26c9b47c51be73f98d38c84494bd5fb99334c5d6fda14ef5d036d50a9e5fd" +checksum = "e9cc7194fdcf43b4a1ccfa13ffae1d79f83beb4becff7761d88dd99faeafe625" dependencies = [ "bitflags 2.4.0", "bstr", @@ -1685,9 +1679,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.40.0" +version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7b700dc20cc9be8a5130a1fd7e10c34117ffa7068431c8c24d963f0a2e0c9b" +checksum = "391e3feabdfa5f90dad6673ce59e3291ac28901b2ff248d86c5a7fbde0391e0e" dependencies = [ "bstr", "btoi", @@ -1714,9 +1708,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e6b749660b613641769edc1954132eb8071a13c32224891686091bef078de4" +checksum = "0ec2f6d07ac88d2fb8007ee3fa3e801856fb9d82e7366ec0ca332eb2c9d74a52" dependencies = [ "gix-actor", "gix-date", @@ -1735,9 +1729,9 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0895cb7b1e70f3c3bd4550c329e9f5caf2975f97fcd4238e05754e72208ef61e" +checksum = "ccb0974cc41dbdb43a180c7f67aa481e1c1e160fcfa8f4a55291fd1126c1a6e7" dependencies = [ "bstr", "gix-hash", @@ -1749,9 +1743,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8c4b15cf2ab7a35f5bcb3ef146187c8d36df0177e171ca061913cbaaa890e89" +checksum = "2ca97ac73459a7f3766aa4a5638a6e37d56d4c7962bc1986fbaf4883d0772588" dependencies = [ "bstr", "gix-date", @@ -1765,9 +1759,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.8.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9870c6b1032f2084567710c3b2106ac603377f8d25766b8a6b7c33e6e3ca279" +checksum = "a16d8c892e4cd676d86f0265bf9d40cefd73d8d94f86b213b8b77d50e77efae0" dependencies = [ "gix-commitgraph", "gix-date", @@ -1792,9 +1786,9 @@ dependencies = [ [[package]] name = "gix-submodule" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd0150e82e9282d3f2ab2dd57a22f9f6c3447b9d9856e5321ac92d38e3e0e2b7" +checksum = "bba78c8d12aa24370178453ec3a472ff08dfaa657d116229f57f2c9cd469a1c2" dependencies = [ "bstr", "gix-config", @@ -1807,9 +1801,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "10.0.0" +version = "11.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ae0978f3e11dc57290ee75ac2477c815bca1ce2fa7ed5dc5f16db067410ac4d" +checksum = "05cc2205cf10d99f70b96e04e16c55d4c7cf33efc151df1f793e29fd12a931f8" dependencies = [ "gix-fs", "libc", @@ -1826,9 +1820,9 @@ checksum = "96b6d623a1152c3facb79067d6e2ecdae48130030cf27d6eb21109f13bd7b836" [[package]] name = "gix-transport" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ec726e6a245e68ace59a34126a1d679de60360676612985e70b0d3b102fb4e" +checksum = "2f209a93364e24f20319751bc11092272e2f3fe82bb72592b2822679cf5be752" dependencies = [ "base64", "bstr", @@ -1845,9 +1839,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.33.0" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ef04ab3643acba289b5cedd25d6f53c0430770b1d689d1d654511e6fb81ba0" +checksum = "14d050ec7d4e1bb76abf0636cf4104fb915b70e54e3ced9a4427c999100ff38a" dependencies = [ "gix-commitgraph", "gix-date", @@ -1861,9 +1855,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.24.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6125ecf46e8c68bf7202da6cad239831daebf0247ffbab30210d72f3856e420f" +checksum = "b1b9ac8ed32ad45f9fc6c5f8c0be2ed911e544a5a19afd62d95d524ebaa95671" dependencies = [ "bstr", "gix-features", @@ -1894,9 +1888,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f5e32972801bd82d56609e6fc84efc358fa1f11f25c5e83b7807ee2280f14fe" +checksum = "ddaf79e721dba64fe726a42f297a3c8ed42e55cdc0d81ca68452f2def3c2d7fd" dependencies = [ "bstr", "gix-attributes", @@ -1912,9 +1906,9 @@ dependencies = [ [[package]] name = "gix-worktree-state" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3aeb06960f2c5ac9e4cdb6b38eb3c2b99d5e525e68285fef21ed17dfbd597ad" +checksum = "34a2fcccdcaf3c71c00a03df31c9aa459d444cabbec4ed9ca1fa64e43406bed4" dependencies = [ "bstr", "gix-features", @@ -2277,6 +2271,15 @@ dependencies = [ "rayon", ] +[[package]] +name = "kstring" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec3066350882a1cd6d950d055997f379ac37fd39f81cd4d8ed186032eb3c5747" +dependencies = [ + "static_assertions", +] + [[package]] name = "lazy_static" version = "1.4.0" @@ -2973,7 +2976,7 @@ version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ - "async-compression 0.4.3", + "async-compression 0.4.4", "base64", "bytes", "encoding_rs", @@ -3722,11 +3725,10 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "ee2ef2af84856a50c1d430afce2fdded0a4ec7eda868db86409b4543df0797f9" dependencies = [ - "cfg-if", "log", "pin-project-lite", "tracing-attributes", @@ -3735,9 +3737,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", @@ -4371,11 +4373,11 @@ dependencies = [ [[package]] name = "zstd" -version = "0.12.4" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c" +checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" dependencies = [ - "zstd-safe 6.0.6", + "zstd-safe 7.0.0", ] [[package]] @@ -4390,11 +4392,10 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "6.0.6" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee98ffd0b48ee95e6c5168188e44a54550b1564d9d530ee21d5f0eaed1069581" +checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e" dependencies = [ - "libc", "zstd-sys", ] diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index ccaf3a4d..74f9d7fe 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -12,7 +12,7 @@ rust-version = "1.65.0" [dependencies] reflink-copy = "0.1.7" tempfile = "3.5.0" -tracing = "0.1.37" +tracing = "0.1.39" [target.'cfg(windows)'.dependencies] windows = { version = "0.51.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index b8ec8345..397957ca 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -40,7 +40,7 @@ supports-color = "2.0.0" tempfile = "3.5.0" tokio = { version = "1.28.2", features = ["rt-multi-thread", "signal"], default-features = false } tracing-core = "0.1.32" -tracing = { version = "0.1.37", default-features = false } +tracing = { version = "0.1.39", default-features = false } tracing-log = { version = "0.1.3", default-features = false } tracing-subscriber = { version = "0.3.17", features = ["fmt", "json", "ansi"], default-features = false } diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 49245c85..05fd51be 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -18,4 +18,4 @@ leon = { version = "2.0.1", path = "../leon" } miette = "5.9.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } thiserror = "1.0.40" -tracing = "0.1.37" +tracing = "0.1.39" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 77c0eb25..be09d46b 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -11,13 +11,13 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" -async-compression = { version = "0.4.3", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } +async-compression = { version = "0.4.4", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.15", features = ["deflate", "bzip2", "lzma", "zstd", "xz", "tokio"] } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" compact_str = "0.7.0" -flate2 = { version = "1.0.26", default-features = false } +flate2 = { version = "1.0.28", default-features = false } futures-util = "0.3.28" httpdate = "1.0.2" reqwest = { version = "0.11.19", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } @@ -35,7 +35,7 @@ thiserror = "1.0.40" tokio = { version = "1.28.2", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.8", features = ["io"] } -tracing = "0.1.37" +tracing = "0.1.39" # trust-dns-resolver must be kept in sync with the version reqwest uses trust-dns-resolver = { version = "0.23.0", optional = true, features = ["dnssec-ring"] } hyper = { version = "0.14.27", optional = true } @@ -48,7 +48,7 @@ xz2 = "0.1.7" # Since zip 0.6.3 depends on zstd 0.11, we can use 0.12.0 here # because it uses the same zstd-sys version. # Otherwise there will be a link conflict. -zstd = { version = "0.12.3", default-features = false } +zstd = { version = "0.13.0", default-features = false } [features] default = ["static", "rustls"] @@ -94,7 +94,7 @@ gh-api-client = ["json"] json = ["serde", "serde_json"] [target."cfg(windows)".dependencies] -default-net = { version = "0.17.0", optional = true } +default-net = { version = "0.18.0", optional = true } ipconfig = { version = "0.3.2", optional = true, default-features = false } [package.metadata.docs.rs] diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 353fec5f..5fb05fd2 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -26,7 +26,7 @@ once_cell = "1.18.0" strum = "0.25.0" thiserror = "1.0.40" tokio = { version = "1.30.0", features = ["rt", "sync"], default-features = false } -tracing = "0.1.37" +tracing = "0.1.39" url = "2.3.1" [dev-dependencies] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index e385e8be..4d4902ad 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -29,7 +29,7 @@ simple-git = { version = "0.1.1", path = "../simple-git", optional = true } tempfile = "3.5.0" thiserror = "1.0.40" tokio = { version = "1.30.0", features = ["rt", "sync"], default-features = false } -tracing = "0.1.37" +tracing = "0.1.39" url = "2.3.1" [dev-dependencies] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index a660f6a7..f3393126 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -32,7 +32,7 @@ target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" thiserror = "1.0.40" tokio = { version = "1.30.0", features = ["rt", "process", "sync"], default-features = false } -tracing = "0.1.37" +tracing = "0.1.39" url = { version = "2.3.1", features = ["serde"] } [features] diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 1f0a5d75..b7b1cd23 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -16,7 +16,7 @@ glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } serde = "1.0.163" thiserror = "1.0.40" -tracing = "0.1.37" +tracing = "0.1.39" [dev-dependencies] tempfile = "3.5.0" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 27664d3b..3b1bee63 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] tokio = { version = "1.28.2", features = ["rt", "process", "sync"], default-features = false } -tracing = { version = "0.1.37", optional = true } +tracing = { version = "0.1.39", optional = true } tracing-subscriber = { version = "0.3.17", features = ["fmt"], default-features = false, optional = true } cfg-if = "1.0.0" guess_host_triple = "0.1.3" diff --git a/crates/simple-git/Cargo.toml b/crates/simple-git/Cargo.toml index 9974d3a1..6d4a865a 100644 --- a/crates/simple-git/Cargo.toml +++ b/crates/simple-git/Cargo.toml @@ -15,10 +15,10 @@ compact_str = "0.7.0" derive_destructure2 = "0.1" thiserror = "1.0.40" tokio = { version = "1.30.0", features = ["rt", "time"], default-features = false } -tracing = "0.1.37" +tracing = "0.1.39" [dependencies.gix] -version = "0.54.1" +version = "0.55.2" default-features = false features = [ "comfort", From 7e132f690d05997934f2fe577a03a520e15f62d0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 20 Oct 2023 20:37:54 +1000 Subject: [PATCH 1555/2020] Fix CI: Use `cargo-hack` 0.6.10 (#1468) * Fix ci: Install deps before caching and include `JUST*` env values in caching key To make sure caching is done properly and does not accidentally include (old) pre-built binaries that we don't want. Signed-off-by: Jiahao XU * Fix missing `shell` Signed-off-by: Jiahao XU * Fix justfile target `check`: Call `cargo hack check` directly without using the `CARGO=cargo-zigbuild` env since `leon` does not use external C/C++ compiler anyway. Signed-off-by: Jiahao XU * CI: Dowgrade cargo-hack to 0.6.10 This is the last version working Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .github/actions/just-setup/action.yml | 5 +++++ .github/workflows/ci.yml | 18 ++++++++---------- .github/workflows/release-packages.yml | 1 - justfile | 2 +- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/actions/just-setup/action.yml b/.github/actions/just-setup/action.yml index 0187304f..66baed82 100644 --- a/.github/actions/just-setup/action.yml +++ b/.github/actions/just-setup/action.yml @@ -53,7 +53,12 @@ runs: fi shell: bash + - run: just ci-install-deps + shell: bash + - if: inputs.indexcache || inputs.buildcache uses: Swatinem/rust-cache@v2 + with: + env-vars: "CARGO CC CFLAGS CXX CMAKE RUST JUST" env: RUSTFLAGS: ${{ steps.retrieve-rustflags.outputs.RUSTFLAGS }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b843cc24..05366c3c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,7 +58,6 @@ jobs: # which works better when we provide it with GITHUB_TOKEN. GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - run: just ci-install-deps - run: just test env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -87,19 +86,19 @@ jobs: CARGO_BUILD_TARGET: ${{ matrix.target }} steps: - uses: actions/checkout@v4 - - uses: ./.github/actions/just-setup - with: - tools: cargo-hack - env: - # just-setup use binstall to install sccache, - # which works better when we provide it with GITHUB_TOKEN. - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Enable cargo-zigbuild if: matrix.os == 'ubuntu-latest' run: echo JUST_USE_CARGO_ZIGBUILD=true >> "$GITHUB_ENV" - - run: just ci-install-deps + - uses: ./.github/actions/just-setup + with: + tools: cargo-hack@0.6.10 + env: + # just-setup use binstall to install sccache, + # which works better when we provide it with GITHUB_TOKEN. + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - run: just avoid-dev-deps - run: just check @@ -121,7 +120,6 @@ jobs: - uses: ./.github/actions/just-setup - run: just toolchain rustfmt,clippy - - run: just ci-install-deps - run: just avoid-dev-deps - run: just lint diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index feff50e7..6cc60658 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -69,7 +69,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: just toolchain rust-src - - run: just ci-install-deps - uses: actions/download-artifact@v3 with: diff --git a/justfile b/justfile index dada41ef..6ea50afe 100644 --- a/justfile +++ b/justfile @@ -215,7 +215,7 @@ build: print-env check: print-env {{cargo-bin}} check {{cargo-build-args}} --profile check-only - cargo-hack hack check --feature-powerset -p leon {{cargo-check-args}} --profile check-only + cargo hack check --feature-powerset -p leon {{cargo-check-args}} --profile check-only {{cargo-bin}} check -p binstalk-downloader --no-default-features --profile check-only {{cargo-bin}} check -p cargo-binstall --no-default-features --features rustls {{cargo-check-args}} --profile check-only cargo-hack hack check -p binstalk-downloader \ From 8efc19b3c3c705edc8107b2bcbad17d8ccc53945 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 20 Oct 2023 21:48:46 +1000 Subject: [PATCH 1556/2020] dep: Update trust-dns-resolver v0.23.0 => hickory-resolver 0.24.0 (#1467) It's renamed to hickory-resolver. Also enabled new feature `hickory-resolver/dns-over-h3` if `rustls` is enabled. Signed-off-by: Jiahao XU --- Cargo.lock | 78 +++++++++++++++---- crates/binstalk-downloader/Cargo.toml | 23 +++--- crates/binstalk-downloader/src/remote.rs | 6 +- .../src/remote/resolver.rs | 4 +- 4 files changed, 79 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b58ca216..1d428d23 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -280,6 +280,7 @@ dependencies = [ "default-net", "flate2", "futures-util", + "hickory-resolver", "httpdate", "hyper", "ipconfig", @@ -295,7 +296,6 @@ dependencies = [ "tokio-tar", "tokio-util", "tracing", - "trust-dns-resolver", "url", "xz2", "zstd 0.13.0", @@ -2013,6 +2013,66 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +[[package]] +name = "hickory-proto" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "091a6fbccf4860009355e3efc52ff4acf37a63489aad7435372d44ceeb6fbbcf" +dependencies = [ + "async-trait", + "bytes", + "cfg-if", + "data-encoding", + "enum-as-inner", + "futures-channel", + "futures-io", + "futures-util", + "h2", + "h3", + "h3-quinn", + "http", + "idna", + "ipnet", + "native-tls", + "once_cell", + "quinn", + "rand", + "ring", + "rustls", + "rustls-pemfile", + "thiserror", + "tinyvec", + "tokio", + "tokio-native-tls", + "tokio-rustls", + "tracing", + "url", +] + +[[package]] +name = "hickory-resolver" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35b8f021164e6a984c9030023544c57789c51760065cd510572fedcfb04164e8" +dependencies = [ + "cfg-if", + "futures-util", + "hickory-proto", + "ipconfig", + "lru-cache", + "once_cell", + "parking_lot", + "rand", + "resolv-conf", + "rustls", + "smallvec", + "thiserror", + "tokio", + "tokio-native-tls", + "tokio-rustls", + "tracing", +] + [[package]] name = "home" version = "0.5.5" @@ -3799,34 +3859,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc775440033cb114085f6f2437682b194fa7546466024b1037e82a48a052a69" dependencies = [ "async-trait", - "bytes", "cfg-if", "data-encoding", "enum-as-inner", "futures-channel", "futures-io", "futures-util", - "h2", - "http", "idna", "ipnet", - "native-tls", "once_cell", - "quinn", "rand", - "ring", - "rustls", - "rustls-pemfile", - "rustls-webpki", "smallvec", "thiserror", "tinyvec", "tokio", - "tokio-native-tls", - "tokio-rustls", "tracing", "url", - "webpki-roots", ] [[package]] @@ -3843,15 +3891,11 @@ dependencies = [ "parking_lot", "rand", "resolv-conf", - "rustls", "smallvec", "thiserror", "tokio", - "tokio-native-tls", - "tokio-rustls", "tracing", "trust-dns-proto", - "webpki-roots", ] [[package]] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index be09d46b..218e9587 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -36,8 +36,7 @@ tokio = { version = "1.28.2", features = ["macros", "rt-multi-thread", "sync", " tokio-tar = "0.3.0" tokio-util = { version = "0.7.8", features = ["io"] } tracing = "0.1.39" -# trust-dns-resolver must be kept in sync with the version reqwest uses -trust-dns-resolver = { version = "0.23.0", optional = true, features = ["dnssec-ring"] } +hickory-resolver = { version = "0.24.0", optional = true, features = ["dnssec-ring"] } hyper = { version = "0.14.27", optional = true } once_cell = { version = "1.18.0", optional = true } url = "2.3.1" @@ -67,20 +66,24 @@ rustls = [ "reqwest/rustls-tls", - # Enable the following features only if trust-dns-resolver is enabled. - "trust-dns-resolver?/dns-over-rustls", - # trust-dns-resolver currently supports https with rustls - "trust-dns-resolver?/dns-over-https-rustls", - "trust-dns-resolver?/dns-over-quic", + # Enable the following features only if hickory-resolver is enabled. + "hickory-resolver?/dns-over-rustls", + # hickory-resolver currently supports https with rustls + "hickory-resolver?/dns-over-https-rustls", + "hickory-resolver?/dns-over-quic", + "hickory-resolver?/dns-over-h3", ] native-tls = [ "__tls", "reqwest/native-tls", - "trust-dns-resolver?/dns-over-native-tls", + "hickory-resolver?/dns-over-native-tls", ] -# Enable trust-dns-resolver so that features on it will also be enabled. -trust-dns = ["trust-dns-resolver", "default-net", "ipconfig", "hyper", "once_cell"] +# Enable hickory-resolver so that features on it will also be enabled. +hickory-dns = ["hickory-resolver", "default-net", "ipconfig", "hyper", "once_cell"] + +# Deprecated alias for hickory-dns, since trust-dns is renamed to hickory-dns +trust-dns = ["hickory-dns"] # Experimental HTTP/3 client, this would require `--cfg reqwest_unstable` # to be passed to `rustc`. diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 096f7dd4..65a43d53 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -30,9 +30,9 @@ pub use request_builder::{Body, RequestBuilder, Response}; mod tls_version; pub use tls_version::TLSVersion; -#[cfg(feature = "trust-dns")] +#[cfg(feature = "hickory-dns")] mod resolver; -#[cfg(feature = "trust-dns")] +#[cfg(feature = "hickory-dns")] use resolver::TrustDnsResolver; #[cfg(feature = "json")] @@ -112,7 +112,7 @@ impl Client { .https_only(true) .tcp_nodelay(false); - #[cfg(feature = "trust-dns")] + #[cfg(feature = "hickory-dns")] { builder = builder.dns_resolver(Arc::new(TrustDnsResolver::default())); } diff --git a/crates/binstalk-downloader/src/remote/resolver.rs b/crates/binstalk-downloader/src/remote/resolver.rs index c0149676..13735fb4 100644 --- a/crates/binstalk-downloader/src/remote/resolver.rs +++ b/crates/binstalk-downloader/src/remote/resolver.rs @@ -1,13 +1,13 @@ use std::{net::SocketAddr, sync::Arc}; +use hickory_resolver::TokioAsyncResolver; use hyper::client::connect::dns::Name; use once_cell::sync::OnceCell; use reqwest::dns::{Addrs, Resolve}; use tracing::{debug, instrument, warn}; -use trust_dns_resolver::TokioAsyncResolver; #[cfg(windows)] -use trust_dns_resolver::config::{NameServerConfig, Protocol, ResolverConfig, ResolverOpts}; +use hickory_resolver::config::{NameServerConfig, Protocol, ResolverConfig, ResolverOpts}; type BoxError = Box; From 9cfc0cd5f97300925ae60f67712b74970a380aca Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 20 Oct 2023 13:01:33 +0000 Subject: [PATCH 1557/2020] dep: Upgrade transitive dependencies (#1470) Co-authored-by: github-actions --- Cargo.lock | 113 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 66 insertions(+), 47 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1d428d23..091ea12c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -135,9 +135,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.73" +version = "0.1.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0" +checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", @@ -405,9 +405,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" [[package]] name = "block-buffer" @@ -805,9 +805,12 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2696e8a945f658fd14dc3b87242e6b80cd0f36ff04ea560fa39082368847946" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +dependencies = [ + "powerfmt", +] [[package]] name = "derive_destructure2" @@ -1335,7 +1338,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea7505b97f4d8e7933e29735a568ba2f86d8de466669d9f0e8321384f9972f47" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "bstr", "gix-path", "libc", @@ -1455,7 +1458,7 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fac08925dbc14d414bd02eb45ffb4cecd912d1fce3883f867bd0103c192d3e4" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "bstr", "gix-features", "gix-path", @@ -1478,7 +1481,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "409268480841ad008e81c17ca5a293393fbf9f2b6c2f85b8ab9de1f0c5176a16" dependencies = [ "gix-hash", - "hashbrown 0.14.1", + "hashbrown 0.14.2", "parking_lot", ] @@ -1500,7 +1503,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c83a4fcc121b2f2e109088f677f89f85e7a8ebf39e8e6659c0ae54d4283b1650" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "bstr", "btoi", "filetime", @@ -1545,7 +1548,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a5cdcf491ecc9ce39dcc227216c540355fe0024ae7c38e94557752ca5ebb67f" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "gix-commitgraph", "gix-date", "gix-hash", @@ -1655,7 +1658,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9cc7194fdcf43b4a1ccfa13ffae1d79f83beb4becff7761d88dd99faeafe625" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "bstr", "gix-attributes", "gix-config-value", @@ -1778,7 +1781,7 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92b9542ac025a8c02ed5d17b3fc031a111a384e859d0be3532ec4d58c40a0f28" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "gix-path", "libc", "windows 0.48.0", @@ -1997,9 +2000,9 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12" +checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" [[package]] name = "heck" @@ -2211,7 +2214,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" dependencies = [ "equivalent", - "hashbrown 0.14.1", + "hashbrown 0.14.2", ] [[package]] @@ -2405,9 +2408,9 @@ checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" [[package]] name = "lock_api" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -2708,7 +2711,7 @@ version = "0.10.57" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "cfg-if", "foreign-types", "libc", @@ -2776,13 +2779,13 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.8" +version = "0.9.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" +checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", + "redox_syscall 0.4.1", "smallvec", "windows-targets", ] @@ -2837,6 +2840,12 @@ version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -3002,6 +3011,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +dependencies = [ + "bitflags 1.3.2", +] + [[package]] name = "redox_users" version = "0.4.3" @@ -3015,9 +3033,9 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7e3e017e993f86feeddf8a7fb609ca49f89082309e328e27aefd4a25bb317a4" +checksum = "8c9bd37fcf997c2d9ec7ebdff893c396677664164cf72105b063ac4a483702d3" dependencies = [ "cfg-if", "ioctl-sys", @@ -3026,9 +3044,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.1" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "465c6fc0621e4abc4187a2bda0937bfd4f722c2730b29562e19689ea796c9a4b" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" [[package]] name = "reqwest" @@ -3129,11 +3147,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.19" +version = "0.38.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed" +checksum = "67ce50cb2e16c2903e30d1cbccfd8387a74b9d4c938b6a4c5ec6cc7556f7a8a0" dependencies = [ - "bitflags 2.4.0", + "bitflags 2.4.1", "errno 0.3.5", "libc", "linux-raw-sys", @@ -3445,9 +3463,9 @@ checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" [[package]] name = "strum_macros" -version = "0.25.2" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad8d03b598d3d0fff69bf533ee3ef19b8eeb342729596df84bcc7e1f96ec4059" +checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" dependencies = [ "heck", "proc-macro2", @@ -3529,9 +3547,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.11" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d0e916b1148c8e263850e1ebcbd046f333e0683c724876bb0da63ea4373dc8a" +checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" [[package]] name = "tempfile" @@ -3569,18 +3587,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.49" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1177e8c6d7ede7afde3585fd2513e611227efd6481bd78d2e82ba1ce16557ed4" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.49" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10712f02019e9288794769fba95cd6847df9874d49d871d062172f9dd41bc4cc" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", @@ -3599,14 +3617,15 @@ dependencies = [ [[package]] name = "time" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "426f806f4089c493dcac0d24c29c01e2c38baf8e30f1b716ee37e83d200b18fe" +checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" dependencies = [ "deranged", "itoa", "libc", "num_threads", + "powerfmt", "serde", "time-core", "time-macros", @@ -3785,9 +3804,9 @@ checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" [[package]] name = "tracing" -version = "0.1.39" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee2ef2af84856a50c1d430afce2fdded0a4ec7eda868db86409b4543df0797f9" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ "log", "pin-project-lite", @@ -3854,9 +3873,9 @@ dependencies = [ [[package]] name = "trust-dns-proto" -version = "0.23.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dc775440033cb114085f6f2437682b194fa7546466024b1037e82a48a052a69" +checksum = "559ac980345f7f5020883dd3bcacf176355225e01916f8c2efecad7534f682c6" dependencies = [ "async-trait", "cfg-if", @@ -3879,9 +3898,9 @@ dependencies = [ [[package]] name = "trust-dns-resolver" -version = "0.23.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dff7aed33ef3e8bf2c9966fccdfed93f93d46f432282ea875cd66faabc6ef2f" +checksum = "c723b0e608b24ad04c73b2607e0241b2c98fd79795a95e98b068b6966138a29d" dependencies = [ "cfg-if", "futures-util", @@ -4352,9 +4371,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.16" +version = "0.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "037711d82167854aff2018dfd193aa0fef5370f456732f0d5a0c59b0f1b4b907" +checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" dependencies = [ "memchr", ] From 61748689b35b8e6854bc88e61220837fd0a47d85 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 22 Oct 2023 12:20:39 +0000 Subject: [PATCH 1558/2020] release: binstalk-downloader v0.9.3 (#1471) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 091ea12c..032d3e13 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -267,7 +267,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.9.2" +version = "0.9.3" dependencies = [ "async-compression 0.4.4", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 218e9587..fdca22da 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.9.2" +version = "0.9.3" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 5fb05fd2..a9870af4 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.9.2", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.9.3", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } @@ -30,7 +30,7 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.9.2", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.9.3", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 4d4902ad..5442a3e8 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.9.2", path = "../binstalk-downloader", default-features = false, features = ["json"] } +binstalk-downloader = { version = "0.9.3", path = "../binstalk-downloader", default-features = false, features = ["json"] } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "2.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } @@ -35,7 +35,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.20.0", features = ["serde"] } -binstalk-downloader = { version = "0.9.2", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } +binstalk-downloader = { version = "0.9.3", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } [features] git = ["simple-git"] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index f3393126..a6930cee 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.9.2", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.9.3", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.2.1", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.2.0", path = "../binstalk-registry" } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } From b935529fd0a43c24082c1b6847e36bdf96a885d5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 22 Oct 2023 12:40:16 +0000 Subject: [PATCH 1559/2020] dep: Upgrade transitive dependencies (#1472) Co-authored-by: github-actions --- Cargo.lock | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 032d3e13..8caf6719 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -687,9 +687,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a17b76ff3a4162b0b27f354a0c87015ddad39d35f9c0c36607a3bdd175dde1f1" +checksum = "3fbc60abd742b35f2492f808e1abbb83d45f72db402e14c55057edc9c7b1e9e4" dependencies = [ "libc", ] @@ -2153,7 +2153,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.9", + "socket2 0.4.10", "tokio", "tower-service", "tracing", @@ -2236,19 +2236,13 @@ dependencies = [ "winapi", ] -[[package]] -name = "ioctl-sys" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bd11f3a29434026f5ff98c730b668ba74b1033637b8817940b54d040696133c" - [[package]] name = "ipconfig" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.4", + "socket2 0.5.5", "widestring", "windows-sys", "winreg 0.50.0", @@ -2929,7 +2923,7 @@ checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ "bytes", "libc", - "socket2 0.5.4", + "socket2 0.5.5", "tracing", "windows-sys", ] @@ -3033,12 +3027,12 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9bd37fcf997c2d9ec7ebdff893c396677664164cf72105b063ac4a483702d3" +checksum = "f97f7665e51f23760e9e4949d454a4782c76ef954acaeec9d1b0f48a58e4529e" dependencies = [ "cfg-if", - "ioctl-sys", + "rustix", "windows 0.51.1", ] @@ -3419,9 +3413,9 @@ checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" [[package]] name = "socket2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" dependencies = [ "libc", "winapi", @@ -3429,9 +3423,9 @@ dependencies = [ [[package]] name = "socket2" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4031e820eb552adee9295814c0ced9e5cf38ddf1e8b7d566d6de8e2538ea989e" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys", @@ -3674,7 +3668,7 @@ dependencies = [ "num_cpus", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.4", + "socket2 0.5.5", "tokio-macros", "windows-sys", ] From dc20cb7eb37d0bc4b498ade18a4e78a52358c6ad Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 22 Oct 2023 13:29:59 +0000 Subject: [PATCH 1560/2020] release: cargo-binstall v1.4.4 (#1473) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8caf6719..e071e29d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -506,7 +506,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.4.3" +version = "1.4.4" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 397957ca..94a5f99d 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.4.3" +version = "1.4.4" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index f992f4bb..7282110d 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 24f5796a7cba75c24b696c348b346d0e04286ee3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 27 Oct 2023 03:54:06 +0000 Subject: [PATCH 1561/2020] dep: Upgrade transitive dependencies (#1474) Co-authored-by: github-actions --- Cargo.lock | 190 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 108 insertions(+), 82 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e071e29d..b400f8ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -208,9 +208,9 @@ checksum = "d27c3610c36aee21ce8ac510e6224498de4228ad772a171ed65643a24693a5a8" [[package]] name = "base64" -version = "0.21.4" +version = "0.21.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ba43ea6f343b788c8764558649e08df62f86c6ef251fdaeb1ffd010a9ae50a2" +checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" [[package]] name = "beef" @@ -341,7 +341,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror", - "toml_edit 0.20.2", + "toml_edit 0.20.5", "url", ] @@ -367,7 +367,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", - "toml_edit 0.20.2", + "toml_edit 0.20.5", "tracing", "url", ] @@ -584,9 +584,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.6" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d04704f56c2cde07f43e8e2c154b43f216dc5c92fc98ada720177362f953b956" +checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" dependencies = [ "clap_builder", "clap_derive", @@ -594,9 +594,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.6" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e231faeaca65ebd1ea3c737966bf858971cd38c3849107aa3ea7de90a804e45" +checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" dependencies = [ "anstream", "anstyle", @@ -606,9 +606,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.2" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0862016ff20d69b84ef8247369fabf5c008a7417002411897d40ee1f4532b873" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", @@ -618,9 +618,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd7cc57abe963c6d3b9d8be5b06ba7c8957a930305ca90304f24ef040aa6f961" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "clru" @@ -687,9 +687,9 @@ checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" [[package]] name = "cpufeatures" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fbc60abd742b35f2492f808e1abbb83d45f72db402e14c55057edc9c7b1e9e4" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] @@ -1070,9 +1070,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" +checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" dependencies = [ "futures-channel", "futures-core", @@ -1085,9 +1085,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" +checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" dependencies = [ "futures-core", "futures-sink", @@ -1095,15 +1095,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-executor" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" +checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" dependencies = [ "futures-core", "futures-task", @@ -1112,15 +1112,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" +checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" [[package]] name = "futures-macro" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" +checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", @@ -1129,21 +1129,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-channel", "futures-core", @@ -2040,7 +2040,7 @@ dependencies = [ "once_cell", "quinn", "rand", - "ring", + "ring 0.16.20", "rustls", "rustls-pemfile", "thiserror", @@ -2162,9 +2162,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d78e1e73ec14cf7375674f74d7dde185c8206fd9dea6fb6295e8a98098aaa97" +checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http", @@ -2250,9 +2250,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" +checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" @@ -2297,9 +2297,9 @@ dependencies = [ [[package]] name = "jobslot" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d03a2fc28c7a19e689b7e8c3f209c77dac23133d235a80cd9c3f400ecd9a73f" +checksum = "f3fd5952a22a0b3abdece9834533f35c4cd02ce72d00eef5fc21a432aadfcaa9" dependencies = [ "cfg-if", "getrandom", @@ -2556,9 +2556,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" +checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", "wasi", @@ -2906,7 +2906,7 @@ checksum = "2c78e758510582acc40acb90458401172d41f1016f8c9dde89e49677afb7eec1" dependencies = [ "bytes", "rand", - "ring", + "ring 0.16.20", "rustc-hash", "rustls", "slab", @@ -3112,12 +3112,26 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", - "untrusted", + "spin 0.5.2", + "untrusted 0.7.1", "web-sys", "winapi", ] +[[package]] +name = "ring" +version = "0.17.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +dependencies = [ + "cc", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys", +] + [[package]] name = "rustc-demangle" version = "0.1.23" @@ -3141,9 +3155,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.20" +version = "0.38.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67ce50cb2e16c2903e30d1cbccfd8387a74b9d4c938b6a4c5ec6cc7556f7a8a0" +checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" dependencies = [ "bitflags 2.4.1", "errno 0.3.5", @@ -3154,12 +3168,12 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.7" +version = "0.21.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd8d6c9f025a446bc4d18ad9632e69aec8f287aa84499ee335599fabd20c3fd8" +checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" dependencies = [ "log", - "ring", + "ring 0.17.5", "rustls-webpki", "sct", ] @@ -3175,12 +3189,12 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.101.6" +version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c7d5dece342910d9ba34d259310cae3e0154b873b35408b787b59bce53d34fe" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring", - "untrusted", + "ring 0.17.5", + "untrusted 0.9.0", ] [[package]] @@ -3221,12 +3235,12 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring", - "untrusted", + "ring 0.17.5", + "untrusted 0.9.0", ] [[package]] @@ -3263,9 +3277,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.189" +version = "1.0.190" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e422a44e74ad4001bdc8eede9a4570ab52f71190e9c076d14369f38b9200537" +checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" dependencies = [ "serde_derive", ] @@ -3281,9 +3295,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.189" +version = "1.0.190" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e48d1f918009ce3145511378cf68d613e3b3d9137d67272562080d68a2b32d5" +checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" dependencies = [ "proc-macro2", "quote", @@ -3303,9 +3317,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.3" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" +checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" dependencies = [ "serde", ] @@ -3437,6 +3451,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "static_assertions" version = "1.1.0" @@ -3547,13 +3567,13 @@ checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" [[package]] name = "tempfile" -version = "3.8.0" +version = "3.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb94d2f3cc536af71caac6b6fcebf65860b347e7ce0cc9ebe8f70d3e521054ef" +checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" dependencies = [ "cfg-if", "fastrand 2.0.1", - "redox_syscall 0.3.5", + "redox_syscall 0.4.1", "rustix", "windows-sys", ] @@ -3732,9 +3752,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d68074620f57a0b21594d9735eb2e98ab38b17f80d3fcb189fca266771ca60d" +checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" dependencies = [ "bytes", "futures-core", @@ -3747,21 +3767,21 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" +checksum = "3efaf127c78d5339cc547cce4e4d973bd5e4f56e949a06d091c082ebeef2f800" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.20.2", + "toml_edit 0.20.5", ] [[package]] name = "toml_datetime" -version = "0.6.3" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" +checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" dependencies = [ "serde", ] @@ -3779,9 +3799,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.20.2" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" +checksum = "782bf6c2ddf761c1e7855405e8975472acf76f7f36d0d4328bd3b7a2fae12a85" dependencies = [ "indexmap 2.0.2", "serde", @@ -3831,12 +3851,12 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] @@ -3867,9 +3887,9 @@ dependencies = [ [[package]] name = "trust-dns-proto" -version = "0.23.1" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "559ac980345f7f5020883dd3bcacf176355225e01916f8c2efecad7534f682c6" +checksum = "3119112651c157f4488931a01e586aa459736e9d6046d3bd9105ffb69352d374" dependencies = [ "async-trait", "cfg-if", @@ -3892,9 +3912,9 @@ dependencies = [ [[package]] name = "trust-dns-resolver" -version = "0.23.1" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c723b0e608b24ad04c73b2607e0241b2c98fd79795a95e98b068b6966138a29d" +checksum = "10a3e6c3aff1718b3c73e395d1f35202ba2ffa847c6a62eea0db8fb4cfe30be6" dependencies = [ "cfg-if", "futures-util", @@ -3977,6 +3997,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "2.4.1" From b86bf5f2e11fec00fb25eed77ec0fe0ba2ca7a96 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 28 Oct 2023 01:41:46 +0000 Subject: [PATCH 1562/2020] build(deps): bump the deps group with 2 updates (#1475) Bumps the deps group with 2 updates: [tracing-log](https://github.com/tokio-rs/tracing) and [toml_edit](https://github.com/toml-rs/toml). Updates `tracing-log` from 0.1.4 to 0.2.0 - [Release notes](https://github.com/tokio-rs/tracing/releases) - [Commits](https://github.com/tokio-rs/tracing/compare/tracing-log-0.1.4...tracing-log-0.2.0) Updates `toml_edit` from 0.20.5 to 0.20.7 - [Commits](https://github.com/toml-rs/toml/compare/v0.20.5...v0.20.7) --- updated-dependencies: - dependency-name: tracing-log dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: toml_edit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 14 +++++++------- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- 4 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b400f8ce..47b27aca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -341,7 +341,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror", - "toml_edit 0.20.5", + "toml_edit 0.20.7", "url", ] @@ -367,7 +367,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", - "toml_edit 0.20.5", + "toml_edit 0.20.7", "tracing", "url", ] @@ -3774,7 +3774,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.20.5", + "toml_edit 0.20.7", ] [[package]] @@ -3799,9 +3799,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.20.5" +version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "782bf6c2ddf761c1e7855405e8975472acf76f7f36d0d4328bd3b7a2fae12a85" +checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ "indexmap 2.0.2", "serde", @@ -3851,9 +3851,9 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.4" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ "log", "once_cell", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 94a5f99d..e66ff137 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -41,7 +41,7 @@ tempfile = "3.5.0" tokio = { version = "1.28.2", features = ["rt-multi-thread", "signal"], default-features = false } tracing-core = "0.1.32" tracing = { version = "0.1.39", default-features = false } -tracing-log = { version = "0.1.3", default-features = false } +tracing-log = { version = "0.2.0", default-features = false } tracing-subscriber = { version = "0.3.17", features = ["fmt", "json", "ansi"], default-features = false } [build-dependencies] diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 5bc2ce93..d4f60dbb 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.107" thiserror = "1.0.40" -toml_edit = { version = "0.20.0", features = ["serde"] } +toml_edit = { version = "0.20.7", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 5442a3e8..f620d366 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -34,7 +34,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } -toml_edit = { version = "0.20.0", features = ["serde"] } +toml_edit = { version = "0.20.7", features = ["serde"] } binstalk-downloader = { version = "0.9.3", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } [features] From 6454a1df055ca052667dcb98cde26d8d53840129 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 3 Nov 2023 03:46:55 +0000 Subject: [PATCH 1563/2020] dep: Upgrade transitive dependencies (#1477) Co-authored-by: github-actions --- Cargo.lock | 64 +++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 47b27aca..05e886d1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -431,9 +431,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da74e2b81409b1b743f8f0c62cc6254afefb8b8e50bbfe3735550f7aeefa3448" +checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -2209,9 +2209,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8adf3ddd720272c6ea8bf59463c04e0f93d0bbf7c5439b691bca2987e0270897" +checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", "hashbrown 0.14.2", @@ -2311,9 +2311,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" +checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" dependencies = [ "wasm-bindgen", ] @@ -2701,9 +2701,9 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "openssl" -version = "0.10.57" +version = "0.10.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bac25ee399abb46215765b1cb35bc0212377e58a061560d8b29b024fd0430e7c" +checksum = "a9dfc0783362704e97ef3bd24261995a699468440099ef95d869b4d9732f829a" dependencies = [ "bitflags 2.4.1", "cfg-if", @@ -2733,9 +2733,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.93" +version = "0.9.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4d56a4c0478783083cfafcc42493dd4a981d41669da64b4572a2a089b51b1d" +checksum = "2f55da20b29f956fb01f0add8683eb26ee13ebe3ebd935e49898717c6b4b2830" dependencies = [ "cc", "libc", @@ -3306,9 +3306,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.107" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -3767,9 +3767,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3efaf127c78d5339cc547cce4e4d973bd5e4f56e949a06d091c082ebeef2f800" +checksum = "8ff9e3abce27ee2c9a37f9ad37238c1bdd4e789c84ba37df76aa4d528f5072cc" dependencies = [ "serde", "serde_spanned", @@ -3792,7 +3792,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.1.0", "toml_datetime", "winnow", ] @@ -3803,7 +3803,7 @@ version = "0.20.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" dependencies = [ - "indexmap 2.0.2", + "indexmap 2.1.0", "serde", "serde_spanned", "toml_datetime", @@ -4098,9 +4098,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4108,9 +4108,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" dependencies = [ "bumpalo", "log", @@ -4123,9 +4123,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.37" +version = "0.4.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" +checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" dependencies = [ "cfg-if", "js-sys", @@ -4135,9 +4135,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4145,9 +4145,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", @@ -4158,9 +4158,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.87" +version = "0.2.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" [[package]] name = "wasm-streams" @@ -4177,9 +4177,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.64" +version = "0.3.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" dependencies = [ "js-sys", "wasm-bindgen", @@ -4391,9 +4391,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.17" +version = "0.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3b801d0e0a6726477cc207f60162da452f3a95adb368399bef20a946e06f65c" +checksum = "176b6138793677221d420fd2f0aeeced263f197688b36484660da767bca2fa32" dependencies = [ "memchr", ] From 3414c4ee83a6b4b30a1c14db5c808e5239c65712 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 4 Nov 2023 12:44:22 +1100 Subject: [PATCH 1564/2020] build(deps): bump the deps group with 3 updates (#1478) Bumps the deps group with 3 updates: [command-group](https://github.com/watchexec/command-group), [default-net](https://github.com/shellrow/default-net) and [cargo_toml](https://gitlab.com/lib.rs/cargo_toml). Updates `command-group` from 2.1.0 to 3.0.0 - [Changelog](https://github.com/watchexec/command-group/blob/main/CHANGELOG.md) - [Commits](https://github.com/watchexec/command-group/compare/v2.1.0...v3.0.0) Updates `default-net` from 0.18.0 to 0.19.0 - [Release notes](https://github.com/shellrow/default-net/releases) - [Commits](https://github.com/shellrow/default-net/compare/v0.18.0...v0.19.0) Updates `cargo_toml` from 0.16.3 to 0.17.0 - [Commits](https://gitlab.com/lib.rs/cargo_toml/compare/v0.16.3...v0.17.0) --- updated-dependencies: - dependency-name: command-group dependency-type: direct:production update-type: version-update:semver-major dependency-group: deps - dependency-name: default-net dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: cargo_toml dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 18 +++++++++--------- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 05e886d1..78f57609 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -549,9 +549,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.16.3" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3f9629bc6c4388ea699781dc988c2b99766d7679b151c81990b4fa1208fafd3" +checksum = "6ca592ad99e6a0fd4b95153406138b997cc26ccd3cd0aecdfd4fbdbf1519bd77" dependencies = [ "serde", "toml", @@ -645,9 +645,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "command-group" -version = "2.1.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5080df6b0f0ecb76cab30808f00d937ba725cebe266a3da8cd89dff92f2a9916" +checksum = "38f0a774e568e1cce33f12d03f442e87d9e0bc519f877317aa6e536d845d0a24" dependencies = [ "async-trait", "nix", @@ -788,9 +788,9 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "default-net" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ee644f45fd960bc570bfe62a43485a5378eb44364ab423b8edbf874955038" +checksum = "407d4a2744e934ce48e7788c73c2dd0f43abaa2e45d1e1b5e71f273edfdfb8e2" dependencies = [ "dlopen2", "libc", @@ -2633,11 +2633,11 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.4" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.4.1", "cfg-if", "libc", ] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index fdca22da..56800946 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -97,7 +97,7 @@ gh-api-client = ["json"] json = ["serde", "serde_json"] [target."cfg(windows)".dependencies] -default-net = { version = "0.18.0", optional = true } +default-net = { version = "0.19.0", optional = true } ipconfig = { version = "0.3.2", optional = true, default-features = false } [package.metadata.docs.rs] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index a6930cee..ad42ec9a 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -16,7 +16,7 @@ binstalk-fetchers = { version = "0.2.1", path = "../binstalk-fetchers", features binstalk-registry = { version = "0.2.0", path = "../binstalk-registry" } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "2.0.0", path = "../cargo-toml-workspace" } -command-group = { version = "2.1.0", features = ["with-tokio"] } +command-group = { version = "3.0.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.13", path = "../detect-targets", features = ["tracing"] } either = "1.8.1" diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index b7b1cd23..55ab886a 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Jiahao XU "] license = "Apache-2.0 OR MIT" [dependencies] -cargo_toml = "0.16.0" +cargo_toml = "0.17.0" compact_str = { version = "0.7.0", features = ["serde"] } glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } From d76a40bf7d41edd6e1b4a03f9f415d21bf6039e8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 9 Nov 2023 08:06:32 +1000 Subject: [PATCH 1565/2020] Rm unnecessary warning msg "Failed to read git credential file" (#1479) * Rm unnecessary warning msg "Failed to read git credential file" Fixed #1476 If `gh auth token` executed successfully and binstall obtained a gh token from it, then there's no reason to issue any warning msg. Only when binstall cannot read from `.git-credential` and `gh auth token` failed does binstall need to issue warning. Signed-off-by: Jiahao XU * Fix clippy warning Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- crates/bin/src/entry.rs | 9 ++++++++- crates/bin/src/gh_token.rs | 13 +------------ crates/bin/src/git_credentials.rs | 18 ++---------------- 3 files changed, 11 insertions(+), 29 deletions(-) diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index d38ec5b0..304bab65 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -114,7 +114,14 @@ pub fn install_crates( if args.no_discover_github_token { None } else { - git_credentials::try_from_home().or_else(gh_token::get) + git_credentials::try_from_home().or_else(|| match gh_token::get() { + Ok(token) => Some(token), + Err(err) => { + warn!(?err, "Failed to retrieve token from `gh auth token`"); + warn!("Failed to read git credential file"); + None + } + }) } }), ); diff --git a/crates/bin/src/gh_token.rs b/crates/bin/src/gh_token.rs index 3cfb3563..172070a6 100644 --- a/crates/bin/src/gh_token.rs +++ b/crates/bin/src/gh_token.rs @@ -1,9 +1,8 @@ use std::{io, process}; use compact_str::CompactString; -use tracing::warn; -fn get_inner() -> io::Result { +pub(super) fn get() -> io::Result { let process::Output { status, stdout, .. } = process::Command::new("gh") .args(["auth", "token"]) .stdin(process::Stdio::null()) @@ -26,13 +25,3 @@ fn get_inner() -> io::Result { Ok(s.trim().into()) } - -pub(super) fn get() -> Option { - match get_inner() { - Ok(token) => Some(token), - Err(err) => { - warn!(?err, "Failed to retrieve token from `gh auth token`"); - None - } - } -} diff --git a/crates/bin/src/git_credentials.rs b/crates/bin/src/git_credentials.rs index 613b3732..d2e420f7 100644 --- a/crates/bin/src/git_credentials.rs +++ b/crates/bin/src/git_credentials.rs @@ -2,7 +2,6 @@ use std::{env, fs, path::PathBuf}; use compact_str::CompactString; use dirs::home_dir; -use tracing::warn; pub fn try_from_home() -> Option { if let Some(mut home) = home_dir() { @@ -25,7 +24,8 @@ pub fn try_from_home() -> Option { } fn from_file(path: PathBuf) -> Option { - read_cred_file(path)? + fs::read_to_string(path) + .ok()? .lines() .find_map(from_line) .map(CompactString::from) @@ -40,20 +40,6 @@ fn from_line(line: &str) -> Option<&str> { Some(cred.split_once(':')?.1) } -fn read_cred_file(path: PathBuf) -> Option { - match fs::read_to_string(&path) { - Ok(s) => Some(s), - Err(err) => { - warn!( - ?err, - "Failed to read git credential file {}", - path.display() - ); - None - } - } -} - #[cfg(test)] mod test { use super::*; From 70afd8419d884ffedfe55e917299a8d18f4e0ef1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 10 Nov 2023 03:53:23 +0000 Subject: [PATCH 1566/2020] dep: Upgrade transitive dependencies (#1480) Co-authored-by: github-actions --- Cargo.lock | 149 +++++++++++++++++++++++++++++------------------------ 1 file changed, 82 insertions(+), 67 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 78f57609..e24dd34d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -141,7 +141,7 @@ checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -441,9 +441,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79ad7fb2dd38f3dabd76b09c6a5a20c038fc0213ef1e9afd30eb777f120f019" +checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" dependencies = [ "memchr", "regex-automata", @@ -613,7 +613,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -820,7 +820,7 @@ checksum = "ac4b68190bad25c00b64ea19767b2321a037fc0e5bea7563d5d8e35e04b19c95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -928,7 +928,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -950,9 +950,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3e13f66a2f95e32a39eaa81f6b95d42878ca0e1db0c7543723dfe12557e860" +checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e" dependencies = [ "libc", "windows-sys", @@ -1124,7 +1124,7 @@ checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -1169,9 +1169,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "libc", @@ -1539,7 +1539,7 @@ checksum = "9d8acb5ee668d55f0f2d19a320a3f9ef67a6999ad483e11135abcc2464ed18b6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -2359,14 +2359,14 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] name = "libc" -version = "0.2.149" +version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" +checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" [[package]] name = "libmimalloc-sys" @@ -2378,6 +2378,17 @@ dependencies = [ "libc", ] +[[package]] +name = "libredox" +version = "0.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +dependencies = [ + "bitflags 2.4.1", + "libc", + "redox_syscall 0.4.1", +] + [[package]] name = "libz-ng-sys" version = "1.1.12" @@ -2396,9 +2407,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f" +checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" [[package]] name = "lock_api" @@ -2521,7 +2532,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -2701,9 +2712,9 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "openssl" -version = "0.10.58" +version = "0.10.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9dfc0783362704e97ef3bd24261995a699468440099ef95d869b4d9732f829a" +checksum = "7a257ad03cd8fb16ad4172fedf8094451e1af1c4b70097636ef2eac9a5f0cc33" dependencies = [ "bitflags 2.4.1", "cfg-if", @@ -2722,7 +2733,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -2733,9 +2744,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.94" +version = "0.9.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f55da20b29f956fb01f0add8683eb26ee13ebe3ebd935e49898717c6b4b2830" +checksum = "40a4130519a360279579c2053038317e40eff64d13fd3f004f9e1b72b8a6aaf9" dependencies = [ "cc", "libc", @@ -2813,7 +2824,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -2900,9 +2911,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c78e758510582acc40acb90458401172d41f1016f8c9dde89e49677afb7eec1" +checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" dependencies = [ "bytes", "rand", @@ -2987,15 +2998,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.3.5" @@ -3016,12 +3018,12 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" +checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" dependencies = [ "getrandom", - "redox_syscall 0.2.16", + "libredox", "thiserror", ] @@ -3160,7 +3162,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" dependencies = [ "bitflags 2.4.1", - "errno 0.3.5", + "errno 0.3.6", "libc", "linux-raw-sys", "windows-sys", @@ -3180,9 +3182,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ "base64", ] @@ -3277,9 +3279,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.190" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91d3c334ca1ee894a2c6f6ad698fe8c435b76d504b13d436f0685d648d6d96f7" +checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" dependencies = [ "serde_derive", ] @@ -3295,13 +3297,13 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.190" +version = "1.0.192" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67c5609f394e5c2bd7fc51efda478004ea80ef42fee983d5c67a65e34f32c0e3" +checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -3415,9 +3417,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.1" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942b4a808e05215192e39f4ab80813e599068285906cc91aa64f923db842bd5a" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "smawk" @@ -3485,7 +3487,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -3529,9 +3531,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.38" +version = "2.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e96b79aaa137db8f61e26363a0c9b47d8b4ec75da28b7d1d614c2303e232408b" +checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" dependencies = [ "proc-macro2", "quote", @@ -3616,7 +3618,7 @@ checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -3677,9 +3679,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.33.0" +version = "1.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f38200e3ef7995e5ef13baec2f432a6da0aa9ac495b2c0e8f3b7eec2c92d653" +checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" dependencies = [ "backtrace", "bytes", @@ -3695,13 +3697,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -3767,14 +3769,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ff9e3abce27ee2c9a37f9ad37238c1bdd4e789c84ba37df76aa4d528f5072cc" +checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.20.7", + "toml_edit 0.21.0", ] [[package]] @@ -3810,6 +3812,19 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_edit" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +dependencies = [ + "indexmap 2.1.0", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + [[package]] name = "tower-service" version = "0.3.2" @@ -3836,7 +3851,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", ] [[package]] @@ -4035,9 +4050,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vergen" -version = "8.2.5" +version = "8.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e7dc29b3c54a2ea67ef4f953d5ec0c4085035c0ae2d325be1c0d2144bd9f16" +checksum = "1290fd64cc4e7d3c9b07d7f333ce0ce0007253e32870e632624835cc80b83939" dependencies = [ "anyhow", "rustc_version", @@ -4117,7 +4132,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", "wasm-bindgen-shared", ] @@ -4151,7 +4166,7 @@ checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" dependencies = [ "proc-macro2", "quote", - "syn 2.0.38", + "syn 2.0.39", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4391,9 +4406,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winnow" -version = "0.5.18" +version = "0.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176b6138793677221d420fd2f0aeeced263f197688b36484660da767bca2fa32" +checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" dependencies = [ "memchr", ] From 8dff97a0a259abdad7f09e3d019557789d3e2e26 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 11 Nov 2023 17:32:43 +1100 Subject: [PATCH 1567/2020] build(deps): bump the deps group with 5 updates (#1482) Bumps the deps group with 5 updates: | Package | From | To | | --- | --- | --- | | [clap](https://github.com/clap-rs/clap) | `4.4.7` | `4.4.8` | | [file-format](https://github.com/mmalecot/file-format) | `0.21.0` | `0.22.0` | | [command-group](https://github.com/watchexec/command-group) | `3.0.0` | `4.1.0` | | [toml_edit](https://github.com/toml-rs/toml) | `0.20.7` | `0.21.0` | | [default-net](https://github.com/shellrow/default-net) | `0.19.0` | `0.20.0` | Updates `clap` from 4.4.7 to 4.4.8 - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.4.7...v4.4.8) Updates `file-format` from 0.21.0 to 0.22.0 - [Release notes](https://github.com/mmalecot/file-format/releases) - [Changelog](https://github.com/mmalecot/file-format/blob/main/CHANGELOG.md) - [Commits](https://github.com/mmalecot/file-format/compare/v0.21.0...v0.22.0) Updates `command-group` from 3.0.0 to 4.1.0 - [Changelog](https://github.com/watchexec/command-group/blob/main/CHANGELOG.md) - [Commits](https://github.com/watchexec/command-group/compare/v3.0.0...v4.1.0) Updates `toml_edit` from 0.20.7 to 0.21.0 - [Commits](https://github.com/toml-rs/toml/compare/v0.20.7...v0.21.0) Updates `default-net` from 0.19.0 to 0.20.0 - [Release notes](https://github.com/shellrow/default-net/releases) - [Commits](https://github.com/shellrow/default-net/compare/v0.19.0...v0.20.0) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: file-format dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: command-group dependency-type: direct:production update-type: version-update:semver-major dependency-group: deps - dependency-name: toml_edit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: default-net dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 37 +++++++++------------------ crates/bin/Cargo.toml | 4 +-- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 7 files changed, 19 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e24dd34d..342194a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -341,7 +341,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror", - "toml_edit 0.20.7", + "toml_edit 0.21.0", "url", ] @@ -367,7 +367,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", - "toml_edit 0.20.7", + "toml_edit 0.21.0", "tracing", "url", ] @@ -584,9 +584,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.7" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac495e00dcec98c83465d5ad66c5c4fabd652fd6686e7c6269b117e729a6f17b" +checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" dependencies = [ "clap_builder", "clap_derive", @@ -594,9 +594,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.7" +version = "4.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77ed9a32a62e6ca27175d00d29d05ca32e396ea1eb5fb01d8256b669cec7663" +checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" dependencies = [ "anstream", "anstyle", @@ -645,9 +645,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "command-group" -version = "3.0.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38f0a774e568e1cce33f12d03f442e87d9e0bc519f877317aa6e536d845d0a24" +checksum = "e389ace313e22a2ac5a0e54f5805616a783077943b001edabbdb8640d52c490e" dependencies = [ "async-trait", "nix", @@ -788,9 +788,9 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "default-net" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "407d4a2744e934ce48e7788c73c2dd0f43abaa2e45d1e1b5e71f273edfdfb8e2" +checksum = "7ba429d84a27fa854c66fd2e29eb1cdf6d38bbfd4495bd9f522f12a7f21e05bf" dependencies = [ "dlopen2", "libc", @@ -994,9 +994,9 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "file-format" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "888c5782fda56d3bfa40339d7fc4e2d57191d42fd2708557d9963f5e5e3e9ca0" +checksum = "7fcb859e047d667f798f913a2cd0d5c214b85944d1191efa8146c98888fc557b" [[package]] name = "filetime" @@ -3799,19 +3799,6 @@ dependencies = [ "winnow", ] -[[package]] -name = "toml_edit" -version = "0.20.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f427fce4d84c72b5b732388bf4a9f4531b53f74e2887e3ecb2481f68f66d81" -dependencies = [ - "indexmap 2.1.0", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - [[package]] name = "toml_edit" version = "0.21.0" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index e66ff137..b3942f90 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,10 +24,10 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.17.1", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.10.0" } -clap = { version = "4.4.3", features = ["derive", "env"] } +clap = { version = "4.4.8", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" -file-format = { version = "0.21.0", default-features = false } +file-format = { version = "0.22.0", default-features = false } home = "0.5.5" log = { version = "0.4.18", features = ["std"] } miette = "5.9.0" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 56800946..029b713d 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -97,7 +97,7 @@ gh-api-client = ["json"] json = ["serde", "serde_json"] [target."cfg(windows)".dependencies] -default-net = { version = "0.19.0", optional = true } +default-net = { version = "0.20.0", optional = true } ipconfig = { version = "0.3.2", optional = true, default-features = false } [package.metadata.docs.rs] diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index d4f60dbb..ef8c8168 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.107" thiserror = "1.0.40" -toml_edit = { version = "0.20.7", features = ["serde"] } +toml_edit = { version = "0.21.0", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index f620d366..2e818bbf 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -34,7 +34,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } -toml_edit = { version = "0.20.7", features = ["serde"] } +toml_edit = { version = "0.21.0", features = ["serde"] } binstalk-downloader = { version = "0.9.3", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } [features] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index ad42ec9a..dbaff255 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -16,7 +16,7 @@ binstalk-fetchers = { version = "0.2.1", path = "../binstalk-fetchers", features binstalk-registry = { version = "0.2.0", path = "../binstalk-registry" } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "2.0.0", path = "../cargo-toml-workspace" } -command-group = { version = "3.0.0", features = ["with-tokio"] } +command-group = { version = "4.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.13", path = "../detect-targets", features = ["tracing"] } either = "1.8.1" diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 74b2c103..9614a426 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" exclude = ["fuzz", "benches"] [dependencies] -clap = { version = "4.4.3", features = ["derive"], optional = true } +clap = { version = "4.4.8", features = ["derive"], optional = true } miette = { version = "5.9.0", default-features = false, optional = true } thiserror = "1.0.38" From 5064e4e18871804bcaeece68cf3d6faec8dfb684 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Nov 2023 17:34:36 +1000 Subject: [PATCH 1568/2020] CI: Cache zig global_cache to speedup build (#1481) * CI: Cache zig global_cache to speedup build This can be helpful in two situations: - If `cc` is bumped to a new release, then all the `*-sys` crates will be rebuilt even if their source doesn't change. Caching zig global_cache would avoid expensive rebuilds. - For target `x86_64h-apple-darwin`, it uses build-std which means the rust cache is quite ineffective (only build-dependencies are cached), so we would also need zig global_cache to avoid rebuilding c dependencies in CI. Signed-off-by: Jiahao XU * Fix missing `shell: bash` Signed-off-by: Jiahao XU * Fix CI: Create symlink to `zig` Signed-off-by: Jiahao XU * CI: Fix getting output from prev step in just-setup Signed-off-by: Jiahao XU * CI: Include job_id `github.job` in zig cache key Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .github/actions/just-setup/action.yml | 41 +++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/.github/actions/just-setup/action.yml b/.github/actions/just-setup/action.yml index 66baed82..12a43633 100644 --- a/.github/actions/just-setup/action.yml +++ b/.github/actions/just-setup/action.yml @@ -19,14 +19,14 @@ runs: using: composite steps: - name: Add just to tools to install - run: echo "tools=just" >>$GITHUB_ENV + run: echo "tools=just" >>"$GITHUB_ENV" shell: bash - name: Add inputs.tools to tools to install if: inputs.tools != '' env: inputs_tools: ${{ inputs.tools }} - run: echo "tools=$tools,$inputs_tools" >>$GITHUB_ENV + run: echo "tools=$tools,$inputs_tools" >>"$GITHUB_ENV" shell: bash - name: Install tools @@ -62,3 +62,40 @@ runs: env-vars: "CARGO CC CFLAGS CXX CMAKE RUST JUST" env: RUSTFLAGS: ${{ steps.retrieve-rustflags.outputs.RUSTFLAGS }} + + - name: Find zig location and create symlink to it in ~/.local/bin + if: env.JUST_USE_CARGO_ZIGBUILD + run: | + python_package_path=$(python3 -m site --user-site) + ln -s "${python_package_path}/ziglang/zig" "$HOME/.local/bin/zig" + shell: bash + + - name: Calculate zig cache key + if: env.JUST_USE_CARGO_ZIGBUILD + run: | + ZIG_VERSION=$(zig version) + SYS_CRATE_HASHSUM=$(cargo tree --all-features --prefix none --no-dedupe --target "$CARGO_BUILD_TARGET" | grep -e '-sys' -e '^ring' | sort -u | sha1sum | sed 's/[ -]*//g') + PREFIX=v0-${JOB_ID}-zig-${ZIG_VERSION}-${CARGO_BUILD_TARGET}- + echo "ZIG_CACHE_KEY=${PREFIX}${SYS_CRATE_HASHSUM}" >> "$GITHUB_ENV" + echo -e "ZIG_CACHE_RESTORE_KEY=$PREFIX" >> "$GITHUB_ENV" + shell: bash + env: + RUSTFLAGS: ${{ steps.retrieve-rustflags.outputs.RUSTFLAGS }} + JOB_ID: ${{ github.job }} + + - name: Get zig global cache dir + if: env.JUST_USE_CARGO_ZIGBUILD + id: zig_global_cache_dir_path + run: | + cache_dir=$(zig env | jq -r '.global_cache_dir') + echo "cache_dir=$cache_dir" >> "$GITHUB_OUTPUT" + shell: bash + + - name: Cache zig compilation + if: env.JUST_USE_CARGO_ZIGBUILD + uses: actions/cache@v3 + with: + path: ${{ steps.zig_global_cache_dir_path.outputs.cache_dir }} + key: ${{ env.ZIG_CACHE_KEY }} + restore-keys: | + ${{ env.ZIG_CACHE_RESTORE_KEY }} From 6e974813f848717cfd04da62df7faf26a0fac2f3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 11 Nov 2023 08:00:28 +0000 Subject: [PATCH 1569/2020] release: cargo-toml-workspace v3.0.0 (#1483) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 342194a0..8cb17239 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -535,7 +535,7 @@ dependencies = [ [[package]] name = "cargo-toml-workspace" -version = "2.0.0" +version = "3.0.0" dependencies = [ "cargo_toml", "compact_str", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 2e818bbf..d9137d7a 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -15,7 +15,7 @@ async-trait = "0.1.68" base16 = "0.2.1" binstalk-downloader = { version = "0.9.3", path = "../binstalk-downloader", default-features = false, features = ["json"] } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } -cargo-toml-workspace = { version = "2.0.0", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "3.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } leon = { version = "2.0.1", path = "../leon" } miette = "5.9.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index dbaff255..84960920 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -15,7 +15,7 @@ binstalk-downloader = { version = "0.9.3", path = "../binstalk-downloader", defa binstalk-fetchers = { version = "0.2.1", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.2.0", path = "../binstalk-registry" } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } -cargo-toml-workspace = { version = "2.0.0", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "3.0.0", path = "../cargo-toml-workspace" } command-group = { version = "4.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.13", path = "../detect-targets", features = ["tracing"] } diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 55ab886a..84e9c2a9 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-toml-workspace" -version = "2.0.0" +version = "3.0.0" edition = "2021" description = "Parse cargo workspace and load specific crate" repository = "https://github.com/cargo-bins/cargo-binstall" From c874f2e0dc634dc86de157cf5d7dae01d3fdf14a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 11 Nov 2023 08:05:41 +0000 Subject: [PATCH 1570/2020] release: binstalk-downloader v0.9.4 (#1485) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8cb17239..b6e85a73 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -267,7 +267,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.9.3" +version = "0.9.4" dependencies = [ "async-compression 0.4.4", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 029b713d..388b1251 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.9.3" +version = "0.9.4" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index a9870af4..7e26c28a 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.9.3", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.9.4", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } @@ -30,7 +30,7 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.9.3", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.9.4", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index d9137d7a..1afe696b 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.9.3", path = "../binstalk-downloader", default-features = false, features = ["json"] } +binstalk-downloader = { version = "0.9.4", path = "../binstalk-downloader", default-features = false, features = ["json"] } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "3.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } @@ -35,7 +35,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.21.0", features = ["serde"] } -binstalk-downloader = { version = "0.9.3", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } +binstalk-downloader = { version = "0.9.4", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } [features] git = ["simple-git"] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 84960920..840b739e 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.9.3", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.9.4", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.2.1", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.2.0", path = "../binstalk-registry" } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } From 86237aa611b2be859489e53074b2a936c4271eee Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 11 Nov 2023 09:50:21 +0000 Subject: [PATCH 1571/2020] release: binstalk-registry v0.3.0 (#1486) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b6e85a73..97cb7079 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -347,7 +347,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.2.0" +version = "0.3.0" dependencies = [ "async-trait", "base16", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 1afe696b..0ccef36f 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.2.0" +version = "0.3.0" edition = "2021" rust-version = "1.65.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 840b739e..bbc621b0 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.9.4", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.2.1", path = "../binstalk-fetchers", features = ["quickinstall"] } -binstalk-registry = { version = "0.2.0", path = "../binstalk-registry" } +binstalk-registry = { version = "0.3.0", path = "../binstalk-registry" } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "3.0.0", path = "../cargo-toml-workspace" } command-group = { version = "4.1.0", features = ["with-tokio"] } From 26b6db2244dce2b044547d8602db66bf26660519 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 11 Nov 2023 21:11:09 +1000 Subject: [PATCH 1572/2020] Fix `release-cli.yml`: Do not dry run cargo-publish (#1487) * Fix `release-cli.yml`: Do not dry run `cargo-publish` If dependencies of `carog-binstall` is bumped, then `cargo-publish` dry run will fail since the dependency has not published yet Signed-off-by: Jiahao XU * Speedup step publish in `release-cli.yml` Use `just-setup` to cache rust/zig compilation, also disable all features to reduce dependencies pulled in. Signed-off-by: Jiahao XU * `release-cli.yml`: Restore rust cache before ephermal-crate.sh is run which writes the key to `Cargo.toml` and invalidates the cache. Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .github/workflows/release-cli.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 4aaf0322..80b94fda 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -82,6 +82,9 @@ jobs: - uses: actions/download-artifact@v3 with: name: minisign.pub + + - uses: ./.github/actions/just-setup + - run: .github/scripts/ephemeral-crate.sh - if: fromJSON(inputs.info).is-release != 'true' @@ -89,10 +92,7 @@ jobs: env: crate: ${{ fromJSON(inputs.info).crate }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - run: | - set -ex - cargo publish -p "$crate" --allow-dirty --dry-run - cargo package --no-verify -p "$crate" --allow-dirty + run: cargo package -p "$crate" --allow-dirty --no-default-features - if: fromJSON(inputs.info).is-release != 'true' name: Upload crate package as artifact uses: actions/upload-artifact@v3 @@ -105,7 +105,7 @@ jobs: env: crate: ${{ fromJSON(inputs.info).crate }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - run: cargo publish -p "$crate" --allow-dirty + run: cargo publish -p "$crate" --allow-dirty --no-default-features - if: fromJSON(inputs.info).is-release == 'true' name: Make release latest From 4599a7083915af16b6e94fc2363c93d379fcbe41 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 12 Nov 2023 00:17:16 +1000 Subject: [PATCH 1573/2020] Fix CI: Dry-run `cargo-publish` on crate to be published (#1490) * Fix CI: Dry-run `cargo-publish` on crate to be published If there's no crate to publish, do not dry-run `cargo-publish`. Only dry-run `cargo-publish` on crate to be published to avoid `cargo-publish` error on `cargo-binstall` when one of its direct dependencies is bumped. Signed-off-by: Jiahao XU * Fix passing of crate to `release-cli.yml` Signed-off-by: Jiahao XU * Fix passing of `needs.pr-info.outpus.crate` Signed-off-by: Jiahao XU * Fix `release-dry-run`: Only run if is release or is not PR event Signed-off-by: Jiahao XU * Fix passing of crate Signed-off-by: Jiahao XU * Rm `just-setup` from `release-cli.yml` since it cannot be cached release is trigged by the closing of PR, so the cache is saved under the branch `release/*` which cannot be reused. Signed-off-by: Jiahao XU * Fix dry-run publish Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 19 +++++++++++++++++-- .github/workflows/release-cli.yml | 8 +++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 05366c3c..48012559 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,15 +123,30 @@ jobs: - run: just avoid-dev-deps - run: just lint + pr-info: + outputs: + is-release: ${{ steps.meta.outputs.is-release }} + crate: ${{ steps.meta.outputs.crates-names }} + + runs-on: ubuntu-latest + steps: + - id: meta + if: github.event_name == 'pull_request' + uses: cargo-bins/release-meta@v1 + with: + event-data: ${{ toJSON(github.event) }} + extract-notes-under: '### Release notes' + release-dry-run: + needs: pr-info uses: ./.github/workflows/release-cli.yml - if: github.event_name != 'pull_request' + if: github.event_name != 'pull_request' || needs.pr-info.outputs.is-release == 'true' secrets: inherit with: info: | { "is-release": false, - "crate": "cargo-binstall", + "crate": "${{ needs.pr-info.outputs.crate }}", "version": "0.0.0", "notes": "" } diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 80b94fda..677fb6ce 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -83,17 +83,15 @@ jobs: with: name: minisign.pub - - uses: ./.github/actions/just-setup - - run: .github/scripts/ephemeral-crate.sh - - if: fromJSON(inputs.info).is-release != 'true' + - if: fromJSON(inputs.info).is-release != 'true' && fromJSON(inputs.info).crate != '' name: DRY-RUN Publish to crates.io env: crate: ${{ fromJSON(inputs.info).crate }} CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - run: cargo package -p "$crate" --allow-dirty --no-default-features - - if: fromJSON(inputs.info).is-release != 'true' + run: cargo publish --dry-run -p "$crate" --allow-dirty --no-default-features + - if: fromJSON(inputs.info).is-release != 'true' && fromJSON(inputs.info).crate != '' name: Upload crate package as artifact uses: actions/upload-artifact@v3 with: From 122e64ab25d4007899cdb326487d24a8c5547b9e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 12 Nov 2023 04:53:10 +1000 Subject: [PATCH 1574/2020] release: binstalk-manifests v0.11.0 (#1484) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 97cb7079..20803b41 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -326,7 +326,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.10.0" +version = "0.11.0" dependencies = [ "beef", "binstalk-types", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index b3942f90..19e3979f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.17.1", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.10.0" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.11.0" } clap = { version = "4.4.8", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index ef8c8168..4abebe70 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.10.0" +version = "0.11.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From 5b8608d3676275653fe8add791b2968940147280 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 11 Nov 2023 23:36:51 +0000 Subject: [PATCH 1575/2020] release: binstalk v0.18.0 (#1493) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 20803b41..36ae77de 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -223,7 +223,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.17.1" +version = "0.18.0" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 19e3979f..0e1d8344 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.17.1", default-features = false } +binstalk = { path = "../binstalk", version = "0.18.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.11.0" } clap = { version = "4.4.8", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index bbc621b0..a251ade1 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.17.1" +version = "0.18.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From d345b2c14ba37c419e5d045bed00d9f0c31a1f35 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 12 Nov 2023 23:59:27 +1300 Subject: [PATCH 1576/2020] release: cargo-binstall v1.4.5 (#1492) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 36ae77de..52194c33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -506,7 +506,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.4.4" +version = "1.4.5" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 0e1d8344..f6d81b9e 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.4.4" +version = "1.4.5" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 7282110d..f2dbc0ca 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 9d8dc94d8d23c3ad54f8a69dee8478c63e0c8836 Mon Sep 17 00:00:00 2001 From: Yuri Astrakhan Date: Mon, 13 Nov 2023 22:03:31 -0500 Subject: [PATCH 1577/2020] Fix badge (#1494) It was pointing to an non-existent CI job, changed it to CI workflow. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 52db9ecb..d03300b9 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ To support `binstall` maintainers must add configuration values to `Cargo.toml` ## Status -![Build](https://github.com/cargo-bins/cargo-binstall/workflows/Rust/badge.svg) +[![CI build](https://github.com/cargo-bins/cargo-binstall/actions/workflows/ci.yml/badge.svg)](https://github.com/cargo-bins/cargo-binstall/actions) [![GitHub tag](https://img.shields.io/github/tag/cargo-bins/cargo-binstall.svg)](https://github.com/cargo-bins/cargo-binstall) [![Crates.io](https://img.shields.io/crates/v/cargo-binstall.svg)](https://crates.io/crates/cargo-binstall) From 645579430a6d6c176d45ee26b857291b0724cd69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dawid=20Ci=C4=99=C5=BCarkiewicz?= Date: Thu, 16 Nov 2023 14:35:08 -0800 Subject: [PATCH 1578/2020] feat(fs-lock): new_try_exclusive and new_try_shared (#1496) In certain situations it's useful to attempt to lock the file. --- crates/fs-lock/src/lib.rs | 56 +++++++++++++++++++++++++++++++-------- 1 file changed, 45 insertions(+), 11 deletions(-) diff --git a/crates/fs-lock/src/lib.rs b/crates/fs-lock/src/lib.rs index 9adb4927..af209ff5 100644 --- a/crates/fs-lock/src/lib.rs +++ b/crates/fs-lock/src/lib.rs @@ -4,7 +4,7 @@ use std::{ fs::File, - io::{self, IoSlice, IoSliceMut, Result, SeekFrom}, + io::{self, IoSlice, IoSliceMut, SeekFrom}, ops, }; @@ -18,20 +18,54 @@ impl FileLock { /// Take an exclusive lock on a [`File`]. /// /// Note that this operation is blocking, and should not be called in async contexts. - pub fn new_exclusive(file: File) -> Result { + pub fn new_exclusive(file: File) -> io::Result { file.lock_exclusive()?; Ok(Self(file)) } + /// Try to take an exclusive lock on a [`File`]. + /// + /// On success returns [`Self`]. On error the original [`File`] and optionally + /// an [`io::Error`] if the the failure was caused by anything other than + /// the lock being taken already. + /// + /// Note that this operation is blocking, and should not be called in async contexts. + pub fn new_try_exclusive(file: File) -> Result)> { + match file.try_lock_exclusive() { + Ok(()) => Ok(Self(file)), + Err(e) if e.raw_os_error() == fs4::lock_contended_error().raw_os_error() => { + Err((file, None)) + } + Err(e) => Err((file, Some(e))), + } + } + /// Take a shared lock on a [`File`]. /// /// Note that this operation is blocking, and should not be called in async contexts. - pub fn new_shared(file: File) -> Result { + pub fn new_shared(file: File) -> io::Result { file.lock_shared()?; Ok(Self(file)) } + + /// Try to take a shared lock on a [`File`]. + /// + /// On success returns [`Self`]. On error the original [`File`] and optionally + /// an [`io::Error`] if the the failure was caused by anything other than + /// the lock being taken already. + /// + /// Note that this operation is blocking, and should not be called in async contexts. + pub fn new_try_shared(file: File) -> Result)> { + match file.try_lock_shared() { + Ok(()) => Ok(Self(file)), + Err(e) if e.raw_os_error() == fs4::lock_contended_error().raw_os_error() => { + Err((file, None)) + } + Err(e) => Err((file, Some(e))), + } + } } impl Drop for FileLock { @@ -54,37 +88,37 @@ impl ops::DerefMut for FileLock { } impl io::Write for FileLock { - fn write(&mut self, buf: &[u8]) -> Result { + fn write(&mut self, buf: &[u8]) -> io::Result { self.0.write(buf) } - fn flush(&mut self) -> Result<()> { + fn flush(&mut self) -> io::Result<()> { self.0.flush() } - fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> Result { + fn write_vectored(&mut self, bufs: &[IoSlice<'_>]) -> io::Result { self.0.write_vectored(bufs) } } impl io::Read for FileLock { - fn read(&mut self, buf: &mut [u8]) -> Result { + fn read(&mut self, buf: &mut [u8]) -> io::Result { self.0.read(buf) } - fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result { + fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> io::Result { self.0.read_vectored(bufs) } } impl io::Seek for FileLock { - fn seek(&mut self, pos: SeekFrom) -> Result { + fn seek(&mut self, pos: SeekFrom) -> io::Result { self.0.seek(pos) } - fn rewind(&mut self) -> Result<()> { + fn rewind(&mut self) -> io::Result<()> { self.0.rewind() } - fn stream_position(&mut self) -> Result { + fn stream_position(&mut self) -> io::Result { self.0.stream_position() } } From aabe107726e4afae0bc10cb8cfb0ae98dd8746d3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 17 Nov 2023 11:01:45 +1000 Subject: [PATCH 1579/2020] release: fs-lock v0.1.2 (#1497) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/fs-lock/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 52194c33..389c5a99 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1053,7 +1053,7 @@ dependencies = [ [[package]] name = "fs-lock" -version = "0.1.1" +version = "0.1.2" dependencies = [ "fs4", ] diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 4abebe70..6ff4c5e8 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" beef = { version = "0.5.2", features = ["impl_serde"] } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } -fs-lock = { version = "0.1.1", path = "../fs-lock" } +fs-lock = { version = "0.1.2", path = "../fs-lock" } home = "0.5.5" miette = "5.9.0" semver = { version = "1.0.17", features = ["serde"] } diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 57368b18..660ad260 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -3,7 +3,7 @@ name = "fs-lock" description = "Locked files that can be used like normal File" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/fs-lock" -version = "0.1.1" +version = "0.1.2" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From 0a5be723226a35c73ea9bd45569120ba96e7b538 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 17 Nov 2023 05:33:38 +0000 Subject: [PATCH 1580/2020] dep: Upgrade transitive dependencies (#1498) Co-authored-by: github-actions --- Cargo.lock | 217 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 143 insertions(+), 74 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 389c5a99..8e27f130 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -67,7 +67,7 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" dependencies = [ - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -77,7 +77,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" dependencies = [ "anstyle", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -117,9 +117,9 @@ dependencies = [ [[package]] name = "async-compression" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f658e2baef915ba0f26f1f7c42bfb8e12f532a01f449a090ded75ae7a07e9ba2" +checksum = "bc2d0cfb2a7388d34f590e76686704c494ed7aaceed62ee1ba35cbf363abc2a5" dependencies = [ "brotli", "bzip2", @@ -269,7 +269,7 @@ dependencies = [ name = "binstalk-downloader" version = "0.9.4" dependencies = [ - "async-compression 0.4.4", + "async-compression 0.4.5", "async-trait", "async_zip", "binstalk-types", @@ -833,7 +833,7 @@ dependencies = [ "tracing", "tracing-subscriber", "windows-dll", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -871,7 +871,7 @@ dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -950,12 +950,12 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c18ee0ed65a5f1f81cac6b1d213b69c35fa47d4252ad41f1486dbd8226fe36e" +checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1007,7 +1007,7 @@ dependencies = [ "cfg-if", "libc", "redox_syscall 0.3.5", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1065,7 +1065,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29f9df8a11882c4e3335eb2d18a0137c505d9ca927470b0cac9c6f0ae07d28f7" dependencies = [ "rustix", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -1481,7 +1481,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "409268480841ad008e81c17ca5a293393fbf9f2b6c2f85b8ab9de1f0c5176a16" dependencies = [ "gix-hash", - "hashbrown 0.14.2", + "hashbrown", "parking_lot", ] @@ -1947,9 +1947,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.21" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91fc23aa11be92976ef4729127f1a74adf36d8436f7816b185d18df956790833" +checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" dependencies = [ "bytes", "fnv", @@ -1957,7 +1957,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 1.9.3", + "indexmap", "slab", "tokio", "tokio-util", @@ -1992,12 +1992,6 @@ dependencies = [ "tokio-util", ] -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - [[package]] name = "hashbrown" version = "0.14.2" @@ -2082,7 +2076,7 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" dependencies = [ - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -2098,9 +2092,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" +checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" dependencies = [ "bytes", "fnv", @@ -2197,16 +2191,6 @@ dependencies = [ "unicode-normalization", ] -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - [[package]] name = "indexmap" version = "2.1.0" @@ -2214,7 +2198,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" dependencies = [ "equivalent", - "hashbrown 0.14.2", + "hashbrown", ] [[package]] @@ -2244,7 +2228,7 @@ checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ "socket2 0.5.5", "widestring", - "windows-sys", + "windows-sys 0.48.0", "winreg 0.50.0", ] @@ -2262,7 +2246,7 @@ checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" dependencies = [ "hermit-abi", "rustix", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -2297,16 +2281,16 @@ dependencies = [ [[package]] name = "jobslot" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3fd5952a22a0b3abdece9834533f35c4cd02ce72d00eef5fc21a432aadfcaa9" +checksum = "69d354a626ad589ae49ba37a6c8c782e615813516f86eba9da15a390b1363b01" dependencies = [ "cfg-if", "getrandom", "libc", "scopeguard", "tokio", - "windows-sys", + "windows-sys 0.52.0", ] [[package]] @@ -2573,7 +2557,7 @@ checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" dependencies = [ "libc", "wasi", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -2792,7 +2776,7 @@ dependencies = [ "libc", "redox_syscall 0.4.1", "smallvec", - "windows-targets", + "windows-targets 0.48.5", ] [[package]] @@ -2936,7 +2920,7 @@ dependencies = [ "libc", "socket2 0.5.5", "tracing", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -3029,13 +3013,13 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f97f7665e51f23760e9e4949d454a4782c76ef954acaeec9d1b0f48a58e4529e" +checksum = "248fbed6f59e99c8ef6c6ecadc9b09c6e93713b8f921d73e41d6ed6017bf0624" dependencies = [ "cfg-if", "rustix", - "windows 0.51.1", + "windows 0.52.0", ] [[package]] @@ -3050,7 +3034,7 @@ version = "0.11.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" dependencies = [ - "async-compression 0.4.4", + "async-compression 0.4.5", "base64", "bytes", "encoding_rs", @@ -3131,7 +3115,7 @@ dependencies = [ "libc", "spin 0.9.8", "untrusted 0.9.0", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -3157,22 +3141,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.21" +version = "0.38.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b426b0506e5d50a7d8dafcf2e81471400deb602392c7dd110815afb4eaf02a3" +checksum = "9ad981d6c340a49cdc40a1028d9c6084ec7e9fa33fcb839cab656a267071e234" dependencies = [ "bitflags 2.4.1", - "errno 0.3.6", + "errno 0.3.7", "libc", "linux-raw-sys", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] name = "rustls" -version = "0.21.8" +version = "0.21.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" +checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" dependencies = [ "log", "ring 0.17.5", @@ -3226,7 +3210,7 @@ version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -3444,7 +3428,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -3577,7 +3561,7 @@ dependencies = [ "fastrand 2.0.1", "redox_syscall 0.4.1", "rustix", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -3692,7 +3676,7 @@ dependencies = [ "signal-hook-registry", "socket2 0.5.5", "tokio-macros", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -3794,7 +3778,7 @@ version = "0.19.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ - "indexmap 2.1.0", + "indexmap", "toml_datetime", "winnow", ] @@ -3805,7 +3789,7 @@ version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" dependencies = [ - "indexmap 2.1.0", + "indexmap", "serde", "serde_spanned", "toml_datetime", @@ -3874,9 +3858,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "nu-ansi-term", "serde", @@ -3962,9 +3946,9 @@ checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" [[package]] name = "unicode-bom" -version = "2.0.2" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98e90c70c9f0d4d1ee6d0a7d04aa06cb9bbd53d8cfbdd62a0269a7c2eb640552" +checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" [[package]] name = "unicode-ident" @@ -4249,7 +4233,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", ] [[package]] @@ -4258,8 +4242,18 @@ version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows-core", - "windows-targets", + "windows-core 0.51.1", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core 0.52.0", + "windows-targets 0.52.0", ] [[package]] @@ -4268,7 +4262,16 @@ version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.0", ] [[package]] @@ -4301,7 +4304,16 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets 0.52.0", ] [[package]] @@ -4310,21 +4322,42 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm", + "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", + "windows_x86_64_gnullvm 0.48.5", "windows_x86_64_msvc 0.48.5", ] +[[package]] +name = "windows-targets" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +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" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" + [[package]] name = "windows_aarch64_msvc" version = "0.35.0" @@ -4337,6 +4370,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" + [[package]] name = "windows_i686_gnu" version = "0.35.0" @@ -4349,6 +4388,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +[[package]] +name = "windows_i686_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" + [[package]] name = "windows_i686_msvc" version = "0.35.0" @@ -4361,6 +4406,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +[[package]] +name = "windows_i686_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" + [[package]] name = "windows_x86_64_gnu" version = "0.35.0" @@ -4373,12 +4424,24 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" + [[package]] name = "windows_x86_64_msvc" version = "0.35.0" @@ -4391,6 +4454,12 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" + [[package]] name = "winnow" version = "0.5.19" @@ -4407,7 +4476,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "524e57b2c537c0f9b1e69f1965311ec12182b4122e45035b1508cd24d2adadb1" dependencies = [ "cfg-if", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] @@ -4417,7 +4486,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "937f3df7948156640f46aacef17a70db0de5917bda9c92b0f751f3a955b588fc" dependencies = [ "cfg-if", - "windows-sys", + "windows-sys 0.48.0", ] [[package]] From a62f22050b4816fd3b1a474d52825a3526fe5ffc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 18 Nov 2023 03:04:12 +0000 Subject: [PATCH 1581/2020] build(deps): bump the deps group with 4 updates (#1502) Bumps the deps group with 4 updates: [windows](https://github.com/microsoft/windows-rs), [itertools](https://github.com/rust-itertools/itertools), [default-net](https://github.com/shellrow/default-net) and [windows-sys](https://github.com/microsoft/windows-rs). Updates `windows` from 0.51.1 to 0.52.0 - [Release notes](https://github.com/microsoft/windows-rs/releases) - [Commits](https://github.com/microsoft/windows-rs/compare/0.51.1...0.52.0) Updates `itertools` from 0.11.0 to 0.12.0 - [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-itertools/itertools/compare/v0.11.0...v0.12.0) Updates `default-net` from 0.20.0 to 0.21.0 - [Release notes](https://github.com/shellrow/default-net/releases) - [Commits](https://github.com/shellrow/default-net/compare/v0.20.0...v0.21.0) Updates `windows-sys` from 0.48.0 to 0.52.0 - [Release notes](https://github.com/microsoft/windows-rs/releases) - [Commits](https://github.com/microsoft/windows-rs/compare/0.48.0...0.52.0) --- updated-dependencies: - dependency-name: windows dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: itertools dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: default-net dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: windows-sys dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 33 ++++++--------------------- crates/atomic-file-install/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 2 +- 6 files changed, 12 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8e27f130..e3118985 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -167,7 +167,7 @@ dependencies = [ "reflink-copy", "tempfile", "tracing", - "windows 0.51.1", + "windows 0.52.0", ] [[package]] @@ -788,9 +788,9 @@ checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" [[package]] name = "default-net" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba429d84a27fa854c66fd2e29eb1cdf6d38bbfd4495bd9f522f12a7f21e05bf" +checksum = "85dc7576d8346d3c86ad64dc64d26d0f6c970ba4795b850f15ee94467d8e53eb" dependencies = [ "dlopen2", "libc", @@ -833,7 +833,7 @@ dependencies = [ "tracing", "tracing-subscriber", "windows-dll", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2257,9 +2257,9 @@ checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" [[package]] name = "itertools" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" dependencies = [ "either", ] @@ -4236,35 +4236,16 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows" -version = "0.51.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" -dependencies = [ - "windows-core 0.51.1", - "windows-targets 0.48.5", -] - [[package]] name = "windows" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-core 0.52.0", + "windows-core", "windows-targets 0.52.0", ] -[[package]] -name = "windows-core" -version = "0.51.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-core" version = "0.52.0" diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index 74f9d7fe..98cdf302 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -15,4 +15,4 @@ tempfile = "3.5.0" tracing = "0.1.39" [target.'cfg(windows)'.dependencies] -windows = { version = "0.51.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } +windows = { version = "0.52.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 388b1251..77907297 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -97,7 +97,7 @@ gh-api-client = ["json"] json = ["serde", "serde_json"] [target."cfg(windows)".dependencies] -default-net = { version = "0.20.0", optional = true } +default-net = { version = "0.21.0", optional = true } ipconfig = { version = "0.3.2", optional = true, default-features = false } [package.metadata.docs.rs] diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 7e26c28a..f099c388 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -17,7 +17,7 @@ binstalk-types = { version = "0.6.1", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } either = "1.8.1" -itertools = "0.11.0" +itertools = "0.12.0" leon = { version = "2.0.1", path = "../leon" } leon-macros = { version = "1.0.0", path = "../leon-macros" } miette = "5.9.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index a251ade1..50d663d5 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -20,7 +20,7 @@ command-group = { version = "4.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.13", path = "../detect-targets", features = ["tracing"] } either = "1.8.1" -itertools = "0.11.0" +itertools = "0.12.0" jobslot = { version = "0.2.11", features = ["tokio"] } leon = { version = "2.0.1", path = "../leon" } maybe-owned = "0.3.4" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 3b1bee63..799a96e3 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -21,7 +21,7 @@ tracing = ["dep:tracing"] cli-logging = ["tracing", "dep:tracing-subscriber"] [target.'cfg(target_os = "windows")'.dependencies] -windows-sys = { version = "0.48.0", features = ["Win32_System_Threading", "Win32_System_SystemInformation", "Win32_Foundation"] } +windows-sys = { version = "0.52.0", features = ["Win32_System_Threading", "Win32_System_SystemInformation", "Win32_Foundation"] } windows-dll = { version = "0.4.1", features = ["windows"], default-features = false } [dev-dependencies] From cbabc33ccf1c3b0259d4bbe839b221327108399b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 18 Nov 2023 04:37:08 +0000 Subject: [PATCH 1582/2020] release: atomic-file-install v1.0.1 (#1503) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/atomic-file-install/Cargo.toml | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e3118985..27da910c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -162,7 +162,7 @@ dependencies = [ [[package]] name = "atomic-file-install" -version = "1.0.0" +version = "1.0.1" dependencies = [ "reflink-copy", "tempfile", diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index 98cdf302..baad0d24 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "atomic-file-install" -version = "1.0.0" +version = "1.0.1" edition = "2021" description = "For atomically installing a file or a symlink." repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 05fd51be..a8ed8209 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -11,7 +11,7 @@ authors = ["Jiahao XU "] license = "GPL-3.0-only" [dependencies] -atomic-file-install = { version = "1.0.0", path = "../atomic-file-install" } +atomic-file-install = { version = "1.0.1", path = "../atomic-file-install" } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } leon = { version = "2.0.1", path = "../leon" } From 7dfb617c95cb047fe6c7dba3199a367cfafca5de Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 18 Nov 2023 04:50:46 +0000 Subject: [PATCH 1583/2020] release: binstalk-downloader v0.9.5 (#1505) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 27da910c..a7918c4a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -267,7 +267,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.9.4" +version = "0.9.5" dependencies = [ "async-compression 0.4.5", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 77907297..2601c47c 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.9.4" +version = "0.9.5" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index f099c388..ae529aa9 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.9.4", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.9.5", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } @@ -30,7 +30,7 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.9.4", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.9.5", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 0ccef36f..4e958633 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.9.4", path = "../binstalk-downloader", default-features = false, features = ["json"] } +binstalk-downloader = { version = "0.9.5", path = "../binstalk-downloader", default-features = false, features = ["json"] } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "3.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } @@ -35,7 +35,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.21.0", features = ["serde"] } -binstalk-downloader = { version = "0.9.4", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } +binstalk-downloader = { version = "0.9.5", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } [features] git = ["simple-git"] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 50d663d5..b3d111d2 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.9.4", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.9.5", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.2.1", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.3.0", path = "../binstalk-registry" } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } From 47d573fd2dca32aa8e4edf265a4d0f01ec946940 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 18 Nov 2023 16:20:55 +1100 Subject: [PATCH 1584/2020] release: detect-targets v0.1.14 (#1504) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a7918c4a..a10ec9fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -825,7 +825,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.13" +version = "0.1.14" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 6ff4c5e8..87d298bb 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -25,5 +25,5 @@ toml_edit = { version = "0.21.0", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.13", path = "../detect-targets" } +detect-targets = { version = "0.1.14", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index b3d111d2..b42d6e7e 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -18,7 +18,7 @@ binstalk-types = { version = "0.6.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "3.0.0", path = "../cargo-toml-workspace" } command-group = { version = "4.1.0", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } -detect-targets = { version = "0.1.13", path = "../detect-targets", features = ["tracing"] } +detect-targets = { version = "0.1.14", path = "../detect-targets", features = ["tracing"] } either = "1.8.1" itertools = "0.12.0" jobslot = { version = "0.2.11", features = ["tokio"] } diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 799a96e3..6bec9e94 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.13" +version = "0.1.14" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From 7e6223a8e20c0dcaeb48085981f5a00a97c3612f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 18 Nov 2023 05:53:27 +0000 Subject: [PATCH 1585/2020] release: binstalk-fetchers v0.2.2 (#1506) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a10ec9fa..5c86b140 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -303,7 +303,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.2.1" +version = "0.2.2" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index ae529aa9..c8fdde6b 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.2.1" +version = "0.2.2" edition = "2021" description = "The binstall fetchers" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index b42d6e7e..cc3e4002 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.9.5", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } -binstalk-fetchers = { version = "0.2.1", path = "../binstalk-fetchers", features = ["quickinstall"] } +binstalk-fetchers = { version = "0.2.2", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.3.0", path = "../binstalk-registry" } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "3.0.0", path = "../cargo-toml-workspace" } From 3738f11f30417cf550eaab1ceaf7b283cd255821 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 18 Nov 2023 06:41:26 +0000 Subject: [PATCH 1586/2020] release: binstalk v0.18.1 (#1507) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5c86b140..c1e5a914 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -223,7 +223,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.18.0" +version = "0.18.1" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index f6d81b9e..ca9bcffe 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.18.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.18.1", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.11.0" } clap = { version = "4.4.8", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index cc3e4002..67c28daa 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.18.0" +version = "0.18.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From 05f90e651dd151df76e1b5c050cfb117ff47cbb6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 18 Nov 2023 21:57:12 +1100 Subject: [PATCH 1587/2020] release: cargo-binstall v1.4.6 (#1508) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c1e5a914..72360842 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -506,7 +506,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.4.5" +version = "1.4.6" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index ca9bcffe..478bf810 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.4.5" +version = "1.4.6" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index f2dbc0ca..c8428bb4 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 469fc1783e5caa1b1e1f7e4af57c4ad49834e497 Mon Sep 17 00:00:00 2001 From: Christopher Durham Date: Mon, 20 Nov 2023 02:22:38 -0500 Subject: [PATCH 1588/2020] Use $Env:CARGO_HOME in ps1 install script (#1509) --- install-from-binstall-release.ps1 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install-from-binstall-release.ps1 b/install-from-binstall-release.ps1 index 73bc3564..b6c60f13 100644 --- a/install-from-binstall-release.ps1 +++ b/install-from-binstall-release.ps1 @@ -18,8 +18,9 @@ Write-Host "" Invoke-Expression "$tmpdir\cargo-binstall\cargo-binstall.exe -y --force cargo-binstall" Remove-Item -Force $tmpdir\cargo-binstall.zip Remove-Item -Recurse -Force $tmpdir\cargo-binstall -if ($Env:Path -split ";" -notcontains "$HOME\.cargo\bin") { +$cargo_home = if ($Env:CARGO_HOME -ne $null) { $Env:CARGO_HOME } else { "$HOME\.cargo" } +if ($Env:Path -split ";" -notcontains "$cargo_home\bin") { Write-Host "" - Write-Host "Your path is missing $HOME\.cargo\bin, you might want to add it." -ForegroundColor Red + Write-Host "Your path is missing $cargo_home\bin, you might want to add it." -ForegroundColor Red Write-Host "" } From 1882dfabe4ecac57efd664b5c43cb49f008dba51 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Nov 2023 04:35:49 +0000 Subject: [PATCH 1589/2020] dep: Upgrade transitive dependencies (#1510) Co-authored-by: github-actions --- Cargo.lock | 60 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 72360842..966eef1e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -549,9 +549,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.17.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ca592ad99e6a0fd4b95153406138b997cc26ccd3cd0aecdfd4fbdbf1519bd77" +checksum = "4d1ece59890e746567b467253aea0adbe8a21784d0b025d8a306f66c391c2957" dependencies = [ "serde", "toml", @@ -782,9 +782,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "default-net" @@ -1044,9 +1044,9 @@ checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] name = "form_urlencoded" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" +checksum = "e13624c2627564efccf4934284bdd98cbaa14e79b0b5a141218e507b3a823456" dependencies = [ "percent-encoding", ] @@ -2028,7 +2028,7 @@ dependencies = [ "h3", "h3-quinn", "http", - "idna", + "idna 0.4.0", "ipnet", "native-tls", "once_cell", @@ -2191,6 +2191,16 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +dependencies = [ + "unicode-bidi", + "unicode-normalization", +] + [[package]] name = "indexmap" version = "2.1.0" @@ -2696,9 +2706,9 @@ checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "openssl" -version = "0.10.59" +version = "0.10.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a257ad03cd8fb16ad4172fedf8094451e1af1c4b70097636ef2eac9a5f0cc33" +checksum = "79a4c6c3a2b158f7f8f2a2fc5a969fa3a068df6fc9dbb4a43845436e3af7c800" dependencies = [ "bitflags 2.4.1", "cfg-if", @@ -2728,9 +2738,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.95" +version = "0.9.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40a4130519a360279579c2053038317e40eff64d13fd3f004f9e1b72b8a6aaf9" +checksum = "3812c071ba60da8b5677cc12bcb1d42989a65553772897a7e0355545a819838f" dependencies = [ "cc", "libc", @@ -2787,9 +2797,9 @@ checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" [[package]] name = "percent-encoding" -version = "2.3.0" +version = "2.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" +checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" @@ -3141,9 +3151,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.24" +version = "0.38.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ad981d6c340a49cdc40a1028d9c6084ec7e9fa33fcb839cab656a267071e234" +checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" dependencies = [ "bitflags 2.4.1", "errno 0.3.7", @@ -3263,9 +3273,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.192" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bca2a08484b285dcb282d0f67b26cadc0df8b19f8c12502c13d966bf9482f001" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] @@ -3281,9 +3291,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.192" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6c7207fbec9faa48073f3e3074cbe553af6ea512d7c21ba46e434e70ea9fbc1" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", @@ -3884,7 +3894,7 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "idna", + "idna 0.4.0", "ipnet", "once_cell", "rand", @@ -3991,12 +4001,12 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5" +checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" dependencies = [ "form_urlencoded", - "idna", + "idna 0.5.0", "percent-encoding", "serde", ] @@ -4173,9 +4183,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.2" +version = "0.25.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14247bb57be4f377dfb94c72830b8ce8fc6beac03cf4bf7b9732eadd414123fc" +checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" [[package]] name = "widestring" From c177fd2101b74695b528a3422f30c338340eab77 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 25 Nov 2023 14:00:15 +1000 Subject: [PATCH 1590/2020] build(deps): bump the deps group with 1 update (#1511) Bumps the deps group with 1 update: [command-group](https://github.com/watchexec/command-group). - [Changelog](https://github.com/watchexec/command-group/blob/main/CHANGELOG.md) - [Commits](https://github.com/watchexec/command-group/compare/v4.1.0...v5.0.1) --- updated-dependencies: - dependency-name: command-group dependency-type: direct:production update-type: version-update:semver-major dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 966eef1e..3ee981a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -645,9 +645,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "command-group" -version = "4.1.0" +version = "5.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e389ace313e22a2ac5a0e54f5805616a783077943b001edabbdb8640d52c490e" +checksum = "a68fa787550392a9d58f44c21a3022cfb3ea3e2458b7f85d3b399d0ceeccf409" dependencies = [ "async-trait", "nix", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 67c28daa..85cc5a41 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -16,7 +16,7 @@ binstalk-fetchers = { version = "0.2.2", path = "../binstalk-fetchers", features binstalk-registry = { version = "0.3.0", path = "../binstalk-registry" } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "3.0.0", path = "../cargo-toml-workspace" } -command-group = { version = "4.1.0", features = ["with-tokio"] } +command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.14", path = "../detect-targets", features = ["tracing"] } either = "1.8.1" From 0717044540e2fa9aff4ff3358d210eab0b5ecce2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 1 Dec 2023 08:04:25 +0000 Subject: [PATCH 1591/2020] dep: Upgrade transitive dependencies (#1513) Co-authored-by: github-actions --- Cargo.lock | 88 +++++++++++++++++++++++++++--------------------------- 1 file changed, 44 insertions(+), 44 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3ee981a2..fa6a2138 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -584,9 +584,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.8" +version = "4.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2275f18819641850fa26c89acc84d465c1bf91ce57bc2748b28c420473352f64" +checksum = "41fffed7514f420abec6d183b1d3acfd9099c79c3a10a06ade4f8203f1411272" dependencies = [ "clap_builder", "clap_derive", @@ -594,9 +594,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.8" +version = "4.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07cdf1b148b25c1e1f7a42225e30a0d99a615cd4637eae7365548dd4529b95bc" +checksum = "63361bae7eef3771745f02d8d892bec2fee5f6e34af316ba556e7f97a7069ff1" dependencies = [ "anstream", "anstyle", @@ -671,9 +671,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -681,9 +681,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" @@ -950,12 +950,12 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f258a7194e7f7c2a7837a8913aeab7fd8c383457034fa20ce4dd3dcb813e8eb8" +checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1180,9 +1180,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8d784f27acf97159b40fc4db5ecd8aa23b9ad5ef69cdd136d3bc80665f0c0" +checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gix" @@ -1994,9 +1994,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" [[package]] name = "heck" @@ -2305,9 +2305,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54c0c35952f67de54bb584e9fd912b3023117cbafc0a77d8f3dee1fb5f572fe8" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] @@ -2401,9 +2401,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" +checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" [[package]] name = "lock_api" @@ -2863,9 +2863,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.69" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "134c189feb4956b20f6f547d2cf727d4c0fe06722b20a0eec87ed445a97f92da" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ "unicode-ident", ] @@ -3116,9 +3116,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.5" +version = "0.17.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" +checksum = "684d5e6e18f669ccebf64a92236bb7db9a34f07be010e3627368182027180866" dependencies = [ "cc", "getrandom", @@ -3151,15 +3151,15 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.25" +version = "0.38.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc99bc2d4f1fed22595588a013687477aedf3cdcfb26558c559edb67b4d9b22e" +checksum = "9470c4bf8246c8daf25f9598dca807fb6510347b1e1cfa55749113850c79d88a" dependencies = [ "bitflags 2.4.1", - "errno 0.3.7", + "errno 0.3.8", "libc", "linux-raw-sys", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3169,7 +3169,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" dependencies = [ "log", - "ring 0.17.5", + "ring 0.17.6", "rustls-webpki", "sct", ] @@ -3189,7 +3189,7 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.5", + "ring 0.17.6", "untrusted 0.9.0", ] @@ -3235,7 +3235,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.5", + "ring 0.17.6", "untrusted 0.9.0", ] @@ -4094,9 +4094,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7daec296f25a1bae309c0cd5c29c4b260e510e6d813c286b19eaadf409d40fce" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4104,9 +4104,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e397f4664c0e4e428e8313a469aaa58310d302159845980fd23b0f22a847f217" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", @@ -4119,9 +4119,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9afec9963e3d0994cac82455b2b3502b81a7f40f9a0d32181f7528d9f4b43e02" +checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" dependencies = [ "cfg-if", "js-sys", @@ -4131,9 +4131,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5961017b3b08ad5f3fe39f1e79877f8ee7c23c5e5fd5eb80de95abc41f1f16b2" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4141,9 +4141,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5353b8dab669f5e10f5bd76df26a9360c748f054f862ff5f3f8aae0c7fb3907" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", @@ -4154,9 +4154,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.88" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d046c5d029ba91a1ed14da14dca44b68bf2f124cfbaf741c54151fdb3e0750b" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "wasm-streams" @@ -4173,9 +4173,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db499c5f66323272151db0e666cd34f78617522fb0c1604d31a27c50c206a85" +checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" dependencies = [ "js-sys", "wasm-bindgen", From f56e3eeb06929c8c6db32d7f47833604170db4bc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 8 Dec 2023 04:14:21 +0000 Subject: [PATCH 1592/2020] dep: Upgrade transitive dependencies (#1515) Co-authored-by: github-actions --- Cargo.lock | 191 ++++++++++++++++++++++++++++------------------------- 1 file changed, 100 insertions(+), 91 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fa6a2138..4c839378 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -54,30 +54,30 @@ checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317b9a89c1868f5ea6ff1d9539a69f45dffc21ce321ac1fd1160dfa48c8e2140" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "a3a318f1f38d2418400f8209655bfd825785afd25aa30bb7ba6cc792e4596748" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0699d10d2f4d628a98ee7b57b289abbc98ff3bad977cb3152709d4bf2330628" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -584,9 +584,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.10" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41fffed7514f420abec6d183b1d3acfd9099c79c3a10a06ade4f8203f1411272" +checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" dependencies = [ "clap_builder", "clap_derive", @@ -594,9 +594,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.9" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63361bae7eef3771745f02d8d892bec2fee5f6e34af316ba556e7f97a7069ff1" +checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" dependencies = [ "anstream", "anstyle", @@ -805,9 +805,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" +checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" dependencies = [ "powerfmt", ] @@ -1000,14 +1000,14 @@ checksum = "7fcb859e047d667f798f913a2cd0d5c214b85944d1191efa8146c98888fc557b" [[package]] name = "filetime" -version = "0.2.22" +version = "0.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", - "windows-sys 0.48.0", + "redox_syscall 0.4.1", + "windows-sys 0.52.0", ] [[package]] @@ -1241,9 +1241,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "948a5f9e43559d16faf583694f1c742eb401ce24ce8e6f2238caedea7486433c" +checksum = "2eadca029ef716b4378f7afb19f7ee101fde9e58ba1f1445971315ac866db417" dependencies = [ "bstr", "btoi", @@ -1255,9 +1255,9 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.20.0" +version = "0.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dca120f0c6562d2d7cae467f2466e576d9f7f189beec2af2e026145107c729e2" +checksum = "0f395469d38c76ec47cd1a6c5a53fbc3f13f737b96eaf7535f4e6b367e643381" dependencies = [ "bstr", "gix-glob", @@ -1272,18 +1272,18 @@ dependencies = [ [[package]] name = "gix-bitmap" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ccab4bc576844ddb51b78d81b4a42d73e6229660fa614dfc3d3999c874d1959" +checksum = "d49e1a13a30d3f88be4bceae184dd13a2d3fb9ffa7515f7ed7ae771b857f4916" dependencies = [ "thiserror", ] [[package]] name = "gix-chunk" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b42ea64420f7994000130328f3c7a2038f639120518870436d31b8bde704493" +checksum = "d411ecd9b558b0c20b3252b7e409eec48eabc41d18324954fe526bac6e2db55f" dependencies = [ "thiserror", ] @@ -1299,15 +1299,15 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8bc78b1a6328fa6d8b3a53b6c73997af37fd6bfc1d6c49f149e63bda5cbb36" +checksum = "85a7007ba021f059803afaf6f8a48872422abc20550ac12ede6ddea2936cec36" dependencies = [ "bstr", "gix-chunk", "gix-features", "gix-hash", - "memmap2", + "memmap2 0.9.0", "thiserror", ] @@ -1334,9 +1334,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea7505b97f4d8e7933e29735a568ba2f86d8de466669d9f0e8321384f9972f47" +checksum = "6419db582ea84dfb58c7e7b0af7fd62c808aa14954af2936a33f89b0f4ed018e" dependencies = [ "bitflags 2.4.1", "bstr", @@ -1363,9 +1363,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc7df669639582dc7c02737642f76890b03b5544e141caba68a7d6b4eb551e0d" +checksum = "468dfbe411f335f01525a1352271727f8e7772075a93fa747260f502086b30be" dependencies = [ "bstr", "itoa", @@ -1401,9 +1401,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.36.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f4365ba17c4f218d7fd9ec102b8d2d3cb0ca200a835e81151ace7778aec827" +checksum = "4d46a4a5c6bb5bebec9c0d18b65ada20e6517dbd7cf855b87dd4bbdce3a771b2" dependencies = [ "bytes", "bytesize", @@ -1445,18 +1445,18 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd171c0cae97cd0dc57e7b4601cb1ebf596450e263ef3c02be9107272c877bd" +checksum = "20e86eb040f5776a5ade092282e51cdcad398adb77d948b88d17583c2ae4e107" dependencies = [ "gix-features", ] [[package]] name = "gix-glob" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fac08925dbc14d414bd02eb45ffb4cecd912d1fce3883f867bd0103c192d3e4" +checksum = "5db19298c5eeea2961e5b3bf190767a2d1f09b8802aeb5f258e42276350aff19" dependencies = [ "bitflags 2.4.1", "bstr", @@ -1466,9 +1466,9 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1884c7b41ea0875217c1be9ce91322f90bde433e91d374d0e1276073a51ccc60" +checksum = "99c1e554a87759e672c7d2e37211e761aa390c61ffcd3753a57c51173143f3cb" dependencies = [ "faster-hex", "thiserror", @@ -1476,9 +1476,9 @@ dependencies = [ [[package]] name = "gix-hashtable" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "409268480841ad008e81c17ca5a293393fbf9f2b6c2f85b8ab9de1f0c5176a16" +checksum = "feb61880816d7ec4f0b20606b498147d480860ddd9133ba542628df2f548d3ca" dependencies = [ "gix-hash", "hashbrown", @@ -1487,9 +1487,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e73c07763a8005ae02cb5cf83040729cea9bb70c7cef68ec6c24159904c499a" +checksum = "a215cc8cf21645bca131fcf6329d3ebd46299c47dbbe27df71bb1ca9e328b879" dependencies = [ "bstr", "gix-glob", @@ -1515,16 +1515,16 @@ dependencies = [ "gix-object", "gix-traverse", "itoa", - "memmap2", + "memmap2 0.7.1", "smallvec", "thiserror", ] [[package]] name = "gix-lock" -version = "11.0.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4feb1dcd304fe384ddc22edba9dd56a42b0800032de6537728cea2f033a4f37" +checksum = "7e5c65e6a29830a435664891ced3f3c1af010f14900226019590ee0971a22f37" dependencies = [ "gix-tempfile", "gix-utils", @@ -1533,9 +1533,9 @@ dependencies = [ [[package]] name = "gix-macros" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d8acb5ee668d55f0f2d19a320a3f9ef67a6999ad483e11135abcc2464ed18b6" +checksum = "02a5bcaf6704d9354a3071cede7e77d366a5980c7352e102e2c2f9b645b1d3ae" dependencies = [ "proc-macro2", "quote", @@ -1610,7 +1610,7 @@ dependencies = [ "gix-object", "gix-path", "gix-tempfile", - "memmap2", + "memmap2 0.7.1", "parking_lot", "smallvec", "thiserror", @@ -1641,9 +1641,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a1d370115171e3ae03c5c6d4f7d096f2981a40ddccb98dfd704c773530ba73b" +checksum = "d86d6fac2fabe07b67b7835f46d07571f68b11aa1aaecae94fe722ea4ef305e1" dependencies = [ "bstr", "gix-trace", @@ -1654,9 +1654,9 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9cc7194fdcf43b4a1ccfa13ffae1d79f83beb4becff7761d88dd99faeafe625" +checksum = "1dbbb92f75a38ef043c8bb830b339b38d0698d7f3746968b5fcbade7a880494d" dependencies = [ "bitflags 2.4.1", "bstr", @@ -1700,9 +1700,9 @@ dependencies = [ [[package]] name = "gix-quote" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "475c86a97dd0127ba4465fbb239abac9ea10e68301470c9791a6dd5351cdc905" +checksum = "4f84845efa535468bc79c5a87b9d29219f1da0313c8ecf0365a5daa7e72786f2" dependencies = [ "bstr", "btoi", @@ -1725,7 +1725,7 @@ dependencies = [ "gix-path", "gix-tempfile", "gix-validate", - "memmap2", + "memmap2 0.7.1", "thiserror", "winnow", ] @@ -1777,9 +1777,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92b9542ac025a8c02ed5d17b3fc031a111a384e859d0be3532ec4d58c40a0f28" +checksum = "a36ea2c5907d64a9b4b5d3cc9f430e6c30f0509646b5e38eb275ca57c5bf29e2" dependencies = [ "bitflags 2.4.1", "gix-path", @@ -1804,9 +1804,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "11.0.0" +version = "11.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cc2205cf10d99f70b96e04e16c55d4c7cf33efc151df1f793e29fd12a931f8" +checksum = "388dd29114a86ec69b28d1e26d6d63a662300ecf61ab3f4cc578f7d7dc9e7e23" dependencies = [ "gix-fs", "libc", @@ -1817,9 +1817,9 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b6d623a1152c3facb79067d6e2ecdae48130030cf27d6eb21109f13bd7b836" +checksum = "b686a35799b53a9825575ca3f06481d0a053a409c4d97ffcf5ddd67a8760b497" [[package]] name = "gix-transport" @@ -1858,9 +1858,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.25.1" +version = "0.25.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1b9ac8ed32ad45f9fc6c5f8c0be2ed911e544a5a19afd62d95d524ebaa95671" +checksum = "0c427a1a11ccfa53a4a2da47d9442c2241deee63a154bc15cc14b8312fbc4005" dependencies = [ "bstr", "gix-features", @@ -1872,18 +1872,18 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b85d89dc728613e26e0ed952a19583744e7f5240fcd4aa30d6c824ffd8b52f0f" +checksum = "9f82c41937f00e15a1f6cb0b55307f0ca1f77f4407ff2bf440be35aa688c6a3e" dependencies = [ "fastrand 2.0.1", ] [[package]] name = "gix-validate" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e05cab2b03a45b866156e052aa38619f4ece4adcb2f79978bfc249bc3b21b8c5" +checksum = "75b7d8e4274be69f284bbc7e6bb2ccf7065dbcdeba22d8c549f2451ae426883f" dependencies = [ "bstr", "thiserror", @@ -2488,6 +2488,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memmap2" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "deaba38d7abf1d4cca21cc89e932e542ba2b9258664d2a9ef0e61512039c9375" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.9.0" @@ -2561,9 +2570,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "wasi", @@ -2700,15 +2709,15 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.18.0" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.60" +version = "0.10.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79a4c6c3a2b158f7f8f2a2fc5a969fa3a068df6fc9dbb4a43845436e3af7c800" +checksum = "6b8419dc8cc6d866deb801274bba2e6f8f6108c1bb7fcc10ee5ab864931dbb45" dependencies = [ "bitflags 2.4.1", "cfg-if", @@ -2738,9 +2747,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.96" +version = "0.9.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3812c071ba60da8b5677cc12bcb1d42989a65553772897a7e0355545a819838f" +checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b" dependencies = [ "cc", "libc", @@ -3023,9 +3032,9 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248fbed6f59e99c8ef6c6ecadc9b09c6e93713b8f921d73e41d6ed6017bf0624" +checksum = "7c509b49b989bce68439387eb469cbe301c6cfb08e28612ddc3a179bd7b0a012" dependencies = [ "cfg-if", "rustix", @@ -3116,9 +3125,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.6" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "684d5e6e18f669ccebf64a92236bb7db9a34f07be010e3627368182027180866" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ "cc", "getrandom", @@ -3169,7 +3178,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" dependencies = [ "log", - "ring 0.17.6", + "ring 0.17.7", "rustls-webpki", "sct", ] @@ -3189,7 +3198,7 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.6", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -3235,7 +3244,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.6", + "ring 0.17.7", "untrusted 0.9.0", ] @@ -3929,9 +3938,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" @@ -3950,9 +3959,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" [[package]] name = "unicode-bom" @@ -4453,9 +4462,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.19" +version = "0.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "829846f3e3db426d4cee4510841b71a8e58aa2a76b1132579487ae430ccd9c7b" +checksum = "b67b5f0a4e7a27a64c651977932b9dc5667ca7fc31ac44b03ed37a0cf42fdfff" dependencies = [ "memchr", ] From b2ddd176e348ba8b5e60daef046b62f9c489d5b4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 9 Dec 2023 01:29:41 +0000 Subject: [PATCH 1593/2020] build(deps): bump the deps group with 2 updates (#1516) Bumps the deps group with 2 updates: [tokio](https://github.com/tokio-rs/tokio) and [gix](https://github.com/Byron/gitoxide). Updates `tokio` from 1.34.0 to 1.35.0 - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.34.0...tokio-1.35.0) Updates `gix` from 0.55.2 to 0.56.0 - [Release notes](https://github.com/Byron/gitoxide/releases) - [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md) - [Commits](https://github.com/Byron/gitoxide/compare/gix-v0.55.2...gix-v0.56.0) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: gix dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 185 ++++++++++---------------- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 4 +- crates/simple-git/Cargo.toml | 4 +- 8 files changed, 82 insertions(+), 121 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4c839378..4aaaf798 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1186,12 +1186,13 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gix" -version = "0.55.2" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "002667cd1ebb789313d0d0afe3d23b2821cf3b0e91605095f0e6d8751f0ceeea" +checksum = "5b0dcdc9c60d66535897fa40a7ea2a635e72f99456b1d9ae86b7e170e80618cb" dependencies = [ "gix-actor", "gix-attributes", + "gix-command", "gix-commitgraph", "gix-config", "gix-credentials", @@ -1290,11 +1291,14 @@ dependencies = [ [[package]] name = "gix-command" -version = "0.2.10" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c576cfbf577f72c097b5f88aedea502cd62952bdc1fb3adcab4531d5525a4c7" +checksum = "b3b54c1d8d63e6ef2adbd9b94d6e49ff168858510b44d3811cdd02dfacc4f0c9" dependencies = [ "bstr", + "gix-path", + "gix-trace", + "shell-words", ] [[package]] @@ -1307,15 +1311,15 @@ dependencies = [ "gix-chunk", "gix-features", "gix-hash", - "memmap2 0.9.0", + "memmap2", "thiserror", ] [[package]] name = "gix-config" -version = "0.31.0" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cae98c6b4c66c09379bc35274b172587d6b0ac369a416c39128ad8c6454f9bb" +checksum = "0341471d55d8676e98b88e121d7065dfa4c9c5acea4b6d6ecdd2846e85cce0c3" dependencies = [ "bstr", "gix-config-value", @@ -1347,9 +1351,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c5c5d74069b842a1861e581027ac6b7ad9ff66f5911c89b9f45484d7ebda6a4" +checksum = "513dac42450b27946bd0a0535a3a5a88e473d6522e5e3439a129cab779c88f3d" dependencies = [ "bstr", "gix-command", @@ -1357,6 +1361,7 @@ dependencies = [ "gix-path", "gix-prompt", "gix-sec", + "gix-trace", "gix-url", "thiserror", ] @@ -1375,10 +1380,11 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "931394f69fb8c9ed6afc0aae3487bd869e936339bcc13ed8884472af072e0554" +checksum = "8119a985887cfe68f4bdf92e51bd64bc758a73882d82fcfc03ebcb164441c85d" dependencies = [ + "bstr", "gix-hash", "gix-object", "thiserror", @@ -1386,9 +1392,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a45d5cf0321178883e38705ab2b098f625d609a7d4c391b33ac952eff2c490f2" +checksum = "6fad89416ebe0b3b7df78464124e2a02417b6cd3743d48ad93df86f4d2929c07" dependencies = [ "bstr", "dunce", @@ -1425,9 +1431,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92f674d3fdb6b1987b04521ec9a5b7be8650671f2c4bbd17c3c81e2a364242ff" +checksum = "6d6a5c9d8e55c364e7c226919c19c9a28be1392d6208b5008059fa94ff7e2bf0" dependencies = [ "bstr", "encoding_rs", @@ -1439,6 +1445,7 @@ dependencies = [ "gix-path", "gix-quote", "gix-trace", + "gix-utils", "smallvec", "thiserror", ] @@ -1499,9 +1506,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c83a4fcc121b2f2e109088f677f89f85e7a8ebf39e8e6659c0ae54d4283b1650" +checksum = "65ce8d03ec25de952be7d2a9adce2a4c2cb8f7fc2d4c25be91301be9707f380b" dependencies = [ "bitflags 2.4.1", "bstr", @@ -1515,7 +1522,9 @@ dependencies = [ "gix-object", "gix-traverse", "itoa", - "memmap2 0.7.1", + "libc", + "memmap2", + "rustix", "smallvec", "thiserror", ] @@ -1544,9 +1553,9 @@ dependencies = [ [[package]] name = "gix-negotiate" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a5cdcf491ecc9ce39dcc227216c540355fe0024ae7c38e94557752ca5ebb67f" +checksum = "979f6accd9c051b3dd018b50adf29c0a2459edddf6105cc70b767976cd6f8014" dependencies = [ "bitflags 2.4.1", "gix-commitgraph", @@ -1560,9 +1569,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740f2a44267f58770a1cb3a3d01d14e67b089c7136c48d4bddbb3cfd2bf86a51" +checksum = "febf79c5825720c1c63fe974c7bbe695d0cb54aabad73f45671c60ce0e501e33" dependencies = [ "bstr", "btoi", @@ -1579,9 +1588,9 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.54.0" +version = "0.55.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8630b56cb80d8fa684d383dad006a66401ee8314e12fbf0e566ddad8c115143b" +checksum = "1fae5f971540c99c6ecc8d4368ecc9d18a9dc8b9391025c68c4399747dc93bac" dependencies = [ "arc-swap", "gix-date", @@ -1598,9 +1607,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.44.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1431ba2e30deff1405920693d54ab231c88d7c240dd6ccc936ee223d8f8697c3" +checksum = "4569491c92446fddf373456ff360aff9a9effd627b40a70f2d7914dcd75a3205" dependencies = [ "clru", "gix-chunk", @@ -1610,7 +1619,7 @@ dependencies = [ "gix-object", "gix-path", "gix-tempfile", - "memmap2 0.7.1", + "memmap2", "parking_lot", "smallvec", "thiserror", @@ -1619,23 +1628,25 @@ dependencies = [ [[package]] name = "gix-packetline" -version = "0.16.7" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a8384b1e964151aff0d5632dd9b191059d07dff358b96bd940f1b452600d7ab" +checksum = "03b9fcc4425bd64c585440d14e5d2405a399f323429401571ba56a2c6d111865" dependencies = [ "bstr", "faster-hex", + "gix-trace", "thiserror", ] [[package]] name = "gix-packetline-blocking" -version = "0.16.6" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d8395f7501c84d6a1fe902035fdfd8cd86d89e2dd6be0200ec1a72fd3c92d39" +checksum = "50052c0f76c5af5acda41177fb55b60c1e484cc246ae919d8d21129cd1000a4e" dependencies = [ "bstr", "faster-hex", + "gix-trace", "thiserror", ] @@ -1669,9 +1680,9 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c9a913769516f5e9d937afac206fb76428e3d7238e538845842887fda584678" +checksum = "4967b921304a5355e65a6257280eddf6e0f9ce3df111256531460adca3771305" dependencies = [ "gix-command", "gix-config-value", @@ -1682,9 +1693,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.41.1" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391e3feabdfa5f90dad6673ce59e3291ac28901b2ff248d86c5a7fbde0391e0e" +checksum = "95736ef407db0bd15a5bdea791fbfcf523b9f13b96c852c240cd86a9ee0ef817" dependencies = [ "bstr", "btoi", @@ -1711,9 +1722,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ec2f6d07ac88d2fb8007ee3fa3e801856fb9d82e7366ec0ca332eb2c9d74a52" +checksum = "1ac23ed741583c792f573c028785db683496a6dfcd672ec701ee54ba6a77e1ff" dependencies = [ "gix-actor", "gix-date", @@ -1725,16 +1736,16 @@ dependencies = [ "gix-path", "gix-tempfile", "gix-validate", - "memmap2 0.7.1", + "memmap2", "thiserror", "winnow", ] [[package]] name = "gix-refspec" -version = "0.19.0" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccb0974cc41dbdb43a180c7f67aa481e1c1e160fcfa8f4a55291fd1126c1a6e7" +checksum = "76d9d3b82e1ee78fc0dc1c37ea5ea76c2dbc73f407db155f0dfcea285e583bee" dependencies = [ "bstr", "gix-hash", @@ -1746,9 +1757,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ca97ac73459a7f3766aa4a5638a6e37d56d4c7962bc1986fbaf4883d0772588" +checksum = "fe5dd51710ce5434bc315ea30394fab483c5377276494edd79222b321a5a9544" dependencies = [ "bstr", "gix-date", @@ -1762,9 +1773,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a16d8c892e4cd676d86f0265bf9d40cefd73d8d94f86b213b8b77d50e77efae0" +checksum = "69d4ed2493ca94a475fdf147138e1ef8bab3b6ebb56abf3d9bda1c05372ec1dd" dependencies = [ "gix-commitgraph", "gix-date", @@ -1789,9 +1800,9 @@ dependencies = [ [[package]] name = "gix-submodule" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bba78c8d12aa24370178453ec3a472ff08dfaa657d116229f57f2c9cd469a1c2" +checksum = "02a3d7f60a95bdcaeb8981663c99d1c9f4de42aab1169524c949e948989809f9" dependencies = [ "bstr", "gix-config", @@ -1823,9 +1834,9 @@ checksum = "b686a35799b53a9825575ca3f06481d0a053a409c4d97ffcf5ddd67a8760b497" [[package]] name = "gix-transport" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f209a93364e24f20319751bc11092272e2f3fe82bb72592b2822679cf5be752" +checksum = "f731cfefc4d62468c6dd2053f5c6707828256a6d2f5488c1811e3f42c178b144" dependencies = [ "base64", "bstr", @@ -1842,9 +1853,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.34.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d050ec7d4e1bb76abf0636cf4104fb915b70e54e3ced9a4427c999100ff38a" +checksum = "df2112088122a0206592c84fbd42020db63b2ccaed66a0293779f2e5fbf80474" dependencies = [ "gix-commitgraph", "gix-date", @@ -1891,9 +1902,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddaf79e721dba64fe726a42f297a3c8ed42e55cdc0d81ca68452f2def3c2d7fd" +checksum = "7f1d0ae01dee14abe8c8117d78d7518f9a507de2dc4522546fbf4c444e9860b4" dependencies = [ "bstr", "gix-attributes", @@ -1909,9 +1920,9 @@ dependencies = [ [[package]] name = "gix-worktree-state" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34a2fcccdcaf3c71c00a03df31c9aa459d444cabbec4ed9ca1fa64e43406bed4" +checksum = "afef3c1cfe610ccfbca391515a1254662a648ce2635c9f60511eb1feb751fa01" dependencies = [ "bstr", "gix-features", @@ -2479,15 +2490,6 @@ version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" -[[package]] -name = "memmap2" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49388d20533534cd19360ad3d6a7dadc885944aa802ba3995040c5ec11288c6" -dependencies = [ - "libc", -] - [[package]] name = "memmap2" version = "0.9.0" @@ -3088,7 +3090,6 @@ dependencies = [ "tokio-rustls", "tokio-util", "tower-service", - "trust-dns-resolver", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -3388,6 +3389,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + [[package]] name = "signal-hook-registry" version = "1.4.1" @@ -3682,9 +3689,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "841d45b238a16291a4e1584e61820b8ae57d696cc5015c459c229ccc6990cc1c" dependencies = [ "backtrace", "bytes", @@ -3890,52 +3897,6 @@ dependencies = [ "tracing-serde", ] -[[package]] -name = "trust-dns-proto" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3119112651c157f4488931a01e586aa459736e9d6046d3bd9105ffb69352d374" -dependencies = [ - "async-trait", - "cfg-if", - "data-encoding", - "enum-as-inner", - "futures-channel", - "futures-io", - "futures-util", - "idna 0.4.0", - "ipnet", - "once_cell", - "rand", - "smallvec", - "thiserror", - "tinyvec", - "tokio", - "tracing", - "url", -] - -[[package]] -name = "trust-dns-resolver" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a3e6c3aff1718b3c73e395d1f35202ba2ffa847c6a62eea0db8fb4cfe30be6" -dependencies = [ - "cfg-if", - "futures-util", - "ipconfig", - "lru-cache", - "once_cell", - "parking_lot", - "rand", - "resolv-conf", - "smallvec", - "thiserror", - "tokio", - "tracing", - "trust-dns-proto", -] - [[package]] name = "try-lock" version = "0.2.5" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 478bf810..8281bd68 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -38,7 +38,7 @@ strum = "0.25.0" strum_macros = "0.25.0" supports-color = "2.0.0" tempfile = "3.5.0" -tokio = { version = "1.28.2", features = ["rt-multi-thread", "signal"], default-features = false } +tokio = { version = "1.35.0", features = ["rt-multi-thread", "signal"], default-features = false } tracing-core = "0.1.32" tracing = { version = "0.1.39", default-features = false } tracing-log = { version = "0.2.0", default-features = false } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 2601c47c..4e81186c 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -32,7 +32,7 @@ serde_json = { version = "1.0.107", optional = true } tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.5.0" thiserror = "1.0.40" -tokio = { version = "1.28.2", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } +tokio = { version = "1.35.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.8", features = ["io"] } tracing = "0.1.39" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index c8fdde6b..001e30e2 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -25,7 +25,7 @@ minisign-verify = "0.2.1" once_cell = "1.18.0" strum = "0.25.0" thiserror = "1.0.40" -tokio = { version = "1.30.0", features = ["rt", "sync"], default-features = false } +tokio = { version = "1.35.0", features = ["rt", "sync"], default-features = false } tracing = "0.1.39" url = "2.3.1" diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 4e958633..14555e1d 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -28,7 +28,7 @@ sha2 = "0.10.7" simple-git = { version = "0.1.1", path = "../simple-git", optional = true } tempfile = "3.5.0" thiserror = "1.0.40" -tokio = { version = "1.30.0", features = ["rt", "sync"], default-features = false } +tokio = { version = "1.35.0", features = ["rt", "sync"], default-features = false } tracing = "0.1.39" url = "2.3.1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 85cc5a41..4fe5ebf1 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -31,7 +31,7 @@ strum = "0.25.0" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" thiserror = "1.0.40" -tokio = { version = "1.30.0", features = ["rt", "process", "sync"], default-features = false } +tokio = { version = "1.35.0", features = ["rt", "process", "sync"], default-features = false } tracing = "0.1.39" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 6bec9e94..97f5b5cb 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -tokio = { version = "1.28.2", features = ["rt", "process", "sync"], default-features = false } +tokio = { version = "1.35.0", features = ["rt", "process", "sync"], default-features = false } tracing = { version = "0.1.39", optional = true } tracing-subscriber = { version = "0.3.17", features = ["fmt"], default-features = false, optional = true } cfg-if = "1.0.0" @@ -25,7 +25,7 @@ windows-sys = { version = "0.52.0", features = ["Win32_System_Threading", "Win32 windows-dll = { version = "0.4.1", features = ["windows"], default-features = false } [dev-dependencies] -tokio = { version = "1.28.2", features = ["macros"], default-features = false } +tokio = { version = "1.35.0", features = ["macros"], default-features = false } [package.metadata.binstall] pkg-url = "{ repo }/releases/download/v{ version }/cargo-binstall-{ target }.full.{ archive-format }" diff --git a/crates/simple-git/Cargo.toml b/crates/simple-git/Cargo.toml index 6d4a865a..c3ef1152 100644 --- a/crates/simple-git/Cargo.toml +++ b/crates/simple-git/Cargo.toml @@ -14,11 +14,11 @@ license = "Apache-2.0 OR MIT" compact_str = "0.7.0" derive_destructure2 = "0.1" thiserror = "1.0.40" -tokio = { version = "1.30.0", features = ["rt", "time"], default-features = false } +tokio = { version = "1.35.0", features = ["rt", "time"], default-features = false } tracing = "0.1.39" [dependencies.gix] -version = "0.55.2" +version = "0.56.0" default-features = false features = [ "comfort", From 8bb3557eda2a952777d33b2ba175566063750371 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 13:17:23 +0000 Subject: [PATCH 1594/2020] dep: Upgrade transitive dependencies (#1517) Co-authored-by: github-actions --- Cargo.lock | 105 +++++++++++++++++++++++++++++------------------------ 1 file changed, 58 insertions(+), 47 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4aaaf798..c3f2d0c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,9 +34,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ab91ebe16eb252986481c5b62f6098f3b698a45e34b5b98200cf20dd2484a44" +checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" dependencies = [ "anstyle", "anstyle-parse", @@ -63,9 +63,9 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3a318f1f38d2418400f8209655bfd825785afd25aa30bb7ba6cc792e4596748" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ "windows-sys 0.52.0", ] @@ -141,7 +141,7 @@ checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.40", ] [[package]] @@ -613,7 +613,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.40", ] [[package]] @@ -820,7 +820,7 @@ checksum = "ac4b68190bad25c00b64ea19767b2321a037fc0e5bea7563d5d8e35e04b19c95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.40", ] [[package]] @@ -928,7 +928,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.40", ] [[package]] @@ -977,6 +977,15 @@ dependencies = [ "serde", ] +[[package]] +name = "faster-hex" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2a2b11eda1d40935b26cf18f6833c526845ae8c41e58d09af6adeb6f0269183" +dependencies = [ + "serde", +] + [[package]] name = "fastrand" version = "1.9.0" @@ -1124,7 +1133,7 @@ checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.40", ] [[package]] @@ -1473,11 +1482,11 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99c1e554a87759e672c7d2e37211e761aa390c61ffcd3753a57c51173143f3cb" +checksum = "1f8cf8c2266f63e582b7eb206799b63aa5fa68ee510ad349f637dfe2d0653de0" dependencies = [ - "faster-hex", + "faster-hex 0.9.0", "thiserror", ] @@ -1506,9 +1515,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.27.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65ce8d03ec25de952be7d2a9adce2a4c2cb8f7fc2d4c25be91301be9707f380b" +checksum = "f3f308f5cd2992e96a274b0d1931e9a0e44fdcba87695ead3f6df30d8a697e9c" dependencies = [ "bitflags 2.4.1", "bstr", @@ -1548,7 +1557,7 @@ checksum = "02a5bcaf6704d9354a3071cede7e77d366a5980c7352e102e2c2f9b645b1d3ae" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.40", ] [[package]] @@ -1633,7 +1642,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03b9fcc4425bd64c585440d14e5d2405a399f323429401571ba56a2c6d111865" dependencies = [ "bstr", - "faster-hex", + "faster-hex 0.8.1", "gix-trace", "thiserror", ] @@ -1645,7 +1654,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50052c0f76c5af5acda41177fb55b60c1e484cc246ae919d8d21129cd1000a4e" dependencies = [ "bstr", - "faster-hex", + "faster-hex 0.8.1", "gix-trace", "thiserror", ] @@ -2114,9 +2123,9 @@ 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", @@ -2287,9 +2296,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" @@ -2364,14 +2373,14 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.40", ] [[package]] name = "libc" -version = "0.2.150" +version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "libmimalloc-sys" @@ -2537,7 +2546,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.40", ] [[package]] @@ -2738,7 +2747,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.40", ] [[package]] @@ -2829,7 +2838,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.40", ] [[package]] @@ -3034,9 +3043,9 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c509b49b989bce68439387eb469cbe301c6cfb08e28612ddc3a179bd7b0a012" +checksum = "767be24c0da52e7448d495b8d162506a9aa125426651d547d545d6c2b4b65b62" dependencies = [ "cfg-if", "rustix", @@ -3161,9 +3170,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.26" +version = "0.38.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9470c4bf8246c8daf25f9598dca807fb6510347b1e1cfa55749113850c79d88a" +checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" dependencies = [ "bitflags 2.4.1", "errno 0.3.8", @@ -3174,9 +3183,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.9" +version = "0.21.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "629648aced5775d558af50b2b4c7b02983a04b312126d45eeead26e7caa498b9" +checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", "ring 0.17.7", @@ -3211,9 +3220,9 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "same-file" @@ -3307,7 +3316,7 @@ checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.40", ] [[package]] @@ -3497,7 +3506,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.39", + "syn 2.0.40", ] [[package]] @@ -3541,9 +3550,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "13fa70a4ee923979ffb522cacce59d34421ebdea5625e1073c4326ef9d2dd42e" dependencies = [ "proc-macro2", "quote", @@ -3628,7 +3637,7 @@ checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.40", ] [[package]] @@ -3713,7 +3722,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.40", ] [[package]] @@ -3759,7 +3768,7 @@ dependencies = [ "redox_syscall 0.3.5", "tokio", "tokio-stream", - "xattr 1.0.1", + "xattr 1.1.2", ] [[package]] @@ -3848,7 +3857,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.40", ] [[package]] @@ -4083,7 +4092,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.40", "wasm-bindgen-shared", ] @@ -4117,7 +4126,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.40", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4461,11 +4470,13 @@ dependencies = [ [[package]] name = "xattr" -version = "1.0.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" +checksum = "d367426ae76bdfce3d8eaea6e94422afd6def7d46f9c89e2980309115b3c2c41" dependencies = [ "libc", + "linux-raw-sys", + "rustix", ] [[package]] From 09debccace53b09bf4548b24bd12aae02d5ed43e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 12 Dec 2023 00:08:13 +1000 Subject: [PATCH 1595/2020] freat: Avoid breaking changes due to gix upgrade (#1518) Wrap all error type in a new type so that we don't have to release new major versions after upgrading depoendency gix`. Signed-off-by: Jiahao XU --- crates/simple-git/src/error.rs | 67 ++++++++++++++++++++++++++++ crates/simple-git/src/lib.rs | 80 ++++++---------------------------- 2 files changed, 80 insertions(+), 67 deletions(-) create mode 100644 crates/simple-git/src/error.rs diff --git a/crates/simple-git/src/error.rs b/crates/simple-git/src/error.rs new file mode 100644 index 00000000..1aa6f17f --- /dev/null +++ b/crates/simple-git/src/error.rs @@ -0,0 +1,67 @@ +use gix::clone; +use thiserror::Error as ThisError; + +#[derive(Debug, ThisError)] +#[error(transparent)] +pub struct GitError(#[from] GitErrorInner); + +#[derive(Debug, ThisError)] +pub(super) enum GitErrorInner { + #[error("Failed to prepare for fetch: {0}")] + PrepareFetchError(#[source] Box), + + #[error("Failed to fetch: {0}")] + FetchError(#[source] Box), + + #[error("Failed to checkout: {0}")] + CheckOutError(#[source] Box), + + #[error("HEAD ref was corrupt in crates-io index repository clone")] + HeadCommit(#[source] Box), + + #[error("tree of head commit wasn't present in crates-io index repository clone")] + GetTreeOfCommit(#[source] Box), + + #[error("An object was missing in the crates-io index repository clone")] + ObjectLookup(#[source] Box), +} + +impl From for GitErrorInner { + fn from(e: clone::Error) -> Self { + Self::PrepareFetchError(Box::new(e)) + } +} + +impl From for GitErrorInner { + fn from(e: clone::fetch::Error) -> Self { + Self::FetchError(Box::new(e)) + } +} + +impl From for GitErrorInner { + fn from(e: clone::checkout::main_worktree::Error) -> Self { + Self::CheckOutError(Box::new(e)) + } +} + +impl From for GitErrorInner { + fn from(e: gix::reference::head_commit::Error) -> Self { + Self::HeadCommit(Box::new(e)) + } +} + +impl From for GitErrorInner { + fn from(e: gix::object::commit::Error) -> Self { + Self::GetTreeOfCommit(Box::new(e)) + } +} + +impl From for GitErrorInner { + fn from(e: gix::object::find::existing::Error) -> Self { + Self::ObjectLookup(Box::new(e)) + } +} + +#[derive(Debug, ThisError)] +#[error(transparent)] +pub struct GitUrlParseError(pub(super) gix::url::parse::Error); diff --git a/crates/simple-git/src/lib.rs b/crates/simple-git/src/lib.rs index 8ff64e39..e432baff 100644 --- a/crates/simple-git/src/lib.rs +++ b/crates/simple-git/src/lib.rs @@ -1,7 +1,6 @@ use std::{fmt, mem, num::NonZeroU32, path::Path, str::FromStr, sync::atomic::AtomicBool}; use gix::{clone, create, open, remote, Url}; -use thiserror::Error as ThisError; use tracing::debug; mod progress_tracing; @@ -10,65 +9,9 @@ use progress_tracing::TracingProgress; mod cancellation_token; pub use cancellation_token::{GitCancelOnDrop, GitCancellationToken}; -pub use gix::url::parse::Error as GitUrlParseError; - -#[derive(Debug, ThisError)] -#[non_exhaustive] -pub enum GitError { - #[error("Failed to prepare for fetch: {0}")] - PrepareFetchError(#[source] Box), - - #[error("Failed to fetch: {0}")] - FetchError(#[source] Box), - - #[error("Failed to checkout: {0}")] - CheckOutError(#[source] Box), - - #[error("HEAD ref was corrupt in crates-io index repository clone")] - HeadCommit(#[source] Box), - - #[error("tree of head commit wasn't present in crates-io index repository clone")] - GetTreeOfCommit(#[source] Box), - - #[error("An object was missing in the crates-io index repository clone")] - ObjectLookup(#[source] Box), -} - -impl From for GitError { - fn from(e: clone::Error) -> Self { - Self::PrepareFetchError(Box::new(e)) - } -} - -impl From for GitError { - fn from(e: clone::fetch::Error) -> Self { - Self::FetchError(Box::new(e)) - } -} - -impl From for GitError { - fn from(e: clone::checkout::main_worktree::Error) -> Self { - Self::CheckOutError(Box::new(e)) - } -} - -impl From for GitError { - fn from(e: gix::reference::head_commit::Error) -> Self { - Self::HeadCommit(Box::new(e)) - } -} - -impl From for GitError { - fn from(e: gix::object::commit::Error) -> Self { - Self::GetTreeOfCommit(Box::new(e)) - } -} - -impl From for GitError { - fn from(e: gix::object::find::existing::Error) -> Self { - Self::ObjectLookup(Box::new(e)) - } -} +mod error; +use error::GitErrorInner; +pub use error::{GitError, GitUrlParseError}; #[derive(Clone, Debug)] pub struct GitUrl(Url); @@ -86,7 +29,7 @@ impl FromStr for GitUrl { type Err = GitUrlParseError; fn from_str(s: &str) -> Result { - Url::try_from(s).map(Self) + Url::try_from(s).map(Self).map_err(GitUrlParseError) } } @@ -98,7 +41,7 @@ impl Repository { url: GitUrl, path: &Path, kind: create::Kind, - ) -> Result { + ) -> Result { Ok(clone::PrepareFetch::new( url.0, path, @@ -133,7 +76,8 @@ impl Repository { .as_ref() .map(GitCancellationToken::get_atomic) .unwrap_or(&AtomicBool::new(false)), - )? + ) + .map_err(GitErrorInner::from)? .0 .into(), )) @@ -154,7 +98,8 @@ impl Repository { Ok(Self( Self::prepare_fetch(url, path, create::Kind::WithWorktree)? - .fetch_then_checkout(&mut progress, &AtomicBool::new(false))? + .fetch_then_checkout(&mut progress, &AtomicBool::new(false)) + .map_err(GitErrorInner::from)? .0 .main_worktree( &mut progress, @@ -162,7 +107,8 @@ impl Repository { .as_ref() .map(GitCancellationToken::get_atomic) .unwrap_or(&AtomicBool::new(false)), - )? + ) + .map_err(GitErrorInner::from)? .0 .into(), )) @@ -173,7 +119,7 @@ impl Repository { &self, path: impl AsRef, ) -> Result>, GitError> { - fn inner(this: &Repository, path: &Path) -> Result>, GitError> { + fn inner(this: &Repository, path: &Path) -> Result>, GitErrorInner> { Ok( if let Some(entry) = this .0 @@ -189,6 +135,6 @@ impl Repository { ) } - inner(self, path.as_ref()) + Ok(inner(self, path.as_ref())?) } } From f0bfa54944c2ad8a9e8a9cce301a7a0095685823 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 22:37:04 +0000 Subject: [PATCH 1596/2020] release: simple-git v0.2.0 (#1520) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/simple-git/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c3f2d0c5..7985cd76 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3415,7 +3415,7 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.1.1" +version = "0.2.0" dependencies = [ "compact_str", "derive_destructure2", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 14555e1d..39537cdb 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -25,7 +25,7 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde_json = "1.0.107" sha2 = "0.10.7" -simple-git = { version = "0.1.1", path = "../simple-git", optional = true } +simple-git = { version = "0.2.0", path = "../simple-git", optional = true } tempfile = "3.5.0" thiserror = "1.0.40" tokio = { version = "1.35.0", features = ["rt", "sync"], default-features = false } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 4fe5ebf1..d094dea0 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ leon = { version = "2.0.1", path = "../leon" } maybe-owned = "0.3.4" miette = "5.9.0" semver = { version = "1.0.17", features = ["serde"] } -simple-git = { version = "0.1.1", path = "../simple-git", optional = true } +simple-git = { version = "0.2.0", path = "../simple-git", optional = true } strum = "0.25.0" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" diff --git a/crates/simple-git/Cargo.toml b/crates/simple-git/Cargo.toml index c3ef1152..5bcaf325 100644 --- a/crates/simple-git/Cargo.toml +++ b/crates/simple-git/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "simple-git" -version = "0.1.1" +version = "0.2.0" edition = "2021" description = "The simple git interface for gix suitable for async context (with tokio)" From 0e87113cc5ce1ae2447c0855ef3a1171525e7f03 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 11 Dec 2023 23:54:34 +0000 Subject: [PATCH 1597/2020] release: binstalk-registry v0.4.0 (#1521) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7985cd76..4a3749a5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -347,7 +347,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.3.0" +version = "0.4.0" dependencies = [ "async-trait", "base16", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 39537cdb..17297fcd 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.3.0" +version = "0.4.0" edition = "2021" rust-version = "1.65.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index d094dea0..b09047a7 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.9.5", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.2.2", path = "../binstalk-fetchers", features = ["quickinstall"] } -binstalk-registry = { version = "0.3.0", path = "../binstalk-registry" } +binstalk-registry = { version = "0.4.0", path = "../binstalk-registry" } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "3.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } From 3d22e1b8f4ab4601d2e67a13162f219a3d4e8cb9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 02:40:07 +0000 Subject: [PATCH 1598/2020] release: binstalk v0.19.0 (#1522) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4a3749a5..2e51e876 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -223,7 +223,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.18.1" +version = "0.19.0" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 8281bd68..992ed668 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.18.1", default-features = false } +binstalk = { path = "../binstalk", version = "0.19.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.11.0" } clap = { version = "4.4.8", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index b09047a7..f34da962 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.18.1" +version = "0.19.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From f6a95fa733be466c0e66c360f52e1d6998e47f25 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 14:02:34 +1000 Subject: [PATCH 1599/2020] release: cargo-binstall v1.4.7 (#1523) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2e51e876..2c07a91a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -506,7 +506,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.4.6" +version = "1.4.7" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 992ed668..bcd82635 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.4.6" +version = "1.4.7" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index c8428bb4..88f3195a 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From c8e93d4a242f928e47556f573031a560fc849588 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Wed, 13 Dec 2023 19:39:08 +1300 Subject: [PATCH 1600/2020] Renew readme (#1524) - Reorders sections to show Binstall's value upfront - Clarifies and simplifies language - Updates the sample output - Includes cargo-run-bin (#1514) - Places the github actions in more prominence in the Install section - Unifies appellation by consistently using the "Binstall" name except for commands - Changes the arch labels in the install table to reflect common/official usage --- README.md | 139 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 77 insertions(+), 62 deletions(-) diff --git a/README.md b/README.md index d03300b9..fb4f05b8 100644 --- a/README.md +++ b/README.md @@ -1,95 +1,119 @@ # Cargo B(inary)Install -`cargo binstall` provides a low-complexity mechanism for installing rust binaries as an alternative to building from source (via `cargo install`) or manually downloading packages. This is intended to work with existing CI artifacts and infrastructure, and with minimal overhead for package maintainers. +Binstall provides a low-complexity mechanism for installing Rust binaries as an alternative to building from source (via `cargo install`) or manually downloading packages. +This is intended to work with existing CI artifacts and infrastructure, and with minimal overhead for package maintainers. -`binstall` works by fetching the crate information from `crates.io`, then searching the linked `repository` for matching releases and artifacts, with fallbacks to [quickinstall](https://github.com/alsuren/cargo-quickinstall) and finally `cargo install` if these are not found. -To support `binstall` maintainers must add configuration values to `Cargo.toml` to allow the tool to locate the appropriate binary package for a given version and target. See [SUPPORT.md](./SUPPORT.md) for more detail. - -## Status +Binstall works by fetching the crate information from `crates.io` and searching the linked `repository` for matching releases and artifacts, falling back to the [quickinstall](https://github.com/alsuren/cargo-quickinstall) third-party artifact host, to alternate targets as supported, and finally to `cargo install` as a last resort. [![CI build](https://github.com/cargo-bins/cargo-binstall/actions/workflows/ci.yml/badge.svg)](https://github.com/cargo-bins/cargo-binstall/actions) [![GitHub tag](https://img.shields.io/github/tag/cargo-bins/cargo-binstall.svg)](https://github.com/cargo-bins/cargo-binstall) [![Crates.io](https://img.shields.io/crates/v/cargo-binstall.svg)](https://crates.io/crates/cargo-binstall) -You probably want to **[see this page as it was when the latest version was published](https://crates.io/crates/cargo-binstall)** for accurate documentation. +_You may want to [see this page as it was when the latest version was published](https://crates.io/crates/cargo-binstall)._ + +## Usage + +```console +$ cargo binstall radio-sx128x@0.14.1-alpha.5 + INFO resolve: Resolving package: 'radio-sx128x@=0.14.1-alpha.5' + WARN The package radio-sx128x v0.14.1-alpha.5 (x86_64-unknown-linux-gnu) has been downloaded from github.com + INFO This will install the following binaries: + INFO - sx128x-util (sx128x-util-x86_64-unknown-linux-gnu -> /home/.cargo/bin/sx128x-util) +Do you wish to continue? yes/[no] +? yes + INFO Installing binaries... + INFO Done in 2.838798298s +``` + +Binstall aims to be a drop-in replacement for `cargo install` in many cases, and supports similar options. + +For unattended use (e.g. in CI), use the `--no-confirm` flag. +For additional options please see `cargo binstall --help`. ## Installation -Here are the one-liners for installing pre-compiled `cargo-binstall` binary from release on Linux and macOS: +### If you already have it + +To upgrade cargo-binstall, use `cargo binstall cargo-binstall`! + +### Quickly + +Here are one-liners for downloading and installing a pre-compiled `cargo-binstall` binary. + +#### Linux and macOS ``` curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash ``` -And the one-liner for installing a pre-compiled `cargo-binstall` binary from release on Windows (x86_64 and aarch64): +#### Windows ``` Set-ExecutionPolicy Unrestricted -Scope Process; iex (iwr "https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.ps1").Content ``` -To get started _using_ `cargo-binstall` first install the binary (either via `cargo install cargo-binstall` or by downloading a pre-compiled [release](https://github.com/cargo-bins/cargo-binstall/releases)), then extract it using `tar` or `unzip` and move it into `$HOME/.cargo/bin`. -We recommend using the pre-compiled ones because we optimize those more than a standard source build does. +### Manually + +Download the relevant package for your system below, unpack it, and move the `cargo-binstall` executable into `$HOME/.cargo/bin`: | OS | Arch | URL | | ------- | ------- | ------------------------------------------------------------ | -| linux | x86\_64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz | -| linux | armv7 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-armv7-unknown-linux-musleabihf.tgz | -| linux | arm64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-unknown-linux-musl.tgz | -| macos | x86\_64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-apple-darwin.zip | -| macos | m1 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-apple-darwin.zip | -| macos | universal | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-universal-apple-darwin.zip | -| windows | x86\_64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-pc-windows-msvc.zip | -| windows | arm64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-pc-windows-msvc.zip | +| Linux | x86\_64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz | +| Linux | armv7 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-armv7-unknown-linux-musleabihf.tgz | +| Linux | arm64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-unknown-linux-musl.tgz | +| Mac | Intel | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-apple-darwin.zip | +| Mac | Apple Silicon | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-apple-darwin.zip | +| Mac | Universal
(both archs) | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-universal-apple-darwin.zip | +| Windows | Intel/AMD | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-pc-windows-msvc.zip | +| Windows | ARM 64 | https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-aarch64-pc-windows-msvc.zip | -We also provide pre-built artifacts with debuginfo for Linux and Mac. -These artifacts are suffixed with `.full.tgz` on Linux and `.full.zip` on Mac and Windows. +### From source -To upgrade cargo-binstall, use `cargo binstall cargo-binstall`! - -## Usage - -Supported packages can be installed using `cargo binstall NAME` where `NAME` is the crates.io package name. - -Package versions and targets may be specified using the `--version` and `--target` arguments respectively, and will be installed into `$HOME/.cargo/bin` by default. For additional options please see `cargo binstall --help`. +With a recent [Rust](https://rustup.rs) installed: ``` -[garry] ➜ ~ cargo binstall radio-sx128x --version 0.14.1-alpha.5 -21:14:15 [INFO] Resolving package: 'radio-sx128x' -21:14:18 [INFO] This will install the following binaries: -21:14:18 [INFO] - sx128x-util (sx128x-util-x86_64-apple-darwin -> /Users/ryankurte/.cargo/bin/sx128x-util-v0.14.1-alpha.5) -21:14:18 [INFO] And create (or update) the following symlinks: -21:14:18 [INFO] - sx128x-util (/Users/ryankurte/.cargo/bin/sx128x-util-v0.14.1-alpha.5 -> /Users/ryankurte/.cargo/bin/sx128x-util) -21:14:18 [INFO] Do you wish to continue? yes/[no] -? yes -21:14:20 [INFO] Installing binaries... -21:14:21 [INFO] Done in 6.212736s +cargo install cargo-binstall ``` +### In GitHub Actions + +We provide a first-party, minimal action that installs the latest version of Binstall: + +```yml + - uses: cargo-bins/cargo-binstall@main +``` + +For more features, we recommend the excellent [taiki-e/install-action](https://github.com/marketplace/actions/install-development-tools), which has dedicated support for selected tools and uses Binstall for everything else. + +## Companion tools + +These are useful *third-party* tools which work well with Binstall. + +### [`cargo-update`](https://github.com/nabijaczleweli/cargo-update) + +While you can upgrade crates explicitly by running `cargo binstall` again, `cargo-update` takes care of updating all tools as needed. +It automatically uses Binstall to install the updates if it is present. + +### [`cargo-run-bin`](https://github.com/dustinblackman/cargo-run-bin) + +Binstall and `cargo install` both install tools globally by default, which is fine for system-wide tools. +When installing tooling for a project, however, you may prefer to both scope the tools to that project and control their versions in code. +That's where `cargo-run-bin` comes in, with a dedicated section in your Cargo.toml and a short cargo subcommand. +When Binstall is available, it installs from binary whenever possible... and you can even manage Binstall itself with `cargo-run-bin`! + ## Unsupported crates -Nowadays, `cargo-binstall` is smart enough. All you need just passing the crate name. +Binstall is generally smart enough to auto-detect artifacts in most situations. +However, if a package fails to install, you can manually specify the `pkg-url`, `bin-dir`, and `pkg-fmt` as needed at the command line, with values as documented in [SUPPORT.md](./SUPPORT.md). -```shell -cargo binstall --no-confirm --no-symlinks cargo-edit cargo-watch cargo-tarpaulin \ - watchexec-cli cargo-outdated just fnm broot stylua -``` - -If your favorite package fails to install, you can instead specify the `pkg-url`, `bin-dir`, and `pkg-fmt` at the command line, with values as documented in [SUPPORT.md](./SUPPORT.md). - -For example: - -```shell +```console $ cargo-binstall \ --pkg-url="{ repo }/releases/download/{ version }/{ name }-{ version }-{ target }.{ archive-format }" \ --pkg-fmt="txz" \ crate_name ``` -## Upgrade installed crates - -The most ergonomic way to upgrade the installed crates is with [`cargo-update`](https://github.com/nabijaczleweli/cargo-update). `cargo-update` automatically uses `cargo-binstall` to install the updates if `cargo-binstall` is present. - -Supported crates such as `cargo-binstall` itself can also be updated with `cargo-binstall` as in the example in [Installation](#installation) above. +Maintainers wanting to make their users' life easier can add [explicit Binstall metadata](./SUPPORT.md) to `Cargo.toml` to locate the appropriate binary package for a given version and target. ## Signatures @@ -123,15 +147,6 @@ Compared to something like a `curl ... | sh` script, we're not running arbitrary ### What do the error codes mean? You can find a full description of errors including exit codes here: -### Can I use it in CI? -Yes! We have two options, both for GitHub Actions: - -1. For full featured use, we recommend the excellent [taiki-e/install-action](https://github.com/marketplace/actions/install-development-tools), which has explicit support for selected tools and uses `cargo-binstall` for everything else. -2. We provide a first-party, minimal action that _only_ installs the tool: -```yml - - uses: cargo-bins/cargo-binstall@main -``` - ### Are debug symbols available? Yes! Extra pre-built packages with a `.full` suffix are available and contain split debuginfo, documentation files, and extra binaries like the `detect-wasi` utility. From f29543e555a96243188ce2523ea7e5f37931f3b5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 15 Dec 2023 04:46:30 +0000 Subject: [PATCH 1601/2020] dep: Upgrade transitive dependencies (#1527) Co-authored-by: github-actions --- Cargo.lock | 69 +++++++++++++++++++++++++++--------------------------- 1 file changed, 34 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2c07a91a..c8f659d6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -141,7 +141,7 @@ checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.41", ] [[package]] @@ -613,7 +613,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.41", ] [[package]] @@ -719,9 +719,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a33c2bf77f2df06183c3aa30d1e96c0695a313d4f9c453cc3762a6db39f99200" +checksum = "14c3242926edf34aec4ac3a77108ad4854bffaa2e4ddc1824124ce59231302d5" dependencies = [ "cfg-if", "crossbeam-utils", @@ -729,9 +729,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6fd6f855243022dcecf8702fef0c297d4338e226845fe067f6341ad9fa0cef" +checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" dependencies = [ "cfg-if", "crossbeam-epoch", @@ -740,22 +740,21 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.15" +version = "0.9.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae211234986c545741a7dc064309f67ee1e5ad243d0e48335adc0484d960bcc7" +checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", "memoffset", - "scopeguard", ] [[package]] name = "crossbeam-queue" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +checksum = "b9bcf5bdbfdd6030fb4a1c497b5d5fc5921aa2f60d359a17e249c0e6df3de153" dependencies = [ "cfg-if", "crossbeam-utils", @@ -763,9 +762,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" +checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" dependencies = [ "cfg-if", ] @@ -820,7 +819,7 @@ checksum = "ac4b68190bad25c00b64ea19767b2321a037fc0e5bea7563d5d8e35e04b19c95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.41", ] [[package]] @@ -928,7 +927,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.41", ] [[package]] @@ -1133,7 +1132,7 @@ checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.41", ] [[package]] @@ -1557,7 +1556,7 @@ checksum = "02a5bcaf6704d9354a3071cede7e77d366a5980c7352e102e2c2f9b645b1d3ae" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.41", ] [[package]] @@ -2373,7 +2372,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.41", ] [[package]] @@ -2546,7 +2545,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.41", ] [[package]] @@ -2747,7 +2746,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.41", ] [[package]] @@ -2838,7 +2837,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.41", ] [[package]] @@ -3316,7 +3315,7 @@ checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.41", ] [[package]] @@ -3506,7 +3505,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.40", + "syn 2.0.41", ] [[package]] @@ -3550,9 +3549,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.40" +version = "2.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13fa70a4ee923979ffb522cacce59d34421ebdea5625e1073c4326ef9d2dd42e" +checksum = "44c8b28c477cc3bf0e7966561e3460130e1255f7a1cf71931075f1c5e7a7e269" dependencies = [ "proc-macro2", "quote", @@ -3637,7 +3636,7 @@ checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.41", ] [[package]] @@ -3722,7 +3721,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.41", ] [[package]] @@ -3768,7 +3767,7 @@ dependencies = [ "redox_syscall 0.3.5", "tokio", "tokio-stream", - "xattr 1.1.2", + "xattr 1.1.3", ] [[package]] @@ -3857,7 +3856,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.41", ] [[package]] @@ -4092,7 +4091,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.41", "wasm-bindgen-shared", ] @@ -4126,7 +4125,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.40", + "syn 2.0.41", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4432,9 +4431,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.26" +version = "0.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67b5f0a4e7a27a64c651977932b9dc5667ca7fc31ac44b03ed37a0cf42fdfff" +checksum = "6c830786f7720c2fd27a1a0e27a709dbd3c4d009b56d098fc742d4f4eab91fe2" dependencies = [ "memchr", ] @@ -4470,9 +4469,9 @@ dependencies = [ [[package]] name = "xattr" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d367426ae76bdfce3d8eaea6e94422afd6def7d46f9c89e2980309115b3c2c41" +checksum = "a7dae5072fe1f8db8f8d29059189ac175196e410e40ba42d5d4684ae2f750995" dependencies = [ "libc", "linux-raw-sys", From b296ac53151bff4d466b204ebeb00b4cf3bc49da Mon Sep 17 00:00:00 2001 From: Marcus Griep Date: Thu, 14 Dec 2023 23:14:21 -0700 Subject: [PATCH 1602/2020] fix: remove a trailing slash in registry index URL (#1528) --- crates/binstalk-registry/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/binstalk-registry/src/lib.rs b/crates/binstalk-registry/src/lib.rs index 30923f6a..065bb619 100644 --- a/crates/binstalk-registry/src/lib.rs +++ b/crates/binstalk-registry/src/lib.rs @@ -152,7 +152,7 @@ impl Registry { fn from_str_inner(s: &str) -> Result { if let Some(s) = s.strip_prefix("sparse+") { - let url = Url::parse(s)?; + let url = Url::parse(s.trim_end_matches('/'))?; let scheme = url.scheme(); if scheme != "http" && scheme != "https" { From f23a619a612f75a092facde0de22782d1b22547c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 16 Dec 2023 01:15:39 +0000 Subject: [PATCH 1603/2020] build(deps): bump the deps group with 3 updates (#1530) Bumps the deps group with 3 updates: [file-format](https://github.com/mmalecot/file-format), [home](https://github.com/rust-lang/cargo) and [thiserror](https://github.com/dtolnay/thiserror). Updates `file-format` from 0.22.0 to 0.23.0 - [Release notes](https://github.com/mmalecot/file-format/releases) - [Changelog](https://github.com/mmalecot/file-format/blob/main/CHANGELOG.md) - [Commits](https://github.com/mmalecot/file-format/compare/v0.22.0...v0.23.0) Updates `home` from 0.5.5 to 0.5.9 - [Changelog](https://github.com/rust-lang/cargo/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/cargo/commits) Updates `thiserror` from 1.0.50 to 1.0.51 - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.50...1.0.51) --- updated-dependencies: - dependency-name: file-format dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: home dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 18 +++++++++--------- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- crates/simple-git/Cargo.toml | 2 +- 11 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c8f659d6..4bbd1492 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1002,9 +1002,9 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "file-format" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcb859e047d667f798f913a2cd0d5c214b85944d1191efa8146c98888fc557b" +checksum = "865ed54301d7e5136763302a3c9e595317e08a3119e19a078ab1ed269eb18edc" [[package]] name = "filetime" @@ -2091,11 +2091,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3621,18 +3621,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "f11c217e1416d6f036b870f14e0413d480dbf28edbee1f877abaf0206af43bb7" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df" dependencies = [ "proc-macro2", "quote", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index bcd82635..e9bb98e5 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -27,8 +27,8 @@ binstalk-manifests = { path = "../binstalk-manifests", version = "0.11.0" } clap = { version = "4.4.8", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" -file-format = { version = "0.22.0", default-features = false } -home = "0.5.5" +file-format = { version = "0.23.0", default-features = false } +home = "0.5.9" log = { version = "0.4.18", features = ["std"] } miette = "5.9.0" mimalloc = { version = "0.1.39", default-features = false, optional = true } diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index a8ed8209..99cf929e 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -17,5 +17,5 @@ compact_str = { version = "0.7.0", features = ["serde"] } leon = { version = "2.0.1", path = "../leon" } miette = "5.9.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } -thiserror = "1.0.40" +thiserror = "1.0.51" tracing = "0.1.39" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 4e81186c..005e9455 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -31,7 +31,7 @@ serde_json = { version = "1.0.107", optional = true } #tar = "0.4.38" tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.5.0" -thiserror = "1.0.40" +thiserror = "1.0.51" tokio = { version = "1.35.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.8", features = ["io"] } diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 001e30e2..1cb07af1 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -24,7 +24,7 @@ miette = "5.9.0" minisign-verify = "0.2.1" once_cell = "1.18.0" strum = "0.25.0" -thiserror = "1.0.40" +thiserror = "1.0.51" tokio = { version = "1.35.0", features = ["rt", "sync"], default-features = false } tracing = "0.1.39" url = "2.3.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 87d298bb..120d7c17 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -14,13 +14,13 @@ beef = { version = "0.5.2", features = ["impl_serde"] } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } fs-lock = { version = "0.1.2", path = "../fs-lock" } -home = "0.5.5" +home = "0.5.9" miette = "5.9.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.107" -thiserror = "1.0.40" +thiserror = "1.0.51" toml_edit = { version = "0.21.0", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 17297fcd..9aa69017 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -27,7 +27,7 @@ serde_json = "1.0.107" sha2 = "0.10.7" simple-git = { version = "0.2.0", path = "../simple-git", optional = true } tempfile = "3.5.0" -thiserror = "1.0.40" +thiserror = "1.0.51" tokio = { version = "1.35.0", features = ["rt", "sync"], default-features = false } tracing = "0.1.39" url = "2.3.1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index f34da962..0ba5ffdc 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -30,7 +30,7 @@ simple-git = { version = "0.2.0", path = "../simple-git", optional = true } strum = "0.25.0" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" -thiserror = "1.0.40" +thiserror = "1.0.51" tokio = { version = "1.35.0", features = ["rt", "process", "sync"], default-features = false } tracing = "0.1.39" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 84e9c2a9..633b0ed9 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -15,7 +15,7 @@ compact_str = { version = "0.7.0", features = ["serde"] } glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } serde = "1.0.163" -thiserror = "1.0.40" +thiserror = "1.0.51" tracing = "0.1.39" [dev-dependencies] diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 9614a426..10f87731 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -13,7 +13,7 @@ exclude = ["fuzz", "benches"] [dependencies] clap = { version = "4.4.8", features = ["derive"], optional = true } miette = { version = "5.9.0", default-features = false, optional = true } -thiserror = "1.0.38" +thiserror = "1.0.51" [features] default = ["miette"] diff --git a/crates/simple-git/Cargo.toml b/crates/simple-git/Cargo.toml index 5bcaf325..773e3343 100644 --- a/crates/simple-git/Cargo.toml +++ b/crates/simple-git/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] compact_str = "0.7.0" derive_destructure2 = "0.1" -thiserror = "1.0.40" +thiserror = "1.0.51" tokio = { version = "1.35.0", features = ["rt", "time"], default-features = false } tracing = "0.1.39" From 63179d9993c3dc8caacff504e0934d320f12ee7b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 16 Dec 2023 02:23:28 +0000 Subject: [PATCH 1604/2020] release: binstalk-registry v0.4.1 (#1531) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4bbd1492..dc8fc5cc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -347,7 +347,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.4.0" +version = "0.4.1" dependencies = [ "async-trait", "base16", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 9aa69017..dbd3f563 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.4.0" +version = "0.4.1" edition = "2021" rust-version = "1.65.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 0ba5ffdc..b199245d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.9.5", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.2.2", path = "../binstalk-fetchers", features = ["quickinstall"] } -binstalk-registry = { version = "0.4.0", path = "../binstalk-registry" } +binstalk-registry = { version = "0.4.1", path = "../binstalk-registry" } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "3.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } From ef85500736137075603ad733033ad468c1b07067 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 16 Dec 2023 17:40:00 +1300 Subject: [PATCH 1605/2020] release: cargo-binstall v1.4.8 (#1532) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dc8fc5cc..e981070b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -506,7 +506,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.4.7" +version = "1.4.8" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index e9bb98e5..94ca6a74 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.4.7" +version = "1.4.8" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 88f3195a..f5e1a284 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From fea489032a1a50176ceb0dcd2716a77cc117665a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 19 Dec 2023 19:37:26 +1000 Subject: [PATCH 1606/2020] build(deps): bump actions/{up, down}load-artifact from 3 to 4 (#1533) * build(deps): bump actions/upload-artifact from 3 to 4 Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 3 to 4. - [Release notes](https://github.com/actions/upload-artifact/releases) - [Commits](https://github.com/actions/upload-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/upload-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * build(deps): bump actions/download-artifact from 3 to 4 Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 3 to 4. - [Release notes](https://github.com/actions/download-artifact/releases) - [Commits](https://github.com/actions/download-artifact/compare/v3...v4) --- updated-dependencies: - dependency-name: actions/download-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 10 +++++----- .github/workflows/release-cli.yml | 8 ++++---- .github/workflows/release-packages.yml | 20 ++++++++++---------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48012559..bee7c724 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -172,7 +172,7 @@ jobs: # Set working directory here, otherwise `cargo-zigbuild` would download # and build quite a few unused dependencies. working-directory: crates/detect-targets - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: detect-targets path: target/${{ env.CARGO_BUILD_TARGET }}/debug/detect-targets @@ -183,7 +183,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: detect-targets - run: chmod +x detect-targets @@ -205,7 +205,7 @@ jobs: - ubuntu-latest runs-on: ${{ matrix.os }} steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: detect-targets - run: chmod +x detect-targets @@ -228,7 +228,7 @@ jobs: - fedora runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: detect-targets - run: chmod +x detect-targets @@ -244,7 +244,7 @@ jobs: needs: detect-targets-build runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: detect-targets - run: chmod +x detect-targets diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 677fb6ce..097cc736 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -46,11 +46,11 @@ jobs: env: AGE_KEY_PUBLIC: ${{ vars.AGE_KEY_PUBLIC }} run: .github/scripts/ephemeral-gen.sh - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: minisign.pub path: minisign.pub - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: minisign.key.age path: minisign.key.age @@ -79,7 +79,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: minisign.pub @@ -93,7 +93,7 @@ jobs: run: cargo publish --dry-run -p "$crate" --allow-dirty --no-default-features - if: fromJSON(inputs.info).is-release != 'true' && fromJSON(inputs.info).crate != '' name: Upload crate package as artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: crate-package path: target/package/*.crate diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index 6cc60658..04403e39 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -70,7 +70,7 @@ jobs: - run: just toolchain rust-src - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: minisign.pub - run: just package @@ -85,7 +85,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: minisign.key.age - name: Sign package @@ -107,14 +107,14 @@ jobs: prerelease: true - if: "fromJSON(inputs.publish).is-release != 'true' || runner.os == 'macOS'" name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.t }} path: packages/cargo-binstall-* retention-days: 1 - name: Upload timings - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.t }}-cargo-timings path: target/cargo-timings @@ -138,27 +138,27 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: x86_64h-apple-darwin path: packages/ - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: x86_64-apple-darwin path: packages/ - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: aarch64-apple-darwin path: packages/ - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: minisign.pub - run: ls -shalr packages/ - run: just repackage-lipo - run: ls -shal packages/ - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: minisign.key.age - env: @@ -180,7 +180,7 @@ jobs: prerelease: true - if: fromJSON(inputs.publish).is-release != 'true' name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: universal-apple-darwin path: packages/cargo-binstall-universal-* From bdda03dfd40c84ca3d6cd9bf931b4f98849b1418 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 22 Dec 2023 04:10:35 +0000 Subject: [PATCH 1607/2020] dep: Upgrade transitive dependencies (#1536) Co-authored-by: github-actions --- Cargo.lock | 153 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 87 insertions(+), 66 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e981070b..849fd63f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -82,9 +82,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "59d2a3357dde987206219e78ecfbbb6e8dad06cbb65292758d3270e6254f7355" [[package]] name = "arc-swap" @@ -135,13 +135,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "fdf6721fb0140e4f897002dd086c06f6c27775df19cfe1fccb21181a48fd2c98" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.42", ] [[package]] @@ -549,9 +549,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.17.1" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d1ece59890e746567b467253aea0adbe8a21784d0b025d8a306f66c391c2957" +checksum = "8a969e13a7589e9e3e4207e153bae624ade2b5622fb4684a4923b23ec3d57719" dependencies = [ "serde", "toml", @@ -613,7 +613,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.42", ] [[package]] @@ -819,7 +819,7 @@ checksum = "ac4b68190bad25c00b64ea19767b2321a037fc0e5bea7563d5d8e35e04b19c95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.42", ] [[package]] @@ -927,7 +927,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.42", ] [[package]] @@ -1132,7 +1132,7 @@ checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.42", ] [[package]] @@ -1556,7 +1556,7 @@ checksum = "02a5bcaf6704d9354a3071cede7e77d366a5980c7352e102e2c2f9b645b1d3ae" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.42", ] [[package]] @@ -1730,9 +1730,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.39.0" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ac23ed741583c792f573c028785db683496a6dfcd672ec701ee54ba6a77e1ff" +checksum = "3b2069adc212cf7f3317ef55f6444abd06c50f28479dbbac5a86acf3b05cbbfe" dependencies = [ "gix-actor", "gix-date", @@ -1997,6 +1997,21 @@ dependencies = [ "tracing", ] +[[package]] +name = "h3" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b83e1915177ea624b5bbbdb16bc54f0c106c9664892c695f995e53f5c6793b80" +dependencies = [ + "bytes", + "fastrand 2.0.1", + "futures-util", + "http", + "pin-project-lite", + "tokio", + "tracing", +] + [[package]] name = "h3-quinn" version = "0.0.3" @@ -2005,12 +2020,27 @@ checksum = "2d4a1a1763e4f3e82ee9f1ecf2cf862b22cc7316ebe14684e42f94532b5ec64d" dependencies = [ "bytes", "futures", - "h3", + "h3 0.0.2", "quinn", "quinn-proto", "tokio-util", ] +[[package]] +name = "h3-quinn" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac9675014d703c3d516a121757bbc02e53f1ee838e0729fc7534b35024a81ae4" +dependencies = [ + "bytes", + "futures", + "h3 0.0.3", + "quinn", + "quinn-proto", + "tokio", + "tokio-util", +] + [[package]] name = "hashbrown" version = "0.14.3" @@ -2044,8 +2074,8 @@ dependencies = [ "futures-io", "futures-util", "h2", - "h3", - "h3-quinn", + "h3 0.0.2", + "h3-quinn 0.0.3", "http", "idna 0.4.0", "ipnet", @@ -2151,9 +2181,9 @@ checksum = "86cce260d758a9aa3d7c4b99d55c815a540f8a37514ba6046ab6be402a157cb0" [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" dependencies = [ "bytes", "futures-channel", @@ -2166,7 +2196,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2", "tokio", "tower-service", "tracing", @@ -2255,7 +2285,7 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b58db92f96b720de98181bbbe63c831e87005ab460c1bf306eb2622b4707997f" dependencies = [ - "socket2 0.5.5", + "socket2", "widestring", "windows-sys 0.48.0", "winreg 0.50.0", @@ -2372,7 +2402,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.42", ] [[package]] @@ -2500,9 +2530,9 @@ checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" [[package]] name = "memmap2" -version = "0.9.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deaba38d7abf1d4cca21cc89e932e542ba2b9258664d2a9ef0e61512039c9375" +checksum = "45fd3a57831bf88bc63f8cebc0cf956116276e97fef3966103e96416209f7c92" dependencies = [ "libc", ] @@ -2545,7 +2575,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.42", ] [[package]] @@ -2746,7 +2776,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.42", ] [[package]] @@ -2837,7 +2867,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.42", ] [[package]] @@ -2854,9 +2884,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" [[package]] name = "powerfmt" @@ -2882,9 +2912,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" dependencies = [ "unicode-ident", ] @@ -2912,6 +2942,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ "bytes", + "futures-io", "pin-project-lite", "quinn-proto", "quinn-udp", @@ -2947,7 +2978,7 @@ checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" dependencies = [ "bytes", "libc", - "socket2 0.5.5", + "socket2", "tracing", "windows-sys 0.48.0", ] @@ -3059,9 +3090,9 @@ checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ "async-compression 0.4.5", "base64", @@ -3071,8 +3102,8 @@ dependencies = [ "futures-core", "futures-util", "h2", - "h3", - "h3-quinn", + "h3 0.0.3", + "h3-quinn 0.0.4", "http", "http-body", "hyper", @@ -3315,7 +3346,7 @@ checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.42", ] [[package]] @@ -3331,9 +3362,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] @@ -3445,16 +3476,6 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" -[[package]] -name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - [[package]] name = "socket2" version = "0.5.5" @@ -3505,7 +3526,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.41", + "syn 2.0.42", ] [[package]] @@ -3549,9 +3570,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.41" +version = "2.0.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c8b28c477cc3bf0e7966561e3460130e1255f7a1cf71931075f1c5e7a7e269" +checksum = "5b7d0a2c048d661a1a59fcd7355baa232f7ed34e0ee4df2eef3c1c1c0d3852d8" dependencies = [ "proc-macro2", "quote", @@ -3636,7 +3657,7 @@ checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.42", ] [[package]] @@ -3651,9 +3672,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a34ab300f2dee6e562c10a046fc05e358b29f9bf92277f30c3c8d82275f6f5" +checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" dependencies = [ "deranged", "itoa", @@ -3673,9 +3694,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ad70d68dba9e1f8aceda7aa6711965dfec1cac869f311a51bd08b3a2ccbce20" +checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" dependencies = [ "time-core", ] @@ -3697,9 +3718,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.0" +version = "1.35.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841d45b238a16291a4e1584e61820b8ae57d696cc5015c459c229ccc6990cc1c" +checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" dependencies = [ "backtrace", "bytes", @@ -3708,7 +3729,7 @@ dependencies = [ "num_cpus", "pin-project-lite", "signal-hook-registry", - "socket2 0.5.5", + "socket2", "tokio-macros", "windows-sys 0.48.0", ] @@ -3721,7 +3742,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.42", ] [[package]] @@ -3856,7 +3877,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.42", ] [[package]] @@ -4091,7 +4112,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.42", "wasm-bindgen-shared", ] @@ -4125,7 +4146,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.41", + "syn 2.0.42", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4431,9 +4452,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.28" +version = "0.5.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c830786f7720c2fd27a1a0e27a709dbd3c4d009b56d098fc742d4f4eab91fe2" +checksum = "9b5c3db89721d50d0e2a673f5043fc4722f76dcc352d7b1ab8b8288bed4ed2c5" dependencies = [ "memchr", ] From 55bb7f380570f8edcf95024d36e4443f221ac4ce Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 25 Dec 2023 14:12:29 +1000 Subject: [PATCH 1608/2020] build(deps): bump geekyeggo/delete-artifact from 2 to 4 (#1541) Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 2 to 4. - [Release notes](https://github.com/geekyeggo/delete-artifact/releases) - [Changelog](https://github.com/GeekyEggo/delete-artifact/blob/main/CHANGELOG.md) - [Commits](https://github.com/geekyeggo/delete-artifact/compare/v2...v4) --- updated-dependencies: - dependency-name: geekyeggo/delete-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release-cli.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 097cc736..3340b4ca 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -118,7 +118,7 @@ jobs: - if: fromJSON(inputs.info).is-release == 'true' name: Delete signing key artifact - uses: geekyeggo/delete-artifact@v2 + uses: geekyeggo/delete-artifact@v4 with: name: minisign.key.age failOnError: false From 2c23023069487be9996696eb8230e73e7b1c2efa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Dec 2023 07:01:59 +0000 Subject: [PATCH 1609/2020] build(deps): bump the deps group with 4 updates (#1542) * build(deps): bump the deps group with 4 updates Bumps the deps group with 4 updates: [thiserror](https://github.com/dtolnay/thiserror), [async_zip](https://github.com/Majored/rs-async-zip), [futures-util](https://github.com/rust-lang/futures-rs) and [syn](https://github.com/dtolnay/syn). Updates `thiserror` from 1.0.51 to 1.0.52 - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.51...1.0.52) Updates `async_zip` from 0.0.15 to 0.0.16 - [Release notes](https://github.com/Majored/rs-async-zip/releases) - [Commits](https://github.com/Majored/rs-async-zip/commits/v0.0.16) Updates `futures-util` from 0.3.29 to 0.3.30 - [Release notes](https://github.com/rust-lang/futures-rs/releases) - [Changelog](https://github.com/rust-lang/futures-rs/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/futures-rs/compare/0.3.29...0.3.30) Updates `syn` from 2.0.42 to 2.0.43 - [Release notes](https://github.com/dtolnay/syn/releases) - [Commits](https://github.com/dtolnay/syn/compare/2.0.42...2.0.43) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: async_zip dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: futures-util dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: syn dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps ... Signed-off-by: dependabot[bot] * Fix compilation of `extract_zip_entry`: Relax generic bound Use `futures_io::AsyncRead`, which is the most relaxed bound possible. Signed-off-by: Jiahao XU * ENable feature `async_zip/deflate64` New compression algorithm introduced Signed-off-by: Jiahao XU * Update transitive deps Signed-off-by: Jiahao XU --------- Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU --- Cargo.lock | 209 ++++++++---------- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 7 +- .../src/download/zip_extraction.rs | 7 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- crates/leon-macros/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- crates/simple-git/Cargo.toml | 2 +- 12 files changed, 111 insertions(+), 130 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 849fd63f..f2cbaddf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -98,23 +98,6 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "async-compression" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "942c7cd7ae39e91bde4820d74132e9862e62c2f386c3aa90ccf55949f5bad63a" -dependencies = [ - "bzip2", - "flate2", - "futures-core", - "futures-io", - "memchr", - "pin-project-lite", - "xz2", - "zstd 0.11.2+zstd.1.5.2", - "zstd-safe 5.0.2+zstd.1.5.2", -] - [[package]] name = "async-compression" version = "0.4.5" @@ -123,14 +106,16 @@ checksum = "bc2d0cfb2a7388d34f590e76686704c494ed7aaceed62ee1ba35cbf363abc2a5" dependencies = [ "brotli", "bzip2", + "deflate64", "flate2", "futures-core", + "futures-io", "memchr", "pin-project-lite", "tokio", "xz2", - "zstd 0.13.0", - "zstd-safe 7.0.0", + "zstd", + "zstd-safe", ] [[package]] @@ -141,19 +126,18 @@ checksum = "fdf6721fb0140e4f897002dd086c06f6c27775df19cfe1fccb21181a48fd2c98" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] name = "async_zip" -version = "0.0.15" +version = "0.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795310de3218cde15219fc98c1cf7d8fe9db4865aab27fcf1d535d6cb61c6b54" +checksum = "527207465fb6dcafbf661b0d4a51d0d2306c9d0c2975423079a6caa807930daf" dependencies = [ - "async-compression 0.3.15", + "async-compression", "crc32fast", - "futures-util", - "log", + "futures-lite", "pin-project", "thiserror", "tokio", @@ -269,7 +253,7 @@ dependencies = [ name = "binstalk-downloader" version = "0.9.5" dependencies = [ - "async-compression 0.4.5", + "async-compression", "async-trait", "async_zip", "binstalk-types", @@ -279,6 +263,7 @@ dependencies = [ "compact_str", "default-net", "flate2", + "futures-io", "futures-util", "hickory-resolver", "httpdate", @@ -298,7 +283,7 @@ dependencies = [ "tracing", "url", "xz2", - "zstd 0.13.0", + "zstd", ] [[package]] @@ -613,7 +598,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -705,9 +690,9 @@ dependencies = [ [[package]] name = "crossbeam" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2801af0d36612ae591caa9568261fddce32ce6e08a7275ea334a06a4ad021a2c" +checksum = "6eb9105919ca8e40d437fc9cbb8f1975d916f1bd28afe795a48aae32a2cc8920" dependencies = [ "cfg-if", "crossbeam-channel", @@ -719,9 +704,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.9" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c3242926edf34aec4ac3a77108ad4854bffaa2e4ddc1824124ce59231302d5" +checksum = "82a9b73a36529d9c47029b9fb3a6f0ea3cc916a261195352ba19e770fc1748b2" dependencies = [ "cfg-if", "crossbeam-utils", @@ -740,21 +725,20 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.16" +version = "0.9.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa" +checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d" dependencies = [ "autocfg", "cfg-if", "crossbeam-utils", - "memoffset", ] [[package]] name = "crossbeam-queue" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9bcf5bdbfdd6030fb4a1c497b5d5fc5921aa2f60d359a17e249c0e6df3de153" +checksum = "adc6598521bb5a83d491e8c1fe51db7296019d2ca3cb93cc6c2a20369a4d78a2" dependencies = [ "cfg-if", "crossbeam-utils", @@ -762,9 +746,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.17" +version = "0.8.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" +checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" dependencies = [ "cfg-if", ] @@ -802,6 +786,12 @@ dependencies = [ "windows 0.48.0", ] +[[package]] +name = "deflate64" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61ceff48ed7e0e66d428a569d36485a091c39fe118ee1220217655f6b814fa9" + [[package]] name = "deranged" version = "0.3.10" @@ -819,7 +809,7 @@ checksum = "ac4b68190bad25c00b64ea19767b2321a037fc0e5bea7563d5d8e35e04b19c95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -927,7 +917,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -1078,9 +1068,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1093,9 +1083,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1103,15 +1093,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1120,38 +1110,51 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" + +[[package]] +name = "futures-lite" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aeee267a1883f7ebef3700f262d2d54de95dfaf38189015a74fdc4e0c7ad8143" +dependencies = [ + "fastrand 2.0.1", + "futures-core", + "futures-io", + "parking", + "pin-project-lite", +] [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -1556,7 +1559,7 @@ checksum = "02a5bcaf6704d9354a3071cede7e77d366a5980c7352e102e2c2f9b645b1d3ae" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -2402,7 +2405,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -2537,15 +2540,6 @@ dependencies = [ "libc", ] -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - [[package]] name = "miette" version = "5.10.0" @@ -2575,7 +2569,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -2740,9 +2734,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.1" +version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" dependencies = [ "memchr", ] @@ -2755,9 +2749,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.61" +version = "0.10.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b8419dc8cc6d866deb801274bba2e6f8f6108c1bb7fcc10ee5ab864931dbb45" +checksum = "8cde4d2d9200ad5909f8dac647e29482e07c3a35de8a13fce7c9c7747ad9f671" dependencies = [ "bitflags 2.4.1", "cfg-if", @@ -2776,7 +2770,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -2787,9 +2781,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.97" +version = "0.9.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3eaad34cdd97d81de97964fc7f29e2d104f483840d906ef56daa1912338460b" +checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" dependencies = [ "cc", "libc", @@ -2815,6 +2809,12 @@ version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +[[package]] +name = "parking" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" + [[package]] name = "parking_lot" version = "0.12.1" @@ -2867,7 +2867,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -3094,7 +3094,7 @@ version = "0.11.23" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" dependencies = [ - "async-compression 0.4.5", + "async-compression", "base64", "bytes", "encoding_rs", @@ -3346,7 +3346,7 @@ checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -3526,7 +3526,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -3570,9 +3570,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.42" +version = "2.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b7d0a2c048d661a1a59fcd7355baa232f7ed34e0ee4df2eef3c1c1c0d3852d8" +checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" dependencies = [ "proc-macro2", "quote", @@ -3642,22 +3642,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.51" +version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f11c217e1416d6f036b870f14e0413d480dbf28edbee1f877abaf0206af43bb7" +checksum = "83a48fd946b02c0a526b2e9481c8e2a17755e47039164a86c4070446e3a4614d" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.51" +version = "1.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01742297787513b79cf8e29d1056ede1313e2420b7b3b15d0a768b4921f549df" +checksum = "e7fbe9b594d6568a6a1443250a7e67d80b74e1e96f6d1715e1e21cc1888291d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -3742,7 +3742,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -3877,7 +3877,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", ] [[package]] @@ -4112,7 +4112,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", "wasm-bindgen-shared", ] @@ -4146,7 +4146,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.42", + "syn 2.0.43", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4508,32 +4508,13 @@ dependencies = [ "lzma-sys", ] -[[package]] -name = "zstd" -version = "0.11.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4" -dependencies = [ - "zstd-safe 5.0.2+zstd.1.5.2", -] - [[package]] name = "zstd" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" dependencies = [ - "zstd-safe 7.0.0", -] - -[[package]] -name = "zstd-safe" -version = "5.0.2+zstd.1.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db" -dependencies = [ - "libc", - "zstd-sys", + "zstd-safe", ] [[package]] diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 99cf929e..9ad272a6 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -17,5 +17,5 @@ compact_str = { version = "0.7.0", features = ["serde"] } leon = { version = "2.0.1", path = "../leon" } miette = "5.9.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } -thiserror = "1.0.51" +thiserror = "1.0.52" tracing = "0.1.39" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 005e9455..1493ee62 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -12,13 +12,14 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" async-compression = { version = "0.4.4", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } -async_zip = { version = "0.0.15", features = ["deflate", "bzip2", "lzma", "zstd", "xz", "tokio"] } +async_zip = { version = "0.0.16", features = ["deflate", "deflate64", "bzip2", "lzma", "zstd", "xz", "tokio"] } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" compact_str = "0.7.0" flate2 = { version = "1.0.28", default-features = false } -futures-util = "0.3.28" +futures-util = "0.3.30" +futures-io = "0.3.30" httpdate = "1.0.2" reqwest = { version = "0.11.19", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } percent-encoding = "2.2.0" @@ -31,7 +32,7 @@ serde_json = { version = "1.0.107", optional = true } #tar = "0.4.38" tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.5.0" -thiserror = "1.0.51" +thiserror = "1.0.52" tokio = { version = "1.35.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.8", features = ["io"] } diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index b545ae14..a5a5c961 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -10,13 +10,12 @@ use async_zip::{ }; use bytes::{Bytes, BytesMut}; use futures_util::future::try_join; -use futures_util::io::Take; use thiserror::Error as ThisError; use tokio::{ io::{AsyncRead, AsyncReadExt}, sync::mpsc, }; -use tokio_util::compat::{Compat, FuturesAsyncReadCompatExt}; +use tokio_util::compat::FuturesAsyncReadCompatExt; use super::{DownloadError, ExtractedFiles}; use crate::utils::asyncify; @@ -41,13 +40,13 @@ impl ZipError { } pub(super) async fn extract_zip_entry( - zip_reader: &mut ZipEntryReader<'_, Take>, WithEntry<'_>>, + zip_reader: &mut ZipEntryReader<'_, R, WithEntry<'_>>, path: &Path, buf: &mut BytesMut, extracted_files: &mut ExtractedFiles, ) -> Result<(), DownloadError> where - R: AsyncRead + Unpin + Send + Sync, + R: futures_io::AsyncRead + Unpin + Send + Sync, { // Sanitize filename let raw_filename = zip_reader.entry().filename(); diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 1cb07af1..41dadb57 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -24,7 +24,7 @@ miette = "5.9.0" minisign-verify = "0.2.1" once_cell = "1.18.0" strum = "0.25.0" -thiserror = "1.0.51" +thiserror = "1.0.52" tokio = { version = "1.35.0", features = ["rt", "sync"], default-features = false } tracing = "0.1.39" url = "2.3.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 120d7c17..6b8bfe61 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -20,7 +20,7 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.107" -thiserror = "1.0.51" +thiserror = "1.0.52" toml_edit = { version = "0.21.0", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index dbd3f563..f8bee8d5 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -27,7 +27,7 @@ serde_json = "1.0.107" sha2 = "0.10.7" simple-git = { version = "0.2.0", path = "../simple-git", optional = true } tempfile = "3.5.0" -thiserror = "1.0.51" +thiserror = "1.0.52" tokio = { version = "1.35.0", features = ["rt", "sync"], default-features = false } tracing = "0.1.39" url = "2.3.1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index b199245d..7199c31e 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -30,7 +30,7 @@ simple-git = { version = "0.2.0", path = "../simple-git", optional = true } strum = "0.25.0" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" -thiserror = "1.0.51" +thiserror = "1.0.52" tokio = { version = "1.35.0", features = ["rt", "process", "sync"], default-features = false } tracing = "0.1.39" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 633b0ed9..7107daba 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -15,7 +15,7 @@ compact_str = { version = "0.7.0", features = ["serde"] } glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } serde = "1.0.163" -thiserror = "1.0.51" +thiserror = "1.0.52" tracing = "0.1.39" [dev-dependencies] diff --git a/crates/leon-macros/Cargo.toml b/crates/leon-macros/Cargo.toml index b26e0376..fa323e30 100644 --- a/crates/leon-macros/Cargo.toml +++ b/crates/leon-macros/Cargo.toml @@ -15,5 +15,5 @@ proc-macro = true [dependencies] leon = { version = "2.0.1", path = "../leon", default-features = false } proc-macro2 = "1.0.68" -syn = { version = "2.0.35", default-features = false, features = ["proc-macro", "parsing"] } +syn = { version = "2.0.43", default-features = false, features = ["proc-macro", "parsing"] } quote = "1.0.28" diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 10f87731..4058a0cb 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -13,7 +13,7 @@ exclude = ["fuzz", "benches"] [dependencies] clap = { version = "4.4.8", features = ["derive"], optional = true } miette = { version = "5.9.0", default-features = false, optional = true } -thiserror = "1.0.51" +thiserror = "1.0.52" [features] default = ["miette"] diff --git a/crates/simple-git/Cargo.toml b/crates/simple-git/Cargo.toml index 773e3343..903a2785 100644 --- a/crates/simple-git/Cargo.toml +++ b/crates/simple-git/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] compact_str = "0.7.0" derive_destructure2 = "0.1" -thiserror = "1.0.51" +thiserror = "1.0.52" tokio = { version = "1.35.0", features = ["rt", "time"], default-features = false } tracing = "0.1.39" From c014531bc412503e143e3d886fc8fa34490d0842 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 26 Dec 2023 08:36:48 +0000 Subject: [PATCH 1610/2020] release: binstalk-downloader v0.9.6 (#1545) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f2cbaddf..72e16f11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -251,7 +251,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.9.5" +version = "0.9.6" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 1493ee62..dbc8c0c4 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.9.5" +version = "0.9.6" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 41dadb57..39981dee 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.9.5", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.9.6", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } @@ -30,7 +30,7 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.9.5", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.9.6", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index f8bee8d5..dd9c094e 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.9.5", path = "../binstalk-downloader", default-features = false, features = ["json"] } +binstalk-downloader = { version = "0.9.6", path = "../binstalk-downloader", default-features = false, features = ["json"] } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "3.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } @@ -35,7 +35,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.21.0", features = ["serde"] } -binstalk-downloader = { version = "0.9.5", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } +binstalk-downloader = { version = "0.9.6", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } [features] git = ["simple-git"] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 7199c31e..8dac5477 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.9.5", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.9.6", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.2.2", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.4.1", path = "../binstalk-registry" } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } From b48410fbe852754cd2f5daf985b549431a0c9b39 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 26 Dec 2023 11:04:59 +0000 Subject: [PATCH 1611/2020] release: cargo-binstall v1.4.9 (#1546) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 72e16f11..8d7c193e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -491,7 +491,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.4.8" +version = "1.4.9" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 94ca6a74..6a28cc85 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.4.8" +version = "1.4.9" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index f5e1a284..b4053a63 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From c27f2ae258212e662338175ed048dc3bd91d6d57 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 29 Dec 2023 17:29:26 +1100 Subject: [PATCH 1612/2020] dep: Upgrade transitive dependencies (#1549) Co-authored-by: github-actions --- Cargo.lock | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8d7c193e..6530fe7d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -82,9 +82,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.76" +version = "1.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59d2a3357dde987206219e78ecfbbb6e8dad06cbb65292758d3270e6254f7355" +checksum = "c9d19de80eff169429ac1e9f48fffb163916b448a44e8e046186232046d9e1f9" [[package]] name = "arc-swap" @@ -426,9 +426,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "542f33a8835a0884b006a0c3df3dadd99c0c3f296ed26c2fdc8028e01ad6230c" +checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" dependencies = [ "memchr", "regex-automata", @@ -569,9 +569,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.11" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" +checksum = "dcfab8ba68f3668e89f6ff60f5b205cea56aa7b769451a59f34b8682f51c056d" dependencies = [ "clap_builder", "clap_derive", @@ -579,9 +579,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.11" +version = "4.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" +checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9" dependencies = [ "anstream", "anstyle", @@ -2302,13 +2302,13 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ "hermit-abi", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2527,9 +2527,9 @@ checksum = "df39d232f5c40b0891c10216992c2f250c054105cb1e56f0fc9032db6203ecc1" [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memmap2" @@ -3265,11 +3265,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3608,15 +3608,15 @@ checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" [[package]] name = "tempfile" -version = "3.8.1" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", "fastrand 2.0.1", "redox_syscall 0.4.1", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3788,7 +3788,7 @@ dependencies = [ "redox_syscall 0.3.5", "tokio", "tokio-stream", - "xattr 1.1.3", + "xattr 1.2.0", ] [[package]] @@ -4452,9 +4452,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.30" +version = "0.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b5c3db89721d50d0e2a673f5043fc4722f76dcc352d7b1ab8b8288bed4ed2c5" +checksum = "97a4882e6b134d6c28953a387571f1acdd3496830d5e36c5e3a1075580ea641c" dependencies = [ "memchr", ] @@ -4490,9 +4490,9 @@ dependencies = [ [[package]] name = "xattr" -version = "1.1.3" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7dae5072fe1f8db8f8d29059189ac175196e410e40ba42d5d4684ae2f750995" +checksum = "914566e6413e7fa959cc394fb30e563ba80f3541fbd40816d4c05a0fc3f2a0f1" dependencies = [ "libc", "linux-raw-sys", From cfb41882a2ddc36863ed83c9f38b00f6e22f1c2f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 30 Dec 2023 12:23:48 +1000 Subject: [PATCH 1613/2020] build(deps): bump the deps group with 1 update (#1550) Bumps the deps group with 1 update: [gix](https://github.com/Byron/gitoxide). Updates `gix` from 0.56.0 to 0.57.0 - [Release notes](https://github.com/Byron/gitoxide/releases) - [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md) - [Commits](https://github.com/Byron/gitoxide/compare/gix-v0.56.0...gix-v0.57.0) --- updated-dependencies: - dependency-name: gix dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 217 +++++++++++++++++------------------ crates/simple-git/Cargo.toml | 2 +- 2 files changed, 105 insertions(+), 114 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6530fe7d..0c892f58 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -957,15 +957,6 @@ dependencies = [ "libc", ] -[[package]] -name = "faster-hex" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "239f7bfb930f820ab16a9cd95afc26f88264cf6905c960b340a615384aa3338a" -dependencies = [ - "serde", -] - [[package]] name = "faster-hex" version = "0.9.0" @@ -1197,9 +1188,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gix" -version = "0.56.0" +version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b0dcdc9c60d66535897fa40a7ea2a635e72f99456b1d9ae86b7e170e80618cb" +checksum = "721c7497ab24b665ed5a1eb2b3526936aa60068e61ba260651f7e77c52feec69" dependencies = [ "gix-actor", "gix-attributes", @@ -1253,9 +1244,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2eadca029ef716b4378f7afb19f7ee101fde9e58ba1f1445971315ac866db417" +checksum = "886014c4865b93ce268f1d3eddd4fd3261242c3f3ee61eb36009f913016a9059" dependencies = [ "bstr", "btoi", @@ -1267,9 +1258,9 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.20.1" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f395469d38c76ec47cd1a6c5a53fbc3f13f737b96eaf7535f4e6b367e643381" +checksum = "7988e14ef81f36ea4b55db0e81b69d854707b032bcbd4d2e8652b8fbe77d03d2" dependencies = [ "bstr", "gix-glob", @@ -1284,27 +1275,27 @@ dependencies = [ [[package]] name = "gix-bitmap" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d49e1a13a30d3f88be4bceae184dd13a2d3fb9ffa7515f7ed7ae771b857f4916" +checksum = "fd1c96bc0b2bba51d8460ba55f1a7c9d74532d58f11fac60b652c8be2c8539d4" dependencies = [ "thiserror", ] [[package]] name = "gix-chunk" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d411ecd9b558b0c20b3252b7e409eec48eabc41d18324954fe526bac6e2db55f" +checksum = "2ade37ef69870de0ed966b97c57a3a947a22ff3482a52c3b99b205f77bcb08fb" dependencies = [ "thiserror", ] [[package]] name = "gix-command" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b54c1d8d63e6ef2adbd9b94d6e49ff168858510b44d3811cdd02dfacc4f0c9" +checksum = "9abdc8cd59add5a13fd0d639df3442d7ce7737da70862e508f749bfb869b0e51" dependencies = [ "bstr", "gix-path", @@ -1314,9 +1305,9 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.22.1" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85a7007ba021f059803afaf6f8a48872422abc20550ac12ede6ddea2936cec36" +checksum = "e7559ea9cefee188cd88b05afcc8e3ef7a3cb4a5c647bccf06b981e591b02b77" dependencies = [ "bstr", "gix-chunk", @@ -1328,9 +1319,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0341471d55d8676e98b88e121d7065dfa4c9c5acea4b6d6ecdd2846e85cce0c3" +checksum = "9c35dc7f9c00a42bbc9cfa1ca2ec0a78ad1b76ff0736d3d35dfd612962244467" dependencies = [ "bstr", "gix-config-value", @@ -1349,9 +1340,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6419db582ea84dfb58c7e7b0af7fd62c808aa14954af2936a33f89b0f4ed018e" +checksum = "39f388cb2396aee82d6f460a2e7770659bdf8854e9e5478f7d2b1324a9698284" dependencies = [ "bitflags 2.4.1", "bstr", @@ -1362,9 +1353,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "513dac42450b27946bd0a0535a3a5a88e473d6522e5e3439a129cab779c88f3d" +checksum = "1fbeb9722ea91b2b674355de6dc17b717c80b140235fb448ea340e0137d30aa0" dependencies = [ "bstr", "gix-command", @@ -1379,9 +1370,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "468dfbe411f335f01525a1352271727f8e7772075a93fa747260f502086b30be" +checksum = "9d85f4a01e0d05c3de585e28bae514d4baf01655e3fc3f14ce6f30bf62405345" dependencies = [ "bstr", "itoa", @@ -1391,9 +1382,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8119a985887cfe68f4bdf92e51bd64bc758a73882d82fcfc03ebcb164441c85d" +checksum = "ac0e75f5afd2f6c47c800b6b0a000a08045739d0450d20482e8faa42543f62d1" dependencies = [ "bstr", "gix-hash", @@ -1403,9 +1394,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fad89416ebe0b3b7df78464124e2a02417b6cd3743d48ad93df86f4d2929c07" +checksum = "f0b63ce2ad81632ac1a84ac370f85a5e580c3261580bd85ea17ff35d3a0bba18" dependencies = [ "bstr", "dunce", @@ -1418,9 +1409,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.36.1" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d46a4a5c6bb5bebec9c0d18b65ada20e6517dbd7cf855b87dd4bbdce3a771b2" +checksum = "befe7edea299a824504b5acc96d7a3a538125b38c42f3a8379f6912a29c90c81" dependencies = [ "bytes", "bytesize", @@ -1442,9 +1433,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d6a5c9d8e55c364e7c226919c19c9a28be1392d6208b5008059fa94ff7e2bf0" +checksum = "7337fc67a428e098206b77fef0e57b07af24067c1a73ea86dd757f828418bf02" dependencies = [ "bstr", "encoding_rs", @@ -1463,18 +1454,18 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20e86eb040f5776a5ade092282e51cdcad398adb77d948b88d17583c2ae4e107" +checksum = "007017ce93b819ea52c0ec68306f7d72212a2d307c3d70f1548c7141c015d0a1" dependencies = [ "gix-features", ] [[package]] name = "gix-glob" -version = "0.14.1" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db19298c5eeea2961e5b3bf190767a2d1f09b8802aeb5f258e42276350aff19" +checksum = "61fb116c2516d3a1170e010118f639944a6389872c875a008960cdab2a44ac72" dependencies = [ "bitflags 2.4.1", "bstr", @@ -1484,19 +1475,19 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.13.3" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8cf8c2266f63e582b7eb206799b63aa5fa68ee510ad349f637dfe2d0653de0" +checksum = "c52c3170a17b6031833cd2eb4ad7bc23f2755d06e6e70f78dec21d42e8fe1b30" dependencies = [ - "faster-hex 0.9.0", + "faster-hex", "thiserror", ] [[package]] name = "gix-hashtable" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "feb61880816d7ec4f0b20606b498147d480860ddd9133ba542628df2f548d3ca" +checksum = "40a838e6366a5e5b84668b6997ce0981b833136468e8ba949f424c0ef2927eba" dependencies = [ "gix-hash", "hashbrown", @@ -1505,9 +1496,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a215cc8cf21645bca131fcf6329d3ebd46299c47dbbe27df71bb1ca9e328b879" +checksum = "9f3eac0757be81b910f080d7a3829b141bc473904682905f039c95b8001be22c" dependencies = [ "bstr", "gix-glob", @@ -1517,9 +1508,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.27.1" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3f308f5cd2992e96a274b0d1931e9a0e44fdcba87695ead3f6df30d8a697e9c" +checksum = "bc091900d4c770997c7cb9532657e66639acfc37a5e941a34e4dab13814137a2" dependencies = [ "bitflags 2.4.1", "bstr", @@ -1542,9 +1533,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "11.0.1" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e5c65e6a29830a435664891ced3f3c1af010f14900226019590ee0971a22f37" +checksum = "6cf112ddee94223c119a8534dad027740dc3aba3365ac5edeef8a7f6660c74db" dependencies = [ "gix-tempfile", "gix-utils", @@ -1553,9 +1544,9 @@ dependencies = [ [[package]] name = "gix-macros" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02a5bcaf6704d9354a3071cede7e77d366a5980c7352e102e2c2f9b645b1d3ae" +checksum = "fc207b64189cf71bcb17fc841ab99a5d63d0845546b611e2703ce467f659323a" dependencies = [ "proc-macro2", "quote", @@ -1564,9 +1555,9 @@ dependencies = [ [[package]] name = "gix-negotiate" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "979f6accd9c051b3dd018b50adf29c0a2459edddf6105cc70b767976cd6f8014" +checksum = "b512d472d5f1900f19d1e272b9140d4a7bb083914a46dacd1f6f7c1d561d0d6e" dependencies = [ "bitflags 2.4.1", "gix-commitgraph", @@ -1580,9 +1571,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.39.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "febf79c5825720c1c63fe974c7bbe695d0cb54aabad73f45671c60ce0e501e33" +checksum = "e4c77e47ffba92127faf632a841fce23d19547e269bd8b88e68961a70eab4e93" dependencies = [ "bstr", "btoi", @@ -1599,9 +1590,9 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.55.0" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fae5f971540c99c6ecc8d4368ecc9d18a9dc8b9391025c68c4399747dc93bac" +checksum = "a3254f2005cc7553ea78e85e816a09150c6f7a64e6b7627b8d1fdc56721bea73" dependencies = [ "arc-swap", "gix-date", @@ -1618,9 +1609,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.45.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569491c92446fddf373456ff360aff9a9effd627b40a70f2d7914dcd75a3205" +checksum = "02ebc8cd657eec207d82d8f876ca402361308ecd3c87a47935b0299506257b4f" dependencies = [ "clru", "gix-chunk", @@ -1639,33 +1630,33 @@ dependencies = [ [[package]] name = "gix-packetline" -version = "0.17.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03b9fcc4425bd64c585440d14e5d2405a399f323429401571ba56a2c6d111865" +checksum = "6d1696f4227aa943497dccc38b7843bf83b56bd12a8c66effe47ecee31d72959" dependencies = [ "bstr", - "faster-hex 0.8.1", + "faster-hex", "gix-trace", "thiserror", ] [[package]] name = "gix-packetline-blocking" -version = "0.17.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50052c0f76c5af5acda41177fb55b60c1e484cc246ae919d8d21129cd1000a4e" +checksum = "3782e1ef002d177c219fe7d21108becc42131d8619991290dfd5730cd2f285e9" dependencies = [ "bstr", - "faster-hex 0.8.1", + "faster-hex", "gix-trace", "thiserror", ] [[package]] name = "gix-path" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86d6fac2fabe07b67b7835f46d07571f68b11aa1aaecae94fe722ea4ef305e1" +checksum = "10931652a3da126990ac93bce1b1c600cc99d7c268d712b6360ed52174ce1b68" dependencies = [ "bstr", "gix-trace", @@ -1676,9 +1667,9 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dbbb92f75a38ef043c8bb830b339b38d0698d7f3746968b5fcbade7a880494d" +checksum = "15789ea68bf44addba50cee259844018c33c685dc68ba3c45a1e84194c320964" dependencies = [ "bitflags 2.4.1", "bstr", @@ -1691,9 +1682,9 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4967b921304a5355e65a6257280eddf6e0f9ce3df111256531460adca3771305" +checksum = "c0671492962e4395234fcd7c6184faad00f98639f5e229c3003a23ad08fd6d55" dependencies = [ "gix-command", "gix-config-value", @@ -1704,9 +1695,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.42.0" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95736ef407db0bd15a5bdea791fbfcf523b9f13b96c852c240cd86a9ee0ef817" +checksum = "2d55275f585f801bc4f6964f7d0734b98c511d1dd7f16ac15f4ebef44a67dc4f" dependencies = [ "bstr", "btoi", @@ -1722,9 +1713,9 @@ dependencies = [ [[package]] name = "gix-quote" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f84845efa535468bc79c5a87b9d29219f1da0313c8ecf0365a5daa7e72786f2" +checksum = "6c43530cb94a7759807e6f8d180e17ac9c65673b891645c6c433831dc0cf4342" dependencies = [ "bstr", "btoi", @@ -1733,9 +1724,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.39.1" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2069adc212cf7f3317ef55f6444abd06c50f28479dbbac5a86acf3b05cbbfe" +checksum = "baa951b3b850d6d1be4f900768e49af20b76bf9505beac22af723d57249a2f1d" dependencies = [ "gix-actor", "gix-date", @@ -1754,9 +1745,9 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d9d3b82e1ee78fc0dc1c37ea5ea76c2dbc73f407db155f0dfcea285e583bee" +checksum = "88c61f849d58c06e3068a0b601cf10127d2a07cdad00a725ed66cf303f76f6b3" dependencies = [ "bstr", "gix-hash", @@ -1768,9 +1759,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe5dd51710ce5434bc315ea30394fab483c5377276494edd79222b321a5a9544" +checksum = "bcbbf91f4200c5c76802ef5f057b96f5a336827508881fe55a780be71a794d22" dependencies = [ "bstr", "gix-date", @@ -1784,9 +1775,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d4ed2493ca94a475fdf147138e1ef8bab3b6ebb56abf3d9bda1c05372ec1dd" +checksum = "33ab66354d83f70f2730391747d0c75f94ef3c3dd40ebde2e206db9faaf7a0a7" dependencies = [ "gix-commitgraph", "gix-date", @@ -1799,21 +1790,21 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a36ea2c5907d64a9b4b5d3cc9f430e6c30f0509646b5e38eb275ca57c5bf29e2" +checksum = "a9963f38a42144253ed4d571882d7db5ef644c12e6726e4b75135597cc9d0e1a" dependencies = [ "bitflags 2.4.1", "gix-path", "libc", - "windows 0.48.0", + "windows 0.52.0", ] [[package]] name = "gix-submodule" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02a3d7f60a95bdcaeb8981663c99d1c9f4de42aab1169524c949e948989809f9" +checksum = "f139195283be6e2ee139e05f2360d7cefc8168844da2ae90f194d75fb6a5fda9" dependencies = [ "bstr", "gix-config", @@ -1826,9 +1817,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "11.0.1" +version = "12.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388dd29114a86ec69b28d1e26d6d63a662300ecf61ab3f4cc578f7d7dc9e7e23" +checksum = "e76a494bd530e1a1309188ff971825a24f159c76c2db0bf71fa5dfb469a2c915" dependencies = [ "gix-fs", "libc", @@ -1839,15 +1830,15 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b686a35799b53a9825575ca3f06481d0a053a409c4d97ffcf5ddd67a8760b497" +checksum = "bda62acb44dd86a40c7c3762a5403cfc1ac789ea559df54085cedf79864f809e" [[package]] name = "gix-transport" -version = "0.39.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f731cfefc4d62468c6dd2053f5c6707828256a6d2f5488c1811e3f42c178b144" +checksum = "8ed85964df9ab65f998aa0e50a755e61ad2458b43610a1085cf2f1bcb74d972e" dependencies = [ "base64", "bstr", @@ -1864,9 +1855,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2112088122a0206592c84fbd42020db63b2ccaed66a0293779f2e5fbf80474" +checksum = "8661fab39985c9214e56d81a63ceb5886ac948cec2fba76c39494d1e0e307ea8" dependencies = [ "gix-commitgraph", "gix-date", @@ -1880,9 +1871,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.25.2" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c427a1a11ccfa53a4a2da47d9442c2241deee63a154bc15cc14b8312fbc4005" +checksum = "10a0129c1e8b52736d7c5128300a4485dbc85863001371e2771ac1754bd89fd7" dependencies = [ "bstr", "gix-features", @@ -1894,18 +1885,18 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f82c41937f00e15a1f6cb0b55307f0ca1f77f4407ff2bf440be35aa688c6a3e" +checksum = "ab9277a5e32e85d53f738096d872a4a9b76067ad471894ad31bd99c8fa2da1dc" dependencies = [ "fastrand 2.0.1", ] [[package]] name = "gix-validate" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b7d8e4274be69f284bbc7e6bb2ccf7065dbcdeba22d8c549f2451ae426883f" +checksum = "f805ebbdbaa4bfd98e2ee43e6d14099b8a4d9141f5d7b8202fea4d48e44263e7" dependencies = [ "bstr", "thiserror", @@ -1913,9 +1904,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f1d0ae01dee14abe8c8117d78d7518f9a507de2dc4522546fbf4c444e9860b4" +checksum = "11f5b03e5733180229f2d92d03b35f8ad5da5cb7c94148b923acc1f0e93d34f3" dependencies = [ "bstr", "gix-attributes", @@ -1931,9 +1922,9 @@ dependencies = [ [[package]] name = "gix-worktree-state" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afef3c1cfe610ccfbca391515a1254662a648ce2635c9f60511eb1feb751fa01" +checksum = "ef560bd2c346a0002a13cc5ed29d78113f971a4dbf84fce7e0297e6d65490bc0" dependencies = [ "bstr", "gix-features", @@ -2921,9 +2912,9 @@ dependencies = [ [[package]] name = "prodash" -version = "26.2.2" +version = "28.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794b5bf8e2d19b53dcdcec3e4bba628e20f5b6062503ba89281fa7037dd7bbcf" +checksum = "744a264d26b88a6a7e37cbad97953fa233b94d585236310bcbc88474b4092d79" dependencies = [ "bytesize", "human_format", diff --git a/crates/simple-git/Cargo.toml b/crates/simple-git/Cargo.toml index 903a2785..5cf113f3 100644 --- a/crates/simple-git/Cargo.toml +++ b/crates/simple-git/Cargo.toml @@ -18,7 +18,7 @@ tokio = { version = "1.35.0", features = ["rt", "time"], default-features = fals tracing = "0.1.39" [dependencies.gix] -version = "0.56.0" +version = "0.57.0" default-features = false features = [ "comfort", From 5d030ffc8ba7e5df1ffa982b60322499e7ac3b84 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 6 Jan 2024 00:19:52 +1000 Subject: [PATCH 1614/2020] dep: Upgrade transitive dependencies (#1553) Co-authored-by: github-actions --- Cargo.lock | 294 ++++++++++++++++++++++++++--------------------------- 1 file changed, 147 insertions(+), 147 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0c892f58..f8a0f734 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -82,9 +82,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.77" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9d19de80eff169429ac1e9f48fffb163916b448a44e8e046186232046d9e1f9" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "arc-swap" @@ -120,13 +120,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.75" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdf6721fb0140e4f897002dd086c06f6c27775df19cfe1fccb21181a48fd2c98" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -569,9 +569,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.12" +version = "4.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfab8ba68f3668e89f6ff60f5b205cea56aa7b769451a59f34b8682f51c056d" +checksum = "52bdc885e4cacc7f7c9eedc1ef6da641603180c783c41a15c264944deeaab642" dependencies = [ "clap_builder", "clap_derive", @@ -598,7 +598,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -672,9 +672,9 @@ checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -794,9 +794,9 @@ checksum = "c61ceff48ed7e0e66d428a569d36485a091c39fe118ee1220217655f6b814fa9" [[package]] name = "deranged" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb30d70a07a3b04884d2677f06bec33509dc67ca60d92949e5535352d3191dc" +checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" dependencies = [ "powerfmt", ] @@ -809,7 +809,7 @@ checksum = "ac4b68190bad25c00b64ea19767b2321a037fc0e5bea7563d5d8e35e04b19c95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -917,7 +917,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -1126,7 +1126,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -1188,9 +1188,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gix" -version = "0.57.0" +version = "0.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721c7497ab24b665ed5a1eb2b3526936aa60068e61ba260651f7e77c52feec69" +checksum = "6dd025382892c7b500a9ce1582cd803f9c2ebfe44aff52e9c7f86feee7ced75e" dependencies = [ "gix-actor", "gix-attributes", @@ -1244,9 +1244,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.29.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "886014c4865b93ce268f1d3eddd4fd3261242c3f3ee61eb36009f913016a9059" +checksum = "da27b5ab4ab5c75ff891dccd48409f8cc53c28a79480f1efdd33184b2dc1d958" dependencies = [ "bstr", "btoi", @@ -1258,9 +1258,9 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7988e14ef81f36ea4b55db0e81b69d854707b032bcbd4d2e8652b8fbe77d03d2" +checksum = "bd6de7603d6bcefcf9a1d87779c4812b14665f71bc870df7ce9ca4c4b309de18" dependencies = [ "bstr", "gix-glob", @@ -1275,27 +1275,27 @@ dependencies = [ [[package]] name = "gix-bitmap" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd1c96bc0b2bba51d8460ba55f1a7c9d74532d58f11fac60b652c8be2c8539d4" +checksum = "78b6cd0f246180034ddafac9b00a112f19178135b21eb031b3f79355891f7325" dependencies = [ "thiserror", ] [[package]] name = "gix-chunk" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ade37ef69870de0ed966b97c57a3a947a22ff3482a52c3b99b205f77bcb08fb" +checksum = "003ec6deacf68076a0c157271a127e0bb2c031c1a41f7168cbe5d248d9b85c78" dependencies = [ "thiserror", ] [[package]] name = "gix-command" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9abdc8cd59add5a13fd0d639df3442d7ce7737da70862e508f749bfb869b0e51" +checksum = "deefa783a418ceb5ae88d0701ab110efaec2df398f4520d90529dec543e48467" dependencies = [ "bstr", "gix-path", @@ -1305,9 +1305,9 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.23.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7559ea9cefee188cd88b05afcc8e3ef7a3cb4a5c647bccf06b981e591b02b77" +checksum = "8a39c675fd737cb43a2120eddf1aa652c19d76b28d79783a198ac1b398ed9ce6" dependencies = [ "bstr", "gix-chunk", @@ -1319,9 +1319,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.33.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c35dc7f9c00a42bbc9cfa1ca2ec0a78ad1b76ff0736d3d35dfd612962244467" +checksum = "367304855b369cadcac4ee5fb5a3a20da9378dd7905106141070b79f85241079" dependencies = [ "bstr", "gix-config-value", @@ -1340,9 +1340,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.2" +version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39f388cb2396aee82d6f460a2e7770659bdf8854e9e5478f7d2b1324a9698284" +checksum = "52e0be46f4cf1f8f9e88d0e3eb7b29718aff23889563249f379119bd1ab6910e" dependencies = [ "bitflags 2.4.1", "bstr", @@ -1353,9 +1353,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.23.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fbeb9722ea91b2b674355de6dc17b717c80b140235fb448ea340e0137d30aa0" +checksum = "380cf3a7c31763743ae6403ec473281d54bfa05628331d09518a350ad5a0971f" dependencies = [ "bstr", "gix-command", @@ -1370,9 +1370,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d85f4a01e0d05c3de585e28bae514d4baf01655e3fc3f14ce6f30bf62405345" +checksum = "fb7f3dfb72bebe3449b5e642be64e3c6ccbe9821c8b8f19f487cf5bfbbf4067e" dependencies = [ "bstr", "itoa", @@ -1382,9 +1382,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.39.0" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac0e75f5afd2f6c47c800b6b0a000a08045739d0450d20482e8faa42543f62d1" +checksum = "fd6a0454f8c42d686f17e7f084057c717c082b7dbb8209729e4e8f26749eb93a" dependencies = [ "bstr", "gix-hash", @@ -1394,9 +1394,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0b63ce2ad81632ac1a84ac370f85a5e580c3261580bd85ea17ff35d3a0bba18" +checksum = "b8d7b2896edc3d899d28a646ccc6df729827a6600e546570b2783466404a42d6" dependencies = [ "bstr", "dunce", @@ -1409,9 +1409,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.37.0" +version = "0.37.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "befe7edea299a824504b5acc96d7a3a538125b38c42f3a8379f6912a29c90c81" +checksum = "77a80f0fe688d654c2a741751578b11131071026d1934d03c1820d6d767525ce" dependencies = [ "bytes", "bytesize", @@ -1433,9 +1433,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7337fc67a428e098206b77fef0e57b07af24067c1a73ea86dd757f828418bf02" +checksum = "f598c1d688bf9d57f428ed7ee70c3e786d6f0cc7ed1aeb3c982135af41f6e516" dependencies = [ "bstr", "encoding_rs", @@ -1454,18 +1454,18 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "007017ce93b819ea52c0ec68306f7d72212a2d307c3d70f1548c7141c015d0a1" +checksum = "7555c23a005537434bbfcb8939694e18cad42602961d0de617f8477cc2adecdd" dependencies = [ "gix-features", ] [[package]] name = "gix-glob" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61fb116c2516d3a1170e010118f639944a6389872c875a008960cdab2a44ac72" +checksum = "ae6232f18b262770e343dcdd461c0011c9b9ae27f0c805e115012aa2b902c1b8" dependencies = [ "bitflags 2.4.1", "bstr", @@ -1475,9 +1475,9 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c52c3170a17b6031833cd2eb4ad7bc23f2755d06e6e70f78dec21d42e8fe1b30" +checksum = "b0ed89cdc1dce26685c80271c4287077901de3c3dd90234d5fa47c22b2268653" dependencies = [ "faster-hex", "thiserror", @@ -1485,9 +1485,9 @@ dependencies = [ [[package]] name = "gix-hashtable" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40a838e6366a5e5b84668b6997ce0981b833136468e8ba949f424c0ef2927eba" +checksum = "ebe47d8c0887f82355e2e9e16b6cecaa4d5e5346a7a474ca78ff94de1db35a5b" dependencies = [ "gix-hash", "hashbrown", @@ -1496,9 +1496,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3eac0757be81b910f080d7a3829b141bc473904682905f039c95b8001be22c" +checksum = "f356ce440c60aedb7e72f3447f352f9c5e64352135c8cf33e838f49760fd2643" dependencies = [ "bstr", "gix-glob", @@ -1508,9 +1508,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc091900d4c770997c7cb9532657e66639acfc37a5e941a34e4dab13814137a2" +checksum = "bd97a226ea6a7669109b84fa045bada556ec925e25145cb458adb4958b023ad0" dependencies = [ "bitflags 2.4.1", "bstr", @@ -1533,9 +1533,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "12.0.0" +version = "12.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cf112ddee94223c119a8534dad027740dc3aba3365ac5edeef8a7f6660c74db" +checksum = "f40a439397f1e230b54cf85d52af87e5ea44cc1e7748379785d3f6d03d802b00" dependencies = [ "gix-tempfile", "gix-utils", @@ -1544,20 +1544,20 @@ dependencies = [ [[package]] name = "gix-macros" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc207b64189cf71bcb17fc841ab99a5d63d0845546b611e2703ce467f659323a" +checksum = "d75e7ab728059f595f6ddc1ad8771b8d6a231971ae493d9d5948ecad366ee8bb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] name = "gix-negotiate" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b512d472d5f1900f19d1e272b9140d4a7bb083914a46dacd1f6f7c1d561d0d6e" +checksum = "e6820bb5e9e259f6ad052826037452ca023d4f248c5d710dce067d89685dd582" dependencies = [ "bitflags 2.4.1", "gix-commitgraph", @@ -1571,9 +1571,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.40.0" +version = "0.40.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4c77e47ffba92127faf632a841fce23d19547e269bd8b88e68961a70eab4e93" +checksum = "0c89402e8faa41b49fde348665a8f38589e461036475af43b6b70615a6a313a2" dependencies = [ "bstr", "btoi", @@ -1590,9 +1590,9 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.56.0" +version = "0.56.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3254f2005cc7553ea78e85e816a09150c6f7a64e6b7627b8d1fdc56721bea73" +checksum = "46ae6da873de41c6c2b73570e82c571b69df5154dcd8f46dfafc6687767c33b1" dependencies = [ "arc-swap", "gix-date", @@ -1609,9 +1609,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.46.0" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02ebc8cd657eec207d82d8f876ca402361308ecd3c87a47935b0299506257b4f" +checksum = "782b4d42790a14072d5c400deda9851f5765f50fe72bca6dece0da1cd6f05a9a" dependencies = [ "clru", "gix-chunk", @@ -1630,9 +1630,9 @@ dependencies = [ [[package]] name = "gix-packetline" -version = "0.17.1" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d1696f4227aa943497dccc38b7843bf83b56bd12a8c66effe47ecee31d72959" +checksum = "f894634991382500b9c701550e2b4f64c411d5582adbebcc748a4511feb4356d" dependencies = [ "bstr", "faster-hex", @@ -1642,9 +1642,9 @@ dependencies = [ [[package]] name = "gix-packetline-blocking" -version = "0.17.1" +version = "0.17.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3782e1ef002d177c219fe7d21108becc42131d8619991290dfd5730cd2f285e9" +checksum = "c67ed1571267cc92ee64ab3e39eeaef46e5fc690bac9d12f1ddd1b1331be10dc" dependencies = [ "bstr", "faster-hex", @@ -1654,9 +1654,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10931652a3da126990ac93bce1b1c600cc99d7c268d712b6360ed52174ce1b68" +checksum = "b8dd0998ab245f33d40ca2267e58d542fe54185ebd1dc41923346cf28d179fb6" dependencies = [ "bstr", "gix-trace", @@ -1667,9 +1667,9 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15789ea68bf44addba50cee259844018c33c685dc68ba3c45a1e84194c320964" +checksum = "0cdb0ee9517c04f89bcaf6366fe893a17154ecb02d88b5c8174f27f1091d1247" dependencies = [ "bitflags 2.4.1", "bstr", @@ -1682,9 +1682,9 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0671492962e4395234fcd7c6184faad00f98639f5e229c3003a23ad08fd6d55" +checksum = "02bd89d058258e53e0fd6c57f13ee16c5673a83066a68e11f88626fc8cfda5f6" dependencies = [ "gix-command", "gix-config-value", @@ -1695,9 +1695,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.43.0" +version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d55275f585f801bc4f6964f7d0734b98c511d1dd7f16ac15f4ebef44a67dc4f" +checksum = "eca52738435991105f3bbd7f3a3a42cdf84c9992a78b9b7b1de528b3c022cfdd" dependencies = [ "bstr", "btoi", @@ -1713,9 +1713,9 @@ dependencies = [ [[package]] name = "gix-quote" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c43530cb94a7759807e6f8d180e17ac9c65673b891645c6c433831dc0cf4342" +checksum = "9f7dc10303d73a960d10fb82f81188b036ac3e6b11b5795b20b1a60b51d1321f" dependencies = [ "bstr", "btoi", @@ -1724,9 +1724,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.40.0" +version = "0.40.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baa951b3b850d6d1be4f900768e49af20b76bf9505beac22af723d57249a2f1d" +checksum = "64d9bd1984638d8f3511a2fcbe84fcedb8a5b5d64df677353620572383f42649" dependencies = [ "gix-actor", "gix-date", @@ -1745,9 +1745,9 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88c61f849d58c06e3068a0b601cf10127d2a07cdad00a725ed66cf303f76f6b3" +checksum = "be219df5092c1735abb2a53eccdf775e945eea6986ee1b6e7a5896dccc0be704" dependencies = [ "bstr", "gix-hash", @@ -1759,9 +1759,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcbbf91f4200c5c76802ef5f057b96f5a336827508881fe55a780be71a794d22" +checksum = "aa78e1df3633bc937d4db15f8dca2abdb1300ca971c0fabcf9fa97e38cf4cd9f" dependencies = [ "bstr", "gix-date", @@ -1775,9 +1775,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab66354d83f70f2730391747d0c75f94ef3c3dd40ebde2e206db9faaf7a0a7" +checksum = "702de5fe5c2bbdde80219f3a8b9723eb927466e7ecd187cfd1b45d986408e45f" dependencies = [ "gix-commitgraph", "gix-date", @@ -1790,9 +1790,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.10.2" +version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9963f38a42144253ed4d571882d7db5ef644c12e6726e4b75135597cc9d0e1a" +checksum = "78f6dce0c6683e2219e8169aac4b1c29e89540a8262fef7056b31d80d969408c" dependencies = [ "bitflags 2.4.1", "gix-path", @@ -1802,9 +1802,9 @@ dependencies = [ [[package]] name = "gix-submodule" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139195283be6e2ee139e05f2360d7cefc8168844da2ae90f194d75fb6a5fda9" +checksum = "21d438409222de24dffcc9897f04a9f97903a19fe4835b598ab3bb9b6e0f5e35" dependencies = [ "bstr", "gix-config", @@ -1817,9 +1817,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "12.0.0" +version = "12.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e76a494bd530e1a1309188ff971825a24f159c76c2db0bf71fa5dfb469a2c915" +checksum = "a8ef376d718b1f5f119b458e21b00fbf576bc9d4e26f8f383d29f5ffe3ba3eaa" dependencies = [ "gix-fs", "libc", @@ -1830,15 +1830,15 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda62acb44dd86a40c7c3762a5403cfc1ac789ea559df54085cedf79864f809e" +checksum = "e8e1127ede0475b58f4fe9c0aaa0d9bb0bad2af90bbd93ccd307c8632b863d89" [[package]] name = "gix-transport" -version = "0.40.0" +version = "0.40.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ed85964df9ab65f998aa0e50a755e61ad2458b43610a1085cf2f1bcb74d972e" +checksum = "be01a22053e9395a409fcaeed879d94f4fcffeb4f46de7143275fbf5e5b39770" dependencies = [ "base64", "bstr", @@ -1855,9 +1855,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.36.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8661fab39985c9214e56d81a63ceb5886ac948cec2fba76c39494d1e0e307ea8" +checksum = "cb64213e52e1b726cb04581690c1e98b5910f983b977d5e9f2eb09f1a7fea6d2" dependencies = [ "gix-commitgraph", "gix-date", @@ -1871,9 +1871,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10a0129c1e8b52736d7c5128300a4485dbc85863001371e2771ac1754bd89fd7" +checksum = "8f0f17cceb7552a231d1fec690bc2740c346554e3be6f5d2c41dfa809594dc44" dependencies = [ "bstr", "gix-features", @@ -1885,18 +1885,18 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab9277a5e32e85d53f738096d872a4a9b76067ad471894ad31bd99c8fa2da1dc" +checksum = "de6225e2de30b6e9bca2d9f1cc4731640fcef0fb3cabddceee366e7e85d3e94f" dependencies = [ "fastrand 2.0.1", ] [[package]] name = "gix-validate" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f805ebbdbaa4bfd98e2ee43e6d14099b8a4d9141f5d7b8202fea4d48e44263e7" +checksum = "ac7cc36f496bd5d96cdca0f9289bb684480725d40db60f48194aa7723b883854" dependencies = [ "bstr", "thiserror", @@ -1904,9 +1904,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.29.0" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11f5b03e5733180229f2d92d03b35f8ad5da5cb7c94148b923acc1f0e93d34f3" +checksum = "53982f8abff0789a9599e644108a1914da61a4d0dede8e45037e744dcb008d52" dependencies = [ "bstr", "gix-attributes", @@ -1922,9 +1922,9 @@ dependencies = [ [[package]] name = "gix-worktree-state" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef560bd2c346a0002a13cc5ed29d78113f971a4dbf84fce7e0297e6d65490bc0" +checksum = "d8c74e732224c051370ce78b84748e36de9ace200dc47983da8629740ece20a1" dependencies = [ "bstr", "gix-features", @@ -2396,7 +2396,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -2560,7 +2560,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -2761,7 +2761,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -2858,7 +2858,7 @@ checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -2903,9 +2903,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75cb1540fadbd5b8fbccc4dddad2734eba435053f725621c070711a14bb5f4b8" +checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" dependencies = [ "unicode-ident", ] @@ -2976,9 +2976,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -3304,18 +3304,18 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.193" +version = "1.0.194" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "0b114498256798c94a0689e1a15fec6005dee8ac1f41de56404b67afc2a4b773" dependencies = [ "serde_derive", ] @@ -3331,20 +3331,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.194" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "a3385e45322e8f9931410f01b3031ec534c3947d0e94c18049af4d9f9907d4e0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.111" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" dependencies = [ "itoa", "ryu", @@ -3517,7 +3517,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -3561,9 +3561,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.43" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee659fb5f3d355364e1f3e5bc10fb82068efbf824a1e9d1c9504244a6469ad53" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -3593,9 +3593,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.12" +version = "0.12.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" +checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" [[package]] name = "tempfile" @@ -3633,22 +3633,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.52" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a48fd946b02c0a526b2e9481c8e2a17755e47039164a86c4070446e3a4614d" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.52" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7fbe9b594d6568a6a1443250a7e67d80b74e1e96f6d1715e1e21cc1888291d3" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -3733,7 +3733,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -3868,7 +3868,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", ] [[package]] @@ -4103,7 +4103,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", "wasm-bindgen-shared", ] @@ -4137,7 +4137,7 @@ checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.43", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4443,9 +4443,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.31" +version = "0.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a4882e6b134d6c28953a387571f1acdd3496830d5e36c5e3a1075580ea641c" +checksum = "8434aeec7b290e8da5c3f0d628cb0eac6cabcb31d14bb74f779a08109a5914d6" dependencies = [ "memchr", ] From dca22b654843e9452c6e5daa5e70bcd234e0fc61 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 6 Jan 2024 14:20:08 +1100 Subject: [PATCH 1615/2020] build(deps): bump the deps group with 1 update (#1556) Bumps the deps group with 1 update: [embed-resource](https://github.com/nabijaczleweli/rust-embed-resource). Updates `embed-resource` from 2.4.0 to 2.4.1 - [Release notes](https://github.com/nabijaczleweli/rust-embed-resource/releases) - [Commits](https://github.com/nabijaczleweli/rust-embed-resource/compare/v2.4.0...v2.4.1) --- updated-dependencies: - dependency-name: embed-resource dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 5 +++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f8a0f734..4e82524c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -888,11 +888,12 @@ checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" [[package]] name = "embed-resource" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f54cc3e827ee1c3812239a9a41dede7b4d7d5d5464faa32d71bd7cba28ce2cb2" +checksum = "3bde55e389bea6a966bd467ad1ad7da0ae14546a5bc794d16d1e55e7fca44881" dependencies = [ "cc", + "memchr", "rustc_version", "toml", "vswhom", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 6a28cc85..ce8f5d21 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -45,7 +45,7 @@ tracing-log = { version = "0.2.0", default-features = false } tracing-subscriber = { version = "0.3.17", features = ["fmt", "json", "ansi"], default-features = false } [build-dependencies] -embed-resource = "2.1.1" +embed-resource = "2.4.1" vergen = { version = "8.2.5", features = ["build", "cargo", "git", "gitcl", "rustc"] } [features] From b14f78b982a1bfa3fc7c3976b9b8e771d5a28050 Mon Sep 17 00:00:00 2001 From: Dustin Blackman Date: Sat, 6 Jan 2024 12:39:54 +0000 Subject: [PATCH 1616/2020] feat: Add strategies environment variable (#1555) --- crates/bin/src/args.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index d5fb5e5e..d03b09f4 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -151,7 +151,12 @@ pub struct Args { /// binstall will run the strategies specified in order. /// /// Default value is "crate-meta-data,quick-install,compile". - #[clap(help_heading = "Overrides", long, value_delimiter(','))] + #[clap( + help_heading = "Overrides", + long, + value_delimiter(','), + env = "BINSTALL_STRATEGIES" + )] pub(crate) strategies: Vec, /// Disable the strategies specified. From 5341d050b936d2ba7d0f7ac56f97eb7abf8a035d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 6 Jan 2024 13:07:50 +0000 Subject: [PATCH 1617/2020] release: simple-git v0.2.1 (#1557) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/simple-git/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4e82524c..f33b8883 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3437,7 +3437,7 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.0" +version = "0.2.1" dependencies = [ "compact_str", "derive_destructure2", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index dd9c094e..a96127f2 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -25,7 +25,7 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde_json = "1.0.107" sha2 = "0.10.7" -simple-git = { version = "0.2.0", path = "../simple-git", optional = true } +simple-git = { version = "0.2.1", path = "../simple-git", optional = true } tempfile = "3.5.0" thiserror = "1.0.52" tokio = { version = "1.35.0", features = ["rt", "sync"], default-features = false } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 8dac5477..397374f7 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ leon = { version = "2.0.1", path = "../leon" } maybe-owned = "0.3.4" miette = "5.9.0" semver = { version = "1.0.17", features = ["serde"] } -simple-git = { version = "0.2.0", path = "../simple-git", optional = true } +simple-git = { version = "0.2.1", path = "../simple-git", optional = true } strum = "0.25.0" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" diff --git a/crates/simple-git/Cargo.toml b/crates/simple-git/Cargo.toml index 5cf113f3..eefed5a4 100644 --- a/crates/simple-git/Cargo.toml +++ b/crates/simple-git/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "simple-git" -version = "0.2.0" +version = "0.2.1" edition = "2021" description = "The simple git interface for gix suitable for async context (with tokio)" From 763885b3a560f9dda51a357aadd789b383f610d0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 7 Jan 2024 11:46:33 +1100 Subject: [PATCH 1618/2020] release: cargo-binstall v1.5.0 (#1558) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f33b8883..d2aec74d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -491,7 +491,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.4.9" +version = "1.5.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index ce8f5d21..d89c4e5a 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.4.9" +version = "1.5.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index b4053a63..d11ba79d 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From f5da25cc56cc7fd1b7c13f93ea559d7b60b742bc Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 8 Jan 2024 00:46:30 +1000 Subject: [PATCH 1619/2020] Revert "build(deps): bump actions/{up, down}load-artifact from 3 to 4" (#1561) Revert "build(deps): bump actions/{up, down}load-artifact from 3 to 4 (#1533)" This reverts commit fea489032a1a50176ceb0dcd2716a77cc117665a. --- .github/workflows/ci.yml | 10 +++++----- .github/workflows/release-cli.yml | 8 ++++---- .github/workflows/release-packages.yml | 20 ++++++++++---------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bee7c724..48012559 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -172,7 +172,7 @@ jobs: # Set working directory here, otherwise `cargo-zigbuild` would download # and build quite a few unused dependencies. working-directory: crates/detect-targets - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v3 with: name: detect-targets path: target/${{ env.CARGO_BUILD_TARGET }}/debug/detect-targets @@ -183,7 +183,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v3 with: name: detect-targets - run: chmod +x detect-targets @@ -205,7 +205,7 @@ jobs: - ubuntu-latest runs-on: ${{ matrix.os }} steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v3 with: name: detect-targets - run: chmod +x detect-targets @@ -228,7 +228,7 @@ jobs: - fedora runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v3 with: name: detect-targets - run: chmod +x detect-targets @@ -244,7 +244,7 @@ jobs: needs: detect-targets-build runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v3 with: name: detect-targets - run: chmod +x detect-targets diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 3340b4ca..92b271c9 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -46,11 +46,11 @@ jobs: env: AGE_KEY_PUBLIC: ${{ vars.AGE_KEY_PUBLIC }} run: .github/scripts/ephemeral-gen.sh - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v3 with: name: minisign.pub path: minisign.pub - - uses: actions/upload-artifact@v4 + - uses: actions/upload-artifact@v3 with: name: minisign.key.age path: minisign.key.age @@ -79,7 +79,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v3 with: name: minisign.pub @@ -93,7 +93,7 @@ jobs: run: cargo publish --dry-run -p "$crate" --allow-dirty --no-default-features - if: fromJSON(inputs.info).is-release != 'true' && fromJSON(inputs.info).crate != '' name: Upload crate package as artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: crate-package path: target/package/*.crate diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index 04403e39..6cc60658 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -70,7 +70,7 @@ jobs: - run: just toolchain rust-src - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v3 with: name: minisign.pub - run: just package @@ -85,7 +85,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v3 with: name: minisign.key.age - name: Sign package @@ -107,14 +107,14 @@ jobs: prerelease: true - if: "fromJSON(inputs.publish).is-release != 'true' || runner.os == 'macOS'" name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: ${{ matrix.t }} path: packages/cargo-binstall-* retention-days: 1 - name: Upload timings - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: ${{ matrix.t }}-cargo-timings path: target/cargo-timings @@ -138,27 +138,27 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v3 with: name: x86_64h-apple-darwin path: packages/ - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v3 with: name: x86_64-apple-darwin path: packages/ - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v3 with: name: aarch64-apple-darwin path: packages/ - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v3 with: name: minisign.pub - run: ls -shalr packages/ - run: just repackage-lipo - run: ls -shal packages/ - - uses: actions/download-artifact@v4 + - uses: actions/download-artifact@v3 with: name: minisign.key.age - env: @@ -180,7 +180,7 @@ jobs: prerelease: true - if: fromJSON(inputs.publish).is-release != 'true' name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v3 with: name: universal-apple-darwin path: packages/cargo-binstall-universal-* From c08b8d232a25955be759ae17606ed4e16b638133 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 8 Jan 2024 22:09:45 +1000 Subject: [PATCH 1620/2020] feat: Impl new option `--continue-on-failure` (#1559) * feat: Impl new option `--continue-on-failure` Resolve #1548 Signed-off-by: Jiahao XU * Add new e2e-tests continue-on-failure Signed-off-by: Jiahao XU * Rm dup line ion `e2e-tests/live.sh` Signed-off-by: Jiahao XU * Fix shellcheck Signed-off-by: Jiahao XU * Fix `BinstallError::crate_errors` if `errors.len()` is 1 In that case, it should return `Some(Self::CrateContext(_))` instead of `Some(Self::Errors(_))` Signed-off-by: Jiahao XU * Add more tests to `e2e-tests/continue-on-failure.sh` Signed-off-by: Jiahao XU * Propagate crate errors on `confirm()` err Signed-off-by: Jiahao XU * Test having two errors in `e2e-tests/continue-on-failure.sh` Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 4 + crates/bin/src/bin_util.rs | 14 +- crates/bin/src/entry.rs | 212 ++++++++++++++---- crates/binstalk/src/errors.rs | 118 +++++++++- crates/binstalk/src/ops/resolve/resolution.rs | 15 +- e2e-tests/continue-on-failure.sh | 58 +++++ e2e-tests/live.sh | 1 - justfile | 3 +- 8 files changed, 365 insertions(+), 60 deletions(-) create mode 100755 e2e-tests/continue-on-failure.sh diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index d03b09f4..85f2ca69 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -191,6 +191,10 @@ pub struct Args { #[clap(help_heading = "Options", long)] pub(crate) no_cleanup: bool, + /// Continue installing other crates even if one of the crate failed to install. + #[clap(help_heading = "Options", long)] + pub(crate) continue_on_failure: bool, + /// By default, binstall keeps track of the installed packages with metadata files /// stored in the installation root directory. /// diff --git a/crates/bin/src/bin_util.rs b/crates/bin/src/bin_util.rs index d75445f1..df49c3f1 100644 --- a/crates/bin/src/bin_util.rs +++ b/crates/bin/src/bin_util.rs @@ -1,5 +1,4 @@ use std::{ - future::Future, process::{ExitCode, Termination}, time::Duration, }; @@ -48,20 +47,17 @@ impl MainExit { } /// This function would start a tokio multithreading runtime, -/// spawn a new task on it that runs `f()`, then `block_on` it. +/// then `block_on` the task it returns. /// /// It will cancel the future if user requested cancellation /// via signal. -pub fn run_tokio_main(f: Func) -> Result<()> -where - Func: FnOnce() -> Result>, - Fut: Future> + Send + 'static, -{ +pub fn run_tokio_main( + f: impl FnOnce() -> Result>>>, +) -> Result<()> { let rt = Runtime::new().map_err(BinstallError::from)?; let _guard = rt.enter(); - if let Some(fut) = f()? { - let handle = AutoAbortJoinHandle::new(rt.spawn(fut)); + if let Some(handle) = f()? { rt.block_on(cancel_on_user_sig_term(handle))? } else { Ok(()) diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 304bab65..f409a726 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -1,12 +1,11 @@ use std::{ env, fs, - future::Future, path::{Path, PathBuf}, sync::Arc, }; use binstalk::{ - errors::BinstallError, + errors::{BinstallError, CrateContextError}, fetchers::{Fetcher, GhCrateMeta, QuickInstall, SignaturePolicy}, get_desired_targets, helpers::{ @@ -27,7 +26,7 @@ use binstalk_manifests::{ use file_format::FileFormat; use home::cargo_home; use log::LevelFilter; -use miette::{miette, Result, WrapErr}; +use miette::{miette, Report, Result, WrapErr}; use tokio::task::block_in_place; use tracing::{debug, error, info, warn}; @@ -40,7 +39,7 @@ use crate::{ pub fn install_crates( args: Args, jobserver_client: LazyJobserverClient, -) -> Result>>> { +) -> Result>>> { // Compute Resolvers let mut cargo_install_fallback = false; @@ -217,54 +216,131 @@ pub fn install_crates( }) .collect(); - Ok(Some(async move { - // Collect results - let mut resolution_fetchs = Vec::new(); - let mut resolution_sources = Vec::new(); + Ok(Some(if args.continue_on_failure { + AutoAbortJoinHandle::spawn(async move { + // Collect results + let mut resolution_fetchs = Vec::new(); + let mut resolution_sources = Vec::new(); + let mut errors = Vec::new(); - for task in tasks { - match task.await?? { - Resolution::AlreadyUpToDate => {} - Resolution::Fetch(fetch) => { - fetch.print(&binstall_opts); - resolution_fetchs.push(fetch) - } - Resolution::InstallFromSource(source) => { - source.print(); - resolution_sources.push(source) + for task in tasks { + match task.flattened_join().await { + Ok(Resolution::AlreadyUpToDate) => {} + Ok(Resolution::Fetch(fetch)) => { + fetch.print(&binstall_opts); + resolution_fetchs.push(fetch) + } + Ok(Resolution::InstallFromSource(source)) => { + source.print(); + resolution_sources.push(source) + } + Err(BinstallError::CrateContext(err)) => errors.push(err), + Err(e) => panic!("Expected BinstallError::CrateContext(_), got {}", e), } } - } - if resolution_fetchs.is_empty() && resolution_sources.is_empty() { - debug!("Nothing to do"); - return Ok(()); - } + if resolution_fetchs.is_empty() && resolution_sources.is_empty() { + return if let Some(err) = BinstallError::crate_errors(errors) { + Err(err.into()) + } else { + debug!("Nothing to do"); + Ok(()) + }; + } - // Confirm - if !dry_run && !no_confirm { - confirm().await?; - } + // Confirm + if !dry_run && !no_confirm { + if let Err(abort_err) = confirm().await { + return if let Some(err) = BinstallError::crate_errors(errors) { + Err(Report::new(abort_err).wrap_err(err)) + } else { + Err(abort_err.into()) + }; + } + } - do_install_fetches( - resolution_fetchs, - manifests, - &binstall_opts, - dry_run, - temp_dir, - no_cleanup, - )?; + let manifest_update_res = do_install_fetches_continue_on_failure( + resolution_fetchs, + manifests, + &binstall_opts, + dry_run, + temp_dir, + no_cleanup, + &mut errors, + ); - let tasks: Vec<_> = resolution_sources - .into_iter() - .map(|source| AutoAbortJoinHandle::spawn(source.install(binstall_opts.clone()))) - .collect(); + let tasks: Vec<_> = resolution_sources + .into_iter() + .map(|source| AutoAbortJoinHandle::spawn(source.install(binstall_opts.clone()))) + .collect(); - for task in tasks { - task.await??; - } + for task in tasks { + match task.flattened_join().await { + Ok(_) => (), + Err(BinstallError::CrateContext(err)) => errors.push(err), + Err(e) => panic!("Expected BinstallError::CrateContext(_), got {}", e), + } + } - Ok(()) + match (BinstallError::crate_errors(errors), manifest_update_res) { + (None, Ok(())) => Ok(()), + (None, Err(err)) => Err(err), + (Some(err), Ok(())) => Err(err.into()), + (Some(err), Err(manifest_update_err)) => { + Err(Report::new(err).wrap_err(manifest_update_err)) + } + } + }) + } else { + AutoAbortJoinHandle::spawn(async move { + // Collect results + let mut resolution_fetchs = Vec::new(); + let mut resolution_sources = Vec::new(); + + for task in tasks { + match task.await?? { + Resolution::AlreadyUpToDate => {} + Resolution::Fetch(fetch) => { + fetch.print(&binstall_opts); + resolution_fetchs.push(fetch) + } + Resolution::InstallFromSource(source) => { + source.print(); + resolution_sources.push(source) + } + } + } + + if resolution_fetchs.is_empty() && resolution_sources.is_empty() { + debug!("Nothing to do"); + return Ok(()); + } + + // Confirm + if !dry_run && !no_confirm { + confirm().await?; + } + + do_install_fetches( + resolution_fetchs, + manifests, + &binstall_opts, + dry_run, + temp_dir, + no_cleanup, + )?; + + let tasks: Vec<_> = resolution_sources + .into_iter() + .map(|source| AutoAbortJoinHandle::spawn(source.install(binstall_opts.clone()))) + .collect(); + + for task in tasks { + task.await??; + } + + Ok(()) + }) })) } @@ -449,3 +525,53 @@ fn do_install_fetches( Ok(()) }) } + +#[allow(clippy::vec_box)] +fn do_install_fetches_continue_on_failure( + resolution_fetchs: Vec>, + // Take manifests by value to drop the `FileLock`. + manifests: Option, + binstall_opts: &Options, + dry_run: bool, + temp_dir: tempfile::TempDir, + no_cleanup: bool, + errors: &mut Vec>, +) -> Result<()> { + if resolution_fetchs.is_empty() { + return Ok(()); + } + + if dry_run { + info!("Dry-run: Not proceeding to install fetched binaries"); + return Ok(()); + } + + block_in_place(|| { + let metadata_vec = resolution_fetchs + .into_iter() + .filter_map(|fetch| match fetch.install(binstall_opts) { + Ok(crate_info) => Some(crate_info), + Err(BinstallError::CrateContext(err)) => { + errors.push(err); + None + } + Err(e) => panic!("Expected BinstallError::CrateContext(_), got {}", e), + }) + .collect::>(); + + if let Some(manifests) = manifests { + manifests.update(metadata_vec)?; + } + + if no_cleanup { + // Consume temp_dir without removing it from fs. + let _ = temp_dir.into_path(); + } else { + temp_dir.close().unwrap_or_else(|err| { + warn!("Failed to clean up some resources: {err}"); + }); + } + + Ok(()) + }) +} diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index c64525e4..c5afd7a6 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -1,5 +1,5 @@ use std::{ - io, + fmt, io, ops, path::PathBuf, process::{ExitCode, ExitStatus, Termination}, }; @@ -9,6 +9,7 @@ use binstalk_downloader::{ }; use binstalk_fetchers::FetchError; use compact_str::CompactString; +use itertools::Itertools; use miette::{Diagnostic, Report}; use target_lexicon::ParseError as TargetTripleParseError; use thiserror::Error; @@ -40,6 +41,90 @@ pub struct CrateContextError { err: BinstallError, } +#[derive(Debug)] +pub struct CrateErrors(Box<[Box]>); + +impl CrateErrors { + fn iter(&self) -> impl Iterator + Clone { + self.0.iter().map(ops::Deref::deref) + } + + fn get_iter_for<'a, T: 'a>( + &'a self, + f: fn(&'a CrateContextError) -> Option, + ) -> Option + 'a> { + let iter = self.iter().filter_map(f); + + if iter.clone().next().is_none() { + None + } else { + Some(iter) + } + } +} + +impl fmt::Display for CrateErrors { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + fmt::Display::fmt(&self.0.iter().format(", "), f) + } +} + +impl std::error::Error for CrateErrors { + fn source(&self) -> Option<&(dyn std::error::Error + 'static)> { + self.0.first().map(|e| e as _) + } +} + +impl miette::Diagnostic for CrateErrors { + fn code<'a>(&'a self) -> Option> { + Some(Box::new("binstall::many_failure")) + } + + fn severity(&self) -> Option { + self.iter().filter_map(miette::Diagnostic::severity).max() + } + + fn help<'a>(&'a self) -> Option> { + Some(Box::new( + self.get_iter_for(miette::Diagnostic::help)?.format("\n"), + )) + } + + fn url<'a>(&'a self) -> Option> { + Some(Box::new( + self.get_iter_for(miette::Diagnostic::url)?.format("\n"), + )) + } + + fn source_code(&self) -> Option<&dyn miette::SourceCode> { + self.iter().find_map(miette::Diagnostic::source_code) + } + + fn labels(&self) -> Option + '_>> { + let get_iter = || self.iter().filter_map(miette::Diagnostic::labels).flatten(); + + if get_iter().next().is_none() { + None + } else { + Some(Box::new(get_iter())) + } + } + + fn related<'a>(&'a self) -> Option + 'a>> { + Some(Box::new( + self.iter().map(|e| e as _).chain( + self.iter() + .filter_map(miette::Diagnostic::related) + .flatten(), + ), + )) + } + + fn diagnostic_source(&self) -> Option<&dyn miette::Diagnostic> { + self.0.first().map(|err| &**err as _) + } +} + #[derive(Debug, Error)] #[error("Invalid pkg-url {pkg_url} for {crate_name}@{version} on {target}: {reason}")] pub struct InvalidPkgFmtError { @@ -344,6 +429,11 @@ pub enum BinstallError { #[error(transparent)] #[diagnostic(transparent)] CrateContext(Box), + + /// A wrapped error for failures of multiple crates when `--continue-on-failure` is specified. + #[error(transparent)] + #[diagnostic(transparent)] + Errors(CrateErrors), } impl BinstallError { @@ -380,6 +470,7 @@ impl BinstallError { GitError(_) => 98, LoadManifestFromWSError(_) => 99, CrateContext(context) => context.err.exit_number(), + Errors(errors) => (errors.0)[0].err.exit_number(), }; // reserved codes @@ -401,10 +492,27 @@ impl BinstallError { /// Add crate context to the error pub fn crate_context(self, crate_name: impl Into) -> Self { - Self::CrateContext(Box::new(CrateContextError { - err: self, - crate_name: crate_name.into(), - })) + self.crate_context_inner(crate_name.into()) + } + + fn crate_context_inner(self, crate_name: CompactString) -> Self { + match self { + Self::CrateContext(mut crate_context_error) => { + crate_context_error.crate_name = crate_name; + Self::CrateContext(crate_context_error) + } + err => Self::CrateContext(Box::new(CrateContextError { err, crate_name })), + } + } + + pub fn crate_errors(mut errors: Vec>) -> Option { + if errors.is_empty() { + None + } else if errors.len() == 1 { + Some(Self::CrateContext(errors.pop().unwrap())) + } else { + Some(Self::Errors(CrateErrors(errors.into_boxed_slice()))) + } } } diff --git a/crates/binstalk/src/ops/resolve/resolution.rs b/crates/binstalk/src/ops/resolve/resolution.rs index fa06322e..9c149dea 100644 --- a/crates/binstalk/src/ops/resolve/resolution.rs +++ b/crates/binstalk/src/ops/resolve/resolution.rs @@ -51,6 +51,12 @@ impl Resolution { impl ResolutionFetch { pub fn install(self, opts: &Options) -> Result { + let crate_name = self.name.clone(); + self.install_inner(opts) + .map_err(|err| err.crate_context(crate_name)) + } + + fn install_inner(self, opts: &Options) -> Result { type InstallFp = fn(&bins::BinFile) -> Result<(), bins::Error>; let (install_bin, install_link): (InstallFp, InstallFp) = match (opts.no_track, opts.force) @@ -126,6 +132,13 @@ impl ResolutionFetch { impl ResolutionSource { pub async fn install(self, opts: Arc) -> Result<(), BinstallError> { + let crate_name = self.name.clone(); + self.install_inner(opts) + .await + .map_err(|err| err.crate_context(crate_name)) + } + + async fn install_inner(self, opts: Arc) -> Result<(), BinstallError> { let target = if let Some(targets) = opts.desired_targets.get_initialized() { Some(targets.first().ok_or(BinstallError::NoViableTargets)?) } else { @@ -171,7 +184,7 @@ impl ResolutionSource { cmd.arg("--no-track"); } - debug!("Running `{}`", format_cmd(&cmd),); + debug!("Running `{}`", format_cmd(&cmd)); if !opts.dry_run { let mut child = opts diff --git a/e2e-tests/continue-on-failure.sh b/e2e-tests/continue-on-failure.sh new file mode 100755 index 00000000..44080313 --- /dev/null +++ b/e2e-tests/continue-on-failure.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +set -euxo pipefail + +unset CARGO_INSTALL_ROOT + +CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export CARGO_HOME +othertmpdir=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-test') +export PATH="$CARGO_HOME/bin:$othertmpdir/bin:$PATH" + +mkdir -p "$othertmpdir/bin" +# Copy it to bin to test use of env var `CARGO` +cp "./$1" "$othertmpdir/bin/" + + +## Test --continue-on-failure +set +e +cargo binstall --no-confirm --continue-on-failure cargo-watch@8.4.0 non-existent-clippy +exit_code="$?" + +set -e + +if [ "$exit_code" != 76 ]; then + echo "Expected exit code 76, but actual exit code $exit_code" + exit 1 +fi + + +cargo_watch_version="$(cargo watch -V)" +echo "$cargo_watch_version" + +[ "$cargo_watch_version" = "cargo-watch 8.4.0" ] + + +## Test that it is no-op when only one crate is passed +set +e +cargo binstall --no-confirm --continue-on-failure non-existent-clippy +exit_code="$?" + +set -e + +if [ "$exit_code" != 76 ]; then + echo "Expected exit code 76, but actual exit code $exit_code" + exit 1 +fi + +# Test if both crates are invalid +set +e +cargo binstall --no-confirm --continue-on-failure non-existent-clippy non-existent-clippy2 +exit_code="$?" + +set -e + +if [ "$exit_code" != 76 ]; then + echo "Expected exit code 76, but actual exit code $exit_code" + exit 1 +fi diff --git a/e2e-tests/live.sh b/e2e-tests/live.sh index afeb092b..507ac6ae 100755 --- a/e2e-tests/live.sh +++ b/e2e-tests/live.sh @@ -36,7 +36,6 @@ echo "$cargo_release_version" [ "$cargo_release_version" = "cargo-release 0.24.9" ] -cargo-binstall --help >/dev/null cargo binstall --help >/dev/null cargo_binstall_version="$(cargo-binstall -V)" diff --git a/justfile b/justfile index 6ea50afe..361602d7 100644 --- a/justfile +++ b/justfile @@ -248,6 +248,7 @@ e2e-test-no-track: (e2e-test "no-track") e2e-test-git: (e2e-test "git") e2e-test-registries: (e2e-test "registries") e2e-test-signing: (e2e-test "signing") +e2e-test-continue-on-failure: (e2e-test "continue-on-failure") # WinTLS (Windows in CI) does not have TLS 1.3 support [windows] @@ -256,7 +257,7 @@ e2e-test-tls: (e2e-test "tls" "1.2") [macos] e2e-test-tls: (e2e-test "tls" "1.2") (e2e-test "tls" "1.3") -e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-git e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate e2e-test-no-track e2e-test-registries e2e-test-signing +e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-git e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate e2e-test-no-track e2e-test-registries e2e-test-signing e2e-test-continue-on-failure unit-tests: print-env {{cargo-bin}} test {{cargo-build-args}} From 9df18b1a48f58fcc391129e95dbd943327220cdc Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 13 Jan 2024 10:51:42 +1000 Subject: [PATCH 1621/2020] Disable zlib-ng for aarch64 linux and re-enable it for x64 linux (#1565) Signed-off-by: Jiahao XU --- justfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/justfile b/justfile index 361602d7..46f5c8ec 100644 --- a/justfile +++ b/justfile @@ -78,9 +78,9 @@ support-pkg-config := if target == target-host { if target-os == "linux" { "true" } else { "" } } else { "" } -#} else if target == "x86_64-unknown-linux-gnu" { +#} else if target == "aarch64-unknown-linux-gnu" { # ",zlib-ng" -#} else if target == "x86_64-unknown-linux-musl" { +#} else if target == "aarch64-unknown-linux-musl" { # ",zlib-ng" git-max-perf-feature := if target == "x86_64-apple-darwin" { ",zlib-ng" @@ -90,9 +90,9 @@ git-max-perf-feature := if target == "x86_64-apple-darwin" { ",zlib-ng" } else if target-os == "windows" { ",zlib-ng" -} else if target == "aarch64-unknown-linux-gnu" { +} else if target == "x86_64-unknown-linux-gnu" { ",zlib-ng" -} else if target == "aarch64-unknown-linux-musl" { +} else if target == "x86_64-unknown-linux-musl" { ",zlib-ng" } else { "" From 7222a8279d2f9b8941a7f20948e643526220bf28 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 13 Jan 2024 02:02:37 +0000 Subject: [PATCH 1622/2020] dep: Upgrade transitive dependencies (#1563) Co-authored-by: github-actions --- Cargo.lock | 85 ++++++++++++++++++++++++------------------------------ 1 file changed, 38 insertions(+), 47 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d2aec74d..1006684a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -34,9 +34,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.5" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" +checksum = "4cd2405b3ac1faab2990b74d728624cd9fd115651fcecc7c2d8daf01376275ba" dependencies = [ "anstyle", "anstyle-parse", @@ -192,9 +192,9 @@ checksum = "d27c3610c36aee21ce8ac510e6224498de4228ad772a171ed65643a24693a5a8" [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "beef" @@ -569,9 +569,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.13" +version = "4.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52bdc885e4cacc7f7c9eedc1ef6da641603180c783c41a15c264944deeaab642" +checksum = "58e54881c004cec7895b0068a0a954cd5d62da01aef83fa35b1e594497bf5445" dependencies = [ "clap_builder", "clap_derive", @@ -579,9 +579,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.12" +version = "4.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb7fb5e4e979aec3be7791562fcba452f94ad85e954da024396433e0e25a79e9" +checksum = "59cb82d7f531603d2fd1f507441cdd35184fa81beff7bd489570de7f773460bb" dependencies = [ "anstream", "anstyle", @@ -690,11 +690,10 @@ dependencies = [ [[package]] name = "crossbeam" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eb9105919ca8e40d437fc9cbb8f1975d916f1bd28afe795a48aae32a2cc8920" +checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" dependencies = [ - "cfg-if", "crossbeam-channel", "crossbeam-deque", "crossbeam-epoch", @@ -704,54 +703,46 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a9b73a36529d9c47029b9fb3a6f0ea3cc916a261195352ba19e770fc1748b2" +checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-deque" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" dependencies = [ - "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] [[package]] name = "crossbeam-epoch" -version = "0.9.17" +version = "0.9.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e3681d554572a651dda4186cd47240627c3d0114d45a95f6ad27f2f22e7548d" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" dependencies = [ - "autocfg", - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-queue" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc6598521bb5a83d491e8c1fe51db7296019d2ca3cb93cc6c2a20369a4d78a2" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.18" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3a430a770ebd84726f584a90ee7f020d28db52c6d02138900f22341f866d39c" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crypto-common" @@ -1108,9 +1099,9 @@ checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeee267a1883f7ebef3700f262d2d54de95dfaf38189015a74fdc4e0c7ad8143" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" dependencies = [ "fastrand 2.0.1", "futures-core", @@ -1172,9 +1163,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", @@ -1961,9 +1952,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.22" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" +checksum = "b553656127a00601c8ae5590fcfdc118e4083a7924b6cf4ffc1ea4b99dc429d7" dependencies = [ "bytes", "fnv", @@ -2402,9 +2393,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.151" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libmimalloc-sys" @@ -2429,9 +2420,9 @@ dependencies = [ [[package]] name = "libz-ng-sys" -version = "1.1.12" +version = "1.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dd9f43e75536a46ee0f92b758f6b63846e594e86638c61a9251338a65baea63" +checksum = "81157dde2fd4ad2b45ea3a4bb47b8193b52a6346b678840d91d80d3c2cd166c5" dependencies = [ "cmake", "libc", @@ -2904,9 +2895,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.75" +version = "1.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907a61bd0f64c2f29cd1cf1dc34d05176426a3f504a78010f08416ddb7b13708" +checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" dependencies = [ "unicode-ident", ] @@ -3314,9 +3305,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.194" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b114498256798c94a0689e1a15fec6005dee8ac1f41de56404b67afc2a4b773" +checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" dependencies = [ "serde_derive", ] @@ -3332,9 +3323,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.194" +version = "1.0.195" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3385e45322e8f9931410f01b3031ec534c3947d0e94c18049af4d9f9907d4e0" +checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" dependencies = [ "proc-macro2", "quote", @@ -4444,9 +4435,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.32" +version = "0.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8434aeec7b290e8da5c3f0d628cb0eac6cabcb31d14bb74f779a08109a5914d6" +checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" dependencies = [ "memchr", ] From b415b0d7e6b3d4f49d09bf29c767324ecf8adadb Mon Sep 17 00:00:00 2001 From: Jacob Hummer Date: Fri, 12 Jan 2024 20:22:51 -0600 Subject: [PATCH 1623/2020] Fix install-from-binstall-release.sh for Git Bash users on Windows (#1562) * Update install-from-binstall-release.sh * Update install-from-binstall-release.sh * Update install-from-binstall-release.sh Co-authored-by: Jiahao XU * Update install-from-binstall-release.sh Co-authored-by: Jiahao XU * Update install-script.yml * Update install-from-binstall-release.sh * Update install-script.yml --------- Co-authored-by: Jiahao XU --- .github/workflows/install-script.yml | 30 ++++++++++++++++++++++++++++ install-from-binstall-release.sh | 6 ++++++ 2 files changed, 36 insertions(+) diff --git a/.github/workflows/install-script.yml b/.github/workflows/install-script.yml index 26f68e22..fec2960e 100644 --- a/.github/workflows/install-script.yml +++ b/.github/workflows/install-script.yml @@ -82,3 +82,33 @@ jobs: - name: Verify `cargo-binstall` installation run: cargo binstall -vV + + windows-bash: + strategy: + fail-fast: false + matrix: + set_cargo_home: [t, f] + + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Set `CARGO_HOME` + if: matrix.set_cargo_home == 't' + shell: bash + run: | + CARGO_HOME="$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')" + mkdir -p "${CARGO_HOME}/bin" + echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" + echo "${CARGO_HOME}/bin" >> $GITHUB_PATH + + - name: Install `cargo-binstall` using scripts + shell: bash + run: ./install-from-binstall-release.sh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Verify `cargo-binstall` installation + shell: bash + run: cargo binstall -vV diff --git a/install-from-binstall-release.sh b/install-from-binstall-release.sh index 7630eeb4..90686cba 100755 --- a/install-from-binstall-release.sh +++ b/install-from-binstall-release.sh @@ -20,6 +20,12 @@ elif [ "$os" == "Linux" ]; then url="${base_url}${target}.tgz" curl -L --proto '=https' --tlsv1.2 -sSf "$url" | tar -xvzf - +elif [ "${OS-}" = "Windows_NT" ]; then + machine="$(uname -m)" + target="${machine}-pc-windows-msvc" + url="${base_url}${target}.zip" + curl -LO --proto '=https' --tlsv1.2 -sSf "$url" + unzip "cargo-binstall-${target}.zip" else echo "Unsupported OS ${os}" exit 1 From 69c5c3714c7ad89a873b531fcb01ffe2e1865d92 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 13 Jan 2024 03:11:53 +0000 Subject: [PATCH 1624/2020] build(deps): bump the deps group with 2 updates (#1567) Bumps the deps group with 2 updates: [vergen](https://github.com/rustyhorde/vergen) and [cargo_toml](https://gitlab.com/lib.rs/cargo_toml). Updates `vergen` from 8.2.6 to 8.2.7 - [Release notes](https://github.com/rustyhorde/vergen/releases) - [Commits](https://github.com/rustyhorde/vergen/compare/8.2.6...8.2.7) Updates `cargo_toml` from 0.17.2 to 0.18.0 - [Commits](https://gitlab.com/lib.rs/cargo_toml/commits/v0.18.0) --- updated-dependencies: - dependency-name: vergen dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: cargo_toml dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1006684a..3b906ad3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -534,9 +534,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.17.2" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a969e13a7589e9e3e4207e153bae624ade2b5622fb4684a4923b23ec3d57719" +checksum = "802b755090e39835a4b0440fb0bbee0df7495a8b337f63db21e616f7821c7e8c" dependencies = [ "serde", "toml", @@ -4013,9 +4013,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vergen" -version = "8.2.6" +version = "8.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1290fd64cc4e7d3c9b07d7f333ce0ce0007253e32870e632624835cc80b83939" +checksum = "f2066fbfd3bfbadab28cab8bae840c9e74917bc6deeef2ed0781f2eb2fdfafdb" dependencies = [ "anyhow", "rustc_version", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index d89c4e5a..0427b849 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -46,7 +46,7 @@ tracing-subscriber = { version = "0.3.17", features = ["fmt", "json", "ansi"], d [build-dependencies] embed-resource = "2.4.1" -vergen = { version = "8.2.5", features = ["build", "cargo", "git", "gitcl", "rustc"] } +vergen = { version = "8.2.7", features = ["build", "cargo", "git", "gitcl", "rustc"] } [features] default = ["static", "rustls", "trust-dns", "fancy-no-backtrace", "zstd-thin", "git"] diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 7107daba..795a27a8 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Jiahao XU "] license = "Apache-2.0 OR MIT" [dependencies] -cargo_toml = "0.17.0" +cargo_toml = "0.18.0" compact_str = { version = "0.7.0", features = ["serde"] } glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } From 338b04335488515a280504c59e9c089ab31ceae8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 13 Jan 2024 04:54:16 +0000 Subject: [PATCH 1625/2020] release: cargo-toml-workspace v4.0.0 (#1568) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3b906ad3..1bf3456e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -520,7 +520,7 @@ dependencies = [ [[package]] name = "cargo-toml-workspace" -version = "3.0.0" +version = "4.0.0" dependencies = [ "cargo_toml", "compact_str", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index a96127f2..39e3f8c4 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -15,7 +15,7 @@ async-trait = "0.1.68" base16 = "0.2.1" binstalk-downloader = { version = "0.9.6", path = "../binstalk-downloader", default-features = false, features = ["json"] } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } -cargo-toml-workspace = { version = "3.0.0", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "4.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } leon = { version = "2.0.1", path = "../leon" } miette = "5.9.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 397374f7..612443cb 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -15,7 +15,7 @@ binstalk-downloader = { version = "0.9.6", path = "../binstalk-downloader", defa binstalk-fetchers = { version = "0.2.2", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.4.1", path = "../binstalk-registry" } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } -cargo-toml-workspace = { version = "3.0.0", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "4.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.14", path = "../detect-targets", features = ["tracing"] } diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 795a27a8..87062c4d 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-toml-workspace" -version = "3.0.0" +version = "4.0.0" edition = "2021" description = "Parse cargo workspace and load specific crate" repository = "https://github.com/cargo-bins/cargo-binstall" From 8313dea231231644480709a68bcbec27f649013b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 13 Jan 2024 06:42:42 +0000 Subject: [PATCH 1626/2020] release: binstalk-registry v0.5.0 (#1569) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1bf3456e..c722f820 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -332,7 +332,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.4.1" +version = "0.5.0" dependencies = [ "async-trait", "base16", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 39e3f8c4..71ee9f02 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.4.1" +version = "0.5.0" edition = "2021" rust-version = "1.65.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 612443cb..96492ccf 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.9.6", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.2.2", path = "../binstalk-fetchers", features = ["quickinstall"] } -binstalk-registry = { version = "0.4.1", path = "../binstalk-registry" } +binstalk-registry = { version = "0.5.0", path = "../binstalk-registry" } binstalk-types = { version = "0.6.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "4.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } From b497939ec694f6dad37c7f5494e564b4fa1ec8be Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 13 Jan 2024 08:28:22 +0000 Subject: [PATCH 1627/2020] release: binstalk v0.20.0 (#1570) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c722f820..f1c2ea9e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -207,7 +207,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.19.0" +version = "0.20.0" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 0427b849..660b41f0 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.19.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.20.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.11.0" } clap = { version = "4.4.8", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 96492ccf..e55b1c65 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.19.0" +version = "0.20.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From 7d25079422ea6d24ac138ff5b358b0fcb1a88bf9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 13 Jan 2024 09:44:33 +0000 Subject: [PATCH 1628/2020] release: cargo-binstall v1.6.0 (#1571) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f1c2ea9e..b539bd0e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -491,7 +491,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.5.0" +version = "1.6.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 660b41f0..e0038c5c 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Rust binary package installer for CI integration" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.5.0" +version = "1.6.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index d11ba79d..c10c10b2 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From d02776c7fcb7086067fb4534b9da7f6a95a16c5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Mon, 15 Jan 2024 00:59:24 +1300 Subject: [PATCH 1629/2020] detect-target: fallback on targets we don't explicitly have support for (#1574) See #1573 --- crates/detect-targets/src/detect.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/detect-targets/src/detect.rs b/crates/detect-targets/src/detect.rs index 15d8a125..a85e6e07 100644 --- a/crates/detect-targets/src/detect.rs +++ b/crates/detect-targets/src/detect.rs @@ -57,6 +57,8 @@ pub async fn detect_targets() -> Vec { // Linux is a bit special, since the result from `guess_host_triple` // might be wrong about whether glibc or musl is used. linux::detect_targets(target).await + } else { + vec![target] } } } From 8befa3d6491e023b3676c07bf71a1680700e3e6e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 16 Jan 2024 09:02:40 +1000 Subject: [PATCH 1630/2020] Fix detect-targets on android targets (#1576) * Fix detect-targets on android targets By enabling linux fallback on Android. Also add CI regression test for aarch64-linux-android target. Signed-off-by: Jiahao XU * Fix CI: Add job `detect-targets-android-check` as required for merging Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 29 +++++++++++++++++++++++++++++ crates/detect-targets/src/detect.rs | 4 ++-- 2 files changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 48012559..86ba6d7a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -256,6 +256,34 @@ jobs: --mount src="$PWD/detect-targets",dst=/detect-targets,type=bind \ nixos/nix /detect-targets )" = x86_64-unknown-linux-musl ] + detect-targets-android-check: + strategy: + fail-fast: false + matrix: + include: + - target: aarch64-linux-android + + runs-on: ubuntu-latest + env: + CARGO_BUILD_TARGET: ${{ matrix.target }} + + steps: + - uses: actions/checkout@v4 + + - name: Add ${{ matrix.target }} + run: rustup target add ${{ matrix.target }} + + - uses: Swatinem/rust-cache@v2 + with: + cache-all-crates: true + - name: Build detect-targets + run: | + cargo check --target ${{ matrix.target }} + # Set working directory here, otherwise `cargo-check` would download + # and build quite a few unused dependencies. + working-directory: crates/detect-targets + + # Dummy job to have a stable name for the "all tests pass" requirement tests-pass: name: Tests pass @@ -269,6 +297,7 @@ jobs: - detect-targets-ubuntu-test - detect-targets-more-glibc-test - detect-targets-nix-test + - detect-targets-android-check if: always() # always run even if dependencies fail runs-on: ubuntu-latest steps: diff --git a/crates/detect-targets/src/detect.rs b/crates/detect-targets/src/detect.rs index a85e6e07..a3f4a67c 100644 --- a/crates/detect-targets/src/detect.rs +++ b/crates/detect-targets/src/detect.rs @@ -11,7 +11,7 @@ use tokio::process::Command; use tracing::debug; cfg_if! { - if #[cfg(target_os = "linux")] { + if #[cfg(any(target_os = "linux", target_os = "android"))] { mod linux; } else if #[cfg(target_os = "macos")] { mod macos; @@ -53,7 +53,7 @@ pub async fn detect_targets() -> Vec { let mut targets = vec![target]; targets.extend(windows::detect_alternative_targets(&targets[0])); targets - } else if #[cfg(target_os = "linux")] { + } else if #[cfg(any(target_os = "linux", target_os = "android"))] { // Linux is a bit special, since the result from `guess_host_triple` // might be wrong about whether glibc or musl is used. linux::detect_targets(target).await From 857a2caf34b6c570eb86fe1b71fc78c4f9e98702 Mon Sep 17 00:00:00 2001 From: FlareFlo Date: Fri, 19 Jan 2024 03:20:37 +0100 Subject: [PATCH 1631/2020] Fix missing spaces in error log (#1577) --- crates/binstalk/src/ops/resolve.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index f19c96c9..94b1b5ff 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -250,8 +250,8 @@ async fn download_extract_and_verify( if required_features.is_empty() { error!( - "When resolving {name} bin {bin_name} is not found.\ -This binary is not optional so it must be included in the archive, please contact with\ + "When resolving {name} bin {bin_name} is not found. \ +This binary is not optional so it must be included in the archive, please contact with \ upstream to fix this issue." ); // This bin is not optional, error From 87f71b76cdf038366b82f1fafb662400445bdc37 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 19 Jan 2024 03:42:30 +0000 Subject: [PATCH 1632/2020] dep: Upgrade transitive dependencies (#1578) Co-authored-by: github-actions --- Cargo.lock | 209 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 138 insertions(+), 71 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b539bd0e..3bb7653c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,15 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + [[package]] name = "alloc-no-stdlib" version = "2.0.4" @@ -34,9 +43,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.7" +version = "0.6.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd2405b3ac1faab2990b74d728624cd9fd115651fcecc7c2d8daf01376275ba" +checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" dependencies = [ "anstyle", "anstyle-parse", @@ -100,9 +109,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-compression" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc2d0cfb2a7388d34f590e76686704c494ed7aaceed62ee1ba35cbf363abc2a5" +checksum = "a116f46a969224200a0a97f29cfd4c50e7534e4b4826bd23ea2c3c533039c82c" dependencies = [ "brotli", "bzip2", @@ -390,9 +399,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "block-buffer" @@ -489,6 +498,15 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "camino" +version = "1.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +dependencies = [ + "serde", +] + [[package]] name = "cargo-binstall" version = "1.6.0" @@ -518,6 +536,15 @@ dependencies = [ "vergen", ] +[[package]] +name = "cargo-platform" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +dependencies = [ + "serde", +] + [[package]] name = "cargo-toml-workspace" version = "4.0.0" @@ -532,6 +559,20 @@ dependencies = [ "tracing", ] +[[package]] +name = "cargo_metadata" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d886547e41f740c616ae73108f6eb70afe6d940c7bc697cb30f13daec073037" +dependencies = [ + "camino", + "cargo-platform", + "semver", + "serde", + "serde_json", + "thiserror", +] + [[package]] name = "cargo_toml" version = "0.18.0" @@ -569,9 +610,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.16" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58e54881c004cec7895b0068a0a954cd5d62da01aef83fa35b1e594497bf5445" +checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" dependencies = [ "clap_builder", "clap_derive", @@ -579,9 +620,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.16" +version = "4.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59cb82d7f531603d2fd1f507441cdd35184fa81beff7bd489570de7f773460bb" +checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" dependencies = [ "anstream", "anstyle", @@ -1297,9 +1338,9 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.23.1" +version = "0.23.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a39c675fd737cb43a2120eddf1aa652c19d76b28d79783a198ac1b398ed9ce6" +checksum = "7e8dcbf434951fa477063e05fea59722615af70dc2567377e58c2f7853b010fc" dependencies = [ "bstr", "gix-chunk", @@ -1336,7 +1377,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52e0be46f4cf1f8f9e88d0e3eb7b29718aff23889563249f379119bd1ab6910e" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "bstr", "gix-path", "libc", @@ -1401,9 +1442,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.37.1" +version = "0.37.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77a80f0fe688d654c2a741751578b11131071026d1934d03c1820d6d767525ce" +checksum = "d50270e8dcc665f30ba0735b17984b9535bdf1e646c76e638e007846164d57af" dependencies = [ "bytes", "bytesize", @@ -1459,7 +1500,7 @@ version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae6232f18b262770e343dcdd461c0011c9b9ae27f0c805e115012aa2b902c1b8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "bstr", "gix-features", "gix-path", @@ -1500,11 +1541,11 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.28.1" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd97a226ea6a7669109b84fa045bada556ec925e25145cb458adb4958b023ad0" +checksum = "9e50e63df6c8d4137f7fb882f27643b3a9756c468a1a2cdbe1ce443010ca8778" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "bstr", "btoi", "filetime", @@ -1551,7 +1592,7 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6820bb5e9e259f6ad052826037452ca023d4f248c5d710dce067d89685dd582" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "gix-commitgraph", "gix-date", "gix-hash", @@ -1663,7 +1704,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0cdb0ee9517c04f89bcaf6366fe893a17154ecb02d88b5c8174f27f1091d1247" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "bstr", "gix-attributes", "gix-config-value", @@ -1786,7 +1827,7 @@ version = "0.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78f6dce0c6683e2219e8169aac4b1c29e89540a8262fef7056b31d80d969408c" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "gix-path", "libc", "windows 0.52.0", @@ -1822,9 +1863,9 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8e1127ede0475b58f4fe9c0aaa0d9bb0bad2af90bbd93ccd307c8632b863d89" +checksum = "02b202d766a7fefc596e2cc6a89cda8ad8ad733aed82da635ac120691112a9b1" [[package]] name = "gix-transport" @@ -1847,9 +1888,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.36.1" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb64213e52e1b726cb04581690c1e98b5910f983b977d5e9f2eb09f1a7fea6d2" +checksum = "65109e445ba7a409b48f34f570a4d7db72eade1dc1bcff81990a490e86c07161" dependencies = [ "gix-commitgraph", "gix-date", @@ -1952,9 +1993,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.23" +version = "0.3.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b553656127a00601c8ae5590fcfdc118e4083a7924b6cf4ffc1ea4b99dc429d7" +checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" dependencies = [ "bytes", "fnv", @@ -2041,9 +2082,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hickory-proto" @@ -2340,9 +2381,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] @@ -2413,16 +2454,16 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "libc", "redox_syscall 0.4.1", ] [[package]] name = "libz-ng-sys" -version = "1.1.14" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81157dde2fd4ad2b45ea3a4bb47b8193b52a6346b678840d91d80d3c2cd166c5" +checksum = "c6409efc61b12687963e602df8ecf70e8ddacf95bc6576bcf16e3ac6328083c5" dependencies = [ "cmake", "libc", @@ -2436,9 +2477,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" @@ -2668,7 +2709,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cfg-if", "libc", ] @@ -2736,7 +2777,7 @@ version = "0.10.62" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8cde4d2d9200ad5909f8dac647e29482e07c3a35de8a13fce7c9c7747ad9f671" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cfg-if", "foreign-types", "libc", @@ -2867,9 +2908,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d3587f8a9e599cc7ec2c00e331f71c4e69a5f9a4b8a6efd5b07466b9736f9a" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "powerfmt" @@ -3007,9 +3048,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" dependencies = [ "either", "rayon-core", @@ -3017,9 +3058,9 @@ dependencies = [ [[package]] name = "rayon-core" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" dependencies = [ "crossbeam-deque", "crossbeam-utils", @@ -3065,11 +3106,34 @@ dependencies = [ "windows 0.52.0", ] +[[package]] +name = "regex" +version = "1.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + [[package]] name = "regex-automata" version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" @@ -3183,11 +3247,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno 0.3.8", "libc", "linux-raw-sys", @@ -3449,9 +3513,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "3b187f0231d56fe41bfb12034819dd2bf336422a5866de41bc3fec4b2e3883e8" [[package]] name = "smawk" @@ -3771,7 +3835,7 @@ dependencies = [ "redox_syscall 0.3.5", "tokio", "tokio-stream", - "xattr 1.2.0", + "xattr 1.3.1", ] [[package]] @@ -3932,9 +3996,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-bom" @@ -4013,11 +4077,14 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vergen" -version = "8.2.7" +version = "8.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2066fbfd3bfbadab28cab8bae840c9e74917bc6deeef2ed0781f2eb2fdfafdb" +checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525" dependencies = [ "anyhow", + "cargo_metadata", + "cfg-if", + "regex", "rustc_version", "rustversion", "time", @@ -4076,9 +4143,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4086,9 +4153,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", @@ -4101,9 +4168,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if", "js-sys", @@ -4113,9 +4180,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4123,9 +4190,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", @@ -4136,9 +4203,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "wasm-streams" @@ -4155,9 +4222,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" dependencies = [ "js-sys", "wasm-bindgen", @@ -4473,9 +4540,9 @@ dependencies = [ [[package]] name = "xattr" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914566e6413e7fa959cc394fb30e563ba80f3541fbd40816d4c05a0fc3f2a0f1" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", "linux-raw-sys", From 0c74d017f997eff5c6546bb7138d42fa95718f30 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 20 Jan 2024 06:16:31 +0000 Subject: [PATCH 1633/2020] release: detect-targets v0.1.15 (#1579) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3bb7653c..d87cfced 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -846,7 +846,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.14" +version = "0.1.15" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 6b8bfe61..22248ca5 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -25,5 +25,5 @@ toml_edit = { version = "0.21.0", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.14", path = "../detect-targets" } +detect-targets = { version = "0.1.15", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index e55b1c65..4e2f498d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -18,7 +18,7 @@ binstalk-types = { version = "0.6.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "4.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } -detect-targets = { version = "0.1.14", path = "../detect-targets", features = ["tracing"] } +detect-targets = { version = "0.1.15", path = "../detect-targets", features = ["tracing"] } either = "1.8.1" itertools = "0.12.0" jobslot = { version = "0.2.11", features = ["tokio"] } diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 97f5b5cb..6066568d 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.14" +version = "0.1.15" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From 7fc0a333e3ea8d84360d5e614274d2069451c1be Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 20 Jan 2024 08:06:39 +0000 Subject: [PATCH 1634/2020] release: binstalk v0.20.1 (#1580) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d87cfced..8bb43f90 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -216,7 +216,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.20.0" +version = "0.20.1" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index e0038c5c..11a1de0f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.20.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.20.1", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.11.0" } clap = { version = "4.4.8", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 4e2f498d..599822db 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.20.0" +version = "0.20.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From 412d42001a8d74eff0ff733a117009121f0d2207 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 Jan 2024 09:00:04 +0000 Subject: [PATCH 1635/2020] build(deps): bump the deps group with 1 update (#1581) Bumps the deps group with 1 update: [gix](https://github.com/Byron/gitoxide). Updates `gix` from 0.57.1 to 0.58.0 - [Release notes](https://github.com/Byron/gitoxide/releases) - [Changelog](https://github.com/Byron/gitoxide/blob/main/CHANGELOG.md) - [Commits](https://github.com/Byron/gitoxide/compare/gix-v0.57.1...gix-v0.58.0) --- updated-dependencies: - dependency-name: gix dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 166 ++++++++++++++++++----------------- crates/simple-git/Cargo.toml | 2 +- 2 files changed, 87 insertions(+), 81 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8bb43f90..b8920dd3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1221,9 +1221,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gix" -version = "0.57.1" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd025382892c7b500a9ce1582cd803f9c2ebfe44aff52e9c7f86feee7ced75e" +checksum = "31887c304d9a935f3e5494fb5d6a0106c34e965168ec0db9b457424eedd0c741" dependencies = [ "gix-actor", "gix-attributes", @@ -1272,14 +1272,13 @@ dependencies = [ "reqwest", "smallvec", "thiserror", - "unicode-normalization", ] [[package]] name = "gix-actor" -version = "0.29.1" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da27b5ab4ab5c75ff891dccd48409f8cc53c28a79480f1efdd33184b2dc1d958" +checksum = "0a7bb9fad6125c81372987c06469601d37e1a2d421511adb69971b9083517a8a" dependencies = [ "bstr", "btoi", @@ -1291,9 +1290,9 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.21.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6de7603d6bcefcf9a1d87779c4812b14665f71bc870df7ce9ca4c4b309de18" +checksum = "214ee3792e504ee1ce206b36dcafa4f328ca313d1e2ac0b41433d68ef4e14260" dependencies = [ "bstr", "gix-glob", @@ -1326,9 +1325,9 @@ dependencies = [ [[package]] name = "gix-command" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deefa783a418ceb5ae88d0701ab110efaec2df398f4520d90529dec543e48467" +checksum = "ce1ffc7db3fb50b7dae6ecd937a3527cb725f444614df2ad8988d81806f13f09" dependencies = [ "bstr", "gix-path", @@ -1338,9 +1337,9 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.23.2" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e8dcbf434951fa477063e05fea59722615af70dc2567377e58c2f7853b010fc" +checksum = "82dbd7fb959862e3df2583331f0ad032ac93533e8a52f1b0694bc517f5d292bc" dependencies = [ "bstr", "gix-chunk", @@ -1352,9 +1351,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.33.1" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "367304855b369cadcac4ee5fb5a3a20da9378dd7905106141070b79f85241079" +checksum = "e62bf2073b6ce3921ffa6d8326f645f30eec5fc4a8e8a4bc0fcb721a2f3f69dc" dependencies = [ "bstr", "gix-config-value", @@ -1373,9 +1372,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.3" +version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e0be46f4cf1f8f9e88d0e3eb7b29718aff23889563249f379119bd1ab6910e" +checksum = "5b8a1e7bfb37a46ed0b8468db37a6d8a0a61d56bdbe4603ae492cb322e5f3958" dependencies = [ "bitflags 2.4.2", "bstr", @@ -1386,9 +1385,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.23.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380cf3a7c31763743ae6403ec473281d54bfa05628331d09518a350ad5a0971f" +checksum = "206ede3fe433abba3c8b0174179d5bbac65ae3f0d9187e2ea96c0494db6a139f" dependencies = [ "bstr", "gix-command", @@ -1415,9 +1414,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.39.1" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6a0454f8c42d686f17e7f084057c717c082b7dbb8209729e4e8f26749eb93a" +checksum = "cbdcb5e49c4b9729dd1c361040ae5c3cd7c497b2260b18c954f62db3a63e98cf" dependencies = [ "bstr", "gix-hash", @@ -1427,12 +1426,13 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8d7b2896edc3d899d28a646ccc6df729827a6600e546570b2783466404a42d6" +checksum = "b4669218f3ec0cbbf8f16857b32200890f8ca585f36f5817242e4115fe4551af" dependencies = [ "bstr", "dunce", + "gix-fs", "gix-hash", "gix-path", "gix-ref", @@ -1442,9 +1442,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.37.2" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50270e8dcc665f30ba0735b17984b9535bdf1e646c76e638e007846164d57af" +checksum = "184f7f7d4e45db0e2a362aeaf12c06c5e84817d0ef91d08e8e90170dad9f0b07" dependencies = [ "bytes", "bytesize", @@ -1453,6 +1453,7 @@ dependencies = [ "flate2", "gix-hash", "gix-trace", + "gix-utils", "jwalk", "libc", "once_cell", @@ -1466,9 +1467,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f598c1d688bf9d57f428ed7ee70c3e786d6f0cc7ed1aeb3c982135af41f6e516" +checksum = "9240862840fb740d209422937195e129e4ed3da49af212383260134bea8f6c1a" dependencies = [ "bstr", "encoding_rs", @@ -1487,18 +1488,19 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7555c23a005537434bbfcb8939694e18cad42602961d0de617f8477cc2adecdd" +checksum = "4436e883d5769f9fb18677b8712b49228357815f9e4104174a6fc2d8461a437b" dependencies = [ "gix-features", + "gix-utils", ] [[package]] name = "gix-glob" -version = "0.15.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae6232f18b262770e343dcdd461c0011c9b9ae27f0c805e115012aa2b902c1b8" +checksum = "4965a1d06d0ab84a29d4a67697a97352ab14ae1da821084e5afb1fd6d8191ca0" dependencies = [ "bitflags 2.4.2", "bstr", @@ -1529,21 +1531,22 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f356ce440c60aedb7e72f3447f352f9c5e64352135c8cf33e838f49760fd2643" +checksum = "1f7069aaca4a05784c4cb44e392f0eaf627c6e57e05d3100c0e2386a37a682f0" dependencies = [ "bstr", "gix-glob", "gix-path", + "gix-trace", "unicode-bom", ] [[package]] name = "gix-index" -version = "0.28.2" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e50e63df6c8d4137f7fb882f27643b3a9756c468a1a2cdbe1ce443010ca8778" +checksum = "1d7152181ba8f0a3addc5075dd612cea31fc3e252b29c8be8c45f4892bf87426" dependencies = [ "bitflags 2.4.2", "bstr", @@ -1566,9 +1569,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "12.0.1" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40a439397f1e230b54cf85d52af87e5ea44cc1e7748379785d3f6d03d802b00" +checksum = "651e46174dc5e7d18b7b809d31937b6de3681b1debd78618c99162cc30fcf3e1" dependencies = [ "gix-tempfile", "gix-utils", @@ -1588,9 +1591,9 @@ dependencies = [ [[package]] name = "gix-negotiate" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6820bb5e9e259f6ad052826037452ca023d4f248c5d710dce067d89685dd582" +checksum = "a163adb84149e522e991cbe27250a6e01de56f98cd05b174614ce3f8a4e8b140" dependencies = [ "bitflags 2.4.2", "gix-commitgraph", @@ -1604,9 +1607,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.40.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c89402e8faa41b49fde348665a8f38589e461036475af43b6b70615a6a313a2" +checksum = "693ce9d30741506cb082ef2d8b797415b48e032cce0ab23eff894c19a7e4777b" dependencies = [ "bstr", "btoi", @@ -1623,13 +1626,14 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.56.1" +version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46ae6da873de41c6c2b73570e82c571b69df5154dcd8f46dfafc6687767c33b1" +checksum = "8ba2fa9e81f2461b78b4d81a807867667326c84cdab48e0aed7b73a593aa1be4" dependencies = [ "arc-swap", "gix-date", "gix-features", + "gix-fs", "gix-hash", "gix-object", "gix-pack", @@ -1642,9 +1646,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.46.1" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "782b4d42790a14072d5c400deda9851f5765f50fe72bca6dece0da1cd6f05a9a" +checksum = "8da5f3e78c96b76c4e6fe5e8e06b76221e4a0ee9a255aa935ed1fdf68988dfd8" dependencies = [ "clru", "gix-chunk", @@ -1663,9 +1667,9 @@ dependencies = [ [[package]] name = "gix-packetline" -version = "0.17.2" +version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f894634991382500b9c701550e2b4f64c411d5582adbebcc748a4511feb4356d" +checksum = "09ff45eef7747bde4986429a3e813478d50c2688b8f239e57bd3aa81065b285f" dependencies = [ "bstr", "faster-hex", @@ -1675,9 +1679,9 @@ dependencies = [ [[package]] name = "gix-packetline-blocking" -version = "0.17.2" +version = "0.17.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c67ed1571267cc92ee64ab3e39eeaef46e5fc690bac9d12f1ddd1b1331be10dc" +checksum = "ca8ef6dd3ea50e26f3bf572e90c034d033c804d340cd1eb386392f184a9ba2f7" dependencies = [ "bstr", "faster-hex", @@ -1687,9 +1691,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8dd0998ab245f33d40ca2267e58d542fe54185ebd1dc41923346cf28d179fb6" +checksum = "14a6282621aed1becc3f83d64099a564b3b9063f22783d9a87ea502a3e9f2e40" dependencies = [ "bstr", "gix-trace", @@ -1700,9 +1704,9 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cdb0ee9517c04f89bcaf6366fe893a17154ecb02d88b5c8174f27f1091d1247" +checksum = "9cbd49750edb26b0a691e5246fc635fa554d344da825cd20fa9ee0da9c1b761f" dependencies = [ "bitflags 2.4.2", "bstr", @@ -1728,9 +1732,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.43.1" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eca52738435991105f3bbd7f3a3a42cdf84c9992a78b9b7b1de528b3c022cfdd" +checksum = "84af465436787ff423a1b4d5bd0c1979200e7165ed04324fa03ba2235485eebc" dependencies = [ "bstr", "btoi", @@ -1757,9 +1761,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.40.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d9bd1984638d8f3511a2fcbe84fcedb8a5b5d64df677353620572383f42649" +checksum = "5818958994ad7879fa566f5441ebcc48f0926aa027b28948e6fbf6578894dc31" dependencies = [ "gix-actor", "gix-date", @@ -1770,6 +1774,7 @@ dependencies = [ "gix-object", "gix-path", "gix-tempfile", + "gix-utils", "gix-validate", "memmap2", "thiserror", @@ -1778,9 +1783,9 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.21.1" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be219df5092c1735abb2a53eccdf775e945eea6986ee1b6e7a5896dccc0be704" +checksum = "613aa4d93034c5791d13bdc635e530f4ddab1412ddfb4a8215f76213177b61c7" dependencies = [ "bstr", "gix-hash", @@ -1792,9 +1797,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa78e1df3633bc937d4db15f8dca2abdb1300ca971c0fabcf9fa97e38cf4cd9f" +checksum = "288f6549d7666db74dc3f169a9a333694fc28ecd2f5aa7b2c979c89eb556751a" dependencies = [ "bstr", "gix-date", @@ -1808,9 +1813,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702de5fe5c2bbdde80219f3a8b9723eb927466e7ecd187cfd1b45d986408e45f" +checksum = "5b9b4d91dfc5c14fee61a28c65113ded720403b65a0f46169c0460f731a5d03c" dependencies = [ "gix-commitgraph", "gix-date", @@ -1823,21 +1828,21 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.10.3" +version = "0.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f6dce0c6683e2219e8169aac4b1c29e89540a8262fef7056b31d80d969408c" +checksum = "f8d9bf462feaf05f2121cba7399dbc6c34d88a9cad58fc1e95027791d6a3c6d2" dependencies = [ "bitflags 2.4.2", "gix-path", "libc", - "windows 0.52.0", + "windows-sys 0.52.0", ] [[package]] name = "gix-submodule" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21d438409222de24dffcc9897f04a9f97903a19fe4835b598ab3bb9b6e0f5e35" +checksum = "73182f6c1f5ed1ed94ba16581ac62593d5e29cd1c028b2af618f836283b8f8d4" dependencies = [ "bstr", "gix-config", @@ -1850,9 +1855,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "12.0.1" +version = "13.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8ef376d718b1f5f119b458e21b00fbf576bc9d4e26f8f383d29f5ffe3ba3eaa" +checksum = "2d337955b7af00fb87120d053d87cdfb422a80b9ff7a3aa4057a99c79422dc30" dependencies = [ "gix-fs", "libc", @@ -1869,9 +1874,9 @@ checksum = "02b202d766a7fefc596e2cc6a89cda8ad8ad733aed82da635ac120691112a9b1" [[package]] name = "gix-transport" -version = "0.40.1" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be01a22053e9395a409fcaeed879d94f4fcffeb4f46de7143275fbf5e5b39770" +checksum = "58aba2869cc38937bc834b068c93e09e2ab1119bac626f0464d100c1438b799a" dependencies = [ "base64", "bstr", @@ -1888,9 +1893,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.36.2" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65109e445ba7a409b48f34f570a4d7db72eade1dc1bcff81990a490e86c07161" +checksum = "bfc30c5b5e4e838683b59e1b0574ce6bc1c35916df9709aaab32bb7751daf08b" dependencies = [ "gix-commitgraph", "gix-date", @@ -1904,9 +1909,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.26.1" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0f17cceb7552a231d1fec690bc2740c346554e3be6f5d2c41dfa809594dc44" +checksum = "26f1981ecc700f4fd73ae62b9ca2da7c8816c8fd267f0185e3f8c21e967984ac" dependencies = [ "bstr", "gix-features", @@ -1918,11 +1923,12 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de6225e2de30b6e9bca2d9f1cc4731640fcef0fb3cabddceee366e7e85d3e94f" +checksum = "56e839f3d0798b296411263da6bee780a176ef8008a5dfc31287f7eda9266ab8" dependencies = [ "fastrand 2.0.1", + "unicode-normalization", ] [[package]] @@ -1937,9 +1943,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.29.1" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53982f8abff0789a9599e644108a1914da61a4d0dede8e45037e744dcb008d52" +checksum = "ca36bb3dc54038c66507dc75c4d8edbee2d6d5cc45227b4eb508ad13dd60a006" dependencies = [ "bstr", "gix-attributes", @@ -1955,9 +1961,9 @@ dependencies = [ [[package]] name = "gix-worktree-state" -version = "0.6.1" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8c74e732224c051370ce78b84748e36de9ace200dc47983da8629740ece20a1" +checksum = "8ae178614b70bdb0c7f6f21b8c9fb711ab78bd7e8e1866f565fcf28876747f1d" dependencies = [ "bstr", "gix-features", diff --git a/crates/simple-git/Cargo.toml b/crates/simple-git/Cargo.toml index eefed5a4..4f552803 100644 --- a/crates/simple-git/Cargo.toml +++ b/crates/simple-git/Cargo.toml @@ -18,7 +18,7 @@ tokio = { version = "1.35.0", features = ["rt", "time"], default-features = fals tracing = "0.1.39" [dependencies.gix] -version = "0.57.0" +version = "0.58.0" default-features = false features = [ "comfort", From 32b73b1ee991c6c2f143b231c75410c351dbf102 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 21 Jan 2024 00:46:34 +1000 Subject: [PATCH 1636/2020] Update crates.io description for cargo-binstall (#1583) Since the one on GitHub has changed. Signed-off-by: Jiahao XU --- crates/bin/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 11a1de0f..6dcac580 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-binstall" -description = "Rust binary package installer for CI integration" +description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" version = "1.6.0" From 70ebed3702b8471029273bd88b994f4283b31629 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 21 Jan 2024 02:42:49 +1000 Subject: [PATCH 1637/2020] Update `::fmt` impl (#1582) Forward it to `::fmt` now that `gix::Url` implements `Display` Signed-off-by: Jiahao XU --- crates/simple-git/src/lib.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/simple-git/src/lib.rs b/crates/simple-git/src/lib.rs index e432baff..78a8c2bb 100644 --- a/crates/simple-git/src/lib.rs +++ b/crates/simple-git/src/lib.rs @@ -18,10 +18,7 @@ pub struct GitUrl(Url); impl fmt::Display for GitUrl { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let url_bstr = self.0.to_bstring(); - let url_str = String::from_utf8_lossy(&url_bstr); - - f.write_str(&url_str) + fmt::Display::fmt(&self.0, f) } } From 7f70a4e8eed8c7ff6a2890ddc098dcf8c41520d8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 21 Jan 2024 00:19:23 +0000 Subject: [PATCH 1638/2020] release: simple-git v0.2.2 (#1584) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/simple-git/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b8920dd3..0b526914 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3498,7 +3498,7 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.1" +version = "0.2.2" dependencies = [ "compact_str", "derive_destructure2", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 71ee9f02..0fe64545 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -25,7 +25,7 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde_json = "1.0.107" sha2 = "0.10.7" -simple-git = { version = "0.2.1", path = "../simple-git", optional = true } +simple-git = { version = "0.2.2", path = "../simple-git", optional = true } tempfile = "3.5.0" thiserror = "1.0.52" tokio = { version = "1.35.0", features = ["rt", "sync"], default-features = false } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 599822db..b39784ed 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ leon = { version = "2.0.1", path = "../leon" } maybe-owned = "0.3.4" miette = "5.9.0" semver = { version = "1.0.17", features = ["serde"] } -simple-git = { version = "0.2.1", path = "../simple-git", optional = true } +simple-git = { version = "0.2.2", path = "../simple-git", optional = true } strum = "0.25.0" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" diff --git a/crates/simple-git/Cargo.toml b/crates/simple-git/Cargo.toml index 4f552803..6bcf93a2 100644 --- a/crates/simple-git/Cargo.toml +++ b/crates/simple-git/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "simple-git" -version = "0.2.1" +version = "0.2.2" edition = "2021" description = "The simple git interface for gix suitable for async context (with tokio)" From 01ddf00b545d19eed2a6428aa23703c871e4bbb5 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 21 Jan 2024 16:50:20 +1000 Subject: [PATCH 1639/2020] Fix Unmatched checksum error (#1585) Fixed #1575 Always consume the stream if a `data_verifier` is provided in `binstalk_download::Download` Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/download.rs | 40 ++++++++++------------ 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index 53cba008..4bb26d82 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -201,18 +201,17 @@ impl Download<'_> { debug!("Downloading and extracting then in-memory processing"); - match extract_tar_based_stream_and_visit(&mut stream, fmt, visitor).await { - Ok(()) => { - debug!("Download, extraction and in-memory procession OK"); - Ok(()) - } - Err(err) => { - if has_data_verifier { - consume_stream(&mut stream).await; - } - Err(err) - } + let res = extract_tar_based_stream_and_visit(&mut stream, fmt, visitor).await; + + if has_data_verifier { + consume_stream(&mut stream).await; } + + if res.is_ok() { + debug!("Download, extraction and in-memory procession OK"); + } + + res } /// Download a file from the provided URL and extract it to the provided path. @@ -242,18 +241,15 @@ impl Download<'_> { PkgFmtDecomposed::Zip => extract_zip(&mut stream, path).await, }; - match res { - Ok(extracted_files) => { - debug!("Download OK, extracted to: '{}'", path.display()); - Ok(extracted_files) - } - Err(err) => { - if has_data_verifier { - consume_stream(&mut stream).await; - } - Err(err) - } + if has_data_verifier { + consume_stream(&mut stream).await; } + + if res.is_ok() { + debug!("Download OK, extracted to: '{}'", path.display()); + } + + res } inner(self, fmt, path.as_ref()).await From a7c691873d4c738f8522c35298b2550cf229b7f0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 21 Jan 2024 22:12:02 +1300 Subject: [PATCH 1640/2020] release: cargo-binstall v1.6.1 (#1586) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0b526914..9d3d53c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -509,7 +509,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.6.0" +version = "1.6.1" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 6dcac580..ba5f0863 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.6.0" +version = "1.6.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index c10c10b2..d8947640 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 12b2824a3b97efd3d6da0f5f215b35f7857eeb27 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 26 Jan 2024 04:04:15 +0000 Subject: [PATCH 1641/2020] dep: Upgrade transitive dependencies (#1587) Co-authored-by: github-actions --- Cargo.lock | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9d3d53c1..b8f14547 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2563,9 +2563,9 @@ checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memmap2" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45fd3a57831bf88bc63f8cebc0cf956116276e97fef3966103e96416209f7c92" +checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" dependencies = [ "libc", ] @@ -2779,9 +2779,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.62" +version = "0.10.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cde4d2d9200ad5909f8dac647e29482e07c3a35de8a13fce7c9c7747ad9f671" +checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" dependencies = [ "bitflags 2.4.2", "cfg-if", @@ -2811,9 +2811,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.98" +version = "0.9.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1665caf8ab2dc9aef43d1c0023bd904633a6a05cb30b0ad59bec2ae986e57a7" +checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" dependencies = [ "cc", "libc", @@ -2882,18 +2882,18 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" +checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.3" +version = "1.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" +checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2", "quote", @@ -2942,9 +2942,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.76" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95fc56cda0b5c3325f5fbbd7ff9fda9e02bb00bb3dac51252d2f1bfa1cb8cc8c" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -3114,9 +3114,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", @@ -3126,9 +3126,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -3519,9 +3519,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b187f0231d56fe41bfb12034819dd2bf336422a5866de41bc3fec4b2e3883e8" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "smawk" @@ -3603,9 +3603,9 @@ dependencies = [ [[package]] name = "supports-unicode" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b6c2cb240ab5dd21ed4906895ee23fe5a48acdbd15a3ce388e7b62a9b66baf7" +checksum = "f850c19edd184a205e883199a261ed44471c81e39bd95b1357f5febbef00e77a" dependencies = [ "is-terminal", ] From dba9dd5ff07cf8abeec838910e76eeb234de3fef Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 1 Feb 2024 00:26:11 +1000 Subject: [PATCH 1642/2020] build(deps): bump actions/{up, down}load-artifact from 3 to 4 (#1591) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Revert "Revert "build(deps): bump actions/{up, down}load-artifact from 3 to 4…" This reverts commit f5da25cc56cc7fd1b7c13f93ea559d7b60b742bc. --- .github/workflows/ci.yml | 10 +++++----- .github/workflows/release-cli.yml | 8 ++++---- .github/workflows/release-packages.yml | 20 ++++++++++---------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86ba6d7a..4639ab3e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -172,7 +172,7 @@ jobs: # Set working directory here, otherwise `cargo-zigbuild` would download # and build quite a few unused dependencies. working-directory: crates/detect-targets - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: detect-targets path: target/${{ env.CARGO_BUILD_TARGET }}/debug/detect-targets @@ -183,7 +183,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: detect-targets - run: chmod +x detect-targets @@ -205,7 +205,7 @@ jobs: - ubuntu-latest runs-on: ${{ matrix.os }} steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: detect-targets - run: chmod +x detect-targets @@ -228,7 +228,7 @@ jobs: - fedora runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: detect-targets - run: chmod +x detect-targets @@ -244,7 +244,7 @@ jobs: needs: detect-targets-build runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: detect-targets - run: chmod +x detect-targets diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 92b271c9..3340b4ca 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -46,11 +46,11 @@ jobs: env: AGE_KEY_PUBLIC: ${{ vars.AGE_KEY_PUBLIC }} run: .github/scripts/ephemeral-gen.sh - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: minisign.pub path: minisign.pub - - uses: actions/upload-artifact@v3 + - uses: actions/upload-artifact@v4 with: name: minisign.key.age path: minisign.key.age @@ -79,7 +79,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: minisign.pub @@ -93,7 +93,7 @@ jobs: run: cargo publish --dry-run -p "$crate" --allow-dirty --no-default-features - if: fromJSON(inputs.info).is-release != 'true' && fromJSON(inputs.info).crate != '' name: Upload crate package as artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: crate-package path: target/package/*.crate diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index 6cc60658..04403e39 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -70,7 +70,7 @@ jobs: - run: just toolchain rust-src - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: minisign.pub - run: just package @@ -85,7 +85,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: minisign.key.age - name: Sign package @@ -107,14 +107,14 @@ jobs: prerelease: true - if: "fromJSON(inputs.publish).is-release != 'true' || runner.os == 'macOS'" name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.t }} path: packages/cargo-binstall-* retention-days: 1 - name: Upload timings - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.t }}-cargo-timings path: target/cargo-timings @@ -138,27 +138,27 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: x86_64h-apple-darwin path: packages/ - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: x86_64-apple-darwin path: packages/ - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: aarch64-apple-darwin path: packages/ - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: minisign.pub - run: ls -shalr packages/ - run: just repackage-lipo - run: ls -shal packages/ - - uses: actions/download-artifact@v3 + - uses: actions/download-artifact@v4 with: name: minisign.key.age - env: @@ -180,7 +180,7 @@ jobs: prerelease: true - if: fromJSON(inputs.publish).is-release != 'true' name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: universal-apple-darwin path: packages/cargo-binstall-universal-* From 9cf7b15df82a1671cfa301578fcd00fd6e6fb31c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 1 Feb 2024 00:26:57 +1000 Subject: [PATCH 1643/2020] CI: Use runner `macos-14` which uses M1 machine (#1590) * CI: Use runner `macos-14` which uses M1 machine `macos-14` provides 3-core M1, 7G mem and 14G stroage, while `macos-latest` (`macos-13` as of writing) provides 4-core intel, 14G mem and 14G storage. While the memory is cut by half and core count reduce by 1, I believe that it would still speedup the CI since M1 is much more powerful than previous Intel CPU used in `macos-13`. It would also allow us to run tests on aarch64-apple-darwin and on universal-apple-darwin, if necessary. Signed-off-by: Jiahao XU * CI: Fix `e2e-test-subcrate`: Bump `cargo-audit` ver to v0.18.3 Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 6 +++--- .github/workflows/gh-action.yml | 2 +- .github/workflows/install-script.yml | 2 +- .github/workflows/release-packages.yml | 8 ++++---- e2e-tests/subcrate.sh | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4639ab3e..6964748f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -40,7 +40,7 @@ jobs: matrix: include: - target: x86_64-apple-darwin - os: macos-latest + os: macos-14 - target: x86_64-unknown-linux-gnu os: ubuntu-latest - target: x86_64-pc-windows-msvc @@ -78,7 +78,7 @@ jobs: - target: x86_64-unknown-linux-musl os: ubuntu-latest - target: aarch64-apple-darwin - os: macos-latest + os: macos-14 - target: aarch64-pc-windows-msvc os: windows-latest runs-on: ${{ matrix.os }} @@ -108,7 +108,7 @@ jobs: matrix: include: - target: x86_64-apple-darwin - os: macos-latest + os: macos-14 - target: x86_64-unknown-linux-gnu os: ubuntu-latest - target: x86_64-pc-windows-msvc diff --git a/.github/workflows/gh-action.yml b/.github/workflows/gh-action.yml index ae86c47e..47b78223 100644 --- a/.github/workflows/gh-action.yml +++ b/.github/workflows/gh-action.yml @@ -19,7 +19,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ macos-latest, ubuntu-latest, windows-latest ] + os: [ macos-14, ubuntu-latest, windows-latest ] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/install-script.yml b/.github/workflows/install-script.yml index fec2960e..e04d09cb 100644 --- a/.github/workflows/install-script.yml +++ b/.github/workflows/install-script.yml @@ -29,7 +29,7 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-latest, ubuntu-latest] + os: [macos-14, ubuntu-latest] set_cargo_home: [t, f] runs-on: ${{ matrix.os }} diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index 04403e39..e031981f 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -27,9 +27,9 @@ jobs: fail-fast: false matrix: include: - - { o: macos-latest, t: x86_64-apple-darwin, r: true } - - { o: macos-latest, t: x86_64h-apple-darwin, } - - { o: macos-latest, t: aarch64-apple-darwin } + - { o: macos-14, t: x86_64-apple-darwin, r: true } + - { o: macos-14, t: x86_64h-apple-darwin, } + - { o: macos-14, t: aarch64-apple-darwin } - { o: ubuntu-latest, t: x86_64-unknown-linux-gnu, g: 2.17, r: true, c: true } - { o: ubuntu-latest, t: armv7-unknown-linux-gnueabihf, g: 2.17, c: true } - { o: ubuntu-latest, t: aarch64-unknown-linux-gnu, g: 2.17, c: true } @@ -125,7 +125,7 @@ jobs: name: universal-apple-darwin permissions: contents: write - runs-on: macos-latest + runs-on: macos-14 env: JUST_FOR_RELEASE: true diff --git a/e2e-tests/subcrate.sh b/e2e-tests/subcrate.sh index 90e0fcd2..40a15ecc 100755 --- a/e2e-tests/subcrate.sh +++ b/e2e-tests/subcrate.sh @@ -14,9 +14,9 @@ mkdir -p "$othertmpdir/bin" cp "./$1" "$othertmpdir/bin/" # cargo-audit -cargo binstall --no-confirm cargo-audit@0.17.5 --strategies crate-meta-data +cargo binstall --no-confirm cargo-audit@0.18.3 --strategies crate-meta-data cargo_audit_version="$(cargo audit --version)" echo "$cargo_audit_version" -[ "$cargo_audit_version" = "cargo-audit 0.17.5" ] +[ "$cargo_audit_version" = "cargo-audit 0.18.3" ] From 6dc2a0a8238d3fe629dd0f11fd6b240ff3877557 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 1 Feb 2024 00:28:34 +1000 Subject: [PATCH 1644/2020] Fix: Load system-wide native cert on rustls (#1589) * Fix: Load system-wide native cert on rustls Signed-off-by: Jiahao XU * Update `Cargo.lock` Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- Cargo.lock | 13 +++++++++++++ crates/binstalk-downloader/Cargo.toml | 2 ++ 2 files changed, 15 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index b8f14547..aeeae558 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3172,6 +3172,7 @@ dependencies = [ "pin-project-lite", "quinn", "rustls", + "rustls-native-certs", "rustls-pemfile", "serde", "serde_json", @@ -3276,6 +3277,18 @@ dependencies = [ "sct", ] +[[package]] +name = "rustls-native-certs" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index dbc8c0c4..e86bc561 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -66,6 +66,8 @@ rustls = [ "__tls", "reqwest/rustls-tls", + "reqwest/rustls-tls-webpki-roots", + "reqwest/rustls-tls-native-roots", # Enable the following features only if hickory-resolver is enabled. "hickory-resolver?/dns-over-rustls", From c300d8cd35325c98b3ed9ab7b93b0cf8b38f8b3c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 2 Feb 2024 03:37:30 +0000 Subject: [PATCH 1645/2020] dep: Upgrade transitive dependencies (#1593) Co-authored-by: github-actions --- Cargo.lock | 95 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 55 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aeeae558..66bed0dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,9 +57,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" +checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" [[package]] name = "anstyle-parse" @@ -335,7 +335,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror", - "toml_edit 0.21.0", + "toml_edit 0.21.1", "url", ] @@ -361,7 +361,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", - "toml_edit 0.21.0", + "toml_edit 0.21.1", "tracing", "url", ] @@ -820,9 +820,9 @@ dependencies = [ [[package]] name = "deflate64" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61ceff48ed7e0e66d428a569d36485a091c39fe118ee1220217655f6b814fa9" +checksum = "9576c1de19747eb6f5efb6a806c3e836512bbdb17bfedc984ccb0bcc953c8390" [[package]] name = "deranged" @@ -1691,9 +1691,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.4" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14a6282621aed1becc3f83d64099a564b3b9063f22783d9a87ea502a3e9f2e40" +checksum = "97e9ad649bf5e109562d6acba657ca428661ec08e77eaf3a755d8fa55485be9c" dependencies = [ "bstr", "gix-trace", @@ -2285,9 +2285,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" dependencies = [ "equivalent", "hashbrown", @@ -2349,9 +2349,9 @@ checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" [[package]] name = "itertools" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25db6b064527c5d482d0423354fcd07a89a2dfe07b67892e62411946db7f07b0" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" dependencies = [ "either", ] @@ -2440,9 +2440,9 @@ dependencies = [ [[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 = "libmimalloc-sys" @@ -2531,13 +2531,13 @@ checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" [[package]] name = "maybe-async" -version = "0.2.7" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f1b8c13cb1f814b634a96b2c725449fe7ed464a7b8781de8688be5ffbd3f305" +checksum = "afc95a651c82daf7004c824405aa1019723644950d488571bd718e3ed84646ed" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] @@ -2734,6 +2734,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + [[package]] name = "num-traits" version = "0.2.17" @@ -3143,9 +3149,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.23" +version = "0.11.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b1ae8d9ac08420c66222fb9096fc5de435c3c48542bc5336c51892cffafb41" +checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" dependencies = [ "async-compression", "base64", @@ -3177,6 +3183,7 @@ dependencies = [ "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", @@ -3254,9 +3261,9 @@ dependencies = [ [[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 0.3.8", @@ -3388,9 +3395,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.195" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63261df402c67811e9ac6def069e4786148c4563f4b50fd4bf30aa370d626b02" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] @@ -3406,9 +3413,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.195" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46fe8f8603d81ba86327b23a2e9cdf49e1255fb94a4c5f297f6ee0547178ea2c" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", @@ -3417,9 +3424,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.111" +version = "1.0.113" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176e46fa42316f18edd598015a5166857fc835ec732f5215eac6b7bdbf0a84f4" +checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" dependencies = [ "itoa", "ryu", @@ -3645,6 +3652,12 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "system-configuration" version = "0.5.1" @@ -3738,13 +3751,14 @@ dependencies = [ [[package]] name = "time" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f657ba42c3f86e7680e53c8cd3af8abbe56b5491790b46e22e19c0d57463583e" +checksum = "fe80ced77cbfb4cb91a94bf72b378b4b6791a0d9b7f09d0be747d1bdff4e68bd" dependencies = [ "deranged", "itoa", "libc", + "num-conv", "num_threads", "powerfmt", "serde", @@ -3760,10 +3774,11 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26197e33420244aeb70c3e8c78376ca46571bc4e701e4791c2cd9f57dcb3a43f" +checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" dependencies = [ + "num-conv", "time-core", ] @@ -3874,14 +3889,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "c6a4b9e8023eb94392d3dca65d717c53abc5dad49c07cb65bb8fcd87115fa325" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.0", + "toml_edit 0.21.1", ] [[package]] @@ -3906,9 +3921,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" dependencies = [ "indexmap", "serde", @@ -4228,9 +4243,9 @@ checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "wasm-streams" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4609d447824375f43e1ffbc051b50ad8f4b3ae8219680c94452ea05eb240ac7" +checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" dependencies = [ "futures-util", "js-sys", @@ -4521,9 +4536,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.34" +version = "0.5.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7cf47b659b318dccbd69cc4797a39ae128f533dce7902a1096044d1967b9c16" +checksum = "818ce546a11a9986bc24f93d0cdf38a8a1a400f1473ea8c82e59f6e0ffab9249" dependencies = [ "memchr", ] From 923c317bd4a8ef0142a4cc600ba332baca466fc2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 3 Feb 2024 12:47:42 +1000 Subject: [PATCH 1646/2020] build(deps): bump the deps group with 3 updates (#1596) Bumps the deps group with 3 updates: [strum](https://github.com/Peternator7/strum), [strum_macros](https://github.com/Peternator7/strum) and [cargo_toml](https://gitlab.com/lib.rs/cargo_toml). Updates `strum` from 0.25.0 to 0.26.1 - [Release notes](https://github.com/Peternator7/strum/releases) - [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md) - [Commits](https://github.com/Peternator7/strum/commits/v0.26.1) Updates `strum_macros` from 0.25.3 to 0.26.1 - [Release notes](https://github.com/Peternator7/strum/releases) - [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md) - [Commits](https://github.com/Peternator7/strum/commits/v0.26.1) Updates `cargo_toml` from 0.18.0 to 0.19.1 - [Commits](https://gitlab.com/lib.rs/cargo_toml/commits/main) --- updated-dependencies: - dependency-name: strum dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: strum_macros dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: cargo_toml dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 12 ++++++------ crates/bin/Cargo.toml | 4 ++-- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 66bed0dd..2a6fc6d5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -575,9 +575,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.18.0" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "802b755090e39835a4b0440fb0bbee0df7495a8b337f63db21e616f7821c7e8c" +checksum = "3dc9f7a067415ab5058020f04c60ec7b557084dbec0e021217bbabc7a8d38d14" dependencies = [ "serde", "toml", @@ -3585,15 +3585,15 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "strum" -version = "0.25.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290d54ea6f91c969195bdbcd7442c8c2a2ba87da8bf60a7ee86a235d4bc1e125" +checksum = "723b93e8addf9aa965ebe2d11da6d7540fa2283fcea14b3371ff055f7ba13f5f" [[package]] name = "strum_macros" -version = "0.25.3" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23dc1fa9ac9c169a78ba62f0b841814b7abae11bdd047b9c58f893439e309ea0" +checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18" dependencies = [ "heck", "proc-macro2", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index ba5f0863..5b6cdbcc 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -34,8 +34,8 @@ miette = "5.9.0" mimalloc = { version = "0.1.39", default-features = false, optional = true } once_cell = "1.18.0" semver = "1.0.17" -strum = "0.25.0" -strum_macros = "0.25.0" +strum = "0.26.1" +strum_macros = "0.26.1" supports-color = "2.0.0" tempfile = "3.5.0" tokio = { version = "1.35.0", features = ["rt-multi-thread", "signal"], default-features = false } diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 39981dee..42aa5a14 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -23,7 +23,7 @@ leon-macros = { version = "1.0.0", path = "../leon-macros" } miette = "5.9.0" minisign-verify = "0.2.1" once_cell = "1.18.0" -strum = "0.25.0" +strum = "0.26.1" thiserror = "1.0.52" tokio = { version = "1.35.0", features = ["rt", "sync"], default-features = false } tracing = "0.1.39" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 6c1b168b..1de7953f 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -15,6 +15,6 @@ maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.18.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } -strum = "0.25.0" -strum_macros = "0.25.0" +strum = "0.26.1" +strum_macros = "0.26.1" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index b39784ed..3f15c22c 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -27,7 +27,7 @@ maybe-owned = "0.3.4" miette = "5.9.0" semver = { version = "1.0.17", features = ["serde"] } simple-git = { version = "0.2.2", path = "../simple-git", optional = true } -strum = "0.25.0" +strum = "0.26.1" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" thiserror = "1.0.52" diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 87062c4d..fa3d9c9e 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Jiahao XU "] license = "Apache-2.0 OR MIT" [dependencies] -cargo_toml = "0.18.0" +cargo_toml = "0.19.1" compact_str = { version = "0.7.0", features = ["serde"] } glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } From 23a7890db20feb5aaa45db6563ae50c7914f339a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 3 Feb 2024 03:52:00 +0000 Subject: [PATCH 1647/2020] release: binstalk-types v0.7.0 (#1598) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2a6fc6d5..9ccf2aae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -368,7 +368,7 @@ dependencies = [ [[package]] name = "binstalk-types" -version = "0.6.1" +version = "0.7.0" dependencies = [ "compact_str", "maybe-owned", diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 9ad272a6..55bf9079 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] atomic-file-install = { version = "1.0.1", path = "../atomic-file-install" } -binstalk-types = { version = "0.6.1", path = "../binstalk-types" } +binstalk-types = { version = "0.7.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } leon = { version = "2.0.1", path = "../leon" } miette = "5.9.0" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index e86bc561..97d8281f 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" async-trait = "0.1.68" async-compression = { version = "0.4.4", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } async_zip = { version = "0.0.16", features = ["deflate", "deflate64", "bzip2", "lzma", "zstd", "xz", "tokio"] } -binstalk-types = { version = "0.6.1", path = "../binstalk-types" } +binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" compact_str = "0.7.0" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 42aa5a14..bae62402 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" binstalk-downloader = { version = "0.9.6", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } -binstalk-types = { version = "0.6.1", path = "../binstalk-types" } +binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } either = "1.8.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 22248ca5..ad172b2f 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] beef = { version = "0.5.2", features = ["impl_serde"] } -binstalk-types = { version = "0.6.1", path = "../binstalk-types" } +binstalk-types = { version = "0.7.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } fs-lock = { version = "0.1.2", path = "../fs-lock" } home = "0.5.9" diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 0fe64545..c2a28b98 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -14,7 +14,7 @@ license = "Apache-2.0 OR MIT" async-trait = "0.1.68" base16 = "0.2.1" binstalk-downloader = { version = "0.9.6", path = "../binstalk-downloader", default-features = false, features = ["json"] } -binstalk-types = { version = "0.6.1", path = "../binstalk-types" } +binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "4.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } leon = { version = "2.0.1", path = "../leon" } diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 1de7953f..4d7ed95e 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-types" description = "The binstall toolkit that contains basic types for binstalk crates" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-types" -version = "0.6.1" +version = "0.7.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 3f15c22c..04c6d40f 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -14,7 +14,7 @@ binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.9.6", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.2.2", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.5.0", path = "../binstalk-registry" } -binstalk-types = { version = "0.6.1", path = "../binstalk-types" } +binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "4.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } From 42f2eb834e237e25feb9c1e8e26023ce02bb430e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 3 Feb 2024 07:25:52 +0000 Subject: [PATCH 1648/2020] release: cargo-toml-workspace v5.0.0 (#1599) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9ccf2aae..bd430565 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -547,7 +547,7 @@ dependencies = [ [[package]] name = "cargo-toml-workspace" -version = "4.0.0" +version = "5.0.0" dependencies = [ "cargo_toml", "compact_str", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index c2a28b98..2807d5cd 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -15,7 +15,7 @@ async-trait = "0.1.68" base16 = "0.2.1" binstalk-downloader = { version = "0.9.6", path = "../binstalk-downloader", default-features = false, features = ["json"] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } -cargo-toml-workspace = { version = "4.0.0", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "5.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } leon = { version = "2.0.1", path = "../leon" } miette = "5.9.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 04c6d40f..8e63c321 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -15,7 +15,7 @@ binstalk-downloader = { version = "0.9.6", path = "../binstalk-downloader", defa binstalk-fetchers = { version = "0.2.2", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.5.0", path = "../binstalk-registry" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } -cargo-toml-workspace = { version = "4.0.0", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "5.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.15", path = "../detect-targets", features = ["tracing"] } diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index fa3d9c9e..46569657 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-toml-workspace" -version = "4.0.0" +version = "5.0.0" edition = "2021" description = "Parse cargo workspace and load specific crate" repository = "https://github.com/cargo-bins/cargo-binstall" From 4ff5700c6453562e7561eeca8555b6eadcd57a2d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 3 Feb 2024 09:44:13 +0000 Subject: [PATCH 1649/2020] release: binstalk-downloader v0.10.0 (#1600) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bd430565..708800ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -260,7 +260,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.9.6" +version = "0.10.0" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 97d8281f..a4bae9d8 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.9.6" +version = "0.10.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index bae62402..4820d158 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.9.6", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } @@ -30,7 +30,7 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.9.6", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 2807d5cd..9acf3df8 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.9.6", path = "../binstalk-downloader", default-features = false, features = ["json"] } +binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader", default-features = false, features = ["json"] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "5.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } @@ -35,7 +35,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.21.0", features = ["serde"] } -binstalk-downloader = { version = "0.9.6", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } +binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } [features] git = ["simple-git"] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 8e63c321..c0c25f35 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.9.6", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.2.2", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.5.0", path = "../binstalk-registry" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } From 3e52d2d0f49a60ac0c014f5b93f64cb6e93eb329 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 3 Feb 2024 10:56:08 +0000 Subject: [PATCH 1650/2020] release: binstalk-fetchers v0.3.0 (#1601) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 708800ed..eccdddf0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -297,7 +297,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.2.2" +version = "0.3.0" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 4820d158..54017828 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.2.2" +version = "0.3.0" edition = "2021" description = "The binstall fetchers" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index c0c25f35..b5f31061 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } -binstalk-fetchers = { version = "0.2.2", path = "../binstalk-fetchers", features = ["quickinstall"] } +binstalk-fetchers = { version = "0.3.0", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.5.0", path = "../binstalk-registry" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "5.0.0", path = "../cargo-toml-workspace" } From 290ebbb7e93b8a87bee3f3aa2586c99e9243f131 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 3 Feb 2024 21:55:48 +1000 Subject: [PATCH 1651/2020] release: binstalk-bins v0.3.0 (#1603) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eccdddf0..608d2315 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -246,7 +246,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.2.0" +version = "0.3.0" dependencies = [ "atomic-file-install", "binstalk-types", diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 55bf9079..9ced68c6 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.2.0" +version = "0.3.0" edition = "2021" description = "The binstall binaries discovery and installation crate." diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index b5f31061..fffe30f6 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.2.0", path = "../binstalk-bins" } +binstalk-bins = { version = "0.3.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.3.0", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.5.0", path = "../binstalk-registry" } From 9e57c9cd711056ecb1f512d55e32dd64b6e0c78c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 3 Feb 2024 12:59:58 +0000 Subject: [PATCH 1652/2020] release: binstalk-manifests v0.12.0 (#1602) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 608d2315..f8976415 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -320,7 +320,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.11.0" +version = "0.12.0" dependencies = [ "beef", "binstalk-types", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 5b6cdbcc..3566a798 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.20.1", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.11.0" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.12.0" } clap = { version = "4.4.8", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index ad172b2f..fdcdbd01 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.11.0" +version = "0.12.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From f8bb0147054f0e6bf29f080158c527f873052b2a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 3 Feb 2024 14:03:24 +0000 Subject: [PATCH 1653/2020] release: binstalk-registry v0.6.0 (#1605) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f8976415..5c3d2a6e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -341,7 +341,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.5.0" +version = "0.6.0" dependencies = [ "async-trait", "base16", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 9acf3df8..5334c52e 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.5.0" +version = "0.6.0" edition = "2021" rust-version = "1.65.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index fffe30f6..ae519820 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" binstalk-bins = { version = "0.3.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.3.0", path = "../binstalk-fetchers", features = ["quickinstall"] } -binstalk-registry = { version = "0.5.0", path = "../binstalk-registry" } +binstalk-registry = { version = "0.6.0", path = "../binstalk-registry" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "5.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } From 1f49dcaa28c79f2552b17a6b0a343bafbe82cbb7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 3 Feb 2024 15:03:04 +0000 Subject: [PATCH 1654/2020] release: binstalk v0.21.0 (#1606) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5c3d2a6e..e4d3e370 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -216,7 +216,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.20.1" +version = "0.21.0" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 3566a798..bc4c08c8 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.20.1", default-features = false } +binstalk = { path = "../binstalk", version = "0.21.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.12.0" } clap = { version = "4.4.8", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index ae519820..2c67bda6 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.20.1" +version = "0.21.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From 76611ebef3331cb06b91e99543a1764b4b1b8249 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 3 Feb 2024 21:37:12 +0000 Subject: [PATCH 1655/2020] dep: Upgrade transitive dependencies (#1607) Co-authored-by: github-actions --- Cargo.lock | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e4d3e370..8a5f201e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1325,9 +1325,9 @@ dependencies = [ [[package]] name = "gix-command" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce1ffc7db3fb50b7dae6ecd937a3527cb725f444614df2ad8988d81806f13f09" +checksum = "c82b5e9494e61983e61049bbd15fe0fa6b70672dd236362bdb5b2b50fc428f10" dependencies = [ "bstr", "gix-path", @@ -2373,9 +2373,9 @@ dependencies = [ [[package]] name = "jobslot" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69d354a626ad589ae49ba37a6c8c782e615813516f86eba9da15a390b1363b01" +checksum = "1e21650a7eb4eb51339b77d6c015e8fcba5966ed2deea61df6cc653241be77fc" dependencies = [ "cfg-if", "getrandom", @@ -3751,9 +3751,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.32" +version = "0.3.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe80ced77cbfb4cb91a94bf72b378b4b6791a0d9b7f09d0be747d1bdff4e68bd" +checksum = "00b24b79b7a07f10209f19e683ca1e289d80b1e76ffa8c2b779718566a083679" dependencies = [ "deranged", "itoa", @@ -3799,9 +3799,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.35.1" +version = "1.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89b4efa943be685f629b149f53829423f8f5531ea21249408e8e2f8671ec104" +checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" dependencies = [ "backtrace", "bytes", @@ -4266,9 +4266,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.25.3" +version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1778a42e8b3b90bff8d0f5032bf22250792889a5cdc752aa0020c84abe3aaf10" +checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" [[package]] name = "widestring" @@ -4536,9 +4536,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.36" +version = "0.5.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "818ce546a11a9986bc24f93d0cdf38a8a1a400f1473ea8c82e59f6e0ffab9249" +checksum = "a7cad8365489051ae9f054164e459304af2e7e9bb407c958076c8bf4aef52da5" dependencies = [ "memchr", ] From 3f271cce2b581890bb211a740bfde8073f150150 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 4 Feb 2024 12:50:56 +1100 Subject: [PATCH 1656/2020] release: cargo-binstall v1.6.2 (#1608) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8a5f201e..878fb14d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -509,7 +509,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.6.1" +version = "1.6.2" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index bc4c08c8..9696e9f5 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.6.1" +version = "1.6.2" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index d8947640..a9450faf 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 8e29d416b4bb9699691a62720a19e95b5d3c850e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 9 Feb 2024 14:33:20 +1000 Subject: [PATCH 1657/2020] dep: Upgrade transitive dependencies (#1610) Co-authored-by: github-actions --- Cargo.lock | 122 +++++++++++++++++++++++++++++------------------------ 1 file changed, 67 insertions(+), 55 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 878fb14d..5f04de4e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -57,9 +57,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.5" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2faccea4cc4ab4a667ce676a30e8ec13922a692c99bb8f5b11f1502c72e04220" +checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" [[package]] name = "anstyle-parse" @@ -610,9 +610,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.4.18" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e578d6ec4194633722ccf9544794b71b1385c3c027efe0c55db226fc880865c" +checksum = "80c21025abd42669a92efc996ef13cfb2c5c627858421ea58d5c3b331a6c134f" dependencies = [ "clap_builder", "clap_derive", @@ -620,9 +620,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.4.18" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4df4df40ec50c46000231c914968278b1eb05098cf8f1b3a518a95030e71d1c7" +checksum = "458bf1f341769dfcf849846f65dffdf9146daa56bcd2a47cb4e1de9915567c99" dependencies = [ "anstream", "anstyle", @@ -632,9 +632,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.4.7" +version = "4.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" +checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" dependencies = [ "heck", "proc-macro2", @@ -644,9 +644,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" +checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "clru" @@ -1569,9 +1569,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "13.0.0" +version = "13.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "651e46174dc5e7d18b7b809d31937b6de3681b1debd78618c99162cc30fcf3e1" +checksum = "886490a07b1d6433aa91262a99d430a91cc8b9a1f758ac1282e132f1098a9342" dependencies = [ "gix-tempfile", "gix-utils", @@ -1855,9 +1855,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "13.0.0" +version = "13.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d337955b7af00fb87120d053d87cdfb422a80b9ff7a3aa4057a99c79422dc30" +checksum = "439f4da9657aec7434cde3c2510dcdb0a35f2031233ff67ae986269c788966d7" dependencies = [ "gix-fs", "libc", @@ -2088,9 +2088,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" +checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" [[package]] name = "hickory-proto" @@ -2332,20 +2332,20 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" [[package]] name = "is-terminal" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" +checksum = "fe8f25ce1159c7740ff0b9b2f5cdf4a8428742ba7c112b9f20f22cd5219c7dab" dependencies = [ "hermit-abi", - "rustix", + "libc", "windows-sys 0.52.0", ] [[package]] name = "is_ci" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "616cde7c720bb2bb5824a224687d8f77bfd38922027f01d825cd7453be5099fb" +checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] name = "itertools" @@ -2364,9 +2364,9 @@ checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "jobserver" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c37f63953c4c63420ed5fd3d6d398c719489b9f872b9fa683262f8edd363c7d" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" dependencies = [ "libc", ] @@ -2387,9 +2387,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" +checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" dependencies = [ "wasm-bindgen", ] @@ -2625,9 +2625,9 @@ checksum = "933dca44d65cdd53b355d0b73d380a2ff5da71f87f036053188bf1eab6a19881" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" dependencies = [ "adler", ] @@ -2742,9 +2742,9 @@ checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" dependencies = [ "autocfg", ] @@ -3579,9 +3579,9 @@ 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 = "strum" @@ -3687,13 +3687,12 @@ checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" [[package]] name = "tempfile" -version = "3.9.0" +version = "3.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" +checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" dependencies = [ "cfg-if", "fastrand 2.0.1", - "redox_syscall 0.4.1", "rustix", "windows-sys 0.52.0", ] @@ -3751,9 +3750,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.33" +version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b24b79b7a07f10209f19e683ca1e289d80b1e76ffa8c2b779718566a083679" +checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" dependencies = [ "deranged", "itoa", @@ -3889,14 +3888,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.9" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6a4b9e8023eb94392d3dca65d717c53abc5dad49c07cb65bb8fcd87115fa325" +checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.1", + "toml_edit 0.22.4", ] [[package]] @@ -3932,6 +3931,19 @@ dependencies = [ "winnow", ] +[[package]] +name = "toml_edit" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" +dependencies = [ + "indexmap", + "serde", + "serde_spanned", + "toml_datetime", + "winnow", +] + [[package]] name = "tower-service" version = "0.3.2" @@ -4177,9 +4189,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" +checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4187,9 +4199,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" +checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" dependencies = [ "bumpalo", "log", @@ -4202,9 +4214,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" dependencies = [ "cfg-if", "js-sys", @@ -4214,9 +4226,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" +checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4224,9 +4236,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" +checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", @@ -4237,9 +4249,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.90" +version = "0.2.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" +checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" [[package]] name = "wasm-streams" @@ -4256,9 +4268,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.67" +version = "0.3.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" dependencies = [ "js-sys", "wasm-bindgen", @@ -4536,9 +4548,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.37" +version = "0.5.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cad8365489051ae9f054164e459304af2e7e9bb407c958076c8bf4aef52da5" +checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" dependencies = [ "memchr", ] From c450f442cb9271c4ccdba48435674f47b01bfb2b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 9 Feb 2024 15:38:28 +1000 Subject: [PATCH 1658/2020] Refactor: Move simple-git into a new repo (#1611) Moved to https://github.com/cargo-bins/simple-git Signed-off-by: Jiahao XU --- .github/workflows/release-pr.yml | 1 - Cargo.toml | 1 - crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/simple-git/Cargo.toml | 38 ----- crates/simple-git/LICENSE-APACHE | 176 -------------------- crates/simple-git/LICENSE-MIT | 23 --- crates/simple-git/src/cancellation_token.rs | 44 ----- crates/simple-git/src/error.rs | 67 -------- crates/simple-git/src/lib.rs | 137 --------------- crates/simple-git/src/progress_tracing.rs | 156 ----------------- 11 files changed, 2 insertions(+), 645 deletions(-) delete mode 100644 crates/simple-git/Cargo.toml delete mode 100644 crates/simple-git/LICENSE-APACHE delete mode 100644 crates/simple-git/LICENSE-MIT delete mode 100644 crates/simple-git/src/cancellation_token.rs delete mode 100644 crates/simple-git/src/error.rs delete mode 100644 crates/simple-git/src/lib.rs delete mode 100644 crates/simple-git/src/progress_tracing.rs diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 9518882a..8bfefdfc 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -23,7 +23,6 @@ on: - normalize-path - leon - leon-macros - - simple-git version: description: Version to release required: true diff --git a/Cargo.toml b/Cargo.toml index 7ea291db..6df9c1c0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,6 @@ members = [ "crates/detect-wasi", "crates/fs-lock", "crates/normalize-path", - "crates/simple-git", "crates/detect-targets", "crates/leon", "crates/leon-macros", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 5334c52e..53b1bc1d 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -25,7 +25,7 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde_json = "1.0.107" sha2 = "0.10.7" -simple-git = { version = "0.2.2", path = "../simple-git", optional = true } +simple-git = { version = "0.2.2", optional = true } tempfile = "3.5.0" thiserror = "1.0.52" tokio = { version = "1.35.0", features = ["rt", "sync"], default-features = false } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 2c67bda6..423fd402 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ leon = { version = "2.0.1", path = "../leon" } maybe-owned = "0.3.4" miette = "5.9.0" semver = { version = "1.0.17", features = ["serde"] } -simple-git = { version = "0.2.2", path = "../simple-git", optional = true } +simple-git = { version = "0.2.2", optional = true } strum = "0.26.1" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" diff --git a/crates/simple-git/Cargo.toml b/crates/simple-git/Cargo.toml deleted file mode 100644 index 6bcf93a2..00000000 --- a/crates/simple-git/Cargo.toml +++ /dev/null @@ -1,38 +0,0 @@ -[package] -name = "simple-git" -version = "0.2.2" -edition = "2021" - -description = "The simple git interface for gix suitable for async context (with tokio)" -repository = "https://github.com/cargo-bins/cargo-binstall" -documentation = "https://docs.rs/simple-git" -rust-version = "1.65.0" -authors = ["Jiahao XU "] -license = "Apache-2.0 OR MIT" - -[dependencies] -compact_str = "0.7.0" -derive_destructure2 = "0.1" -thiserror = "1.0.52" -tokio = { version = "1.35.0", features = ["rt", "time"], default-features = false } -tracing = "0.1.39" - -[dependencies.gix] -version = "0.58.0" -default-features = false -features = [ - "comfort", - "blocking-http-transport-reqwest", - "max-performance-safe", - "worktree-mutation", -] - -[features] -rustls = [ - "gix/blocking-http-transport-reqwest-rust-tls", -] -native-tls = [ - "gix/blocking-http-transport-reqwest-native-tls", -] - -git-max-perf = ["gix/max-performance"] diff --git a/crates/simple-git/LICENSE-APACHE b/crates/simple-git/LICENSE-APACHE deleted file mode 100644 index 1b5ec8b7..00000000 --- a/crates/simple-git/LICENSE-APACHE +++ /dev/null @@ -1,176 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS diff --git a/crates/simple-git/LICENSE-MIT b/crates/simple-git/LICENSE-MIT deleted file mode 100644 index 31aa7938..00000000 --- a/crates/simple-git/LICENSE-MIT +++ /dev/null @@ -1,23 +0,0 @@ -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/crates/simple-git/src/cancellation_token.rs b/crates/simple-git/src/cancellation_token.rs deleted file mode 100644 index 97e65e52..00000000 --- a/crates/simple-git/src/cancellation_token.rs +++ /dev/null @@ -1,44 +0,0 @@ -use std::sync::{ - atomic::{AtomicBool, Ordering::Relaxed}, - Arc, -}; - -use derive_destructure2::destructure; - -/// Token that can be used to cancel git operation. -#[derive(Clone, Debug, Default)] -pub struct GitCancellationToken(Arc); - -impl GitCancellationToken { - /// Create a guard that cancel the git operation on drop. - #[must_use = "You must assign the guard to a variable, \ -otherwise it is equivalent to `GitCancellationToken::cancel()`"] - pub fn cancel_on_drop(self) -> GitCancelOnDrop { - GitCancelOnDrop(self) - } - - /// Cancel the git operation. - pub fn cancel(&self) { - self.0.store(true, Relaxed) - } - - pub(super) fn get_atomic(&self) -> &AtomicBool { - &self.0 - } -} - -/// Guard used to cancel git operation on drop -#[derive(Debug, destructure)] -pub struct GitCancelOnDrop(GitCancellationToken); - -impl Drop for GitCancelOnDrop { - fn drop(&mut self) { - self.0.cancel() - } -} -impl GitCancelOnDrop { - /// Disarm the guard, return the token. - pub fn disarm(self) -> GitCancellationToken { - self.destructure().0 - } -} diff --git a/crates/simple-git/src/error.rs b/crates/simple-git/src/error.rs deleted file mode 100644 index 1aa6f17f..00000000 --- a/crates/simple-git/src/error.rs +++ /dev/null @@ -1,67 +0,0 @@ -use gix::clone; -use thiserror::Error as ThisError; - -#[derive(Debug, ThisError)] -#[error(transparent)] -pub struct GitError(#[from] GitErrorInner); - -#[derive(Debug, ThisError)] -pub(super) enum GitErrorInner { - #[error("Failed to prepare for fetch: {0}")] - PrepareFetchError(#[source] Box), - - #[error("Failed to fetch: {0}")] - FetchError(#[source] Box), - - #[error("Failed to checkout: {0}")] - CheckOutError(#[source] Box), - - #[error("HEAD ref was corrupt in crates-io index repository clone")] - HeadCommit(#[source] Box), - - #[error("tree of head commit wasn't present in crates-io index repository clone")] - GetTreeOfCommit(#[source] Box), - - #[error("An object was missing in the crates-io index repository clone")] - ObjectLookup(#[source] Box), -} - -impl From for GitErrorInner { - fn from(e: clone::Error) -> Self { - Self::PrepareFetchError(Box::new(e)) - } -} - -impl From for GitErrorInner { - fn from(e: clone::fetch::Error) -> Self { - Self::FetchError(Box::new(e)) - } -} - -impl From for GitErrorInner { - fn from(e: clone::checkout::main_worktree::Error) -> Self { - Self::CheckOutError(Box::new(e)) - } -} - -impl From for GitErrorInner { - fn from(e: gix::reference::head_commit::Error) -> Self { - Self::HeadCommit(Box::new(e)) - } -} - -impl From for GitErrorInner { - fn from(e: gix::object::commit::Error) -> Self { - Self::GetTreeOfCommit(Box::new(e)) - } -} - -impl From for GitErrorInner { - fn from(e: gix::object::find::existing::Error) -> Self { - Self::ObjectLookup(Box::new(e)) - } -} - -#[derive(Debug, ThisError)] -#[error(transparent)] -pub struct GitUrlParseError(pub(super) gix::url::parse::Error); diff --git a/crates/simple-git/src/lib.rs b/crates/simple-git/src/lib.rs deleted file mode 100644 index 78a8c2bb..00000000 --- a/crates/simple-git/src/lib.rs +++ /dev/null @@ -1,137 +0,0 @@ -use std::{fmt, mem, num::NonZeroU32, path::Path, str::FromStr, sync::atomic::AtomicBool}; - -use gix::{clone, create, open, remote, Url}; -use tracing::debug; - -mod progress_tracing; -use progress_tracing::TracingProgress; - -mod cancellation_token; -pub use cancellation_token::{GitCancelOnDrop, GitCancellationToken}; - -mod error; -use error::GitErrorInner; -pub use error::{GitError, GitUrlParseError}; - -#[derive(Clone, Debug)] -pub struct GitUrl(Url); - -impl fmt::Display for GitUrl { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt::Display::fmt(&self.0, f) - } -} - -impl FromStr for GitUrl { - type Err = GitUrlParseError; - - fn from_str(s: &str) -> Result { - Url::try_from(s).map(Self).map_err(GitUrlParseError) - } -} - -#[derive(Debug)] -pub struct Repository(gix::ThreadSafeRepository); - -impl Repository { - fn prepare_fetch( - url: GitUrl, - path: &Path, - kind: create::Kind, - ) -> Result { - Ok(clone::PrepareFetch::new( - url.0, - path, - kind, - create::Options { - destination_must_be_empty: true, - ..Default::default() - }, - open::Options::isolated(), - )? - .with_shallow(remote::fetch::Shallow::DepthAtRemote( - NonZeroU32::new(1).unwrap(), - ))) - } - - /// WARNING: This is a blocking operation, if you want to use it in - /// async context then you must wrap the call in [`tokio::task::spawn_blocking`]. - /// - /// WARNING: This function must be called after tokio runtime is initialized. - pub fn shallow_clone_bare( - url: GitUrl, - path: &Path, - cancellation_token: Option, - ) -> Result { - debug!("Shallow cloning {url} to {}", path.display()); - - Ok(Self( - Self::prepare_fetch(url, path, create::Kind::Bare)? - .fetch_only( - &mut TracingProgress::new("Cloning bare"), - cancellation_token - .as_ref() - .map(GitCancellationToken::get_atomic) - .unwrap_or(&AtomicBool::new(false)), - ) - .map_err(GitErrorInner::from)? - .0 - .into(), - )) - } - - /// WARNING: This is a blocking operation, if you want to use it in - /// async context then you must wrap the call in [`tokio::task::spawn_blocking`]. - /// - /// WARNING: This function must be called after tokio runtime is initialized. - pub fn shallow_clone( - url: GitUrl, - path: &Path, - cancellation_token: Option, - ) -> Result { - debug!("Shallow cloning {url} to {} with worktree", path.display()); - - let mut progress = TracingProgress::new("Cloning with worktree"); - - Ok(Self( - Self::prepare_fetch(url, path, create::Kind::WithWorktree)? - .fetch_then_checkout(&mut progress, &AtomicBool::new(false)) - .map_err(GitErrorInner::from)? - .0 - .main_worktree( - &mut progress, - cancellation_token - .as_ref() - .map(GitCancellationToken::get_atomic) - .unwrap_or(&AtomicBool::new(false)), - ) - .map_err(GitErrorInner::from)? - .0 - .into(), - )) - } - - #[inline(always)] - pub fn get_head_commit_entry_data_by_path( - &self, - path: impl AsRef, - ) -> Result>, GitError> { - fn inner(this: &Repository, path: &Path) -> Result>, GitErrorInner> { - Ok( - if let Some(entry) = this - .0 - .to_thread_local() - .head_commit()? - .tree()? - .peel_to_entry_by_path(path)? - { - Some(mem::take(&mut entry.object()?.data)) - } else { - None - }, - ) - } - - Ok(inner(self, path.as_ref())?) - } -} diff --git a/crates/simple-git/src/progress_tracing.rs b/crates/simple-git/src/progress_tracing.rs deleted file mode 100644 index 5ffc9dfe..00000000 --- a/crates/simple-git/src/progress_tracing.rs +++ /dev/null @@ -1,156 +0,0 @@ -use std::{ - sync::{ - atomic::{AtomicBool, Ordering}, - Arc, - }, - time::Duration, -}; - -use compact_str::{format_compact, CompactString}; -use gix::progress::{ - prodash::messages::MessageLevel, Count, Id, NestedProgress, Progress, Step, StepShared, Unit, - UNKNOWN, -}; -use tokio::time; -use tracing::{error, info}; - -pub(super) struct TracingProgress { - name: CompactString, - id: Id, - max: Option, - unit: Option, - step: StepShared, - trigger: Arc, -} - -const EMIT_LOG_EVERY_S: f32 = 0.5; -const SEP: &str = "::"; - -impl TracingProgress { - /// Create a new instanCompactce from `name`. - pub fn new(name: &str) -> Self { - let trigger = Arc::new(AtomicBool::new(true)); - tokio::spawn({ - let mut interval = time::interval(Duration::from_secs_f32(EMIT_LOG_EVERY_S)); - interval.set_missed_tick_behavior(time::MissedTickBehavior::Skip); - - let trigger = Arc::clone(&trigger); - async move { - while Arc::strong_count(&trigger) > 1 { - trigger.store(true, Ordering::Relaxed); - - interval.tick().await; - } - } - }); - Self { - name: CompactString::new(name), - id: UNKNOWN, - max: None, - step: Default::default(), - unit: None, - trigger, - } - } - - fn log_progress(&self, step: Step) { - if self.trigger.swap(false, Ordering::Relaxed) { - match (self.max, &self.unit) { - (max, Some(unit)) => { - info!("{} → {}", self.name, unit.display(step, max, None)) - } - (Some(max), None) => info!("{} → {} / {}", self.name, step, max), - (None, None) => info!("{} → {}", self.name, step), - } - } - } -} - -impl Count for TracingProgress { - fn set(&self, step: Step) { - self.step.store(step, Ordering::Relaxed); - self.log_progress(step); - } - - fn step(&self) -> Step { - self.step.load(Ordering::Relaxed) - } - - fn inc_by(&self, step_to_inc: Step) { - self.log_progress( - self.step - .fetch_add(step_to_inc, Ordering::Relaxed) - .wrapping_add(step_to_inc), - ); - } - - fn counter(&self) -> StepShared { - Arc::clone(&self.step) - } -} - -impl Progress for TracingProgress { - fn init(&mut self, max: Option, unit: Option) { - self.max = max; - self.unit = unit; - } - - fn unit(&self) -> Option { - self.unit.clone() - } - - fn max(&self) -> Option { - self.max - } - - fn set_max(&mut self, max: Option) -> Option { - let prev = self.max; - self.max = max; - prev - } - - fn set_name(&mut self, name: String) { - self.name = self - .name - .split("::") - .next() - .map(|parent| format_compact!("{parent}{SEP}{name}")) - .unwrap_or_else(|| name.into()); - } - - fn name(&self) -> Option { - self.name.split(SEP).nth(1).map(ToOwned::to_owned) - } - - fn id(&self) -> Id { - self.id - } - - fn message(&self, level: MessageLevel, message: String) { - let name = &self.name; - match level { - MessageLevel::Info => info!("ℹ{name} → {message}"), - MessageLevel::Failure => error!("𐄂{name} → {message}"), - MessageLevel::Success => info!("✓{name} → {message}"), - } - } -} - -impl NestedProgress for TracingProgress { - type SubProgress = TracingProgress; - - fn add_child(&mut self, name: impl Into) -> Self::SubProgress { - self.add_child_with_id(name, UNKNOWN) - } - - fn add_child_with_id(&mut self, name: impl Into, id: Id) -> Self::SubProgress { - Self { - name: format_compact!("{}{}{}", self.name, SEP, Into::::into(name)), - id, - step: Arc::default(), - max: None, - unit: None, - trigger: Arc::clone(&self.trigger), - } - } -} From 42215f774a65409ba3d08212209dcd8c01f172ac Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sun, 11 Feb 2024 23:55:47 +1100 Subject: [PATCH 1659/2020] build(deps): bump the deps group with 5 updates (#1612) * build(deps): bump the deps group with 5 updates Bumps the deps group with 5 updates: | Package | From | To | | --- | --- | --- | | [file-format](https://github.com/mmalecot/file-format) | `0.23.0` | `0.24.0` | | [miette](https://github.com/zkat/miette) | `5.10.0` | `7.0.0` | | [supports-color](https://github.com/zkat/supports-color) | `2.1.0` | `3.0.0` | | [simple-git](https://github.com/cargo-bins/simple-git) | `0.2.2` | `0.2.3` | | [toml_edit](https://github.com/toml-rs/toml) | `0.21.1` | `0.22.4` | Updates `file-format` from 0.23.0 to 0.24.0 - [Release notes](https://github.com/mmalecot/file-format/releases) - [Changelog](https://github.com/mmalecot/file-format/blob/main/CHANGELOG.md) - [Commits](https://github.com/mmalecot/file-format/compare/v0.23.0...v0.24.0) Updates `miette` from 5.10.0 to 7.0.0 - [Release notes](https://github.com/zkat/miette/releases) - [Changelog](https://github.com/zkat/miette/blob/main/CHANGELOG.md) - [Commits](https://github.com/zkat/miette/compare/miette-derive-v5.10.0...miette-derive-v7.0.0) Updates `supports-color` from 2.1.0 to 3.0.0 - [Release notes](https://github.com/zkat/supports-color/releases) - [Changelog](https://github.com/zkat/supports-color/blob/main/CHANGELOG.md) - [Commits](https://github.com/zkat/supports-color/compare/v2.1.0...v3.0.0) Updates `simple-git` from 0.2.2 to 0.2.3 - [Commits](https://github.com/cargo-bins/simple-git/commits) Updates `toml_edit` from 0.21.1 to 0.22.4 - [Commits](https://github.com/toml-rs/toml/compare/v0.21.1...v0.22.4) --- updated-dependencies: - dependency-name: file-format dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: miette dependency-type: direct:production update-type: version-update:semver-major dependency-group: deps - dependency-name: supports-color dependency-type: direct:production update-type: version-update:semver-major dependency-group: deps - dependency-name: simple-git dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: toml_edit dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] * Fix compilation of `leon` when feature `cli` is enabled Signed-off-by: Jiahao XU --------- Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU --- Cargo.lock | 82 +++++++++------------------- crates/bin/Cargo.toml | 6 +- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 4 +- crates/binstalk-registry/Cargo.toml | 4 +- crates/binstalk/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 8 files changed, 36 insertions(+), 68 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5f04de4e..99014b18 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -335,7 +335,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror", - "toml_edit 0.21.1", + "toml_edit 0.22.4", "url", ] @@ -361,7 +361,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", - "toml_edit 0.21.1", + "toml_edit 0.22.4", "tracing", "url", ] @@ -1016,9 +1016,9 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "file-format" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "865ed54301d7e5136763302a3c9e595317e08a3119e19a078ab1ed269eb18edc" +checksum = "4ba1b81b3c213cf1c071f8bf3b83531f310df99642e58c48247272eef006cae5" [[package]] name = "filetime" @@ -1269,7 +1269,6 @@ dependencies = [ "gix-worktree-state", "once_cell", "parking_lot", - "reqwest", "smallvec", "thiserror", ] @@ -2330,17 +2329,6 @@ version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" -[[package]] -name = "is-terminal" -version = "0.4.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe8f25ce1159c7740ff0b9b2f5cdf4a8428742ba7c112b9f20f22cd5219c7dab" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "is_ci" version = "1.2.0" @@ -2572,15 +2560,13 @@ dependencies = [ [[package]] name = "miette" -version = "5.10.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59bb584eaeeab6bd0226ccf3509a69d7936d148cf3d036ad350abe35e8c6856e" +checksum = "98a72adfa0c7ae88ba0abcbd00047a476616c66b831d628b8ac7f1e9de0cfd67" dependencies = [ "backtrace", "backtrace-ext", - "is-terminal", "miette-derive", - "once_cell", "owo-colors", "supports-color", "supports-hyperlinks", @@ -2593,9 +2579,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "5.10.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" +checksum = "279def6bf114a34b3cf887489eb440d4dfcf709ab3ce9955e4a6f957ce5cce77" dependencies = [ "proc-macro2", "quote", @@ -2841,9 +2827,9 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owo-colors" -version = "3.5.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1b04fb49957986fdce4d6ee7a65027d55d4b6d2265e5848bbb507b58ccfdb6f" +checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" [[package]] name = "parking" @@ -3518,7 +3504,9 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.2" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7883672e04f8375bd069217fa00b6b6e08372e558cbcf82d0037ab5b9a5165" dependencies = [ "compact_str", "derive_destructure2", @@ -3604,31 +3592,24 @@ dependencies = [ [[package]] name = "supports-color" -version = "2.1.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6398cde53adc3c4557306a96ce67b302968513830a77a95b2b17305d9719a89" +checksum = "9829b314621dfc575df4e409e79f9d6a66a3bd707ab73f23cb4aa3a854ac854f" dependencies = [ - "is-terminal", "is_ci", ] [[package]] name = "supports-hyperlinks" -version = "2.1.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f84231692eb0d4d41e4cdd0cabfdd2e6cd9e255e65f80c9aa7c98dd502b4233d" -dependencies = [ - "is-terminal", -] +checksum = "2c0a1e5168041f5f3ff68ff7d95dcb9c8749df29f6e7e89ada40dd4c9de404ee" [[package]] name = "supports-unicode" -version = "2.1.0" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f850c19edd184a205e883199a261ed44471c81e39bd95b1357f5febbef00e77a" -dependencies = [ - "is-terminal", -] +checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" @@ -3699,19 +3680,19 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.1.17" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "633c1a546cee861a1a6d0dc69ebeca693bf4296661ba7852b9d21d159e0506df" +checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" dependencies = [ - "libc", - "winapi", + "rustix", + "windows-sys 0.48.0", ] [[package]] name = "textwrap" -version = "0.15.2" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7b3e525a49ec206798b40326a44121291b530c963cfb01018f63e135bac543d" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" dependencies = [ "smawk", "unicode-linebreak", @@ -3918,19 +3899,6 @@ dependencies = [ "winnow", ] -[[package]] -name = "toml_edit" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8534fd7f78b5405e860340ad6575217ce99f38d4d5c8f2442cb5ecb50090e1" -dependencies = [ - "indexmap", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - [[package]] name = "toml_edit" version = "0.22.4" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 9696e9f5..64e9e80e 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -27,16 +27,16 @@ binstalk-manifests = { path = "../binstalk-manifests", version = "0.12.0" } clap = { version = "4.4.8", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" -file-format = { version = "0.23.0", default-features = false } +file-format = { version = "0.24.0", default-features = false } home = "0.5.9" log = { version = "0.4.18", features = ["std"] } -miette = "5.9.0" +miette = "7.0.0" mimalloc = { version = "0.1.39", default-features = false, optional = true } once_cell = "1.18.0" semver = "1.0.17" strum = "0.26.1" strum_macros = "0.26.1" -supports-color = "2.0.0" +supports-color = "3.0.0" tempfile = "3.5.0" tokio = { version = "1.35.0", features = ["rt-multi-thread", "signal"], default-features = false } tracing-core = "0.1.32" diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 9ced68c6..0a31242e 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -15,7 +15,7 @@ atomic-file-install = { version = "1.0.1", path = "../atomic-file-install" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } leon = { version = "2.0.1", path = "../leon" } -miette = "5.9.0" +miette = "7.0.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } thiserror = "1.0.52" tracing = "0.1.39" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 54017828..02588421 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -20,7 +20,7 @@ either = "1.8.1" itertools = "0.12.0" leon = { version = "2.0.1", path = "../leon" } leon-macros = { version = "1.0.0", path = "../leon-macros" } -miette = "5.9.0" +miette = "7.0.0" minisign-verify = "0.2.1" once_cell = "1.18.0" strum = "0.26.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index fdcdbd01..f7f553d0 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -15,13 +15,13 @@ binstalk-types = { version = "0.7.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } fs-lock = { version = "0.1.2", path = "../fs-lock" } home = "0.5.9" -miette = "5.9.0" +miette = "7.0.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.107" thiserror = "1.0.52" -toml_edit = { version = "0.21.0", features = ["serde"] } +toml_edit = { version = "0.22.4", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 53b1bc1d..3ee43e3b 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -18,7 +18,7 @@ binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "5.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } leon = { version = "2.0.1", path = "../leon" } -miette = "5.9.0" +miette = "7.0.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } once_cell = "1.18.0" semver = { version = "1.0.17", features = ["serde"] } @@ -34,7 +34,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } -toml_edit = { version = "0.21.0", features = ["serde"] } +toml_edit = { version = "0.22.4", features = ["serde"] } binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } [features] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 423fd402..c898f64f 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -24,7 +24,7 @@ itertools = "0.12.0" jobslot = { version = "0.2.11", features = ["tokio"] } leon = { version = "2.0.1", path = "../leon" } maybe-owned = "0.3.4" -miette = "5.9.0" +miette = "7.0.0" semver = { version = "1.0.17", features = ["serde"] } simple-git = { version = "0.2.2", optional = true } strum = "0.26.1" diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 4058a0cb..5fd6209f 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -12,7 +12,7 @@ exclude = ["fuzz", "benches"] [dependencies] clap = { version = "4.4.8", features = ["derive"], optional = true } -miette = { version = "5.9.0", default-features = false, optional = true } +miette = { version = "7.0.0", default-features = false, features = ["derive"], optional = true } thiserror = "1.0.52" [features] From 5a8af0fb99244f138de2238f5c193a1af8303052 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 04:31:10 +0000 Subject: [PATCH 1660/2020] release: leon v3.0.0 (#1613) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/leon-macros/Cargo.toml | 2 +- crates/leon/Cargo.toml | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 99014b18..34022dfd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2409,7 +2409,7 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "leon" -version = "2.0.1" +version = "3.0.0" dependencies = [ "clap", "miette", diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 0a31242e..7b86cf49 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -14,7 +14,7 @@ license = "GPL-3.0-only" atomic-file-install = { version = "1.0.1", path = "../atomic-file-install" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } -leon = { version = "2.0.1", path = "../leon" } +leon = { version = "3.0.0", path = "../leon" } miette = "7.0.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } thiserror = "1.0.52" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 02588421..957d6c75 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -18,7 +18,7 @@ bytes = "1.4.0" compact_str = { version = "0.7.0" } either = "1.8.1" itertools = "0.12.0" -leon = { version = "2.0.1", path = "../leon" } +leon = { version = "3.0.0", path = "../leon" } leon-macros = { version = "1.0.0", path = "../leon-macros" } miette = "7.0.0" minisign-verify = "0.2.1" diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 3ee43e3b..a3e4116b 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -17,7 +17,7 @@ binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader", def binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "5.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } -leon = { version = "2.0.1", path = "../leon" } +leon = { version = "3.0.0", path = "../leon" } miette = "7.0.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } once_cell = "1.18.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index c898f64f..080e5d17 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -22,7 +22,7 @@ detect-targets = { version = "0.1.15", path = "../detect-targets", features = [" either = "1.8.1" itertools = "0.12.0" jobslot = { version = "0.2.11", features = ["tokio"] } -leon = { version = "2.0.1", path = "../leon" } +leon = { version = "3.0.0", path = "../leon" } maybe-owned = "0.3.4" miette = "7.0.0" semver = { version = "1.0.17", features = ["serde"] } diff --git a/crates/leon-macros/Cargo.toml b/crates/leon-macros/Cargo.toml index fa323e30..896bf2dd 100644 --- a/crates/leon-macros/Cargo.toml +++ b/crates/leon-macros/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" proc-macro = true [dependencies] -leon = { version = "2.0.1", path = "../leon", default-features = false } +leon = { version = "3.0.0", path = "../leon", default-features = false } proc-macro2 = "1.0.68" syn = { version = "2.0.43", default-features = false, features = ["proc-macro", "parsing"] } quote = "1.0.28" diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml index 5fd6209f..1a986b9b 100644 --- a/crates/leon/Cargo.toml +++ b/crates/leon/Cargo.toml @@ -3,7 +3,7 @@ name = "leon" description = "Dead-simple string templating" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/leon" -version = "2.0.1" +version = "3.0.0" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From add9310d5e5e365acd8fc9ebd4af794c5641059f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 12 Feb 2024 17:14:02 +1000 Subject: [PATCH 1661/2020] Fix release-pr.yml: Do not run semver-checks for leon-macros (#1614) leon-macros is a proc-macro crate and cargo-semver-checks cannot perform semver checks on proc-macro crates. --- .github/workflows/release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 8bfefdfc..0a858785 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -56,7 +56,7 @@ jobs: pr-label: release pr-release-notes: ${{ inputs.crate == 'bin' }} pr-template-file: .github/scripts/release-pr-template.ejs - check-semver: ${{ inputs.crate != 'bin' }} + check-semver: ${{ inputs.crate != 'bin' && inputs.crate != 'leon-macros' }} check-package: true env: RUSTFLAGS: --cfg reqwest_unstable From e8934cdc8aa8b5510b7a574f040c1e62ab4848f6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 20:50:11 +1100 Subject: [PATCH 1662/2020] release: leon-macros v1.0.1 (#1616) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/leon-macros/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 34022dfd..06bb4ab7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2418,7 +2418,7 @@ dependencies = [ [[package]] name = "leon-macros" -version = "1.0.0" +version = "1.0.1" dependencies = [ "leon", "proc-macro2", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 957d6c75..b926b887 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -19,7 +19,7 @@ compact_str = { version = "0.7.0" } either = "1.8.1" itertools = "0.12.0" leon = { version = "3.0.0", path = "../leon" } -leon-macros = { version = "1.0.0", path = "../leon-macros" } +leon-macros = { version = "1.0.1", path = "../leon-macros" } miette = "7.0.0" minisign-verify = "0.2.1" once_cell = "1.18.0" diff --git a/crates/leon-macros/Cargo.toml b/crates/leon-macros/Cargo.toml index 896bf2dd..ca4577be 100644 --- a/crates/leon-macros/Cargo.toml +++ b/crates/leon-macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "leon-macros" -version = "1.0.0" +version = "1.0.1" edition = "2021" description = "Proc macros for crate leon" repository = "https://github.com/cargo-bins/cargo-binstall" From 4cde7f075d0832d659d41581e8b892d51abd01c0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 10:27:28 +0000 Subject: [PATCH 1663/2020] release: binstalk-bins v0.4.0 (#1617) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 06bb4ab7..1ed6829d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -246,7 +246,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.3.0" +version = "0.4.0" dependencies = [ "atomic-file-install", "binstalk-types", diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 7b86cf49..021f081c 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.3.0" +version = "0.4.0" edition = "2021" description = "The binstall binaries discovery and installation crate." diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 080e5d17..ffcaf900 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.3.0", path = "../binstalk-bins" } +binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.3.0", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.6.0", path = "../binstalk-registry" } From 1d783172e3232d6a506d28061f06b83e50b1a7a2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 11:20:24 +0000 Subject: [PATCH 1664/2020] release: binstalk-fetchers v0.4.0 (#1618) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1ed6829d..7bd75ec1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -297,7 +297,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.3.0" +version = "0.4.0" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index b926b887..972f9d77 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.3.0" +version = "0.4.0" edition = "2021" description = "The binstall fetchers" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index ffcaf900..3e202c04 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } -binstalk-fetchers = { version = "0.3.0", path = "../binstalk-fetchers", features = ["quickinstall"] } +binstalk-fetchers = { version = "0.4.0", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.6.0", path = "../binstalk-registry" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "5.0.0", path = "../cargo-toml-workspace" } From 1c95c73a3863327d7540c2d184140c62ba9687db Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 12 Feb 2024 12:24:16 +0000 Subject: [PATCH 1665/2020] release: binstalk-manifests v0.13.0 (#1619) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7bd75ec1..d2519bca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -320,7 +320,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.12.0" +version = "0.13.0" dependencies = [ "beef", "binstalk-types", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 64e9e80e..671c8b1b 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.21.0", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.12.0" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.13.0" } clap = { version = "4.4.8", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index f7f553d0..3ce73f46 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.12.0" +version = "0.13.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From 22dabf1497638a018dc56e9f83f78d7553a219fa Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 00:17:36 +1100 Subject: [PATCH 1666/2020] release: binstalk-registry v0.7.0 (#1620) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d2519bca..03c16e46 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -341,7 +341,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.6.0" +version = "0.7.0" dependencies = [ "async-trait", "base16", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index a3e4116b..5317bec7 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.6.0" +version = "0.7.0" edition = "2021" rust-version = "1.65.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 3e202c04..97c17f37 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.4.0", path = "../binstalk-fetchers", features = ["quickinstall"] } -binstalk-registry = { version = "0.6.0", path = "../binstalk-registry" } +binstalk-registry = { version = "0.7.0", path = "../binstalk-registry" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "5.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } From 83442b013e3bfb00b465bca2a6689b9d6f26f81c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 07:14:29 +0000 Subject: [PATCH 1667/2020] release: binstalk v0.22.0 (#1622) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 03c16e46..66a05e06 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -216,7 +216,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.21.0" +version = "0.22.0" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 671c8b1b..72895787 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.21.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.22.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.13.0" } clap = { version = "4.4.8", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 97c17f37..477d42eb 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.21.0" +version = "0.22.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From 4c9cff3365b81c25e32325f12043f48254a4e31c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 07:59:52 +0000 Subject: [PATCH 1668/2020] dep: Upgrade transitive dependencies (#1623) Co-authored-by: github-actions --- Cargo.lock | 42 ++++++++++++++++-------------------------- 1 file changed, 16 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 66a05e06..d1ec58fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -538,9 +538,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceed8ef69d8518a5dda55c07425450b58a4e1946f4951eab6d7191ee86c2443d" +checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" dependencies = [ "serde", ] @@ -594,11 +594,10 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "9b918671670962b48bc23753aef0c51d072dca6f52f01f800854ada6ddb7f7d3" dependencies = [ - "jobserver", "libc", ] @@ -722,9 +721,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.3.2" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" dependencies = [ "cfg-if", ] @@ -914,9 +913,9 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "either" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" +checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "embed-resource" @@ -2284,9 +2283,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824b2ae422412366ba479e8111fd301f7b5faece8149317bb81925979a53f520" +checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" dependencies = [ "equivalent", "hashbrown", @@ -2350,15 +2349,6 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" -[[package]] -name = "jobserver" -version = "0.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" -dependencies = [ - "libc", -] - [[package]] name = "jobslot" version = "0.2.15" @@ -3701,18 +3691,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", @@ -4516,9 +4506,9 @@ checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" [[package]] name = "winnow" -version = "0.5.39" +version = "0.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5389a154b01683d28c77f8f68f49dea75f0a4da32557a58f68ee51ebba472d29" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" dependencies = [ "memchr", ] From 0c219ebf5182cacb987f8995ede233d64f8dee99 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 13 Feb 2024 09:05:03 +0000 Subject: [PATCH 1669/2020] release: cargo-binstall v1.6.3 (#1624) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d1ec58fd..1bc93800 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -509,7 +509,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.6.2" +version = "1.6.3" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 72895787..9ec564fb 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.6.2" +version = "1.6.3" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index a9450faf..8a0dd0ff 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 2d29534754fe2066793cc015ba895ec1d18c9325 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 16 Feb 2024 08:49:43 +0000 Subject: [PATCH 1670/2020] dep: Upgrade transitive dependencies (#1625) Co-authored-by: github-actions --- Cargo.lock | 111 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 65 insertions(+), 46 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1bc93800..30a5080b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -135,7 +135,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -335,7 +335,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror", - "toml_edit 0.22.4", + "toml_edit 0.22.6", "url", ] @@ -361,7 +361,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", - "toml_edit 0.22.4", + "toml_edit 0.22.6", "tracing", "url", ] @@ -455,9 +455,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "d32a994c2b3ca201d9b263612a374263f05e7adde37c4707f693dcd375076d1f" [[package]] name = "byteorder" @@ -594,10 +594,11 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.85" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b918671670962b48bc23753aef0c51d072dca6f52f01f800854ada6ddb7f7d3" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ + "jobserver", "libc", ] @@ -638,7 +639,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -840,7 +841,7 @@ checksum = "ac4b68190bad25c00b64ea19767b2321a037fc0e5bea7563d5d8e35e04b19c95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -949,7 +950,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -1158,7 +1159,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -1283,7 +1284,7 @@ dependencies = [ "gix-date", "itoa", "thiserror", - "winnow", + "winnow 0.5.40", ] [[package]] @@ -1365,7 +1366,7 @@ dependencies = [ "smallvec", "thiserror", "unicode-bom", - "winnow", + "winnow 0.5.40", ] [[package]] @@ -1584,7 +1585,7 @@ checksum = "d75e7ab728059f595f6ddc1ad8771b8d6a231971ae493d9d5948ecad366ee8bb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -1619,7 +1620,7 @@ dependencies = [ "itoa", "smallvec", "thiserror", - "winnow", + "winnow 0.5.40", ] [[package]] @@ -1743,7 +1744,7 @@ dependencies = [ "gix-transport", "maybe-async", "thiserror", - "winnow", + "winnow 0.5.40", ] [[package]] @@ -1776,7 +1777,7 @@ dependencies = [ "gix-validate", "memmap2", "thiserror", - "winnow", + "winnow 0.5.40", ] [[package]] @@ -2086,9 +2087,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c62115964e08cb8039170eb33c1d0e2388a256930279edca206fff675f82c3" +checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" [[package]] name = "hickory-proto" @@ -2349,6 +2350,15 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +[[package]] +name = "jobserver" +version = "0.1.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +dependencies = [ + "libc", +] + [[package]] name = "jobslot" version = "0.2.15" @@ -2413,7 +2423,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -2515,7 +2525,7 @@ checksum = "afc95a651c82daf7004c824405aa1019723644950d488571bd718e3ed84646ed" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -2550,9 +2560,9 @@ dependencies = [ [[package]] name = "miette" -version = "7.0.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98a72adfa0c7ae88ba0abcbd00047a476616c66b831d628b8ac7f1e9de0cfd67" +checksum = "baed61d13cc3723ee6dbed730a82bfacedc60a85d81da2d77e9c3e8ebc0b504a" dependencies = [ "backtrace", "backtrace-ext", @@ -2569,13 +2579,13 @@ dependencies = [ [[package]] name = "miette-derive" -version = "7.0.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "279def6bf114a34b3cf887489eb440d4dfcf709ab3ce9955e4a6f957ce5cce77" +checksum = "f301c3f54f98abc6c212ee722f5e5c62e472a334415840669e356f04850051ec" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -2737,9 +2747,9 @@ dependencies = [ [[package]] name = "num_threads" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +checksum = "5c7398b9c8b70908f6371f47ed36737907c87c52af34c268fed0bf0ceb92ead9" dependencies = [ "libc", ] @@ -2782,7 +2792,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -2879,7 +2889,7 @@ checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -2896,9 +2906,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" +checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "powerfmt" @@ -3395,7 +3405,7 @@ checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -3577,7 +3587,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -3614,9 +3624,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.48" +version = "2.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" +checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" dependencies = [ "proc-macro2", "quote", @@ -3706,7 +3716,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -3793,7 +3803,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -3866,7 +3876,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.4", + "toml_edit 0.22.6", ] [[package]] @@ -3886,20 +3896,20 @@ checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" dependencies = [ "indexmap", "toml_datetime", - "winnow", + "winnow 0.5.40", ] [[package]] name = "toml_edit" -version = "0.22.4" +version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c9ffdf896f8daaabf9b66ba8e77ea1ed5ed0f72821b398aba62352e95062951" +checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.1", ] [[package]] @@ -3928,7 +3938,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", ] [[package]] @@ -4166,7 +4176,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", "wasm-bindgen-shared", ] @@ -4200,7 +4210,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.48", + "syn 2.0.49", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4513,6 +4523,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "winnow" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d90f4e0f530c4c69f62b80d839e9ef3855edc9cba471a160c4d692deed62b401" +dependencies = [ + "memchr", +] + [[package]] name = "winreg" version = "0.50.0" From 1928e2ccb380b2b066ba583eacb381c36f3f52cc Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 20 Feb 2024 23:16:47 +1000 Subject: [PATCH 1671/2020] Refactor: Mv leon and leon-macros into another repo (#1628) * Refactor: Mv leon and leon-macros into another repo It's moved to https://github.com/cargo-bins/leon Signed-off-by: Jiahao XU * Fix CI: Rm `cargo-hack` check for `leon` Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .github/workflows/release-pr.yml | 2 - Cargo.lock | 9 +- Cargo.toml | 2 - crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/leon-macros/Cargo.toml | 19 -- crates/leon-macros/LICENSE-APACHE | 176 ---------- crates/leon-macros/LICENSE-MIT | 23 -- crates/leon-macros/src/lib.rs | 36 -- crates/leon-macros/tests/parsing.rs | 21 -- crates/leon/Cargo.toml | 21 -- crates/leon/LICENSE-APACHE | 176 ---------- crates/leon/LICENSE-MIT | 23 -- crates/leon/benches/.gitignore | 1 - crates/leon/benches/Cargo.lock | 431 ------------------------ crates/leon/benches/Cargo.toml | 30 -- crates/leon/benches/benches/others.rs | 89 ----- crates/leon/benches/benches/values.rs | 301 ----------------- crates/leon/benches/src/lib.rs | 0 crates/leon/fuzz/.gitignore | 4 - crates/leon/fuzz/Cargo.lock | 150 --------- crates/leon/fuzz/Cargo.toml | 27 -- crates/leon/fuzz/fuzz_targets/parser.rs | 9 - crates/leon/src/error.rs | 89 ----- crates/leon/src/lib.rs | 157 --------- crates/leon/src/macros.rs | 156 --------- crates/leon/src/main.rs | 61 ---- crates/leon/src/parser.rs | 334 ------------------ crates/leon/src/template.rs | 278 --------------- crates/leon/src/values.rs | 161 --------- justfile | 1 - 33 files changed, 11 insertions(+), 2786 deletions(-) delete mode 100644 crates/leon-macros/Cargo.toml delete mode 100644 crates/leon-macros/LICENSE-APACHE delete mode 100644 crates/leon-macros/LICENSE-MIT delete mode 100644 crates/leon-macros/src/lib.rs delete mode 100644 crates/leon-macros/tests/parsing.rs delete mode 100644 crates/leon/Cargo.toml delete mode 100644 crates/leon/LICENSE-APACHE delete mode 100644 crates/leon/LICENSE-MIT delete mode 100644 crates/leon/benches/.gitignore delete mode 100644 crates/leon/benches/Cargo.lock delete mode 100644 crates/leon/benches/Cargo.toml delete mode 100644 crates/leon/benches/benches/others.rs delete mode 100644 crates/leon/benches/benches/values.rs delete mode 100644 crates/leon/benches/src/lib.rs delete mode 100644 crates/leon/fuzz/.gitignore delete mode 100644 crates/leon/fuzz/Cargo.lock delete mode 100644 crates/leon/fuzz/Cargo.toml delete mode 100644 crates/leon/fuzz/fuzz_targets/parser.rs delete mode 100644 crates/leon/src/error.rs delete mode 100644 crates/leon/src/lib.rs delete mode 100644 crates/leon/src/macros.rs delete mode 100644 crates/leon/src/main.rs delete mode 100644 crates/leon/src/parser.rs delete mode 100644 crates/leon/src/template.rs delete mode 100644 crates/leon/src/values.rs diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 0a858785..7e2f6614 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -21,8 +21,6 @@ on: - detect-wasi - fs-lock - normalize-path - - leon - - leon-macros version: description: Version to release required: true diff --git a/Cargo.lock b/Cargo.lock index 30a5080b..389edcba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2409,16 +2409,19 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "leon" -version = "3.0.0" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d82a8693bd856b8b0596b6abed75d494ba6ca04b8e1b12be3a2ab947c305d8b1" dependencies = [ - "clap", "miette", "thiserror", ] [[package]] name = "leon-macros" -version = "1.0.1" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "acf3621546e1f1fedade073ad01f1c1bf561584a9b4c83c37728a28da69544aa" dependencies = [ "leon", "proc-macro2", diff --git a/Cargo.toml b/Cargo.toml index 6df9c1c0..8fda04af 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,8 +15,6 @@ members = [ "crates/fs-lock", "crates/normalize-path", "crates/detect-targets", - "crates/leon", - "crates/leon-macros", ] [profile.release] diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 021f081c..42ef86cd 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -14,7 +14,7 @@ license = "GPL-3.0-only" atomic-file-install = { version = "1.0.1", path = "../atomic-file-install" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } -leon = { version = "3.0.0", path = "../leon" } +leon = "3.0.0" miette = "7.0.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } thiserror = "1.0.52" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 972f9d77..55b58d19 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -18,8 +18,8 @@ bytes = "1.4.0" compact_str = { version = "0.7.0" } either = "1.8.1" itertools = "0.12.0" -leon = { version = "3.0.0", path = "../leon" } -leon-macros = { version = "1.0.1", path = "../leon-macros" } +leon = "3.0.0" +leon-macros = "1.0.1" miette = "7.0.0" minisign-verify = "0.2.1" once_cell = "1.18.0" diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 5317bec7..41f96d03 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -17,7 +17,7 @@ binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader", def binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "5.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } -leon = { version = "3.0.0", path = "../leon" } +leon = "3.0.0" miette = "7.0.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } once_cell = "1.18.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 477d42eb..5a7072e9 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -22,7 +22,7 @@ detect-targets = { version = "0.1.15", path = "../detect-targets", features = [" either = "1.8.1" itertools = "0.12.0" jobslot = { version = "0.2.11", features = ["tokio"] } -leon = { version = "3.0.0", path = "../leon" } +leon = "3.0.0" maybe-owned = "0.3.4" miette = "7.0.0" semver = { version = "1.0.17", features = ["serde"] } diff --git a/crates/leon-macros/Cargo.toml b/crates/leon-macros/Cargo.toml deleted file mode 100644 index ca4577be..00000000 --- a/crates/leon-macros/Cargo.toml +++ /dev/null @@ -1,19 +0,0 @@ -[package] -name = "leon-macros" -version = "1.0.1" -edition = "2021" -description = "Proc macros for crate leon" -repository = "https://github.com/cargo-bins/cargo-binstall" -documentation = "https://docs.rs/leon-macros" -rust-version = "1.61.0" -authors = ["Félix Saparelli ", "Jiahao XU Jiahao_XU@outlook"] -license = "Apache-2.0 OR MIT" - -[lib] -proc-macro = true - -[dependencies] -leon = { version = "3.0.0", path = "../leon", default-features = false } -proc-macro2 = "1.0.68" -syn = { version = "2.0.43", default-features = false, features = ["proc-macro", "parsing"] } -quote = "1.0.28" diff --git a/crates/leon-macros/LICENSE-APACHE b/crates/leon-macros/LICENSE-APACHE deleted file mode 100644 index 1b5ec8b7..00000000 --- a/crates/leon-macros/LICENSE-APACHE +++ /dev/null @@ -1,176 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS diff --git a/crates/leon-macros/LICENSE-MIT b/crates/leon-macros/LICENSE-MIT deleted file mode 100644 index 31aa7938..00000000 --- a/crates/leon-macros/LICENSE-MIT +++ /dev/null @@ -1,23 +0,0 @@ -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/crates/leon-macros/src/lib.rs b/crates/leon-macros/src/lib.rs deleted file mode 100644 index 2f6a3389..00000000 --- a/crates/leon-macros/src/lib.rs +++ /dev/null @@ -1,36 +0,0 @@ -use leon::{Item, Template}; -use quote::quote; -use syn::{parse_macro_input, LitStr}; - -#[proc_macro] -pub fn template(input: proc_macro::TokenStream) -> proc_macro::TokenStream { - let input = parse_macro_input!(input as LitStr).value(); - - #[allow(clippy::unnecessary_to_owned)] - let items = Template::parse(&input) - .unwrap() - .items - .into_owned() - .into_iter() - .map(|item| match item { - Item::Text(text) => quote! { - ::leon::Item::Text(#text) - }, - Item::Key(key) => quote! { - ::leon::Item::Key(#key) - }, - }); - - quote! { - ::leon::Template::new( - { - const ITEMS: &'static [::leon::Item<'static>] = &[ - #(#items),* - ]; - ITEMS - }, - ::core::option::Option::None, - ) - } - .into() -} diff --git a/crates/leon-macros/tests/parsing.rs b/crates/leon-macros/tests/parsing.rs deleted file mode 100644 index c8dbf8b0..00000000 --- a/crates/leon-macros/tests/parsing.rs +++ /dev/null @@ -1,21 +0,0 @@ -use leon::{Item, Template}; - -#[test] -fn test() { - assert_eq!(leon_macros::template!(""), Template::new(&[], None),); - - assert_eq!( - leon_macros::template!("a"), - Template::new(&[Item::Text("a")], None), - ); - - assert_eq!( - leon_macros::template!("{1}"), - Template::new(&[Item::Key("1")], None), - ); - - assert_eq!( - leon_macros::template!("a{ 1 } c"), - Template::new(&[Item::Text("a"), Item::Key("1"), Item::Text(" c")], None), - ); -} diff --git a/crates/leon/Cargo.toml b/crates/leon/Cargo.toml deleted file mode 100644 index 1a986b9b..00000000 --- a/crates/leon/Cargo.toml +++ /dev/null @@ -1,21 +0,0 @@ -[package] -name = "leon" -description = "Dead-simple string templating" -repository = "https://github.com/cargo-bins/cargo-binstall" -documentation = "https://docs.rs/leon" -version = "3.0.0" -rust-version = "1.61.0" -authors = ["Félix Saparelli "] -edition = "2021" -license = "Apache-2.0 OR MIT" -exclude = ["fuzz", "benches"] - -[dependencies] -clap = { version = "4.4.8", features = ["derive"], optional = true } -miette = { version = "7.0.0", default-features = false, features = ["derive"], optional = true } -thiserror = "1.0.52" - -[features] -default = ["miette"] -cli = ["dep:clap", "miette", "miette?/fancy-no-backtrace"] -miette = ["dep:miette"] diff --git a/crates/leon/LICENSE-APACHE b/crates/leon/LICENSE-APACHE deleted file mode 100644 index 1b5ec8b7..00000000 --- a/crates/leon/LICENSE-APACHE +++ /dev/null @@ -1,176 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS diff --git a/crates/leon/LICENSE-MIT b/crates/leon/LICENSE-MIT deleted file mode 100644 index 31aa7938..00000000 --- a/crates/leon/LICENSE-MIT +++ /dev/null @@ -1,23 +0,0 @@ -Permission is hereby granted, free of charge, to any -person obtaining a copy of this software and associated -documentation files (the "Software"), to deal in the -Software without restriction, including without -limitation the rights to use, copy, modify, merge, -publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software -is furnished to do so, subject to the following -conditions: - -The above copyright notice and this permission notice -shall be included in all copies or substantial portions -of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF -ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED -TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A -PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT -SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR -IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER -DEALINGS IN THE SOFTWARE. diff --git a/crates/leon/benches/.gitignore b/crates/leon/benches/.gitignore deleted file mode 100644 index eb5a316c..00000000 --- a/crates/leon/benches/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target diff --git a/crates/leon/benches/Cargo.lock b/crates/leon/benches/Cargo.lock deleted file mode 100644 index b2fe1571..00000000 --- a/crates/leon/benches/Cargo.lock +++ /dev/null @@ -1,431 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "anes" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "cast" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" - -[[package]] -name = "ciborium" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0c137568cc60b904a7724001b35ce2630fd00d5d84805fbb608ab89509d788f" -dependencies = [ - "ciborium-io", - "ciborium-ll", - "serde", -] - -[[package]] -name = "ciborium-io" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "346de753af073cc87b52b2083a506b38ac176a44cfb05497b622e27be899b369" - -[[package]] -name = "ciborium-ll" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213030a2b5a4e0c0892b6652260cf6ccac84827b83a85a534e178e3906c4cf1b" -dependencies = [ - "ciborium-io", - "half", -] - -[[package]] -name = "clap" -version = "3.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" -dependencies = [ - "bitflags", - "clap_lex", - "indexmap", - "textwrap", -] - -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] - -[[package]] -name = "criterion" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c76e09c1aae2bc52b3d2f29e13c6572553b30c4aa1b8a49fd70de6412654cb" -dependencies = [ - "anes", - "atty", - "cast", - "ciborium", - "clap", - "criterion-plot", - "itertools", - "lazy_static", - "num-traits", - "oorandom", - "regex", - "serde", - "serde_derive", - "serde_json", - "tinytemplate", - "walkdir", -] - -[[package]] -name = "criterion-plot" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" -dependencies = [ - "cast", - "itertools", -] - -[[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "half" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "leon" -version = "1.0.0" -dependencies = [ - "miette", - "thiserror", -] - -[[package]] -name = "leon-benches" -version = "0.0.0" -dependencies = [ - "criterion", - "leon", - "serde", - "tinytemplate", -] - -[[package]] -name = "libc" -version = "0.2.142" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a987beff54b60ffa6d51982e1aa1146bc42f19bd26be28b0586f252fccf5317" - -[[package]] -name = "miette" -version = "5.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92a992891d5579caa9efd8e601f82e30a1caa79a27a5db075dde30ecb9eab357" -dependencies = [ - "miette-derive", - "once_cell", - "thiserror", - "unicode-width", -] - -[[package]] -name = "miette-derive" -version = "5.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c65c625186a9bcce6699394bee511e1b1aec689aa7e3be1bf4e996e75834153" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "num-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "once_cell" -version = "1.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" - -[[package]] -name = "oorandom" -version = "11.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ab1bc2a289d34bd04a330323ac98a1b4bc82c9d9fcb1e66b63caa84da26b575" - -[[package]] -name = "os_str_bytes" -version = "6.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" - -[[package]] -name = "proc-macro2" -version = "1.0.56" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "regex" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" -dependencies = [ - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" - -[[package]] -name = "ryu" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "serde" -version = "1.0.160" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2f3770c8bce3bcda7e149193a069a0f4365bda1fa5cd88e03bca26afc1216c" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.160" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291a097c63d8497e00160b166a967a4a79c64f3facdd01cbd7502231688d77df" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "serde_json" -version = "1.0.96" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "syn" -version = "2.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - -[[package]] -name = "thiserror" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" -dependencies = [ - "serde", - "serde_json", -] - -[[package]] -name = "unicode-ident" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" - -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - -[[package]] -name = "walkdir" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" -dependencies = [ - "same-file", - "winapi-util", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" diff --git a/crates/leon/benches/Cargo.toml b/crates/leon/benches/Cargo.toml deleted file mode 100644 index acd07206..00000000 --- a/crates/leon/benches/Cargo.toml +++ /dev/null @@ -1,30 +0,0 @@ -[package] -name = "leon-benches" -version = "0.0.0" -publish = false -edition = "2021" - -[dependencies] -leon = { path = ".." } -criterion = { version = "0.4.0", default-features = false, features = ["cargo_bench_support"] } -serde = { version = "1.0.160", features = ["derive"] } -tinytemplate = "1.2.1" - -# Prevent this from interfering with workspaces -[workspace] -members = ["."] - -[[bench]] -name = "values" -harness = false - -[[bench]] -name = "others" -harness = false - -[profile.release] -opt-level = 3 -lto = true -codegen-units = 1 -panic = "abort" -strip = "symbols" diff --git a/crates/leon/benches/benches/others.rs b/crates/leon/benches/benches/others.rs deleted file mode 100644 index 92267a9e..00000000 --- a/crates/leon/benches/benches/others.rs +++ /dev/null @@ -1,89 +0,0 @@ -use std::borrow::Cow; - -use criterion::{black_box, criterion_group, criterion_main, Criterion}; -use leon::{vals, Template}; -use serde::Serialize; -use tinytemplate::TinyTemplate; - -fn compare_impls(c: &mut Criterion) { - const TEMPLATE: &str = "hello {name}! i am {age} years old. my goal is to {goal}. i like: {flower}, {music}, {animal}, {color}, {food}. i'm drinking {drink}"; - fn replace_fn(key: &str) -> Option> { - Some(Cow::Borrowed(match key { - "name" => "marcus", - "age" => "42", - "goal" => "primary", - "flower" => "lotus", - "music" => "jazz", - "animal" => "cat", - "color" => "blue", - "food" => "pizza", - "drink" => "coffee", - _ => return None, - })) - } - - #[derive(Copy, Clone, Serialize)] - struct Context<'c> { - name: &'c str, - age: u8, - goal: &'c str, - flower: &'c str, - music: &'c str, - animal: &'c str, - color: &'c str, - food: &'c str, - drink: &'c str, - } - - let tt_context = Context { - name: "marcus", - age: 42, - goal: "primary", - flower: "lotus", - music: "jazz", - animal: "cat", - color: "blue", - food: "pizza", - drink: "coffee", - }; - - c.bench_function("leon", move |b| { - b.iter(move || { - let template = Template::parse(black_box(TEMPLATE)).unwrap(); - let output = template.render(&vals(replace_fn)).unwrap(); - black_box(output); - }) - }); - - c.bench_function("std, string replaces", move |b| { - b.iter(move || { - let mut output = black_box(TEMPLATE).to_string(); - for (key, value) in [ - ("name", "marcus"), - ("age", "42"), - ("goal", "primary"), - ("flower", "lotus"), - ("music", "jazz"), - ("animal", "cat"), - ("color", "blue"), - ("food", "pizza"), - ("drink", "coffee"), - ] { - output = output.replace(&format!("{{{}}}", key), value); - } - black_box(output); - }) - }); - - c.bench_function("tiny template", move |b| { - b.iter(move || { - let mut tt = TinyTemplate::new(); - tt.add_template("tmp", black_box(TEMPLATE)).unwrap(); - let output = tt.render("tmp", &tt_context).unwrap(); - black_box(output); - }) - }); -} - -criterion_group!(compare, compare_impls); -criterion_main!(compare); diff --git a/crates/leon/benches/benches/values.rs b/crates/leon/benches/benches/values.rs deleted file mode 100644 index e2e645bd..00000000 --- a/crates/leon/benches/benches/values.rs +++ /dev/null @@ -1,301 +0,0 @@ -use std::{borrow::Cow, collections::HashMap, sync::Arc}; - -use criterion::{black_box, criterion_group, criterion_main, Criterion}; -use leon::{vals, Template, Values, ValuesFn}; - -macro_rules! make_values { - ($($name:expr => $value:expr),*) => { - ( - &[$(($name, $value)),*], - { - let mut map = HashMap::new(); - $( - map.insert($name, $value); - )* - map - }, - vals(|key| match key { - $( - $name => Some(Cow::Borrowed($value)), - )* - _ => None, - }) - ) - }; -} - -fn one_replace(c: &mut Criterion) { - const TEMPLATE: &str = "Hello, {name}!"; - - let (slice, hashmap, vals) = make_values!( - "name" => "marcus" - ); - - inner_bench("one replace", c, TEMPLATE, vals, hashmap, slice); -} - -fn some_replaces(c: &mut Criterion) { - const TEMPLATE: &str = "hello {name}! i am {age} years old. my goal is to {goal}. i like: {flower}, {music}, {animal}, {color}, {food}. i'm drinking {drink}"; - - let (slice, hashmap, vals) = make_values!( - "name" => "marcus", - "age" => "42", - "goal" => "primary", - "flower" => "lotus", - "music" => "jazz", - "animal" => "cat", - "color" => "blue", - "food" => "pizza", - "drink" => "coffee" - ); - - inner_bench("some replaces", c, TEMPLATE, vals, hashmap, slice); -} - -fn many_replaces(c: &mut Criterion) { - const TEMPLATE: &str = " - {artichoke} - {aubergine} - {asparagus} - {broccoflower} - {broccoli} - {brussels sprouts} - {cabbage} - {kohlrabi} - {Savoy cabbage} - {red cabbage} - {cauliflower} - {celery} - {endive} - {fiddleheads} - {frisee} - {fennel} - {greens} - {arugula} - {bok choy} - {chard} - {collard greens} - {kale} - {lettuce} - {mustard greens} - {spinach} - {herbs} - {anise} - {basil} - {caraway} - {coriander} - {chamomile} - {daikon} - {dill} - {squash} - {lavender} - {cymbopogon} - {marjoram} - {oregano} - {parsley} - {rosemary} - {thyme} - {legumes} - {alfalfa sprouts} - {azuki beans} - {bean sprouts} - {black beans} - {black-eyed peas} - {borlotti bean} - {broad beans} - {chickpeas, garbanzos, or ceci beans} - {green beans} - {kidney beans} - {lentils} - {lima beans or butter bean} - {mung beans} - {navy beans} - {peanuts} - {pinto beans} - {runner beans} - {split peas} - {soy beans} - {peas} - {mange tout or snap peas} - {mushrooms} - {nettles} - {New Zealand spinach} - {okra} - {onions} - {chives} - {garlic} - {leek} - {onion} - {shallot} - {scallion} - {peppers} - {bell pepper} - {chili pepper} - {jalapeño} - {habanero} - {paprika} - {tabasco pepper} - {cayenne pepper} - {radicchio} - {rhubarb} - {root vegetables} - {beetroot} - {beet} - {mangelwurzel} - {carrot} - {celeriac} - {corms} - {eddoe} - {konjac} - {taro} - {water chestnut} - {ginger} - {parsnip} - {rutabaga} - {radish} - {wasabi} - "; - - let (slice, hashmap, vals) = make_values!( - "artichoke" => "Abiu", - "aubergine" => "Açaí", - "asparagus" => "Acerola", - "broccoflower" => "Akebi", - "broccoli" => "Ackee", - "brussels sprouts" => "African Cherry Orange", - "cabbage" => "American Mayapple", - "kohlrabi" => "Apple", - "Savoy cabbage" => "Apricot", - "red cabbage" => "Araza", - "cauliflower" => "Avocado", - "celery" => "Banana", - "endive" => "Bilberry", - "fiddleheads" => "Blackberry", - "frisee" => "Blackcurrant", - "fennel" => "Black sapote", - "greens" => "Blueberry", - "arugula" => "Boysenberry", - "bok choy" => "Breadfruit", - "chard" => "Buddha's hand", - "collard greens" => "Cactus pear", - "kale" => "Canistel", - "lettuce" => "Cashew", - "mustard greens" => "Cempedak", - "spinach" => "Cherimoya", - "herbs" => "Cherry", - "anise" => "Chico fruit", - "basil" => "Cloudberry", - "caraway" => "Coco de mer", - "coriander" => "Coconut", - "chamomile" => "Crab apple", - "daikon" => "Cranberry", - "dill" => "Currant", - "squash" => "Damson", - "lavender" => "Date", - "cymbopogon" => "Dragonfruit", - "marjoram" => "Pitaya", - "oregano" => "Durian", - "parsley" => "Elderberry", - "rosemary" => "Feijoa", - "thyme" => "Fig", - "legumes" => "Finger Lime", - "alfalfa sprouts" => "Caviar Lime", - "azuki beans" => "Goji berry", - "bean sprouts" => "Gooseberry", - "black beans" => "Grape", - "black-eyed peas" => "Raisin", - "borlotti bean" => "Grapefruit", - "broad beans" => "Grewia asiatica", - "chickpeas, garbanzos, or ceci beans" => "Guava", - "green beans" => "Hala Fruit", - "kidney beans" => "Honeyberry", - "lentils" => "Huckleberry", - "lima beans or butter bean" => "Jabuticaba", - "mung beans" => "Jackfruit", - "navy beans" => "Jambul", - "peanuts" => "Japanese plum", - "pinto beans" => "Jostaberry", - "runner beans" => "Jujube", - "split peas" => "Juniper berry", - "soy beans" => "Kaffir Lime", - "peas" => "Kiwano", - "mange tout or snap peas" => "Kiwifruit", - "mushrooms" => "Kumquat", - "nettles" => "Lemon", - "New Zealand spinach" => "Lime", - "okra" => "Loganberry", - "onions" => "Longan", - "chives" => "Loquat", - "garlic" => "Lulo", - "leek" => "Lychee", - "onion" => "Magellan Barberry", - "shallot" => "Mamey Apple", - "scallion" => "Mamey Sapote", - "peppers" => "Mango", - "bell pepper" => "Mangosteen", - "chili pepper" => "Marionberry", - "jalapeño" => "Melon", - "habanero" => "Cantaloupe", - "paprika" => "Galia melon", - "tabasco pepper" => "Honeydew", - "cayenne pepper" => "Mouse melon", - "radicchio" => "Musk melon", - "rhubarb" => "Watermelon", - "root vegetables" => "Miracle fruit", - "beetroot" => "Momordica fruit", - "beet" => "Monstera deliciosa", - "mangelwurzel" => "Mulberry", - "carrot" => "Nance", - "celeriac" => "Nectarine", - "corms" => "Orange", - "eddoe" => "Blood orange", - "konjac" => "Clementine", - "taro" => "Mandarine", - "water chestnut" => "Tangerine", - "ginger" => "Papaya", - "parsnip" => "Passionfruit", - "rutabaga" => "Pawpaw", - "radish" => "Peach", - "wasabi" => "Pear" - ); - - inner_bench("many replaces", c, TEMPLATE, vals, hashmap, slice); -} - -fn inner_bench( - name: &str, - c: &mut Criterion, - template_str: &str, - vals: ValuesFn, - hashmap: HashMap<&str, &str>, - slice: &[(&str, &str)], -) where - F: Fn(&str) -> Option> + Send + Clone + 'static, -{ - c.bench_function(&format!("{name}, fn"), move |b| { - let vals = vals.clone(); - b.iter(move || { - let template = Template::parse(black_box(template_str)).unwrap(); - black_box(template.render(&vals).unwrap()); - }) - }); - let hashmap = Arc::new(hashmap); - c.bench_function(&format!("{name}, hashmap"), move |b| { - let hashmap = Arc::clone(&hashmap); - b.iter(move || { - let template = Template::parse(black_box(template_str)).unwrap(); - black_box(template.render(&hashmap).unwrap()); - }) - }); - c.bench_function(&format!("{name}, slice"), move |b| { - b.iter(move || { - let template = Template::parse(black_box(template_str)).unwrap(); - black_box(template.render(&slice as &dyn Values).unwrap()); - }) - }); -} - -criterion_group!(one, one_replace); -criterion_group!(some, some_replaces); -criterion_group!(many, many_replaces); -criterion_main!(one, some, many); diff --git a/crates/leon/benches/src/lib.rs b/crates/leon/benches/src/lib.rs deleted file mode 100644 index e69de29b..00000000 diff --git a/crates/leon/fuzz/.gitignore b/crates/leon/fuzz/.gitignore deleted file mode 100644 index 1a45eee7..00000000 --- a/crates/leon/fuzz/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -target -corpus -artifacts -coverage diff --git a/crates/leon/fuzz/Cargo.lock b/crates/leon/fuzz/Cargo.lock deleted file mode 100644 index 9409a0dd..00000000 --- a/crates/leon/fuzz/Cargo.lock +++ /dev/null @@ -1,150 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "arbitrary" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e90af4de65aa7b293ef2d09daff88501eb254f58edde2e1ac02c82d873eadad" - -[[package]] -name = "cc" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" -dependencies = [ - "jobserver", -] - -[[package]] -name = "jobserver" -version = "0.1.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "068b1ee6743e4d11fb9c6a1e6064b3693a1b600e7f5f5988047d98b3dc9fb90b" -dependencies = [ - "libc", -] - -[[package]] -name = "leon" -version = "0.0.0" -dependencies = [ - "miette", - "thiserror", -] - -[[package]] -name = "leon-fuzz" -version = "0.0.0" -dependencies = [ - "leon", - "libfuzzer-sys", -] - -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - -[[package]] -name = "libfuzzer-sys" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beb09950ae85a0a94b27676cccf37da5ff13f27076aa1adbc6545dd0d0e1bd4e" -dependencies = [ - "arbitrary", - "cc", - "once_cell", -] - -[[package]] -name = "miette" -version = "5.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd9b301defa984bbdbe112b4763e093ed191750a0d914a78c1106b2d0fe703" -dependencies = [ - "miette-derive", - "once_cell", - "thiserror", - "unicode-width", -] - -[[package]] -name = "miette-derive" -version = "5.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97c2401ab7ac5282ca5c8b518a87635b1a93762b0b90b9990c509888eeccba29" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "proc-macro2" -version = "1.0.51" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "thiserror" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" diff --git a/crates/leon/fuzz/Cargo.toml b/crates/leon/fuzz/Cargo.toml deleted file mode 100644 index 1801da08..00000000 --- a/crates/leon/fuzz/Cargo.toml +++ /dev/null @@ -1,27 +0,0 @@ -[package] -name = "leon-fuzz" -version = "0.0.0" -publish = false -edition = "2021" - -[package.metadata] -cargo-fuzz = true - -[dependencies] -libfuzzer-sys = "0.4" - -[dependencies.leon] -path = ".." - -# Prevent this from interfering with workspaces -[workspace] -members = ["."] - -[profile.release] -debug = 1 - -[[bin]] -name = "parser" -path = "fuzz_targets/parser.rs" -test = false -doc = false diff --git a/crates/leon/fuzz/fuzz_targets/parser.rs b/crates/leon/fuzz/fuzz_targets/parser.rs deleted file mode 100644 index 9cd51fe5..00000000 --- a/crates/leon/fuzz/fuzz_targets/parser.rs +++ /dev/null @@ -1,9 +0,0 @@ -#![no_main] - -use libfuzzer_sys::fuzz_target; - -fuzz_target!(|data: &[u8]| { - if let Ok(s) = std::str::from_utf8(data) { - let _ = leon::Template::parse(s); - } -}); diff --git a/crates/leon/src/error.rs b/crates/leon/src/error.rs deleted file mode 100644 index 93923cf2..00000000 --- a/crates/leon/src/error.rs +++ /dev/null @@ -1,89 +0,0 @@ -use thiserror::Error as ThisError; - -#[derive(Debug, ThisError)] -#[cfg_attr(feature = "miette", derive(miette::Diagnostic))] -pub enum RenderError { - /// A key was missing from the provided values. - #[error("missing key `{0}`")] - MissingKey(String), - - /// An I/O error passed through from [`Template::render_into`](crate::Template::render_into). - #[error("write failed: {0}")] - Io(#[from] std::io::Error), -} - -/// An error that can occur when parsing a template. -/// -/// When the `miette` feature is enabled, this is a rich miette-powered error -/// which will highlight the source of the error in the template when output -/// (with miette's `fancy` feature). With `miette` disabled, this is opaque. -#[derive(Clone, Debug, ThisError, PartialEq, Eq)] -#[cfg_attr(feature = "miette", derive(miette::Diagnostic))] -#[cfg_attr(feature = "miette", diagnostic(transparent))] -#[error(transparent)] -pub struct ParseError(Box); - -/// The inner (unboxed) type of [`ParseError`]. -#[derive(Clone, Debug, ThisError, PartialEq, Eq)] -#[error("{kind} at span start = {offset}, len = {len}: {src}")] -struct InnerParseError { - src: String, - offset: usize, - len: usize, - kind: ErrorKind, -} - -#[cfg(feature = "miette")] -impl miette::Diagnostic for InnerParseError { - fn source_code(&self) -> Option<&dyn miette::SourceCode> { - Some(&self.src) - } - - fn labels(&self) -> Option + '_>> { - Some(Box::new(std::iter::once_with(|| { - miette::LabeledSpan::new(Some(self.kind.to_string()), self.offset, self.len) - }))) - } -} - -#[derive(Clone, Debug, ThisError, PartialEq, Eq)] -enum ErrorKind { - #[error("This bracket is not opening or closing anything. Try removing it, or escaping it with a backslash.")] - Unbalanced, - - #[error("This escape is malformed.")] - Escape, - - #[error("A key cannot be empty.")] - KeyEmpty, - - #[error("Escapes are not allowed in keys.")] - KeyEscape, -} - -impl ParseError { - fn new(src: &str, start: usize, end: usize, kind: ErrorKind) -> Self { - Self(Box::new(InnerParseError { - src: String::from(src), - offset: start, - len: end.saturating_sub(start) + 1, - kind, - })) - } - - pub(crate) fn unbalanced(src: &str, start: usize, end: usize) -> Self { - Self::new(src, start, end, ErrorKind::Unbalanced) - } - - pub(crate) fn escape(src: &str, start: usize, end: usize) -> Self { - Self::new(src, start, end, ErrorKind::Escape) - } - - pub(crate) fn key_empty(src: &str, start: usize, end: usize) -> Self { - Self::new(src, start, end, ErrorKind::KeyEmpty) - } - - pub(crate) fn key_escape(src: &str, start: usize, end: usize) -> Self { - Self::new(src, start, end, ErrorKind::KeyEscape) - } -} diff --git a/crates/leon/src/lib.rs b/crates/leon/src/lib.rs deleted file mode 100644 index a6ef467e..00000000 --- a/crates/leon/src/lib.rs +++ /dev/null @@ -1,157 +0,0 @@ -//! Dead-simple string templating. -//! -//! Leon parses a template string into a list of tokens, and then substitutes -//! provided values in. Unlike other templating engines, it is extremely simple: -//! it supports no logic, only replaces. It is even simpler than `format!()`, -//! albeit with a similar syntax. -//! -//! # Syntax -//! -//! ```plain -//! it is better to rule { group } -//! one can live {adverb} without power -//! ``` -//! -//! A replacement is denoted by `{` and `}`. The contents of the braces, trimmed -//! of any whitespace, are the key. Any text outside of braces is left as-is. -//! -//! To escape a brace, use `\{` or `\}`. To escape a backslash, use `\\`. Keys -//! cannot contain escapes. -//! -//! ```plain -//! \{ leon \} -//! ``` -//! -//! The above examples, given the values `group = "no one"` and -//! `adverb = "honourably"`, would render to: -//! -//! ```plain -//! it is better to rule no one -//! one can live honourably without power -//! { leon } -//! ``` -//! -//! # Usage -//! -//! A template is first parsed to a token list: -//! -//! ``` -//! use leon::Template; -//! -//! let template = Template::parse("hello {name}").unwrap(); -//! ``` -//! -//! The template can be inspected, for example to check if a key is present: -//! -//! ``` -//! # use leon::Template; -//! # -//! # let template = Template::parse("hello {name}").unwrap(); -//! assert!(template.has_key("name")); -//! ``` -//! -//! The template can be rendered to a string: -//! -//! ``` -//! # use leon::Template; -//! use leon::vals; -//! # -//! # let template = Template::parse("hello {name}").unwrap(); -//! assert_eq!( -//! template.render( -//! &&vals(|_key| Some("marcus".into())) -//! ).unwrap().as_str(), -//! "hello marcus", -//! ); -//! ``` -//! -//! …or to a writer: -//! -//! ``` -//! use std::io::Write; -//! # use leon::Template; -//! use leon::vals; -//! # -//! # let template = Template::parse("hello {name}").unwrap(); -//! let mut buf: Vec = Vec::new(); -//! template.render_into( -//! &mut buf, -//! &&vals(|key| if key == "name" { -//! Some("julius".into()) -//! } else { -//! None -//! }) -//! ).unwrap(); -//! assert_eq!(buf.as_slice(), b"hello julius"); -//! ``` -//! -//! …with a map: -//! -//! ``` -//! use std::collections::HashMap; -//! # use leon::Template; -//! # let template = Template::parse("hello {name}").unwrap(); -//! let mut values = HashMap::new(); -//! values.insert("name", "brutus"); -//! assert_eq!(template.render(&values).unwrap().as_str(), "hello brutus"); -//! ``` -//! -//! …or with your own type, if you implement the [`Values`] trait: -//! -//! ``` -//! # use leon::Template; -//! use std::borrow::Cow; -//! use leon::Values; -//! -//! struct MyMap { -//! name: &'static str, -//! } -//! impl Values for MyMap { -//! fn get_value(&self, key: &str) -> Option> { -//! if key == "name" { -//! Some(self.name.into()) -//! } else { -//! None -//! } -//! } -//! } -//! # -//! # let template = Template::parse("hello {name}").unwrap(); -//! let values = MyMap { name: "pontifex" }; -//! assert_eq!(template.render(&values).unwrap().as_str(), "hello pontifex"); -//! ``` -//! -//! # Compile-time parsing -//! -//! You can either use [`leon-macros`](https://docs.rs/leon-macros)'s -//! [`template!`](https://docs.rs/leon-macros/latest/leon_macros/macro.template.html), -//! a proc-macro, with the exact same syntax as the normal parser, or this -//! crate's [`template!`] rules-macro, which requires a slightly different -//! syntax but doesn't bring in additional dependencies. In either case, -//! the leon library is required as a runtime dependency. -//! -//! # Errors -//! -//! Leon will return a [`ParseError`] if the template fails to -//! parse. This can happen if there are unbalanced braces, or if a key is empty. -//! -//! Leon will return a [`RenderError::MissingKey`] if a key is missing from keyed -//! values passed to [`Template::render()`], unless a default value is provided -//! with [`Template.default`]. -//! -//! It will also pass through I/O errors when using [`Template::render_into()`]. - -#[doc(inline)] -pub use error::*; - -#[doc(inline)] -pub use template::*; - -#[doc(inline)] -pub use values::*; - -mod error; -mod macros; -mod parser; -mod template; -mod values; diff --git a/crates/leon/src/macros.rs b/crates/leon/src/macros.rs deleted file mode 100644 index 1de4fda6..00000000 --- a/crates/leon/src/macros.rs +++ /dev/null @@ -1,156 +0,0 @@ -#[doc(hidden)] -#[macro_export] -macro_rules! __template_item { - () => {}; - ({ $key:literal }) => { - $crate::Item::Key($key) - }; - ( $text:literal ) => { - $crate::Item::Text($text) - }; -} - -#[doc(hidden)] -#[macro_export] -macro_rules! __template_impl { - ($( $token:tt ),* ; $default:expr) => { - $crate::Template::new( - { - const ITEMS: &'static [$crate::Item<'static>] = &[ - $( - $crate::__template_item!($token) - ),* - ]; - ITEMS - }, - $default, - ) - }; -} - -/// Construct a template constant using syntax similar to the template to be -/// passed to [`Template::parse`](crate::Template::parse). -/// -/// This is essentially a shorthand for: -/// -/// ``` -/// use leon::{Item, Template}; -/// Template::new({ -/// const ITEMS: &'static [Item<'static>] = &[Item::Text("Hello "), Item::Key("name")]; -/// ITEMS -/// }, Some("world")); -/// ``` -/// -/// # Examples -/// -/// ``` -/// assert_eq!( -/// leon::template!("Hello ", {"name"}) -/// .render(&[("name", "Магда Нахман")]) -/// .unwrap(), -/// "Hello Магда Нахман", -/// ); -/// ``` -/// -/// With a default: -/// -/// ``` -/// assert_eq!( -/// leon::template!("Hello ", {"name"}; "M. P. T. Acharya") -/// .render(&[("city", "Madras")]) -/// .unwrap(), -/// "Hello M. P. T. Acharya", -/// ); -/// ``` -#[macro_export] -macro_rules! template { - () => { - $crate::Template::new( - { - const ITEMS: &'static [$crate::Item<'static>] = &[]; - ITEMS - }, - ::core::option::Option::None, - ) - }; - - ($( $token:tt ),* $(,)?) => { - $crate::__template_impl!($( $token ),* ; ::core::option::Option::None) - }; - - ($( $token:tt ),* $(,)? ; $default:expr) => { - $crate::__template_impl!($( $token ),* ; ::core::option::Option::Some($default)) - }; -} - -#[cfg(test)] -mod tests { - use crate::{template, Item, Template}; - - #[test] - fn test_template2() { - assert_eq!(template!(), Template::new(&[], None),); - - // Only literals - assert_eq!(template!("1"), Template::new(&[Item::Text("1")], None)); - - assert_eq!( - template!("1", "2"), - Template::new(&[Item::Text("1"), Item::Text("2")], None) - ); - - assert_eq!( - template!("1", "2", "3"), - Template::new(&[Item::Text("1"), Item::Text("2"), Item::Text("3")], None) - ); - - // Only keys - assert_eq!(template!({ "k1" }), Template::new(&[Item::Key("k1")], None)); - - assert_eq!( - template!({ "k1" }, { "k2" }), - Template::new(&[Item::Key("k1"), Item::Key("k2")], None) - ); - - assert_eq!( - template!({ "k1" }, { "k2" }, { "k3" }), - Template::new(&[Item::Key("k1"), Item::Key("k2"), Item::Key("k3")], None) - ); - - // Mixed - assert_eq!( - template!("1", { "k1" }, "3"), - Template::new(&[Item::Text("1"), Item::Key("k1"), Item::Text("3")], None) - ); - - assert_eq!( - template!("1", "2", { "k1" }, "3", "4"), - Template::new( - &[ - Item::Text("1"), - Item::Text("2"), - Item::Key("k1"), - Item::Text("3"), - Item::Text("4") - ], - None - ) - ); - - assert_eq!( - template!("1", "2", { "k1" }, { "k2" }, "3", "4", { "k3" }), - Template::new( - &[ - Item::Text("1"), - Item::Text("2"), - Item::Key("k1"), - Item::Key("k2"), - Item::Text("3"), - Item::Text("4"), - Item::Key("k3"), - ], - None - ) - ); - } -} diff --git a/crates/leon/src/main.rs b/crates/leon/src/main.rs deleted file mode 100644 index acbdb1f5..00000000 --- a/crates/leon/src/main.rs +++ /dev/null @@ -1,61 +0,0 @@ -#[cfg(feature = "cli")] -fn main() -> miette::Result<()> { - use std::{collections::HashMap, error::Error, io::stdout}; - - use clap::Parser; - use leon::Template; - - /// Render a Leon template with the given values. - #[derive(Parser, Debug)] - #[command(author, version, about, long_about = None)] - struct Args { - /// Leon template - template: String, - - /// Default to use for missing keys - #[arg(long)] - default: Option, - - /// Use values from the environment - #[arg(long)] - env: bool, - - /// Key-value pairs to use - #[arg(short, long, value_parser = parse_key_val::)] - values: Vec<(String, String)>, - } - - /// Parse a single key-value pair - fn parse_key_val(s: &str) -> Result<(T, U), Box> - where - T: std::str::FromStr, - T::Err: Error + Send + Sync + 'static, - U: std::str::FromStr, - U::Err: Error + Send + Sync + 'static, - { - let (k, v) = s - .split_once('=') - .ok_or_else(|| format!("invalid KEY=value: no `=` found in `{s}`"))?; - Ok((k.parse()?, v.parse()?)) - } - - let args = Args::parse(); - let mut values: HashMap = HashMap::from_iter(args.values); - if args.env { - for (key, value) in std::env::vars() { - values.entry(key).or_insert(value); - } - } - - let template = args.template; - let mut template = Template::parse(&template)?; - if let Some(default) = &args.default { - template.set_default(default); - } - - template.render_into(&mut stdout().lock(), &values)?; - Ok(()) -} - -#[cfg(not(feature = "cli"))] -fn main() {} diff --git a/crates/leon/src/parser.rs b/crates/leon/src/parser.rs deleted file mode 100644 index 7c033cba..00000000 --- a/crates/leon/src/parser.rs +++ /dev/null @@ -1,334 +0,0 @@ -use crate::{Item, ParseError, Template}; - -impl<'s> Template<'s> { - pub(crate) fn parse_items(source: &'s str) -> Result>, ParseError> { - let mut items = Vec::new(); - - let mut start = 0; - let mut s = source; - - loop { - if let Some(index) = s.find(['\\', '{', '}']) { - if index != 0 { - let (first, last) = s.split_at(index); - items.push(Item::Text(first)); - - // Move cursor forward - start += index; - s = last; - } - } else { - if !s.is_empty() { - items.push(Item::Text(s)); - } - - break Ok(items); - }; - - let mut chars = s.chars(); - let ch = chars.next().unwrap(); - - match ch { - '\\' => { - match chars.next() { - Some('\\' | '{' | '}') => { - let t = s.get(1..2).unwrap(); - debug_assert!(["\\", "{", "}"].contains(&t), "{}", t); - items.push(Item::Text(t)); - - // Move cursor forward - start += 2; - s = s.get(2..).unwrap(); - } - _ => { - return Err(ParseError::escape(source, start, start + 1)); - } - } - } - '{' => { - let Some((key, rest)) = s[1..].split_once('}') else { - return Err(ParseError::unbalanced(source, start, start + s.len())); - }; - if let Some(index) = key.find('\\') { - return Err(ParseError::key_escape(source, start, start + 1 + index)); - } - - let k = key.trim(); - if k.is_empty() { - return Err(ParseError::key_empty(source, start, start + key.len() + 1)); - } - items.push(Item::Key(k)); - - // Move cursor forward - // for the '{' - // | for the '}' - // | | - start += 1 + key.len() + 1; - s = rest; - } - '}' => { - return Err(ParseError::unbalanced(source, start, start)); - } - _ => unreachable!(), - } - } - } -} - -#[cfg(test)] -mod test_valid { - use crate::{template, Template}; - - #[test] - fn empty() { - let template = Template::parse("").unwrap(); - assert_eq!(template, Template::default()); - } - - #[test] - fn no_keys() { - let template = Template::parse("hello world").unwrap(); - assert_eq!(template, template!("hello world")); - } - - #[test] - fn leading_key() { - let template = Template::parse("{salutation} world").unwrap(); - assert_eq!(template, template!({ "salutation" }, " world")); - } - - #[test] - fn trailing_key() { - let template = Template::parse("hello {name}").unwrap(); - assert_eq!(template, template!("hello ", { "name" })); - } - - #[test] - fn middle_key() { - let template = Template::parse("hello {name}!").unwrap(); - assert_eq!(template, template!("hello ", { "name" }, "!")); - } - - #[test] - fn middle_text() { - let template = Template::parse("{salutation} good {title}").unwrap(); - assert_eq!(template, template!({ "salutation" }, " good ", { "title" })); - } - - #[test] - fn multiline() { - let template = Template::parse( - " - And if thy native country was { ancient civilisation }, - What need to slight thee? Came not {hero} thence, - Who gave to { country } her books and art of writing? - ", - ) - .unwrap(); - assert_eq!( - template, - template!( - "\n And if thy native country was ", - { "ancient civilisation" }, - ",\n What need to slight thee? Came not ", - { "hero" }, - " thence,\n Who gave to ", - { "country" }, - " her books and art of writing?\n ", - ) - ); - } - - #[test] - fn key_no_whitespace() { - let template = Template::parse("{word}").unwrap(); - assert_eq!(template, template!({ "word" })); - } - - #[test] - fn key_leading_whitespace() { - let template = Template::parse("{ word}").unwrap(); - assert_eq!(template, template!({ "word" })); - } - - #[test] - fn key_trailing_whitespace() { - let template = Template::parse("{word\n}").unwrap(); - assert_eq!(template, template!({ "word" })); - } - - #[test] - fn key_both_whitespace() { - let template = Template::parse( - "{ - \tword - }", - ) - .unwrap(); - assert_eq!(template, template!({ "word" })); - } - - #[test] - fn key_inner_whitespace() { - let template = Template::parse("{ a word }").unwrap(); - assert_eq!(template, template!({ "a word" })); - } - - #[test] - fn escape_left() { - let template = Template::parse(r"this \{ single left brace").unwrap(); - assert_eq!(template, template!("this ", "{", " single left brace")); - } - - #[test] - fn escape_right() { - let template = Template::parse(r"this \} single right brace").unwrap(); - assert_eq!(template, template!("this ", "}", " single right brace")); - } - - #[test] - fn escape_both() { - let template = Template::parse(r"these \{ two \} braces").unwrap(); - assert_eq!(template, template!("these ", "{", " two ", "}", " braces")); - } - - #[test] - fn escape_doubled() { - let template = Template::parse(r"these \{\{ four \}\} braces").unwrap(); - assert_eq!( - template, - template!("these ", "{", "{", " four ", "}", "}", " braces") - ); - } - - #[test] - fn escape_escape() { - let template = Template::parse(r"these \\ backslashes \\\\").unwrap(); - assert_eq!( - template, - template!("these ", r"\", " backslashes ", r"\", r"\",) - ); - } - - #[test] - fn escape_before_key() { - let template = Template::parse(r"\\{ a } \{{ b } \}{ c }").unwrap(); - assert_eq!( - template, - template!(r"\", { "a" }, " ", r"{", { "b" }, " ", r"}", { "c" }) - ); - } - - #[test] - fn escape_after_key() { - let template = Template::parse(r"{ a }\\ { b }\{ { c }\}").unwrap(); - assert_eq!( - template, - template!({ "a" }, r"\", " ", { "b" }, r"{", " ", { "c" }, r"}") - ); - } - - #[test] - fn multibyte_texts() { - let template = Template::parse("幸徳 {particle} 秋水").unwrap(); - assert_eq!(template, template!("幸徳 ", { "particle" }, " 秋水")); - } - - #[test] - fn multibyte_key() { - let template = Template::parse("The { 連盟 }").unwrap(); - assert_eq!(template, template!("The ", { "連盟" })); - } - - #[test] - fn multibyte_both() { - let template = Template::parse("大杉 {栄}").unwrap(); - assert_eq!(template, template!("大杉 ", { "栄" })); - } - - #[test] - fn multibyte_whitespace() { - let template = Template::parse("岩佐 作{ 太 }郎").unwrap(); - assert_eq!(template, template!("岩佐 作", { "太" }, "郎")); - } - - #[test] - fn multibyte_with_escapes() { - let template = Template::parse(r"日本\{アナキスト\}連盟").unwrap(); - assert_eq!( - template, - template!("日本", r"{", "アナキスト", r"}", "連盟") - ); - } - - #[test] - fn multibyte_rtl_text() { - let template = Template::parse("محمد صايل").unwrap(); - assert_eq!(template, template!("محمد صايل")); - } - - #[test] - fn multibyte_rtl_key() { - let template = Template::parse("محمد {ريشة}").unwrap(); - assert_eq!(template, template!("محمد ", { "ريشة" })); - } -} - -#[cfg(test)] -mod test_error { - use crate::{ParseError, Template}; - - #[test] - fn key_left_half() { - let template = Template::parse("{ open").unwrap_err(); - assert_eq!(template, ParseError::unbalanced("{ open", 0, 6)); - } - - #[test] - fn key_right_half() { - let template = Template::parse("open }").unwrap_err(); - assert_eq!(template, ParseError::unbalanced("open }", 5, 5)); - } - - #[test] - fn key_with_half_escape() { - let template = Template::parse(r"this is { not \ allowed }").unwrap_err(); - assert_eq!( - template, - ParseError::key_escape(r"this is { not \ allowed }", 8, 14) - ); - } - - #[test] - fn key_with_full_escape() { - let template = Template::parse(r"{ not \} allowed }").unwrap_err(); - assert_eq!( - template, - ParseError::key_escape(r"{ not \} allowed }", 0, 6) - ); - } - - #[test] - fn key_empty() { - let template = Template::parse(r"void: {}").unwrap_err(); - assert_eq!(template, ParseError::key_empty(r"void: {}", 6, 7)); - } - - #[test] - fn key_only_whitespace() { - let template = Template::parse(r"nothing: { }").unwrap_err(); - assert_eq!(template, ParseError::key_empty(r"nothing: { }", 9, 11)); - } - - #[test] - fn bad_escape() { - let template = Template::parse(r"not \a thing").unwrap_err(); - assert_eq!(template, ParseError::escape(r"not \a thing", 4, 5)); - } - - #[test] - fn end_escape() { - let template = Template::parse(r"forget me not \").unwrap_err(); - assert_eq!(template, ParseError::escape(r"forget me not \", 14, 15)); - } -} diff --git a/crates/leon/src/template.rs b/crates/leon/src/template.rs deleted file mode 100644 index e24b8aca..00000000 --- a/crates/leon/src/template.rs +++ /dev/null @@ -1,278 +0,0 @@ -use std::{borrow::Cow, fmt::Display, io::Write, ops}; - -use crate::{ParseError, RenderError, Values}; - -#[derive(Clone, Debug, Default, PartialEq, Eq)] -pub struct Template<'s> { - pub items: Cow<'s, [Item<'s>]>, - pub default: Option>, -} - -#[derive(Clone, Debug, PartialEq, Eq)] -pub enum Item<'s> { - Text(&'s str), - Key(&'s str), -} - -impl<'s> Template<'s> { - /// Construct a template with the given items and default. - /// - /// You can write a template literal without any help by constructing it directly: - /// - /// ``` - /// use std::borrow::Cow; - /// use leon::{Item, Template}; - /// const TEMPLATE: Template = Template { - /// items: Cow::Borrowed({ - /// const ITEMS: &'static [Item<'static>] = &[ - /// Item::Text("Hello"), - /// Item::Key("name"), - /// ]; - /// ITEMS - /// }), - /// default: None, - /// }; - /// assert_eq!(TEMPLATE.render(&[("name", "world")]).unwrap(), "Helloworld"); - /// ``` - /// - /// As that's a bit verbose, using this function and the enum shorthands can be helpful: - /// - /// ``` - /// use leon::{Item, Item::*, Template}; - /// const TEMPLATE: Template = Template::new({ - /// const ITEMS: &'static [Item<'static>] = &[Text("Hello "), Key("name")]; - /// ITEMS - /// }, Some("world")); - /// - /// assert_eq!(TEMPLATE.render(&[("unrelated", "value")]).unwrap(), "Hello world"); - /// ``` - /// - /// For an even more ergonomic syntax, see the [`leon::template!`](crate::template!) macro. - pub const fn new(items: &'s [Item<'s>], default: Option<&'s str>) -> Template<'s> { - Template { - items: Cow::Borrowed(items), - default: match default { - Some(default) => Some(Cow::Borrowed(default)), - None => None, - }, - } - } - - /// Parse a template from a string. - /// - /// # Syntax - /// - /// ```plain - /// it is better to rule { group } - /// one can live {adverb} without power - /// ``` - /// - /// A replacement is denoted by `{` and `}`. The contents of the braces, trimmed - /// of any whitespace, are the key. Any text outside of braces is left as-is. - /// - /// To escape a brace, use `\{` or `\}`. To escape a backslash, use `\\`. Keys - /// cannot contain escapes. - /// - /// ```plain - /// \{ leon \} - /// ``` - /// - /// The above examples, given the values `group = "no one"` and - /// `adverb = "honourably"`, would render to: - /// - /// ```plain - /// it is better to rule no one - /// one can live honourably without power - /// { leon } - /// ``` - /// - /// # Example - /// - /// ``` - /// use leon::Template; - /// let template = Template::parse("hello {name}").unwrap(); - /// ``` - /// - pub fn parse(s: &'s str) -> Result { - Self::parse_items(s).map(|items| Template { - items: Cow::Owned(items), - default: None, - }) - } - - pub fn render_into( - &self, - writer: &mut dyn Write, - values: &dyn Values, - ) -> Result<(), RenderError> { - for token in self.items.as_ref() { - match token { - Item::Text(text) => writer.write_all(text.as_bytes())?, - Item::Key(key) => { - if let Some(value) = values.get_value(key) { - writer.write_all(value.as_bytes())?; - } else if let Some(default) = &self.default { - writer.write_all(default.as_bytes())?; - } else { - return Err(RenderError::MissingKey(key.to_string())); - } - } - } - } - Ok(()) - } - - pub fn render(&self, values: &dyn Values) -> Result { - let mut buf = Vec::with_capacity( - self.items - .iter() - .map(|item| match item { - Item::Key(_) => 0, - Item::Text(t) => t.len(), - }) - .sum(), - ); - self.render_into(&mut buf, values)?; - - // UNWRAP: We know that the buffer is valid UTF-8 because we only write strings. - Ok(String::from_utf8(buf).unwrap()) - } - - /// If the template contains key `key`. - pub fn has_key(&self, key: &str) -> bool { - self.has_any_of_keys(&[key]) - } - - /// If the template contains any one of the `keys`. - pub fn has_any_of_keys(&self, keys: &[&str]) -> bool { - self.items.iter().any(|token| match token { - Item::Key(k) => keys.contains(k), - _ => false, - }) - } - - /// Returns all keys in this template. - pub fn keys(&self) -> impl Iterator { - self.items.iter().filter_map(|token| match token { - Item::Key(k) => Some(k), - _ => None, - }) - } - - /// Sets the default value for this template. - pub fn set_default(&mut self, default: &dyn Display) { - self.default = Some(Cow::Owned(default.to_string())); - } - - /// Cast `Template<'s>` to `Template<'t>` where `'s` is a subtype of `'t`, - /// meaning that `Template<'s>` outlives `Template<'t>`. - pub fn cast<'t>(self) -> Template<'t> - where - 's: 't, - { - Template { - items: match self.items { - Cow::Owned(vec) => Cow::Owned(vec), - Cow::Borrowed(slice) => Cow::Borrowed(slice as &'t [Item<'t>]), - }, - default: self.default.map(|default| default as Cow<'t, str>), - } - } -} - -impl<'s, 'rhs: 's> ops::AddAssign<&Template<'rhs>> for Template<'s> { - fn add_assign(&mut self, rhs: &Template<'rhs>) { - self.items - .to_mut() - .extend(rhs.items.as_ref().iter().cloned()); - - if let Some(default) = &rhs.default { - self.default = Some(default.clone()); - } - } -} - -impl<'s, 'rhs: 's> ops::AddAssign> for Template<'s> { - fn add_assign(&mut self, rhs: Template<'rhs>) { - match rhs.items { - Cow::Borrowed(items) => self.items.to_mut().extend(items.iter().cloned()), - Cow::Owned(items) => self.items.to_mut().extend(items), - } - - if let Some(default) = rhs.default { - self.default = Some(default); - } - } -} - -impl<'s, 'item: 's> ops::AddAssign> for Template<'s> { - fn add_assign(&mut self, item: Item<'item>) { - self.items.to_mut().push(item); - } -} - -impl<'s, 'item: 's> ops::AddAssign<&Item<'item>> for Template<'s> { - fn add_assign(&mut self, item: &Item<'item>) { - self.add_assign(item.clone()) - } -} - -impl<'s, 'rhs: 's> ops::Add> for Template<'s> { - type Output = Self; - - fn add(mut self, rhs: Template<'rhs>) -> Self::Output { - self += rhs; - self - } -} - -impl<'s, 'rhs: 's> ops::Add<&Template<'rhs>> for Template<'s> { - type Output = Self; - - fn add(mut self, rhs: &Template<'rhs>) -> Self::Output { - self += rhs; - self - } -} - -impl<'s, 'item: 's> ops::Add> for Template<'s> { - type Output = Self; - - fn add(mut self, item: Item<'item>) -> Self::Output { - self += item; - self - } -} - -impl<'s, 'item: 's> ops::Add<&Item<'item>> for Template<'s> { - type Output = Self; - - fn add(mut self, item: &Item<'item>) -> Self::Output { - self += item; - self - } -} - -#[cfg(test)] -mod test { - use crate::Template; - - #[test] - fn concat_templates() { - let t1 = crate::template!("Hello", { "name" }); - let t2 = crate::template!("have a", { "adjective" }, "day"); - assert_eq!( - t1 + t2, - crate::template!("Hello", { "name" }, "have a", { "adjective" }, "day"), - ); - } - - #[test] - fn test_cast() { - fn inner<'a>(_: &'a u32, _: Template<'a>) {} - - let template: Template<'static> = crate::template!("hello"); - let i = 1; - inner(&i, template.cast()); - } -} diff --git a/crates/leon/src/values.rs b/crates/leon/src/values.rs deleted file mode 100644 index f5255272..00000000 --- a/crates/leon/src/values.rs +++ /dev/null @@ -1,161 +0,0 @@ -use std::{ - borrow::{Borrow, Cow}, - collections::{BTreeMap, HashMap}, - hash::{BuildHasher, Hash}, - ops::Deref, - rc::Rc, - sync::Arc, -}; - -pub trait Values { - fn get_value(&self, key: &str) -> Option>; -} - -impl Values for &T -where - T: Values, -{ - fn get_value(&self, key: &str) -> Option> { - T::get_value(self, key) - } -} - -impl Values for Arc -where - T: Values, -{ - fn get_value(&self, key: &str) -> Option> { - T::get_value(self.deref(), key) - } -} - -impl Values for Rc -where - T: Values, -{ - fn get_value(&self, key: &str) -> Option> { - T::get_value(self.deref(), key) - } -} - -impl Values for [(K, V)] -where - K: AsRef, - V: AsRef, -{ - fn get_value(&self, key: &str) -> Option> { - self.iter().find_map(|(k, v)| { - if k.as_ref() == key { - Some(Cow::Borrowed(v.as_ref())) - } else { - None - } - }) - } -} - -impl Values for &[(K, V)] -where - K: AsRef, - V: AsRef, -{ - fn get_value(&self, key: &str) -> Option> { - (*self).get_value(key) - } -} - -impl Values for [(K, V); N] -where - K: AsRef, - V: AsRef, -{ - fn get_value(&self, key: &str) -> Option> { - self.as_slice().get_value(key) - } -} - -impl Values for Vec<(K, V)> -where - K: AsRef, - V: AsRef, -{ - fn get_value(&self, key: &str) -> Option> { - self.as_slice().get_value(key) - } -} - -impl Values for HashMap -where - K: Borrow + Eq + Hash, - V: AsRef, - S: BuildHasher, -{ - fn get_value(&self, key: &str) -> Option> { - self.get(key).map(|v| Cow::Borrowed(v.as_ref())) - } -} - -impl Values for BTreeMap -where - K: Borrow + Ord, - V: AsRef, -{ - fn get_value(&self, key: &str) -> Option> { - self.get(key).map(|v| Cow::Borrowed(v.as_ref())) - } -} - -/// Workaround to allow using functions as [`Values`]. -/// -/// As this isn't constructible you'll want to use [`vals()`] instead. -#[derive(Copy, Clone, Debug)] -pub struct ValuesFn { - inner: F, -} - -impl Values for ValuesFn -where - F: Fn(&str) -> Option>, -{ - fn get_value(&self, key: &str) -> Option> { - (self.inner)(key) - } -} - -/// See doc of [`vals`] -impl From for ValuesFn -where - F: Fn(&str) -> Option>, -{ - fn from(inner: F) -> Self { - Self { inner } - } -} - -/// Wraps your function so it implements [`Values`], -/// though it only works if your function returns `Cow<'static, str>`. -/// -/// Since regular function pointers cannot return anything other than -/// `Cow<'static, str>` and closure in Rust currently does not support -/// returning borrows of captured data, supporting anything other than -/// `Cow<'static, str>` for functions is pointless and would only cause -/// more confusion and compile-time errors. -/// -/// To return `&str` owned by the values itself, please create a newtype -/// and implement [`Values`] on it manually instead of using this function. -/// -/// # Example -/// -/// ``` -/// use leon::{Values, vals}; -/// -/// fn use_values(_values: impl Values) {} -/// -/// use_values(&vals(|_| Some("hello".into()))); -/// ``` -pub const fn vals(func: F) -> ValuesFn -where - F: Fn(&str) -> Option>, -{ - ValuesFn { inner: func } -} diff --git a/justfile b/justfile index 46f5c8ec..d01a9510 100644 --- a/justfile +++ b/justfile @@ -215,7 +215,6 @@ build: print-env check: print-env {{cargo-bin}} check {{cargo-build-args}} --profile check-only - cargo hack check --feature-powerset -p leon {{cargo-check-args}} --profile check-only {{cargo-bin}} check -p binstalk-downloader --no-default-features --profile check-only {{cargo-bin}} check -p cargo-binstall --no-default-features --features rustls {{cargo-check-args}} --profile check-only cargo-hack hack check -p binstalk-downloader \ From 6dd4a155fbcad0426d199ac8e5090506459095b5 Mon Sep 17 00:00:00 2001 From: Ilkka Poutanen Date: Fri, 23 Feb 2024 13:21:05 +0200 Subject: [PATCH 1672/2020] Typo fix (#1631) --- crates/binstalk/src/ops/resolve.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 94b1b5ff..994bc6fd 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -261,7 +261,7 @@ upstream to fix this issue." let features = required_features.iter().format(","); warn!( "When resolving {name} bin {bin_name} is not found. \ -But since it requies features {features}, this bin is ignored." +But since it requires features {features}, this bin is ignored." ); None } From fbb49b4eb6d25002b5cce3e7bc4cc1e7ae84e02f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 23 Feb 2024 13:03:58 +0000 Subject: [PATCH 1673/2020] dep: Upgrade transitive dependencies (#1630) * dep: Upgrade transitive dependencies * CI: Use make 4.4.1 on macOS Siuce cc 1.0.86 only works with make >=4.3 Signed-off-by: Jiahao XU * CI: Bump actions/cache to v4 Signed-off-by: Jiahao XU * CI: Fix copying of make compilation bash code Signed-off-by: Jiahao XU * CI: Fix make compilation Signed-off-by: Jiahao XU * CI: Speedup make compilation Signed-off-by: Jiahao XU * Fix CI: Add missing `shell` Signed-off-by: Jiahao XU * CI: FIx parallism for compiling make Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU Co-authored-by: github-actions Co-authored-by: Jiahao XU --- .github/actions/just-setup/action.yml | 26 +++- Cargo.lock | 197 ++++++++++++-------------- 2 files changed, 119 insertions(+), 104 deletions(-) diff --git a/.github/actions/just-setup/action.yml b/.github/actions/just-setup/action.yml index 12a43633..6d279257 100644 --- a/.github/actions/just-setup/action.yml +++ b/.github/actions/just-setup/action.yml @@ -93,9 +93,33 @@ runs: - name: Cache zig compilation if: env.JUST_USE_CARGO_ZIGBUILD - uses: actions/cache@v3 + uses: actions/cache@v4 with: path: ${{ steps.zig_global_cache_dir_path.outputs.cache_dir }} key: ${{ env.ZIG_CACHE_KEY }} restore-keys: | ${{ env.ZIG_CACHE_RESTORE_KEY }} + + - name: Cache make compiled + if: runner.os == 'macOS' + id: cache-make + uses: actions/cache@v4 + with: + path: /usr/local/bin/make + key: ${{ runner.os }}-make-4.4.1 + + - name: Build and use make 4.4.1 on macOS, since cc requires make >=4.3 + if: runner.os == 'macOS' && steps.cache-make.outputs.cache-hit != 'true' + run: | + curl "https://ftp.gnu.org/gnu/make/make-${MAKE_VERSION}.tar.gz" | tar xz + pushd "make-${MAKE_VERSION}" + ./configure + make -j 4 + popd + cp -p "make-${MAKE_VERSION}/make" /usr/local/bin + env: + MAKE_VERSION: 4.4.1 + shell: bash + + - run: make -v + shell: bash diff --git a/Cargo.lock b/Cargo.lock index 389edcba..5579258b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,9 +43,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.11" +version = "0.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e2e1ebcb11de5c03c67de28a7df593d32191b44939c482e97702baaaa6ab6a5" +checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" dependencies = [ "anstyle", "anstyle-parse", @@ -91,9 +91,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.79" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" +checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "arc-swap" @@ -135,7 +135,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.50", ] [[package]] @@ -455,9 +455,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.15.0" +version = "3.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a994c2b3ca201d9b263612a374263f05e7adde37c4707f693dcd375076d1f" +checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" [[package]] name = "byteorder" @@ -594,11 +594,10 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "7f9fa1897e4325be0d68d48df6aa1a71ac2ed4d27723887e7754192705350730" dependencies = [ - "jobserver", "libc", ] @@ -610,9 +609,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.0" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80c21025abd42669a92efc996ef13cfb2c5c627858421ea58d5c3b331a6c134f" +checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" dependencies = [ "clap_builder", "clap_derive", @@ -620,9 +619,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.0" +version = "4.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458bf1f341769dfcf849846f65dffdf9146daa56bcd2a47cb4e1de9915567c99" +checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" dependencies = [ "anstream", "anstyle", @@ -639,7 +638,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.50", ] [[package]] @@ -841,7 +840,7 @@ checksum = "ac4b68190bad25c00b64ea19767b2321a037fc0e5bea7563d5d8e35e04b19c95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.50", ] [[package]] @@ -950,7 +949,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.50", ] [[package]] @@ -1159,7 +1158,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.50", ] [[package]] @@ -1585,7 +1584,7 @@ checksum = "d75e7ab728059f595f6ddc1ad8771b8d6a231971ae493d9d5948ecad366ee8bb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.50", ] [[package]] @@ -2207,9 +2206,9 @@ checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" [[package]] name = "human_format" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86cce260d758a9aa3d7c4b99d55c815a540f8a37514ba6046ab6be402a157cb0" +checksum = "5c3b1f728c459d27b12448862017b96ad4767b1ec2ec5e6434e99f1577f085b8" [[package]] name = "hyper" @@ -2350,15 +2349,6 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" -[[package]] -name = "jobserver" -version = "0.1.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" -dependencies = [ - "libc", -] - [[package]] name = "jobslot" version = "0.2.15" @@ -2426,7 +2416,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.50", ] [[package]] @@ -2522,13 +2512,13 @@ checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" [[package]] name = "maybe-async" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc95a651c82daf7004c824405aa1019723644950d488571bd718e3ed84646ed" +checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.50", ] [[package]] @@ -2588,7 +2578,7 @@ checksum = "f301c3f54f98abc6c212ee722f5e5c62e472a334415840669e356f04850051ec" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.50", ] [[package]] @@ -2774,9 +2764,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.63" +version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" +checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ "bitflags 2.4.2", "cfg-if", @@ -2795,7 +2785,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.50", ] [[package]] @@ -2806,9 +2796,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.99" +version = "0.9.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" +checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff" dependencies = [ "cc", "libc", @@ -2892,7 +2882,7 @@ checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.50", ] [[package]] @@ -3215,16 +3205,17 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.7" +version = "0.17.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", + "cfg-if", "getrandom", "libc", "spin 0.9.8", "untrusted 0.9.0", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3268,7 +3259,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", - "ring 0.17.7", + "ring 0.17.8", "rustls-webpki", "sct", ] @@ -3300,7 +3291,7 @@ version = "0.101.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", "untrusted 0.9.0", ] @@ -3312,9 +3303,9 @@ checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] name = "ryu" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" +checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" [[package]] name = "same-file" @@ -3346,7 +3337,7 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring 0.17.7", + "ring 0.17.8", "untrusted 0.9.0", ] @@ -3375,18 +3366,18 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.21" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" +checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" +checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" dependencies = [ "serde_derive", ] @@ -3402,20 +3393,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.196" +version = "1.0.197" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" +checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.50", ] [[package]] name = "serde_json" -version = "1.0.113" +version = "1.0.114" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69801b70b1c3dac963ecb03a364ba0ceda9cf60c71cfe475e99864759c8b8a79" +checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" dependencies = [ "itoa", "ryu", @@ -3590,7 +3581,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.49", + "syn 2.0.50", ] [[package]] @@ -3627,9 +3618,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.49" +version = "2.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915aea9e586f80826ee59f8453c1101f9d1c4b3964cd2460185ee8e299ada496" +checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" dependencies = [ "proc-macro2", "quote", @@ -3665,9 +3656,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.13" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tempfile" @@ -3693,9 +3684,9 @@ dependencies = [ [[package]] name = "textwrap" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" +checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" dependencies = [ "smawk", "unicode-linebreak", @@ -3719,14 +3710,14 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.50", ] [[package]] name = "thread_local" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdd6f064ccff2d6567adcb3873ca630700f00b5ad3f060c25b5dcfd9a4ce152" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" dependencies = [ "cfg-if", "once_cell", @@ -3806,7 +3797,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.50", ] [[package]] @@ -3912,7 +3903,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.1", + "winnow 0.6.2", ] [[package]] @@ -3941,7 +3932,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.50", ] [[package]] @@ -4037,9 +4028,9 @@ checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" [[package]] name = "unicode-normalization" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" dependencies = [ "tinyvec", ] @@ -4179,7 +4170,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.50", "wasm-bindgen-shared", ] @@ -4213,7 +4204,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.49", + "syn 2.0.50", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4319,7 +4310,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core", - "windows-targets 0.52.0", + "windows-targets 0.52.3", ] [[package]] @@ -4328,7 +4319,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.3", ] [[package]] @@ -4370,7 +4361,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.3", ] [[package]] @@ -4390,17 +4381,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" 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", + "windows_aarch64_gnullvm 0.52.3", + "windows_aarch64_msvc 0.52.3", + "windows_i686_gnu 0.52.3", + "windows_i686_msvc 0.52.3", + "windows_x86_64_gnu 0.52.3", + "windows_x86_64_gnullvm 0.52.3", + "windows_x86_64_msvc 0.52.3", ] [[package]] @@ -4411,9 +4402,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" [[package]] name = "windows_aarch64_msvc" @@ -4429,9 +4420,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" [[package]] name = "windows_i686_gnu" @@ -4447,9 +4438,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" [[package]] name = "windows_i686_msvc" @@ -4465,9 +4456,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" [[package]] name = "windows_x86_64_gnu" @@ -4483,9 +4474,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" [[package]] name = "windows_x86_64_gnullvm" @@ -4495,9 +4486,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" [[package]] name = "windows_x86_64_msvc" @@ -4513,9 +4504,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" [[package]] name = "winnow" @@ -4528,9 +4519,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d90f4e0f530c4c69f62b80d839e9ef3855edc9cba471a160c4d692deed62b401" +checksum = "7a4191c47f15cc3ec71fcb4913cb83d58def65dd3787610213c649283b5ce178" dependencies = [ "memchr", ] From 5dea671585b1b99263da8524028da86e9e6fb88f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 24 Feb 2024 01:58:35 +0000 Subject: [PATCH 1674/2020] build(deps): bump the deps group with 2 updates (#1633) Bumps the deps group with 2 updates: [windows](https://github.com/microsoft/windows-rs) and [default-net](https://github.com/shellrow/default-net). Updates `windows` from 0.52.0 to 0.53.0 - [Release notes](https://github.com/microsoft/windows-rs/releases) - [Commits](https://github.com/microsoft/windows-rs/compare/0.52.0...0.53.0) Updates `default-net` from 0.21.0 to 0.22.0 - [Release notes](https://github.com/shellrow/default-net/releases) - [Commits](https://github.com/shellrow/default-net/compare/v0.21.0...v0.22.0) --- updated-dependencies: - dependency-name: windows dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: default-net dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 37 ++++++++++++++++++++++++--- crates/atomic-file-install/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5579258b..e67a9dc5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -160,7 +160,7 @@ dependencies = [ "reflink-copy", "tempfile", "tracing", - "windows 0.52.0", + "windows 0.53.0", ] [[package]] @@ -802,9 +802,9 @@ checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" [[package]] name = "default-net" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85dc7576d8346d3c86ad64dc64d26d0f6c970ba4795b850f15ee94467d8e53eb" +checksum = "0c5a6569a908354d49b10db3c516d69aca1eccd97562fd31c98b13f00b73ca66" dependencies = [ "dlopen2", "libc", @@ -4309,7 +4309,17 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-core", + "windows-core 0.52.0", + "windows-targets 0.52.3", +] + +[[package]] +name = "windows" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "efc5cf48f83140dcaab716eeaea345f9e93d0018fb81162753a3f76c3397b538" +dependencies = [ + "windows-core 0.53.0", "windows-targets 0.52.3", ] @@ -4322,6 +4332,16 @@ dependencies = [ "windows-targets 0.52.3", ] +[[package]] +name = "windows-core" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dcc5b895a6377f1ab9fa55acedab1fd5ac0db66ad1e6c7f47e28a22e446a5dd" +dependencies = [ + "windows-result", + "windows-targets 0.52.3", +] + [[package]] name = "windows-dll" version = "0.4.1" @@ -4346,6 +4366,15 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "windows-result" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cd19df78e5168dfb0aedc343d1d1b8d422ab2db6756d2dc3fef75035402a3f64" +dependencies = [ + "windows-targets 0.52.3", +] + [[package]] name = "windows-sys" version = "0.48.0" diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index baad0d24..f2715770 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -15,4 +15,4 @@ tempfile = "3.5.0" tracing = "0.1.39" [target.'cfg(windows)'.dependencies] -windows = { version = "0.52.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } +windows = { version = "0.53.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index a4bae9d8..9b403a5a 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -100,7 +100,7 @@ gh-api-client = ["json"] json = ["serde", "serde_json"] [target."cfg(windows)".dependencies] -default-net = { version = "0.21.0", optional = true } +default-net = { version = "0.22.0", optional = true } ipconfig = { version = "0.3.2", optional = true, default-features = false } [package.metadata.docs.rs] From 130021ca5f562eba88a59a5aac14e9637543ce2a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 1 Mar 2024 16:17:19 +1000 Subject: [PATCH 1675/2020] dep: Upgrade transitive dependencies (#1636) Co-authored-by: github-actions --- Cargo.lock | 216 ++++++++++++++++++++++++++--------------------------- 1 file changed, 108 insertions(+), 108 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e67a9dc5..53aa2203 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -43,9 +43,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.12" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b09b5178381e0874812a9b157f7fe84982617e48f71f4e3235482775e5b540" +checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" dependencies = [ "anstyle", "anstyle-parse", @@ -135,7 +135,7 @@ checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -435,9 +435,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.9.0" +version = "1.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c48f0051a4b4c5e0b6d365cd04af53aeaa209e3cc15ec2cdb69e73cc87fbd0dc" +checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" dependencies = [ "memchr", "regex-automata", @@ -594,9 +594,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9fa1897e4325be0d68d48df6aa1a71ac2ed4d27723887e7754192705350730" +checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" dependencies = [ "libc", ] @@ -638,7 +638,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -743,9 +743,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.11" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "176dc175b78f56c0f321911d9c8eb2b77a78a4860b9c19db83835fea1a46649b" +checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" dependencies = [ "crossbeam-utils", ] @@ -840,7 +840,7 @@ checksum = "ac4b68190bad25c00b64ea19767b2321a037fc0e5bea7563d5d8e35e04b19c95" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -949,7 +949,7 @@ dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1158,7 +1158,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1288,9 +1288,9 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "214ee3792e504ee1ce206b36dcafa4f328ca313d1e2ac0b41433d68ef4e14260" +checksum = "4a3d3143c52cb90a4e45ac9f36ad3d458768ac4479f5f4a9f4723ee776bf87b1" dependencies = [ "bstr", "gix-glob", @@ -1323,9 +1323,9 @@ dependencies = [ [[package]] name = "gix-command" -version = "0.3.4" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82b5e9494e61983e61049bbd15fe0fa6b70672dd236362bdb5b2b50fc428f10" +checksum = "7fbea18732d602afc6daa73657c07d8cc0bcb3ff50872de1be5c8706954137fc" dependencies = [ "bstr", "gix-path", @@ -1335,9 +1335,9 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82dbd7fb959862e3df2583331f0ad032ac93533e8a52f1b0694bc517f5d292bc" +checksum = "b27bf9d74c34eca0c5c676087b7309ea5b362809ebcaf7eb90c38b547dac3e9f" dependencies = [ "bstr", "gix-chunk", @@ -1370,9 +1370,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.4" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e7bfb37a46ed0b8468db37a6d8a0a61d56bdbe4603ae492cb322e5f3958" +checksum = "74ab5d22bc21840f4be0ba2e78df947ba14d8ba6999ea798f86b5bdb999edd0c" dependencies = [ "bitflags 2.4.2", "bstr", @@ -1383,9 +1383,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206ede3fe433abba3c8b0174179d5bbac65ae3f0d9187e2ea96c0494db6a139f" +checksum = "0c14f8f9c829ad863d29edeb09f495c1bdfd757204a6ff17ea22c1e2ce8748de" dependencies = [ "bstr", "gix-command", @@ -1400,9 +1400,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb7f3dfb72bebe3449b5e642be64e3c6ccbe9821c8b8f19f487cf5bfbbf4067e" +checksum = "17077f0870ac12b55d2eed9cb3f56549e40def514c8a783a0a79177a8a76b7c5" dependencies = [ "bstr", "itoa", @@ -1496,9 +1496,9 @@ dependencies = [ [[package]] name = "gix-glob" -version = "0.16.0" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4965a1d06d0ab84a29d4a67697a97352ab14ae1da821084e5afb1fd6d8191ca0" +checksum = "e7c050a43e4e5601c99af40d7613957698e7a90a5b33f2a319c3842f9f9dc48b" dependencies = [ "bitflags 2.4.2", "bstr", @@ -1529,9 +1529,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f7069aaca4a05784c4cb44e392f0eaf627c6e57e05d3100c0e2386a37a682f0" +checksum = "b0b7b0ecaa005f4c1ae7a8581c5e0f1311f77c5eb77b7bfb605424043861b81f" dependencies = [ "bstr", "gix-glob", @@ -1584,7 +1584,7 @@ checksum = "d75e7ab728059f595f6ddc1ad8771b8d6a231971ae493d9d5948ecad366ee8bb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -1689,9 +1689,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97e9ad649bf5e109562d6acba657ca428661ec08e77eaf3a755d8fa55485be9c" +checksum = "69e0b521a5c345b7cd6a81e3e6f634407360a038c8b74ba14c621124304251b8" dependencies = [ "bstr", "gix-trace", @@ -1717,9 +1717,9 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02bd89d058258e53e0fd6c57f13ee16c5673a83066a68e11f88626fc8cfda5f6" +checksum = "c04122ecca9079c27f6cd256cacbec1326b9c947d46d66ff8fb0d00e931656a1" dependencies = [ "gix-command", "gix-config-value", @@ -1730,30 +1730,30 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.44.0" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84af465436787ff423a1b4d5bd0c1979200e7165ed04324fa03ba2235485eebc" +checksum = "23a6bddf10ea18f6a804a81ad22741b08cb74fd4469be63a2b1b93f66ce1d238" dependencies = [ "bstr", - "btoi", "gix-credentials", "gix-date", "gix-features", "gix-hash", "gix-transport", + "gix-utils", "maybe-async", "thiserror", - "winnow 0.5.40", + "winnow 0.6.5", ] [[package]] name = "gix-quote" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7dc10303d73a960d10fb82f81188b036ac3e6b11b5795b20b1a60b51d1321f" +checksum = "4d1b102957d975c6eb56c2b7ad9ac7f26d117299b910812b2e9bf086ec43496d" dependencies = [ "bstr", - "btoi", + "gix-utils", "thiserror", ] @@ -1826,9 +1826,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.10.4" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8d9bf462feaf05f2121cba7399dbc6c34d88a9cad58fc1e95027791d6a3c6d2" +checksum = "022592a0334bdf77c18c06e12a7c0eaff28845c37e73c51a3e37d56dd495fb35" dependencies = [ "bitflags 2.4.2", "gix-path", @@ -1872,9 +1872,9 @@ checksum = "02b202d766a7fefc596e2cc6a89cda8ad8ad733aed82da635ac120691112a9b1" [[package]] name = "gix-transport" -version = "0.41.0" +version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58aba2869cc38937bc834b068c93e09e2ab1119bac626f0464d100c1438b799a" +checksum = "3823a4527c0c2b5b1ef217da6c092d820976b5487626117ffb1bcc18b6d4f810" dependencies = [ "base64", "bstr", @@ -1907,9 +1907,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.27.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f1981ecc700f4fd73ae62b9ca2da7c8816c8fd267f0185e3f8c21e967984ac" +checksum = "34db38a818cda121a8b9fea119e1136ba7fb4021b89f30a3449e9873bff84fe8" dependencies = [ "bstr", "gix-features", @@ -1921,9 +1921,9 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e839f3d0798b296411263da6bee780a176ef8008a5dfc31287f7eda9266ab8" +checksum = "60157a15b9f14b11af1c6817ad7a93b10b50b4e5136d98a127c46a37ff16eeb6" dependencies = [ "fastrand 2.0.1", "unicode-normalization", @@ -2086,9 +2086,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.3.6" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd5256b483761cd23699d0da46cc6fd2ee3be420bbe6d020ae4a091e70b7e9fd" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hickory-proto" @@ -2283,9 +2283,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.3" +version = "2.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "233cf39063f058ea2caae4091bf4a3ef70a653afbc026f5c4a4135d114e3c177" +checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" dependencies = [ "equivalent", "hashbrown", @@ -2416,7 +2416,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -2480,9 +2480,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" [[package]] name = "lru-cache" @@ -2518,7 +2518,7 @@ checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -2578,7 +2578,7 @@ checksum = "f301c3f54f98abc6c212ee722f5e5c62e472a334415840669e356f04850051ec" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -2785,7 +2785,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -2882,7 +2882,7 @@ checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -3039,9 +3039,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7237101a77a10773db45d62004a272517633fbcc3df19d96455ede1122e051" +checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" dependencies = [ "either", "rayon-core", @@ -3399,7 +3399,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -3533,12 +3533,12 @@ checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" [[package]] name = "socket2" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3581,7 +3581,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -3618,9 +3618,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.50" +version = "2.0.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" +checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" dependencies = [ "proc-macro2", "quote", @@ -3662,9 +3662,9 @@ checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" [[package]] name = "tempfile" -version = "3.10.0" +version = "3.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a365e8cd18e44762ef95d87f284f4b5cd04107fec2ff3052bd6a3e6069669e67" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", "fastrand 2.0.1", @@ -3710,7 +3710,7 @@ checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -3797,7 +3797,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -3903,7 +3903,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.2", + "winnow 0.6.5", ] [[package]] @@ -3932,7 +3932,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", ] [[package]] @@ -4170,7 +4170,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", "wasm-bindgen-shared", ] @@ -4204,7 +4204,7 @@ checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn 2.0.52", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4310,7 +4310,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ "windows-core 0.52.0", - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -4320,7 +4320,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "efc5cf48f83140dcaab716eeaea345f9e93d0018fb81162753a3f76c3397b538" dependencies = [ "windows-core 0.53.0", - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -4329,7 +4329,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -4339,7 +4339,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9dcc5b895a6377f1ab9fa55acedab1fd5ac0db66ad1e6c7f47e28a22e446a5dd" dependencies = [ "windows-result", - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -4372,7 +4372,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd19df78e5168dfb0aedc343d1d1b8d422ab2db6756d2dc3fef75035402a3f64" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -4390,7 +4390,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.3", + "windows-targets 0.52.4", ] [[package]] @@ -4410,17 +4410,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d380ba1dc7187569a8a9e91ed34b8ccfc33123bbacb8c0aed2d1ad7f3ef2dc5f" +checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" dependencies = [ - "windows_aarch64_gnullvm 0.52.3", - "windows_aarch64_msvc 0.52.3", - "windows_i686_gnu 0.52.3", - "windows_i686_msvc 0.52.3", - "windows_x86_64_gnu 0.52.3", - "windows_x86_64_gnullvm 0.52.3", - "windows_x86_64_msvc 0.52.3", + "windows_aarch64_gnullvm 0.52.4", + "windows_aarch64_msvc 0.52.4", + "windows_i686_gnu 0.52.4", + "windows_i686_msvc 0.52.4", + "windows_x86_64_gnu 0.52.4", + "windows_x86_64_gnullvm 0.52.4", + "windows_x86_64_msvc 0.52.4", ] [[package]] @@ -4431,9 +4431,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68e5dcfb9413f53afd9c8f86e56a7b4d86d9a2fa26090ea2dc9e40fba56c6ec6" +checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" [[package]] name = "windows_aarch64_msvc" @@ -4449,9 +4449,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dab469ebbc45798319e69eebf92308e541ce46760b49b18c6b3fe5e8965b30f" +checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" [[package]] name = "windows_i686_gnu" @@ -4467,9 +4467,9 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a4e9b6a7cac734a8b4138a4e1044eac3404d8326b6c0f939276560687a033fb" +checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" [[package]] name = "windows_i686_msvc" @@ -4485,9 +4485,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b0ec9c422ca95ff34a78755cfa6ad4a51371da2a5ace67500cf7ca5f232c58" +checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" [[package]] name = "windows_x86_64_gnu" @@ -4503,9 +4503,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "704131571ba93e89d7cd43482277d6632589b18ecf4468f591fbae0a8b101614" +checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" [[package]] name = "windows_x86_64_gnullvm" @@ -4515,9 +4515,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42079295511643151e98d61c38c0acc444e52dd42ab456f7ccfd5152e8ecf21c" +checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" [[package]] name = "windows_x86_64_msvc" @@ -4533,9 +4533,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.3" +version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0770833d60a970638e989b3fa9fd2bb1aaadcf88963d1659fd7d9990196ed2d6" +checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winnow" @@ -4548,9 +4548,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.2" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a4191c47f15cc3ec71fcb4913cb83d58def65dd3787610213c649283b5ce178" +checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" dependencies = [ "memchr", ] From 1fd99af959d0ec3357fb0a722a695a176f8ca2d8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 2 Mar 2024 15:11:52 +1100 Subject: [PATCH 1676/2020] build(deps): bump the deps group with 3 updates (#1637) Bumps the deps group with 3 updates: [reflink-copy](https://github.com/cargo-bins/reflink-copy), [windows](https://github.com/microsoft/windows-rs) and [fs4](https://github.com/al8n/fs4-rs). Updates `reflink-copy` from 0.1.14 to 0.1.15 - [Release notes](https://github.com/cargo-bins/reflink-copy/releases) - [Commits](https://github.com/cargo-bins/reflink-copy/compare/0.1.14...0.1.15) Updates `windows` from 0.53.0 to 0.54.0 - [Release notes](https://github.com/microsoft/windows-rs/releases) - [Commits](https://github.com/microsoft/windows-rs/compare/0.53.0...0.54.0) Updates `fs4` from 0.7.0 to 0.8.0 - [Release notes](https://github.com/al8n/fs4-rs/releases) - [Commits](https://github.com/al8n/fs4-rs/commits) --- updated-dependencies: - dependency-name: reflink-copy dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: windows dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: fs4 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 43 ++++++++------------------- crates/atomic-file-install/Cargo.toml | 4 +-- crates/fs-lock/Cargo.toml | 2 +- 3 files changed, 15 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 53aa2203..68e80317 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -160,7 +160,7 @@ dependencies = [ "reflink-copy", "tempfile", "tracing", - "windows 0.53.0", + "windows 0.54.0", ] [[package]] @@ -1081,12 +1081,12 @@ dependencies = [ [[package]] name = "fs4" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29f9df8a11882c4e3335eb2d18a0137c505d9ca927470b0cac9c6f0ae07d28f7" +checksum = "3d15c33be2d8e5bc0e6229c8c20905d69d6074c92c64c9b3485560b6d6dc1b68" dependencies = [ "rustix", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -3088,13 +3088,13 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "767be24c0da52e7448d495b8d162506a9aa125426651d547d545d6c2b4b65b62" +checksum = "52b1349400e2ffd64a9fb5ed9008e33c0b8ef86bd5bae8f73080839c7082f1d5" dependencies = [ "cfg-if", "rustix", - "windows 0.52.0", + "windows 0.54.0", ] [[package]] @@ -4305,38 +4305,19 @@ dependencies = [ [[package]] name = "windows" -version = "0.52.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" dependencies = [ - "windows-core 0.52.0", - "windows-targets 0.52.4", -] - -[[package]] -name = "windows" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efc5cf48f83140dcaab716eeaea345f9e93d0018fb81162753a3f76c3397b538" -dependencies = [ - "windows-core 0.53.0", + "windows-core", "windows-targets 0.52.4", ] [[package]] name = "windows-core" -version = "0.52.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.4", -] - -[[package]] -name = "windows-core" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dcc5b895a6377f1ab9fa55acedab1fd5ac0db66ad1e6c7f47e28a22e446a5dd" +checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" dependencies = [ "windows-result", "windows-targets 0.52.4", diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index f2715770..a27cb7bd 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -10,9 +10,9 @@ license = "Apache-2.0 OR MIT" rust-version = "1.65.0" [dependencies] -reflink-copy = "0.1.7" +reflink-copy = "0.1.15" tempfile = "3.5.0" tracing = "0.1.39" [target.'cfg(windows)'.dependencies] -windows = { version = "0.53.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } +windows = { version = "0.54.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 660ad260..69391c6f 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -10,4 +10,4 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -fs4 = "0.7.0" +fs4 = "0.8.0" From 70a90ecb27500894b8f8fc9c38bb63ef4758a399 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Mar 2024 10:34:13 +1100 Subject: [PATCH 1677/2020] build(deps): bump mio from 0.8.10 to 0.8.11 (#1639) Bumps [mio](https://github.com/tokio-rs/mio) from 0.8.10 to 0.8.11. - [Release notes](https://github.com/tokio-rs/mio/releases) - [Changelog](https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md) - [Commits](https://github.com/tokio-rs/mio/compare/v0.8.10...v0.8.11) --- updated-dependencies: - dependency-name: mio dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 68e80317..da7f576d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2613,9 +2613,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" +checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "wasi", From 91cf432f876335a9f2feda4c6f87c87bae11b747 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 8 Mar 2024 03:33:12 +0000 Subject: [PATCH 1678/2020] dep: Upgrade transitive dependencies (#1640) Co-authored-by: github-actions --- Cargo.lock | 111 +++++++++++++++++++++++++++++------------------------ 1 file changed, 61 insertions(+), 50 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index da7f576d..a543c93d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -97,9 +97,9 @@ checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" [[package]] name = "arc-swap" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" +checksum = "7b3d0060af21e8d11a926981cc00c6c1541aa91dd64b9f881985c3da1094425f" [[package]] name = "arrayvec" @@ -455,9 +455,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.15.3" +version = "3.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea184aa71bb362a1157c896979544cc23974e08fd265f29ea96b59f0b4a555b" +checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" [[package]] name = "byteorder" @@ -575,9 +575,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.19.1" +version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dc9f7a067415ab5058020f04c60ec7b557084dbec0e021217bbabc7a8d38d14" +checksum = "a98356df42a2eb1bd8f1793ae4ee4de48e384dd974ce5eac8eee802edb7492be" dependencies = [ "serde", "toml", @@ -594,10 +594,11 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.88" +version = "1.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02f341c093d19155a6e41631ce5971aac4e9a868262212153124c15fa22d1cdc" +checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" dependencies = [ + "jobserver", "libc", ] @@ -609,9 +610,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.1" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c918d541ef2913577a0f9566e9ce27cb35b6df072075769e0b26cb5a554520da" +checksum = "b230ab84b0ffdf890d5a10abdbc8b83ae1c4918275daea1ab8801f71536b2651" dependencies = [ "clap_builder", "clap_derive", @@ -619,9 +620,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.1" +version = "4.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3e7391dad68afb0c2ede1bf619f579a3dc9c2ec67f089baa397123a2f3d1eb" +checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" dependencies = [ "anstream", "anstyle", @@ -919,16 +920,16 @@ checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" [[package]] name = "embed-resource" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bde55e389bea6a966bd467ad1ad7da0ae14546a5bc794d16d1e55e7fca44881" +checksum = "c6985554d0688b687c5cb73898a34fbe3ad6c24c58c238a4d91d5e840670ee9d" dependencies = [ "cc", "memchr", "rustc_version", "toml", "vswhom", - "winreg 0.51.0", + "winreg 0.52.0", ] [[package]] @@ -2172,9 +2173,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -2350,10 +2351,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] -name = "jobslot" -version = "0.2.15" +name = "jobserver" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e21650a7eb4eb51339b77d6c015e8fcba5966ed2deea61df6cc653241be77fc" +checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +dependencies = [ + "libc", +] + +[[package]] +name = "jobslot" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4038586dc6dc27b600cb9e829fc7fa242623a0cf652c63c76aa6c7e862aa74d8" dependencies = [ "cfg-if", "getrandom", @@ -2365,9 +2375,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "406cda4b368d531c842222cf9d2600a9a4acce8d29423695379c6868a143a9ee" +checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" dependencies = [ "wasm-bindgen", ] @@ -2553,12 +2563,13 @@ dependencies = [ [[package]] name = "miette" -version = "7.1.0" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baed61d13cc3723ee6dbed730a82bfacedc60a85d81da2d77e9c3e8ebc0b504a" +checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" dependencies = [ "backtrace", "backtrace-ext", + "cfg-if", "miette-derive", "owo-colors", "supports-color", @@ -2572,9 +2583,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "7.1.0" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301c3f54f98abc6c212ee722f5e5c62e472a334415840669e356f04850051ec" +checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ "proc-macro2", "quote", @@ -2867,18 +2878,18 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0302c4a0442c456bd56f841aee5c3bfd17967563f6fadc9ceb9f9c23cf3807e0" +checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.4" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266c042b60c9c76b8d53061e52b2e0d1116abc57cefc8c5cd671619a56ac3690" +checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", @@ -3111,9 +3122,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" dependencies = [ "aho-corasick", "memchr", @@ -4126,9 +4137,9 @@ dependencies = [ [[package]] name = "walkdir" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d71d857dc86794ca4c280d616f7da00d2dbfd8cd788846559a6813e6aa4b54ee" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" dependencies = [ "same-file", "winapi-util", @@ -4151,9 +4162,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1e124130aee3fb58c5bdd6b639a0509486b0338acaaae0c84a5124b0f588b7f" +checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -4161,9 +4172,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9e7e1900c352b609c8488ad12639a311045f40a35491fb69ba8c12f758af70b" +checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" dependencies = [ "bumpalo", "log", @@ -4176,9 +4187,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.41" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877b9c3f61ceea0e56331985743b13f3d25c406a7098d45180fb5f09bc19ed97" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -4188,9 +4199,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30af9e2d358182b5c7449424f017eba305ed32a7010509ede96cdc4696c46ed" +checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4198,9 +4209,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642f325be6301eb8107a83d12a8ac6c1e1c54345a7ef1a9261962dfefda09e66" +checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", @@ -4211,9 +4222,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.91" +version = "0.2.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f186bd2dcf04330886ce82d6f33dd75a7bfcf69ecf5763b89fcde53b6ac9838" +checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" [[package]] name = "wasm-streams" @@ -4230,9 +4241,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.68" +version = "0.3.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96565907687f7aceb35bc5fc03770a8a0471d82e479f25832f54a0e3f4b28446" +checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" dependencies = [ "js-sys", "wasm-bindgen", @@ -4548,9 +4559,9 @@ dependencies = [ [[package]] name = "winreg" -version = "0.51.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "937f3df7948156640f46aacef17a70db0de5917bda9c92b0f751f3a955b588fc" +checksum = "a277a57398d4bfa075df44f501a17cfdf8542d224f0d36095a2adc7aee4ef0a5" dependencies = [ "cfg-if", "windows-sys 0.48.0", From fda8f98cdf754ba087cca388dd2fc7a0aec46479 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 9 Mar 2024 01:55:36 +0000 Subject: [PATCH 1679/2020] build(deps): bump the deps group with 2 updates (#1641) Bumps the deps group with 2 updates: [reqwest](https://github.com/seanmonstar/reqwest) and [fs4](https://github.com/al8n/fs4-rs). Updates `reqwest` from 0.11.24 to 0.11.25 - [Release notes](https://github.com/seanmonstar/reqwest/releases) - [Changelog](https://github.com/seanmonstar/reqwest/blob/master/CHANGELOG.md) - [Commits](https://github.com/seanmonstar/reqwest/compare/v0.11.24...v0.11.25) Updates `fs4` from 0.8.0 to 0.8.1 - [Release notes](https://github.com/al8n/fs4-rs/releases) - [Commits](https://github.com/al8n/fs4-rs/commits) --- updated-dependencies: - dependency-name: reqwest dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: fs4 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 35 +++++++++++++++++++++------ crates/binstalk-downloader/Cargo.toml | 2 +- crates/fs-lock/Cargo.toml | 2 +- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a543c93d..d2851d5f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -814,7 +814,7 @@ dependencies = [ "netlink-packet-route", "netlink-sys", "once_cell", - "system-configuration", + "system-configuration 0.5.1", "windows 0.48.0", ] @@ -1082,9 +1082,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d15c33be2d8e5bc0e6229c8c20905d69d6074c92c64c9b3485560b6d6dc1b68" +checksum = "57b1e34e369d7f0151309821497440bd0266b86c77ccd69717c3b67e5eaeffe4" dependencies = [ "rustix", "windows-sys 0.52.0", @@ -3139,9 +3139,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.24" +version = "0.11.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6920094eb85afde5e4a138be3f2de8bbdf28000f0029e72c45025a56b042251" +checksum = "0eea5a9eb898d3783f17c6407670e3592fd174cb81a10e51d4c37f49450b9946" dependencies = [ "async-compression", "base64", @@ -3174,7 +3174,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration", + "system-configuration 0.6.0", "tokio", "tokio-native-tls", "tokio-rustls", @@ -3652,7 +3652,18 @@ checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", "core-foundation", - "system-configuration-sys", + "system-configuration-sys 0.5.0", +] + +[[package]] +name = "system-configuration" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658bc6ee10a9b4fcf576e9b0819d95ec16f4d2c02d39fd83ac1c8789785c4a42" +dependencies = [ + "bitflags 2.4.2", + "core-foundation", + "system-configuration-sys 0.6.0", ] [[package]] @@ -3665,6 +3676,16 @@ dependencies = [ "libc", ] +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "target-lexicon" version = "0.12.14" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 9b403a5a..88bdd585 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -21,7 +21,7 @@ flate2 = { version = "1.0.28", default-features = false } futures-util = "0.3.30" futures-io = "0.3.30" httpdate = "1.0.2" -reqwest = { version = "0.11.19", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } +reqwest = { version = "0.11.25", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } percent-encoding = "2.2.0" serde = { version = "1.0.163", features = ["derive"], optional = true } serde-tuple-vec-map = "1.0.1" diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 69391c6f..890b0bff 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -10,4 +10,4 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -fs4 = "0.8.0" +fs4 = "0.8.1" From a5e534224c399f1bfc2e6250674edef3b222e75c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 9 Mar 2024 14:33:43 +1100 Subject: [PATCH 1680/2020] release: binstalk-downloader v0.10.1 (#1644) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d2851d5f..b34eb357 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -260,7 +260,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.10.0" +version = "0.10.1" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 88bdd585..e3d379b6 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.10.0" +version = "0.10.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 55b58d19..87b26557 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.10.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } @@ -30,7 +30,7 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.10.1", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 41f96d03..e2907404 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader", default-features = false, features = ["json"] } +binstalk-downloader = { version = "0.10.1", path = "../binstalk-downloader", default-features = false, features = ["json"] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "5.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } @@ -35,7 +35,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.4", features = ["serde"] } -binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } +binstalk-downloader = { version = "0.10.1", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } [features] git = ["simple-git"] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 5a7072e9..b57fe60b 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.10.0", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.10.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-fetchers = { version = "0.4.0", path = "../binstalk-fetchers", features = ["quickinstall"] } binstalk-registry = { version = "0.7.0", path = "../binstalk-registry" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } From 3d2f72a8c5afdb1d4f7950ea29ee794569b1180a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 9 Mar 2024 14:33:48 +1100 Subject: [PATCH 1681/2020] release: atomic-file-install v1.0.2 (#1643) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/atomic-file-install/Cargo.toml | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b34eb357..1aac03e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -155,7 +155,7 @@ dependencies = [ [[package]] name = "atomic-file-install" -version = "1.0.1" +version = "1.0.2" dependencies = [ "reflink-copy", "tempfile", diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index a27cb7bd..8e4f5810 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "atomic-file-install" -version = "1.0.1" +version = "1.0.2" edition = "2021" description = "For atomically installing a file or a symlink." repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 42ef86cd..1a920595 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -11,7 +11,7 @@ authors = ["Jiahao XU "] license = "GPL-3.0-only" [dependencies] -atomic-file-install = { version = "1.0.1", path = "../atomic-file-install" } +atomic-file-install = { version = "1.0.2", path = "../atomic-file-install" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } leon = "3.0.0" From 6d3dcadfee5d9f6bc47cf451cecef76f4b31ee4d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 9 Mar 2024 14:33:53 +1100 Subject: [PATCH 1682/2020] release: fs-lock v0.1.3 (#1642) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/fs-lock/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1aac03e6..8eb1e4f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1075,7 +1075,7 @@ dependencies = [ [[package]] name = "fs-lock" -version = "0.1.2" +version = "0.1.3" dependencies = [ "fs4", ] diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 3ce73f46..85dfe070 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" beef = { version = "0.5.2", features = ["impl_serde"] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } -fs-lock = { version = "0.1.2", path = "../fs-lock" } +fs-lock = { version = "0.1.3", path = "../fs-lock" } home = "0.5.9" miette = "7.0.0" semver = { version = "1.0.17", features = ["serde"] } diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 890b0bff..00be6e48 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -3,7 +3,7 @@ name = "fs-lock" description = "Locked files that can be used like normal File" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/fs-lock" -version = "0.1.2" +version = "0.1.3" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From be2934e283ac6e66ff78587cad1f2422e8162fc9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 9 Mar 2024 16:28:33 +1100 Subject: [PATCH 1683/2020] release: cargo-binstall v1.6.4 (#1645) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8eb1e4f3..5bd816fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -509,7 +509,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.6.3" +version = "1.6.4" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 9ec564fb..d8588fa1 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.6.3" +version = "1.6.4" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 8a0dd0ff..cddd6f98 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From cf2473129b56806bdcbe07a6dd1b61ca33fc6c23 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 12 Mar 2024 13:11:47 +1100 Subject: [PATCH 1684/2020] build(deps): bump mathieudutour/github-tag-action from 6.1 to 6.2 (#1646) Bumps [mathieudutour/github-tag-action](https://github.com/mathieudutour/github-tag-action) from 6.1 to 6.2. - [Release notes](https://github.com/mathieudutour/github-tag-action/releases) - [Commits](https://github.com/mathieudutour/github-tag-action/compare/v6.1...v6.2) --- updated-dependencies: - dependency-name: mathieudutour/github-tag-action dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release-cli.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 3340b4ca..5dc4ca4f 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -24,7 +24,7 @@ jobs: - uses: actions/checkout@v4 - if: fromJSON(inputs.info).is-release == 'true' name: Push cli release tag - uses: mathieudutour/github-tag-action@v6.1 + uses: mathieudutour/github-tag-action@v6.2 with: github_token: ${{ secrets.GITHUB_TOKEN }} custom_tag: ${{ fromJSON(inputs.info).version }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c3d85d87..997fc89f 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,7 +32,7 @@ jobs: - uses: actions/checkout@v4 - name: Push lib release tag if: needs.info.outputs.crate != 'cargo-binstall' - uses: mathieudutour/github-tag-action@v6.1 + uses: mathieudutour/github-tag-action@v6.2 with: github_token: ${{ secrets.GITHUB_TOKEN }} custom_tag: ${{ needs.info.outputs.version }} From 6b95a97e15d12729d1d15fc2d76313d93be18151 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 15 Mar 2024 09:26:01 +0000 Subject: [PATCH 1685/2020] dep: Upgrade transitive dependencies (#1647) Co-authored-by: github-actions --- Cargo.lock | 192 +++++++++++++++++++++++------------------------------ 1 file changed, 84 insertions(+), 108 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5bd816fa..a9a84b2d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -91,9 +91,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.80" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ad32ce52e4161730f7098c077cd2ed6229b5804ccf99e5366be1ab72a98b4e1" +checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" [[package]] name = "arc-swap" @@ -335,7 +335,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror", - "toml_edit 0.22.6", + "toml_edit 0.22.7", "url", ] @@ -361,7 +361,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", - "toml_edit 0.22.6", + "toml_edit 0.22.7", "tracing", "url", ] @@ -814,15 +814,15 @@ dependencies = [ "netlink-packet-route", "netlink-sys", "once_cell", - "system-configuration 0.5.1", + "system-configuration", "windows 0.48.0", ] [[package]] name = "deflate64" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9576c1de19747eb6f5efb6a806c3e836512bbdb17bfedc984ccb0bcc953c8390" +checksum = "83ace6c86376be0b6cdcf3fb41882e81d94b31587573d1cfa9d01cd06bba210d" [[package]] name = "deranged" @@ -995,9 +995,6 @@ name = "faster-hex" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2a2b11eda1d40935b26cf18f6833c526845ae8c41e58d09af6adeb6f0269183" -dependencies = [ - "serde", -] [[package]] name = "fastrand" @@ -1289,9 +1286,9 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.22.1" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a3d3143c52cb90a4e45ac9f36ad3d458768ac4479f5f4a9f4723ee776bf87b1" +checksum = "eefb48f42eac136a4a0023f49a54ec31be1c7a9589ed762c45dcb9b953f7ecc8" dependencies = [ "bstr", "gix-glob", @@ -1306,27 +1303,27 @@ dependencies = [ [[package]] name = "gix-bitmap" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b6cd0f246180034ddafac9b00a112f19178135b21eb031b3f79355891f7325" +checksum = "a371db66cbd4e13f0ed9dc4c0fea712d7276805fccc877f77e96374d317e87ae" dependencies = [ "thiserror", ] [[package]] name = "gix-chunk" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "003ec6deacf68076a0c157271a127e0bb2c031c1a41f7168cbe5d248d9b85c78" +checksum = "45c8751169961ba7640b513c3b24af61aa962c967aaf04116734975cd5af0c52" dependencies = [ "thiserror", ] [[package]] name = "gix-command" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fbea18732d602afc6daa73657c07d8cc0bcb3ff50872de1be5c8706954137fc" +checksum = "f90009020dc4b3de47beed28e1334706e0a330ddd17f5cfeb097df3b15a54b77" dependencies = [ "bstr", "gix-path", @@ -1336,9 +1333,9 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b27bf9d74c34eca0c5c676087b7309ea5b362809ebcaf7eb90c38b547dac3e9f" +checksum = "f7b102311085da4af18823413b5176d7c500fb2272eaf391cfa8635d8bcb12c4" dependencies = [ "bstr", "gix-chunk", @@ -1371,9 +1368,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.5" +version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74ab5d22bc21840f4be0ba2e78df947ba14d8ba6999ea798f86b5bdb999edd0c" +checksum = "fbd06203b1a9b33a78c88252a625031b094d9e1b647260070c25b09910c0a804" dependencies = [ "bitflags 2.4.2", "bstr", @@ -1384,9 +1381,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c14f8f9c829ad863d29edeb09f495c1bdfd757204a6ff17ea22c1e2ce8748de" +checksum = "5c70146183bd3c7119329a3c7392d1aa0e0adbe48d727f4df31828fe6d8fdaa1" dependencies = [ "bstr", "gix-command", @@ -1401,9 +1398,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17077f0870ac12b55d2eed9cb3f56549e40def514c8a783a0a79177a8a76b7c5" +checksum = "180b130a4a41870edfbd36ce4169c7090bca70e195da783dea088dd973daa59c" dependencies = [ "bstr", "itoa", @@ -1441,9 +1438,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.38.0" +version = "0.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "184f7f7d4e45db0e2a362aeaf12c06c5e84817d0ef91d08e8e90170dad9f0b07" +checksum = "db4254037d20a247a0367aa79333750146a369719f0c6617fec4f5752cc62b37" dependencies = [ "bytes", "bytesize", @@ -1487,9 +1484,9 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4436e883d5769f9fb18677b8712b49228357815f9e4104174a6fc2d8461a437b" +checksum = "634b8a743b0aae03c1a74ee0ea24e8c5136895efac64ce52b3ea106e1c6f0613" dependencies = [ "gix-features", "gix-utils", @@ -1497,9 +1494,9 @@ dependencies = [ [[package]] name = "gix-glob" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c050a43e4e5601c99af40d7613957698e7a90a5b33f2a319c3842f9f9dc48b" +checksum = "682bdc43cb3c00dbedfcc366de2a849b582efd8d886215dbad2ea662ec156bb5" dependencies = [ "bitflags 2.4.2", "bstr", @@ -1509,9 +1506,9 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.14.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0ed89cdc1dce26685c80271c4287077901de3c3dd90234d5fa47c22b2268653" +checksum = "f93d7df7366121b5018f947a04d37f034717e113dcf9ccd85c34b58e57a74d5e" dependencies = [ "faster-hex", "thiserror", @@ -1519,9 +1516,9 @@ dependencies = [ [[package]] name = "gix-hashtable" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebe47d8c0887f82355e2e9e16b6cecaa4d5e5346a7a474ca78ff94de1db35a5b" +checksum = "7ddf80e16f3c19ac06ce415a38b8591993d3f73aede049cb561becb5b3a8e242" dependencies = [ "gix-hash", "hashbrown", @@ -1530,9 +1527,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0b7b0ecaa005f4c1ae7a8581c5e0f1311f77c5eb77b7bfb605424043861b81f" +checksum = "640dbeb4f5829f9fc14d31f654a34a0350e43a24e32d551ad130d99bf01f63f1" dependencies = [ "bstr", "gix-glob", @@ -1568,9 +1565,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "13.1.0" +version = "13.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "886490a07b1d6433aa91262a99d430a91cc8b9a1f758ac1282e132f1098a9342" +checksum = "e7c359f81f01b8352063319bcb39789b7ea0887b406406381106e38c4a34d049" dependencies = [ "gix-tempfile", "gix-utils", @@ -1579,9 +1576,9 @@ dependencies = [ [[package]] name = "gix-macros" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75e7ab728059f595f6ddc1ad8771b8d6a231971ae493d9d5948ecad366ee8bb" +checksum = "1dff438f14e67e7713ab9332f5fd18c8f20eb7eb249494f6c2bf170522224032" dependencies = [ "proc-macro2", "quote", @@ -1666,9 +1663,9 @@ dependencies = [ [[package]] name = "gix-packetline" -version = "0.17.3" +version = "0.17.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09ff45eef7747bde4986429a3e813478d50c2688b8f239e57bd3aa81065b285f" +checksum = "9ea5cd2b8ecbab2f3a2133686bf241dfc947a744347cfac8806c4ae5769ab931" dependencies = [ "bstr", "faster-hex", @@ -1690,9 +1687,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69e0b521a5c345b7cd6a81e3e6f634407360a038c8b74ba14c621124304251b8" +checksum = "23623cf0f475691a6d943f898c4d0b89f5c1a2a64d0f92bce0e0322ee6528783" dependencies = [ "bstr", "gix-trace", @@ -1718,9 +1715,9 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c04122ecca9079c27f6cd256cacbec1326b9c947d46d66ff8fb0d00e931656a1" +checksum = "f5325eb17ce7b5e5d25dec5c2315d642a09d55b9888b3bf46b7d72e1621a55d8" dependencies = [ "gix-command", "gix-config-value", @@ -1731,9 +1728,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.44.1" +version = "0.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23a6bddf10ea18f6a804a81ad22741b08cb74fd4469be63a2b1b93f66ce1d238" +checksum = "a905cd00946ed8ed6f4f2281f98a889c5b3d38361cd94b8d5a5771d25ab33b99" dependencies = [ "bstr", "gix-credentials", @@ -1749,9 +1746,9 @@ dependencies = [ [[package]] name = "gix-quote" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d1b102957d975c6eb56c2b7ad9ac7f26d117299b910812b2e9bf086ec43496d" +checksum = "cbff4f9b9ea3fa7a25a70ee62f545143abef624ac6aa5884344e70c8b0a1d9ff" dependencies = [ "bstr", "gix-utils", @@ -1827,9 +1824,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "022592a0334bdf77c18c06e12a7c0eaff28845c37e73c51a3e37d56dd495fb35" +checksum = "fddc27984a643b20dd03e97790555804f98cf07404e0e552c0ad8133266a79a1" dependencies = [ "bitflags 2.4.2", "gix-path", @@ -1854,9 +1851,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "13.1.0" +version = "13.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439f4da9657aec7434cde3c2510dcdb0a35f2031233ff67ae986269c788966d7" +checksum = "a761d76594f4443b675e85928e4902dec333273836bd386906f01e7e346a0d11" dependencies = [ "gix-fs", "libc", @@ -1867,15 +1864,15 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02b202d766a7fefc596e2cc6a89cda8ad8ad733aed82da635ac120691112a9b1" +checksum = "9b838b2db8f62c9447d483a4c28d251b67fee32741a82cb4d35e9eb4e9fdc5ab" [[package]] name = "gix-transport" -version = "0.41.1" +version = "0.41.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3823a4527c0c2b5b1ef217da6c092d820976b5487626117ffb1bcc18b6d4f810" +checksum = "cf8e5f72ec9cad9ee44714b9a4ec7427b540a2418b62111f5e3a715bebe1ed9d" dependencies = [ "base64", "bstr", @@ -1908,9 +1905,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.27.1" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34db38a818cda121a8b9fea119e1136ba7fb4021b89f30a3449e9873bff84fe8" +checksum = "8f0b24f3ecc79a5a53539de9c2e99425d0ef23feacdcf3faac983aa9a2f26849" dependencies = [ "bstr", "gix-features", @@ -1922,9 +1919,9 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60157a15b9f14b11af1c6817ad7a93b10b50b4e5136d98a127c46a37ff16eeb6" +checksum = "0066432d4c277f9877f091279a597ea5331f68ca410efc874f0bdfb1cd348f92" dependencies = [ "fastrand 2.0.1", "unicode-normalization", @@ -1932,9 +1929,9 @@ dependencies = [ [[package]] name = "gix-validate" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac7cc36f496bd5d96cdca0f9289bb684480725d40db60f48194aa7723b883854" +checksum = "e39fc6e06044985eac19dd34d474909e517307582e462b2eb4c8fa51b6241545" dependencies = [ "bstr", "thiserror", @@ -2938,9 +2935,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" dependencies = [ "unicode-ident", ] @@ -3139,9 +3136,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.25" +version = "0.11.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eea5a9eb898d3783f17c6407670e3592fd174cb81a10e51d4c37f49450b9946" +checksum = "78bf93c4af7a8bb7d879d51cebe797356ff10ae8516ace542b5182d9dcac10b2" dependencies = [ "async-compression", "base64", @@ -3174,7 +3171,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper", - "system-configuration 0.6.0", + "system-configuration", "tokio", "tokio-native-tls", "tokio-rustls", @@ -3578,15 +3575,15 @@ checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" [[package]] name = "strum" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "723b93e8addf9aa965ebe2d11da6d7540fa2283fcea14b3371ff055f7ba13f5f" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" [[package]] name = "strum_macros" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a3417fc93d76740d974a01654a09777cb500428cc874ca9f45edfe0c4d4cd18" +checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" dependencies = [ "heck", "proc-macro2", @@ -3652,18 +3649,7 @@ checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", "core-foundation", - "system-configuration-sys 0.5.0", -] - -[[package]] -name = "system-configuration" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bc6ee10a9b4fcf576e9b0819d95ec16f4d2c02d39fd83ac1c8789785c4a42" -dependencies = [ - "bitflags 2.4.2", - "core-foundation", - "system-configuration-sys 0.6.0", + "system-configuration-sys", ] [[package]] @@ -3676,16 +3662,6 @@ dependencies = [ "libc", ] -[[package]] -name = "system-configuration-sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" -dependencies = [ - "core-foundation-sys", - "libc", -] - [[package]] name = "target-lexicon" version = "0.12.14" @@ -3727,18 +3703,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e45bcbe8ed29775f228095caf2cd67af7a4ccf756ebff23a306bf3e8b47b24b" +checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.57" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a953cb265bef375dae3de6663da4d3804eee9682ea80d8e2542529b73c531c81" +checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", @@ -3854,9 +3830,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" dependencies = [ "futures-core", "pin-project-lite", @@ -3895,14 +3871,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.10" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a9aad4a3066010876e8dcf5a8a06e70a558751117a145c6ce2b82c2e2054290" +checksum = "af06656561d28735e9c1cd63dfd57132c8155426aa6af24f36a00a351f88c48e" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.6", + "toml_edit 0.22.7", ] [[package]] @@ -3927,9 +3903,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.6" +version = "0.22.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c1b5fd4128cc8d3e0cb74d4ed9a9cc7c7284becd4df68f5f940e1ad123606f6" +checksum = "18769cd1cec395d70860ceb4d932812a0b4d06b1a4bb336745a4d21b9496e992" dependencies = [ "indexmap", "serde", From 69a701d12e72f7c9f0a83e1602c34a9a2c10a007 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 16 Mar 2024 11:54:37 +1000 Subject: [PATCH 1686/2020] build(deps): bump the deps group with 2 updates (#1649) Bumps the deps group with 2 updates: [clap](https://github.com/clap-rs/clap) and [simple-git](https://github.com/cargo-bins/simple-git). Updates `clap` from 4.5.2 to 4.5.3 - [Release notes](https://github.com/clap-rs/clap/releases) - [Changelog](https://github.com/clap-rs/clap/blob/master/CHANGELOG.md) - [Commits](https://github.com/clap-rs/clap/compare/v4.5.2...v4.5.3) Updates `simple-git` from 0.2.3 to 0.2.4 - [Release notes](https://github.com/cargo-bins/simple-git/releases) - [Commits](https://github.com/cargo-bins/simple-git/commits/0.2.4) --- updated-dependencies: - dependency-name: clap dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: simple-git dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 180 ++++++++++++++++------------ crates/bin/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 109 insertions(+), 77 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a9a84b2d..1439ec94 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,18 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "ahash" +version = "0.8.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + [[package]] name = "aho-corasick" version = "1.1.2" @@ -41,6 +53,12 @@ dependencies = [ "alloc-no-stdlib", ] +[[package]] +name = "allocator-api2" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" + [[package]] name = "anstream" version = "0.6.13" @@ -444,15 +462,6 @@ dependencies = [ "serde", ] -[[package]] -name = "btoi" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dd6407f73a9b8b6162d8a2ef999fe6afd7cc15902ebf42c5cd296addf17e0ad" -dependencies = [ - "num-traits", -] - [[package]] name = "bumpalo" version = "3.15.4" @@ -610,9 +619,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.2" +version = "4.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b230ab84b0ffdf890d5a10abdbc8b83ae1c4918275daea1ab8801f71536b2651" +checksum = "949626d00e063efc93b6dca932419ceb5432f99769911c0b995f7e884c778813" dependencies = [ "clap_builder", "clap_derive", @@ -632,11 +641,11 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.0" +version = "4.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "307bc0538d5f0f83b8248db3087aa92fe504e4691294d0c96c0eabc33f47ba47" +checksum = "90239a040c80f5e14809ca132ddc4176ab33d5e17e49691793296e3fcb34d72f" dependencies = [ - "heck", + "heck 0.5.0", "proc-macro2", "quote", "syn 2.0.52", @@ -947,7 +956,7 @@ version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "syn 2.0.52", @@ -1218,9 +1227,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gix" -version = "0.58.0" +version = "0.60.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31887c304d9a935f3e5494fb5d6a0106c34e965168ec0db9b457424eedd0c741" +checksum = "027b87106e07ab0965541f71dadd7db87be3f2b26feda3cce50028566a4dff0c" dependencies = [ "gix-actor", "gix-attributes", @@ -1272,16 +1281,16 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a7bb9fad6125c81372987c06469601d37e1a2d421511adb69971b9083517a8a" +checksum = "3eb3230825b44deba727ec2e9c886c4ab350d34333ae17555973ceb5e5261471" dependencies = [ "bstr", - "btoi", "gix-date", + "gix-utils", "itoa", "thiserror", - "winnow 0.5.40", + "winnow 0.6.5", ] [[package]] @@ -1347,9 +1356,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.34.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e62bf2073b6ce3921ffa6d8326f645f30eec5fc4a8e8a4bc0fcb721a2f3f69dc" +checksum = "62129c75e4b6229fe15fb9838cdc00c655e87105b651e4edd7c183fc5288b5d1" dependencies = [ "bstr", "gix-config-value", @@ -1363,7 +1372,7 @@ dependencies = [ "smallvec", "thiserror", "unicode-bom", - "winnow 0.5.40", + "winnow 0.6.5", ] [[package]] @@ -1410,9 +1419,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.40.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdcb5e49c4b9729dd1c361040ae5c3cd7c497b2260b18c954f62db3a63e98cf" +checksum = "78e605593c2ef74980a534ade0909c7dc57cca72baa30cbb67d2dda621f99ac4" dependencies = [ "bstr", "gix-hash", @@ -1422,9 +1431,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4669218f3ec0cbbf8f16857b32200890f8ca585f36f5817242e4115fe4551af" +checksum = "64bab49087ed3710caf77e473dc0efc54ca33d8ccc6441359725f121211482b1" dependencies = [ "bstr", "dunce", @@ -1463,9 +1472,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.9.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9240862840fb740d209422937195e129e4ed3da49af212383260134bea8f6c1a" +checksum = "bd71bf3e64d8fb5d5635d4166ca5a36fe56b292ffff06eab1d93ea47fd5beb89" dependencies = [ "bstr", "encoding_rs", @@ -1540,14 +1549,14 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7152181ba8f0a3addc5075dd612cea31fc3e252b29c8be8c45f4892bf87426" +checksum = "8b7e07051ef3db0b124e0065e14b04f275d91a320fb7fadc273422ca91b87282" dependencies = [ "bitflags 2.4.2", "bstr", - "btoi", "filetime", + "fnv", "gix-bitmap", "gix-features", "gix-fs", @@ -1555,6 +1564,8 @@ dependencies = [ "gix-lock", "gix-object", "gix-traverse", + "gix-utils", + "hashbrown", "itoa", "libc", "memmap2", @@ -1587,9 +1598,9 @@ dependencies = [ [[package]] name = "gix-negotiate" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a163adb84149e522e991cbe27250a6e01de56f98cd05b174614ce3f8a4e8b140" +checksum = "54ba98f8c8c06870dfc167d192ca38a38261867b836cb89ac80bc9176dba975e" dependencies = [ "bitflags 2.4.2", "gix-commitgraph", @@ -1603,28 +1614,28 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.41.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693ce9d30741506cb082ef2d8b797415b48e032cce0ab23eff894c19a7e4777b" +checksum = "03e9e56e790cdd548dee951019b4f0575a00cdd95092d34ceddeb3294b34ef08" dependencies = [ "bstr", - "btoi", "gix-actor", "gix-date", "gix-features", "gix-hash", + "gix-utils", "gix-validate", "itoa", "smallvec", "thiserror", - "winnow 0.5.40", + "winnow 0.6.5", ] [[package]] name = "gix-odb" -version = "0.57.0" +version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ba2fa9e81f2461b78b4d81a807867667326c84cdab48e0aed7b73a593aa1be4" +checksum = "81b55378c719693380f66d9dd21ce46721eed2981d8789fc698ec1ada6fa176e" dependencies = [ "arc-swap", "gix-date", @@ -1642,9 +1653,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.47.0" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da5f3e78c96b76c4e6fe5e8e06b76221e4a0ee9a255aa935ed1fdf68988dfd8" +checksum = "6391aeaa030ad64aba346a9f5c69bb1c4e5c6fb4411705b03b40b49d8614ec30" dependencies = [ "clru", "gix-chunk", @@ -1700,9 +1711,9 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cbd49750edb26b0a691e5246fc635fa554d344da825cd20fa9ee0da9c1b761f" +checksum = "9ca791acebbcb19703323c151115f029922fd8f91c5d187d50efbfe39447f6d8" dependencies = [ "bitflags 2.4.2", "bstr", @@ -1757,9 +1768,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.41.0" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5818958994ad7879fa566f5441ebcc48f0926aa027b28948e6fbf6578894dc31" +checksum = "fd4aba68b925101cb45d6df328979af0681364579db889098a0de75b36c77b65" dependencies = [ "gix-actor", "gix-date", @@ -1774,14 +1785,14 @@ dependencies = [ "gix-validate", "memmap2", "thiserror", - "winnow 0.5.40", + "winnow 0.6.5", ] [[package]] name = "gix-refspec" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613aa4d93034c5791d13bdc635e530f4ddab1412ddfb4a8215f76213177b61c7" +checksum = "dde848865834a54fe4d9b4573f15d0e9a68eaf3d061b42d3ed52b4b8acf880b2" dependencies = [ "bstr", "gix-hash", @@ -1793,9 +1804,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "288f6549d7666db74dc3f169a9a333694fc28ecd2f5aa7b2c979c89eb556751a" +checksum = "9e34196e1969bd5d36e2fbc4467d893999132219d503e23474a8ad2b221cb1e8" dependencies = [ "bstr", "gix-date", @@ -1809,9 +1820,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9b4d91dfc5c14fee61a28c65113ded720403b65a0f46169c0460f731a5d03c" +checksum = "e0a7d393ae814eeaae41a333c0ff684b243121cc61ccdc5bbe9897094588047d" dependencies = [ "gix-commitgraph", "gix-date", @@ -1836,9 +1847,9 @@ dependencies = [ [[package]] name = "gix-submodule" -version = "0.8.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73182f6c1f5ed1ed94ba16581ac62593d5e29cd1c028b2af618f836283b8f8d4" +checksum = "4fb7ea05666362472fecd44c1fc35fe48a5b9b841b431cc4f85b95e6f20c23ec" dependencies = [ "bstr", "gix-config", @@ -1889,9 +1900,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfc30c5b5e4e838683b59e1b0574ce6bc1c35916df9709aaab32bb7751daf08b" +checksum = "95aef84bc777025403a09788b1e4815c06a19332e9e5d87a955e1ed7da9bf0cf" dependencies = [ "gix-commitgraph", "gix-date", @@ -1939,9 +1950,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.30.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca36bb3dc54038c66507dc75c4d8edbee2d6d5cc45227b4eb508ad13dd60a006" +checksum = "fe78e03af9eec168eb187e05463a981c57f0a915f64b1788685a776bd2ef969c" dependencies = [ "bstr", "gix-attributes", @@ -1957,9 +1968,9 @@ dependencies = [ [[package]] name = "gix-worktree-state" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae178614b70bdb0c7f6f21b8c9fb711ab78bd7e8e1866f565fcf28876747f1d" +checksum = "565809f1694d70953c1524e687cd87b378f133c0af7af6e5813fc3c38b3aa25f" dependencies = [ "bstr", "gix-features", @@ -2075,6 +2086,10 @@ name = "hashbrown" version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +dependencies = [ + "ahash", + "allocator-api2", +] [[package]] name = "heck" @@ -2082,6 +2097,12 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + [[package]] name = "hermit-abi" version = "0.3.9" @@ -2727,15 +2748,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" -[[package]] -name = "num-traits" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" -dependencies = [ - "autocfg", -] - [[package]] name = "num_cpus" version = "1.16.0" @@ -3506,9 +3518,9 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d7883672e04f8375bd069217fa00b6b6e08372e558cbcf82d0037ab5b9a5165" +checksum = "bcc1f7191e80a2b1610f37c3cdc2410d776a1104a84ac645d311011883a55ddc" dependencies = [ "compact_str", "derive_destructure2", @@ -3585,7 +3597,7 @@ version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" dependencies = [ - "heck", + "heck 0.4.1", "proc-macro2", "quote", "rustversion", @@ -4593,6 +4605,26 @@ dependencies = [ "lzma-sys", ] +[[package]] +name = "zerocopy" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.7.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.52", +] + [[package]] name = "zstd" version = "0.13.0" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index d8588fa1..20b2f5ef 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -24,7 +24,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.22.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.13.0" } -clap = { version = "4.4.8", features = ["derive", "env"] } +clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" file-format = { version = "0.24.0", default-features = false } diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index e2907404..471d1c86 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -25,7 +25,7 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde_json = "1.0.107" sha2 = "0.10.7" -simple-git = { version = "0.2.2", optional = true } +simple-git = { version = "0.2.4", optional = true } tempfile = "3.5.0" thiserror = "1.0.52" tokio = { version = "1.35.0", features = ["rt", "sync"], default-features = false } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index b57fe60b..65bee22f 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ leon = "3.0.0" maybe-owned = "0.3.4" miette = "7.0.0" semver = { version = "1.0.17", features = ["serde"] } -simple-git = { version = "0.2.2", optional = true } +simple-git = { version = "0.2.4", optional = true } strum = "0.26.1" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" From 0e9e50569795561afcf19ea4efe03839273a6f40 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 19 Mar 2024 17:47:44 +1000 Subject: [PATCH 1687/2020] build(deps): bump geekyeggo/delete-artifact from 4 to 5 (#1650) Bumps [geekyeggo/delete-artifact](https://github.com/geekyeggo/delete-artifact) from 4 to 5. - [Release notes](https://github.com/geekyeggo/delete-artifact/releases) - [Changelog](https://github.com/GeekyEggo/delete-artifact/blob/main/CHANGELOG.md) - [Commits](https://github.com/geekyeggo/delete-artifact/compare/v4...v5) --- updated-dependencies: - dependency-name: geekyeggo/delete-artifact dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release-cli.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 5dc4ca4f..7e5f16ed 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -118,7 +118,7 @@ jobs: - if: fromJSON(inputs.info).is-release == 'true' name: Delete signing key artifact - uses: geekyeggo/delete-artifact@v4 + uses: geekyeggo/delete-artifact@v5 with: name: minisign.key.age failOnError: false From d76e2d8d779bb0800a199435eb7ede545e688145 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 22 Mar 2024 16:24:21 +1100 Subject: [PATCH 1688/2020] dep: Upgrade transitive dependencies (#1651) * dep: Upgrade transitive dependencies * Apply clippy suggestions * Apply clippy suggestion --------- Co-authored-by: github-actions Co-authored-by: Jiahao XU --- Cargo.lock | 145 +++++++++--------- .../src/crates_manifests.rs | 1 + crates/binstalk-registry/src/vfs.rs | 2 +- 3 files changed, 75 insertions(+), 73 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1439ec94..aa2eb1f5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -31,9 +31,9 @@ dependencies = [ [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] @@ -147,13 +147,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.77" +version = "0.1.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" +checksum = "461abc97219de0eaaf81fe3ef974a540158f3d079c2ab200f891f1a2ef201e85" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.53", ] [[package]] @@ -189,9 +189,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "95d8e92cac0961e91dbd517496b00f7e9b92363dbe6d42c3198268323798860c" dependencies = [ "addr2line", "cc", @@ -353,7 +353,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror", - "toml_edit 0.22.7", + "toml_edit 0.22.9", "url", ] @@ -379,7 +379,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", - "toml_edit 0.22.7", + "toml_edit 0.22.9", "tracing", "url", ] @@ -417,9 +417,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" [[package]] name = "block-buffer" @@ -432,9 +432,9 @@ dependencies = [ [[package]] name = "brotli" -version = "3.4.0" +version = "3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "516074a47ef4bce09577a3b379392300159ce5b1ba2e501ff1c819950066100f" +checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -547,9 +547,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "694c8807f2ae16faecc43dc17d74b3eb042482789fd0eb64b39a2e04e087053f" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ "serde", ] @@ -648,7 +648,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.53", ] [[package]] @@ -844,13 +844,13 @@ dependencies = [ [[package]] name = "derive_destructure2" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac4b68190bad25c00b64ea19767b2321a037fc0e5bea7563d5d8e35e04b19c95" +checksum = "64b697ac90ff296f0fc031ee5a61c7ac31fb9fff50e3fb32873b09223613fc0c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.53", ] [[package]] @@ -959,7 +959,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.53", ] [[package]] @@ -1146,9 +1146,9 @@ checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" +checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ "fastrand 2.0.1", "futures-core", @@ -1165,7 +1165,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.53", ] [[package]] @@ -1281,9 +1281,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3eb3230825b44deba727ec2e9c886c4ab350d34333ae17555973ceb5e5261471" +checksum = "45c3a3bde455ad2ee8ba8a195745241ce0b770a8a26faae59fcf409d01b28c46" dependencies = [ "bstr", "gix-date", @@ -1381,7 +1381,7 @@ version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbd06203b1a9b33a78c88252a625031b094d9e1b647260070c25b09910c0a804" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "bstr", "gix-path", "libc", @@ -1507,7 +1507,7 @@ version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "682bdc43cb3c00dbedfcc366de2a849b582efd8d886215dbad2ea662ec156bb5" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "bstr", "gix-features", "gix-path", @@ -1549,11 +1549,11 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b7e07051ef3db0b124e0065e14b04f275d91a320fb7fadc273422ca91b87282" +checksum = "549621f13d9ccf325a7de45506a3266af0d08f915181c5687abb5e8669bfd2e6" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "bstr", "filetime", "fnv", @@ -1593,7 +1593,7 @@ checksum = "1dff438f14e67e7713ab9332f5fd18c8f20eb7eb249494f6c2bf170522224032" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.53", ] [[package]] @@ -1602,7 +1602,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54ba98f8c8c06870dfc167d192ca38a38261867b836cb89ac80bc9176dba975e" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "gix-commitgraph", "gix-date", "gix-hash", @@ -1614,9 +1614,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03e9e56e790cdd548dee951019b4f0575a00cdd95092d34ceddeb3294b34ef08" +checksum = "3d4f8efae72030df1c4a81d02dbe2348e748d9b9a11e108ed6efbd846326e051" dependencies = [ "bstr", "gix-actor", @@ -1711,11 +1711,11 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ca791acebbcb19703323c151115f029922fd8f91c5d187d50efbfe39447f6d8" +checksum = "1a96ed0e71ce9084a471fddfa74e842576a7cbf02fe8bd50388017ac461aed97" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "bstr", "gix-attributes", "gix-config-value", @@ -1839,7 +1839,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fddc27984a643b20dd03e97790555804f98cf07404e0e552c0ad8133266a79a1" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "gix-path", "libc", "windows-sys 0.52.0", @@ -2006,9 +2006,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.24" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2c4422095b67ee78da96fbb51a4cc413b3b25883c7717ff7ca1ab31022c9c9" +checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb" dependencies = [ "bytes", "fnv", @@ -2379,11 +2379,12 @@ dependencies = [ [[package]] name = "jobslot" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4038586dc6dc27b600cb9e829fc7fa242623a0cf652c63c76aa6c7e862aa74d8" +checksum = "0303fc691930667d6fd0b2cd194f9d6b37be3d890e0b89cf4a34e27231f35c4f" dependencies = [ "cfg-if", + "derive_destructure2", "getrandom", "libc", "scopeguard", @@ -2444,7 +2445,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.53", ] [[package]] @@ -2469,7 +2470,7 @@ version = "0.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "libc", "redox_syscall 0.4.1", ] @@ -2546,7 +2547,7 @@ checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.53", ] [[package]] @@ -2607,7 +2608,7 @@ checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.53", ] [[package]] @@ -2723,7 +2724,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cfg-if", "libc", ] @@ -2788,7 +2789,7 @@ version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "cfg-if", "foreign-types", "libc", @@ -2805,7 +2806,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.53", ] [[package]] @@ -2902,7 +2903,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.53", ] [[package]] @@ -3148,9 +3149,9 @@ checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "reqwest" -version = "0.11.26" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78bf93c4af7a8bb7d879d51cebe797356ff10ae8516ace542b5182d9dcac10b2" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "async-compression", "base64", @@ -3261,11 +3262,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.31" +version = "0.38.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea3e1a662af26cd7a3ba09c0297a31af215563ecf42817c98df621387f4e949" +checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.5.0", "errno 0.3.8", "libc", "linux-raw-sys", @@ -3419,7 +3420,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.53", ] [[package]] @@ -3541,9 +3542,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" [[package]] name = "smawk" @@ -3601,7 +3602,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.52", + "syn 2.0.53", ] [[package]] @@ -3638,9 +3639,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.52" +version = "2.0.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b699d15b36d1f02c3e7c69f8ffef53de37aefae075d8488d4ba1a7788d574a07" +checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032" dependencies = [ "proc-macro2", "quote", @@ -3730,7 +3731,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.53", ] [[package]] @@ -3817,7 +3818,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.53", ] [[package]] @@ -3883,14 +3884,14 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af06656561d28735e9c1cd63dfd57132c8155426aa6af24f36a00a351f88c48e" +checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.7", + "toml_edit 0.22.9", ] [[package]] @@ -3915,9 +3916,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.7" +version = "0.22.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18769cd1cec395d70860ceb4d932812a0b4d06b1a4bb336745a4d21b9496e992" +checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" dependencies = [ "indexmap", "serde", @@ -3952,7 +3953,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.53", ] [[package]] @@ -4190,7 +4191,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.53", "wasm-bindgen-shared", ] @@ -4224,7 +4225,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.53", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4622,7 +4623,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.52", + "syn 2.0.53", ] [[package]] diff --git a/crates/binstalk-manifests/src/crates_manifests.rs b/crates/binstalk-manifests/src/crates_manifests.rs index dc5636a1..265e1e0d 100644 --- a/crates/binstalk-manifests/src/crates_manifests.rs +++ b/crates/binstalk-manifests/src/crates_manifests.rs @@ -51,6 +51,7 @@ impl Manifests { .read(true) .write(true) .create(true) + .truncate(false) .open(manifest_path) .and_then(FileLock::new_exclusive)?; diff --git a/crates/binstalk-registry/src/vfs.rs b/crates/binstalk-registry/src/vfs.rs index b3339a81..7779b431 100644 --- a/crates/binstalk-registry/src/vfs.rs +++ b/crates/binstalk-registry/src/vfs.rs @@ -38,6 +38,6 @@ impl AbstractFilesystem for Vfs { fn file_names_in(&self, rel_path: &str) -> io::Result>> { let rel_path = Path::new(rel_path).normalize(); - Ok(self.0.get(&*rel_path).map(Clone::clone).unwrap_or_default()) + Ok(self.0.get(&*rel_path).cloned().unwrap_or_default()) } } From 8de3ec8fb72df0f5052768e750a70ebceafbbe3e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 29 Mar 2024 08:58:04 +0000 Subject: [PATCH 1689/2020] dep: Upgrade transitive dependencies (#1654) Co-authored-by: github-actions --- Cargo.lock | 142 ++++++++++++++++++++++++++--------------------------- 1 file changed, 71 insertions(+), 71 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aa2eb1f5..a17be211 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -115,9 +115,9 @@ checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" [[package]] name = "arc-swap" -version = "1.7.0" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b3d0060af21e8d11a926981cc00c6c1541aa91dd64b9f881985c3da1094425f" +checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "arrayvec" @@ -147,13 +147,13 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.78" +version = "0.1.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "461abc97219de0eaaf81fe3ef974a540158f3d079c2ab200f891f1a2ef201e85" +checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.55", ] [[package]] @@ -183,15 +183,15 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" [[package]] name = "backtrace" -version = "0.3.70" +version = "0.3.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95d8e92cac0961e91dbd517496b00f7e9b92363dbe6d42c3198268323798860c" +checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" dependencies = [ "addr2line", "cc", @@ -476,9 +476,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" [[package]] name = "bytesize" @@ -619,9 +619,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.3" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "949626d00e063efc93b6dca932419ceb5432f99769911c0b995f7e884c778813" +checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" dependencies = [ "clap_builder", "clap_derive", @@ -641,14 +641,14 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.3" +version = "4.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90239a040c80f5e14809ca132ddc4176ab33d5e17e49691793296e3fcb34d72f" +checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.55", ] [[package]] @@ -850,7 +850,7 @@ checksum = "64b697ac90ff296f0fc031ee5a61c7ac31fb9fff50e3fb32873b09223613fc0c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.55", ] [[package]] @@ -959,7 +959,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.55", ] [[package]] @@ -1016,9 +1016,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" [[package]] name = "file-format" @@ -1150,7 +1150,7 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.0.1", + "fastrand 2.0.2", "futures-core", "futures-io", "parking", @@ -1165,7 +1165,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.55", ] [[package]] @@ -1227,9 +1227,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gix" -version = "0.60.0" +version = "0.61.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "027b87106e07ab0965541f71dadd7db87be3f2b26feda3cce50028566a4dff0c" +checksum = "e4e0e59a44bf00de058ee98d6ecf3c9ed8f8842c1da642258ae4120d41ded8f7" dependencies = [ "gix-actor", "gix-attributes", @@ -1593,7 +1593,7 @@ checksum = "1dff438f14e67e7713ab9332f5fd18c8f20eb7eb249494f6c2bf170522224032" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.55", ] [[package]] @@ -1674,9 +1674,9 @@ dependencies = [ [[package]] name = "gix-packetline" -version = "0.17.4" +version = "0.17.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea5cd2b8ecbab2f3a2133686bf241dfc947a744347cfac8806c4ae5769ab931" +checksum = "b70486beda0903b6d5b65dfa6e40585098cdf4e6365ca2dff4f74c387354a515" dependencies = [ "bstr", "faster-hex", @@ -1934,7 +1934,7 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0066432d4c277f9877f091279a597ea5331f68ca410efc874f0bdfb1cd348f92" dependencies = [ - "fastrand 2.0.1", + "fastrand 2.0.2", "unicode-normalization", ] @@ -2044,7 +2044,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b83e1915177ea624b5bbbdb16bc54f0c106c9664892c695f995e53f5c6793b80" dependencies = [ "bytes", - "fastrand 2.0.1", + "fastrand 2.0.2", "futures-util", "http", "pin-project-lite", @@ -2302,9 +2302,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.5" +version = "2.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0b929d511467233429c45a44ac1dcaa21ba0f5ba11e4879e6ed28ddb4f9df4" +checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" dependencies = [ "equivalent", "hashbrown", @@ -2364,9 +2364,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" @@ -2445,7 +2445,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.55", ] [[package]] @@ -2547,7 +2547,7 @@ checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.55", ] [[package]] @@ -2567,9 +2567,9 @@ checksum = "df39d232f5c40b0891c10216992c2f250c054105cb1e56f0fc9032db6203ecc1" [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" [[package]] name = "memmap2" @@ -2608,7 +2608,7 @@ checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.55", ] [[package]] @@ -2806,7 +2806,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.55", ] [[package]] @@ -2817,9 +2817,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.101" +version = "0.9.102" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dda2b0f344e78efc2facf7d195d098df0dd72151b26ab98da807afc26c198dff" +checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" dependencies = [ "cc", "libc", @@ -2903,7 +2903,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.55", ] [[package]] @@ -3060,9 +3060,9 @@ dependencies = [ [[package]] name = "rayon" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4963ed1bc86e4f3ee217022bd855b297cef07fb9eac5dfa1f788b220b49b3bd" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ "either", "rayon-core", @@ -3120,9 +3120,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.3" +version = "1.10.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" dependencies = [ "aho-corasick", "memchr", @@ -3143,9 +3143,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" @@ -3420,14 +3420,14 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.55", ] [[package]] name = "serde_json" -version = "1.0.114" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f09b1bd632ef549eaa9f60a1f8de742bdbc698e6cee2095fc84dde5f549ae0" +checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" dependencies = [ "itoa", "ryu", @@ -3519,9 +3519,9 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcc1f7191e80a2b1610f37c3cdc2410d776a1104a84ac645d311011883a55ddc" +checksum = "27be740d8cf080ede6b7c48d62c96936521975c0b5d937cf750e16890bbf91a5" dependencies = [ "compact_str", "derive_destructure2", @@ -3602,7 +3602,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.53", + "syn 2.0.55", ] [[package]] @@ -3639,9 +3639,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.53" +version = "2.0.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7383cd0e49fff4b6b90ca5670bfd3e9d6a733b3f90c686605aa7eec8c4996032" +checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" dependencies = [ "proc-macro2", "quote", @@ -3688,7 +3688,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.0.1", + "fastrand 2.0.2", "rustix", "windows-sys 0.52.0", ] @@ -3731,7 +3731,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.55", ] [[package]] @@ -3794,9 +3794,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.36.0" +version = "1.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61285f6515fa018fb2d1e46eb21223fff441ee8db5d0f1435e8ab4f5cdb80931" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" dependencies = [ "backtrace", "bytes", @@ -3818,7 +3818,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.55", ] [[package]] @@ -3953,7 +3953,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.55", ] [[package]] @@ -4191,7 +4191,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.55", "wasm-bindgen-shared", ] @@ -4225,7 +4225,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.55", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4623,32 +4623,32 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.53", + "syn 2.0.55", ] [[package]] name = "zstd" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bffb3309596d527cfcba7dfc6ed6052f1d39dfbd7c867aa2e865e4a449c10110" +checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "7.0.0" +version = "7.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43747c7422e2924c11144d5229878b98180ef8b06cca4ab5af37afc8a8d8ea3e" +checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.9+zstd.1.5.5" +version = "2.0.10+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e16efa8a874a0481a574084d34cc26fdb3b99627480f785888deb6386506656" +checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" dependencies = [ "cc", "pkg-config", From 397fa7200fa17160b99ee57589db955d16006e13 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 3 Apr 2024 07:26:39 +1000 Subject: [PATCH 1690/2020] Bump dep reqwest in binstalk-downloader from 0.11.26 to 0.12.0 (#1655) * Bump dep reqwest in binstalk-downloader from 0.11.26 to 0.12.0 reqwest 0.11.27 is still used in gix, but it will be upgraded in next gix release. Signed-off-by: Jiahao XU * Fix feature selection: Forward tls feature to `simple-git` Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- Cargo.lock | 363 ++++++++++++++---- crates/binstalk-downloader/Cargo.toml | 45 ++- .../src/remote/resolver.rs | 5 +- crates/binstalk-registry/Cargo.toml | 16 +- crates/binstalk/Cargo.toml | 22 +- 5 files changed, 355 insertions(+), 96 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a17be211..87abc89d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -294,11 +294,10 @@ dependencies = [ "futures-util", "hickory-resolver", "httpdate", - "hyper", "ipconfig", "once_cell", "percent-encoding", - "reqwest", + "reqwest 0.12.2", "serde", "serde-tuple-vec-map", "serde_json", @@ -1275,6 +1274,7 @@ dependencies = [ "gix-worktree-state", "once_cell", "parking_lot", + "reqwest 0.11.27", "smallvec", "thiserror", ] @@ -1894,7 +1894,7 @@ dependencies = [ "gix-quote", "gix-sec", "gix-url", - "reqwest", + "reqwest 0.11.27", "thiserror", ] @@ -2015,7 +2015,7 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http", + "http 0.2.12", "indexmap", "slab", "tokio", @@ -2032,22 +2032,7 @@ dependencies = [ "bytes", "fastrand 1.9.0", "futures-util", - "http", - "tokio", - "tracing", -] - -[[package]] -name = "h3" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b83e1915177ea624b5bbbdb16bc54f0c106c9664892c695f995e53f5c6793b80" -dependencies = [ - "bytes", - "fastrand 2.0.2", - "futures-util", - "http", - "pin-project-lite", + "http 0.2.12", "tokio", "tracing", ] @@ -2060,27 +2045,12 @@ checksum = "2d4a1a1763e4f3e82ee9f1ecf2cf862b22cc7316ebe14684e42f94532b5ec64d" dependencies = [ "bytes", "futures", - "h3 0.0.2", + "h3", "quinn", "quinn-proto", "tokio-util", ] -[[package]] -name = "h3-quinn" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac9675014d703c3d516a121757bbc02e53f1ee838e0729fc7534b35024a81ae4" -dependencies = [ - "bytes", - "futures", - "h3 0.0.3", - "quinn", - "quinn-proto", - "tokio", - "tokio-util", -] - [[package]] name = "hashbrown" version = "0.14.3" @@ -2124,9 +2094,9 @@ dependencies = [ "futures-io", "futures-util", "h2", - "h3 0.0.2", - "h3-quinn 0.0.3", - "http", + "h3", + "h3-quinn", + "http 0.2.12", "idna 0.4.0", "ipnet", "native-tls", @@ -2134,13 +2104,13 @@ dependencies = [ "quinn", "rand", "ring 0.16.20", - "rustls", - "rustls-pemfile", + "rustls 0.21.10", + "rustls-pemfile 1.0.4", "thiserror", "tinyvec", "tokio", "tokio-native-tls", - "tokio-rustls", + "tokio-rustls 0.24.1", "tracing", "url", ] @@ -2160,12 +2130,12 @@ dependencies = [ "parking_lot", "rand", "resolv-conf", - "rustls", + "rustls 0.21.10", "smallvec", "thiserror", "tokio", "tokio-native-tls", - "tokio-rustls", + "tokio-rustls 0.24.1", "tracing", ] @@ -2200,6 +2170,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "http-body" version = "0.4.6" @@ -2207,7 +2188,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +dependencies = [ + "bytes", + "futures-core", + "http 1.1.0", + "http-body 1.0.0", "pin-project-lite", ] @@ -2240,8 +2244,8 @@ dependencies = [ "futures-core", "futures-util", "h2", - "http", - "http-body", + "http 0.2.12", + "http-body 0.4.6", "httparse", "httpdate", "itoa", @@ -2253,6 +2257,25 @@ dependencies = [ "want", ] +[[package]] +name = "hyper" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + [[package]] name = "hyper-rustls" version = "0.24.2" @@ -2260,11 +2283,28 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", - "http", - "hyper", - "rustls", + "http 0.2.12", + "hyper 0.14.28", + "rustls 0.21.10", "tokio", - "tokio-rustls", + "tokio-rustls 0.24.1", +] + +[[package]] +name = "hyper-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.2.0", + "hyper-util", + "rustls 0.22.3", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.25.0", + "tower-service", ] [[package]] @@ -2274,12 +2314,48 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper", + "hyper 0.14.28", "native-tls", "tokio", "tokio-native-tls", ] +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.2.0", + "hyper-util", + "native-tls", + "tokio", + "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "hyper 1.2.0", + "pin-project-lite", + "socket2", + "tokio", + "tower", + "tower-service", + "tracing", +] + [[package]] name = "idna" version = "0.4.0" @@ -2978,12 +3054,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ "bytes", - "futures-io", "pin-project-lite", "quinn-proto", "quinn-udp", "rustc-hash", - "rustls", + "rustls 0.21.10", "thiserror", "tokio", "tracing", @@ -2999,7 +3074,7 @@ dependencies = [ "rand", "ring 0.16.20", "rustc-hash", - "rustls", + "rustls 0.21.10", "slab", "thiserror", "tinyvec", @@ -3153,21 +3228,17 @@ version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ - "async-compression", "base64", "bytes", "encoding_rs", - "futures-channel", "futures-core", "futures-util", "h2", - "h3 0.0.3", - "h3-quinn 0.0.4", - "http", - "http-body", - "hyper", - "hyper-rustls", - "hyper-tls", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.28", + "hyper-rustls 0.24.2", + "hyper-tls 0.5.0", "ipnet", "js-sys", "log", @@ -3176,10 +3247,8 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "quinn", - "rustls", - "rustls-native-certs", - "rustls-pemfile", + "rustls 0.21.10", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", @@ -3187,7 +3256,53 @@ dependencies = [ "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls", + "tokio-rustls 0.24.1", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots 0.25.4", + "winreg 0.50.0", +] + +[[package]] +name = "reqwest" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d66674f2b6fb864665eea7a3c1ac4e3dfacd2fda83cf6f935a612e01b0e3338" +dependencies = [ + "async-compression", + "base64", + "bytes", + "futures-core", + "futures-util", + "http 1.1.0", + "http-body 1.0.0", + "http-body-util", + "hyper 1.2.0", + "hyper-rustls 0.26.0", + "hyper-tls 0.6.0", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls 0.22.3", + "rustls-native-certs", + "rustls-pemfile 1.0.4", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper", + "tokio", + "tokio-native-tls", + "tokio-rustls 0.25.0", "tokio-util", "tower-service", "url", @@ -3195,7 +3310,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots", + "webpki-roots 0.26.1", "winreg 0.50.0", ] @@ -3281,18 +3396,33 @@ checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" dependencies = [ "log", "ring 0.17.8", - "rustls-webpki", + "rustls-webpki 0.101.7", "sct", ] [[package]] -name = "rustls-native-certs" -version = "0.6.3" +name = "rustls" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9aace74cb666635c918e9c12bc0d348266037aa8eb599b5cba565709a8dff00" +checksum = "99008d7ad0bbbea527ec27bddbc0e432c5b87d8175178cee68d2eec9c4a1813c" +dependencies = [ + "log", + "ring 0.17.8", + "rustls-pki-types", + "rustls-webpki 0.102.2", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" dependencies = [ "openssl-probe", - "rustls-pemfile", + "rustls-pemfile 2.1.1", + "rustls-pki-types", "schannel", "security-framework", ] @@ -3306,6 +3436,22 @@ dependencies = [ "base64", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f48172685e6ff52a556baa527774f61fcaa884f59daf3375c62a3f1cd2549dab" +dependencies = [ + "base64", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" + [[package]] name = "rustls-webpki" version = "0.101.7" @@ -3316,6 +3462,17 @@ dependencies = [ "untrusted 0.9.0", ] +[[package]] +name = "rustls-webpki" +version = "0.102.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +dependencies = [ + "ring 0.17.8", + "rustls-pki-types", + "untrusted 0.9.0", +] + [[package]] name = "rustversion" version = "1.0.14" @@ -3605,6 +3762,12 @@ dependencies = [ "syn 2.0.55", ] +[[package]] +name = "subtle" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + [[package]] name = "supports-color" version = "3.0.0" @@ -3837,7 +4000,18 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls", + "rustls 0.21.10", + "tokio", +] + +[[package]] +name = "tokio-rustls" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +dependencies = [ + "rustls 0.22.3", + "rustls-pki-types", "tokio", ] @@ -3927,6 +4101,28 @@ dependencies = [ "winnow 0.6.5", ] +[[package]] +name = "tower" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" +dependencies = [ + "futures-core", + "futures-util", + "pin-project", + "pin-project-lite", + "tokio", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" + [[package]] name = "tower-service" version = "0.3.2" @@ -4265,6 +4461,15 @@ version = "0.25.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" +[[package]] +name = "webpki-roots" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +dependencies = [ + "rustls-pki-types", +] + [[package]] name = "widestring" version = "1.0.2" @@ -4626,6 +4831,12 @@ dependencies = [ "syn 2.0.55", ] +[[package]] +name = "zeroize" +version = "1.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" + [[package]] name = "zstd" version = "0.13.1" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index e3d379b6..d750dcd3 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -11,8 +11,22 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" -async-compression = { version = "0.4.4", features = ["gzip", "zstd", "xz", "bzip2", "tokio"] } -async_zip = { version = "0.0.16", features = ["deflate", "deflate64", "bzip2", "lzma", "zstd", "xz", "tokio"] } +async-compression = { version = "0.4.4", features = [ + "gzip", + "zstd", + "xz", + "bzip2", + "tokio", +] } +async_zip = { version = "0.0.16", features = [ + "deflate", + "deflate64", + "bzip2", + "lzma", + "zstd", + "xz", + "tokio", +] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" @@ -21,7 +35,12 @@ flate2 = { version = "1.0.28", default-features = false } futures-util = "0.3.30" futures-io = "0.3.30" httpdate = "1.0.2" -reqwest = { version = "0.11.25", features = ["stream", "gzip", "brotli", "deflate"], default-features = false } +reqwest = { version = "0.12.0", features = [ + "stream", + "gzip", + "brotli", + "deflate", +], default-features = false } percent-encoding = "2.2.0" serde = { version = "1.0.163", features = ["derive"], optional = true } serde-tuple-vec-map = "1.0.1" @@ -33,12 +52,19 @@ serde_json = { version = "1.0.107", optional = true } tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.5.0" thiserror = "1.0.52" -tokio = { version = "1.35.0", features = ["macros", "rt-multi-thread", "sync", "time", "fs"], default-features = false } +tokio = { version = "1.35.0", features = [ + "macros", + "rt-multi-thread", + "sync", + "time", + "fs", +], default-features = false } tokio-tar = "0.3.0" tokio-util = { version = "0.7.8", features = ["io"] } tracing = "0.1.39" -hickory-resolver = { version = "0.24.0", optional = true, features = ["dnssec-ring"] } -hyper = { version = "0.14.27", optional = true } +hickory-resolver = { version = "0.24.0", optional = true, features = [ + "dnssec-ring", +] } once_cell = { version = "1.18.0", optional = true } url = "2.3.1" @@ -83,14 +109,17 @@ native-tls = [ ] # Enable hickory-resolver so that features on it will also be enabled. -hickory-dns = ["hickory-resolver", "default-net", "ipconfig", "hyper", "once_cell"] +hickory-dns = ["hickory-resolver", "default-net", "ipconfig", "once_cell"] # Deprecated alias for hickory-dns, since trust-dns is renamed to hickory-dns trust-dns = ["hickory-dns"] +# HTTP3 is temporarily disabled by reqwest. +# # Experimental HTTP/3 client, this would require `--cfg reqwest_unstable` # to be passed to `rustc`. -http3 = ["reqwest/http3"] +#http3 = ["reqwest/http3"] +http3 = [] zstd-thin = ["zstd/thin"] diff --git a/crates/binstalk-downloader/src/remote/resolver.rs b/crates/binstalk-downloader/src/remote/resolver.rs index 13735fb4..4d33c1e6 100644 --- a/crates/binstalk-downloader/src/remote/resolver.rs +++ b/crates/binstalk-downloader/src/remote/resolver.rs @@ -1,9 +1,8 @@ use std::{net::SocketAddr, sync::Arc}; use hickory_resolver::TokioAsyncResolver; -use hyper::client::connect::dns::Name; use once_cell::sync::OnceCell; -use reqwest::dns::{Addrs, Resolve}; +use reqwest::dns::{Addrs, Name, Resolve, Resolving}; use tracing::{debug, instrument, warn}; #[cfg(windows)] @@ -15,7 +14,7 @@ type BoxError = Box; pub struct TrustDnsResolver(Arc>); impl Resolve for TrustDnsResolver { - fn resolve(&self, name: Name) -> reqwest::dns::Resolving { + fn resolve(&self, name: Name) -> Resolving { let resolver = self.clone(); Box::pin(async move { let resolver = resolver.0.get_or_try_init(new_resolver)?; diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 471d1c86..2f9e51c4 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,9 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.10.1", path = "../binstalk-downloader", default-features = false, features = ["json"] } +binstalk-downloader = { version = "0.10.1", path = "../binstalk-downloader", default-features = false, features = [ + "json", +] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "5.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } @@ -28,18 +30,26 @@ sha2 = "0.10.7" simple-git = { version = "0.2.4", optional = true } tempfile = "3.5.0" thiserror = "1.0.52" -tokio = { version = "1.35.0", features = ["rt", "sync"], default-features = false } +tokio = { version = "1.35.0", features = [ + "rt", + "sync", +], default-features = false } tracing = "0.1.39" url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.4", features = ["serde"] } -binstalk-downloader = { version = "0.10.1", path = "../binstalk-downloader", default-features = false, features = ["rustls"] } +binstalk-downloader = { version = "0.10.1", path = "../binstalk-downloader", default-features = false, features = [ + "rustls", +] } [features] git = ["simple-git"] +rustls = ["simple-git?/rustls"] +native-tls = ["simple-git?/native-tls"] + crates_io_api = [] [package.metadata.docs.rs] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 65bee22f..d66a289b 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,14 +11,20 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.10.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } -binstalk-fetchers = { version = "0.4.0", path = "../binstalk-fetchers", features = ["quickinstall"] } +binstalk-downloader = { version = "0.10.1", path = "../binstalk-downloader", default-features = false, features = [ + "gh-api-client", +] } +binstalk-fetchers = { version = "0.4.0", path = "../binstalk-fetchers", features = [ + "quickinstall", +] } binstalk-registry = { version = "0.7.0", path = "../binstalk-registry" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "5.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } -detect-targets = { version = "0.1.15", path = "../detect-targets", features = ["tracing"] } +detect-targets = { version = "0.1.15", path = "../detect-targets", features = [ + "tracing", +] } either = "1.8.1" itertools = "0.12.0" jobslot = { version = "0.2.11", features = ["tokio"] } @@ -31,7 +37,11 @@ strum = "0.26.1" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" thiserror = "1.0.52" -tokio = { version = "1.35.0", features = ["rt", "process", "sync"], default-features = false } +tokio = { version = "1.35.0", features = [ + "rt", + "process", + "sync", +], default-features = false } tracing = "0.1.39" url = { version = "2.3.1", features = ["serde"] } @@ -46,8 +56,8 @@ pkg-config = ["binstalk-downloader/pkg-config"] zlib-ng = ["binstalk-downloader/zlib-ng"] -rustls = ["binstalk-downloader/rustls"] -native-tls = ["binstalk-downloader/native-tls"] +rustls = ["binstalk-downloader/rustls", "binstalk-registry/rustls"] +native-tls = ["binstalk-downloader/native-tls", "binstalk-registry/native-tls"] trust-dns = ["binstalk-downloader/trust-dns"] From 48039ed7391210095b8601ea4cc899a1dc20b12e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 5 Apr 2024 07:44:33 +0000 Subject: [PATCH 1691/2020] dep: Upgrade transitive dependencies (#1656) Co-authored-by: github-actions --- Cargo.lock | 83 +++++++++++++++++++++++++++--------------------------- 1 file changed, 41 insertions(+), 42 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 87abc89d..93ae107a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -127,9 +127,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-compression" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a116f46a969224200a0a97f29cfd4c50e7534e4b4826bd23ea2c3c533039c82c" +checksum = "86a9249d1447a85f95810c620abea82e001fe58a31713fcce614caf52499f905" dependencies = [ "brotli", "bzip2", @@ -153,7 +153,7 @@ checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -647,7 +647,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -849,7 +849,7 @@ checksum = "64b697ac90ff296f0fc031ee5a61c7ac31fb9fff50e3fb32873b09223613fc0c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -958,7 +958,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -1087,9 +1087,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b1e34e369d7f0151309821497440bd0266b86c77ccd69717c3b67e5eaeffe4" +checksum = "21dabded2e32cd57ded879041205c60a4a4c4bab47bd0fd2fa8b01f30849f02b" dependencies = [ "rustix", "windows-sys 0.52.0", @@ -1164,7 +1164,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -1593,7 +1593,7 @@ checksum = "1dff438f14e67e7713ab9332f5fd18c8f20eb7eb249494f6c2bf170522224032" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -2006,9 +2006,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.3.25" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fbd2820c5e49886948654ab546d0688ff24530286bdcf8fca3cefb16d4618eb" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -2521,7 +2521,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -2542,13 +2542,12 @@ dependencies = [ [[package]] name = "libredox" -version = "0.0.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85c833ca1e66078851dba29046874e38f08b2c883700aa29a03ddd3b23814ee8" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.5.0", "libc", - "redox_syscall 0.4.1", ] [[package]] @@ -2623,7 +2622,7 @@ checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -2684,7 +2683,7 @@ checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -2785,9 +2784,9 @@ dependencies = [ [[package]] name = "netlink-sys" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6471bf08e7ac0135876a9581bf3217ef0333c191c128d34878079f42ee150411" +checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" dependencies = [ "bytes", "libc", @@ -2882,7 +2881,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -2979,14 +2978,14 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -3173,9 +3172,9 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18479200779601e498ada4e8c1e1f50e3ee19deb0259c25825a98b5603b2cb4" +checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" dependencies = [ "getrandom", "libredox", @@ -3521,9 +3520,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.9.2" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" dependencies = [ "bitflags 1.3.2", "core-foundation", @@ -3534,9 +3533,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" dependencies = [ "core-foundation-sys", "libc", @@ -3577,7 +3576,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -3739,9 +3738,9 @@ checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] name = "strsim" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee073c9e4cd00e28217186dbe12796d692868f432bf2e97ee73bed0c56dfa01" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" @@ -3759,7 +3758,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -3802,9 +3801,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.55" +version = "2.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "002a1b3dbf967edfafc32655d0f377ab0bb7b994aa1d32c8cc7e9b8bf3ebb8f0" +checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" dependencies = [ "proc-macro2", "quote", @@ -3894,7 +3893,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -3981,7 +3980,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -4149,7 +4148,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] @@ -4387,7 +4386,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", "wasm-bindgen-shared", ] @@ -4421,7 +4420,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4828,7 +4827,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.55", + "syn 2.0.58", ] [[package]] From fe2a4d8b0c520886458a35cb766450e39af9bba1 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 6 Apr 2024 12:08:10 +1000 Subject: [PATCH 1692/2020] Remove dep windows-dll and replace it with manual loading (#1658) Fixed #1629 Signed-off-by: Jiahao XU --- Cargo.lock | 165 ++++---------------- crates/detect-targets/Cargo.toml | 18 ++- crates/detect-targets/src/detect/windows.rs | 88 +++++++---- 3 files changed, 100 insertions(+), 171 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 93ae107a..1c90ba68 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -153,7 +153,7 @@ checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -352,7 +352,7 @@ dependencies = [ "serde_json", "tempfile", "thiserror", - "toml_edit 0.22.9", + "toml_edit", "url", ] @@ -378,7 +378,7 @@ dependencies = [ "tempfile", "thiserror", "tokio", - "toml_edit 0.22.9", + "toml_edit", "tracing", "url", ] @@ -647,7 +647,7 @@ dependencies = [ "heck 0.5.0", "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -849,7 +849,7 @@ checksum = "64b697ac90ff296f0fc031ee5a61c7ac31fb9fff50e3fb32873b09223613fc0c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -861,7 +861,6 @@ dependencies = [ "tokio", "tracing", "tracing-subscriber", - "windows-dll", "windows-sys 0.52.0", ] @@ -958,7 +957,7 @@ dependencies = [ "heck 0.4.1", "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -1164,7 +1163,7 @@ checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -1290,7 +1289,7 @@ dependencies = [ "gix-utils", "itoa", "thiserror", - "winnow 0.6.5", + "winnow", ] [[package]] @@ -1372,7 +1371,7 @@ dependencies = [ "smallvec", "thiserror", "unicode-bom", - "winnow 0.6.5", + "winnow", ] [[package]] @@ -1593,7 +1592,7 @@ checksum = "1dff438f14e67e7713ab9332f5fd18c8f20eb7eb249494f6c2bf170522224032" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -1628,7 +1627,7 @@ dependencies = [ "itoa", "smallvec", "thiserror", - "winnow 0.6.5", + "winnow", ] [[package]] @@ -1752,7 +1751,7 @@ dependencies = [ "gix-utils", "maybe-async", "thiserror", - "winnow 0.6.5", + "winnow", ] [[package]] @@ -1785,7 +1784,7 @@ dependencies = [ "gix-validate", "memmap2", "thiserror", - "winnow 0.6.5", + "winnow", ] [[package]] @@ -2521,7 +2520,7 @@ dependencies = [ "leon", "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -2622,7 +2621,7 @@ checksum = "5cf92c10c7e361d6b99666ec1c6f9805b0bea2c3bd8c78dc6fe98ac5bd78db11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -2683,7 +2682,7 @@ checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -2881,7 +2880,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -2978,7 +2977,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -3011,16 +3010,6 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit 0.19.15", -] - [[package]] name = "proc-macro2" version = "1.0.79" @@ -3576,7 +3565,7 @@ checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -3758,7 +3747,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.58", + "syn", ] [[package]] @@ -3788,17 +3777,6 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - [[package]] name = "syn" version = "2.0.58" @@ -3893,7 +3871,7 @@ checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -3980,7 +3958,7 @@ checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -4064,7 +4042,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.22.9", + "toml_edit", ] [[package]] @@ -4076,17 +4054,6 @@ dependencies = [ "serde", ] -[[package]] -name = "toml_edit" -version = "0.19.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" -dependencies = [ - "indexmap", - "toml_datetime", - "winnow 0.5.40", -] - [[package]] name = "toml_edit" version = "0.22.9" @@ -4097,7 +4064,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.5", + "winnow", ] [[package]] @@ -4148,7 +4115,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] @@ -4386,7 +4353,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn 2.0.58", + "syn", "wasm-bindgen-shared", ] @@ -4420,7 +4387,7 @@ checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -4506,19 +4473,6 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" -[[package]] -name = "windows" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08746b4b7ac95f708b3cccceb97b7f9a21a8916dd47fc99b0e6aaf7208f26fd7" -dependencies = [ - "windows_aarch64_msvc 0.35.0", - "windows_i686_gnu 0.35.0", - "windows_i686_msvc 0.35.0", - "windows_x86_64_gnu 0.35.0", - "windows_x86_64_msvc 0.35.0", -] - [[package]] name = "windows" version = "0.48.0" @@ -4548,30 +4502,6 @@ dependencies = [ "windows-targets 0.52.4", ] -[[package]] -name = "windows-dll" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0895e287d32aad509d5720ea1975e5d22b2fa51fc3e1f94163cdb73b185b5555" -dependencies = [ - "once_cell", - "thiserror", - "windows 0.35.0", - "windows-dll-codegen", -] - -[[package]] -name = "windows-dll-codegen" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7c2f703a1e16b2447f1ce6c6a7c9231535fef0ca2e260f4bc69ecc8e06b208b" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "windows-result" version = "0.1.0" @@ -4641,12 +4571,6 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" -[[package]] -name = "windows_aarch64_msvc" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3bc5134e8ce0da5d64dcec3529793f1d33aee5a51fc2b4662e0f881dd463e6" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -4659,12 +4583,6 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" -[[package]] -name = "windows_i686_gnu" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0343a6f35bf43a07b009b8591b78b10ea03de86b06f48e28c96206cd0f453b50" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -4677,12 +4595,6 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" -[[package]] -name = "windows_i686_msvc" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1acdcbf4ca63d8e7a501be86fee744347186275ec2754d129ddeab7a1e3a02e4" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -4695,12 +4607,6 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" -[[package]] -name = "windows_x86_64_gnu" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "893c0924c5a990ec73cd2264d1c0cba1773a929e1a3f5dbccffd769f8c4edebb" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -4725,12 +4631,6 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" -[[package]] -name = "windows_x86_64_msvc" -version = "0.35.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a29bd61f32889c822c99a8fdf2e93378bd2fae4d7efd2693fab09fcaaf7eff4b" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -4743,15 +4643,6 @@ version = "0.52.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" -[[package]] -name = "winnow" -version = "0.5.40" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" -dependencies = [ - "memchr", -] - [[package]] name = "winnow" version = "0.6.5" @@ -4827,7 +4718,7 @@ checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.58", + "syn", ] [[package]] diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 6066568d..08f40576 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -10,9 +10,15 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -tokio = { version = "1.35.0", features = ["rt", "process", "sync"], default-features = false } +tokio = { version = "1.35.0", features = [ + "rt", + "process", + "sync", +], default-features = false } tracing = { version = "0.1.39", optional = true } -tracing-subscriber = { version = "0.3.17", features = ["fmt"], default-features = false, optional = true } +tracing-subscriber = { version = "0.3.17", features = [ + "fmt", +], default-features = false, optional = true } cfg-if = "1.0.0" guess_host_triple = "0.1.3" @@ -21,8 +27,12 @@ tracing = ["dep:tracing"] cli-logging = ["tracing", "dep:tracing-subscriber"] [target.'cfg(target_os = "windows")'.dependencies] -windows-sys = { version = "0.52.0", features = ["Win32_System_Threading", "Win32_System_SystemInformation", "Win32_Foundation"] } -windows-dll = { version = "0.4.1", features = ["windows"], default-features = false } +windows-sys = { version = "0.52.0", features = [ + "Win32_System_Threading", + "Win32_System_SystemInformation", + "Win32_Foundation", + "Win32_System_LibraryLoader", +] } [dev-dependencies] tokio = { version = "1.35.0", features = ["macros"], default-features = false } diff --git a/crates/detect-targets/src/detect/windows.rs b/crates/detect-targets/src/detect/windows.rs index e4178796..5e4fe447 100644 --- a/crates/detect-targets/src/detect/windows.rs +++ b/crates/detect-targets/src/detect/windows.rs @@ -1,44 +1,72 @@ use std::mem; -use windows_dll::dll; -use windows_sys::{ - core::HRESULT, - Win32::System::{ +use windows_sys::Win32::{ + Foundation::{FreeLibrary, HMODULE, S_OK}, + System::{ + LibraryLoader::{GetProcAddress, LoadLibraryA}, SystemInformation::{ IMAGE_FILE_MACHINE, IMAGE_FILE_MACHINE_AMD64, IMAGE_FILE_MACHINE_ARM, IMAGE_FILE_MACHINE_ARM64, IMAGE_FILE_MACHINE_I386, }, - Threading::{UserEnabled, Wow64Container, MACHINE_ATTRIBUTES}, + Threading::{GetMachineTypeAttributes, UserEnabled, Wow64Container, MACHINE_ATTRIBUTES}, }, }; -#[dll("Kernel32")] -extern "system" { - #[allow(non_snake_case)] - #[fallible] - fn GetMachineTypeAttributes( - machine: IMAGE_FILE_MACHINE, - machine_attributes: *mut MACHINE_ATTRIBUTES, - ) -> HRESULT; +struct LibraryHandle(HMODULE); + +impl LibraryHandle { + fn new(name: &[u8]) -> Option { + let handle = unsafe { LoadLibraryA(name.as_ptr() as _) }; + (handle != 0).then(|| Self(handle)) + } + + /// Get a function pointer to a function in the library. + /// # SAFETY + /// + /// The caller must ensure that the function signature matches the actual function. + /// The easiest way to do this is to add an entry to windows_sys_no_link.list and use the + /// generated function for `func_signature`. + /// + /// The function returned cannot be used after the handle is dropped. + unsafe fn get_proc_address(&self, name: &[u8]) -> Option { + let symbol = unsafe { GetProcAddress(self.0, name.as_ptr() as _) }; + symbol.map(|symbol| unsafe { mem::transmute_copy(&symbol) }) + } +} + +impl Drop for LibraryHandle { + fn drop(&mut self) { + unsafe { FreeLibrary(self.0) }; + } +} + +type GetMachineTypeAttributesFuncType = + unsafe extern "system" fn(u16, *mut MACHINE_ATTRIBUTES) -> i32; +const _: () = { + // Ensure that our hand-written signature matches the actual function signature. + // We can't use `GetMachineTypeAttributes` outside of a const scope otherwise we'll end up statically linking to + // it, which will fail to load on older versions of Windows. + let _: GetMachineTypeAttributesFuncType = GetMachineTypeAttributes; +}; + +fn is_arch_supported_inner(arch: IMAGE_FILE_MACHINE) -> Option { + // GetMachineTypeAttributes is only available on Win11 22000+, so dynamically load it. + let kernel32 = LibraryHandle::new(b"kernel32.dll\0")?; + // SAFETY: GetMachineTypeAttributesFuncType is checked to match the real function signature. + let get_machine_type_attributes = unsafe { + kernel32.get_proc_address::(b"GetMachineTypeAttributes\0") + }?; + + let mut machine_attributes = mem::MaybeUninit::uninit(); + if unsafe { get_machine_type_attributes(arch, machine_attributes.as_mut_ptr()) } == S_OK { + let machine_attributes = unsafe { machine_attributes.assume_init() }; + Some((machine_attributes & (Wow64Container | UserEnabled)) != 0) + } else { + Some(false) + } } fn is_arch_supported(arch: IMAGE_FILE_MACHINE) -> bool { - let mut machine_attributes = mem::MaybeUninit::uninit(); - - // SAFETY: GetMachineTypeAttributes takes type IMAGE_FILE_MACHINE - // plus it takes a pointer to machine_attributes which is only - // written to. - match unsafe { GetMachineTypeAttributes(arch, machine_attributes.as_mut_ptr()) } { - Ok(0) => { - // SAFETY: Symbol GetMachineTypeAttributes exists and calls to it - // succceeds. - // - // Thus, machine_attributes is initialized. - let machine_attributes = unsafe { machine_attributes.assume_init() }; - - (machine_attributes & (Wow64Container | UserEnabled)) != 0 - } - _ => false, - } + is_arch_supported_inner(arch).unwrap_or(false) } pub(super) fn detect_alternative_targets(target: &str) -> impl Iterator { From f1b7cd4430e0e4ff6278248609f0bc344bcfd0f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 6 Apr 2024 03:38:11 +0000 Subject: [PATCH 1693/2020] build(deps): bump async_zip from 0.0.16 to 0.0.17 in the deps group (#1659) * build(deps): bump async_zip from 0.0.16 to 0.0.17 in the deps group Bumps the deps group with 1 update: [async_zip](https://github.com/Majored/rs-async-zip). Updates `async_zip` from 0.0.16 to 0.0.17 - [Release notes](https://github.com/Majored/rs-async-zip/releases) - [Commits](https://github.com/Majored/rs-async-zip/compare/v0.0.16...v0.0.17) --- updated-dependencies: - dependency-name: async_zip dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps ... Signed-off-by: dependabot[bot] * Fix `extract_zip_entry` generic bound Signed-off-by: Jiahao XU --------- Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-downloader/src/download/zip_extraction.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1c90ba68..d7716a77 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -158,9 +158,9 @@ dependencies = [ [[package]] name = "async_zip" -version = "0.0.16" +version = "0.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "527207465fb6dcafbf661b0d4a51d0d2306c9d0c2975423079a6caa807930daf" +checksum = "00b9f7252833d5ed4b00aa9604b563529dd5e11de9c23615de2dcdf91eb87b52" dependencies = [ "async-compression", "crc32fast", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index d750dcd3..9a73b638 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -18,7 +18,7 @@ async-compression = { version = "0.4.4", features = [ "bzip2", "tokio", ] } -async_zip = { version = "0.0.16", features = [ +async_zip = { version = "0.0.17", features = [ "deflate", "deflate64", "bzip2", diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index a5a5c961..329c0695 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -46,7 +46,7 @@ pub(super) async fn extract_zip_entry( extracted_files: &mut ExtractedFiles, ) -> Result<(), DownloadError> where - R: futures_io::AsyncRead + Unpin + Send + Sync, + R: futures_io::AsyncBufRead + Unpin + Send + Sync, { // Sanitize filename let raw_filename = zip_reader.entry().filename(); From 9ca98efb51f20753ea9bb0024e2e247414224bd0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 12 Apr 2024 03:47:18 +0000 Subject: [PATCH 1694/2020] dep: Upgrade transitive dependencies (#1660) Co-authored-by: github-actions --- Cargo.lock | 100 ++++++++++++++++++++++++++++------------------------- 1 file changed, 53 insertions(+), 47 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d7716a77..2148766f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -109,9 +109,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0952808a6c2afd1aa8947271f3a60f1a6763c7b912d210184c5149b5cf147247" +checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" [[package]] name = "arc-swap" @@ -127,9 +127,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-compression" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86a9249d1447a85f95810c620abea82e001fe58a31713fcce614caf52499f905" +checksum = "07dbbf24db18d609b1462965249abdf49129ccad073ec257da372adc83259c60" dependencies = [ "brotli", "bzip2", @@ -147,9 +147,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.79" +version = "0.1.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507401cad91ec6a857ed5513a2073c82a9b9048762b885bb98655b306964681" +checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" dependencies = [ "proc-macro2", "quote", @@ -223,6 +223,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" + [[package]] name = "beef" version = "0.5.2" @@ -297,7 +303,7 @@ dependencies = [ "ipconfig", "once_cell", "percent-encoding", - "reqwest 0.12.2", + "reqwest 0.12.3", "serde", "serde-tuple-vec-map", "serde_json", @@ -431,9 +437,9 @@ dependencies = [ [[package]] name = "brotli" -version = "3.5.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d640d25bc63c50fb1f0b545ffd80207d2e10a4c965530809b40ba3386825c391" +checksum = "125740193d7fee5cc63ab9e16c2fdc4e07c74ba755cc53b327d6ea029e9fc569" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -442,9 +448,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "2.5.1" +version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2e4afe60d7dd600fdd3de8d0f08c2b7ec039712e3b6137ff98b7004e82de4f" +checksum = "65622a320492e09b5e0ac436b14c54ff68199bac392d0e89a6832c4518eea525" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -463,9 +469,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.15.4" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ff69b9dd49fd426c69a0db9fc04dd934cdb6645ff000864d98f7e2af8830eaa" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "byteorder" @@ -602,9 +608,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.90" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cd6604a82acf3039f1144f54b8eb34e91ffba622051189e71b781822d5ee1f5" +checksum = "2678b2e3449475e95b0aa6f9b506a28e61b3dc8996592b983695e8ebb58a8b41" dependencies = [ "jobserver", "libc", @@ -941,9 +947,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -1208,9 +1214,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ "cfg-if", "libc", @@ -1884,7 +1890,7 @@ version = "0.41.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf8e5f72ec9cad9ee44714b9a4ec7427b540a2418b62111f5e3a715bebe1ed9d" dependencies = [ - "base64", + "base64 0.21.7", "bstr", "gix-command", "gix-credentials", @@ -2445,9 +2451,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab46a6e9526ddef3ae7f787c06f0f2600639ba80ea3eade3d8e670a2230f51d6" +checksum = "f08474e32172238f2827bd160c67871cdb2801430f65c3979184dc362e3ca118" dependencies = [ "libc", ] @@ -3084,9 +3090,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.35" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" dependencies = [ "proc-macro2", ] @@ -3216,7 +3222,7 @@ version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ - "base64", + "base64 0.21.7", "bytes", "encoding_rs", "futures-core", @@ -3256,12 +3262,12 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d66674f2b6fb864665eea7a3c1ac4e3dfacd2fda83cf6f935a612e01b0e3338" +checksum = "3e6cc1e89e689536eb5aeede61520e874df5a4707df811cd5da4aa5fbb2aae19" dependencies = [ "async-compression", - "base64", + "base64 0.22.0", "bytes", "futures-core", "futures-util", @@ -3282,7 +3288,7 @@ dependencies = [ "pin-project-lite", "rustls 0.22.3", "rustls-native-certs", - "rustls-pemfile 1.0.4", + "rustls-pemfile 2.1.2", "rustls-pki-types", "serde", "serde_json", @@ -3299,7 +3305,7 @@ dependencies = [ "wasm-streams", "web-sys", "webpki-roots 0.26.1", - "winreg 0.50.0", + "winreg 0.52.0", ] [[package]] @@ -3409,7 +3415,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.1", + "rustls-pemfile 2.1.2", "rustls-pki-types", "schannel", "security-framework", @@ -3421,16 +3427,16 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" dependencies = [ - "base64", + "base64 0.21.7", ] [[package]] name = "rustls-pemfile" -version = "2.1.1" +version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f48172685e6ff52a556baa527774f61fcaa884f59daf3375c62a3f1cd2549dab" +checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ - "base64", + "base64 0.22.0", "rustls-pki-types", ] @@ -3463,9 +3469,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" [[package]] name = "ryu" @@ -3886,9 +3892,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.34" +version = "0.3.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8248b6521bb14bc45b4067159b9b6ad792e2d6d754d6c41fb50e29fefe38749" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" dependencies = [ "deranged", "itoa", @@ -3909,9 +3915,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba3a3ef41e6672a2f0f001392bb5dcd3ff0a9992d618ca761a11c3121547774" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" dependencies = [ "num-conv", "time-core", @@ -4178,9 +4184,9 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "uluru" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "794a32261a1f5eb6a4462c81b59cec87b5c27d5deea7dd1ac8fc781c41d226db" +checksum = "7c8a2469e56e6e5095c82ccd3afb98dad95f7af7929aab6d8ba8d6e0f73657da" dependencies = [ "arrayvec", ] @@ -4438,9 +4444,9 @@ dependencies = [ [[package]] name = "widestring" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" +checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" [[package]] name = "winapi" @@ -4645,9 +4651,9 @@ checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" [[package]] name = "winnow" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dffa400e67ed5a4dd237983829e66475f0a4a26938c4b04c21baede6262215b8" +checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" dependencies = [ "memchr", ] From 479dd07d14301b748a8b9b81c322ba40be0abcae Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 13 Apr 2024 01:38:03 +0000 Subject: [PATCH 1695/2020] build(deps): bump the deps group with 2 updates (#1661) Bumps the deps group with 2 updates: [windows](https://github.com/microsoft/windows-rs) and [either](https://github.com/rayon-rs/either). Updates `windows` from 0.54.0 to 0.56.0 - [Release notes](https://github.com/microsoft/windows-rs/releases) - [Commits](https://github.com/microsoft/windows-rs/compare/0.54.0...0.56.0) Updates `either` from 1.10.0 to 1.11.0 - [Commits](https://github.com/rayon-rs/either/compare/1.10.0...1.11.0) --- updated-dependencies: - dependency-name: windows dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: either dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 117 ++++++++++++++++++-------- crates/atomic-file-install/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 87 insertions(+), 36 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2148766f..351f555d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -178,7 +178,7 @@ dependencies = [ "reflink-copy", "tempfile", "tracing", - "windows 0.54.0", + "windows 0.56.0", ] [[package]] @@ -927,9 +927,9 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "either" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" [[package]] name = "embed-resource" @@ -4494,8 +4494,18 @@ version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" dependencies = [ - "windows-core", - "windows-targets 0.52.4", + "windows-core 0.54.0", + "windows-targets 0.52.5", +] + +[[package]] +name = "windows" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" +dependencies = [ + "windows-core 0.56.0", + "windows-targets 0.52.5", ] [[package]] @@ -4505,16 +4515,50 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" dependencies = [ "windows-result", - "windows-targets 0.52.4", + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-core" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-result", + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-implement" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "windows-interface" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] name = "windows-result" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd19df78e5168dfb0aedc343d1d1b8d422ab2db6756d2dc3fef75035402a3f64" +checksum = "749f0da9cc72d82e600d8d2e44cadd0b9eedb9038f71a1c58556ac1c5791813b" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -4532,7 +4576,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.5", ] [[package]] @@ -4552,17 +4596,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.5", + "windows_aarch64_msvc 0.52.5", + "windows_i686_gnu 0.52.5", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.5", + "windows_x86_64_gnu 0.52.5", + "windows_x86_64_gnullvm 0.52.5", + "windows_x86_64_msvc 0.52.5", ] [[package]] @@ -4573,9 +4618,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" [[package]] name = "windows_aarch64_msvc" @@ -4585,9 +4630,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" [[package]] name = "windows_i686_gnu" @@ -4597,9 +4642,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" [[package]] name = "windows_i686_msvc" @@ -4609,9 +4660,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" [[package]] name = "windows_x86_64_gnu" @@ -4621,9 +4672,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" [[package]] name = "windows_x86_64_gnullvm" @@ -4633,9 +4684,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" [[package]] name = "windows_x86_64_msvc" @@ -4645,9 +4696,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index 8e4f5810..421933a6 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -15,4 +15,4 @@ tempfile = "3.5.0" tracing = "0.1.39" [target.'cfg(windows)'.dependencies] -windows = { version = "0.54.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } +windows = { version = "0.56.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 87b26557..a929a94b 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -16,7 +16,7 @@ binstalk-downloader = { version = "0.10.1", path = "../binstalk-downloader", def binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } -either = "1.8.1" +either = "1.11.0" itertools = "0.12.0" leon = "3.0.0" leon-macros = "1.0.1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index d66a289b..87ea8afc 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -25,7 +25,7 @@ compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.15", path = "../detect-targets", features = [ "tracing", ] } -either = "1.8.1" +either = "1.11.0" itertools = "0.12.0" jobslot = { version = "0.2.11", features = ["tokio"] } leon = "3.0.0" From 6476c3bdd9438888e817be735f1cd3bbd556bf4d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 19 Apr 2024 03:32:40 +0000 Subject: [PATCH 1696/2020] dep: Upgrade transitive dependencies (#1662) Co-authored-by: github-actions --- Cargo.lock | 318 ++++++++++++++++++----------------------------------- 1 file changed, 105 insertions(+), 213 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 351f555d..e907823b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -55,9 +55,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.16" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "anstream" @@ -303,7 +303,7 @@ dependencies = [ "ipconfig", "once_cell", "percent-encoding", - "reqwest 0.12.3", + "reqwest", "serde", "serde-tuple-vec-map", "serde_json", @@ -608,9 +608,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.92" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2678b2e3449475e95b0aa6f9b506a28e61b3dc8996592b983695e8ebb58a8b41" +checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" dependencies = [ "jobserver", "libc", @@ -1231,9 +1231,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gix" -version = "0.61.0" +version = "0.62.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4e0e59a44bf00de058ee98d6ecf3c9ed8f8842c1da642258ae4120d41ded8f7" +checksum = "5631c64fb4cd48eee767bf98a3cbc5c9318ef3bb71074d4c099a2371510282b6" dependencies = [ "gix-actor", "gix-attributes", @@ -1279,7 +1279,6 @@ dependencies = [ "gix-worktree-state", "once_cell", "parking_lot", - "reqwest 0.11.27", "smallvec", "thiserror", ] @@ -1361,9 +1360,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.36.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62129c75e4b6229fe15fb9838cdc00c655e87105b651e4edd7c183fc5288b5d1" +checksum = "7580e05996e893347ad04e1eaceb92e1c0e6a3ffe517171af99bf6b6df0ca6e5" dependencies = [ "bstr", "gix-config-value", @@ -1424,9 +1423,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.42.0" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78e605593c2ef74980a534ade0909c7dc57cca72baa30cbb67d2dda621f99ac4" +checksum = "a5fbc24115b957346cd23fb0f47d830eb799c46c89cdcf2f5acc9bf2938c2d01" dependencies = [ "bstr", "gix-hash", @@ -1477,9 +1476,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd71bf3e64d8fb5d5635d4166ca5a36fe56b292ffff06eab1d93ea47fd5beb89" +checksum = "5c0d1f01af62bfd2fb3dd291acc2b29d4ab3e96ad52a679174626508ce98ef12" dependencies = [ "bstr", "encoding_rs", @@ -1498,9 +1497,9 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634b8a743b0aae03c1a74ee0ea24e8c5136895efac64ce52b3ea106e1c6f0613" +checksum = "e2184c40e7910529677831c8b481acf788ffd92427ed21fad65b6aa637e631b8" dependencies = [ "gix-features", "gix-utils", @@ -1554,9 +1553,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.31.1" +version = "0.32.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "549621f13d9ccf325a7de45506a3266af0d08f915181c5687abb5e8669bfd2e6" +checksum = "881ab3b1fa57f497601a5add8289e72a7ae09471fc0b9bbe483b628ae8e418a1" dependencies = [ "bitflags 2.5.0", "bstr", @@ -1638,9 +1637,9 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.59.0" +version = "0.60.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81b55378c719693380f66d9dd21ce46721eed2981d8789fc698ec1ada6fa176e" +checksum = "e8bbb43d2fefdc4701ffdf9224844d05b136ae1b9a73c2f90710c8dd27a93503" dependencies = [ "arc-swap", "gix-date", @@ -1658,9 +1657,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6391aeaa030ad64aba346a9f5c69bb1c4e5c6fb4411705b03b40b49d8614ec30" +checksum = "b58bad27c7677fa6b587aab3a1aca0b6c97373bd371a0a4290677c838c9bcaf1" dependencies = [ "clru", "gix-chunk", @@ -1691,9 +1690,9 @@ dependencies = [ [[package]] name = "gix-packetline-blocking" -version = "0.17.3" +version = "0.17.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca8ef6dd3ea50e26f3bf572e90c034d033c804d340cd1eb386392f184a9ba2f7" +checksum = "c31d42378a3d284732e4d589979930d0d253360eccf7ec7a80332e5ccb77e14a" dependencies = [ "bstr", "faster-hex", @@ -1716,9 +1715,9 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.7.2" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a96ed0e71ce9084a471fddfa74e842576a7cbf02fe8bd50388017ac461aed97" +checksum = "ea9f934a111e0efdf93ae06e3648427e60e783099fbebd6a53a7a2ffb10a1e65" dependencies = [ "bitflags 2.5.0", "bstr", @@ -1744,9 +1743,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.44.2" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a905cd00946ed8ed6f4f2281f98a889c5b3d38361cd94b8d5a5771d25ab33b99" +checksum = "aed3bb6179835a3250403baa9d7022579e559fc45f2efc416d9de1a14b5acf11" dependencies = [ "bstr", "gix-credentials", @@ -1880,15 +1879,15 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b838b2db8f62c9447d483a4c28d251b67fee32741a82cb4d35e9eb4e9fdc5ab" +checksum = "f924267408915fddcd558e3f37295cc7d6a3e50f8bd8b606cee0808c3915157e" [[package]] name = "gix-transport" -version = "0.41.2" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf8e5f72ec9cad9ee44714b9a4ec7427b540a2418b62111f5e3a715bebe1ed9d" +checksum = "9d2f783b2fe86bf2a8cf1f3b8669d65b01ab4932f32cc0101d3893e1b16a3bd6" dependencies = [ "base64 0.21.7", "bstr", @@ -1899,16 +1898,17 @@ dependencies = [ "gix-quote", "gix-sec", "gix-url", - "reqwest 0.11.27", + "reqwest", "thiserror", ] [[package]] name = "gix-traverse" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95aef84bc777025403a09788b1e4815c06a19332e9e5d87a955e1ed7da9bf0cf" +checksum = "f4029ec209b0cc480d209da3837a42c63801dd8548f09c1f4502c60accb62aeb" dependencies = [ + "bitflags 2.5.0", "gix-commitgraph", "gix-date", "gix-hash", @@ -1921,9 +1921,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0b24f3ecc79a5a53539de9c2e99425d0ef23feacdcf3faac983aa9a2f26849" +checksum = "0db829ebdca6180fbe32be7aed393591df6db4a72dbbc0b8369162390954d1cf" dependencies = [ "bstr", "gix-features", @@ -1935,9 +1935,9 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0066432d4c277f9877f091279a597ea5331f68ca410efc874f0bdfb1cd348f92" +checksum = "35192df7fd0fa112263bad8021e2df7167df4cc2a6e6d15892e1e55621d3d4dc" dependencies = [ "fastrand 2.0.2", "unicode-normalization", @@ -1955,9 +1955,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.32.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe78e03af9eec168eb187e05463a981c57f0a915f64b1788685a776bd2ef969c" +checksum = "f06ca5dd164678914fc9280ba9d1ffeb66499ccc16ab1278c513828beee88401" dependencies = [ "bstr", "gix-attributes", @@ -1973,9 +1973,9 @@ dependencies = [ [[package]] name = "gix-worktree-state" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "565809f1694d70953c1524e687cd87b378f133c0af7af6e5813fc3c38b3aa25f" +checksum = "70b4bcac42d5b3197d38e3f15f6eb277c5e6d6a1669c7beabed8f666dba1c9b8" dependencies = [ "bstr", "gix-features", @@ -2028,6 +2028,25 @@ dependencies = [ "tracing", ] +[[package]] +name = "h2" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "816ec7294445779408f36fe57bc5b7fc1cf59664059096c65f905c1c61f58069" +dependencies = [ + "bytes", + "fnv", + "futures-core", + "futures-sink", + "futures-util", + "http 1.1.0", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + [[package]] name = "h3" version = "0.0.2" @@ -2086,9 +2105,9 @@ checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hickory-proto" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "091a6fbccf4860009355e3efc52ff4acf37a63489aad7435372d44ceeb6fbbcf" +checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" dependencies = [ "async-trait", "bytes", @@ -2098,7 +2117,7 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "h2", + "h2 0.3.26", "h3", "h3-quinn", "http 0.2.12", @@ -2122,9 +2141,9 @@ dependencies = [ [[package]] name = "hickory-resolver" -version = "0.24.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35b8f021164e6a984c9030023544c57789c51760065cd510572fedcfb04164e8" +checksum = "28757f23aa75c98f254cf0405e6d8c25b831b32921b050a66692427679b1f243" dependencies = [ "cfg-if", "futures-util", @@ -2186,17 +2205,6 @@ dependencies = [ "itoa", ] -[[package]] -name = "http-body" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" -dependencies = [ - "bytes", - "http 0.2.12", - "pin-project-lite", -] - [[package]] name = "http-body" version = "1.0.0" @@ -2216,7 +2224,7 @@ dependencies = [ "bytes", "futures-core", "http 1.1.0", - "http-body 1.0.0", + "http-body", "pin-project-lite", ] @@ -2240,39 +2248,16 @@ checksum = "5c3b1f728c459d27b12448862017b96ad4767b1ec2ec5e6434e99f1577f085b8" [[package]] name = "hyper" -version = "0.14.28" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf96e135eb83a2a8ddf766e426a841d8ddd7449d5f00d34ea02b41d2f19eef80" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http 0.2.12", - "http-body 0.4.6", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "186548d73ac615b32a73aafe38fb4f56c0d340e110e5a200bcadbaf2e199263a" +checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" dependencies = [ "bytes", "futures-channel", "futures-util", + "h2 0.4.4", "http 1.1.0", - "http-body 1.0.0", + "http-body", "httparse", "itoa", "pin-project-lite", @@ -2281,20 +2266,6 @@ dependencies = [ "want", ] -[[package]] -name = "hyper-rustls" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" -dependencies = [ - "futures-util", - "http 0.2.12", - "hyper 0.14.28", - "rustls 0.21.10", - "tokio", - "tokio-rustls 0.24.1", -] - [[package]] name = "hyper-rustls" version = "0.26.0" @@ -2303,7 +2274,7 @@ checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" dependencies = [ "futures-util", "http 1.1.0", - "hyper 1.2.0", + "hyper", "hyper-util", "rustls 0.22.3", "rustls-pki-types", @@ -2312,19 +2283,6 @@ dependencies = [ "tower-service", ] -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper 0.14.28", - "native-tls", - "tokio", - "tokio-native-tls", -] - [[package]] name = "hyper-tls" version = "0.6.0" @@ -2333,7 +2291,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.2.0", + "hyper", "hyper-util", "native-tls", "tokio", @@ -2351,8 +2309,8 @@ dependencies = [ "futures-channel", "futures-util", "http 1.1.0", - "http-body 1.0.0", - "hyper 1.2.0", + "http-body", + "hyper", "pin-project-lite", "socket2", "tokio", @@ -2451,9 +2409,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.29" +version = "0.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f08474e32172238f2827bd160c67871cdb2801430f65c3979184dc362e3ca118" +checksum = "685a7d121ee3f65ae4fddd72b25a04bb36b6af81bc0828f7d5434c0fe60fa3a2" dependencies = [ "libc", ] @@ -3018,9 +2976,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.79" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e835ff2298f5721608eb1a980ecaee1aef2c132bf95ecc026a11b7bf3c01c02e" +checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" dependencies = [ "unicode-ident", ] @@ -3178,13 +3136,13 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52b1349400e2ffd64a9fb5ed9008e33c0b8ef86bd5bae8f73080839c7082f1d5" +checksum = "4dea9fb2ba3bcc8c51607906e56fe392ba2eb9947dcc84597f26d73f56877c66" dependencies = [ "cfg-if", "rustix", - "windows 0.54.0", + "windows 0.56.0", ] [[package]] @@ -3216,50 +3174,6 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" -[[package]] -name = "reqwest" -version = "0.11.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" -dependencies = [ - "base64 0.21.7", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http 0.2.12", - "http-body 0.4.6", - "hyper 0.14.28", - "hyper-rustls 0.24.2", - "hyper-tls 0.5.0", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls 0.21.10", - "rustls-pemfile 1.0.4", - "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper", - "system-configuration", - "tokio", - "tokio-native-tls", - "tokio-rustls 0.24.1", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "webpki-roots 0.25.4", - "winreg 0.50.0", -] - [[package]] name = "reqwest" version = "0.12.3" @@ -3269,14 +3183,17 @@ dependencies = [ "async-compression", "base64 0.22.0", "bytes", + "encoding_rs", + "futures-channel", "futures-core", "futures-util", + "h2 0.4.4", "http 1.1.0", - "http-body 1.0.0", + "http-body", "http-body-util", - "hyper 1.2.0", - "hyper-rustls 0.26.0", - "hyper-tls 0.6.0", + "hyper", + "hyper-rustls", + "hyper-tls", "hyper-util", "ipnet", "js-sys", @@ -3294,6 +3211,7 @@ dependencies = [ "serde_json", "serde_urlencoded", "sync_wrapper", + "system-configuration", "tokio", "tokio-native-tls", "tokio-rustls 0.25.0", @@ -3304,7 +3222,7 @@ dependencies = [ "wasm-bindgen-futures", "wasm-streams", "web-sys", - "webpki-roots 0.26.1", + "webpki-roots", "winreg 0.52.0", ] @@ -3547,9 +3465,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.197" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" dependencies = [ "serde_derive", ] @@ -3565,9 +3483,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.198" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" dependencies = [ "proc-macro2", "quote", @@ -3576,9 +3494,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.115" +version = "1.0.116" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12dc5c46daa8e9fdf4f5e71b6cf9a53f2487da0e86e55808e2d35539666497dd" +checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" dependencies = [ "itoa", "ryu", @@ -3670,9 +3588,9 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27be740d8cf080ede6b7c48d62c96936521975c0b5d937cf750e16890bbf91a5" +checksum = "86d82bd3d05ee8c01cbfa587587acbb4d1f18a41c7b84a92eda8a6c8ab5a091e" dependencies = [ "compact_str", "derive_destructure2", @@ -3785,9 +3703,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.58" +version = "2.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44cfb93f38070beee36b3fef7d4f5a16f27751d94b187b666a5cc5e9b0d30687" +checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" dependencies = [ "proc-macro2", "quote", @@ -4062,9 +3980,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.9" +version = "0.22.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e40bb779c5187258fd7aad0eb68cb8706a0a81fa712fbea808ab43c4b8374c4" +checksum = "fb686a972ccef8537b39eead3968b0e8616cb5040dbb9bba93007c8e07c9215f" dependencies = [ "indexmap", "serde", @@ -4427,12 +4345,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki-roots" -version = "0.25.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f20c57d8d7db6d3b86154206ae5d8fba62dd39573114de97c2cb0578251f8e1" - [[package]] name = "webpki-roots" version = "0.26.1" @@ -4488,33 +4400,13 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows" -version = "0.54.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9252e5725dbed82865af151df558e754e4a3c2c30818359eb17465f1346a1b49" -dependencies = [ - "windows-core 0.54.0", - "windows-targets 0.52.5", -] - [[package]] name = "windows" version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" dependencies = [ - "windows-core 0.56.0", - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-core" -version = "0.54.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12661b9c89351d684a50a8a643ce5f608e20243b9fb84687800163429f161d65" -dependencies = [ - "windows-result", + "windows-core", "windows-targets 0.52.5", ] From f45dd80b4d433afa0c64cd161ad3d0e2698a42aa Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 Apr 2024 11:54:12 +1000 Subject: [PATCH 1697/2020] build(deps): bump rustls from 0.21.10 to 0.21.11 (#1663) Bumps [rustls](https://github.com/rustls/rustls) from 0.21.10 to 0.21.11. - [Release notes](https://github.com/rustls/rustls/releases) - [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustls/rustls/compare/v/0.21.10...v/0.21.11) --- updated-dependencies: - dependency-name: rustls dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e907823b..d8fe780f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2128,7 +2128,7 @@ dependencies = [ "quinn", "rand", "ring 0.16.20", - "rustls 0.21.10", + "rustls 0.21.11", "rustls-pemfile 1.0.4", "thiserror", "tinyvec", @@ -2154,7 +2154,7 @@ dependencies = [ "parking_lot", "rand", "resolv-conf", - "rustls 0.21.10", + "rustls 0.21.11", "smallvec", "thiserror", "tokio", @@ -3010,7 +3010,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.21.10", + "rustls 0.21.11", "thiserror", "tokio", "tracing", @@ -3026,7 +3026,7 @@ dependencies = [ "rand", "ring 0.16.20", "rustc-hash", - "rustls 0.21.10", + "rustls 0.21.11", "slab", "thiserror", "tinyvec", @@ -3302,9 +3302,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.10" +version = "0.21.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9d5a6813c0759e4609cd494e8e725babae6a2ca7b62a5536a13daaec6fcb7ba" +checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" dependencies = [ "log", "ring 0.17.8", @@ -3901,7 +3901,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.10", + "rustls 0.21.11", "tokio", ] From 55024b07711ae1abd2d73c9eb15452db0b29882b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 20 Apr 2024 02:12:40 +0000 Subject: [PATCH 1698/2020] build(deps): bump the deps group with 2 updates (#1664) Bumps the deps group with 2 updates: [toml_edit](https://github.com/toml-rs/toml) and [cargo_toml](https://gitlab.com/lib.rs/cargo_toml). Updates `toml_edit` from 0.22.11 to 0.22.12 - [Commits](https://github.com/toml-rs/toml/compare/v0.22.11...v0.22.12) Updates `cargo_toml` from 0.19.2 to 0.20.0 - [Commits](https://gitlab.com/lib.rs/cargo_toml/compare/v0.19.2...v0.20.0) --- updated-dependencies: - dependency-name: toml_edit dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: cargo_toml dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d8fe780f..a7070158 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -589,9 +589,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.19.2" +version = "0.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a98356df42a2eb1bd8f1793ae4ee4de48e384dd974ce5eac8eee802edb7492be" +checksum = "e1ce9b2c7d2f95999f29c0b761cdddf8e6d0d41a2ed662621b5a557f364a495e" dependencies = [ "serde", "toml", @@ -3980,9 +3980,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.11" +version = "0.22.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb686a972ccef8537b39eead3968b0e8616cb5040dbb9bba93007c8e07c9215f" +checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" dependencies = [ "indexmap", "serde", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 85dfe070..139590be 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -21,7 +21,7 @@ serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.107" thiserror = "1.0.52" -toml_edit = { version = "0.22.4", features = ["serde"] } +toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 2f9e51c4..514581e0 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -39,7 +39,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } -toml_edit = { version = "0.22.4", features = ["serde"] } +toml_edit = { version = "0.22.12", features = ["serde"] } binstalk-downloader = { version = "0.10.1", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 46569657..463c181f 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Jiahao XU "] license = "Apache-2.0 OR MIT" [dependencies] -cargo_toml = "0.19.1" +cargo_toml = "0.20.0" compact_str = { version = "0.7.0", features = ["serde"] } glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } From fda8cac41a075910988b94364fc899a011052e1c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 24 Apr 2024 17:32:39 +1000 Subject: [PATCH 1699/2020] Bump reqwest to 0.12.4 and enable feature zstd (#1667) to support compression using zstd. Also enable `http2` (which is now enabled by other deps of this crate). Signed-off-by: Jiahao XU --- Cargo.lock | 4 ++-- crates/binstalk-downloader/Cargo.toml | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a7070158..41fb2e98 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3176,9 +3176,9 @@ checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" [[package]] name = "reqwest" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e6cc1e89e689536eb5aeede61520e874df5a4707df811cd5da4aa5fbb2aae19" +checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ "async-compression", "base64 0.22.0", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 9a73b638..a6966689 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -35,8 +35,10 @@ flate2 = { version = "1.0.28", default-features = false } futures-util = "0.3.30" futures-io = "0.3.30" httpdate = "1.0.2" -reqwest = { version = "0.12.0", features = [ +reqwest = { version = "0.12.4", features = [ + "http2", "stream", + "zstd", "gzip", "brotli", "deflate", From ecd89428978b3fff9fbb4c3148a094bbcc78ea2a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 26 Apr 2024 03:31:43 +0000 Subject: [PATCH 1700/2020] dep: Upgrade transitive dependencies (#1670) Co-authored-by: github-actions --- Cargo.lock | 92 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 51 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 41fb2e98..8c6f213b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -589,9 +589,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1ce9b2c7d2f95999f29c0b761cdddf8e6d0d41a2ed662621b5a557f364a495e" +checksum = "c8cb1d556b8b8f36e5ca74938008be3ac102f5dcb5b68a0477e4249ae2291cd3" dependencies = [ "serde", "toml", @@ -608,12 +608,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f6e324229dc011159fcc089755d1e2e216a90d43a7dea6853ca740b84f35e7" +checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" dependencies = [ "jobserver", "libc", + "once_cell", ] [[package]] @@ -2276,7 +2277,7 @@ dependencies = [ "http 1.1.0", "hyper", "hyper-util", - "rustls 0.22.3", + "rustls 0.22.4", "rustls-pki-types", "tokio", "tokio-rustls 0.25.0", @@ -2409,9 +2410,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.30" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "685a7d121ee3f65ae4fddd72b25a04bb36b6af81bc0828f7d5434c0fe60fa3a2" +checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" dependencies = [ "libc", ] @@ -2495,9 +2496,9 @@ checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libmimalloc-sys" -version = "0.1.35" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3979b5c37ece694f1f5e51e7ecc871fdb0f517ed04ee45f88d15d6d553cb9664" +checksum = "81eb4061c0582dedea1cbc7aff2240300dd6982e0239d1c99e65c1dbf4a30ba7" dependencies = [ "cc", "libc", @@ -2537,9 +2538,9 @@ checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" dependencies = [ "autocfg", "scopeguard", @@ -2651,9 +2652,9 @@ dependencies = [ [[package]] name = "mimalloc" -version = "0.1.39" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa01922b5ea280a911e323e4d2fd24b7fe5cc4042e0d2cda3c40775cdc4bdc9c" +checksum = "9f41a2280ded0da56c8cf898babb86e8f10651a34adcfff190ae9a1159c6908d" dependencies = [ "libmimalloc-sys", ] @@ -2891,9 +2892,9 @@ checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" -version = "0.12.1" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" dependencies = [ "lock_api", "parking_lot_core", @@ -2901,15 +2902,15 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.9.9" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c42a9226546d68acdd9c0a280d17ce19bfe27a46bf68784e4066115788d008e" +checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", + "redox_syscall 0.5.1", "smallvec", - "windows-targets 0.48.5", + "windows-targets 0.52.5", ] [[package]] @@ -3123,6 +3124,15 @@ dependencies = [ "bitflags 1.3.2", ] +[[package]] +name = "redox_syscall" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +dependencies = [ + "bitflags 2.5.0", +] + [[package]] name = "redox_users" version = "0.4.5" @@ -3136,9 +3146,9 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dea9fb2ba3bcc8c51607906e56fe392ba2eb9947dcc84597f26d73f56877c66" +checksum = "7c3138c30c59ed9b8572f82bed97ea591ecd7e45012566046cc39e72679cff22" dependencies = [ "cfg-if", "rustix", @@ -3203,7 +3213,7 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.22.3", + "rustls 0.22.4", "rustls-native-certs", "rustls-pemfile 2.1.2", "rustls-pki-types", @@ -3289,9 +3299,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.32" +version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65e04861e65f21776e67888bfbea442b3642beaa0138fdb1dd7a84a52dffdb89" +checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.5.0", "errno 0.3.8", @@ -3314,14 +3324,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.3" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99008d7ad0bbbea527ec27bddbc0e432c5b87d8175178cee68d2eec9c4a1813c" +checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" dependencies = [ "log", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.2", + "rustls-webpki 0.102.3", "subtle", "zeroize", ] @@ -3360,9 +3370,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd36cc4259e3e4514335c4a138c6b43171a8d61d8f5c9348f9fc7529416f247" +checksum = "beb461507cee2c2ff151784c52762cf4d9ff6a61f3e80968600ed24fa837fa54" [[package]] name = "rustls-webpki" @@ -3376,9 +3386,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.2" +version = "0.102.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faaa0a62740bedb9b2ef5afa303da42764c012f743917351dc9a237ea1663610" +checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -3579,9 +3589,9 @@ checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" [[package]] name = "signal-hook-registry" -version = "1.4.1" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" +checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" dependencies = [ "libc", ] @@ -3780,18 +3790,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03468839009160513471e86a034bb2c5c0e4baae3b43f79ffc55c4a5427b3297" +checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.58" +version = "1.0.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61f3ba182994efc43764a46c018c347bc492c79f024e705f46567b418f6d4f7" +checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" dependencies = [ "proc-macro2", "quote", @@ -3911,7 +3921,7 @@ version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" dependencies = [ - "rustls 0.22.3", + "rustls 0.22.4", "rustls-pki-types", "tokio", ] @@ -4378,11 +4388,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] [[package]] From 3198712328ed4fae1fab1736091241ecd92c6703 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 2 May 2024 15:27:20 +1000 Subject: [PATCH 1701/2020] Bump release-pr to v2.1.1 (#1672) --- .github/workflows/release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 7e2f6614..b5398fd0 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -46,7 +46,7 @@ jobs: with: tool: cargo-release,cargo-semver-checks - - uses: cargo-bins/release-pr@v2 + - uses: cargo-bins/release-pr@v2.1.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} version: ${{ inputs.version }} From 65a3c2c918a760a626b9b024c6aaaab67b4464ca Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 09:02:44 +0000 Subject: [PATCH 1702/2020] release: detect-targets v0.1.16 (#1674) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8c6f213b..4e56d37c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -861,7 +861,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.15" +version = "0.1.16" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 139590be..4f907b3a 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.15", path = "../detect-targets" } +detect-targets = { version = "0.1.16", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 87ea8afc..162cb46b 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -22,7 +22,7 @@ binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "5.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } -detect-targets = { version = "0.1.15", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.16", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 08f40576..e48e7f1b 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.15" +version = "0.1.16" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From d515e11a8bd89e4f86f7db24e2471f05a656831c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 09:08:24 +0000 Subject: [PATCH 1703/2020] release: binstalk-downloader v0.10.2 (#1675) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4e56d37c..11a90023 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -284,7 +284,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.10.1" +version = "0.10.2" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index a6966689..9296a145 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.10.1" +version = "0.10.2" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index a929a94b..f5089514 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.10.1", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.10.2", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } @@ -30,7 +30,7 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.10.1", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.10.2", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 514581e0..3438a249 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.10.1", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.10.2", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } @@ -40,7 +40,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.10.1", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.10.2", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 162cb46b..b7abd4b3 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.10.1", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.10.2", path = "../binstalk-downloader", default-features = false, features = [ "gh-api-client", ] } binstalk-fetchers = { version = "0.4.0", path = "../binstalk-fetchers", features = [ From a9fad9fce4e70087566db88a46a30ab8d7ae1596 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 10:22:24 +0000 Subject: [PATCH 1704/2020] release: cargo-toml-workspace v6.0.0 (#1676) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 11a90023..7c9c877c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -561,7 +561,7 @@ dependencies = [ [[package]] name = "cargo-toml-workspace" -version = "5.0.0" +version = "6.0.0" dependencies = [ "cargo_toml", "compact_str", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 3438a249..56a128a1 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -17,7 +17,7 @@ binstalk-downloader = { version = "0.10.2", path = "../binstalk-downloader", def "json", ] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } -cargo-toml-workspace = { version = "5.0.0", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "6.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.7.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index b7abd4b3..cea6e680 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -19,7 +19,7 @@ binstalk-fetchers = { version = "0.4.0", path = "../binstalk-fetchers", features ] } binstalk-registry = { version = "0.7.0", path = "../binstalk-registry" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } -cargo-toml-workspace = { version = "5.0.0", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "6.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } detect-targets = { version = "0.1.16", path = "../detect-targets", features = [ diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 463c181f..346d2a8c 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-toml-workspace" -version = "5.0.0" +version = "6.0.0" edition = "2021" description = "Parse cargo workspace and load specific crate" repository = "https://github.com/cargo-bins/cargo-binstall" From ce5f37738f2e7a9184306a54034a96bcda011c37 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 11:15:21 +0000 Subject: [PATCH 1705/2020] release: binstalk-registry v0.8.0 (#1677) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7c9c877c..6a88e59c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -364,7 +364,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.7.0" +version = "0.8.0" dependencies = [ "async-trait", "base16", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 56a128a1..e24eaa96 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.7.0" +version = "0.8.0" edition = "2021" rust-version = "1.65.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index cea6e680..1376021d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -17,7 +17,7 @@ binstalk-downloader = { version = "0.10.2", path = "../binstalk-downloader", def binstalk-fetchers = { version = "0.4.0", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.7.0", path = "../binstalk-registry" } +binstalk-registry = { version = "0.8.0", path = "../binstalk-registry" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } From aaaa2b1387427836845b8d62e2290cc5ccbacc63 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 2 May 2024 22:06:53 +1000 Subject: [PATCH 1706/2020] release: atomic-file-install v1.0.3 (#1673) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/atomic-file-install/Cargo.toml | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6a88e59c..07652f2a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -173,7 +173,7 @@ dependencies = [ [[package]] name = "atomic-file-install" -version = "1.0.2" +version = "1.0.3" dependencies = [ "reflink-copy", "tempfile", diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index 421933a6..4fdcf09e 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "atomic-file-install" -version = "1.0.2" +version = "1.0.3" edition = "2021" description = "For atomically installing a file or a symlink." repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 1a920595..1ecfbba4 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -11,7 +11,7 @@ authors = ["Jiahao XU "] license = "GPL-3.0-only" [dependencies] -atomic-file-install = { version = "1.0.2", path = "../atomic-file-install" } +atomic-file-install = { version = "1.0.3", path = "../atomic-file-install" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } leon = "3.0.0" From 6ef3b665f4b7b216c4edf3488124af4b068e7ca0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 3 May 2024 09:03:12 +1000 Subject: [PATCH 1707/2020] Fix clippy lint error in 1.78.0 (#1679) * Bump msrv of binstalk-downloader to 1.70.0 * Fix trait bound in multiple places for copy_file_to_mpsc * Rm super-trait trait bounds for FusedStream * Bump detect-targets msrv to 1.62.0 * Bump cargo-binstall msrv to 1.70.0 --- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-downloader/src/download.rs | 2 +- crates/binstalk-downloader/src/download/zip_extraction.rs | 2 +- crates/detect-targets/Cargo.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 20b2f5ef..75df8b89 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -4,7 +4,7 @@ description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" version = "1.6.4" -rust-version = "1.65.0" +rust-version = "1.70.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 9296a145..f5d57668 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -4,7 +4,7 @@ description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" version = "0.10.2" -rust-version = "1.65.0" +rust-version = "1.70.0" authors = ["ryan "] edition = "2021" license = "Apache-2.0 OR MIT" diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index 4bb26d82..c1b7f59e 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -143,7 +143,7 @@ impl<'a> Download<'a> { async fn get_stream( self, ) -> Result< - impl Stream> + FusedStream + Send + Sync + Unpin + 'a, + impl FusedStream> + Send + Sync + Unpin + 'a, DownloadError, > { let mut data_verifier = self.data_verifier; diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index 329c0695..1cf028ad 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -142,7 +142,7 @@ where Ok(()) } -async fn copy_file_to_mpsc( +async fn copy_file_to_mpsc( mut entry_reader: R, tx: mpsc::Sender, buf: &mut BytesMut, diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index e48e7f1b..b2f2bac1 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -4,7 +4,7 @@ description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" version = "0.1.16" -rust-version = "1.61.0" +rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" From 2d856bf1c0f5aa75f0208bf921cd01b8d6947b8e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 3 May 2024 09:44:23 +1000 Subject: [PATCH 1708/2020] Speedup ci by using personal access token for testing (#1680) * Use secrets,CI_TEST_GITHUB_TOKEN for testing in ci.yml * Run e2e-test in release-packages.yml using secrets.CI_TEST_GITHUB_TOKEN * Use CI_RELEASE_TEST_GITHUB_TOKEN in e2e-test in release-packages.yml --- .github/workflows/ci.yml | 2 +- .github/workflows/release-packages.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6964748f..0bbae3c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -60,7 +60,7 @@ jobs: - run: just test env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CI_TEST_GITHUB_TOKEN }} cross-check: strategy: diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index e031981f..ed218a8f 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -83,7 +83,7 @@ jobs: if: "matrix.r" run: just e2e-tests env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN }} - uses: actions/download-artifact@v4 with: From bf077e1e3aeb884d091e0d376d726834a00402d0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 3 May 2024 00:19:19 +0000 Subject: [PATCH 1709/2020] release: binstalk-downloader v0.10.3 (#1684) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 07652f2a..ad8d3a10 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -284,7 +284,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.10.2" +version = "0.10.3" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index f5d57668..c72aced9 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.10.2" +version = "0.10.3" rust-version = "1.70.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index f5089514..3b5d77ff 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.10.2", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } @@ -30,7 +30,7 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.10.2", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index e24eaa96..fb0f224b 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.10.2", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } @@ -40,7 +40,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.10.2", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 1376021d..e6aa2a1e 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.10.2", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader", default-features = false, features = [ "gh-api-client", ] } binstalk-fetchers = { version = "0.4.0", path = "../binstalk-fetchers", features = [ From 27bc4a2d2aa5c757e2d869805cfb75a4fabd9bec Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 3 May 2024 10:29:20 +1000 Subject: [PATCH 1710/2020] release: detect-targets v0.1.17 (#1682) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ad8d3a10..f7605b64 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -861,7 +861,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.16" +version = "0.1.17" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 4f907b3a..c4a96ad0 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.16", path = "../detect-targets" } +detect-targets = { version = "0.1.17", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index e6aa2a1e..5136af93 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -22,7 +22,7 @@ binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.7.0", features = ["serde"] } -detect-targets = { version = "0.1.16", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.17", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index b2f2bac1..00ffe458 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.16" +version = "0.1.17" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" From 11f5feac089254ab92dc5e0f6ac9c70e78ace01e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 3 May 2024 02:07:00 +0000 Subject: [PATCH 1711/2020] release: binstalk v0.23.0 (#1678) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f7605b64..e83ff490 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -240,7 +240,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.22.0" +version = "0.23.0" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 75df8b89..26e7c10f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.22.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.23.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.13.0" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 5136af93..74fe2dd1 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.22.0" +version = "0.23.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From 25a21830cc74160242381ac449cd8ea55f906ed3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 3 May 2024 15:43:23 +1000 Subject: [PATCH 1712/2020] dep: Upgrade transitive dependencies (#1685) Co-authored-by: github-actions --- Cargo.lock | 119 ++++++++++++++++++++++++++++------------------------- 1 file changed, 63 insertions(+), 56 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e83ff490..d92fa30c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,47 +61,48 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "anstream" -version = "0.6.13" +version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d96bd03f33fe50a863e394ee9718a706f988b9079b20c3784fb726e7678b62fb" +checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", + "is_terminal_polyfill", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.6" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8901269c6307e8d93993578286ac0edf7f195079ffff5ebdeea6a59ffb7e36bc" +checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" [[package]] name = "anstyle-parse" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" +checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" +checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.2" +version = "3.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" +checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -127,9 +128,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-compression" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07dbbf24db18d609b1462965249abdf49129ccad073ec257da372adc83259c60" +checksum = "4e9eabd7a98fe442131a17c316bd9349c43695e49e730c3c8e12cfb5f4da2693" dependencies = [ "brotli", "bzip2", @@ -225,9 +226,9 @@ checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "base64" -version = "0.22.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9475866fec1451be56a3c2400fd081ff546538961565ccb5b7142cbd22bc7a51" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "beef" @@ -437,9 +438,9 @@ dependencies = [ [[package]] name = "brotli" -version = "4.0.0" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "125740193d7fee5cc63ab9e16c2fdc4e07c74ba755cc53b327d6ea029e9fc569" +checksum = "19483b140a7ac7174d34b5a581b406c64f84da5409d3e09cf4fff604f9270e67" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -448,9 +449,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "3.0.0" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65622a320492e09b5e0ac436b14c54ff68199bac392d0e89a6832c4518eea525" +checksum = "e6221fe77a248b9117d431ad93761222e1cf8ff282d9d1d5d9f53d6299a1cf76" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -608,9 +609,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d32a725bc159af97c3e629873bb9f88fb8cf8a4867175f76dc987815ea07c83b" +checksum = "065a29261d53ba54260972629f9ca6bffa69bac13cd1fed61420f7fa68b9f8bd" dependencies = [ "jobserver", "libc", @@ -665,9 +666,9 @@ checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" [[package]] name = "clru" -version = "0.6.1" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8191fa7302e03607ff0e237d4246cc043ff5b3cb9409d995172ba3bea16b807" +checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" [[package]] name = "cmake" @@ -680,9 +681,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" +checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" [[package]] name = "command-group" @@ -812,9 +813,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "default-net" @@ -1021,9 +1022,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.2" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bd65b1cf4c852a3cc96f18a8ce7b5640f6b703f905c7d74532294c2a63984" +checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "file-format" @@ -1045,9 +1046,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" dependencies = [ "crc32fast", "libz-ng-sys", @@ -1155,7 +1156,7 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.0.2", + "fastrand 2.1.0", "futures-core", "futures-io", "parking", @@ -1940,7 +1941,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35192df7fd0fa112263bad8021e2df7167df4cc2a6e6d15892e1e55621d3d4dc" dependencies = [ - "fastrand 2.0.2", + "fastrand 2.1.0", "unicode-normalization", ] @@ -2078,9 +2079,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" dependencies = [ "ahash", "allocator-api2", @@ -2129,7 +2130,7 @@ dependencies = [ "quinn", "rand", "ring 0.16.20", - "rustls 0.21.11", + "rustls 0.21.12", "rustls-pemfile 1.0.4", "thiserror", "tinyvec", @@ -2155,7 +2156,7 @@ dependencies = [ "parking_lot", "rand", "resolv-conf", - "rustls 0.21.11", + "rustls 0.21.12", "smallvec", "thiserror", "tokio", @@ -2393,6 +2394,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" +[[package]] +name = "is_terminal_polyfill" +version = "1.70.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" + [[package]] name = "itertools" version = "0.12.1" @@ -2490,9 +2497,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.154" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" [[package]] name = "libmimalloc-sys" @@ -3011,7 +3018,7 @@ dependencies = [ "quinn-proto", "quinn-udp", "rustc-hash", - "rustls 0.21.11", + "rustls 0.21.12", "thiserror", "tokio", "tracing", @@ -3027,7 +3034,7 @@ dependencies = [ "rand", "ring 0.16.20", "rustc-hash", - "rustls 0.21.11", + "rustls 0.21.12", "slab", "thiserror", "tinyvec", @@ -3191,7 +3198,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" dependencies = [ "async-compression", - "base64 0.22.0", + "base64 0.22.1", "bytes", "encoding_rs", "futures-channel", @@ -3312,9 +3319,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.21.11" +version = "0.21.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fecbfb7b1444f477b345853b1fce097a2c6fb637b2bfb87e6bc5db0f043fae4" +checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" dependencies = [ "log", "ring 0.17.8", @@ -3364,7 +3371,7 @@ version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ - "base64 0.22.0", + "base64 0.22.1", "rustls-pki-types", ] @@ -3475,9 +3482,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.198" +version = "1.0.200" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9846a40c979031340571da2545a4e5b7c4163bdae79b301d5f86d03979451fcc" +checksum = "ddc6f9cc94d67c0e21aaf7eda3a010fd3af78ebf6e096aa6e2e13c79749cce4f" dependencies = [ "serde_derive", ] @@ -3493,9 +3500,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.198" +version = "1.0.200" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e88edab869b01783ba905e7d0153f9fc1a6505a96e4ad3018011eedb838566d9" +checksum = "856f046b9400cee3c8c94ed572ecdb752444c24528c035cd35882aad6f492bcb" dependencies = [ "proc-macro2", "quote", @@ -3633,9 +3640,9 @@ checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" [[package]] name = "socket2" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05ffd9c0a93b7543e062e759284fcf5f5e3b098501104bfbdde4d404db792871" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", "windows-sys 0.52.0", @@ -3762,7 +3769,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" dependencies = [ "cfg-if", - "fastrand 2.0.2", + "fastrand 2.1.0", "rustix", "windows-sys 0.52.0", ] @@ -3911,7 +3918,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" dependencies = [ - "rustls 0.21.11", + "rustls 0.21.12", "tokio", ] @@ -4154,9 +4161,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" [[package]] name = "untrusted" @@ -4604,9 +4611,9 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c976aaaa0e1f90dbb21e9587cdaf1d9679a1cde8875c0d6bd83ab96a208352" +checksum = "14b9415ee827af173ebb3f15f9083df5a122eb93572ec28741fb153356ea2578" dependencies = [ "memchr", ] From dfdaf6952e30a0fc88fe8f8afc4906244bdeccf8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 3 May 2024 08:19:06 +0000 Subject: [PATCH 1713/2020] release: cargo-binstall v1.6.5 (#1686) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d92fa30c..3f8609ab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -524,7 +524,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.6.4" +version = "1.6.5" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 26e7c10f..690b7ff7 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.6.4" +version = "1.6.5" rust-version = "1.70.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index cddd6f98..ae28aca4 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 331e0efb51dedfd786ca115219186119e35a70e9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 10 May 2024 03:38:43 +0000 Subject: [PATCH 1714/2020] dep: Upgrade transitive dependencies (#1695) Co-authored-by: github-actions --- Cargo.lock | 117 ++++++++++++++++++++++++++--------------------------- 1 file changed, 58 insertions(+), 59 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3f8609ab..8da655c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -110,9 +110,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f538837af36e6f6a9be0faa67f9a314f8119e4e4b5867c6ab40ed60360142519" +checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" [[package]] name = "arc-swap" @@ -128,9 +128,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-compression" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e9eabd7a98fe442131a17c316bd9349c43695e49e730c3c8e12cfb5f4da2693" +checksum = "9c90a406b4495d129f00461241616194cb8a032c8d1c53c657f0961d5f8e0498" dependencies = [ "brotli", "bzip2", @@ -184,9 +184,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1fdabc7756949593fe60f30ec81974b613357de856987752631dea1e3394c80" +checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" @@ -438,9 +438,9 @@ dependencies = [ [[package]] name = "brotli" -version = "5.0.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19483b140a7ac7174d34b5a581b406c64f84da5409d3e09cf4fff604f9270e67" +checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -609,9 +609,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.96" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "065a29261d53ba54260972629f9ca6bffa69bac13cd1fed61420f7fa68b9f8bd" +checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" dependencies = [ "jobserver", "libc", @@ -987,9 +987,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1094,9 +1094,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21dabded2e32cd57ded879041205c60a4a4c4bab47bd0fd2fa8b01f30849f02b" +checksum = "73969b81e8bc90a3828d913dd3973d80771bfb9d7fbe1a78a79122aad456af15" dependencies = [ "rustix", "windows-sys 0.52.0", @@ -1216,9 +1216,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -2922,9 +2922,9 @@ dependencies = [ [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "percent-encoding" @@ -2984,9 +2984,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.81" +version = "1.0.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1597b0c024618f09a9c3b8655b7e430397a36d23fdafec26d6965e9eec3eba" +checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" dependencies = [ "unicode-ident", ] @@ -3285,9 +3285,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -3311,7 +3311,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ "bitflags 2.5.0", - "errno 0.3.8", + "errno 0.3.9", "libc", "linux-raw-sys", "windows-sys 0.52.0", @@ -3377,9 +3377,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.5.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beb461507cee2c2ff151784c52762cf4d9ff6a61f3e80968600ed24fa837fa54" +checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" [[package]] name = "rustls-webpki" @@ -3404,15 +3404,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80af6f9131f277a45a3fba6ce8e2258037bb0477a67e610d3c1fe046ab31de47" +checksum = "092474d1a01ea8278f69e6a358998405fae5b8b963ddaeb2b0b04a128bf1dfb0" [[package]] name = "ryu" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e86697c916019a8588c99b5fac3cead74ec0b4b819707a682fd4d23fa0ce1ba1" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "same-file" @@ -3450,11 +3450,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770452e37cad93e0a50d5abc3990d2bc351c36d0328f86cefec2f2fb206eaef6" +checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.5.0", "core-foundation", "core-foundation-sys", "libc", @@ -3463,9 +3463,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.10.0" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41f3cc463c0ef97e11c3461a9d3787412d30e8e7eb907c79180c4a57bf7c04ef" +checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" dependencies = [ "core-foundation-sys", "libc", @@ -3473,18 +3473,18 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.22" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.200" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc6f9cc94d67c0e21aaf7eda3a010fd3af78ebf6e096aa6e2e13c79749cce4f" +checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" dependencies = [ "serde_derive", ] @@ -3500,9 +3500,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.200" +version = "1.0.201" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "856f046b9400cee3c8c94ed572ecdb752444c24528c035cd35882aad6f492bcb" +checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" dependencies = [ "proc-macro2", "quote", @@ -3511,9 +3511,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.116" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" dependencies = [ "itoa", "ryu", @@ -3555,9 +3555,9 @@ dependencies = [ [[package]] name = "sha1-asm" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ba6947745e7f86be3b8af00b7355857085dbdf8901393c89514510eb61f4e21" +checksum = "286acebaf8b67c1130aedffad26f594eff0c1292389158135327d2e23aed582b" dependencies = [ "cc", ] @@ -3720,9 +3720,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.60" +version = "2.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "909518bc7b1c9b779f1bbf07f2929d35af9f0f37e47c6e9ef7f9dddc1e1821f3" +checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" dependencies = [ "proc-macro2", "quote", @@ -3797,18 +3797,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.59" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0126ad08bff79f29fc3ae6a55cc72352056dfff61e3ff8bb7129476d44b23aa" +checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.59" +version = "1.0.60" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cd413b5d558b4c5bf3680e324a6fa5014e7b7c067a51e69dbdf47eb7148b66" +checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" dependencies = [ "proc-macro2", "quote", @@ -3961,9 +3961,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" dependencies = [ "bytes", "futures-core", @@ -3971,7 +3971,6 @@ dependencies = [ "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] @@ -4611,9 +4610,9 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b9415ee827af173ebb3f15f9083df5a122eb93572ec28741fb153356ea2578" +checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" dependencies = [ "memchr", ] @@ -4669,18 +4668,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" +checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.32" +version = "0.7.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" +checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" dependencies = [ "proc-macro2", "quote", From e74127b04e8b63a0c7d67abd7b2f4172b012102d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 11 May 2024 11:43:39 +1000 Subject: [PATCH 1715/2020] build(deps): bump file-format from 0.24.0 to 0.25.0 in the deps group (#1696) Bumps the deps group with 1 update: [file-format](https://github.com/mmalecot/file-format). Updates `file-format` from 0.24.0 to 0.25.0 - [Release notes](https://github.com/mmalecot/file-format/releases) - [Changelog](https://github.com/mmalecot/file-format/blob/main/CHANGELOG.md) - [Commits](https://github.com/mmalecot/file-format/compare/v0.24.0...v0.25.0) --- updated-dependencies: - dependency-name: file-format dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8da655c4..09aae034 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1028,9 +1028,9 @@ checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" [[package]] name = "file-format" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ba1b81b3c213cf1c071f8bf3b83531f310df99642e58c48247272eef006cae5" +checksum = "9ffe3a660c3a1b10e96f304a9413d673b2118d62e4520f7ddf4a4faccfe8b9b9" [[package]] name = "filetime" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 690b7ff7..a6748926 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -27,7 +27,7 @@ binstalk-manifests = { path = "../binstalk-manifests", version = "0.13.0" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.7.0" dirs = "5.0.1" -file-format = { version = "0.24.0", default-features = false } +file-format = { version = "0.25.0", default-features = false } home = "0.5.9" log = { version = "0.4.18", features = ["std"] } miette = "7.0.0" From 496eda84391a637c2ee6f2d4fe4dc7cbb56ab314 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 11 May 2024 03:35:50 +0000 Subject: [PATCH 1716/2020] release: cargo-binstall v1.6.6 (#1697) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 09aae034..2fe923cc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -524,7 +524,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.6.5" +version = "1.6.6" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index a6748926..0fd624cd 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.6.5" +version = "1.6.6" rust-version = "1.70.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index ae28aca4..0f227200 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From ec08340fc3de3d1de2d27d9a9dd672946629760b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 17 May 2024 09:03:37 +0000 Subject: [PATCH 1717/2020] dep: Upgrade transitive dependencies (#1703) Co-authored-by: github-actions --- Cargo.lock | 62 +++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2fe923cc..2dc4a2e8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -515,9 +515,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" dependencies = [ "serde", ] @@ -929,9 +929,9 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "either" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47c1c47d2f5964e29c61246e81db715514cd532db6b5116a25ea3c03d6780a2" +checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" [[package]] name = "embed-resource" @@ -1216,9 +1216,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" dependencies = [ "cfg-if", "libc", @@ -1413,9 +1413,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180b130a4a41870edfbd36ce4169c7090bca70e195da783dea088dd973daa59c" +checksum = "367ee9093b0c2b04fd04c5c7c8b6a1082713534eab537597ae343663a518fa99" dependencies = [ "bstr", "itoa", @@ -2497,9 +2497,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.154" +version = "0.2.153" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae743338b92ff9146ce83992f766a31066a91a8c84a45e0e9f21e7cf6de6d346" +checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" [[package]] name = "libmimalloc-sys" @@ -2539,9 +2539,9 @@ checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" [[package]] name = "linux-raw-sys" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "lock_api" @@ -3338,7 +3338,7 @@ dependencies = [ "log", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.3", + "rustls-webpki 0.102.4", "subtle", "zeroize", ] @@ -3393,9 +3393,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.3" +version = "0.102.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3bce581c0dd41bce533ce695a1437fa16a7ab5ac3ccfa99fe1a620a7885eabf" +checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -3404,9 +3404,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "092474d1a01ea8278f69e6a358998405fae5b8b963ddaeb2b0b04a128bf1dfb0" +checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" [[package]] name = "ryu" @@ -3482,9 +3482,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.201" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "780f1cebed1629e4753a1a38a3c72d30b97ec044f0aef68cb26650a3c5cf363c" +checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" dependencies = [ "serde_derive", ] @@ -3500,9 +3500,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.201" +version = "1.0.202" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5e405930b9796f1c00bee880d03fc7e0bb4b9a11afc776885ffe84320da2865" +checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" dependencies = [ "proc-macro2", "quote", @@ -3522,9 +3522,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" +checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" dependencies = [ "serde", ] @@ -3720,9 +3720,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.61" +version = "2.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +checksum = "7ad3dee41f36859875573074334c200d1add8e4a87bb37113ebd31d926b7b11f" dependencies = [ "proc-macro2", "quote", @@ -3975,9 +3975,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.12" +version = "0.8.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9dd1545e8208b4a5af1aa9bbd0b4cf7e9ea08fabc5d0a5c67fcaafa17433aa3" +checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" dependencies = [ "serde", "serde_spanned", @@ -3987,18 +3987,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.12" +version = "0.22.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3328d4f68a705b2a4498da1d580585d39a6510f98318a2cec3018a7ec61ddef" +checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" dependencies = [ "indexmap", "serde", From 45307909c39f8e59566e02ab00e5a706cfa71304 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 18 May 2024 13:28:12 +1000 Subject: [PATCH 1718/2020] build(deps): bump the deps group with 2 updates (#1704) Bumps the deps group with 2 updates: [itertools](https://github.com/rust-itertools/itertools) and [thiserror](https://github.com/dtolnay/thiserror). Updates `itertools` from 0.12.1 to 0.13.0 - [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-itertools/itertools/compare/v0.12.1...v0.13.0) Updates `thiserror` from 1.0.60 to 1.0.61 - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.60...1.0.61) --- updated-dependencies: - dependency-name: itertools dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 12 ++++++------ crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 4 ++-- crates/cargo-toml-workspace/Cargo.toml | 2 +- 8 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2dc4a2e8..7ba8c932 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2402,9 +2402,9 @@ checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" [[package]] name = "itertools" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -3797,18 +3797,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.60" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.60" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 1ecfbba4..acbef433 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -17,5 +17,5 @@ compact_str = { version = "0.7.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } -thiserror = "1.0.52" +thiserror = "1.0.61" tracing = "0.1.39" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index c72aced9..f176a872 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -53,7 +53,7 @@ serde_json = { version = "1.0.107", optional = true } #tar = "0.4.38" tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.5.0" -thiserror = "1.0.52" +thiserror = "1.0.61" tokio = { version = "1.35.0", features = [ "macros", "rt-multi-thread", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 3b5d77ff..e73a46a1 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -17,14 +17,14 @@ binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } either = "1.11.0" -itertools = "0.12.0" +itertools = "0.13.0" leon = "3.0.0" leon-macros = "1.0.1" miette = "7.0.0" minisign-verify = "0.2.1" once_cell = "1.18.0" strum = "0.26.1" -thiserror = "1.0.52" +thiserror = "1.0.61" tokio = { version = "1.35.0", features = ["rt", "sync"], default-features = false } tracing = "0.1.39" url = "2.3.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index c4a96ad0..b66070ea 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -20,7 +20,7 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.107" -thiserror = "1.0.52" +thiserror = "1.0.61" toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index fb0f224b..2a3f5516 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -29,7 +29,7 @@ serde_json = "1.0.107" sha2 = "0.10.7" simple-git = { version = "0.2.4", optional = true } tempfile = "3.5.0" -thiserror = "1.0.52" +thiserror = "1.0.61" tokio = { version = "1.35.0", features = [ "rt", "sync", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 74fe2dd1..9a8fbe18 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -26,7 +26,7 @@ detect-targets = { version = "0.1.17", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" -itertools = "0.12.0" +itertools = "0.13.0" jobslot = { version = "0.2.11", features = ["tokio"] } leon = "3.0.0" maybe-owned = "0.3.4" @@ -36,7 +36,7 @@ simple-git = { version = "0.2.4", optional = true } strum = "0.26.1" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" -thiserror = "1.0.52" +thiserror = "1.0.61" tokio = { version = "1.35.0", features = [ "rt", "process", diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 346d2a8c..6c6fca80 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -15,7 +15,7 @@ compact_str = { version = "0.7.0", features = ["serde"] } glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } serde = "1.0.163" -thiserror = "1.0.52" +thiserror = "1.0.61" tracing = "0.1.39" [dev-dependencies] From abc0dbee67f7751c8ddb7443222bc37ee0b7bb42 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 18 May 2024 04:23:54 +0000 Subject: [PATCH 1719/2020] release: binstalk-fetchers v0.4.1 (#1705) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7ba8c932..3deda604 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -321,7 +321,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.4.0" +version = "0.4.1" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index e73a46a1..5f48a7b2 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.4.0" +version = "0.4.1" edition = "2021" description = "The binstall fetchers" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 9a8fbe18..c9c2a5d0 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -14,7 +14,7 @@ binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader", default-features = false, features = [ "gh-api-client", ] } -binstalk-fetchers = { version = "0.4.0", path = "../binstalk-fetchers", features = [ +binstalk-fetchers = { version = "0.4.1", path = "../binstalk-fetchers", features = [ "quickinstall", ] } binstalk-registry = { version = "0.8.0", path = "../binstalk-registry" } From 6cede2e8dc9228f3e8f4438d116eed9e0741533b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 18 May 2024 05:20:48 +0000 Subject: [PATCH 1720/2020] release: binstalk v0.23.1 (#1706) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3deda604..291a2339 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -241,7 +241,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.23.0" +version = "0.23.1" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 0fd624cd..a428efd3 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.23.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.23.1", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.13.0" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index c9c2a5d0..12409e0c 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.23.0" +version = "0.23.1" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From 4545b16e0b5874e42e87976bd3ccaedf420c1615 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 18 May 2024 06:13:50 +0000 Subject: [PATCH 1721/2020] release: cargo-binstall v1.6.7 (#1707) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 291a2339..7deabd94 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -524,7 +524,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.6.6" +version = "1.6.7" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index a428efd3..a4ec57fc 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.6.6" +version = "1.6.7" rust-version = "1.70.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 0f227200..acc2b0d2 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 88b4dd4e6584845c43c49d1f886517df7ec48767 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 May 2024 08:40:07 +0000 Subject: [PATCH 1722/2020] dep: Upgrade transitive dependencies (#1709) Co-authored-by: github-actions --- Cargo.lock | 193 ++++++++++++++++++++++++++++------------------------- 1 file changed, 101 insertions(+), 92 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7deabd94..65f5609a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -110,9 +110,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.83" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25bdb32cbbdce2b519a9cd7df3a678443100e265d5e25ca763b7572a5104f5f3" +checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" [[package]] name = "arc-swap" @@ -182,6 +182,12 @@ dependencies = [ "windows 0.56.0", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "autocfg" version = "1.3.0" @@ -609,9 +615,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.97" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099a5357d84c4c61eb35fc8eafa9a79a902c2f76911e5747ced4e032edd8d9b4" +checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" dependencies = [ "jobserver", "libc", @@ -738,9 +744,9 @@ dependencies = [ [[package]] name = "crc32fast" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3855a8a784b474f333699ef2bbca9db2c4a1f6d9088a90a2d25b1eb53111eaa" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] @@ -760,9 +766,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab3db02a9c5b5121e1e42fbdb1aeb65f5e02624cc58c43f2884c6ccac0b82f95" +checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" dependencies = [ "crossbeam-utils", ] @@ -797,9 +803,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" +checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" [[package]] name = "crypto-common" @@ -1216,9 +1222,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94b22e06ecb0110981051723910cbf0b5f5e09a2062dd7663334ee79a9d1286c" +checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", "libc", @@ -1233,9 +1239,9 @@ checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" [[package]] name = "gix" -version = "0.62.0" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5631c64fb4cd48eee767bf98a3cbc5c9318ef3bb71074d4c099a2371510282b6" +checksum = "984c5018adfa7a4536ade67990b3ebc6e11ab57b3d6cd9968de0947ca99b4b06" dependencies = [ "gix-actor", "gix-attributes", @@ -1287,9 +1293,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.31.1" +version = "0.31.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c3a3bde455ad2ee8ba8a195745241ce0b770a8a26faae59fcf409d01b28c46" +checksum = "d69c59d392c7e6c94385b6fd6089d6df0fe945f32b4357687989f3aee253cd7f" dependencies = [ "bstr", "gix-date", @@ -1336,9 +1342,9 @@ dependencies = [ [[package]] name = "gix-command" -version = "0.3.6" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f90009020dc4b3de47beed28e1334706e0a330ddd17f5cfeb097df3b15a54b77" +checksum = "6c22e086314095c43ffe5cdc5c0922d5439da4fd726f3b0438c56147c34dc225" dependencies = [ "bstr", "gix-path", @@ -1362,9 +1368,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.36.1" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7580e05996e893347ad04e1eaceb92e1c0e6a3ffe517171af99bf6b6df0ca6e5" +checksum = "53fafe42957e11d98e354a66b6bd70aeea00faf2f62dd11164188224a507c840" dependencies = [ "bstr", "gix-config-value", @@ -1425,9 +1431,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.43.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5fbc24115b957346cd23fb0f47d830eb799c46c89cdcf2f5acc9bf2938c2d01" +checksum = "40b9bd8b2d07b6675a840b56a6c177d322d45fa082672b0dad8f063b25baf0a4" dependencies = [ "bstr", "gix-hash", @@ -1437,9 +1443,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.31.0" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64bab49087ed3710caf77e473dc0efc54ca33d8ccc6441359725f121211482b1" +checksum = "fc27c699b63da66b50d50c00668bc0b7e90c3a382ef302865e891559935f3dbf" dependencies = [ "bstr", "dunce", @@ -1453,9 +1459,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.38.1" +version = "0.38.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db4254037d20a247a0367aa79333750146a369719f0c6617fec4f5752cc62b37" +checksum = "ac7045ac9fe5f9c727f38799d002a7ed3583cd777e3322a7c4b43e3cf437dc69" dependencies = [ "bytes", "bytesize", @@ -1478,9 +1484,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c0d1f01af62bfd2fb3dd291acc2b29d4ab3e96ad52a679174626508ce98ef12" +checksum = "00ce6ea5ac8fca7adbc63c48a1b9e0492c222c386aa15f513405f1003f2f4ab2" dependencies = [ "bstr", "encoding_rs", @@ -1499,10 +1505,11 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.10.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2184c40e7910529677831c8b481acf788ffd92427ed21fad65b6aa637e631b8" +checksum = "3f78f7d6dcda7a5809efd73a33b145e3dce7421c460df21f32126f9732736b0c" dependencies = [ + "fastrand 2.1.0", "gix-features", "gix-utils", ] @@ -1555,9 +1562,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.32.1" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "881ab3b1fa57f497601a5add8289e72a7ae09471fc0b9bbe483b628ae8e418a1" +checksum = "2d8c5a5f1c58edcbc5692b174cda2703aba82ed17d7176ff4c1752eb48b1b167" dependencies = [ "bitflags 2.5.0", "bstr", @@ -1571,6 +1578,7 @@ dependencies = [ "gix-object", "gix-traverse", "gix-utils", + "gix-validate", "hashbrown", "itoa", "libc", @@ -1582,9 +1590,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "13.1.1" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7c359f81f01b8352063319bcb39789b7ea0887b406406381106e38c4a34d049" +checksum = "e3bc7fe297f1f4614774989c00ec8b1add59571dc9b024b4c00acb7dedd4e19d" dependencies = [ "gix-tempfile", "gix-utils", @@ -1593,9 +1601,9 @@ dependencies = [ [[package]] name = "gix-macros" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1dff438f14e67e7713ab9332f5fd18c8f20eb7eb249494f6c2bf170522224032" +checksum = "999ce923619f88194171a67fb3e6d613653b8d4d6078b529b15a765da0edcc17" dependencies = [ "proc-macro2", "quote", @@ -1604,9 +1612,9 @@ dependencies = [ [[package]] name = "gix-negotiate" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54ba98f8c8c06870dfc167d192ca38a38261867b836cb89ac80bc9176dba975e" +checksum = "d57dec54544d155a495e01de947da024471e1825d7d3f2724301c07a310d6184" dependencies = [ "bitflags 2.5.0", "gix-commitgraph", @@ -1620,9 +1628,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d4f8efae72030df1c4a81d02dbe2348e748d9b9a11e108ed6efbd846326e051" +checksum = "1fe2dc4a41191c680c942e6ebd630c8107005983c4679214fdb1007dcf5ae1df" dependencies = [ "bstr", "gix-actor", @@ -1639,9 +1647,9 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.60.0" +version = "0.61.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8bbb43d2fefdc4701ffdf9224844d05b136ae1b9a73c2f90710c8dd27a93503" +checksum = "e92b9790e2c919166865d0825b26cc440a387c175bed1b43a2fa99c0e9d45e98" dependencies = [ "arc-swap", "gix-date", @@ -1659,9 +1667,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.50.0" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b58bad27c7677fa6b587aab3a1aca0b6c97373bd371a0a4290677c838c9bcaf1" +checksum = "7a8da51212dbff944713edb2141ed7e002eea326b8992070374ce13a6cb610b3" dependencies = [ "clru", "gix-chunk", @@ -1717,9 +1725,9 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea9f934a111e0efdf93ae06e3648427e60e783099fbebd6a53a7a2ffb10a1e65" +checksum = "a76cab098dc10ba2d89f634f66bf196dea4d7db4bf10b75c7a9c201c55a2ee19" dependencies = [ "bitflags 2.5.0", "bstr", @@ -1732,9 +1740,9 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5325eb17ce7b5e5d25dec5c2315d642a09d55b9888b3bf46b7d72e1621a55d8" +checksum = "fddabbc7c51c241600ab3c4623b19fa53bde7c1a2f637f61043ed5fcadf000cc" dependencies = [ "gix-command", "gix-config-value", @@ -1745,9 +1753,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.45.0" +version = "0.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aed3bb6179835a3250403baa9d7022579e559fc45f2efc416d9de1a14b5acf11" +checksum = "3c140d4c6d209048826bad78f021a01b612830f89da356efeb31afe8957f8bee" dependencies = [ "bstr", "gix-credentials", @@ -1774,9 +1782,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.43.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd4aba68b925101cb45d6df328979af0681364579db889098a0de75b36c77b65" +checksum = "0b36752b448647acd59c9668fdd830b16d07db1e6d9c3b3af105c1605a6e23d9" dependencies = [ "gix-actor", "gix-date", @@ -1810,9 +1818,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.27.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e34196e1969bd5d36e2fbc4467d893999132219d503e23474a8ad2b221cb1e8" +checksum = "63e08f8107ed1f93a83bcfbb4c38084c7cb3f6cd849793f1d5eec235f9b13b2b" dependencies = [ "bstr", "gix-date", @@ -1826,9 +1834,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7d393ae814eeaae41a333c0ff684b243121cc61ccdc5bbe9897094588047d" +checksum = "4181db9cfcd6d1d0fd258e91569dbb61f94cb788b441b5294dd7f1167a3e788f" dependencies = [ "gix-commitgraph", "gix-date", @@ -1853,9 +1861,9 @@ dependencies = [ [[package]] name = "gix-submodule" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb7ea05666362472fecd44c1fc35fe48a5b9b841b431cc4f85b95e6f20c23ec" +checksum = "921cd49924ac14b6611b22e5fb7bbba74d8780dc7ad26153304b64d1272460ac" dependencies = [ "bstr", "gix-config", @@ -1868,9 +1876,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "13.1.1" +version = "14.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a761d76594f4443b675e85928e4902dec333273836bd386906f01e7e346a0d11" +checksum = "d3b0e276cd08eb2a22e9f286a4f13a222a01be2defafa8621367515375644b99" dependencies = [ "gix-fs", "libc", @@ -1887,11 +1895,11 @@ checksum = "f924267408915fddcd558e3f37295cc7d6a3e50f8bd8b606cee0808c3915157e" [[package]] name = "gix-transport" -version = "0.42.0" +version = "0.42.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d2f783b2fe86bf2a8cf1f3b8669d65b01ab4932f32cc0101d3893e1b16a3bd6" +checksum = "eb0ffa5f869977f5b9566399154055902f05d7e85c787d5eacf551acdd0c4adf" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "bstr", "gix-command", "gix-credentials", @@ -1906,9 +1914,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.39.0" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4029ec209b0cc480d209da3837a42c63801dd8548f09c1f4502c60accb62aeb" +checksum = "f20cb69b63eb3e4827939f42c05b7756e3488ef49c25c412a876691d568ee2a0" dependencies = [ "bitflags 2.5.0", "gix-commitgraph", @@ -1947,9 +1955,9 @@ dependencies = [ [[package]] name = "gix-validate" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e39fc6e06044985eac19dd34d474909e517307582e462b2eb4c8fa51b6241545" +checksum = "82c27dd34a49b1addf193c92070bcbf3beaf6e10f16a78544de6372e146a0acf" dependencies = [ "bstr", "thiserror", @@ -1957,9 +1965,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.33.1" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f06ca5dd164678914fc9280ba9d1ffeb66499ccc16ab1278c513828beee88401" +checksum = "53f6b7de83839274022aff92157d7505f23debf739d257984a300a35972ca94e" dependencies = [ "bstr", "gix-attributes", @@ -1971,13 +1979,14 @@ dependencies = [ "gix-index", "gix-object", "gix-path", + "gix-validate", ] [[package]] name = "gix-worktree-state" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70b4bcac42d5b3197d38e3f15f6eb277c5e6d6a1669c7beabed8f666dba1c9b8" +checksum = "e64b2835892ce553b15aef7f6f7bb1e39e146fdf71eb99609b86710a7786cf34" dependencies = [ "bstr", "gix-features", @@ -2032,15 +2041,15 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "816ec7294445779408f36fe57bc5b7fc1cf59664059096c65f905c1c61f58069" +checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" dependencies = [ + "atomic-waker", "bytes", "fnv", "futures-core", "futures-sink", - "futures-util", "http 1.1.0", "indexmap", "slab", @@ -2257,7 +2266,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.4", + "h2 0.4.5", "http 1.1.0", "http-body", "httparse", @@ -2353,9 +2362,9 @@ dependencies = [ [[package]] name = "instant" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" dependencies = [ "cfg-if", ] @@ -2497,15 +2506,15 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.153" +version = "0.2.155" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libmimalloc-sys" -version = "0.1.37" +version = "0.1.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81eb4061c0582dedea1cbc7aff2240300dd6982e0239d1c99e65c1dbf4a30ba7" +checksum = "0e7bb23d733dfcc8af652a78b7bf232f0e967710d044732185e561e47c0336b6" dependencies = [ "cc", "libc", @@ -2659,9 +2668,9 @@ dependencies = [ [[package]] name = "mimalloc" -version = "0.1.41" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f41a2280ded0da56c8cf898babb86e8f10651a34adcfff190ae9a1159c6908d" +checksum = "e9186d86b79b52f4a77af65604b51225e8db1d6ee7e3f41aec1e40829c71a176" dependencies = [ "libmimalloc-sys", ] @@ -2680,9 +2689,9 @@ checksum = "933dca44d65cdd53b355d0b73d380a2ff5da71f87f036053188bf1eab6a19881" [[package]] name = "miniz_oxide" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d811f3e15f28568be3407c8e7fdb6514c1cda3cb30683f15b6a1a1dc4ea14a7" +checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" dependencies = [ "adler", ] @@ -2984,9 +2993,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.82" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" dependencies = [ "unicode-ident", ] @@ -3204,7 +3213,7 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2 0.4.4", + "h2 0.4.5", "http 1.1.0", "http-body", "http-body-util", @@ -3605,9 +3614,9 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86d82bd3d05ee8c01cbfa587587acbb4d1f18a41c7b84a92eda8a6c8ab5a091e" +checksum = "967718707829012b2a32af27feeee10fc6a5d450957491ae234ce0a6ab415f32" dependencies = [ "compact_str", "derive_destructure2", @@ -3720,9 +3729,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.64" +version = "2.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ad3dee41f36859875573074334c200d1add8e4a87bb37113ebd31d926b7b11f" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" dependencies = [ "proc-macro2", "quote", From 2d221debd81c80879aba2f339e22e3b62d2146a6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 25 May 2024 01:39:17 +0000 Subject: [PATCH 1723/2020] release: cargo-binstall v1.6.8 (#1710) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 65f5609a..5e165d30 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -530,7 +530,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.6.7" +version = "1.6.8" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index a4ec57fc..dbc7780f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.6.7" +version = "1.6.8" rust-version = "1.70.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index acc2b0d2..71cfcd6f 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 734c24b9266969c7d5f06ad526d366e16fa5c1a7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 31 May 2024 09:19:59 +0000 Subject: [PATCH 1724/2020] dep: Upgrade transitive dependencies (#1713) Co-authored-by: github-actions --- Cargo.lock | 78 ++++++++++++++++++++++++++---------------------------- 1 file changed, 38 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5e165d30..235f73b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" dependencies = [ "gimli", ] @@ -128,9 +128,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-compression" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c90a406b4495d129f00461241616194cb8a032c8d1c53c657f0961d5f8e0498" +checksum = "cd066d0b4ef8ecb03a55319dc13aa6910616d0f44008a045bb1835af830abff5" dependencies = [ "brotli", "bzip2", @@ -196,9 +196,9 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.71" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b05800d2e817c8b3b4b54abd461726265fa9789ae34330622f2db9ee696f9d" +checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" dependencies = [ "addr2line", "cc", @@ -455,9 +455,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "4.0.0" +version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6221fe77a248b9117d431ad93761222e1cf8ff282d9d1d5d9f53d6299a1cf76" +checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -1233,9 +1233,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.28.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "gix" @@ -1505,9 +1505,9 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f78f7d6dcda7a5809efd73a33b145e3dce7421c460df21f32126f9732736b0c" +checksum = "c3338ff92a2164f5209f185ec0cd316f571a72676bb01d27e22f2867ba69f77a" dependencies = [ "fastrand 2.1.0", "gix-features", @@ -1516,9 +1516,9 @@ dependencies = [ [[package]] name = "gix-glob" -version = "0.16.2" +version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "682bdc43cb3c00dbedfcc366de2a849b582efd8d886215dbad2ea662ec156bb5" +checksum = "c2a29ad0990cf02c48a7aac76ed0dbddeb5a0d070034b83675cc3bbf937eace4" dependencies = [ "bitflags 2.5.0", "bstr", @@ -1782,9 +1782,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.44.0" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b36752b448647acd59c9668fdd830b16d07db1e6d9c3b3af105c1605a6e23d9" +checksum = "3394a2997e5bc6b22ebc1e1a87b41eeefbcfcff3dbfa7c4bd73cb0ac8f1f3e2e" dependencies = [ "gix-actor", "gix-date", @@ -2312,9 +2312,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca38ef113da30126bbff9cd1705f9273e15d45498615d138b0c20279ac7a76aa" +checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" dependencies = [ "bytes", "futures-channel", @@ -2709,11 +2709,10 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -2825,9 +2824,9 @@ dependencies = [ [[package]] name = "object" -version = "0.32.2" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a622008b6e321afc04970976f62ee297fdbaa6f95318ca343e3eebb9648441" +checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" dependencies = [ "memchr", ] @@ -2908,9 +2907,9 @@ checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" [[package]] name = "parking_lot" -version = "0.12.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e4af0ca4f6caed20e900d564c242b8e5d4903fdacf31d3daf527b66fe6f42fb" +checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" dependencies = [ "lock_api", "parking_lot_core", @@ -2993,9 +2992,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.83" +version = "1.0.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b33eb56c327dec362a9e55b3ad14f9d2f0904fb5a5b03b513ab5465399e9f43" +checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" dependencies = [ "unicode-ident", ] @@ -3491,9 +3490,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.202" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226b61a0d411b2ba5ff6d7f73a476ac4f8bb900373459cd00fab8512828ba395" +checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" dependencies = [ "serde_derive", ] @@ -3509,9 +3508,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.202" +version = "1.0.203" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6048858004bcff69094cd972ed40a32500f153bd3be9f716b2eed2e8217c4838" +checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" dependencies = [ "proc-macro2", "quote", @@ -3884,9 +3883,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" dependencies = [ "backtrace", "bytes", @@ -3902,9 +3901,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" dependencies = [ "proc-macro2", "quote", @@ -4029,7 +4028,6 @@ dependencies = [ "tokio", "tower-layer", "tower-service", - "tracing", ] [[package]] @@ -4619,9 +4617,9 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3c52e9c97a68071b23e836c9380edae937f17b9c4667bd021973efc689f618d" +checksum = "86c949fede1d13936a99f14fafd3e76fd642b556dd2ce96287fbe2e0151bfac6" dependencies = [ "memchr", ] @@ -4697,9 +4695,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" [[package]] name = "zstd" From dc229e7fc7d76a872835635af279ec875e497e33 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 7 Jun 2024 03:51:09 +0000 Subject: [PATCH 1725/2020] dep: Upgrade transitive dependencies (#1715) Co-authored-by: github-actions --- Cargo.lock | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 235f73b0..510002b9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -91,9 +91,9 @@ dependencies = [ [[package]] name = "anstyle-query" -version = "1.0.3" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a64c907d4e79225ac72e2a354c9ce84d50ebb4586dee56c82b3ee73004f537f5" +checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" dependencies = [ "windows-sys 0.52.0", ] @@ -632,9 +632,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.4" +version = "4.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90bc066a67923782aa8515dbaea16946c5bcc5addbd668bb80af688e53e548a0" +checksum = "a9689a29b593160de5bc4aacab7b5d54fb52231de70122626c178e6a368994c7" dependencies = [ "clap_builder", "clap_derive", @@ -642,9 +642,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.2" +version = "4.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae129e2e766ae0ec03484e609954119f123cc1fe650337e155d03b022f24f7b4" +checksum = "2e5387378c84f6faa26890ebf9f0a92989f8873d4d380467bcd0d8d8620424df" dependencies = [ "anstream", "anstyle", @@ -654,9 +654,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.4" +version = "4.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "528131438037fd55894f62d6e9f068b8f45ac57ffa77517819645d10aed04f64" +checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -666,9 +666,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98cc8fbded0c607b7ba9dd60cd98df59af97e84d24e49c8557331cfc26d301ce" +checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" [[package]] name = "clru" @@ -2992,9 +2992,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.84" +version = "1.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec96c6a92621310b51366f1e28d05ef11489516e93be030060e5fc12024a49d6" +checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" dependencies = [ "unicode-ident", ] @@ -3688,11 +3688,11 @@ checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" [[package]] name = "strum_macros" -version = "0.26.2" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.4.1", + "heck 0.5.0", "proc-macro2", "quote", "rustversion", @@ -3983,9 +3983,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.13" +version = "0.8.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4e43f8cc456c9704c851ae29c67e17ef65d2c30017c17a9765b89c382dc8bba" +checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" dependencies = [ "serde", "serde_spanned", @@ -4004,9 +4004,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.13" +version = "0.22.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c127785850e8c20836d49732ae6abfa47616e60bf9d9f57c43c250361a9db96c" +checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" dependencies = [ "indexmap", "serde", @@ -4167,9 +4167,9 @@ dependencies = [ [[package]] name = "unicode-width" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f5e5f3158ecfd4b8ff6fe086db7c8467a2dfdac97fe420f2b7c4aa97af66d6" +checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" [[package]] name = "untrusted" @@ -4370,9 +4370,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3de34ae270483955a94f4b21bdaaeb83d508bb84a01435f393818edb0012009" +checksum = "3c452ad30530b54a4d8e71952716a212b08efd0f3562baa66c29a618b07da7c3" dependencies = [ "rustls-pki-types", ] @@ -4617,9 +4617,9 @@ checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" [[package]] name = "winnow" -version = "0.6.9" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86c949fede1d13936a99f14fafd3e76fd642b556dd2ce96287fbe2e0151bfac6" +checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" dependencies = [ "memchr", ] From ed173e2b5fd3fa6b629ea7ba7db4a5b5f323aed9 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 8 Jun 2024 01:31:46 +0000 Subject: [PATCH 1726/2020] build(deps): bump windows from 0.56.0 to 0.57.0 in the deps group (#1716) Bumps the deps group with 1 update: [windows](https://github.com/microsoft/windows-rs). Updates `windows` from 0.56.0 to 0.57.0 - [Release notes](https://github.com/microsoft/windows-rs/releases) - [Commits](https://github.com/microsoft/windows-rs/compare/0.56.0...0.57.0) --- updated-dependencies: - dependency-name: windows dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 52 ++++++++++++++++++++++++--- crates/atomic-file-install/Cargo.toml | 2 +- 2 files changed, 49 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 510002b9..e9e717ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -179,7 +179,7 @@ dependencies = [ "reflink-copy", "tempfile", "tracing", - "windows 0.56.0", + "windows 0.57.0", ] [[package]] @@ -4429,7 +4429,17 @@ version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" dependencies = [ - "windows-core", + "windows-core 0.56.0", + "windows-targets 0.52.5", +] + +[[package]] +name = "windows" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" +dependencies = [ + "windows-core 0.57.0", "windows-targets 0.52.5", ] @@ -4439,8 +4449,20 @@ version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" dependencies = [ - "windows-implement", - "windows-interface", + "windows-implement 0.56.0", + "windows-interface 0.56.0", + "windows-result", + "windows-targets 0.52.5", +] + +[[package]] +name = "windows-core" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" +dependencies = [ + "windows-implement 0.57.0", + "windows-interface 0.57.0", "windows-result", "windows-targets 0.52.5", ] @@ -4456,6 +4478,17 @@ dependencies = [ "syn", ] +[[package]] +name = "windows-implement" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "windows-interface" version = "0.56.0" @@ -4467,6 +4500,17 @@ dependencies = [ "syn", ] +[[package]] +name = "windows-interface" +version = "0.57.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "windows-result" version = "0.1.1" diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index 4fdcf09e..38d00841 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -15,4 +15,4 @@ tempfile = "3.5.0" tracing = "0.1.39" [target.'cfg(windows)'.dependencies] -windows = { version = "0.56.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } +windows = { version = "0.57.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } From bd058392bb5eb6b11f6e7bc4c4fa98230a0d51f6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 8 Jun 2024 02:46:07 +0000 Subject: [PATCH 1727/2020] dep: Upgrade transitive dependencies (#1717) Co-authored-by: github-actions --- Cargo.lock | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e9e717ff..a1baf1c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -412,13 +412,13 @@ dependencies = [ [[package]] name = "binstall-tar" -version = "0.4.39" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01db907e07c37309ea816c183ffe548daaa66ef640a291408f232d6ca4089dbb" +checksum = "e3620d72763b5d8df3384f3b2ec47dc5885441c2abbd94dd32197167d08b014a" dependencies = [ "filetime", "libc", - "xattr 0.2.3", + "xattr", ] [[package]] @@ -615,9 +615,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.98" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41c270e7540d725e65ac7f1b212ac8ce349719624d7bcff99f8e2e488e8cf03f" +checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" dependencies = [ "jobserver", "libc", @@ -3964,7 +3964,7 @@ dependencies = [ "redox_syscall 0.3.5", "tokio", "tokio-stream", - "xattr 1.3.1", + "xattr", ] [[package]] @@ -4513,9 +4513,9 @@ dependencies = [ [[package]] name = "windows-result" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "749f0da9cc72d82e600d8d2e44cadd0b9eedb9038f71a1c58556ac1c5791813b" +checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" dependencies = [ "windows-targets 0.52.5", ] @@ -4688,15 +4688,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "xattr" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d1526bbe5aaeb5eb06885f4d987bcdfa5e23187055de9b83fe00156a821fabc" -dependencies = [ - "libc", -] - [[package]] name = "xattr" version = "1.3.1" From 02dbe215007bff00f1b591a879f5ccd5dda3d43c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 8 Jun 2024 13:41:59 +1000 Subject: [PATCH 1728/2020] release: atomic-file-install v1.0.4 (#1718) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/atomic-file-install/Cargo.toml | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a1baf1c1..703f1cc8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -174,7 +174,7 @@ dependencies = [ [[package]] name = "atomic-file-install" -version = "1.0.3" +version = "1.0.4" dependencies = [ "reflink-copy", "tempfile", diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index 38d00841..c05a43a6 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "atomic-file-install" -version = "1.0.3" +version = "1.0.4" edition = "2021" description = "For atomically installing a file or a symlink." repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index acbef433..31626f6f 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -11,7 +11,7 @@ authors = ["Jiahao XU "] license = "GPL-3.0-only" [dependencies] -atomic-file-install = { version = "1.0.3", path = "../atomic-file-install" } +atomic-file-install = { version = "1.0.4", path = "../atomic-file-install" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } leon = "3.0.0" From 48ee0b0e3e646f7f0cfb2428f46dbcd32afe979b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 8 Jun 2024 16:00:33 +1000 Subject: [PATCH 1729/2020] release: cargo-binstall v1.6.9 (#1719) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 703f1cc8..d8bcb685 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -530,7 +530,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.6.8" +version = "1.6.9" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index dbc7780f..a67b2ad9 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.6.8" +version = "1.6.9" rust-version = "1.70.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 71cfcd6f..6468006d 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 1dbd2460a35a730c36b8afe6b051631d6f0da7cc Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 10 Jun 2024 16:02:12 +1000 Subject: [PATCH 1730/2020] Support private github repository (#1690) * Refactor: Create new crate binstalk-git-repo-api Signed-off-by: Jiahao XU * Fix CI lint warnings Signed-off-by: Jiahao XU * Fix `just check`: Rm deleted features from `cargo-hack` check Signed-off-by: Jiahao XU * Refactor: Extract new mod error Signed-off-by: Jiahao XU * Ret artifact url in `has_release_artifact` So that we can use it to download from private repositories. Signed-off-by: Jiahao XU * Move `test_graph_ql_error_type` to mod `error` Signed-off-by: Jiahao XU * Fix running `cargo test` in `binstalk-git-repo-api`` Signed-off-by: Jiahao XU * Remove unnecessary import in mod `error::test` Signed-off-by: Jiahao XU * Rename mod `request`` to `release_artifacts` Signed-off-by: Jiahao XU * Impl draft version of fetching repo info Signed-off-by: Jiahao XU * Refactor: Move `HasReleaseArtifacts` failure variants into `GhApiError` Signed-off-by: Jiahao XU * Refactor: Use `GhRepo` in `GhRelease` Signed-off-by: Jiahao XU * Fix testing Signed-off-by: Jiahao XU * Refactor: Return `'static` future Signed-off-by: Jiahao XU * Refactor: Make sure `'static` Future is returned To make it easier to create generic function Signed-off-by: Jiahao XU * Add logging to unit testing Signed-off-by: Jiahao XU * Fix unit testing Signed-off-by: Jiahao XU * Refactor: Extract new fn `GhApiClient::do_fetch` Signed-off-by: Jiahao XU * Rm unused `percent_encode_http_url_path` Signed-off-by: Jiahao XU * Fix `cargo test` run on CI `cargo test` run all tests in one process. As such, `set_global_default` would fail on the second call. Signed-off-by: Jiahao XU * Optimize `GhApiClient::do_fetch`: Avoid unnecessary restful API call Signed-off-by: Jiahao XU * Refactor: Rm param `auth_token` for restful API fn which is always set to `None` Signed-off-by: Jiahao XU * Impl new API `GhApiClient::get_repo_info` Signed-off-by: Jiahao XU * Fix unit test for `GhApiClient::get_repo_info` Signed-off-by: Jiahao XU * Refactor testing: Parameter-ize testing Signed-off-by: Jiahao XU * Parallelise `test_get_repo_info` Signed-off-by: Jiahao XU * Refactor: Create parameter-ised `test_has_release_artifact` Signed-off-by: Jiahao XU * Parallelize `test_has_release_artifact` Signed-off-by: Jiahao XU * Refactor: `gh_api_client::test::create_client` shall not be `async` as there is no `.await` in it. Signed-off-by: Jiahao XU * Return `Url` in `GhApiClient::has_release_artifact` Signed-off-by: Jiahao XU * Impl new API `GhApiClient::download_artifact` Signed-off-by: Jiahao XU * Remove unused deps added to binstalk-git-repo-api Signed-off-by: Jiahao XU * Fix clippy lints Signed-off-by: Jiahao XU * Add new API `GhApiClient::remote_client` Signed-off-by: Jiahao XU * Add `GhApiClient::has_gh_token` Signed-off-by: Jiahao XU * Add `GhRepo::try_extract_from_url` Signed-off-by: Jiahao XU * Rename `ReleaseArtifactUrl` to `GhReleaseArtifactUrl` Signed-off-by: Jiahao XU * Add new fn `Download::with_data_verifier` Signed-off-by: Jiahao XU * feature: Support private repository Signed-off-by: Jiahao XU * Fix clippy lints Signed-off-by: Jiahao XU * Add e2e-test/private-github-repo Signed-off-by: Jiahao XU * Fix clippy lints Signed-off-by: Jiahao XU * Fix `launch_baseline_find_tasks`: Retry on rate limit Signed-off-by: Jiahao XU * Fix test failure: Retry on rate limit Signed-off-by: Jiahao XU * Temporarily enable debug output for e2e-test-private-github-repo Signed-off-by: Jiahao XU * Fix `get_repo_info`: Retry on rate limit Signed-off-by: Jiahao XU * Improve `debug!` logging Signed-off-by: Jiahao XU * Add more debug logging Signed-off-by: Jiahao XU * Add more debugging Signed-off-by: Jiahao XU * Add more debug logging Signed-off-by: Jiahao XU * Apply suggestions from code review * Fix compilation Signed-off-by: Jiahao XU * Fix cargo fmt Signed-off-by: Jiahao XU * Add crate binstalk-git-repo-api to release-pr.yml * Update crates/binstalk-git-repo-api/Cargo.toml * Apply suggestions from code review * Update crates/binstalk/Cargo.toml --------- Signed-off-by: Jiahao XU --- .github/workflows/release-pr.yml | 1 + Cargo.lock | 23 +- Cargo.toml | 1 + crates/binstalk-downloader/Cargo.toml | 3 - crates/binstalk-downloader/src/download.rs | 76 +- .../binstalk-downloader/src/gh_api_client.rs | 506 ------------- .../src/gh_api_client/request.rs | 447 ----------- crates/binstalk-downloader/src/lib.rs | 9 - crates/binstalk-fetchers/Cargo.toml | 8 +- crates/binstalk-fetchers/src/common.rs | 60 +- crates/binstalk-fetchers/src/gh_crate_meta.rs | 90 ++- crates/binstalk-fetchers/src/lib.rs | 72 +- crates/binstalk-git-repo-api/Cargo.toml | 28 + crates/binstalk-git-repo-api/LICENSE-APACHE | 176 +++++ crates/binstalk-git-repo-api/LICENSE-MIT | 23 + .../src/gh_api_client.rs | 703 ++++++++++++++++++ .../src/gh_api_client/common.rs | 143 ++++ .../src/gh_api_client/error.rs | 203 +++++ .../src/gh_api_client/release_artifacts.rs | 187 +++++ .../src/gh_api_client/repo_info.rs | 80 ++ crates/binstalk-git-repo-api/src/lib.rs | 1 + crates/binstalk/Cargo.toml | 5 +- crates/binstalk/src/errors.rs | 7 +- crates/binstalk/src/helpers.rs | 7 +- crates/binstalk/src/helpers/remote.rs | 54 -- crates/binstalk/src/ops.rs | 6 +- crates/binstalk/src/ops/resolve.rs | 7 +- .../private-github-repo-test-Cargo.toml | 13 + e2e-tests/private-github-repo.sh | 21 + justfile | 5 +- 30 files changed, 1838 insertions(+), 1127 deletions(-) delete mode 100644 crates/binstalk-downloader/src/gh_api_client.rs delete mode 100644 crates/binstalk-downloader/src/gh_api_client/request.rs create mode 100644 crates/binstalk-git-repo-api/Cargo.toml create mode 100644 crates/binstalk-git-repo-api/LICENSE-APACHE create mode 100644 crates/binstalk-git-repo-api/LICENSE-MIT create mode 100644 crates/binstalk-git-repo-api/src/gh_api_client.rs create mode 100644 crates/binstalk-git-repo-api/src/gh_api_client/common.rs create mode 100644 crates/binstalk-git-repo-api/src/gh_api_client/error.rs create mode 100644 crates/binstalk-git-repo-api/src/gh_api_client/release_artifacts.rs create mode 100644 crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs create mode 100644 crates/binstalk-git-repo-api/src/lib.rs delete mode 100644 crates/binstalk/src/helpers/remote.rs create mode 100644 e2e-tests/manifests/private-github-repo-test-Cargo.toml create mode 100755 e2e-tests/private-github-repo.sh diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index b5398fd0..9777ad89 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -12,6 +12,7 @@ on: - binstalk - binstalk-bins - binstalk-fetchers + - binstalk-git-repo-api - binstalk-registry - binstalk-manifests - binstalk-types diff --git a/Cargo.lock b/Cargo.lock index d8bcb685..bf75d89e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -252,6 +252,7 @@ dependencies = [ "binstalk-bins", "binstalk-downloader", "binstalk-fetchers", + "binstalk-git-repo-api", "binstalk-registry", "binstalk-types", "cargo-toml-workspace", @@ -309,10 +310,8 @@ dependencies = [ "httpdate", "ipconfig", "once_cell", - "percent-encoding", "reqwest", "serde", - "serde-tuple-vec-map", "serde_json", "tempfile", "thiserror", @@ -331,6 +330,7 @@ version = "0.4.1" dependencies = [ "async-trait", "binstalk-downloader", + "binstalk-git-repo-api", "binstalk-types", "bytes", "compact_str", @@ -348,6 +348,23 @@ dependencies = [ "url", ] +[[package]] +name = "binstalk-git-repo-api" +version = "0.0.0" +dependencies = [ + "binstalk-downloader", + "compact_str", + "percent-encoding", + "serde", + "serde-tuple-vec-map", + "serde_json", + "thiserror", + "tokio", + "tracing", + "tracing-subscriber", + "url", +] + [[package]] name = "binstalk-manifests" version = "0.13.0" @@ -4106,8 +4123,10 @@ dependencies = [ "serde", "serde_json", "sharded-slab", + "smallvec", "thread_local", "tracing-core", + "tracing-log", "tracing-serde", ] diff --git a/Cargo.toml b/Cargo.toml index 8fda04af..3ed0edbb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,6 +15,7 @@ members = [ "crates/fs-lock", "crates/normalize-path", "crates/detect-targets", + "crates/binstalk-git-repo-api", ] [profile.release] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index f176a872..b7a55be1 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -43,9 +43,7 @@ reqwest = { version = "0.12.4", features = [ "brotli", "deflate", ], default-features = false } -percent-encoding = "2.2.0" serde = { version = "1.0.163", features = ["derive"], optional = true } -serde-tuple-vec-map = "1.0.1" serde_json = { version = "1.0.107", optional = true } # Use a fork here since we need PAX support, but the upstream # does not hav the PR merged yet. @@ -127,7 +125,6 @@ zstd-thin = ["zstd/thin"] cross-lang-fat-lto = ["zstd/fat-lto"] -gh-api-client = ["json"] json = ["serde", "serde_json"] [target."cfg(windows)".dependencies] diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index c1b7f59e..a2ee5cde 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -1,4 +1,4 @@ -use std::{fmt, io, marker::PhantomData, path::Path}; +use std::{fmt, io, path::Path}; use binstalk_types::cargo_toml_binstall::PkgFmtDecomposed; use bytes::Bytes; @@ -8,7 +8,7 @@ use tracing::{debug, error, instrument}; pub use binstalk_types::cargo_toml_binstall::{PkgFmt, TarBasedFmt}; -use crate::remote::{Client, Error as RemoteError, Url}; +use crate::remote::{Client, Error as RemoteError, Response, Url}; mod async_extracter; use async_extracter::*; @@ -90,38 +90,43 @@ impl DataVerifier for () { } } +#[derive(Debug)] +enum DownloadContent { + ToIssue { client: Client, url: Url }, + Response(Response), +} + +impl DownloadContent { + async fn into_response(self) -> Result { + Ok(match self { + DownloadContent::ToIssue { client, url } => client.get(url).send(true).await?, + DownloadContent::Response(response) => response, + }) + } +} + pub struct Download<'a> { - client: Client, - url: Url, + content: DownloadContent, data_verifier: Option<&'a mut dyn DataVerifier>, } impl fmt::Debug for Download<'_> { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - #[allow(dead_code, clippy::type_complexity)] - #[derive(Debug)] - struct Download<'a> { - client: &'a Client, - url: &'a Url, - data_verifier: Option>, - } - - fmt::Debug::fmt( - &Download { - client: &self.client, - url: &self.url, - data_verifier: self.data_verifier.as_ref().map(|_| PhantomData), - }, - f, - ) + fmt::Debug::fmt(&self.content, f) } } impl Download<'static> { pub fn new(client: Client, url: Url) -> Self { Self { - client, - url, + content: DownloadContent::ToIssue { client, url }, + data_verifier: None, + } + } + + pub fn from_response(response: Response) -> Self { + Self { + content: DownloadContent::Response(response), data_verifier: None, } } @@ -134,8 +139,24 @@ impl<'a> Download<'a> { data_verifier: &'a mut dyn DataVerifier, ) -> Self { Self { - client, - url, + content: DownloadContent::ToIssue { client, url }, + data_verifier: Some(data_verifier), + } + } + + pub fn from_response_with_data_verifier( + response: Response, + data_verifier: &'a mut dyn DataVerifier, + ) -> Self { + Self { + content: DownloadContent::Response(response), + data_verifier: Some(data_verifier), + } + } + + pub fn with_data_verifier(self, data_verifier: &mut dyn DataVerifier) -> Download<'_> { + Download { + content: self.content, data_verifier: Some(data_verifier), } } @@ -148,9 +169,10 @@ impl<'a> Download<'a> { > { let mut data_verifier = self.data_verifier; Ok(self - .client - .get_stream(self.url) + .content + .into_response() .await? + .bytes_stream() .map(move |res| { let bytes = res?; @@ -257,7 +279,7 @@ impl Download<'_> { #[instrument] pub async fn into_bytes(self) -> Result { - let bytes = self.client.get(self.url).send(true).await?.bytes().await?; + let bytes = self.content.into_response().await?.bytes().await?; if let Some(verifier) = self.data_verifier { verifier.update(&bytes); } diff --git a/crates/binstalk-downloader/src/gh_api_client.rs b/crates/binstalk-downloader/src/gh_api_client.rs deleted file mode 100644 index 92dac5f8..00000000 --- a/crates/binstalk-downloader/src/gh_api_client.rs +++ /dev/null @@ -1,506 +0,0 @@ -use std::{ - collections::HashMap, - ops::Deref, - sync::{ - atomic::{AtomicBool, Ordering::Relaxed}, - Arc, Mutex, RwLock, - }, - time::{Duration, Instant}, -}; - -use compact_str::CompactString; -use percent_encoding::{ - percent_decode_str, utf8_percent_encode, AsciiSet, PercentEncode, CONTROLS, -}; -use tokio::sync::OnceCell; - -use crate::remote; - -mod request; -pub use request::{GhApiContextError, GhApiError, GhGraphQLErrors}; - -/// default retry duration if x-ratelimit-reset is not found in response header -const DEFAULT_RETRY_DURATION: Duration = Duration::from_secs(10 * 60); - -fn percent_encode_http_url_path(path: &str) -> PercentEncode<'_> { - /// https://url.spec.whatwg.org/#fragment-percent-encode-set - const FRAGMENT: &AsciiSet = &CONTROLS.add(b' ').add(b'"').add(b'<').add(b'>').add(b'`'); - - /// https://url.spec.whatwg.org/#path-percent-encode-set - const PATH: &AsciiSet = &FRAGMENT.add(b'#').add(b'?').add(b'{').add(b'}'); - - const PATH_SEGMENT: &AsciiSet = &PATH.add(b'/').add(b'%'); - - // The backslash (\) character is treated as a path separator in special URLs - // so it needs to be additionally escaped in that case. - // - // http is considered to have special path. - const SPECIAL_PATH_SEGMENT: &AsciiSet = &PATH_SEGMENT.add(b'\\'); - - utf8_percent_encode(path, SPECIAL_PATH_SEGMENT) -} - -fn percent_decode_http_url_path(input: &str) -> CompactString { - if input.contains('%') { - percent_decode_str(input).decode_utf8_lossy().into() - } else { - // No '%', no need to decode. - CompactString::new(input) - } -} - -/// The keys required to identify a github release. -#[derive(Clone, Eq, PartialEq, Hash, Debug)] -pub struct GhRelease { - pub owner: CompactString, - pub repo: CompactString, - pub tag: CompactString, -} - -/// The Github Release and one of its artifact. -#[derive(Clone, Eq, PartialEq, Hash, Debug)] -pub struct GhReleaseArtifact { - pub release: GhRelease, - pub artifact_name: CompactString, -} - -impl GhReleaseArtifact { - /// Create [`GhReleaseArtifact`] from url. - pub fn try_extract_from_url(url: &remote::Url) -> Option { - if url.domain() != Some("github.com") { - return None; - } - - let mut path_segments = url.path_segments()?; - - let owner = path_segments.next()?; - let repo = path_segments.next()?; - - if (path_segments.next()?, path_segments.next()?) != ("releases", "download") { - return None; - } - - let tag = path_segments.next()?; - let artifact_name = path_segments.next()?; - - (path_segments.next().is_none() && url.fragment().is_none() && url.query().is_none()).then( - || Self { - release: GhRelease { - owner: percent_decode_http_url_path(owner), - repo: percent_decode_http_url_path(repo), - tag: percent_decode_http_url_path(tag), - }, - artifact_name: percent_decode_http_url_path(artifact_name), - }, - ) - } -} - -#[derive(Debug)] -struct Map(RwLock>>); - -impl Default for Map { - fn default() -> Self { - Self(Default::default()) - } -} - -impl Map -where - K: Eq + std::hash::Hash, - V: Default, -{ - fn get(&self, k: K) -> Arc { - let optional_value = self.0.read().unwrap().deref().get(&k).cloned(); - optional_value.unwrap_or_else(|| Arc::clone(self.0.write().unwrap().entry(k).or_default())) - } -} - -#[derive(Debug)] -struct Inner { - client: remote::Client, - release_artifacts: Map>>, - retry_after: Mutex>, - - auth_token: Option, - is_auth_token_valid: AtomicBool, -} - -/// Github API client for querying whether a release artifact exitsts. -/// Can only handle github.com for now. -#[derive(Clone, Debug)] -pub struct GhApiClient(Arc); - -impl GhApiClient { - pub fn new(client: remote::Client, auth_token: Option) -> Self { - Self(Arc::new(Inner { - client, - release_artifacts: Default::default(), - retry_after: Default::default(), - - auth_token, - is_auth_token_valid: AtomicBool::new(true), - })) - } -} - -enum FetchReleaseArtifactError { - Error(GhApiError), - RateLimit { retry_after: Instant }, - Unauthorized, -} - -impl GhApiClient { - async fn do_fetch_release_artifacts( - &self, - release: &GhRelease, - auth_token: Option<&str>, - ) -> Result, FetchReleaseArtifactError> { - use request::FetchReleaseRet::*; - use FetchReleaseArtifactError as Error; - - match request::fetch_release_artifacts(&self.0.client, release, auth_token).await { - Ok(ReleaseNotFound) => Ok(None), - Ok(Artifacts(artifacts)) => Ok(Some(artifacts)), - Ok(ReachedRateLimit { retry_after }) => { - let retry_after = retry_after.unwrap_or(DEFAULT_RETRY_DURATION); - - let now = Instant::now(); - let retry_after = now - .checked_add(retry_after) - .unwrap_or_else(|| now + DEFAULT_RETRY_DURATION); - - Err(Error::RateLimit { retry_after }) - } - Ok(Unauthorized) => Err(Error::Unauthorized), - Err(err) => Err(Error::Error(err)), - } - } - - /// The returned future is guaranteed to be pointer size. - pub async fn has_release_artifact( - &self, - GhReleaseArtifact { - release, - artifact_name, - }: GhReleaseArtifact, - ) -> Result { - use FetchReleaseArtifactError as Error; - - let once_cell = self.0.release_artifacts.get(release.clone()); - let res = once_cell - .get_or_try_init(|| { - Box::pin(async { - { - let mut guard = self.0.retry_after.lock().unwrap(); - - if let Some(retry_after) = *guard { - if retry_after.elapsed().is_zero() { - return Err(Error::RateLimit { retry_after }); - } else { - // Instant retry_after is already reached. - *guard = None; - } - }; - } - - if self.0.is_auth_token_valid.load(Relaxed) { - match self - .do_fetch_release_artifacts(&release, self.0.auth_token.as_deref()) - .await - { - Err(Error::Unauthorized) => { - self.0.is_auth_token_valid.store(false, Relaxed); - } - res => return res, - } - } - - self.do_fetch_release_artifacts(&release, None).await - }) - }) - .await; - - match res { - Ok(Some(artifacts)) => { - let has_artifact = artifacts.contains(&artifact_name); - Ok(if has_artifact { - HasReleaseArtifact::Yes - } else { - HasReleaseArtifact::No - }) - } - Ok(None) => Ok(HasReleaseArtifact::NoSuchRelease), - Err(Error::Unauthorized) => Ok(HasReleaseArtifact::Unauthorized), - Err(Error::RateLimit { retry_after }) => { - *self.0.retry_after.lock().unwrap() = Some(retry_after); - - Ok(HasReleaseArtifact::RateLimit { retry_after }) - } - Err(Error::Error(err)) => Err(err), - } - } -} - -#[derive(Eq, PartialEq, Copy, Clone, Debug)] -pub enum HasReleaseArtifact { - Yes, - No, - NoSuchRelease, - /// GitHub returns 401 requiring a token. - /// In this case, it makes sense to fallback to HEAD/GET. - Unauthorized, - - /// GitHub rate limit is applied per hour, so in case of reaching the rate - /// limit, [`GhApiClient`] will return this variant and let the user decide - /// what to do. - /// - /// Usually it is more sensible to fallback to directly HEAD/GET the - /// artifact url than waiting until `retry_after`. - /// - /// If you encounter this frequently, then you should consider getting an - /// authentication token (can be personal access or oath access token), - /// which should give you 5000 requests per hour per user. - /// - /// Rate limit for unauthorized user is 60 requests per hour per originating - /// IP address, so it is very easy to be rate limited. - RateLimit { - retry_after: Instant, - }, -} - -#[cfg(test)] -mod test { - use super::*; - use compact_str::{CompactString, ToCompactString}; - use std::{env, num::NonZeroU16}; - - mod cargo_binstall_v0_20_1 { - use super::{CompactString, GhRelease}; - - pub(super) const RELEASE: GhRelease = GhRelease { - owner: CompactString::new_inline("cargo-bins"), - repo: CompactString::new_inline("cargo-binstall"), - tag: CompactString::new_inline("v0.20.1"), - }; - - pub(super) const ARTIFACTS: &[&str] = &[ - "cargo-binstall-aarch64-apple-darwin.full.zip", - "cargo-binstall-aarch64-apple-darwin.zip", - "cargo-binstall-aarch64-pc-windows-msvc.full.zip", - "cargo-binstall-aarch64-pc-windows-msvc.zip", - "cargo-binstall-aarch64-unknown-linux-gnu.full.tgz", - "cargo-binstall-aarch64-unknown-linux-gnu.tgz", - "cargo-binstall-aarch64-unknown-linux-musl.full.tgz", - "cargo-binstall-aarch64-unknown-linux-musl.tgz", - "cargo-binstall-armv7-unknown-linux-gnueabihf.full.tgz", - "cargo-binstall-armv7-unknown-linux-gnueabihf.tgz", - "cargo-binstall-armv7-unknown-linux-musleabihf.full.tgz", - "cargo-binstall-armv7-unknown-linux-musleabihf.tgz", - "cargo-binstall-universal-apple-darwin.full.zip", - "cargo-binstall-universal-apple-darwin.zip", - "cargo-binstall-x86_64-apple-darwin.full.zip", - "cargo-binstall-x86_64-apple-darwin.zip", - "cargo-binstall-x86_64-pc-windows-msvc.full.zip", - "cargo-binstall-x86_64-pc-windows-msvc.zip", - "cargo-binstall-x86_64-unknown-linux-gnu.full.tgz", - "cargo-binstall-x86_64-unknown-linux-gnu.tgz", - "cargo-binstall-x86_64-unknown-linux-musl.full.tgz", - "cargo-binstall-x86_64-unknown-linux-musl.tgz", - ]; - } - - fn try_extract_artifact_from_str(s: &str) -> Option { - GhReleaseArtifact::try_extract_from_url(&url::Url::parse(s).unwrap()) - } - - fn assert_extract_gh_release_artifacts_failures(urls: &[&str]) { - for url in urls { - assert_eq!(try_extract_artifact_from_str(url), None); - } - } - - #[test] - fn extract_gh_release_artifacts_failure() { - use cargo_binstall_v0_20_1::*; - - let GhRelease { owner, repo, tag } = RELEASE; - - assert_extract_gh_release_artifacts_failures(&[ - "https://examle.com", - "https://github.com", - &format!("https://github.com/{owner}"), - &format!("https://github.com/{owner}/{repo}"), - &format!("https://github.com/{owner}/{repo}/123e"), - &format!("https://github.com/{owner}/{repo}/releases/21343"), - &format!("https://github.com/{owner}/{repo}/releases/download"), - &format!("https://github.com/{owner}/{repo}/releases/download/{tag}"), - &format!("https://github.com/{owner}/{repo}/releases/download/{tag}/a/23"), - &format!("https://github.com/{owner}/{repo}/releases/download/{tag}/a#a=12"), - &format!("https://github.com/{owner}/{repo}/releases/download/{tag}/a?page=3"), - ]); - } - - #[test] - fn extract_gh_release_artifacts_success() { - use cargo_binstall_v0_20_1::*; - - let GhRelease { owner, repo, tag } = RELEASE; - - for artifact in ARTIFACTS { - let GhReleaseArtifact { - release, - artifact_name, - } = try_extract_artifact_from_str(&format!( - "https://github.com/{owner}/{repo}/releases/download/{tag}/{artifact}" - )) - .unwrap(); - - assert_eq!(release, RELEASE); - assert_eq!(artifact_name, artifact); - } - } - - /// Mark this as an async fn so that you won't accidentally use it in - /// sync context. - async fn create_client() -> Vec { - let client = remote::Client::new( - concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), - None, - NonZeroU16::new(10).unwrap(), - 1.try_into().unwrap(), - [], - ) - .unwrap(); - - let mut gh_clients = vec![GhApiClient::new(client.clone(), None)]; - - if let Ok(token) = env::var("GITHUB_TOKEN") { - gh_clients.push(GhApiClient::new(client, Some(token.into()))); - } - - gh_clients - } - - async fn test_specific_release(release: &GhRelease, artifacts: &[&str]) { - for client in create_client().await { - eprintln!("In client {client:?}"); - - for artifact_name in artifacts { - let ret = client - .has_release_artifact(GhReleaseArtifact { - release: release.clone(), - artifact_name: artifact_name.to_compact_string(), - }) - .await - .unwrap(); - - assert!( - matches!( - ret, - HasReleaseArtifact::Yes | HasReleaseArtifact::RateLimit { .. } - ), - "for '{artifact_name}': answer is {:#?}", - ret - ); - } - - let ret = client - .has_release_artifact(GhReleaseArtifact { - release: release.clone(), - artifact_name: "123z".to_compact_string(), - }) - .await - .unwrap(); - - assert!( - matches!( - ret, - HasReleaseArtifact::No | HasReleaseArtifact::RateLimit { .. } - ), - "ret = {:#?}", - ret - ); - } - } - - #[tokio::test] - async fn test_gh_api_client_cargo_binstall_v0_20_1() { - test_specific_release( - &cargo_binstall_v0_20_1::RELEASE, - cargo_binstall_v0_20_1::ARTIFACTS, - ) - .await - } - - #[tokio::test] - async fn test_gh_api_client_cargo_binstall_no_such_release() { - for client in create_client().await { - let release = GhRelease { - owner: "cargo-bins".to_compact_string(), - repo: "cargo-binstall".to_compact_string(), - // We are currently at v0.20.1 and we would never release - // anything older than v0.20.1 - tag: "v0.18.2".to_compact_string(), - }; - - let ret = client - .has_release_artifact(GhReleaseArtifact { - release, - artifact_name: "1234".to_compact_string(), - }) - .await - .unwrap(); - - assert!( - matches!( - ret, - HasReleaseArtifact::NoSuchRelease | HasReleaseArtifact::RateLimit { .. } - ), - "ret = {:#?}", - ret - ); - } - } - - mod cargo_audit_v_0_17_6 { - use super::*; - - const RELEASE: GhRelease = GhRelease { - owner: CompactString::new_inline("rustsec"), - repo: CompactString::new_inline("rustsec"), - tag: CompactString::new_inline("cargo-audit/v0.17.6"), - }; - - const ARTIFACTS: &[&str] = &[ - "cargo-audit-aarch64-unknown-linux-gnu-v0.17.6.tgz", - "cargo-audit-armv7-unknown-linux-gnueabihf-v0.17.6.tgz", - "cargo-audit-x86_64-apple-darwin-v0.17.6.tgz", - "cargo-audit-x86_64-pc-windows-msvc-v0.17.6.zip", - "cargo-audit-x86_64-unknown-linux-gnu-v0.17.6.tgz", - "cargo-audit-x86_64-unknown-linux-musl-v0.17.6.tgz", - ]; - - #[test] - fn extract_with_escaped_characters() { - let release_artifact = try_extract_artifact_from_str( -"https://github.com/rustsec/rustsec/releases/download/cargo-audit%2Fv0.17.6/cargo-audit-aarch64-unknown-linux-gnu-v0.17.6.tgz" - ).unwrap(); - - assert_eq!( - release_artifact, - GhReleaseArtifact { - release: RELEASE, - artifact_name: CompactString::from( - "cargo-audit-aarch64-unknown-linux-gnu-v0.17.6.tgz", - ) - } - ); - } - - #[tokio::test] - async fn test_gh_api_client_cargo_audit_v_0_17_6() { - test_specific_release(&RELEASE, ARTIFACTS).await - } - } -} diff --git a/crates/binstalk-downloader/src/gh_api_client/request.rs b/crates/binstalk-downloader/src/gh_api_client/request.rs deleted file mode 100644 index 59e0d140..00000000 --- a/crates/binstalk-downloader/src/gh_api_client/request.rs +++ /dev/null @@ -1,447 +0,0 @@ -use std::{ - borrow::Borrow, - collections::HashSet, - error, fmt, - hash::{Hash, Hasher}, - io, - sync::OnceLock, - time::Duration, -}; - -use compact_str::{CompactString, ToCompactString}; -use reqwest::{header::HeaderMap, StatusCode}; -use serde::{de::Deserializer, Deserialize, Serialize}; -use serde_json::to_string as to_json_string; -use thiserror::Error as ThisError; -use tracing::debug; -use url::Url; - -use super::{percent_encode_http_url_path, remote, GhRelease}; - -#[derive(ThisError, Debug)] -#[error("Context: '{context}', err: '{err}'")] -pub struct GhApiContextError { - context: CompactString, - #[source] - err: GhApiError, -} - -#[derive(ThisError, Debug)] -#[non_exhaustive] -pub enum GhApiError { - #[error("IO Error: {0}")] - Io(#[from] io::Error), - - #[error("Remote Error: {0}")] - Remote(#[from] remote::Error), - - #[error("Failed to parse url: {0}")] - InvalidUrl(#[from] url::ParseError), - - /// A wrapped error providing the context the error is about. - #[error(transparent)] - Context(Box), - - #[error("Remote failed to process GraphQL query: {0}")] - GraphQLErrors(#[from] GhGraphQLErrors), -} - -impl GhApiError { - /// Attach context to [`GhApiError`] - pub fn context(self, context: impl fmt::Display) -> Self { - Self::Context(Box::new(GhApiContextError { - context: context.to_compact_string(), - err: self, - })) - } -} - -// Only include fields we do care about - -#[derive(Eq, Deserialize, Debug)] -struct Artifact { - name: CompactString, -} - -// Manually implement PartialEq and Hash to ensure it will always produce the -// same hash as a str with the same content, and that the comparison will be -// the same to coparing a string. - -impl PartialEq for Artifact { - fn eq(&self, other: &Self) -> bool { - self.name.eq(&other.name) - } -} - -impl Hash for Artifact { - fn hash(&self, state: &mut H) - where - H: Hasher, - { - let s: &str = self.name.as_str(); - s.hash(state) - } -} - -// Implement Borrow so that we can use call -// `HashSet::contains::` - -impl Borrow for Artifact { - fn borrow(&self) -> &str { - &self.name - } -} - -#[derive(Debug, Default, Deserialize)] -pub(super) struct Artifacts { - assets: HashSet, -} - -impl Artifacts { - pub(super) fn contains(&self, artifact_name: &str) -> bool { - self.assets.contains(artifact_name) - } -} - -pub(super) enum FetchReleaseRet { - ReachedRateLimit { retry_after: Option }, - ReleaseNotFound, - Artifacts(Artifacts), - Unauthorized, -} - -fn check_for_status(status: StatusCode, headers: &HeaderMap) -> Option { - match status { - remote::StatusCode::FORBIDDEN - if headers - .get("x-ratelimit-remaining") - .map(|val| val == "0") - .unwrap_or(false) => - { - Some(FetchReleaseRet::ReachedRateLimit { - retry_after: headers.get("x-ratelimit-reset").and_then(|value| { - let secs = value.to_str().ok()?.parse().ok()?; - Some(Duration::from_secs(secs)) - }), - }) - } - - remote::StatusCode::UNAUTHORIZED => Some(FetchReleaseRet::Unauthorized), - remote::StatusCode::NOT_FOUND => Some(FetchReleaseRet::ReleaseNotFound), - - _ => None, - } -} - -async fn fetch_release_artifacts_restful_api( - client: &remote::Client, - GhRelease { owner, repo, tag }: &GhRelease, - auth_token: Option<&str>, -) -> Result { - let mut request_builder = client - .get(Url::parse(&format!( - "https://api.github.com/repos/{owner}/{repo}/releases/tags/{tag}", - owner = percent_encode_http_url_path(owner), - repo = percent_encode_http_url_path(repo), - tag = percent_encode_http_url_path(tag), - ))?) - .header("Accept", "application/vnd.github+json") - .header("X-GitHub-Api-Version", "2022-11-28"); - - if let Some(auth_token) = auth_token { - request_builder = request_builder.bearer_auth(&auth_token); - } - - let response = request_builder.send(false).await?; - - if let Some(ret) = check_for_status(response.status(), response.headers()) { - Ok(ret) - } else { - Ok(FetchReleaseRet::Artifacts(response.json().await?)) - } -} - -#[derive(Deserialize)] -enum GraphQLResponse { - #[serde(rename = "data")] - Data(GraphQLData), - - #[serde(rename = "errors")] - Errors(GhGraphQLErrors), -} - -#[derive(Debug, Deserialize)] -pub struct GhGraphQLErrors(Box<[GraphQLError]>); - -impl GhGraphQLErrors { - fn is_rate_limited(&self) -> bool { - self.0 - .iter() - .any(|error| matches!(error.error_type, GraphQLErrorType::RateLimited)) - } -} - -impl error::Error for GhGraphQLErrors {} - -impl fmt::Display for GhGraphQLErrors { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - let last_error_index = self.0.len() - 1; - - for (i, error) in self.0.iter().enumerate() { - write!( - f, - "type: '{error_type}', msg: '{msg}'", - error_type = error.error_type, - msg = error.message, - )?; - - for location in error.locations.as_deref().into_iter().flatten() { - write!( - f, - ", occured on query line {line} col {col}", - line = location.line, - col = location.column - )?; - } - - for (k, v) in &error.others { - write!(f, ", {k}: {v}")?; - } - - if i < last_error_index { - f.write_str("\n")?; - } - } - - Ok(()) - } -} - -#[derive(Debug, Deserialize)] -struct GraphQLError { - message: CompactString, - locations: Option>, - - #[serde(rename = "type")] - error_type: GraphQLErrorType, - - #[serde(flatten, with = "tuple_vec_map")] - others: Vec<(CompactString, serde_json::Value)>, -} - -#[derive(Debug)] -enum GraphQLErrorType { - RateLimited, - Other(CompactString), -} - -impl fmt::Display for GraphQLErrorType { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.write_str(match self { - GraphQLErrorType::RateLimited => "RATE_LIMITED", - GraphQLErrorType::Other(s) => s, - }) - } -} - -impl<'de> Deserialize<'de> for GraphQLErrorType { - fn deserialize(deserializer: D) -> Result - where - D: Deserializer<'de>, - { - let s = CompactString::deserialize(deserializer)?; - Ok(match &*s { - "RATE_LIMITED" => GraphQLErrorType::RateLimited, - _ => GraphQLErrorType::Other(s), - }) - } -} - -#[derive(Debug, Deserialize)] -struct GraphQLLocation { - line: u64, - column: u64, -} - -#[derive(Deserialize)] -struct GraphQLData { - repository: Option, -} - -#[derive(Deserialize)] -struct GraphQLRepo { - release: Option, -} - -#[derive(Deserialize)] -struct GraphQLRelease { - #[serde(rename = "releaseAssets")] - assets: GraphQLReleaseAssets, -} - -#[derive(Deserialize)] -struct GraphQLReleaseAssets { - nodes: Vec, - #[serde(rename = "pageInfo")] - page_info: GraphQLPageInfo, -} - -#[derive(Deserialize)] -struct GraphQLPageInfo { - #[serde(rename = "endCursor")] - end_cursor: Option, - #[serde(rename = "hasNextPage")] - has_next_page: bool, -} - -enum FilterCondition { - Init, - After(CompactString), -} - -impl fmt::Display for FilterCondition { - fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - match self { - // GitHub imposes a limit of 100 for the value passed to param "first" - FilterCondition::Init => f.write_str("first:100"), - FilterCondition::After(end_cursor) => write!(f, r#"first:100,after:"{end_cursor}""#), - } - } -} - -#[derive(Serialize)] -struct GraphQLQuery { - query: String, -} - -async fn fetch_release_artifacts_graphql_api( - client: &remote::Client, - GhRelease { owner, repo, tag }: &GhRelease, - auth_token: &str, -) -> Result { - static GRAPHQL_ENDPOINT: OnceLock = OnceLock::new(); - - let graphql_endpoint = GRAPHQL_ENDPOINT.get_or_init(|| { - Url::parse("https://api.github.com/graphql").expect("Literal provided must be a valid url") - }); - - let mut artifacts = Artifacts::default(); - let mut cond = FilterCondition::Init; - - loop { - let query = format!( - r#" -query {{ - repository(owner:"{owner}",name:"{repo}") {{ - release(tagName:"{tag}") {{ - releaseAssets({cond}) {{ - nodes {{ name }} - pageInfo {{ endCursor hasNextPage }} - }} - }} - }} -}}"# - ); - - let graphql_query = to_json_string(&GraphQLQuery { query }).map_err(remote::Error::from)?; - - debug!("Sending graphql query to https://api.github.com/graphql: '{graphql_query}'"); - - let request_builder = client - .post(graphql_endpoint.clone(), graphql_query) - .header("Accept", "application/vnd.github+json") - .bearer_auth(&auth_token); - - let response = request_builder.send(false).await?; - - if let Some(ret) = check_for_status(response.status(), response.headers()) { - return Ok(ret); - } - - let response: GraphQLResponse = response.json().await?; - - let data = match response { - GraphQLResponse::Data(data) => data, - GraphQLResponse::Errors(errors) if errors.is_rate_limited() => { - return Ok(FetchReleaseRet::ReachedRateLimit { retry_after: None }) - } - GraphQLResponse::Errors(errors) => return Err(errors.into()), - }; - - let assets = data - .repository - .and_then(|repository| repository.release) - .map(|release| release.assets); - - if let Some(assets) = assets { - artifacts.assets.extend(assets.nodes); - - match assets.page_info { - GraphQLPageInfo { - end_cursor: Some(end_cursor), - has_next_page: true, - } => { - cond = FilterCondition::After(end_cursor); - } - _ => break Ok(FetchReleaseRet::Artifacts(artifacts)), - } - } else { - break Ok(FetchReleaseRet::ReleaseNotFound); - } - } -} - -pub(super) async fn fetch_release_artifacts( - client: &remote::Client, - release: &GhRelease, - auth_token: Option<&str>, -) -> Result { - if let Some(auth_token) = auth_token { - let res = fetch_release_artifacts_graphql_api(client, release, auth_token) - .await - .map_err(|err| err.context("GraphQL API")); - - match res { - // Fallback to Restful API - Ok(FetchReleaseRet::Unauthorized) => (), - res => return res, - } - } - - fetch_release_artifacts_restful_api(client, release, auth_token) - .await - .map_err(|err| err.context("Restful API")) -} - -#[cfg(test)] -mod test { - use super::*; - use serde::de::value::{BorrowedStrDeserializer, Error}; - - macro_rules! assert_matches { - ($expression:expr, $pattern:pat $(if $guard:expr)? $(,)?) => { - match $expression { - $pattern $(if $guard)? => true, - expr => { - panic!( - "assertion failed: `{expr:?}` does not match `{}`", - stringify!($pattern $(if $guard)?) - ) - } - } - } - } - - #[test] - fn test_graph_ql_error_type() { - let deserialize = |input: &str| { - GraphQLErrorType::deserialize(BorrowedStrDeserializer::<'_, Error>::new(input)).unwrap() - }; - - assert_matches!(deserialize("RATE_LIMITED"), GraphQLErrorType::RateLimited); - assert_matches!( - deserialize("rATE_LIMITED"), - GraphQLErrorType::Other(val) if val == CompactString::new("rATE_LIMITED") - ); - } -} diff --git a/crates/binstalk-downloader/src/lib.rs b/crates/binstalk-downloader/src/lib.rs index c4a23c84..1e4cfad7 100644 --- a/crates/binstalk-downloader/src/lib.rs +++ b/crates/binstalk-downloader/src/lib.rs @@ -1,15 +1,6 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] pub use bytes; - pub mod download; - -/// Github API client. -/// Currently only support github.com and does not support other enterprise -/// github. -#[cfg(feature = "gh-api-client")] -pub mod gh_api_client; - pub mod remote; - mod utils; diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 5f48a7b2..67816eae 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,8 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader", default-features = false, features = ["gh-api-client"] } +binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.0.0", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } @@ -25,7 +26,10 @@ minisign-verify = "0.2.1" once_cell = "1.18.0" strum = "0.26.1" thiserror = "1.0.61" -tokio = { version = "1.35.0", features = ["rt", "sync"], default-features = false } +tokio = { version = "1.35.0", features = [ + "rt", + "sync", +], default-features = false } tracing = "0.1.39" url = "2.3.1" diff --git a/crates/binstalk-fetchers/src/common.rs b/crates/binstalk-fetchers/src/common.rs index ae789929..b3a491ae 100644 --- a/crates/binstalk-fetchers/src/common.rs +++ b/crates/binstalk-fetchers/src/common.rs @@ -3,12 +3,12 @@ use std::sync::{ Once, }; -use binstalk_downloader::gh_api_client::{GhReleaseArtifact, HasReleaseArtifact}; pub(super) use binstalk_downloader::{ download::{Download, ExtractedFiles}, - gh_api_client::GhApiClient, remote::{Client, Url}, }; +pub(super) use binstalk_git_repo_api::gh_api_client::GhApiClient; +use binstalk_git_repo_api::gh_api_client::{GhApiError, GhReleaseArtifact, GhReleaseArtifactUrl}; pub(super) use binstalk_types::cargo_toml_binstall::{PkgFmt, PkgMeta}; pub(super) use compact_str::CompactString; pub(super) use tokio::task::JoinHandle; @@ -16,6 +16,39 @@ pub(super) use tracing::{debug, instrument, warn}; use crate::FetchError; +static WARN_RATE_LIMIT_ONCE: Once = Once::new(); +static WARN_UNAUTHORIZED_ONCE: Once = Once::new(); + +pub(super) async fn get_gh_release_artifact_url( + gh_api_client: GhApiClient, + artifact: GhReleaseArtifact, +) -> Result, GhApiError> { + debug!("Using GitHub API to check for existence of artifact, which will also cache the API response"); + + // The future returned has the same size as a pointer + match gh_api_client.has_release_artifact(artifact).await { + Ok(ret) => Ok(ret), + Err(GhApiError::NotFound) => Ok(None), + + Err(GhApiError::RateLimit { retry_after }) => { + WARN_RATE_LIMIT_ONCE.call_once(|| { + warn!("Your GitHub API token (if any) has reached its rate limit and cannot be used again until {retry_after:?}, so we will fallback to HEAD/GET on the url."); + warn!("If you did not supply a github token, consider doing so: GitHub limits unauthorized users to 60 requests per hour per origin IP address."); + }); + Err(GhApiError::RateLimit { retry_after }) + } + Err(GhApiError::Unauthorized) => { + WARN_UNAUTHORIZED_ONCE.call_once(|| { + warn!("GitHub API somehow requires a token for the API access, so we will fallback to HEAD/GET on the url."); + warn!("Please consider supplying a token to cargo-binstall to speedup resolution."); + }); + Err(GhApiError::Unauthorized) + } + + Err(err) => Err(err), + } +} + /// This function returns a future where its size should be at most size of /// 2-4 pointers. pub(super) async fn does_url_exist( @@ -24,32 +57,17 @@ pub(super) async fn does_url_exist( url: &Url, ) -> Result { static GH_API_CLIENT_FAILED: AtomicBool = AtomicBool::new(false); - static WARN_RATE_LIMIT_ONCE: Once = Once::new(); - static WARN_UNAUTHORIZED_ONCE: Once = Once::new(); debug!("Checking for package at: '{url}'"); if !GH_API_CLIENT_FAILED.load(Relaxed) { if let Some(artifact) = GhReleaseArtifact::try_extract_from_url(url) { - debug!("Using GitHub API to check for existence of artifact, which will also cache the API response"); + match get_gh_release_artifact_url(gh_api_client, artifact).await { + Ok(ret) => return Ok(ret.is_some()), - // The future returned has the same size as a pointer - match gh_api_client.has_release_artifact(artifact).await? { - HasReleaseArtifact::Yes => return Ok(true), - HasReleaseArtifact::No | HasReleaseArtifact::NoSuchRelease => return Ok(false), + Err(GhApiError::RateLimit { .. }) | Err(GhApiError::Unauthorized) => {} - HasReleaseArtifact::RateLimit { retry_after } => { - WARN_RATE_LIMIT_ONCE.call_once(|| { - warn!("Your GitHub API token (if any) has reached its rate limit and cannot be used again until {retry_after:?}, so we will fallback to HEAD/GET on the url."); - warn!("If you did not supply a github token, consider doing so: GitHub limits unauthorized users to 60 requests per hour per origin IP address."); - }); - } - HasReleaseArtifact::Unauthorized => { - WARN_UNAUTHORIZED_ONCE.call_once(|| { - warn!("GitHub API somehow requires a token for the API access, so we will fallback to HEAD/GET on the url."); - warn!("Please consider supplying a token to cargo-binstall to speedup resolution."); - }); - } + Err(err) => return Err(err.into()), } GH_API_CLIENT_FAILED.store(true, Relaxed); diff --git a/crates/binstalk-fetchers/src/gh_crate_meta.rs b/crates/binstalk-fetchers/src/gh_crate_meta.rs index 68c66f00..d2d85f50 100644 --- a/crates/binstalk-fetchers/src/gh_crate_meta.rs +++ b/crates/binstalk-fetchers/src/gh_crate_meta.rs @@ -1,16 +1,18 @@ use std::{borrow::Cow, fmt, iter, path::Path, sync::Arc}; +use binstalk_git_repo_api::gh_api_client::{GhApiError, GhReleaseArtifact, GhReleaseArtifactUrl}; use compact_str::{CompactString, ToCompactString}; use either::Either; use leon::Template; use once_cell::sync::OnceCell; use strum::IntoEnumIterator; +use tokio::time::sleep; use tracing::{debug, info, trace, warn}; use url::Url; use crate::{ common::*, futures_resolver::FuturesResolver, Data, FetchError, InvalidPkgFmtError, RepoInfo, - SignaturePolicy, SignatureVerifier, TargetDataErased, + SignaturePolicy, SignatureVerifier, TargetDataErased, DEFAULT_GH_API_RETRY_DURATION, }; pub(crate) mod hosting; @@ -31,6 +33,8 @@ struct Resolved { archive_suffix: Option, repo: Option, subcrate: Option, + gh_release_artifact_url: Option, + is_repo_private: bool, } impl GhCrateMeta { @@ -41,6 +45,7 @@ impl GhCrateMeta { pkg_url: &Template<'_>, repo: Option<&str>, subcrate: Option<&str>, + is_repo_private: bool, ) { let render_url = |ext| { let ctx = Context::from_data_with_repo( @@ -82,16 +87,45 @@ impl GhCrateMeta { let repo = repo.map(ToString::to_string); let subcrate = subcrate.map(ToString::to_string); let archive_suffix = ext.map(ToString::to_string); + let gh_release_artifact = GhReleaseArtifact::try_extract_from_url(&url); + async move { - Ok(does_url_exist(client, gh_api_client, &url) + debug!("Checking for package at: '{url}'"); + + let mut resolved = Resolved { + url: url.clone(), + pkg_fmt, + repo, + subcrate, + archive_suffix, + is_repo_private, + gh_release_artifact_url: None, + }; + + if let Some(artifact) = gh_release_artifact { + loop { + match get_gh_release_artifact_url(gh_api_client.clone(), artifact.clone()) + .await + { + Ok(Some(artifact_url)) => { + resolved.gh_release_artifact_url = Some(artifact_url); + return Ok(Some(resolved)); + } + Ok(None) => return Ok(None), + + Err(GhApiError::RateLimit { retry_after }) => { + sleep(retry_after.unwrap_or(DEFAULT_GH_API_RETRY_DURATION)).await; + } + Err(GhApiError::Unauthorized) if !is_repo_private => break, + + Err(err) => return Err(err.into()), + } + } + } + + Ok(Box::pin(client.remote_gettable(url)) .await? - .then_some(Resolved { - url, - pkg_fmt, - repo, - subcrate, - archive_suffix, - })) + .then_some(resolved)) } })); } @@ -118,10 +152,11 @@ impl super::Fetcher for GhCrateMeta { fn find(self: Arc) -> JoinHandle> { tokio::spawn(async move { - let info = self.data.get_repo_info(&self.client).await?.as_ref(); + let info = self.data.get_repo_info(&self.gh_api_client).await?; let repo = info.map(|info| &info.repo); let subcrate = info.and_then(|info| info.subcrate.as_deref()); + let is_repo_private = info.map(|info| info.is_private).unwrap_or_default(); let mut pkg_fmt = self.target_data.meta.pkg_fmt; @@ -230,13 +265,22 @@ impl super::Fetcher for GhCrateMeta { // basically cartesian product. // | for pkg_fmt in pkg_fmts.clone() { - this.launch_baseline_find_tasks(&resolver, pkg_fmt, &pkg_url, repo, subcrate); + this.launch_baseline_find_tasks( + &resolver, + pkg_fmt, + &pkg_url, + repo, + subcrate, + is_repo_private, + ); } } if let Some(resolved) = resolver.resolve().await? { debug!(?resolved, "Winning URL found!"); - self.resolution.set(resolved).unwrap(); // find() is called first + self.resolution + .set(resolved) + .expect("find() should be only called once"); Ok(true) } else { Ok(false) @@ -245,7 +289,10 @@ impl super::Fetcher for GhCrateMeta { } async fn fetch_and_extract(&self, dst: &Path) -> Result { - let resolved = self.resolution.get().unwrap(); // find() is called first + let resolved = self + .resolution + .get() + .expect("find() should be called once before fetch_and_extract()"); trace!(?resolved, "preparing to fetch"); let verifier = match (self.signature_policy, &self.target_data.meta.signing) { @@ -290,11 +337,18 @@ impl super::Fetcher for GhCrateMeta { "Downloading package", ); let mut data_verifier = verifier.data_verifier()?; - let files = Download::new_with_data_verifier( - self.client.clone(), - resolved.url.clone(), - data_verifier.as_mut(), - ) + let files = match resolved.gh_release_artifact_url.as_ref() { + Some(artifact_url) if resolved.is_repo_private => self + .gh_api_client + .download_artifact(artifact_url.clone()) + .await? + .with_data_verifier(data_verifier.as_mut()), + _ => Download::new_with_data_verifier( + self.client.clone(), + resolved.url.clone(), + data_verifier.as_mut(), + ), + } .and_extract(resolved.pkg_fmt, dst) .await?; trace!("validating signature (if any)"); diff --git a/crates/binstalk-fetchers/src/lib.rs b/crates/binstalk-fetchers/src/lib.rs index a742e87e..688bfbbb 100644 --- a/crates/binstalk-fetchers/src/lib.rs +++ b/crates/binstalk-fetchers/src/lib.rs @@ -1,13 +1,12 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] -use std::{path::Path, sync::Arc}; +use std::{path::Path, sync::Arc, time::Duration}; -use binstalk_downloader::{ - download::DownloadError, gh_api_client::GhApiError, remote::Error as RemoteError, -}; +use binstalk_downloader::{download::DownloadError, remote::Error as RemoteError}; +use binstalk_git_repo_api::gh_api_client::{GhApiError, GhRepo}; use binstalk_types::cargo_toml_binstall::SigningAlgorithm; use thiserror::Error as ThisError; -use tokio::sync::OnceCell; +use tokio::{sync::OnceCell, time::sleep}; pub use url::ParseError as UrlParseError; mod gh_crate_meta; @@ -28,6 +27,8 @@ mod futures_resolver; use gh_crate_meta::hosting::RepositoryHost; +static DEFAULT_GH_API_RETRY_DURATION: Duration = Duration::from_secs(1); + #[derive(Debug, ThisError)] #[error("Invalid pkg-url {pkg_url} for {crate_name}@{version} on {target}: {reason}")] pub struct InvalidPkgFmtError { @@ -145,6 +146,7 @@ struct RepoInfo { repo: Url, repository_host: RepositoryHost, subcrate: Option, + is_private: bool, } /// What to do about package signatures @@ -180,29 +182,61 @@ impl Data { } #[instrument(level = "debug")] - async fn get_repo_info(&self, client: &Client) -> Result<&Option, FetchError> { + async fn get_repo_info(&self, client: &GhApiClient) -> Result, FetchError> { self.repo_info .get_or_try_init(move || { Box::pin(async move { - if let Some(repo) = self.repo.as_deref() { - let mut repo = client.get_redirected_final_url(Url::parse(repo)?).await?; - let repository_host = RepositoryHost::guess_git_hosting_services(&repo); + let Some(repo) = self.repo.as_deref() else { + return Ok(None); + }; - let repo_info = RepoInfo { - subcrate: RepoInfo::detect_subcrate(&mut repo, repository_host), - repo, - repository_host, - }; + let mut repo = Url::parse(repo)?; + let mut repository_host = RepositoryHost::guess_git_hosting_services(&repo); - debug!("Resolved repo_info = {repo_info:#?}"); - - Ok(Some(repo_info)) - } else { - Ok(None) + if repository_host == RepositoryHost::Unknown { + repo = client + .remote_client() + .get_redirected_final_url(repo) + .await?; + repository_host = RepositoryHost::guess_git_hosting_services(&repo); } + + let subcrate = RepoInfo::detect_subcrate(&mut repo, repository_host); + + let mut is_private = false; + if repository_host == RepositoryHost::GitHub && client.has_gh_token() { + if let Some(gh_repo) = GhRepo::try_extract_from_url(&repo) { + loop { + match client.get_repo_info(&gh_repo).await { + Ok(Some(gh_repo_info)) => { + is_private = gh_repo_info.is_private(); + break; + } + Ok(None) => return Err(GhApiError::NotFound.into()), + Err(GhApiError::RateLimit { retry_after }) => { + sleep(retry_after.unwrap_or(DEFAULT_GH_API_RETRY_DURATION)) + .await + } + Err(err) => return Err(err.into()), + } + } + } + } + + let repo_info = RepoInfo { + subcrate, + repo, + repository_host, + is_private, + }; + + debug!("Resolved repo_info = {repo_info:#?}"); + + Ok(Some(repo_info)) }) }) .await + .map(Option::as_ref) } } diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml new file mode 100644 index 00000000..32a7279e --- /dev/null +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "binstalk-git-repo-api" +description = "The binstall toolkit for accessing API for git repository" +repository = "https://github.com/cargo-bins/cargo-binstall" +documentation = "https://docs.rs/binstalk-git-repo-api" +version = "0.0.0" +rust-version = "1.70.0" +authors = ["Jiahao XU "] +edition = "2021" +license = "Apache-2.0 OR MIT" + +[dependencies] +binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader", default-features = false, features = [ + "json", +] } +compact_str = "0.7.0" +percent-encoding = "2.2.0" +serde = { version = "1.0.163", features = ["derive"] } +serde-tuple-vec-map = "1.0.1" +serde_json = { version = "1.0.107" } +thiserror = "1.0.52" +tokio = { version = "1.35.0", features = ["sync"], default-features = false } +tracing = "0.1.39" +url = "2.3.1" + +[dev-dependencies] +binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader" } +tracing-subscriber = "0.3" diff --git a/crates/binstalk-git-repo-api/LICENSE-APACHE b/crates/binstalk-git-repo-api/LICENSE-APACHE new file mode 100644 index 00000000..1b5ec8b7 --- /dev/null +++ b/crates/binstalk-git-repo-api/LICENSE-APACHE @@ -0,0 +1,176 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS diff --git a/crates/binstalk-git-repo-api/LICENSE-MIT b/crates/binstalk-git-repo-api/LICENSE-MIT new file mode 100644 index 00000000..31aa7938 --- /dev/null +++ b/crates/binstalk-git-repo-api/LICENSE-MIT @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/crates/binstalk-git-repo-api/src/gh_api_client.rs b/crates/binstalk-git-repo-api/src/gh_api_client.rs new file mode 100644 index 00000000..d7238dd6 --- /dev/null +++ b/crates/binstalk-git-repo-api/src/gh_api_client.rs @@ -0,0 +1,703 @@ +use std::{ + collections::HashMap, + future::Future, + ops::Deref, + sync::{ + atomic::{AtomicBool, Ordering::Relaxed}, + Arc, Mutex, RwLock, + }, + time::{Duration, Instant}, +}; + +use binstalk_downloader::{download::Download, remote}; +use compact_str::{format_compact, CompactString, ToCompactString}; +use tokio::sync::OnceCell; +use tracing::instrument; +use url::Url; + +mod common; +mod error; +mod release_artifacts; +mod repo_info; + +use common::{check_http_status_and_header, percent_decode_http_url_path}; +pub use error::{GhApiContextError, GhApiError, GhGraphQLErrors}; +pub use repo_info::RepoInfo; + +/// default retry duration if x-ratelimit-reset is not found in response header +const DEFAULT_RETRY_DURATION: Duration = Duration::from_secs(10 * 60); + +#[derive(Clone, Eq, PartialEq, Hash, Debug)] +pub struct GhRepo { + pub owner: CompactString, + pub repo: CompactString, +} +impl GhRepo { + pub fn repo_url(&self) -> Result { + Url::parse(&format_compact!( + "https://github.com/{}/{}", + self.owner, + self.repo + )) + } + + pub fn try_extract_from_url(url: &Url) -> Option { + if url.domain() != Some("github.com") { + return None; + } + + let mut path_segments = url.path_segments()?; + + Some(Self { + owner: path_segments.next()?.to_compact_string(), + repo: path_segments.next()?.to_compact_string(), + }) + } +} + +/// The keys required to identify a github release. +#[derive(Clone, Eq, PartialEq, Hash, Debug)] +pub struct GhRelease { + pub repo: GhRepo, + pub tag: CompactString, +} + +/// The Github Release and one of its artifact. +#[derive(Clone, Eq, PartialEq, Hash, Debug)] +pub struct GhReleaseArtifact { + pub release: GhRelease, + pub artifact_name: CompactString, +} + +impl GhReleaseArtifact { + /// Create [`GhReleaseArtifact`] from url. + pub fn try_extract_from_url(url: &remote::Url) -> Option { + if url.domain() != Some("github.com") { + return None; + } + + let mut path_segments = url.path_segments()?; + + let owner = path_segments.next()?; + let repo = path_segments.next()?; + + if (path_segments.next()?, path_segments.next()?) != ("releases", "download") { + return None; + } + + let tag = path_segments.next()?; + let artifact_name = path_segments.next()?; + + (path_segments.next().is_none() && url.fragment().is_none() && url.query().is_none()).then( + || Self { + release: GhRelease { + repo: GhRepo { + owner: percent_decode_http_url_path(owner), + repo: percent_decode_http_url_path(repo), + }, + tag: percent_decode_http_url_path(tag), + }, + artifact_name: percent_decode_http_url_path(artifact_name), + }, + ) + } +} + +#[derive(Debug)] +struct Map(RwLock>>); + +impl Default for Map { + fn default() -> Self { + Self(Default::default()) + } +} + +impl Map +where + K: Eq + std::hash::Hash, + V: Default, +{ + fn get(&self, k: K) -> Arc { + let optional_value = self.0.read().unwrap().deref().get(&k).cloned(); + optional_value.unwrap_or_else(|| Arc::clone(self.0.write().unwrap().entry(k).or_default())) + } +} + +#[derive(Debug)] +struct Inner { + client: remote::Client, + release_artifacts: Map>>, + retry_after: Mutex>, + + auth_token: Option, + is_auth_token_valid: AtomicBool, +} + +/// Github API client for querying whether a release artifact exitsts. +/// Can only handle github.com for now. +#[derive(Clone, Debug)] +pub struct GhApiClient(Arc); + +impl GhApiClient { + pub fn new(client: remote::Client, auth_token: Option) -> Self { + Self(Arc::new(Inner { + client, + release_artifacts: Default::default(), + retry_after: Default::default(), + + auth_token, + is_auth_token_valid: AtomicBool::new(true), + })) + } + + pub fn remote_client(&self) -> &remote::Client { + &self.0.client + } +} + +impl GhApiClient { + fn check_retry_after(&self) -> Result<(), GhApiError> { + let mut guard = self.0.retry_after.lock().unwrap(); + + if let Some(retry_after) = *guard { + if retry_after.elapsed().is_zero() { + return Err(GhApiError::RateLimit { + retry_after: Some(retry_after - Instant::now()), + }); + } else { + // Instant retry_after is already reached. + *guard = None; + } + } + + Ok(()) + } + + fn get_auth_token(&self) -> Option<&str> { + if self.0.is_auth_token_valid.load(Relaxed) { + self.0.auth_token.as_deref() + } else { + None + } + } + + pub fn has_gh_token(&self) -> bool { + self.get_auth_token().is_some() + } + + async fn do_fetch( + &self, + graphql_func: GraphQLFn, + restful_func: RestfulFn, + data: &T, + ) -> Result + where + GraphQLFn: Fn(&remote::Client, &T, &str) -> GraphQLFut, + RestfulFn: Fn(&remote::Client, &T) -> RestfulFut, + GraphQLFut: Future> + Send + Sync + 'static, + RestfulFut: Future> + Send + Sync + 'static, + { + self.check_retry_after()?; + + if let Some(auth_token) = self.get_auth_token() { + match graphql_func(&self.0.client, data, auth_token).await { + Err(GhApiError::Unauthorized) => { + self.0.is_auth_token_valid.store(false, Relaxed); + } + res => return res.map_err(|err| err.context("GraphQL API")), + } + } + + restful_func(&self.0.client, data) + .await + .map_err(|err| err.context("Restful API")) + } + + #[instrument(level = "debug", skip(self), ret)] + pub async fn get_repo_info(&self, repo: &GhRepo) -> Result, GhApiError> { + match self + .do_fetch( + repo_info::fetch_repo_info_graphql_api, + repo_info::fetch_repo_info_restful_api, + repo, + ) + .await + { + Ok(repo_info) => Ok(repo_info), + Err(GhApiError::NotFound) => Ok(None), + Err(err) => Err(err), + } + } +} + +#[derive(Clone, Debug, Eq, PartialEq, Hash)] +pub struct GhReleaseArtifactUrl(Url); + +impl GhApiClient { + /// Return `Ok(Some(api_artifact_url))` if exists. + /// + /// The returned future is guaranteed to be pointer size. + #[instrument(level = "debug", skip(self), ret)] + pub async fn has_release_artifact( + &self, + GhReleaseArtifact { + release, + artifact_name, + }: GhReleaseArtifact, + ) -> Result, GhApiError> { + let once_cell = self.0.release_artifacts.get(release.clone()); + let res = once_cell + .get_or_try_init(|| { + Box::pin(async { + match self + .do_fetch( + release_artifacts::fetch_release_artifacts_graphql_api, + release_artifacts::fetch_release_artifacts_restful_api, + &release, + ) + .await + { + Ok(artifacts) => Ok(Some(artifacts)), + Err(GhApiError::NotFound) => Ok(None), + Err(err) => Err(err), + } + }) + }) + .await; + + match res { + Ok(Some(artifacts)) => Ok(artifacts + .get_artifact_url(&artifact_name) + .map(GhReleaseArtifactUrl)), + Ok(None) => Ok(None), + Err(GhApiError::RateLimit { retry_after }) => { + *self.0.retry_after.lock().unwrap() = + Some(Instant::now() + retry_after.unwrap_or(DEFAULT_RETRY_DURATION)); + + Err(GhApiError::RateLimit { retry_after }) + } + Err(err) => Err(err), + } + } + + pub async fn download_artifact( + &self, + artifact_url: GhReleaseArtifactUrl, + ) -> Result, GhApiError> { + self.check_retry_after()?; + + let Some(auth_token) = self.get_auth_token() else { + return Err(GhApiError::Unauthorized); + }; + + let response = self + .0 + .client + .get(artifact_url.0) + .header("Accept", "application/octet-stream") + .bearer_auth(&auth_token) + .send(false) + .await?; + + match check_http_status_and_header(&response) { + Err(GhApiError::Unauthorized) => { + self.0.is_auth_token_valid.store(false, Relaxed); + } + res => res?, + } + + Ok(Download::from_response(response)) + } +} + +#[cfg(test)] +mod test { + use super::*; + use compact_str::{CompactString, ToCompactString}; + use std::{env, num::NonZeroU16, time::Duration}; + use tokio::time::sleep; + use tracing::subscriber::set_global_default; + use tracing_subscriber::{filter::LevelFilter, fmt::fmt}; + + static DEFAULT_RETRY_AFTER: Duration = Duration::from_secs(1); + + mod cargo_binstall_v0_20_1 { + use super::{CompactString, GhRelease, GhRepo}; + + pub(super) const RELEASE: GhRelease = GhRelease { + repo: GhRepo { + owner: CompactString::new_inline("cargo-bins"), + repo: CompactString::new_inline("cargo-binstall"), + }, + tag: CompactString::new_inline("v0.20.1"), + }; + + pub(super) const ARTIFACTS: &[&str] = &[ + "cargo-binstall-aarch64-apple-darwin.full.zip", + "cargo-binstall-aarch64-apple-darwin.zip", + "cargo-binstall-aarch64-pc-windows-msvc.full.zip", + "cargo-binstall-aarch64-pc-windows-msvc.zip", + "cargo-binstall-aarch64-unknown-linux-gnu.full.tgz", + "cargo-binstall-aarch64-unknown-linux-gnu.tgz", + "cargo-binstall-aarch64-unknown-linux-musl.full.tgz", + "cargo-binstall-aarch64-unknown-linux-musl.tgz", + "cargo-binstall-armv7-unknown-linux-gnueabihf.full.tgz", + "cargo-binstall-armv7-unknown-linux-gnueabihf.tgz", + "cargo-binstall-armv7-unknown-linux-musleabihf.full.tgz", + "cargo-binstall-armv7-unknown-linux-musleabihf.tgz", + "cargo-binstall-universal-apple-darwin.full.zip", + "cargo-binstall-universal-apple-darwin.zip", + "cargo-binstall-x86_64-apple-darwin.full.zip", + "cargo-binstall-x86_64-apple-darwin.zip", + "cargo-binstall-x86_64-pc-windows-msvc.full.zip", + "cargo-binstall-x86_64-pc-windows-msvc.zip", + "cargo-binstall-x86_64-unknown-linux-gnu.full.tgz", + "cargo-binstall-x86_64-unknown-linux-gnu.tgz", + "cargo-binstall-x86_64-unknown-linux-musl.full.tgz", + "cargo-binstall-x86_64-unknown-linux-musl.tgz", + ]; + } + + mod cargo_audit_v_0_17_6 { + use super::*; + + pub(super) const RELEASE: GhRelease = GhRelease { + repo: GhRepo { + owner: CompactString::new_inline("rustsec"), + repo: CompactString::new_inline("rustsec"), + }, + tag: CompactString::new_inline("cargo-audit/v0.17.6"), + }; + + pub(super) const ARTIFACTS: &[&str] = &[ + "cargo-audit-aarch64-unknown-linux-gnu-v0.17.6.tgz", + "cargo-audit-armv7-unknown-linux-gnueabihf-v0.17.6.tgz", + "cargo-audit-x86_64-apple-darwin-v0.17.6.tgz", + "cargo-audit-x86_64-pc-windows-msvc-v0.17.6.zip", + "cargo-audit-x86_64-unknown-linux-gnu-v0.17.6.tgz", + "cargo-audit-x86_64-unknown-linux-musl-v0.17.6.tgz", + ]; + + #[test] + fn extract_with_escaped_characters() { + let release_artifact = try_extract_artifact_from_str( +"https://github.com/rustsec/rustsec/releases/download/cargo-audit%2Fv0.17.6/cargo-audit-aarch64-unknown-linux-gnu-v0.17.6.tgz" + ).unwrap(); + + assert_eq!( + release_artifact, + GhReleaseArtifact { + release: RELEASE, + artifact_name: CompactString::from( + "cargo-audit-aarch64-unknown-linux-gnu-v0.17.6.tgz", + ) + } + ); + } + } + + #[test] + fn gh_repo_extract_from_and_to_url() { + [ + "https://github.com/cargo-bins/cargo-binstall", + "https://github.com/rustsec/rustsec", + ] + .into_iter() + .for_each(|url| { + let url = Url::parse(&url).unwrap(); + assert_eq!( + GhRepo::try_extract_from_url(&url) + .unwrap() + .repo_url() + .unwrap(), + url + ); + }) + } + + fn try_extract_artifact_from_str(s: &str) -> Option { + GhReleaseArtifact::try_extract_from_url(&url::Url::parse(s).unwrap()) + } + + fn assert_extract_gh_release_artifacts_failures(urls: &[&str]) { + for url in urls { + assert_eq!(try_extract_artifact_from_str(url), None); + } + } + + #[test] + fn extract_gh_release_artifacts_failure() { + use cargo_binstall_v0_20_1::*; + + let GhRelease { + repo: GhRepo { owner, repo }, + tag, + } = RELEASE; + + assert_extract_gh_release_artifacts_failures(&[ + "https://examle.com", + "https://github.com", + &format!("https://github.com/{owner}"), + &format!("https://github.com/{owner}/{repo}"), + &format!("https://github.com/{owner}/{repo}/123e"), + &format!("https://github.com/{owner}/{repo}/releases/21343"), + &format!("https://github.com/{owner}/{repo}/releases/download"), + &format!("https://github.com/{owner}/{repo}/releases/download/{tag}"), + &format!("https://github.com/{owner}/{repo}/releases/download/{tag}/a/23"), + &format!("https://github.com/{owner}/{repo}/releases/download/{tag}/a#a=12"), + &format!("https://github.com/{owner}/{repo}/releases/download/{tag}/a?page=3"), + ]); + } + + #[test] + fn extract_gh_release_artifacts_success() { + use cargo_binstall_v0_20_1::*; + + let GhRelease { + repo: GhRepo { owner, repo }, + tag, + } = RELEASE; + + for artifact in ARTIFACTS { + let GhReleaseArtifact { + release, + artifact_name, + } = try_extract_artifact_from_str(&format!( + "https://github.com/{owner}/{repo}/releases/download/{tag}/{artifact}" + )) + .unwrap(); + + assert_eq!(release, RELEASE); + assert_eq!(artifact_name, artifact); + } + } + + fn init_logger() { + // Disable time, target, file, line_num, thread name/ids to make the + // output more readable + let subscriber = fmt() + .without_time() + .with_target(false) + .with_file(false) + .with_line_number(false) + .with_thread_names(false) + .with_thread_ids(false) + .with_test_writer() + .with_max_level(LevelFilter::DEBUG) + .finish(); + + // Setup global subscriber + let _ = set_global_default(subscriber); + } + + fn create_remote_client() -> remote::Client { + remote::Client::new( + concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), + None, + NonZeroU16::new(10).unwrap(), + 1.try_into().unwrap(), + [], + ) + .unwrap() + } + + /// Mark this as an async fn so that you won't accidentally use it in + /// sync context. + fn create_client() -> Vec { + let client = create_remote_client(); + + let mut gh_clients = vec![GhApiClient::new(client.clone(), None)]; + + if let Ok(token) = env::var("GITHUB_TOKEN") { + gh_clients.push(GhApiClient::new(client, Some(token.into()))); + } + + gh_clients + } + + #[tokio::test] + async fn test_get_repo_info() { + const PUBLIC_REPOS: [GhRepo; 1] = [GhRepo { + owner: CompactString::new_inline("cargo-bins"), + repo: CompactString::new_inline("cargo-binstall"), + }]; + const PRIVATE_REPOS: [GhRepo; 1] = [GhRepo { + owner: CompactString::new_inline("cargo-bins"), + repo: CompactString::new_inline("private-repo-for-testing"), + }]; + const NON_EXISTENT_REPOS: [GhRepo; 1] = [GhRepo { + owner: CompactString::new_inline("cargo-bins"), + repo: CompactString::new_inline("ttt"), + }]; + + init_logger(); + + let mut tests: Vec<(_, _)> = Vec::new(); + + for client in create_client() { + for repo in PUBLIC_REPOS { + let client = client.clone(); + + tests.push(( + Some(RepoInfo::new(repo.clone(), false)), + tokio::spawn(async move { client.get_repo_info(&repo).await }), + )); + } + + for repo in NON_EXISTENT_REPOS { + let client = client.clone(); + + tests.push(( + None, + tokio::spawn(async move { client.get_repo_info(&repo).await }), + )); + } + + if client.has_gh_token() { + for repo in PRIVATE_REPOS { + let client = client.clone(); + + tests.push(( + Some(RepoInfo::new(repo.clone(), true)), + tokio::spawn(async move { + loop { + match client.get_repo_info(&repo).await { + Err(GhApiError::RateLimit { retry_after }) => { + sleep(retry_after.unwrap_or(DEFAULT_RETRY_AFTER)).await + } + res => break res, + } + } + }), + )); + } + } + } + + for (expected, task) in tests { + assert_eq!(task.await.unwrap().unwrap(), expected); + } + } + + #[tokio::test] + async fn test_has_release_artifact_and_download_artifacts() { + const RELEASES: [(GhRelease, &[&str]); 2] = [ + ( + cargo_binstall_v0_20_1::RELEASE, + cargo_binstall_v0_20_1::ARTIFACTS, + ), + ( + cargo_audit_v_0_17_6::RELEASE, + cargo_audit_v_0_17_6::ARTIFACTS, + ), + ]; + const NON_EXISTENT_RELEASES: [GhRelease; 1] = [GhRelease { + repo: GhRepo { + owner: CompactString::new_inline("cargo-bins"), + repo: CompactString::new_inline("cargo-binstall"), + }, + // We are currently at v0.20.1 and we would never release + // anything older than v0.20.1 + tag: CompactString::new_inline("v0.18.2"), + }]; + + init_logger(); + + let mut tasks = Vec::new(); + + for client in create_client() { + for (release, artifacts) in RELEASES { + for artifact_name in artifacts { + let client = client.clone(); + let release = release.clone(); + tasks.push(tokio::spawn(async move { + let artifact = GhReleaseArtifact { + release, + artifact_name: artifact_name.to_compact_string(), + }; + + let browser_download_task = client.get_auth_token().map(|_| { + tokio::spawn( + Download::new( + client.remote_client().clone(), + Url::parse(&format!( + "https://github.com/{}/{}/releases/download/{}/{}", + artifact.release.repo.owner, + artifact.release.repo.repo, + artifact.release.tag, + artifact.artifact_name, + )) + .unwrap(), + ) + .into_bytes(), + ) + }); + + let artifact_url = loop { + match client.has_release_artifact(artifact.clone()).await { + Err(GhApiError::RateLimit { retry_after }) => { + sleep(retry_after.unwrap_or(DEFAULT_RETRY_AFTER)).await + } + res => break res.unwrap().unwrap(), + } + }; + + if let Some(browser_download_task) = browser_download_task { + let artifact_download_data = loop { + match client.download_artifact(artifact_url.clone()).await { + Err(GhApiError::RateLimit { retry_after }) => { + sleep(retry_after.unwrap_or(DEFAULT_RETRY_AFTER)).await + } + res => break res.unwrap(), + } + } + .into_bytes() + .await + .unwrap(); + + let browser_download_data = + browser_download_task.await.unwrap().unwrap(); + + assert_eq!(artifact_download_data, browser_download_data); + } + })); + } + + let client = client.clone(); + tasks.push(tokio::spawn(async move { + assert_eq!( + client + .has_release_artifact(GhReleaseArtifact { + release, + artifact_name: "123z".to_compact_string(), + }) + .await + .unwrap(), + None + ); + })); + } + + for release in NON_EXISTENT_RELEASES { + let client = client.clone(); + + tasks.push(tokio::spawn(async move { + assert_eq!( + client + .has_release_artifact(GhReleaseArtifact { + release, + artifact_name: "1234".to_compact_string(), + }) + .await + .unwrap(), + None + ); + })); + } + } + + for task in tasks { + task.await.unwrap(); + } + } +} diff --git a/crates/binstalk-git-repo-api/src/gh_api_client/common.rs b/crates/binstalk-git-repo-api/src/gh_api_client/common.rs new file mode 100644 index 00000000..b09823e9 --- /dev/null +++ b/crates/binstalk-git-repo-api/src/gh_api_client/common.rs @@ -0,0 +1,143 @@ +use std::{fmt::Debug, future::Future, sync::OnceLock, time::Duration}; + +use binstalk_downloader::remote::{self, Response, Url}; +use compact_str::CompactString; +use percent_encoding::percent_decode_str; +use serde::{de::DeserializeOwned, Deserialize, Serialize}; +use serde_json::to_string as to_json_string; +use tracing::debug; + +use super::{GhApiError, GhGraphQLErrors}; + +pub(super) fn percent_decode_http_url_path(input: &str) -> CompactString { + if input.contains('%') { + percent_decode_str(input).decode_utf8_lossy().into() + } else { + // No '%', no need to decode. + CompactString::new(input) + } +} + +pub(super) fn check_http_status_and_header(response: &Response) -> Result<(), GhApiError> { + let headers = response.headers(); + + match response.status() { + remote::StatusCode::FORBIDDEN + if headers + .get("x-ratelimit-remaining") + .map(|val| val == "0") + .unwrap_or(false) => + { + Err(GhApiError::RateLimit { + retry_after: headers.get("x-ratelimit-reset").and_then(|value| { + let secs = value.to_str().ok()?.parse().ok()?; + Some(Duration::from_secs(secs)) + }), + }) + } + + remote::StatusCode::UNAUTHORIZED => Err(GhApiError::Unauthorized), + remote::StatusCode::NOT_FOUND => Err(GhApiError::NotFound), + + _ => Ok(()), + } +} + +fn get_api_endpoint() -> &'static Url { + static API_ENDPOINT: OnceLock = OnceLock::new(); + + API_ENDPOINT.get_or_init(|| { + Url::parse("https://api.github.com/").expect("Literal provided must be a valid url") + }) +} + +pub(super) fn issue_restful_api( + client: &remote::Client, + path: &[&str], +) -> impl Future> + Send + Sync + 'static +where + T: DeserializeOwned, +{ + let mut url = get_api_endpoint().clone(); + + url.path_segments_mut() + .expect("get_api_endpoint() should return a https url") + .extend(path); + + debug!("Getting restful API: {url}"); + + let future = client + .get(url) + .header("Accept", "application/vnd.github+json") + .header("X-GitHub-Api-Version", "2022-11-28") + .send(false); + + async move { + let response = future.await?; + + check_http_status_and_header(&response)?; + + Ok(response.json().await?) + } +} + +#[derive(Debug, Deserialize)] +struct GraphQLResponse { + data: T, + errors: Option, +} + +#[derive(Serialize)] +struct GraphQLQuery { + query: String, +} + +fn get_graphql_endpoint() -> Url { + let mut graphql_endpoint = get_api_endpoint().clone(); + + graphql_endpoint + .path_segments_mut() + .expect("get_api_endpoint() should return a https url") + .push("graphql"); + + graphql_endpoint +} + +pub(super) fn issue_graphql_query( + client: &remote::Client, + query: String, + auth_token: &str, +) -> impl Future> + Send + Sync + 'static +where + T: DeserializeOwned + Debug, +{ + let res = to_json_string(&GraphQLQuery { query }) + .map_err(remote::Error::from) + .map(|graphql_query| { + let graphql_endpoint = get_graphql_endpoint(); + + debug!("Sending graphql query to {graphql_endpoint}: '{graphql_query}'"); + + let request_builder = client + .post(graphql_endpoint, graphql_query) + .header("Accept", "application/vnd.github+json") + .bearer_auth(&auth_token); + + request_builder.send(false) + }); + + async move { + let response = res?.await?; + check_http_status_and_header(&response)?; + + let mut response: GraphQLResponse = response.json().await?; + + debug!("response = {response:?}"); + + if let Some(error) = response.errors.take() { + Err(error.into()) + } else { + Ok(response.data) + } + } +} diff --git a/crates/binstalk-git-repo-api/src/gh_api_client/error.rs b/crates/binstalk-git-repo-api/src/gh_api_client/error.rs new file mode 100644 index 00000000..1787a372 --- /dev/null +++ b/crates/binstalk-git-repo-api/src/gh_api_client/error.rs @@ -0,0 +1,203 @@ +use std::{error, fmt, io, time::Duration}; + +use binstalk_downloader::remote; +use compact_str::{CompactString, ToCompactString}; +use serde::{de::Deserializer, Deserialize}; +use thiserror::Error as ThisError; + +#[derive(ThisError, Debug)] +#[error("Context: '{context}', err: '{err}'")] +pub struct GhApiContextError { + context: CompactString, + #[source] + err: GhApiError, +} + +#[derive(ThisError, Debug)] +#[non_exhaustive] +pub enum GhApiError { + #[error("IO Error: {0}")] + Io(#[from] io::Error), + + #[error("Remote Error: {0}")] + Remote(#[from] remote::Error), + + #[error("Failed to parse url: {0}")] + InvalidUrl(#[from] url::ParseError), + + /// A wrapped error providing the context the error is about. + #[error(transparent)] + Context(Box), + + #[error("Remote failed to process GraphQL query: {0}")] + GraphQLErrors(GhGraphQLErrors), + + #[error("Hit rate-limit, retry after {retry_after:?}")] + RateLimit { retry_after: Option }, + + #[error("Corresponding resource is not found")] + NotFound, + + #[error("Does not have permission to access the API")] + Unauthorized, +} + +impl GhApiError { + /// Attach context to [`GhApiError`] + pub fn context(self, context: impl fmt::Display) -> Self { + use GhApiError::*; + + if matches!(self, RateLimit { .. } | NotFound | Unauthorized) { + self + } else { + Self::Context(Box::new(GhApiContextError { + context: context.to_compact_string(), + err: self, + })) + } + } +} + +impl From for GhApiError { + fn from(e: GhGraphQLErrors) -> Self { + if e.is_rate_limited() { + Self::RateLimit { retry_after: None } + } else if e.is_not_found_error() { + Self::NotFound + } else { + Self::GraphQLErrors(e) + } + } +} + +#[derive(Debug, Deserialize)] +pub struct GhGraphQLErrors(Box<[GraphQLError]>); + +impl GhGraphQLErrors { + fn is_rate_limited(&self) -> bool { + self.0 + .iter() + .any(|error| matches!(error.error_type, GraphQLErrorType::RateLimited)) + } + + fn is_not_found_error(&self) -> bool { + self.0 + .iter() + .any(|error| matches!(&error.error_type, GraphQLErrorType::Other(error_type) if *error_type == "NOT_FOUND")) + } +} + +impl error::Error for GhGraphQLErrors {} + +impl fmt::Display for GhGraphQLErrors { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + let last_error_index = self.0.len() - 1; + + for (i, error) in self.0.iter().enumerate() { + write!( + f, + "type: '{error_type}', msg: '{msg}'", + error_type = error.error_type, + msg = error.message, + )?; + + for location in error.locations.as_deref().into_iter().flatten() { + write!( + f, + ", occured on query line {line} col {col}", + line = location.line, + col = location.column + )?; + } + + for (k, v) in &error.others { + write!(f, ", {k}: {v}")?; + } + + if i < last_error_index { + f.write_str("\n")?; + } + } + + Ok(()) + } +} + +#[derive(Debug, Deserialize)] +struct GraphQLError { + message: CompactString, + locations: Option>, + + #[serde(rename = "type")] + error_type: GraphQLErrorType, + + #[serde(flatten, with = "tuple_vec_map")] + others: Vec<(CompactString, serde_json::Value)>, +} + +#[derive(Debug)] +pub(super) enum GraphQLErrorType { + RateLimited, + Other(CompactString), +} + +impl fmt::Display for GraphQLErrorType { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + f.write_str(match self { + GraphQLErrorType::RateLimited => "RATE_LIMITED", + GraphQLErrorType::Other(s) => s, + }) + } +} + +impl<'de> Deserialize<'de> for GraphQLErrorType { + fn deserialize(deserializer: D) -> Result + where + D: Deserializer<'de>, + { + let s = CompactString::deserialize(deserializer)?; + Ok(match &*s { + "RATE_LIMITED" => GraphQLErrorType::RateLimited, + _ => GraphQLErrorType::Other(s), + }) + } +} + +#[derive(Debug, Deserialize)] +struct GraphQLLocation { + line: u64, + column: u64, +} + +#[cfg(test)] +mod test { + use super::*; + use serde::de::value::{BorrowedStrDeserializer, Error}; + + macro_rules! assert_matches { + ($expression:expr, $pattern:pat $(if $guard:expr)? $(,)?) => { + match $expression { + $pattern $(if $guard)? => true, + expr => { + panic!( + "assertion failed: `{expr:?}` does not match `{}`", + stringify!($pattern $(if $guard)?) + ) + } + } + } + } + + #[test] + fn test_graph_ql_error_type() { + let deserialize = |input: &str| { + GraphQLErrorType::deserialize(BorrowedStrDeserializer::<'_, Error>::new(input)).unwrap() + }; + + assert_matches!(deserialize("RATE_LIMITED"), GraphQLErrorType::RateLimited); + assert_matches!( + deserialize("rATE_LIMITED"), + GraphQLErrorType::Other(val) if val == CompactString::new("rATE_LIMITED") + ); + } +} diff --git a/crates/binstalk-git-repo-api/src/gh_api_client/release_artifacts.rs b/crates/binstalk-git-repo-api/src/gh_api_client/release_artifacts.rs new file mode 100644 index 00000000..312d8a73 --- /dev/null +++ b/crates/binstalk-git-repo-api/src/gh_api_client/release_artifacts.rs @@ -0,0 +1,187 @@ +use std::{ + borrow::Borrow, + collections::HashSet, + fmt, + future::Future, + hash::{Hash, Hasher}, +}; + +use binstalk_downloader::remote::{self}; +use compact_str::{CompactString, ToCompactString}; +use serde::Deserialize; +use url::Url; + +use super::{ + common::{issue_graphql_query, issue_restful_api}, + GhApiError, GhRelease, GhRepo, +}; + +// Only include fields we do care about + +#[derive(Eq, Deserialize, Debug)] +struct Artifact { + name: CompactString, + url: Url, +} + +// Manually implement PartialEq and Hash to ensure it will always produce the +// same hash as a str with the same content, and that the comparison will be +// the same to coparing a string. + +impl PartialEq for Artifact { + fn eq(&self, other: &Self) -> bool { + self.name.eq(&other.name) + } +} + +impl Hash for Artifact { + fn hash(&self, state: &mut H) + where + H: Hasher, + { + let s: &str = self.name.as_str(); + s.hash(state) + } +} + +// Implement Borrow so that we can use call +// `HashSet::contains::` + +impl Borrow for Artifact { + fn borrow(&self) -> &str { + &self.name + } +} + +#[derive(Debug, Default, Deserialize)] +pub(super) struct Artifacts { + assets: HashSet, +} + +impl Artifacts { + /// get url for downloading the artifact using GitHub API (for private repository). + pub(super) fn get_artifact_url(&self, artifact_name: &str) -> Option { + self.assets + .get(artifact_name) + .map(|artifact| artifact.url.clone()) + } +} + +pub(super) fn fetch_release_artifacts_restful_api( + client: &remote::Client, + GhRelease { + repo: GhRepo { owner, repo }, + tag, + }: &GhRelease, +) -> impl Future> + Send + Sync + 'static { + issue_restful_api(client, &["repos", owner, repo, "releases", "tags", tag]) +} + +#[derive(Debug, Deserialize)] +struct GraphQLData { + repository: Option, +} + +#[derive(Debug, Deserialize)] +struct GraphQLRepo { + release: Option, +} + +#[derive(Debug, Deserialize)] +struct GraphQLRelease { + #[serde(rename = "releaseAssets")] + assets: GraphQLReleaseAssets, +} + +#[derive(Debug, Deserialize)] +struct GraphQLReleaseAssets { + nodes: Vec, + #[serde(rename = "pageInfo")] + page_info: GraphQLPageInfo, +} + +#[derive(Debug, Deserialize)] +struct GraphQLPageInfo { + #[serde(rename = "endCursor")] + end_cursor: Option, + #[serde(rename = "hasNextPage")] + has_next_page: bool, +} + +enum FilterCondition { + Init, + After(CompactString), +} + +impl fmt::Display for FilterCondition { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + // GitHub imposes a limit of 100 for the value passed to param "first" + FilterCondition::Init => f.write_str("first:100"), + FilterCondition::After(end_cursor) => write!(f, r#"first:100,after:"{end_cursor}""#), + } + } +} + +pub(super) fn fetch_release_artifacts_graphql_api( + client: &remote::Client, + GhRelease { + repo: GhRepo { owner, repo }, + tag, + }: &GhRelease, + auth_token: &str, +) -> impl Future> + Send + Sync + 'static { + let client = client.clone(); + let auth_token = auth_token.to_compact_string(); + + let base_query_prefix = format!( + r#" +query {{ + repository(owner:"{owner}",name:"{repo}") {{ + release(tagName:"{tag}") {{"# + ); + + let base_query_suffix = r#" + nodes { name url } + pageInfo { endCursor hasNextPage } +}}}}"# + .trim(); + + async move { + let mut artifacts = Artifacts::default(); + let mut cond = FilterCondition::Init; + let base_query_prefix = base_query_prefix.trim(); + + loop { + let query = format!( + r#" +{base_query_prefix} +releaseAssets({cond}) {{ +{base_query_suffix}"# + ); + + let data: GraphQLData = issue_graphql_query(&client, query, &auth_token).await?; + + let assets = data + .repository + .and_then(|repository| repository.release) + .map(|release| release.assets); + + if let Some(assets) = assets { + artifacts.assets.extend(assets.nodes); + + match assets.page_info { + GraphQLPageInfo { + end_cursor: Some(end_cursor), + has_next_page: true, + } => { + cond = FilterCondition::After(end_cursor); + } + _ => break Ok(artifacts), + } + } else { + break Err(GhApiError::NotFound); + } + } + } +} diff --git a/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs b/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs new file mode 100644 index 00000000..ddc6d152 --- /dev/null +++ b/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs @@ -0,0 +1,80 @@ +use std::future::Future; + +use compact_str::CompactString; +use serde::Deserialize; + +use super::{ + common::{issue_graphql_query, issue_restful_api}, + remote, GhApiError, GhRepo, +}; + +#[derive(Clone, Eq, PartialEq, Hash, Debug, Deserialize)] +struct Owner { + login: CompactString, +} + +#[derive(Clone, Eq, PartialEq, Hash, Debug, Deserialize)] +pub struct RepoInfo { + owner: Owner, + name: CompactString, + private: bool, +} + +impl RepoInfo { + #[cfg(test)] + pub(crate) fn new(GhRepo { owner, repo }: GhRepo, private: bool) -> Self { + Self { + owner: Owner { login: owner }, + name: repo, + private, + } + } + pub fn repo(&self) -> GhRepo { + GhRepo { + owner: self.owner.login.clone(), + repo: self.name.clone(), + } + } + + pub fn is_private(&self) -> bool { + self.private + } +} + +pub(super) fn fetch_repo_info_restful_api( + client: &remote::Client, + GhRepo { owner, repo }: &GhRepo, +) -> impl Future, GhApiError>> + Send + Sync + 'static { + issue_restful_api(client, &["repos", owner, repo]) +} + +#[derive(Debug, Deserialize)] +struct GraphQLData { + repository: Option, +} + +pub(super) fn fetch_repo_info_graphql_api( + client: &remote::Client, + GhRepo { owner, repo }: &GhRepo, + auth_token: &str, +) -> impl Future, GhApiError>> + Send + Sync + 'static { + let query = format!( + r#" +query {{ + repository(owner:"{owner}",name:"{repo}") {{ + owner {{ + login + }} + name + private: isPrivate + }} +}}"# + ); + + let future = issue_graphql_query(client, query, auth_token); + + async move { + let data: GraphQLData = future.await?; + Ok(data.repository) + } +} diff --git a/crates/binstalk-git-repo-api/src/lib.rs b/crates/binstalk-git-repo-api/src/lib.rs new file mode 100644 index 00000000..7d7dd52c --- /dev/null +++ b/crates/binstalk-git-repo-api/src/lib.rs @@ -0,0 +1 @@ +pub mod gh_api_client; diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 12409e0c..e14816bd 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,9 +11,8 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader", default-features = false, features = [ - "gh-api-client", -] } +binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.0.0", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.4.1", path = "../binstalk-fetchers", features = [ "quickinstall", ] } diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index c5afd7a6..f367299d 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -4,9 +4,7 @@ use std::{ process::{ExitCode, ExitStatus, Termination}, }; -use binstalk_downloader::{ - download::DownloadError, gh_api_client::GhApiError, remote::Error as RemoteError, -}; +use binstalk_downloader::{download::DownloadError, remote::Error as RemoteError}; use binstalk_fetchers::FetchError; use compact_str::CompactString; use itertools::Itertools; @@ -19,7 +17,8 @@ use tracing::{error, warn}; use crate::{ bins, helpers::{ - cargo_toml::Error as CargoTomlError, cargo_toml_workspace::Error as LoadManifestFromWSError, + cargo_toml::Error as CargoTomlError, + cargo_toml_workspace::Error as LoadManifestFromWSError, gh_api_client::GhApiError, }, registry::{InvalidRegistryError, RegistryError}, }; diff --git a/crates/binstalk/src/helpers.rs b/crates/binstalk/src/helpers.rs index 058813de..4e5792e6 100644 --- a/crates/binstalk/src/helpers.rs +++ b/crates/binstalk/src/helpers.rs @@ -1,10 +1,13 @@ pub mod jobserver_client; -pub mod remote; +pub mod remote { + pub use binstalk_downloader::remote::*; + pub use url::ParseError as UrlParseError; +} pub(crate) mod target_triple; pub mod tasks; pub(crate) use binstalk_downloader::download; -pub use binstalk_downloader::gh_api_client; +pub use binstalk_git_repo_api::gh_api_client; pub(crate) use cargo_toml_workspace::{self, cargo_toml}; #[cfg(feature = "git")] diff --git a/crates/binstalk/src/helpers/remote.rs b/crates/binstalk/src/helpers/remote.rs deleted file mode 100644 index 24635b89..00000000 --- a/crates/binstalk/src/helpers/remote.rs +++ /dev/null @@ -1,54 +0,0 @@ -pub use binstalk_downloader::remote::*; -pub use url::ParseError as UrlParseError; - -use binstalk_downloader::gh_api_client::{GhApiClient, GhReleaseArtifact, HasReleaseArtifact}; -use std::sync::{ - atomic::{AtomicBool, Ordering::Relaxed}, - Once, -}; -use tracing::{debug, warn}; - -use crate::errors::BinstallError; - -/// This function returns a future where its size should be at most size of -/// 2 pointers. -pub async fn does_url_exist( - client: Client, - gh_api_client: GhApiClient, - url: &Url, -) -> Result { - static GH_API_CLIENT_FAILED: AtomicBool = AtomicBool::new(false); - static WARN_RATE_LIMIT_ONCE: Once = Once::new(); - static WARN_UNAUTHORIZED_ONCE: Once = Once::new(); - - debug!("Checking for package at: '{url}'"); - - if !GH_API_CLIENT_FAILED.load(Relaxed) { - if let Some(artifact) = GhReleaseArtifact::try_extract_from_url(url) { - debug!("Using GitHub API to check for existence of artifact, which will also cache the API response"); - - // The future returned has the same size as a pointer - match gh_api_client.has_release_artifact(artifact).await? { - HasReleaseArtifact::Yes => return Ok(true), - HasReleaseArtifact::No | HasReleaseArtifact::NoSuchRelease => return Ok(false), - - HasReleaseArtifact::RateLimit { retry_after } => { - WARN_RATE_LIMIT_ONCE.call_once(|| { - warn!("Your GitHub API token (if any) has reached its rate limit and cannot be used again until {retry_after:?}, so we will fallback to HEAD/GET on the url."); - warn!("If you did not supply a github token, consider doing so: GitHub limits unauthorized users to 60 requests per hour per origin IP address."); - }); - } - HasReleaseArtifact::Unauthorized => { - WARN_UNAUTHORIZED_ONCE.call_once(|| { - warn!("GitHub API somehow requires a token for the API access, so we will fallback to HEAD/GET on the url."); - warn!("Please consider supplying a token to cargo-binstall to speedup resolution."); - }); - } - } - - GH_API_CLIENT_FAILED.store(true, Relaxed); - } - } - - Ok(Box::pin(client.remote_gettable(url.clone())).await?) -} diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index 2124c14e..66366be6 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -6,9 +6,7 @@ use semver::VersionReq; use crate::{ fetchers::{Data, Fetcher, SignaturePolicy, TargetDataErased}, - helpers::{ - self, gh_api_client::GhApiClient, jobserver_client::LazyJobserverClient, remote::Client, - }, + helpers::{gh_api_client::GhApiClient, jobserver_client::LazyJobserverClient, remote::Client}, manifests::cargo_toml_binstall::PkgOverride, registry::Registry, DesiredTargets, @@ -23,7 +21,7 @@ pub type Resolver = #[non_exhaustive] pub enum CargoTomlFetchOverride { #[cfg(feature = "git")] - Git(helpers::git::GitUrl), + Git(crate::helpers::git::GitUrl), Path(PathBuf), } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 994bc6fd..0fa65d9b 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -12,7 +12,6 @@ use itertools::Itertools; use leon::Template; use maybe_owned::MaybeOwned; use semver::{Version, VersionReq}; -use tempfile::TempDir; use tokio::task::spawn_blocking; use tracing::{debug, error, info, instrument, warn}; @@ -21,7 +20,7 @@ use crate::{ errors::{BinstallError, VersionParseError}, fetchers::{Data, Fetcher, TargetData}, helpers::{ - self, cargo_toml::Manifest, cargo_toml_workspace::load_manifest_from_workspace, + cargo_toml::Manifest, cargo_toml_workspace::load_manifest_from_workspace, download::ExtractedFiles, remote::Client, target_triple::TargetTriple, tasks::AutoAbortJoinHandle, }, @@ -361,7 +360,7 @@ impl PackageInfo { } #[cfg(feature = "git")] Some(Git(git_url)) => { - use helpers::git::{GitCancellationToken, Repository as GitRepository}; + use crate::helpers::git::{GitCancellationToken, Repository as GitRepository}; let git_url = git_url.clone(); let name = name.clone(); @@ -370,7 +369,7 @@ impl PackageInfo { let cancel_on_drop = cancellation_token.clone().cancel_on_drop(); let ret = spawn_blocking(move || { - let dir = TempDir::new()?; + let dir = tempfile::TempDir::new()?; GitRepository::shallow_clone(git_url, dir.as_ref(), Some(cancellation_token))?; load_manifest_from_workspace(dir.as_ref(), &name).map_err(BinstallError::from) diff --git a/e2e-tests/manifests/private-github-repo-test-Cargo.toml b/e2e-tests/manifests/private-github-repo-test-Cargo.toml new file mode 100644 index 00000000..cf5cf9e6 --- /dev/null +++ b/e2e-tests/manifests/private-github-repo-test-Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "cargo-binstall" +description = "Rust binary package installer for CI integration" +repository = "https://github.com/cargo-bins/private-repo-for-testing" +version = "0.12.0" +rust-version = "1.61.0" +authors = ["ryan "] +edition = "2021" +license = "GPL-3.0" + +[[bin]] +name = "cargo-binstall" +path = "src/main.rs" diff --git a/e2e-tests/private-github-repo.sh b/e2e-tests/private-github-repo.sh new file mode 100755 index 00000000..e0050101 --- /dev/null +++ b/e2e-tests/private-github-repo.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +set -euxo pipefail + +unset CARGO_INSTALL_ROOT + +CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export CARGO_HOME +export PATH="$CARGO_HOME/bin:$PATH" + +# Install binaries using `--manifest-path` +# Also test default github template +"./$1" binstall --force --manifest-path "manifests/private-github-repo-test-Cargo.toml" --no-confirm cargo-binstall --strategies crate-meta-data + +# Test that the installed binaries can be run +cargo binstall --help >/dev/null + +cargo_binstall_version="$(cargo binstall -V)" +echo "$cargo_binstall_version" + +[ "$cargo_binstall_version" = "cargo-binstall 0.12.0" ] diff --git a/justfile b/justfile index d01a9510..d80759d0 100644 --- a/justfile +++ b/justfile @@ -219,7 +219,7 @@ check: print-env {{cargo-bin}} check -p cargo-binstall --no-default-features --features rustls {{cargo-check-args}} --profile check-only cargo-hack hack check -p binstalk-downloader \ --feature-powerset \ - --include-features default,json,gh-api-client \ + --include-features default,json \ --profile check-only \ {{cargo-check-args}} @@ -248,6 +248,7 @@ e2e-test-git: (e2e-test "git") e2e-test-registries: (e2e-test "registries") e2e-test-signing: (e2e-test "signing") e2e-test-continue-on-failure: (e2e-test "continue-on-failure") +e2e-test-private-github-repo: (e2e-test "private-github-repo") # WinTLS (Windows in CI) does not have TLS 1.3 support [windows] @@ -256,7 +257,7 @@ e2e-test-tls: (e2e-test "tls" "1.2") [macos] e2e-test-tls: (e2e-test "tls" "1.2") (e2e-test "tls" "1.3") -e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-git e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate e2e-test-no-track e2e-test-registries e2e-test-signing e2e-test-continue-on-failure +e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-git e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate e2e-test-no-track e2e-test-registries e2e-test-signing e2e-test-continue-on-failure e2e-test-private-github-repo unit-tests: print-env {{cargo-bin}} test {{cargo-build-args}} From 5bcc24374113fc7155a3f96e3276f7bb253b3012 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 10 Jun 2024 18:11:05 +1000 Subject: [PATCH 1731/2020] release: binstalk-downloader v0.11.0 (#1722) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-git-repo-api/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bf75d89e..354d7e66 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -292,7 +292,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.10.3" +version = "0.11.0" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index b7a55be1..eb0fbfc0 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.10.3" +version = "0.11.0" rust-version = "1.70.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 67816eae..aea86a93 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader", default-features = false } +binstalk-downloader = { version = "0.11.0", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.0.0", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.11.0", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 32a7279e..5befe5b4 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.11.0", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.7.0" @@ -24,5 +24,5 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.11.0", path = "../binstalk-downloader" } tracing-subscriber = "0.3" diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 2a3f5516..47094fb1 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.11.0", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } @@ -40,7 +40,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.11.0", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index e14816bd..aa51cffa 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.10.3", path = "../binstalk-downloader", default-features = false } +binstalk-downloader = { version = "0.11.0", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.0.0", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.4.1", path = "../binstalk-fetchers", features = [ "quickinstall", From 52f172c713336c551b5d55c5a3556d9c559b87d7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 10 Jun 2024 22:17:45 +1000 Subject: [PATCH 1732/2020] Fix binstalk_fetchers::FetchError definition (#1711) Rm useless cfg on it --- crates/binstalk-fetchers/src/lib.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/binstalk-fetchers/src/lib.rs b/crates/binstalk-fetchers/src/lib.rs index 688bfbbb..ea5b7a28 100644 --- a/crates/binstalk-fetchers/src/lib.rs +++ b/crates/binstalk-fetchers/src/lib.rs @@ -41,7 +41,6 @@ pub struct InvalidPkgFmtError { #[derive(Debug, ThisError, miette::Diagnostic)] #[non_exhaustive] -#[cfg_attr(feature = "miette", derive(miette::Diagnostic))] pub enum FetchError { #[error(transparent)] Download(#[from] DownloadError), From 3aae88346759ab3b6733f6ef8a163665368d916c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 11 Jun 2024 00:12:44 +1000 Subject: [PATCH 1733/2020] Speedup ci (#1724) * Optimize binstalk-git-repo-api Use a dedicated github token in CI Signed-off-by: Jiahao XU * Speedup CI using `cargo-nextest` Signed-off-by: Jiahao XU * Fix release profile override on Windows Signed-off-by: Jiahao XU * Optimize unit test in binstalk-registry Signed-off-by: Jiahao XU * Use `secrets.CI_RELEASE_TEST_GITHUB_TOKEN` for just-setup Signed-off-by: Jiahao XU * Fix unit testing in justfile Signed-off-by: Jiahao XU * Add retry on rate limit in unit testing Signed-off-by: Jiahao XU * Only use `CI_UNIT_TEST_GITHUB_TOKEN` in unit testing Signed-off-by: Jiahao XU * Fix `test_get_repo_info`: Retry on rate limit Signed-off-by: Jiahao XU * Fix `test_has_release_artifact_and_download_artifacts` Retry on rate limit Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 240 +++++++++-------- .github/workflows/release-packages.yml | 253 ++++++++++-------- .../src/gh_api_client.rs | 89 +++--- crates/binstalk-registry/src/lib.rs | 79 +++--- justfile | 3 +- 5 files changed, 356 insertions(+), 308 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0bbae3c5..416c5120 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,16 +51,19 @@ jobs: CARGO_BUILD_TARGET: ${{ matrix.target }} steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/just-setup - env: - # just-setup use binstall to install sccache, - # which works better when we provide it with GITHUB_TOKEN. - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: actions/checkout@v4 + - uses: ./.github/actions/just-setup + env: + # just-setup use binstall to install sccache, + # which works better when we provide it with GITHUB_TOKEN. + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN }} + with: + tools: cargo-nextest - - run: just test - env: - GITHUB_TOKEN: ${{ secrets.CI_TEST_GITHUB_TOKEN }} + - run: just test + env: + GITHUB_TOKEN: ${{ secrets.CI_TEST_GITHUB_TOKEN }} + CI_UNIT_TEST_GITHUB_TOKEN: ${{ secrets.CI_UNIT_TEST_GITHUB_TOKEN }} cross-check: strategy: @@ -85,22 +88,22 @@ jobs: env: CARGO_BUILD_TARGET: ${{ matrix.target }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Enable cargo-zigbuild - if: matrix.os == 'ubuntu-latest' - run: echo JUST_USE_CARGO_ZIGBUILD=true >> "$GITHUB_ENV" + - name: Enable cargo-zigbuild + if: matrix.os == 'ubuntu-latest' + run: echo JUST_USE_CARGO_ZIGBUILD=true >> "$GITHUB_ENV" - - uses: ./.github/actions/just-setup - with: - tools: cargo-hack@0.6.10 - env: - # just-setup use binstall to install sccache, - # which works better when we provide it with GITHUB_TOKEN. - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: ./.github/actions/just-setup + with: + tools: cargo-hack@0.6.10 + env: + # just-setup use binstall to install sccache, + # which works better when we provide it with GITHUB_TOKEN. + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN }} - - run: just avoid-dev-deps - - run: just check + - run: just avoid-dev-deps + - run: just check lint: strategy: @@ -116,12 +119,16 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - - uses: ./.github/actions/just-setup + - uses: actions/checkout@v4 + - uses: ./.github/actions/just-setup + env: + # just-setup use binstall to install sccache, + # which works better when we provide it with GITHUB_TOKEN. + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN }} - - run: just toolchain rustfmt,clippy - - run: just avoid-dev-deps - - run: just lint + - run: just toolchain rustfmt,clippy + - run: just avoid-dev-deps + - run: just lint pr-info: outputs: @@ -130,12 +137,12 @@ jobs: runs-on: ubuntu-latest steps: - - id: meta - if: github.event_name == 'pull_request' - uses: cargo-bins/release-meta@v1 - with: - event-data: ${{ toJSON(github.event) }} - extract-notes-under: '### Release notes' + - id: meta + if: github.event_name == 'pull_request' + uses: cargo-bins/release-meta@v1 + with: + event-data: ${{ toJSON(github.event) }} + extract-notes-under: "### Release notes" release-dry-run: needs: pr-info @@ -158,42 +165,42 @@ jobs: env: CARGO_BUILD_TARGET: x86_64-unknown-linux-musl steps: - - uses: actions/checkout@v4 - - name: Install ${{ env.CARGO_BUILD_TARGET }} target - run: | - rustup target add $CARGO_BUILD_TARGET - pip3 install -r zigbuild-requirements.txt - - uses: Swatinem/rust-cache@v2 - with: - cache-all-crates: true - - name: Build detect-targets - run: | - cargo zigbuild --features cli-logging --target $CARGO_BUILD_TARGET - # Set working directory here, otherwise `cargo-zigbuild` would download - # and build quite a few unused dependencies. - working-directory: crates/detect-targets - - uses: actions/upload-artifact@v4 - with: - name: detect-targets - path: target/${{ env.CARGO_BUILD_TARGET }}/debug/detect-targets + - uses: actions/checkout@v4 + - name: Install ${{ env.CARGO_BUILD_TARGET }} target + run: | + rustup target add $CARGO_BUILD_TARGET + pip3 install -r zigbuild-requirements.txt + - uses: Swatinem/rust-cache@v2 + with: + cache-all-crates: true + - name: Build detect-targets + run: | + cargo zigbuild --features cli-logging --target $CARGO_BUILD_TARGET + # Set working directory here, otherwise `cargo-zigbuild` would download + # and build quite a few unused dependencies. + working-directory: crates/detect-targets + - uses: actions/upload-artifact@v4 + with: + name: detect-targets + path: target/${{ env.CARGO_BUILD_TARGET }}/debug/detect-targets detect-targets-alpine-test: runs-on: ubuntu-latest needs: detect-targets-build steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - uses: actions/download-artifact@v4 - with: - name: detect-targets - - run: chmod +x detect-targets + - uses: actions/download-artifact@v4 + with: + name: detect-targets + - run: chmod +x detect-targets - - name: Run test in alpine - run: | - docker run --rm \ - --mount src="$PWD/detect-targets",dst=/usr/local/bin/detect-targets,type=bind \ - --mount src="$PWD/.github/scripts/test-detect-targets-musl.sh",dst=/usr/local/bin/test.sh,type=bind \ - alpine /bin/ash -c "apk update && apk add bash && test.sh x86_64-unknown-linux-musl" + - name: Run test in alpine + run: | + docker run --rm \ + --mount src="$PWD/detect-targets",dst=/usr/local/bin/detect-targets,type=bind \ + --mount src="$PWD/.github/scripts/test-detect-targets-musl.sh",dst=/usr/local/bin/test.sh,type=bind \ + alpine /bin/ash -c "apk update && apk add bash && test.sh x86_64-unknown-linux-musl" detect-targets-ubuntu-test: needs: detect-targets-build @@ -205,15 +212,15 @@ jobs: - ubuntu-latest runs-on: ${{ matrix.os }} steps: - - uses: actions/download-artifact@v4 - with: - name: detect-targets - - run: chmod +x detect-targets + - uses: actions/download-artifact@v4 + with: + name: detect-targets + - run: chmod +x detect-targets - - name: Run test in ubuntu - run: | - set -exuo pipefail - [ "$(./detect-targets)" = "$(printf 'x86_64-unknown-linux-gnu\nx86_64-unknown-linux-musl')" ] + - name: Run test in ubuntu + run: | + set -exuo pipefail + [ "$(./detect-targets)" = "$(printf 'x86_64-unknown-linux-gnu\nx86_64-unknown-linux-musl')" ] detect-targets-more-glibc-test: needs: detect-targets-build @@ -228,33 +235,33 @@ jobs: - fedora runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v4 - with: - name: detect-targets - - run: chmod +x detect-targets + - uses: actions/download-artifact@v4 + with: + name: detect-targets + - run: chmod +x detect-targets - - name: Run test - run: | - set -exuo pipefail - [ "$(docker run --rm \ - --mount src="$PWD/detect-targets",dst=/usr/local/bin/detect-targets,type=bind \ - ${{ matrix.container }} detect-targets )" = "$(printf 'x86_64-unknown-linux-gnu\nx86_64-unknown-linux-musl')" ] + - name: Run test + run: | + set -exuo pipefail + [ "$(docker run --rm \ + --mount src="$PWD/detect-targets",dst=/usr/local/bin/detect-targets,type=bind \ + ${{ matrix.container }} detect-targets )" = "$(printf 'x86_64-unknown-linux-gnu\nx86_64-unknown-linux-musl')" ] detect-targets-nix-test: needs: detect-targets-build runs-on: ubuntu-latest steps: - - uses: actions/download-artifact@v4 - with: - name: detect-targets - - run: chmod +x detect-targets + - uses: actions/download-artifact@v4 + with: + name: detect-targets + - run: chmod +x detect-targets - - name: Run test - run: | - set -exuo pipefail - [ "$(docker run --rm \ - --mount src="$PWD/detect-targets",dst=/detect-targets,type=bind \ - nixos/nix /detect-targets )" = x86_64-unknown-linux-musl ] + - name: Run test + run: | + set -exuo pipefail + [ "$(docker run --rm \ + --mount src="$PWD/detect-targets",dst=/detect-targets,type=bind \ + nixos/nix /detect-targets )" = x86_64-unknown-linux-musl ] detect-targets-android-check: strategy: @@ -268,40 +275,39 @@ jobs: CARGO_BUILD_TARGET: ${{ matrix.target }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Add ${{ matrix.target }} - run: rustup target add ${{ matrix.target }} - - - uses: Swatinem/rust-cache@v2 - with: - cache-all-crates: true - - name: Build detect-targets - run: | - cargo check --target ${{ matrix.target }} - # Set working directory here, otherwise `cargo-check` would download - # and build quite a few unused dependencies. - working-directory: crates/detect-targets + - name: Add ${{ matrix.target }} + run: rustup target add ${{ matrix.target }} + - uses: Swatinem/rust-cache@v2 + with: + cache-all-crates: true + - name: Build detect-targets + run: | + cargo check --target ${{ matrix.target }} + # Set working directory here, otherwise `cargo-check` would download + # and build quite a few unused dependencies. + working-directory: crates/detect-targets # Dummy job to have a stable name for the "all tests pass" requirement tests-pass: name: Tests pass needs: - - test - - cross-check - - lint - - release-dry-run - - detect-targets-build - - detect-targets-alpine-test - - detect-targets-ubuntu-test - - detect-targets-more-glibc-test - - detect-targets-nix-test - - detect-targets-android-check + - test + - cross-check + - lint + - release-dry-run + - detect-targets-build + - detect-targets-alpine-test + - detect-targets-ubuntu-test + - detect-targets-more-glibc-test + - detect-targets-nix-test + - detect-targets-android-check if: always() # always run even if dependencies fail runs-on: ubuntu-latest steps: - # fail if ANY dependency has failed or cancelled - - if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')" - run: exit 1 - - run: exit 0 + # fail if ANY dependency has failed or cancelled + - if: "contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')" + run: exit 1 + - run: exit 0 diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index ed218a8f..5054d5ab 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -27,17 +27,28 @@ jobs: fail-fast: false matrix: include: - - { o: macos-14, t: x86_64-apple-darwin, r: true } - - { o: macos-14, t: x86_64h-apple-darwin, } - - { o: macos-14, t: aarch64-apple-darwin } - - { o: ubuntu-latest, t: x86_64-unknown-linux-gnu, g: 2.17, r: true, c: true } - - { o: ubuntu-latest, t: armv7-unknown-linux-gnueabihf, g: 2.17, c: true } - - { o: ubuntu-latest, t: aarch64-unknown-linux-gnu, g: 2.17, c: true } - - { o: ubuntu-latest, t: x86_64-unknown-linux-musl, r: true, c: true } - - { o: ubuntu-latest, t: armv7-unknown-linux-musleabihf, c: true } - - { o: ubuntu-latest, t: aarch64-unknown-linux-musl, c: true } - - { o: windows-latest, t: x86_64-pc-windows-msvc, r: true } - - { o: windows-latest, t: aarch64-pc-windows-msvc } + - { o: macos-14, t: x86_64-apple-darwin, r: true } + - { o: macos-14, t: x86_64h-apple-darwin } + - { o: macos-14, t: aarch64-apple-darwin } + - { + o: ubuntu-latest, + t: x86_64-unknown-linux-gnu, + g: 2.17, + r: true, + c: true, + } + - { + o: ubuntu-latest, + t: armv7-unknown-linux-gnueabihf, + g: 2.17, + c: true, + } + - { o: ubuntu-latest, t: aarch64-unknown-linux-gnu, g: 2.17, c: true } + - { o: ubuntu-latest, t: x86_64-unknown-linux-musl, r: true, c: true } + - { o: ubuntu-latest, t: armv7-unknown-linux-musleabihf, c: true } + - { o: ubuntu-latest, t: aarch64-unknown-linux-musl, c: true } + - { o: windows-latest, t: x86_64-pc-windows-msvc, r: true } + - { o: windows-latest, t: aarch64-pc-windows-msvc } name: ${{ matrix.t }} runs-on: ${{ matrix.o }} @@ -52,73 +63,77 @@ jobs: JUST_ENABLE_H3: true steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Override release profile lto settings - if: inputs.CARGO_PROFILE_RELEASE_LTO - run: echo "CARGO_PROFILE_RELEASE_LTO=${{ inputs.CARGO_PROFILE_RELEASE_LTO }}" >> "$GITHUB_ENV" + - name: Override release profile lto settings + if: inputs.CARGO_PROFILE_RELEASE_LTO + run: echo "CARGO_PROFILE_RELEASE_LTO=${{ inputs.CARGO_PROFILE_RELEASE_LTO }}" >> "$GITHUB_ENV" + shell: bash - - name: Override release profile codegen-units settings - if: inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS - run: echo "CARGO_PROFILE_RELEASE_CODEGEN_UNITS=${{ inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS }}" >> "$GITHUB_ENV" + - name: Override release profile codegen-units settings + if: inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS + run: echo "CARGO_PROFILE_RELEASE_CODEGEN_UNITS=${{ inputs.CARGO_PROFILE_RELEASE_CODEGEN_UNITS }}" >> "$GITHUB_ENV" + shell: bash - - uses: ./.github/actions/just-setup - with: - tools: cargo-auditable,rsign2,rage - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: ./.github/actions/just-setup + with: + tools: cargo-auditable,rsign2,rage + env: + # just-setup use binstall to install sccache, + # which works better when we provide it with GITHUB_TOKEN. + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN }} - - run: just toolchain rust-src + - run: just toolchain rust-src - - uses: actions/download-artifact@v4 - with: - name: minisign.pub - - run: just package - - if: runner.os == 'Windows' - run: Get-ChildItem packages/ - - if: runner.os != 'Windows' - run: ls -shal packages/ + - uses: actions/download-artifact@v4 + with: + name: minisign.pub + - run: just package + - if: runner.os == 'Windows' + run: Get-ChildItem packages/ + - if: runner.os != 'Windows' + run: ls -shal packages/ - - name: Ensure release binary is runnable - if: "matrix.r" - run: just e2e-tests - env: - GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN }} + - name: Ensure release binary is runnable + if: "matrix.r" + run: just e2e-tests + env: + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN }} - - uses: actions/download-artifact@v4 - with: - name: minisign.key.age - - name: Sign package - env: - AGE_KEY_SECRET: ${{ secrets.AGE_KEY_SECRET }} - shell: bash - run: .github/scripts/ephemeral-sign.sh packages/cargo-binstall-* + - uses: actions/download-artifact@v4 + with: + name: minisign.key.age + - name: Sign package + env: + AGE_KEY_SECRET: ${{ secrets.AGE_KEY_SECRET }} + shell: bash + run: .github/scripts/ephemeral-sign.sh packages/cargo-binstall-* - - if: fromJSON(inputs.publish).is-release == 'true' - name: Upload to release - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - release_name: v${{ fromJSON(inputs.publish).version }} - tag: v${{ fromJSON(inputs.publish).version }} - body: ${{ fromJSON(inputs.publish).notes }} - file: packages/cargo-binstall-* - file_glob: true - prerelease: true - - if: "fromJSON(inputs.publish).is-release != 'true' || runner.os == 'macOS'" - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.t }} - path: packages/cargo-binstall-* - retention-days: 1 + - if: fromJSON(inputs.publish).is-release == 'true' + name: Upload to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + release_name: v${{ fromJSON(inputs.publish).version }} + tag: v${{ fromJSON(inputs.publish).version }} + body: ${{ fromJSON(inputs.publish).notes }} + file: packages/cargo-binstall-* + file_glob: true + prerelease: true + - if: "fromJSON(inputs.publish).is-release != 'true' || runner.os == 'macOS'" + name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.t }} + path: packages/cargo-binstall-* + retention-days: 1 - - name: Upload timings - uses: actions/upload-artifact@v4 - with: - name: ${{ matrix.t }}-cargo-timings - path: target/cargo-timings - retention-days: 1 + - name: Upload timings + uses: actions/upload-artifact@v4 + with: + name: ${{ matrix.t }}-cargo-timings + path: target/cargo-timings + retention-days: 1 lipo: needs: build @@ -130,58 +145,58 @@ jobs: JUST_FOR_RELEASE: true steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - uses: taiki-e/install-action@v2 - with: - tool: just,rsign2,rage - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - uses: taiki-e/install-action@v2 + with: + tool: just,rsign2,rage + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/download-artifact@v4 - with: - name: x86_64h-apple-darwin - path: packages/ - - uses: actions/download-artifact@v4 - with: - name: x86_64-apple-darwin - path: packages/ - - uses: actions/download-artifact@v4 - with: - name: aarch64-apple-darwin - path: packages/ + - uses: actions/download-artifact@v4 + with: + name: x86_64h-apple-darwin + path: packages/ + - uses: actions/download-artifact@v4 + with: + name: x86_64-apple-darwin + path: packages/ + - uses: actions/download-artifact@v4 + with: + name: aarch64-apple-darwin + path: packages/ - - uses: actions/download-artifact@v4 - with: - name: minisign.pub - - run: ls -shalr packages/ - - run: just repackage-lipo - - run: ls -shal packages/ + - uses: actions/download-artifact@v4 + with: + name: minisign.pub + - run: ls -shalr packages/ + - run: just repackage-lipo + - run: ls -shal packages/ - - uses: actions/download-artifact@v4 - with: - name: minisign.key.age - - env: - AGE_KEY_SECRET: ${{ secrets.AGE_KEY_SECRET }} - shell: bash - run: .github/scripts/ephemeral-sign.sh packages/cargo-binstall-universal-* + - uses: actions/download-artifact@v4 + with: + name: minisign.key.age + - env: + AGE_KEY_SECRET: ${{ secrets.AGE_KEY_SECRET }} + shell: bash + run: .github/scripts/ephemeral-sign.sh packages/cargo-binstall-universal-* - - if: fromJSON(inputs.publish).is-release == 'true' - name: Upload to release - uses: svenstaro/upload-release-action@v2 - with: - repo_token: ${{ secrets.GITHUB_TOKEN }} - tag: v${{ fromJSON(inputs.publish).version }} - release_name: v${{ fromJSON(inputs.publish).version }} - body: ${{ fromJSON(inputs.publish).notes }} - file: packages/cargo-binstall-universal-* - file_glob: true - overwrite: true - prerelease: true - - if: fromJSON(inputs.publish).is-release != 'true' - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: universal-apple-darwin - path: packages/cargo-binstall-universal-* - retention-days: 1 + - if: fromJSON(inputs.publish).is-release == 'true' + name: Upload to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: v${{ fromJSON(inputs.publish).version }} + release_name: v${{ fromJSON(inputs.publish).version }} + body: ${{ fromJSON(inputs.publish).notes }} + file: packages/cargo-binstall-universal-* + file_glob: true + overwrite: true + prerelease: true + - if: fromJSON(inputs.publish).is-release != 'true' + name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: universal-apple-darwin + path: packages/cargo-binstall-universal-* + retention-days: 1 diff --git a/crates/binstalk-git-repo-api/src/gh_api_client.rs b/crates/binstalk-git-repo-api/src/gh_api_client.rs index d7238dd6..693bc3a2 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client.rs @@ -508,7 +508,7 @@ mod test { let mut gh_clients = vec![GhApiClient::new(client.clone(), None)]; - if let Ok(token) = env::var("GITHUB_TOKEN") { + if let Ok(token) = env::var("CI_UNIT_TEST_GITHUB_TOKEN") { gh_clients.push(GhApiClient::new(client, Some(token.into()))); } @@ -535,40 +535,36 @@ mod test { let mut tests: Vec<(_, _)> = Vec::new(); for client in create_client() { - for repo in PUBLIC_REPOS { + let spawn_get_repo_info_task = |repo| { let client = client.clone(); + tokio::spawn(async move { + loop { + match client.get_repo_info(&repo).await { + Err(GhApiError::RateLimit { retry_after }) => { + sleep(retry_after.unwrap_or(DEFAULT_RETRY_AFTER)).await + } + res => break res, + } + } + }) + }; + for repo in PUBLIC_REPOS { tests.push(( Some(RepoInfo::new(repo.clone(), false)), - tokio::spawn(async move { client.get_repo_info(&repo).await }), + spawn_get_repo_info_task(repo), )); } for repo in NON_EXISTENT_REPOS { - let client = client.clone(); - - tests.push(( - None, - tokio::spawn(async move { client.get_repo_info(&repo).await }), - )); + tests.push((None, spawn_get_repo_info_task(repo))); } if client.has_gh_token() { for repo in PRIVATE_REPOS { - let client = client.clone(); - tests.push(( Some(RepoInfo::new(repo.clone(), true)), - tokio::spawn(async move { - loop { - match client.get_repo_info(&repo).await { - Err(GhApiError::RateLimit { retry_after }) => { - sleep(retry_after.unwrap_or(DEFAULT_RETRY_AFTER)).await - } - res => break res, - } - } - }), + spawn_get_repo_info_task(repo), )); } } @@ -606,6 +602,20 @@ mod test { let mut tasks = Vec::new(); for client in create_client() { + async fn has_release_artifact( + client: &GhApiClient, + artifact: &GhReleaseArtifact, + ) -> Result, GhApiError> { + loop { + match client.has_release_artifact(artifact.clone()).await { + Err(GhApiError::RateLimit { retry_after }) => { + sleep(retry_after.unwrap_or(DEFAULT_RETRY_AFTER)).await + } + res => break res, + } + } + } + for (release, artifacts) in RELEASES { for artifact_name in artifacts { let client = client.clone(); @@ -632,15 +642,10 @@ mod test { .into_bytes(), ) }); - - let artifact_url = loop { - match client.has_release_artifact(artifact.clone()).await { - Err(GhApiError::RateLimit { retry_after }) => { - sleep(retry_after.unwrap_or(DEFAULT_RETRY_AFTER)).await - } - res => break res.unwrap().unwrap(), - } - }; + let artifact_url = has_release_artifact(&client, &artifact) + .await + .unwrap() + .unwrap(); if let Some(browser_download_task) = browser_download_task { let artifact_download_data = loop { @@ -666,13 +671,15 @@ mod test { let client = client.clone(); tasks.push(tokio::spawn(async move { assert_eq!( - client - .has_release_artifact(GhReleaseArtifact { + has_release_artifact( + &client, + &GhReleaseArtifact { release, artifact_name: "123z".to_compact_string(), - }) - .await - .unwrap(), + } + ) + .await + .unwrap(), None ); })); @@ -683,13 +690,15 @@ mod test { tasks.push(tokio::spawn(async move { assert_eq!( - client - .has_release_artifact(GhReleaseArtifact { + has_release_artifact( + &client, + &GhReleaseArtifact { release, artifact_name: "1234".to_compact_string(), - }) - .await - .unwrap(), + } + ) + .await + .unwrap(), None ); })); diff --git a/crates/binstalk-registry/src/lib.rs b/crates/binstalk-registry/src/lib.rs index 065bb619..59c40c7e 100644 --- a/crates/binstalk-registry/src/lib.rs +++ b/crates/binstalk-registry/src/lib.rs @@ -218,7 +218,7 @@ mod test { /// Mark this as an async fn so that you won't accidentally use it in /// sync context. - async fn create_client() -> Client { + fn create_client() -> Client { Client::new( concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), None, @@ -231,31 +231,40 @@ mod test { #[tokio::test] async fn test_crates_io_sparse_registry() { - let client = create_client().await; - - let sparse_registry: Registry = Registry::crates_io_sparse_registry(); - assert!( - matches!(sparse_registry, Registry::Sparse(_)), - "{:?}", - sparse_registry - ); + let client = create_client(); let crate_name = "cargo-binstall"; let version_req = &VersionReq::parse("=1.0.0").unwrap(); - let manifest_from_sparse = sparse_registry - .fetch_crate_matched(client.clone(), crate_name, version_req) - .await - .unwrap(); + + let serialized_manifest_from_sparse_task = tokio::spawn({ + let client = client.clone(); + let version_req = version_req.clone(); + + async move { + let sparse_registry: Registry = Registry::crates_io_sparse_registry(); + assert!( + matches!(sparse_registry, Registry::Sparse(_)), + "{:?}", + sparse_registry + ); + + let manifest_from_sparse = sparse_registry + .fetch_crate_matched(client, crate_name, &version_req) + .await + .unwrap(); + + to_string(&manifest_from_sparse).unwrap() + } + }); let manifest_from_cratesio_api = fetch_crate_cratesio_api(client, crate_name, version_req) .await .unwrap(); - let serialized_manifest_from_sparse = to_string(&manifest_from_sparse).unwrap(); let serialized_manifest_from_cratesio_api = to_string(&manifest_from_cratesio_api).unwrap(); assert_eq!( - serialized_manifest_from_sparse, + serialized_manifest_from_sparse_task.await.unwrap(), serialized_manifest_from_cratesio_api ); } @@ -263,34 +272,42 @@ mod test { #[cfg(feature = "git")] #[tokio::test] async fn test_crates_io_git_registry() { - let client = create_client().await; - - let git_registry: Registry = "https://github.com/rust-lang/crates.io-index" - .parse() - .unwrap(); - assert!( - matches!(git_registry, Registry::Git(_)), - "{:?}", - git_registry - ); + let client = create_client(); let crate_name = "cargo-binstall"; let version_req = &VersionReq::parse("=1.0.0").unwrap(); - let manifest_from_git = git_registry - .fetch_crate_matched(client.clone(), crate_name, version_req) - .await - .unwrap(); + + let serialized_manifest_from_git_task = tokio::spawn({ + let version_req = version_req.clone(); + let client = client.clone(); + + async move { + let git_registry: Registry = "https://github.com/rust-lang/crates.io-index" + .parse() + .unwrap(); + assert!( + matches!(git_registry, Registry::Git(_)), + "{:?}", + git_registry + ); + + let manifest_from_git = git_registry + .fetch_crate_matched(client, crate_name, &version_req) + .await + .unwrap(); + to_string(&manifest_from_git).unwrap() + } + }); let manifest_from_cratesio_api = Registry::default() .fetch_crate_matched(client, crate_name, version_req) .await .unwrap(); - let serialized_manifest_from_git = to_string(&manifest_from_git).unwrap(); let serialized_manifest_from_cratesio_api = to_string(&manifest_from_cratesio_api).unwrap(); assert_eq!( - serialized_manifest_from_git, + serialized_manifest_from_git_task.await.unwrap(), serialized_manifest_from_cratesio_api ); } diff --git a/justfile b/justfile index d80759d0..c813172c 100644 --- a/justfile +++ b/justfile @@ -260,7 +260,8 @@ e2e-test-tls: (e2e-test "tls" "1.2") (e2e-test "tls" "1.3") e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-git e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate e2e-test-no-track e2e-test-registries e2e-test-signing e2e-test-continue-on-failure e2e-test-private-github-repo unit-tests: print-env - {{cargo-bin}} test {{cargo-build-args}} + cargo nextest run {{cargo-build-args}} + cargo test --doc {{cargo-build-args}} test: unit-tests build e2e-tests From 238e0f6318a7e290ad34459f1fd191088b70f55b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 11 Jun 2024 22:37:48 +1000 Subject: [PATCH 1734/2020] Fix rate limit checking in `GhApiClient` (#1725) * Fix rate limit checking in `GhApiClient` - Mv logic into `binstalk_downloader` - Check for `RETRY_AFTER` and `x-ratelimit-remaining` on any status code Signed-off-by: Jiahao XU * Fix clippy lint Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/remote.rs | 47 +++++++++++++------ .../src/gh_api_client.rs | 7 ++- .../src/gh_api_client/common.rs | 29 ++---------- 3 files changed, 40 insertions(+), 43 deletions(-) diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 65a43d53..7bd2c684 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -9,7 +9,7 @@ use bytes::Bytes; use futures_util::Stream; use httpdate::parse_http_date; use reqwest::{ - header::{HeaderMap, RETRY_AFTER}, + header::{HeaderMap, HeaderValue, RETRY_AFTER}, Request, }; use thiserror::Error as ThisError; @@ -172,6 +172,8 @@ impl Client { url: &Url, ) -> Result>, ReqwestError> { + static HEADER_VALUE_0: HeaderValue = HeaderValue::from_static("0"); + let response = match self.0.service.call(request).await { Err(err) if err.is_timeout() || err.is_connect() => { let duration = RETRY_DURATION_FOR_TIMEOUT; @@ -197,22 +199,37 @@ impl Client { Ok(ControlFlow::Continue(Ok(response))) }; - match status { - // Delay further request on rate limit - StatusCode::SERVICE_UNAVAILABLE | StatusCode::TOO_MANY_REQUESTS => { - let duration = parse_header_retry_after(response.headers()) - .unwrap_or(DEFAULT_RETRY_DURATION_FOR_RATE_LIMIT) - .min(MAX_RETRY_DURATION); + let headers = response.headers(); - add_delay_and_continue(response, duration) + // Some server (looking at you, github GraphQL API) may returns a rate limit + // even when OK is returned or on other status code (e.g. 453 forbidden). + if let Some(duration) = parse_header_retry_after(headers) { + add_delay_and_continue(response, duration.min(MAX_RETRY_DURATION)) + } else if headers.get("x-ratelimit-remaining") == Some(&HEADER_VALUE_0) { + let duration = headers + .get("x-ratelimit-reset") + .and_then(|value| { + let secs = value.to_str().ok()?.parse().ok()?; + Some(Duration::from_secs(secs)) + }) + .unwrap_or(DEFAULT_RETRY_DURATION_FOR_RATE_LIMIT) + .min(MAX_RETRY_DURATION); + + add_delay_and_continue(response, duration) + } else { + match status { + // Delay further request on rate limit + StatusCode::SERVICE_UNAVAILABLE | StatusCode::TOO_MANY_REQUESTS => { + add_delay_and_continue(response, DEFAULT_RETRY_DURATION_FOR_RATE_LIMIT) + } + + // Delay further request on timeout + StatusCode::REQUEST_TIMEOUT | StatusCode::GATEWAY_TIMEOUT => { + add_delay_and_continue(response, RETRY_DURATION_FOR_TIMEOUT) + } + + _ => Ok(ControlFlow::Break(response)), } - - // Delay further request on timeout - StatusCode::REQUEST_TIMEOUT | StatusCode::GATEWAY_TIMEOUT => { - add_delay_and_continue(response, RETRY_DURATION_FOR_TIMEOUT) - } - - _ => Ok(ControlFlow::Break(response)), } } diff --git a/crates/binstalk-git-repo-api/src/gh_api_client.rs b/crates/binstalk-git-repo-api/src/gh_api_client.rs index 693bc3a2..ac7f1565 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client.rs @@ -299,14 +299,13 @@ impl GhApiClient { .send(false) .await?; - match check_http_status_and_header(&response) { + match check_http_status_and_header(response) { Err(GhApiError::Unauthorized) => { self.0.is_auth_token_valid.store(false, Relaxed); + Err(GhApiError::Unauthorized) } - res => res?, + res => res.map(Download::from_response), } - - Ok(Download::from_response(response)) } } diff --git a/crates/binstalk-git-repo-api/src/gh_api_client/common.rs b/crates/binstalk-git-repo-api/src/gh_api_client/common.rs index b09823e9..86b50a6d 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client/common.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client/common.rs @@ -1,4 +1,4 @@ -use std::{fmt::Debug, future::Future, sync::OnceLock, time::Duration}; +use std::{fmt::Debug, future::Future, sync::OnceLock}; use binstalk_downloader::remote::{self, Response, Url}; use compact_str::CompactString; @@ -18,28 +18,12 @@ pub(super) fn percent_decode_http_url_path(input: &str) -> CompactString { } } -pub(super) fn check_http_status_and_header(response: &Response) -> Result<(), GhApiError> { - let headers = response.headers(); - +pub(super) fn check_http_status_and_header(response: Response) -> Result { match response.status() { - remote::StatusCode::FORBIDDEN - if headers - .get("x-ratelimit-remaining") - .map(|val| val == "0") - .unwrap_or(false) => - { - Err(GhApiError::RateLimit { - retry_after: headers.get("x-ratelimit-reset").and_then(|value| { - let secs = value.to_str().ok()?.parse().ok()?; - Some(Duration::from_secs(secs)) - }), - }) - } - remote::StatusCode::UNAUTHORIZED => Err(GhApiError::Unauthorized), remote::StatusCode::NOT_FOUND => Err(GhApiError::NotFound), - _ => Ok(()), + _ => Ok(response.error_for_status()?), } } @@ -73,9 +57,7 @@ where .send(false); async move { - let response = future.await?; - - check_http_status_and_header(&response)?; + let response = check_http_status_and_header(future.await?)?; Ok(response.json().await?) } @@ -127,8 +109,7 @@ where }); async move { - let response = res?.await?; - check_http_status_and_header(&response)?; + let response = check_http_status_and_header(res?.await?)?; let mut response: GraphQLResponse = response.json().await?; From 9a0367b3ec097014da7c5a5a0ca05d126380fdd4 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 11 Jun 2024 23:31:35 +1000 Subject: [PATCH 1735/2020] release: binstalk-downloader v0.11.1 (#1726) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-git-repo-api/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 354d7e66..6338e444 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -292,7 +292,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.11.0" +version = "0.11.1" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index eb0fbfc0..0275901d 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.11.0" +version = "0.11.1" rust-version = "1.70.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index aea86a93..59c455ca 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.11.0", path = "../binstalk-downloader", default-features = false } +binstalk-downloader = { version = "0.11.1", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.0.0", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.11.0", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.11.1", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 5befe5b4..49dd38e7 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.11.0", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.11.1", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.7.0" @@ -24,5 +24,5 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.11.0", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.11.1", path = "../binstalk-downloader" } tracing-subscriber = "0.3" diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 47094fb1..b99b2d44 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.11.0", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.11.1", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } @@ -40,7 +40,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.11.0", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.11.1", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index aa51cffa..04525ed1 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.11.0", path = "../binstalk-downloader", default-features = false } +binstalk-downloader = { version = "0.11.1", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.0.0", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.4.1", path = "../binstalk-fetchers", features = [ "quickinstall", From 2feac66e1412f514de5c9fe5180e77a23122657a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 12 Jun 2024 12:29:16 +1000 Subject: [PATCH 1736/2020] Speedup ci: Only run tests on change (#1729) * Fix unit test for `GhApiClient` Set client-side rate limit to 1 request per 200 ms Signed-off-by: Jiahao XU * Only run `detect-targets` test if changed Signed-off-by: Jiahao XU * Only run unit tests for crates that are changed Signed-off-by: Jiahao XU * Fix job `changed-files` Signed-off-by: Jiahao XU * Fix job `changed-files` Signed-off-by: Jiahao XU * Fix shell error in job `changed-files` Signed-off-by: Jiahao XU * FIx separator for `changed-files` Signed-off-by: Jiahao XU * Fix passning of craetes to run Signed-off-by: Jiahao XU * Fix passing of `CARGO_NEXTEST_ADDITIONAL_ARGS` Signed-off-by: Jiahao XU * Fix deciding which crates to test on windows Signed-off-by: Jiahao XU * Fix just recipe `unit-tests` Signed-off-by: Jiahao XU * Split test into two jobs so that they will have they own cache (since different feature flags are used). Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 108 ++++++++++++++++-- .../src/gh_api_client.rs | 2 +- justfile | 5 +- 3 files changed, 105 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 416c5120..1d01065d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,43 @@ env: CARGO_PROFILE_CHECK_ONLY_CODEGEN_UNITS: 4 jobs: - test: + changed-files: + runs-on: ubuntu-latest + name: Test changed-files + permissions: + pull-requests: read + + outputs: + crates_changed: ${{ steps.list-changed-files.outputs.crates_changed }} + has_detect_target_changed: ${{ steps.list-changed-files.outputs.has_detect_target_changed }} + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v44 + with: + dir_names: true + dir_names_exclude_current_dir: true + dir_names_max_depth: 2 + separator: "\n" + + - name: List all changed files + id: list-changed-files + env: + ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} + run: | + set -euxo pipefail + crates_changed="$(echo "$ALL_CHANGED_FILES" | grep crates | cut -d / -f 2)" + has_detect_target_changed="$(echo "$crates_changed" | grep -q detect-targets && echo true || echo false)" + echo "crates_changed=$crates_changed" | tee -a "$GITHUB_OUTPUT" + echo "has_detect_target_changed=$has_detect_target_changed" | tee -a "$GITHUB_OUTPUT" + + unit-tests: + needs: changed-files strategy: fail-fast: false matrix: @@ -60,11 +96,52 @@ jobs: with: tools: cargo-nextest - - run: just test + - name: Decide crates to test + shell: bash + env: + CRATES_CHANGED: ${{ needs.changed-files.outputs.crates_changed }} + run: | + ARGS="" + for crate in $CRATES_CHANGED; do + ARGS="$ARGS -p $crate" + done + echo "CARGO_NEXTEST_ADDITIONAL_ARGS=$ARGS" | tee -a "$GITHUB_ENV" + + - run: just unit-tests env: GITHUB_TOKEN: ${{ secrets.CI_TEST_GITHUB_TOKEN }} CI_UNIT_TEST_GITHUB_TOKEN: ${{ secrets.CI_UNIT_TEST_GITHUB_TOKEN }} + e2e-tests: + strategy: + fail-fast: false + matrix: + include: + - target: x86_64-apple-darwin + os: macos-14 + - target: x86_64-unknown-linux-gnu + os: ubuntu-latest + - target: x86_64-pc-windows-msvc + os: windows-latest + + runs-on: ${{ matrix.os }} + env: + CARGO_BUILD_TARGET: ${{ matrix.target }} + + steps: + - uses: actions/checkout@v4 + - uses: ./.github/actions/just-setup + env: + # just-setup use binstall to install sccache, + # which works better when we provide it with GITHUB_TOKEN. + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN }} + + - run: | + just build + just e2e-tests + env: + GITHUB_TOKEN: ${{ secrets.CI_TEST_GITHUB_TOKEN }} + cross-check: strategy: fail-fast: false @@ -161,6 +238,8 @@ jobs: CARGO_PROFILE_RELEASE_CODEGEN_UNITS: 4 detect-targets-build: + needs: changed-files + if: needs.changed-files.outputs.has_detect_target_changed == 'true' runs-on: ubuntu-latest env: CARGO_BUILD_TARGET: x86_64-unknown-linux-musl @@ -186,7 +265,10 @@ jobs: detect-targets-alpine-test: runs-on: ubuntu-latest - needs: detect-targets-build + needs: + - detect-targets-build + - changed-files + if: needs.changed-files.outputs.has_detect_target_changed == 'true' steps: - uses: actions/checkout@v4 @@ -203,7 +285,10 @@ jobs: alpine /bin/ash -c "apk update && apk add bash && test.sh x86_64-unknown-linux-musl" detect-targets-ubuntu-test: - needs: detect-targets-build + needs: + - detect-targets-build + - changed-files + if: needs.changed-files.outputs.has_detect_target_changed == 'true' strategy: fail-fast: false matrix: @@ -223,7 +308,10 @@ jobs: [ "$(./detect-targets)" = "$(printf 'x86_64-unknown-linux-gnu\nx86_64-unknown-linux-musl')" ] detect-targets-more-glibc-test: - needs: detect-targets-build + needs: + - detect-targets-build + - changed-files + if: needs.changed-files.outputs.has_detect_target_changed == 'true' strategy: fail-fast: false matrix: @@ -248,7 +336,10 @@ jobs: ${{ matrix.container }} detect-targets )" = "$(printf 'x86_64-unknown-linux-gnu\nx86_64-unknown-linux-musl')" ] detect-targets-nix-test: - needs: detect-targets-build + needs: + - detect-targets-build + - changed-files + if: needs.changed-files.outputs.has_detect_target_changed == 'true' runs-on: ubuntu-latest steps: - uses: actions/download-artifact@v4 @@ -264,6 +355,8 @@ jobs: nixos/nix /detect-targets )" = x86_64-unknown-linux-musl ] detect-targets-android-check: + needs: changed-files + if: needs.changed-files.outputs.has_detect_target_changed == 'true' strategy: fail-fast: false matrix: @@ -294,7 +387,8 @@ jobs: tests-pass: name: Tests pass needs: - - test + - unit-tests + - e2e-tests - cross-check - lint - release-dry-run diff --git a/crates/binstalk-git-repo-api/src/gh_api_client.rs b/crates/binstalk-git-repo-api/src/gh_api_client.rs index ac7f1565..bc480f67 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client.rs @@ -493,7 +493,7 @@ mod test { remote::Client::new( concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), None, - NonZeroU16::new(10).unwrap(), + NonZeroU16::new(200).unwrap(), 1.try_into().unwrap(), [], ) diff --git a/justfile b/justfile index c813172c..01270a4f 100644 --- a/justfile +++ b/justfile @@ -12,6 +12,7 @@ use-auditable := env_var_or_default("JUST_USE_AUDITABLE", "") timings := env_var_or_default("JUST_TIMINGS", "") build-std := env_var_or_default("JUST_BUILD_STD", "") enable-h3 := env_var_or_default("JUST_ENABLE_H3", "") +cargo-nextest-additional-args := env_var_or_default("CARGO_NEXTEST_ADDITIONAL_ARGS", "") export BINSTALL_LOG_LEVEL := if env_var_or_default("RUNNER_DEBUG", "0") == "1" { "debug" } else { "info" } export BINSTALL_RATE_LIMIT := "30/1" @@ -260,8 +261,8 @@ e2e-test-tls: (e2e-test "tls" "1.2") (e2e-test "tls" "1.3") e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-git e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate e2e-test-no-track e2e-test-registries e2e-test-signing e2e-test-continue-on-failure e2e-test-private-github-repo unit-tests: print-env - cargo nextest run {{cargo-build-args}} - cargo test --doc {{cargo-build-args}} + cargo nextest run --target {{target}} {{cargo-nextest-additional-args}} + cargo test --doc --target {{target}} test: unit-tests build e2e-tests From 4d7a91aa4c3e8ea624d428dc0898681363fbaf40 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 12 Jun 2024 19:47:41 +1000 Subject: [PATCH 1737/2020] Fix job changed-files in ci.yml (#1730) * Fix job changed-files in ci.yml When there are multiple crates, it would be in multiple lines, breaking github output * Fix job changed-files in ci.yml When no crate is changed, command cut will fail. * Fix job unit-tests in ci.yml If noo crate is changed, do not run cargo-nextest. * Fix ci.yml syntax --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d01065d..84078570 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,9 +64,9 @@ jobs: ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: | set -euxo pipefail - crates_changed="$(echo "$ALL_CHANGED_FILES" | grep crates | cut -d / -f 2)" + crates_changed="$(echo "$ALL_CHANGED_FILES" | grep crates | cut -d / -f 2 || echo)" has_detect_target_changed="$(echo "$crates_changed" | grep -q detect-targets && echo true || echo false)" - echo "crates_changed=$crates_changed" | tee -a "$GITHUB_OUTPUT" + echo "crates_changed=${crates_changed//$'\n'/ }" | tee -a "$GITHUB_OUTPUT" echo "has_detect_target_changed=$has_detect_target_changed" | tee -a "$GITHUB_OUTPUT" unit-tests: @@ -108,6 +108,7 @@ jobs: echo "CARGO_NEXTEST_ADDITIONAL_ARGS=$ARGS" | tee -a "$GITHUB_ENV" - run: just unit-tests + if: env.CARGO_NEXTEST_ADDITIONAL_ARGS != '' env: GITHUB_TOKEN: ${{ secrets.CI_TEST_GITHUB_TOKEN }} CI_UNIT_TEST_GITHUB_TOKEN: ${{ secrets.CI_UNIT_TEST_GITHUB_TOKEN }} From 6622bf1ae34f2f90c6064446c8f6082732f4023e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 12 Jun 2024 20:34:50 +1000 Subject: [PATCH 1738/2020] Speedup binstalk-git-repo-api unit testing (#1731) * Share `remote::Client` between tests when in cargo-test Signed-off-by: Jiahao XU * Run rate-limited binstalk-git-repo-api test in serial Signed-off-by: Jiahao XU * Update client-side rate limit to 1 request per 300ms Signed-off-by: Jiahao XU * Reduce test cases in `rate_limited_test_has_release_artifact_and_download_artifacts` Signed-off-by: Jiahao XU * Add `cargo-nextest` that I forgot Signed-off-by: Jiahao XU * Fix unit testing: Pass auth-token to restful API to avoid rate limit Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .config/nextest.toml | 6 ++ Cargo.lock | 1 + crates/binstalk-git-repo-api/Cargo.toml | 1 + .../src/gh_api_client.rs | 80 ++++++++++++------- .../src/gh_api_client/common.rs | 12 ++- .../src/gh_api_client/release_artifacts.rs | 7 +- .../src/gh_api_client/repo_info.rs | 3 +- 7 files changed, 75 insertions(+), 35 deletions(-) create mode 100644 .config/nextest.toml diff --git a/.config/nextest.toml b/.config/nextest.toml new file mode 100644 index 00000000..a5c8a4cf --- /dev/null +++ b/.config/nextest.toml @@ -0,0 +1,6 @@ +[test-groups] +rate-limited = { max-threads = 1 } + +[[profile.default.overrides]] +filter = 'test(rate_limited::)' +test-group = 'rate-limited' diff --git a/Cargo.lock b/Cargo.lock index 6338e444..3509b24e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -354,6 +354,7 @@ version = "0.0.0" dependencies = [ "binstalk-downloader", "compact_str", + "once_cell", "percent-encoding", "serde", "serde-tuple-vec-map", diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 49dd38e7..cc088b81 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -26,3 +26,4 @@ url = "2.3.1" [dev-dependencies] binstalk-downloader = { version = "0.11.1", path = "../binstalk-downloader" } tracing-subscriber = "0.3" +once_cell = "1" diff --git a/crates/binstalk-git-repo-api/src/gh_api_client.rs b/crates/binstalk-git-repo-api/src/gh_api_client.rs index bc480f67..46b22852 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client.rs @@ -131,6 +131,8 @@ struct Inner { auth_token: Option, is_auth_token_valid: AtomicBool, + + only_use_restful_api: AtomicBool, } /// Github API client for querying whether a release artifact exitsts. @@ -147,9 +149,16 @@ impl GhApiClient { auth_token, is_auth_token_valid: AtomicBool::new(true), + + only_use_restful_api: AtomicBool::new(false), })) } + /// If you don't want to use GitHub GraphQL API for whatever reason, call this. + pub fn set_only_use_restful_api(&self) { + self.0.only_use_restful_api.store(true, Relaxed); + } + pub fn remote_client(&self) -> &remote::Client { &self.0.client } @@ -193,22 +202,24 @@ impl GhApiClient { ) -> Result where GraphQLFn: Fn(&remote::Client, &T, &str) -> GraphQLFut, - RestfulFn: Fn(&remote::Client, &T) -> RestfulFut, + RestfulFn: Fn(&remote::Client, &T, Option<&str>) -> RestfulFut, GraphQLFut: Future> + Send + Sync + 'static, RestfulFut: Future> + Send + Sync + 'static, { self.check_retry_after()?; - if let Some(auth_token) = self.get_auth_token() { - match graphql_func(&self.0.client, data, auth_token).await { - Err(GhApiError::Unauthorized) => { - self.0.is_auth_token_valid.store(false, Relaxed); + if !self.0.only_use_restful_api.load(Relaxed) { + if let Some(auth_token) = self.get_auth_token() { + match graphql_func(&self.0.client, data, auth_token).await { + Err(GhApiError::Unauthorized) => { + self.0.is_auth_token_valid.store(false, Relaxed); + } + res => return res.map_err(|err| err.context("GraphQL API")), } - res => return res.map_err(|err| err.context("GraphQL API")), } } - restful_func(&self.0.client, data) + restful_func(&self.0.client, data, self.get_auth_token()) .await .map_err(|err| err.context("Restful API")) } @@ -313,6 +324,7 @@ impl GhApiClient { mod test { use super::*; use compact_str::{CompactString, ToCompactString}; + use once_cell::sync::OnceCell; use std::{env, num::NonZeroU16, time::Duration}; use tokio::time::sleep; use tracing::subscriber::set_global_default; @@ -368,6 +380,7 @@ mod test { tag: CompactString::new_inline("cargo-audit/v0.17.6"), }; + #[allow(unused)] pub(super) const ARTIFACTS: &[&str] = &[ "cargo-audit-aarch64-unknown-linux-gnu-v0.17.6.tgz", "cargo-audit-armv7-unknown-linux-gnueabihf-v0.17.6.tgz", @@ -490,14 +503,20 @@ mod test { } fn create_remote_client() -> remote::Client { - remote::Client::new( - concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), - None, - NonZeroU16::new(200).unwrap(), - 1.try_into().unwrap(), - [], - ) - .unwrap() + static CLIENT: OnceCell = OnceCell::new(); + + CLIENT + .get_or_init(|| { + remote::Client::new( + concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), + None, + NonZeroU16::new(300).unwrap(), + 1.try_into().unwrap(), + [], + ) + .unwrap() + }) + .clone() } /// Mark this as an async fn so that you won't accidentally use it in @@ -505,17 +524,24 @@ mod test { fn create_client() -> Vec { let client = create_remote_client(); - let mut gh_clients = vec![GhApiClient::new(client.clone(), None)]; + let auth_token = env::var("CI_UNIT_TEST_GITHUB_TOKEN") + .ok() + .map(CompactString::from); - if let Ok(token) = env::var("CI_UNIT_TEST_GITHUB_TOKEN") { - gh_clients.push(GhApiClient::new(client, Some(token.into()))); + let gh_client = GhApiClient::new(client.clone(), auth_token.clone()); + gh_client.set_only_use_restful_api(); + + let mut gh_clients = vec![gh_client]; + + if auth_token.is_some() { + gh_clients.push(GhApiClient::new(client, auth_token)); } gh_clients } #[tokio::test] - async fn test_get_repo_info() { + async fn rate_limited_test_get_repo_info() { const PUBLIC_REPOS: [GhRepo; 1] = [GhRepo { owner: CompactString::new_inline("cargo-bins"), repo: CompactString::new_inline("cargo-binstall"), @@ -575,17 +601,11 @@ mod test { } #[tokio::test] - async fn test_has_release_artifact_and_download_artifacts() { - const RELEASES: [(GhRelease, &[&str]); 2] = [ - ( - cargo_binstall_v0_20_1::RELEASE, - cargo_binstall_v0_20_1::ARTIFACTS, - ), - ( - cargo_audit_v_0_17_6::RELEASE, - cargo_audit_v_0_17_6::ARTIFACTS, - ), - ]; + async fn rate_limited_test_has_release_artifact_and_download_artifacts() { + const RELEASES: [(GhRelease, &[&str]); 1] = [( + cargo_binstall_v0_20_1::RELEASE, + cargo_binstall_v0_20_1::ARTIFACTS, + )]; const NON_EXISTENT_RELEASES: [GhRelease; 1] = [GhRelease { repo: GhRepo { owner: CompactString::new_inline("cargo-bins"), diff --git a/crates/binstalk-git-repo-api/src/gh_api_client/common.rs b/crates/binstalk-git-repo-api/src/gh_api_client/common.rs index 86b50a6d..35048e58 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client/common.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client/common.rs @@ -38,6 +38,7 @@ fn get_api_endpoint() -> &'static Url { pub(super) fn issue_restful_api( client: &remote::Client, path: &[&str], + auth_token: Option<&str>, ) -> impl Future> + Send + Sync + 'static where T: DeserializeOwned, @@ -50,11 +51,16 @@ where debug!("Getting restful API: {url}"); - let future = client + let mut request_builder = client .get(url) .header("Accept", "application/vnd.github+json") - .header("X-GitHub-Api-Version", "2022-11-28") - .send(false); + .header("X-GitHub-Api-Version", "2022-11-28"); + + if let Some(auth_token) = auth_token { + request_builder = request_builder.bearer_auth(&auth_token); + } + + let future = request_builder.send(false); async move { let response = check_http_status_and_header(future.await?)?; diff --git a/crates/binstalk-git-repo-api/src/gh_api_client/release_artifacts.rs b/crates/binstalk-git-repo-api/src/gh_api_client/release_artifacts.rs index 312d8a73..d11e2401 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client/release_artifacts.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client/release_artifacts.rs @@ -73,8 +73,13 @@ pub(super) fn fetch_release_artifacts_restful_api( repo: GhRepo { owner, repo }, tag, }: &GhRelease, + auth_token: Option<&str>, ) -> impl Future> + Send + Sync + 'static { - issue_restful_api(client, &["repos", owner, repo, "releases", "tags", tag]) + issue_restful_api( + client, + &["repos", owner, repo, "releases", "tags", tag], + auth_token, + ) } #[derive(Debug, Deserialize)] diff --git a/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs b/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs index ddc6d152..33b33682 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs @@ -44,8 +44,9 @@ impl RepoInfo { pub(super) fn fetch_repo_info_restful_api( client: &remote::Client, GhRepo { owner, repo }: &GhRepo, + auth_token: Option<&str>, ) -> impl Future, GhApiError>> + Send + Sync + 'static { - issue_restful_api(client, &["repos", owner, repo]) + issue_restful_api(client, &["repos", owner, repo], auth_token) } #[derive(Debug, Deserialize)] From 7941387b732eb3ec0818687267ae4c8723be85d2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 12 Jun 2024 20:56:59 +1000 Subject: [PATCH 1739/2020] Fix job `changed-files` (#1732) * Fix job `changed-files` Convert `ALL_CHANGED_FILES` to multiple lines before processing Signed-off-by: Jiahao XU * Run e2e-tests and unit-tests on aarch64-apple-darwin Since the CI now uses M1 instead of x86_64, built a native executable instead of relying on rosetta Signed-off-by: Jiahao XU * Run unit-tests on Linux-only Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 22 +++++----------------- .github/workflows/release-packages.yml | 4 ++-- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84078570..1f122f23 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -56,7 +56,6 @@ jobs: dir_names: true dir_names_exclude_current_dir: true dir_names_max_depth: 2 - separator: "\n" - name: List all changed files id: list-changed-files @@ -64,27 +63,16 @@ jobs: ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: | set -euxo pipefail - crates_changed="$(echo "$ALL_CHANGED_FILES" | grep crates | cut -d / -f 2 || echo)" + crates_changed="$(for file in $ALL_CHANGED_FILES; do echo $file; done | grep crates | cut -d / -f 2 || echo)" has_detect_target_changed="$(echo "$crates_changed" | grep -q detect-targets && echo true || echo false)" echo "crates_changed=${crates_changed//$'\n'/ }" | tee -a "$GITHUB_OUTPUT" echo "has_detect_target_changed=$has_detect_target_changed" | tee -a "$GITHUB_OUTPUT" unit-tests: needs: changed-files - strategy: - fail-fast: false - matrix: - include: - - target: x86_64-apple-darwin - os: macos-14 - - target: x86_64-unknown-linux-gnu - os: ubuntu-latest - - target: x86_64-pc-windows-msvc - os: windows-latest - - runs-on: ${{ matrix.os }} + runs-on: ubuntu-latest env: - CARGO_BUILD_TARGET: ${{ matrix.target }} + CARGO_BUILD_TARGET: x86_64-unknown-linux-gnu steps: - uses: actions/checkout@v4 @@ -118,7 +106,7 @@ jobs: fail-fast: false matrix: include: - - target: x86_64-apple-darwin + - target: aarch64-apple-darwin os: macos-14 - target: x86_64-unknown-linux-gnu os: ubuntu-latest @@ -158,7 +146,7 @@ jobs: os: ubuntu-latest - target: x86_64-unknown-linux-musl os: ubuntu-latest - - target: aarch64-apple-darwin + - target: x86_64-apple-darwin os: macos-14 - target: aarch64-pc-windows-msvc os: windows-latest diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index 5054d5ab..07b5014e 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -27,9 +27,9 @@ jobs: fail-fast: false matrix: include: - - { o: macos-14, t: x86_64-apple-darwin, r: true } + - { o: macos-14, t: x86_64-apple-darwin } - { o: macos-14, t: x86_64h-apple-darwin } - - { o: macos-14, t: aarch64-apple-darwin } + - { o: macos-14, t: aarch64-apple-darwin, r: true } - { o: ubuntu-latest, t: x86_64-unknown-linux-gnu, From 8fe7b9263198424ef0ca6229907b9b7c66ba96ac Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 12 Jun 2024 11:31:53 +0000 Subject: [PATCH 1740/2020] release: binstalk-git-repo-api v0.1.0 (#1728) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-git-repo-api/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3509b24e..d4c0ef6e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -350,7 +350,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.0.0" +version = "0.1.0" dependencies = [ "binstalk-downloader", "compact_str", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 59c455ca..a502afc9 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" binstalk-downloader = { version = "0.11.1", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.0.0", path = "../binstalk-git-repo-api" } +binstalk-git-repo-api = { version = "0.1.0", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index cc088b81..cd0cb894 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.0.0" +version = "0.1.0" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 04525ed1..e3b8ac13 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.11.1", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.0.0", path = "../binstalk-git-repo-api" } +binstalk-git-repo-api = { version = "0.1.0", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.4.1", path = "../binstalk-fetchers", features = [ "quickinstall", ] } From 49d0bb71a0c626ab3924f2e15720a6c3007659de Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 12 Jun 2024 13:02:02 +0000 Subject: [PATCH 1741/2020] dep: Upgrade transitive dependencies (#1734) Co-authored-by: github-actions --- Cargo.lock | 377 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 294 insertions(+), 83 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d4c0ef6e..6a76c2cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -196,9 +196,9 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.72" +version = "0.3.73" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17c6a35df3749d2e8bb1b7b21a976d82b15548788d2735b9d82f329268f71a11" +checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" dependencies = [ "addr2line", "cc", @@ -650,9 +650,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.6" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9689a29b593160de5bc4aacab7b5d54fb52231de70122626c178e6a368994c7" +checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" dependencies = [ "clap_builder", "clap_derive", @@ -660,9 +660,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.6" +version = "4.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e5387378c84f6faa26890ebf9f0a92989f8873d4d380467bcd0d8d8620424df" +checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" dependencies = [ "anstream", "anstyle", @@ -934,6 +934,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "displaydoc" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "dlopen2" version = "0.5.0" @@ -1118,9 +1129,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73969b81e8bc90a3828d913dd3973d80771bfb9d7fbe1a78a79122aad456af15" +checksum = "f7e180ac76c23b45e767bd7ae9579bc0bb458618c4bc71835926e098e61d15f8" dependencies = [ "rustix", "windows-sys 0.52.0", @@ -2246,12 +2257,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0475f8b2ac86659c21b64320d5d653f9efe42acd2a4e560073ec61a155a34f1d" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", - "futures-core", + "futures-util", "http 1.1.0", "http-body", "pin-project-lite", @@ -2259,9 +2270,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "d0e7a4dd27b9476dc40cb050d3632d3bba3a70ddbff012285f7f8559a1e7e545" [[package]] name = "httpdate" @@ -2348,6 +2359,124 @@ dependencies = [ "tracing", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "idna" version = "0.4.0" @@ -2360,12 +2489,14 @@ dependencies = [ [[package]] name = "idna" -version = "0.5.0" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" +checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" dependencies = [ - "unicode-bidi", - "unicode-normalization", + "icu_normalizer", + "icu_properties", + "smallvec", + "utf8_iter", ] [[package]] @@ -2570,6 +2701,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "lock_api" version = "0.4.12" @@ -2842,9 +2979,9 @@ dependencies = [ [[package]] name = "object" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" +checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" dependencies = [ "memchr", ] @@ -3179,20 +3316,20 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c3138c30c59ed9b8572f82bed97ea591ecd7e45012566046cc39e72679cff22" +checksum = "6d731e7e3ebfcf422d96b8473e507d5b64790900dd5464772d38d1da9da24d3a" dependencies = [ "cfg-if", "rustix", - "windows 0.56.0", + "windows 0.57.0", ] [[package]] name = "regex" -version = "1.10.4" +version = "1.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c117dbdfde9c8308975b6a18d71f3f385c89461f7b3fb054288ecf2a2058ba4c" +checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" dependencies = [ "aho-corasick", "memchr", @@ -3202,9 +3339,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b83b8b9847f9bf95ef68afb0b8e6cdb80f498442f5179a29fad448fcc1eaea" +checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" dependencies = [ "aho-corasick", "memchr", @@ -3213,9 +3350,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adad44e29e4c806119491a7f06f03de4d1af22c3a680dd47f1e6e179439d1f56" +checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" @@ -3631,9 +3768,9 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.7" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "967718707829012b2a32af27feeee10fc6a5d450957491ae234ce0a6ab415f32" +checksum = "802c6e812f1a776cc85f887864e8c8f4b1e0fef694870b6bb109bd2ccb567ad5" dependencies = [ "compact_str", "derive_destructure2", @@ -3686,6 +3823,12 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -3761,6 +3904,17 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -3884,6 +4038,16 @@ dependencies = [ "time-core", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -4205,21 +4369,33 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna 1.0.0", "percent-encoding", "serde", ] [[package]] -name = "utf8parse" -version = "0.2.1" +name = "utf16_iter" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "711b9620af191e0cdc7468a8d14e709c3dcdb115b36f838e601583af800a370a" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[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 = "valuable" @@ -4443,35 +4619,13 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows" -version = "0.56.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" -dependencies = [ - "windows-core 0.56.0", - "windows-targets 0.52.5", -] - [[package]] name = "windows" version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" dependencies = [ - "windows-core 0.57.0", - "windows-targets 0.52.5", -] - -[[package]] -name = "windows-core" -version = "0.56.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" -dependencies = [ - "windows-implement 0.56.0", - "windows-interface 0.56.0", - "windows-result", + "windows-core", "windows-targets 0.52.5", ] @@ -4481,23 +4635,12 @@ version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" dependencies = [ - "windows-implement 0.57.0", - "windows-interface 0.57.0", + "windows-implement", + "windows-interface", "windows-result", "windows-targets 0.52.5", ] -[[package]] -name = "windows-implement" -version = "0.56.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "windows-implement" version = "0.57.0" @@ -4509,17 +4652,6 @@ dependencies = [ "syn", ] -[[package]] -name = "windows-interface" -version = "0.56.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "windows-interface" version = "0.57.0" @@ -4708,6 +4840,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "xattr" version = "1.3.1" @@ -4728,6 +4872,30 @@ dependencies = [ "lzma-sys", ] +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.34" @@ -4748,12 +4916,55 @@ dependencies = [ "syn", ] +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + [[package]] name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +[[package]] +name = "zerovec" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "zstd" version = "0.13.1" From 60a194be90dbf0b799fce84c69e1c3e15291ff89 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 13 Jun 2024 00:03:27 +1000 Subject: [PATCH 1742/2020] Improve ci (#1737) * Run e2e-test on x86_64h-apple-darwin Since it is a target built with `build-std`, we need to make sure it is runnable. Signed-off-by: Jiahao XU * Fix `upgrade-transitive-deps` Fill in PR description, so that reviewer can just re-open it to run the CI. Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .github/workflows/release-packages.yml | 2 +- .github/workflows/upgrade-transitive-deps.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index 07b5014e..525657d9 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -28,7 +28,7 @@ jobs: matrix: include: - { o: macos-14, t: x86_64-apple-darwin } - - { o: macos-14, t: x86_64h-apple-darwin } + - { o: macos-14, t: x86_64h-apple-darwin, r: true } - { o: macos-14, t: aarch64-apple-darwin, r: true } - { o: ubuntu-latest, diff --git a/.github/workflows/upgrade-transitive-deps.yml b/.github/workflows/upgrade-transitive-deps.yml index 76779b3d..90c1a537 100644 --- a/.github/workflows/upgrade-transitive-deps.yml +++ b/.github/workflows/upgrade-transitive-deps.yml @@ -3,7 +3,7 @@ name: Upgrade transitive dependencies on: workflow_dispatch: # Allow running on-demand schedule: - - cron: '0 3 * * 5' + - cron: "0 3 * * 5" jobs: upgrade: @@ -45,4 +45,4 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh pr create --base main --fill --label 'PR: dependencies' + gh pr create --base main --fill --label 'PR: dependencies' --body 'Update dependencies From a2d2c5d85cccf472cd255ee10c5f571bb8637885 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 13 Jun 2024 00:17:30 +1000 Subject: [PATCH 1743/2020] Disable e2e-tests on x86_64h-apple-darwin macos-14-arm64 cannot execute executable built for x86_64h --- .github/workflows/release-packages.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index 525657d9..07b5014e 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -28,7 +28,7 @@ jobs: matrix: include: - { o: macos-14, t: x86_64-apple-darwin } - - { o: macos-14, t: x86_64h-apple-darwin, r: true } + - { o: macos-14, t: x86_64h-apple-darwin } - { o: macos-14, t: aarch64-apple-darwin, r: true } - { o: ubuntu-latest, From 4687726c6655f7e571691c844f29c4bbe674e25a Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 13 Jun 2024 00:25:24 +1000 Subject: [PATCH 1744/2020] Improve derbugg logging (#1738) * Improve derbugg logging Make it more readable Signed-off-by: Jiahao XU * Fix excessive logging Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/download.rs | 9 ++++++--- crates/binstalk-downloader/src/remote.rs | 7 ++++++- crates/binstalk-downloader/src/remote/resolver.rs | 4 ++-- crates/binstalk-fetchers/src/lib.rs | 2 +- crates/binstalk-git-repo-api/src/gh_api_client.rs | 6 +++--- .../src/gh_api_client/repo_info.rs | 12 +++++++++++- crates/binstalk-registry/src/common.rs | 7 ++++++- crates/binstalk-registry/src/crates_io_registry.rs | 7 ++++++- crates/binstalk-registry/src/git_registry.rs | 7 ++++++- crates/binstalk-registry/src/sparse_registry.rs | 8 +++++++- 10 files changed, 54 insertions(+), 15 deletions(-) diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index a2ee5cde..5c39973e 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -212,7 +212,7 @@ impl Download<'_> { /// /// NOTE that this API does not support gnu extension sparse file unlike /// [`Download::and_extract`]. - #[instrument(skip(visitor))] + #[instrument(skip(self, visitor))] pub async fn and_visit_tar( self, fmt: TarBasedFmt, @@ -239,7 +239,10 @@ impl Download<'_> { /// Download a file from the provided URL and extract it to the provided path. /// /// NOTE that this will only extract directory and regular files. - #[instrument(skip(path))] + #[instrument( + skip(self, path), + fields(path = format_args!("{}", path.as_ref().display())) + )] pub async fn and_extract( self, fmt: PkgFmt, @@ -277,7 +280,7 @@ impl Download<'_> { inner(self, fmt, path.as_ref()).await } - #[instrument] + #[instrument(skip(self))] pub async fn into_bytes(self) -> Result { let bytes = self.content.into_response().await?.bytes().await?; if let Some(verifier) = self.data_verifier { diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 7bd2c684..1d1547fa 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -165,7 +165,12 @@ impl Client { /// /// Return `Ok(ControlFlow::Break(response))` when succeeds and no need /// to retry. - #[instrument] + #[instrument( + skip(self, url), + fields( + url = format_args!("{url}"), + ), + )] async fn do_send_request( &self, request: Request, diff --git a/crates/binstalk-downloader/src/remote/resolver.rs b/crates/binstalk-downloader/src/remote/resolver.rs index 4d33c1e6..3382bde7 100644 --- a/crates/binstalk-downloader/src/remote/resolver.rs +++ b/crates/binstalk-downloader/src/remote/resolver.rs @@ -26,7 +26,7 @@ impl Resolve for TrustDnsResolver { } } -#[instrument(level = "trace")] +#[instrument] fn new_resolver() -> Result { #[cfg(unix)] { @@ -61,7 +61,7 @@ fn new_resolver() -> Result { } #[cfg(windows)] -#[instrument(level = "trace")] +#[instrument] fn get_adapter() -> Result { debug!("Retrieving local IP address"); let local_ip = diff --git a/crates/binstalk-fetchers/src/lib.rs b/crates/binstalk-fetchers/src/lib.rs index ea5b7a28..33e50944 100644 --- a/crates/binstalk-fetchers/src/lib.rs +++ b/crates/binstalk-fetchers/src/lib.rs @@ -180,7 +180,7 @@ impl Data { } } - #[instrument(level = "debug")] + #[instrument(skip(client))] async fn get_repo_info(&self, client: &GhApiClient) -> Result, FetchError> { self.repo_info .get_or_try_init(move || { diff --git a/crates/binstalk-git-repo-api/src/gh_api_client.rs b/crates/binstalk-git-repo-api/src/gh_api_client.rs index 46b22852..5823b53e 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client.rs @@ -12,7 +12,7 @@ use std::{ use binstalk_downloader::{download::Download, remote}; use compact_str::{format_compact, CompactString, ToCompactString}; use tokio::sync::OnceCell; -use tracing::instrument; +use tracing::{instrument, Level}; use url::Url; mod common; @@ -224,7 +224,7 @@ impl GhApiClient { .map_err(|err| err.context("Restful API")) } - #[instrument(level = "debug", skip(self), ret)] + #[instrument(skip(self), ret(level = Level::DEBUG))] pub async fn get_repo_info(&self, repo: &GhRepo) -> Result, GhApiError> { match self .do_fetch( @@ -248,7 +248,7 @@ impl GhApiClient { /// Return `Ok(Some(api_artifact_url))` if exists. /// /// The returned future is guaranteed to be pointer size. - #[instrument(level = "debug", skip(self), ret)] + #[instrument(skip(self), ret(level = Level::DEBUG))] pub async fn has_release_artifact( &self, GhReleaseArtifact { diff --git a/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs b/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs index 33b33682..ac5c08cc 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs @@ -1,4 +1,4 @@ -use std::future::Future; +use std::{fmt, future::Future}; use compact_str::CompactString; use serde::Deserialize; @@ -20,6 +20,16 @@ pub struct RepoInfo { private: bool, } +impl fmt::Display for RepoInfo { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!( + f, + "RepoInfo {{ owner: {}, name: {}, is_private: {} }}", + self.owner.login, self.name, self.private + ) + } +} + impl RepoInfo { #[cfg(test)] pub(crate) fn new(GhRepo { owner, repo }: GhRepo, private: bool) -> Self { diff --git a/crates/binstalk-registry/src/common.rs b/crates/binstalk-registry/src/common.rs index 5f14f3e9..17f5fefa 100644 --- a/crates/binstalk-registry/src/common.rs +++ b/crates/binstalk-registry/src/common.rs @@ -55,7 +55,12 @@ impl DataVerifier for Sha256Digest { } } -#[instrument] +#[instrument( + skip(client, crate_url), + fields( + crate_url = format_args!("{crate_url}"), + ), +)] pub(super) async fn parse_manifest( client: Client, crate_name: &str, diff --git a/crates/binstalk-registry/src/crates_io_registry.rs b/crates/binstalk-registry/src/crates_io_registry.rs index 9857a610..b07b6a1a 100644 --- a/crates/binstalk-registry/src/crates_io_registry.rs +++ b/crates/binstalk-registry/src/crates_io_registry.rs @@ -105,7 +105,12 @@ async fn fetch_crate_cratesio_version_matched( /// Find the crate by name, get its latest stable version matches `version_req`, /// retrieve its Cargo.toml and infer all its bins. -#[instrument] +#[instrument( + skip(client), + fields( + version_req = format_args!("{version_req}"), + ) +)] pub async fn fetch_crate_cratesio_api( client: Client, name: &str, diff --git a/crates/binstalk-registry/src/git_registry.rs b/crates/binstalk-registry/src/git_registry.rs index c68ff1da..518a48b0 100644 --- a/crates/binstalk-registry/src/git_registry.rs +++ b/crates/binstalk-registry/src/git_registry.rs @@ -97,7 +97,12 @@ impl GitRegistry { ) } - #[instrument] + #[instrument( + skip(self, client, version_req), + fields( + version_req = format_args!("{version_req}"), + ), + )] pub async fn fetch_crate_matched( &self, client: Client, diff --git a/crates/binstalk-registry/src/sparse_registry.rs b/crates/binstalk-registry/src/sparse_registry.rs index c30a0fe5..7dca1b32 100644 --- a/crates/binstalk-registry/src/sparse_registry.rs +++ b/crates/binstalk-registry/src/sparse_registry.rs @@ -78,7 +78,13 @@ impl SparseRegistry { ) } - #[instrument] + #[instrument( + skip(self, client, version_req), + fields( + registry_url = format_args!("{}", self.url), + version_req = format_args!("{version_req}"), + ) + )] pub async fn fetch_crate_matched( &self, client: Client, From e334e3153ae8a180737dfdf33da5ad15c32b0976 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 13 Jun 2024 00:37:19 +1000 Subject: [PATCH 1745/2020] Compile all tests in justfile target unit-tests To make sure all code is valid. And to improve caching of CI job unit-tests. --- justfile | 1 + 1 file changed, 1 insertion(+) diff --git a/justfile b/justfile index 01270a4f..97e0201e 100644 --- a/justfile +++ b/justfile @@ -261,6 +261,7 @@ e2e-test-tls: (e2e-test "tls" "1.2") (e2e-test "tls" "1.3") e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-git e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate e2e-test-no-track e2e-test-registries e2e-test-signing e2e-test-continue-on-failure e2e-test-private-github-repo unit-tests: print-env + cargo test --no-run --target {{target}} cargo nextest run --target {{target}} {{cargo-nextest-additional-args}} cargo test --doc --target {{target}} From 07c8dd7e8a5be35b2d38c459497f30cd98888db7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Jun 2024 07:26:20 +1000 Subject: [PATCH 1746/2020] release: binstalk-fetchers v0.5.0 (#1735) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6a76c2cf..29307992 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -326,7 +326,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.4.1" +version = "0.5.0" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index a502afc9..dcb42fe7 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.4.1" +version = "0.5.0" edition = "2021" description = "The binstall fetchers" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index e3b8ac13..07faf801 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.11.1", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.1.0", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.4.1", path = "../binstalk-fetchers", features = [ +binstalk-fetchers = { version = "0.5.0", path = "../binstalk-fetchers", features = [ "quickinstall", ] } binstalk-registry = { version = "0.8.0", path = "../binstalk-registry" } From 66f303393f0f98d8d68321608a72255893409c8a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Jun 2024 10:30:42 +1000 Subject: [PATCH 1747/2020] release: binstalk-registry v0.9.0 (#1736) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 29307992..8af084ca 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -389,7 +389,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.8.0" +version = "0.9.0" dependencies = [ "async-trait", "base16", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index b99b2d44..3f980b5c 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.8.0" +version = "0.9.0" edition = "2021" rust-version = "1.65.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 07faf801..13002933 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -16,7 +16,7 @@ binstalk-git-repo-api = { version = "0.1.0", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.5.0", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.8.0", path = "../binstalk-registry" } +binstalk-registry = { version = "0.9.0", path = "../binstalk-registry" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } From f567e3bd9e4541a84cf561e192e8abba74c4edc9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Jun 2024 02:54:38 +0000 Subject: [PATCH 1748/2020] release: binstalk-downloader v0.11.2 (#1739) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-git-repo-api/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8af084ca..f3598d5a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -292,7 +292,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.11.1" +version = "0.11.2" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 0275901d..37600b5d 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.11.1" +version = "0.11.2" rust-version = "1.70.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index dcb42fe7..c54162ca 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.11.1", path = "../binstalk-downloader", default-features = false } +binstalk-downloader = { version = "0.11.2", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.1.0", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.11.1", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.11.2", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index cd0cb894..eaaf7c5e 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.11.1", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.11.2", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.7.0" @@ -24,6 +24,6 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.11.1", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.11.2", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 3f980b5c..eabe9656 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.11.1", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.11.2", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } @@ -40,7 +40,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.11.1", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.11.2", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 13002933..038c26ab 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.11.1", path = "../binstalk-downloader", default-features = false } +binstalk-downloader = { version = "0.11.2", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.1.0", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.5.0", path = "../binstalk-fetchers", features = [ "quickinstall", From 734906d5fd534f80b2034095a7646d479bd6f9b3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Jun 2024 03:41:38 +0000 Subject: [PATCH 1749/2020] release: binstalk-git-repo-api v0.1.1 (#1740) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-git-repo-api/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f3598d5a..61c76d90 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -350,7 +350,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.1.0" +version = "0.1.1" dependencies = [ "binstalk-downloader", "compact_str", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index c54162ca..be8858ad 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" binstalk-downloader = { version = "0.11.2", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.1.0", path = "../binstalk-git-repo-api" } +binstalk-git-repo-api = { version = "0.1.1", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index eaaf7c5e..738b6f97 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.1.0" +version = "0.1.1" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 038c26ab..237e3716 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.11.2", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.1.0", path = "../binstalk-git-repo-api" } +binstalk-git-repo-api = { version = "0.1.1", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.5.0", path = "../binstalk-fetchers", features = [ "quickinstall", ] } From 38f8eb4b1acc59acdb9781e05fb5c99163f1237f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 13 Jun 2024 18:10:23 +1000 Subject: [PATCH 1750/2020] Fix passing GITHUB_TOKEN in ci.yml (#1742) Fix CI --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1f122f23..722ffebf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -125,9 +125,8 @@ jobs: # which works better when we provide it with GITHUB_TOKEN. GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN }} - - run: | - just build - just e2e-tests + - run: just build + - run: just e2e-tests env: GITHUB_TOKEN: ${{ secrets.CI_TEST_GITHUB_TOKEN }} From 250814f5307e6856407a08652a2280dd1245b1f4 Mon Sep 17 00:00:00 2001 From: Remo Senekowitsch Date: Thu, 13 Jun 2024 10:26:30 +0200 Subject: [PATCH 1751/2020] fix(resolve): prefer official binaries (#1741) * prefer official binaries with secondary targets over quickinstall binaries * chore(test): add jj-cli to live e2e test --- crates/binstalk/src/ops/resolve.rs | 11 +++++------ e2e-tests/live.sh | 7 ++++++- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 0fa65d9b..b1457c0c 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -101,9 +101,9 @@ async fn resolve_inner( )); handles.extend( - desired_targets - .into_iter() - .map(|(triple, target)| { + resolvers + .iter() + .cartesian_product(desired_targets.into_iter().map(|(triple, target)| { debug!("Building metadata for target: {target}"); let target_meta = package_info.meta.merge_overrides( @@ -117,9 +117,8 @@ async fn resolve_inner( meta: target_meta, target_related_info: triple, }) - }) - .cartesian_product(resolvers) - .map(|(target_data, f)| { + })) + .map(|(f, target_data)| { let fetcher = f( opts.client.clone(), opts.gh_api_client.clone(), diff --git a/e2e-tests/live.sh b/e2e-tests/live.sh index 507ac6ae..b6770442 100755 --- a/e2e-tests/live.sh +++ b/e2e-tests/live.sh @@ -8,7 +8,7 @@ unset CARGO_INSTALL_ROOT # to find versions matching <= 1.3.3 # - `cargo-quickinstall` would test `fetch_crate_cratesio_version_matched` ability # to find latest stable version. -crates="b3sum@<=1.3.3 cargo-release@0.24.9 cargo-binstall@0.20.1 cargo-watch@8.4.0 miniserve@0.23.0 sccache@0.3.3 cargo-quickinstall" +crates="b3sum@<=1.3.3 cargo-release@0.24.9 cargo-binstall@0.20.1 cargo-watch@8.4.0 miniserve@0.23.0 sccache@0.3.3 cargo-quickinstall jj-cli@0.18.0" CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') export CARGO_HOME @@ -54,3 +54,8 @@ echo "$miniserve_version" [ "$miniserve_version" = "miniserve 0.23.0" ] cargo-quickinstall -V + +jj_version="$(jj --version)" +echo "$jj_version" + +[ "$jj_version" = "jj 0.18.0-9fb5307b7886e390c02817af7c31b403f0279144" ] From d524db37847b76183eedc6017b6d7a7fdaa8168d Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 13 Jun 2024 19:32:38 +1000 Subject: [PATCH 1752/2020] Fix ci and improve efficiency (#1744) * Fix job changed-file in ci.yml * Do not run job e2e-tests on PR which might not have access to GitHub Token in secrets, if opened by non-maintainer * Provide GITHUB_TOKEN fallback if the secrets is not accessible * Fix regex expression passed to sed --- .github/workflows/ci.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 722ffebf..f0b69a37 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,7 @@ jobs: ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: | set -euxo pipefail - crates_changed="$(for file in $ALL_CHANGED_FILES; do echo $file; done | grep crates | cut -d / -f 2 || echo)" + crates_changed="$(for file in $ALL_CHANGED_FILES; do echo $file; done | grep crates | cut -d / -f 2 | sed 's/bin/cargo-binstall/' || echo)" has_detect_target_changed="$(echo "$crates_changed" | grep -q detect-targets && echo true || echo false)" echo "crates_changed=${crates_changed//$'\n'/ }" | tee -a "$GITHUB_OUTPUT" echo "has_detect_target_changed=$has_detect_target_changed" | tee -a "$GITHUB_OUTPUT" @@ -80,7 +80,7 @@ jobs: env: # just-setup use binstall to install sccache, # which works better when we provide it with GITHUB_TOKEN. - GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} with: tools: cargo-nextest @@ -98,10 +98,11 @@ jobs: - run: just unit-tests if: env.CARGO_NEXTEST_ADDITIONAL_ARGS != '' env: - GITHUB_TOKEN: ${{ secrets.CI_TEST_GITHUB_TOKEN }} - CI_UNIT_TEST_GITHUB_TOKEN: ${{ secrets.CI_UNIT_TEST_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CI_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + CI_UNIT_TEST_GITHUB_TOKEN: ${{ secrets.CI_UNIT_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} e2e-tests: + if: github.event_name != 'pull_request' strategy: fail-fast: false matrix: @@ -165,7 +166,7 @@ jobs: env: # just-setup use binstall to install sccache, # which works better when we provide it with GITHUB_TOKEN. - GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - run: just avoid-dev-deps - run: just check @@ -189,7 +190,7 @@ jobs: env: # just-setup use binstall to install sccache, # which works better when we provide it with GITHUB_TOKEN. - GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - run: just toolchain rustfmt,clippy - run: just avoid-dev-deps From 22217acc51e1f3b2f814474b21e062662e9aebe8 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 13 Jun 2024 20:19:00 +1000 Subject: [PATCH 1753/2020] Fix job changed-files ci.yml (#1745) Fix sed expression --- .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 f0b69a37..f687113e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -63,7 +63,7 @@ jobs: ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }} run: | set -euxo pipefail - crates_changed="$(for file in $ALL_CHANGED_FILES; do echo $file; done | grep crates | cut -d / -f 2 | sed 's/bin/cargo-binstall/' || echo)" + crates_changed="$(for file in $ALL_CHANGED_FILES; do echo $file; done | grep crates | cut -d / -f 2 | sed 's/^bin$/cargo-binstall/' || echo)" has_detect_target_changed="$(echo "$crates_changed" | grep -q detect-targets && echo true || echo false)" echo "crates_changed=${crates_changed//$'\n'/ }" | tee -a "$GITHUB_OUTPUT" echo "has_detect_target_changed=$has_detect_target_changed" | tee -a "$GITHUB_OUTPUT" From cd85622b1364924067ac6f6834083f85f99c1f65 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 13 Jun 2024 20:50:47 +1000 Subject: [PATCH 1754/2020] Improve gh token auto scraping (#1746) * Log the gh-auth token retrieval failure on debug level Fixed #1733 * Make gh_token::get an async function * Improve returned err msg in gh_token::get * Update use of gh_token::get() in entry.rs * Fix typos * Fix unclosed () * Fix unclosed () * Fix gh_token.rs * Fix entry.rs * Fix fmt in entry.rs * Fix fmt in gh_token.rs * Fix fmt in gh_token.rs * Fix fmt in gh_token.rs * Fix fmt in entry.rs --- crates/bin/src/entry.rs | 43 +++++++++++++++++++++++++------------- crates/bin/src/gh_token.rs | 26 +++++++++++++++-------- 2 files changed, 45 insertions(+), 24 deletions(-) diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index f409a726..e8e30079 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -27,7 +27,7 @@ use file_format::FileFormat; use home::cargo_home; use log::LevelFilter; use miette::{miette, Report, Result, WrapErr}; -use tokio::task::block_in_place; +use tokio::{runtime::Handle, task::block_in_place}; use tracing::{debug, error, info, warn}; use crate::{ @@ -82,6 +82,28 @@ pub fn install_crates( // Launch target detection let desired_targets = get_desired_targets(args.targets); + // Launch scraping of gh token + let no_discover_github_token = args.no_discover_github_token; + let github_token = args.github_token.or_else(|| { + if args.no_discover_github_token { + None + } else { + git_credentials::try_from_home() + } + }); + let get_gh_token_task = (github_token.is_none() && !no_discover_github_token).then(|| { + AutoAbortJoinHandle::spawn(async move { + match gh_token::get().await { + Ok(token) => Some(token), + Err(err) => { + debug!(?err, "Failed to retrieve token from `gh auth token`"); + debug!("Failed to read git credential file"); + None + } + } + }) + }); + // Computer cli_overrides let cli_overrides = PkgOverride { pkg_url: args.pkg_url, @@ -109,20 +131,11 @@ pub fn install_crates( let gh_api_client = GhApiClient::new( client.clone(), - args.github_token.or_else(|| { - if args.no_discover_github_token { - None - } else { - git_credentials::try_from_home().or_else(|| match gh_token::get() { - Ok(token) => Some(token), - Err(err) => { - warn!(?err, "Failed to retrieve token from `gh auth token`"); - warn!("Failed to read git credential file"); - None - } - }) - } - }), + if let Some(task) = get_gh_token_task { + Handle::current().block_on(task)? + } else { + github_token + }, ); // Create binstall_opts diff --git a/crates/bin/src/gh_token.rs b/crates/bin/src/gh_token.rs index 172070a6..b7a46655 100644 --- a/crates/bin/src/gh_token.rs +++ b/crates/bin/src/gh_token.rs @@ -1,14 +1,19 @@ -use std::{io, process}; +use std::{ + io, + process::{Output, Stdio}, +}; use compact_str::CompactString; +use tokio::process::Command; -pub(super) fn get() -> io::Result { - let process::Output { status, stdout, .. } = process::Command::new("gh") +pub(super) async fn get() -> io::Result { + let Output { status, stdout, .. } = Command::new("gh") .args(["auth", "token"]) - .stdin(process::Stdio::null()) - .stdout(process::Stdio::piped()) - .stderr(process::Stdio::null()) - .output()?; + .stdin(Stdio::null()) + .stdout(Stdio::piped()) + .stderr(Stdio::null()) + .output() + .await?; if !status.success() { return Err(io::Error::new( @@ -19,8 +24,11 @@ pub(super) fn get() -> io::Result { // Use String here instead of CompactString here since // `CompactString::from_utf8` allocates if it's longer than 24B. - let s = String::from_utf8(stdout).map_err(|_err| { - io::Error::new(io::ErrorKind::InvalidData, "Invalid output, expected utf8") + let s = String::from_utf8(stdout).map_err(|err| { + io::Error::new( + io::ErrorKind::InvalidData, + format!("Invalid output, expected utf8: {err}"), + ) })?; Ok(s.trim().into()) From 9a270f03b681c3fc2247feb1620269658c32c79f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 13 Jun 2024 11:41:33 +0000 Subject: [PATCH 1755/2020] release: binstalk v0.24.0 (#1743) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 61c76d90..5c5156e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -247,7 +247,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.23.1" +version = "0.24.0" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index a67b2ad9..3102d1f3 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.23.1", default-features = false } +binstalk = { path = "../binstalk", version = "0.24.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.13.0" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 237e3716..49b8ed21 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.23.1" +version = "0.24.0" rust-version = "1.65.0" authors = ["ryan "] edition = "2021" From 05f488322ecda3dddaf92cbb546ca8f31eb30172 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 13 Jun 2024 23:43:39 +1000 Subject: [PATCH 1756/2020] Add cargo-binstall installation path to GITHUB_PATH (#1748) * Add cargo-binstall installation path to GITHUB_PATH in install-from-binstall-release.sh Fixed #1714 * Add cargo-binstall installation path to GITHUB_PATH in install-from-binstall-release.ps1 * Update install-script.yml to test * Fix use of env var in install-from-binstall-release.ps1 --- .github/workflows/install-script.yml | 3 --- install-from-binstall-release.ps1 | 10 +++++++--- install-from-binstall-release.sh | 10 +++++++--- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/.github/workflows/install-script.yml b/.github/workflows/install-script.yml index e04d09cb..b37874b2 100644 --- a/.github/workflows/install-script.yml +++ b/.github/workflows/install-script.yml @@ -43,7 +43,6 @@ jobs: CARGO_HOME="$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')" mkdir -p "${CARGO_HOME}/bin" echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" - echo "${CARGO_HOME}/bin" >> $GITHUB_PATH - name: Install `cargo-binstall` using scripts run: ./install-from-binstall-release.sh @@ -73,7 +72,6 @@ jobs: CARGO_HOME="$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')" mkdir -p "${CARGO_HOME}/bin" echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" - echo "${CARGO_HOME}/bin" >> $GITHUB_PATH - name: Install `cargo-binstall` using scripts run: ./install-from-binstall-release.ps1 @@ -101,7 +99,6 @@ jobs: CARGO_HOME="$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')" mkdir -p "${CARGO_HOME}/bin" echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" - echo "${CARGO_HOME}/bin" >> $GITHUB_PATH - name: Install `cargo-binstall` using scripts shell: bash diff --git a/install-from-binstall-release.ps1 b/install-from-binstall-release.ps1 index b6c60f13..a06b25e4 100644 --- a/install-from-binstall-release.ps1 +++ b/install-from-binstall-release.ps1 @@ -20,7 +20,11 @@ Remove-Item -Force $tmpdir\cargo-binstall.zip Remove-Item -Recurse -Force $tmpdir\cargo-binstall $cargo_home = if ($Env:CARGO_HOME -ne $null) { $Env:CARGO_HOME } else { "$HOME\.cargo" } if ($Env:Path -split ";" -notcontains "$cargo_home\bin") { - Write-Host "" - Write-Host "Your path is missing $cargo_home\bin, you might want to add it." -ForegroundColor Red - Write-Host "" + if (($Env:CI -ne $null) -and ($Env:GITHUB_PATH -ne $null)) { + Add-Content -Path "$Env:GITHUB_PATH" -Value "$cargo_home\bin" + } else { + Write-Host "" + Write-Host "Your path is missing $cargo_home\bin, you might want to add it." -ForegroundColor Red + Write-Host "" + } } diff --git a/install-from-binstall-release.sh b/install-from-binstall-release.sh index 90686cba..57305c3e 100755 --- a/install-from-binstall-release.sh +++ b/install-from-binstall-release.sh @@ -36,7 +36,11 @@ fi CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" if ! [[ ":$PATH:" == *":$CARGO_HOME/bin:"* ]]; then - echo - printf "\033[0;31mYour path is missing %s, you might want to add it.\033[0m\n" "$CARGO_HOME/bin" - echo + if [ -n "$CI" ] && [ -n "$GITHUB_PATH" ]; then + echo "$CARGO_HOME/bin" >> "$GITHUB_PATH" + else + echo + printf "\033[0;31mYour path is missing %s, you might want to add it.\033[0m\n" "$CARGO_HOME/bin" + echo + fi fi From ba0e752b9c9f81cb5fd4564f5e22af615a01a620 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 14 Jun 2024 00:24:09 +1000 Subject: [PATCH 1757/2020] Fix upgrade-transitive-deps.yml (#1749) Fix use of gh-pr-create --- .github/workflows/upgrade-transitive-deps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upgrade-transitive-deps.yml b/.github/workflows/upgrade-transitive-deps.yml index 90c1a537..aaacad8a 100644 --- a/.github/workflows/upgrade-transitive-deps.yml +++ b/.github/workflows/upgrade-transitive-deps.yml @@ -45,4 +45,4 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh pr create --base main --fill --label 'PR: dependencies' --body 'Update dependencies + gh pr create --base main --label 'PR: dependencies' --title 'dep: Upgrade transitive dependencies' --body 'Update dependencies From 45d96a5b134bf7b5a0a2903132994fb97a5aadef Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 14 Jun 2024 10:55:06 +1000 Subject: [PATCH 1758/2020] Fix install-from-binstall-release.sh (#1751) Fixed #1750 --- install-from-binstall-release.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/install-from-binstall-release.sh b/install-from-binstall-release.sh index 57305c3e..1da856d4 100755 --- a/install-from-binstall-release.sh +++ b/install-from-binstall-release.sh @@ -36,7 +36,7 @@ fi CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" if ! [[ ":$PATH:" == *":$CARGO_HOME/bin:"* ]]; then - if [ -n "$CI" ] && [ -n "$GITHUB_PATH" ]; then + if [ -n "${CI:-}" ] && [ -n "${GITHUB_PATH:-}" ]; then echo "$CARGO_HOME/bin" >> "$GITHUB_PATH" else echo From bb1e2cf363443eb8f6e20457a170c212cb48410e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 14 Jun 2024 13:28:11 +1000 Subject: [PATCH 1759/2020] Fix missing ' upgrade-transitive-deps.yml (#1752) --- .github/workflows/upgrade-transitive-deps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upgrade-transitive-deps.yml b/.github/workflows/upgrade-transitive-deps.yml index aaacad8a..a1f8d117 100644 --- a/.github/workflows/upgrade-transitive-deps.yml +++ b/.github/workflows/upgrade-transitive-deps.yml @@ -45,4 +45,4 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh pr create --base main --label 'PR: dependencies' --title 'dep: Upgrade transitive dependencies' --body 'Update dependencies + gh pr create --base main --label 'PR: dependencies' --title 'dep: Upgrade transitive dependencies' --body 'Update dependencies' From a220952fd6ea4740ea9b8547552ddbe5df3bb065 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 03:46:47 +0000 Subject: [PATCH 1760/2020] dep: Upgrade transitive dependencies (#1753) Co-authored-by: github-actions --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5c5156e9..a1b8e3d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2777,9 +2777,9 @@ checksum = "df39d232f5c40b0891c10216992c2f250c054105cb1e56f0fc9032db6203ecc1" [[package]] name = "memchr" -version = "2.7.2" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8640c5d730cb13ebd907d8d04b52f55ac9a2eec55b440c8892f40d56c76c1d" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" From dfa230f0393521db5b7b32f06c9f8a051fa0fec8 Mon Sep 17 00:00:00 2001 From: Tomas Olvecky Date: Fri, 14 Jun 2024 06:52:37 +0200 Subject: [PATCH 1761/2020] Use binary name when searching for artifacts (#1747) * Use binary name when searching for artifacts When there is a single binary declared in the manifest and it differs from the package name, add it to the list of handles used for pre-built artifact fetching. * Simplify `binary_name` assignment with a `match` * Add e2e test * Only attempt to use the binary name with `GhCrateMeta` fetcher * Avoid too much over-allocating. Technically it should also check if gh-crate-meta resolver is enabled, but it is unlikely for it to be disabled and overallocating for extra n-target should be fine, it is an improvement over doubling the space allocated if the binary_name is Some. * Fix fmt in crates/binstalk/src/ops/resolve.rs --------- Co-authored-by: Jiahao XU --- crates/binstalk-fetchers/src/gh_crate_meta.rs | 4 +- crates/binstalk-registry/src/visitor.rs | 2 +- crates/binstalk/src/ops/resolve.rs | 105 ++++++++++++------ e2e-tests/live.sh | 9 +- rust-toolchain.toml | 1 + 5 files changed, 82 insertions(+), 39 deletions(-) diff --git a/crates/binstalk-fetchers/src/gh_crate_meta.rs b/crates/binstalk-fetchers/src/gh_crate_meta.rs index d2d85f50..976b6942 100644 --- a/crates/binstalk-fetchers/src/gh_crate_meta.rs +++ b/crates/binstalk-fetchers/src/gh_crate_meta.rs @@ -15,6 +15,8 @@ use crate::{ SignaturePolicy, SignatureVerifier, TargetDataErased, DEFAULT_GH_API_RETRY_DURATION, }; +pub const FETCHER_GH_CRATE_META: &str = "GhCrateMeta"; + pub(crate) mod hosting; pub struct GhCrateMeta { @@ -391,7 +393,7 @@ impl super::Fetcher for GhCrateMeta { } fn fetcher_name(&self) -> &'static str { - "GhCrateMeta" + FETCHER_GH_CRATE_META } fn is_third_party(&self) -> bool { diff --git a/crates/binstalk-registry/src/visitor.rs b/crates/binstalk-registry/src/visitor.rs index 717ec57f..e7ecaacd 100644 --- a/crates/binstalk-registry/src/visitor.rs +++ b/crates/binstalk-registry/src/visitor.rs @@ -71,7 +71,7 @@ impl ManifestVisitor { // Load and parse manifest let mut manifest = Manifest::from_slice_with_metadata(&self.cargo_toml_content)?; - + debug!("Manifest: {manifest:?}"); // Checks vfs for binary output names manifest.complete_from_abstract_filesystem::(&self.vfs, None)?; diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index b1457c0c..0ab49faf 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -7,6 +7,7 @@ use std::{ sync::Arc, }; +use binstalk_fetchers::FETCHER_GH_CRATE_META; use compact_str::{CompactString, ToCompactString}; use itertools::Itertools; use leon::Template; @@ -91,45 +92,77 @@ async fn resolve_inner( .collect::, _>>()?; let resolvers = &opts.resolvers; - let mut handles: Vec<(Arc, _)> = - Vec::with_capacity(desired_targets.len() * resolvers.len()); + let binary_name = match package_info.binaries.as_slice() { + [bin] if bin.name != package_info.name => Some(CompactString::from(bin.name.as_str())), + _ => None, + }; - let data = Arc::new(Data::new( - package_info.name.clone(), - package_info.version_str.clone(), - package_info.repo.clone(), - )); - - handles.extend( - resolvers - .iter() - .cartesian_product(desired_targets.into_iter().map(|(triple, target)| { - debug!("Building metadata for target: {target}"); - - let target_meta = package_info.meta.merge_overrides( - iter::once(&opts.cli_overrides).chain(package_info.overrides.get(target)), - ); - - debug!("Found metadata: {target_meta:?}"); - - Arc::new(TargetData { - target: target.clone(), - meta: target_meta, - target_related_info: triple, - }) - })) - .map(|(f, target_data)| { - let fetcher = f( - opts.client.clone(), - opts.gh_api_client.clone(), - data.clone(), - target_data, - opts.signature_policy, - ); - (fetcher.clone(), AutoAbortJoinHandle::new(fetcher.find())) - }), + let mut handles: Vec<(Arc, _)> = Vec::with_capacity( + desired_targets.len() * resolvers.len() + + if binary_name.is_some() { + desired_targets.len() + } else { + 0 + }, ); + let mut handles_fn = + |data: Arc, filter_fetcher_by_name_predicate: fn(&'static str) -> bool| { + handles.extend( + resolvers + .iter() + .cartesian_product(desired_targets.clone().into_iter().map( + |(triple, target)| { + debug!("Building metadata for target: {target}"); + + let target_meta = package_info.meta.merge_overrides( + iter::once(&opts.cli_overrides) + .chain(package_info.overrides.get(target)), + ); + + debug!("Found metadata: {target_meta:?}"); + + Arc::new(TargetData { + target: target.clone(), + meta: target_meta, + target_related_info: triple, + }) + }, + )) + .filter_map(|(f, target_data)| { + let fetcher = f( + opts.client.clone(), + opts.gh_api_client.clone(), + data.clone(), + target_data, + opts.signature_policy, + ); + filter_fetcher_by_name_predicate(fetcher.fetcher_name()) + .then_some((fetcher.clone(), AutoAbortJoinHandle::new(fetcher.find()))) + }), + ) + }; + + handles_fn( + Arc::new(Data::new( + package_info.name.clone(), + package_info.version_str.clone(), + package_info.repo.clone(), + )), + |_| true, + ); + + if let Some(binary_name) = binary_name { + handles_fn( + Arc::new(Data::new( + binary_name, + package_info.version_str.clone(), + package_info.repo.clone(), + )), + |name| name == FETCHER_GH_CRATE_META, + ); + } + for (fetcher, handle) in handles { fetcher.clone().report_to_upstream(); match handle.flattened_join().await { diff --git a/e2e-tests/live.sh b/e2e-tests/live.sh index b6770442..359ba4da 100755 --- a/e2e-tests/live.sh +++ b/e2e-tests/live.sh @@ -8,7 +8,9 @@ unset CARGO_INSTALL_ROOT # to find versions matching <= 1.3.3 # - `cargo-quickinstall` would test `fetch_crate_cratesio_version_matched` ability # to find latest stable version. -crates="b3sum@<=1.3.3 cargo-release@0.24.9 cargo-binstall@0.20.1 cargo-watch@8.4.0 miniserve@0.23.0 sccache@0.3.3 cargo-quickinstall jj-cli@0.18.0" +# - `git-mob-tool tests the using of using a binary name (`git-mob`) different +# from the package name. +crates="b3sum@<=1.3.3 cargo-release@0.24.9 cargo-binstall@0.20.1 cargo-watch@8.4.0 miniserve@0.23.0 sccache@0.3.3 cargo-quickinstall jj-cli@0.18.0 git-mob-tool@1.6.1" CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') export CARGO_HOME @@ -59,3 +61,8 @@ jj_version="$(jj --version)" echo "$jj_version" [ "$jj_version" = "jj 0.18.0-9fb5307b7886e390c02817af7c31b403f0279144" ] + +git_mob_version="$(git-mob --version)" +echo "$git_mob_version" + +[ "$git_mob_version" = "git-mob-tool 1.6.1" ] diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 2fc3eef2..05e6ca1b 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,4 @@ [toolchain] channel = "stable" profile = "minimal" +components = ["rustfmt", "clippy"] From 34cca9f415ba1cc02853c0655efc0e4d61d47f54 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 14 Jun 2024 18:00:53 +1000 Subject: [PATCH 1762/2020] Use io::Error::downcast in 1.79 (#1754) * Bump msrv of binstalk-downloader, binstalk and cargo-binstall to 1.79 * Update From for DownloadError to use io::Error::downcast * Update From for BinstallError * fix dmt --- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-downloader/src/download.rs | 16 ++-------------- crates/binstalk/Cargo.toml | 2 +- crates/binstalk/src/errors.rs | 16 ++-------------- 5 files changed, 7 insertions(+), 31 deletions(-) diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 3102d1f3..662a42b2 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -4,7 +4,7 @@ description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" version = "1.6.9" -rust-version = "1.70.0" +rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 37600b5d..da674b45 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -4,7 +4,7 @@ description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" version = "0.11.2" -rust-version = "1.70.0" +rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "Apache-2.0 OR MIT" diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index 5c39973e..bfbd21f0 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -44,20 +44,8 @@ pub enum DownloadError { impl From for DownloadError { fn from(err: io::Error) -> Self { - if err.get_ref().is_some() { - let kind = err.kind(); - - let inner = err - .into_inner() - .expect("err.get_ref() returns Some, so err.into_inner() should also return Some"); - - inner - .downcast() - .map(|b| *b) - .unwrap_or_else(|err| DownloadError::Io(io::Error::new(kind, err))) - } else { - DownloadError::Io(err) - } + err.downcast::() + .unwrap_or_else(DownloadError::Io) } } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 49b8ed21..104fd711 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -4,7 +4,7 @@ description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" version = "0.24.0" -rust-version = "1.65.0" +rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" diff --git a/crates/binstalk/src/errors.rs b/crates/binstalk/src/errors.rs index f367299d..80686ef1 100644 --- a/crates/binstalk/src/errors.rs +++ b/crates/binstalk/src/errors.rs @@ -530,20 +530,8 @@ impl Termination for BinstallError { impl From for BinstallError { fn from(err: io::Error) -> Self { - if err.get_ref().is_some() { - let kind = err.kind(); - - let inner = err - .into_inner() - .expect("err.get_ref() returns Some, so err.into_inner() should also return Some"); - - inner - .downcast() - .map(|b| *b) - .unwrap_or_else(|err| BinstallError::Io(io::Error::new(kind, err))) - } else { - BinstallError::Io(err) - } + err.downcast::() + .unwrap_or_else(BinstallError::Io) } } From d3cd0a2ad41a79cd8be873e07e56c182824041dc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 08:13:57 +0000 Subject: [PATCH 1763/2020] release: binstalk-fetchers v0.5.1 (#1755) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a1b8e3d9..dfb64da8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -326,7 +326,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.5.0" +version = "0.5.1" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index be8858ad..1bb1d1b1 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.5.0" +version = "0.5.1" edition = "2021" description = "The binstall fetchers" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 104fd711..a3daf309 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.11.2", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.1.1", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.5.0", path = "../binstalk-fetchers", features = [ +binstalk-fetchers = { version = "0.5.1", path = "../binstalk-fetchers", features = [ "quickinstall", ] } binstalk-registry = { version = "0.9.0", path = "../binstalk-registry" } From 475fd61cd76fcf16549c291f112ed34cad3abe1f Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 14 Jun 2024 19:29:41 +1000 Subject: [PATCH 1764/2020] Do not run ci.yml on push to main (#1757) All commits should be submit via PR, and merge_queue already run ci.yml, with up-to-date source code. Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f687113e..73496d8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,12 +14,6 @@ on: - opened - reopened - synchronize - push: - branches: - - main - paths-ignore: - - README.md - - SUPPORT.md concurrency: group: ${{ github.workflow }}-${{ github.ref || github.event.pull_request.number || github.sha }}-${{ inputs.additional_key }} From 77b0b68ea9f93330e361d7ae723b0f3a0a1254d2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 20:04:28 +1000 Subject: [PATCH 1765/2020] release: binstalk-registry v0.9.1 (#1756) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dfb64da8..1bc370cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -389,7 +389,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.9.0" +version = "0.9.1" dependencies = [ "async-trait", "base16", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index eabe9656..74cc093e 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.9.0" +version = "0.9.1" edition = "2021" rust-version = "1.65.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index a3daf309..7fcc5162 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -16,7 +16,7 @@ binstalk-git-repo-api = { version = "0.1.1", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.5.1", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.9.0", path = "../binstalk-registry" } +binstalk-registry = { version = "0.9.1", path = "../binstalk-registry" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } From 610504957fed050dfb05b82a5a3abe2c62995cbd Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 14 Jun 2024 20:25:13 +1000 Subject: [PATCH 1766/2020] Fix release-pr.yml (#1758) Always use latest stable rust Signed-off-by: Jiahao XU --- .github/workflows/release-pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 9777ad89..3230671f 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -47,6 +47,7 @@ jobs: with: tool: cargo-release,cargo-semver-checks + - run: rustup toolchain install stable --no-self-update --profile minimal - uses: cargo-bins/release-pr@v2.1.1 with: github-token: ${{ secrets.GITHUB_TOKEN }} From 540fa79c6b2dcdf5ab8efd84530e18f6c8a9994c Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 14 Jun 2024 21:33:20 +1000 Subject: [PATCH 1767/2020] CI: Fix publish (#1760) * Fix publish in release-cli.yml Using latest stable rust Signed-off-by: Jiahao XU * Fix publish in release.yml Use latest stable rust Signed-off-by: Jiahao XU * Run release-dry-run in merge queue only Running it twice on PR pipeline and merge queue pipeline only wastes time and causes rate limit. For PR that modifies release-dry-run and wants to test it, they can temporarily run release-dry-run on PR pipeline. Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 17 +---------------- .github/workflows/release-cli.yml | 2 ++ .github/workflows/release.yml | 1 + 3 files changed, 4 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 73496d8b..7a61dbaa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -190,24 +190,9 @@ jobs: - run: just avoid-dev-deps - run: just lint - pr-info: - outputs: - is-release: ${{ steps.meta.outputs.is-release }} - crate: ${{ steps.meta.outputs.crates-names }} - - runs-on: ubuntu-latest - steps: - - id: meta - if: github.event_name == 'pull_request' - uses: cargo-bins/release-meta@v1 - with: - event-data: ${{ toJSON(github.event) }} - extract-notes-under: "### Release notes" - release-dry-run: - needs: pr-info uses: ./.github/workflows/release-cli.yml - if: github.event_name != 'pull_request' || needs.pr-info.outputs.is-release == 'true' + if: github.event_name != 'pull_request' secrets: inherit with: info: | diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index 7e5f16ed..a92f7b13 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -83,6 +83,8 @@ jobs: with: name: minisign.pub + - run: rustup toolchain install stable --no-self-update --profile minimal + - run: .github/scripts/ephemeral-crate.sh - if: fromJSON(inputs.info).is-release != 'true' && fromJSON(inputs.info).crate != '' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 997fc89f..c8131abb 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -30,6 +30,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - run: rustup toolchain install stable --no-self-update --profile minimal - name: Push lib release tag if: needs.info.outputs.crate != 'cargo-binstall' uses: mathieudutour/github-tag-action@v6.2 From b71b3ce472580a61f6483ae5062775cedc4b83ce Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 12:38:01 +0000 Subject: [PATCH 1768/2020] release: binstalk-downloader v0.11.3 (#1759) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-git-repo-api/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1bc370cf..9e2859ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -292,7 +292,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.11.2" +version = "0.11.3" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index da674b45..18eb45f7 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.11.2" +version = "0.11.3" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 1bb1d1b1..7940e862 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.11.2", path = "../binstalk-downloader", default-features = false } +binstalk-downloader = { version = "0.11.3", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.1.1", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.11.2", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.11.3", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 738b6f97..f2f0361f 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.11.2", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.11.3", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.7.0" @@ -24,6 +24,6 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.11.2", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.11.3", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 74cc093e..0a161fcc 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.11.2", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.11.3", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } @@ -40,7 +40,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.11.2", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.11.3", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 7fcc5162..f64bf8b0 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.11.2", path = "../binstalk-downloader", default-features = false } +binstalk-downloader = { version = "0.11.3", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.1.1", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.5.1", path = "../binstalk-fetchers", features = [ "quickinstall", From 5c9a7b2c802f565461b8fb5c6c19b881f94c57be Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 14 Jun 2024 13:12:01 +0000 Subject: [PATCH 1769/2020] release: binstalk v0.24.1 (#1762) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9e2859ed..70f96a48 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -247,7 +247,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.24.0" +version = "0.24.1" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 662a42b2..398dd18e 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.24.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.24.1", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.13.0" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index f64bf8b0..fc39d74a 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.24.0" +version = "0.24.1" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" From 4c68c80ab8ddedd86c3b37633f87ab5dad255adf Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 14 Jun 2024 23:21:14 +1000 Subject: [PATCH 1770/2020] Add env var BINSTALL_NO_DISCOVER_GITHUB_TOKEN (#1763) * Add env var BINSTALL_NO_DISCOVER_GITHUB_TOKEN For #1733 Signed-off-by: Jiahao XU * Fix fmt Signed-off-by: Jiahao XU * Fix fmt Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 85f2ca69..d32ea65a 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -144,7 +144,12 @@ pub struct Args { /// allows 2 requests per 6ms. /// /// Both duration and request count must not be 0. - #[clap(help_heading = "Overrides", long, default_value_t = RateLimit::default(), env = "BINSTALL_RATE_LIMIT")] + #[clap( + help_heading = "Overrides", + long, + default_value_t = RateLimit::default(), + env = "BINSTALL_RATE_LIMIT" + )] pub(crate) rate_limit: RateLimit, /// Specify the strategies to be used, @@ -170,7 +175,11 @@ pub struct Args { /// `$HOME/.git-credentials` or `$HOME/.config/gh/hosts.yml` by default. /// /// This option can be used to disable that behavior. - #[clap(help_heading = "Overrides", long)] + #[clap( + help_heading = "Overrides", + long, + env = "BINSTALL_NO_DISCOVER_GITHUB_TOKEN" + )] pub(crate) no_discover_github_token: bool, /// This flag is now enabled by default thus a no-op. From 07dd868fa60a9c02b530100d4cd28ca690668048 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Fri, 14 Jun 2024 23:36:31 +1000 Subject: [PATCH 1771/2020] Fix release-dry-run (#1764) Dry run publish in merge_queue CI for release PR Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7a61dbaa..54f36d96 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -190,7 +190,22 @@ jobs: - run: just avoid-dev-deps - run: just lint + pr-info: + outputs: + is-release: ${{ steps.meta.outputs.is-release }} + crate: ${{ steps.meta.outputs.crates-names }} + + runs-on: ubuntu-latest + steps: + - id: meta + if: github.event_name == 'pull_request' + uses: cargo-bins/release-meta@v1 + with: + event-data: ${{ toJSON(github.event) }} + extract-notes-under: "### Release notes" + release-dry-run: + needs: pr-info uses: ./.github/workflows/release-cli.yml if: github.event_name != 'pull_request' secrets: inherit From 59ba0cb92a807b6f46c8370062149e406443c4d0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 15 Jun 2024 10:02:21 +1000 Subject: [PATCH 1772/2020] Speedup compilation on windows (#1766) * Speedup compilation on windows Signed-off-by: Jiahao XU * Speedup CI on macOS Use lld Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .cargo/config.toml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 00000000..65dd5780 --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,16 @@ +[target.x86_64-pc-windows-msvc] +rustflags = ["-C", "link-arg=-fuse-ld=lld"] +[target.x86_64-pc-windows-gnu] +rustflags = ["-C", "link-arg=-fuse-ld=lld"] + +[target.aarch64-pc-windows-msvc] +rustflags = ["-C", "link-arg=-fuse-ld=lld"] +[target.aarch64-pc-windows-gnu] +rustflags = ["-C", "link-arg=-fuse-ld=lld"] + +[target.x86_64-apple-darwin] +rustflags = ["-C", "link-arg=-fuse-ld=lld"] +[target.x86_64h-apple-darwin] +rustflags = ["-C", "link-arg=-fuse-ld=lld"] +[target.aarch64-apple-darwin] +rustflags = ["-C", "link-arg=-fuse-ld=lld"] From 9891eac34cf12d32e7a6a4069901c04f38e89d55 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 15 Jun 2024 10:27:27 +1000 Subject: [PATCH 1773/2020] release: cargo-binstall v1.7.0 (#1765) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 70f96a48..4188da21 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -548,7 +548,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.6.9" +version = "1.7.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 398dd18e..605f225a 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.6.9" +version = "1.7.0" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 6468006d..2b019635 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From e3c8c4080679ec449d875815301a6708c920a282 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 15 Jun 2024 11:32:07 +1000 Subject: [PATCH 1774/2020] Run ci.yml every Monday (#1767) Just to keep the cache hot while making sure cargo-binstall can compile on latest stable/nightly rust Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 54f36d96..cd0afba6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,6 +14,8 @@ on: - opened - reopened - synchronize + schedule: + - cron: "0 3 * * 1" concurrency: group: ${{ github.workflow }}-${{ github.ref || github.event.pull_request.number || github.sha }}-${{ inputs.additional_key }} From fff6aa812252e6ac091c65568eefa315b88ec9f0 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sat, 15 Jun 2024 15:42:09 +1000 Subject: [PATCH 1775/2020] Improve use of github token (#1769) * Add new dep zeroize * Use Zeroizing to avoid leaking the token * Optimize gh-auth-token Spawn it as a task, and only await it when using GhApiClient * Fix binstalk-git-repo-api unit tests --- Cargo.lock | 3 + crates/bin/Cargo.toml | 1 + crates/bin/src/args.rs | 15 ++++- crates/bin/src/entry.rs | 61 +++++++++---------- crates/bin/src/gh_token.rs | 13 ++-- crates/bin/src/git_credentials.rs | 12 ++-- crates/binstalk-git-repo-api/Cargo.toml | 1 + .../src/gh_api_client.rs | 10 +-- crates/binstalk/Cargo.toml | 1 + crates/binstalk/src/helpers.rs | 1 + .../src/helpers/lazy_gh_api_client.rs | 53 ++++++++++++++++ crates/binstalk/src/ops.rs | 7 ++- crates/binstalk/src/ops/resolve.rs | 4 +- 13 files changed, 128 insertions(+), 54 deletions(-) create mode 100644 crates/binstalk/src/helpers/lazy_gh_api_client.rs diff --git a/Cargo.lock b/Cargo.lock index 4188da21..2b1d3b50 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -274,6 +274,7 @@ dependencies = [ "tokio", "tracing", "url", + "zeroize", ] [[package]] @@ -364,6 +365,7 @@ dependencies = [ "tracing", "tracing-subscriber", "url", + "zeroize", ] [[package]] @@ -573,6 +575,7 @@ dependencies = [ "tracing-log", "tracing-subscriber", "vergen", + "zeroize", ] [[package]] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 605f225a..592f36c6 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -43,6 +43,7 @@ tracing-core = "0.1.32" tracing = { version = "0.1.39", default-features = false } tracing-log = { version = "0.2.0", default-features = false } tracing-subscriber = { version = "0.3.17", features = ["fmt", "json", "ansi"], default-features = false } +zeroize = "1.8.1" [build-dependencies] embed-resource = "2.4.1" diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index d32ea65a..e81f1970 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -15,11 +15,11 @@ use binstalk::{ }; use clap::{error::ErrorKind, CommandFactory, Parser, ValueEnum}; use compact_str::CompactString; - use log::LevelFilter; use semver::VersionReq; use strum::EnumCount; use strum_macros::EnumCount; +use zeroize::Zeroizing; #[derive(Debug, Parser)] #[clap( @@ -308,7 +308,7 @@ pub struct Args { /// token from `$HOME/.git-credentials` or `$HOME/.config/gh/hosts.yml` /// unless `--no-discover-github-token` is specified. #[clap(help_heading = "Options", long, env = "GITHUB_TOKEN")] - pub(crate) github_token: Option, + pub(crate) github_token: Option, /// Only install packages that are signed /// @@ -365,6 +365,15 @@ pub struct Args { pub(crate) quiet: bool, } +#[derive(Debug, Clone)] +pub(crate) struct GithubToken(pub(crate) Zeroizing>); + +impl From<&str> for GithubToken { + fn from(s: &str) -> Self { + Self(Zeroizing::new(s.into())) + } +} + #[derive(Debug, Copy, Clone, ValueEnum)] pub(crate) enum TLSVersion { #[clap(name = "1.2")] @@ -575,7 +584,7 @@ You cannot use --{option} and specify multiple packages at the same time. Do one if opts.github_token.is_none() { if let Ok(github_token) = env::var("GH_TOKEN") { - opts.github_token = Some(github_token.into()); + opts.github_token = Some(GithubToken(Zeroizing::new(github_token.into()))); } } diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index e8e30079..48288aa2 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -9,8 +9,8 @@ use binstalk::{ fetchers::{Fetcher, GhCrateMeta, QuickInstall, SignaturePolicy}, get_desired_targets, helpers::{ - gh_api_client::GhApiClient, jobserver_client::LazyJobserverClient, + lazy_gh_api_client::LazyGhApiClient, remote::{Certificate, Client}, tasks::AutoAbortJoinHandle, }, @@ -27,7 +27,7 @@ use file_format::FileFormat; use home::cargo_home; use log::LevelFilter; use miette::{miette, Report, Result, WrapErr}; -use tokio::{runtime::Handle, task::block_in_place}; +use tokio::task::block_in_place; use tracing::{debug, error, info, warn}; use crate::{ @@ -82,28 +82,6 @@ pub fn install_crates( // Launch target detection let desired_targets = get_desired_targets(args.targets); - // Launch scraping of gh token - let no_discover_github_token = args.no_discover_github_token; - let github_token = args.github_token.or_else(|| { - if args.no_discover_github_token { - None - } else { - git_credentials::try_from_home() - } - }); - let get_gh_token_task = (github_token.is_none() && !no_discover_github_token).then(|| { - AutoAbortJoinHandle::spawn(async move { - match gh_token::get().await { - Ok(token) => Some(token), - Err(err) => { - debug!(?err, "Failed to retrieve token from `gh auth token`"); - debug!("Failed to read git credential file"); - None - } - } - }) - }); - // Computer cli_overrides let cli_overrides = PkgOverride { pkg_url: args.pkg_url, @@ -129,14 +107,33 @@ pub fn install_crates( ) .map_err(BinstallError::from)?; - let gh_api_client = GhApiClient::new( - client.clone(), - if let Some(task) = get_gh_token_task { - Handle::current().block_on(task)? - } else { - github_token - }, - ); + let gh_api_client = args + .github_token + .map(|token| token.0) + .or_else(|| { + if args.no_discover_github_token { + None + } else { + git_credentials::try_from_home() + } + }) + .map(|token| LazyGhApiClient::new(client.clone(), Some(token))) + .unwrap_or_else(|| { + if args.no_discover_github_token { + LazyGhApiClient::new(client.clone(), None) + } else { + LazyGhApiClient::with_get_gh_token_future(client.clone(), async { + match gh_token::get().await { + Ok(token) => Some(token), + Err(err) => { + debug!(?err, "Failed to retrieve token from `gh auth token`"); + debug!("Failed to read git credential file"); + None + } + } + }) + } + }); // Create binstall_opts let binstall_opts = Arc::new(Options { diff --git a/crates/bin/src/gh_token.rs b/crates/bin/src/gh_token.rs index b7a46655..837f9f95 100644 --- a/crates/bin/src/gh_token.rs +++ b/crates/bin/src/gh_token.rs @@ -1,12 +1,13 @@ use std::{ io, process::{Output, Stdio}, + str, }; -use compact_str::CompactString; use tokio::process::Command; +use zeroize::Zeroizing; -pub(super) async fn get() -> io::Result { +pub(super) async fn get() -> io::Result>> { let Output { status, stdout, .. } = Command::new("gh") .args(["auth", "token"]) .stdin(Stdio::null()) @@ -15,6 +16,8 @@ pub(super) async fn get() -> io::Result { .output() .await?; + let stdout = Zeroizing::new(stdout); + if !status.success() { return Err(io::Error::new( io::ErrorKind::Other, @@ -22,14 +25,12 @@ pub(super) async fn get() -> io::Result { )); } - // Use String here instead of CompactString here since - // `CompactString::from_utf8` allocates if it's longer than 24B. - let s = String::from_utf8(stdout).map_err(|err| { + let s = str::from_utf8(&stdout).map_err(|err| { io::Error::new( io::ErrorKind::InvalidData, format!("Invalid output, expected utf8: {err}"), ) })?; - Ok(s.trim().into()) + Ok(Zeroizing::new(s.trim().into())) } diff --git a/crates/bin/src/git_credentials.rs b/crates/bin/src/git_credentials.rs index d2e420f7..9c9a35ba 100644 --- a/crates/bin/src/git_credentials.rs +++ b/crates/bin/src/git_credentials.rs @@ -1,9 +1,9 @@ use std::{env, fs, path::PathBuf}; -use compact_str::CompactString; use dirs::home_dir; +use zeroize::Zeroizing; -pub fn try_from_home() -> Option { +pub fn try_from_home() -> Option>> { if let Some(mut home) = home_dir() { home.push(".git-credentials"); if let Some(cred) = from_file(home) { @@ -23,12 +23,12 @@ pub fn try_from_home() -> Option { None } -fn from_file(path: PathBuf) -> Option { - fs::read_to_string(path) - .ok()? +fn from_file(path: PathBuf) -> Option>> { + Zeroizing::new(fs::read_to_string(path).ok()?) .lines() .find_map(from_line) - .map(CompactString::from) + .map(Box::::from) + .map(Zeroizing::new) } fn from_line(line: &str) -> Option<&str> { diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index f2f0361f..0a807f61 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -22,6 +22,7 @@ thiserror = "1.0.52" tokio = { version = "1.35.0", features = ["sync"], default-features = false } tracing = "0.1.39" url = "2.3.1" +zeroize = "1.8.1" [dev-dependencies] binstalk-downloader = { version = "0.11.3", path = "../binstalk-downloader" } diff --git a/crates/binstalk-git-repo-api/src/gh_api_client.rs b/crates/binstalk-git-repo-api/src/gh_api_client.rs index 5823b53e..b2e3d6a3 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client.rs @@ -14,6 +14,7 @@ use compact_str::{format_compact, CompactString, ToCompactString}; use tokio::sync::OnceCell; use tracing::{instrument, Level}; use url::Url; +use zeroize::Zeroizing; mod common; mod error; @@ -129,7 +130,7 @@ struct Inner { release_artifacts: Map>>, retry_after: Mutex>, - auth_token: Option, + auth_token: Option>>, is_auth_token_valid: AtomicBool, only_use_restful_api: AtomicBool, @@ -141,7 +142,7 @@ struct Inner { pub struct GhApiClient(Arc); impl GhApiClient { - pub fn new(client: remote::Client, auth_token: Option) -> Self { + pub fn new(client: remote::Client, auth_token: Option>>) -> Self { Self(Arc::new(Inner { client, release_artifacts: Default::default(), @@ -184,7 +185,7 @@ impl GhApiClient { fn get_auth_token(&self) -> Option<&str> { if self.0.is_auth_token_valid.load(Relaxed) { - self.0.auth_token.as_deref() + self.0.auth_token.as_deref().map(|s| &**s) } else { None } @@ -526,7 +527,8 @@ mod test { let auth_token = env::var("CI_UNIT_TEST_GITHUB_TOKEN") .ok() - .map(CompactString::from); + .map(Box::::from) + .map(zeroize::Zeroizing::new); let gh_client = GhApiClient::new(client.clone(), auth_token.clone()); gh_client.set_only_use_restful_api(); diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index fc39d74a..7ad056e8 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -43,6 +43,7 @@ tokio = { version = "1.35.0", features = [ ], default-features = false } tracing = "0.1.39" url = { version = "2.3.1", features = ["serde"] } +zeroize = "1.8.1" [features] default = ["static", "rustls", "git"] diff --git a/crates/binstalk/src/helpers.rs b/crates/binstalk/src/helpers.rs index 4e5792e6..5222f440 100644 --- a/crates/binstalk/src/helpers.rs +++ b/crates/binstalk/src/helpers.rs @@ -3,6 +3,7 @@ pub mod remote { pub use binstalk_downloader::remote::*; pub use url::ParseError as UrlParseError; } +pub mod lazy_gh_api_client; pub(crate) mod target_triple; pub mod tasks; diff --git a/crates/binstalk/src/helpers/lazy_gh_api_client.rs b/crates/binstalk/src/helpers/lazy_gh_api_client.rs new file mode 100644 index 00000000..26869e91 --- /dev/null +++ b/crates/binstalk/src/helpers/lazy_gh_api_client.rs @@ -0,0 +1,53 @@ +use std::{future::Future, sync::Mutex}; + +use binstalk_git_repo_api::gh_api_client::GhApiClient; +use tokio::sync::OnceCell; +use zeroize::Zeroizing; + +use crate::{ + errors::BinstallError, + helpers::{remote, tasks::AutoAbortJoinHandle}, +}; + +pub type GitHubToken = Option>>; + +#[derive(Debug)] +pub struct LazyGhApiClient { + client: remote::Client, + inner: OnceCell, + task: Mutex>>, +} + +impl LazyGhApiClient { + pub fn new(client: remote::Client, auth_token: GitHubToken) -> Self { + Self { + inner: OnceCell::new_with(Some(GhApiClient::new(client.clone(), auth_token))), + client, + task: Mutex::new(None), + } + } + + pub fn with_get_gh_token_future(client: remote::Client, get_auth_token_future: Fut) -> Self + where + Fut: Future + Send + Sync + 'static, + { + Self { + inner: OnceCell::new(), + task: Mutex::new(Some(AutoAbortJoinHandle::spawn(get_auth_token_future))), + client, + } + } + + pub async fn get(&self) -> Result<&GhApiClient, BinstallError> { + self.inner + .get_or_try_init(|| async { + let task = self.task.lock().unwrap().take(); + Ok(if let Some(task) = task { + GhApiClient::new(self.client.clone(), task.await?) + } else { + GhApiClient::new(self.client.clone(), None) + }) + }) + .await + } +} diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index 66366be6..ae810a3d 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -6,7 +6,10 @@ use semver::VersionReq; use crate::{ fetchers::{Data, Fetcher, SignaturePolicy, TargetDataErased}, - helpers::{gh_api_client::GhApiClient, jobserver_client::LazyJobserverClient, remote::Client}, + helpers::{ + gh_api_client::GhApiClient, jobserver_client::LazyJobserverClient, + lazy_gh_api_client::LazyGhApiClient, remote::Client, + }, manifests::cargo_toml_binstall::PkgOverride, registry::Registry, DesiredTargets, @@ -47,7 +50,7 @@ pub struct Options { pub cargo_root: Option, pub client: Client, - pub gh_api_client: GhApiClient, + pub gh_api_client: LazyGhApiClient, pub jobserver_client: LazyJobserverClient, pub registry: Registry, diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 0ab49faf..805bfb4a 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -106,6 +106,8 @@ async fn resolve_inner( }, ); + let gh_api_client = opts.gh_api_client.get().await?; + let mut handles_fn = |data: Arc, filter_fetcher_by_name_predicate: fn(&'static str) -> bool| { handles.extend( @@ -132,7 +134,7 @@ async fn resolve_inner( .filter_map(|(f, target_data)| { let fetcher = f( opts.client.clone(), - opts.gh_api_client.clone(), + gh_api_client.clone(), data.clone(), target_data, opts.signature_policy, From ed31bc17e53d3c00c04b97a95f94d78e00a846b3 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 15 Jun 2024 16:02:41 +1000 Subject: [PATCH 1776/2020] release: binstalk-git-repo-api v0.2.0 (#1771) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-git-repo-api/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2b1d3b50..f5964b9a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -351,7 +351,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.1.1" +version = "0.2.0" dependencies = [ "binstalk-downloader", "compact_str", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 7940e862..e4ba78b3 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" binstalk-downloader = { version = "0.11.3", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.1.1", path = "../binstalk-git-repo-api" } +binstalk-git-repo-api = { version = "0.2.0", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 0a807f61..3e2e25f3 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.1.1" +version = "0.2.0" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 7ad056e8..c05bf4ae 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.11.3", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.1.1", path = "../binstalk-git-repo-api" } +binstalk-git-repo-api = { version = "0.2.0", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.5.1", path = "../binstalk-fetchers", features = [ "quickinstall", ] } From 08f66b0083b35b796d0718260e374c37d6791e29 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 15 Jun 2024 16:36:08 +1000 Subject: [PATCH 1777/2020] release: binstalk-fetchers v0.6.0 (#1772) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f5964b9a..c7556660 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -327,7 +327,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.5.1" +version = "0.6.0" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index e4ba78b3..cbfb488f 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.5.1" +version = "0.6.0" edition = "2021" description = "The binstall fetchers" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index c05bf4ae..222405af 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.11.3", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.2.0", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.5.1", path = "../binstalk-fetchers", features = [ +binstalk-fetchers = { version = "0.6.0", path = "../binstalk-fetchers", features = [ "quickinstall", ] } binstalk-registry = { version = "0.9.1", path = "../binstalk-registry" } From 6ed611c66e10f4a76c5699248a3fac9800c12de5 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 15 Jun 2024 07:00:10 +0000 Subject: [PATCH 1778/2020] release: binstalk v0.25.0 (#1773) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c7556660..a41c27ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -247,7 +247,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.24.1" +version = "0.25.0" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 592f36c6..0e5f9269 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.24.1", default-features = false } +binstalk = { path = "../binstalk", version = "0.25.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.13.0" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 222405af..a2e6c3d1 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.24.1" +version = "0.25.0" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" From 0d7080e6a9e1ca43a37026b52683e367c416c87f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 15 Jun 2024 07:27:29 +0000 Subject: [PATCH 1779/2020] release: cargo-binstall v1.7.1 (#1774) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a41c27ed..175c851d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -550,7 +550,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.7.0" +version = "1.7.1" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 0e5f9269..cf15c239 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.7.0" +version = "1.7.1" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 2b019635..7b416a68 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From b9e8267cecf353affe45b659973817dec7c2fdbf Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 16 Jun 2024 01:08:25 +1000 Subject: [PATCH 1780/2020] Speedup Linux CI (#1775) * Speedup Linux CI Use transparent huge page, according to https://kobzol.github.io/rust/rustc/2023/10/21/make-rust-compiler-5percent-faster.html it gives a nice 5% speedup Signed-off-by: Jiahao XU * Fix action.yml Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .github/actions/just-setup/action.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/actions/just-setup/action.yml b/.github/actions/just-setup/action.yml index 6d279257..6ab5176f 100644 --- a/.github/actions/just-setup/action.yml +++ b/.github/actions/just-setup/action.yml @@ -123,3 +123,13 @@ runs: - run: make -v shell: bash + + - name: Enable transparent huge page + if: runner.os == 'Linux' + run: echo madvise | sudo tee /sys/kernel/mm/transparent_hugepage/enabled + shell: bash + + - name: Configure jemalloc (used by rustc) to use transparent huge page + if: runner.os == 'Linux' + run: echo "MALLOC_CONF=thp:always,metadata_thp:always" >> "$GITHUB_ENV" + shell: bash From 3505b6ae5bd2fa3b0a43d5611441f2cfee7a17ec Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Sun, 16 Jun 2024 01:39:14 +1000 Subject: [PATCH 1781/2020] Fix docs.rs build of binstalk-downloader (#1776) Fixed docs.rs build Signed-off-by: Jiahao XU --- crates/binstalk-downloader/Cargo.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 18eb45f7..60a9b677 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -132,5 +132,4 @@ default-net = { version = "0.22.0", optional = true } ipconfig = { version = "0.3.2", optional = true, default-features = false } [package.metadata.docs.rs] -features = ["gh-api-client"] rustdoc-args = ["--cfg", "docsrs"] From ee16116583d89064fb48218b93329843765fc4a7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 15 Jun 2024 16:05:37 +0000 Subject: [PATCH 1782/2020] release: binstalk-downloader v0.11.4 (#1777) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-git-repo-api/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 175c851d..8f1d730e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -293,7 +293,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.11.3" +version = "0.11.4" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 60a9b677..53693587 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.11.3" +version = "0.11.4" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index cbfb488f..fa1aced8 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.11.3", path = "../binstalk-downloader", default-features = false } +binstalk-downloader = { version = "0.11.4", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.2.0", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.11.3", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.11.4", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 3e2e25f3..edb5ef13 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.11.3", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.11.4", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.7.0" @@ -25,6 +25,6 @@ url = "2.3.1" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.11.3", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.11.4", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 0a161fcc..caf6f6db 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.11.3", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.11.4", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } @@ -40,7 +40,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.11.3", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.11.4", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index a2e6c3d1..ff3110e2 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.11.3", path = "../binstalk-downloader", default-features = false } +binstalk-downloader = { version = "0.11.4", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.2.0", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.6.0", path = "../binstalk-fetchers", features = [ "quickinstall", From fc1117d0e4b70544ab3ffe021651cd848c81628e Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 18 Jun 2024 21:58:51 +1000 Subject: [PATCH 1783/2020] Disable use of lld (#1782) * Update justfile to use lld on macOS and Linux When cargo-zigbuild is not used Signed-off-by: Jiahao XU * Delete .cargo/config.toml Signed-off-by: Jiahao XU * Update justfile to use lld as long as cargo-zigbuild isn't used Signed-off-by: Jiahao XU * Disable lld again Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- .cargo/config.toml | 16 ---------------- justfile | 4 +--- 2 files changed, 1 insertion(+), 19 deletions(-) delete mode 100644 .cargo/config.toml diff --git a/.cargo/config.toml b/.cargo/config.toml deleted file mode 100644 index 65dd5780..00000000 --- a/.cargo/config.toml +++ /dev/null @@ -1,16 +0,0 @@ -[target.x86_64-pc-windows-msvc] -rustflags = ["-C", "link-arg=-fuse-ld=lld"] -[target.x86_64-pc-windows-gnu] -rustflags = ["-C", "link-arg=-fuse-ld=lld"] - -[target.aarch64-pc-windows-msvc] -rustflags = ["-C", "link-arg=-fuse-ld=lld"] -[target.aarch64-pc-windows-gnu] -rustflags = ["-C", "link-arg=-fuse-ld=lld"] - -[target.x86_64-apple-darwin] -rustflags = ["-C", "link-arg=-fuse-ld=lld"] -[target.x86_64h-apple-darwin] -rustflags = ["-C", "link-arg=-fuse-ld=lld"] -[target.aarch64-apple-darwin] -rustflags = ["-C", "link-arg=-fuse-ld=lld"] diff --git a/justfile b/justfile index 97e0201e..aa60dfd0 100644 --- a/justfile +++ b/justfile @@ -133,10 +133,8 @@ rustc-miropt := "" # if for-release != "" { " -Z mir-opt-level=4" } else { "" } # This option is disabled on windows since it not supported. rust-lld := "" #if use-cargo-zigbuild != "" { #"" -#} else if target-os != "windows" { -#" -Z gcc-ld=lld" #} else { -#"" +#" -C link-arg=-fuse-ld=lld" #} # ICF: link-time identical code folding From ef7ca1ba9f997face1b09f6369a3d67d956e8dd2 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Tue, 18 Jun 2024 23:30:23 +1000 Subject: [PATCH 1784/2020] Re enable h3 in reqwest and remove impl `Sync` on returned Future in `binstalk-git-repo-api` (#1783) * Upgrade transitive dependencies Signed-off-by: Jiahao XU * Re-enable h3 Signed-off-by: Jiahao XU * Fix `binstalk-git-repo-api` Remove `Sync` bound on returned `Future`, since `tokio::spawn` does not require it Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- Cargo.lock | 157 +++++++++++++----- crates/binstalk-downloader/Cargo.toml | 5 +- .../src/gh_api_client.rs | 4 +- .../src/gh_api_client/common.rs | 4 +- .../src/gh_api_client/release_artifacts.rs | 4 +- .../src/gh_api_client/repo_info.rs | 4 +- 6 files changed, 130 insertions(+), 48 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8f1d730e..b47111ad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -617,9 +617,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.20.2" +version = "0.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8cb1d556b8b8f36e5ca74938008be3ac102f5dcb5b68a0477e4249ae2291cd3" +checksum = "4895c018bb228aa6b3ba1a0285543fcb4b704734c3fb1f72afaa75aa769500c1" dependencies = [ "serde", "toml", @@ -2104,6 +2104,21 @@ dependencies = [ "tracing", ] +[[package]] +name = "h3" +version = "0.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5069de1c2ac82d9e361b07f2b8a2c582ec071750e063530fc7f3b5197e24805" +dependencies = [ + "bytes", + "fastrand 2.1.0", + "futures-util", + "http 1.1.0", + "pin-project-lite", + "tokio", + "tracing", +] + [[package]] name = "h3-quinn" version = "0.0.3" @@ -2112,9 +2127,23 @@ checksum = "2d4a1a1763e4f3e82ee9f1ecf2cf862b22cc7316ebe14684e42f94532b5ec64d" dependencies = [ "bytes", "futures", - "h3", - "quinn", - "quinn-proto", + "h3 0.0.2", + "quinn 0.10.2", + "quinn-proto 0.10.6", + "tokio-util", +] + +[[package]] +name = "h3-quinn" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8c01d99d7cf812fd34ddf135e6c940df9e24f2e759dbc7179fb0e54d4bd6551" +dependencies = [ + "bytes", + "futures", + "h3 0.0.5", + "quinn 0.11.2", + "tokio", "tokio-util", ] @@ -2161,14 +2190,14 @@ dependencies = [ "futures-io", "futures-util", "h2 0.3.26", - "h3", - "h3-quinn", + "h3 0.0.2", + "h3-quinn 0.0.3", "http 0.2.12", "idna 0.4.0", "ipnet", "native-tls", "once_cell", - "quinn", + "quinn 0.10.2", "rand", "ring 0.16.20", "rustls 0.21.12", @@ -2273,9 +2302,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.3" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0e7a4dd27b9476dc40cb050d3632d3bba3a70ddbff012285f7f8559a1e7e545" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -2311,19 +2340,21 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.26.0" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0bea761b46ae2b24eb4aef630d8d1c398157b6fc29e6350ecf090a0b70c952c" +checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", "http 1.1.0", "hyper", "hyper-util", - "rustls 0.22.4", + "rustls 0.23.10", + "rustls-native-certs", "rustls-pki-types", "tokio", - "tokio-rustls 0.25.0", + "tokio-rustls 0.26.0", "tower-service", + "webpki-roots", ] [[package]] @@ -2847,9 +2878,9 @@ checksum = "933dca44d65cdd53b355d0b73d380a2ff5da71f87f036053188bf1eab6a19881" [[package]] name = "miniz_oxide" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd01fe195c66b572b37921ad8803d010623c0aca821bea2302239d155cdae" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" dependencies = [ "adler", ] @@ -3081,7 +3112,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.1", + "redox_syscall 0.5.2", "smallvec", "windows-targets 0.52.5", ] @@ -3181,8 +3212,8 @@ checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" dependencies = [ "bytes", "pin-project-lite", - "quinn-proto", - "quinn-udp", + "quinn-proto 0.10.6", + "quinn-udp 0.4.1", "rustc-hash", "rustls 0.21.12", "thiserror", @@ -3190,6 +3221,24 @@ dependencies = [ "tracing", ] +[[package]] +name = "quinn" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +dependencies = [ + "bytes", + "futures-io", + "pin-project-lite", + "quinn-proto 0.11.3", + "quinn-udp 0.5.2", + "rustc-hash", + "rustls 0.23.10", + "thiserror", + "tokio", + "tracing", +] + [[package]] name = "quinn-proto" version = "0.10.6" @@ -3207,6 +3256,23 @@ dependencies = [ "tracing", ] +[[package]] +name = "quinn-proto" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +dependencies = [ + "bytes", + "rand", + "ring 0.17.8", + "rustc-hash", + "rustls 0.23.10", + "slab", + "thiserror", + "tinyvec", + "tracing", +] + [[package]] name = "quinn-udp" version = "0.4.1" @@ -3220,6 +3286,19 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "quinn-udp" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +dependencies = [ + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.52.0", +] + [[package]] name = "quote" version = "1.0.36" @@ -3299,9 +3378,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "469052894dcb553421e483e4209ee581a45100d31b4018de03e5a7ad86374a7e" +checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ "bitflags 2.5.0", ] @@ -3359,9 +3438,9 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "566cafdd92868e0939d3fb961bd0dc25fcfaaed179291093b3d43e6b3150ea10" +checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ "async-compression", "base64 0.22.1", @@ -3371,6 +3450,8 @@ dependencies = [ "futures-core", "futures-util", "h2 0.4.5", + "h3 0.0.5", + "h3-quinn 0.0.6", "http 1.1.0", "http-body", "http-body-util", @@ -3386,18 +3467,20 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.22.4", + "quinn 0.11.2", + "rustls 0.23.10", "rustls-native-certs", "rustls-pemfile 2.1.2", "rustls-pki-types", "serde", "serde_json", "serde_urlencoded", + "slab", "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls 0.25.0", + "tokio-rustls 0.26.0", "tokio-util", "tower-service", "url", @@ -3497,11 +3580,11 @@ dependencies = [ [[package]] name = "rustls" -version = "0.22.4" +version = "0.23.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ef73721ac7bcd79b2b315da7779d8fc09718c6b3d2d1b2d94850eb8c18432" +checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" dependencies = [ - "log", + "once_cell", "ring 0.17.8", "rustls-pki-types", "rustls-webpki 0.102.4", @@ -3903,9 +3986,9 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "0.1.2" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" [[package]] name = "synstructure" @@ -4117,11 +4200,11 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "775e0c0f0adb3a2f22a00c4745d728b479985fc15ee7ca6a2608388c5569860f" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.22.4", + "rustls 0.23.10", "rustls-pki-types", "tokio", ] @@ -4569,9 +4652,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c452ad30530b54a4d8e71952716a212b08efd0f3562baa66c29a618b07da7c3" +checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" dependencies = [ "rustls-pki-types", ] @@ -4988,9 +5071,9 @@ dependencies = [ [[package]] name = "zstd-sys" -version = "2.0.10+zstd.1.5.6" +version = "2.0.11+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c253a4914af5bafc8fa8c86ee400827e83cf6ec01195ec1f1ed8441bf00d65aa" +checksum = "75652c55c0b6f3e6f12eb786fe1bc960396bf05a1eb3bf1f3691c3610ac2e6d4" dependencies = [ "cc", "pkg-config", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 53693587..ba76c66c 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -35,7 +35,7 @@ flate2 = { version = "1.0.28", default-features = false } futures-util = "0.3.30" futures-io = "0.3.30" httpdate = "1.0.2" -reqwest = { version = "0.12.4", features = [ +reqwest = { version = "0.12.5", features = [ "http2", "stream", "zstd", @@ -118,8 +118,7 @@ trust-dns = ["hickory-dns"] # # Experimental HTTP/3 client, this would require `--cfg reqwest_unstable` # to be passed to `rustc`. -#http3 = ["reqwest/http3"] -http3 = [] +http3 = ["reqwest/http3"] zstd-thin = ["zstd/thin"] diff --git a/crates/binstalk-git-repo-api/src/gh_api_client.rs b/crates/binstalk-git-repo-api/src/gh_api_client.rs index b2e3d6a3..5b6420cf 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client.rs @@ -204,8 +204,8 @@ impl GhApiClient { where GraphQLFn: Fn(&remote::Client, &T, &str) -> GraphQLFut, RestfulFn: Fn(&remote::Client, &T, Option<&str>) -> RestfulFut, - GraphQLFut: Future> + Send + Sync + 'static, - RestfulFut: Future> + Send + Sync + 'static, + GraphQLFut: Future> + Send + 'static, + RestfulFut: Future> + Send + 'static, { self.check_retry_after()?; diff --git a/crates/binstalk-git-repo-api/src/gh_api_client/common.rs b/crates/binstalk-git-repo-api/src/gh_api_client/common.rs index 35048e58..723834ec 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client/common.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client/common.rs @@ -39,7 +39,7 @@ pub(super) fn issue_restful_api( client: &remote::Client, path: &[&str], auth_token: Option<&str>, -) -> impl Future> + Send + Sync + 'static +) -> impl Future> + Send + 'static where T: DeserializeOwned, { @@ -95,7 +95,7 @@ pub(super) fn issue_graphql_query( client: &remote::Client, query: String, auth_token: &str, -) -> impl Future> + Send + Sync + 'static +) -> impl Future> + Send + 'static where T: DeserializeOwned + Debug, { diff --git a/crates/binstalk-git-repo-api/src/gh_api_client/release_artifacts.rs b/crates/binstalk-git-repo-api/src/gh_api_client/release_artifacts.rs index d11e2401..5b738842 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client/release_artifacts.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client/release_artifacts.rs @@ -74,7 +74,7 @@ pub(super) fn fetch_release_artifacts_restful_api( tag, }: &GhRelease, auth_token: Option<&str>, -) -> impl Future> + Send + Sync + 'static { +) -> impl Future> + Send + 'static { issue_restful_api( client, &["repos", owner, repo, "releases", "tags", tag], @@ -135,7 +135,7 @@ pub(super) fn fetch_release_artifacts_graphql_api( tag, }: &GhRelease, auth_token: &str, -) -> impl Future> + Send + Sync + 'static { +) -> impl Future> + Send + 'static { let client = client.clone(); let auth_token = auth_token.to_compact_string(); diff --git a/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs b/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs index ac5c08cc..d95cca81 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client/repo_info.rs @@ -55,7 +55,7 @@ pub(super) fn fetch_repo_info_restful_api( client: &remote::Client, GhRepo { owner, repo }: &GhRepo, auth_token: Option<&str>, -) -> impl Future, GhApiError>> + Send + Sync + 'static { +) -> impl Future, GhApiError>> + Send + 'static { issue_restful_api(client, &["repos", owner, repo], auth_token) } @@ -68,7 +68,7 @@ pub(super) fn fetch_repo_info_graphql_api( client: &remote::Client, GhRepo { owner, repo }: &GhRepo, auth_token: &str, -) -> impl Future, GhApiError>> + Send + Sync + 'static { +) -> impl Future, GhApiError>> + Send + 'static { let query = format!( r#" query {{ From 4bd5e79115f83ea0350d3cdf28d41c2486341fa8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:21:59 +0000 Subject: [PATCH 1785/2020] release: binstalk-downloader v0.11.5 (#1784) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-git-repo-api/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b47111ad..8a87f032 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -293,7 +293,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.11.4" +version = "0.11.5" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index ba76c66c..cb1635ab 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.11.4" +version = "0.11.5" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index fa1aced8..2a003a21 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.11.4", path = "../binstalk-downloader", default-features = false } +binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.2.0", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.11.4", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index edb5ef13..990fbb2f 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.11.4", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.7.0" @@ -25,6 +25,6 @@ url = "2.3.1" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.11.4", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index caf6f6db..727e3c5e 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.11.4", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } @@ -40,7 +40,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.11.4", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index ff3110e2..a5aba05f 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.11.4", path = "../binstalk-downloader", default-features = false } +binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.2.0", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.6.0", path = "../binstalk-fetchers", features = [ "quickinstall", From 384789d1c90ae23434bc29a163a00f737ef999ca Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 18 Jun 2024 14:44:56 +0000 Subject: [PATCH 1786/2020] release: binstalk-git-repo-api v0.3.0 (#1785) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-git-repo-api/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8a87f032..988e0d5e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -351,7 +351,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.2.0" +version = "0.3.0" dependencies = [ "binstalk-downloader", "compact_str", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 2a003a21..ff86dc4c 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.2.0", path = "../binstalk-git-repo-api" } +binstalk-git-repo-api = { version = "0.3.0", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.7.0" } diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 990fbb2f..5f450329 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.2.0" +version = "0.3.0" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index a5aba05f..83c50493 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.2.0", path = "../binstalk-git-repo-api" } +binstalk-git-repo-api = { version = "0.3.0", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.6.0", path = "../binstalk-fetchers", features = [ "quickinstall", ] } From 9fdd1ad32a3f04b3932a212cda4845b6febe4128 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 18:03:02 +1000 Subject: [PATCH 1787/2020] release: binstalk-fetchers v0.7.0 (#1786) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 988e0d5e..536dd179 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -327,7 +327,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.6.0" +version = "0.7.0" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index ff86dc4c..877162cf 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.6.0" +version = "0.7.0" edition = "2021" description = "The binstall fetchers" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 83c50493..e43e5ce2 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.3.0", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.6.0", path = "../binstalk-fetchers", features = [ +binstalk-fetchers = { version = "0.7.0", path = "../binstalk-fetchers", features = [ "quickinstall", ] } binstalk-registry = { version = "0.9.1", path = "../binstalk-registry" } From 374fc45b61fd453c2200877253808020584ece82 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Wed, 19 Jun 2024 18:48:47 +1000 Subject: [PATCH 1788/2020] Bump cargo-bins/release-pr from 2.1.1 to 2.1.2 (#1787) To reduce action output Signed-off-by: Jiahao XU --- .github/workflows/release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 3230671f..dd8ec5ca 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -48,7 +48,7 @@ jobs: tool: cargo-release,cargo-semver-checks - run: rustup toolchain install stable --no-self-update --profile minimal - - uses: cargo-bins/release-pr@v2.1.1 + - uses: cargo-bins/release-pr@v2.1.2 with: github-token: ${{ secrets.GITHUB_TOKEN }} version: ${{ inputs.version }} From c49072c5652a20d8717ac9f03410f652751ced7d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 13:15:52 +0000 Subject: [PATCH 1789/2020] build(deps): bump cargo-bins/release-pr from 2.1.2 to 2.1.3 (#1788) Bumps [cargo-bins/release-pr](https://github.com/cargo-bins/release-pr) from 2.1.2 to 2.1.3. - [Release notes](https://github.com/cargo-bins/release-pr/releases) - [Commits](https://github.com/cargo-bins/release-pr/compare/v2.1.2...v2.1.3) --- updated-dependencies: - dependency-name: cargo-bins/release-pr dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index dd8ec5ca..e51104c5 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -48,7 +48,7 @@ jobs: tool: cargo-release,cargo-semver-checks - run: rustup toolchain install stable --no-self-update --profile minimal - - uses: cargo-bins/release-pr@v2.1.2 + - uses: cargo-bins/release-pr@v2.1.3 with: github-token: ${{ secrets.GITHUB_TOKEN }} version: ${{ inputs.version }} From 45b25fede5d1bf391984d990a2e9a68ef1823a6b Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 20 Jun 2024 00:07:23 +1000 Subject: [PATCH 1790/2020] CI: Allow semver-check in `release-pr.yml` to be disabled via inputs (#1789) In case buliding of previous version fail due to new releases in upstream. Signed-off-by: Jiahao XU --- .github/workflows/release-pr.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index e51104c5..238f2fa4 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -27,6 +27,11 @@ on: required: true type: string default: patch + no-check-semver: + description: Whether to check semver + required: true + type: string + default: "false" jobs: make-release-pr: @@ -56,7 +61,7 @@ jobs: pr-label: release pr-release-notes: ${{ inputs.crate == 'bin' }} pr-template-file: .github/scripts/release-pr-template.ejs - check-semver: ${{ inputs.crate != 'bin' && inputs.crate != 'leon-macros' }} + check-semver: ${{ inputs.crate != 'bin' && inputs.no-check-semver != 'true' }} check-package: true env: RUSTFLAGS: --cfg reqwest_unstable From 050c337da12837ce3695c9cbb04e4d86154573b7 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 20 Jun 2024 00:29:09 +1000 Subject: [PATCH 1791/2020] Fix typo in release-pr.yml inputs (#1790) Stupid mistakes introduced in #1789 Signed-off-by: Jiahao XU --- .github/workflows/release-pr.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 238f2fa4..3a43ef2c 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -28,7 +28,7 @@ on: type: string default: patch no-check-semver: - description: Whether to check semver + description: To disable check semver required: true type: string default: "false" From 77565d8e4054f07023b5dfa96259e5931d630e3d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 10:30:15 +1000 Subject: [PATCH 1792/2020] release: binstalk v0.26.0 (#1791) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 536dd179..e422efb9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -247,7 +247,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.25.0" +version = "0.26.0" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index cf15c239..cfc738c0 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.25.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.26.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.13.0" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index e43e5ce2..afb98bca 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.25.0" +version = "0.26.0" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" From 1b21c1d468ae6b3fbc797d2abcbeaf8dd8783362 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Thu, 20 Jun 2024 20:12:26 +1000 Subject: [PATCH 1793/2020] Include instruction to install using homebrew (#1793) * Include instruction to install using homebrew cargo-binstall is now in homebrew-core, so update our REAMDE to reflect that! Signed-off-by: Jiahao XU * Update README.md - Fix typo - Add link to homebrew Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- README.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README.md b/README.md index fb4f05b8..c4abb998 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,12 @@ Here are one-liners for downloading and installing a pre-compiled `cargo-binstal curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash ``` +or if you have [homebrew](https://brew.sh/) installed: + +``` +brew install cargo-binstall +``` + #### Windows ``` From c8fc23b4b58e7bd14a660d25da03c24a7e009845 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 20 Jun 2024 20:40:44 +1000 Subject: [PATCH 1794/2020] release: cargo-binstall v1.7.2 (#1792) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e422efb9..2839c916 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -550,7 +550,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.7.1" +version = "1.7.2" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index cfc738c0..f0fbbf97 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.7.1" +version = "1.7.2" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 7b416a68..a0376911 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From ebdca1126ebdd15d62a7241fe9e8ad22c4e695f7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 21 Jun 2024 03:53:44 +0000 Subject: [PATCH 1795/2020] dep: Upgrade transitive dependencies (#1794) Co-authored-by: github-actions --- Cargo.lock | 281 +++-------------------------------------------------- 1 file changed, 13 insertions(+), 268 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2839c916..40b334d2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -937,17 +937,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "displaydoc" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "487585f4d0c6655fe74905e2504d8ad6908e4db67f744eb140876906c2f3175d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "dlopen2" version = "0.5.0" @@ -2393,124 +2382,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "icu_collections" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" -dependencies = [ - "displaydoc", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_locid" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" -dependencies = [ - "displaydoc", - "litemap", - "tinystr", - "writeable", - "zerovec", -] - -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - -[[package]] -name = "icu_normalizer" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_normalizer_data", - "icu_properties", - "icu_provider", - "smallvec", - "utf16_iter", - "utf8_iter", - "write16", - "zerovec", -] - -[[package]] -name = "icu_normalizer_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" - -[[package]] -name = "icu_properties" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f8ac670d7422d7f76b32e17a5db556510825b29ec9154f235977c9caba61036" -dependencies = [ - "displaydoc", - "icu_collections", - "icu_locid_transform", - "icu_properties_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_properties_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" - -[[package]] -name = "icu_provider" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_provider_macros", - "stable_deref_trait", - "tinystr", - "writeable", - "yoke", - "zerofrom", - "zerovec", -] - -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "idna" version = "0.4.0" @@ -2523,14 +2394,12 @@ dependencies = [ [[package]] name = "idna" -version = "1.0.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4716a3a0933a1d01c2f72450e89596eb51dd34ef3c211ccd875acdf1f8fe47ed" +checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" dependencies = [ - "icu_normalizer", - "icu_properties", - "smallvec", - "utf8_iter", + "unicode-bidi", + "unicode-normalization", ] [[package]] @@ -2735,12 +2604,6 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" -[[package]] -name = "litemap" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" - [[package]] name = "lock_api" version = "0.4.12" @@ -3181,9 +3044,9 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.85" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22244ce15aa966053a896d1accb3a6e68469b97c7f33f284b99f0d576879fc23" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] @@ -3909,12 +3772,6 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -[[package]] -name = "stable_deref_trait" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" - [[package]] name = "static_assertions" version = "1.1.0" @@ -3948,9 +3805,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" +checksum = "0d0208408ba0c3df17ed26eb06992cb1a1268d41b2c0e12e65203fbe3972cee5" [[package]] name = "supports-color" @@ -3975,9 +3832,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.66" +version = "2.0.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" dependencies = [ "proc-macro2", "quote", @@ -3990,17 +3847,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" -[[package]] -name = "synstructure" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "system-configuration" version = "0.5.1" @@ -4124,16 +3970,6 @@ dependencies = [ "time-core", ] -[[package]] -name = "tinystr" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" -dependencies = [ - "displaydoc", - "zerovec", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -4455,28 +4291,16 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.1" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c25da092f0a868cdf09e8674cd3b7ef3a7d92a24253e663a2fb85e2496de56" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", - "idna 1.0.0", + "idna 0.5.0", "percent-encoding", "serde", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - -[[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" @@ -4926,18 +4750,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - -[[package]] -name = "writeable" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" - [[package]] name = "xattr" version = "1.3.1" @@ -4958,30 +4770,6 @@ dependencies = [ "lzma-sys", ] -[[package]] -name = "yoke" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" -dependencies = [ - "serde", - "stable_deref_trait", - "yoke-derive", - "zerofrom", -] - -[[package]] -name = "yoke-derive" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - [[package]] name = "zerocopy" version = "0.7.34" @@ -5002,55 +4790,12 @@ dependencies = [ "syn", ] -[[package]] -name = "zerofrom" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" -dependencies = [ - "zerofrom-derive", -] - -[[package]] -name = "zerofrom-derive" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "synstructure", -] - [[package]] name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" -[[package]] -name = "zerovec" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb2cc8827d6c0994478a15c53f374f46fbd41bea663d809b14744bc42e6b109c" -dependencies = [ - "yoke", - "zerofrom", - "zerovec-derive", -] - -[[package]] -name = "zerovec-derive" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97cf56601ee5052b4417d90c8755c6683473c926039908196cf35d99f893ebe7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "zstd" version = "0.13.1" From ac7bac651df718620c61e67d131e29feae92a83a Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sun, 23 Jun 2024 20:42:03 +1000 Subject: [PATCH 1796/2020] Run artifact discover in sequential instead of in parallel (#1796) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Perform artifact discovery in sequential Run different `fetcher.find()` in sequential * FuturesResolver: Fallback to other future if one error * Fix typo * Apply cargo fmt * Parallelise `::find` Check for signature in parallel to the package * Download signature in `::find` So that the signature download can be done in parallel. * Bump msrv for binstalk-fetchers to 1.70 * Update crates/binstalk-fetchers/src/futures_resolver.rs Co-authored-by: Félix Saparelli Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * cargo fmt Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Signed-off-by: Jiahao XU Co-authored-by: Félix Saparelli --- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-fetchers/src/common.rs | 41 ++++++- .../binstalk-fetchers/src/futures_resolver.rs | 18 +++- crates/binstalk-fetchers/src/gh_crate_meta.rs | 2 +- crates/binstalk-fetchers/src/lib.rs | 5 +- crates/binstalk-fetchers/src/quickinstall.rs | 102 +++++++++++------- crates/binstalk/src/ops/resolve.rs | 12 ++- 7 files changed, 128 insertions(+), 54 deletions(-) diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 877162cf..37bd254e 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" description = "The binstall fetchers" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-fetchers" -rust-version = "1.65.0" +rust-version = "1.70.0" authors = ["Jiahao XU "] license = "GPL-3.0-only" diff --git a/crates/binstalk-fetchers/src/common.rs b/crates/binstalk-fetchers/src/common.rs index b3a491ae..10272f10 100644 --- a/crates/binstalk-fetchers/src/common.rs +++ b/crates/binstalk-fetchers/src/common.rs @@ -1,6 +1,11 @@ -use std::sync::{ - atomic::{AtomicBool, Ordering::Relaxed}, - Once, +#![allow(unused)] + +use std::{ + future::Future, + sync::{ + atomic::{AtomicBool, Ordering::Relaxed}, + Once, + }, }; pub(super) use binstalk_downloader::{ @@ -76,3 +81,33 @@ pub(super) async fn does_url_exist( Ok(Box::pin(client.remote_gettable(url.clone())).await?) } + +#[derive(Debug)] +pub(super) struct AutoAbortJoinHandle(JoinHandle); + +impl AutoAbortJoinHandle +where + T: Send + 'static, +{ + pub(super) fn spawn(future: F) -> Self + where + F: Future + Send + 'static, + { + Self(tokio::spawn(future)) + } +} + +impl Drop for AutoAbortJoinHandle { + fn drop(&mut self) { + self.0.abort(); + } +} + +impl AutoAbortJoinHandle> +where + E: Into, +{ + pub(super) async fn flattened_join(mut self) -> Result { + (&mut self.0).await?.map_err(Into::into) + } +} diff --git a/crates/binstalk-fetchers/src/futures_resolver.rs b/crates/binstalk-fetchers/src/futures_resolver.rs index 0a550519..461ab462 100644 --- a/crates/binstalk-fetchers/src/futures_resolver.rs +++ b/crates/binstalk-fetchers/src/futures_resolver.rs @@ -1,5 +1,7 @@ -use std::{future::Future, pin::Pin}; +use std::{fmt::Debug, future::Future, pin::Pin}; + use tokio::sync::mpsc; +use tracing::warn; /// Given multiple futures with output = `Result, E>`, /// returns the the first one that returns either `Err(_)` or @@ -17,7 +19,7 @@ impl Default for FuturesResolver { } } -impl FuturesResolver { +impl FuturesResolver { /// Insert new future into this resolver, they will start running /// right away. pub fn push(&self, fut: Fut) @@ -67,10 +69,18 @@ impl FuturesResolver { } /// Return the resolution. - pub fn resolve(self) -> impl Future, E>> { + pub fn resolve(self) -> impl Future> { let mut rx = self.rx; drop(self.tx); - async move { rx.recv().await.transpose() } + async move { + loop { + match rx.recv().await { + Some(Ok(ret)) => return Some(ret), + Some(Err(err)) => warn!(?err, "Fail to resolve the future"), + None => return None, + } + } + } } } diff --git a/crates/binstalk-fetchers/src/gh_crate_meta.rs b/crates/binstalk-fetchers/src/gh_crate_meta.rs index 976b6942..51cd012c 100644 --- a/crates/binstalk-fetchers/src/gh_crate_meta.rs +++ b/crates/binstalk-fetchers/src/gh_crate_meta.rs @@ -278,7 +278,7 @@ impl super::Fetcher for GhCrateMeta { } } - if let Some(resolved) = resolver.resolve().await? { + if let Some(resolved) = resolver.resolve().await { debug!(?resolved, "Winning URL found!"); self.resolution .set(resolved) diff --git a/crates/binstalk-fetchers/src/lib.rs b/crates/binstalk-fetchers/src/lib.rs index 33e50944..f589e5fc 100644 --- a/crates/binstalk-fetchers/src/lib.rs +++ b/crates/binstalk-fetchers/src/lib.rs @@ -6,7 +6,7 @@ use binstalk_downloader::{download::DownloadError, remote::Error as RemoteError} use binstalk_git_repo_api::gh_api_client::{GhApiError, GhRepo}; use binstalk_types::cargo_toml_binstall::SigningAlgorithm; use thiserror::Error as ThisError; -use tokio::{sync::OnceCell, time::sleep}; +use tokio::{sync::OnceCell, task::JoinError, time::sleep}; pub use url::ParseError as UrlParseError; mod gh_crate_meta; @@ -70,6 +70,9 @@ pub enum FetchError { #[error("Failed to verify signature")] InvalidSignature, + + #[error("Failed to wait for task: {0}")] + TaskJoinError(#[from] JoinError), } impl From for FetchError { diff --git a/crates/binstalk-fetchers/src/quickinstall.rs b/crates/binstalk-fetchers/src/quickinstall.rs index aa9b402a..2862fb89 100644 --- a/crates/binstalk-fetchers/src/quickinstall.rs +++ b/crates/binstalk-fetchers/src/quickinstall.rs @@ -1,4 +1,8 @@ -use std::{borrow::Cow, path::Path, sync::Arc}; +use std::{ + borrow::Cow, + path::Path, + sync::{Arc, OnceLock}, +}; use binstalk_downloader::remote::Method; use binstalk_types::cargo_toml_binstall::{PkgFmt, PkgMeta, PkgSigning}; @@ -61,6 +65,8 @@ pub struct QuickInstall { signature_policy: SignaturePolicy, target_data: Arc, + + signature_verifier: OnceLock, } impl QuickInstall { @@ -75,6 +81,41 @@ impl QuickInstall { .await .copied() } + + fn download_signature( + self: Arc, + ) -> AutoAbortJoinHandle> { + AutoAbortJoinHandle::spawn(async move { + if self.signature_policy == SignaturePolicy::Ignore { + Ok(SignatureVerifier::Noop) + } else { + debug!(url=%self.signature_url, "Downloading signature"); + match Download::new(self.client.clone(), self.signature_url.clone()) + .into_bytes() + .await + { + Ok(signature) => { + trace!(?signature, "got signature contents"); + let config = PkgSigning { + algorithm: SigningAlgorithm::Minisign, + pubkey: QUICKINSTALL_SIGN_KEY, + file: None, + }; + SignatureVerifier::new(&config, &signature) + } + Err(err) => { + if self.signature_policy == SignaturePolicy::Require { + error!("Failed to download signature: {err}"); + Err(FetchError::MissingSignature) + } else { + debug!("Failed to download signature, skipping verification: {err}"); + Ok(SignatureVerifier::Noop) + } + } + } + } + }) + } } #[async_trait::async_trait] @@ -109,6 +150,8 @@ impl super::Fetcher for QuickInstall { signature_policy, target_data, + + signature_verifier: OnceLock::new(), }) } @@ -118,22 +161,28 @@ impl super::Fetcher for QuickInstall { return Ok(false); } - if self.signature_policy == SignaturePolicy::Require { - does_url_exist( - self.client.clone(), - self.gh_api_client.clone(), - &self.signature_url, - ) - .await - .map_err(|_| FetchError::MissingSignature)?; - } + let download_signature_task = self.clone().download_signature(); - does_url_exist( + let is_found = does_url_exist( self.client.clone(), self.gh_api_client.clone(), &self.package_url, ) - .await + .await?; + + if !is_found { + return Ok(false); + } + + if self + .signature_verifier + .set(download_signature_task.flattened_join().await?) + .is_err() + { + panic!("::find is run twice"); + } + + Ok(true) }) } @@ -160,33 +209,8 @@ by rust officially."#, } async fn fetch_and_extract(&self, dst: &Path) -> Result { - let verifier = if self.signature_policy == SignaturePolicy::Ignore { - SignatureVerifier::Noop - } else { - debug!(url=%self.signature_url, "Downloading signature"); - match Download::new(self.client.clone(), self.signature_url.clone()) - .into_bytes() - .await - { - Ok(signature) => { - trace!(?signature, "got signature contents"); - let config = PkgSigning { - algorithm: SigningAlgorithm::Minisign, - pubkey: QUICKINSTALL_SIGN_KEY, - file: None, - }; - SignatureVerifier::new(&config, &signature)? - } - Err(err) => { - if self.signature_policy == SignaturePolicy::Require { - error!("Failed to download signature: {err}"); - return Err(FetchError::MissingSignature); - } - - debug!("Failed to download signature, skipping verification: {err}"); - SignatureVerifier::Noop - } - } + let Some(verifier) = self.signature_verifier.get() else { + panic!("::find has not been called yet!") }; debug!(url=%self.package_url, "Downloading package"); diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 805bfb4a..b8e02374 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -97,7 +97,7 @@ async fn resolve_inner( _ => None, }; - let mut handles: Vec<(Arc, _)> = Vec::with_capacity( + let mut handles: Vec> = Vec::with_capacity( desired_targets.len() * resolvers.len() + if binary_name.is_some() { desired_targets.len() @@ -139,8 +139,7 @@ async fn resolve_inner( target_data, opts.signature_policy, ); - filter_fetcher_by_name_predicate(fetcher.fetcher_name()) - .then_some((fetcher.clone(), AutoAbortJoinHandle::new(fetcher.find()))) + filter_fetcher_by_name_predicate(fetcher.fetcher_name()).then_some(fetcher) }), ) }; @@ -165,9 +164,12 @@ async fn resolve_inner( ); } - for (fetcher, handle) in handles { + for fetcher in handles { fetcher.clone().report_to_upstream(); - match handle.flattened_join().await { + match AutoAbortJoinHandle::new(fetcher.clone().find()) + .flattened_join() + .await + { Ok(true) => { // Generate temporary binary path let bin_path = opts.temp_dir.join(format!( From 27e3b2672dc94f5f9814fb931b7dbaf821f3daed Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 23 Jun 2024 12:14:44 +0000 Subject: [PATCH 1797/2020] release: binstalk-fetchers v0.7.1 (#1797) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 40b334d2..295a7475 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -327,7 +327,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.7.0" +version = "0.7.1" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 37bd254e..2e074a0c 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.7.0" +version = "0.7.1" edition = "2021" description = "The binstall fetchers" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index afb98bca..c9c7e650 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.3.0", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.7.0", path = "../binstalk-fetchers", features = [ +binstalk-fetchers = { version = "0.7.1", path = "../binstalk-fetchers", features = [ "quickinstall", ] } binstalk-registry = { version = "0.9.1", path = "../binstalk-registry" } From 323651229315a461c4d83268a27b0139dc3890e9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 23 Jun 2024 23:17:55 +1000 Subject: [PATCH 1798/2020] release: binstalk v0.26.1 (#1798) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 295a7475..7cd24e52 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -247,7 +247,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.26.0" +version = "0.26.1" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index f0fbbf97..65442447 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.26.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.26.1", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.13.0" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.7.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index c9c7e650..8d6a291c 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.26.0" +version = "0.26.1" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" From 76814e4e8feaede87d8d112a4fad519d8eeaf81d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 23 Jun 2024 14:46:16 +0000 Subject: [PATCH 1799/2020] release: cargo-binstall v1.7.3 (#1799) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7cd24e52..a2184fa9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -550,7 +550,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.7.2" +version = "1.7.3" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 65442447..7ebefd9e 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.7.2" +version = "1.7.3" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index a0376911..fb368672 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From a39cf031f944a6585646727135ab1a1ecd68109e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 28 Jun 2024 03:40:06 +0000 Subject: [PATCH 1800/2020] dep: Upgrade transitive dependencies (#1802) Co-authored-by: github-actions --- Cargo.lock | 82 +++++++++++++++++++++++++++--------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a2184fa9..73784629 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -449,9 +449,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4b9d6a944f767f8e5e0db018570623c85f3d925ac718db4e06d0187adb21c1" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "block-buffer" @@ -636,9 +636,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.99" +version = "1.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96c51067fd44124faa7f870b4b1c969379ad32b2ba805aa959430ceaa384f695" +checksum = "ac367972e516d45567c7eafc73d24e1c193dcf200a8d94e9db7b3d38b349572d" dependencies = [ "jobserver", "libc", @@ -956,9 +956,9 @@ checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" [[package]] name = "either" -version = "1.12.0" +version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dca9240753cf90908d7e4aac30f630662b02aebaa1b58a3cadabdb23385b58b" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "embed-resource" @@ -1414,7 +1414,7 @@ version = "0.14.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbd06203b1a9b33a78c88252a625031b094d9e1b647260070c25b09910c0a804" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "bstr", "gix-path", "libc", @@ -1440,9 +1440,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "367ee9093b0c2b04fd04c5c7c8b6a1082713534eab537597ae343663a518fa99" +checksum = "9eed6931f21491ee0aeb922751bd7ec97b4b2fe8fbfedcb678e2a2dce5f3b8c0" dependencies = [ "bstr", "itoa", @@ -1541,7 +1541,7 @@ version = "0.16.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2a29ad0990cf02c48a7aac76ed0dbddeb5a0d070034b83675cc3bbf937eace4" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "bstr", "gix-features", "gix-path", @@ -1587,7 +1587,7 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d8c5a5f1c58edcbc5692b174cda2703aba82ed17d7176ff4c1752eb48b1b167" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "bstr", "filetime", "fnv", @@ -1637,7 +1637,7 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d57dec54544d155a495e01de947da024471e1825d7d3f2724301c07a310d6184" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "gix-commitgraph", "gix-date", "gix-hash", @@ -1733,9 +1733,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23623cf0f475691a6d943f898c4d0b89f5c1a2a64d0f92bce0e0322ee6528783" +checksum = "ca987128ffb056d732bd545db5db3d8b103d252fbf083c2567bb0796876619a4" dependencies = [ "bstr", "gix-trace", @@ -1750,7 +1750,7 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a76cab098dc10ba2d89f634f66bf196dea4d7db4bf10b75c7a9c201c55a2ee19" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "bstr", "gix-attributes", "gix-config-value", @@ -1874,7 +1874,7 @@ version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fddc27984a643b20dd03e97790555804f98cf07404e0e552c0ad8133266a79a1" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "gix-path", "libc", "windows-sys 0.52.0", @@ -1939,7 +1939,7 @@ version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f20cb69b63eb3e4827939f42c05b7756e3488ef49c25c412a876691d568ee2a0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "gix-commitgraph", "gix-date", "gix-hash", @@ -2530,9 +2530,9 @@ dependencies = [ [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "leon" @@ -2564,9 +2564,9 @@ checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" [[package]] name = "libmimalloc-sys" -version = "0.1.38" +version = "0.1.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7bb23d733dfcc8af652a78b7bf232f0e967710d044732185e561e47c0336b6" +checksum = "23aa6811d3bd4deb8a84dde645f943476d13b248d818edcf8ce0b2f37f036b44" dependencies = [ "cc", "libc", @@ -2578,7 +2578,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "libc", ] @@ -2616,9 +2616,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.21" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90ed8c1e510134f979dbc4f070f87d4313098b704861a105fe34231c70a3901c" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "lru-cache" @@ -2720,9 +2720,9 @@ dependencies = [ [[package]] name = "mimalloc" -version = "0.1.42" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9186d86b79b52f4a77af65604b51225e8db1d6ee7e3f41aec1e40829c71a176" +checksum = "68914350ae34959d83f732418d51e2427a794055d0b9529f48259ac07af65633" dependencies = [ "libmimalloc-sys", ] @@ -2830,7 +2830,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "libc", ] @@ -2895,7 +2895,7 @@ version = "0.10.64" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "cfg-if", "foreign-types", "libc", @@ -3245,7 +3245,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", ] [[package]] @@ -3422,7 +3422,7 @@ version = "0.38.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "errno 0.3.9", "libc", "linux-raw-sys", @@ -3566,7 +3566,7 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" dependencies = [ - "bitflags 2.5.0", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -3623,9 +3623,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.117" +version = "1.0.118" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "455182ea6142b14f93f4bc5320a2b31c1f266b66a4a5c858b013302a5d8cbfc3" +checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" dependencies = [ "itoa", "ryu", @@ -3786,9 +3786,9 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.26.2" +version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" +checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" [[package]] name = "strum_macros" @@ -3805,9 +3805,9 @@ dependencies = [ [[package]] name = "subtle" -version = "2.6.0" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d0208408ba0c3df17ed26eb06992cb1a1268d41b2c0e12e65203fbe3972cee5" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "supports-color" @@ -3832,9 +3832,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.67" +version = "2.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff8655ed1d86f3af4ee3fd3263786bc14245ad17c4c7e85ba7187fb3ae028c90" +checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" dependencies = [ "proc-macro2", "quote", @@ -3972,9 +3972,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" dependencies = [ "tinyvec_macros", ] From bda3c7568bb795b670b7a00e67628bd245146ec9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 5 Jul 2024 14:47:12 +1000 Subject: [PATCH 1801/2020] dep: Upgrade transitive dependencies (#1807) Co-authored-by: github-actions --- Cargo.lock | 200 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 132 insertions(+), 68 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 73784629..95255830 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -627,18 +627,18 @@ dependencies = [ [[package]] name = "castaway" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a17ed5635fc8536268e5d4de1e22e81ac34419e5f052d4d51f4e01dcc263fcc" +checksum = "0abae9be0aaf9ea96a3b1b8b1b55c602ca751eba1b1500220cea4ecbafe7c0d5" dependencies = [ "rustversion", ] [[package]] name = "cc" -version = "1.0.101" +version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac367972e516d45567c7eafc73d24e1c193dcf200a8d94e9db7b3d38b349572d" +checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490" dependencies = [ "jobserver", "libc", @@ -653,9 +653,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.7" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5db83dced34638ad474f39f250d7fea9598bdd239eaced1bdf45d597da0f433f" +checksum = "84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d" dependencies = [ "clap_builder", "clap_derive", @@ -663,9 +663,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.7" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e204572485eb3fbf28f871612191521df159bc3e15a9f5064c66dba3a8c05f" +checksum = "c1c09dd5ada6c6c78075d6fd0da3f90d8080651e2d6cc8eb2f1aaa4034ced708" dependencies = [ "anstream", "anstyle", @@ -675,9 +675,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.5" +version = "4.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c780290ccf4fb26629baa7a1081e68ced113f1d3ec302fa5948f1c381ebf06c6" +checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -1314,9 +1314,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.31.2" +version = "0.31.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d69c59d392c7e6c94385b6fd6089d6df0fe945f32b4357687989f3aee253cd7f" +checksum = "d9b8ee65074b2bbb91d9d97c15d172ea75043aefebf9869b5b329149dc76501c" dependencies = [ "bstr", "gix-date", @@ -1649,9 +1649,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.42.2" +version = "0.42.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fe2dc4a41191c680c942e6ebd630c8107005983c4679214fdb1007dcf5ae1df" +checksum = "25da2f46b4e7c2fa7b413ce4dffb87f69eaf89c2057e386491f4c55cadbfe386" dependencies = [ "bstr", "gix-actor", @@ -2309,9 +2309,9 @@ checksum = "5c3b1f728c459d27b12448862017b96ad4767b1ec2ec5e6434e99f1577f085b8" [[package]] name = "hyper" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "c4fe55fb7a772d59a5ff1dfbff4fe0258d19b89fec4b233e75d35d5d2316badc" dependencies = [ "bytes", "futures-channel", @@ -2364,9 +2364,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b875924a60b96e5d7b9ae7b066540b1dd1cbd90d1828f54c92e02a283351c56" +checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" dependencies = [ "bytes", "futures-channel", @@ -2876,9 +2876,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.0" +version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "576dfe1fc8f9df304abb159d767a29d0476f7750fbf8aa7ad07816004a207434" +checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" dependencies = [ "memchr", ] @@ -2977,7 +2977,7 @@ dependencies = [ "libc", "redox_syscall 0.5.2", "smallvec", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -3261,13 +3261,13 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.18" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d731e7e3ebfcf422d96b8473e507d5b64790900dd5464772d38d1da9da24d3a" +checksum = "dc31414597d1cd7fdd2422798b7652a6329dda0fe0219e6335a13d5bcaa9aeb6" dependencies = [ "cfg-if", "rustix", - "windows 0.57.0", + "windows 0.58.0", ] [[package]] @@ -3450,16 +3450,16 @@ dependencies = [ "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.4", + "rustls-webpki 0.102.5", "subtle", "zeroize", ] [[package]] name = "rustls-native-certs" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f1fb85efa936c42c6d5fc28d2629bb51e4b2f4b8a5211e297d599cc5a093792" +checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" dependencies = [ "openssl-probe", "rustls-pemfile 2.1.2", @@ -3505,9 +3505,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.4" +version = "0.102.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff448f7e92e913c4b7d4c6d8e4540a1724b319b4152b8aef6d4cf8339712b33e" +checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -3623,9 +3623,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.118" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d947f6b3163d8857ea16c4fa0dd4840d52f3041039a85decd46867eb1abef2e4" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "itoa", "ryu", @@ -4535,8 +4535,18 @@ version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" dependencies = [ - "windows-core", - "windows-targets 0.52.5", + "windows-core 0.57.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" +dependencies = [ + "windows-core 0.58.0", + "windows-targets 0.52.6", ] [[package]] @@ -4545,10 +4555,23 @@ version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" dependencies = [ - "windows-implement", - "windows-interface", - "windows-result", - "windows-targets 0.52.5", + "windows-implement 0.57.0", + "windows-interface 0.57.0", + "windows-result 0.1.2", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" +dependencies = [ + "windows-implement 0.58.0", + "windows-interface 0.58.0", + "windows-result 0.2.0", + "windows-strings", + "windows-targets 0.52.6", ] [[package]] @@ -4562,6 +4585,17 @@ dependencies = [ "syn", ] +[[package]] +name = "windows-implement" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bbd5b46c938e506ecbce286b6628a02171d56153ba733b6c741fc627ec9579b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "windows-interface" version = "0.57.0" @@ -4573,13 +4607,43 @@ dependencies = [ "syn", ] +[[package]] +name = "windows-interface" +version = "0.58.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053c4c462dc91d3b1504c6fe5a726dd15e216ba718e84a0e46a88fbe5ded3515" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "windows-result" version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result 0.2.0", + "windows-targets 0.52.6", ] [[package]] @@ -4597,7 +4661,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -4617,18 +4681,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -4639,9 +4703,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -4651,9 +4715,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -4663,15 +4727,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -4681,9 +4745,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -4693,9 +4757,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -4705,9 +4769,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -4717,9 +4781,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" @@ -4772,18 +4836,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae87e3fcd617500e5d106f0380cf7b77f3c6092aae37191433159dda23cfb087" +checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.34" +version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e934569e47891f7d9411f1a451d947a60e000ab3bd24fbb970f000387d1b3b" +checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", From 832834058d49e8058167c8be5c7844e962dfbf8d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 6 Jul 2024 02:06:54 +0000 Subject: [PATCH 1802/2020] build(deps): bump the deps group with 2 updates (#1808) Bumps the deps group with 2 updates: [windows](https://github.com/microsoft/windows-rs) and [zstd](https://github.com/gyscos/zstd-rs). Updates `windows` from 0.57.0 to 0.58.0 - [Release notes](https://github.com/microsoft/windows-rs/releases) - [Commits](https://github.com/microsoft/windows-rs/compare/0.57.0...0.58.0) Updates `zstd` from 0.13.1 to 0.13.2 - [Release notes](https://github.com/gyscos/zstd-rs/releases) - [Commits](https://github.com/gyscos/zstd-rs/compare/v0.13.1...v0.13.2) --- updated-dependencies: - dependency-name: windows dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: zstd dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 69 ++++----------------------- crates/atomic-file-install/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- 3 files changed, 10 insertions(+), 63 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 95255830..0961ee11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -179,7 +179,7 @@ dependencies = [ "reflink-copy", "tempfile", "tracing", - "windows 0.57.0", + "windows 0.58.0", ] [[package]] @@ -4529,35 +4529,13 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12342cb4d8e3b046f3d80effd474a7a02447231330ef77d71daa6fbc40681143" -dependencies = [ - "windows-core 0.57.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows" version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" dependencies = [ - "windows-core 0.58.0", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-core" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2ed2439a290666cd67ecce2b0ffaad89c2a56b976b736e6ece670297897832d" -dependencies = [ - "windows-implement 0.57.0", - "windows-interface 0.57.0", - "windows-result 0.1.2", + "windows-core", "windows-targets 0.52.6", ] @@ -4567,24 +4545,13 @@ version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" dependencies = [ - "windows-implement 0.58.0", - "windows-interface 0.58.0", - "windows-result 0.2.0", + "windows-implement", + "windows-interface", + "windows-result", "windows-strings", "windows-targets 0.52.6", ] -[[package]] -name = "windows-implement" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9107ddc059d5b6fbfbffdfa7a7fe3e22a226def0b2608f72e9d552763d3e1ad7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "windows-implement" version = "0.58.0" @@ -4596,17 +4563,6 @@ dependencies = [ "syn", ] -[[package]] -name = "windows-interface" -version = "0.57.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29bee4b38ea3cde66011baa44dba677c432a78593e202392d1e9070cf2a7fca7" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "windows-interface" version = "0.58.0" @@ -4618,15 +4574,6 @@ dependencies = [ "syn", ] -[[package]] -name = "windows-result" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-result" version = "0.2.0" @@ -4642,7 +4589,7 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ - "windows-result 0.2.0", + "windows-result", "windows-targets 0.52.6", ] @@ -4862,9 +4809,9 @@ checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" [[package]] name = "zstd" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d789b1514203a1120ad2429eae43a7bd32b90976a7bb8a05f7ec02fa88cc23a" +checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" dependencies = [ "zstd-safe", ] diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index c05a43a6..970a609d 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -15,4 +15,4 @@ tempfile = "3.5.0" tracing = "0.1.39" [target.'cfg(windows)'.dependencies] -windows = { version = "0.57.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } +windows = { version = "0.58.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index cb1635ab..47a919c2 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -74,7 +74,7 @@ xz2 = "0.1.7" # Since zip 0.6.3 depends on zstd 0.11, we can use 0.12.0 here # because it uses the same zstd-sys version. # Otherwise there will be a link conflict. -zstd = { version = "0.13.0", default-features = false } +zstd = { version = "0.13.2", default-features = false } [features] default = ["static", "rustls"] From d401c4829656e970b997ffc9707870118656486e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 6 Jul 2024 12:33:00 +1000 Subject: [PATCH 1803/2020] dep: Upgrade transitive dependencies (#1810) Co-authored-by: github-actions --- Cargo.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0961ee11..2d4d34e3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2487,9 +2487,9 @@ dependencies = [ [[package]] name = "jobslot" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0303fc691930667d6fd0b2cd194f9d6b37be3d890e0b89cf4a34e27231f35c4f" +checksum = "4aa6aac359cd1a94a809e1012b1b72d7416e6810299927ab60de041ef735fe00" dependencies = [ "cfg-if", "derive_destructure2", @@ -3972,9 +3972,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c55115c6fbe2d2bef26eb09ad74bde02d8255476fc0c7b515ef09fbb35742d82" +checksum = "ce6b6a2fb3a985e99cebfaefa9faa3024743da73304ca1c683a36429613d3d22" dependencies = [ "tinyvec_macros", ] @@ -4818,18 +4818,18 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "7.1.0" +version = "7.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd99b45c6bc03a018c8b8a86025678c87e55526064e38f9df301989dce7ec0a" +checksum = "fa556e971e7b568dc775c136fc9de8c779b1c2fc3a63defaafadffdbd3181afa" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.11+zstd.1.5.6" +version = "2.0.12+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75652c55c0b6f3e6f12eb786fe1bc960396bf05a1eb3bf1f3691c3610ac2e6d4" +checksum = "0a4e40c320c3cb459d9a9ff6de98cff88f4751ee9275d140e2be94a2b74e4c13" dependencies = [ "cc", "pkg-config", From 0a9f17f1badb83b975e13806fdad471a6e900ca8 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 6 Jul 2024 14:27:28 +1000 Subject: [PATCH 1804/2020] Speedup and prevent rate limit in gh-action.yml (#1811) By passing github token Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- .github/workflows/gh-action.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/gh-action.yml b/.github/workflows/gh-action.yml index 47b78223..d9aad264 100644 --- a/.github/workflows/gh-action.yml +++ b/.github/workflows/gh-action.yml @@ -25,12 +25,16 @@ jobs: - name: Install cargo-binstall uses: ./ # uses action.yml from root of the repo - + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Verify successful installation - display cargo-binstall's help run: cargo binstall --help - name: Verify successful installation - install example binary using cargo-binstall run: cargo binstall -y ripgrep - + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Verify successful installation - display help of installed binary run: rg --help From 928e28a51cd625371370a74ceb0565ca00fa1dfb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 6 Jul 2024 05:06:54 +0000 Subject: [PATCH 1805/2020] release: atomic-file-install v1.0.5 (#1812) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/atomic-file-install/Cargo.toml | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2d4d34e3..203ba64e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -174,7 +174,7 @@ dependencies = [ [[package]] name = "atomic-file-install" -version = "1.0.4" +version = "1.0.5" dependencies = [ "reflink-copy", "tempfile", diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index 970a609d..6472d276 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "atomic-file-install" -version = "1.0.4" +version = "1.0.5" edition = "2021" description = "For atomically installing a file or a symlink." repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 31626f6f..a7f88aae 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -11,7 +11,7 @@ authors = ["Jiahao XU "] license = "GPL-3.0-only" [dependencies] -atomic-file-install = { version = "1.0.4", path = "../atomic-file-install" } +atomic-file-install = { version = "1.0.5", path = "../atomic-file-install" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } compact_str = { version = "0.7.0", features = ["serde"] } leon = "3.0.0" From 7032b067466e55d05f7994ed91e3848083feda2e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 6 Jul 2024 05:50:06 +0000 Subject: [PATCH 1806/2020] release: cargo-binstall v1.7.4 (#1813) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 203ba64e..4b57caf4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -550,7 +550,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.7.3" +version = "1.7.4" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 7ebefd9e..e0099d56 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.7.3" +version = "1.7.4" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index fb368672..da1fb6c9 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 8705f1c34534163ac0658a3e6e07dbc695a16d1a Mon Sep 17 00:00:00 2001 From: Yuki Nagato <37764578+YUKI2eN3e@users.noreply.github.com> Date: Wed, 10 Jul 2024 20:36:58 -0700 Subject: [PATCH 1807/2020] Raspberry-pi (#1814) * Get install script to work on raspberry pi * cleanup --- install-from-binstall-release.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/install-from-binstall-release.sh b/install-from-binstall-release.sh index 1da856d4..05e507bf 100755 --- a/install-from-binstall-release.sh +++ b/install-from-binstall-release.sh @@ -13,6 +13,9 @@ if [ "$os" == "Darwin" ]; then unzip cargo-binstall-universal-apple-darwin.zip elif [ "$os" == "Linux" ]; then machine="$(uname -m)" + if [ "$machine" == "armv7l" ]; then + machine="armv7" + fi target="${machine}-unknown-linux-musl" if [ "$machine" == "armv7" ]; then target="${target}eabihf" From a92ad4952f2e6c5c9bd8c6f704a15931d082360d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 12 Jul 2024 03:49:02 +0000 Subject: [PATCH 1808/2020] dep: Upgrade transitive dependencies (#1816) Co-authored-by: github-actions --- Cargo.lock | 110 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 62 insertions(+), 48 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4b57caf4..abe28a3b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -148,9 +148,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.80" +version = "0.1.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6fa2087f2753a7da8cc1c0dbfcf89579dd57458e36769de5ac750b4671737ca" +checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" dependencies = [ "proc-macro2", "quote", @@ -257,7 +257,7 @@ dependencies = [ "binstalk-types", "cargo-toml-workspace", "command-group", - "compact_str", + "compact_str 0.7.1", "detect-targets", "either", "itertools", @@ -283,7 +283,7 @@ version = "0.4.0" dependencies = [ "atomic-file-install", "binstalk-types", - "compact_str", + "compact_str 0.7.1", "leon", "miette", "normalize-path", @@ -302,7 +302,7 @@ dependencies = [ "binstall-tar", "bytes", "bzip2", - "compact_str", + "compact_str 0.7.1", "default-net", "flate2", "futures-io", @@ -334,7 +334,7 @@ dependencies = [ "binstalk-git-repo-api", "binstalk-types", "bytes", - "compact_str", + "compact_str 0.7.1", "either", "itertools", "leon", @@ -354,7 +354,7 @@ name = "binstalk-git-repo-api" version = "0.3.0" dependencies = [ "binstalk-downloader", - "compact_str", + "compact_str 0.7.1", "once_cell", "percent-encoding", "serde", @@ -374,7 +374,7 @@ version = "0.13.0" dependencies = [ "beef", "binstalk-types", - "compact_str", + "compact_str 0.7.1", "detect-targets", "fs-lock", "home", @@ -398,7 +398,7 @@ dependencies = [ "binstalk-downloader", "binstalk-types", "cargo-toml-workspace", - "compact_str", + "compact_str 0.7.1", "leon", "miette", "normalize-path", @@ -420,7 +420,7 @@ dependencies = [ name = "binstalk-types" version = "0.7.0" dependencies = [ - "compact_str", + "compact_str 0.7.1", "maybe-owned", "once_cell", "semver", @@ -555,7 +555,7 @@ dependencies = [ "binstalk", "binstalk-manifests", "clap", - "compact_str", + "compact_str 0.7.1", "dirs", "embed-resource", "file-format", @@ -592,7 +592,7 @@ name = "cargo-toml-workspace" version = "6.0.0" dependencies = [ "cargo_toml", - "compact_str", + "compact_str 0.7.1", "glob", "normalize-path", "serde", @@ -636,9 +636,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.104" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74b6a57f98764a267ff415d50a25e6e166f3831a5071af4995296ea97d210490" +checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" dependencies = [ "jobserver", "libc", @@ -653,9 +653,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.8" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d" +checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462" dependencies = [ "clap_builder", "clap_derive", @@ -663,9 +663,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.8" +version = "4.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1c09dd5ada6c6c78075d6fd0da3f90d8080651e2d6cc8eb2f1aaa4034ced708" +checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942" dependencies = [ "anstream", "anstyle", @@ -738,6 +738,20 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "compact_str" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6050c3a16ddab2e412160b31f2c871015704239bca62f72f6e5f0be631d3f644" +dependencies = [ + "castaway", + "cfg-if", + "itoa", + "rustversion", + "ryu", + "static_assertions", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -2309,9 +2323,9 @@ checksum = "5c3b1f728c459d27b12448862017b96ad4767b1ec2ec5e6434e99f1577f085b8" [[package]] name = "hyper" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4fe55fb7a772d59a5ff1dfbff4fe0258d19b89fec4b233e75d35d5d2316badc" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", @@ -2337,7 +2351,7 @@ dependencies = [ "http 1.1.0", "hyper", "hyper-util", - "rustls 0.23.10", + "rustls 0.23.11", "rustls-native-certs", "rustls-pki-types", "tokio", @@ -3096,7 +3110,7 @@ dependencies = [ "quinn-proto 0.11.3", "quinn-udp 0.5.2", "rustc-hash", - "rustls 0.23.10", + "rustls 0.23.11", "thiserror", "tokio", "tracing", @@ -3129,7 +3143,7 @@ dependencies = [ "rand", "ring 0.17.8", "rustc-hash", - "rustls 0.23.10", + "rustls 0.23.11", "slab", "thiserror", "tinyvec", @@ -3331,7 +3345,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn 0.11.2", - "rustls 0.23.10", + "rustls 0.23.11", "rustls-native-certs", "rustls-pemfile 2.1.2", "rustls-pki-types", @@ -3443,9 +3457,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.10" +version = "0.23.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05cff451f60db80f490f3c182b77c35260baace73209e9cdbbe526bfe3a4d402" +checksum = "4828ea528154ae444e5a642dbb7d5623354030dc9822b83fd9bb79683c7399d0" dependencies = [ "once_cell", "ring 0.17.8", @@ -3594,9 +3608,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7253ab4de971e72fb7be983802300c30b5a7f0c2e56fab8abfc6a214307c0094" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ "serde_derive", ] @@ -3612,9 +3626,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.203" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "500cbc0ebeb6f46627f50f3f5811ccf6bf00643be300b4c3eabc0ef55dc5b5ba" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", @@ -3717,11 +3731,11 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.8" +version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "802c6e812f1a776cc85f887864e8c8f4b1e0fef694870b6bb109bd2ccb567ad5" +checksum = "48955a621e2b4a92fdb9fcbf8a5bf0e56b15a56bfe09e6defc01cb25ca59f31c" dependencies = [ - "compact_str", + "compact_str 0.8.0", "derive_destructure2", "gix", "thiserror", @@ -3832,9 +3846,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.68" +version = "2.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "901fa70d88b9d6c98022e23b4136f9f3e54e4662c3bc1bd1d84a42a9a0f0c1e9" +checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" dependencies = [ "proc-macro2", "quote", @@ -3870,9 +3884,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.14" +version = "0.12.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" +checksum = "4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2" [[package]] name = "tempfile" @@ -3909,18 +3923,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.61" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.61" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c" dependencies = [ "proc-macro2", "quote", @@ -3972,9 +3986,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce6b6a2fb3a985e99cebfaefa9faa3024743da73304ca1c683a36429613d3d22" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -4040,7 +4054,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.10", + "rustls 0.23.11", "rustls-pki-types", "tokio", ] @@ -4108,9 +4122,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.14" +version = "0.22.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f21c7aaf97f1bd9ca9d4f9e73b0a6c74bd5afef56f2bc931943a6e1c37e04e38" +checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1" dependencies = [ "indexmap", "serde", @@ -4321,9 +4335,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "vergen" -version = "8.3.1" +version = "8.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e27d6bdd219887a9eadd19e1c34f32e47fa332301184935c6d9bca26f3cca525" +checksum = "2990d9ea5967266ea0ccf413a4aa5c42a93dbcfda9cb49a97de6931726b12566" dependencies = [ "anyhow", "cargo_metadata", From 0fe605f7f02d03ad99763e36b969eb2fc9ea3c2f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 13 Jul 2024 14:10:11 +1000 Subject: [PATCH 1809/2020] build(deps): bump compact_str from 0.7.1 to 0.8.0 in the deps group (#1817) * build(deps): bump compact_str from 0.7.1 to 0.8.0 in the deps group Bumps the deps group with 1 update: [compact_str](https://github.com/ParkMyCar/compact_str). Updates `compact_str` from 0.7.1 to 0.8.0 - [Changelog](https://github.com/ParkMyCar/compact_str/blob/main/CHANGELOG.md) - [Commits](https://github.com/ParkMyCar/compact_str/commits) --- updated-dependencies: - dependency-name: compact_str dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] * Fix compilation error and deprecations Signed-off-by: Jiahao XU * Use `CompactString::const_new` when possible Signed-off-by: Jiahao XU --------- Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU --- Cargo.lock | 37 ++++++------------- crates/bin/Cargo.toml | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-git-repo-api/Cargo.toml | 2 +- .../src/gh_api_client.rs | 32 ++++++++-------- .../src/gh_api_client/error.rs | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-manifests/src/cargo_config.rs | 4 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk-registry/src/common.rs | 8 ++-- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- 15 files changed, 45 insertions(+), 58 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index abe28a3b..bbe839ee 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -257,7 +257,7 @@ dependencies = [ "binstalk-types", "cargo-toml-workspace", "command-group", - "compact_str 0.7.1", + "compact_str", "detect-targets", "either", "itertools", @@ -283,7 +283,7 @@ version = "0.4.0" dependencies = [ "atomic-file-install", "binstalk-types", - "compact_str 0.7.1", + "compact_str", "leon", "miette", "normalize-path", @@ -302,7 +302,7 @@ dependencies = [ "binstall-tar", "bytes", "bzip2", - "compact_str 0.7.1", + "compact_str", "default-net", "flate2", "futures-io", @@ -334,7 +334,7 @@ dependencies = [ "binstalk-git-repo-api", "binstalk-types", "bytes", - "compact_str 0.7.1", + "compact_str", "either", "itertools", "leon", @@ -354,7 +354,7 @@ name = "binstalk-git-repo-api" version = "0.3.0" dependencies = [ "binstalk-downloader", - "compact_str 0.7.1", + "compact_str", "once_cell", "percent-encoding", "serde", @@ -374,7 +374,7 @@ version = "0.13.0" dependencies = [ "beef", "binstalk-types", - "compact_str 0.7.1", + "compact_str", "detect-targets", "fs-lock", "home", @@ -398,7 +398,7 @@ dependencies = [ "binstalk-downloader", "binstalk-types", "cargo-toml-workspace", - "compact_str 0.7.1", + "compact_str", "leon", "miette", "normalize-path", @@ -420,7 +420,7 @@ dependencies = [ name = "binstalk-types" version = "0.7.0" dependencies = [ - "compact_str 0.7.1", + "compact_str", "maybe-owned", "once_cell", "semver", @@ -555,7 +555,7 @@ dependencies = [ "binstalk", "binstalk-manifests", "clap", - "compact_str 0.7.1", + "compact_str", "dirs", "embed-resource", "file-format", @@ -592,7 +592,7 @@ name = "cargo-toml-workspace" version = "6.0.0" dependencies = [ "cargo_toml", - "compact_str 0.7.1", + "compact_str", "glob", "normalize-path", "serde", @@ -724,20 +724,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "compact_str" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86b9c4c00838774a6d902ef931eff7470720c51d90c2e32cfe15dc304737b3f" -dependencies = [ - "castaway", - "cfg-if", - "itoa", - "ryu", - "serde", - "static_assertions", -] - [[package]] name = "compact_str" version = "0.8.0" @@ -749,6 +735,7 @@ dependencies = [ "itoa", "rustversion", "ryu", + "serde", "static_assertions", ] @@ -3735,7 +3722,7 @@ version = "0.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "48955a621e2b4a92fdb9fcbf8a5bf0e56b15a56bfe09e6defc01cb25ca59f31c" dependencies = [ - "compact_str 0.8.0", + "compact_str", "derive_destructure2", "gix", "thiserror", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index e0099d56..42529cb8 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -25,7 +25,7 @@ pkg-fmt = "zip" binstalk = { path = "../binstalk", version = "0.26.1", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.13.0" } clap = { version = "4.5.3", features = ["derive", "env"] } -compact_str = "0.7.0" +compact_str = "0.8.0" dirs = "5.0.1" file-format = { version = "0.25.0", default-features = false } home = "0.5.9" diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index a7f88aae..5a9b3983 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" [dependencies] atomic-file-install = { version = "1.0.5", path = "../atomic-file-install" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } -compact_str = { version = "0.7.0", features = ["serde"] } +compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 47a919c2..f95505f4 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -30,7 +30,7 @@ async_zip = { version = "0.0.17", features = [ binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" -compact_str = "0.7.0" +compact_str = "0.8.0" flate2 = { version = "1.0.28", default-features = false } futures-util = "0.3.30" futures-io = "0.3.30" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 2e074a0c..3c1f1458 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -16,7 +16,7 @@ binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", def binstalk-git-repo-api = { version = "0.3.0", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } bytes = "1.4.0" -compact_str = { version = "0.7.0" } +compact_str = { version = "0.8.0" } either = "1.11.0" itertools = "0.13.0" leon = "3.0.0" diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 5f450329..0810f549 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } -compact_str = "0.7.0" +compact_str = "0.8.0" percent-encoding = "2.2.0" serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" diff --git a/crates/binstalk-git-repo-api/src/gh_api_client.rs b/crates/binstalk-git-repo-api/src/gh_api_client.rs index 5b6420cf..8773fa11 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client.rs @@ -338,10 +338,10 @@ mod test { pub(super) const RELEASE: GhRelease = GhRelease { repo: GhRepo { - owner: CompactString::new_inline("cargo-bins"), - repo: CompactString::new_inline("cargo-binstall"), + owner: CompactString::const_new("cargo-bins"), + repo: CompactString::const_new("cargo-binstall"), }, - tag: CompactString::new_inline("v0.20.1"), + tag: CompactString::const_new("v0.20.1"), }; pub(super) const ARTIFACTS: &[&str] = &[ @@ -375,10 +375,10 @@ mod test { pub(super) const RELEASE: GhRelease = GhRelease { repo: GhRepo { - owner: CompactString::new_inline("rustsec"), - repo: CompactString::new_inline("rustsec"), + owner: CompactString::const_new("rustsec"), + repo: CompactString::const_new("rustsec"), }, - tag: CompactString::new_inline("cargo-audit/v0.17.6"), + tag: CompactString::const_new("cargo-audit/v0.17.6"), }; #[allow(unused)] @@ -417,7 +417,7 @@ mod test { ] .into_iter() .for_each(|url| { - let url = Url::parse(&url).unwrap(); + let url = Url::parse(url).unwrap(); assert_eq!( GhRepo::try_extract_from_url(&url) .unwrap() @@ -545,16 +545,16 @@ mod test { #[tokio::test] async fn rate_limited_test_get_repo_info() { const PUBLIC_REPOS: [GhRepo; 1] = [GhRepo { - owner: CompactString::new_inline("cargo-bins"), - repo: CompactString::new_inline("cargo-binstall"), + owner: CompactString::const_new("cargo-bins"), + repo: CompactString::const_new("cargo-binstall"), }]; const PRIVATE_REPOS: [GhRepo; 1] = [GhRepo { - owner: CompactString::new_inline("cargo-bins"), - repo: CompactString::new_inline("private-repo-for-testing"), + owner: CompactString::const_new("cargo-bins"), + repo: CompactString::const_new("private-repo-for-testing"), }]; const NON_EXISTENT_REPOS: [GhRepo; 1] = [GhRepo { - owner: CompactString::new_inline("cargo-bins"), - repo: CompactString::new_inline("ttt"), + owner: CompactString::const_new("cargo-bins"), + repo: CompactString::const_new("ttt"), }]; init_logger(); @@ -610,12 +610,12 @@ mod test { )]; const NON_EXISTENT_RELEASES: [GhRelease; 1] = [GhRelease { repo: GhRepo { - owner: CompactString::new_inline("cargo-bins"), - repo: CompactString::new_inline("cargo-binstall"), + owner: CompactString::const_new("cargo-bins"), + repo: CompactString::const_new("cargo-binstall"), }, // We are currently at v0.20.1 and we would never release // anything older than v0.20.1 - tag: CompactString::new_inline("v0.18.2"), + tag: CompactString::const_new("v0.18.2"), }]; init_logger(); diff --git a/crates/binstalk-git-repo-api/src/gh_api_client/error.rs b/crates/binstalk-git-repo-api/src/gh_api_client/error.rs index 1787a372..0a2918a9 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client/error.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client/error.rs @@ -197,7 +197,7 @@ mod test { assert_matches!(deserialize("RATE_LIMITED"), GraphQLErrorType::RateLimited); assert_matches!( deserialize("rATE_LIMITED"), - GraphQLErrorType::Other(val) if val == CompactString::new("rATE_LIMITED") + GraphQLErrorType::Other(val) if val == CompactString::const_new("rATE_LIMITED") ); } } diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index b66070ea..151829e3 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -12,7 +12,7 @@ license = "Apache-2.0 OR MIT" [dependencies] beef = { version = "0.5.2", features = ["impl_serde"] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } -compact_str = { version = "0.7.0", features = ["serde"] } +compact_str = { version = "0.8.0", features = ["serde"] } fs-lock = { version = "0.1.3", path = "../fs-lock" } home = "0.5.9" miette = "7.0.0" diff --git a/crates/binstalk-manifests/src/cargo_config.rs b/crates/binstalk-manifests/src/cargo_config.rs index 21fac013..a92cc104 100644 --- a/crates/binstalk-manifests/src/cargo_config.rs +++ b/crates/binstalk-manifests/src/cargo_config.rs @@ -210,7 +210,7 @@ root = "/some/path" # `cargo install` destination directory ); let http = config.http.unwrap(); - assert_eq!(http.proxy.unwrap(), CompactString::new_inline("host:port")); + assert_eq!(http.proxy.unwrap(), CompactString::const_new("host:port")); assert_eq!(http.timeout.unwrap(), 30); assert_eq!(http.cainfo.unwrap(), Path::new("root").join("cert.pem")); @@ -218,7 +218,7 @@ root = "/some/path" # `cargo install` destination directory assert_eq!(env.len(), 3); assert_eq!( env.get("ENV_VAR_NAME").unwrap(), - &Env::Value(CompactString::new("value")) + &Env::Value(CompactString::const_new("value")) ); assert_eq!( env.get("ENV_VAR_NAME_2").unwrap(), diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 727e3c5e..940b48db 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -18,7 +18,7 @@ binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", def ] } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.0", path = "../cargo-toml-workspace" } -compact_str = { version = "0.7.0", features = ["serde"] } +compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } diff --git a/crates/binstalk-registry/src/common.rs b/crates/binstalk-registry/src/common.rs index 17f5fefa..cd426298 100644 --- a/crates/binstalk-registry/src/common.rs +++ b/crates/binstalk-registry/src/common.rs @@ -96,10 +96,10 @@ pub(super) fn crate_prefix_components( match (chars.next(), chars.next(), chars.next(), chars.next()) { (None, None, None, None) => Err(RegistryError::NotFound(crate_name.into())), - (Some(_), None, None, None) => Ok((CompactString::new("1"), None)), - (Some(_), Some(_), None, None) => Ok((CompactString::new("2"), None)), + (Some(_), None, None, None) => Ok((CompactString::const_new("1"), None)), + (Some(_), Some(_), None, None) => Ok((CompactString::const_new("2"), None)), (Some(ch), Some(_), Some(_), None) => Ok(( - CompactString::new("3"), + CompactString::const_new("3"), Some(ch.to_lowercase().to_compact_string()), )), (Some(a), Some(b), Some(c), Some(d)) => Ok(( @@ -127,7 +127,7 @@ pub(super) fn render_dl_template( struct Context<'a> { crate_name: &'a str, crate_prefix: CompactString, - crate_lowerprefix: String, + crate_lowerprefix: CompactString, version: &'a str, cksum: &'a str, } diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 4d7ed95e..8560eb7c 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -compact_str = { version = "0.7.0", features = ["serde"] } +compact_str = { version = "0.8.0", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.18.0" semver = { version = "1.0.17", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 8d6a291c..f067de70 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -20,7 +20,7 @@ binstalk-registry = { version = "0.9.1", path = "../binstalk-registry" } binstalk-types = { version = "0.7.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } -compact_str = { version = "0.7.0", features = ["serde"] } +compact_str = { version = "0.8.0", features = ["serde"] } detect-targets = { version = "0.1.17", path = "../detect-targets", features = [ "tracing", ] } diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 6c6fca80..f1f5157d 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] cargo_toml = "0.20.0" -compact_str = { version = "0.7.0", features = ["serde"] } +compact_str = { version = "0.8.0", features = ["serde"] } glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } serde = "1.0.163" From 74af0e7f8a895aa8ccb53d95f62ad51dc7850c91 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 13 Jul 2024 18:49:45 +1000 Subject: [PATCH 1810/2020] Mark binstalk_manifests::cargo_crates_v1::CratesToml::insert private (#1818) It uses a private type so it should not have public visibility. Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/binstalk-manifests/src/cargo_crates_v1.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/binstalk-manifests/src/cargo_crates_v1.rs b/crates/binstalk-manifests/src/cargo_crates_v1.rs index 8c57299b..6e8100be 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1.rs @@ -68,7 +68,7 @@ impl CratesToml<'_> { /// Only use it when you know that the crate is not in the manifest. /// Otherwise, you need to call [`CratesToml::remove`] first. - pub fn insert(&mut self, cvs: &CrateVersionSource, bins: Vec) { + fn insert(&mut self, cvs: &CrateVersionSource, bins: Vec) { self.v1.push((cvs.to_string(), Cow::owned(bins))); } From fdfc89c28704785027e1be612f5da6df65845653 Mon Sep 17 00:00:00 2001 From: Kristof Mattei <864376+kristof-mattei@users.noreply.github.com> Date: Sun, 14 Jul 2024 07:45:41 -0700 Subject: [PATCH 1811/2020] fix: normalize GitHub URLs ending in .git to not ending in .git (#1804) * fix: normalize GitHub URLs ending in .git to not ending in .git * Refactor `Data::get_repo_info` Signed-off-by: Jiahao XU * Fix `get_repo_info` for repo with `.git` suffix Signed-off-by: Jiahao XU * Add e2e-tests to cover it Signed-off-by: Jiahao XU * Always try geting the redirected url This would help: - redirect public gh repo `.git` to its canonical form - redirect public gh repo, which has been recently renamed - cases where redirection is needed to get the real repo This commit make it fallbacks to the previou surl, if getting the redirected url fail, in case the repository is private. Signed-off-by: Jiahao XU * Add more e2e-tests Signed-off-by: Jiahao XU * Optimize: Do not try redirect if gh_get_repo_info fail Signed-off-by: Jiahao XU * Minor refactor Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU Co-authored-by: Jiahao XU --- crates/binstalk-fetchers/src/lib.rs | 143 +++++++++++++----- e2e-tests/manifests/github-test-Cargo2.toml | 2 +- e2e-tests/manifests/gitlab-test-Cargo.toml | 2 +- .../private-github-repo-test-Cargo.toml | 2 +- 4 files changed, 106 insertions(+), 43 deletions(-) diff --git a/crates/binstalk-fetchers/src/lib.rs b/crates/binstalk-fetchers/src/lib.rs index f589e5fc..5d4f692a 100644 --- a/crates/binstalk-fetchers/src/lib.rs +++ b/crates/binstalk-fetchers/src/lib.rs @@ -3,7 +3,7 @@ use std::{path::Path, sync::Arc, time::Duration}; use binstalk_downloader::{download::DownloadError, remote::Error as RemoteError}; -use binstalk_git_repo_api::gh_api_client::{GhApiError, GhRepo}; +use binstalk_git_repo_api::gh_api_client::{GhApiError, GhRepo, RepoInfo as GhRepoInfo}; use binstalk_types::cargo_toml_binstall::SigningAlgorithm; use thiserror::Error as ThisError; use tokio::{sync::OnceCell, task::JoinError, time::sleep}; @@ -185,6 +185,81 @@ impl Data { #[instrument(skip(client))] async fn get_repo_info(&self, client: &GhApiClient) -> Result, FetchError> { + async fn gh_get_repo_info( + client: &GhApiClient, + gh_repo: &GhRepo, + ) -> Result { + loop { + match client.get_repo_info(gh_repo).await { + Ok(Some(gh_repo_info)) => break Ok(gh_repo_info), + Ok(None) => break Err(GhApiError::NotFound), + Err(GhApiError::RateLimit { retry_after }) => { + sleep(retry_after.unwrap_or(DEFAULT_GH_API_RETRY_DURATION)).await + } + Err(err) => break Err(err), + } + } + } + + async fn get_repo_info_inner( + repo: &str, + client: &GhApiClient, + ) -> Result { + let repo = Url::parse(repo)?; + let mut repo = client + .remote_client() + .get_redirected_final_url(repo.clone()) + .await + .unwrap_or(repo); + let repository_host = RepositoryHost::guess_git_hosting_services(&repo); + + let subcrate = RepoInfo::detect_subcrate(&mut repo, repository_host); + + if let Some(repo) = repo + .as_str() + .strip_suffix(".git") + .and_then(|s| Url::parse(s).ok()) + { + let repository_host = RepositoryHost::guess_git_hosting_services(&repo); + match GhRepo::try_extract_from_url(&repo) { + Some(gh_repo) if client.has_gh_token() => { + if let Ok(gh_repo_info) = gh_get_repo_info(client, &gh_repo).await { + return Ok(RepoInfo { + subcrate, + repository_host, + repo, + is_private: gh_repo_info.is_private(), + }); + } + } + _ => { + if let Ok(repo) = + client.remote_client().get_redirected_final_url(repo).await + { + return Ok(RepoInfo { + subcrate, + repository_host: RepositoryHost::guess_git_hosting_services(&repo), + repo, + is_private: false, + }); + } + } + } + } + + Ok(RepoInfo { + is_private: match GhRepo::try_extract_from_url(&repo) { + Some(gh_repo) if client.has_gh_token() => { + gh_get_repo_info(client, &gh_repo).await?.is_private() + } + _ => false, + }, + subcrate, + repo, + repository_host, + }) + } + self.repo_info .get_or_try_init(move || { Box::pin(async move { @@ -192,45 +267,7 @@ impl Data { return Ok(None); }; - let mut repo = Url::parse(repo)?; - let mut repository_host = RepositoryHost::guess_git_hosting_services(&repo); - - if repository_host == RepositoryHost::Unknown { - repo = client - .remote_client() - .get_redirected_final_url(repo) - .await?; - repository_host = RepositoryHost::guess_git_hosting_services(&repo); - } - - let subcrate = RepoInfo::detect_subcrate(&mut repo, repository_host); - - let mut is_private = false; - if repository_host == RepositoryHost::GitHub && client.has_gh_token() { - if let Some(gh_repo) = GhRepo::try_extract_from_url(&repo) { - loop { - match client.get_repo_info(&gh_repo).await { - Ok(Some(gh_repo_info)) => { - is_private = gh_repo_info.is_private(); - break; - } - Ok(None) => return Err(GhApiError::NotFound.into()), - Err(GhApiError::RateLimit { retry_after }) => { - sleep(retry_after.unwrap_or(DEFAULT_GH_API_RETRY_DURATION)) - .await - } - Err(err) => return Err(err.into()), - } - } - } - } - - let repo_info = RepoInfo { - subcrate, - repo, - repository_host, - is_private, - }; + let repo_info = get_repo_info_inner(repo, client).await?; debug!("Resolved repo_info = {repo_info:#?}"); @@ -322,6 +359,8 @@ pub type TargetDataErased = TargetData #[cfg(test)] mod test { + use std::num::{NonZeroU16, NonZeroU64}; + use super::*; #[test] @@ -388,4 +427,28 @@ mod test { ); } } + + #[tokio::test] + async fn test_ignore_dot_git_for_github_repos() { + let url_without_git = "https://github.com/cargo-bins/cargo-binstall"; + let url_with_git = format!("{}.git", url_without_git); + + let data = Data::new("cargo-binstall".into(), "v1.2.3".into(), Some(url_with_git)); + + let gh_client = GhApiClient::new( + Client::new( + "user-agent", + None, + NonZeroU16::new(1000).unwrap(), + NonZeroU64::new(1000).unwrap(), + [], + ) + .unwrap(), + None, + ); + + let repo_info = data.get_repo_info(&gh_client).await.unwrap().unwrap(); + + assert_eq!(url_without_git, repo_info.repo.as_str()); + } } diff --git a/e2e-tests/manifests/github-test-Cargo2.toml b/e2e-tests/manifests/github-test-Cargo2.toml index aa47c496..8732c248 100644 --- a/e2e-tests/manifests/github-test-Cargo2.toml +++ b/e2e-tests/manifests/github-test-Cargo2.toml @@ -1,7 +1,7 @@ [package] name = "cargo-binstall" description = "Rust binary package installer for CI integration" -repository = "https://github.com/cargo-bins/cargo-binstall" +repository = "https://github.com/cargo-bins/cargo-binstall.git" version = "0.12.0" rust-version = "1.61.0" authors = ["ryan "] diff --git a/e2e-tests/manifests/gitlab-test-Cargo.toml b/e2e-tests/manifests/gitlab-test-Cargo.toml index 2fd25046..5d8ae7f9 100644 --- a/e2e-tests/manifests/gitlab-test-Cargo.toml +++ b/e2e-tests/manifests/gitlab-test-Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cargo-binstall" description = "Rust binary package installer for CI integration" -repository = "https://gitlab.kitware.com/NobodyXu/hello-world" +repository = "https://gitlab.kitware.com/NobodyXu/hello-world.git" version = "0.2.0" rust-version = "1.61.0" authors = ["ryan "] diff --git a/e2e-tests/manifests/private-github-repo-test-Cargo.toml b/e2e-tests/manifests/private-github-repo-test-Cargo.toml index cf5cf9e6..38e3ea76 100644 --- a/e2e-tests/manifests/private-github-repo-test-Cargo.toml +++ b/e2e-tests/manifests/private-github-repo-test-Cargo.toml @@ -1,7 +1,7 @@ [package] name = "cargo-binstall" description = "Rust binary package installer for CI integration" -repository = "https://github.com/cargo-bins/private-repo-for-testing" +repository = "https://github.com/cargo-bins/private-repo-for-testing.git" version = "0.12.0" rust-version = "1.61.0" authors = ["ryan "] From 5a316b765f6d145806aaadc50f925b46ac3e3c9f Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 16 Jul 2024 00:10:12 +1000 Subject: [PATCH 1812/2020] Fix url link in README.md (#1820) Fixed #1819 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c4abb998..472e3ff7 100644 --- a/README.md +++ b/README.md @@ -110,7 +110,7 @@ When Binstall is available, it installs from binary whenever possible... and you ## Unsupported crates Binstall is generally smart enough to auto-detect artifacts in most situations. -However, if a package fails to install, you can manually specify the `pkg-url`, `bin-dir`, and `pkg-fmt` as needed at the command line, with values as documented in [SUPPORT.md](./SUPPORT.md). +However, if a package fails to install, you can manually specify the `pkg-url`, `bin-dir`, and `pkg-fmt` as needed at the command line, with values as documented in [SUPPORT.md](https://github.com/cargo-bins/cargo-binstall/blob/main/SUPPORT.md). ```console $ cargo-binstall \ @@ -119,11 +119,11 @@ $ cargo-binstall \ crate_name ``` -Maintainers wanting to make their users' life easier can add [explicit Binstall metadata](./SUPPORT.md) to `Cargo.toml` to locate the appropriate binary package for a given version and target. +Maintainers wanting to make their users' life easier can add [explicit Binstall metadata](https://github.com/cargo-bins/cargo-binstall/blob/main/SUPPORT.md) to `Cargo.toml` to locate the appropriate binary package for a given version and target. ## Signatures -We have initial, limited [support](./SIGNING.md) for maintainers to specify a signing public key and where to find package signatures. +We have initial, limited [support](https://github.com/cargo-bins/cargo-binstall/blob/main/SIGNING.md) for maintainers to specify a signing public key and where to find package signatures. With this enabled, Binstall will download and verify signatures for that package. You can use `--only-signed` to refuse to install packages if they're not signed. @@ -142,7 +142,7 @@ Also, there's this great and woefully underused (IMO) `[package.metadata]` field ### Is this secure? Yes and also no? -We have [initial support](./SIGNING.md) for verifying signatures, but not a lot of the ecosystem produces signatures at the moment. +We have [initial support](https://github.com/cargo-bins/cargo-binstall/blob/main/SIGNING.md) for verifying signatures, but not a lot of the ecosystem produces signatures at the moment. See [#1](https://github.com/cargo-bins/cargo-binstall/issues/1) to discuss more on this. We always pull the metadata from crates.io over HTTPS, and verify the checksum of the crate tar. From eba07fb147c0bdaf493421d58c8b5d8c1c73af52 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Wed, 17 Jul 2024 15:34:12 +1000 Subject: [PATCH 1813/2020] Fix v1 manifest format for git and local path (#1821) * Bump simple-git to v0.2.10 Signed-off-by: Jiahao XU * Fix v1 manifest format for git and local path Fixed #1815 Signed-off-by: Jiahao XU * Fix v1 format for custom registry Signed-off-by: Jiahao XU * Remove unused functions Signed-off-by: Jiahao XU * Fix compilation Signed-off-by: Jiahao XU * Update git.sh Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fixed git.sh for windows Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * fixx git.sh for win Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Update git.sh Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * fix git.sh Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- Cargo.lock | 4 +- .../binstalk-manifests/src/cargo_crates_v1.rs | 6 -- .../cargo_crates_v1/crate_version_source.rs | 8 +- crates/binstalk-registry/src/git_registry.rs | 6 +- crates/binstalk-registry/src/lib.rs | 12 ++- .../binstalk-registry/src/sparse_registry.rs | 6 ++ crates/binstalk/Cargo.toml | 2 +- crates/binstalk/src/ops/resolve.rs | 74 +++++++++++++++---- crates/binstalk/src/ops/resolve/resolution.rs | 3 +- e2e-tests/git.sh | 17 ++++- e2e-tests/manifest-path.sh | 3 + e2e-tests/registries.sh | 9 ++- 12 files changed, 112 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bbe839ee..b229b76b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3718,9 +3718,9 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48955a621e2b4a92fdb9fcbf8a5bf0e56b15a56bfe09e6defc01cb25ca59f31c" +checksum = "ceb5955ab3b66f8c0f0557873ca472c196d30a6c19696074ce3aca4c226b5c3a" dependencies = [ "compact_str", "derive_destructure2", diff --git a/crates/binstalk-manifests/src/cargo_crates_v1.rs b/crates/binstalk-manifests/src/cargo_crates_v1.rs index 6e8100be..a4821285 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1.rs @@ -66,12 +66,6 @@ impl CratesToml<'_> { Self::load_from_reader(file) } - /// Only use it when you know that the crate is not in the manifest. - /// Otherwise, you need to call [`CratesToml::remove`] first. - fn insert(&mut self, cvs: &CrateVersionSource, bins: Vec) { - self.v1.push((cvs.to_string(), Cow::owned(bins))); - } - pub fn remove(&mut self, name: &str) { self.v1.retain(|(s, _bin)| { s.split_once(' ') diff --git a/crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs b/crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs index 389bed2a..a705bba2 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1/crate_version_source.rs @@ -1,6 +1,6 @@ use std::{borrow::Cow, fmt, str::FromStr}; -use binstalk_types::{crate_info::cratesio_url, maybe_owned::MaybeOwned}; +use binstalk_types::maybe_owned::MaybeOwned; use compact_str::CompactString; use miette::Diagnostic; use semver::Version; @@ -42,12 +42,6 @@ pub enum Source<'a> { Registry(MaybeOwned<'a, Url>), } -impl Source<'static> { - pub fn cratesio_registry() -> Self { - Self::Registry(MaybeOwned::Borrowed(cratesio_url())) - } -} - impl<'a> From<&'a CrateSource> for Source<'a> { fn from(source: &'a CrateSource) -> Self { use SourceType::*; diff --git a/crates/binstalk-registry/src/git_registry.rs b/crates/binstalk-registry/src/git_registry.rs index 518a48b0..b707b602 100644 --- a/crates/binstalk-registry/src/git_registry.rs +++ b/crates/binstalk-registry/src/git_registry.rs @@ -1,4 +1,4 @@ -use std::{io, path::PathBuf, sync::Arc}; +use std::{fmt::Display, io, path::PathBuf, sync::Arc}; use binstalk_downloader::remote::Client; use binstalk_types::cargo_toml_binstall::Meta; @@ -73,6 +73,10 @@ impl GitRegistry { })) } + pub fn url(&self) -> impl Display + '_ { + &self.0.url + } + /// WARNING: This is a blocking operation. fn find_crate_matched_ver( repo: &Repository, diff --git a/crates/binstalk-registry/src/lib.rs b/crates/binstalk-registry/src/lib.rs index 59c40c7e..6dd19ecc 100644 --- a/crates/binstalk-registry/src/lib.rs +++ b/crates/binstalk-registry/src/lib.rs @@ -1,6 +1,6 @@ #![cfg_attr(docsrs, feature(doc_auto_cfg))] -use std::{io, str::FromStr, sync::Arc}; +use std::{fmt, io, str::FromStr, sync::Arc}; use base16::DecodeError as Base16DecodeError; use binstalk_downloader::{ @@ -197,6 +197,16 @@ impl Registry { } } +impl fmt::Display for Registry { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + match self { + #[cfg(feature = "git")] + Registry::Git(registry) => fmt::Display::fmt(®istry.url(), f), + Registry::Sparse(registry) => fmt::Display::fmt(®istry.url(), f), + } + } +} + impl FromStr for Registry { type Err = InvalidRegistryError; diff --git a/crates/binstalk-registry/src/sparse_registry.rs b/crates/binstalk-registry/src/sparse_registry.rs index 7dca1b32..48a4f5b2 100644 --- a/crates/binstalk-registry/src/sparse_registry.rs +++ b/crates/binstalk-registry/src/sparse_registry.rs @@ -1,3 +1,5 @@ +use std::fmt::Display; + use binstalk_downloader::remote::{Client, Error as RemoteError}; use binstalk_types::cargo_toml_binstall::Meta; use cargo_toml_workspace::cargo_toml::Manifest; @@ -28,6 +30,10 @@ impl SparseRegistry { } } + pub fn url(&self) -> impl Display + '_ { + &self.url + } + async fn get_dl_template(&self, client: &Client) -> Result<&str, RegistryError> { self.dl_template .get_or_try_init(|| { diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index f067de70..d5e6f75a 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -31,7 +31,7 @@ leon = "3.0.0" maybe-owned = "0.3.4" miette = "7.0.0" semver = { version = "1.0.17", features = ["serde"] } -simple-git = { version = "0.2.4", optional = true } +simple-git = { version = "0.2.10", optional = true } strum = "0.26.1" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index b8e02374..5c6379d9 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -8,6 +8,7 @@ use std::{ }; use binstalk_fetchers::FETCHER_GH_CRATE_META; +use binstalk_types::crate_info::{CrateSource, SourceType}; use compact_str::{CompactString, ToCompactString}; use itertools::Itertools; use leon::Template; @@ -15,6 +16,7 @@ use maybe_owned::MaybeOwned; use semver::{Version, VersionReq}; use tokio::task::spawn_blocking; use tracing::{debug, error, info, instrument, warn}; +use url::Url; use crate::{ bins, @@ -195,6 +197,7 @@ async fn resolve_inner( new_version: package_info.version, name: package_info.name, version_req: version_req_str, + source: package_info.source, bin_files, }))); } else { @@ -365,6 +368,7 @@ struct PackageInfo { binaries: Vec, name: CompactString, version_str: CompactString, + source: CrateSource, version: Version, repo: Option, overrides: BTreeMap, @@ -387,43 +391,80 @@ impl PackageInfo { use CargoTomlFetchOverride::*; // Fetch crate via crates.io, git, or use a local manifest path - let manifest = match opts.cargo_toml_fetch_override.as_ref() { - Some(Path(manifest_path)) => { - let manifest_path = manifest_path.clone(); - let name = name.clone(); + let (manifest, source) = match opts.cargo_toml_fetch_override.as_ref() { + Some(Path(manifest_path)) => ( + spawn_blocking({ + let manifest_path = manifest_path.clone(); + let name = name.clone(); - spawn_blocking(move || load_manifest_path(manifest_path, &name)).await?? - } + move || load_manifest_path(manifest_path, &name) + }) + .await??, + CrateSource { + source_type: SourceType::Path, + url: MaybeOwned::Owned(Url::parse(&format!( + "file://{}", + manifest_path.display() + ))?), + }, + ), #[cfg(feature = "git")] Some(Git(git_url)) => { use crate::helpers::git::{GitCancellationToken, Repository as GitRepository}; - let git_url = git_url.clone(); - let name = name.clone(); let cancellation_token = GitCancellationToken::default(); // Cancel git operation if the future is cancelled (dropped). let cancel_on_drop = cancellation_token.clone().cancel_on_drop(); - let ret = spawn_blocking(move || { - let dir = tempfile::TempDir::new()?; - GitRepository::shallow_clone(git_url, dir.as_ref(), Some(cancellation_token))?; + let (ret, commit_hash) = spawn_blocking({ + let git_url = git_url.clone(); + let name = name.clone(); + move || { + let dir = tempfile::TempDir::new()?; + let repo = GitRepository::shallow_clone( + git_url, + dir.as_ref(), + Some(cancellation_token), + )?; - load_manifest_from_workspace(dir.as_ref(), &name).map_err(BinstallError::from) + Ok::<_, BinstallError>(( + load_manifest_from_workspace(dir.as_ref(), &name) + .map_err(BinstallError::from)?, + repo.get_head_commit_hash()?, + )) + } }) .await??; // Git operation done, disarm it cancel_on_drop.disarm(); - ret + ( + ret, + CrateSource { + source_type: SourceType::Git, + url: MaybeOwned::Owned(Url::parse(&format!("{git_url}#{commit_hash}"))?), + }, + ) } - None => { + None => ( Box::pin( opts.registry .fetch_crate_matched(client, &name, version_req), ) - .await? - } + .await?, + { + let registry = format!("{}", opts.registry); + if registry == "https://index.crates.io/" { + CrateSource::cratesio_registry() + } else { + CrateSource { + source_type: SourceType::Registry, + url: MaybeOwned::Owned(Url::parse(®istry)?), + } + } + }, + ), }; let Some(mut package) = manifest.package else { @@ -479,6 +520,7 @@ impl PackageInfo { meta, binaries, name, + source, version_str: new_version_str, version: new_version, repo: package.repository().map(ToString::to_string), diff --git a/crates/binstalk/src/ops/resolve/resolution.rs b/crates/binstalk/src/ops/resolve/resolution.rs index 9c149dea..75d4f398 100644 --- a/crates/binstalk/src/ops/resolve/resolution.rs +++ b/crates/binstalk/src/ops/resolve/resolution.rs @@ -22,6 +22,7 @@ pub struct ResolutionFetch { pub name: CompactString, pub version_req: CompactString, pub bin_files: Vec, + pub source: CrateSource, } pub struct ResolutionSource { @@ -84,7 +85,7 @@ impl ResolutionFetch { name: self.name, version_req: self.version_req, current_version: self.new_version, - source: CrateSource::cratesio_registry(), + source: self.source, target: self.fetcher.target().to_compact_string(), bins: self .bin_files diff --git a/e2e-tests/git.sh b/e2e-tests/git.sh index 8058d49c..0811f88b 100644 --- a/e2e-tests/git.sh +++ b/e2e-tests/git.sh @@ -46,16 +46,29 @@ cp -r manifests/workspace/* "$GIT" git add . git commit -m 'Update to workspace' ) +COMMIT_HASH="$(cd "$GIT" && git rev-parse HEAD)" -# Install binaries using `--git` +if [ "$OSTYPE" = "cygwin" ] || [ "$OSTYPE" = "msys" ]; then + source="(git+file:///$(cygpath -m "$GIT")#$COMMIT_HASH)" +else + source="(git+file://$GIT#$COMMIT_HASH)" +fi + +# Install cargo-binstall using `--git` "./$1" binstall --force --git "file://$GIT" --no-confirm cargo-binstall test_cargo_binstall_install -# Install binaries using `--git` +cat "$CARGO_HOME/.crates.toml" +grep -F "cargo-binstall 0.12.0 $source" <"$CARGO_HOME/.crates.toml" + +# Install cargo-watch using `--git` "./$1" binstall --force --git "file://$GIT" --no-confirm cargo-watch cargo_watch_version="$(cargo watch -V)" echo "$cargo_watch_version" [ "$cargo_watch_version" = "cargo-watch 8.4.0" ] + +cat "$CARGO_HOME/.crates.toml" +grep -F "cargo-watch 8.4.0 $source" <"$CARGO_HOME/.crates.toml" diff --git a/e2e-tests/manifest-path.sh b/e2e-tests/manifest-path.sh index 88cefad6..35f2a1b7 100755 --- a/e2e-tests/manifest-path.sh +++ b/e2e-tests/manifest-path.sh @@ -19,3 +19,6 @@ cargo_binstall_version="$(cargo binstall -V)" echo "$cargo_binstall_version" [ "$cargo_binstall_version" = "cargo-binstall 0.12.0" ] + +cat "$CARGO_HOME/.crates.toml" +grep -F "cargo-binstall 0.12.0 (path+file://manifests/github-test-Cargo.toml)" <"$CARGO_HOME/.crates.toml" diff --git a/e2e-tests/registries.sh b/e2e-tests/registries.sh index 7eb3f041..7be7ffaf 100644 --- a/e2e-tests/registries.sh +++ b/e2e-tests/registries.sh @@ -43,20 +43,27 @@ EOF # Install binaries using default registry in config "./$1" binstall --force -y cargo-binstall@0.12.0 +grep -F "cargo-binstall 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" <"$CARGO_HOME/.crates.toml" + test_cargo_binstall_install # Install binaries using registry t2 in config "./$1" binstall --force --registry t2 -y cargo-binstall@0.12.0 +grep -F "cargo-binstall 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" <"$CARGO_HOME/.crates.toml" + test_cargo_binstall_install # Install binaries using registry t3 in env CARGO_REGISTRIES_t3_INDEX='sparse+https://index.crates.io/' "./$1" binstall --force --registry t3 -y cargo-binstall@0.12.0 -test_cargo_binstall_install +grep -F "cargo-binstall 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" <"$CARGO_HOME/.crates.toml" +test_cargo_binstall_install # Install binaries using index directly "./$1" binstall --force --index 'sparse+https://index.crates.io/' -y cargo-binstall@0.12.0 +grep -F "cargo-binstall 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" <"$CARGO_HOME/.crates.toml" + test_cargo_binstall_install From fbe6e4c83a57f60c7a93a426f239b72ba08b0a9b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 19 Jul 2024 04:03:34 +0000 Subject: [PATCH 1814/2020] dep: Upgrade transitive dependencies (#1825) Co-authored-by: github-actions --- Cargo.lock | 63 +++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b229b76b..1dfb3697 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -508,9 +508,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.0" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "514de17de45fdb8dc022b1a7975556c53c86f9f0aa5f534b98977b171857c2c9" +checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" [[package]] name = "bytesize" @@ -636,13 +636,12 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.0" +version = "1.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaff6f8ce506b9773fa786672d63fc7a191ffea1be33f72bbd4aeacefca9ffc8" +checksum = "324c74f2155653c90b04f25b2a47a8a631360cb908f92a772695f430c7e31052" dependencies = [ "jobserver", "libc", - "once_cell", ] [[package]] @@ -864,9 +863,9 @@ dependencies = [ [[package]] name = "deflate64" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83ace6c86376be0b6cdcf3fb41882e81d94b31587573d1cfa9d01cd06bba210d" +checksum = "da692b8d1080ea3045efaab14434d40468c3d8657e42abddfffca87b428f4c1b" [[package]] name = "deranged" @@ -963,9 +962,9 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "embed-resource" -version = "2.4.2" +version = "2.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6985554d0688b687c5cb73898a34fbe3ad6c24c58c238a4d91d5e840670ee9d" +checksum = "4edcacde9351c33139a41e3c97eb2334351a81a2791bebb0b243df837128f602" dependencies = [ "cc", "memchr", @@ -1734,9 +1733,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca987128ffb056d732bd545db5db3d8b103d252fbf083c2567bb0796876619a4" +checksum = "8d23d5bbda31344d8abc8de7c075b3cf26e5873feba7c4a15d916bce67382bd9" dependencies = [ "bstr", "gix-trace", @@ -2269,9 +2268,9 @@ dependencies = [ [[package]] name = "http-body" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cac85db508abc24a2e48553ba12a996e87244a0395ce011e62b37158745d643" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", "http 1.1.0", @@ -2976,7 +2975,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.2", + "redox_syscall 0.5.3", "smallvec", "windows-targets 0.52.6", ] @@ -3242,9 +3241,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.2" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c82cf8cff14456045f55ec4241383baeff27af886adb72ffb2162f99911de0fd" +checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" dependencies = [ "bitflags 2.6.0", ] @@ -3563,9 +3562,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c627723fd09706bacdb5cf41499e95098555af3c3c29d014dc3c458ef6be11c0" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ "bitflags 2.6.0", "core-foundation", @@ -3576,9 +3575,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.0" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317936bbbd05227752583946b9e66d7ce3b489f84e11a94a510b4437fef407d7" +checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" dependencies = [ "core-foundation-sys", "libc", @@ -3833,9 +3832,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.70" +version = "2.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" +checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" dependencies = [ "proc-macro2", "quote", @@ -3910,18 +3909,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.62" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2675633b1499176c2dff06b0856a27976a8f9d436737b4cf4f312d4d91d8bbb" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.62" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d20468752b09f49e909e55a5d338caa8bedf615594e9d80bc4c565d30faf798c" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", @@ -3988,9 +3987,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.0" +version = "1.38.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4f4a02a7a80d6f274636f0aa95c7e383b912d41fe721a31f29e29698585a4a" +checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" dependencies = [ "backtrace", "bytes", @@ -4088,9 +4087,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.14" +version = "0.8.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f49eb2ab21d2f26bd6db7bf383edc527a7ebaee412d17af4d40fdccd442f335" +checksum = "ac2caab0bf757388c6c0ae23b3293fdb463fee59434529014f85e3263b995c28" dependencies = [ "serde", "serde_spanned", @@ -4109,9 +4108,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.15" +version = "0.22.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59a3a72298453f564e2b111fa896f8d07fabb36f51f06d7e875fc5e0b5a3ef1" +checksum = "278f3d518e152219c994ce877758516bca5e118eaed6996192a774fb9fbf0788" dependencies = [ "indexmap", "serde", From 09d61d081dcc46f5a4483c1444ed69f2a5d44e62 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 08:12:40 +1000 Subject: [PATCH 1815/2020] build(deps): bump openssl from 0.10.64 to 0.10.66 in the cargo group (#1829) Bumps the cargo group with 1 update: [openssl](https://github.com/sfackler/rust-openssl). Updates `openssl` from 0.10.64 to 0.10.66 - [Release notes](https://github.com/sfackler/rust-openssl/releases) - [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.64...openssl-v0.10.66) --- updated-dependencies: - dependency-name: openssl dependency-type: indirect dependency-group: cargo ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1dfb3697..3ad0d864 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2891,9 +2891,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "openssl" -version = "0.10.64" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a0481286a310808298130d22dd1fef0fa571e05a8f44ec801801e84b216b1f" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -2923,9 +2923,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.102" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c597637d56fbc83893a35eb0dd04b2b8e7a50c91e64e9493e398b5df4fb45fa2" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", From 3f29fbe83a15cd56afbf4726841b280550f507f5 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Wed, 24 Jul 2024 00:05:22 +1000 Subject: [PATCH 1816/2020] Feature: SupportdDisable of strategies for crate using `Cargo.toml` (#1828) * Refactor: Move `Strategy` to `binstalk-types` Signed-off-by: Jiahao XU * Add serialisation test for `Strategy` Signed-off-by: Jiahao XU * Add support to disable strategies via crate `Cargo.toml` Signed-off-by: Jiahao XU * Add e2e-test Signed-off-by: Jiahao XU * Fix `Cargo.toml` disabled strategy checking for compile strategy Signed-off-by: Jiahao XU * Optimize `resolve_inner`: Cache meta override Signed-off-by: Jiahao XU * Add compile-time length checking for `Strategy` Signed-off-by: Jiahao XU * More optimization Signed-off-by: Jiahao XU * Fix order of override: cli options alwayus takes precedence Signed-off-by: Jiahao XU * Add missing manifest for e2e-test Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- Cargo.lock | 1 + crates/bin/src/args.rs | 51 +++++++----- crates/bin/src/entry.rs | 13 ++- crates/binstalk-fetchers/src/gh_crate_meta.rs | 5 ++ crates/binstalk-fetchers/src/lib.rs | 5 +- crates/binstalk-fetchers/src/quickinstall.rs | 6 +- crates/binstalk-types/Cargo.toml | 3 + .../binstalk-types/src/cargo_toml_binstall.rs | 65 +++++++++++++++ crates/binstalk/src/ops/resolve.rs | 82 ++++++++++++------- .../manifests/strategies-test-Cargo.toml | 19 +++++ e2e-tests/strategies.sh | 13 +++ 11 files changed, 206 insertions(+), 57 deletions(-) create mode 100644 e2e-tests/manifests/strategies-test-Cargo.toml diff --git a/Cargo.lock b/Cargo.lock index 3ad0d864..040048c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -425,6 +425,7 @@ dependencies = [ "once_cell", "semver", "serde", + "serde_json", "strum", "strum_macros", "url", diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index e81f1970..061fbdab 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -13,12 +13,12 @@ use binstalk::{ ops::resolve::{CrateName, VersionReqExt}, registry::Registry, }; -use clap::{error::ErrorKind, CommandFactory, Parser, ValueEnum}; +use binstalk_manifests::cargo_toml_binstall::Strategy; +use clap::{builder::PossibleValue, error::ErrorKind, CommandFactory, Parser, ValueEnum}; use compact_str::CompactString; use log::LevelFilter; use semver::VersionReq; use strum::EnumCount; -use strum_macros::EnumCount; use zeroize::Zeroizing; #[derive(Debug, Parser)] @@ -162,13 +162,13 @@ pub struct Args { value_delimiter(','), env = "BINSTALL_STRATEGIES" )] - pub(crate) strategies: Vec, + pub(crate) strategies: Vec, /// Disable the strategies specified. /// If a strategy is specified in `--strategies` and `--disable-strategies`, /// then it will be removed. #[clap(help_heading = "Overrides", long, value_delimiter(','))] - pub(crate) disable_strategies: Vec, + pub(crate) disable_strategies: Vec, /// If `--github-token` or environment variable `GITHUB_TOKEN`/`GH_TOKEN` /// is not specified, then cargo-binstall will try to extract github token from @@ -431,16 +431,24 @@ impl Default for RateLimit { } /// Strategy for installing the package -#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, ValueEnum, EnumCount)] -#[repr(u8)] -pub(crate) enum Strategy { - /// Attempt to download official pre-built artifacts using - /// information provided in `Cargo.toml`. - CrateMetaData, - /// Query third-party QuickInstall for the crates. - QuickInstall, - /// Build the crates from source using `cargo-build`. - Compile, +#[derive(Debug, Copy, Clone, Eq, PartialEq, Ord, PartialOrd)] +pub(crate) struct StrategyWrapped(pub(crate) Strategy); + +impl StrategyWrapped { + const VARIANTS: &'static [Self; 3] = &[ + Self(Strategy::CrateMetaData), + Self(Strategy::QuickInstall), + Self(Strategy::Compile), + ]; +} + +impl ValueEnum for StrategyWrapped { + fn value_variants<'a>() -> &'a [Self] { + Self::VARIANTS + } + fn to_possible_value(&self) -> Option { + Some(PossibleValue::new(self.0.to_str())) + } } pub fn parse() -> Args { @@ -532,7 +540,7 @@ You cannot use --{option} and specify multiple packages at the same time. Do one let mut is_variant_present = [false; Strategy::COUNT]; for strategy in &opts.strategies { - let index = *strategy as u8 as usize; + let index = strategy.0 as u8 as usize; if is_variant_present[index] { new_dup_strategy_err().exit() } else { @@ -543,9 +551,9 @@ You cannot use --{option} and specify multiple packages at the same time. Do one // Default strategies if empty if opts.strategies.is_empty() { opts.strategies = vec![ - Strategy::CrateMetaData, - Strategy::QuickInstall, - Strategy::Compile, + StrategyWrapped(Strategy::CrateMetaData), + StrategyWrapped(Strategy::QuickInstall), + StrategyWrapped(Strategy::Compile), ]; } @@ -573,7 +581,8 @@ You cannot use --{option} and specify multiple packages at the same time. Do one } // Ensure that Strategy::Compile is specified as the last strategy - if opts.strategies[..(opts.strategies.len() - 1)].contains(&Strategy::Compile) { + if opts.strategies[..(opts.strategies.len() - 1)].contains(&StrategyWrapped(Strategy::Compile)) + { command .error( ErrorKind::InvalidValue, @@ -593,10 +602,14 @@ You cannot use --{option} and specify multiple packages at the same time. Do one #[cfg(test)] mod test { + use strum::VariantArray; + use super::*; #[test] fn verify_cli() { Args::command().debug_assert() } + + const _: () = assert!(Strategy::VARIANTS.len() == StrategyWrapped::VARIANTS.len()); } diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 48288aa2..770c72fb 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -21,7 +21,9 @@ use binstalk::{ }, }; use binstalk_manifests::{ - cargo_config::Config, cargo_toml_binstall::PkgOverride, crates_manifests::Manifests, + cargo_config::Config, + cargo_toml_binstall::{PkgOverride, Strategy}, + crates_manifests::Manifests, }; use file_format::FileFormat; use home::cargo_home; @@ -30,11 +32,7 @@ use miette::{miette, Report, Result, WrapErr}; use tokio::task::block_in_place; use tracing::{debug, error, info, warn}; -use crate::{ - args::{Args, Strategy}, - gh_token, git_credentials, install_path, - ui::confirm, -}; +use crate::{args::Args, gh_token, git_credentials, install_path, ui::confirm}; pub fn install_crates( args: Args, @@ -46,7 +44,7 @@ pub fn install_crates( let resolvers: Vec<_> = args .strategies .into_iter() - .filter_map(|strategy| match strategy { + .filter_map(|strategy| match strategy.0 { Strategy::CrateMetaData => Some(GhCrateMeta::new as Resolver), Strategy::QuickInstall => Some(QuickInstall::new as Resolver), Strategy::Compile => { @@ -87,6 +85,7 @@ pub fn install_crates( pkg_url: args.pkg_url, pkg_fmt: args.pkg_fmt, bin_dir: args.bin_dir, + disabled_strategies: None, signing: None, }; diff --git a/crates/binstalk-fetchers/src/gh_crate_meta.rs b/crates/binstalk-fetchers/src/gh_crate_meta.rs index 51cd012c..d1df0637 100644 --- a/crates/binstalk-fetchers/src/gh_crate_meta.rs +++ b/crates/binstalk-fetchers/src/gh_crate_meta.rs @@ -1,6 +1,7 @@ use std::{borrow::Cow, fmt, iter, path::Path, sync::Arc}; use binstalk_git_repo_api::gh_api_client::{GhApiError, GhReleaseArtifact, GhReleaseArtifactUrl}; +use binstalk_types::cargo_toml_binstall::Strategy; use compact_str::{CompactString, ToCompactString}; use either::Either; use leon::Template; @@ -396,6 +397,10 @@ impl super::Fetcher for GhCrateMeta { FETCHER_GH_CRATE_META } + fn strategy(&self) -> Strategy { + Strategy::CrateMetaData + } + fn is_third_party(&self) -> bool { false } diff --git a/crates/binstalk-fetchers/src/lib.rs b/crates/binstalk-fetchers/src/lib.rs index 5d4f692a..49a86894 100644 --- a/crates/binstalk-fetchers/src/lib.rs +++ b/crates/binstalk-fetchers/src/lib.rs @@ -4,7 +4,7 @@ use std::{path::Path, sync::Arc, time::Duration}; use binstalk_downloader::{download::DownloadError, remote::Error as RemoteError}; use binstalk_git_repo_api::gh_api_client::{GhApiError, GhRepo, RepoInfo as GhRepoInfo}; -use binstalk_types::cargo_toml_binstall::SigningAlgorithm; +use binstalk_types::cargo_toml_binstall::{SigningAlgorithm, Strategy}; use thiserror::Error as ThisError; use tokio::{sync::OnceCell, task::JoinError, time::sleep}; pub use url::ParseError as UrlParseError; @@ -134,6 +134,9 @@ pub trait Fetcher: Send + Sync { /// [`Fetcher::fetch_and_extract`]. fn fetcher_name(&self) -> &'static str; + /// The strategy used by this fetcher + fn strategy(&self) -> Strategy; + /// Should return true if the remote is from a third-party source fn is_third_party(&self) -> bool; diff --git a/crates/binstalk-fetchers/src/quickinstall.rs b/crates/binstalk-fetchers/src/quickinstall.rs index 2862fb89..ad5d2f7d 100644 --- a/crates/binstalk-fetchers/src/quickinstall.rs +++ b/crates/binstalk-fetchers/src/quickinstall.rs @@ -5,7 +5,7 @@ use std::{ }; use binstalk_downloader::remote::Method; -use binstalk_types::cargo_toml_binstall::{PkgFmt, PkgMeta, PkgSigning}; +use binstalk_types::cargo_toml_binstall::{PkgFmt, PkgMeta, PkgSigning, Strategy}; use tokio::sync::OnceCell; use tracing::{error, info, trace}; use url::Url; @@ -252,6 +252,10 @@ by rust officially."#, "QuickInstall" } + fn strategy(&self) -> Strategy { + Strategy::QuickInstall + } + fn is_third_party(&self) -> bool { true } diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 8560eb7c..54e5d0ed 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -18,3 +18,6 @@ serde = { version = "1.0.163", features = ["derive"] } strum = "0.26.1" strum_macros = "0.26.1" url = { version = "2.3.1", features = ["serde"] } + +[dev-dependencies] +serde_json = "1" diff --git a/crates/binstalk-types/src/cargo_toml_binstall.rs b/crates/binstalk-types/src/cargo_toml_binstall.rs index 2c9af131..e1ab03c6 100644 --- a/crates/binstalk-types/src/cargo_toml_binstall.rs +++ b/crates/binstalk-types/src/cargo_toml_binstall.rs @@ -5,6 +5,7 @@ use std::{borrow::Cow, collections::BTreeMap}; use serde::{Deserialize, Serialize}; +use strum_macros::{EnumCount, VariantArray}; mod package_formats; #[doc(inline)] @@ -19,6 +20,41 @@ pub struct Meta { pub binstall: Option, } +/// Strategies to use for binary discovery +#[derive( + Debug, + Copy, + Clone, + Eq, + PartialEq, + Ord, + PartialOrd, + EnumCount, + VariantArray, + Deserialize, + Serialize, +)] +#[serde(rename_all = "kebab-case")] +pub enum Strategy { + /// Attempt to download official pre-built artifacts using + /// information provided in `Cargo.toml`. + CrateMetaData, + /// Query third-party QuickInstall for the crates. + QuickInstall, + /// Build the crates from source using `cargo-build`. + Compile, +} + +impl Strategy { + pub const fn to_str(self) -> &'static str { + match self { + Strategy::CrateMetaData => "crate-meta-data", + Strategy::QuickInstall => "quick-install", + Strategy::Compile => "compile", + } + } +} + /// Metadata for binary installation use. /// /// Exposed via `[package.metadata]` in `Cargo.toml` @@ -37,6 +73,9 @@ pub struct PkgMeta { /// Package signing configuration pub signing: Option, + /// Stratgies to disable + pub disabled_strategies: Option>, + /// Target specific overrides pub overrides: BTreeMap, } @@ -82,10 +121,16 @@ impl PkgMeta { .or_else(|| self.bin_dir.clone()), signing: pkg_overrides + .clone() .into_iter() .find_map(|pkg_override| pkg_override.signing.clone()) .or_else(|| self.signing.clone()), + disabled_strategies: pkg_overrides + .into_iter() + .find_map(|pkg_override| pkg_override.disabled_strategies.clone()) + .or_else(|| self.disabled_strategies.clone()), + overrides: Default::default(), } } @@ -106,6 +151,9 @@ pub struct PkgOverride { /// Path template override for binary files in packages pub bin_dir: Option, + /// Stratgies to disable + pub disabled_strategies: Option>, + /// Package signing configuration pub signing: Option, } @@ -141,3 +189,20 @@ pub enum SigningAlgorithm { /// [minisign](https://jedisct1.github.io/minisign/) Minisign, } + +#[cfg(test)] +mod tests { + use strum::VariantArray; + + use super::*; + + #[test] + fn test_strategy_ser() { + Strategy::VARIANTS.iter().for_each(|strategy| { + assert_eq!( + serde_json::to_string(&strategy).unwrap(), + format!(r#""{}""#, strategy.to_str()) + ) + }); + } +} diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 5c6379d9..426e478b 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -8,7 +8,10 @@ use std::{ }; use binstalk_fetchers::FETCHER_GH_CRATE_META; -use binstalk_types::crate_info::{CrateSource, SourceType}; +use binstalk_types::{ + cargo_toml_binstall::Strategy, + crate_info::{CrateSource, SourceType}, +}; use compact_str::{CompactString, ToCompactString}; use itertools::Itertools; use leon::Template; @@ -90,8 +93,22 @@ async fn resolve_inner( .get() .await .iter() - .map(|target| TargetTriple::from_str(target).map(|triple| (triple, target))) - .collect::, _>>()?; + .map(|target| { + debug!("Building metadata for target: {target}"); + + let meta = package_info.meta.merge_overrides( + iter::once(&opts.cli_overrides).chain(package_info.overrides.get(target)), + ); + + debug!("Found metadata: {meta:?}"); + + Ok(Arc::new(TargetData { + target: target.clone(), + meta, + target_related_info: TargetTriple::from_str(target)?, + })) + }) + .collect::, BinstallError>>()?; let resolvers = &opts.resolvers; let binary_name = match package_info.binaries.as_slice() { @@ -115,32 +132,24 @@ async fn resolve_inner( handles.extend( resolvers .iter() - .cartesian_product(desired_targets.clone().into_iter().map( - |(triple, target)| { - debug!("Building metadata for target: {target}"); - - let target_meta = package_info.meta.merge_overrides( - iter::once(&opts.cli_overrides) - .chain(package_info.overrides.get(target)), - ); - - debug!("Found metadata: {target_meta:?}"); - - Arc::new(TargetData { - target: target.clone(), - meta: target_meta, - target_related_info: triple, - }) - }, - )) + .cartesian_product(&desired_targets) .filter_map(|(f, target_data)| { let fetcher = f( opts.client.clone(), gh_api_client.clone(), data.clone(), - target_data, + target_data.clone(), opts.signature_policy, ); + + if let Some(disabled_strategies) = + target_data.meta.disabled_strategies.as_deref() + { + if disabled_strategies.contains(&fetcher.strategy()) { + return None; + } + } + filter_fetcher_by_name_predicate(fetcher.fetcher_name()).then_some(fetcher) }), ) @@ -231,14 +240,29 @@ async fn resolve_inner( } } - if opts.cargo_install_fallback { - Ok(Resolution::InstallFromSource(ResolutionSource { - name: package_info.name, - version: package_info.version_str, - })) - } else { - Err(BinstallError::NoFallbackToCargoInstall) + if !opts.cargo_install_fallback { + return Err(BinstallError::NoFallbackToCargoInstall); } + + let meta = package_info + .meta + .merge_overrides(iter::once(&opts.cli_overrides)); + + let target_meta = desired_targets + .first() + .map(|target_data| &target_data.meta) + .unwrap_or(&meta); + + if let Some(disabled_strategies) = target_meta.disabled_strategies.as_deref() { + if disabled_strategies.contains(&Strategy::Compile) { + return Err(BinstallError::NoFallbackToCargoInstall); + } + } + + Ok(Resolution::InstallFromSource(ResolutionSource { + name: package_info.name, + version: package_info.version_str, + })) } /// * `fetcher` - `fetcher.find()` must have returned `Ok(true)`. diff --git a/e2e-tests/manifests/strategies-test-Cargo.toml b/e2e-tests/manifests/strategies-test-Cargo.toml new file mode 100644 index 00000000..f4235a84 --- /dev/null +++ b/e2e-tests/manifests/strategies-test-Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "cargo-update" +repository = "https://github.com/nabijaczleweli/cargo-update" +version = "11.1.2" + +[[bin]] +name = "cargo-install-update" +path = "src/main.rs" +test = false +doc = false + +[[bin]] +name = "cargo-install-update-config" +path = "src/main-config.rs" +test = false +doc = false + +[package.metadata.binstall] +disabled-strategies = ["quick-install", "compile"] diff --git a/e2e-tests/strategies.sh b/e2e-tests/strategies.sh index 1a91c894..0248d6c3 100755 --- a/e2e-tests/strategies.sh +++ b/e2e-tests/strategies.sh @@ -36,3 +36,16 @@ fi ## Test compile-only strategy "./$1" binstall --no-confirm --strategies compile cargo-quickinstall@0.2.8 + +## Test --disable-strategies +set +e + +"./$1" binstall --no-confirm --manifest-path "manifests/strategies-test-Cargo.toml" cargo-update@11.1.2 +exit_code="$?" + +set -e + +if [ "$exit_code" != 94 ]; then + echo "Expected exit code 94, but actual exit code $exit_code" + exit 1 +fi From 53f342ab1caa383e0548865446eeebda477a21da Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Thu, 25 Jul 2024 12:25:43 +1000 Subject: [PATCH 1817/2020] Enable vendored native-tls if native-tls and static is enabled (#1832) Fixed #1694 Signed-off-by: Jiahao XU --- Cargo.lock | 11 +++++++++++ crates/binstalk-downloader/Cargo.toml | 9 ++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 040048c3..55fe35bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -310,6 +310,7 @@ dependencies = [ "hickory-resolver", "httpdate", "ipconfig", + "native-tls", "once_cell", "reqwest", "serde", @@ -2922,6 +2923,15 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +[[package]] +name = "openssl-src" +version = "300.3.1+3.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91" +dependencies = [ + "cc", +] + [[package]] name = "openssl-sys" version = "0.9.103" @@ -2930,6 +2940,7 @@ checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", + "openssl-src", "pkg-config", "vcpkg", ] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index f95505f4..af06ad3f 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -76,10 +76,16 @@ xz2 = "0.1.7" # Otherwise there will be a link conflict. zstd = { version = "0.13.2", default-features = false } +[target."cfg(not(target_arch = \"wasm32\"))".dependencies.native-tls-crate] +optional = true +package = "native-tls" +# The version must be kept in sync of reqwest +version = "0.2.10" + [features] default = ["static", "rustls"] -static = ["bzip2/static", "xz2/static"] +static = ["bzip2/static", "xz2/static", "native-tls-crate?/vendored"] pkg-config = ["zstd/pkg-config"] zlib-ng = ["flate2/zlib-ng"] @@ -104,6 +110,7 @@ rustls = [ ] native-tls = [ "__tls", + "native-tls-crate", "reqwest/native-tls", "hickory-resolver?/dns-over-native-tls", ] From 871e1eaf6898a931c7c9bbed6d0c33bcfe85fdb0 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 26 Jul 2024 01:10:59 +1000 Subject: [PATCH 1818/2020] Fix 1.80 cargo clippy errors (#1834) Fix 1.80 clippy lint errors Fix 1.80 linting Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Signed-off-by: Jiahao XU --- crates/binstalk-manifests/src/cargo_config.rs | 2 +- crates/cargo-toml-workspace/src/lib.rs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/binstalk-manifests/src/cargo_config.rs b/crates/binstalk-manifests/src/cargo_config.rs index a92cc104..6bc36d96 100644 --- a/crates/binstalk-manifests/src/cargo_config.rs +++ b/crates/binstalk-manifests/src/cargo_config.rs @@ -71,7 +71,7 @@ pub struct Config { fn join_if_relative(path: Option<&mut PathBuf>, dir: &Path) { match path { - Some(path) if path.is_relative() => *path = dir.join(&path), + Some(path) if path.is_relative() => *path = dir.join(&*path), _ => (), } } diff --git a/crates/cargo-toml-workspace/src/lib.rs b/crates/cargo-toml-workspace/src/lib.rs index 87f6e58d..16c8050d 100644 --- a/crates/cargo-toml-workspace/src/lib.rs +++ b/crates/cargo-toml-workspace/src/lib.rs @@ -142,6 +142,7 @@ impl Pattern { } /// * `glob_path` - path to dir to glob for + /// /// return paths relative to `glob_path`. fn glob_dirs(&self, glob_path: &Path) -> Result, ErrorInner> { let mut paths = vec![PathBuf::new()]; From 6df132a9d5fbc09cfae083076b0abaf42091582f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 03:34:19 +0000 Subject: [PATCH 1819/2020] dep: Upgrade transitive dependencies (#1837) Co-authored-by: github-actions --- Cargo.lock | 299 +++++++++++++++++++++++++---------------------------- 1 file changed, 142 insertions(+), 157 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 55fe35bd..0fd28b67 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,9 +61,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", @@ -76,33 +76,33 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", "windows-sys 0.52.0", @@ -128,9 +128,9 @@ checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] name = "async-compression" -version = "0.4.11" +version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd066d0b4ef8ecb03a55319dc13aa6910616d0f44008a045bb1835af830abff5" +checksum = "fec134f64e2bc57411226dfc4e52dec859ddfc7e711fc5e07b612584f000e4aa" dependencies = [ "brotli", "bzip2", @@ -487,9 +487,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.9.1" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05efc5cfd9110c8416e471df0e96702d58690178e206e61b7173706673c93706" +checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" dependencies = [ "memchr", "regex-automata", @@ -619,9 +619,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.20.3" +version = "0.20.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4895c018bb228aa6b3ba1a0285543fcb4b704734c3fb1f72afaa75aa769500c1" +checksum = "ad639525b1c67b6a298f378417b060fbc04618bea559482a8484381cce27d965" dependencies = [ "serde", "toml", @@ -638,9 +638,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324c74f2155653c90b04f25b2a47a8a631360cb908f92a772695f430c7e31052" +checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" dependencies = [ "jobserver", "libc", @@ -654,9 +654,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.9" +version = "4.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64acc1846d54c1fe936a78dc189c34e28d3f5afc348403f28ecf53660b9b8462" +checksum = "35723e6a11662c2afb578bcf0b88bf6ea8e21282a953428f240574fcc3a2b5b3" dependencies = [ "clap_builder", "clap_derive", @@ -664,9 +664,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.9" +version = "4.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb8393d67ba2e7bfaf28a23458e4e2b543cc73a99595511eb207fdb8aede942" +checksum = "49eb96cbfa7cfa35017b7cd548c75b14c3118c98b423041d70562665e07fb0fa" dependencies = [ "anstream", "anstyle", @@ -676,9 +676,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.8" +version = "4.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" +checksum = "5d029b67f89d30bbb547c89fd5161293c0aec155fc691d7924b64550662db93e" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -688,9 +688,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" [[package]] name = "clru" @@ -709,9 +709,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "command-group" @@ -1262,9 +1262,9 @@ checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "gix" -version = "0.63.0" +version = "0.64.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "984c5018adfa7a4536ade67990b3ebc6e11ab57b3d6cd9968de0947ca99b4b06" +checksum = "d78414d29fcc82329080166077e0f7689f4016551fdb334d787c3d040fe2634f" dependencies = [ "gix-actor", "gix-attributes", @@ -1309,16 +1309,15 @@ dependencies = [ "gix-worktree", "gix-worktree-state", "once_cell", - "parking_lot", "smallvec", "thiserror", ] [[package]] name = "gix-actor" -version = "0.31.4" +version = "0.31.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b8ee65074b2bbb91d9d97c15d172ea75043aefebf9869b5b329149dc76501c" +checksum = "a0e454357e34b833cc3a00b6efbbd3dd4d18b24b9fb0c023876ec2645e8aa3f2" dependencies = [ "bstr", "gix-date", @@ -1330,9 +1329,9 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.22.2" +version = "0.22.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eefb48f42eac136a4a0023f49a54ec31be1c7a9589ed762c45dcb9b953f7ecc8" +checksum = "e37ce99c7e81288c28b703641b6d5d119aacc45c1a6b247156e6249afa486257" dependencies = [ "bstr", "gix-glob", @@ -1365,9 +1364,9 @@ dependencies = [ [[package]] name = "gix-command" -version = "0.3.7" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c22e086314095c43ffe5cdc5c0922d5439da4fd726f3b0438c56147c34dc225" +checksum = "0d76867867da891cbe32021ad454e8cae90242f6afb06762e4dd0d357afd1d7b" dependencies = [ "bstr", "gix-path", @@ -1377,9 +1376,9 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.24.2" +version = "0.24.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7b102311085da4af18823413b5176d7c500fb2272eaf391cfa8635d8bcb12c4" +checksum = "133b06f67f565836ec0c473e2116a60fb74f80b6435e21d88013ac0e3c60fc78" dependencies = [ "bstr", "gix-chunk", @@ -1391,9 +1390,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fafe42957e11d98e354a66b6bd70aeea00faf2f62dd11164188224a507c840" +checksum = "28f53fd03d1bf09ebcc2c8654f08969439c4556e644ca925f27cf033bc43e658" dependencies = [ "bstr", "gix-config-value", @@ -1412,9 +1411,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.6" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbd06203b1a9b33a78c88252a625031b094d9e1b647260070c25b09910c0a804" +checksum = "b328997d74dd15dc71b2773b162cb4af9a25c424105e4876e6d0686ab41c383e" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1425,9 +1424,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.24.2" +version = "0.24.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c70146183bd3c7119329a3c7392d1aa0e0adbe48d727f4df31828fe6d8fdaa1" +checksum = "198588f532e4d1202e04e6c3f50e4d7c060dffc66801c6f53cc246f1d234739e" dependencies = [ "bstr", "gix-command", @@ -1454,9 +1453,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.44.0" +version = "0.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40b9bd8b2d07b6675a840b56a6c177d322d45fa082672b0dad8f063b25baf0a4" +checksum = "1996d5c8a305b59709467d80617c9fde48d9d75fd1f4179ea970912630886c9d" dependencies = [ "bstr", "gix-hash", @@ -1466,9 +1465,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc27c699b63da66b50d50c00668bc0b7e90c3a382ef302865e891559935f3dbf" +checksum = "67662731cec3cb31ba3ed2463809493f76d8e5d6c6d245de8b0560438c13450e" dependencies = [ "bstr", "dunce", @@ -1507,9 +1506,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00ce6ea5ac8fca7adbc63c48a1b9e0492c222c386aa15f513405f1003f2f4ab2" +checksum = "e6547738da28275f4dff4e9f3a0f28509f53f94dd6bd822733c91cb306bca61a" dependencies = [ "bstr", "encoding_rs", @@ -1528,9 +1527,9 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3338ff92a2164f5209f185ec0cd316f571a72676bb01d27e22f2867ba69f77a" +checksum = "6adf99c27cdf17b1c4d77680c917e0d94d8783d4e1c73d3be0d1d63107163d7a" dependencies = [ "fastrand 2.1.0", "gix-features", @@ -1539,9 +1538,9 @@ dependencies = [ [[package]] name = "gix-glob" -version = "0.16.3" +version = "0.16.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2a29ad0990cf02c48a7aac76ed0dbddeb5a0d070034b83675cc3bbf937eace4" +checksum = "fa7df15afa265cc8abe92813cd354d522f1ac06b29ec6dfa163ad320575cb447" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1572,9 +1571,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "640dbeb4f5829f9fc14d31f654a34a0350e43a24e32d551ad130d99bf01f63f1" +checksum = "5e6afb8f98e314d4e1adc822449389ada863c174b5707cedd327d67b84dba527" dependencies = [ "bstr", "gix-glob", @@ -1585,9 +1584,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.33.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d8c5a5f1c58edcbc5692b174cda2703aba82ed17d7176ff4c1752eb48b1b167" +checksum = "9a9a44eb55bd84bb48f8a44980e951968ced21e171b22d115d1cdcef82a7d73f" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1635,9 +1634,9 @@ dependencies = [ [[package]] name = "gix-negotiate" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d57dec54544d155a495e01de947da024471e1825d7d3f2724301c07a310d6184" +checksum = "9ec879fb6307bb63519ba89be0024c6f61b4b9d61f1a91fd2ce572d89fe9c224" dependencies = [ "bitflags 2.6.0", "gix-commitgraph", @@ -1670,9 +1669,9 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.61.0" +version = "0.61.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e92b9790e2c919166865d0825b26cc440a387c175bed1b43a2fa99c0e9d45e98" +checksum = "20d384fe541d93d8a3bb7d5d5ef210780d6df4f50c4e684ccba32665a5e3bc9b" dependencies = [ "arc-swap", "gix-date", @@ -1690,9 +1689,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.51.0" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a8da51212dbff944713edb2141ed7e002eea326b8992070374ce13a6cb610b3" +checksum = "3e0594491fffe55df94ba1c111a6566b7f56b3f8d2e1efc750e77d572f5f5229" dependencies = [ "clru", "gix-chunk", @@ -1748,9 +1747,9 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.7.5" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76cab098dc10ba2d89f634f66bf196dea4d7db4bf10b75c7a9c201c55a2ee19" +checksum = "d307d1b8f84dc8386c4aa20ce0cf09242033840e15469a3ecba92f10cfb5c046" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1763,9 +1762,9 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.8.5" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fddabbc7c51c241600ab3c4623b19fa53bde7c1a2f637f61043ed5fcadf000cc" +checksum = "7e0595d2be4b6d6a71a099e989bdd610882b882da35fb8503d91d6f81aa0936f" dependencies = [ "gix-command", "gix-config-value", @@ -1776,9 +1775,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.45.1" +version = "0.45.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c140d4c6d209048826bad78f021a01b612830f89da356efeb31afe8957f8bee" +checksum = "bad8da8e89f24177bd77947092199bb13dcc318bbd73530ba8a05e6d6adaaa9d" dependencies = [ "bstr", "gix-credentials", @@ -1805,12 +1804,11 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.44.1" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3394a2997e5bc6b22ebc1e1a87b41eeefbcfcff3dbfa7c4bd73cb0ac8f1f3e2e" +checksum = "636e96a0a5562715153fee098c217110c33a6f8218f08f4687ff99afde159bb5" dependencies = [ "gix-actor", - "gix-date", "gix-features", "gix-fs", "gix-hash", @@ -1827,9 +1825,9 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.23.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde848865834a54fe4d9b4573f15d0e9a68eaf3d061b42d3ed52b4b8acf880b2" +checksum = "6868f8cd2e62555d1f7c78b784bece43ace40dd2a462daf3b588d5416e603f37" dependencies = [ "bstr", "gix-hash", @@ -1841,25 +1839,23 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.27.1" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63e08f8107ed1f93a83bcfbb4c38084c7cb3f6cd849793f1d5eec235f9b13b2b" +checksum = "01b13e43c2118c4b0537ddac7d0821ae0dfa90b7b8dbf20c711e153fb749adce" dependencies = [ "bstr", "gix-date", "gix-hash", - "gix-hashtable", "gix-object", "gix-revwalk", - "gix-trace", "thiserror", ] [[package]] name = "gix-revwalk" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4181db9cfcd6d1d0fd258e91569dbb61f94cb788b441b5294dd7f1167a3e788f" +checksum = "1b030ccaab71af141f537e0225f19b9e74f25fefdba0372246b844491cab43e0" dependencies = [ "gix-commitgraph", "gix-date", @@ -1872,9 +1868,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fddc27984a643b20dd03e97790555804f98cf07404e0e552c0ad8133266a79a1" +checksum = "1547d26fa5693a7f34f05b4a3b59a90890972922172653bcb891ab3f09f436df" dependencies = [ "bitflags 2.6.0", "gix-path", @@ -1884,9 +1880,9 @@ dependencies = [ [[package]] name = "gix-submodule" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "921cd49924ac14b6611b22e5fb7bbba74d8780dc7ad26153304b64d1272460ac" +checksum = "0f2e0f69aa00805e39d39ec80472a7e9da20ed5d73318b27925a2cc198e854fd" dependencies = [ "bstr", "gix-config", @@ -1899,9 +1895,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "14.0.0" +version = "14.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3b0e276cd08eb2a22e9f286a4f13a222a01be2defafa8621367515375644b99" +checksum = "006acf5a613e0b5cf095d8e4b3f48c12a60d9062aa2b2dd105afaf8344a5600c" dependencies = [ "gix-fs", "libc", @@ -1918,9 +1914,9 @@ checksum = "f924267408915fddcd558e3f37295cc7d6a3e50f8bd8b606cee0808c3915157e" [[package]] name = "gix-transport" -version = "0.42.1" +version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb0ffa5f869977f5b9566399154055902f05d7e85c787d5eacf551acdd0c4adf" +checksum = "27c02b83763ffe95bcc27ce5821b2b7f843315a009c06f1cd59c9b66c508c058" dependencies = [ "base64 0.22.1", "bstr", @@ -1937,9 +1933,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.39.1" +version = "0.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f20cb69b63eb3e4827939f42c05b7756e3488ef49c25c412a876691d568ee2a0" +checksum = "e499a18c511e71cf4a20413b743b9f5bcf64b3d9e81e9c3c6cd399eae55a8840" dependencies = [ "bitflags 2.6.0", "gix-commitgraph", @@ -1954,9 +1950,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.27.3" +version = "0.27.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0db829ebdca6180fbe32be7aed393591df6db4a72dbbc0b8369162390954d1cf" +checksum = "e2eb9b35bba92ea8f0b5ab406fad3cf6b87f7929aa677ff10aa042c6da621156" dependencies = [ "bstr", "gix-features", @@ -1988,9 +1984,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.34.0" +version = "0.34.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53f6b7de83839274022aff92157d7505f23debf739d257984a300a35972ca94e" +checksum = "26f7326ebe0b9172220694ea69d344c536009a9b98fb0f9de092c440f3efe7a6" dependencies = [ "bstr", "gix-attributes", @@ -2007,9 +2003,9 @@ dependencies = [ [[package]] name = "gix-worktree-state" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b2835892ce553b15aef7f6f7bb1e39e146fdf71eb99609b86710a7786cf34" +checksum = "39ed6205b5f51067a485b11843babcf3304c0799e265a06eb0dde7f69cd85cd8" dependencies = [ "bstr", "gix-features", @@ -2339,7 +2335,7 @@ dependencies = [ "http 1.1.0", "hyper", "hyper-util", - "rustls 0.23.11", + "rustls 0.23.12", "rustls-native-certs", "rustls-pki-types", "tokio", @@ -2459,9 +2455,9 @@ checksum = "7655c9839580ee829dfacba1d1278c2b7883e50a277ff7541299489d6bdfdc45" [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -2480,9 +2476,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jobserver" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2b099aaa34a9751c5bf0878add70444e1ed2dd73f347be99003d4577277de6e" +checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" dependencies = [ "libc", ] @@ -2523,9 +2519,9 @@ dependencies = [ [[package]] name = "kstring" -version = "2.0.0" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec3066350882a1cd6d950d055997f379ac37fd39f81cd4d8ed186032eb3c5747" +checksum = "558bf9508a558512042d3095138b1f7b8fe90c5467d94f9f1da28b3731c5dbd1" dependencies = [ "static_assertions", ] @@ -2752,13 +2748,14 @@ dependencies = [ [[package]] name = "mio" -version = "0.8.11" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" dependencies = [ + "hermit-abi", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -2857,16 +2854,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "num_threads" version = "0.1.7" @@ -2878,9 +2865,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.1" +version = "0.36.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" +checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" dependencies = [ "memchr", ] @@ -3106,9 +3093,9 @@ dependencies = [ "futures-io", "pin-project-lite", "quinn-proto 0.11.3", - "quinn-udp 0.5.2", + "quinn-udp 0.5.4", "rustc-hash", - "rustls 0.23.11", + "rustls 0.23.12", "thiserror", "tokio", "tracing", @@ -3141,7 +3128,7 @@ dependencies = [ "rand", "ring 0.17.8", "rustc-hash", - "rustls 0.23.11", + "rustls 0.23.12", "slab", "thiserror", "tinyvec", @@ -3163,14 +3150,13 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.2" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9096629c45860fc7fb143e125eb826b5e721e10be3263160c7d60ca832cf8c46" +checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" dependencies = [ "libc", "once_cell", "socket2", - "tracing", "windows-sys 0.52.0", ] @@ -3343,7 +3329,7 @@ dependencies = [ "percent-encoding", "pin-project-lite", "quinn 0.11.2", - "rustls 0.23.11", + "rustls 0.23.12", "rustls-native-certs", "rustls-pemfile 2.1.2", "rustls-pki-types", @@ -3455,14 +3441,14 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.11" +version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4828ea528154ae444e5a642dbb7d5623354030dc9822b83fd9bb79683c7399d0" +checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" dependencies = [ "once_cell", "ring 0.17.8", "rustls-pki-types", - "rustls-webpki 0.102.5", + "rustls-webpki 0.102.6", "subtle", "zeroize", ] @@ -3517,9 +3503,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.5" +version = "0.102.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a6fccd794a42c2c105b513a2f62bc3fd8f3ba57a4593677ceb0bd035164d78" +checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" dependencies = [ "ring 0.17.8", "rustls-pki-types", @@ -3646,9 +3632,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] @@ -3688,9 +3674,9 @@ dependencies = [ [[package]] name = "sha1_smol" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" +checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" [[package]] name = "sha2" @@ -3729,9 +3715,9 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.10" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ceb5955ab3b66f8c0f0557873ca472c196d30a6c19696074ce3aca4c226b5c3a" +checksum = "3dbb678a20886f703df5cf4b925101d75bf7ee793db8134f0d4b7420036b3557" dependencies = [ "compact_str", "derive_destructure2", @@ -3844,9 +3830,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.71" +version = "2.0.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" +checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" dependencies = [ "proc-macro2", "quote", @@ -3999,27 +3985,26 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.38.1" +version = "1.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" +checksum = "d040ac2b29ab03b09d4129c2f5bbd012a3ac2f79d38ff506a4bf8dd34b0eac8a" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "tokio-macros" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f5ae998a069d4b5aba8ee9dad856af7d520c3699e6159b185c2acd48155d39a" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", @@ -4052,7 +4037,7 @@ version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.11", + "rustls 0.23.12", "rustls-pki-types", "tokio", ] @@ -4099,9 +4084,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.15" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac2caab0bf757388c6c0ae23b3293fdb463fee59434529014f85e3263b995c28" +checksum = "81967dd0dd2c1ab0bc3468bd7caecc32b8a4aa47d0c8c695d8c2b2108168d62c" dependencies = [ "serde", "serde_spanned", @@ -4111,18 +4096,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "f8fb9f64314842840f1d940ac544da178732128f1c78c21772e876579e0da1db" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.16" +version = "0.22.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "278f3d518e152219c994ce877758516bca5e118eaed6996192a774fb9fbf0788" +checksum = "8d9f8729f5aea9562aac1cc0441f5d6de3cff1ee0c5d67293eeca5eb36ee7c16" dependencies = [ "indexmap", "serde", @@ -4348,9 +4333,9 @@ dependencies = [ [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "vswhom" @@ -4746,9 +4731,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.13" +version = "0.6.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" +checksum = "b480ae9340fc261e6be3e95a1ba86d54ae3f9171132a73ce8d4bbaf68339507c" dependencies = [ "memchr", ] From fa105bb8d78b37fa8b6c3d958544e205798d2948 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 26 Jul 2024 14:26:56 +1000 Subject: [PATCH 1820/2020] Update doc in SUPPORT.md for disabled-strategies (#1830) * Update doc in SUPPORT.md for disabled-strategies For #1828 and #1721 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Update SUPPORT.md Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- SUPPORT.md | 1 + 1 file changed, 1 insertion(+) diff --git a/SUPPORT.md b/SUPPORT.md index b88b5517..3ca7d5b4 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -20,6 +20,7 @@ With the following configuration keys: - `pkg-url` specifies the package download URL for a given target/version, templated - `bin-dir` specifies the binary path within the package, templated (with an `.exe` suffix on windows) - `pkg-fmt` overrides the package format for download/extraction (defaults to: `tgz`) +- `disabled-strategies` to disable specific strategies (e.g. `crate-meta-data` for trying to find pre-built on your repository, `quick-install` for pre-built from third-party cargo-bins/cargo-quickinstall, `compile` for falling back to `cargo-install`) for your crate (defaults to empty array). The user can override this by explicitly specifying --strategies on the command line. `pkg-url` and `bin-dir` are templated to support different names for different versions / architectures / etc. From 680960127300d8935617e3bbf1a0f6943c0740f2 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 26 Jul 2024 16:03:38 +1000 Subject: [PATCH 1821/2020] Add new option to `--disable-telemetry` to disable quickinstall statistics collection (#1831) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add new option `--disable-quick-install-stats` Signed-off-by: Jiahao XU * Send quickinstall stats in parallel This commit also make sure'the stats is always sent for each fetcher, regardless of whether it is picked or not, to make sure that the quick-install stats collection gets the full infomration of possible targets. Signed-off-by: Jiahao XU * Rename option to `--disable-telemetry` Signed-off-by: Jiahao XU * Update args.rs Co-authored-by: Félix Saparelli Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Update args.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Co-authored-by: Félix Saparelli --- crates/bin/src/args.rs | 24 ++++++++++++++++++++ crates/bin/src/entry.rs | 1 + crates/binstalk-fetchers/src/quickinstall.rs | 4 ++-- crates/binstalk/src/lib.rs | 2 ++ crates/binstalk/src/ops.rs | 1 + crates/binstalk/src/ops/resolve.rs | 7 +++++- 6 files changed, 36 insertions(+), 3 deletions(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 061fbdab..187cd9ab 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -219,6 +219,14 @@ pub struct Args { #[clap(help_heading = "Options", long)] pub(crate) no_track: bool, + /// Disable statistics collection on popular crates. + /// + /// Strategy quick-install (can be disabled via --disable-strategies) collects + /// statistics of popular crates by default, by sending the crate, version and + /// target to https://warehouse-clerk-tmp.vercel.app/api/crate + #[clap(help_heading = "Options", long, env = "BINSTALL_DISABLE_TELEMETRY")] + pub(crate) disable_telemetry: bool, + /// Install binaries in a custom location. /// /// By default, binaries are installed to the global location `$CARGO_HOME/bin`, and global @@ -611,5 +619,21 @@ mod test { Args::command().debug_assert() } + #[test] + fn quickinstall_url_matches() { + let long_help = Args::command() + .get_opts() + .find(|opt| opt.get_long() == Some("disable-telemetry")) + .unwrap() + .get_long_help() + .unwrap() + .to_string(); + assert!( + long_help.ends_with(binstalk::QUICK_INSTALL_STATS_URL), + "{}", + long_help + ); + } + const _: () = assert!(Strategy::VARIANTS.len() == StrategyWrapped::VARIANTS.len()); } diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 770c72fb..e923d97f 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -207,6 +207,7 @@ pub fn install_crates( } else { SignaturePolicy::IfPresent }, + disable_telemetry: args.disable_telemetry, }); // Destruct args before any async function to reduce size of the future diff --git a/crates/binstalk-fetchers/src/quickinstall.rs b/crates/binstalk-fetchers/src/quickinstall.rs index ad5d2f7d..b963e491 100644 --- a/crates/binstalk-fetchers/src/quickinstall.rs +++ b/crates/binstalk-fetchers/src/quickinstall.rs @@ -16,7 +16,7 @@ use crate::{ }; const BASE_URL: &str = "https://github.com/cargo-bins/cargo-quickinstall/releases/download"; -const STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; +pub const QUICK_INSTALL_STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; const QUICKINSTALL_SIGN_KEY: Cow<'static, str> = Cow::Borrowed("RWTdnnab2pAka9OdwgCMYyOE66M/BlQoFWaJ/JjwcPV+f3n24IRTj97t"); @@ -144,7 +144,7 @@ impl super::Fetcher for QuickInstall { .expect("package_url is pre-generated and should never be invalid url"), signature_url: Url::parse(&format!("{url}.sig")) .expect("signature_url is pre-generated and should never be invalid url"), - stats_url: Url::parse(&format!("{STATS_URL}/{package}.tar.gz",)) + stats_url: Url::parse(&format!("{QUICK_INSTALL_STATS_URL}/{package}.tar.gz",)) .expect("stats_url is pre-generated and should never be invalid url"), package, signature_policy, diff --git a/crates/binstalk/src/lib.rs b/crates/binstalk/src/lib.rs index 1aa934df..271c0f71 100644 --- a/crates/binstalk/src/lib.rs +++ b/crates/binstalk/src/lib.rs @@ -9,3 +9,5 @@ pub use binstalk_fetchers as fetchers; pub use binstalk_registry as registry; pub use binstalk_types as manifests; pub use detect_targets::{get_desired_targets, DesiredTargets, TARGET}; + +pub use fetchers::QUICK_INSTALL_STATS_URL; diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index ae810a3d..57b20c17 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -55,4 +55,5 @@ pub struct Options { pub registry: Registry, pub signature_policy: SignaturePolicy, + pub disable_telemetry: bool, } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 426e478b..5d27adcf 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -175,8 +175,13 @@ async fn resolve_inner( ); } + if !opts.disable_telemetry { + for fetcher in &handles { + fetcher.clone().report_to_upstream(); + } + } + for fetcher in handles { - fetcher.clone().report_to_upstream(); match AutoAbortJoinHandle::new(fetcher.clone().find()) .flattened_join() .await From e017be224788d698b43c7c448a3a6b80dbe3fd21 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 26 Jul 2024 16:46:04 +1000 Subject: [PATCH 1822/2020] Add env for --disable-strategies (#1838) Fixed #1833 --- crates/bin/src/args.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 187cd9ab..8fbe09e5 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -167,7 +167,12 @@ pub struct Args { /// Disable the strategies specified. /// If a strategy is specified in `--strategies` and `--disable-strategies`, /// then it will be removed. - #[clap(help_heading = "Overrides", long, value_delimiter(','))] + #[clap( + help_heading = "Overrides", + long, + value_delimiter(','), + env = "BINSTALL_DISABLE_STRATEGIES" + )] pub(crate) disable_strategies: Vec, /// If `--github-token` or environment variable `GITHUB_TOKEN`/`GH_TOKEN` From 6b4dbb4caa7602c03c078cc861c326f660316c71 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 26 Jul 2024 18:21:36 +1000 Subject: [PATCH 1823/2020] Fix: Ignore invalid Github Token (#1839) * Fix: Ignore empty Github Token Empty GitHub Token is invalid, it should not be used. * Fix compilation And detect more invalid tokens Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * fix Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/bin/src/args.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 8fbe09e5..195f25f1 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -609,6 +609,10 @@ You cannot use --{option} and specify multiple packages at the same time. Do one opts.github_token = Some(GithubToken(Zeroizing::new(github_token.into()))); } } + match opts.github_token.as_ref() { + Some(token) if token.0.len() < 10 => opts.github_token = None, + _ => (), + } opts } From 58d638726b63232e26cabd6753871245c4a88d3e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 08:37:08 +0000 Subject: [PATCH 1824/2020] release: binstalk-types v0.8.0 (#1841) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0fd28b67..2d264091 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -419,7 +419,7 @@ dependencies = [ [[package]] name = "binstalk-types" -version = "0.7.0" +version = "0.8.0" dependencies = [ "compact_str", "maybe-owned", diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 5a9b3983..a10550d8 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] atomic-file-install = { version = "1.0.5", path = "../atomic-file-install" } -binstalk-types = { version = "0.7.0", path = "../binstalk-types" } +binstalk-types = { version = "0.8.0", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index af06ad3f..75b0c425 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -27,7 +27,7 @@ async_zip = { version = "0.0.17", features = [ "xz", "tokio", ] } -binstalk-types = { version = "0.7.0", path = "../binstalk-types" } +binstalk-types = { version = "0.8.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" compact_str = "0.8.0" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 3c1f1458..a41ba3a1 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -14,7 +14,7 @@ license = "GPL-3.0-only" async-trait = "0.1.68" binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.3.0", path = "../binstalk-git-repo-api" } -binstalk-types = { version = "0.7.0", path = "../binstalk-types" } +binstalk-types = { version = "0.8.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } either = "1.11.0" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 151829e3..80abe7d6 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] beef = { version = "0.5.2", features = ["impl_serde"] } -binstalk-types = { version = "0.7.0", path = "../binstalk-types" } +binstalk-types = { version = "0.8.0", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } fs-lock = { version = "0.1.3", path = "../fs-lock" } home = "0.5.9" diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 940b48db..4a9d4353 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -16,7 +16,7 @@ base16 = "0.2.1" binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } -binstalk-types = { version = "0.7.0", path = "../binstalk-types" } +binstalk-types = { version = "0.8.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 54e5d0ed..1d315b68 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-types" description = "The binstall toolkit that contains basic types for binstalk crates" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-types" -version = "0.7.0" +version = "0.8.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index d5e6f75a..12c3bad1 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -17,7 +17,7 @@ binstalk-fetchers = { version = "0.7.1", path = "../binstalk-fetchers", features "quickinstall", ] } binstalk-registry = { version = "0.9.1", path = "../binstalk-registry" } -binstalk-types = { version = "0.7.0", path = "../binstalk-types" } +binstalk-types = { version = "0.8.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } From 24c7c1a4bb5f5acb35b1bd4c59d10fffddff3772 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 08:57:35 +0000 Subject: [PATCH 1825/2020] release: cargo-toml-workspace v6.0.1 (#1840) chore: Release Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Co-authored-by: github-actions Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2d264091..28dc4072 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -591,7 +591,7 @@ dependencies = [ [[package]] name = "cargo-toml-workspace" -version = "6.0.0" +version = "6.0.1" dependencies = [ "cargo_toml", "compact_str", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 4a9d4353..dc729954 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -17,7 +17,7 @@ binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", def "json", ] } binstalk-types = { version = "0.8.0", path = "../binstalk-types" } -cargo-toml-workspace = { version = "6.0.0", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "6.0.1", path = "../cargo-toml-workspace" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 12c3bad1..edaadbb9 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -18,7 +18,7 @@ binstalk-fetchers = { version = "0.7.1", path = "../binstalk-fetchers", features ] } binstalk-registry = { version = "0.9.1", path = "../binstalk-registry" } binstalk-types = { version = "0.8.0", path = "../binstalk-types" } -cargo-toml-workspace = { version = "6.0.0", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "6.0.1", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } detect-targets = { version = "0.1.17", path = "../detect-targets", features = [ diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index f1f5157d..47efe906 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-toml-workspace" -version = "6.0.0" +version = "6.0.1" edition = "2021" description = "Parse cargo workspace and load specific crate" repository = "https://github.com/cargo-bins/cargo-binstall" From 78f26622b23cff488b12dfc5d8b6ca1b283f0bbb Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 19:11:23 +1000 Subject: [PATCH 1826/2020] release: binstalk-downloader v0.12.0 (#1842) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-git-repo-api/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 28dc4072..05e1e7be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -293,7 +293,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.11.5" +version = "0.12.0" dependencies = [ "async-compression", "async-trait", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 75b0c425..09271b9c 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.11.5" +version = "0.12.0" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index a41ba3a1..553664a1 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", default-features = false } +binstalk-downloader = { version = "0.12.0", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.3.0", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.8.0", path = "../binstalk-types" } bytes = "1.4.0" @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.12.0", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 0810f549..99d1d93e 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.12.0", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.8.0" @@ -25,6 +25,6 @@ url = "2.3.1" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.12.0", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index dc729954..59886c2c 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.12.0", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.8.0", path = "../binstalk-types" } @@ -40,7 +40,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.12.0", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index edaadbb9..73bfb004 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -11,7 +11,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.11.5", path = "../binstalk-downloader", default-features = false } +binstalk-downloader = { version = "0.12.0", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.3.0", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.7.1", path = "../binstalk-fetchers", features = [ "quickinstall", From 75d46eeaab0a5ec7958e75ded73a7f2ee199bdac Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 19:25:15 +1000 Subject: [PATCH 1827/2020] release: binstalk-manifests v0.14.0 (#1844) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 05e1e7be..dddefdbc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -371,7 +371,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.13.0" +version = "0.14.0" dependencies = [ "beef", "binstalk-types", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 42529cb8..45a7bac3 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,7 +23,7 @@ pkg-fmt = "zip" [dependencies] binstalk = { path = "../binstalk", version = "0.26.1", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.13.0" } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.14.0" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 80abe7d6..2ebbc0ee 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.13.0" +version = "0.14.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" From 40ec708bd8988f610d64ced6ea727f308ba53f5e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 19:38:04 +1000 Subject: [PATCH 1828/2020] release: binstalk-bins v0.5.0 (#1843) chore: Release Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Co-authored-by: github-actions Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- Cargo.lock | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index dddefdbc..496ea721 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.4.0" +version = "0.5.0" dependencies = [ "atomic-file-install", "binstalk-types", diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index a10550d8..913d8578 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.4.0" +version = "0.5.0" edition = "2021" description = "The binstall binaries discovery and installation crate." diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 73bfb004..1ce83111 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.4.0", path = "../binstalk-bins" } +binstalk-bins = { version = "0.5.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.12.0", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.3.0", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.7.1", path = "../binstalk-fetchers", features = [ From 08d8946dde334a4bef41e8a99f5da78df6c66dc8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 09:39:17 +0000 Subject: [PATCH 1829/2020] release: binstalk-git-repo-api v0.4.0 (#1845) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-git-repo-api/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 496ea721..ca01f0d9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -352,7 +352,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.3.0" +version = "0.4.0" dependencies = [ "binstalk-downloader", "compact_str", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 553664a1..9e62122a 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" binstalk-downloader = { version = "0.12.0", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.3.0", path = "../binstalk-git-repo-api" } +binstalk-git-repo-api = { version = "0.4.0", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.8.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 99d1d93e..d0516813 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.3.0" +version = "0.4.0" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 1ce83111..90e94a9a 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.5.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.12.0", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.3.0", path = "../binstalk-git-repo-api" } +binstalk-git-repo-api = { version = "0.4.0", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.7.1", path = "../binstalk-fetchers", features = [ "quickinstall", ] } From 8b314728d8c0f4594a0ec731e05218c8a4dfe4f9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 09:40:36 +0000 Subject: [PATCH 1830/2020] release: binstalk-registry v0.10.0 (#1846) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ca01f0d9..9bc095ed 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -392,7 +392,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.9.1" +version = "0.10.0" dependencies = [ "async-trait", "base16", diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 59886c2c..daceab1b 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.9.1" +version = "0.10.0" edition = "2021" rust-version = "1.65.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 90e94a9a..fae58f66 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -16,7 +16,7 @@ binstalk-git-repo-api = { version = "0.4.0", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.7.1", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.9.1", path = "../binstalk-registry" } +binstalk-registry = { version = "0.10.0", path = "../binstalk-registry" } binstalk-types = { version = "0.8.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.1", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } From 091b39d2789b7b82561e5db9adac0c58aa8ebc49 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 10:21:55 +0000 Subject: [PATCH 1831/2020] release: binstalk-fetchers v0.8.0 (#1847) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9bc095ed..71a151a3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -328,7 +328,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.7.1" +version = "0.8.0" dependencies = [ "async-trait", "binstalk-downloader", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 9e62122a..87234858 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.7.1" +version = "0.8.0" edition = "2021" description = "The binstall fetchers" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index fae58f66..6787d71f 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" binstalk-bins = { version = "0.5.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.12.0", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.4.0", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.7.1", path = "../binstalk-fetchers", features = [ +binstalk-fetchers = { version = "0.8.0", path = "../binstalk-fetchers", features = [ "quickinstall", ] } binstalk-registry = { version = "0.10.0", path = "../binstalk-registry" } From 40a083f65d50846b4f7c810ca03ca479027c6a0e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 10:49:28 +0000 Subject: [PATCH 1832/2020] release: binstalk v0.27.0 (#1848) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 71a151a3..493f93ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -247,7 +247,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.26.1" +version = "0.27.0" dependencies = [ "binstalk-bins", "binstalk-downloader", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 45a7bac3..fcfe7fd4 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.26.1", default-features = false } +binstalk = { path = "../binstalk", version = "0.27.0", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.14.0" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 6787d71f..1d44502e 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.26.1" +version = "0.27.0" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" From f2a184de0e5fee59b78b57695f266682b5f23147 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 26 Jul 2024 21:34:38 +1000 Subject: [PATCH 1833/2020] release: cargo-binstall v1.8.0 (#1849) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 493f93ce..66377a2a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -552,7 +552,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.7.4" +version = "1.8.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index fcfe7fd4..7dcf8731 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.7.4" +version = "1.8.0" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index da1fb6c9..d20658ed 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From c635ad6f957466c7818a18cb88570757ee1002b3 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Mon, 29 Jul 2024 13:52:03 +1000 Subject: [PATCH 1834/2020] CI: Add release-plz to release library crates (#1850) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Create release-plz.yml Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Disable release-plz for cargo-binstall Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Félix Saparelli Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Co-authored-by: Félix Saparelli --- .github/workflows/release-plz.yml | 27 +++++++++++++++++++++++++++ release-plz.toml | 3 +++ 2 files changed, 30 insertions(+) create mode 100644 .github/workflows/release-plz.yml create mode 100644 release-plz.toml diff --git a/.github/workflows/release-plz.yml b/.github/workflows/release-plz.yml new file mode 100644 index 00000000..db2b1e0a --- /dev/null +++ b/.github/workflows/release-plz.yml @@ -0,0 +1,27 @@ +name: Release-plz + +permissions: + pull-requests: write + contents: write + +on: + push: + branches: + - main + +jobs: + release-plz: + name: Release-plz + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Install Rust toolchain + run: rustup toolchain install stable --no-self-update --profile minimal + - name: Run release-plz + uses: MarcoIeni/release-plz-action@v0.5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} diff --git a/release-plz.toml b/release-plz.toml new file mode 100644 index 00000000..7103eb64 --- /dev/null +++ b/release-plz.toml @@ -0,0 +1,3 @@ +[[package]] +name = "cargo-binstall" +release = false # don't process this package From 9f3bfa9ca338192fac338906ee397fe5a230ce90 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Wed, 31 Jul 2024 22:49:13 +1000 Subject: [PATCH 1835/2020] Switch back to macos-latest (#1855) macos-latest is now an alias of macos-14 M1 Signed-off-by: Jiahao XU --- .github/workflows/ci.yml | 8 +-- .github/workflows/gh-action.yml | 6 +- .github/workflows/install-script.yml | 92 +++++++++++++------------- .github/workflows/release-packages.yml | 8 +-- 4 files changed, 57 insertions(+), 57 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cd0afba6..83427410 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -104,7 +104,7 @@ jobs: matrix: include: - target: aarch64-apple-darwin - os: macos-14 + os: macos-latest - target: x86_64-unknown-linux-gnu os: ubuntu-latest - target: x86_64-pc-windows-msvc @@ -143,7 +143,7 @@ jobs: - target: x86_64-unknown-linux-musl os: ubuntu-latest - target: x86_64-apple-darwin - os: macos-14 + os: macos-latest - target: aarch64-pc-windows-msvc os: windows-latest runs-on: ${{ matrix.os }} @@ -173,7 +173,7 @@ jobs: matrix: include: - target: x86_64-apple-darwin - os: macos-14 + os: macos-latest - target: x86_64-unknown-linux-gnu os: ubuntu-latest - target: x86_64-pc-windows-msvc @@ -205,7 +205,7 @@ jobs: with: event-data: ${{ toJSON(github.event) }} extract-notes-under: "### Release notes" - + release-dry-run: needs: pr-info uses: ./.github/workflows/release-cli.yml diff --git a/.github/workflows/gh-action.yml b/.github/workflows/gh-action.yml index d9aad264..20990277 100644 --- a/.github/workflows/gh-action.yml +++ b/.github/workflows/gh-action.yml @@ -19,7 +19,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ macos-14, ubuntu-latest, windows-latest ] + os: [macos-latest, ubuntu-latest, windows-latest] steps: - uses: actions/checkout@v4 @@ -27,7 +27,7 @@ jobs: uses: ./ # uses action.yml from root of the repo env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + - name: Verify successful installation - display cargo-binstall's help run: cargo binstall --help @@ -35,6 +35,6 @@ jobs: run: cargo binstall -y ripgrep env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - + - name: Verify successful installation - display help of installed binary run: rg --help diff --git a/.github/workflows/install-script.yml b/.github/workflows/install-script.yml index b37874b2..c13b8bc2 100644 --- a/.github/workflows/install-script.yml +++ b/.github/workflows/install-script.yml @@ -29,30 +29,30 @@ jobs: strategy: fail-fast: false matrix: - os: [macos-14, ubuntu-latest] + os: [macos-latest, ubuntu-latest] set_cargo_home: [t, f] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Set `CARGO_HOME` - if: matrix.set_cargo_home == 't' - run: | - CARGO_HOME="$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')" - mkdir -p "${CARGO_HOME}/bin" - echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" + - name: Set `CARGO_HOME` + if: matrix.set_cargo_home == 't' + run: | + CARGO_HOME="$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')" + mkdir -p "${CARGO_HOME}/bin" + echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" - - name: Install `cargo-binstall` using scripts - run: ./install-from-binstall-release.sh - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Install `cargo-binstall` using scripts + run: ./install-from-binstall-release.sh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Verify `cargo-binstall` installation - run: | - which cargo-binstall - cargo binstall -vV + - name: Verify `cargo-binstall` installation + run: | + which cargo-binstall + cargo binstall -vV windows: strategy: @@ -63,23 +63,23 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Set `CARGO_HOME` - if: matrix.set_cargo_home == 't' - shell: bash - run: | - CARGO_HOME="$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')" - mkdir -p "${CARGO_HOME}/bin" - echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" + - name: Set `CARGO_HOME` + if: matrix.set_cargo_home == 't' + shell: bash + run: | + CARGO_HOME="$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')" + mkdir -p "${CARGO_HOME}/bin" + echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" - - name: Install `cargo-binstall` using scripts - run: ./install-from-binstall-release.ps1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Install `cargo-binstall` using scripts + run: ./install-from-binstall-release.ps1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Verify `cargo-binstall` installation - run: cargo binstall -vV + - name: Verify `cargo-binstall` installation + run: cargo binstall -vV windows-bash: strategy: @@ -90,22 +90,22 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v4 - - name: Set `CARGO_HOME` - if: matrix.set_cargo_home == 't' - shell: bash - run: | - CARGO_HOME="$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')" - mkdir -p "${CARGO_HOME}/bin" - echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" + - name: Set `CARGO_HOME` + if: matrix.set_cargo_home == 't' + shell: bash + run: | + CARGO_HOME="$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home')" + mkdir -p "${CARGO_HOME}/bin" + echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" - - name: Install `cargo-binstall` using scripts - shell: bash - run: ./install-from-binstall-release.sh - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Install `cargo-binstall` using scripts + shell: bash + run: ./install-from-binstall-release.sh + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Verify `cargo-binstall` installation - shell: bash - run: cargo binstall -vV + - name: Verify `cargo-binstall` installation + shell: bash + run: cargo binstall -vV diff --git a/.github/workflows/release-packages.yml b/.github/workflows/release-packages.yml index 07b5014e..4291de23 100644 --- a/.github/workflows/release-packages.yml +++ b/.github/workflows/release-packages.yml @@ -27,9 +27,9 @@ jobs: fail-fast: false matrix: include: - - { o: macos-14, t: x86_64-apple-darwin } - - { o: macos-14, t: x86_64h-apple-darwin } - - { o: macos-14, t: aarch64-apple-darwin, r: true } + - { o: macos-latest, t: x86_64-apple-darwin } + - { o: macos-latest, t: x86_64h-apple-darwin } + - { o: macos-latest, t: aarch64-apple-darwin, r: true } - { o: ubuntu-latest, t: x86_64-unknown-linux-gnu, @@ -140,7 +140,7 @@ jobs: name: universal-apple-darwin permissions: contents: write - runs-on: macos-14 + runs-on: macos-latest env: JUST_FOR_RELEASE: true From ad892911c662d4b58d759ef48f88b690d442d213 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 2 Aug 2024 05:04:46 +0000 Subject: [PATCH 1836/2020] dep: Upgrade transitive dependencies (#1856) Co-authored-by: github-actions --- Cargo.lock | 100 +++++++++++++++++++++++++++++++++++------------------ 1 file changed, 67 insertions(+), 33 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 66377a2a..156440f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,7 +26,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -510,9 +510,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "bytesize" @@ -638,9 +638,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2aba8f4e9906c7ce3c73463f62a7f0c65183ada1a2d47e397cc8810827f9694f" +checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" dependencies = [ "jobserver", "libc", @@ -654,9 +654,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.11" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35723e6a11662c2afb578bcf0b88bf6ea8e21282a953428f240574fcc3a2b5b3" +checksum = "0fbb260a053428790f3de475e304ff84cdbc4face759ea7a3e64c1edd938a7fc" dependencies = [ "clap_builder", "clap_derive", @@ -664,9 +664,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.11" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49eb96cbfa7cfa35017b7cd548c75b14c3118c98b423041d70562665e07fb0fa" +checksum = "64b17d7ea74e9f833c7dbf2cbe4fb12ff26783eda4782a8975b72f895c9b4d99" dependencies = [ "anstream", "anstyle", @@ -676,9 +676,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.11" +version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d029b67f89d30bbb547c89fd5161293c0aec155fc691d7924b64550662db93e" +checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -2402,9 +2402,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" dependencies = [ "equivalent", "hashbrown", @@ -2485,9 +2485,9 @@ dependencies = [ [[package]] name = "jobslot" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4aa6aac359cd1a94a809e1012b1b72d7416e6810299927ab60de041ef735fe00" +checksum = "fe10868679d7a24c2c67d862d0e64a342ce9aef7cdde9ce8019bd35d353d458d" dependencies = [ "cfg-if", "derive_destructure2", @@ -2495,7 +2495,7 @@ dependencies = [ "libc", "scopeguard", "tokio", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3037,9 +3037,12 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +checksum = "dee4364d9f3b902ef14fab8a1ddffb783a1cb6b4bba3bfc1fa3922732c7de97f" +dependencies = [ + "zerocopy 0.6.6", +] [[package]] name = "proc-macro2" @@ -3621,11 +3624,12 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.120" +version = "1.0.122" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" +checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -3868,9 +3872,9 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.15" +version = "0.12.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4873307b7c257eddcb50c9bedf158eb669578359fb28428bef438fec8e6ba7c2" +checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" @@ -3985,9 +3989,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.1" +version = "1.39.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d040ac2b29ab03b09d4129c2f5bbd012a3ac2f79d38ff506a4bf8dd34b0eac8a" +checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" dependencies = [ "backtrace", "bytes", @@ -4084,9 +4088,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81967dd0dd2c1ab0bc3468bd7caecc32b8a4aa47d0c8c695d8c2b2108168d62c" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", @@ -4096,18 +4100,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8fb9f64314842840f1d940ac544da178732128f1c78c21772e876579e0da1db" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.17" +version = "0.22.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d9f8729f5aea9562aac1cc0441f5d6de3cff1ee0c5d67293eeca5eb36ee7c16" +checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" dependencies = [ "indexmap", "serde", @@ -4608,6 +4612,15 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-targets" version = "0.48.5" @@ -4731,9 +4744,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.16" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b480ae9340fc261e6be3e95a1ba86d54ae3f9171132a73ce8d4bbaf68339507c" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr", ] @@ -4778,13 +4791,34 @@ dependencies = [ "lzma-sys", ] +[[package]] +name = "zerocopy" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854e949ac82d619ee9a14c66a1b674ac730422372ccb759ce0c39cabcf2bf8e6" +dependencies = [ + "byteorder", + "zerocopy-derive 0.6.6", +] + [[package]] name = "zerocopy" version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy-derive" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "125139de3f6b9d625c39e2efdd73d41bdac468ccd556556440e322be0e1bbd91" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] From 5d57d4506e1c92051317cbf40a98c88f50519fa2 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 3 Aug 2024 14:40:18 +1000 Subject: [PATCH 1837/2020] Fix CI blocked due to cargo-binstall rate-limit (#1860) * Update gh-action.yml Use CI_RELEASE_TEST_GITHUB_TOKEN if found as that one has less power Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Update install-script.yml Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * RM outdated comment in gh-action.yml Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Pass github token to cargo-bins/cargo-binstall action in release-cli.yml Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Pass github-token to taiki-e/install-action in release-pr.yml Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- .github/workflows/gh-action.yml | 4 ++-- .github/workflows/install-script.yml | 6 +++--- .github/workflows/release-cli.yml | 4 +++- .github/workflows/release-pr.yml | 2 ++ 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gh-action.yml b/.github/workflows/gh-action.yml index 20990277..5d2280a2 100644 --- a/.github/workflows/gh-action.yml +++ b/.github/workflows/gh-action.yml @@ -26,7 +26,7 @@ jobs: - name: Install cargo-binstall uses: ./ # uses action.yml from root of the repo env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - name: Verify successful installation - display cargo-binstall's help run: cargo binstall --help @@ -34,7 +34,7 @@ jobs: - name: Verify successful installation - install example binary using cargo-binstall run: cargo binstall -y ripgrep env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - name: Verify successful installation - display help of installed binary run: rg --help diff --git a/.github/workflows/install-script.yml b/.github/workflows/install-script.yml index c13b8bc2..40976162 100644 --- a/.github/workflows/install-script.yml +++ b/.github/workflows/install-script.yml @@ -47,7 +47,7 @@ jobs: - name: Install `cargo-binstall` using scripts run: ./install-from-binstall-release.sh env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - name: Verify `cargo-binstall` installation run: | @@ -76,7 +76,7 @@ jobs: - name: Install `cargo-binstall` using scripts run: ./install-from-binstall-release.ps1 env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - name: Verify `cargo-binstall` installation run: cargo binstall -vV @@ -104,7 +104,7 @@ jobs: shell: bash run: ./install-from-binstall-release.sh env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - name: Verify `cargo-binstall` installation shell: bash diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index a92f7b13..b31acdd1 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -36,10 +36,12 @@ jobs: - uses: actions/checkout@v4 - uses: cargo-bins/cargo-binstall@main + env: + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - name: Install binaries required run: cargo binstall -y --force rsign2 rage env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - name: Create ephemeral keypair id: keypair diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 3a43ef2c..47f98b4b 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -51,6 +51,8 @@ jobs: uses: taiki-e/install-action@v2 with: tool: cargo-release,cargo-semver-checks + env: + GITHUB_TOKEN: ${{ secrets.CI_RELEASE_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - run: rustup toolchain install stable --no-self-update --profile minimal - uses: cargo-bins/release-pr@v2.1.3 From cdbb12111231314513e0143af3624655b3b0f6ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 3 Aug 2024 15:03:10 +1000 Subject: [PATCH 1838/2020] build(deps): bump the deps group across 1 directory with 2 updates (#1859) * build(deps): bump the deps group across 1 directory with 2 updates Bumps the deps group with 2 updates in the / directory: [fs4](https://github.com/al8n/fs4-rs) and [windows-sys](https://github.com/microsoft/windows-rs). Updates `fs4` from 0.8.4 to 0.9.1 - [Release notes](https://github.com/al8n/fs4-rs/releases) - [Commits](https://github.com/al8n/fs4-rs/commits) Updates `windows-sys` from 0.52.0 to 0.59.0 - [Release notes](https://github.com/microsoft/windows-rs/releases) - [Commits](https://github.com/microsoft/windows-rs/compare/0.52.0...0.59.0) --- updated-dependencies: - dependency-name: fs4 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: windows-sys dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] * Fix use of fs4 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix windows.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Rm drop impl for LibraryHandle As unmounting dynlib might cause UB Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix clippy in windows.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- Cargo.lock | 6 +++--- crates/detect-targets/Cargo.toml | 2 +- crates/detect-targets/src/detect/windows.rs | 10 ++-------- crates/fs-lock/Cargo.toml | 2 +- crates/fs-lock/src/lib.rs | 2 +- 5 files changed, 8 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 156440f1..7f5faefd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -898,7 +898,7 @@ dependencies = [ "tokio", "tracing", "tracing-subscriber", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1123,9 +1123,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.8.4" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7e180ac76c23b45e767bd7ae9579bc0bb458618c4bc71835926e098e61d15f8" +checksum = "e8c6b3bd49c37d2aa3f3f2220233b29a7cd23f79d1fe70e5337d25fb390793de" dependencies = [ "rustix", "windows-sys 0.52.0", diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 00ffe458..03399ae8 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -27,7 +27,7 @@ tracing = ["dep:tracing"] cli-logging = ["tracing", "dep:tracing-subscriber"] [target.'cfg(target_os = "windows")'.dependencies] -windows-sys = { version = "0.52.0", features = [ +windows-sys = { version = "0.59.0", features = [ "Win32_System_Threading", "Win32_System_SystemInformation", "Win32_Foundation", diff --git a/crates/detect-targets/src/detect/windows.rs b/crates/detect-targets/src/detect/windows.rs index 5e4fe447..5bb397cb 100644 --- a/crates/detect-targets/src/detect/windows.rs +++ b/crates/detect-targets/src/detect/windows.rs @@ -1,6 +1,6 @@ use std::mem; use windows_sys::Win32::{ - Foundation::{FreeLibrary, HMODULE, S_OK}, + Foundation::{HMODULE, S_OK}, System::{ LibraryLoader::{GetProcAddress, LoadLibraryA}, SystemInformation::{ @@ -16,7 +16,7 @@ struct LibraryHandle(HMODULE); impl LibraryHandle { fn new(name: &[u8]) -> Option { let handle = unsafe { LoadLibraryA(name.as_ptr() as _) }; - (handle != 0).then(|| Self(handle)) + (!handle.is_null()).then_some(Self(handle)) } /// Get a function pointer to a function in the library. @@ -33,12 +33,6 @@ impl LibraryHandle { } } -impl Drop for LibraryHandle { - fn drop(&mut self) { - unsafe { FreeLibrary(self.0) }; - } -} - type GetMachineTypeAttributesFuncType = unsafe extern "system" fn(u16, *mut MACHINE_ATTRIBUTES) -> i32; const _: () = { diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 00be6e48..bd7ed3c9 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -10,4 +10,4 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -fs4 = "0.8.1" +fs4 = "0.9.1" diff --git a/crates/fs-lock/src/lib.rs b/crates/fs-lock/src/lib.rs index af209ff5..0a96609f 100644 --- a/crates/fs-lock/src/lib.rs +++ b/crates/fs-lock/src/lib.rs @@ -8,7 +8,7 @@ use std::{ ops, }; -use fs4::FileExt; +use fs4::fs_std::FileExt; /// A locked file. #[derive(Debug)] From ee94b8b6396783e613662a1175b2469518b1180d Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 3 Aug 2024 15:27:23 +1000 Subject: [PATCH 1839/2020] Fix: --strategies on CLI do not seem to override disabled-strategies in the manifest (#1857) * Fix cli override in entry.rs Forward `args.disabled_strategies` Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix `args::parse`: Do not free disabled_strategies Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix passing of cli_overrides Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Create strategies-test-override-Cargo.toml Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Add e2e-tests for cli-overrides Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix entry.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * fix entry.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix entry.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Update strategies.sh Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Compute cli_overrides in args::parse Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * fix use of args::parse main_impl.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Update entry.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix args::parse Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix typo in args.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix args.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix fmt in args.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * fix fmt in main_impl.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * update e2e-test-strategies Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Update e2e-tests/strategies.sh Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Update e2e-tests/strategies.sh Make sure both --strategies and --disable-strategies is tested Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Update strategies.sh Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/bin/src/args.rs | 27 ++++++++++++++----- crates/bin/src/entry.rs | 10 +------ crates/bin/src/main_impl.rs | 5 ++-- .../strategies-test-override-Cargo.toml | 13 +++++++++ e2e-tests/strategies.sh | 10 ++++++- 5 files changed, 47 insertions(+), 18 deletions(-) create mode 100644 e2e-tests/manifests/strategies-test-override-Cargo.toml diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 195f25f1..cb0aa65a 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -13,7 +13,7 @@ use binstalk::{ ops::resolve::{CrateName, VersionReqExt}, registry::Registry, }; -use binstalk_manifests::cargo_toml_binstall::Strategy; +use binstalk_manifests::cargo_toml_binstall::{PkgOverride, Strategy}; use clap::{builder::PossibleValue, error::ErrorKind, CommandFactory, Parser, ValueEnum}; use compact_str::CompactString; use log::LevelFilter; @@ -464,7 +464,7 @@ impl ValueEnum for StrategyWrapped { } } -pub fn parse() -> Args { +pub fn parse() -> (Args, PkgOverride) { // Filter extraneous arg when invoked by cargo // `cargo run -- --help` gives ["target/debug/cargo-binstall", "--help"] // `cargo binstall --help` gives ["/home/ryan/.cargo/bin/cargo-binstall", "binstall", "--help"] @@ -561,6 +561,8 @@ You cannot use --{option} and specify multiple packages at the same time. Do one } } + let has_strategies_override = !opts.strategies.is_empty(); + // Default strategies if empty if opts.strategies.is_empty() { opts.strategies = vec![ @@ -588,9 +590,6 @@ You cannot use --{option} and specify multiple packages at the same time. Do one .error(ErrorKind::TooFewValues, "You have disabled all strategies") .exit() } - - // Free disable_strategies as it will not be used again. - opts.disable_strategies = Vec::new(); } // Ensure that Strategy::Compile is specified as the last strategy @@ -614,7 +613,23 @@ You cannot use --{option} and specify multiple packages at the same time. Do one _ => (), } - opts + let cli_overrides = PkgOverride { + pkg_url: opts.pkg_url.take(), + pkg_fmt: opts.pkg_fmt.take(), + bin_dir: opts.bin_dir.take(), + disabled_strategies: (!opts.disable_strategies.is_empty() || has_strategies_override).then( + || { + opts.disable_strategies + .iter() + .map(|strategy| strategy.0) + .collect::>() + .into_boxed_slice() + }, + ), + signing: None, + }; + + (opts, cli_overrides) } #[cfg(test)] diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index e923d97f..4a0c446f 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -36,6 +36,7 @@ use crate::{args::Args, gh_token, git_credentials, install_path, ui::confirm}; pub fn install_crates( args: Args, + cli_overrides: PkgOverride, jobserver_client: LazyJobserverClient, ) -> Result>>> { // Compute Resolvers @@ -80,15 +81,6 @@ pub fn install_crates( // Launch target detection let desired_targets = get_desired_targets(args.targets); - // Computer cli_overrides - let cli_overrides = PkgOverride { - pkg_url: args.pkg_url, - pkg_fmt: args.pkg_fmt, - bin_dir: args.bin_dir, - disabled_strategies: None, - signing: None, - }; - // Initialize reqwest client let rate_limit = args.rate_limit; diff --git a/crates/bin/src/main_impl.rs b/crates/bin/src/main_impl.rs index 14a3dbd8..2c78960b 100644 --- a/crates/bin/src/main_impl.rs +++ b/crates/bin/src/main_impl.rs @@ -15,7 +15,7 @@ pub fn do_main() -> impl Termination { // This must be the very first thing to happen let jobserver_client = LazyJobserverClient::new(); - let args = args::parse(); + let (args, cli_overrides) = args::parse(); if args.version { let cargo_binstall_version = env!("CARGO_PKG_VERSION"); @@ -54,7 +54,8 @@ rustc-llvm-version: {rustc_llvm_version}"# let start = Instant::now(); - let result = run_tokio_main(|| entry::install_crates(args, jobserver_client)); + let result = + run_tokio_main(|| entry::install_crates(args, cli_overrides, jobserver_client)); let done = start.elapsed(); debug!("run time: {done:?}"); diff --git a/e2e-tests/manifests/strategies-test-override-Cargo.toml b/e2e-tests/manifests/strategies-test-override-Cargo.toml new file mode 100644 index 00000000..97127671 --- /dev/null +++ b/e2e-tests/manifests/strategies-test-override-Cargo.toml @@ -0,0 +1,13 @@ +[package] +name = "cargo-quickinstall" +repository = "https://github.com/cargo-bins/cargo-quickinstall" +version = "0.2.10" + +[[bin]] +name = "cargo-quickinstall" +path = "src/main.rs" +test = false +doc = false + +[package.metadata.binstall] +disabled-strategies = ["crate-meta-data", "quick-install", "compile"] diff --git a/e2e-tests/strategies.sh b/e2e-tests/strategies.sh index 0248d6c3..583d8d14 100755 --- a/e2e-tests/strategies.sh +++ b/e2e-tests/strategies.sh @@ -37,7 +37,7 @@ fi ## Test compile-only strategy "./$1" binstall --no-confirm --strategies compile cargo-quickinstall@0.2.8 -## Test --disable-strategies +## Test Cargo.toml disable-strategies set +e "./$1" binstall --no-confirm --manifest-path "manifests/strategies-test-Cargo.toml" cargo-update@11.1.2 @@ -49,3 +49,11 @@ if [ "$exit_code" != 94 ]; then echo "Expected exit code 94, but actual exit code $exit_code" exit 1 fi + +set -euxo pipefail + +## Test --strategies overriding `disabled-strategies=["compile"]` in Cargo.toml + "./$1" binstall --no-confirm --manifest-path "manifests/strategies-test-override-Cargo.toml" --strategies compile cargo-quickinstall@0.2.10 + +## Test --disable-strategies overriding `disabled-strategies=["compile"]` in Cargo.toml + "./$1" binstall --no-confirm --manifest-path "manifests/strategies-test-override-Cargo.toml" --disable-strategies crate-meta-data,quick-install --force cargo-quickinstall@0.2.10 From de55e465f5065877b121029e1611cc5cbea85e0d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 3 Aug 2024 05:48:40 +0000 Subject: [PATCH 1840/2020] dep: Upgrade transitive dependencies (#1861) Co-authored-by: github-actions --- Cargo.lock | 55 ++++++++++++++++++------------------------------------ 1 file changed, 18 insertions(+), 37 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7f5faefd..3e9b4371 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,7 +26,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy 0.7.35", + "zerocopy", ] [[package]] @@ -3037,11 +3037,11 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.18" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee4364d9f3b902ef14fab8a1ddffb783a1cb6b4bba3bfc1fa3922732c7de97f" +checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "zerocopy 0.6.6", + "zerocopy", ] [[package]] @@ -3273,9 +3273,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.5" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr", @@ -3878,12 +3878,13 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.10.1" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +checksum = "b8fcd239983515c23a32fb82099f97d0b11b8c72f654ed659363a95c3dad7a53" dependencies = [ "cfg-if", "fastrand 2.1.0", + "once_cell", "rustix", "windows-sys 0.52.0", ] @@ -4508,11 +4509,11 @@ checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" [[package]] name = "winapi-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d4cc384e1e73b93bafa6fb4f1df8c41695c8a91cf9c4c64358067d15a7b6c6b" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4791,34 +4792,14 @@ dependencies = [ "lzma-sys", ] -[[package]] -name = "zerocopy" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854e949ac82d619ee9a14c66a1b674ac730422372ccb759ce0c39cabcf2bf8e6" -dependencies = [ - "byteorder", - "zerocopy-derive 0.6.6", -] - [[package]] name = "zerocopy" version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "zerocopy-derive 0.7.35", -] - -[[package]] -name = "zerocopy-derive" -version = "0.6.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "125139de3f6b9d625c39e2efdd73d41bdac468ccd556556440e322be0e1bbd91" -dependencies = [ - "proc-macro2", - "quote", - "syn", + "byteorder", + "zerocopy-derive", ] [[package]] @@ -4849,18 +4830,18 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "7.2.0" +version = "7.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa556e971e7b568dc775c136fc9de8c779b1c2fc3a63defaafadffdbd3181afa" +checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.12+zstd.1.5.6" +version = "2.0.13+zstd.1.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4e40c320c3cb459d9a9ff6de98cff88f4751ee9275d140e2be94a2b74e4c13" +checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" dependencies = [ "cc", "pkg-config", From 52f2db4f5797aed4bd56fd66dcf8a56503149d23 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sun, 4 Aug 2024 12:13:18 +1000 Subject: [PATCH 1841/2020] Add `--maximum-resolution-timeout` (#1862) * Add --maximum-resolution-timeout Fixed #1823 * Display default value for `--maximum-resolution-timeout` in help --- crates/bin/src/args.rs | 9 +++ crates/bin/src/entry.rs | 5 ++ crates/binstalk/Cargo.toml | 1 + crates/binstalk/src/ops.rs | 4 +- crates/binstalk/src/ops/resolve.rs | 105 ++++++++++++++++------------- 5 files changed, 76 insertions(+), 48 deletions(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index cb0aa65a..000abd5f 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -187,6 +187,15 @@ pub struct Args { )] pub(crate) no_discover_github_token: bool, + /// Maximum time each resolution (one for each possible target and each strategy), in seconds. + #[clap( + help_heading = "Overrides", + long, + env = "BINSTALL_MAXIMUM_RESOLUTION_TIMEOUT", + default_value_t = NonZeroU16::new(180).unwrap(), + )] + pub(crate) maximum_resolution_timeout: NonZeroU16, + /// This flag is now enabled by default thus a no-op. /// /// By default, Binstall will install a binary as-is in the install path. diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 4a0c446f..5fbf6e84 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -2,6 +2,7 @@ use std::{ env, fs, path::{Path, PathBuf}, sync::Arc, + time::Duration, }; use binstalk::{ @@ -200,6 +201,10 @@ pub fn install_crates( SignaturePolicy::IfPresent }, disable_telemetry: args.disable_telemetry, + + maximum_resolution_timeout: Duration::from_secs( + args.maximum_resolution_timeout.get().into(), + ), }); // Destruct args before any async function to reduce size of the future diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 1d44502e..8a07f4a2 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -40,6 +40,7 @@ tokio = { version = "1.35.0", features = [ "rt", "process", "sync", + "time", ], default-features = false } tracing = "0.1.39" url = { version = "2.3.1", features = ["serde"] } diff --git a/crates/binstalk/src/ops.rs b/crates/binstalk/src/ops.rs index 57b20c17..8051daaa 100644 --- a/crates/binstalk/src/ops.rs +++ b/crates/binstalk/src/ops.rs @@ -1,6 +1,6 @@ //! Concrete Binstall operations. -use std::{path::PathBuf, sync::Arc}; +use std::{path::PathBuf, sync::Arc, time::Duration}; use semver::VersionReq; @@ -56,4 +56,6 @@ pub struct Options { pub signature_policy: SignaturePolicy, pub disable_telemetry: bool, + + pub maximum_resolution_timeout: Duration, } diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 5d27adcf..87a7dbfc 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -17,7 +17,7 @@ use itertools::Itertools; use leon::Template; use maybe_owned::MaybeOwned; use semver::{Version, VersionReq}; -use tokio::task::spawn_blocking; +use tokio::{task::spawn_blocking, time::timeout}; use tracing::{debug, error, info, instrument, warn}; use url::Url; @@ -182,62 +182,73 @@ async fn resolve_inner( } for fetcher in handles { - match AutoAbortJoinHandle::new(fetcher.clone().find()) - .flattened_join() - .await + match timeout( + opts.maximum_resolution_timeout, + AutoAbortJoinHandle::new(fetcher.clone().find()).flattened_join(), + ) + .await { - Ok(true) => { - // Generate temporary binary path - let bin_path = opts.temp_dir.join(format!( - "bin-{}-{}-{}", - package_info.name, - fetcher.target(), - fetcher.fetcher_name() - )); + Ok(ret) => match ret { + Ok(true) => { + // Generate temporary binary path + let bin_path = opts.temp_dir.join(format!( + "bin-{}-{}-{}", + package_info.name, + fetcher.target(), + fetcher.fetcher_name() + )); - match download_extract_and_verify( - fetcher.as_ref(), - &bin_path, - &package_info, - &opts.install_path, - opts.no_symlinks, - ) - .await - { - Ok(bin_files) => { - if !bin_files.is_empty() { - return Ok(Resolution::Fetch(Box::new(ResolutionFetch { - fetcher, - new_version: package_info.version, - name: package_info.name, - version_req: version_req_str, - source: package_info.source, - bin_files, - }))); - } else { - warn!( - "Error when checking binaries provided by fetcher {}: \ + match download_extract_and_verify( + fetcher.as_ref(), + &bin_path, + &package_info, + &opts.install_path, + opts.no_symlinks, + ) + .await + { + Ok(bin_files) => { + if !bin_files.is_empty() { + return Ok(Resolution::Fetch(Box::new(ResolutionFetch { + fetcher, + new_version: package_info.version, + name: package_info.name, + version_req: version_req_str, + source: package_info.source, + bin_files, + }))); + } else { + warn!( + "Error when checking binaries provided by fetcher {}: \ The fetcher does not provide any optional binary", + fetcher.source_name(), + ); + } + } + Err(err) => { + if let BinstallError::UserAbort = err { + return Err(err); + } + warn!( + "Error while downloading and extracting from fetcher {}: {}", fetcher.source_name(), + err ); } } - Err(err) => { - if let BinstallError::UserAbort = err { - return Err(err); - } - warn!( - "Error while downloading and extracting from fetcher {}: {}", - fetcher.source_name(), - err - ); - } } - } - Ok(false) => (), + Ok(false) => (), + Err(err) => { + warn!( + "Error while checking fetcher {}: {}", + fetcher.source_name(), + err + ); + } + }, Err(err) => { warn!( - "Error while checking fetcher {}: {}", + "Timeout reached while checking fetcher {}: {}", fetcher.source_name(), err ); From cf7c8f96569de2d4e64317400159b5dafd99ca62 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 4 Aug 2024 13:04:47 +1000 Subject: [PATCH 1842/2020] chore: release (#1853) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 10 +++++----- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-manifests/CHANGELOG.md | 12 ++++++++++++ crates/binstalk-manifests/Cargo.toml | 6 +++--- crates/binstalk/CHANGELOG.md | 12 ++++++++++++ crates/binstalk/Cargo.toml | 4 ++-- crates/detect-targets/CHANGELOG.md | 12 ++++++++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 14 ++++++++++++++ crates/detect-wasi/Cargo.toml | 2 +- crates/fs-lock/CHANGELOG.md | 12 ++++++++++++ crates/fs-lock/Cargo.toml | 2 +- 12 files changed, 77 insertions(+), 15 deletions(-) create mode 100644 crates/binstalk-manifests/CHANGELOG.md create mode 100644 crates/binstalk/CHANGELOG.md create mode 100644 crates/detect-targets/CHANGELOG.md create mode 100644 crates/detect-wasi/CHANGELOG.md create mode 100644 crates/fs-lock/CHANGELOG.md diff --git a/Cargo.lock b/Cargo.lock index 3e9b4371..0b6260b9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -247,7 +247,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.27.0" +version = "0.27.1" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -371,7 +371,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.14.0" +version = "0.14.1" dependencies = [ "beef", "binstalk-types", @@ -891,7 +891,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.17" +version = "0.1.18" dependencies = [ "cfg-if", "guess_host_triple", @@ -903,7 +903,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.0" +version = "1.0.1" dependencies = [ "tempfile", ] @@ -1116,7 +1116,7 @@ dependencies = [ [[package]] name = "fs-lock" -version = "0.1.3" +version = "0.1.4" dependencies = [ "fs4", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 7dcf8731..1336948d 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,8 +22,8 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.27.0", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.14.0" } +binstalk = { path = "../binstalk", version = "0.27.1", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.14.1" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md new file mode 100644 index 00000000..8a36a80a --- /dev/null +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.14.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.14.0...binstalk-manifests-v0.14.1) - 2024-08-04 + +### Other +- updated the following local packages: detect-targets, fs-lock diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 2ebbc0ee..0e63584b 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.14.0" +version = "0.14.1" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" beef = { version = "0.5.2", features = ["impl_serde"] } binstalk-types = { version = "0.8.0", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } -fs-lock = { version = "0.1.3", path = "../fs-lock" } +fs-lock = { version = "0.1.4", path = "../fs-lock" } home = "0.5.9" miette = "7.0.0" semver = { version = "1.0.17", features = ["serde"] } @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.17", path = "../detect-targets" } +detect-targets = { version = "0.1.18", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md new file mode 100644 index 00000000..ed1a8e87 --- /dev/null +++ b/crates/binstalk/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.27.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.27.0...binstalk-v0.27.1) - 2024-08-04 + +### Other +- Add `--maximum-resolution-timeout` ([#1862](https://github.com/cargo-bins/cargo-binstall/pull/1862)) diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 8a07f4a2..aec27ce8 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.27.0" +version = "0.27.1" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -21,7 +21,7 @@ binstalk-types = { version = "0.8.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.1", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.17", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.18", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md new file mode 100644 index 00000000..2ad6898d --- /dev/null +++ b/crates/detect-targets/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.1.18](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.17...detect-targets-v0.1.18) - 2024-08-04 + +### Other +- *(deps)* bump the deps group across 1 directory with 2 updates ([#1859](https://github.com/cargo-bins/cargo-binstall/pull/1859)) diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 03399ae8..44a9365a 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.17" +version = "0.1.18" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md new file mode 100644 index 00000000..0c388db7 --- /dev/null +++ b/crates/detect-wasi/CHANGELOG.md @@ -0,0 +1,14 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [1.0.1](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.0...detect-wasi-v1.0.1) - 2024-08-04 + +### Other +- Bump tempfile from 3.4.0 to 3.5.0 ([#967](https://github.com/cargo-bins/cargo-binstall/pull/967)) +- Bump tempfile from 3.3.0 to 3.4.0 ([#834](https://github.com/cargo-bins/cargo-binstall/pull/834)) +- Migrate CI and builds to Just, add "full" builds ([#660](https://github.com/cargo-bins/cargo-binstall/pull/660)) diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index 88ad5a18..c700b9fb 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.0" +version = "1.0.1" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" diff --git a/crates/fs-lock/CHANGELOG.md b/crates/fs-lock/CHANGELOG.md new file mode 100644 index 00000000..af4f3ae8 --- /dev/null +++ b/crates/fs-lock/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.1.4](https://github.com/cargo-bins/cargo-binstall/compare/fs-lock-v0.1.3...fs-lock-v0.1.4) - 2024-08-04 + +### Other +- *(deps)* bump the deps group across 1 directory with 2 updates ([#1859](https://github.com/cargo-bins/cargo-binstall/pull/1859)) diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index bd7ed3c9..04e67728 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -3,7 +3,7 @@ name = "fs-lock" description = "Locked files that can be used like normal File" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/fs-lock" -version = "0.1.3" +version = "0.1.4" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From 23ee8ab6b7397851bc11705bcdf46f2519ea0285 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 4 Aug 2024 15:32:22 +1000 Subject: [PATCH 1843/2020] release: cargo-binstall v1.9.0 (#1863) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0b6260b9..9401aa5f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -552,7 +552,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.8.0" +version = "1.9.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 1336948d..b08aceaf 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.8.0" +version = "1.9.0" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index d20658ed..476cef80 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 90d47f76b1d1f5859c6d7129df91827223bd072e Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Mon, 5 Aug 2024 20:42:00 +1000 Subject: [PATCH 1844/2020] Fix release-plz.toml (#1866) Do not set release as latest, since that would break installation script/action. Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- release-plz.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/release-plz.toml b/release-plz.toml index 7103eb64..40edb4b6 100644 --- a/release-plz.toml +++ b/release-plz.toml @@ -1,3 +1,4 @@ [[package]] name = "cargo-binstall" release = false # don't process this package +git_release_latest = false # don't set release as latest release From b854f3f52ce175834d032f7dc4dc648743b0ab47 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Thu, 8 Aug 2024 00:04:00 +1000 Subject: [PATCH 1845/2020] feature: Merge disable strategies (#1868) * feat: Merge --disable-strategies with ones in cargo manifest Signed-off-by: Jiahao XU * Update doc Signed-off-by: Jiahao XU * Update e2e-test-strategies Signed-off-by: Jiahao XU * Fix typo in option doc in crates/bin/src/args.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- SUPPORT.md | 7 ++++- crates/bin/src/args.rs | 27 +++++++++++------- .../binstalk-types/src/cargo_toml_binstall.rs | 28 ++++++++++++++++--- .../manifests/strategies-test-Cargo2.toml | 19 +++++++++++++ e2e-tests/strategies.sh | 15 +++++++--- 5 files changed, 77 insertions(+), 19 deletions(-) create mode 100644 e2e-tests/manifests/strategies-test-Cargo2.toml diff --git a/SUPPORT.md b/SUPPORT.md index 3ca7d5b4..090e463a 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -13,6 +13,7 @@ As an example, the configuration would be like this: pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }-v{ version }{ archive-suffix }" bin-dir = "{ name }-{ target }-v{ version }/{ bin }{ binary-ext }" pkg-fmt = "tgz" +disabled-strategies = ["quick-install", "compile"] ``` With the following configuration keys: @@ -20,7 +21,11 @@ With the following configuration keys: - `pkg-url` specifies the package download URL for a given target/version, templated - `bin-dir` specifies the binary path within the package, templated (with an `.exe` suffix on windows) - `pkg-fmt` overrides the package format for download/extraction (defaults to: `tgz`) -- `disabled-strategies` to disable specific strategies (e.g. `crate-meta-data` for trying to find pre-built on your repository, `quick-install` for pre-built from third-party cargo-bins/cargo-quickinstall, `compile` for falling back to `cargo-install`) for your crate (defaults to empty array). The user can override this by explicitly specifying --strategies on the command line. +- `disabled-strategies` to disable specific strategies (e.g. `crate-meta-data` for trying to find pre-built on your repository, + `quick-install` for pre-built from third-party cargo-bins/cargo-quickinstall, `compile` for falling back to `cargo-install`) + for your crate (defaults to empty array). + If `--strategies` is passed on the command line, then the `disabled-strategies` in `package.metadata` will be ignored. + Otherwise, the `disabled-strategies` in `package.metadata` and `--disable-strategies` will be merged. `pkg-url` and `bin-dir` are templated to support different names for different versions / architectures / etc. diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 000abd5f..1eab39c4 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -1,7 +1,7 @@ use std::{ env, ffi::OsString, - fmt, + fmt, mem, num::{NonZeroU16, NonZeroU64, ParseIntError}, path::PathBuf, str::FromStr, @@ -155,6 +155,10 @@ pub struct Args { /// Specify the strategies to be used, /// binstall will run the strategies specified in order. /// + /// If this option is specified, then cargo-binstall will ignore + /// `disabled-strategies` in `package.metadata` in the cargo manifest + /// of the installed packages. + /// /// Default value is "crate-meta-data,quick-install,compile". #[clap( help_heading = "Overrides", @@ -167,6 +171,10 @@ pub struct Args { /// Disable the strategies specified. /// If a strategy is specified in `--strategies` and `--disable-strategies`, /// then it will be removed. + /// + /// If `--strategies` is not specified, then the strategies specified in this + /// option will be merged with the disabled-strategies` in `package.metadata` + /// in the cargo manifest of the installed packages. #[clap( help_heading = "Overrides", long, @@ -570,7 +578,7 @@ You cannot use --{option} and specify multiple packages at the same time. Do one } } - let has_strategies_override = !opts.strategies.is_empty(); + let ignore_disabled_strategies = !opts.strategies.is_empty(); // Default strategies if empty if opts.strategies.is_empty() { @@ -626,15 +634,14 @@ You cannot use --{option} and specify multiple packages at the same time. Do one pkg_url: opts.pkg_url.take(), pkg_fmt: opts.pkg_fmt.take(), bin_dir: opts.bin_dir.take(), - disabled_strategies: (!opts.disable_strategies.is_empty() || has_strategies_override).then( - || { - opts.disable_strategies - .iter() - .map(|strategy| strategy.0) - .collect::>() - .into_boxed_slice() - }, + disabled_strategies: Some( + mem::take(&mut opts.disable_strategies) + .into_iter() + .map(|strategy| strategy.0) + .collect::>() + .into_boxed_slice(), ), + ignore_disabled_strategies, signing: None, }; diff --git a/crates/binstalk-types/src/cargo_toml_binstall.rs b/crates/binstalk-types/src/cargo_toml_binstall.rs index e1ab03c6..74330e9e 100644 --- a/crates/binstalk-types/src/cargo_toml_binstall.rs +++ b/crates/binstalk-types/src/cargo_toml_binstall.rs @@ -101,6 +101,11 @@ impl PkgMeta { where It: IntoIterator + Clone, { + let ignore_disabled_strategies = pkg_overrides + .clone() + .into_iter() + .any(|pkg_override| pkg_override.ignore_disabled_strategies); + Self { pkg_url: pkg_overrides .clone() @@ -126,10 +131,22 @@ impl PkgMeta { .find_map(|pkg_override| pkg_override.signing.clone()) .or_else(|| self.signing.clone()), - disabled_strategies: pkg_overrides - .into_iter() - .find_map(|pkg_override| pkg_override.disabled_strategies.clone()) - .or_else(|| self.disabled_strategies.clone()), + disabled_strategies: if ignore_disabled_strategies { + None + } else { + let mut disabled_strategies = pkg_overrides + .into_iter() + .filter_map(|pkg_override| pkg_override.disabled_strategies.as_deref()) + .flatten() + .chain(self.disabled_strategies.as_deref().into_iter().flatten()) + .copied() + .collect::>(); + + disabled_strategies.sort_unstable(); + disabled_strategies.dedup(); + + Some(disabled_strategies.into_boxed_slice()) + }, overrides: Default::default(), } @@ -156,6 +173,9 @@ pub struct PkgOverride { /// Package signing configuration pub signing: Option, + + #[serde(skip)] + pub ignore_disabled_strategies: bool, } #[derive(Clone, Debug, Eq, PartialEq, Serialize, Deserialize)] diff --git a/e2e-tests/manifests/strategies-test-Cargo2.toml b/e2e-tests/manifests/strategies-test-Cargo2.toml new file mode 100644 index 00000000..aef2811e --- /dev/null +++ b/e2e-tests/manifests/strategies-test-Cargo2.toml @@ -0,0 +1,19 @@ +[package] +name = "cargo-update" +repository = "https://github.com/nabijaczleweli/cargo-update" +version = "11.1.2" + +[[bin]] +name = "cargo-install-update" +path = "src/main.rs" +test = false +doc = false + +[[bin]] +name = "cargo-install-update-config" +path = "src/main-config.rs" +test = false +doc = false + +[package.metadata.binstall] +disabled-strategies = ["quick-install"] diff --git a/e2e-tests/strategies.sh b/e2e-tests/strategies.sh index 583d8d14..981ce188 100755 --- a/e2e-tests/strategies.sh +++ b/e2e-tests/strategies.sh @@ -50,10 +50,17 @@ if [ "$exit_code" != 94 ]; then exit 1 fi -set -euxo pipefail +set +e + +"./$1" binstall --disable-strategies compile --no-confirm --manifest-path "manifests/strategies-test-Cargo2.toml" cargo-update@11.1.2 +exit_code="$?" + +set -e + +if [ "$exit_code" != 94 ]; then + echo "Expected exit code 94, but actual exit code $exit_code" + exit 1 +fi ## Test --strategies overriding `disabled-strategies=["compile"]` in Cargo.toml "./$1" binstall --no-confirm --manifest-path "manifests/strategies-test-override-Cargo.toml" --strategies compile cargo-quickinstall@0.2.10 - -## Test --disable-strategies overriding `disabled-strategies=["compile"]` in Cargo.toml - "./$1" binstall --no-confirm --manifest-path "manifests/strategies-test-override-Cargo.toml" --disable-strategies crate-meta-data,quick-install --force cargo-quickinstall@0.2.10 From 96f5445e529cdc1f8dbbc70d3f554f0527f4a946 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 10 Aug 2024 14:31:24 +1000 Subject: [PATCH 1846/2020] dep: Bump hickory-resolver to 0.25.0-alpha.2 (#1869) * dep: Bump hickory-resolver to 0.25.0-alpha.2 Signed-off-by: Jiahao XU * Remove workaround for ring 0.16 on aarc64-pc-windows-msvc Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- Cargo.lock | 351 ++++++-------------------- crates/binstalk-downloader/Cargo.toml | 2 +- justfile | 6 +- 3 files changed, 78 insertions(+), 281 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9401aa5f..c92ae666 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -146,6 +146,17 @@ dependencies = [ "zstd-safe", ] +[[package]] +name = "async-recursion" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "async-trait" version = "0.1.81" @@ -224,12 +235,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d27c3610c36aee21ce8ac510e6224498de4228ad772a171ed65643a24693a5a8" -[[package]] -name = "base64" -version = "0.21.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" - [[package]] name = "base64" version = "0.22.1" @@ -1040,15 +1045,6 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2a2b11eda1d40935b26cf18f6833c526845ae8c41e58d09af6adeb6f0269183" -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - [[package]] name = "fastrand" version = "2.1.0" @@ -1185,7 +1181,7 @@ version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" dependencies = [ - "fastrand 2.1.0", + "fastrand", "futures-core", "futures-io", "parking", @@ -1531,7 +1527,7 @@ version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6adf99c27cdf17b1c4d77680c917e0d94d8783d4e1c73d3be0d1d63107163d7a" dependencies = [ - "fastrand 2.1.0", + "fastrand", "gix-features", "gix-utils", ] @@ -1918,7 +1914,7 @@ version = "0.42.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27c02b83763ffe95bcc27ce5821b2b7f843315a009c06f1cd59c9b66c508c058" dependencies = [ - "base64 0.22.1", + "base64", "bstr", "gix-command", "gix-credentials", @@ -1968,7 +1964,7 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "35192df7fd0fa112263bad8021e2df7167df4cc2a6e6d15892e1e55621d3d4dc" dependencies = [ - "fastrand 2.1.0", + "fastrand", "unicode-normalization", ] @@ -2039,25 +2035,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "h2" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http 0.2.12", - "indexmap", - "slab", - "tokio", - "tokio-util", - "tracing", -] - [[package]] name = "h2" version = "0.4.5" @@ -2069,7 +2046,7 @@ dependencies = [ "fnv", "futures-core", "futures-sink", - "http 1.1.0", + "http", "indexmap", "slab", "tokio", @@ -2077,20 +2054,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "h3" -version = "0.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6de6ca43eed186fd055214af06967b0a7a68336cefec7e8a4004e96efeaccb9e" -dependencies = [ - "bytes", - "fastrand 1.9.0", - "futures-util", - "http 0.2.12", - "tokio", - "tracing", -] - [[package]] name = "h3" version = "0.0.5" @@ -2098,28 +2061,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5069de1c2ac82d9e361b07f2b8a2c582ec071750e063530fc7f3b5197e24805" dependencies = [ "bytes", - "fastrand 2.1.0", + "fastrand", "futures-util", - "http 1.1.0", + "http", "pin-project-lite", "tokio", "tracing", ] -[[package]] -name = "h3-quinn" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d4a1a1763e4f3e82ee9f1ecf2cf862b22cc7316ebe14684e42f94532b5ec64d" -dependencies = [ - "bytes", - "futures", - "h3 0.0.2", - "quinn 0.10.2", - "quinn-proto 0.10.6", - "tokio-util", -] - [[package]] name = "h3-quinn" version = "0.0.6" @@ -2128,8 +2077,8 @@ checksum = "b8c01d99d7cf812fd34ddf135e6c940df9e24f2e759dbc7179fb0e54d4bd6551" dependencies = [ "bytes", "futures", - "h3 0.0.5", - "quinn 0.11.2", + "h3", + "quinn", "tokio", "tokio-util", ] @@ -2164,11 +2113,13 @@ checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hickory-proto" -version = "0.24.1" +version = "0.25.0-alpha.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07698b8420e2f0d6447a436ba999ec85d8fbf2a398bbd737b82cac4a2e96e512" +checksum = "8270a1857fb962b9914aafd46a89a187a4e63d0eb4190c327e7c7b8256a2d055" dependencies = [ + "async-recursion", "async-trait", + "bitflags 2.6.0", "bytes", "cfg-if", "data-encoding", @@ -2176,33 +2127,35 @@ dependencies = [ "futures-channel", "futures-io", "futures-util", - "h2 0.3.26", - "h3 0.0.2", - "h3-quinn 0.0.3", - "http 0.2.12", - "idna 0.4.0", + "h2", + "h3", + "h3-quinn", + "http", + "idna", "ipnet", "native-tls", "once_cell", - "quinn 0.10.2", + "pin-project-lite", + "quinn", "rand", - "ring 0.16.20", - "rustls 0.21.12", - "rustls-pemfile 1.0.4", + "ring", + "rustls", + "rustls-pemfile", "thiserror", + "time", "tinyvec", "tokio", "tokio-native-tls", - "tokio-rustls 0.24.1", + "tokio-rustls", "tracing", "url", ] [[package]] name = "hickory-resolver" -version = "0.24.1" +version = "0.25.0-alpha.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28757f23aa75c98f254cf0405e6d8c25b831b32921b050a66692427679b1f243" +checksum = "46c110355b5703070d9e29c344d79818a7cde3de9c27fc35750defea6074b0ad" dependencies = [ "cfg-if", "futures-util", @@ -2211,14 +2164,15 @@ dependencies = [ "lru-cache", "once_cell", "parking_lot", + "quinn", "rand", "resolv-conf", - "rustls 0.21.12", + "rustls", "smallvec", "thiserror", "tokio", "tokio-native-tls", - "tokio-rustls 0.24.1", + "tokio-rustls", "tracing", ] @@ -2242,17 +2196,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "http" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - [[package]] name = "http" version = "1.1.0" @@ -2271,7 +2214,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.1.0", + "http", ] [[package]] @@ -2282,7 +2225,7 @@ checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" dependencies = [ "bytes", "futures-util", - "http 1.1.0", + "http", "http-body", "pin-project-lite", ] @@ -2314,8 +2257,8 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "h2 0.4.5", - "http 1.1.0", + "h2", + "http", "http-body", "httparse", "itoa", @@ -2332,14 +2275,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" dependencies = [ "futures-util", - "http 1.1.0", + "http", "hyper", "hyper-util", - "rustls 0.23.12", + "rustls", "rustls-native-certs", "rustls-pki-types", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls", "tower-service", "webpki-roots", ] @@ -2369,7 +2312,7 @@ dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", + "http", "http-body", "hyper", "pin-project-lite", @@ -2380,16 +2323,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "0.5.0" @@ -2410,15 +2343,6 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - [[package]] name = "io-close" version = "0.3.7" @@ -3069,23 +2993,6 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" -[[package]] -name = "quinn" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cc2c5017e4b43d5995dcea317bc46c1e09404c0a9664d2908f7f02dfe943d75" -dependencies = [ - "bytes", - "pin-project-lite", - "quinn-proto 0.10.6", - "quinn-udp 0.4.1", - "rustc-hash", - "rustls 0.21.12", - "thiserror", - "tokio", - "tracing", -] - [[package]] name = "quinn" version = "0.11.2" @@ -3095,32 +3002,15 @@ dependencies = [ "bytes", "futures-io", "pin-project-lite", - "quinn-proto 0.11.3", - "quinn-udp 0.5.4", + "quinn-proto", + "quinn-udp", "rustc-hash", - "rustls 0.23.12", + "rustls", "thiserror", "tokio", "tracing", ] -[[package]] -name = "quinn-proto" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "141bf7dfde2fbc246bfd3fe12f2455aa24b0fbd9af535d8c86c7bd1381ff2b1a" -dependencies = [ - "bytes", - "rand", - "ring 0.16.20", - "rustc-hash", - "rustls 0.21.12", - "slab", - "thiserror", - "tinyvec", - "tracing", -] - [[package]] name = "quinn-proto" version = "0.11.3" @@ -3129,28 +3019,15 @@ checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" dependencies = [ "bytes", "rand", - "ring 0.17.8", + "ring", "rustc-hash", - "rustls 0.23.12", + "rustls", "slab", "thiserror", "tinyvec", "tracing", ] -[[package]] -name = "quinn-udp" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "055b4e778e8feb9f93c4e439f71dc2156ef13360b432b799e179a8c4cdf0b1d7" -dependencies = [ - "bytes", - "libc", - "socket2", - "tracing", - "windows-sys 0.48.0", -] - [[package]] name = "quinn-udp" version = "0.5.4" @@ -3160,6 +3037,7 @@ dependencies = [ "libc", "once_cell", "socket2", + "tracing", "windows-sys 0.52.0", ] @@ -3307,16 +3185,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" dependencies = [ "async-compression", - "base64 0.22.1", + "base64", "bytes", "encoding_rs", "futures-channel", "futures-core", "futures-util", - "h2 0.4.5", - "h3 0.0.5", - "h3-quinn 0.0.6", - "http 1.1.0", + "h2", + "h3", + "h3-quinn", + "http", "http-body", "http-body-util", "hyper", @@ -3331,10 +3209,10 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "quinn 0.11.2", - "rustls 0.23.12", + "quinn", + "rustls", "rustls-native-certs", - "rustls-pemfile 2.1.2", + "rustls-pemfile", "rustls-pki-types", "serde", "serde_json", @@ -3344,7 +3222,7 @@ dependencies = [ "system-configuration", "tokio", "tokio-native-tls", - "tokio-rustls 0.26.0", + "tokio-rustls", "tokio-util", "tower-service", "url", @@ -3366,21 +3244,6 @@ dependencies = [ "quick-error", ] -[[package]] -name = "ring" -version = "0.16.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" -dependencies = [ - "cc", - "libc", - "once_cell", - "spin 0.5.2", - "untrusted 0.7.1", - "web-sys", - "winapi", -] - [[package]] name = "ring" version = "0.17.8" @@ -3391,8 +3254,8 @@ dependencies = [ "cfg-if", "getrandom", "libc", - "spin 0.9.8", - "untrusted 0.9.0", + "spin", + "untrusted", "windows-sys 0.52.0", ] @@ -3430,28 +3293,17 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rustls" -version = "0.21.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f56a14d1f48b391359b22f731fd4bd7e43c97f3c50eee276f3aa09c94784d3e" -dependencies = [ - "log", - "ring 0.17.8", - "rustls-webpki 0.101.7", - "sct", -] - [[package]] name = "rustls" version = "0.23.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" dependencies = [ + "log", "once_cell", - "ring 0.17.8", + "ring", "rustls-pki-types", - "rustls-webpki 0.102.6", + "rustls-webpki", "subtle", "zeroize", ] @@ -3463,28 +3315,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" dependencies = [ "openssl-probe", - "rustls-pemfile 2.1.2", + "rustls-pemfile", "rustls-pki-types", "schannel", "security-framework", ] -[[package]] -name = "rustls-pemfile" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" -dependencies = [ - "base64 0.21.7", -] - [[package]] name = "rustls-pemfile" version = "2.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" dependencies = [ - "base64 0.22.1", + "base64", "rustls-pki-types", ] @@ -3494,25 +3337,15 @@ version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" -[[package]] -name = "rustls-webpki" -version = "0.101.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" -dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", -] - [[package]] name = "rustls-webpki" version = "0.102.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" dependencies = [ - "ring 0.17.8", + "ring", "rustls-pki-types", - "untrusted 0.9.0", + "untrusted", ] [[package]] @@ -3551,16 +3384,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[package]] -name = "sct" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" -dependencies = [ - "ring 0.17.8", - "untrusted 0.9.0", -] - [[package]] name = "security-framework" version = "2.11.1" @@ -3762,12 +3585,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - [[package]] name = "spin" version = "0.9.8" @@ -3883,7 +3700,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8fcd239983515c23a32fb82099f97d0b11b8c72f654ed659363a95c3dad7a53" dependencies = [ "cfg-if", - "fastrand 2.1.0", + "fastrand", "once_cell", "rustix", "windows-sys 0.52.0", @@ -4026,23 +3843,13 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-rustls" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" -dependencies = [ - "rustls 0.21.12", - "tokio", -] - [[package]] name = "tokio-rustls" version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" dependencies = [ - "rustls 0.23.12", + "rustls", "rustls-pki-types", "tokio", ] @@ -4279,12 +4086,6 @@ version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" -[[package]] -name = "untrusted" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" - [[package]] name = "untrusted" version = "0.9.0" @@ -4298,7 +4099,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", - "idna 0.5.0", + "idna", "percent-encoding", "serde", ] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 09271b9c..a7ad420f 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -62,7 +62,7 @@ tokio = { version = "1.35.0", features = [ tokio-tar = "0.3.0" tokio-util = { version = "0.7.8", features = ["io"] } tracing = "0.1.39" -hickory-resolver = { version = "0.24.0", optional = true, features = [ +hickory-resolver = { version = "0.25.0-alpha.2", optional = true, features = [ "dnssec-ring", ] } once_cell = { version = "1.18.0", optional = true } diff --git a/justfile b/justfile index aa60dfd0..bb7ab556 100644 --- a/justfile +++ b/justfile @@ -112,10 +112,6 @@ cargo-features := trim_end_match(if override-features != "" { override-features # errors with: "Found a record with an unknown abbreviation code" cargo-split-debuginfo := if cargo-buildstd != "" { " --config='profile.release.split-debuginfo=\"packed\"' --config=profile.release.debug=2" } else { "" } -# for ARM64 Windows, use a patched version of ring -# this should be unnecessary once ring 0.17 is released -win-arm64-ring16 := if target == "aarch64-pc-windows-msvc" { " --config='patch.crates-io.ring.git=\"https://github.com/awakecoding/ring\"' --config='patch.crates-io.ring.branch=\"0.16.20_alpha\"'" } else { "" } - # MIR optimisation level (defaults to 2, bring it up to 4 for release builds) # **DISABLED because it's buggy** rustc-miropt := "" # if for-release != "" { " -Z mir-opt-level=4" } else { "" } @@ -175,7 +171,7 @@ target-glibc-ver-postfix := if glibc-version != "" { "" } -cargo-check-args := (" --target ") + (target) + (target-glibc-ver-postfix) + (cargo-buildstd) + (if extra-build-args != "" { " " + extra-build-args } else { "" }) + (cargo-split-debuginfo) + (win-arm64-ring16) +cargo-check-args := (" --target ") + (target) + (target-glibc-ver-postfix) + (cargo-buildstd) + (if extra-build-args != "" { " " + extra-build-args } else { "" }) + (cargo-split-debuginfo) cargo-build-args := (if for-release != "" { " --release" } else { "" }) + (cargo-check-args) + (cargo-no-default-features) + (if cargo-features != "" { " --features " + cargo-features } else { "" }) + (if timings != "" { " --timings" } else { "" }) export RUSTFLAGS := (linker-plugin-lto) + (rustc-gcclibs) + (rustc-miropt) + (rust-lld) + (rustc-icf) + (if enable-h3 != "" { " --cfg reqwest_unstable" } else { "" }) From e9b36b063251606fbabfbbdaec55dc21caa62ee0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 10 Aug 2024 05:02:06 +0000 Subject: [PATCH 1847/2020] dep: Upgrade transitive dependencies (#1874) Co-authored-by: github-actions --- Cargo.lock | 81 +++++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 44 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c92ae666..b38530bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -643,9 +643,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26a5c3fd7bfa1ce3897a3a3501d362b2d87b7f2583ebcb4a949ec25911025cbc" +checksum = "504bdec147f2cc13c8b57ed9401fd8a147cc66b67ad5cb241394244f2c947549" dependencies = [ "jobserver", "libc", @@ -659,9 +659,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.13" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fbb260a053428790f3de475e304ff84cdbc4face759ea7a3e64c1edd938a7fc" +checksum = "11d8838454fda655dafd3accb2b6e2bea645b9e4078abe84a22ceb947235c5cc" dependencies = [ "clap_builder", "clap_derive", @@ -669,9 +669,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.13" +version = "4.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64b17d7ea74e9f833c7dbf2cbe4fb12ff26783eda4782a8975b72f895c9b4d99" +checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" dependencies = [ "anstream", "anstyle", @@ -957,9 +957,9 @@ dependencies = [ [[package]] name = "dunce" -version = "1.0.4" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "either" @@ -1059,21 +1059,21 @@ checksum = "9ffe3a660c3a1b10e96f304a9413d673b2118d62e4520f7ddf4a4faccfe8b9b9" [[package]] name = "filetime" -version = "0.2.23" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ee447700ac8aa0b2f2bd7bc4462ad686ba06baa6727ac149a2d6277f0d240fd" +checksum = "bf401df4a4e3872c4fe8151134cf483738e74b67fc934d6532c882b3d24a4550" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.4.1", - "windows-sys 0.52.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] name = "flate2" -version = "1.0.30" +version = "1.0.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f54427cfd1c7829e2a139fcefea601bf088ebca651d2bf53ebc600eac295dae" +checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" dependencies = [ "crc32fast", "libz-ng-sys", @@ -2305,9 +2305,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.6" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ab92f4f49ee4fb4f997c784b7a2e0fa70050211e0b6a287f898c3c9785ca956" +checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" dependencies = [ "bytes", "futures-channel", @@ -2502,6 +2502,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", + "redox_syscall 0.5.3", ] [[package]] @@ -2789,9 +2790,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.2" +version = "0.36.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f203fa8daa7bb185f760ae12bd8e097f63d17041dcdcaf675ac54cdf863170e" +checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" dependencies = [ "memchr", ] @@ -2995,9 +2996,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quinn" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4ceeeeabace7857413798eb1ffa1e9c905a9946a57d81fb69b4b71c4d8eb3ad" +checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" dependencies = [ "bytes", "futures-io", @@ -3006,6 +3007,7 @@ dependencies = [ "quinn-udp", "rustc-hash", "rustls", + "socket2", "thiserror", "tokio", "tracing", @@ -3013,9 +3015,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.3" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf517c03a109db8100448a4be38d498df8a210a99fe0e1b9eaf39e78c640efe" +checksum = "ba92fb39ec7ad06ca2582c0ca834dfeadcaf06ddfc8e635c80aa7e1c05315fdd" dependencies = [ "bytes", "rand", @@ -3109,15 +3111,6 @@ dependencies = [ "bitflags 1.3.2", ] -[[package]] -name = "redox_syscall" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" -dependencies = [ - "bitflags 1.3.2", -] - [[package]] name = "redox_syscall" version = "0.5.3" @@ -3267,9 +3260,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "1.1.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustc_version" @@ -3323,9 +3316,9 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.2" +version = "2.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29993a25686778eb88d4189742cd713c9bce943bc54251a33509dc63cbacf73d" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" dependencies = [ "base64", "rustls-pki-types", @@ -3333,9 +3326,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.7.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "976295e77ce332211c0d24d92c0e83e50f5c5f046d11082cea19f3df13a3562d" +checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-webpki" @@ -3418,9 +3411,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.204" +version = "1.0.205" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "e33aedb1a7135da52b7c21791455563facbbcc43d0f0f66165b42c21b3dfb150" dependencies = [ "serde_derive", ] @@ -3436,9 +3429,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.205" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "692d6f5ac90220161d6774db30c662202721e64aed9058d2c394f451261420c1" dependencies = [ "proc-macro2", "quote", @@ -3695,15 +3688,15 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.11.0" +version = "3.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fcd239983515c23a32fb82099f97d0b11b8c72f654ed659363a95c3dad7a53" +checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" dependencies = [ "cfg-if", "fastrand", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] From 53512b92712846d2cf5cb87db904822b0016deff Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 10 Aug 2024 17:46:44 +1000 Subject: [PATCH 1848/2020] chore: release (#1870) * chore: release * Bump dependents of binstall-types to next major version Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- Cargo.lock | 20 ++++++++++---------- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-bins/CHANGELOG.md | 12 ++++++++++++ crates/binstalk-bins/Cargo.toml | 4 ++-- crates/binstalk-downloader/CHANGELOG.md | 12 ++++++++++++ crates/binstalk-downloader/Cargo.toml | 4 ++-- crates/binstalk-fetchers/CHANGELOG.md | 12 ++++++++++++ crates/binstalk-fetchers/Cargo.toml | 10 +++++----- crates/binstalk-git-repo-api/CHANGELOG.md | 12 ++++++++++++ crates/binstalk-git-repo-api/Cargo.toml | 6 +++--- crates/binstalk-manifests/CHANGELOG.md | 5 +++++ crates/binstalk-manifests/Cargo.toml | 6 +++--- crates/binstalk-registry/CHANGELOG.md | 12 ++++++++++++ crates/binstalk-registry/Cargo.toml | 8 ++++---- crates/binstalk-types/CHANGELOG.md | 12 ++++++++++++ crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/CHANGELOG.md | 5 +++++ crates/binstalk/Cargo.toml | 16 ++++++++-------- crates/detect-targets/CHANGELOG.md | 5 +++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 5 +++++ crates/detect-wasi/Cargo.toml | 2 +- 22 files changed, 134 insertions(+), 42 deletions(-) create mode 100644 crates/binstalk-bins/CHANGELOG.md create mode 100644 crates/binstalk-downloader/CHANGELOG.md create mode 100644 crates/binstalk-fetchers/CHANGELOG.md create mode 100644 crates/binstalk-git-repo-api/CHANGELOG.md create mode 100644 crates/binstalk-registry/CHANGELOG.md create mode 100644 crates/binstalk-types/CHANGELOG.md diff --git a/Cargo.lock b/Cargo.lock index b38530bc..f58a3ce2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -252,7 +252,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.27.1" +version = "0.28.0" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -284,7 +284,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.5.0" +version = "0.6.0" dependencies = [ "atomic-file-install", "binstalk-types", @@ -298,7 +298,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.12.0" +version = "0.13.0" dependencies = [ "async-compression", "async-trait", @@ -333,7 +333,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.8.0" +version = "0.9.0" dependencies = [ "async-trait", "binstalk-downloader", @@ -357,7 +357,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.4.0" +version = "0.5.0" dependencies = [ "binstalk-downloader", "compact_str", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.14.1" +version = "0.15.0" dependencies = [ "beef", "binstalk-types", @@ -397,7 +397,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.10.0" +version = "0.11.0" dependencies = [ "async-trait", "base16", @@ -424,7 +424,7 @@ dependencies = [ [[package]] name = "binstalk-types" -version = "0.8.0" +version = "0.9.0" dependencies = [ "compact_str", "maybe-owned", @@ -896,7 +896,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.18" +version = "0.1.19" dependencies = [ "cfg-if", "guess_host_triple", @@ -908,7 +908,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.1" +version = "1.0.2" dependencies = [ "tempfile", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index b08aceaf..076ec6c0 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,8 +22,8 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.27.1", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.14.1" } +binstalk = { path = "../binstalk", version = "0.28.0", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.0" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-bins/CHANGELOG.md b/crates/binstalk-bins/CHANGELOG.md new file mode 100644 index 00000000..42b7f45a --- /dev/null +++ b/crates/binstalk-bins/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.6.0](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.5.0...binstalk-bins-v0.6.0) - 2024-08-10 + +### Other +- updated the following local packages: binstalk-types diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 913d8578..6dd76f77 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.5.0" +version = "0.6.0" edition = "2021" description = "The binstall binaries discovery and installation crate." @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] atomic-file-install = { version = "1.0.5", path = "../atomic-file-install" } -binstalk-types = { version = "0.8.0", path = "../binstalk-types" } +binstalk-types = { version = "0.9.0", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" diff --git a/crates/binstalk-downloader/CHANGELOG.md b/crates/binstalk-downloader/CHANGELOG.md new file mode 100644 index 00000000..13f95e02 --- /dev/null +++ b/crates/binstalk-downloader/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.13.0](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.12.0...binstalk-downloader-v0.13.0) - 2024-08-10 + +### Other +- Bump hickory-resolver to 0.25.0-alpha.2 ([#1869](https://github.com/cargo-bins/cargo-binstall/pull/1869)) diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index a7ad420f..bc3fdd7a 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.12.0" +version = "0.13.0" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -27,7 +27,7 @@ async_zip = { version = "0.0.17", features = [ "xz", "tokio", ] } -binstalk-types = { version = "0.8.0", path = "../binstalk-types" } +binstalk-types = { version = "0.9.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" compact_str = "0.8.0" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md new file mode 100644 index 00000000..10577222 --- /dev/null +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.9.0](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.8.0...binstalk-fetchers-v0.9.0) - 2024-08-10 + +### Other +- updated the following local packages: binstalk-types, binstalk-downloader, binstalk-downloader diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 87234858..4b9dc32e 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.8.0" +version = "0.9.0" edition = "2021" description = "The binstall fetchers" @@ -12,9 +12,9 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.12.0", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.4.0", path = "../binstalk-git-repo-api" } -binstalk-types = { version = "0.8.0", path = "../binstalk-types" } +binstalk-downloader = { version = "0.13.0", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.0", path = "../binstalk-git-repo-api" } +binstalk-types = { version = "0.9.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } either = "1.11.0" @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.12.0", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.0", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md new file mode 100644 index 00000000..27633892 --- /dev/null +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.5.0](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.4.0...binstalk-git-repo-api-v0.5.0) - 2024-08-10 + +### Other +- updated the following local packages: binstalk-downloader, binstalk-downloader diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index d0516813..ed140541 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.4.0" +version = "0.5.0" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.12.0", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.0", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.8.0" @@ -25,6 +25,6 @@ url = "2.3.1" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.12.0", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.0", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index 8a36a80a..a7b33a16 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.0](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.14.1...binstalk-manifests-v0.15.0) - 2024-08-10 + +### Other +- updated the following local packages: binstalk-types, detect-targets + ## [0.14.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.14.0...binstalk-manifests-v0.14.1) - 2024-08-04 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 0e63584b..4fc10c37 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.14.1" +version = "0.15.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] beef = { version = "0.5.2", features = ["impl_serde"] } -binstalk-types = { version = "0.8.0", path = "../binstalk-types" } +binstalk-types = { version = "0.9.0", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } fs-lock = { version = "0.1.4", path = "../fs-lock" } home = "0.5.9" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.18", path = "../detect-targets" } +detect-targets = { version = "0.1.19", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md new file mode 100644 index 00000000..05bb36db --- /dev/null +++ b/crates/binstalk-registry/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.11.0](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.10.0...binstalk-registry-v0.11.0) - 2024-08-10 + +### Other +- updated the following local packages: binstalk-types, binstalk-downloader, binstalk-downloader diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index daceab1b..c803d11e 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.10.0" +version = "0.11.0" edition = "2021" rust-version = "1.65.0" @@ -13,10 +13,10 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.12.0", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.0", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } -binstalk-types = { version = "0.8.0", path = "../binstalk-types" } +binstalk-types = { version = "0.9.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.1", path = "../cargo-toml-workspace" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" @@ -40,7 +40,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.12.0", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.0", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk-types/CHANGELOG.md b/crates/binstalk-types/CHANGELOG.md new file mode 100644 index 00000000..9d65f706 --- /dev/null +++ b/crates/binstalk-types/CHANGELOG.md @@ -0,0 +1,12 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [0.9.0](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-types-v0.8.0...binstalk-types-v0.9.0) - 2024-08-10 + +### Added +- Merge disable strategies ([#1868](https://github.com/cargo-bins/cargo-binstall/pull/1868)) diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 1d315b68..4c09e825 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-types" description = "The binstall toolkit that contains basic types for binstalk crates" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-types" -version = "0.8.0" +version = "0.9.0" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index ed1a8e87..4337e34f 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.0](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.27.1...binstalk-v0.27.2) - 2024-08-10 + +### Other +- updated the following local packages: binstalk-types, binstalk-downloader, detect-targets + ## [0.27.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.27.0...binstalk-v0.27.1) - 2024-08-04 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index aec27ce8..c45b2ae9 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,25 +3,25 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.27.1" +version = "0.28.0" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.5.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.12.0", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.4.0", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.8.0", path = "../binstalk-fetchers", features = [ +binstalk-bins = { version = "0.6.0", path = "../binstalk-bins" } +binstalk-downloader = { version = "0.13.0", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.0", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.9.0", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.10.0", path = "../binstalk-registry" } -binstalk-types = { version = "0.8.0", path = "../binstalk-types" } +binstalk-registry = { version = "0.11.0", path = "../binstalk-registry" } +binstalk-types = { version = "0.9.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.1", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.18", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.19", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index 2ad6898d..8e099799 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.19](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.18...detect-targets-v0.1.19) - 2024-08-10 + +### Other +- update Cargo.lock dependencies + ## [0.1.18](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.17...detect-targets-v0.1.18) - 2024-08-04 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 44a9365a..533acf70 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.18" +version = "0.1.19" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index 0c388db7..007b81c1 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.2](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.1...detect-wasi-v1.0.2) - 2024-08-10 + +### Other +- update Cargo.lock dependencies + ## [1.0.1](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.0...detect-wasi-v1.0.1) - 2024-08-04 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index c700b9fb..899457ef 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.1" +version = "1.0.2" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From d35fecfd64d33f6d0d6d4fe1472a9107b0c94656 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 10 Aug 2024 18:24:15 +1000 Subject: [PATCH 1849/2020] release: cargo-binstall v1.10.0 (#1875) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f58a3ce2..06a90e1a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -557,7 +557,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.9.0" +version = "1.10.0" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 076ec6c0..0d89077e 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.9.0" +version = "1.10.0" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 476cef80..256ce8d0 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 43012ceb2cf779c88990b247a4f9d3e6ac5674de Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 10 Aug 2024 18:40:05 +1000 Subject: [PATCH 1850/2020] Fix release-plz.toml (#1876) Set git_release_latest=false in workspace Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- release-plz.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/release-plz.toml b/release-plz.toml index 40edb4b6..37bb12f8 100644 --- a/release-plz.toml +++ b/release-plz.toml @@ -1,4 +1,7 @@ +[workspace] +git_release_latest = false # don't set release as latest release + [[package]] name = "cargo-binstall" release = false # don't process this package -git_release_latest = false # don't set release as latest release + From a8eea5bc72c8b1aae4cedd85d85d1815d305a7ee Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sun, 11 Aug 2024 17:26:09 +1000 Subject: [PATCH 1851/2020] Enable happy eyeballs when using hickory-dns (#1877) * Enable happy eyeballs when using hickory-dns Ported from seanmonstar/reqwest#2378 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix imports in resolver.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix fmt in resolver.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix fmt in resolver.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix resolver.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix import on windows in resolver.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- .../src/remote/resolver.rs | 71 +++++++++++-------- 1 file changed, 40 insertions(+), 31 deletions(-) diff --git a/crates/binstalk-downloader/src/remote/resolver.rs b/crates/binstalk-downloader/src/remote/resolver.rs index 3382bde7..d6b01c8e 100644 --- a/crates/binstalk-downloader/src/remote/resolver.rs +++ b/crates/binstalk-downloader/src/remote/resolver.rs @@ -1,12 +1,15 @@ use std::{net::SocketAddr, sync::Arc}; -use hickory_resolver::TokioAsyncResolver; +use hickory_resolver::{ + config::{LookupIpStrategy, ResolverConfig, ResolverOpts}, + system_conf, TokioAsyncResolver, +}; use once_cell::sync::OnceCell; use reqwest::dns::{Addrs, Name, Resolve, Resolving}; use tracing::{debug, instrument, warn}; #[cfg(windows)] -use hickory_resolver::config::{NameServerConfig, Protocol, ResolverConfig, ResolverOpts}; +use hickory_resolver::config::{NameServerConfig, Protocol}; type BoxError = Box; @@ -26,38 +29,44 @@ impl Resolve for TrustDnsResolver { } } +#[cfg(unix)] +fn get_configs() -> Result<(ResolverConfig, ResolverOpts), BoxError> { + debug!("Using system DNS resolver configuration"); + system_conf::read_system_conf().map_err(Into::into) +} + +#[cfg(windows)] +fn get_configs() -> Result<(ResolverConfig, ResolverOpts), BoxError> { + debug!("Using custom DNS resolver configuration"); + let mut config = ResolverConfig::new(); + let opts = ResolverOpts::default(); + + get_adapter()?.dns_servers().iter().for_each(|addr| { + tracing::trace!("Adding DNS server: {}", addr); + let socket_addr = SocketAddr::new(*addr, 53); + for protocol in [Protocol::Udp, Protocol::Tcp] { + config.add_name_server(NameServerConfig { + socket_addr, + protocol, + tls_dns_name: None, + trust_negative_responses: false, + #[cfg(feature = "rustls")] + tls_config: None, + bind_addr: None, + }) + } + }); + + Ok((config, opts)) +} + #[instrument] fn new_resolver() -> Result { - #[cfg(unix)] - { - debug!("Using system DNS resolver configuration"); - Ok(TokioAsyncResolver::tokio_from_system_conf()?) - } - #[cfg(windows)] - { - debug!("Using custom DNS resolver configuration"); - let mut config = ResolverConfig::new(); - let opts = ResolverOpts::default(); + let (config, mut opts) = get_configs()?; - get_adapter()?.dns_servers().iter().for_each(|addr| { - tracing::trace!("Adding DNS server: {}", addr); - let socket_addr = SocketAddr::new(*addr, 53); - for protocol in [Protocol::Udp, Protocol::Tcp] { - config.add_name_server(NameServerConfig { - socket_addr, - protocol, - tls_dns_name: None, - trust_negative_responses: false, - #[cfg(feature = "rustls")] - tls_config: None, - bind_addr: None, - }) - } - }); - - debug!("Resolver configuration complete"); - Ok(TokioAsyncResolver::tokio(config, opts)) - } + debug!("Resolver configuration complete"); + opts.ip_strategy = LookupIpStrategy::Ipv4AndIpv6; + Ok(TokioAsyncResolver::tokio(config, opts)) } #[cfg(windows)] From d02d7b2a69827ea979a9b2dc07967c80de161d19 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Mon, 12 Aug 2024 23:57:22 +1000 Subject: [PATCH 1852/2020] Fix setting release to latest in release-cli.yml (#1879) * Fix setting release to latest in release-cli.yml Using gh-release-edit Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Update .github/workflows/release-cli.yml Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- .github/workflows/release-cli.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release-cli.yml b/.github/workflows/release-cli.yml index b31acdd1..39be23c1 100644 --- a/.github/workflows/release-cli.yml +++ b/.github/workflows/release-cli.yml @@ -110,7 +110,7 @@ jobs: run: cargo publish -p "$crate" --allow-dirty --no-default-features - if: fromJSON(inputs.info).is-release == 'true' - name: Make release latest + name: Upload minisign.pub uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} @@ -120,6 +120,12 @@ jobs: promote: true file: minisign.pub + - if: fromJSON(inputs.info).is-release == 'true' + name: Make release latest + run: gh release edit v${{ fromJSON(inputs.info).version }} --latest --draft=false + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - if: fromJSON(inputs.info).is-release == 'true' name: Delete signing key artifact uses: geekyeggo/delete-artifact@v5 From 2c00df4c9017d98f63b78801dd227ff2ad70e534 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 14:22:35 +0000 Subject: [PATCH 1853/2020] chore: release (#1878) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 10 +++++----- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/CHANGELOG.md | 5 +++++ crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/CHANGELOG.md | 5 +++++ crates/binstalk-fetchers/Cargo.toml | 8 ++++---- crates/binstalk-git-repo-api/CHANGELOG.md | 5 +++++ crates/binstalk-git-repo-api/Cargo.toml | 6 +++--- crates/binstalk-registry/CHANGELOG.md | 5 +++++ crates/binstalk-registry/Cargo.toml | 6 +++--- crates/binstalk/CHANGELOG.md | 5 +++++ crates/binstalk/Cargo.toml | 10 +++++----- 12 files changed, 47 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 06a90e1a..adeb3ebf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -252,7 +252,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.0" +version = "0.28.1" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -298,7 +298,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.13.0" +version = "0.13.1" dependencies = [ "async-compression", "async-trait", @@ -333,7 +333,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.9.0" +version = "0.9.1" dependencies = [ "async-trait", "binstalk-downloader", @@ -357,7 +357,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.0" +version = "0.5.1" dependencies = [ "binstalk-downloader", "compact_str", @@ -397,7 +397,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.11.0" +version = "0.11.1" dependencies = [ "async-trait", "base16", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 0d89077e..add1f362 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.28.0", default-features = false } +binstalk = { path = "../binstalk", version = "0.28.1", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.0" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" diff --git a/crates/binstalk-downloader/CHANGELOG.md b/crates/binstalk-downloader/CHANGELOG.md index 13f95e02..de662490 100644 --- a/crates/binstalk-downloader/CHANGELOG.md +++ b/crates/binstalk-downloader/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.13.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.0...binstalk-downloader-v0.13.1) - 2024-08-12 + +### Other +- Enable happy eyeballs when using hickory-dns ([#1877](https://github.com/cargo-bins/cargo-binstall/pull/1877)) + ## [0.13.0](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.12.0...binstalk-downloader-v0.13.0) - 2024-08-10 ### Other diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index bc3fdd7a..05a8e52d 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.13.0" +version = "0.13.1" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index 10577222..6a94e153 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.9.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.9.0...binstalk-fetchers-v0.9.1) - 2024-08-12 + +### Other +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.9.0](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.8.0...binstalk-fetchers-v0.9.0) - 2024-08-10 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 4b9dc32e..75d9b98b 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.9.0" +version = "0.9.1" edition = "2021" description = "The binstall fetchers" @@ -12,8 +12,8 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.13.0", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.0", path = "../binstalk-git-repo-api" } +binstalk-downloader = { version = "0.13.1", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.1", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.9.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.0", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.1", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index 27633892..000a8ca7 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.0...binstalk-git-repo-api-v0.5.1) - 2024-08-12 + +### Other +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.5.0](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.4.0...binstalk-git-repo-api-v0.5.0) - 2024-08-10 ### Other diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index ed140541..0237cea2 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.0" +version = "0.5.1" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.13.0", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.1", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.8.0" @@ -25,6 +25,6 @@ url = "2.3.1" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.0", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.1", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md index 05bb36db..36628bf4 100644 --- a/crates/binstalk-registry/CHANGELOG.md +++ b/crates/binstalk-registry/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.0...binstalk-registry-v0.11.1) - 2024-08-12 + +### Other +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.11.0](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.10.0...binstalk-registry-v0.11.0) - 2024-08-10 ### Other diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index c803d11e..a0415643 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.11.0" +version = "0.11.1" edition = "2021" rust-version = "1.65.0" @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.13.0", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.1", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.9.0", path = "../binstalk-types" } @@ -40,7 +40,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.13.0", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.1", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index 4337e34f..29fb2bad 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.0...binstalk-v0.28.1) - 2024-08-12 + +### Other +- updated the following local packages: binstalk-downloader + ## [0.28.0](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.27.1...binstalk-v0.27.2) - 2024-08-10 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index c45b2ae9..3826e9f0 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.0" +version = "0.28.1" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -11,12 +11,12 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.6.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.13.0", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.0", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.9.0", path = "../binstalk-fetchers", features = [ +binstalk-downloader = { version = "0.13.1", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.1", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.9.1", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.11.0", path = "../binstalk-registry" } +binstalk-registry = { version = "0.11.1", path = "../binstalk-registry" } binstalk-types = { version = "0.9.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.1", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } From ad67d44ff6b5eaff3f087200c4b07b1c26f8cf1d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 12 Aug 2024 14:55:46 +0000 Subject: [PATCH 1854/2020] release: cargo-binstall v1.10.1 (#1880) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index adeb3ebf..e326d8f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -557,7 +557,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.0" +version = "1.10.1" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index add1f362..5907ec6a 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.0" +version = "1.10.1" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 256ce8d0..ec6745a6 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From c4abcb90a5fac18f5f8744cbf7bd11b00a37ca41 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 13 Aug 2024 09:15:54 +0000 Subject: [PATCH 1855/2020] release: cargo-binstall v1.10.2 (#1881) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e326d8f4..4a85acba 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -557,7 +557,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.1" +version = "1.10.2" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 5907ec6a..85431a21 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.1" +version = "1.10.2" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index ec6745a6..630fe414 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 448bb02a7fb3bded10e371612519f0c07c920411 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 16 Aug 2024 03:46:47 +0000 Subject: [PATCH 1856/2020] dep: Upgrade transitive dependencies (#1882) Co-authored-by: github-actions --- Cargo.lock | 100 +++++++++++++++++++++++++++++------------------------ 1 file changed, 54 insertions(+), 46 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4a85acba..680eb2f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -548,9 +548,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.7" +version = "1.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0ec6b951b160caa93cc0c7b209e5a3bff7aae9062213451ac99493cd844c239" +checksum = "3054fea8a20d8ff3968d5b22cc27501d2b08dc4decdb31b184323f00c5ef23bb" dependencies = [ "serde", ] @@ -643,12 +643,13 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.8" +version = "1.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "504bdec147f2cc13c8b57ed9401fd8a147cc66b67ad5cb241394244f2c947549" +checksum = "68064e60dbf1f17005c2fde4d07c16d8baa506fd7ffed8ccab702d93617975c7" dependencies = [ "jobserver", "libc", + "shlex", ] [[package]] @@ -659,9 +660,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.15" +version = "4.5.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d8838454fda655dafd3accb2b6e2bea645b9e4078abe84a22ceb947235c5cc" +checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" dependencies = [ "clap_builder", "clap_derive", @@ -705,9 +706,9 @@ checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" [[package]] name = "cmake" -version = "0.1.50" +version = "0.1.51" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31c789563b815f77f4250caee12365734369f942439b7defd71e18a48197130" +checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" dependencies = [ "cc", ] @@ -757,15 +758,15 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" +checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" dependencies = [ "libc", ] @@ -2335,9 +2336,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.3.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3fc2e30ba82dd1b3911c8de1ffc143c74a914a14e99514d7637e3099df5ea0" +checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" dependencies = [ "equivalent", "hashbrown", @@ -2424,9 +2425,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] @@ -2480,9 +2481,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.155" +version = "0.2.156" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "a5f43f184355eefb8d17fc948dbecf6c13be3c141f20d834ae842193a448c72a" [[package]] name = "libmimalloc-sys" @@ -2673,9 +2674,9 @@ dependencies = [ [[package]] name = "mio" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4569e456d394deccd22ce1c1913e6ea0e54519f577285001215d33557431afe4" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ "hermit-abi", "libc", @@ -3411,9 +3412,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.205" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33aedb1a7135da52b7c21791455563facbbcc43d0f0f66165b42c21b3dfb150" +checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" dependencies = [ "serde_derive", ] @@ -3429,9 +3430,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.205" +version = "1.0.208" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692d6f5ac90220161d6774db30c662202721e64aed9058d2c394f451261420c1" +checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" dependencies = [ "proc-macro2", "quote", @@ -3440,9 +3441,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.122" +version = "1.0.125" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "784b6203951c57ff748476b126ccb5e8e2959a5c19e5c617ab1956be3dbc68da" +checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" dependencies = [ "itoa", "memchr", @@ -3524,6 +3525,12 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "signal-hook-registry" version = "1.4.2" @@ -3644,9 +3651,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.72" +version = "2.0.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc4b9b9bf2add8093d3f2c0204471e951b2285580335de42f9d2534f3ae7a8af" +checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" dependencies = [ "proc-macro2", "quote", @@ -3938,15 +3945,15 @@ dependencies = [ [[package]] name = "tower-layer" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -4183,19 +4190,20 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", @@ -4208,9 +4216,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.42" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -4220,9 +4228,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4230,9 +4238,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", @@ -4243,9 +4251,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wasm-streams" @@ -4262,9 +4270,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77afa9a11836342370f4817622a2f0f418b134426d91a82dfb48f532d2ec13ef" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", From 6cb09fd1e2327dfe0cbf7f52c6542551b6f05223 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 17 Aug 2024 08:57:12 +1000 Subject: [PATCH 1857/2020] Add link for all supported pkg-fmt in SUPPORT.md (#1887) * Add link for all supported pkg-fmt in SUPPORT.md Fix #1885 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Update SUPPORT.md Co-authored-by: pinage404 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Co-authored-by: pinage404 --- SUPPORT.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SUPPORT.md b/SUPPORT.md index 090e463a..f18fd17f 100644 --- a/SUPPORT.md +++ b/SUPPORT.md @@ -20,7 +20,7 @@ With the following configuration keys: - `pkg-url` specifies the package download URL for a given target/version, templated - `bin-dir` specifies the binary path within the package, templated (with an `.exe` suffix on windows) -- `pkg-fmt` overrides the package format for download/extraction (defaults to: `tgz`) +- `pkg-fmt` overrides the package format for download/extraction (defaults to: `tgz`), check [the documentation](https://docs.rs/binstalk-types/latest/binstalk_types/cargo_toml_binstall/enum.PkgFmt.html) for all supported formats. - `disabled-strategies` to disable specific strategies (e.g. `crate-meta-data` for trying to find pre-built on your repository, `quick-install` for pre-built from third-party cargo-bins/cargo-quickinstall, `compile` for falling back to `cargo-install`) for your crate (defaults to empty array). From b599493600b644395007f78a3dabaaac5af5a33e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alejandro=20Gonz=C3=A1lez?= <7822554+AlexTMjugador@users.noreply.github.com> Date: Tue, 20 Aug 2024 12:24:13 +0200 Subject: [PATCH 1858/2020] docs: mention `quickinstall` telemetry collection in `--help` and README (#1890) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs: mention `quickinstall` telemetry collection in `--help` and README These changes describe the usage statistics collected when the `quickinstall` strategy is used by default, according to the discussion and details brought forward on https://github.com/cargo-bins/cargo-binstall/issues/1884. Both the project README and the CLI long help contain clear disclosures of such statistics collection now. Signed-off-by: Alejandro González * docs: add some more data collection details Signed-off-by: Alejandro González --------- Signed-off-by: Alejandro González --- README.md | 15 +++++++++++++++ crates/bin/src/args.rs | 8 +++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 472e3ff7..2a40466b 100644 --- a/README.md +++ b/README.md @@ -157,6 +157,21 @@ You can find a full description of errors including exit codes here: . +Should you be interested on it, the backend code for these endpoints can be found at . + +If you prefer not to participate in this data collection, you can opt out by any of the following methods: + +- Setting the `--disable-telemetry` flag in the command line interface. +- Setting the `BINSTALL_DISABLE_TELEMETRY` environment variable to `true`. +- Disabling the `quickinstall` strategy with `--disable-strategy quick-install`, or if specifying a list of strategies to use with `--strategy`, avoiding including `quickinstall` in that list. +- Adding `quick-install` to the `disabled-strategies` configuration key in the crate metadata (refer to [the related support documentation](SUPPORT.md#support-for-cargo-binstall) for more details). + --- If you have ideas/contributions or anything is not working the way you expect (in which case, please include an output with `--log-level debug`) and feel free to open an issue or PR. diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 1eab39c4..9c460013 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -25,7 +25,13 @@ use zeroize::Zeroizing; #[clap( version, about = "Install a Rust binary... from binaries!", - after_long_help = "License: GPLv3. Source available at https://github.com/cargo-bins/cargo-binstall", + after_long_help = + "License: GPLv3. Source available at https://github.com/cargo-bins/cargo-binstall\n\n\ + Some crate installation strategies may collect anonymized usage statistics by default. \ + If you prefer not to participate on such data collection, you can opt out by using the \ + `--disable-telemetry` flag or its associated environment variable. For more details \ + about this data collection, please refer to the mentioned flag or the project's README \ + file", arg_required_else_help(true), // Avoid conflict with version_req disable_version_flag(true), From 50bee16581a718009892162f952be09449e1adcb Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 22 Aug 2024 13:22:31 +1000 Subject: [PATCH 1859/2020] build(deps): bump tj-actions/changed-files from 44 to 45 (#1893) Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 44 to 45. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/v44...v45) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .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 83427410..63132171 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -47,7 +47,7 @@ jobs: - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v44 + uses: tj-actions/changed-files@v45 with: dir_names: true dir_names_exclude_current_dir: true From 5ae11b35d7e046402d4a34208f355f6433dfa8fe Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 25 Aug 2024 07:55:45 +0000 Subject: [PATCH 1860/2020] dep: Upgrade transitive dependencies (#1897) Co-authored-by: github-actions --- Cargo.lock | 439 ++++++++++++++++++++++++++++------------------------- 1 file changed, 229 insertions(+), 210 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 680eb2f1..abc2aefa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,6 +17,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler2" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" + [[package]] name = "ahash" version = "0.8.11" @@ -122,9 +128,9 @@ checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "async-compression" @@ -215,7 +221,7 @@ dependencies = [ "cc", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.7.4", "object", "rustc-demangle", ] @@ -548,9 +554,9 @@ dependencies = [ [[package]] name = "camino" -version = "1.1.8" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3054fea8a20d8ff3968d5b22cc27501d2b08dc4decdb31b184323f00c5ef23bb" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ "serde", ] @@ -643,9 +649,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.12" +version = "1.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68064e60dbf1f17005c2fde4d07c16d8baa506fd7ffed8ccab702d93617975c7" +checksum = "50d2eb3cd3d1bf4529e31c215ee6f93ec5a3d536d9f578f93d9d33ee19562932" dependencies = [ "jobserver", "libc", @@ -780,19 +786,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1137cd7e7fc0fb5d3c5a8678be38ec56e819125d8d7907411fe24ccb943faca8" -dependencies = [ - "crossbeam-channel", - "crossbeam-deque", - "crossbeam-epoch", - "crossbeam-queue", - "crossbeam-utils", -] - [[package]] name = "crossbeam-channel" version = "0.5.13" @@ -802,34 +795,6 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-queue" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" -dependencies = [ - "crossbeam-utils", -] - [[package]] name = "crossbeam-utils" version = "0.8.20" @@ -865,7 +830,7 @@ dependencies = [ "netlink-packet-route", "netlink-sys", "once_cell", - "system-configuration", + "system-configuration 0.5.1", "windows 0.48.0", ] @@ -1048,9 +1013,9 @@ checksum = "a2a2b11eda1d40935b26cf18f6833c526845ae8c41e58d09af6adeb6f0269183" [[package]] name = "fastrand" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fc0510504f03c51ada170672ac806f1f105a88aa97a5281117e1ddc3368e51a" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "file-format" @@ -1072,13 +1037,13 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.31" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f211bbe8e69bbd0cfdea405084f128ae8b4aaa6b0b522fc8f2b009084797920" +checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", "libz-ng-sys", - "miniz_oxide", + "miniz_oxide 0.8.0", ] [[package]] @@ -1259,9 +1224,9 @@ checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" [[package]] name = "gix" -version = "0.64.0" +version = "0.66.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d78414d29fcc82329080166077e0f7689f4016551fdb334d787c3d040fe2634f" +checksum = "9048b8d1ae2104f045cb37e5c450fc49d5d8af22609386bfc739c11ba88995eb" dependencies = [ "gix-actor", "gix-attributes", @@ -1281,7 +1246,6 @@ dependencies = [ "gix-ignore", "gix-index", "gix-lock", - "gix-macros", "gix-negotiate", "gix-object", "gix-odb", @@ -1312,9 +1276,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.31.5" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0e454357e34b833cc3a00b6efbbd3dd4d18b24b9fb0c023876ec2645e8aa3f2" +checksum = "fc19e312cd45c4a66cd003f909163dc2f8e1623e30a0c0c6df3776e89b308665" dependencies = [ "bstr", "gix-date", @@ -1326,9 +1290,9 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.22.3" +version = "0.22.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e37ce99c7e81288c28b703641b6d5d119aacc45c1a6b247156e6249afa486257" +checksum = "ebccbf25aa4a973dd352564a9000af69edca90623e8a16dad9cbc03713131311" dependencies = [ "bstr", "gix-glob", @@ -1361,9 +1325,9 @@ dependencies = [ [[package]] name = "gix-command" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d76867867da891cbe32021ad454e8cae90242f6afb06762e4dd0d357afd1d7b" +checksum = "dff2e692b36bbcf09286c70803006ca3fd56551a311de450be317a0ab8ea92e7" dependencies = [ "bstr", "gix-path", @@ -1387,9 +1351,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.38.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28f53fd03d1bf09ebcc2c8654f08969439c4556e644ca925f27cf033bc43e658" +checksum = "78e797487e6ca3552491de1131b4f72202f282fb33f198b1c34406d765b42bb0" dependencies = [ "bstr", "gix-config-value", @@ -1408,9 +1372,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.7" +version = "0.14.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b328997d74dd15dc71b2773b162cb4af9a25c424105e4876e6d0686ab41c383e" +checksum = "03f76169faa0dec598eac60f83d7fcdd739ec16596eca8fb144c88973dbe6f8c" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1421,9 +1385,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.24.4" +version = "0.24.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "198588f532e4d1202e04e6c3f50e4d7c060dffc66801c6f53cc246f1d234739e" +checksum = "8ce391d305968782f1ae301c4a3d42c5701df7ff1d8bc03740300f6fd12bce78" dependencies = [ "bstr", "gix-command", @@ -1438,21 +1402,21 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.8.7" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eed6931f21491ee0aeb922751bd7ec97b4b2fe8fbfedcb678e2a2dce5f3b8c0" +checksum = "35c84b7af01e68daf7a6bb8bb909c1ff5edb3ce4326f1f43063a5a96d3c3c8a5" dependencies = [ "bstr", "itoa", + "jiff", "thiserror", - "time", ] [[package]] name = "gix-diff" -version = "0.44.1" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1996d5c8a305b59709467d80617c9fde48d9d75fd1f4179ea970912630886c9d" +checksum = "92c9afd80fff00f8b38b1c1928442feb4cd6d2232a6ed806b6b193151a3d336c" dependencies = [ "bstr", "gix-hash", @@ -1462,9 +1426,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.33.0" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67662731cec3cb31ba3ed2463809493f76d8e5d6c6d245de8b0560438c13450e" +checksum = "0577366b9567376bc26e815fd74451ebd0e6218814e242f8e5b7072c58d956d2" dependencies = [ "bstr", "dunce", @@ -1490,7 +1454,6 @@ dependencies = [ "gix-hash", "gix-trace", "gix-utils", - "jwalk", "libc", "once_cell", "parking_lot", @@ -1503,9 +1466,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.11.3" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6547738da28275f4dff4e9f3a0f28509f53f94dd6bd822733c91cb306bca61a" +checksum = "4121790ae140066e5b953becc72e7496278138d19239be2e63b5067b0843119e" dependencies = [ "bstr", "encoding_rs", @@ -1524,9 +1487,9 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6adf99c27cdf17b1c4d77680c917e0d94d8783d4e1c73d3be0d1d63107163d7a" +checksum = "f2bfe6249cfea6d0c0e0990d5226a4cb36f030444ba9e35e0639275db8f98575" dependencies = [ "fastrand", "gix-features", @@ -1535,9 +1498,9 @@ dependencies = [ [[package]] name = "gix-glob" -version = "0.16.4" +version = "0.16.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7df15afa265cc8abe92813cd354d522f1ac06b29ec6dfa163ad320575cb447" +checksum = "74908b4bbc0a0a40852737e5d7889f676f081e340d5451a16e5b4c50d592f111" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1568,9 +1531,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.11.3" +version = "0.11.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6afb8f98e314d4e1adc822449389ada863c174b5707cedd327d67b84dba527" +checksum = "e447cd96598460f5906a0f6c75e950a39f98c2705fc755ad2f2020c9e937fab7" dependencies = [ "bstr", "gix-glob", @@ -1581,9 +1544,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.33.1" +version = "0.35.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a9a44eb55bd84bb48f8a44980e951968ced21e171b22d115d1cdcef82a7d73f" +checksum = "0cd4203244444017682176e65fd0180be9298e58ed90bd4a8489a357795ed22d" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1618,22 +1581,11 @@ dependencies = [ "thiserror", ] -[[package]] -name = "gix-macros" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "999ce923619f88194171a67fb3e6d613653b8d4d6078b529b15a765da0edcc17" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "gix-negotiate" -version = "0.13.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ec879fb6307bb63519ba89be0024c6f61b4b9d61f1a91fd2ce572d89fe9c224" +checksum = "b4063bf329a191a9e24b6f948a17ccf6698c0380297f5e169cee4f1d2ab9475b" dependencies = [ "bitflags 2.6.0", "gix-commitgraph", @@ -1647,9 +1599,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.42.3" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25da2f46b4e7c2fa7b413ce4dffb87f69eaf89c2057e386491f4c55cadbfe386" +checksum = "2f5b801834f1de7640731820c2df6ba88d95480dc4ab166a5882f8ff12b88efa" dependencies = [ "bstr", "gix-actor", @@ -1666,9 +1618,9 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.61.1" +version = "0.63.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20d384fe541d93d8a3bb7d5d5ef210780d6df4f50c4e684ccba32665a5e3bc9b" +checksum = "a3158068701c17df54f0ab2adda527f5a6aca38fd5fd80ceb7e3c0a2717ec747" dependencies = [ "arc-swap", "gix-date", @@ -1686,9 +1638,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.51.1" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e0594491fffe55df94ba1c111a6566b7f56b3f8d2e1efc750e77d572f5f5229" +checksum = "3223aa342eee21e1e0e403cad8ae9caf9edca55ef84c347738d10681676fd954" dependencies = [ "clru", "gix-chunk", @@ -1707,9 +1659,9 @@ dependencies = [ [[package]] name = "gix-packetline" -version = "0.17.5" +version = "0.17.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b70486beda0903b6d5b65dfa6e40585098cdf4e6365ca2dff4f74c387354a515" +checksum = "8c43ef4d5fe2fa222c606731c8bdbf4481413ee4ef46d61340ec39e4df4c5e49" dependencies = [ "bstr", "faster-hex", @@ -1719,9 +1671,9 @@ dependencies = [ [[package]] name = "gix-packetline-blocking" -version = "0.17.4" +version = "0.17.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31d42378a3d284732e4d589979930d0d253360eccf7ec7a80332e5ccb77e14a" +checksum = "b9802304baa798dd6f5ff8008a2b6516d54b74a69ca2d3a2b9e2d6c3b5556b40" dependencies = [ "bstr", "faster-hex", @@ -1731,9 +1683,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.9" +version = "0.10.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d23d5bbda31344d8abc8de7c075b3cf26e5873feba7c4a15d916bce67382bd9" +checksum = "38d5b8722112fa2fa87135298780bc833b0e9f6c56cc82795d209804b3a03484" dependencies = [ "bstr", "gix-trace", @@ -1744,9 +1696,9 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.7.6" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d307d1b8f84dc8386c4aa20ce0cf09242033840e15469a3ecba92f10cfb5c046" +checksum = "5d23bf239532b4414d0e63b8ab3a65481881f7237ed9647bb10c1e3cc54c5ceb" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1759,9 +1711,9 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e0595d2be4b6d6a71a099e989bdd610882b882da35fb8503d91d6f81aa0936f" +checksum = "74fde865cdb46b30d8dad1293385d9bcf998d3a39cbf41bee67d0dab026fe6b1" dependencies = [ "gix-command", "gix-config-value", @@ -1772,9 +1724,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.45.2" +version = "0.45.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad8da8e89f24177bd77947092199bb13dcc318bbd73530ba8a05e6d6adaaa9d" +checksum = "cc43a1006f01b5efee22a003928c9eb83dde2f52779ded9d4c0732ad93164e3e" dependencies = [ "bstr", "gix-credentials", @@ -1801,9 +1753,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.45.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "636e96a0a5562715153fee098c217110c33a6f8218f08f4687ff99afde159bb5" +checksum = "ae0d8406ebf9aaa91f55a57f053c5a1ad1a39f60fdf0303142b7be7ea44311e5" dependencies = [ "gix-actor", "gix-features", @@ -1822,9 +1774,9 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.23.1" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6868f8cd2e62555d1f7c78b784bece43ace40dd2a462daf3b588d5416e603f37" +checksum = "ebb005f82341ba67615ffdd9f7742c87787544441c88090878393d0682869ca6" dependencies = [ "bstr", "gix-hash", @@ -1836,9 +1788,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.27.2" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01b13e43c2118c4b0537ddac7d0821ae0dfa90b7b8dbf20c711e153fb749adce" +checksum = "ba4621b219ac0cdb9256883030c3d56a6c64a6deaa829a92da73b9a576825e1e" dependencies = [ "bstr", "gix-date", @@ -1850,9 +1802,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.13.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b030ccaab71af141f537e0225f19b9e74f25fefdba0372246b844491cab43e0" +checksum = "b41e72544b93084ee682ef3d5b31b1ba4d8fa27a017482900e5e044d5b1b3984" dependencies = [ "gix-commitgraph", "gix-date", @@ -1865,9 +1817,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.10.7" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1547d26fa5693a7f34f05b4a3b59a90890972922172653bcb891ab3f09f436df" +checksum = "0fe4d52f30a737bbece5276fab5d3a8b276dc2650df963e293d0673be34e7a5f" dependencies = [ "bitflags 2.6.0", "gix-path", @@ -1877,9 +1829,9 @@ dependencies = [ [[package]] name = "gix-submodule" -version = "0.12.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f2e0f69aa00805e39d39ec80472a7e9da20ed5d73318b27925a2cc198e854fd" +checksum = "529d0af78cc2f372b3218f15eb1e3d1635a21c8937c12e2dd0b6fc80c2ca874b" dependencies = [ "bstr", "gix-config", @@ -1892,9 +1844,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "14.0.1" +version = "14.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006acf5a613e0b5cf095d8e4b3f48c12a60d9062aa2b2dd105afaf8344a5600c" +checksum = "046b4927969fa816a150a0cda2e62c80016fe11fb3c3184e4dddf4e542f108aa" dependencies = [ "gix-fs", "libc", @@ -1911,9 +1863,9 @@ checksum = "f924267408915fddcd558e3f37295cc7d6a3e50f8bd8b606cee0808c3915157e" [[package]] name = "gix-transport" -version = "0.42.2" +version = "0.42.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27c02b83763ffe95bcc27ce5821b2b7f843315a009c06f1cd59c9b66c508c058" +checksum = "421dcccab01b41a15d97b226ad97a8f9262295044e34fbd37b10e493b0a6481f" dependencies = [ "base64", "bstr", @@ -1930,9 +1882,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.39.2" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e499a18c511e71cf4a20413b743b9f5bcf64b3d9e81e9c3c6cd399eae55a8840" +checksum = "030da39af94e4df35472e9318228f36530989327906f38e27807df305fccb780" dependencies = [ "bitflags 2.6.0", "gix-commitgraph", @@ -1947,9 +1899,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.27.4" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2eb9b35bba92ea8f0b5ab406fad3cf6b87f7929aa677ff10aa042c6da621156" +checksum = "fd280c5e84fb22e128ed2a053a0daeacb6379469be6a85e3d518a0636e160c89" dependencies = [ "bstr", "gix-features", @@ -1971,9 +1923,9 @@ dependencies = [ [[package]] name = "gix-validate" -version = "0.8.5" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82c27dd34a49b1addf193c92070bcbf3beaf6e10f16a78544de6372e146a0acf" +checksum = "81f2badbb64e57b404593ee26b752c26991910fd0d81fe6f9a71c1a8309b6c86" dependencies = [ "bstr", "thiserror", @@ -1981,9 +1933,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.34.1" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26f7326ebe0b9172220694ea69d344c536009a9b98fb0f9de092c440f3efe7a6" +checksum = "c312ad76a3f2ba8e865b360d5cb3aa04660971d16dec6dd0ce717938d903149a" dependencies = [ "bstr", "gix-attributes", @@ -2000,9 +1952,9 @@ dependencies = [ [[package]] name = "gix-worktree-state" -version = "0.11.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ed6205b5f51067a485b11843babcf3304c0799e265a06eb0dde7f69cd85cd8" +checksum = "7b05c4b313fa702c0bacd5068dd3e01671da73b938fade97676859fee286de43" dependencies = [ "bstr", "gix-features", @@ -2026,9 +1978,9 @@ checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" [[package]] name = "guess_host_triple" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b35a8ce923c7490629d84e12fa2f75e1733f1ec692a47c264f9b7fd632855afc" +checksum = "5dd62763349a2c83ed2ce9ce5429158085fa43e0cdd8c60011a7843765d04e18" dependencies = [ "errno 0.2.8", "libc", @@ -2038,9 +1990,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa82e28a107a8cc405f0839610bdc9b15f1e25ec7d696aa5cf173edbcb1486ab" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" dependencies = [ "atomic-waker", "bytes", @@ -2070,6 +2022,20 @@ dependencies = [ "tracing", ] +[[package]] +name = "h3" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e7675a0963b47a6d12fe44c279918b4ffb19baee838ac37f48d2722ad5bc6ab" +dependencies = [ + "bytes", + "fastrand", + "futures-util", + "http", + "pin-project-lite", + "tokio", +] + [[package]] name = "h3-quinn" version = "0.0.6" @@ -2078,7 +2044,21 @@ checksum = "b8c01d99d7cf812fd34ddf135e6c940df9e24f2e759dbc7179fb0e54d4bd6551" dependencies = [ "bytes", "futures", - "h3", + "h3 0.0.5", + "quinn", + "tokio", + "tokio-util", +] + +[[package]] +name = "h3-quinn" +version = "0.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17c799f413fceeea505236c4d8132f084ff4b55a652288d91439ee93dc24d855" +dependencies = [ + "bytes", + "futures", + "h3 0.0.6", "quinn", "tokio", "tokio-util", @@ -2129,8 +2109,8 @@ dependencies = [ "futures-io", "futures-util", "h2", - "h3", - "h3-quinn", + "h3 0.0.5", + "h3-quinn 0.0.6", "http", "idna", "ipnet", @@ -2399,6 +2379,31 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +[[package]] +name = "jiff" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ef8bc400f8312944a9f879db116fed372c4f0859af672eba2a80f79c767dd19" +dependencies = [ + "jiff-tzdb-platform", + "windows-sys 0.59.0", +] + +[[package]] +name = "jiff-tzdb" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05fac328b3df1c0f18a3c2ab6cb7e06e4e549f366017d796e3e66b6d6889abe6" + +[[package]] +name = "jiff-tzdb-platform" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8da387d5feaf355954c2c122c194d6df9c57d865125a67984bb453db5336940" +dependencies = [ + "jiff-tzdb", +] + [[package]] name = "jobserver" version = "0.1.32" @@ -2432,16 +2437,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "jwalk" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2735847566356cd2179a2a38264839308f7079fa96e6bd5a42d740460e003c56" -dependencies = [ - "crossbeam", - "rayon", -] - [[package]] name = "kstring" version = "2.0.2" @@ -2481,9 +2476,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.156" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5f43f184355eefb8d17fc948dbecf6c13be3c141f20d834ae842193a448c72a" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libmimalloc-sys" @@ -2508,9 +2503,9 @@ dependencies = [ [[package]] name = "libz-ng-sys" -version = "1.1.15" +version = "1.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6409efc61b12687963e602df8ecf70e8ddacf95bc6576bcf16e3ac6328083c5" +checksum = "4436751a01da56f1277f323c80d584ffad94a3d14aecd959dd0dff75aa73a438" dependencies = [ "cmake", "libc", @@ -2672,6 +2667,15 @@ dependencies = [ "adler", ] +[[package]] +name = "miniz_oxide" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +dependencies = [ + "adler2", +] + [[package]] name = "mio" version = "1.0.2" @@ -3046,9 +3050,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] @@ -3083,26 +3087,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - [[package]] name = "redox_syscall" version = "0.3.5" @@ -3123,9 +3107,9 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd283d9651eeda4b2a83a43c1c91b266c40fd76ecd39a50a8c630ae69dc72891" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", @@ -3174,9 +3158,9 @@ checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" [[package]] name = "reqwest" -version = "0.12.5" +version = "0.12.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d6d2a27d57148378eb5e111173f4276ad26340ecc5c49a4a2152167a2d6a37" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" dependencies = [ "async-compression", "base64", @@ -3186,8 +3170,8 @@ dependencies = [ "futures-core", "futures-util", "h2", - "h3", - "h3-quinn", + "h3 0.0.6", + "h3-quinn 0.0.7", "http", "http-body", "http-body-util", @@ -3213,7 +3197,7 @@ dependencies = [ "serde_urlencoded", "slab", "sync_wrapper", - "system-configuration", + "system-configuration 0.6.1", "tokio", "tokio-native-tls", "tokio-rustls", @@ -3225,7 +3209,7 @@ dependencies = [ "wasm-streams", "web-sys", "webpki-roots", - "winreg 0.52.0", + "windows-registry", ] [[package]] @@ -3304,9 +3288,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88d6d420651b496bdd98684116959239430022a115c1240e6c3993be0b15fba" +checksum = "04182dffc9091a404e0fc069ea5cd60e5b866c3adf881eff99a32d048242dffa" dependencies = [ "openssl-probe", "rustls-pemfile", @@ -3412,9 +3396,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff085d2cb684faa248efb494c39b68e522822ac0de72ccf08109abde717cfb2" +checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" dependencies = [ "serde_derive", ] @@ -3430,9 +3414,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.208" +version = "1.0.209" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24008e81ff7613ed8e5ba0cfaf24e2c2f1e5b8a0495711e44fcd4882fca62bcf" +checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" dependencies = [ "proc-macro2", "quote", @@ -3441,9 +3425,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.125" +version = "1.0.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83c8e735a073ccf5be70aa8066aa984eaf2fa000db6c8d0100ae605b366d31ed" +checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" dependencies = [ "itoa", "memchr", @@ -3542,9 +3526,9 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dbb678a20886f703df5cf4b925101d75bf7ee793db8134f0d4b7420036b3557" +checksum = "cb3285e97855c860e0cacb651191433bbea700b396a480ade2e82ff532c2d60f" dependencies = [ "compact_str", "derive_destructure2", @@ -3651,9 +3635,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.74" +version = "2.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fceb41e3d546d0bd83421d3409b1460cc7444cd389341a4c880fe7a042cb3d7" +checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" dependencies = [ "proc-macro2", "quote", @@ -3665,6 +3649,9 @@ name = "sync_wrapper" version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] [[package]] name = "system-configuration" @@ -3674,7 +3661,18 @@ checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", "core-foundation", - "system-configuration-sys", + "system-configuration-sys 0.5.0", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags 2.6.0", + "core-foundation", + "system-configuration-sys 0.6.0", ] [[package]] @@ -3687,6 +3685,16 @@ dependencies = [ "libc", ] +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "target-lexicon" version = "0.12.16" @@ -3807,9 +3815,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.2" +version = "1.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daa4fb1bc778bd6f04cbfc4bb2d06a7396a8f299dc33ea1900cedaa316f467b1" +checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" dependencies = [ "backtrace", "bytes", @@ -4378,6 +4386,17 @@ dependencies = [ "syn", ] +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + [[package]] name = "windows-result" version = "0.2.0" From 05bfcbce0e9e936d0cd3fb93738f99cbcb772695 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 25 Aug 2024 08:37:25 +0000 Subject: [PATCH 1861/2020] chore: release (#1883) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-manifests/CHANGELOG.md | 5 +++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk/CHANGELOG.md | 5 +++++ crates/binstalk/Cargo.toml | 4 ++-- crates/detect-targets/CHANGELOG.md | 5 +++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 5 +++++ crates/detect-wasi/Cargo.toml | 2 +- 10 files changed, 32 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index abc2aefa..d6cdcc95 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -258,7 +258,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.1" +version = "0.28.2" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.0" +version = "0.15.1" dependencies = [ "beef", "binstalk-types", @@ -862,7 +862,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.19" +version = "0.1.20" dependencies = [ "cfg-if", "guess_host_triple", @@ -874,7 +874,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.2" +version = "1.0.3" dependencies = [ "tempfile", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 85431a21..5660a090 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,8 +22,8 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.28.1", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.0" } +binstalk = { path = "../binstalk", version = "0.28.2", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.1" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index a7b33a16..e400efee 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.0...binstalk-manifests-v0.15.1) - 2024-08-25 + +### Other +- updated the following local packages: detect-targets + ## [0.15.0](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.14.1...binstalk-manifests-v0.15.0) - 2024-08-10 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 4fc10c37..4a242cb1 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.0" +version = "0.15.1" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.19", path = "../detect-targets" } +detect-targets = { version = "0.1.20", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index 29fb2bad..e14197f9 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.2](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.1...binstalk-v0.28.2) - 2024-08-25 + +### Other +- updated the following local packages: detect-targets + ## [0.28.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.0...binstalk-v0.28.1) - 2024-08-12 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 3826e9f0..24749ec5 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.1" +version = "0.28.2" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -21,7 +21,7 @@ binstalk-types = { version = "0.9.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.1", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.19", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.20", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index 8e099799..f9947d7e 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.20](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.19...detect-targets-v0.1.20) - 2024-08-25 + +### Other +- update Cargo.lock dependencies + ## [0.1.19](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.18...detect-targets-v0.1.19) - 2024-08-10 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 533acf70..fbce9484 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.19" +version = "0.1.20" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index 007b81c1..02225f06 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.3](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.2...detect-wasi-v1.0.3) - 2024-08-25 + +### Other +- update Cargo.lock dependencies + ## [1.0.2](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.1...detect-wasi-v1.0.2) - 2024-08-10 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index 899457ef..867eb147 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.2" +version = "1.0.3" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From 9330730a2ae0fec8c2d7e1653888fe7701dd409a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 25 Aug 2024 09:18:31 +0000 Subject: [PATCH 1862/2020] release: cargo-binstall v1.10.3 (#1898) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d6cdcc95..1a15e4d8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -563,7 +563,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.2" +version = "1.10.3" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 5660a090..667868d0 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.2" +version = "1.10.3" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 630fe414..fa5d0a69 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 069afedf193484171340cfc4d0d6d056423fc993 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sun, 25 Aug 2024 22:15:41 +1000 Subject: [PATCH 1863/2020] Speedup ci: Exclude workspace from macOS SIP and windows defenders (#1899) * Enable macOS dev mode in CI to speedup CI Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Enable dev drive on windows to speedup CI Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Use dev drive for target which is the most write-heavy part. The read to the workspace can be cached as it is really small Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Setup dev drive for cargo/rust home Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Exclude target, cargo/rustup home from windows defender Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Exclude the entire workspace from Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix action.yml Add missing shell, and merge steps for adding windows defender exclusion Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix adding windows defender exclusion path Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix use of Add-MpPreference Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix pwsh Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix creating second dev drive Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix second dev drive setup Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix caching: Do not mount dev drive at target Since it contains files that are not accessible. Also remove use of dev drive for cargo/rustup home since it prevents caching (rust-cache does not read from env). Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Disable dev drive for windows as a failed experiment Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- .github/actions/just-setup/action.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/actions/just-setup/action.yml b/.github/actions/just-setup/action.yml index 6ab5176f..17572609 100644 --- a/.github/actions/just-setup/action.yml +++ b/.github/actions/just-setup/action.yml @@ -18,6 +18,17 @@ inputs: runs: using: composite steps: + - name: Enable macOS developer mode for better + if: runner.os == 'macOS' + run: sudo spctl developer-mode enable-terminal + shell: bash + + - name: Exclude workspace and cargo/rustup home from windows defender + if: runner.os == 'Windows' + run: | + Add-MpPreference -ExclusionPath '${{ github.workspace }}' + shell: pwsh + - name: Add just to tools to install run: echo "tools=just" >>"$GITHUB_ENV" shell: bash From 3331364a65ebd47916a640e6154b6df8848210a8 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Thu, 29 Aug 2024 22:45:33 +1000 Subject: [PATCH 1864/2020] reduce default for maximum_resolution_timeout to 15s (#1900) If then default is too long, then users would still have to wait a long time if they hit rate limit. Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/bin/src/args.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 9c460013..845e734f 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -206,7 +206,7 @@ pub struct Args { help_heading = "Overrides", long, env = "BINSTALL_MAXIMUM_RESOLUTION_TIMEOUT", - default_value_t = NonZeroU16::new(180).unwrap(), + default_value_t = NonZeroU16::new(15).unwrap(), )] pub(crate) maximum_resolution_timeout: NonZeroU16, From 8e9ef12ec8255c1154b233e59b44df709a0b9974 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 30 Aug 2024 09:19:41 +0000 Subject: [PATCH 1865/2020] dep: Upgrade transitive dependencies (#1901) Co-authored-by: github-actions --- Cargo.lock | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 1a15e4d8..70999804 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -649,9 +649,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.14" +version = "1.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d2eb3cd3d1bf4529e31c215ee6f93ec5a3d536d9f578f93d9d33ee19562932" +checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" dependencies = [ "jobserver", "libc", @@ -1025,9 +1025,9 @@ checksum = "9ffe3a660c3a1b10e96f304a9413d673b2118d62e4520f7ddf4a4faccfe8b9b9" [[package]] name = "filetime" -version = "0.2.24" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf401df4a4e3872c4fe8151134cf483738e74b67fc934d6532c882b3d24a4550" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", @@ -2381,9 +2381,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jiff" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ef8bc400f8312944a9f879db116fed372c4f0859af672eba2a80f79c767dd19" +checksum = "362be9c702bada57298130d0565e9c389e6d4024a541692f01819e21abc3e26a" dependencies = [ "jiff-tzdb-platform", "windows-sys 0.59.0", @@ -2795,9 +2795,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.3" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27b64972346851a39438c60b341ebc01bba47464ae329e55cf343eb93964efd9" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr", ] @@ -3251,18 +3251,18 @@ checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" [[package]] name = "rustc_version" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ "semver", ] [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" dependencies = [ "bitflags 2.6.0", "errno 0.3.9", @@ -3288,9 +3288,9 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04182dffc9091a404e0fc069ea5cd60e5b866c3adf881eff99a32d048242dffa" +checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" dependencies = [ "openssl-probe", "rustls-pemfile", @@ -3317,9 +3317,9 @@ checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-webpki" -version = "0.102.6" +version = "0.102.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e6b52d4fda176fd835fdc55a835d4a89b8499cad995885a21149d5ad62f852e" +checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" dependencies = [ "ring", "rustls-pki-types", From e4bbbff1fd49eb677ec8052e0024de3e27c5f19e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 12:39:25 +1200 Subject: [PATCH 1866/2020] build(deps): bump quinn-proto from 0.11.6 to 0.11.8 in the cargo group (#1904) Bumps the cargo group with 1 update: [quinn-proto](https://github.com/quinn-rs/quinn). Updates `quinn-proto` from 0.11.6 to 0.11.8 - [Release notes](https://github.com/quinn-rs/quinn/releases) - [Commits](https://github.com/quinn-rs/quinn/compare/quinn-proto-0.11.6...quinn-proto-0.11.8) --- updated-dependencies: - dependency-name: quinn-proto dependency-type: indirect dependency-group: cargo ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 70999804..3e8f27a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3020,9 +3020,9 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.6" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba92fb39ec7ad06ca2582c0ca834dfeadcaf06ddfc8e635c80aa7e1c05315fdd" +checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" dependencies = [ "bytes", "rand", From a53d51c083bbf243a8252dfb2e6a308ba7dca5a0 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 6 Sep 2024 00:43:38 +1000 Subject: [PATCH 1867/2020] Send telemetry report to quickinstall if no pre-built is found (#1905) * Send telemetry report to quickinstall if no pre-built is found quickinstall telemtry is overloaded cargo-bins/cargo-quickinstall#268, it only needs report when the pre-built is not available in upstream. Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix resolve.rs And optimize sending telemtry: Remove unnecessary `::clone` Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix fmt of resolve.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/binstalk/src/ops/resolve.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 87a7dbfc..59940c94 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -175,13 +175,7 @@ async fn resolve_inner( ); } - if !opts.disable_telemetry { - for fetcher in &handles { - fetcher.clone().report_to_upstream(); - } - } - - for fetcher in handles { + for fetcher in &handles { match timeout( opts.maximum_resolution_timeout, AutoAbortJoinHandle::new(fetcher.clone().find()).flattened_join(), @@ -210,7 +204,7 @@ async fn resolve_inner( Ok(bin_files) => { if !bin_files.is_empty() { return Ok(Resolution::Fetch(Box::new(ResolutionFetch { - fetcher, + fetcher: fetcher.clone(), new_version: package_info.version, name: package_info.name, version_req: version_req_str, @@ -256,6 +250,12 @@ async fn resolve_inner( } } + if !opts.disable_telemetry { + for fetcher in handles { + fetcher.report_to_upstream(); + } + } + if !opts.cargo_install_fallback { return Err(BinstallError::NoFallbackToCargoInstall); } From 659ad8172f29f016eed61568f3fbaf43536189e8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 09:05:08 +0000 Subject: [PATCH 1868/2020] dep: Upgrade transitive dependencies (#1906) Co-authored-by: github-actions --- Cargo.lock | 95 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 54 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3e8f27a0..a6d75125 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -165,9 +165,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.81" +version = "0.1.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e0c28dcc82d7c8ead5cb13beb15405b57b8546e93215673ff8ca0349a028107" +checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" dependencies = [ "proc-macro2", "quote", @@ -649,9 +649,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.15" +version = "1.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b6a275aa2903740dc87da01c62040406b8812552e97129a63ea8850a17c6e6" +checksum = "e9d013ecb737093c0e86b151a7b837993cf9ec6c502946cfb44bedc392421e0b" dependencies = [ "jobserver", "libc", @@ -666,9 +666,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.16" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed6719fffa43d0d87e5fd8caeab59be1554fb028cd30edc88fc4369b17971019" +checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" dependencies = [ "clap_builder", "clap_derive", @@ -676,9 +676,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.15" +version = "4.5.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216aec2b177652e3846684cbfe25c9964d18ec45234f0f5da5157b207ed1aab6" +checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" dependencies = [ "anstream", "anstyle", @@ -2251,16 +2251,16 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.2" +version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ee4be2c948921a1a5320b629c4193916ed787a7f7f293fd3f7f5a6c9de74155" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" dependencies = [ "futures-util", "http", "hyper", "hyper-util", "rustls", - "rustls-native-certs", + "rustls-native-certs 0.8.0", "rustls-pki-types", "tokio", "tokio-rustls", @@ -2316,9 +2316,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93ead53efc7ea8ed3cfb0c79fc8023fbb782a5432b52830b6518941cebe6505c" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown", @@ -2381,9 +2381,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jiff" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "362be9c702bada57298130d0565e9c389e6d4024a541692f01819e21abc3e26a" +checksum = "437651126da47900d4d70255ab15f5c69510ca4e0d88c9f01b5b8d41a45c3a9b" dependencies = [ "jiff-tzdb-platform", "windows-sys 0.59.0", @@ -2654,9 +2654,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minisign-verify" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "933dca44d65cdd53b355d0b73d380a2ff5da71f87f036053188bf1eab6a19881" +checksum = "a05b5d0594e0cb1ad8cee3373018d2b84e25905dc75b2468114cc9a8e86cfc20" [[package]] name = "miniz_oxide" @@ -2842,9 +2842,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.3.1+3.3.1" +version = "300.3.2+3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7259953d42a81bf137fbbd73bd30a8e1914d6dce43c2b90ed575783a22608b91" +checksum = "a211a18d945ef7e648cc6e0058f4c548ee46aab922ea203e0d30e966ea23647b" dependencies = [ "cc", ] @@ -3001,9 +3001,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quinn" -version = "0.11.3" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b22d8e7369034b9a7132bc2008cac12f2013c8132b45e0554e6e20e2617f2156" +checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" dependencies = [ "bytes", "futures-io", @@ -3037,15 +3037,15 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.4" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bffec3605b73c6f1754535084a85229fa8a30f86014e6c81aeec4abb68b0285" +checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" dependencies = [ "libc", "once_cell", "socket2", "tracing", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3189,7 +3189,7 @@ dependencies = [ "pin-project-lite", "quinn", "rustls", - "rustls-native-certs", + "rustls-native-certs 0.7.3", "rustls-pemfile", "rustls-pki-types", "serde", @@ -3260,9 +3260,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.35" +version = "0.38.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a85d50532239da68e9addb745ba38ff4612a242c1c7ceea689c4bc7c2f43c36f" +checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" dependencies = [ "bitflags 2.6.0", "errno 0.3.9", @@ -3299,6 +3299,19 @@ dependencies = [ "security-framework", ] +[[package]] +name = "rustls-native-certs" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" +dependencies = [ + "openssl-probe", + "rustls-pemfile", + "rustls-pki-types", + "schannel", + "security-framework", +] + [[package]] name = "rustls-pemfile" version = "2.1.3" @@ -3425,9 +3438,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.127" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8043c06d9f82bd7271361ed64f415fe5e12a77fdb52e573e7f06a516dea329ad" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", "memchr", @@ -3614,9 +3627,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "supports-color" -version = "3.0.0" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9829b314621dfc575df4e409e79f9d6a66a3bd707ab73f23cb4aa3a854ac854f" +checksum = "8775305acf21c96926c900ad056abeef436701108518cf890020387236ac5a77" dependencies = [ "is_ci", ] @@ -3635,9 +3648,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.76" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578e081a14e0cefc3279b0472138c513f37b41a08d5a3cca9b6e4e8ceb6cd525" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -3815,9 +3828,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.39.3" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", @@ -3864,9 +3877,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" dependencies = [ "futures-core", "pin-project-lite", @@ -3890,9 +3903,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.11" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", @@ -4288,9 +4301,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.3" +version = "0.26.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd7c23921eeb1713a4e851530e9b9756e4fb0e89978582942612524cf09f01cd" +checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" dependencies = [ "rustls-pki-types", ] From 04978e949e7437a3fcfc4be19b5271433ac5fada Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 12:55:55 +0000 Subject: [PATCH 1869/2020] dep: Upgrade transitive dependencies (#1907) Co-authored-by: github-actions --- Cargo.lock | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a6d75125..d2371c38 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -770,9 +770,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51e852e6dc9a5bed1fae92dd2375037bf2b768725bf3be87811edee3249d09ad" +checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" dependencies = [ "libc", ] @@ -1683,9 +1683,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.10" +version = "0.10.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d5b8722112fa2fa87135298780bc833b0e9f6c56cc82795d209804b3a03484" +checksum = "ebfc4febd088abdcbc9f1246896e57e37b7a34f6909840045a1767c6dafac7af" dependencies = [ "bstr", "gix-trace", @@ -1857,9 +1857,9 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f924267408915fddcd558e3f37295cc7d6a3e50f8bd8b606cee0808c3915157e" +checksum = "6cae0e8661c3ff92688ce1c8b8058b3efb312aba9492bbe93661a21705ab431b" [[package]] name = "gix-transport" From 89203c196cdd4fa34c01c887568d0e5f9fc3a2ea Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 13:37:48 +0000 Subject: [PATCH 1870/2020] chore: release (#1902) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-manifests/CHANGELOG.md | 5 +++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk/CHANGELOG.md | 5 +++++ crates/binstalk/Cargo.toml | 4 ++-- crates/detect-targets/CHANGELOG.md | 5 +++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 5 +++++ crates/detect-wasi/Cargo.toml | 2 +- 10 files changed, 32 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d2371c38..6a2f934e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -258,7 +258,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.2" +version = "0.28.3" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.1" +version = "0.15.2" dependencies = [ "beef", "binstalk-types", @@ -862,7 +862,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.20" +version = "0.1.21" dependencies = [ "cfg-if", "guess_host_triple", @@ -874,7 +874,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.3" +version = "1.0.4" dependencies = [ "tempfile", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 667868d0..0fd05acc 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,8 +22,8 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.28.2", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.1" } +binstalk = { path = "../binstalk", version = "0.28.3", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.2" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index e400efee..7cbfea51 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.2](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.1...binstalk-manifests-v0.15.2) - 2024-09-06 + +### Other +- updated the following local packages: detect-targets + ## [0.15.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.0...binstalk-manifests-v0.15.1) - 2024-08-25 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 4a242cb1..0faedf8d 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.1" +version = "0.15.2" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.20", path = "../detect-targets" } +detect-targets = { version = "0.1.21", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index e14197f9..b2ab9757 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.3](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.2...binstalk-v0.28.3) - 2024-09-06 + +### Other +- Send telemetry report to quickinstall if no pre-built is found ([#1905](https://github.com/cargo-bins/cargo-binstall/pull/1905)) + ## [0.28.2](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.1...binstalk-v0.28.2) - 2024-08-25 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 24749ec5..6d4e05b3 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.2" +version = "0.28.3" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -21,7 +21,7 @@ binstalk-types = { version = "0.9.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.1", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.20", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.21", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index f9947d7e..62dd8236 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.21](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.20...detect-targets-v0.1.21) - 2024-09-06 + +### Other +- update Cargo.lock dependencies + ## [0.1.20](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.19...detect-targets-v0.1.20) - 2024-08-25 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index fbce9484..5c4099b0 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.20" +version = "0.1.21" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index 02225f06..c69c623b 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.4](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.3...detect-wasi-v1.0.4) - 2024-09-06 + +### Other +- update Cargo.lock dependencies + ## [1.0.3](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.2...detect-wasi-v1.0.3) - 2024-08-25 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index 867eb147..f89e3e81 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.3" +version = "1.0.4" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From 780584e44b18c1a97aa1de46b8f6da30f9938d37 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Sep 2024 22:43:53 +0000 Subject: [PATCH 1871/2020] release: cargo-binstall v1.10.4 (#1908) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6a2f934e..eec34493 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -563,7 +563,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.3" +version = "1.10.4" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 0fd05acc..a68d6000 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.3" +version = "1.10.4" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index fa5d0a69..c92bba54 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From a88335d05bc9b62a204cddffb309bfc8e9fa9105 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sun, 8 Sep 2024 14:20:04 +1000 Subject: [PATCH 1872/2020] Improve quickinstall telemetry failure message (#1910) Fixed #1896 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/binstalk-fetchers/src/quickinstall.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/binstalk-fetchers/src/quickinstall.rs b/crates/binstalk-fetchers/src/quickinstall.rs index b963e491..434f7d49 100644 --- a/crates/binstalk-fetchers/src/quickinstall.rs +++ b/crates/binstalk-fetchers/src/quickinstall.rs @@ -200,7 +200,7 @@ by rust officially."#, tokio::spawn(async move { if let Err(err) = self.report().await { warn!( - "Failed to send quickinstall report for package {}: {err}", + "Failed to send quickinstall report for package {} (NOTE that this does not affect package resolution): {err}", self.package ) } From c8dec953cc7f4437c36098eb8fda96ccf32caaa2 Mon Sep 17 00:00:00 2001 From: David Laban Date: Wed, 11 Sep 2024 09:15:15 +0100 Subject: [PATCH 1873/2020] report to new stats server (with status) (#1912) * docstrings for things that I was curious about * report to new stats server, with status * Arc needs a clone * fix stats url in docs * fix stats url handling --- crates/bin/src/args.rs | 6 +- crates/binstalk-fetchers/src/common.rs | 7 +++ crates/binstalk-fetchers/src/quickinstall.rs | 62 ++++++++++++++++--- .../src/gh_api_client.rs | 2 + crates/binstalk/src/lib.rs | 2 +- crates/binstalk/src/ops/resolve.rs | 3 + 6 files changed, 71 insertions(+), 11 deletions(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 845e734f..9881341e 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -250,8 +250,8 @@ pub struct Args { /// Disable statistics collection on popular crates. /// /// Strategy quick-install (can be disabled via --disable-strategies) collects - /// statistics of popular crates by default, by sending the crate, version and - /// target to https://warehouse-clerk-tmp.vercel.app/api/crate + /// statistics of popular crates by default, by sending the crate, version, target + /// and status to https://cargo-quickinstall-stats-server.fly.dev/record-install #[clap(help_heading = "Options", long, env = "BINSTALL_DISABLE_TELEMETRY")] pub(crate) disable_telemetry: bool, @@ -675,7 +675,7 @@ mod test { .unwrap() .to_string(); assert!( - long_help.ends_with(binstalk::QUICK_INSTALL_STATS_URL), + long_help.ends_with(binstalk::QUICKINSTALL_STATS_URL), "{}", long_help ); diff --git a/crates/binstalk-fetchers/src/common.rs b/crates/binstalk-fetchers/src/common.rs index 10272f10..ad9e1d68 100644 --- a/crates/binstalk-fetchers/src/common.rs +++ b/crates/binstalk-fetchers/src/common.rs @@ -24,6 +24,9 @@ use crate::FetchError; static WARN_RATE_LIMIT_ONCE: Once = Once::new(); static WARN_UNAUTHORIZED_ONCE: Once = Once::new(); +/// Return Ok(Some(api_artifact_url)) if exists, or Ok(None) if it doesn't. +/// +/// Caches info on all artifacts matching (repo, tag). pub(super) async fn get_gh_release_artifact_url( gh_api_client: GhApiClient, artifact: GhReleaseArtifact, @@ -54,6 +57,10 @@ pub(super) async fn get_gh_release_artifact_url( } } +/// Check if the URL exists by querying the GitHub API. +/// +/// Caches info on all artifacts matching (repo, tag). +/// /// This function returns a future where its size should be at most size of /// 2-4 pointers. pub(super) async fn does_url_exist( diff --git a/crates/binstalk-fetchers/src/quickinstall.rs b/crates/binstalk-fetchers/src/quickinstall.rs index 434f7d49..ebf6976a 100644 --- a/crates/binstalk-fetchers/src/quickinstall.rs +++ b/crates/binstalk-fetchers/src/quickinstall.rs @@ -1,7 +1,7 @@ use std::{ borrow::Cow, path::Path, - sync::{Arc, OnceLock}, + sync::{Arc, Mutex, OnceLock}, }; use binstalk_downloader::remote::Method; @@ -16,7 +16,8 @@ use crate::{ }; const BASE_URL: &str = "https://github.com/cargo-bins/cargo-quickinstall/releases/download"; -pub const QUICK_INSTALL_STATS_URL: &str = "https://warehouse-clerk-tmp.vercel.app/api/crate"; +pub const QUICKINSTALL_STATS_URL: &str = + "https://cargo-quickinstall-stats-server.fly.dev/record-install"; const QUICKINSTALL_SIGN_KEY: Cow<'static, str> = Cow::Borrowed("RWTdnnab2pAka9OdwgCMYyOE66M/BlQoFWaJ/JjwcPV+f3n24IRTj97t"); @@ -58,15 +59,39 @@ pub struct QuickInstall { gh_api_client: GhApiClient, is_supported_v: OnceCell, + data: Arc, package: String, package_url: Url, signature_url: Url, - stats_url: Url, signature_policy: SignaturePolicy, target_data: Arc, signature_verifier: OnceLock, + status: Mutex, +} + +#[derive(Debug, Clone, Copy)] +enum Status { + Start, + NotFound, + Found, + AttemptingInstall, + InvalidSignature, + InstalledFromTarball, +} + +impl Status { + fn as_str(&self) -> &'static str { + match self { + Status::Start => "start", + Status::NotFound => "not-found", + Status::Found => "found", + Status::AttemptingInstall => "attempting-install", + Status::InvalidSignature => "invalid-signature", + Status::InstalledFromTarball => "installed-from-tarball", + } + } } impl QuickInstall { @@ -116,6 +141,14 @@ impl QuickInstall { } }) } + + fn get_status(&self) -> Status { + *self.status.lock().unwrap() + } + + fn set_status(&self, status: Status) { + *self.status.lock().unwrap() = status; + } } #[async_trait::async_trait] @@ -137,6 +170,7 @@ impl super::Fetcher for QuickInstall { Arc::new(Self { client, + data, gh_api_client, is_supported_v: OnceCell::new(), @@ -144,14 +178,13 @@ impl super::Fetcher for QuickInstall { .expect("package_url is pre-generated and should never be invalid url"), signature_url: Url::parse(&format!("{url}.sig")) .expect("signature_url is pre-generated and should never be invalid url"), - stats_url: Url::parse(&format!("{QUICK_INSTALL_STATS_URL}/{package}.tar.gz",)) - .expect("stats_url is pre-generated and should never be invalid url"), package, signature_policy, target_data, signature_verifier: OnceLock::new(), + status: Mutex::new(Status::Start), }) } @@ -171,6 +204,7 @@ impl super::Fetcher for QuickInstall { .await?; if !is_found { + self.set_status(Status::NotFound); return Ok(false); } @@ -182,6 +216,7 @@ impl super::Fetcher for QuickInstall { panic!("::find is run twice"); } + self.set_status(Status::Found); Ok(true) }) } @@ -209,6 +244,7 @@ by rust officially."#, } async fn fetch_and_extract(&self, dst: &Path) -> Result { + self.set_status(Status::AttemptingInstall); let Some(verifier) = self.signature_verifier.get() else { panic!("::find has not been called yet!") }; @@ -227,8 +263,10 @@ by rust officially."#, if let Some(info) = verifier.info() { info!("Verified signature for package '{}': {info}", self.package); } + self.set_status(Status::InstalledFromTarball); Ok(files) } else { + self.set_status(Status::InvalidSignature); Err(FetchError::InvalidSignature) } } @@ -280,10 +318,20 @@ impl QuickInstall { return Ok(()); } - let url = self.stats_url.clone(); + let mut url = Url::parse(QUICKINSTALL_STATS_URL) + .expect("stats_url is pre-generated and should never be invalid url"); + url.query_pairs_mut() + .append_pair("crate", &self.data.name) + .append_pair("version", &self.data.version) + .append_pair("target", &self.target_data.target) + .append_pair( + "agent", + concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), + ) + .append_pair("status", self.get_status().as_str()); debug!("Sending installation report to quickinstall ({url})"); - self.client.request(Method::HEAD, url).send(true).await?; + self.client.request(Method::POST, url).send(true).await?; Ok(()) } diff --git a/crates/binstalk-git-repo-api/src/gh_api_client.rs b/crates/binstalk-git-repo-api/src/gh_api_client.rs index 8773fa11..5b9405d9 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client.rs @@ -248,6 +248,8 @@ pub struct GhReleaseArtifactUrl(Url); impl GhApiClient { /// Return `Ok(Some(api_artifact_url))` if exists. /// + /// Caches info on all artifacts matching (repo, tag). + /// /// The returned future is guaranteed to be pointer size. #[instrument(skip(self), ret(level = Level::DEBUG))] pub async fn has_release_artifact( diff --git a/crates/binstalk/src/lib.rs b/crates/binstalk/src/lib.rs index 271c0f71..83df1938 100644 --- a/crates/binstalk/src/lib.rs +++ b/crates/binstalk/src/lib.rs @@ -10,4 +10,4 @@ pub use binstalk_registry as registry; pub use binstalk_types as manifests; pub use detect_targets::{get_desired_targets, DesiredTargets, TARGET}; -pub use fetchers::QUICK_INSTALL_STATS_URL; +pub use fetchers::QUICKINSTALL_STATS_URL; diff --git a/crates/binstalk/src/ops/resolve.rs b/crates/binstalk/src/ops/resolve.rs index 59940c94..265a18b6 100644 --- a/crates/binstalk/src/ops/resolve.rs +++ b/crates/binstalk/src/ops/resolve.rs @@ -203,6 +203,7 @@ async fn resolve_inner( { Ok(bin_files) => { if !bin_files.is_empty() { + fetcher.clone().report_to_upstream(); return Ok(Resolution::Fetch(Box::new(ResolutionFetch { fetcher: fetcher.clone(), new_version: package_info.version, @@ -250,6 +251,8 @@ async fn resolve_inner( } } + // At this point, we don't know whether fallback to cargo install is allowed, or whether it will + // succeed, but things start to get convoluted when try to include that data, so this will do. if !opts.disable_telemetry { for fetcher in handles { fetcher.report_to_upstream(); From 8c9e1835875b256b72ba24f710e0aa70efa9fe47 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 08:37:44 +0000 Subject: [PATCH 1874/2020] chore: release (#1911) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 6 +++--- crates/bin/Cargo.toml | 2 +- crates/binstalk-fetchers/CHANGELOG.md | 7 +++++++ crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-git-repo-api/CHANGELOG.md | 6 ++++++ crates/binstalk-git-repo-api/Cargo.toml | 2 +- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 6 +++--- 8 files changed, 29 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eec34493..ec6b9011 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -258,7 +258,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.3" +version = "0.28.4" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -339,7 +339,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.9.1" +version = "0.10.0" dependencies = [ "async-trait", "binstalk-downloader", @@ -363,7 +363,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.1" +version = "0.5.2" dependencies = [ "binstalk-downloader", "compact_str", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index a68d6000..e20d3810 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.28.3", default-features = false } +binstalk = { path = "../binstalk", version = "0.28.4", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.2" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index 6a94e153..6eda37f1 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.0](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.9.1...binstalk-fetchers-v0.10.0) - 2024-09-11 + +### Other + +- report to new stats server (with status) ([#1912](https://github.com/cargo-bins/cargo-binstall/pull/1912)) +- Improve quickinstall telemetry failure message ([#1910](https://github.com/cargo-bins/cargo-binstall/pull/1910)) + ## [0.9.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.9.0...binstalk-fetchers-v0.9.1) - 2024-08-12 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 75d9b98b..095d1e5a 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.9.1" +version = "0.10.0" edition = "2021" description = "The binstall fetchers" @@ -13,7 +13,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" binstalk-downloader = { version = "0.13.1", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.1", path = "../binstalk-git-repo-api" } +binstalk-git-repo-api = { version = "0.5.2", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.9.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index 000a8ca7..fa04ab83 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.2](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.1...binstalk-git-repo-api-v0.5.2) - 2024-09-11 + +### Other + +- report to new stats server (with status) ([#1912](https://github.com/cargo-bins/cargo-binstall/pull/1912)) + ## [0.5.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.0...binstalk-git-repo-api-v0.5.1) - 2024-08-12 ### Other diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 0237cea2..26d1b583 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.1" +version = "0.5.2" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index b2ab9757..c613bfa3 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.4](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.3...binstalk-v0.28.4) - 2024-09-11 + +### Other + +- report to new stats server (with status) ([#1912](https://github.com/cargo-bins/cargo-binstall/pull/1912)) + ## [0.28.3](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.2...binstalk-v0.28.3) - 2024-09-06 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 6d4e05b3..4e1a4cfd 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.3" +version = "0.28.4" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -12,8 +12,8 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.6.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.13.1", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.1", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.9.1", path = "../binstalk-fetchers", features = [ +binstalk-git-repo-api = { version = "0.5.2", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.10.0", path = "../binstalk-fetchers", features = [ "quickinstall", ] } binstalk-registry = { version = "0.11.1", path = "../binstalk-registry" } From f9144d57df0014c2e0975517e582dbaaa2b597af Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 11 Sep 2024 09:06:06 +0000 Subject: [PATCH 1875/2020] release: cargo-binstall v1.10.5 (#1914) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ec6b9011..93a46ef1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -563,7 +563,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.4" +version = "1.10.5" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index e20d3810..403d6682 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.4" +version = "1.10.5" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index c92bba54..e840c87f 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From b296b4e92e5c858a30374012377b447365036cb0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Sep 2024 19:08:21 +1000 Subject: [PATCH 1876/2020] dep: Upgrade transitive dependencies (#1915) Co-authored-by: github-actions --- Cargo.lock | 123 ++++++++++++++++++++++------------------------------- 1 file changed, 51 insertions(+), 72 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 93a46ef1..45088b2d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,19 +4,13 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ "gimli", ] -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - [[package]] name = "adler2" version = "2.0.0" @@ -116,9 +110,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "4e1496f8fb1fbf272686b8d37f523dab3e4a7443300055e74cdaa449f3114356" [[package]] name = "arc-swap" @@ -213,17 +207,17 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", - "miniz_oxide 0.7.4", + "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] @@ -649,9 +643,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.16" +version = "1.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9d013ecb737093c0e86b151a7b837993cf9ec6c502946cfb44bedc392421e0b" +checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" dependencies = [ "jobserver", "libc", @@ -692,7 +686,7 @@ version = "4.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "syn", @@ -958,11 +952,11 @@ dependencies = [ [[package]] name = "enum-as-inner" -version = "0.6.0" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ffccbb6966c05b32ef8fbac435df276c4ae4d3dc55a8cd0eb9745e6c12f546a" +checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" dependencies = [ - "heck 0.4.1", + "heck", "proc-macro2", "quote", "syn", @@ -1043,7 +1037,7 @@ checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" dependencies = [ "crc32fast", "libz-ng-sys", - "miniz_oxide 0.8.0", + "miniz_oxide", ] [[package]] @@ -1218,9 +1212,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "gix" @@ -2074,12 +2068,6 @@ dependencies = [ "allocator-api2", ] -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - [[package]] name = "heck" version = "0.5.0" @@ -2286,9 +2274,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde7055719c54e36e95e8719f95883f22072a48ede39db7fc17a4e1d5281e9b9" +checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" dependencies = [ "bytes", "futures-channel", @@ -2348,9 +2336,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" [[package]] name = "is_ci" @@ -2381,9 +2369,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jiff" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "437651126da47900d4d70255ab15f5c69510ca4e0d88c9f01b5b8d41a45c3a9b" +checksum = "8a45489186a6123c128fdf6016183fcfab7113e1820eb813127e036e287233fb" dependencies = [ "jiff-tzdb-platform", "windows-sys 0.59.0", @@ -2391,15 +2379,15 @@ dependencies = [ [[package]] name = "jiff-tzdb" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05fac328b3df1c0f18a3c2ab6cb7e06e4e549f366017d796e3e66b6d6889abe6" +checksum = "91335e575850c5c4c673b9bd467b0e025f164ca59d0564f69d0c2ee0ffad4653" [[package]] name = "jiff-tzdb-platform" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8da387d5feaf355954c2c122c194d6df9c57d865125a67984bb453db5336940" +checksum = "9835f0060a626fe59f160437bc725491a6af23133ea906500027d1bd2f8f4329" dependencies = [ "jiff-tzdb", ] @@ -2498,7 +2486,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", - "redox_syscall 0.5.3", + "redox_syscall 0.5.4", ] [[package]] @@ -2658,15 +2646,6 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a05b5d0594e0cb1ad8cee3373018d2b84e25905dc75b2468114cc9a8e86cfc20" -[[package]] -name = "miniz_oxide" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" -dependencies = [ - "adler", -] - [[package]] name = "miniz_oxide" version = "0.8.0" @@ -2876,15 +2855,15 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "owo-colors" -version = "4.0.0" +version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caff54706df99d2a78a5a4e3455ff45448d81ef1bb63c22cd14052ca0e993a3f" +checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" [[package]] name = "parking" -version = "2.2.0" +version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb813b8af86854136c6922af0598d719255ecb2179515e6e7730d468f05c9cae" +checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" [[package]] name = "parking_lot" @@ -2904,7 +2883,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.3", + "redox_syscall 0.5.4", "smallvec", "windows-targets 0.52.6", ] @@ -3098,9 +3077,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a908a6e00f1fdd0dfd9c0eb08ce85126f6d8bbda50017e74bc4a4b7d4a926a4" +checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" dependencies = [ "bitflags 2.6.0", ] @@ -3260,9 +3239,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.36" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f55e80d50763938498dd5ebb18647174e0c76dc38c5505294bb224624f30f36" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno 0.3.9", @@ -3273,9 +3252,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.12" +version = "0.23.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c58f8c84392efc0a126acce10fa59ff7b3d2ac06ab451a33f2741989b806b044" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" dependencies = [ "log", "once_cell", @@ -3330,9 +3309,9 @@ checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" [[package]] name = "rustls-webpki" -version = "0.102.7" +version = "0.102.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84678086bd54edf2b415183ed7a94d0efb049f1b646a33e22a36f3794be6ae56" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" dependencies = [ "ring", "rustls-pki-types", @@ -3362,11 +3341,11 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbc91545643bcf3a0bbb6569265615222618bdf33ce4ffbbd13c4bbd4c093534" +checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3409,9 +3388,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99fce0ffe7310761ca6bf9faf5115afbc19688edd00171d81b1bb1b116c63e09" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] @@ -3427,9 +3406,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.209" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5831b979fd7b5439637af1752d535ff49f4860c0f341d1baeb6faf0f4242170" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", @@ -3612,7 +3591,7 @@ version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" dependencies = [ - "heck 0.5.0", + "heck", "proc-macro2", "quote", "rustversion", @@ -4082,9 +4061,9 @@ checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "unicode-linebreak" From e3321fbac5e6fdec6bc7db1cb3a1d7b89b687a42 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 20 Sep 2024 10:30:53 +0000 Subject: [PATCH 1877/2020] dep: Upgrade transitive dependencies (#1919) Co-authored-by: github-actions --- Cargo.lock | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 45088b2d..8347228a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -110,9 +110,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e1496f8fb1fbf272686b8d37f523dab3e4a7443300055e74cdaa449f3114356" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "arc-swap" @@ -515,9 +515,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.1" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "bytesize" @@ -643,9 +643,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.18" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62ac837cdb5cb22e10a256099b4fc502b1dfe560cb282963a974d7abd80e476" +checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" dependencies = [ "jobserver", "libc", @@ -2587,9 +2587,9 @@ checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "memmap2" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" dependencies = [ "libc", ] @@ -3917,9 +3917,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.20" +version = "0.22.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583c44c02ad26b0c3f3066fe629275e50627026c51ac2e595cca4c230ce1ce1d" +checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" dependencies = [ "indexmap", "serde", @@ -4073,18 +4073,18 @@ checksum = "3b09c83c3c29d37506a3e260c08c03743a6bb66a9cd432c6934ab501a190571f" [[package]] name = "unicode-normalization" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a56d1686db2308d901306f92a263857ef59ea39678a5458e7cb17f01415101f5" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0336d538f7abc86d282a4189614dfaa90810dfc2c6f6427eaf88e16311dd225d" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "untrusted" @@ -4280,9 +4280,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.5" +version = "0.26.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bd24728e5af82c6c4ec1b66ac4844bdf8156257fccda846ec58b42cd0cdbe6a" +checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" dependencies = [ "rustls-pki-types", ] From 2917b327882cf21fce521d12e0c0799110e7811b Mon Sep 17 00:00:00 2001 From: John Vandenberg Date: Sun, 22 Sep 2024 15:06:01 +0800 Subject: [PATCH 1878/2020] allow setting no_confirm via envvar (#1921) --- crates/bin/src/args.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 9881341e..dc4480b4 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -221,7 +221,12 @@ pub struct Args { pub(crate) dry_run: bool, /// Disable interactive mode / confirmation prompts. - #[clap(help_heading = "Options", short = 'y', long)] + #[clap( + help_heading = "Options", + short = 'y', + long, + env = "BINSTALL_NO_CONFIRM" + )] pub(crate) no_confirm: bool, /// Do not cleanup temporary files. From 4a15b12fd11557e08ae12422296276fd0ca6a33e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 22 Sep 2024 08:59:21 +0000 Subject: [PATCH 1879/2020] chore: release (#1916) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 4 ++-- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- 10 files changed, 36 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8347228a..30a0767a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -252,7 +252,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.4" +version = "0.28.5" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.2" +version = "0.15.3" dependencies = [ "beef", "binstalk-types", @@ -856,7 +856,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.21" +version = "0.1.22" dependencies = [ "cfg-if", "guess_host_triple", @@ -868,7 +868,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.4" +version = "1.0.5" dependencies = [ "tempfile", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 403d6682..34ab7a6f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,8 +22,8 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.28.4", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.2" } +binstalk = { path = "../binstalk", version = "0.28.5", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.3" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index 7cbfea51..7d1c96fb 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.3](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.2...binstalk-manifests-v0.15.3) - 2024-09-22 + +### Other + +- updated the following local packages: detect-targets + ## [0.15.2](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.1...binstalk-manifests-v0.15.2) - 2024-09-06 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 0faedf8d..8cc72920 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.2" +version = "0.15.3" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.21", path = "../detect-targets" } +detect-targets = { version = "0.1.22", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index c613bfa3..4a0b5617 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.5](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.4...binstalk-v0.28.5) - 2024-09-22 + +### Other + +- updated the following local packages: detect-targets + ## [0.28.4](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.3...binstalk-v0.28.4) - 2024-09-11 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 4e1a4cfd..d086020d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.4" +version = "0.28.5" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -21,7 +21,7 @@ binstalk-types = { version = "0.9.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.1", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.21", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.22", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index 62dd8236..0010b384 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.22](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.21...detect-targets-v0.1.22) - 2024-09-22 + +### Other + +- update Cargo.lock dependencies + ## [0.1.21](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.20...detect-targets-v0.1.21) - 2024-09-06 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 5c4099b0..d71d3c0a 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.21" +version = "0.1.22" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index c69c623b..3914f216 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.5](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.4...detect-wasi-v1.0.5) - 2024-09-22 + +### Other + +- update Cargo.lock dependencies + ## [1.0.4](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.3...detect-wasi-v1.0.4) - 2024-09-06 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index f89e3e81..ec4be230 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.4" +version = "1.0.5" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From 3a99ae3c155195e5518c9ff954bee1b90f98b82c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 22 Sep 2024 10:17:00 +0000 Subject: [PATCH 1880/2020] release: cargo-binstall v1.10.6 (#1922) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 30a0767a..ec004c78 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -557,7 +557,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.5" +version = "1.10.6" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 34ab7a6f..df553c59 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.5" +version = "1.10.6" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index e840c87f..f19bd9f2 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From d05a8d0cc0c6d86c4aaafd1a8dd61450486fb727 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 27 Sep 2024 14:10:45 +1000 Subject: [PATCH 1881/2020] dep: Upgrade transitive dependencies (#1923) Co-authored-by: github-actions --- Cargo.lock | 98 +++++++++++++++++++++--------------------------------- 1 file changed, 38 insertions(+), 60 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ec004c78..c9765dc5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -159,9 +159,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.82" +version = "0.1.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a27b8a3a6e1a44fa4c8baf1f653e4172e81486d4941f2237e20dc2d0cf4ddff1" +checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" dependencies = [ "proc-macro2", "quote", @@ -201,9 +201,9 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "autocfg" -version = "1.3.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" @@ -624,9 +624,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.20.4" +version = "0.20.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad639525b1c67b6a298f378417b060fbc04618bea559482a8484381cce27d965" +checksum = "88da5a13c620b4ca0078845707ea9c3faf11edbc3ffd8497d11d686211cd1ac0" dependencies = [ "serde", "toml", @@ -660,9 +660,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.17" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5a21b8495e732f1b3c364c9949b201ca7bae518c502c80256c96ad79eaf6ac" +checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" dependencies = [ "clap_builder", "clap_derive", @@ -670,9 +670,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.17" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8cf2dd12af7a047ad9d6da2b6b249759a22a7abc0f474c1dae1777afa4b21a73" +checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" dependencies = [ "anstream", "anstyle", @@ -682,9 +682,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.13" +version = "4.5.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501d359d5f3dcaf6ecdeee48833ae73ec6e42723a1e52419c79abf9507eec0a0" +checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" dependencies = [ "heck", "proc-macro2", @@ -929,9 +929,9 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "embed-resource" -version = "2.4.3" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edcacde9351c33139a41e3c97eb2334351a81a2791bebb0b243df837128f602" +checksum = "f4e24052d7be71f0efb50c201557f6fe7d237cfd5a64fd5bcd7fd8fe32dbbffa" dependencies = [ "cc", "memchr", @@ -1031,9 +1031,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.33" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324a1be68054ef05ad64b861cc9eaf1d623d2d8cb25b4bf2cb9cdd902b4bf253" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", "libz-ng-sys", @@ -2274,9 +2274,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da62f120a8a37763efb0cf8fdf264b884c7b8b9ac8660b900c8661030c00e6ba" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" dependencies = [ "bytes", "futures-channel", @@ -2287,7 +2287,6 @@ dependencies = [ "pin-project-lite", "socket2", "tokio", - "tower", "tower-service", "tracing", ] @@ -2464,9 +2463,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.158" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libmimalloc-sys" @@ -2486,7 +2485,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", - "redox_syscall 0.5.4", + "redox_syscall 0.5.6", ] [[package]] @@ -2883,7 +2882,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.4", + "redox_syscall 0.5.6", "smallvec", "windows-targets 0.52.6", ] @@ -2934,9 +2933,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "powerfmt" @@ -3077,9 +3076,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0884ad60e090bf1345b93da0a5de8923c93884cd03f40dfcfddd3b4bee661853" +checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b" dependencies = [ "bitflags 2.6.0", ] @@ -3369,9 +3368,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.11.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75da29fe9b9b08fe9d6b22b5b4bcbc75d8db3aa31e639aa56bb62e9d46bfceaf" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -3429,9 +3428,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" dependencies = [ "serde", ] @@ -3729,18 +3728,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.63" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", @@ -3917,9 +3916,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.21" +version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" +checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap", "serde", @@ -3928,27 +3927,6 @@ dependencies = [ "winnow", ] -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "pin-project", - "pin-project-lite", - "tokio", - "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" @@ -4558,9 +4536,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.18" +version = "0.6.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" +checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" dependencies = [ "memchr", ] From f80bf0ccf7161024258fe9022082a1750ec415a0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 4 Oct 2024 20:27:53 +1000 Subject: [PATCH 1882/2020] dep: Upgrade transitive dependencies (#1925) Co-authored-by: github-actions --- Cargo.lock | 123 +++++++++++++++++++++++++++-------------------------- 1 file changed, 62 insertions(+), 61 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c9765dc5..28f9c63e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -128,9 +128,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "async-compression" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fec134f64e2bc57411226dfc4e52dec859ddfc7e711fc5e07b612584f000e4aa" +checksum = "7e614738943d3f68c628ae3dbce7c3daffb196665f82f8c8ea6b65de73c79429" dependencies = [ "brotli", "bzip2", @@ -471,9 +471,9 @@ dependencies = [ [[package]] name = "brotli" -version = "6.0.0" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f7971dbd9326d58187408ab83117d8ac1bb9c17b085fdacd1cf2f598719b6b" +checksum = "cc97b8f16f944bba54f0433f07e30be199b6dc2bd25937444bbad560bcea29bd" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -643,9 +643,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.21" +version = "1.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07b1695e2c7e8fc85310cde85aeaab7e3097f593c91d209d3f9df76c928100f0" +checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938" dependencies = [ "jobserver", "libc", @@ -660,9 +660,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.18" +version = "4.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0956a43b323ac1afaffc053ed5c4b7c1f1800bacd1683c353aabbb752515dd3" +checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" dependencies = [ "clap_builder", "clap_derive", @@ -670,9 +670,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.18" +version = "4.5.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d72166dd41634086d5803a47eb71ae740e61d84709c36f3c34110173db3961b" +checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" dependencies = [ "anstream", "anstyle", @@ -1519,7 +1519,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ddf80e16f3c19ac06ce415a38b8591993d3f73aede049cb561becb5b3a8e242" dependencies = [ "gix-hash", - "hashbrown", + "hashbrown 0.14.5", "parking_lot", ] @@ -1555,7 +1555,7 @@ dependencies = [ "gix-traverse", "gix-utils", "gix-validate", - "hashbrown", + "hashbrown 0.14.5", "itoa", "libc", "memmap2", @@ -2068,6 +2068,12 @@ dependencies = [ "allocator-api2", ] +[[package]] +name = "hashbrown" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" + [[package]] name = "heck" version = "0.5.0" @@ -2201,9 +2207,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.4" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -2248,7 +2254,7 @@ dependencies = [ "hyper", "hyper-util", "rustls", - "rustls-native-certs 0.8.0", + "rustls-native-certs", "rustls-pki-types", "tokio", "tokio-rustls", @@ -2303,12 +2309,12 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.15.0", ] [[package]] @@ -2335,9 +2341,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "187674a687eed5fe42285b40c6291f9a01517d415fad1c3cbc6a9f778af7fcd4" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "is_ci" @@ -2485,7 +2491,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", - "redox_syscall 0.5.6", + "redox_syscall 0.5.7", ] [[package]] @@ -2782,9 +2788,12 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.19.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" +dependencies = [ + "portable-atomic", +] [[package]] name = "openssl" @@ -2882,7 +2891,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.6", + "redox_syscall 0.5.7", "smallvec", "windows-targets 0.52.6", ] @@ -2937,6 +2946,12 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +[[package]] +name = "portable-atomic" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" + [[package]] name = "powerfmt" version = "0.2.0" @@ -3076,9 +3091,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "355ae415ccd3a04315d3f8246e86d67689ea74d88d915576e1589a351062a13b" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ "bitflags 2.6.0", ] @@ -3107,9 +3122,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.6" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", @@ -3119,9 +3134,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38caf58cc5ef2fed281f89292ef23f6365465ed9a41b7a7754eb4e26496c92df" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", @@ -3130,15 +3145,15 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a66a03ae7c801facd77a29370b4faec201768915ac14a721ba36f20bc9c209b" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.7" +version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" dependencies = [ "async-compression", "base64", @@ -3167,7 +3182,7 @@ dependencies = [ "pin-project-lite", "quinn", "rustls", - "rustls-native-certs 0.7.3", + "rustls-native-certs", "rustls-pemfile", "rustls-pki-types", "serde", @@ -3264,19 +3279,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rustls-native-certs" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5bfb394eeed242e909609f56089eecfe5fda225042e8b171791b9c95f5931e5" -dependencies = [ - "openssl-probe", - "rustls-pemfile", - "rustls-pki-types", - "schannel", - "security-framework", -] - [[package]] name = "rustls-native-certs" version = "0.8.0" @@ -3292,19 +3294,18 @@ dependencies = [ [[package]] name = "rustls-pemfile" -version = "2.1.3" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" dependencies = [ - "base64", "rustls-pki-types", ] [[package]] name = "rustls-pki-types" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0a2ce646f8655401bb81e7927b812614bd5d91dbc968696be50603510fcaf0" +checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" [[package]] name = "rustls-webpki" @@ -3626,9 +3627,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.77" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", @@ -3694,9 +3695,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.12.0" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbcdd0c794ebb0d4cf35e88edd2f7d2c4c3e9a5a6dab322839b321c6a87a64" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", @@ -4027,9 +4028,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-bom" @@ -4235,9 +4236,9 @@ checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wasm-streams" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b65dc4c90b63b118468cf747d8bf3566c1913ef60be765b5730ead9e0a3ba129" +checksum = "4e072d4e72f700fb3443d8fe94a39315df013eef1104903cdb0a2abd322bbecd" dependencies = [ "futures-util", "js-sys", From a7794f08a6c298d5d419bea0ab45f4db8252208c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 4 Oct 2024 10:54:17 +0000 Subject: [PATCH 1883/2020] chore: release (#1924) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 4 ++-- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- 10 files changed, 36 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 28f9c63e..44d38f82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -252,7 +252,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.5" +version = "0.28.6" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.3" +version = "0.15.4" dependencies = [ "beef", "binstalk-types", @@ -856,7 +856,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.22" +version = "0.1.23" dependencies = [ "cfg-if", "guess_host_triple", @@ -868,7 +868,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.5" +version = "1.0.6" dependencies = [ "tempfile", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index df553c59..728a19a5 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,8 +22,8 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.28.5", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.3" } +binstalk = { path = "../binstalk", version = "0.28.6", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.4" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index 7d1c96fb..0d74c9b4 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.4](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.3...binstalk-manifests-v0.15.4) - 2024-10-04 + +### Other + +- updated the following local packages: detect-targets + ## [0.15.3](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.2...binstalk-manifests-v0.15.3) - 2024-09-22 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 8cc72920..d170f36e 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.3" +version = "0.15.4" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.22", path = "../detect-targets" } +detect-targets = { version = "0.1.23", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index 4a0b5617..6e3baf5b 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.6](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.5...binstalk-v0.28.6) - 2024-10-04 + +### Other + +- updated the following local packages: detect-targets + ## [0.28.5](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.4...binstalk-v0.28.5) - 2024-09-22 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index d086020d..c5f29b2e 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.5" +version = "0.28.6" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -21,7 +21,7 @@ binstalk-types = { version = "0.9.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.1", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.22", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.23", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index 0010b384..723d9244 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.23](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.22...detect-targets-v0.1.23) - 2024-10-04 + +### Other + +- update Cargo.lock dependencies + ## [0.1.22](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.21...detect-targets-v0.1.22) - 2024-09-22 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index d71d3c0a..9fef455e 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.22" +version = "0.1.23" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index 3914f216..e100b25e 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.6](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.5...detect-wasi-v1.0.6) - 2024-10-04 + +### Other + +- update Cargo.lock dependencies + ## [1.0.5](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.4...detect-wasi-v1.0.5) - 2024-09-22 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index ec4be230..f9813592 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.5" +version = "1.0.6" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From 3ed2912cc1fc3431192b502cf153cde59448ce38 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 4 Oct 2024 12:03:43 +0000 Subject: [PATCH 1884/2020] release: cargo-binstall v1.10.7 (#1926) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 44d38f82..e8232ae7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -557,7 +557,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.6" +version = "1.10.7" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 728a19a5..8170c134 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.6" +version = "1.10.7" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index f19bd9f2..2ddccd2a 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 2a7634c909346d38844fcde799e43ca05b1a06e8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 11 Oct 2024 08:37:06 +0000 Subject: [PATCH 1885/2020] dep: Upgrade transitive dependencies (#1927) Co-authored-by: github-actions --- Cargo.lock | 129 +++++++++++++++++++++++++---------------------------- 1 file changed, 60 insertions(+), 69 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e8232ae7..920a9141 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "addr2line" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ "gimli", ] @@ -128,9 +128,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "async-compression" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e614738943d3f68c628ae3dbce7c3daffb196665f82f8c8ea6b65de73c79429" +checksum = "998282f8f49ccd6116b0ed8a4de0fbd3151697920e7c7533416d6e25e76434a7" dependencies = [ "brotli", "bzip2", @@ -643,9 +643,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.24" +version = "1.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938" +checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" dependencies = [ "jobserver", "libc", @@ -660,9 +660,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.5.19" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be5744db7978a28d9df86a214130d106a89ce49644cbc4e3f0c22c3fba30615" +checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" dependencies = [ "clap_builder", "clap_derive", @@ -670,9 +670,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.19" +version = "4.5.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5fbc17d3ef8278f55b282b2a2e75ae6f6c7d4bb70ed3d0382375104bfafdb4b" +checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" dependencies = [ "anstream", "anstyle", @@ -1089,9 +1089,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" dependencies = [ "futures-channel", "futures-core", @@ -1104,9 +1104,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", "futures-sink", @@ -1114,15 +1114,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-executor" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ "futures-core", "futures-task", @@ -1131,9 +1131,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" @@ -1150,9 +1150,9 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" +checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", @@ -1161,21 +1161,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.30" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-channel", "futures-core", @@ -1212,9 +1212,9 @@ dependencies = [ [[package]] name = "gimli" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gix" @@ -2423,9 +2423,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" +checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" dependencies = [ "wasm-bindgen", ] @@ -2779,21 +2779,18 @@ dependencies = [ [[package]] name = "object" -version = "0.36.4" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.20.1" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" -dependencies = [ - "portable-atomic", -] +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl" @@ -2910,18 +2907,18 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bf43b791c5b9e34c3d182969b4abb522f9343702850a2e57f460d00d09b4b3" +checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.5" +version = "1.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" +checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" dependencies = [ "proc-macro2", "quote", @@ -2946,12 +2943,6 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" -[[package]] -name = "portable-atomic" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" - [[package]] name = "powerfmt" version = "0.2.0" @@ -2969,9 +2960,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.86" +version = "1.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" +checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" dependencies = [ "unicode-ident", ] @@ -3266,9 +3257,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.13" +version = "0.23.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" dependencies = [ "log", "once_cell", @@ -3341,9 +3332,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9aaafd5a2b6e3d657ff009d82fbd630b6bd54dd4eb06f21693925cdf80f9b8b" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ "windows-sys 0.59.0", ] @@ -4169,9 +4160,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" +checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" dependencies = [ "cfg-if", "once_cell", @@ -4180,9 +4171,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" +checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" dependencies = [ "bumpalo", "log", @@ -4195,9 +4186,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.43" +version = "0.4.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" +checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" dependencies = [ "cfg-if", "js-sys", @@ -4207,9 +4198,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" +checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4217,9 +4208,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" +checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" dependencies = [ "proc-macro2", "quote", @@ -4230,9 +4221,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.93" +version = "0.2.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" +checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-streams" @@ -4249,9 +4240,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.70" +version = "0.3.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" +checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" dependencies = [ "js-sys", "wasm-bindgen", From e7f98b2a3d88c75a7922d8436c9c91c3ca7f3532 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 12 Oct 2024 12:46:19 +1100 Subject: [PATCH 1886/2020] build(deps): bump fs4 from 0.9.1 to 0.10.0 in the deps group (#1929) Bumps the deps group with 1 update: [fs4](https://github.com/al8n/fs4-rs). Updates `fs4` from 0.9.1 to 0.10.0 - [Release notes](https://github.com/al8n/fs4-rs/releases) - [Commits](https://github.com/al8n/fs4-rs/commits/0.10.0) --- updated-dependencies: - dependency-name: fs4 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/fs-lock/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 920a9141..5749a493 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1079,9 +1079,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c6b3bd49c37d2aa3f3f2220233b29a7cd23f79d1fe70e5337d25fb390793de" +checksum = "ec6fcfb3c0c1d71612528825042261419d5dade9678c39a781e05b63677d9b32" dependencies = [ "rustix", "windows-sys 0.52.0", diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 04e67728..25714779 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -10,4 +10,4 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -fs4 = "0.9.1" +fs4 = "0.10.0" From a8227ae6a4b9d2175102621f0e87bd4ba504e74c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 12 Oct 2024 03:58:24 +0000 Subject: [PATCH 1887/2020] chore: release (#1928) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 10 +++++----- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 6 +++--- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 4 ++-- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- crates/fs-lock/CHANGELOG.md | 6 ++++++ crates/fs-lock/Cargo.toml | 2 +- 12 files changed, 45 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5749a493..bfe075d0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -252,7 +252,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.6" +version = "0.28.7" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.4" +version = "0.15.5" dependencies = [ "beef", "binstalk-types", @@ -856,7 +856,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.23" +version = "0.1.24" dependencies = [ "cfg-if", "guess_host_triple", @@ -868,7 +868,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.6" +version = "1.0.7" dependencies = [ "tempfile", ] @@ -1072,7 +1072,7 @@ dependencies = [ [[package]] name = "fs-lock" -version = "0.1.4" +version = "0.1.5" dependencies = [ "fs4", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 8170c134..256ff873 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,8 +22,8 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.28.6", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.4" } +binstalk = { path = "../binstalk", version = "0.28.7", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.5" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index 0d74c9b4..aecc8b37 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.5](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.4...binstalk-manifests-v0.15.5) - 2024-10-12 + +### Other + +- updated the following local packages: detect-targets, fs-lock + ## [0.15.4](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.3...binstalk-manifests-v0.15.4) - 2024-10-04 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index d170f36e..e790a20d 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.4" +version = "0.15.5" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" beef = { version = "0.5.2", features = ["impl_serde"] } binstalk-types = { version = "0.9.0", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } -fs-lock = { version = "0.1.4", path = "../fs-lock" } +fs-lock = { version = "0.1.5", path = "../fs-lock" } home = "0.5.9" miette = "7.0.0" semver = { version = "1.0.17", features = ["serde"] } @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.23", path = "../detect-targets" } +detect-targets = { version = "0.1.24", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index 6e3baf5b..aa71e871 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.7](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.6...binstalk-v0.28.7) - 2024-10-12 + +### Other + +- updated the following local packages: detect-targets + ## [0.28.6](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.5...binstalk-v0.28.6) - 2024-10-04 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index c5f29b2e..6693626f 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.6" +version = "0.28.7" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -21,7 +21,7 @@ binstalk-types = { version = "0.9.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.1", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.23", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.24", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index 723d9244..a11806e5 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.24](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.23...detect-targets-v0.1.24) - 2024-10-12 + +### Other + +- update Cargo.lock dependencies + ## [0.1.23](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.22...detect-targets-v0.1.23) - 2024-10-04 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 9fef455e..c7af498f 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.23" +version = "0.1.24" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index e100b25e..24a6d716 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.7](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.6...detect-wasi-v1.0.7) - 2024-10-12 + +### Other + +- update Cargo.lock dependencies + ## [1.0.6](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.5...detect-wasi-v1.0.6) - 2024-10-04 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index f9813592..e4531d35 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.6" +version = "1.0.7" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" diff --git a/crates/fs-lock/CHANGELOG.md b/crates/fs-lock/CHANGELOG.md index af4f3ae8..6a572359 100644 --- a/crates/fs-lock/CHANGELOG.md +++ b/crates/fs-lock/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.5](https://github.com/cargo-bins/cargo-binstall/compare/fs-lock-v0.1.4...fs-lock-v0.1.5) - 2024-10-12 + +### Other + +- *(deps)* bump fs4 from 0.9.1 to 0.10.0 in the deps group ([#1929](https://github.com/cargo-bins/cargo-binstall/pull/1929)) + ## [0.1.4](https://github.com/cargo-bins/cargo-binstall/compare/fs-lock-v0.1.3...fs-lock-v0.1.4) - 2024-08-04 ### Other diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 25714779..5773ce62 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -3,7 +3,7 @@ name = "fs-lock" description = "Locked files that can be used like normal File" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/fs-lock" -version = "0.1.4" +version = "0.1.5" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From 61c9231401214aee390ceef247430f1f2f855a97 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 12 Oct 2024 21:12:53 +1100 Subject: [PATCH 1888/2020] CI: Fix binstalk-git-repo-api on PR of forks (#1932) * Rm CI_UNIT_TEST_GITHUB_TOKEN fallback for unit-tests As it would break unit testing Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * CI: Fix gh_api_client.rs test Ignore empty gh token Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Update crates/binstalk-git-repo-api/src/gh_api_client.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Update crates/binstalk-git-repo-api/src/gh_api_client.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- crates/binstalk-git-repo-api/src/gh_api_client.rs | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 63132171..9a0acffc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -95,7 +95,7 @@ jobs: if: env.CARGO_NEXTEST_ADDITIONAL_ARGS != '' env: GITHUB_TOKEN: ${{ secrets.CI_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} - CI_UNIT_TEST_GITHUB_TOKEN: ${{ secrets.CI_UNIT_TEST_GITHUB_TOKEN || secrets.GITHUB_TOKEN }} + CI_UNIT_TEST_GITHUB_TOKEN: ${{ secrets.CI_UNIT_TEST_GITHUB_TOKEN }} e2e-tests: if: github.event_name != 'pull_request' diff --git a/crates/binstalk-git-repo-api/src/gh_api_client.rs b/crates/binstalk-git-repo-api/src/gh_api_client.rs index 5b9405d9..60856f66 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client.rs @@ -527,10 +527,12 @@ mod test { fn create_client() -> Vec { let client = create_remote_client(); - let auth_token = env::var("CI_UNIT_TEST_GITHUB_TOKEN") - .ok() - .map(Box::::from) - .map(zeroize::Zeroizing::new); + let auth_token = match env::var("CI_UNIT_TEST_GITHUB_TOKEN") { + Ok(auth_token) if !auth_token.is_empty() => { + Some(zeroize::Zeroizing::new(auth_token.into_boxed_str())) + } + _ => None, + }; let gh_client = GhApiClient::new(client.clone(), auth_token.clone()); gh_client.set_only_use_restful_api(); From 5069cb66384b59add3019ea13c183364f015a478 Mon Sep 17 00:00:00 2001 From: PukNgae Cryolitia Date: Sat, 12 Oct 2024 20:32:04 +0800 Subject: [PATCH 1889/2020] fix(gh_api_client): remote client should never being shared everywhere bacause the underlying connection pool will be reused. (#1930) The client pool contains connections associated with a runtime when the runtime closes, the client may panic at seeing the connection disappear "abruptly". Reported-by: https://archriscv.felixc.at/.status/log.htm?url=logs/cargo-binstall/cargo-binstall-1.8.0-1.log Link: https://github.com/seanmonstar/reqwest/issues/1148 --- .../src/gh_api_client.rs | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/crates/binstalk-git-repo-api/src/gh_api_client.rs b/crates/binstalk-git-repo-api/src/gh_api_client.rs index 60856f66..6af635ab 100644 --- a/crates/binstalk-git-repo-api/src/gh_api_client.rs +++ b/crates/binstalk-git-repo-api/src/gh_api_client.rs @@ -327,7 +327,6 @@ impl GhApiClient { mod test { use super::*; use compact_str::{CompactString, ToCompactString}; - use once_cell::sync::OnceCell; use std::{env, num::NonZeroU16, time::Duration}; use tokio::time::sleep; use tracing::subscriber::set_global_default; @@ -506,20 +505,14 @@ mod test { } fn create_remote_client() -> remote::Client { - static CLIENT: OnceCell = OnceCell::new(); - - CLIENT - .get_or_init(|| { - remote::Client::new( - concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), - None, - NonZeroU16::new(300).unwrap(), - 1.try_into().unwrap(), - [], - ) - .unwrap() - }) - .clone() + remote::Client::new( + concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), + None, + NonZeroU16::new(300).unwrap(), + 1.try_into().unwrap(), + [], + ) + .unwrap() } /// Mark this as an async fn so that you won't accidentally use it in From 731592f357b1e397ee7ab9e5cb55ed0fdbafff25 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 12 Oct 2024 15:08:00 +0000 Subject: [PATCH 1890/2020] chore: release (#1933) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 6 +++--- crates/bin/Cargo.toml | 2 +- crates/binstalk-fetchers/CHANGELOG.md | 6 ++++++ crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-git-repo-api/CHANGELOG.md | 10 ++++++++++ crates/binstalk-git-repo-api/Cargo.toml | 2 +- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 6 +++--- 8 files changed, 32 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bfe075d0..ac7b1d38 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -252,7 +252,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.7" +version = "0.28.8" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -333,7 +333,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.10.0" +version = "0.10.1" dependencies = [ "async-trait", "binstalk-downloader", @@ -357,7 +357,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.2" +version = "0.5.3" dependencies = [ "binstalk-downloader", "compact_str", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 256ff873..77e81cdb 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,7 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.28.7", default-features = false } +binstalk = { path = "../binstalk", version = "0.28.8", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.5" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index 6eda37f1..7ad0b19c 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.0...binstalk-fetchers-v0.10.1) - 2024-10-12 + +### Other + +- updated the following local packages: binstalk-git-repo-api + ## [0.10.0](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.9.1...binstalk-fetchers-v0.10.0) - 2024-09-11 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 095d1e5a..5537abdf 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.10.0" +version = "0.10.1" edition = "2021" description = "The binstall fetchers" @@ -13,7 +13,7 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" binstalk-downloader = { version = "0.13.1", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.2", path = "../binstalk-git-repo-api" } +binstalk-git-repo-api = { version = "0.5.3", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.9.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index fa04ab83..e72a198e 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.3](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.2...binstalk-git-repo-api-v0.5.3) - 2024-10-12 + +### Fixed + +- *(gh_api_client)* remote client should never being shared everywhere bacause the underlying connection pool will be reused. ([#1930](https://github.com/cargo-bins/cargo-binstall/pull/1930)) + +### Other + +- Fix binstalk-git-repo-api on PR of forks ([#1932](https://github.com/cargo-bins/cargo-binstall/pull/1932)) + ## [0.5.2](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.1...binstalk-git-repo-api-v0.5.2) - 2024-09-11 ### Other diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 26d1b583..1a1914e9 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.2" +version = "0.5.3" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index aa71e871..07afb869 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.8](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.7...binstalk-v0.28.8) - 2024-10-12 + +### Other + +- updated the following local packages: binstalk-git-repo-api + ## [0.28.7](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.6...binstalk-v0.28.7) - 2024-10-12 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 6693626f..15c228ef 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.7" +version = "0.28.8" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -12,8 +12,8 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.6.0", path = "../binstalk-bins" } binstalk-downloader = { version = "0.13.1", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.2", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.10.0", path = "../binstalk-fetchers", features = [ +binstalk-git-repo-api = { version = "0.5.3", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.10.1", path = "../binstalk-fetchers", features = [ "quickinstall", ] } binstalk-registry = { version = "0.11.1", path = "../binstalk-registry" } From 4675f622c92bd9f642fc5a0117c7bfe984979c57 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 13 Oct 2024 00:45:03 +0000 Subject: [PATCH 1891/2020] release: cargo-binstall v1.10.8 (#1931) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ac7b1d38..7fbedad7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -557,7 +557,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.7" +version = "1.10.8" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 77e81cdb..fd9a7148 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.7" +version = "1.10.8" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 2ddccd2a..3e383922 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From a85dc994eb44a3b5701530569987038d86571ecb Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sun, 13 Oct 2024 11:50:57 +1100 Subject: [PATCH 1892/2020] CI: Run ci.yml on every Sat (#1934) Make sure we have up-to-date cache. Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- .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 9a0acffc..7c24a634 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,7 +15,7 @@ on: - reopened - synchronize schedule: - - cron: "0 3 * * 1" + - cron: "0 3 * * 6" concurrency: group: ${{ github.workflow }}-${{ github.ref || github.event.pull_request.number || github.sha }}-${{ inputs.additional_key }} From 92a022bad41abdae4221a6e901e455359cee03fe Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 18 Oct 2024 07:36:53 +0000 Subject: [PATCH 1893/2020] dep: Upgrade transitive dependencies (#1936) Co-authored-by: github-actions --- Cargo.lock | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7fbedad7..c37160cf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -128,9 +128,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "async-compression" -version = "0.4.14" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "998282f8f49ccd6116b0ed8a4de0fbd3151697920e7c7533416d6e25e76434a7" +checksum = "103db485efc3e41214fe4fda9f3dbeae2eb9082f48fd236e6095627a9422066e" dependencies = [ "brotli", "bzip2", @@ -643,9 +643,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.28" +version = "1.1.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" +checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" dependencies = [ "jobserver", "libc", @@ -2225,9 +2225,9 @@ checksum = "5c3b1f728c459d27b12448862017b96ad4767b1ec2ec5e6434e99f1577f085b8" [[package]] name = "hyper" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" dependencies = [ "bytes", "futures-channel", @@ -2469,9 +2469,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.159" +version = "0.2.161" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" [[package]] name = "libmimalloc-sys" @@ -2794,9 +2794,9 @@ checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl" -version = "0.10.66" +version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" +checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -2835,9 +2835,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.103" +version = "0.9.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" +checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" dependencies = [ "cc", "libc", @@ -2960,9 +2960,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.87" +version = "1.0.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3e4daa0dcf6feba26f985457cdf104d4b4256fc5a09547140f3631bb076b19a" +checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" dependencies = [ "unicode-ident", ] @@ -3257,9 +3257,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.14" +version = "0.23.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "415d9944693cb90382053259f89fbb077ea730ad7273047ec63b19bc9b160ba8" +checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" dependencies = [ "log", "once_cell", @@ -3294,9 +3294,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" +checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" [[package]] name = "rustls-webpki" @@ -3311,9 +3311,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955d28af4278de8121b7ebeb796b6a45735dc01436d898801014aced2773a3d6" +checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" [[package]] name = "ryu" @@ -3408,9 +3408,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.128" +version = "1.0.129" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" +checksum = "6dbcf9b78a125ee667ae19388837dd12294b858d101fdd393cb9d5501ef09eb2" dependencies = [ "itoa", "memchr", From a284b4e69ebbde82de67e4149e342e3ae99cebd9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 25 Oct 2024 12:36:08 +0000 Subject: [PATCH 1894/2020] dep: Upgrade transitive dependencies (#1940) Co-authored-by: github-actions --- Cargo.lock | 313 +++++++++++++++++++++++++++-------------------------- 1 file changed, 160 insertions(+), 153 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c37160cf..694b8dff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,9 +61,9 @@ checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "anstream" -version = "0.6.15" +version = "0.6.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" dependencies = [ "anstyle", "anstyle-parse", @@ -76,43 +76,43 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.8" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" +checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" [[package]] name = "anstyle-parse" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.1" +version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.4" +version = "3.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.89" +version = "1.0.91" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" +checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" [[package]] name = "arc-swap" @@ -128,9 +128,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "async-compression" -version = "0.4.16" +version = "0.4.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "103db485efc3e41214fe4fda9f3dbeae2eb9082f48fd236e6095627a9422066e" +checksum = "0cb8f1d480b0ea3783ab015936d2a55c87e219676f0c0b7dec61494043f21857" dependencies = [ "brotli", "bzip2", @@ -515,9 +515,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" +checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" [[package]] name = "bytesize" @@ -643,9 +643,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.30" +version = "1.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16803a61b81d9eabb7eae2588776c4c1e584b738ede45fdbb4c972cec1e9945" +checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" dependencies = [ "jobserver", "libc", @@ -715,9 +715,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" +checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "command-group" @@ -943,9 +943,9 @@ dependencies = [ [[package]] name = "encoding_rs" -version = "0.8.34" +version = "0.8.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" +checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3" dependencies = [ "cfg-if", ] @@ -1004,6 +1004,9 @@ name = "faster-hex" version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2a2b11eda1d40935b26cf18f6833c526845ae8c41e58d09af6adeb6f0269183" +dependencies = [ + "serde", +] [[package]] name = "fastrand" @@ -1218,9 +1221,9 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gix" -version = "0.66.0" +version = "0.67.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9048b8d1ae2104f045cb37e5c450fc49d5d8af22609386bfc739c11ba88995eb" +checksum = "c7d3e78ddac368d3e3bfbc2862bc2aafa3d89f1b15fed898d9761e1ec6f3f17f" dependencies = [ "gix-actor", "gix-attributes", @@ -1270,9 +1273,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc19e312cd45c4a66cd003f909163dc2f8e1623e30a0c0c6df3776e89b308665" +checksum = "59226ef06661c756e664b46b1d3b2c198f6adc5407a484c086d0171108a70027" dependencies = [ "bstr", "gix-date", @@ -1284,9 +1287,9 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.22.5" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebccbf25aa4a973dd352564a9000af69edca90623e8a16dad9cbc03713131311" +checksum = "31a102d201ef0e5a848458a82292581e7641e52f0f52e693b6cbdd05a652c029" dependencies = [ "bstr", "gix-glob", @@ -1301,27 +1304,27 @@ dependencies = [ [[package]] name = "gix-bitmap" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a371db66cbd4e13f0ed9dc4c0fea712d7276805fccc877f77e96374d317e87ae" +checksum = "10f78312288bd02052be5dbc2ecbc342c9f4eb791986d86c0a5c06b92dc72efa" dependencies = [ "thiserror", ] [[package]] name = "gix-chunk" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45c8751169961ba7640b513c3b24af61aa962c967aaf04116734975cd5af0c52" +checksum = "6c28b58ba04f0c004722344390af9dbc85888fbb84be1981afb934da4114d4cf" dependencies = [ "thiserror", ] [[package]] name = "gix-command" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff2e692b36bbcf09286c70803006ca3fd56551a311de450be317a0ab8ea92e7" +checksum = "c201d2b9e9cce2365a6638fd0a966f751ed92d74be5c0727ac331e6a29ef5846" dependencies = [ "bstr", "gix-path", @@ -1331,9 +1334,9 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.24.3" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "133b06f67f565836ec0c473e2116a60fb74f80b6435e21d88013ac0e3c60fc78" +checksum = "41db900b189e62dc61575f06fdf1a3b6901d264a99be9d32b286af6b2e3984e1" dependencies = [ "bstr", "gix-chunk", @@ -1345,9 +1348,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.40.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78e797487e6ca3552491de1131b4f72202f282fb33f198b1c34406d765b42bb0" +checksum = "0bedd1bf1c7b994be9d57207e8e0de79016c05e2e8701d3015da906e65ac445e" dependencies = [ "bstr", "gix-config-value", @@ -1366,9 +1369,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.8" +version = "0.14.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03f76169faa0dec598eac60f83d7fcdd739ec16596eca8fb144c88973dbe6f8c" +checksum = "f3de3fdca9c75fa4b83a76583d265fa49b1de6b088ebcd210749c24ceeb74660" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1379,9 +1382,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.24.5" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce391d305968782f1ae301c4a3d42c5701df7ff1d8bc03740300f6fd12bce78" +checksum = "d713bac4bf7df5801012285366dae6625d675baec4ba6e443d64e83559bec068" dependencies = [ "bstr", "gix-command", @@ -1396,9 +1399,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c84b7af01e68daf7a6bb8bb909c1ff5edb3ce4326f1f43063a5a96d3c3c8a5" +checksum = "d10d543ac13c97292a15e8e8b7889cd006faf739777437ed95362504b8fe81a0" dependencies = [ "bstr", "itoa", @@ -1408,9 +1411,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.46.0" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92c9afd80fff00f8b38b1c1928442feb4cd6d2232a6ed806b6b193151a3d336c" +checksum = "c9850fd0c15af113db6f9e130d13091ba0d3754e570a2afdff9e2f3043da260e" dependencies = [ "bstr", "gix-hash", @@ -1420,9 +1423,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0577366b9567376bc26e815fd74451ebd0e6218814e242f8e5b7072c58d956d2" +checksum = "c522e31f458f50af09dfb014e10873c5378f702f8049c96f508989aad59671f6" dependencies = [ "bstr", "dunce", @@ -1436,9 +1439,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.38.2" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac7045ac9fe5f9c727f38799d002a7ed3583cd777e3322a7c4b43e3cf437dc69" +checksum = "8e0eb9efdf96c35c0bed7596d1bef2d4ce6360a1d09738001f9d3e402aa7ba3e" dependencies = [ "bytes", "bytesize", @@ -1460,9 +1463,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4121790ae140066e5b953becc72e7496278138d19239be2e63b5067b0843119e" +checksum = "6b37f82359a4485770ed8993ae715ced1bf674f2a63e45f5a0786d38310665ea" dependencies = [ "bstr", "encoding_rs", @@ -1481,9 +1484,9 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.11.3" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2bfe6249cfea6d0c0e0990d5226a4cb36f030444ba9e35e0639275db8f98575" +checksum = "34740384d8d763975858fa2c176b68652a6fcc09f616e24e3ce967b0d370e4d8" dependencies = [ "fastrand", "gix-features", @@ -1492,9 +1495,9 @@ dependencies = [ [[package]] name = "gix-glob" -version = "0.16.5" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74908b4bbc0a0a40852737e5d7889f676f081e340d5451a16e5b4c50d592f111" +checksum = "254b5101cf7facc00d9b5ff564cf46302ca76695cca23d33bc958a707b6fc857" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1504,9 +1507,9 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.14.2" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93d7df7366121b5018f947a04d37f034717e113dcf9ccd85c34b58e57a74d5e" +checksum = "952c3a29f1bc1007cc901abce7479943abfa42016db089de33d0a4fa3c85bfe8" dependencies = [ "faster-hex", "thiserror", @@ -1514,9 +1517,9 @@ dependencies = [ [[package]] name = "gix-hashtable" -version = "0.5.2" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ddf80e16f3c19ac06ce415a38b8591993d3f73aede049cb561becb5b3a8e242" +checksum = "0ef65b256631078ef733bc5530c4e6b1c2e7d5c2830b75d4e9034ab3997d18fe" dependencies = [ "gix-hash", "hashbrown 0.14.5", @@ -1525,9 +1528,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.11.4" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e447cd96598460f5906a0f6c75e950a39f98c2705fc755ad2f2020c9e937fab7" +checksum = "ba55a9b582dc26a639875497615959a8127ac5c37b2426dc50f037fada33a4b7" dependencies = [ "bstr", "gix-glob", @@ -1538,9 +1541,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.35.0" +version = "0.36.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cd4203244444017682176e65fd0180be9298e58ed90bd4a8489a357795ed22d" +checksum = "27619009ca1ea33fd885041273f5fa5a09163a5c1d22a913b28d7b985e66fe29" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1566,9 +1569,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "14.0.0" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bc7fe297f1f4614774989c00ec8b1add59571dc9b024b4c00acb7dedd4e19d" +checksum = "5102acdf4acae2644e38dbbd18cdfba9597a218f7d85f810fe5430207e03c2de" dependencies = [ "gix-tempfile", "gix-utils", @@ -1577,9 +1580,9 @@ dependencies = [ [[package]] name = "gix-negotiate" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4063bf329a191a9e24b6f948a17ccf6698c0380297f5e169cee4f1d2ab9475b" +checksum = "414806291838c3349ea939c6d840ff854f84cd29bd3dde8f904f60b0e5b7d0bd" dependencies = [ "bitflags 2.6.0", "gix-commitgraph", @@ -1593,15 +1596,16 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.44.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f5b801834f1de7640731820c2df6ba88d95480dc4ab166a5882f8ff12b88efa" +checksum = "2a77b6e7753d298553d9ae8b1744924481e7a49170983938bb578dccfbc6fc1a" dependencies = [ "bstr", "gix-actor", "gix-date", "gix-features", "gix-hash", + "gix-hashtable", "gix-utils", "gix-validate", "itoa", @@ -1612,15 +1616,16 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.63.0" +version = "0.64.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3158068701c17df54f0ab2adda527f5a6aca38fd5fd80ceb7e3c0a2717ec747" +checksum = "0bb86aadf7f1b2f980601b4fc94309706f9700f8008f935dc512d556c9e60f61" dependencies = [ "arc-swap", "gix-date", "gix-features", "gix-fs", "gix-hash", + "gix-hashtable", "gix-object", "gix-pack", "gix-path", @@ -1632,9 +1637,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.53.0" +version = "0.54.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3223aa342eee21e1e0e403cad8ae9caf9edca55ef84c347738d10681676fd954" +checksum = "363e6e59a855ba243672408139db68e2478126cdcfeabb420777df4a1f20026b" dependencies = [ "clru", "gix-chunk", @@ -1653,9 +1658,9 @@ dependencies = [ [[package]] name = "gix-packetline" -version = "0.17.6" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c43ef4d5fe2fa222c606731c8bdbf4481413ee4ef46d61340ec39e4df4c5e49" +checksum = "5f14a110eb16e27b4ebdae4ca8b389df3ad637d3020077e6b606b1d078745b65" dependencies = [ "bstr", "faster-hex", @@ -1665,9 +1670,9 @@ dependencies = [ [[package]] name = "gix-packetline-blocking" -version = "0.17.5" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9802304baa798dd6f5ff8008a2b6516d54b74a69ca2d3a2b9e2d6c3b5556b40" +checksum = "decace940e8ba8e29d29b73b843a6cbae67503887f3e5fb7e688d0f4f6ee0757" dependencies = [ "bstr", "faster-hex", @@ -1677,9 +1682,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.11" +version = "0.10.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebfc4febd088abdcbc9f1246896e57e37b7a34f6909840045a1767c6dafac7af" +checksum = "c04e5a94fdb56b1e91eb7df2658ad16832428b8eeda24ff1a0f0288de2bce554" dependencies = [ "bstr", "gix-trace", @@ -1690,9 +1695,9 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.7.7" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d23bf239532b4414d0e63b8ab3a65481881f7237ed9647bb10c1e3cc54c5ceb" +checksum = "70f02bf7625dbf15bf9fedbeace2ac1ce1c5177806bdbc24c441d664c75c00e4" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1705,9 +1710,9 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74fde865cdb46b30d8dad1293385d9bcf998d3a39cbf41bee67d0dab026fe6b1" +checksum = "57944bbdb87f7a9893907032276e99ff4eba3640d8db1bdfb1eba8c07edfd006" dependencies = [ "gix-command", "gix-config-value", @@ -1718,9 +1723,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.45.3" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc43a1006f01b5efee22a003928c9eb83dde2f52779ded9d4c0732ad93164e3e" +checksum = "ac4ebf25f20ac6055728eaa80951acf2cf83948a64af6565b98e7d42b1ab6691" dependencies = [ "bstr", "gix-credentials", @@ -1736,9 +1741,9 @@ dependencies = [ [[package]] name = "gix-quote" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbff4f9b9ea3fa7a25a70ee62f545143abef624ac6aa5884344e70c8b0a1d9ff" +checksum = "f89f9a1525dcfd9639e282ea939f5ab0d09d93cf2b90c1fc6104f1b9582a8e49" dependencies = [ "bstr", "gix-utils", @@ -1747,9 +1752,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.47.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae0d8406ebf9aaa91f55a57f053c5a1ad1a39f60fdf0303142b7be7ea44311e5" +checksum = "a47385e71fa2d9da8c35e642ef4648808ddf0a52bc93425879088c706dfeaea2" dependencies = [ "gix-actor", "gix-features", @@ -1768,9 +1773,9 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebb005f82341ba67615ffdd9f7742c87787544441c88090878393d0682869ca6" +checksum = "0022038a09d80d9abf773be8efcbb502868d97f6972b8633bfb52ab6edaac442" dependencies = [ "bstr", "gix-hash", @@ -1782,11 +1787,12 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba4621b219ac0cdb9256883030c3d56a6c64a6deaa829a92da73b9a576825e1e" +checksum = "4ee8eb4088fece3562af4a5d751e069f90e93345524ad730512185234c4b55f1" dependencies = [ "bstr", + "gix-commitgraph", "gix-date", "gix-hash", "gix-object", @@ -1796,9 +1802,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b41e72544b93084ee682ef3d5b31b1ba4d8fa27a017482900e5e044d5b1b3984" +checksum = "e6c9a9496da98d36ff19063a8576bf09a87425583b709a56dc5594fffa9d39b2" dependencies = [ "gix-commitgraph", "gix-date", @@ -1811,9 +1817,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fe4d52f30a737bbece5276fab5d3a8b276dc2650df963e293d0673be34e7a5f" +checksum = "a2007538eda296445c07949cf04f4a767307d887184d6b3e83e2d636533ddc6e" dependencies = [ "bitflags 2.6.0", "gix-path", @@ -1823,9 +1829,9 @@ dependencies = [ [[package]] name = "gix-submodule" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "529d0af78cc2f372b3218f15eb1e3d1635a21c8937c12e2dd0b6fc80c2ca874b" +checksum = "3ed099621873cd36c580fc822176a32a7e50fef15a5c2ed81aaa087296f0497a" dependencies = [ "bstr", "gix-config", @@ -1838,9 +1844,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "14.0.2" +version = "15.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046b4927969fa816a150a0cda2e62c80016fe11fb3c3184e4dddf4e542f108aa" +checksum = "2feb86ef094cc77a4a9a5afbfe5de626897351bbbd0de3cb9314baf3049adb82" dependencies = [ "gix-fs", "libc", @@ -1851,15 +1857,15 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cae0e8661c3ff92688ce1c8b8058b3efb312aba9492bbe93661a21705ab431b" +checksum = "04bdde120c29f1fc23a24d3e115aeeea3d60d8e65bab92cc5f9d90d9302eb952" [[package]] name = "gix-transport" -version = "0.42.3" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "421dcccab01b41a15d97b226ad97a8f9262295044e34fbd37b10e493b0a6481f" +checksum = "4c485a345f41b8c0256cb86e95ed93e0692d203fd6c769b0433f7352c13608ad" dependencies = [ "base64", "bstr", @@ -1876,9 +1882,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.41.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030da39af94e4df35472e9318228f36530989327906f38e27807df305fccb780" +checksum = "f20f1b13cc4fa6ba92b24e6aa0c2fb6a34beb4458ef88c6300212db504e818df" dependencies = [ "bitflags 2.6.0", "gix-commitgraph", @@ -1893,23 +1899,22 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.27.5" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd280c5e84fb22e128ed2a053a0daeacb6379469be6a85e3d518a0636e160c89" +checksum = "33e7c297c3265015c133a2c02199610b6e1373a09dc4be057d0c1b5285737f06" dependencies = [ "bstr", "gix-features", "gix-path", - "home", "thiserror", "url", ] [[package]] name = "gix-utils" -version = "0.1.12" +version = "0.1.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35192df7fd0fa112263bad8021e2df7167df4cc2a6e6d15892e1e55621d3d4dc" +checksum = "ba427e3e9599508ed98a6ddf8ed05493db114564e338e41f6a996d2e4790335f" dependencies = [ "fastrand", "unicode-normalization", @@ -1917,9 +1922,9 @@ dependencies = [ [[package]] name = "gix-validate" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81f2badbb64e57b404593ee26b752c26991910fd0d81fe6f9a71c1a8309b6c86" +checksum = "e187b263461bc36cea17650141567753bc6207d036cedd1de6e81a52f277ff68" dependencies = [ "bstr", "thiserror", @@ -1927,9 +1932,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c312ad76a3f2ba8e865b360d5cb3aa04660971d16dec6dd0ce717938d903149a" +checksum = "0d345e5b523550fe4fa0e912bf957de752011ccfc87451968fda1b624318f29c" dependencies = [ "bstr", "gix-attributes", @@ -1946,9 +1951,9 @@ dependencies = [ [[package]] name = "gix-worktree-state" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b05c4b313fa702c0bacd5068dd3e01671da73b938fade97676859fee286de43" +checksum = "5e72b00e02f3bd737caae9c20a98e70749f42ae18c8f0b68aac3210b42a0b8da" dependencies = [ "bstr", "gix-features", @@ -2496,9 +2501,9 @@ dependencies = [ [[package]] name = "libz-ng-sys" -version = "1.1.16" +version = "1.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4436751a01da56f1277f323c80d584ffad94a3d14aecd959dd0dff75aa73a438" +checksum = "8f0f7295a34685977acb2e8cc8b08ee4a8dffd6cf278eeccddbe1ed55ba815d5" dependencies = [ "cmake", "libc", @@ -2826,9 +2831,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.3.2+3.3.2" +version = "300.4.0+3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a211a18d945ef7e648cc6e0058f4c548ee46aab922ea203e0d30e966ea23647b" +checksum = "a709e02f2b4aca747929cca5ed248880847c650233cf8b8cdc48f40aaf4898a6" dependencies = [ "cc", ] @@ -2907,18 +2912,18 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf123a161dde1e524adf36f90bc5d8d3462824a9c43553ad07a8183161189ec" +checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.6" +version = "1.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4502d8515ca9f32f1fb543d987f63d95a14934883db45bdb48060b6b69257f8" +checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", @@ -2927,9 +2932,9 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" [[package]] name = "pin-utils" @@ -2960,21 +2965,23 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.88" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c3a7fc5db1e57d5a779a352c8cdb57b29aa4c40cc69c3a68a7fedc815fbf2f9" +checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" dependencies = [ "unicode-ident", ] [[package]] name = "prodash" -version = "28.0.0" +version = "29.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744a264d26b88a6a7e37cbad97953fa233b94d585236310bcbc88474b4092d79" +checksum = "a266d8d6020c61a437be704c5e618037588e1985c7dbb7bf8d265db84cffe325" dependencies = [ "bytesize", "human_format", + "log", + "parking_lot", ] [[package]] @@ -3113,9 +3120,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -3379,9 +3386,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" +checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" dependencies = [ "serde_derive", ] @@ -3397,9 +3404,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.210" +version = "1.0.213" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" +checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" dependencies = [ "proc-macro2", "quote", @@ -3408,9 +3415,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.129" +version = "1.0.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dbcf9b78a125ee667ae19388837dd12294b858d101fdd393cb9d5501ef09eb2" +checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" dependencies = [ "itoa", "memchr", @@ -3509,9 +3516,9 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb3285e97855c860e0cacb651191433bbea700b396a480ade2e82ff532c2d60f" +checksum = "cbaf0ff266d8adc1ee59f9c64669f73a4f8b88e87c0ab15db4da5c603a95b2c3" dependencies = [ "compact_str", "derive_destructure2", @@ -3618,9 +3625,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.79" +version = "2.0.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" +checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" dependencies = [ "proc-macro2", "quote", @@ -3720,18 +3727,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" +checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.64" +version = "1.0.65" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" +checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" dependencies = [ "proc-macro2", "quote", @@ -3798,9 +3805,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.40.0" +version = "1.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" +checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" dependencies = [ "backtrace", "bytes", From afd20e939679522c9a9c066f7e75607f45e1d053 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 26 Oct 2024 01:49:47 +0000 Subject: [PATCH 1895/2020] chore: release (#1937) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 4 ++-- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- 10 files changed, 36 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 694b8dff..21755f56 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -252,7 +252,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.8" +version = "0.28.9" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -376,7 +376,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.5" +version = "0.15.6" dependencies = [ "beef", "binstalk-types", @@ -856,7 +856,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.24" +version = "0.1.25" dependencies = [ "cfg-if", "guess_host_triple", @@ -868,7 +868,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.7" +version = "1.0.8" dependencies = [ "tempfile", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index fd9a7148..e8b1e421 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,8 +22,8 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.28.8", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.5" } +binstalk = { path = "../binstalk", version = "0.28.9", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.6" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index aecc8b37..7b7c0278 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.6](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.5...binstalk-manifests-v0.15.6) - 2024-10-25 + +### Other + +- updated the following local packages: detect-targets + ## [0.15.5](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.4...binstalk-manifests-v0.15.5) - 2024-10-12 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index e790a20d..264cf60f 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.5" +version = "0.15.6" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.24", path = "../detect-targets" } +detect-targets = { version = "0.1.25", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index 07afb869..704cee92 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.9](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.8...binstalk-v0.28.9) - 2024-10-25 + +### Other + +- updated the following local packages: detect-targets + ## [0.28.8](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.7...binstalk-v0.28.8) - 2024-10-12 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 15c228ef..f77b97d3 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.8" +version = "0.28.9" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -21,7 +21,7 @@ binstalk-types = { version = "0.9.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.1", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.24", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.25", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index a11806e5..fe00e652 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.25](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.24...detect-targets-v0.1.25) - 2024-10-25 + +### Other + +- update Cargo.lock dependencies + ## [0.1.24](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.23...detect-targets-v0.1.24) - 2024-10-12 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index c7af498f..ac72f81a 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.24" +version = "0.1.25" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index 24a6d716..c8f2c349 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.8](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.7...detect-wasi-v1.0.8) - 2024-10-25 + +### Other + +- update Cargo.lock dependencies + ## [1.0.7](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.6...detect-wasi-v1.0.7) - 2024-10-12 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index e4531d35..a8fd4b19 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.7" +version = "1.0.8" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From c16790a16f5a52a999b3e7caa2c805aac3bad99c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 26 Oct 2024 02:51:55 +0000 Subject: [PATCH 1896/2020] release: cargo-binstall v1.10.9 (#1941) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 21755f56..a6f6e2ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -557,7 +557,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.8" +version = "1.10.9" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index e8b1e421..17958137 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.8" +version = "1.10.9" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 3e383922..c8528a53 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From e704abe7ac3bd292101729ed57cdfe5bb1f7295a Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Wed, 30 Oct 2024 10:16:54 +1000 Subject: [PATCH 1897/2020] Use rc-zip-sync for zip extraction (#1942) * Use rc-zip-sync for zip extraction Fixed #1080 In this commit, binstalk-downloader is updated to - first download the zip into a temporary file, since there is no correct way to extract zip from a stream. - then use rc-zip-sync to read from the zip and extract it to filesystem. Signed-off-by: Jiahao XU * Fix returned `ExtractedFiles` in `do_extract_zip` Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix clippy in zip_extraction.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- Cargo.lock | 383 +++++++++++++++--- crates/binstalk-downloader/Cargo.toml | 17 +- crates/binstalk-downloader/src/download.rs | 2 +- .../src/download/async_extracter.rs | 73 ++-- .../src/download/zip_extraction.rs | 258 +++--------- 5 files changed, 406 insertions(+), 327 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a6f6e2ff..b2948b45 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -11,6 +11,12 @@ dependencies = [ "gimli", ] +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "adler2" version = "2.0.0" @@ -59,6 +65,21 @@ version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anstream" version = "0.6.17" @@ -134,10 +155,8 @@ checksum = "0cb8f1d480b0ea3783ab015936d2a55c87e219676f0c0b7dec61494043f21857" dependencies = [ "brotli", "bzip2", - "deflate64", "flate2", "futures-core", - "futures-io", "memchr", "pin-project-lite", "tokio", @@ -168,21 +187,6 @@ dependencies = [ "syn", ] -[[package]] -name = "async_zip" -version = "0.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b9f7252833d5ed4b00aa9604b563529dd5e11de9c23615de2dcdf91eb87b52" -dependencies = [ - "async-compression", - "crc32fast", - "futures-lite", - "pin-project", - "thiserror", - "tokio", - "tokio-util", -] - [[package]] name = "atomic-file-install" version = "1.0.5" @@ -214,7 +218,7 @@ dependencies = [ "addr2line", "cfg-if", "libc", - "miniz_oxide", + "miniz_oxide 0.8.0", "object", "rustc-demangle", "windows-targets 0.52.6", @@ -302,11 +306,11 @@ version = "0.13.1" dependencies = [ "async-compression", "async-trait", - "async_zip", "binstalk-types", "binstall-tar", "bytes", "bzip2", + "cfg-if", "compact_str", "default-net", "flate2", @@ -317,6 +321,7 @@ dependencies = [ "ipconfig", "native-tls", "once_cell", + "rc-zip-sync", "reqwest", "serde", "serde_json", @@ -658,6 +663,31 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "chardetng" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14b8f0b65b7b08ae3c8187e8d77174de20cb6777864c6b832d8ad365999cf1ea" +dependencies = [ + "cfg-if", + "encoding_rs", + "memchr", +] + +[[package]] +name = "chrono" +version = "0.4.38" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets 0.52.6", +] + [[package]] name = "clap" version = "4.5.20" @@ -771,6 +801,21 @@ dependencies = [ "libc", ] +[[package]] +name = "crc" +version = "3.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69e6e4d7b33a94f0991c26729976b10ebde1d34c3ee82408fb536164fa10d636" +dependencies = [ + "crc-catalog", +] + +[[package]] +name = "crc-catalog" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" + [[package]] name = "crc32fast" version = "1.4.2" @@ -1040,7 +1085,7 @@ checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", "libz-ng-sys", - "miniz_oxide", + "miniz_oxide 0.8.0", ] [[package]] @@ -1138,19 +1183,6 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" -[[package]] -name = "futures-lite" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52527eb5074e35e9339c6b4e8d12600c7128b68fb25dcb9fa9dec18f7c25f3a5" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - [[package]] name = "futures-macro" version = "0.3.31" @@ -1282,7 +1314,7 @@ dependencies = [ "gix-utils", "itoa", "thiserror", - "winnow", + "winnow 0.6.20", ] [[package]] @@ -1364,7 +1396,7 @@ dependencies = [ "smallvec", "thiserror", "unicode-bom", - "winnow", + "winnow 0.6.20", ] [[package]] @@ -1611,7 +1643,7 @@ dependencies = [ "itoa", "smallvec", "thiserror", - "winnow", + "winnow 0.6.20", ] [[package]] @@ -1736,7 +1768,7 @@ dependencies = [ "gix-utils", "maybe-async", "thiserror", - "winnow", + "winnow 0.6.20", ] [[package]] @@ -1768,7 +1800,7 @@ dependencies = [ "gix-validate", "memmap2", "thiserror", - "winnow", + "winnow 0.6.20", ] [[package]] @@ -2302,6 +2334,29 @@ dependencies = [ "tracing", ] +[[package]] +name = "iana-time-zone" +version = "0.1.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core 0.52.0", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + [[package]] name = "idna" version = "0.5.0" @@ -2546,6 +2601,16 @@ dependencies = [ "linked-hash-map", ] +[[package]] +name = "lzma-rs" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "297e814c836ae64db86b36cf2a557ba54368d03f6afcd7d947c266692f71115e" +dependencies = [ + "byteorder", + "crc", +] + [[package]] name = "lzma-sys" version = "0.1.20" @@ -2656,6 +2721,15 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a05b5d0594e0cb1ad8cee3373018d2b84e25905dc75b2468114cc9a8e86cfc20" +[[package]] +name = "miniz_oxide" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +dependencies = [ + "adler", +] + [[package]] name = "miniz_oxide" version = "0.8.0" @@ -2773,6 +2847,36 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_enum" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e613fc340b2220f734a8595782c551f1250e969d87d3be1ae0579e8d4065179" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "num_threads" version = "0.1.7" @@ -2791,6 +2895,18 @@ dependencies = [ "memchr", ] +[[package]] +name = "oem_cp" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "330138902ab4dab09a86e6b7ab7ddeffb5f8435d52fe0df1bce8b06a17b10ee4" +dependencies = [ + "phf", + "phf_codegen", + "serde", + "serde_json", +] + [[package]] name = "once_cell" version = "1.20.2" @@ -2857,24 +2973,45 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "oval" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "135cef32720c6746450d910890b0b69bcba2bbf6f85c9f4583df13fe415de828" + [[package]] name = "overload" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" +[[package]] +name = "ownable" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcba94d1536fcc470287d96fd26356c38da8215fdb9a74285b09621f35d9350" +dependencies = [ + "ownable-macro", +] + +[[package]] +name = "ownable-macro" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2c91d2781624dec1234581a1a01e63638f36546ad72ee82873ac1b84f41117b" +dependencies = [ + "proc-macro-error", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "owo-colors" version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" -[[package]] -name = "parking" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" - [[package]] name = "parking_lot" version = "0.12.3" @@ -2911,23 +3048,41 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] -name = "pin-project" -version = "1.1.7" +name = "phf" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" dependencies = [ - "pin-project-internal", + "phf_shared", ] [[package]] -name = "pin-project-internal" -version = "1.1.7" +name = "phf_codegen" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" dependencies = [ - "proc-macro2", - "quote", - "syn", + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", ] [[package]] @@ -2948,6 +3103,17 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +[[package]] +name = "positioned-io" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccabfeeb89c73adf4081f0dca7f8e28dbda90981a222ceea37f619e93ea6afe9" +dependencies = [ + "byteorder", + "libc", + "winapi", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -2963,6 +3129,38 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "proc-macro-crate" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +dependencies = [ + "toml_edit", +] + +[[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", + "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", +] + [[package]] name = "proc-macro2" version = "1.0.89" @@ -3078,6 +3276,42 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rc-zip" +version = "5.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14e24471baa77d6e0e8be04c7d62d5e3c3454e7f1863ed7d74faddd6e4786007" +dependencies = [ + "bzip2", + "chardetng", + "chrono", + "crc32fast", + "deflate64", + "encoding_rs", + "lzma-rs", + "miniz_oxide 0.7.4", + "num_enum", + "oem_cp", + "oval", + "ownable", + "thiserror", + "tracing", + "winnow 0.5.40", + "zstd", +] + +[[package]] +name = "rc-zip-sync" +version = "4.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdebaff0e109a140208ab5ffbbe4862aada391d94456cbf7887757f3078a328b" +dependencies = [ + "oval", + "positioned-io", + "rc-zip", + "tracing", +] + [[package]] name = "redox_syscall" version = "0.3.5" @@ -3251,9 +3485,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.37" +version = "0.38.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" +checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" dependencies = [ "bitflags 2.6.0", "errno 0.3.9", @@ -3264,9 +3498,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.15" +version = "0.23.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fbb44d7acc4e873d613422379f69f237a1b141928c02f6bc6ccfddddc2d7993" +checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" dependencies = [ "log", "once_cell", @@ -3528,6 +3762,12 @@ dependencies = [ "tracing", ] +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + [[package]] name = "slab" version = "0.4.9" @@ -3886,7 +4126,6 @@ checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", - "futures-io", "futures-sink", "pin-project-lite", "tokio", @@ -3923,7 +4162,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow", + "winnow 0.6.20", ] [[package]] @@ -4234,9 +4473,9 @@ checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" [[package]] name = "wasm-streams" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e072d4e72f700fb3443d8fe94a39315df013eef1104903cdb0a2abd322bbecd" +checksum = "15053d8d85c7eccdbefef60f06769760a563c7f0a9d6902a13d35c7800b0ad65" dependencies = [ "futures-util", "js-sys", @@ -4316,7 +4555,16 @@ version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd04d41d93c4992d421894c18c8b43496aa748dd4c081bac0dc93eb0489272b6" dependencies = [ - "windows-core", + "windows-core 0.58.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ "windows-targets 0.52.6", ] @@ -4533,6 +4781,15 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + [[package]] name = "winnow" version = "0.6.20" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 05a8e52d..73e58948 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -18,23 +18,22 @@ async-compression = { version = "0.4.4", features = [ "bzip2", "tokio", ] } -async_zip = { version = "0.0.17", features = [ - "deflate", - "deflate64", - "bzip2", - "lzma", - "zstd", - "xz", - "tokio", -] } binstalk-types = { version = "0.9.0", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" +cfg-if = "1" compact_str = "0.8.0" flate2 = { version = "1.0.28", default-features = false } futures-util = "0.3.30" futures-io = "0.3.30" httpdate = "1.0.2" +rc-zip-sync = { version = "4.2.3", features = [ + "deflate", + "bzip2", + "deflate64", + "lzma", + "zstd", +] } reqwest = { version = "0.12.5", features = [ "http2", "stream", diff --git a/crates/binstalk-downloader/src/download.rs b/crates/binstalk-downloader/src/download.rs index bfbd21f0..78943730 100644 --- a/crates/binstalk-downloader/src/download.rs +++ b/crates/binstalk-downloader/src/download.rs @@ -7,6 +7,7 @@ use thiserror::Error as ThisError; use tracing::{debug, error, instrument}; pub use binstalk_types::cargo_toml_binstall::{PkgFmt, TarBasedFmt}; +pub use rc_zip_sync::rc_zip::error::Error as ZipError; use crate::remote::{Client, Error as RemoteError, Response, Url}; @@ -23,7 +24,6 @@ mod extracted_files; pub use extracted_files::{ExtractedFiles, ExtractedFilesEntry}; mod zip_extraction; -pub use zip_extraction::ZipError; #[derive(Debug, ThisError)] #[non_exhaustive] diff --git a/crates/binstalk-downloader/src/download/async_extracter.rs b/crates/binstalk-downloader/src/download/async_extracter.rs index 6add5830..ca2f0710 100644 --- a/crates/binstalk-downloader/src/download/async_extracter.rs +++ b/crates/binstalk-downloader/src/download/async_extracter.rs @@ -6,18 +6,17 @@ use std::{ path::{Component, Path, PathBuf}, }; -use async_zip::base::read::stream::ZipFileReader; -use bytes::{Bytes, BytesMut}; +use bytes::Bytes; use futures_util::Stream; +use tempfile::tempfile as create_tmpfile; use tokio::sync::mpsc; -use tokio_util::io::StreamReader; use tracing::debug; -use super::{ - extracter::*, zip_extraction::extract_zip_entry, DownloadError, ExtractedFiles, TarBasedFmt, - ZipError, +use super::{extracter::*, DownloadError, ExtractedFiles, TarBasedFmt}; +use crate::{ + download::zip_extraction::do_extract_zip, + utils::{extract_with_blocking_task, StreamReadable}, }; -use crate::utils::{extract_with_blocking_task, StreamReadable}; pub async fn extract_bin(stream: S, path: &Path) -> Result where @@ -25,52 +24,30 @@ where { debug!("Writing to `{}`", path.display()); - extract_with_blocking_decoder(stream, path, |mut rx, path| { - let mut file = fs::File::create(path)?; + extract_with_blocking_decoder(stream, path, |rx, path| { + let mut extracted_files = ExtractedFiles::new(); - while let Some(bytes) = rx.blocking_recv() { - file.write_all(&bytes)?; - } + extracted_files.add_file(Path::new(path.file_name().unwrap())); - file.flush() + write_stream_to_file(rx, fs::File::create(path)?)?; + + Ok(extracted_files) }) - .await?; - - let mut extracted_files = ExtractedFiles::new(); - - extracted_files.add_file(Path::new(path.file_name().unwrap())); - - Ok(extracted_files) + .await } pub async fn extract_zip(stream: S, path: &Path) -> Result where S: Stream> + Unpin + Send + Sync, { - debug!("Decompressing from zip archive to `{}`", path.display()); + debug!("Downloading from zip archive to tempfile"); - let reader = StreamReader::new(stream); - let mut zip = ZipFileReader::with_tokio(reader); - let mut buf = BytesMut::with_capacity(4 * 4096); - let mut extracted_files = ExtractedFiles::new(); + extract_with_blocking_decoder(stream, path, |rx, path| { + debug!("Decompressing from zip archive to `{}`", path.display()); - while let Some(mut zip_reader) = zip.next_with_entry().await.map_err(ZipError::from_inner)? { - extract_zip_entry( - zip_reader.reader_mut(), - path, - &mut buf, - &mut extracted_files, - ) - .await?; - - // extract_zip_entry would read the zip_reader until read the file until - // eof unless extract_zip itself is cancelled or an error is raised. - // - // So calling done here should not raise any error. - zip = zip_reader.done().await.map_err(ZipError::from_inner)?; - } - - Ok(extracted_files) + do_extract_zip(write_stream_to_file(rx, create_tmpfile()?)?, path).map_err(io::Error::from) + }) + .await } pub async fn extract_tar_based_stream( @@ -176,3 +153,15 @@ where f(rx, &path) }) } + +fn write_stream_to_file(mut rx: mpsc::Receiver, f: fs::File) -> io::Result { + let mut f = io::BufWriter::new(f); + + while let Some(bytes) = rx.blocking_recv() { + f.write_all(&bytes)?; + } + + f.flush()?; + + f.into_inner().map_err(io::IntoInnerError::into_error) +} diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index 1cf028ad..0bdfc425 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -1,232 +1,66 @@ use std::{ - borrow::Cow, - io::Write, - path::{Component, Path, PathBuf}, + fs::{self, create_dir_all, File}, + io::{self, Read}, + path::Path, }; -use async_zip::{ - base::{read::WithEntry, read::ZipEntryReader}, - ZipString, -}; -use bytes::{Bytes, BytesMut}; -use futures_util::future::try_join; -use thiserror::Error as ThisError; -use tokio::{ - io::{AsyncRead, AsyncReadExt}, - sync::mpsc, -}; -use tokio_util::compat::FuturesAsyncReadCompatExt; +use cfg_if::cfg_if; +use rc_zip_sync::{rc_zip::parse::EntryKind, ReadZip}; use super::{DownloadError, ExtractedFiles}; -use crate::utils::asyncify; -#[derive(Debug, ThisError)] -enum ZipErrorInner { - #[error(transparent)] - Inner(#[from] async_zip::error::ZipError), +pub(super) fn do_extract_zip(f: File, dir: &Path) -> Result { + let mut extracted_files = ExtractedFiles::new(); - #[error("Invalid file path: {0}")] - InvalidFilePath(Box), -} + for entry in f.read_zip()?.entries() { + let Some(name) = entry.sanitized_name().map(Path::new) else { + continue; + }; + let path = dir.join(name); -#[derive(Debug, ThisError)] -#[error(transparent)] -pub struct ZipError(#[from] ZipErrorInner); + let do_extract_file = || { + let mut entry_writer = File::create(&path)?; + let mut entry_reader = entry.reader(); + io::copy(&mut entry_reader, &mut entry_writer)?; -impl ZipError { - pub(super) fn from_inner(err: async_zip::error::ZipError) -> Self { - Self(ZipErrorInner::Inner(err)) - } -} - -pub(super) async fn extract_zip_entry( - zip_reader: &mut ZipEntryReader<'_, R, WithEntry<'_>>, - path: &Path, - buf: &mut BytesMut, - extracted_files: &mut ExtractedFiles, -) -> Result<(), DownloadError> -where - R: futures_io::AsyncBufRead + Unpin + Send + Sync, -{ - // Sanitize filename - let raw_filename = zip_reader.entry().filename(); - let (filename, is_dir) = check_filename_and_normalize(raw_filename)?; - - // Calculates the outpath - let outpath = path.join(&filename); - - // Get permissions - #[cfg_attr(not(unix), allow(unused_mut))] - let mut perms = None; - - #[cfg(unix)] - { - use std::{fs::Permissions, os::unix::fs::PermissionsExt}; - - if let Some(mode) = zip_reader.entry().unix_permissions() { - // If it is a dir, then it needs to be at least rwx for the current - // user so that we can create new files, search for existing files - // and list its contents. - // - // If it is a file, then it needs to be at least readable for the - // current user. - let mode: u16 = mode | if is_dir { 0o700 } else { 0o400 }; - perms = Some(Permissions::from_mode(mode as u32)); - } - } - - if is_dir { - extracted_files.add_dir(&filename); - - // This entry is a dir. - asyncify(move || { - std::fs::create_dir_all(&outpath)?; - if let Some(perms) = perms { - std::fs::set_permissions(&outpath, perms)?; - } - - Ok(()) - }) - .await?; - } else { - extracted_files.add_file(&filename); - - // Use channel size = 5 to minimize the waiting time in the extraction task - let (tx, mut rx) = mpsc::channel::(5); - - // This entry is a file. - - let write_task = asyncify(move || { - if let Some(p) = outpath.parent() { - std::fs::create_dir_all(p)?; - } - let mut outfile = std::fs::File::create(&outpath)?; - - while let Some(bytes) = rx.blocking_recv() { - outfile.write_all(&bytes)?; - } - - outfile.flush()?; - - if let Some(perms) = perms { - outfile.set_permissions(perms)?; - } - - Ok(()) - }); - - let read_task = async move { - // Read everything into `tx` - copy_file_to_mpsc(zip_reader.compat(), tx, buf).await?; - // Check crc32 checksum. - // - // NOTE that since everything is alread read into the channel, - // this function should not read any byte into the `Vec` and - // should return `0`. - assert_eq!(zip_reader.read_to_end_checked(&mut Vec::new()).await?, 0); - Ok(()) + Ok::<_, io::Error>(()) }; - try_join( - async move { write_task.await.map_err(From::from) }, - async move { - read_task - .await - .map_err(ZipError::from_inner) - .map_err(DownloadError::from) - }, - ) - .await?; - } + let parent = path + .parent() + .expect("all full entry paths should have parent paths"); + create_dir_all(parent)?; - Ok(()) -} + match entry.kind() { + EntryKind::Symlink => { + extracted_files.add_file(name); + cfg_if! { + if #[cfg(windows)] { + do_extract_file()?; + } else { + match fs::symlink_metadata(&path) { + Ok(metadata) if metadata.is_file() => fs::remove_file(&path)?, + _ => (), + } -async fn copy_file_to_mpsc( - mut entry_reader: R, - tx: mpsc::Sender, - buf: &mut BytesMut, -) -> Result<(), async_zip::error::ZipError> -where - R: AsyncRead + Unpin + Send + Sync, -{ - // Since BytesMut does not have a max cap, if AsyncReadExt::read_buf returns - // 0 then it means Eof. - while entry_reader.read_buf(buf).await? != 0 { - // Ensure AsyncReadExt::read_buf can read at least 4096B to avoid - // frequent expensive read syscalls. - // - // Performs this reserve before sending the buf over mpsc queue to - // increase the possibility of reusing the previous allocation. - // - // NOTE: `BytesMut` only reuses the previous allocation if it is the - // only one holds the reference to it, which is either on the first - // iteration or all the `Bytes` in the mpsc queue has been consumed, - // written to the file and dropped. - // - // Since reading from entry would have to wait for external file I/O, - // this would give the blocking thread some time to flush `Bytes` - // out. - // - // If all `Bytes` are flushed out, then we can reuse the allocation here. - buf.reserve(4096); + let mut src = String::new(); + entry.reader().read_to_string(&mut src)?; - if tx.send(buf.split().freeze()).await.is_err() { - // Same reason as extract_with_blocking_decoder - break; - } - } - - Ok(()) -} - -/// Ensure the file path is safe to use as a [`Path`]. -/// -/// - It can't contain NULL bytes -/// - It can't resolve to a path outside the current directory -/// > `foo/../bar` is fine, `foo/../../bar` is not. -/// - It can't be an absolute path -/// -/// It will then return a normalized path. -/// -/// This will read well-formed ZIP files correctly, and is resistant -/// to path-based exploits. -/// -/// This function is adapted from `zip::ZipFile::enclosed_name`. -fn check_filename_and_normalize(filename: &ZipString) -> Result<(PathBuf, bool), DownloadError> { - let filename = filename - .as_str() - .map(Cow::Borrowed) - .unwrap_or_else(|_| String::from_utf8_lossy(filename.as_bytes())); - - let bail = |filename: Cow<'_, str>| { - Err(DownloadError::from(ZipError( - ZipErrorInner::InvalidFilePath(filename.into_owned().into()), - ))) - }; - - if filename.contains('\0') { - return bail(filename); - } - - let mut path = PathBuf::new(); - - // The following loop is adapted from - // `normalize_path::NormalizePath::normalize`. - for component in Path::new(&*filename).components() { - match component { - Component::Prefix(_) | Component::RootDir => return bail(filename), - Component::CurDir => (), - Component::ParentDir => { - if !path.pop() { - // `PathBuf::pop` returns false if there is no parent. - // which means the path is invalid. - return bail(filename); + // validate pointing path before creating a symbolic link + if src.contains("..") { + continue; + } + std::os::unix::fs::symlink(src, &path)?; + } } } - Component::Normal(c) => path.push(c), + EntryKind::Directory => (), + EntryKind::File => { + extracted_files.add_file(name); + do_extract_file()?; + } } } - Ok((path, filename.ends_with('/'))) + Ok(extracted_files) } From 81a8218794b046e15f7323d124e260fc50ed916a Mon Sep 17 00:00:00 2001 From: pepa65 Date: Wed, 30 Oct 2024 20:00:56 +0700 Subject: [PATCH 1898/2020] Yes/NO defaults to "no" when just enter is pressed (#1948) * yes/NO in interface * Implement No as default (when only Enter is pressed) * Update README.md Mark the default as [yes] Signed-off-by: pepa65 * Update ui.rs Mark the default as [yes] Signed-off-by: pepa65 * Update ui.rs Do not break on yes/y/YES/Y/"", break on no/n/NO/N, and keep asking otherwise Signed-off-by: pepa65 * Update ui.rs After testing empty didn't work correctly Signed-off-by: pepa65 --------- Signed-off-by: pepa65 --- README.md | 2 +- crates/bin/src/ui.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2a40466b..d8a49b50 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ $ cargo binstall radio-sx128x@0.14.1-alpha.5 WARN The package radio-sx128x v0.14.1-alpha.5 (x86_64-unknown-linux-gnu) has been downloaded from github.com INFO This will install the following binaries: INFO - sx128x-util (sx128x-util-x86_64-unknown-linux-gnu -> /home/.cargo/bin/sx128x-util) -Do you wish to continue? yes/[no] +Do you wish to continue? [yes]/no ? yes INFO Installing binaries... INFO Done in 2.838798298s diff --git a/crates/bin/src/ui.rs b/crates/bin/src/ui.rs index ff02d2ec..bcbb67e1 100644 --- a/crates/bin/src/ui.rs +++ b/crates/bin/src/ui.rs @@ -10,7 +10,7 @@ fn ask_for_confirm(stdin: &mut StdinLock, input: &mut String) -> io::Result<()> { let mut stdout = io::stdout().lock(); - write!(&mut stdout, "Do you wish to continue? yes/[no]\n? ")?; + write!(&mut stdout, "Do you wish to continue? [yes]/no\n? ")?; stdout.flush()?; } @@ -34,8 +34,8 @@ pub async fn confirm() -> Result<(), BinstallError> { } match input.as_str().trim() { - "yes" | "y" | "YES" | "Y" => break true, - "no" | "n" | "NO" | "N" | "" => break false, + "yes" | "y" | "YES" | "Y" | "" => break true, + "no" | "n" | "NO" | "N" => break false, _ => { input.clear(); continue; From 48f8cf9b864283fadefcc037bef75d6754553a05 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 07:23:52 +0000 Subject: [PATCH 1899/2020] dep: Upgrade transitive dependencies (#1949) Co-authored-by: github-actions --- Cargo.lock | 39 +++++++++++++++++++++++---------------- 1 file changed, 23 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b2948b45..7316a2d7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -663,6 +663,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chardetng" version = "0.1.17" @@ -2317,9 +2323,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.9" +version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" dependencies = [ "bytes", "futures-channel", @@ -3226,10 +3232,11 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.5" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fe68c2e9e1a1234e218683dbdf9f9dfcb094113c5ac2b938dfcb9bab4c4140b" +checksum = "e346e016eacfff12233c243718197ca12f148c84e1e84268a896699b41c71780" dependencies = [ + "cfg_aliases", "libc", "once_cell", "socket2", @@ -3383,9 +3390,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.8" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f713147fbe92361e52392c73b8c9e48c04c6625bce969ef54dc901e58e042a7b" +checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" dependencies = [ "async-compression", "base64", @@ -3620,9 +3627,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.213" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ea7893ff5e2466df8d720bb615088341b295f849602c6956047f8f80f0e9bc1" +checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" dependencies = [ "serde_derive", ] @@ -3638,9 +3645,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.213" +version = "1.0.214" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e85ad2009c50b58e87caa8cd6dac16bdf511bbfb7af6c33df902396aa480fa5" +checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" dependencies = [ "proc-macro2", "quote", @@ -3865,9 +3872,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.85" +version = "2.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5023162dfcd14ef8f32034d8bcd4cc5ddc61ef7a247c024a33e24e1f24d21b56" +checksum = "e89275301d38033efb81a6e60e3497e734dfcc62571f2854bf4b16690398824c" dependencies = [ "proc-macro2", "quote", @@ -3967,18 +3974,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.65" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d11abd9594d9b38965ef50805c5e469ca9cc6f197f883f717e0269a3057b3d5" +checksum = "5d171f59dbaa811dbbb1aee1e73db92ec2b122911a48e1390dfe327a821ddede" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.65" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae71770322cbd277e69d762a16c444af02aa0575ac0d174f0b9562d3b37f8602" +checksum = "b08be0f17bd307950653ce45db00cd31200d82b624b36e181337d9c7d92765b5" dependencies = [ "proc-macro2", "quote", From a944df0498fcecac915e06864c1445f7b890cdeb Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 2 Nov 2024 10:52:37 +1000 Subject: [PATCH 1900/2020] Improve UI orompt for installation (#1950) Fixed #1943 The UI now looks like ``` WARN The package cargo-binstall v1.10.9 (aarch64-apple-darwin) has been downloaded from github.com INFO This will install the following binaries: INFO - cargo-binstall => /tmp/e/bin/cargo-binstall ```` Signed-off-by: Jiahao XU --- crates/binstalk-bins/src/lib.rs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/crates/binstalk-bins/src/lib.rs b/crates/binstalk-bins/src/lib.rs index 2b99ad64..15f92a25 100644 --- a/crates/binstalk-bins/src/lib.rs +++ b/crates/binstalk-bins/src/lib.rs @@ -180,9 +180,19 @@ impl BinFile { } pub fn preview_bin(&self) -> impl fmt::Display + '_ { - LazyFormat { + struct PreviewBin<'a> { + base_name: &'a str, + dest: path::Display<'a>, + } + + impl fmt::Display for PreviewBin<'_> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "{} => {}", self.base_name, self.dest) + } + } + + PreviewBin { base_name: &self.base_name, - source: Path::new(self.source.file_name().unwrap()).display(), dest: self.dest.display(), } } From 8644e54e84439ad4450cd24e518af5f44388237a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 2 Nov 2024 01:25:13 +0000 Subject: [PATCH 1901/2020] chore: release (#1944) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 18 +++++++++--------- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-bins/CHANGELOG.md | 6 ++++++ crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-downloader/CHANGELOG.md | 6 ++++++ crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/CHANGELOG.md | 6 ++++++ crates/binstalk-fetchers/Cargo.toml | 8 ++++---- crates/binstalk-git-repo-api/CHANGELOG.md | 6 ++++++ crates/binstalk-git-repo-api/Cargo.toml | 6 +++--- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk-registry/CHANGELOG.md | 6 ++++++ crates/binstalk-registry/Cargo.toml | 6 +++--- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 14 +++++++------- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- 20 files changed, 88 insertions(+), 34 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7316a2d7..4f5fd151 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -256,7 +256,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.9" +version = "0.28.10" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -288,7 +288,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.6.0" +version = "0.6.1" dependencies = [ "atomic-file-install", "binstalk-types", @@ -302,7 +302,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.13.1" +version = "0.13.2" dependencies = [ "async-compression", "async-trait", @@ -338,7 +338,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.10.1" +version = "0.10.2" dependencies = [ "async-trait", "binstalk-downloader", @@ -362,7 +362,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.3" +version = "0.5.4" dependencies = [ "binstalk-downloader", "compact_str", @@ -381,7 +381,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.6" +version = "0.15.7" dependencies = [ "beef", "binstalk-types", @@ -402,7 +402,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.11.1" +version = "0.11.2" dependencies = [ "async-trait", "base16", @@ -907,7 +907,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.25" +version = "0.1.26" dependencies = [ "cfg-if", "guess_host_triple", @@ -919,7 +919,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.8" +version = "1.0.9" dependencies = [ "tempfile", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 17958137..d3bf5f1f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,8 +22,8 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.28.9", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.6" } +binstalk = { path = "../binstalk", version = "0.28.10", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.7" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-bins/CHANGELOG.md b/crates/binstalk-bins/CHANGELOG.md index 42b7f45a..3b220db2 100644 --- a/crates/binstalk-bins/CHANGELOG.md +++ b/crates/binstalk-bins/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.6.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.0...binstalk-bins-v0.6.1) - 2024-11-02 + +### Other + +- Improve UI orompt for installation ([#1950](https://github.com/cargo-bins/cargo-binstall/pull/1950)) + ## [0.6.0](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.5.0...binstalk-bins-v0.6.0) - 2024-08-10 ### Other diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 6dd76f77..6ce7934e 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.6.0" +version = "0.6.1" edition = "2021" description = "The binstall binaries discovery and installation crate." diff --git a/crates/binstalk-downloader/CHANGELOG.md b/crates/binstalk-downloader/CHANGELOG.md index de662490..0772e07d 100644 --- a/crates/binstalk-downloader/CHANGELOG.md +++ b/crates/binstalk-downloader/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.13.2](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.1...binstalk-downloader-v0.13.2) - 2024-11-02 + +### Other + +- Use rc-zip-sync for zip extraction ([#1942](https://github.com/cargo-bins/cargo-binstall/pull/1942)) + ## [0.13.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.0...binstalk-downloader-v0.13.1) - 2024-08-12 ### Other diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 73e58948..fa30f29e 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.13.1" +version = "0.13.2" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index 7ad0b19c..245422ae 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.2](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.1...binstalk-fetchers-v0.10.2) - 2024-11-02 + +### Other + +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.10.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.0...binstalk-fetchers-v0.10.1) - 2024-10-12 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 5537abdf..9686faec 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.10.1" +version = "0.10.2" edition = "2021" description = "The binstall fetchers" @@ -12,8 +12,8 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.13.1", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.3", path = "../binstalk-git-repo-api" } +binstalk-downloader = { version = "0.13.2", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.4", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.9.0", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.3.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.1", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.2", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index e72a198e..faad3e6e 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.4](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.3...binstalk-git-repo-api-v0.5.4) - 2024-11-02 + +### Other + +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.5.3](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.2...binstalk-git-repo-api-v0.5.3) - 2024-10-12 ### Fixed diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 1a1914e9..50470dd4 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.3" +version = "0.5.4" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.13.1", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.2", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.8.0" @@ -25,6 +25,6 @@ url = "2.3.1" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.1", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.2", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index 7b7c0278..a5bb82d9 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.7](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.6...binstalk-manifests-v0.15.7) - 2024-11-02 + +### Other + +- updated the following local packages: detect-targets + ## [0.15.6](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.5...binstalk-manifests-v0.15.6) - 2024-10-25 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 264cf60f..3a8d73a7 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.6" +version = "0.15.7" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.3.1", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.25", path = "../detect-targets" } +detect-targets = { version = "0.1.26", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md index 36628bf4..203b2815 100644 --- a/crates/binstalk-registry/CHANGELOG.md +++ b/crates/binstalk-registry/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.2](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.1...binstalk-registry-v0.11.2) - 2024-11-02 + +### Other + +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.11.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.0...binstalk-registry-v0.11.1) - 2024-08-12 ### Other diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index a0415643..3270ceb6 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.11.1" +version = "0.11.2" edition = "2021" rust-version = "1.65.0" @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.13.1", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.2", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.9.0", path = "../binstalk-types" } @@ -40,7 +40,7 @@ url = "2.3.1" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.13.1", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.2", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index 704cee92..3bb321b3 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.10](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.9...binstalk-v0.28.10) - 2024-11-02 + +### Other + +- updated the following local packages: binstalk-bins, binstalk-downloader, detect-targets + ## [0.28.9](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.8...binstalk-v0.28.9) - 2024-10-25 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index f77b97d3..6b12db1a 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,25 +3,25 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.9" +version = "0.28.10" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.6.0", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.13.1", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.3", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.10.1", path = "../binstalk-fetchers", features = [ +binstalk-bins = { version = "0.6.1", path = "../binstalk-bins" } +binstalk-downloader = { version = "0.13.2", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.4", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.10.2", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.11.1", path = "../binstalk-registry" } +binstalk-registry = { version = "0.11.2", path = "../binstalk-registry" } binstalk-types = { version = "0.9.0", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.1", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.25", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.26", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index fe00e652..5d8d65e0 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.26](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.25...detect-targets-v0.1.26) - 2024-11-02 + +### Other + +- update Cargo.lock dependencies + ## [0.1.25](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.24...detect-targets-v0.1.25) - 2024-10-25 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index ac72f81a..af66d8bf 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.25" +version = "0.1.26" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index c8f2c349..9d74d33a 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.9](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.8...detect-wasi-v1.0.9) - 2024-11-02 + +### Other + +- update Cargo.lock dependencies + ## [1.0.8](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.7...detect-wasi-v1.0.8) - 2024-10-25 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index a8fd4b19..581aa9f4 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.8" +version = "1.0.9" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From 2c1f156332d1d2924a6c78e4f7ad726ee3db2e36 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 2 Nov 2024 02:45:51 +0000 Subject: [PATCH 1902/2020] release: cargo-binstall v1.10.10 (#1951) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4f5fd151..30799c3c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -562,7 +562,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.9" +version = "1.10.10" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index d3bf5f1f..5336115e 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.9" +version = "1.10.10" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index c8528a53..406f6a8e 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 04d28b1f5c8a76701bdea003e7214b6a63a1dc4a Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 5 Nov 2024 20:30:30 +1000 Subject: [PATCH 1903/2020] CI: Fix just-setup (#1957) * Fix just-setup - install rust toolchain before calling install-action, just in case there's no available binary - configure THP/malloc at the start of action Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix rust installation Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix target passed to install-action Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Add missing shell Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix typo Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix passing target to install-action Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- .github/actions/just-setup/action.yml | 34 +++++++++++++++++---------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/actions/just-setup/action.yml b/.github/actions/just-setup/action.yml index 17572609..f57a949f 100644 --- a/.github/actions/just-setup/action.yml +++ b/.github/actions/just-setup/action.yml @@ -22,7 +22,17 @@ runs: if: runner.os == 'macOS' run: sudo spctl developer-mode enable-terminal shell: bash - + + - name: Enable transparent huge page + if: runner.os == 'Linux' + run: echo madvise | sudo tee /sys/kernel/mm/transparent_hugepage/enabled + shell: bash + + - name: Configure jemalloc (used by rustc) to use transparent huge page + if: runner.os == 'Linux' + run: echo "MALLOC_CONF=thp:always,metadata_thp:always" >> "$GITHUB_ENV" + shell: bash + - name: Exclude workspace and cargo/rustup home from windows defender if: runner.os == 'Windows' run: | @@ -40,11 +50,21 @@ runs: run: echo "tools=$tools,$inputs_tools" >>"$GITHUB_ENV" shell: bash + - name: Determine native target + run: | + if [ "$RUNNER_OS" = "Linux" ]; then RUNNER_TARGET=x86_64-unknown-linux-gnu; fi + if [ "$RUNNER_OS" = "macOS" ]; then RUNNER_TARGET=aarch64-apple-darwin; fi + if [ "$RUNNER_OS" = "Windows" ]; then RUNNER_TARGET=x86_64-pc-windows-msvc; fi + echo "RUNNER_TARGET=$RUNNER_TARGET" >>"$GITHUB_ENV" + shell: bash + - name: Install tools uses: taiki-e/install-action@v2 with: tool: ${{ env.tools }} - + env: + CARGO_BUILD_TARGET: ${{ env.RUNNER_TARGET }} + - name: Install rust toolchains run: just toolchain shell: bash @@ -134,13 +154,3 @@ runs: - run: make -v shell: bash - - - name: Enable transparent huge page - if: runner.os == 'Linux' - run: echo madvise | sudo tee /sys/kernel/mm/transparent_hugepage/enabled - shell: bash - - - name: Configure jemalloc (used by rustc) to use transparent huge page - if: runner.os == 'Linux' - run: echo "MALLOC_CONF=thp:always,metadata_thp:always" >> "$GITHUB_ENV" - shell: bash From 4bf36853283cb69321df35d6aa4f5d642850e58c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 10:36:13 +0000 Subject: [PATCH 1904/2020] build(deps): bump the deps group with 3 updates (#1954) Bumps the deps group with 3 updates: [thiserror](https://github.com/dtolnay/thiserror), [url](https://github.com/servo/rust-url) and [fs4](https://github.com/al8n/fs4-rs). Updates `thiserror` from 1.0.66 to 1.0.68 - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.66...1.0.68) Updates `url` from 2.5.2 to 2.5.3 - [Release notes](https://github.com/servo/rust-url/releases) - [Commits](https://github.com/servo/rust-url/compare/v2.5.2...v2.5.3) Updates `fs4` from 0.10.0 to 0.11.0 - [Release notes](https://github.com/al8n/fs4-rs/releases) - [Commits](https://github.com/al8n/fs4-rs/commits) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: url dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: fs4 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 298 +++++++++++++++++++++++- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 4 +- crates/binstalk-fetchers/Cargo.toml | 4 +- crates/binstalk-git-repo-api/Cargo.toml | 4 +- crates/binstalk-manifests/Cargo.toml | 4 +- crates/binstalk-registry/Cargo.toml | 4 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 4 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- crates/fs-lock/Cargo.toml | 2 +- 11 files changed, 302 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 30799c3c..e55ae60e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -955,6 +955,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[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 = "dlopen2" version = "0.5.0" @@ -1133,9 +1144,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec6fcfb3c0c1d71612528825042261419d5dade9678c39a781e05b63677d9b32" +checksum = "adc91b3da7f1a7968b00f9f65a4971252f6a927d3cb9eec05d91cbeaff678f9a" dependencies = [ "rustix", "windows-sys 0.52.0", @@ -2149,7 +2160,7 @@ dependencies = [ "h3 0.0.5", "h3-quinn 0.0.6", "http", - "idna", + "idna 0.5.0", "ipnet", "native-tls", "once_cell", @@ -2363,6 +2374,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "idna" version = "0.5.0" @@ -2373,6 +2502,27 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "686f825264d630750a544639377bae737628043f20d38bbc029e8f29ea968a7e" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + [[package]] name = "indexmap" version = "2.6.0" @@ -2582,6 +2732,12 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "lock_api" version = "0.4.12" @@ -3812,6 +3968,12 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "static_assertions" version = "1.1.0" @@ -3872,9 +4034,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.86" +version = "2.0.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89275301d38033efb81a6e60e3497e734dfcc62571f2854bf4b16690398824c" +checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" dependencies = [ "proc-macro2", "quote", @@ -3890,6 +4052,17 @@ dependencies = [ "futures-core", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -3974,18 +4147,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.66" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d171f59dbaa811dbbb1aee1e73db92ec2b122911a48e1390dfe327a821ddede" +checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.66" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b08be0f17bd307950653ce45db00cd31200d82b624b36e181337d9c7d92765b5" +checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" dependencies = [ "proc-macro2", "quote", @@ -4035,6 +4208,16 @@ dependencies = [ "time-core", ] +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.8.0" @@ -4317,16 +4500,28 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.2" +version = "2.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" +checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" dependencies = [ "form_urlencoded", - "idna", + "idna 1.0.3", "percent-encoding", "serde", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[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" @@ -4826,6 +5021,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "xattr" version = "1.3.1" @@ -4846,6 +5053,30 @@ dependencies = [ "lzma-sys", ] +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -4867,12 +5098,55 @@ dependencies = [ "syn", ] +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + [[package]] name = "zeroize" version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "zstd" version = "0.13.2" diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 6ce7934e..32d93323 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -17,5 +17,5 @@ compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } -thiserror = "1.0.61" +thiserror = "1.0.68" tracing = "0.1.39" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index fa30f29e..3c25240a 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -50,7 +50,7 @@ serde_json = { version = "1.0.107", optional = true } #tar = "0.4.38" tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.5.0" -thiserror = "1.0.61" +thiserror = "1.0.68" tokio = { version = "1.35.0", features = [ "macros", "rt-multi-thread", @@ -65,7 +65,7 @@ hickory-resolver = { version = "0.25.0-alpha.2", optional = true, features = [ "dnssec-ring", ] } once_cell = { version = "1.18.0", optional = true } -url = "2.3.1" +url = "2.5.3" xz2 = "0.1.7" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 9686faec..34a2668a 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -25,13 +25,13 @@ miette = "7.0.0" minisign-verify = "0.2.1" once_cell = "1.18.0" strum = "0.26.1" -thiserror = "1.0.61" +thiserror = "1.0.68" tokio = { version = "1.35.0", features = [ "rt", "sync", ], default-features = false } tracing = "0.1.39" -url = "2.3.1" +url = "2.5.3" [dev-dependencies] binstalk-downloader = { version = "0.13.2", path = "../binstalk-downloader" } diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 50470dd4..2fc1e58e 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -18,10 +18,10 @@ percent-encoding = "2.2.0" serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = { version = "1.0.107" } -thiserror = "1.0.52" +thiserror = "1.0.68" tokio = { version = "1.35.0", features = ["sync"], default-features = false } tracing = "0.1.39" -url = "2.3.1" +url = "2.5.3" zeroize = "1.8.1" [dev-dependencies] diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 3a8d73a7..45f4a089 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -20,9 +20,9 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.107" -thiserror = "1.0.61" +thiserror = "1.0.68" toml_edit = { version = "0.22.12", features = ["serde"] } -url = { version = "2.3.1", features = ["serde"] } +url = { version = "2.5.3", features = ["serde"] } [dev-dependencies] detect-targets = { version = "0.1.26", path = "../detect-targets" } diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 3270ceb6..e0b2e088 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -29,13 +29,13 @@ serde_json = "1.0.107" sha2 = "0.10.7" simple-git = { version = "0.2.4", optional = true } tempfile = "3.5.0" -thiserror = "1.0.61" +thiserror = "1.0.68" tokio = { version = "1.35.0", features = [ "rt", "sync", ], default-features = false } tracing = "0.1.39" -url = "2.3.1" +url = "2.5.3" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 4c09e825..ccb3ef0a 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -17,7 +17,7 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } strum = "0.26.1" strum_macros = "0.26.1" -url = { version = "2.3.1", features = ["serde"] } +url = { version = "2.5.3", features = ["serde"] } [dev-dependencies] serde_json = "1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 6b12db1a..5b33ddb3 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -35,7 +35,7 @@ simple-git = { version = "0.2.10", optional = true } strum = "0.26.1" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" -thiserror = "1.0.61" +thiserror = "1.0.68" tokio = { version = "1.35.0", features = [ "rt", "process", @@ -43,7 +43,7 @@ tokio = { version = "1.35.0", features = [ "time", ], default-features = false } tracing = "0.1.39" -url = { version = "2.3.1", features = ["serde"] } +url = { version = "2.5.3", features = ["serde"] } zeroize = "1.8.1" [features] diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 47efe906..85b4c9d2 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -15,7 +15,7 @@ compact_str = { version = "0.8.0", features = ["serde"] } glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } serde = "1.0.163" -thiserror = "1.0.61" +thiserror = "1.0.68" tracing = "0.1.39" [dev-dependencies] diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 5773ce62..8dd0ce85 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -10,4 +10,4 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -fs4 = "0.10.0" +fs4 = "0.11.0" From ecbd4fdff1a3d0f2d1bced11e5fa114d09f01b2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Tue, 5 Nov 2024 07:42:22 -0300 Subject: [PATCH 1905/2020] install-from-binstall-release: Add BINSTALL_VERSION (#1955) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allow the users to choose different versions of cargo-binstall Signed-off-by: Patrick José Pereira --- install-from-binstall-release.ps1 | 6 +++++- install-from-binstall-release.sh | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/install-from-binstall-release.ps1 b/install-from-binstall-release.ps1 index a06b25e4..0e0a39c2 100644 --- a/install-from-binstall-release.ps1 +++ b/install-from-binstall-release.ps1 @@ -1,7 +1,11 @@ $ErrorActionPreference = "Stop" Set-PSDebug -Trace 1 $tmpdir = $Env:TEMP -$base_url = "https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-" +$BINSTALL_VERSION = $Env:BINSTALL_VERSION +if (-not $BINSTALL_VERSION) { + $BINSTALL_VERSION = 'latest' +} +$base_url = "https://github.com/cargo-bins/cargo-binstall/releases/$BINSTALL_VERSION/download/cargo-binstall-" $proc_arch = [Environment]::GetEnvironmentVariable("PROCESSOR_ARCHITECTURE", [EnvironmentVariableTarget]::Machine) if ($proc_arch -eq "AMD64") { $arch = "x86_64" diff --git a/install-from-binstall-release.sh b/install-from-binstall-release.sh index 05e507bf..d87b29eb 100755 --- a/install-from-binstall-release.sh +++ b/install-from-binstall-release.sh @@ -2,9 +2,11 @@ set -euxo pipefail +BINSTALL_VERSION="${BINSTALL_VERSION:-latest}" + cd "$(mktemp -d)" -base_url="https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-" +base_url="https://github.com/cargo-bins/cargo-binstall/releases/${BINSTALL_VERSION}/download/cargo-binstall-" os="$(uname -s)" if [ "$os" == "Darwin" ]; then From 44b388c9fd07060ee4ff4e5a4361ae5a88fce71b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Tue, 5 Nov 2024 07:44:09 -0300 Subject: [PATCH 1906/2020] install-from-binstall-release: Add user-agent into curl (#1956) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It appears that github API now enforces the user-agent Signed-off-by: Patrick José Pereira --- install-from-binstall-release.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/install-from-binstall-release.sh b/install-from-binstall-release.sh index d87b29eb..fa4f8222 100755 --- a/install-from-binstall-release.sh +++ b/install-from-binstall-release.sh @@ -11,7 +11,7 @@ base_url="https://github.com/cargo-bins/cargo-binstall/releases/${BINSTALL_VERSI os="$(uname -s)" if [ "$os" == "Darwin" ]; then url="${base_url}universal-apple-darwin.zip" - curl -LO --proto '=https' --tlsv1.2 -sSf "$url" + curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -LO --proto '=https' --tlsv1.2 -sSf "$url" unzip cargo-binstall-universal-apple-darwin.zip elif [ "$os" == "Linux" ]; then machine="$(uname -m)" @@ -24,12 +24,12 @@ elif [ "$os" == "Linux" ]; then fi url="${base_url}${target}.tgz" - curl -L --proto '=https' --tlsv1.2 -sSf "$url" | tar -xvzf - + curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -L --proto '=https' --tlsv1.2 -sSf "$url" | tar -xvzf - elif [ "${OS-}" = "Windows_NT" ]; then machine="$(uname -m)" target="${machine}-pc-windows-msvc" url="${base_url}${target}.zip" - curl -LO --proto '=https' --tlsv1.2 -sSf "$url" + curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -LO --proto '=https' --tlsv1.2 -sSf "$url" unzip "cargo-binstall-${target}.zip" else echo "Unsupported OS ${os}" From 1af0df13e5f035af2a41fa0d0dfc826f54e5be9b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 11:38:14 +0000 Subject: [PATCH 1907/2020] dep: Upgrade transitive dependencies (#1959) Co-authored-by: github-actions --- Cargo.lock | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e55ae60e..888320dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -82,9 +82,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.17" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23a1e53f0f5d86382dafe1cf314783b2044280f406e7e1506368220ad11b1338" +checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" dependencies = [ "anstyle", "anstyle-parse", @@ -97,9 +97,9 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8365de52b16c035ff4fcafe0092ba9390540e3e352870ac09933bebcaa2c8c56" +checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" [[package]] name = "anstyle-parse" @@ -131,9 +131,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.91" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c042108f3ed77fd83760a5fd79b53be043192bb3b9dba91d8c574c0ada7850c8" +checksum = "74f37166d7d48a0284b99dd824694c26119c700b53bf0d1540cdb147dbdaaf13" [[package]] name = "arc-swap" @@ -648,9 +648,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.31" +version = "1.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2e7962b54006dcfcc61cb72735f4d89bb97061dd6a7ed882ec6b8ee53714c6f" +checksum = "67b9470d453346108f93a59222a9a1a5724db32d0a4727b7ab7ace4b4d822dc9" dependencies = [ "jobserver", "libc", @@ -2124,9 +2124,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" [[package]] name = "heck" @@ -2530,7 +2530,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.15.0", + "hashbrown 0.15.1", ] [[package]] @@ -2590,9 +2590,9 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "jiff" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a45489186a6123c128fdf6016183fcfab7113e1820eb813127e036e287233fb" +checksum = "b9d9d414fc817d3e3d62b2598616733f76c4cc74fbac96069674739b881295c8" dependencies = [ "jiff-tzdb-platform", "windows-sys 0.59.0", @@ -3648,9 +3648,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.38" +version = "0.38.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa260229e6538e52293eeb577aabd09945a09d6d9cc0fc550ed7529056c2e32a" +checksum = "375116bee2be9ed569afe2154ea6a99dfdffd257f533f187498c2a8f5feaf4ee" dependencies = [ "bitflags 2.6.0", "errno 0.3.9", From 674f04f95f5066f0e3c85a68c1e9fd4145f15b16 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 12:18:49 +0000 Subject: [PATCH 1908/2020] chore: release (#1958) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 24 +++++++++++------------ crates/bin/Cargo.toml | 4 ++-- crates/binstalk-bins/CHANGELOG.md | 6 ++++++ crates/binstalk-bins/Cargo.toml | 4 ++-- crates/binstalk-downloader/CHANGELOG.md | 6 ++++++ crates/binstalk-downloader/Cargo.toml | 4 ++-- crates/binstalk-fetchers/CHANGELOG.md | 6 ++++++ crates/binstalk-fetchers/Cargo.toml | 10 +++++----- crates/binstalk-git-repo-api/CHANGELOG.md | 6 ++++++ crates/binstalk-git-repo-api/Cargo.toml | 6 +++--- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 8 ++++---- crates/binstalk-registry/CHANGELOG.md | 6 ++++++ crates/binstalk-registry/Cargo.toml | 10 +++++----- crates/binstalk-types/CHANGELOG.md | 6 ++++++ crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 18 ++++++++--------- crates/cargo-toml-workspace/CHANGELOG.md | 14 +++++++++++++ crates/cargo-toml-workspace/Cargo.toml | 2 +- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- crates/fs-lock/CHANGELOG.md | 6 ++++++ crates/fs-lock/Cargo.toml | 2 +- 26 files changed, 129 insertions(+), 49 deletions(-) create mode 100644 crates/cargo-toml-workspace/CHANGELOG.md diff --git a/Cargo.lock b/Cargo.lock index 888320dd..51c27f45 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -256,7 +256,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.10" +version = "0.28.11" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -288,7 +288,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.6.1" +version = "0.6.2" dependencies = [ "atomic-file-install", "binstalk-types", @@ -302,7 +302,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.13.2" +version = "0.13.3" dependencies = [ "async-compression", "async-trait", @@ -338,7 +338,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.10.2" +version = "0.10.3" dependencies = [ "async-trait", "binstalk-downloader", @@ -362,7 +362,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.4" +version = "0.5.5" dependencies = [ "binstalk-downloader", "compact_str", @@ -381,7 +381,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.7" +version = "0.15.8" dependencies = [ "beef", "binstalk-types", @@ -402,7 +402,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.11.2" +version = "0.11.3" dependencies = [ "async-trait", "base16", @@ -429,7 +429,7 @@ dependencies = [ [[package]] name = "binstalk-types" -version = "0.9.0" +version = "0.9.1" dependencies = [ "compact_str", "maybe-owned", @@ -601,7 +601,7 @@ dependencies = [ [[package]] name = "cargo-toml-workspace" -version = "6.0.1" +version = "6.0.2" dependencies = [ "cargo_toml", "compact_str", @@ -907,7 +907,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.26" +version = "0.1.27" dependencies = [ "cfg-if", "guess_host_triple", @@ -919,7 +919,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.9" +version = "1.0.10" dependencies = [ "tempfile", ] @@ -1137,7 +1137,7 @@ dependencies = [ [[package]] name = "fs-lock" -version = "0.1.5" +version = "0.1.6" dependencies = [ "fs4", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 5336115e..d8cde4a9 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,8 +22,8 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -binstalk = { path = "../binstalk", version = "0.28.10", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.7" } +binstalk = { path = "../binstalk", version = "0.28.11", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.8" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-bins/CHANGELOG.md b/crates/binstalk-bins/CHANGELOG.md index 3b220db2..f334bffc 100644 --- a/crates/binstalk-bins/CHANGELOG.md +++ b/crates/binstalk-bins/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.6.2](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.1...binstalk-bins-v0.6.2) - 2024-11-05 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1954](https://github.com/cargo-bins/cargo-binstall/pull/1954)) + ## [0.6.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.0...binstalk-bins-v0.6.1) - 2024-11-02 ### Other diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 32d93323..ed3852ff 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.6.1" +version = "0.6.2" edition = "2021" description = "The binstall binaries discovery and installation crate." @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] atomic-file-install = { version = "1.0.5", path = "../atomic-file-install" } -binstalk-types = { version = "0.9.0", path = "../binstalk-types" } +binstalk-types = { version = "0.9.1", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" diff --git a/crates/binstalk-downloader/CHANGELOG.md b/crates/binstalk-downloader/CHANGELOG.md index 0772e07d..2b3febdc 100644 --- a/crates/binstalk-downloader/CHANGELOG.md +++ b/crates/binstalk-downloader/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.13.3](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.2...binstalk-downloader-v0.13.3) - 2024-11-05 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1954](https://github.com/cargo-bins/cargo-binstall/pull/1954)) + ## [0.13.2](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.1...binstalk-downloader-v0.13.2) - 2024-11-02 ### Other diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 3c25240a..33f94dd2 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.13.2" +version = "0.13.3" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -18,7 +18,7 @@ async-compression = { version = "0.4.4", features = [ "bzip2", "tokio", ] } -binstalk-types = { version = "0.9.0", path = "../binstalk-types" } +binstalk-types = { version = "0.9.1", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" cfg-if = "1" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index 245422ae..76307775 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.3](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.2...binstalk-fetchers-v0.10.3) - 2024-11-05 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1954](https://github.com/cargo-bins/cargo-binstall/pull/1954)) + ## [0.10.2](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.1...binstalk-fetchers-v0.10.2) - 2024-11-02 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 34a2668a..d4a4726f 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.10.2" +version = "0.10.3" edition = "2021" description = "The binstall fetchers" @@ -12,9 +12,9 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.13.2", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.4", path = "../binstalk-git-repo-api" } -binstalk-types = { version = "0.9.0", path = "../binstalk-types" } +binstalk-downloader = { version = "0.13.3", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.5", path = "../binstalk-git-repo-api" } +binstalk-types = { version = "0.9.1", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } either = "1.11.0" @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.5.3" [dev-dependencies] -binstalk-downloader = { version = "0.13.2", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.3", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index faad3e6e..c0d2f3d3 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.5](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.4...binstalk-git-repo-api-v0.5.5) - 2024-11-05 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1954](https://github.com/cargo-bins/cargo-binstall/pull/1954)) + ## [0.5.4](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.3...binstalk-git-repo-api-v0.5.4) - 2024-11-02 ### Other diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 2fc1e58e..4b059939 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.4" +version = "0.5.5" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.13.2", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.3", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.8.0" @@ -25,6 +25,6 @@ url = "2.5.3" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.2", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.3", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index a5bb82d9..7a922a7f 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.8](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.7...binstalk-manifests-v0.15.8) - 2024-11-05 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1954](https://github.com/cargo-bins/cargo-binstall/pull/1954)) + ## [0.15.7](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.6...binstalk-manifests-v0.15.7) - 2024-11-02 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 45f4a089..7c7e910a 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.7" +version = "0.15.8" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -11,9 +11,9 @@ license = "Apache-2.0 OR MIT" [dependencies] beef = { version = "0.5.2", features = ["impl_serde"] } -binstalk-types = { version = "0.9.0", path = "../binstalk-types" } +binstalk-types = { version = "0.9.1", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } -fs-lock = { version = "0.1.5", path = "../fs-lock" } +fs-lock = { version = "0.1.6", path = "../fs-lock" } home = "0.5.9" miette = "7.0.0" semver = { version = "1.0.17", features = ["serde"] } @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.3", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.26", path = "../detect-targets" } +detect-targets = { version = "0.1.27", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md index 203b2815..8fc19c48 100644 --- a/crates/binstalk-registry/CHANGELOG.md +++ b/crates/binstalk-registry/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.3](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.2...binstalk-registry-v0.11.3) - 2024-11-05 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1954](https://github.com/cargo-bins/cargo-binstall/pull/1954)) + ## [0.11.2](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.1...binstalk-registry-v0.11.2) - 2024-11-02 ### Other diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index e0b2e088..f8260fbd 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.11.2" +version = "0.11.3" edition = "2021" rust-version = "1.65.0" @@ -13,11 +13,11 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.13.2", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.3", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } -binstalk-types = { version = "0.9.0", path = "../binstalk-types" } -cargo-toml-workspace = { version = "6.0.1", path = "../cargo-toml-workspace" } +binstalk-types = { version = "0.9.1", path = "../binstalk-types" } +cargo-toml-workspace = { version = "6.0.2", path = "../cargo-toml-workspace" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" @@ -40,7 +40,7 @@ url = "2.5.3" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.13.2", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.3", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk-types/CHANGELOG.md b/crates/binstalk-types/CHANGELOG.md index 9d65f706..738e040d 100644 --- a/crates/binstalk-types/CHANGELOG.md +++ b/crates/binstalk-types/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.9.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-types-v0.9.0...binstalk-types-v0.9.1) - 2024-11-05 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1954](https://github.com/cargo-bins/cargo-binstall/pull/1954)) + ## [0.9.0](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-types-v0.8.0...binstalk-types-v0.9.0) - 2024-08-10 ### Added diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index ccb3ef0a..b1e91d01 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-types" description = "The binstall toolkit that contains basic types for binstalk crates" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-types" -version = "0.9.0" +version = "0.9.1" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index 3bb321b3..b8559b94 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.11](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.10...binstalk-v0.28.11) - 2024-11-05 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1954](https://github.com/cargo-bins/cargo-binstall/pull/1954)) + ## [0.28.10](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.9...binstalk-v0.28.10) - 2024-11-02 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 5b33ddb3..046cfb3a 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,25 +3,25 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.10" +version = "0.28.11" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.6.1", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.13.2", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.4", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.10.2", path = "../binstalk-fetchers", features = [ +binstalk-bins = { version = "0.6.2", path = "../binstalk-bins" } +binstalk-downloader = { version = "0.13.3", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.5", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.10.3", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.11.2", path = "../binstalk-registry" } -binstalk-types = { version = "0.9.0", path = "../binstalk-types" } -cargo-toml-workspace = { version = "6.0.1", path = "../cargo-toml-workspace" } +binstalk-registry = { version = "0.11.3", path = "../binstalk-registry" } +binstalk-types = { version = "0.9.1", path = "../binstalk-types" } +cargo-toml-workspace = { version = "6.0.2", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.26", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.27", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/cargo-toml-workspace/CHANGELOG.md b/crates/cargo-toml-workspace/CHANGELOG.md new file mode 100644 index 00000000..63676c54 --- /dev/null +++ b/crates/cargo-toml-workspace/CHANGELOG.md @@ -0,0 +1,14 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [6.0.2](https://github.com/cargo-bins/cargo-binstall/compare/cargo-toml-workspace-v6.0.1...cargo-toml-workspace-v6.0.2) - 2024-11-05 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1954](https://github.com/cargo-bins/cargo-binstall/pull/1954)) diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 85b4c9d2..37dc16b6 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-toml-workspace" -version = "6.0.1" +version = "6.0.2" edition = "2021" description = "Parse cargo workspace and load specific crate" repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index 5d8d65e0..3cd3e706 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.27](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.26...detect-targets-v0.1.27) - 2024-11-05 + +### Other + +- update Cargo.lock dependencies + ## [0.1.26](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.25...detect-targets-v0.1.26) - 2024-11-02 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index af66d8bf..f3040ede 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.26" +version = "0.1.27" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index 9d74d33a..5d82ced5 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.10](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.9...detect-wasi-v1.0.10) - 2024-11-05 + +### Other + +- update Cargo.lock dependencies + ## [1.0.9](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.8...detect-wasi-v1.0.9) - 2024-11-02 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index 581aa9f4..c07b6dc7 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.9" +version = "1.0.10" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" diff --git a/crates/fs-lock/CHANGELOG.md b/crates/fs-lock/CHANGELOG.md index 6a572359..862b40d7 100644 --- a/crates/fs-lock/CHANGELOG.md +++ b/crates/fs-lock/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.6](https://github.com/cargo-bins/cargo-binstall/compare/fs-lock-v0.1.5...fs-lock-v0.1.6) - 2024-11-05 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1954](https://github.com/cargo-bins/cargo-binstall/pull/1954)) + ## [0.1.5](https://github.com/cargo-bins/cargo-binstall/compare/fs-lock-v0.1.4...fs-lock-v0.1.5) - 2024-10-12 ### Other diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 8dd0ce85..163584f6 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -3,7 +3,7 @@ name = "fs-lock" description = "Locked files that can be used like normal File" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/fs-lock" -version = "0.1.5" +version = "0.1.6" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From 02e9225fbd07c965123a530da9d6f5c494e1e977 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 20:34:55 +0000 Subject: [PATCH 1909/2020] release: cargo-binstall v1.10.11 (#1960) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 51c27f45..bf9446c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -562,7 +562,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.10" +version = "1.10.11" dependencies = [ "binstalk", "binstalk-manifests", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index d8cde4a9..43d40065 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.10" +version = "1.10.11" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 406f6a8e..d3825186 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 27e2db85b49807e0e74ae2eeba52fd84f5a5c4ed Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 10:52:34 +0000 Subject: [PATCH 1910/2020] dep: Upgrade transitive dependencies (#1964) Co-authored-by: github-actions --- Cargo.lock | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bf9446c1..e38b11fa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -131,9 +131,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f37166d7d48a0284b99dd824694c26119c700b53bf0d1540cdb147dbdaaf13" +checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" [[package]] name = "arc-swap" @@ -648,9 +648,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.34" +version = "1.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67b9470d453346108f93a59222a9a1a5724db32d0a4727b7ab7ace4b4d822dc9" +checksum = "baee610e9452a8f6f0a1b6194ec09ff9e2d85dea54432acdae41aa0761c95d70" dependencies = [ "jobserver", "libc", @@ -1072,9 +1072,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.1.1" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" +checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "file-format" @@ -1144,9 +1144,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.11.0" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc91b3da7f1a7968b00f9f65a4971252f6a927d3cb9eec05d91cbeaff678f9a" +checksum = "e871a4cfa68bb224863b53149d973df1ac8d1ed2fa1d1bfc37ac1bb65dd37207" dependencies = [ "rustix", "windows-sys 0.52.0", @@ -2685,9 +2685,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.161" +version = "0.2.162" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e9489c2807c139ffd9c1794f4af0ebe86a828db53ecdc7fea2111d0fed085d1" +checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" [[package]] name = "libmimalloc-sys" @@ -3388,9 +3388,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.6" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e346e016eacfff12233c243718197ca12f148c84e1e84268a896699b41c71780" +checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" dependencies = [ "cfg_aliases", "libc", @@ -4113,9 +4113,9 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" [[package]] name = "tempfile" -version = "3.13.0" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" +checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if", "fastrand", @@ -4235,9 +4235,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.0" +version = "1.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145f3413504347a2be84393cc8a7d2fb4d863b375909ea59f2158261aa258bbb" +checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" dependencies = [ "backtrace", "bytes", From 02ca607932ffcf28d573ec477e07de1d162280f0 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 9 Nov 2024 03:47:05 +0000 Subject: [PATCH 1911/2020] build(deps): bump the deps group with 3 updates (#1966) * build(deps): bump the deps group with 3 updates Bumps the deps group with 3 updates: [file-format](https://github.com/mmalecot/file-format), [thiserror](https://github.com/dtolnay/thiserror) and [hickory-resolver](https://github.com/hickory-dns/hickory-dns). Updates `file-format` from 0.25.0 to 0.26.0 - [Release notes](https://github.com/mmalecot/file-format/releases) - [Changelog](https://github.com/mmalecot/file-format/blob/main/CHANGELOG.md) - [Commits](https://github.com/mmalecot/file-format/compare/v0.25.0...v0.26.0) Updates `thiserror` from 1.0.68 to 2.0.1 - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/1.0.68...2.0.1) Updates `hickory-resolver` from 0.25.0-alpha.2 to 0.25.0-alpha.3 - [Release notes](https://github.com/hickory-dns/hickory-dns/releases) - [Changelog](https://github.com/hickory-dns/hickory-dns/blob/main/CHANGELOG.md) - [Commits](https://github.com/hickory-dns/hickory-dns/compare/v0.25.0-alpha.2...v0.25.0-alpha.3) --- updated-dependencies: - dependency-name: file-format dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-major dependency-group: deps - dependency-name: hickory-resolver dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps ... Signed-off-by: dependabot[bot] * Fix import in resolver.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix get_configs() in resolver.rs on Windows Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- Cargo.lock | 188 +++++++++--------- crates/bin/Cargo.toml | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 4 +- .../src/remote/resolver.rs | 3 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-git-repo-api/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- 11 files changed, 101 insertions(+), 110 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e38b11fa..317bf096 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ dependencies = [ "strum", "target-lexicon", "tempfile", - "thiserror", + "thiserror 2.0.1", "tokio", "tracing", "url", @@ -296,7 +296,7 @@ dependencies = [ "leon", "miette", "normalize-path", - "thiserror", + "thiserror 2.0.1", "tracing", ] @@ -326,7 +326,7 @@ dependencies = [ "serde", "serde_json", "tempfile", - "thiserror", + "thiserror 2.0.1", "tokio", "tokio-tar", "tokio-util", @@ -354,7 +354,7 @@ dependencies = [ "minisign-verify", "once_cell", "strum", - "thiserror", + "thiserror 2.0.1", "tokio", "tracing", "url", @@ -371,7 +371,7 @@ dependencies = [ "serde", "serde-tuple-vec-map", "serde_json", - "thiserror", + "thiserror 2.0.1", "tokio", "tracing", "tracing-subscriber", @@ -395,7 +395,7 @@ dependencies = [ "serde-tuple-vec-map", "serde_json", "tempfile", - "thiserror", + "thiserror 2.0.1", "toml_edit", "url", ] @@ -420,7 +420,7 @@ dependencies = [ "sha2", "simple-git", "tempfile", - "thiserror", + "thiserror 2.0.1", "tokio", "toml_edit", "tracing", @@ -609,7 +609,7 @@ dependencies = [ "normalize-path", "serde", "tempfile", - "thiserror", + "thiserror 2.0.1", "tracing", ] @@ -624,7 +624,7 @@ dependencies = [ "semver", "serde", "serde_json", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1078,9 +1078,9 @@ checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" [[package]] name = "file-format" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ffe3a660c3a1b10e96f304a9413d673b2118d62e4520f7ddf4a4faccfe8b9b9" +checksum = "e7ef3d5e8ae27277c8285ac43ed153158178ef0f79567f32024ca8140a0c7cd8" [[package]] name = "filetime" @@ -1317,7 +1317,7 @@ dependencies = [ "gix-worktree-state", "once_cell", "smallvec", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1330,7 +1330,7 @@ dependencies = [ "gix-date", "gix-utils", "itoa", - "thiserror", + "thiserror 1.0.68", "winnow 0.6.20", ] @@ -1347,7 +1347,7 @@ dependencies = [ "gix-trace", "kstring", "smallvec", - "thiserror", + "thiserror 1.0.68", "unicode-bom", ] @@ -1357,7 +1357,7 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10f78312288bd02052be5dbc2ecbc342c9f4eb791986d86c0a5c06b92dc72efa" dependencies = [ - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1366,7 +1366,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c28b58ba04f0c004722344390af9dbc85888fbb84be1981afb934da4114d4cf" dependencies = [ - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1392,7 +1392,7 @@ dependencies = [ "gix-features", "gix-hash", "memmap2", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1411,7 +1411,7 @@ dependencies = [ "memchr", "once_cell", "smallvec", - "thiserror", + "thiserror 1.0.68", "unicode-bom", "winnow 0.6.20", ] @@ -1426,7 +1426,7 @@ dependencies = [ "bstr", "gix-path", "libc", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1443,7 +1443,7 @@ dependencies = [ "gix-sec", "gix-trace", "gix-url", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1455,7 +1455,7 @@ dependencies = [ "bstr", "itoa", "jiff", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1467,7 +1467,7 @@ dependencies = [ "bstr", "gix-hash", "gix-object", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1483,7 +1483,7 @@ dependencies = [ "gix-path", "gix-ref", "gix-sec", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1506,7 +1506,7 @@ dependencies = [ "prodash", "sha1", "sha1_smol", - "thiserror", + "thiserror 1.0.68", "walkdir", ] @@ -1528,7 +1528,7 @@ dependencies = [ "gix-trace", "gix-utils", "smallvec", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1561,7 +1561,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "952c3a29f1bc1007cc901abce7479943abfa42016db089de33d0a4fa3c85bfe8" dependencies = [ "faster-hex", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1613,7 +1613,7 @@ dependencies = [ "memmap2", "rustix", "smallvec", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1624,7 +1624,7 @@ checksum = "5102acdf4acae2644e38dbbd18cdfba9597a218f7d85f810fe5430207e03c2de" dependencies = [ "gix-tempfile", "gix-utils", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1640,7 +1640,7 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1659,7 +1659,7 @@ dependencies = [ "gix-validate", "itoa", "smallvec", - "thiserror", + "thiserror 1.0.68", "winnow 0.6.20", ] @@ -1681,7 +1681,7 @@ dependencies = [ "gix-quote", "parking_lot", "tempfile", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1701,7 +1701,7 @@ dependencies = [ "memmap2", "parking_lot", "smallvec", - "thiserror", + "thiserror 1.0.68", "uluru", ] @@ -1714,7 +1714,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1726,7 +1726,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1739,7 +1739,7 @@ dependencies = [ "gix-trace", "home", "once_cell", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1754,7 +1754,7 @@ dependencies = [ "gix-config-value", "gix-glob", "gix-path", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1767,7 +1767,7 @@ dependencies = [ "gix-config-value", "parking_lot", "rustix", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1784,7 +1784,7 @@ dependencies = [ "gix-transport", "gix-utils", "maybe-async", - "thiserror", + "thiserror 1.0.68", "winnow 0.6.20", ] @@ -1796,7 +1796,7 @@ checksum = "f89f9a1525dcfd9639e282ea939f5ab0d09d93cf2b90c1fc6104f1b9582a8e49" dependencies = [ "bstr", "gix-utils", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1816,7 +1816,7 @@ dependencies = [ "gix-utils", "gix-validate", "memmap2", - "thiserror", + "thiserror 1.0.68", "winnow 0.6.20", ] @@ -1831,7 +1831,7 @@ dependencies = [ "gix-revision", "gix-validate", "smallvec", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1846,7 +1846,7 @@ dependencies = [ "gix-hash", "gix-object", "gix-revwalk", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1861,7 +1861,7 @@ dependencies = [ "gix-hashtable", "gix-object", "smallvec", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1888,7 +1888,7 @@ dependencies = [ "gix-pathspec", "gix-refspec", "gix-url", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1926,7 +1926,7 @@ dependencies = [ "gix-sec", "gix-url", "reqwest", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1943,7 +1943,7 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -1955,7 +1955,7 @@ dependencies = [ "bstr", "gix-features", "gix-path", - "thiserror", + "thiserror 1.0.68", "url", ] @@ -1976,7 +1976,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e187b263461bc36cea17650141567753bc6207d036cedd1de6e81a52f277ff68" dependencies = [ "bstr", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -2015,7 +2015,7 @@ dependencies = [ "gix-path", "gix-worktree", "io-close", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -2055,21 +2055,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "h3" -version = "0.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5069de1c2ac82d9e361b07f2b8a2c582ec071750e063530fc7f3b5197e24805" -dependencies = [ - "bytes", - "fastrand", - "futures-util", - "http", - "pin-project-lite", - "tokio", - "tracing", -] - [[package]] name = "h3" version = "0.0.6" @@ -2084,20 +2069,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "h3-quinn" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8c01d99d7cf812fd34ddf135e6c940df9e24f2e759dbc7179fb0e54d4bd6551" -dependencies = [ - "bytes", - "futures", - "h3 0.0.5", - "quinn", - "tokio", - "tokio-util", -] - [[package]] name = "h3-quinn" version = "0.0.7" @@ -2106,7 +2077,7 @@ checksum = "17c799f413fceeea505236c4d8132f084ff4b55a652288d91439ee93dc24d855" dependencies = [ "bytes", "futures", - "h3 0.0.6", + "h3", "quinn", "tokio", "tokio-util", @@ -2142,9 +2113,9 @@ checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hickory-proto" -version = "0.25.0-alpha.2" +version = "0.25.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8270a1857fb962b9914aafd46a89a187a4e63d0eb4190c327e7c7b8256a2d055" +checksum = "993f9d675890080b3bab88e475e6a0db4fe96b39b2fbd42a72eb315dc9009798" dependencies = [ "async-recursion", "async-trait", @@ -2157,8 +2128,8 @@ dependencies = [ "futures-io", "futures-util", "h2", - "h3 0.0.5", - "h3-quinn 0.0.6", + "h3", + "h3-quinn", "http", "idna 0.5.0", "ipnet", @@ -2169,8 +2140,7 @@ dependencies = [ "rand", "ring", "rustls", - "rustls-pemfile", - "thiserror", + "thiserror 1.0.68", "time", "tinyvec", "tokio", @@ -2182,9 +2152,9 @@ dependencies = [ [[package]] name = "hickory-resolver" -version = "0.25.0-alpha.2" +version = "0.25.0-alpha.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c110355b5703070d9e29c344d79818a7cde3de9c27fc35750defea6074b0ad" +checksum = "0eec9ac701a9b34a77c8ccbe39d589db876290f6bdc6e05ac118fd114cb1ad26" dependencies = [ "cfg-if", "futures-util", @@ -2198,7 +2168,7 @@ dependencies = [ "resolv-conf", "rustls", "smallvec", - "thiserror", + "thiserror 1.0.68", "tokio", "tokio-native-tls", "tokio-rustls", @@ -2668,7 +2638,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d82a8693bd856b8b0596b6abed75d494ba6ca04b8e1b12be3a2ab947c305d8b1" dependencies = [ "miette", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -2847,7 +2817,7 @@ dependencies = [ "supports-unicode", "terminal_size", "textwrap", - "thiserror", + "thiserror 1.0.68", "unicode-width", ] @@ -2964,7 +2934,7 @@ dependencies = [ "anyhow", "byteorder", "paste", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -3364,7 +3334,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror", + "thiserror 1.0.68", "tokio", "tracing", ] @@ -3381,7 +3351,7 @@ dependencies = [ "rustc-hash", "rustls", "slab", - "thiserror", + "thiserror 1.0.68", "tinyvec", "tracing", ] @@ -3457,7 +3427,7 @@ dependencies = [ "oem_cp", "oval", "ownable", - "thiserror", + "thiserror 1.0.68", "tracing", "winnow 0.5.40", "zstd", @@ -3501,7 +3471,7 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", - "thiserror", + "thiserror 1.0.68", ] [[package]] @@ -3558,8 +3528,8 @@ dependencies = [ "futures-core", "futures-util", "h2", - "h3 0.0.6", - "h3-quinn 0.0.7", + "h3", + "h3-quinn", "http", "http-body", "http-body-util", @@ -3920,7 +3890,7 @@ dependencies = [ "compact_str", "derive_destructure2", "gix", - "thiserror", + "thiserror 1.0.68", "tokio", "tracing", ] @@ -4151,7 +4121,16 @@ version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892" dependencies = [ - "thiserror-impl", + "thiserror-impl 1.0.68", +] + +[[package]] +name = "thiserror" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07c1e40dd48a282ae8edc36c732cbc219144b87fb6a4c7316d611c6b1f06ec0c" +dependencies = [ + "thiserror-impl 2.0.1", ] [[package]] @@ -4165,6 +4144,17 @@ dependencies = [ "syn", ] +[[package]] +name = "thiserror-impl" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "874aa7e446f1da8d9c3a5c95b1c5eb41d800045252121dc7f8e0ba370cee55f5" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "thread_local" version = "1.1.8" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 43d40065..d37b036f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -27,7 +27,7 @@ binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.8" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" -file-format = { version = "0.25.0", default-features = false } +file-format = { version = "0.26.0", default-features = false } home = "0.5.9" log = { version = "0.4.18", features = ["std"] } miette = "7.0.0" diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index ed3852ff..4c618400 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -17,5 +17,5 @@ compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } -thiserror = "1.0.68" +thiserror = "2.0.1" tracing = "0.1.39" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 33f94dd2..12f37f49 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -50,7 +50,7 @@ serde_json = { version = "1.0.107", optional = true } #tar = "0.4.38" tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.5.0" -thiserror = "1.0.68" +thiserror = "2.0.1" tokio = { version = "1.35.0", features = [ "macros", "rt-multi-thread", @@ -61,7 +61,7 @@ tokio = { version = "1.35.0", features = [ tokio-tar = "0.3.0" tokio-util = { version = "0.7.8", features = ["io"] } tracing = "0.1.39" -hickory-resolver = { version = "0.25.0-alpha.2", optional = true, features = [ +hickory-resolver = { version = "0.25.0-alpha.3", optional = true, features = [ "dnssec-ring", ] } once_cell = { version = "1.18.0", optional = true } diff --git a/crates/binstalk-downloader/src/remote/resolver.rs b/crates/binstalk-downloader/src/remote/resolver.rs index d6b01c8e..4a7b64bc 100644 --- a/crates/binstalk-downloader/src/remote/resolver.rs +++ b/crates/binstalk-downloader/src/remote/resolver.rs @@ -9,7 +9,7 @@ use reqwest::dns::{Addrs, Name, Resolve, Resolving}; use tracing::{debug, instrument, warn}; #[cfg(windows)] -use hickory_resolver::config::{NameServerConfig, Protocol}; +use hickory_resolver::{config::NameServerConfig, proto::xfer::Protocol}; type BoxError = Box; @@ -53,6 +53,7 @@ fn get_configs() -> Result<(ResolverConfig, ResolverOpts), BoxError> { #[cfg(feature = "rustls")] tls_config: None, bind_addr: None, + http_endpoint: None, }) } }); diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index d4a4726f..1400dd96 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -25,7 +25,7 @@ miette = "7.0.0" minisign-verify = "0.2.1" once_cell = "1.18.0" strum = "0.26.1" -thiserror = "1.0.68" +thiserror = "2.0.1" tokio = { version = "1.35.0", features = [ "rt", "sync", diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 4b059939..5f391470 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -18,7 +18,7 @@ percent-encoding = "2.2.0" serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = { version = "1.0.107" } -thiserror = "1.0.68" +thiserror = "2.0.1" tokio = { version = "1.35.0", features = ["sync"], default-features = false } tracing = "0.1.39" url = "2.5.3" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 7c7e910a..e95f72ae 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -20,7 +20,7 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.107" -thiserror = "1.0.68" +thiserror = "2.0.1" toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.3", features = ["serde"] } diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index f8260fbd..36d0fcde 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -29,7 +29,7 @@ serde_json = "1.0.107" sha2 = "0.10.7" simple-git = { version = "0.2.4", optional = true } tempfile = "3.5.0" -thiserror = "1.0.68" +thiserror = "2.0.1" tokio = { version = "1.35.0", features = [ "rt", "sync", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 046cfb3a..bc0a13ff 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -35,7 +35,7 @@ simple-git = { version = "0.2.10", optional = true } strum = "0.26.1" target-lexicon = { version = "0.12.11", features = ["std"] } tempfile = "3.5.0" -thiserror = "1.0.68" +thiserror = "2.0.1" tokio = { version = "1.35.0", features = [ "rt", "process", diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 37dc16b6..0703faed 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -15,7 +15,7 @@ compact_str = { version = "0.8.0", features = ["serde"] } glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } serde = "1.0.163" -thiserror = "1.0.68" +thiserror = "2.0.1" tracing = "0.1.39" [dev-dependencies] From b1137ece8c792665c2c4ba9e01a17df287e34f32 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 9 Nov 2024 05:07:10 +0000 Subject: [PATCH 1912/2020] dep: Upgrade transitive dependencies (#1967) Co-authored-by: github-actions --- Cargo.lock | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 317bf096..8b54362d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,9 +61,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" +checksum = "611cc2ae7d2e242c457e4be7f97036b8ad9ca152b499f53faf99b1ed8fc2553f" [[package]] name = "android-tzdata" @@ -648,9 +648,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.36" +version = "1.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baee610e9452a8f6f0a1b6194ec09ff9e2d85dea54432acdae41aa0761c95d70" +checksum = "40545c26d092346d8a8dab71ee48e7685a7a9cba76e634790c215b41a4a7b4cf" dependencies = [ "jobserver", "libc", @@ -991,9 +991,9 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "embed-resource" -version = "2.5.0" +version = "2.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4e24052d7be71f0efb50c201557f6fe7d237cfd5a64fd5bcd7fd8fe32dbbffa" +checksum = "b68b6f9f63a0b6a38bc447d4ce84e2b388f3ec95c99c641c8ff0dd3ef89a6379" dependencies = [ "cc", "memchr", @@ -3734,9 +3734,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.0" +version = "2.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" +checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" dependencies = [ "core-foundation-sys", "libc", From c9d5e6de404c2d5d8f6e59a12a4a0de0b82a85bb Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 9 Nov 2024 16:19:35 +1000 Subject: [PATCH 1913/2020] feature: faster self-install without rate limit issue (#1963) * Add new hidden option `--self-install` Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix typo Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Optimize: Only call `LazyJobserverClient::new` when necessary Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * `--self-install` should include a path to a binary On windows, we cannot just copy an executable with process running from it, so better to copy it to a temporary location. Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Impl manifest update and basic API of `self_install` Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Add dep atomic-file-install to cargo-binstall Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Impl `self_install` Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Make `--self-install` a boolean flag Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Accept no duration in `MainExit::new` Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Impl self-install mode in main_impl.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Use `--self-install` mode in install-from-binstall-release.sh Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Use `--self-install` in install-from-binstall-release.ps1 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix import in mod entry Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix call of `self_install` in `main_impl` Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix `--self-install` clap doc Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix `entry::self_install` Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Apply suggestions from code review Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix parsing semver number in entry.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix compilation in entry.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * fix entry.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix fmt in bin_util.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix fmt in entry.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Use --self-install if supported in unix install script Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Use --self-install if available in powershell install script Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix install-from-binstall-release.ps1 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fi install-from-binstall-release.ps1 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix install-from-binstall-release.ps1 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Create self-install.sh Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Add e2e-test-self-install to justfile Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix args::parse() for self-install mode Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix args parsing: Do no require positional arg if --self-install is present Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/bin/Cargo.toml | 1 + crates/bin/src/args.rs | 9 +++++- crates/bin/src/bin_util.rs | 13 ++++----- crates/bin/src/entry.rs | 46 +++++++++++++++++++++++++++++++ crates/bin/src/main_impl.rs | 9 +++--- e2e-tests/self-install.sh | 14 ++++++++++ install-from-binstall-release.ps1 | 7 ++++- install-from-binstall-release.sh | 2 +- justfile | 3 +- 9 files changed, 89 insertions(+), 15 deletions(-) create mode 100644 e2e-tests/self-install.sh diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index d37b036f..6cba3dae 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,6 +22,7 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] +atomic-file-install = { version = "1.0.5", path = "../atomic-file-install" } binstalk = { path = "../binstalk", version = "0.28.11", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.8" } clap = { version = "4.5.3", features = ["derive", "env"] } diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index dc4480b4..8cf81ac7 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -52,7 +52,7 @@ pub struct Args { #[clap( help_heading = "Package selection", value_name = "crate[@version]", - required_unless_present_any = ["version", "help"], + required_unless_present_any = ["version", "self_install", "help"], )] pub(crate) crate_names: Vec, @@ -404,6 +404,9 @@ pub struct Args { /// This would override the `log_level`. #[clap(help_heading = "Meta", short, long, conflicts_with("verbose"))] pub(crate) quiet: bool, + + #[clap(long, hide(true))] + pub(crate) self_install: bool, } #[derive(Debug, Clone)] @@ -515,6 +518,10 @@ pub fn parse() -> (Args, PkgOverride) { // Load options let mut opts = Args::parse_from(args); + if opts.self_install { + return (opts, Default::default()); + } + if opts.log_level.is_none() { if let Some(log) = env::var("BINSTALL_LOG_LEVEL") .ok() diff --git a/crates/bin/src/bin_util.rs b/crates/bin/src/bin_util.rs index df49c3f1..9761526f 100644 --- a/crates/bin/src/bin_util.rs +++ b/crates/bin/src/bin_util.rs @@ -36,13 +36,12 @@ impl Termination for MainExit { } impl MainExit { - pub fn new(res: Result<()>, done: Duration) -> Self { - res.map(|()| MainExit::Success(Some(done))) - .unwrap_or_else(|err| { - err.downcast::() - .map(MainExit::Error) - .unwrap_or_else(MainExit::Report) - }) + pub fn new(res: Result<()>, done: Option) -> Self { + res.map(|()| MainExit::Success(done)).unwrap_or_else(|err| { + err.downcast::() + .map(MainExit::Error) + .unwrap_or_else(MainExit::Report) + }) } } diff --git a/crates/bin/src/entry.rs b/crates/bin/src/entry.rs index 5fbf6e84..43feaa3a 100644 --- a/crates/bin/src/entry.rs +++ b/crates/bin/src/entry.rs @@ -5,6 +5,7 @@ use std::{ time::Duration, }; +use atomic_file_install::atomic_install; use binstalk::{ errors::{BinstallError, CrateContextError}, fetchers::{Fetcher, GhCrateMeta, QuickInstall, SignaturePolicy}, @@ -20,16 +21,20 @@ use binstalk::{ resolve::{CrateName, Resolution, ResolutionFetch, VersionReqExt}, CargoTomlFetchOverride, Options, Resolver, }, + TARGET, }; use binstalk_manifests::{ cargo_config::Config, cargo_toml_binstall::{PkgOverride, Strategy}, + crate_info::{CrateInfo, CrateSource}, crates_manifests::Manifests, }; +use compact_str::CompactString; use file_format::FileFormat; use home::cargo_home; use log::LevelFilter; use miette::{miette, Report, Result, WrapErr}; +use semver::Version; use tokio::task::block_in_place; use tracing::{debug, error, info, warn}; @@ -582,3 +587,44 @@ fn do_install_fetches_continue_on_failure( Ok(()) }) } + +pub fn self_install(args: Args) -> Result<()> { + // Load .cargo/config.toml + let cargo_home = cargo_home().map_err(BinstallError::from)?; + let mut config = Config::load_from_path(cargo_home.join("config.toml"))?; + + // Compute paths + let cargo_root = args.root; + let (install_path, manifests, _) = compute_paths_and_load_manifests( + cargo_root.clone(), + args.install_path, + args.no_track, + cargo_home, + &mut config, + )?; + + let mut dest = install_path.join("cargo-binstall"); + if cfg!(windows) { + assert!(dest.set_extension("exe")); + } + + atomic_install(&env::current_exe().map_err(BinstallError::from)?, &dest) + .map_err(BinstallError::from)?; + + if let Some(manifests) = manifests { + manifests.update(vec![CrateInfo { + name: CompactString::const_new("cargo-binstall"), + version_req: CompactString::const_new("*"), + current_version: Version::new( + env!("CARGO_PKG_VERSION_MAJOR").parse().unwrap(), + env!("CARGO_PKG_VERSION_MINOR").parse().unwrap(), + env!("CARGO_PKG_VERSION_PATCH").parse().unwrap(), + ), + source: CrateSource::cratesio_registry(), + target: CompactString::const_new(TARGET), + bins: vec![CompactString::const_new("cargo-binstall")], + }])?; + } + + Ok(()) +} diff --git a/crates/bin/src/main_impl.rs b/crates/bin/src/main_impl.rs index 2c78960b..51d29ccc 100644 --- a/crates/bin/src/main_impl.rs +++ b/crates/bin/src/main_impl.rs @@ -12,9 +12,6 @@ use crate::{ }; pub fn do_main() -> impl Termination { - // This must be the very first thing to happen - let jobserver_client = LazyJobserverClient::new(); - let (args, cli_overrides) = args::parse(); if args.version { @@ -46,6 +43,8 @@ rustc-llvm-version: {rustc_llvm_version}"# println!("{cargo_binstall_version}"); } MainExit::Success(None) + } else if args.self_install { + MainExit::new(entry::self_install(args), None) } else { logging( args.log_level.unwrap_or(LevelFilter::Info), @@ -54,12 +53,14 @@ rustc-llvm-version: {rustc_llvm_version}"# let start = Instant::now(); + let jobserver_client = LazyJobserverClient::new(); + let result = run_tokio_main(|| entry::install_crates(args, cli_overrides, jobserver_client)); let done = start.elapsed(); debug!("run time: {done:?}"); - MainExit::new(result, done) + MainExit::new(result, Some(done)) } } diff --git a/e2e-tests/self-install.sh b/e2e-tests/self-install.sh new file mode 100644 index 00000000..e00f3538 --- /dev/null +++ b/e2e-tests/self-install.sh @@ -0,0 +1,14 @@ +#!/bin/bash + +set -euxo pipefail + +unset CARGO_INSTALL_ROOT + +CARGO_HOME=$(mktemp -d 2>/dev/null || mktemp -d -t 'cargo-home') +export CARGO_HOME +export PATH="$CARGO_HOME/bin:$PATH" + +"./$1" --self-install + +cargo binstall --help +cargo install --list diff --git a/install-from-binstall-release.ps1 b/install-from-binstall-release.ps1 index 0e0a39c2..4a31f878 100644 --- a/install-from-binstall-release.ps1 +++ b/install-from-binstall-release.ps1 @@ -19,7 +19,12 @@ $url = "$base_url$arch-pc-windows-msvc.zip" Invoke-WebRequest $url -OutFile $tmpdir\cargo-binstall.zip Expand-Archive -Force $tmpdir\cargo-binstall.zip $tmpdir\cargo-binstall Write-Host "" -Invoke-Expression "$tmpdir\cargo-binstall\cargo-binstall.exe -y --force cargo-binstall" + +$ps = Start-Process -PassThru -Wait "$tmpdir\cargo-binstall\cargo-binstall.exe" "--self-install" +if ($ps.ExitCode -ne 0) { + Invoke-Expression "$tmpdir\cargo-binstall\cargo-binstall.exe -y --force cargo-binstall" +} + Remove-Item -Force $tmpdir\cargo-binstall.zip Remove-Item -Recurse -Force $tmpdir\cargo-binstall $cargo_home = if ($Env:CARGO_HOME -ne $null) { $Env:CARGO_HOME } else { "$HOME\.cargo" } diff --git a/install-from-binstall-release.sh b/install-from-binstall-release.sh index fa4f8222..97cf0cca 100755 --- a/install-from-binstall-release.sh +++ b/install-from-binstall-release.sh @@ -36,7 +36,7 @@ else exit 1 fi -./cargo-binstall -y --force cargo-binstall +./cargo-binstall --self-install || ./cargo-binstall -y --force cargo-binstall CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" diff --git a/justfile b/justfile index bb7ab556..291ad42a 100644 --- a/justfile +++ b/justfile @@ -244,6 +244,7 @@ e2e-test-registries: (e2e-test "registries") e2e-test-signing: (e2e-test "signing") e2e-test-continue-on-failure: (e2e-test "continue-on-failure") e2e-test-private-github-repo: (e2e-test "private-github-repo") +e2e-test-self-install: (e2e-test "self-install") # WinTLS (Windows in CI) does not have TLS 1.3 support [windows] @@ -252,7 +253,7 @@ e2e-test-tls: (e2e-test "tls" "1.2") [macos] e2e-test-tls: (e2e-test "tls" "1.2") (e2e-test "tls" "1.3") -e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-git e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate e2e-test-no-track e2e-test-registries e2e-test-signing e2e-test-continue-on-failure e2e-test-private-github-repo +e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-git e2e-test-other-repos e2e-test-strategies e2e-test-version-syntax e2e-test-upgrade e2e-test-tls e2e-test-self-upgrade-no-symlink e2e-test-uninstall e2e-test-subcrate e2e-test-no-track e2e-test-registries e2e-test-signing e2e-test-continue-on-failure e2e-test-private-github-repo e2e-test-self-install unit-tests: print-env cargo test --no-run --target {{target}} From 3677ac112d2edd4c74f28a4a6d1b34cdbf80e746 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 9 Nov 2024 07:22:29 +0000 Subject: [PATCH 1914/2020] chore: release (#1965) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 21 +++++++++++---------- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-bins/CHANGELOG.md | 6 ++++++ crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-downloader/CHANGELOG.md | 6 ++++++ crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/CHANGELOG.md | 6 ++++++ crates/binstalk-fetchers/Cargo.toml | 8 ++++---- crates/binstalk-git-repo-api/CHANGELOG.md | 6 ++++++ crates/binstalk-git-repo-api/Cargo.toml | 6 +++--- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk-registry/CHANGELOG.md | 6 ++++++ crates/binstalk-registry/Cargo.toml | 8 ++++---- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 16 ++++++++-------- crates/cargo-toml-workspace/CHANGELOG.md | 6 ++++++ crates/cargo-toml-workspace/Cargo.toml | 2 +- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- 22 files changed, 99 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8b54362d..5c93ab9a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -256,7 +256,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.11" +version = "0.28.12" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -288,7 +288,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.6.2" +version = "0.6.3" dependencies = [ "atomic-file-install", "binstalk-types", @@ -302,7 +302,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.13.3" +version = "0.13.4" dependencies = [ "async-compression", "async-trait", @@ -338,7 +338,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.10.3" +version = "0.10.4" dependencies = [ "async-trait", "binstalk-downloader", @@ -362,7 +362,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.5" +version = "0.5.6" dependencies = [ "binstalk-downloader", "compact_str", @@ -381,7 +381,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.8" +version = "0.15.9" dependencies = [ "beef", "binstalk-types", @@ -402,7 +402,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.11.3" +version = "0.11.4" dependencies = [ "async-trait", "base16", @@ -564,6 +564,7 @@ dependencies = [ name = "cargo-binstall" version = "1.10.11" dependencies = [ + "atomic-file-install", "binstalk", "binstalk-manifests", "clap", @@ -601,7 +602,7 @@ dependencies = [ [[package]] name = "cargo-toml-workspace" -version = "6.0.2" +version = "6.0.3" dependencies = [ "cargo_toml", "compact_str", @@ -907,7 +908,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.27" +version = "0.1.28" dependencies = [ "cfg-if", "guess_host_triple", @@ -919,7 +920,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.10" +version = "1.0.11" dependencies = [ "tempfile", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 6cba3dae..656d8738 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,8 +23,8 @@ pkg-fmt = "zip" [dependencies] atomic-file-install = { version = "1.0.5", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.11", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.8" } +binstalk = { path = "../binstalk", version = "0.28.12", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.9" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-bins/CHANGELOG.md b/crates/binstalk-bins/CHANGELOG.md index f334bffc..af783299 100644 --- a/crates/binstalk-bins/CHANGELOG.md +++ b/crates/binstalk-bins/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.6.3](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.2...binstalk-bins-v0.6.3) - 2024-11-09 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1966](https://github.com/cargo-bins/cargo-binstall/pull/1966)) + ## [0.6.2](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.1...binstalk-bins-v0.6.2) - 2024-11-05 ### Other diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 4c618400..71addaaa 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.6.2" +version = "0.6.3" edition = "2021" description = "The binstall binaries discovery and installation crate." diff --git a/crates/binstalk-downloader/CHANGELOG.md b/crates/binstalk-downloader/CHANGELOG.md index 2b3febdc..3d637179 100644 --- a/crates/binstalk-downloader/CHANGELOG.md +++ b/crates/binstalk-downloader/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.13.4](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.3...binstalk-downloader-v0.13.4) - 2024-11-09 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1966](https://github.com/cargo-bins/cargo-binstall/pull/1966)) + ## [0.13.3](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.2...binstalk-downloader-v0.13.3) - 2024-11-05 ### Other diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 12f37f49..0c3d8f77 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.13.3" +version = "0.13.4" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index 76307775..5709d1ec 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.4](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.3...binstalk-fetchers-v0.10.4) - 2024-11-09 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1966](https://github.com/cargo-bins/cargo-binstall/pull/1966)) + ## [0.10.3](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.2...binstalk-fetchers-v0.10.3) - 2024-11-05 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 1400dd96..8a67361c 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.10.3" +version = "0.10.4" edition = "2021" description = "The binstall fetchers" @@ -12,8 +12,8 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.13.3", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.5", path = "../binstalk-git-repo-api" } +binstalk-downloader = { version = "0.13.4", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.6", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.9.1", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.5.3" [dev-dependencies] -binstalk-downloader = { version = "0.13.3", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.4", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index c0d2f3d3..b86101b1 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.6](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.5...binstalk-git-repo-api-v0.5.6) - 2024-11-09 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1966](https://github.com/cargo-bins/cargo-binstall/pull/1966)) + ## [0.5.5](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.4...binstalk-git-repo-api-v0.5.5) - 2024-11-05 ### Other diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 5f391470..e0f1bac8 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.5" +version = "0.5.6" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.13.3", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.4", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.8.0" @@ -25,6 +25,6 @@ url = "2.5.3" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.3", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.4", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index 7a922a7f..3775ec5b 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.9](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.8...binstalk-manifests-v0.15.9) - 2024-11-09 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1966](https://github.com/cargo-bins/cargo-binstall/pull/1966)) + ## [0.15.8](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.7...binstalk-manifests-v0.15.8) - 2024-11-05 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index e95f72ae..501286fc 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.8" +version = "0.15.9" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.3", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.27", path = "../detect-targets" } +detect-targets = { version = "0.1.28", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md index 8fc19c48..dfed1124 100644 --- a/crates/binstalk-registry/CHANGELOG.md +++ b/crates/binstalk-registry/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.4](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.3...binstalk-registry-v0.11.4) - 2024-11-09 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1966](https://github.com/cargo-bins/cargo-binstall/pull/1966)) + ## [0.11.3](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.2...binstalk-registry-v0.11.3) - 2024-11-05 ### Other diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 36d0fcde..1e68cd22 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.11.3" +version = "0.11.4" edition = "2021" rust-version = "1.65.0" @@ -13,11 +13,11 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.13.3", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.4", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.9.1", path = "../binstalk-types" } -cargo-toml-workspace = { version = "6.0.2", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "6.0.3", path = "../cargo-toml-workspace" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" @@ -40,7 +40,7 @@ url = "2.5.3" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.13.3", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.4", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index b8559b94..babcd84c 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.12](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.11...binstalk-v0.28.12) - 2024-11-09 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1966](https://github.com/cargo-bins/cargo-binstall/pull/1966)) + ## [0.28.11](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.10...binstalk-v0.28.11) - 2024-11-05 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index bc0a13ff..295672df 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,25 +3,25 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.11" +version = "0.28.12" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.6.2", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.13.3", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.5", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.10.3", path = "../binstalk-fetchers", features = [ +binstalk-bins = { version = "0.6.3", path = "../binstalk-bins" } +binstalk-downloader = { version = "0.13.4", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.6", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.10.4", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.11.3", path = "../binstalk-registry" } +binstalk-registry = { version = "0.11.4", path = "../binstalk-registry" } binstalk-types = { version = "0.9.1", path = "../binstalk-types" } -cargo-toml-workspace = { version = "6.0.2", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "6.0.3", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.27", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.28", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/cargo-toml-workspace/CHANGELOG.md b/crates/cargo-toml-workspace/CHANGELOG.md index 63676c54..d460c883 100644 --- a/crates/cargo-toml-workspace/CHANGELOG.md +++ b/crates/cargo-toml-workspace/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [6.0.3](https://github.com/cargo-bins/cargo-binstall/compare/cargo-toml-workspace-v6.0.2...cargo-toml-workspace-v6.0.3) - 2024-11-09 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1966](https://github.com/cargo-bins/cargo-binstall/pull/1966)) + ## [6.0.2](https://github.com/cargo-bins/cargo-binstall/compare/cargo-toml-workspace-v6.0.1...cargo-toml-workspace-v6.0.2) - 2024-11-05 ### Other diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 0703faed..06d25f35 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-toml-workspace" -version = "6.0.2" +version = "6.0.3" edition = "2021" description = "Parse cargo workspace and load specific crate" repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index 3cd3e706..0c731e6c 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.28](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.27...detect-targets-v0.1.28) - 2024-11-09 + +### Other + +- update Cargo.lock dependencies + ## [0.1.27](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.26...detect-targets-v0.1.27) - 2024-11-05 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index f3040ede..4d1fffd7 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.27" +version = "0.1.28" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index 5d82ced5..e362364a 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.11](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.10...detect-wasi-v1.0.11) - 2024-11-09 + +### Other + +- update Cargo.lock dependencies + ## [1.0.10](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.9...detect-wasi-v1.0.10) - 2024-11-05 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index c07b6dc7..f1b53931 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.10" +version = "1.0.11" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From dae59123ebcd0833a1b28f1af21ab08352d3965b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 9 Nov 2024 09:17:15 +0000 Subject: [PATCH 1915/2020] release: cargo-binstall v1.10.12 (#1968) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5c93ab9a..2bf4325f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -562,7 +562,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.11" +version = "1.10.12" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 656d8738..bed9f188 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.11" +version = "1.10.12" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index d3825186..3db63900 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 8dbc22a45b3a7e3332e915e1957e056d6717f73d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 16 Nov 2024 15:43:14 +1000 Subject: [PATCH 1916/2020] dep: Upgrade transitive dependencies (#1969) * dep: Upgrade transitive dependencies * Fix self-install failure reflink_or_copy now fails if the dest already exists https://github.com/cargo-bins/reflink-copy/commit/9e0b2cf4278146c19782ea458a73a39871d21dd5 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Co-authored-by: github-actions Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- Cargo.lock | 220 ++++++++++++++------------ crates/atomic-file-install/src/lib.rs | 1 + 2 files changed, 120 insertions(+), 101 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2bf4325f..f319ca1f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,9 +61,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611cc2ae7d2e242c457e4be7f97036b8ad9ca152b499f53faf99b1ed8fc2553f" +checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" [[package]] name = "android-tzdata" @@ -279,7 +279,7 @@ dependencies = [ "strum", "target-lexicon", "tempfile", - "thiserror 2.0.1", + "thiserror 2.0.3", "tokio", "tracing", "url", @@ -296,7 +296,7 @@ dependencies = [ "leon", "miette", "normalize-path", - "thiserror 2.0.1", + "thiserror 2.0.3", "tracing", ] @@ -326,7 +326,7 @@ dependencies = [ "serde", "serde_json", "tempfile", - "thiserror 2.0.1", + "thiserror 2.0.3", "tokio", "tokio-tar", "tokio-util", @@ -354,7 +354,7 @@ dependencies = [ "minisign-verify", "once_cell", "strum", - "thiserror 2.0.1", + "thiserror 2.0.3", "tokio", "tracing", "url", @@ -371,7 +371,7 @@ dependencies = [ "serde", "serde-tuple-vec-map", "serde_json", - "thiserror 2.0.1", + "thiserror 2.0.3", "tokio", "tracing", "tracing-subscriber", @@ -395,7 +395,7 @@ dependencies = [ "serde-tuple-vec-map", "serde_json", "tempfile", - "thiserror 2.0.1", + "thiserror 2.0.3", "toml_edit", "url", ] @@ -420,7 +420,7 @@ dependencies = [ "sha2", "simple-git", "tempfile", - "thiserror 2.0.1", + "thiserror 2.0.3", "tokio", "toml_edit", "tracing", @@ -497,9 +497,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40723b8fb387abc38f4f4a37c09073622e41dd12327033091ef8950659e6dc0c" +checksum = "1a68f1f47cdf0ec8ee4b941b2eee2a80cb796db73118c0dd09ac63fbe405be22" dependencies = [ "memchr", "regex-automata", @@ -610,7 +610,7 @@ dependencies = [ "normalize-path", "serde", "tempfile", - "thiserror 2.0.1", + "thiserror 2.0.3", "tracing", ] @@ -625,7 +625,7 @@ dependencies = [ "semver", "serde", "serde_json", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -649,9 +649,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.37" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40545c26d092346d8a8dab71ee48e7685a7a9cba76e634790c215b41a4a7b4cf" +checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" dependencies = [ "jobserver", "libc", @@ -697,9 +697,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.20" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b97f376d85a664d5837dbae44bf546e6477a679ff6610010f17276f686d867e8" +checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" dependencies = [ "clap_builder", "clap_derive", @@ -707,9 +707,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.20" +version = "4.5.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19bc80abd44e4bed93ca373a0704ccbd1b710dc5749406201bb018272808dc54" +checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" dependencies = [ "anstream", "anstyle", @@ -731,9 +731,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1462739cb27611015575c0c11df5df7601141071f07518d56fcc1be504cbec97" +checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" [[package]] name = "clru" @@ -801,9 +801,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "608697df725056feaccfa42cffdaeeec3fccc4ffc38358ecd19b243e716a78e0" +checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6" dependencies = [ "libc", ] @@ -1097,9 +1097,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.34" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" +checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "libz-ng-sys", @@ -1259,8 +1259,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" dependencies = [ "cfg-if", + "js-sys", "libc", "wasi", + "wasm-bindgen", ] [[package]] @@ -1318,7 +1320,7 @@ dependencies = [ "gix-worktree-state", "once_cell", "smallvec", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1331,7 +1333,7 @@ dependencies = [ "gix-date", "gix-utils", "itoa", - "thiserror 1.0.68", + "thiserror 1.0.69", "winnow 0.6.20", ] @@ -1348,7 +1350,7 @@ dependencies = [ "gix-trace", "kstring", "smallvec", - "thiserror 1.0.68", + "thiserror 1.0.69", "unicode-bom", ] @@ -1358,7 +1360,7 @@ version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10f78312288bd02052be5dbc2ecbc342c9f4eb791986d86c0a5c06b92dc72efa" dependencies = [ - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1367,7 +1369,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c28b58ba04f0c004722344390af9dbc85888fbb84be1981afb934da4114d4cf" dependencies = [ - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1393,7 +1395,7 @@ dependencies = [ "gix-features", "gix-hash", "memmap2", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1412,7 +1414,7 @@ dependencies = [ "memchr", "once_cell", "smallvec", - "thiserror 1.0.68", + "thiserror 1.0.69", "unicode-bom", "winnow 0.6.20", ] @@ -1427,7 +1429,7 @@ dependencies = [ "bstr", "gix-path", "libc", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1444,7 +1446,7 @@ dependencies = [ "gix-sec", "gix-trace", "gix-url", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1456,7 +1458,7 @@ dependencies = [ "bstr", "itoa", "jiff", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1468,7 +1470,7 @@ dependencies = [ "bstr", "gix-hash", "gix-object", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1484,7 +1486,7 @@ dependencies = [ "gix-path", "gix-ref", "gix-sec", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1507,7 +1509,7 @@ dependencies = [ "prodash", "sha1", "sha1_smol", - "thiserror 1.0.68", + "thiserror 1.0.69", "walkdir", ] @@ -1529,7 +1531,7 @@ dependencies = [ "gix-trace", "gix-utils", "smallvec", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1562,7 +1564,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "952c3a29f1bc1007cc901abce7479943abfa42016db089de33d0a4fa3c85bfe8" dependencies = [ "faster-hex", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1614,7 +1616,7 @@ dependencies = [ "memmap2", "rustix", "smallvec", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1625,7 +1627,7 @@ checksum = "5102acdf4acae2644e38dbbd18cdfba9597a218f7d85f810fe5430207e03c2de" dependencies = [ "gix-tempfile", "gix-utils", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1641,7 +1643,7 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1660,7 +1662,7 @@ dependencies = [ "gix-validate", "itoa", "smallvec", - "thiserror 1.0.68", + "thiserror 1.0.69", "winnow 0.6.20", ] @@ -1682,7 +1684,7 @@ dependencies = [ "gix-quote", "parking_lot", "tempfile", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1702,7 +1704,7 @@ dependencies = [ "memmap2", "parking_lot", "smallvec", - "thiserror 1.0.68", + "thiserror 1.0.69", "uluru", ] @@ -1715,7 +1717,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1727,7 +1729,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1740,7 +1742,7 @@ dependencies = [ "gix-trace", "home", "once_cell", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1755,7 +1757,7 @@ dependencies = [ "gix-config-value", "gix-glob", "gix-path", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1768,7 +1770,7 @@ dependencies = [ "gix-config-value", "parking_lot", "rustix", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1785,7 +1787,7 @@ dependencies = [ "gix-transport", "gix-utils", "maybe-async", - "thiserror 1.0.68", + "thiserror 1.0.69", "winnow 0.6.20", ] @@ -1797,7 +1799,7 @@ checksum = "f89f9a1525dcfd9639e282ea939f5ab0d09d93cf2b90c1fc6104f1b9582a8e49" dependencies = [ "bstr", "gix-utils", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1817,7 +1819,7 @@ dependencies = [ "gix-utils", "gix-validate", "memmap2", - "thiserror 1.0.68", + "thiserror 1.0.69", "winnow 0.6.20", ] @@ -1832,7 +1834,7 @@ dependencies = [ "gix-revision", "gix-validate", "smallvec", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1847,7 +1849,7 @@ dependencies = [ "gix-hash", "gix-object", "gix-revwalk", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1862,7 +1864,7 @@ dependencies = [ "gix-hashtable", "gix-object", "smallvec", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1889,7 +1891,7 @@ dependencies = [ "gix-pathspec", "gix-refspec", "gix-url", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1927,7 +1929,7 @@ dependencies = [ "gix-sec", "gix-url", "reqwest", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1944,7 +1946,7 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -1956,7 +1958,7 @@ dependencies = [ "bstr", "gix-features", "gix-path", - "thiserror 1.0.68", + "thiserror 1.0.69", "url", ] @@ -1977,7 +1979,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e187b263461bc36cea17650141567753bc6207d036cedd1de6e81a52f277ff68" dependencies = [ "bstr", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -2016,7 +2018,7 @@ dependencies = [ "gix-path", "gix-worktree", "io-close", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -2141,7 +2143,7 @@ dependencies = [ "rand", "ring", "rustls", - "thiserror 1.0.68", + "thiserror 1.0.69", "time", "tinyvec", "tokio", @@ -2169,7 +2171,7 @@ dependencies = [ "resolv-conf", "rustls", "smallvec", - "thiserror 1.0.68", + "thiserror 1.0.69", "tokio", "tokio-native-tls", "tokio-rustls", @@ -2634,19 +2636,19 @@ checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "leon" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d82a8693bd856b8b0596b6abed75d494ba6ca04b8e1b12be3a2ab947c305d8b1" +checksum = "42a865ffec5587961f5afc6d365bccb304f4feaa1928f4fe94c91c9d210d7310" dependencies = [ "miette", - "thiserror 1.0.68", + "thiserror 2.0.3", ] [[package]] name = "leon-macros" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf3621546e1f1fedade073ad01f1c1bf561584a9b4c83c37728a28da69544aa" +checksum = "e0c7ff357e507638488e191166c6e396ff53f921664547d40fe63aa38e5014b0" dependencies = [ "leon", "proc-macro2", @@ -2818,7 +2820,7 @@ dependencies = [ "supports-unicode", "terminal_size", "textwrap", - "thiserror 1.0.68", + "thiserror 1.0.69", "unicode-width", ] @@ -2935,7 +2937,7 @@ dependencies = [ "anyhow", "byteorder", "paste", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] @@ -3323,9 +3325,9 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quinn" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c7c5fdde3cdae7203427dc4f0a68fe0ed09833edc525a03456b153b79828684" +checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" dependencies = [ "bytes", "futures-io", @@ -3335,26 +3337,29 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror 1.0.68", + "thiserror 2.0.3", "tokio", "tracing", ] [[package]] name = "quinn-proto" -version = "0.11.8" +version = "0.11.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fadfaed2cd7f389d0161bb73eeb07b7b78f8691047a6f3e73caaeae55310a4a6" +checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", + "getrandom", "rand", "ring", "rustc-hash", "rustls", + "rustls-pki-types", "slab", - "thiserror 1.0.68", + "thiserror 2.0.3", "tinyvec", "tracing", + "web-time", ] [[package]] @@ -3428,7 +3433,7 @@ dependencies = [ "oem_cp", "oval", "ownable", - "thiserror 1.0.68", + "thiserror 1.0.69", "tracing", "winnow 0.5.40", "zstd", @@ -3472,14 +3477,14 @@ checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ "getrandom", "libredox", - "thiserror 1.0.68", + "thiserror 1.0.69", ] [[package]] name = "reflink-copy" -version = "0.1.19" +version = "0.1.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc31414597d1cd7fdd2422798b7652a6329dda0fe0219e6335a13d5bcaa9aeb6" +checksum = "17400ed684c3a0615932f00c271ae3eea13e47056a1455821995122348ab6438" dependencies = [ "cfg-if", "rustix", @@ -3500,9 +3505,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -3619,9 +3624,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.39" +version = "0.38.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "375116bee2be9ed569afe2154ea6a99dfdffd257f533f187498c2a8f5feaf4ee" +checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" dependencies = [ "bitflags 2.6.0", "errno 0.3.9", @@ -3672,6 +3677,9 @@ name = "rustls-pki-types" version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +dependencies = [ + "web-time", +] [[package]] name = "rustls-webpki" @@ -3754,9 +3762,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55c3193aca71c12ad7890f1785d2b73e1b9f63a0bbc353c08ef26fe03fc56b5" +checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" dependencies = [ "serde_derive", ] @@ -3772,9 +3780,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.214" +version = "1.0.215" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de523f781f095e28fa605cdce0f8307e451cc0fd14e2eb4cd2e98a355b147766" +checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" dependencies = [ "proc-macro2", "quote", @@ -3891,7 +3899,7 @@ dependencies = [ "compact_str", "derive_destructure2", "gix", - "thiserror 1.0.68", + "thiserror 1.0.69", "tokio", "tracing", ] @@ -4118,27 +4126,27 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02dd99dc800bbb97186339685293e1cc5d9df1f8fae2d0aecd9ff1c77efea892" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" dependencies = [ - "thiserror-impl 1.0.68", + "thiserror-impl 1.0.69", ] [[package]] name = "thiserror" -version = "2.0.1" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07c1e40dd48a282ae8edc36c732cbc219144b87fb6a4c7316d611c6b1f06ec0c" +checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" dependencies = [ - "thiserror-impl 2.0.1", + "thiserror-impl 2.0.3", ] [[package]] name = "thiserror-impl" -version = "1.0.68" +version = "1.0.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7c61ec9a6f64d2793d8a45faba21efbe3ced62a886d44c36a009b2b519b4c7e" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", @@ -4147,9 +4155,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.1" +version = "2.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "874aa7e446f1da8d9c3a5c95b1c5eb41d800045252121dc7f8e0ba370cee55f5" +checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" dependencies = [ "proc-macro2", "quote", @@ -4687,6 +4695,16 @@ dependencies = [ "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 = "0.26.6" diff --git a/crates/atomic-file-install/src/lib.rs b/crates/atomic-file-install/src/lib.rs index 63ad812a..4f444262 100644 --- a/crates/atomic-file-install/src/lib.rs +++ b/crates/atomic-file-install/src/lib.rs @@ -33,6 +33,7 @@ fn copy_to_tempfile(src: &Path, dst: &Path) -> io::Result { src.display(), tempfile.path().display() ); + fs::remove_file(tempfile.path())?; // src and dst is likely to be on the same filesystem. // Uses reflink if the fs support it, or fallback to // `fs::copy` if it doesn't support it or it is not on the From b1aaafcd756ce7c23a45680c534be1de8b69dd75 Mon Sep 17 00:00:00 2001 From: Christian Bruckmayer <3799140+ChrisBr@users.noreply.github.com> Date: Mon, 18 Nov 2024 08:04:34 +0000 Subject: [PATCH 1917/2020] Use git credential helper (#1871) * Use git credential helper * Fix compilation Signed-off-by: Jiahao XU * Add back `gh auth token` in `gh_token::get` Signed-off-by: Jiahao XU * Fix confusing `.expect` msg Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU Co-authored-by: Jiahao XU --- crates/bin/src/gh_token.rs | 107 +++++++++++++++++++++++++++++-------- 1 file changed, 85 insertions(+), 22 deletions(-) diff --git a/crates/bin/src/gh_token.rs b/crates/bin/src/gh_token.rs index 837f9f95..9cc7adeb 100644 --- a/crates/bin/src/gh_token.rs +++ b/crates/bin/src/gh_token.rs @@ -4,33 +4,96 @@ use std::{ str, }; -use tokio::process::Command; -use zeroize::Zeroizing; +use tokio::{io::AsyncWriteExt, process::Command}; +use zeroize::{Zeroize, Zeroizing}; pub(super) async fn get() -> io::Result>> { - let Output { status, stdout, .. } = Command::new("gh") + let output = Command::new("gh") .args(["auth", "token"]) - .stdin(Stdio::null()) - .stdout(Stdio::piped()) - .stderr(Stdio::null()) - .output() + .stdout_with_optional_input(None) .await?; - let stdout = Zeroizing::new(stdout); - - if !status.success() { - return Err(io::Error::new( - io::ErrorKind::Other, - format!("process exited with `{status}`"), - )); + if !output.is_empty() { + return Ok(output); } - let s = str::from_utf8(&stdout).map_err(|err| { - io::Error::new( - io::ErrorKind::InvalidData, - format!("Invalid output, expected utf8: {err}"), - ) - })?; - - Ok(Zeroizing::new(s.trim().into())) + Command::new("git") + .args(["credential", "fill"]) + .stdout_with_optional_input(Some("host=github.com\nprotocol=https".as_bytes())) + .await? + .lines() + .find_map(|line| { + line.trim() + .strip_prefix("password=") + .map(|token| Zeroizing::new(token.into())) + }) + .ok_or_else(|| { + io::Error::new( + io::ErrorKind::Other, + "Password not found in `git credential fill` output", + ) + }) +} + +trait CommandExt { + // Helper function to execute a command, optionally with input + async fn stdout_with_optional_input( + &mut self, + input: Option<&[u8]>, + ) -> io::Result>>; +} + +impl CommandExt for Command { + async fn stdout_with_optional_input( + &mut self, + input: Option<&[u8]>, + ) -> io::Result>> { + self.stdout(Stdio::piped()) + .stderr(Stdio::null()) + .stdin(if input.is_some() { + Stdio::piped() + } else { + Stdio::null() + }); + + let mut child = self.spawn()?; + + if let Some(input) = input { + child.stdin.take().unwrap().write_all(input).await?; + } + + let Output { status, stdout, .. } = child.wait_with_output().await?; + + if status.success() { + let s = String::from_utf8(stdout).map_err(|err| { + let msg = format!( + "Invalid output for `{:?}`, expected utf8: {err}", + self.as_std() + ); + + zeroize_and_drop(err.into_bytes()); + + io::Error::new(io::ErrorKind::InvalidData, msg) + })?; + + let trimmed = s.trim(); + + Ok(if trimmed.len() == s.len() { + Zeroizing::new(s.into_boxed_str()) + } else { + Zeroizing::new(trimmed.into()) + }) + } else { + zeroize_and_drop(stdout); + + Err(io::Error::new( + io::ErrorKind::Other, + format!("`{:?}` process exited with `{status}`", self.as_std()), + )) + } + } +} + +fn zeroize_and_drop(mut bytes: Vec) { + bytes.zeroize(); } From 10a53e7bfb0be785033609c4fa20ae67e676c1e9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 08:29:17 +0000 Subject: [PATCH 1918/2020] chore: release (#1972) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 12 ++++++------ crates/atomic-file-install/CHANGELOG.md | 14 ++++++++++++++ crates/atomic-file-install/Cargo.toml | 2 +- crates/bin/Cargo.toml | 6 +++--- crates/binstalk-bins/CHANGELOG.md | 6 ++++++ crates/binstalk-bins/Cargo.toml | 4 ++-- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 6 +++--- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- 14 files changed, 63 insertions(+), 19 deletions(-) create mode 100644 crates/atomic-file-install/CHANGELOG.md diff --git a/Cargo.lock b/Cargo.lock index f319ca1f..960554f1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -189,7 +189,7 @@ dependencies = [ [[package]] name = "atomic-file-install" -version = "1.0.5" +version = "1.0.6" dependencies = [ "reflink-copy", "tempfile", @@ -256,7 +256,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.12" +version = "0.28.13" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -288,7 +288,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.6.3" +version = "0.6.4" dependencies = [ "atomic-file-install", "binstalk-types", @@ -381,7 +381,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.9" +version = "0.15.10" dependencies = [ "beef", "binstalk-types", @@ -908,7 +908,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.28" +version = "0.1.29" dependencies = [ "cfg-if", "guess_host_triple", @@ -920,7 +920,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.11" +version = "1.0.12" dependencies = [ "tempfile", ] diff --git a/crates/atomic-file-install/CHANGELOG.md b/crates/atomic-file-install/CHANGELOG.md new file mode 100644 index 00000000..17f2fa7e --- /dev/null +++ b/crates/atomic-file-install/CHANGELOG.md @@ -0,0 +1,14 @@ +# Changelog + +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +## [1.0.6](https://github.com/cargo-bins/cargo-binstall/compare/atomic-file-install-v1.0.5...atomic-file-install-v1.0.6) - 2024-11-18 + +### Other + +- Upgrade transitive dependencies ([#1969](https://github.com/cargo-bins/cargo-binstall/pull/1969)) diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index 6472d276..04018d0b 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "atomic-file-install" -version = "1.0.5" +version = "1.0.6" edition = "2021" description = "For atomically installing a file or a symlink." repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index bed9f188..e1349526 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,9 +22,9 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -atomic-file-install = { version = "1.0.5", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.12", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.9" } +atomic-file-install = { version = "1.0.6", path = "../atomic-file-install" } +binstalk = { path = "../binstalk", version = "0.28.13", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.10" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-bins/CHANGELOG.md b/crates/binstalk-bins/CHANGELOG.md index af783299..a2751d6c 100644 --- a/crates/binstalk-bins/CHANGELOG.md +++ b/crates/binstalk-bins/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.6.4](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.3...binstalk-bins-v0.6.4) - 2024-11-18 + +### Other + +- updated the following local packages: atomic-file-install + ## [0.6.3](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.2...binstalk-bins-v0.6.3) - 2024-11-09 ### Other diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 71addaaa..fb99fdbf 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.6.3" +version = "0.6.4" edition = "2021" description = "The binstall binaries discovery and installation crate." @@ -11,7 +11,7 @@ authors = ["Jiahao XU "] license = "GPL-3.0-only" [dependencies] -atomic-file-install = { version = "1.0.5", path = "../atomic-file-install" } +atomic-file-install = { version = "1.0.6", path = "../atomic-file-install" } binstalk-types = { version = "0.9.1", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index 3775ec5b..9dfe1dcd 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.10](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.9...binstalk-manifests-v0.15.10) - 2024-11-18 + +### Other + +- updated the following local packages: detect-targets + ## [0.15.9](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.8...binstalk-manifests-v0.15.9) - 2024-11-09 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 501286fc..b7593817 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.9" +version = "0.15.10" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.3", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.28", path = "../detect-targets" } +detect-targets = { version = "0.1.29", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index babcd84c..7d0fa671 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.13](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.12...binstalk-v0.28.13) - 2024-11-18 + +### Other + +- updated the following local packages: detect-targets + ## [0.28.12](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.11...binstalk-v0.28.12) - 2024-11-09 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 295672df..c522c10b 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.12" +version = "0.28.13" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.6.3", path = "../binstalk-bins" } +binstalk-bins = { version = "0.6.4", path = "../binstalk-bins" } binstalk-downloader = { version = "0.13.4", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.5.6", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.10.4", path = "../binstalk-fetchers", features = [ @@ -21,7 +21,7 @@ binstalk-types = { version = "0.9.1", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.3", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.28", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.29", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index 0c731e6c..d3279353 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.29](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.28...detect-targets-v0.1.29) - 2024-11-18 + +### Other + +- update Cargo.lock dependencies + ## [0.1.28](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.27...detect-targets-v0.1.28) - 2024-11-09 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 4d1fffd7..201c21bf 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.28" +version = "0.1.29" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index e362364a..f5b151b3 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.12](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.11...detect-wasi-v1.0.12) - 2024-11-18 + +### Other + +- update Cargo.lock dependencies + ## [1.0.11](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.10...detect-wasi-v1.0.11) - 2024-11-09 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index f1b53931..c81b9fe8 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.11" +version = "1.0.12" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From 2417642284f2a1cb864bed1f62e1aa42dba91b14 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 18 Nov 2024 09:44:41 +0000 Subject: [PATCH 1919/2020] release: cargo-binstall v1.10.13 (#1973) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 960554f1..4303b20a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -562,7 +562,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.12" +version = "1.10.13" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index e1349526..156a8190 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.12" +version = "1.10.13" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 3db63900..4313acb5 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 266e6279281efec8e685d7011e488a87922dc19c Mon Sep 17 00:00:00 2001 From: Martijn Pieters Date: Wed, 20 Nov 2024 08:08:08 +0000 Subject: [PATCH 1920/2020] Fix installer downloads for specific releases (#1976) * Fix installer downloads for specific releases Github download urls for a specific release uses the pattern `../releases/download/[RELEASE]/..`, which differs from the latest release URL which uses `../releases/latest/download/..`. For convenience, if `BINSTALL_VERSION` is set but doesn't start with `v`, the v is prefixed. * ci: Set BINSTALL_VERSION in install script tests When running the install-script workflow in Github Actions, add matrix options for not setting the variable, setting it to the latest release with the `v` prefix, and setting it to the latest release without the `v` prefix. --- .github/workflows/install-script.yml | 41 ++++++++++++++++++++++++++++ install-from-binstall-release.ps1 | 15 ++++++++-- install-from-binstall-release.sh | 14 ++++++++-- 3 files changed, 65 insertions(+), 5 deletions(-) diff --git a/.github/workflows/install-script.yml b/.github/workflows/install-script.yml index 40976162..62768b03 100644 --- a/.github/workflows/install-script.yml +++ b/.github/workflows/install-script.yml @@ -31,6 +31,7 @@ jobs: matrix: os: [macos-latest, ubuntu-latest] set_cargo_home: [t, f] + set_binstall_version: ['no', 'with-v', 'without-v'] runs-on: ${{ matrix.os }} @@ -44,6 +45,18 @@ jobs: mkdir -p "${CARGO_HOME}/bin" echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" + - name: Set `BINSTALL_VERSION` + if: matrix.set_binstall_version != 'no' + env: + STRIP_V: ${{ matrix.set_cargo_home }} + GH_TOKEN: ${{ github.token }} + run: | + # fetch most recent release tag. + BINSTALL_VERSION="$(gh release list --json name --jq '[.[] | select(.name | startswith("v")) | .name] | first')" + if [[ $STRIP_V == 'without-v' ]]; then BINSTALL_VERSION="${BINSTALL_VERSION#v*}"; fi + echo "Setting BINSTALL_VERSION=$BINSTALL_VERSION" + echo "BINSTALL_VERSION=$BINSTALL_VERSION" >> "$GITHUB_ENV" + - name: Install `cargo-binstall` using scripts run: ./install-from-binstall-release.sh env: @@ -59,6 +72,7 @@ jobs: fail-fast: false matrix: set_cargo_home: [t, f] + set_binstall_version: ['no', 'with-v', 'without-v'] runs-on: windows-latest @@ -73,6 +87,19 @@ jobs: mkdir -p "${CARGO_HOME}/bin" echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" + - name: Set `BINSTALL_VERSION` + if: matrix.set_binstall_version != 'no' + shell: bash + env: + GH_TOKEN: ${{ github.token }} + STRIP_V: ${{ matrix.set_cargo_home }} + run: | + # fetch most recent release name. + BINSTALL_VERSION="$(gh release list --json name --jq '[.[] | select(.name | startswith("v")) | .name] | first')" + if [[ $STRIP_V == 'without-v' ]]; then BINSTALL_VERSION="${BINSTALL_VERSION#v*}"; fi + echo "Setting BINSTALL_VERSION=$BINSTALL_VERSION" + echo "BINSTALL_VERSION=$BINSTALL_VERSION" >> "$GITHUB_ENV" + - name: Install `cargo-binstall` using scripts run: ./install-from-binstall-release.ps1 env: @@ -86,6 +113,7 @@ jobs: fail-fast: false matrix: set_cargo_home: [t, f] + set_binstall_version: ['no', 'with-v', 'without-v'] runs-on: windows-latest @@ -100,6 +128,19 @@ jobs: mkdir -p "${CARGO_HOME}/bin" echo "CARGO_HOME=$CARGO_HOME" >> "$GITHUB_ENV" + - name: Set `BINSTALL_VERSION` + if: matrix.set_binstall_version != 'no' + shell: bash + env: + GH_TOKEN: ${{ github.token }} + STRIP_V: ${{ matrix.set_cargo_home }} + run: | + # fetch most recent release name. + BINSTALL_VERSION="$(gh release list --json name --jq '[.[] | select(.name | startswith("v")) | .name] | first')" + if [[ $STRIP_V == 'without-v' ]]; then BINSTALL_VERSION="${BINSTALL_VERSION#v*}"; fi + echo "Setting BINSTALL_VERSION=$BINSTALL_VERSION" + echo "BINSTALL_VERSION=$BINSTALL_VERSION" >> "$GITHUB_ENV" + - name: Install `cargo-binstall` using scripts shell: bash run: ./install-from-binstall-release.sh diff --git a/install-from-binstall-release.ps1 b/install-from-binstall-release.ps1 index 4a31f878..abbc8050 100644 --- a/install-from-binstall-release.ps1 +++ b/install-from-binstall-release.ps1 @@ -2,10 +2,19 @@ $ErrorActionPreference = "Stop" Set-PSDebug -Trace 1 $tmpdir = $Env:TEMP $BINSTALL_VERSION = $Env:BINSTALL_VERSION -if (-not $BINSTALL_VERSION) { - $BINSTALL_VERSION = 'latest' +if ($BINSTALL_VERSION -and $BINSTALL_VERSION -notlike 'v*') { + # prefix version with v + $BINSTALL_VERSION = "v$BINSTALL_VERSION" } -$base_url = "https://github.com/cargo-bins/cargo-binstall/releases/$BINSTALL_VERSION/download/cargo-binstall-" +# Fetch binaries from `[..]/releases/latest/download/[..]` if _no_ version is +# given, otherwise from `[..]/releases/download/VERSION/[..]`. Note the shifted +# location of '/download'. +$base_url = if (-not $BINSTALL_VERSION) { + "https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-" +} else { + "https://github.com/cargo-bins/cargo-binstall/releases/download/$BINSTALL_VERSION/cargo-binstall-" +} + $proc_arch = [Environment]::GetEnvironmentVariable("PROCESSOR_ARCHITECTURE", [EnvironmentVariableTarget]::Machine) if ($proc_arch -eq "AMD64") { $arch = "x86_64" diff --git a/install-from-binstall-release.sh b/install-from-binstall-release.sh index 97cf0cca..2153a16c 100755 --- a/install-from-binstall-release.sh +++ b/install-from-binstall-release.sh @@ -2,11 +2,21 @@ set -euxo pipefail -BINSTALL_VERSION="${BINSTALL_VERSION:-latest}" +if [[ -n "${BINSTALL_VERSION:-}" && "$BINSTALL_VERSION" != v* ]]; then + # prefix version with v + BINSTALL_VERSION="v$BINSTALL_VERSION" +fi cd "$(mktemp -d)" -base_url="https://github.com/cargo-bins/cargo-binstall/releases/${BINSTALL_VERSION}/download/cargo-binstall-" +# Fetch binaries from `[..]/releases/latest/download/[..]` if _no_ version is +# given, otherwise from `[..]/releases/download/VERSION/[..]`. Note the shifted +# location of '/download'. +if [[ -z "${BINSTALL_VERSION:-}" ]]; then + base_url="https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-" +else + base_url="https://github.com/cargo-bins/cargo-binstall/releases/download/${BINSTALL_VERSION}/cargo-binstall-" +fi os="$(uname -s)" if [ "$os" == "Darwin" ]; then From dabb630e7f4f24d0e0654b1d0f4908557c8d6716 Mon Sep 17 00:00:00 2001 From: Martijn Pieters Date: Wed, 20 Nov 2024 11:12:13 +0000 Subject: [PATCH 1921/2020] ci: Correct variable used in install tests (#1977) The `STRIP_V` env var should be set from the `set_binstall_version` matrix variable. While here, ensure that the install-script workflow is run whenever the workflow itself is changed (in addition to the install scripts themselves). --- .github/workflows/install-script.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/install-script.yml b/.github/workflows/install-script.yml index 62768b03..b6ac7095 100644 --- a/.github/workflows/install-script.yml +++ b/.github/workflows/install-script.yml @@ -10,12 +10,14 @@ on: paths: - install-from-binstall-release.ps1 - install-from-binstall-release.sh + - .github/workflows/install-script.yml push: branches: - main paths: - install-from-binstall-release.ps1 - install-from-binstall-release.sh + - .github/workflows/install-script.yml concurrency: group: ${{ github.workflow }}-${{ github.ref || github.event.pull_request.number || github.sha }} @@ -48,7 +50,7 @@ jobs: - name: Set `BINSTALL_VERSION` if: matrix.set_binstall_version != 'no' env: - STRIP_V: ${{ matrix.set_cargo_home }} + STRIP_V: ${{ matrix.set_binstall_version }} GH_TOKEN: ${{ github.token }} run: | # fetch most recent release tag. @@ -92,7 +94,7 @@ jobs: shell: bash env: GH_TOKEN: ${{ github.token }} - STRIP_V: ${{ matrix.set_cargo_home }} + STRIP_V: ${{ matrix.set_binstall_version }} run: | # fetch most recent release name. BINSTALL_VERSION="$(gh release list --json name --jq '[.[] | select(.name | startswith("v")) | .name] | first')" @@ -133,7 +135,7 @@ jobs: shell: bash env: GH_TOKEN: ${{ github.token }} - STRIP_V: ${{ matrix.set_cargo_home }} + STRIP_V: ${{ matrix.set_binstall_version }} run: | # fetch most recent release name. BINSTALL_VERSION="$(gh release list --json name --jq '[.[] | select(.name | startswith("v")) | .name] | first')" From 7b5b928d503349e3a93232675aef6d1b914318fe Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 22 Nov 2024 08:39:08 +0000 Subject: [PATCH 1922/2020] dep: Upgrade transitive dependencies (#1979) Co-authored-by: github-actions --- Cargo.lock | 98 +++++++++++++++++++++++++++++++++--------------------- 1 file changed, 60 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4303b20a..48a21437 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -793,6 +793,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -801,9 +811,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca741a962e1b0bff6d724a1a0958b686406e853bb14061f218562e1896f95e6" +checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" dependencies = [ "libc", ] @@ -2041,9 +2051,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" dependencies = [ "atomic-waker", "bytes", @@ -2252,9 +2262,9 @@ checksum = "5c3b1f728c459d27b12448862017b96ad4767b1ec2ec5e6434e99f1577f085b8" [[package]] name = "hyper" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbbff0a806a4728c99295b254c8838933b5b082d75e3cb70c8dab21fdfbcfa9a" +checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" dependencies = [ "bytes", "futures-channel", @@ -2557,9 +2567,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.11" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" +checksum = "540654e97a3f4470a492cd30ff187bc95d89557a903a2bbf112e2fae98104ef2" [[package]] name = "jiff" @@ -2658,9 +2668,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.162" +version = "0.2.164" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18d287de67fe55fd7e1581fe933d965a5a9477b38e949cfa9f8574ef01506398" +checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" [[package]] name = "libmimalloc-sys" @@ -2898,7 +2908,7 @@ dependencies = [ "openssl-probe", "openssl-sys", "schannel", - "security-framework", + "security-framework 2.11.1", "security-framework-sys", "tempfile", ] @@ -3082,9 +3092,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-src" -version = "300.4.0+3.4.0" +version = "300.4.1+3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a709e02f2b4aca747929cca5ed248880847c650233cf8b8cdc48f40aaf4898a6" +checksum = "faa4eac4138c62414b5622d1b31c5c304f34b406b013c079c2bbc652fdd6678c" dependencies = [ "cc", ] @@ -3298,9 +3308,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.89" +version = "1.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f139b0662de085916d1fb67d2b4169d1addddda1919e696f3252b740b629986e" +checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" dependencies = [ "unicode-ident", ] @@ -3624,9 +3634,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.40" +version = "0.38.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" +checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags 2.6.0", "errno 0.3.9", @@ -3637,9 +3647,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.16" +version = "0.23.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee87ff5d9b36712a58574e12e9f0ea80f915a5b0ac518d322b24a465617925e" +checksum = "7f1a745511c54ba6d4465e8d5dfbd81b45791756de28d4981af70d6dca128f1e" dependencies = [ "log", "once_cell", @@ -3652,15 +3662,14 @@ dependencies = [ [[package]] name = "rustls-native-certs" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcaf18a4f2be7326cd874a5fa579fae794320a0f388d365dca7e480e55f83f8a" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" dependencies = [ "openssl-probe", - "rustls-pemfile", "rustls-pki-types", "schannel", - "security-framework", + "security-framework 3.0.1", ] [[package]] @@ -3715,9 +3724,9 @@ dependencies = [ [[package]] name = "schannel" -version = "0.1.26" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" +checksum = "1f29ebaa345f945cec9fbbc532eb307f0fdad8161f281b6369539c8d84876b3d" dependencies = [ "windows-sys 0.59.0", ] @@ -3735,7 +3744,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ "bitflags 2.6.0", - "core-foundation", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework" +version = "3.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1415a607e92bec364ea2cf9264646dcce0f91e6d65281bd6f2819cca3bf39c8" +dependencies = [ + "bitflags 2.6.0", + "core-foundation 0.10.0", "core-foundation-sys", "libc", "security-framework-sys", @@ -3791,9 +3813,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.132" +version = "1.0.133" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03" +checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" dependencies = [ "itoa", "memchr", @@ -4013,9 +4035,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.87" +version = "2.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25aa4ce346d03a6dcd68dd8b4010bcb74e54e62c90c573f394c46eae99aba32d" +checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" dependencies = [ "proc-macro2", "quote", @@ -4024,9 +4046,9 @@ dependencies = [ [[package]] name = "sync_wrapper" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" dependencies = [ "futures-core", ] @@ -4049,7 +4071,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", - "core-foundation", + "core-foundation 0.9.4", "system-configuration-sys 0.5.0", ] @@ -4060,7 +4082,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ "bitflags 2.6.0", - "core-foundation", + "core-foundation 0.9.4", "system-configuration-sys 0.6.0", ] @@ -4466,9 +4488,9 @@ checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" [[package]] name = "unicode-ident" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" +checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" [[package]] name = "unicode-linebreak" @@ -4707,9 +4729,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.6" +version = "0.26.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "841c67bff177718f1d4dfefde8d8f0e78f9b6589319ba88312f567fc5841a958" +checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" dependencies = [ "rustls-pki-types", ] From 2f84637d2357bdc5b24d7d59c7c6a1b00a71c227 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 23 Nov 2024 12:17:23 +1000 Subject: [PATCH 1923/2020] build(deps): bump the deps group with 2 updates (#1981) Bumps the deps group with 2 updates: [embed-resource](https://github.com/nabijaczleweli/rust-embed-resource) and [url](https://github.com/servo/rust-url). Updates `embed-resource` from 2.5.1 to 3.0.1 - [Release notes](https://github.com/nabijaczleweli/rust-embed-resource/releases) - [Commits](https://github.com/nabijaczleweli/rust-embed-resource/compare/v2.5.1...v3.0.1) Updates `url` from 2.5.3 to 2.5.4 - [Release notes](https://github.com/servo/rust-url/releases) - [Commits](https://github.com/servo/rust-url/compare/v2.5.3...v2.5.4) --- updated-dependencies: - dependency-name: embed-resource dependency-type: direct:production update-type: version-update:semver-major dependency-group: deps - dependency-name: url dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-git-repo-api/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 48a21437..fede25ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1002,9 +1002,9 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "embed-resource" -version = "2.5.1" +version = "3.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b68b6f9f63a0b6a38bc447d4ce84e2b388f3ec95c99c641c8ff0dd3ef89a6379" +checksum = "4762ce03154ba57ebaeee60cc631901ceae4f18219cbb874e464347471594742" dependencies = [ "cc", "memchr", @@ -4521,9 +4521,9 @@ checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" [[package]] name = "url" -version = "2.5.3" +version = "2.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d157f1b96d14500ffdc1f10ba712e780825526c03d9a49b4d0324b0d9113ada" +checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", "idna 1.0.3", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 156a8190..1da2d094 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -47,7 +47,7 @@ tracing-subscriber = { version = "0.3.17", features = ["fmt", "json", "ansi"], d zeroize = "1.8.1" [build-dependencies] -embed-resource = "2.4.1" +embed-resource = "3.0.1" vergen = { version = "8.2.7", features = ["build", "cargo", "git", "gitcl", "rustc"] } [features] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 0c3d8f77..4d31c3ff 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -65,7 +65,7 @@ hickory-resolver = { version = "0.25.0-alpha.3", optional = true, features = [ "dnssec-ring", ] } once_cell = { version = "1.18.0", optional = true } -url = "2.5.3" +url = "2.5.4" xz2 = "0.1.7" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 8a67361c..fe5959a6 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -31,7 +31,7 @@ tokio = { version = "1.35.0", features = [ "sync", ], default-features = false } tracing = "0.1.39" -url = "2.5.3" +url = "2.5.4" [dev-dependencies] binstalk-downloader = { version = "0.13.4", path = "../binstalk-downloader" } diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index e0f1bac8..0e1a4ddd 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -21,7 +21,7 @@ serde_json = { version = "1.0.107" } thiserror = "2.0.1" tokio = { version = "1.35.0", features = ["sync"], default-features = false } tracing = "0.1.39" -url = "2.5.3" +url = "2.5.4" zeroize = "1.8.1" [dev-dependencies] diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index b7593817..448f716d 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -22,7 +22,7 @@ serde-tuple-vec-map = "1.0.1" serde_json = "1.0.107" thiserror = "2.0.1" toml_edit = { version = "0.22.12", features = ["serde"] } -url = { version = "2.5.3", features = ["serde"] } +url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] detect-targets = { version = "0.1.29", path = "../detect-targets" } diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 1e68cd22..269a0eaf 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -35,7 +35,7 @@ tokio = { version = "1.35.0", features = [ "sync", ], default-features = false } tracing = "0.1.39" -url = "2.5.3" +url = "2.5.4" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index b1e91d01..b4fcbe00 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -17,7 +17,7 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } strum = "0.26.1" strum_macros = "0.26.1" -url = { version = "2.5.3", features = ["serde"] } +url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] serde_json = "1" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index c522c10b..811cc776 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -43,7 +43,7 @@ tokio = { version = "1.35.0", features = [ "time", ], default-features = false } tracing = "0.1.39" -url = { version = "2.5.3", features = ["serde"] } +url = { version = "2.5.4", features = ["serde"] } zeroize = "1.8.1" [features] From d0e37e3ce9c209fd7a9fa0769abec455d0b0ed7c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 23 Nov 2024 03:46:10 +0000 Subject: [PATCH 1924/2020] chore: release (#1980) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 20 ++++++++++---------- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-bins/CHANGELOG.md | 6 ++++++ crates/binstalk-bins/Cargo.toml | 4 ++-- crates/binstalk-downloader/CHANGELOG.md | 6 ++++++ crates/binstalk-downloader/Cargo.toml | 4 ++-- crates/binstalk-fetchers/CHANGELOG.md | 6 ++++++ crates/binstalk-fetchers/Cargo.toml | 10 +++++----- crates/binstalk-git-repo-api/CHANGELOG.md | 6 ++++++ crates/binstalk-git-repo-api/Cargo.toml | 6 +++--- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 6 +++--- crates/binstalk-registry/CHANGELOG.md | 6 ++++++ crates/binstalk-registry/Cargo.toml | 8 ++++---- crates/binstalk-types/CHANGELOG.md | 6 ++++++ crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 16 ++++++++-------- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- 22 files changed, 102 insertions(+), 42 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fede25ef..d3aec297 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -256,7 +256,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.13" +version = "0.28.14" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -288,7 +288,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.6.4" +version = "0.6.5" dependencies = [ "atomic-file-install", "binstalk-types", @@ -302,7 +302,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.13.4" +version = "0.13.5" dependencies = [ "async-compression", "async-trait", @@ -338,7 +338,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.10.4" +version = "0.10.5" dependencies = [ "async-trait", "binstalk-downloader", @@ -362,7 +362,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.6" +version = "0.5.7" dependencies = [ "binstalk-downloader", "compact_str", @@ -381,7 +381,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.10" +version = "0.15.11" dependencies = [ "beef", "binstalk-types", @@ -402,7 +402,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.11.4" +version = "0.11.5" dependencies = [ "async-trait", "base16", @@ -429,7 +429,7 @@ dependencies = [ [[package]] name = "binstalk-types" -version = "0.9.1" +version = "0.9.2" dependencies = [ "compact_str", "maybe-owned", @@ -918,7 +918,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.29" +version = "0.1.30" dependencies = [ "cfg-if", "guess_host_triple", @@ -930,7 +930,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.12" +version = "1.0.13" dependencies = [ "tempfile", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 1da2d094..6e20b26b 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,8 +23,8 @@ pkg-fmt = "zip" [dependencies] atomic-file-install = { version = "1.0.6", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.13", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.10" } +binstalk = { path = "../binstalk", version = "0.28.14", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.11" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-bins/CHANGELOG.md b/crates/binstalk-bins/CHANGELOG.md index a2751d6c..3a3709ab 100644 --- a/crates/binstalk-bins/CHANGELOG.md +++ b/crates/binstalk-bins/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.6.5](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.4...binstalk-bins-v0.6.5) - 2024-11-23 + +### Other + +- updated the following local packages: binstalk-types + ## [0.6.4](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.3...binstalk-bins-v0.6.4) - 2024-11-18 ### Other diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index fb99fdbf..b60066af 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.6.4" +version = "0.6.5" edition = "2021" description = "The binstall binaries discovery and installation crate." @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] atomic-file-install = { version = "1.0.6", path = "../atomic-file-install" } -binstalk-types = { version = "0.9.1", path = "../binstalk-types" } +binstalk-types = { version = "0.9.2", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" diff --git a/crates/binstalk-downloader/CHANGELOG.md b/crates/binstalk-downloader/CHANGELOG.md index 3d637179..f05520c0 100644 --- a/crates/binstalk-downloader/CHANGELOG.md +++ b/crates/binstalk-downloader/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.13.5](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.4...binstalk-downloader-v0.13.5) - 2024-11-23 + +### Other + +- *(deps)* bump the deps group with 2 updates ([#1981](https://github.com/cargo-bins/cargo-binstall/pull/1981)) + ## [0.13.4](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.3...binstalk-downloader-v0.13.4) - 2024-11-09 ### Other diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 4d31c3ff..196d3a2b 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.13.4" +version = "0.13.5" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -18,7 +18,7 @@ async-compression = { version = "0.4.4", features = [ "bzip2", "tokio", ] } -binstalk-types = { version = "0.9.1", path = "../binstalk-types" } +binstalk-types = { version = "0.9.2", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.4.4" cfg-if = "1" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index 5709d1ec..3fe9e690 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.5](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.4...binstalk-fetchers-v0.10.5) - 2024-11-23 + +### Other + +- *(deps)* bump the deps group with 2 updates ([#1981](https://github.com/cargo-bins/cargo-binstall/pull/1981)) + ## [0.10.4](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.3...binstalk-fetchers-v0.10.4) - 2024-11-09 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index fe5959a6..714970c0 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.10.4" +version = "0.10.5" edition = "2021" description = "The binstall fetchers" @@ -12,9 +12,9 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.13.4", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.6", path = "../binstalk-git-repo-api" } -binstalk-types = { version = "0.9.1", path = "../binstalk-types" } +binstalk-downloader = { version = "0.13.5", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.7", path = "../binstalk-git-repo-api" } +binstalk-types = { version = "0.9.2", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } either = "1.11.0" @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.5.4" [dev-dependencies] -binstalk-downloader = { version = "0.13.4", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.5", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index b86101b1..4f21b017 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.7](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.6...binstalk-git-repo-api-v0.5.7) - 2024-11-23 + +### Other + +- *(deps)* bump the deps group with 2 updates ([#1981](https://github.com/cargo-bins/cargo-binstall/pull/1981)) + ## [0.5.6](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.5...binstalk-git-repo-api-v0.5.6) - 2024-11-09 ### Other diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 0e1a4ddd..b0ea3e58 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.6" +version = "0.5.7" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.13.4", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.5", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.8.0" @@ -25,6 +25,6 @@ url = "2.5.4" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.4", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.5", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index 9dfe1dcd..cbe072f0 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.11](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.10...binstalk-manifests-v0.15.11) - 2024-11-23 + +### Other + +- *(deps)* bump the deps group with 2 updates ([#1981](https://github.com/cargo-bins/cargo-binstall/pull/1981)) + ## [0.15.10](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.9...binstalk-manifests-v0.15.10) - 2024-11-18 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 448f716d..f45c9304 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.10" +version = "0.15.11" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] beef = { version = "0.5.2", features = ["impl_serde"] } -binstalk-types = { version = "0.9.1", path = "../binstalk-types" } +binstalk-types = { version = "0.9.2", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } fs-lock = { version = "0.1.6", path = "../fs-lock" } home = "0.5.9" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.29", path = "../detect-targets" } +detect-targets = { version = "0.1.30", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md index dfed1124..c7e51adc 100644 --- a/crates/binstalk-registry/CHANGELOG.md +++ b/crates/binstalk-registry/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.5](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.4...binstalk-registry-v0.11.5) - 2024-11-23 + +### Other + +- *(deps)* bump the deps group with 2 updates ([#1981](https://github.com/cargo-bins/cargo-binstall/pull/1981)) + ## [0.11.4](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.3...binstalk-registry-v0.11.4) - 2024-11-09 ### Other diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 269a0eaf..4d237767 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.11.4" +version = "0.11.5" edition = "2021" rust-version = "1.65.0" @@ -13,10 +13,10 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.13.4", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.5", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } -binstalk-types = { version = "0.9.1", path = "../binstalk-types" } +binstalk-types = { version = "0.9.2", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.3", path = "../cargo-toml-workspace" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" @@ -40,7 +40,7 @@ url = "2.5.4" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.13.4", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.5", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk-types/CHANGELOG.md b/crates/binstalk-types/CHANGELOG.md index 738e040d..b512eccc 100644 --- a/crates/binstalk-types/CHANGELOG.md +++ b/crates/binstalk-types/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.9.2](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-types-v0.9.1...binstalk-types-v0.9.2) - 2024-11-23 + +### Other + +- *(deps)* bump the deps group with 2 updates ([#1981](https://github.com/cargo-bins/cargo-binstall/pull/1981)) + ## [0.9.1](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-types-v0.9.0...binstalk-types-v0.9.1) - 2024-11-05 ### Other diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index b4fcbe00..d87c983f 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-types" description = "The binstall toolkit that contains basic types for binstalk crates" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-types" -version = "0.9.1" +version = "0.9.2" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index 7d0fa671..e9063491 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.14](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.13...binstalk-v0.28.14) - 2024-11-23 + +### Other + +- *(deps)* bump the deps group with 2 updates ([#1981](https://github.com/cargo-bins/cargo-binstall/pull/1981)) + ## [0.28.13](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.12...binstalk-v0.28.13) - 2024-11-18 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 811cc776..5b6e6bf1 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,25 +3,25 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.13" +version = "0.28.14" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.6.4", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.13.4", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.6", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.10.4", path = "../binstalk-fetchers", features = [ +binstalk-bins = { version = "0.6.5", path = "../binstalk-bins" } +binstalk-downloader = { version = "0.13.5", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.7", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.10.5", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.11.4", path = "../binstalk-registry" } -binstalk-types = { version = "0.9.1", path = "../binstalk-types" } +binstalk-registry = { version = "0.11.5", path = "../binstalk-registry" } +binstalk-types = { version = "0.9.2", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.3", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.29", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.30", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index d3279353..38f67fb8 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.30](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.29...detect-targets-v0.1.30) - 2024-11-23 + +### Other + +- update Cargo.lock dependencies + ## [0.1.29](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.28...detect-targets-v0.1.29) - 2024-11-18 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 201c21bf..c6cd9a99 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.29" +version = "0.1.30" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index f5b151b3..e3e815c6 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.13](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.12...detect-wasi-v1.0.13) - 2024-11-23 + +### Other + +- update Cargo.lock dependencies + ## [1.0.12](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.11...detect-wasi-v1.0.12) - 2024-11-18 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index c81b9fe8..d61c0976 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.12" +version = "1.0.13" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From 84ca29d5c1719e79e23b6af147555a8f4dac79d6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 23 Nov 2024 05:43:50 +0000 Subject: [PATCH 1925/2020] release: cargo-binstall v1.10.14 (#1982) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d3aec297..7e6c0031 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -562,7 +562,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.13" +version = "1.10.14" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 6e20b26b..e3ef313f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.13" +version = "1.10.14" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 4313acb5..dc802aa7 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From ec715d4202f2d4b4a894e8357d84e637d86111ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 26 Nov 2024 08:16:30 +1000 Subject: [PATCH 1926/2020] build(deps): bump rustls from 0.23.17 to 0.23.18 in the cargo group (#1983) Bumps the cargo group with 1 update: [rustls](https://github.com/rustls/rustls). Updates `rustls` from 0.23.17 to 0.23.18 - [Release notes](https://github.com/rustls/rustls/releases) - [Changelog](https://github.com/rustls/rustls/blob/main/CHANGELOG.md) - [Commits](https://github.com/rustls/rustls/compare/v/0.23.17...v/0.23.18) --- updated-dependencies: - dependency-name: rustls dependency-type: indirect dependency-group: cargo ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7e6c0031..18a09418 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3647,9 +3647,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.17" +version = "0.23.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f1a745511c54ba6d4465e8d5dfbd81b45791756de28d4981af70d6dca128f1e" +checksum = "9c9cc1d47e243d655ace55ed38201c19ae02c148ae56412ab8750e8f0166ab7f" dependencies = [ "log", "once_cell", From fc2684f0d9ecae565d2fecf89b02357b6107f6d0 Mon Sep 17 00:00:00 2001 From: Trevor Gross Date: Tue, 26 Nov 2024 04:04:48 -0500 Subject: [PATCH 1927/2020] Make `install-from-binstall-release` work with POSIX sh (#1984) This script would be useful to run in Docker containers, which don't always have `bash` available (e.g. Alpine). It just needs a few small adjustments to make this work, so apply those changes here. Tested this script in an Alpine container. --- install-from-binstall-release.sh | 34 +++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/install-from-binstall-release.sh b/install-from-binstall-release.sh index 2153a16c..83f6ca8d 100755 --- a/install-from-binstall-release.sh +++ b/install-from-binstall-release.sh @@ -1,35 +1,40 @@ -#!/bin/bash +#!/bin/sh -set -euxo pipefail +set -eux -if [[ -n "${BINSTALL_VERSION:-}" && "$BINSTALL_VERSION" != v* ]]; then - # prefix version with v - BINSTALL_VERSION="v$BINSTALL_VERSION" -fi +# Set pipefail if it works in a subshell, disregard if unsupported +# shellcheck disable=SC3040 +(set -o pipefail 2> /dev/null) && set -o pipefail + +case "${BINSTALL_VERSION:-}" in + "") ;; # unset + v*) ;; # already includes the `v` + *) BINSTALL_VERSION="v$BINSTALL_VERSION" ;; # Add a leading `v` +esac cd "$(mktemp -d)" # Fetch binaries from `[..]/releases/latest/download/[..]` if _no_ version is # given, otherwise from `[..]/releases/download/VERSION/[..]`. Note the shifted # location of '/download'. -if [[ -z "${BINSTALL_VERSION:-}" ]]; then +if [ -z "${BINSTALL_VERSION:-}" ]; then base_url="https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-" else base_url="https://github.com/cargo-bins/cargo-binstall/releases/download/${BINSTALL_VERSION}/cargo-binstall-" fi os="$(uname -s)" -if [ "$os" == "Darwin" ]; then +if [ "$os" = "Darwin" ]; then url="${base_url}universal-apple-darwin.zip" curl -A "Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Firefox/81.0" -LO --proto '=https' --tlsv1.2 -sSf "$url" unzip cargo-binstall-universal-apple-darwin.zip -elif [ "$os" == "Linux" ]; then +elif [ "$os" = "Linux" ]; then machine="$(uname -m)" - if [ "$machine" == "armv7l" ]; then + if [ "$machine" = "armv7l" ]; then machine="armv7" fi target="${machine}-unknown-linux-musl" - if [ "$machine" == "armv7" ]; then + if [ "$machine" = "armv7" ]; then target="${target}eabihf" fi @@ -50,7 +55,12 @@ fi CARGO_HOME="${CARGO_HOME:-$HOME/.cargo}" -if ! [[ ":$PATH:" == *":$CARGO_HOME/bin:"* ]]; then +case ":$PATH:" in + *":$CARGO_HOME/bin:"*) ;; # Cargo home is already in path + *) needs_cargo_home=1 ;; +esac + +if [ -n "${needs_cargo_home:-}" ]; then if [ -n "${CI:-}" ] && [ -n "${GITHUB_PATH:-}" ]; then echo "$CARGO_HOME/bin" >> "$GITHUB_PATH" else From 84683f1ff6fca0d9102ed72bcdeab1ad06ad61f6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 29 Nov 2024 19:24:35 +1100 Subject: [PATCH 1928/2020] dep: Upgrade transitive dependencies (#1985) * dep: Upgrade transitive dependencies * Fix clippy lint error in signing.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix must_use warning in bin/build.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix cargo-fmt in bin/ build.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Co-authored-by: github-actions Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- Cargo.lock | 482 +++++++++++++----------- crates/bin/build.rs | 4 +- crates/binstalk-fetchers/src/signing.rs | 2 +- 3 files changed, 263 insertions(+), 225 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 18a09418..6b433238 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -149,9 +149,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "async-compression" -version = "0.4.17" +version = "0.4.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0cb8f1d480b0ea3783ab015936d2a55c87e219676f0c0b7dec61494043f21857" +checksum = "df895a515f70646414f4b45c0b79082783b80552b373a68283012928df56f522" dependencies = [ "brotli", "bzip2", @@ -520,9 +520,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ac0150caa2ae65ca5bd83f25c7de183dea78d4d366469f148435e2acfbad0da" +checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" [[package]] name = "bytesize" @@ -593,9 +593,9 @@ dependencies = [ [[package]] name = "cargo-platform" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" dependencies = [ "serde", ] @@ -743,9 +743,9 @@ checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" [[package]] name = "cmake" -version = "0.1.51" +version = "0.1.52" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb1e43aa7fd152b1f968787f7dbcdeb306d1867ff373c69955211876c053f91a" +checksum = "c682c223677e0e5b6b7f63a64b9351844c3f1b1678a68b7ee617e30fb082620e" dependencies = [ "cc", ] @@ -851,6 +851,15 @@ dependencies = [ "crossbeam-utils", ] +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.20" @@ -1054,12 +1063,12 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.9" +version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -1283,9 +1292,9 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gix" -version = "0.67.0" +version = "0.68.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d3e78ddac368d3e3bfbc2862bc2aafa3d89f1b15fed898d9761e1ec6f3f17f" +checksum = "b04c66359b5e17f92395abc433861df0edf48f39f3f590818d1d7217327dd6a1" dependencies = [ "gix-actor", "gix-attributes", @@ -1330,28 +1339,28 @@ dependencies = [ "gix-worktree-state", "once_cell", "smallvec", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-actor" -version = "0.33.0" +version = "0.33.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59226ef06661c756e664b46b1d3b2c198f6adc5407a484c086d0171108a70027" +checksum = "32b24171f514cef7bb4dfb72a0b06dacf609b33ba8ad2489d4c4559a03b7afb3" dependencies = [ "bstr", "gix-date", "gix-utils", "itoa", - "thiserror 1.0.69", + "thiserror 2.0.3", "winnow 0.6.20", ] [[package]] name = "gix-attributes" -version = "0.23.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31a102d201ef0e5a848458a82292581e7641e52f0f52e693b6cbdd05a652c029" +checksum = "ddf9bf852194c0edfe699a2d36422d2c1f28f73b7c6d446c3f0ccd3ba232cadc" dependencies = [ "bstr", "gix-glob", @@ -1360,33 +1369,33 @@ dependencies = [ "gix-trace", "kstring", "smallvec", - "thiserror 1.0.69", + "thiserror 2.0.3", "unicode-bom", ] [[package]] name = "gix-bitmap" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f78312288bd02052be5dbc2ecbc342c9f4eb791986d86c0a5c06b92dc72efa" +checksum = "d48b897b4bbc881aea994b4a5bbb340a04979d7be9089791304e04a9fbc66b53" dependencies = [ - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-chunk" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c28b58ba04f0c004722344390af9dbc85888fbb84be1981afb934da4114d4cf" +checksum = "c6ffbeb3a5c0b8b84c3fe4133a6f8c82fa962f4caefe8d0762eced025d3eb4f7" dependencies = [ - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-command" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c201d2b9e9cce2365a6638fd0a966f751ed92d74be5c0727ac331e6a29ef5846" +checksum = "6d7d6b8f3a64453fd7e8191eb80b351eb7ac0839b40a1237cd2c137d5079fe53" dependencies = [ "bstr", "gix-path", @@ -1396,23 +1405,23 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41db900b189e62dc61575f06fdf1a3b6901d264a99be9d32b286af6b2e3984e1" +checksum = "a8da6591a7868fb2b6dabddea6b09988b0b05e0213f938dbaa11a03dd7a48d85" dependencies = [ "bstr", "gix-chunk", "gix-features", "gix-hash", "memmap2", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-config" -version = "0.41.0" +version = "0.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bedd1bf1c7b994be9d57207e8e0de79016c05e2e8701d3015da906e65ac445e" +checksum = "6649b406ca1f99cb148959cf00468b231f07950f8ec438cc0903cda563606f19" dependencies = [ "bstr", "gix-config-value", @@ -1424,29 +1433,29 @@ dependencies = [ "memchr", "once_cell", "smallvec", - "thiserror 1.0.69", + "thiserror 2.0.3", "unicode-bom", "winnow 0.6.20", ] [[package]] name = "gix-config-value" -version = "0.14.9" +version = "0.14.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3de3fdca9c75fa4b83a76583d265fa49b1de6b088ebcd210749c24ceeb74660" +checksum = "49aaeef5d98390a3bcf9dbc6440b520b793d1bf3ed99317dc407b02be995b28e" dependencies = [ "bitflags 2.6.0", "bstr", "gix-path", "libc", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-credentials" -version = "0.25.0" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d713bac4bf7df5801012285366dae6625d675baec4ba6e443d64e83559bec068" +checksum = "2be87bb8685fc7e6e7032ef71c45068ffff609724a0c897b8047fde10db6ae71" dependencies = [ "bstr", "gix-command", @@ -1456,38 +1465,38 @@ dependencies = [ "gix-sec", "gix-trace", "gix-url", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-date" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d10d543ac13c97292a15e8e8b7889cd006faf739777437ed95362504b8fe81a0" +checksum = "691142b1a34d18e8ed6e6114bc1a2736516c5ad60ef3aa9bd1b694886e3ca92d" dependencies = [ "bstr", "itoa", "jiff", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-diff" -version = "0.47.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9850fd0c15af113db6f9e130d13091ba0d3754e570a2afdff9e2f3043da260e" +checksum = "a327be31a392144b60ab0b1c863362c32a1c8f7effdfa2141d5d5b6b916ef3bf" dependencies = [ "bstr", "gix-hash", "gix-object", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-discover" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c522e31f458f50af09dfb014e10873c5378f702f8049c96f508989aad59671f6" +checksum = "83bf6dfa4e266a4a9becb4d18fc801f92c3f7cc6c433dd86fdadbcf315ffb6ef" dependencies = [ "bstr", "dunce", @@ -1496,14 +1505,14 @@ dependencies = [ "gix-path", "gix-ref", "gix-sec", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-features" -version = "0.39.0" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e0eb9efdf96c35c0bed7596d1bef2d4ce6360a1d09738001f9d3e402aa7ba3e" +checksum = "7d85d673f2e022a340dba4713bed77ef2cf4cd737d2f3e0f159d45e0935fd81f" dependencies = [ "bytes", "bytesize", @@ -1519,15 +1528,15 @@ dependencies = [ "prodash", "sha1", "sha1_smol", - "thiserror 1.0.69", + "thiserror 2.0.3", "walkdir", ] [[package]] name = "gix-filter" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b37f82359a4485770ed8993ae715ced1bf674f2a63e45f5a0786d38310665ea" +checksum = "5108cc58d58b27df10ac4de7f31b2eb96d588a33e5eba23739b865f5d8db7995" dependencies = [ "bstr", "encoding_rs", @@ -1541,7 +1550,7 @@ dependencies = [ "gix-trace", "gix-utils", "smallvec", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] @@ -1557,9 +1566,9 @@ dependencies = [ [[package]] name = "gix-glob" -version = "0.17.0" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "254b5101cf7facc00d9b5ff564cf46302ca76695cca23d33bc958a707b6fc857" +checksum = "aaf69a6bec0a3581567484bf99a4003afcaf6c469fd4214352517ea355cf3435" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1569,12 +1578,12 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.15.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "952c3a29f1bc1007cc901abce7479943abfa42016db089de33d0a4fa3c85bfe8" +checksum = "0b5eccc17194ed0e67d49285e4853307e4147e95407f91c1c3e4a13ba9f4e4ce" dependencies = [ "faster-hex", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] @@ -1590,9 +1599,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba55a9b582dc26a639875497615959a8127ac5c37b2426dc50f037fada33a4b7" +checksum = "b6b1fb24d2a4af0aa7438e2771d60c14a80cf2c9bd55c29cf1712b841f05bb8a" dependencies = [ "bstr", "gix-glob", @@ -1603,9 +1612,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.36.0" +version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27619009ca1ea33fd885041273f5fa5a09163a5c1d22a913b28d7b985e66fe29" +checksum = "270645fd20556b64c8ffa1540d921b281e6994413a0ca068596f97e9367a257a" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1626,25 +1635,25 @@ dependencies = [ "memmap2", "rustix", "smallvec", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-lock" -version = "15.0.0" +version = "15.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5102acdf4acae2644e38dbbd18cdfba9597a218f7d85f810fe5430207e03c2de" +checksum = "1cd3ab68a452db63d9f3ebdacb10f30dba1fa0d31ac64f4203d395ed1102d940" dependencies = [ "gix-tempfile", "gix-utils", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-negotiate" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "414806291838c3349ea939c6d840ff854f84cd29bd3dde8f904f60b0e5b7d0bd" +checksum = "d27f830a16405386e9c83b9d5be8261fe32bbd6b3caf15bd1b284c6b2b7ef1a8" dependencies = [ "bitflags 2.6.0", "gix-commitgraph", @@ -1653,14 +1662,14 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-object" -version = "0.45.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a77b6e7753d298553d9ae8b1744924481e7a49170983938bb578dccfbc6fc1a" +checksum = "65d93e2bbfa83a307e47f45e45de7b6c04d7375a8bd5907b215f4bf45237d879" dependencies = [ "bstr", "gix-actor", @@ -1672,15 +1681,15 @@ dependencies = [ "gix-validate", "itoa", "smallvec", - "thiserror 1.0.69", + "thiserror 2.0.3", "winnow 0.6.20", ] [[package]] name = "gix-odb" -version = "0.64.0" +version = "0.65.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb86aadf7f1b2f980601b4fc94309706f9700f8008f935dc512d556c9e60f61" +checksum = "93bed6e1b577c25a6bb8e6ecbf4df525f29a671ddf5f2221821a56a8dbeec4e3" dependencies = [ "arc-swap", "gix-date", @@ -1694,14 +1703,14 @@ dependencies = [ "gix-quote", "parking_lot", "tempfile", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-pack" -version = "0.54.0" +version = "0.55.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "363e6e59a855ba243672408139db68e2478126cdcfeabb420777df4a1f20026b" +checksum = "9b91fec04d359544fecbb8e85117ec746fbaa9046ebafcefb58cb74f20dc76d4" dependencies = [ "clru", "gix-chunk", @@ -1714,52 +1723,52 @@ dependencies = [ "memmap2", "parking_lot", "smallvec", - "thiserror 1.0.69", + "thiserror 2.0.3", "uluru", ] [[package]] name = "gix-packetline" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f14a110eb16e27b4ebdae4ca8b389df3ad637d3020077e6b606b1d078745b65" +checksum = "8a720e5bebf494c3ceffa85aa89f57a5859450a0da0a29ebe89171e23543fa78" dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-packetline-blocking" -version = "0.18.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "decace940e8ba8e29d29b73b843a6cbae67503887f3e5fb7e688d0f4f6ee0757" +checksum = "ce9004ce1bc00fd538b11c1ec8141a1558fb3af3d2b7ac1ac5c41881f9e42d2a" dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-path" -version = "0.10.12" +version = "0.10.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c04e5a94fdb56b1e91eb7df2658ad16832428b8eeda24ff1a0f0288de2bce554" +checksum = "afc292ef1a51e340aeb0e720800338c805975724c1dfbd243185452efd8645b7" dependencies = [ "bstr", "gix-trace", "home", "once_cell", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-pathspec" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f02bf7625dbf15bf9fedbeace2ac1ce1c5177806bdbc24c441d664c75c00e4" +checksum = "4c472dfbe4a4e96fcf7efddcd4771c9037bb4fdea2faaabf2f4888210c75b81e" dependencies = [ "bitflags 2.6.0", "bstr", @@ -1767,27 +1776,27 @@ dependencies = [ "gix-config-value", "gix-glob", "gix-path", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-prompt" -version = "0.8.8" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57944bbdb87f7a9893907032276e99ff4eba3640d8db1bdfb1eba8c07edfd006" +checksum = "7a7822afc4bc9c5fbbc6ce80b00f41c129306b7685cac3248dbfa14784960594" dependencies = [ "gix-command", "gix-config-value", "parking_lot", "rustix", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-protocol" -version = "0.46.0" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac4ebf25f20ac6055728eaa80951acf2cf83948a64af6565b98e7d42b1ab6691" +checksum = "7a7e7e51a0dea531d3448c297e2fa919b2de187111a210c324b7e9f81508b8ca" dependencies = [ "bstr", "gix-credentials", @@ -1797,26 +1806,26 @@ dependencies = [ "gix-transport", "gix-utils", "maybe-async", - "thiserror 1.0.69", + "thiserror 2.0.3", "winnow 0.6.20", ] [[package]] name = "gix-quote" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f89f9a1525dcfd9639e282ea939f5ab0d09d93cf2b90c1fc6104f1b9582a8e49" +checksum = "64a1e282216ec2ab2816cd57e6ed88f8009e634aec47562883c05ac8a7009a63" dependencies = [ "bstr", "gix-utils", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-ref" -version = "0.48.0" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a47385e71fa2d9da8c35e642ef4648808ddf0a52bc93425879088c706dfeaea2" +checksum = "1eae462723686272a58f49501015ef7c0d67c3e042c20049d8dd9c7eff92efde" dependencies = [ "gix-actor", "gix-features", @@ -1829,29 +1838,29 @@ dependencies = [ "gix-utils", "gix-validate", "memmap2", - "thiserror 1.0.69", + "thiserror 2.0.3", "winnow 0.6.20", ] [[package]] name = "gix-refspec" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0022038a09d80d9abf773be8efcbb502868d97f6972b8633bfb52ab6edaac442" +checksum = "00c056bb747868c7eb0aeb352c9f9181ab8ca3d0a2550f16470803500c6c413d" dependencies = [ "bstr", "gix-hash", "gix-revision", "gix-validate", "smallvec", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-revision" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee8eb4088fece3562af4a5d751e069f90e93345524ad730512185234c4b55f1" +checksum = "44488e0380847967bc3e3cacd8b22652e02ea1eb58afb60edd91847695cd2d8d" dependencies = [ "bstr", "gix-commitgraph", @@ -1859,14 +1868,14 @@ dependencies = [ "gix-hash", "gix-object", "gix-revwalk", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-revwalk" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c9a9496da98d36ff19063a8576bf09a87425583b709a56dc5594fffa9d39b2" +checksum = "510026fc32f456f8f067d8f37c34088b97a36b2229d88a6a5023ef179fcb109d" dependencies = [ "gix-commitgraph", "gix-date", @@ -1874,14 +1883,14 @@ dependencies = [ "gix-hashtable", "gix-object", "smallvec", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-sec" -version = "0.10.9" +version = "0.10.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2007538eda296445c07949cf04f4a767307d887184d6b3e83e2d636533ddc6e" +checksum = "a8b876ef997a955397809a2ec398d6a45b7a55b4918f2446344330f778d14fd6" dependencies = [ "bitflags 2.6.0", "gix-path", @@ -1891,9 +1900,9 @@ dependencies = [ [[package]] name = "gix-submodule" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed099621873cd36c580fc822176a32a7e50fef15a5c2ed81aaa087296f0497a" +checksum = "a2455f8c0fcb6ebe2a6e83c8f522d30615d763eb2ef7a23c7d929f9476e89f5c" dependencies = [ "bstr", "gix-config", @@ -1901,7 +1910,7 @@ dependencies = [ "gix-pathspec", "gix-refspec", "gix-url", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] @@ -1925,9 +1934,9 @@ checksum = "04bdde120c29f1fc23a24d3e115aeeea3d60d8e65bab92cc5f9d90d9302eb952" [[package]] name = "gix-transport" -version = "0.43.0" +version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c485a345f41b8c0256cb86e95ed93e0692d203fd6c769b0433f7352c13608ad" +checksum = "39a1a41357b7236c03e0c984147f823d87c3e445a8581bac7006df141577200b" dependencies = [ "base64", "bstr", @@ -1939,14 +1948,14 @@ dependencies = [ "gix-sec", "gix-url", "reqwest", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-traverse" -version = "0.42.0" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f20f1b13cc4fa6ba92b24e6aa0c2fb6a34beb4458ef88c6300212db504e818df" +checksum = "3ff2ec9f779680f795363db1c563168b32b8d6728ec58564c628e85c92d29faf" dependencies = [ "bitflags 2.6.0", "gix-commitgraph", @@ -1956,19 +1965,19 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-url" -version = "0.28.0" +version = "0.28.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33e7c297c3265015c133a2c02199610b6e1373a09dc4be057d0c1b5285737f06" +checksum = "e09f97db3618fb8e473d7d97e77296b50aaee0ddcd6a867f07443e3e87391099" dependencies = [ "bstr", "gix-features", "gix-path", - "thiserror 1.0.69", + "thiserror 2.0.3", "url", ] @@ -1984,19 +1993,19 @@ dependencies = [ [[package]] name = "gix-validate" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e187b263461bc36cea17650141567753bc6207d036cedd1de6e81a52f277ff68" +checksum = "cd520d09f9f585b34b32aba1d0b36ada89ab7fefb54a8ca3fe37fc482a750937" dependencies = [ "bstr", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] name = "gix-worktree" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d345e5b523550fe4fa0e912bf957de752011ccfc87451968fda1b624318f29c" +checksum = "756dbbe15188fa22540d5eab941f8f9cf511a5364d5aec34c88083c09f4bea13" dependencies = [ "bstr", "gix-attributes", @@ -2013,9 +2022,9 @@ dependencies = [ [[package]] name = "gix-worktree-state" -version = "0.14.0" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e72b00e02f3bd737caae9c20a98e70749f42ae18c8f0b68aac3210b42a0b8da" +checksum = "4ebd5eead61d37b334bc31810c9980aa72d659044513cae0e342a88fed2c22ba" dependencies = [ "bstr", "gix-features", @@ -2028,7 +2037,7 @@ dependencies = [ "gix-path", "gix-worktree", "io-close", - "thiserror 1.0.69", + "thiserror 2.0.3", ] [[package]] @@ -2108,9 +2117,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9bfc1af68b1726ea47d3d5109de126281def866b33970e10fbab11b5dafab3" +checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" [[package]] name = "heck" @@ -2126,9 +2135,9 @@ checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hickory-proto" -version = "0.25.0-alpha.3" +version = "0.25.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "993f9d675890080b3bab88e475e6a0db4fe96b39b2fbd42a72eb315dc9009798" +checksum = "d063c0692ee669aa6d261988aa19ca5510f1cc40e4f211024f50c888499a35d7" dependencies = [ "async-recursion", "async-trait", @@ -2144,7 +2153,7 @@ dependencies = [ "h3", "h3-quinn", "http", - "idna 0.5.0", + "idna", "ipnet", "native-tls", "once_cell", @@ -2153,7 +2162,7 @@ dependencies = [ "rand", "ring", "rustls", - "thiserror 1.0.69", + "thiserror 2.0.3", "time", "tinyvec", "tokio", @@ -2165,15 +2174,15 @@ dependencies = [ [[package]] name = "hickory-resolver" -version = "0.25.0-alpha.3" +version = "0.25.0-alpha.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0eec9ac701a9b34a77c8ccbe39d589db876290f6bdc6e05ac118fd114cb1ad26" +checksum = "42bc352e4412fb657e795f79b4efcf2bd60b59ee5ca0187f3554194cd1107a27" dependencies = [ "cfg-if", "futures-util", "hickory-proto", "ipconfig", - "lru-cache", + "moka", "once_cell", "parking_lot", "quinn", @@ -2181,7 +2190,7 @@ dependencies = [ "resolv-conf", "rustls", "smallvec", - "thiserror 1.0.69", + "thiserror 2.0.3", "tokio", "tokio-native-tls", "tokio-rustls", @@ -2475,16 +2484,6 @@ dependencies = [ "syn", ] -[[package]] -name = "idna" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "634d9b1461af396cad843f47fdba5597a4f9e6ddd4bfb6ff5d85028c25cb12f6" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - [[package]] name = "idna" version = "1.0.3" @@ -2513,7 +2512,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.15.1", + "hashbrown 0.15.2", ] [[package]] @@ -2567,9 +2566,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.13" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "540654e97a3f4470a492cd30ff187bc95d89557a903a2bbf112e2fae98104ef2" +checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jiff" @@ -2668,9 +2667,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.164" +version = "0.2.166" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "433bfe06b8c75da9b2e3fbea6e5329ff87748f0b144ef75306e674c3f6f7c13f" +checksum = "c2ccc108bbc0b1331bd061864e7cd823c0cab660bbe6970e66e2c0614decde36" [[package]] name = "libmimalloc-sys" @@ -2703,12 +2702,6 @@ dependencies = [ "libc", ] -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -2717,9 +2710,9 @@ checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "litemap" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" +checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" [[package]] name = "lock_api" @@ -2737,15 +2730,6 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" -[[package]] -name = "lru-cache" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "lzma-rs" version = "0.3.0" @@ -2816,9 +2800,9 @@ dependencies = [ [[package]] name = "miette" -version = "7.2.0" +version = "7.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4edc8853320c2a0dab800fbda86253c8938f6ea88510dc92c5f1ed20e794afc1" +checksum = "317f146e2eb7021892722af37cf1b971f0a70c8406f487e24952667616192c64" dependencies = [ "backtrace", "backtrace-ext", @@ -2836,9 +2820,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "7.2.0" +version = "7.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf09caffaac8068c346b6df2a7fc27a177fd20b39421a39ce0a211bde679a6c" +checksum = "23c9b935fbe1d6cbd1dac857b54a688145e2d93f48db36010514d0f612d0ad67" dependencies = [ "proc-macro2", "quote", @@ -2896,6 +2880,26 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "moka" +version = "0.12.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32cf62eb4dd975d2dde76432fb1075c49e3ee2331cf36f1f8fd4b66550d32b6f" +dependencies = [ + "crossbeam-channel", + "crossbeam-epoch", + "crossbeam-utils", + "once_cell", + "parking_lot", + "quanta", + "rustc_version", + "smallvec", + "tagptr", + "thiserror 1.0.69", + "triomphe", + "uuid", +] + [[package]] name = "native-tls" version = "0.2.12" @@ -3327,6 +3331,21 @@ dependencies = [ "parking_lot", ] +[[package]] +name = "quanta" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" +dependencies = [ + "crossbeam-utils", + "libc", + "once_cell", + "raw-cpuid", + "wasi", + "web-sys", + "winapi", +] + [[package]] name = "quick-error" version = "1.2.3" @@ -3425,6 +3444,15 @@ dependencies = [ "getrandom", ] +[[package]] +name = "raw-cpuid" +version = "11.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" +dependencies = [ + "bitflags 2.6.0", +] + [[package]] name = "rc-zip" version = "5.1.3" @@ -3639,7 +3667,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" dependencies = [ "bitflags 2.6.0", - "errno 0.3.9", + "errno 0.3.10", "libc", "linux-raw-sys", "windows-sys 0.52.0", @@ -3647,9 +3675,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.18" +version = "0.23.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9cc1d47e243d655ace55ed38201c19ae02c148ae56412ab8750e8f0166ab7f" +checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" dependencies = [ "log", "once_cell", @@ -3914,9 +3942,9 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbaf0ff266d8adc1ee59f9c64669f73a4f8b88e87c0ab15db4da5c603a95b2c3" +checksum = "55e6ebf253d8da3d8233aa7a30956f4ea4365d2baf39e5c48b3160ce2b499914" dependencies = [ "compact_str", "derive_destructure2", @@ -3947,17 +3975,11 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -[[package]] -name = "smawk" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7c388c1b5e93756d0c740965c41e8822f866621d41acbdf6336a6a168f8840c" - [[package]] name = "socket2" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" +checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" dependencies = [ "libc", "windows-sys 0.52.0", @@ -4014,18 +4036,18 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "supports-color" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8775305acf21c96926c900ad056abeef436701108518cf890020387236ac5a77" +checksum = "c64fc7232dd8d2e4ac5ce4ef302b1d81e0b80d055b9d77c7c4f51f6aa4c867d6" dependencies = [ "is_ci", ] [[package]] name = "supports-hyperlinks" -version = "3.0.0" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c0a1e5168041f5f3ff68ff7d95dcb9c8749df29f6e7e89ada40dd4c9de404ee" +checksum = "804f44ed3c63152de6a9f90acbea1a110441de43006ea51bcce8f436196a288b" [[package]] name = "supports-unicode" @@ -4106,6 +4128,12 @@ dependencies = [ "libc", ] +[[package]] +name = "tagptr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" + [[package]] name = "target-lexicon" version = "0.12.16" @@ -4127,12 +4155,12 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +checksum = "4f599bd7ca042cfdf8f4512b277c02ba102247820f9d9d4a9f521f496751a6ef" dependencies = [ "rustix", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -4141,7 +4169,6 @@ version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" dependencies = [ - "smawk", "unicode-linebreak", "unicode-width", ] @@ -4384,9 +4411,9 @@ checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" +checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0" dependencies = [ "log", "pin-project-lite", @@ -4396,9 +4423,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.27" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" +checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", @@ -4407,9 +4434,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" +checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" dependencies = [ "once_cell", "valuable", @@ -4453,6 +4480,12 @@ dependencies = [ "tracing-serde", ] +[[package]] +name = "triomphe" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" + [[package]] name = "try-lock" version = "0.2.5" @@ -4474,12 +4507,6 @@ dependencies = [ "arrayvec", ] -[[package]] -name = "unicode-bidi" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" - [[package]] name = "unicode-bom" version = "2.0.3" @@ -4526,7 +4553,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32f8b686cadd1473f4bd0117a5d28d36b1ade384ea9b5069a1c40aefed7fda60" dependencies = [ "form_urlencoded", - "idna 1.0.3", + "idna", "percent-encoding", "serde", ] @@ -4549,6 +4576,15 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" +[[package]] +name = "uuid" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +dependencies = [ + "getrandom", +] + [[package]] name = "valuable" version = "0.1.0" @@ -5086,9 +5122,9 @@ dependencies = [ [[package]] name = "yoke" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" dependencies = [ "serde", "stable_deref_trait", @@ -5098,9 +5134,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", @@ -5131,18 +5167,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", diff --git a/crates/bin/build.rs b/crates/bin/build.rs index e51d1dd2..ed3b0772 100644 --- a/crates/bin/build.rs +++ b/crates/bin/build.rs @@ -17,7 +17,9 @@ fn main() { println!("cargo:rerun-if-changed=manifest.rc"); println!("cargo:rerun-if-changed=windows.manifest"); - embed_resource::compile("manifest.rc", embed_resource::NONE); + embed_resource::compile("manifest.rc", embed_resource::NONE) + .manifest_required() + .unwrap(); }); let git = Command::new("git").arg("--version").spawn(); diff --git a/crates/binstalk-fetchers/src/signing.rs b/crates/binstalk-fetchers/src/signing.rs index 8513d180..b231b440 100644 --- a/crates/binstalk-fetchers/src/signing.rs +++ b/crates/binstalk-fetchers/src/signing.rs @@ -75,7 +75,7 @@ impl MinisignVerifier { pub struct MinisignDataVerifier<'a>(StreamVerifier<'a>); -impl<'a> DataVerifier for MinisignDataVerifier<'a> { +impl DataVerifier for MinisignDataVerifier<'_> { fn update(&mut self, data: &Bytes) { self.0.update(data); } From b78dfd28906c3ada2b7518c8167cc824d779a773 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 29 Nov 2024 21:13:39 +1100 Subject: [PATCH 1929/2020] chore: release (#1986) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 10 +++++----- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-fetchers/CHANGELOG.md | 6 ++++++ crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 6 +++--- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- 12 files changed, 45 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6b433238..83501aad 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -256,7 +256,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.14" +version = "0.28.15" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -338,7 +338,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.10.5" +version = "0.10.6" dependencies = [ "async-trait", "binstalk-downloader", @@ -381,7 +381,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.11" +version = "0.15.12" dependencies = [ "beef", "binstalk-types", @@ -927,7 +927,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.30" +version = "0.1.31" dependencies = [ "cfg-if", "guess_host_triple", @@ -939,7 +939,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.13" +version = "1.0.14" dependencies = [ "tempfile", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index e3ef313f..2b3132e2 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,8 +23,8 @@ pkg-fmt = "zip" [dependencies] atomic-file-install = { version = "1.0.6", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.14", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.11" } +binstalk = { path = "../binstalk", version = "0.28.15", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.12" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index 3fe9e690..1cc2b06c 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.6](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.5...binstalk-fetchers-v0.10.6) - 2024-11-29 + +### Other + +- Upgrade transitive dependencies ([#1985](https://github.com/cargo-bins/cargo-binstall/pull/1985)) + ## [0.10.5](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.4...binstalk-fetchers-v0.10.5) - 2024-11-23 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 714970c0..0527e947 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.10.5" +version = "0.10.6" edition = "2021" description = "The binstall fetchers" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index cbe072f0..ec2bb099 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.12](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.11...binstalk-manifests-v0.15.12) - 2024-11-29 + +### Other + +- updated the following local packages: detect-targets + ## [0.15.11](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.10...binstalk-manifests-v0.15.11) - 2024-11-23 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index f45c9304..9bc32b8c 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.11" +version = "0.15.12" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.30", path = "../detect-targets" } +detect-targets = { version = "0.1.31", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index e9063491..08768951 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.15](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.14...binstalk-v0.28.15) - 2024-11-29 + +### Other + +- updated the following local packages: binstalk-fetchers, detect-targets + ## [0.28.14](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.13...binstalk-v0.28.14) - 2024-11-23 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 5b6e6bf1..a394789d 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.14" +version = "0.28.15" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -13,7 +13,7 @@ license = "GPL-3.0-only" binstalk-bins = { version = "0.6.5", path = "../binstalk-bins" } binstalk-downloader = { version = "0.13.5", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.5.7", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.10.5", path = "../binstalk-fetchers", features = [ +binstalk-fetchers = { version = "0.10.6", path = "../binstalk-fetchers", features = [ "quickinstall", ] } binstalk-registry = { version = "0.11.5", path = "../binstalk-registry" } @@ -21,7 +21,7 @@ binstalk-types = { version = "0.9.2", path = "../binstalk-types" } cargo-toml-workspace = { version = "6.0.3", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.30", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.31", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index 38f67fb8..d4c2e007 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.31](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.30...detect-targets-v0.1.31) - 2024-11-29 + +### Other + +- update Cargo.lock dependencies + ## [0.1.30](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.29...detect-targets-v0.1.30) - 2024-11-23 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index c6cd9a99..c327ddf2 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.30" +version = "0.1.31" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index e3e815c6..c4ff4221 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.14](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.13...detect-wasi-v1.0.14) - 2024-11-29 + +### Other + +- update Cargo.lock dependencies + ## [1.0.13](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.12...detect-wasi-v1.0.13) - 2024-11-23 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index d61c0976..d6e59a40 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.13" +version = "1.0.14" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From f95b696a7a20b247a90c2e4a13ed61cfb1f1a930 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 29 Nov 2024 20:22:18 +1000 Subject: [PATCH 1930/2020] Run CI on main whenever dependencies have changed (#1987) To update the cache. Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- .github/workflows/ci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7c24a634..b3602944 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,8 +14,14 @@ on: - opened - reopened - synchronize - schedule: - - cron: "0 3 * * 6" + push: + branches: + - main + paths: + - 'Cargo.lock' + - 'Cargo.toml' + - '**/Cargo.toml' + concurrency: group: ${{ github.workflow }}-${{ github.ref || github.event.pull_request.number || github.sha }}-${{ inputs.additional_key }} From d22433799a02a7a7ed73b3ba83e7eaa86e0cde92 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 29 Nov 2024 20:39:52 +1000 Subject: [PATCH 1931/2020] Fix permission of release-pr.yml (#1988) It needs permission pull-request to create PR Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- .github/workflows/release-pr.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 47f98b4b..39486a8c 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -33,6 +33,9 @@ on: type: string default: "false" +permissions: + pull-requests: write + jobs: make-release-pr: permissions: From 3e50dfbbc5e265258d4bd66057144f52bf2b330f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 29 Nov 2024 11:04:41 +0000 Subject: [PATCH 1932/2020] release: cargo-binstall v1.10.15 (#1989) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 83501aad..15c6379b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -562,7 +562,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.14" +version = "1.10.15" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 2b3132e2..352957f1 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.14" +version = "1.10.15" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index dc802aa7..3ab2a858 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 7384dab8cfcb41d5e1df049ca0edc08da6f20167 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 6 Dec 2024 04:00:48 +0000 Subject: [PATCH 1933/2020] dep: Upgrade transitive dependencies (#1991) Co-authored-by: github-actions --- Cargo.lock | 238 ++++++++++++++++++++++++++--------------------------- 1 file changed, 116 insertions(+), 122 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 15c6379b..fb2fa744 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,9 +61,9 @@ dependencies = [ [[package]] name = "allocator-api2" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45862d1c77f2228b9e10bc609d5bc203d86ebc9b87ad8d5d5167a6c9abf739d9" +checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "android-tzdata" @@ -131,9 +131,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" +checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" [[package]] name = "arc-swap" @@ -279,7 +279,7 @@ dependencies = [ "strum", "target-lexicon", "tempfile", - "thiserror 2.0.3", + "thiserror 2.0.4", "tokio", "tracing", "url", @@ -296,7 +296,7 @@ dependencies = [ "leon", "miette", "normalize-path", - "thiserror 2.0.3", + "thiserror 2.0.4", "tracing", ] @@ -326,7 +326,7 @@ dependencies = [ "serde", "serde_json", "tempfile", - "thiserror 2.0.3", + "thiserror 2.0.4", "tokio", "tokio-tar", "tokio-util", @@ -354,7 +354,7 @@ dependencies = [ "minisign-verify", "once_cell", "strum", - "thiserror 2.0.3", + "thiserror 2.0.4", "tokio", "tracing", "url", @@ -371,7 +371,7 @@ dependencies = [ "serde", "serde-tuple-vec-map", "serde_json", - "thiserror 2.0.3", + "thiserror 2.0.4", "tokio", "tracing", "tracing-subscriber", @@ -395,7 +395,7 @@ dependencies = [ "serde-tuple-vec-map", "serde_json", "tempfile", - "thiserror 2.0.3", + "thiserror 2.0.4", "toml_edit", "url", ] @@ -420,7 +420,7 @@ dependencies = [ "sha2", "simple-git", "tempfile", - "thiserror 2.0.3", + "thiserror 2.0.4", "tokio", "toml_edit", "tracing", @@ -610,7 +610,7 @@ dependencies = [ "normalize-path", "serde", "tempfile", - "thiserror 2.0.3", + "thiserror 2.0.4", "tracing", ] @@ -649,9 +649,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.1" +version = "1.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9de9f2205d5ef3fd67e685b0df337994ddd4495e2a28d185500d0e1edfea47" +checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" dependencies = [ "jobserver", "libc", @@ -697,9 +697,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.21" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" +checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" dependencies = [ "clap_builder", "clap_derive", @@ -707,9 +707,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.21" +version = "4.5.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" +checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" dependencies = [ "anstream", "anstyle", @@ -731,9 +731,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" [[package]] name = "clru" @@ -1339,7 +1339,7 @@ dependencies = [ "gix-worktree-state", "once_cell", "smallvec", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1352,7 +1352,7 @@ dependencies = [ "gix-date", "gix-utils", "itoa", - "thiserror 2.0.3", + "thiserror 2.0.4", "winnow 0.6.20", ] @@ -1369,7 +1369,7 @@ dependencies = [ "gix-trace", "kstring", "smallvec", - "thiserror 2.0.3", + "thiserror 2.0.4", "unicode-bom", ] @@ -1379,7 +1379,7 @@ version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d48b897b4bbc881aea994b4a5bbb340a04979d7be9089791304e04a9fbc66b53" dependencies = [ - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1388,7 +1388,7 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6ffbeb3a5c0b8b84c3fe4133a6f8c82fa962f4caefe8d0762eced025d3eb4f7" dependencies = [ - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1414,7 +1414,7 @@ dependencies = [ "gix-features", "gix-hash", "memmap2", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1433,7 +1433,7 @@ dependencies = [ "memchr", "once_cell", "smallvec", - "thiserror 2.0.3", + "thiserror 2.0.4", "unicode-bom", "winnow 0.6.20", ] @@ -1448,7 +1448,7 @@ dependencies = [ "bstr", "gix-path", "libc", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1465,7 +1465,7 @@ dependencies = [ "gix-sec", "gix-trace", "gix-url", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1477,7 +1477,7 @@ dependencies = [ "bstr", "itoa", "jiff", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1489,7 +1489,7 @@ dependencies = [ "bstr", "gix-hash", "gix-object", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1505,7 +1505,7 @@ dependencies = [ "gix-path", "gix-ref", "gix-sec", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1528,7 +1528,7 @@ dependencies = [ "prodash", "sha1", "sha1_smol", - "thiserror 2.0.3", + "thiserror 2.0.4", "walkdir", ] @@ -1550,7 +1550,7 @@ dependencies = [ "gix-trace", "gix-utils", "smallvec", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1583,7 +1583,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b5eccc17194ed0e67d49285e4853307e4147e95407f91c1c3e4a13ba9f4e4ce" dependencies = [ "faster-hex", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1635,7 +1635,7 @@ dependencies = [ "memmap2", "rustix", "smallvec", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1646,7 +1646,7 @@ checksum = "1cd3ab68a452db63d9f3ebdacb10f30dba1fa0d31ac64f4203d395ed1102d940" dependencies = [ "gix-tempfile", "gix-utils", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1662,7 +1662,7 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1681,7 +1681,7 @@ dependencies = [ "gix-validate", "itoa", "smallvec", - "thiserror 2.0.3", + "thiserror 2.0.4", "winnow 0.6.20", ] @@ -1703,7 +1703,7 @@ dependencies = [ "gix-quote", "parking_lot", "tempfile", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1723,7 +1723,7 @@ dependencies = [ "memmap2", "parking_lot", "smallvec", - "thiserror 2.0.3", + "thiserror 2.0.4", "uluru", ] @@ -1736,7 +1736,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1748,7 +1748,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1761,7 +1761,7 @@ dependencies = [ "gix-trace", "home", "once_cell", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1776,7 +1776,7 @@ dependencies = [ "gix-config-value", "gix-glob", "gix-path", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1789,7 +1789,7 @@ dependencies = [ "gix-config-value", "parking_lot", "rustix", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1806,7 +1806,7 @@ dependencies = [ "gix-transport", "gix-utils", "maybe-async", - "thiserror 2.0.3", + "thiserror 2.0.4", "winnow 0.6.20", ] @@ -1818,7 +1818,7 @@ checksum = "64a1e282216ec2ab2816cd57e6ed88f8009e634aec47562883c05ac8a7009a63" dependencies = [ "bstr", "gix-utils", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1838,7 +1838,7 @@ dependencies = [ "gix-utils", "gix-validate", "memmap2", - "thiserror 2.0.3", + "thiserror 2.0.4", "winnow 0.6.20", ] @@ -1853,7 +1853,7 @@ dependencies = [ "gix-revision", "gix-validate", "smallvec", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1868,7 +1868,7 @@ dependencies = [ "gix-hash", "gix-object", "gix-revwalk", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1883,7 +1883,7 @@ dependencies = [ "gix-hashtable", "gix-object", "smallvec", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1910,7 +1910,7 @@ dependencies = [ "gix-pathspec", "gix-refspec", "gix-url", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1948,7 +1948,7 @@ dependencies = [ "gix-sec", "gix-url", "reqwest", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1965,7 +1965,7 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -1977,7 +1977,7 @@ dependencies = [ "bstr", "gix-features", "gix-path", - "thiserror 2.0.3", + "thiserror 2.0.4", "url", ] @@ -1998,7 +1998,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd520d09f9f585b34b32aba1d0b36ada89ab7fefb54a8ca3fe37fc482a750937" dependencies = [ "bstr", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -2037,7 +2037,7 @@ dependencies = [ "gix-path", "gix-worktree", "io-close", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -2127,12 +2127,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" - [[package]] name = "hickory-proto" version = "0.25.0-alpha.4" @@ -2162,7 +2156,7 @@ dependencies = [ "rand", "ring", "rustls", - "thiserror 2.0.3", + "thiserror 2.0.4", "time", "tinyvec", "tokio", @@ -2190,7 +2184,7 @@ dependencies = [ "resolv-conf", "rustls", "smallvec", - "thiserror 2.0.3", + "thiserror 2.0.4", "tokio", "tokio-native-tls", "tokio-rustls", @@ -2219,9 +2213,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" dependencies = [ "bytes", "fnv", @@ -2507,9 +2501,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" +checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -2572,9 +2566,9 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jiff" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9d9d414fc817d3e3d62b2598616733f76c4cc74fbac96069674739b881295c8" +checksum = "db69f08d4fb10524cacdb074c10b296299d71274ddbc830a8ee65666867002e9" dependencies = [ "jiff-tzdb-platform", "windows-sys 0.59.0", @@ -2621,10 +2615,11 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.72" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a88f1bda2bd75b0452a14784937d796722fdebfe50df998aeb3f0b7603019a9" +checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705" dependencies = [ + "once_cell", "wasm-bindgen", ] @@ -2650,7 +2645,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42a865ffec5587961f5afc6d365bccb304f4feaa1928f4fe94c91c9d210d7310" dependencies = [ "miette", - "thiserror 2.0.3", + "thiserror 2.0.4", ] [[package]] @@ -2667,9 +2662,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.166" +version = "0.2.167" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2ccc108bbc0b1331bd061864e7cd823c0cab660bbe6970e66e2c0614decde36" +checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" [[package]] name = "libmimalloc-sys" @@ -2870,11 +2865,10 @@ dependencies = [ [[package]] name = "mio" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ - "hermit-abi", "libc", "wasi", "windows-sys 0.52.0", @@ -3366,7 +3360,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror 2.0.3", + "thiserror 2.0.4", "tokio", "tracing", ] @@ -3385,7 +3379,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.3", + "thiserror 2.0.4", "tinyvec", "tracing", "web-time", @@ -3647,9 +3641,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "2.0.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152" +checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" [[package]] name = "rustc_version" @@ -4057,9 +4051,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.89" +version = "2.0.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d46482f1c1c87acd84dea20c1bf5ebff4c757009ed6bf19cfd36fb10e92c4e" +checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" dependencies = [ "proc-macro2", "quote", @@ -4155,9 +4149,9 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f599bd7ca042cfdf8f4512b277c02ba102247820f9d9d4a9f521f496751a6ef" +checksum = "5352447f921fda68cf61b4101566c0bdb5104eff6804d0678e5227580ab6a4e9" dependencies = [ "rustix", "windows-sys 0.59.0", @@ -4184,11 +4178,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +checksum = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490" dependencies = [ - "thiserror-impl 2.0.3", + "thiserror-impl 2.0.4", ] [[package]] @@ -4204,9 +4198,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.3" +version = "2.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" +checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" dependencies = [ "proc-macro2", "quote", @@ -4225,9 +4219,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" dependencies = [ "deranged", "itoa", @@ -4248,9 +4242,9 @@ checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" dependencies = [ "num-conv", "time-core", @@ -4283,9 +4277,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.41.1" +version = "1.42.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" +checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" dependencies = [ "backtrace", "bytes", @@ -4321,12 +4315,11 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ "rustls", - "rustls-pki-types", "tokio", ] @@ -4358,9 +4351,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.12" +version = "0.7.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" dependencies = [ "bytes", "futures-core", @@ -4455,9 +4448,9 @@ dependencies = [ [[package]] name = "tracing-serde" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" +checksum = "704b1aeb7be0d0a84fc9828cae51dab5970fee5088f83d1dd7ee6f6246fc6ff1" dependencies = [ "serde", "tracing-core", @@ -4465,9 +4458,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.3.18" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" +checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ "nu-ansi-term", "serde", @@ -4665,9 +4658,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "128d1e363af62632b8eb57219c8fd7877144af57558fb2ef0368d0087bddeb2e" +checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c" dependencies = [ "cfg-if", "once_cell", @@ -4676,9 +4669,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6dd4d3ca0ddffd1dd1c9c04f94b868c37ff5fac97c30b97cff2d74fce3a358" +checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd" dependencies = [ "bumpalo", "log", @@ -4691,21 +4684,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.45" +version = "0.4.47" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc7ec4f8827a71586374db3e87abdb5a2bb3a15afed140221307c3ec06b1f63b" +checksum = "9dfaf8f50e5f293737ee323940c7d8b08a66a95a419223d9f41610ca08b0833d" dependencies = [ "cfg-if", "js-sys", + "once_cell", "wasm-bindgen", "web-sys", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e79384be7f8f5a9dd5d7167216f022090cf1f9ec128e6e6a482a2cb5c5422c56" +checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4713,9 +4707,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26c6ab57572f7a24a4985830b120de1594465e5d500f24afe89e16b4e833ef68" +checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" dependencies = [ "proc-macro2", "quote", @@ -4726,9 +4720,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.95" +version = "0.2.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65fc09f10666a9f147042251e0dda9c18f166ff7de300607007e96bdebc1068d" +checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49" [[package]] name = "wasm-streams" @@ -4745,9 +4739,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.72" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6488b90108c040df0fe62fa815cbdee25124641df01814dd7282749234c6112" +checksum = "a98bc3c33f0fe7e59ad7cd041b89034fa82a7c2d4365ca538dda6cdaf513863c" dependencies = [ "js-sys", "wasm-bindgen", From e9f25187d770a625aef5b6c777e9855f29842d7d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 7 Dec 2024 04:05:38 +0000 Subject: [PATCH 1934/2020] build(deps): bump the deps group with 3 updates (#1993) * build(deps): bump the deps group with 3 updates Bumps the deps group with 3 updates: [target-lexicon](https://github.com/bytecodealliance/target-lexicon), [cargo_toml](https://gitlab.com/lib.rs/cargo_toml) and [fs4](https://github.com/al8n/fs4-rs). Updates `target-lexicon` from 0.12.16 to 0.13.0 - [Commits](https://github.com/bytecodealliance/target-lexicon/compare/v0.12.16...v0.13.0) Updates `cargo_toml` from 0.20.5 to 0.21.0 - [Commits](https://gitlab.com/lib.rs/cargo_toml/commits/main) Updates `fs4` from 0.11.1 to 0.12.0 - [Release notes](https://github.com/al8n/fs4-rs/releases) - [Commits](https://github.com/al8n/fs4-rs/commits) --- updated-dependencies: - dependency-name: target-lexicon dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: cargo_toml dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: fs4 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] * Fix use of cargo-toml in parse-meta.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- Cargo.lock | 12 ++++++------ crates/binstalk/Cargo.toml | 2 +- crates/binstalk/tests/parse-meta.rs | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- crates/fs-lock/Cargo.toml | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fb2fa744..b011a26c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -630,9 +630,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.20.5" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88da5a13c620b4ca0078845707ea9c3faf11edbc3ffd8497d11d686211cd1ac0" +checksum = "5fbd1fe9db3ebf71b89060adaf7b0504c2d6a425cf061313099547e382c2e472" dependencies = [ "serde", "toml", @@ -1164,9 +1164,9 @@ dependencies = [ [[package]] name = "fs4" -version = "0.11.1" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e871a4cfa68bb224863b53149d973df1ac8d1ed2fa1d1bfc37ac1bb65dd37207" +checksum = "c29c30684418547d476f0b48e84f4821639119c483b1eccd566c8cd0cd05f521" dependencies = [ "rustix", "windows-sys 0.52.0", @@ -4130,9 +4130,9 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "target-lexicon" -version = "0.12.16" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1" +checksum = "4ff4a4048091358129767b8a200d6927f58876c8b5ea16fb7b0222d43b79bfa8" [[package]] name = "tempfile" diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index a394789d..dd1cf81a 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -33,7 +33,7 @@ miette = "7.0.0" semver = { version = "1.0.17", features = ["serde"] } simple-git = { version = "0.2.10", optional = true } strum = "0.26.1" -target-lexicon = { version = "0.12.11", features = ["std"] } +target-lexicon = { version = "0.13.0", features = ["std"] } tempfile = "3.5.0" thiserror = "2.0.1" tokio = { version = "1.35.0", features = [ diff --git a/crates/binstalk/tests/parse-meta.rs b/crates/binstalk/tests/parse-meta.rs index 5d47aae4..72da08f7 100644 --- a/crates/binstalk/tests/parse-meta.rs +++ b/crates/binstalk/tests/parse-meta.rs @@ -24,7 +24,7 @@ fn parse_meta() { &[Product { name: Some("cargo-binstall".to_string()), path: Some("src/main.rs".to_string()), - edition: Edition::E2021, + edition: Some(Edition::E2021), ..Default::default() },], ); diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 06d25f35..616f2d7c 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Jiahao XU "] license = "Apache-2.0 OR MIT" [dependencies] -cargo_toml = "0.20.0" +cargo_toml = "0.21.0" compact_str = { version = "0.8.0", features = ["serde"] } glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 163584f6..ea978ed6 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -10,4 +10,4 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -fs4 = "0.11.0" +fs4 = "0.12.0" From c8e29f204edb40cfed9a925e2eec0ba4265372b1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 7 Dec 2024 15:55:43 +1100 Subject: [PATCH 1935/2020] chore: release (#1992) * chore: release * Apply suggestions from code review Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- Cargo.lock | 14 +++++++------- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 6 +++--- crates/binstalk-registry/CHANGELOG.md | 6 ++++++ crates/binstalk-registry/Cargo.toml | 4 ++-- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 8 ++++---- crates/cargo-toml-workspace/CHANGELOG.md | 6 ++++++ crates/cargo-toml-workspace/Cargo.toml | 2 +- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- crates/fs-lock/CHANGELOG.md | 6 ++++++ crates/fs-lock/Cargo.toml | 2 +- 16 files changed, 64 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b011a26c..5b7c1a0b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -256,7 +256,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.15" +version = "0.28.16" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -381,7 +381,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.12" +version = "0.15.13" dependencies = [ "beef", "binstalk-types", @@ -402,7 +402,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.11.5" +version = "0.11.6" dependencies = [ "async-trait", "base16", @@ -602,7 +602,7 @@ dependencies = [ [[package]] name = "cargo-toml-workspace" -version = "6.0.3" +version = "7.0.0" dependencies = [ "cargo_toml", "compact_str", @@ -927,7 +927,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.31" +version = "0.1.32" dependencies = [ "cfg-if", "guess_host_triple", @@ -939,7 +939,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.14" +version = "1.0.15" dependencies = [ "tempfile", ] @@ -1157,7 +1157,7 @@ dependencies = [ [[package]] name = "fs-lock" -version = "0.1.6" +version = "0.1.7" dependencies = [ "fs4", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 352957f1..9315edd5 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,8 +23,8 @@ pkg-fmt = "zip" [dependencies] atomic-file-install = { version = "1.0.6", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.15", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.12" } +binstalk = { path = "../binstalk", version = "0.28.16", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.13" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index ec2bb099..a91c5d95 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.13](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.12...binstalk-manifests-v0.15.13) - 2024-12-07 + +### Other + +- updated the following local packages: detect-targets, fs-lock + ## [0.15.12](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.11...binstalk-manifests-v0.15.12) - 2024-11-29 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 9bc32b8c..9f3da790 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.12" +version = "0.15.13" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" beef = { version = "0.5.2", features = ["impl_serde"] } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } -fs-lock = { version = "0.1.6", path = "../fs-lock" } +fs-lock = { version = "0.1.7", path = "../fs-lock" } home = "0.5.9" miette = "7.0.0" semver = { version = "1.0.17", features = ["serde"] } @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.31", path = "../detect-targets" } +detect-targets = { version = "0.1.32", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md index c7e51adc..462e3e37 100644 --- a/crates/binstalk-registry/CHANGELOG.md +++ b/crates/binstalk-registry/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.6](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.5...binstalk-registry-v0.11.6) - 2024-12-07 + +### Other + +- updated the following local packages: cargo-toml-workspace + ## [0.11.5](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.4...binstalk-registry-v0.11.5) - 2024-11-23 ### Other diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 4d237767..c941e411 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.11.5" +version = "0.11.6" edition = "2021" rust-version = "1.65.0" @@ -17,7 +17,7 @@ binstalk-downloader = { version = "0.13.5", path = "../binstalk-downloader", def "json", ] } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } -cargo-toml-workspace = { version = "6.0.3", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "7.0.0", path = "../cargo-toml-workspace" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index 08768951..5ab91fc5 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.16](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.15...binstalk-v0.28.16) - 2024-12-07 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1993](https://github.com/cargo-bins/cargo-binstall/pull/1993)) + ## [0.28.15](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.14...binstalk-v0.28.15) - 2024-11-29 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index dd1cf81a..0f3bfcc2 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.15" +version = "0.28.16" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -16,12 +16,12 @@ binstalk-git-repo-api = { version = "0.5.7", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.10.6", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.11.5", path = "../binstalk-registry" } +binstalk-registry = { version = "0.11.6", path = "../binstalk-registry" } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } -cargo-toml-workspace = { version = "6.0.3", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "7.0.0", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.31", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.32", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/cargo-toml-workspace/CHANGELOG.md b/crates/cargo-toml-workspace/CHANGELOG.md index d460c883..862bf006 100644 --- a/crates/cargo-toml-workspace/CHANGELOG.md +++ b/crates/cargo-toml-workspace/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [7.0.0](https://github.com/cargo-bins/cargo-binstall/compare/cargo-toml-workspace-v6.0.3...cargo-toml-workspace-v7.0.0) - 2024-12-07 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1993](https://github.com/cargo-bins/cargo-binstall/pull/1993)) + ## [6.0.3](https://github.com/cargo-bins/cargo-binstall/compare/cargo-toml-workspace-v6.0.2...cargo-toml-workspace-v6.0.3) - 2024-11-09 ### Other diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 616f2d7c..95d676a3 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-toml-workspace" -version = "6.0.3" +version = "7.0.0" edition = "2021" description = "Parse cargo workspace and load specific crate" repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index d4c2e007..ab6ec246 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.32](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.31...detect-targets-v0.1.32) - 2024-12-07 + +### Other + +- update Cargo.lock dependencies + ## [0.1.31](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.30...detect-targets-v0.1.31) - 2024-11-29 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index c327ddf2..d937131f 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.31" +version = "0.1.32" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index c4ff4221..4ecee1f5 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.15](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.14...detect-wasi-v1.0.15) - 2024-12-07 + +### Other + +- update Cargo.lock dependencies + ## [1.0.14](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.13...detect-wasi-v1.0.14) - 2024-11-29 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index d6e59a40..ec715b6c 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.14" +version = "1.0.15" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" diff --git a/crates/fs-lock/CHANGELOG.md b/crates/fs-lock/CHANGELOG.md index 862b40d7..2f99c1b6 100644 --- a/crates/fs-lock/CHANGELOG.md +++ b/crates/fs-lock/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.7](https://github.com/cargo-bins/cargo-binstall/compare/fs-lock-v0.1.6...fs-lock-v0.1.7) - 2024-12-07 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#1993](https://github.com/cargo-bins/cargo-binstall/pull/1993)) + ## [0.1.6](https://github.com/cargo-bins/cargo-binstall/compare/fs-lock-v0.1.5...fs-lock-v0.1.6) - 2024-11-05 ### Other diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index ea978ed6..04d36516 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -3,7 +3,7 @@ name = "fs-lock" description = "Locked files that can be used like normal File" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/fs-lock" -version = "0.1.6" +version = "0.1.7" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From b8ce712a752e7a76842c7ce66eed1de7a17ab68c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 7 Dec 2024 06:06:30 +0000 Subject: [PATCH 1936/2020] release: cargo-binstall v1.10.16 (#1994) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5b7c1a0b..eedd00b0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -562,7 +562,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.15" +version = "1.10.16" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 9315edd5..80196773 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.15" +version = "1.10.16" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 3ab2a858..7d1d3b87 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From c827565f9ae799861507597d4bf0bd55265664f9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 13 Dec 2024 10:27:01 +0000 Subject: [PATCH 1937/2020] dep: Upgrade transitive dependencies (#1995) Co-authored-by: github-actions --- Cargo.lock | 215 ++++++++++++++++++++++++++--------------------------- 1 file changed, 107 insertions(+), 108 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eedd00b0..16677764 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ dependencies = [ "strum", "target-lexicon", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tracing", "url", @@ -296,7 +296,7 @@ dependencies = [ "leon", "miette", "normalize-path", - "thiserror 2.0.4", + "thiserror 2.0.6", "tracing", ] @@ -326,7 +326,7 @@ dependencies = [ "serde", "serde_json", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-tar", "tokio-util", @@ -354,7 +354,7 @@ dependencies = [ "minisign-verify", "once_cell", "strum", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tracing", "url", @@ -371,7 +371,7 @@ dependencies = [ "serde", "serde-tuple-vec-map", "serde_json", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tracing", "tracing-subscriber", @@ -395,7 +395,7 @@ dependencies = [ "serde-tuple-vec-map", "serde_json", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", "toml_edit", "url", ] @@ -420,7 +420,7 @@ dependencies = [ "sha2", "simple-git", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "toml_edit", "tracing", @@ -497,9 +497,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a68f1f47cdf0ec8ee4b941b2eee2a80cb796db73118c0dd09ac63fbe405be22" +checksum = "786a307d683a5bf92e6fd5fd69a7eb613751668d1d8d67d802846dfe367c62c8" dependencies = [ "memchr", "regex-automata", @@ -610,7 +610,7 @@ dependencies = [ "normalize-path", "serde", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", "tracing", ] @@ -649,9 +649,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.2" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" +checksum = "27f657647bcff5394bf56c7317665bbf790a137a50eaaa5c6bfbb9e27a518f2d" dependencies = [ "jobserver", "libc", @@ -683,9 +683,9 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1092,9 +1092,9 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "file-format" @@ -1339,7 +1339,7 @@ dependencies = [ "gix-worktree-state", "once_cell", "smallvec", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1352,7 +1352,7 @@ dependencies = [ "gix-date", "gix-utils", "itoa", - "thiserror 2.0.4", + "thiserror 2.0.6", "winnow 0.6.20", ] @@ -1369,7 +1369,7 @@ dependencies = [ "gix-trace", "kstring", "smallvec", - "thiserror 2.0.4", + "thiserror 2.0.6", "unicode-bom", ] @@ -1379,7 +1379,7 @@ version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d48b897b4bbc881aea994b4a5bbb340a04979d7be9089791304e04a9fbc66b53" dependencies = [ - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1388,7 +1388,7 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6ffbeb3a5c0b8b84c3fe4133a6f8c82fa962f4caefe8d0762eced025d3eb4f7" dependencies = [ - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1414,7 +1414,7 @@ dependencies = [ "gix-features", "gix-hash", "memmap2", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1433,7 +1433,7 @@ dependencies = [ "memchr", "once_cell", "smallvec", - "thiserror 2.0.4", + "thiserror 2.0.6", "unicode-bom", "winnow 0.6.20", ] @@ -1448,7 +1448,7 @@ dependencies = [ "bstr", "gix-path", "libc", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1465,7 +1465,7 @@ dependencies = [ "gix-sec", "gix-trace", "gix-url", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1477,7 +1477,7 @@ dependencies = [ "bstr", "itoa", "jiff", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1489,7 +1489,7 @@ dependencies = [ "bstr", "gix-hash", "gix-object", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1505,7 +1505,7 @@ dependencies = [ "gix-path", "gix-ref", "gix-sec", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1528,7 +1528,7 @@ dependencies = [ "prodash", "sha1", "sha1_smol", - "thiserror 2.0.4", + "thiserror 2.0.6", "walkdir", ] @@ -1550,7 +1550,7 @@ dependencies = [ "gix-trace", "gix-utils", "smallvec", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1583,7 +1583,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b5eccc17194ed0e67d49285e4853307e4147e95407f91c1c3e4a13ba9f4e4ce" dependencies = [ "faster-hex", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1635,7 +1635,7 @@ dependencies = [ "memmap2", "rustix", "smallvec", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1646,7 +1646,7 @@ checksum = "1cd3ab68a452db63d9f3ebdacb10f30dba1fa0d31ac64f4203d395ed1102d940" dependencies = [ "gix-tempfile", "gix-utils", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1662,7 +1662,7 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1681,7 +1681,7 @@ dependencies = [ "gix-validate", "itoa", "smallvec", - "thiserror 2.0.4", + "thiserror 2.0.6", "winnow 0.6.20", ] @@ -1703,7 +1703,7 @@ dependencies = [ "gix-quote", "parking_lot", "tempfile", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1723,7 +1723,7 @@ dependencies = [ "memmap2", "parking_lot", "smallvec", - "thiserror 2.0.4", + "thiserror 2.0.6", "uluru", ] @@ -1736,7 +1736,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1748,7 +1748,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1761,7 +1761,7 @@ dependencies = [ "gix-trace", "home", "once_cell", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1776,7 +1776,7 @@ dependencies = [ "gix-config-value", "gix-glob", "gix-path", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1789,7 +1789,7 @@ dependencies = [ "gix-config-value", "parking_lot", "rustix", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1806,7 +1806,7 @@ dependencies = [ "gix-transport", "gix-utils", "maybe-async", - "thiserror 2.0.4", + "thiserror 2.0.6", "winnow 0.6.20", ] @@ -1818,7 +1818,7 @@ checksum = "64a1e282216ec2ab2816cd57e6ed88f8009e634aec47562883c05ac8a7009a63" dependencies = [ "bstr", "gix-utils", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1838,7 +1838,7 @@ dependencies = [ "gix-utils", "gix-validate", "memmap2", - "thiserror 2.0.4", + "thiserror 2.0.6", "winnow 0.6.20", ] @@ -1853,7 +1853,7 @@ dependencies = [ "gix-revision", "gix-validate", "smallvec", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1868,7 +1868,7 @@ dependencies = [ "gix-hash", "gix-object", "gix-revwalk", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1883,7 +1883,7 @@ dependencies = [ "gix-hashtable", "gix-object", "smallvec", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1910,7 +1910,7 @@ dependencies = [ "gix-pathspec", "gix-refspec", "gix-url", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1948,7 +1948,7 @@ dependencies = [ "gix-sec", "gix-url", "reqwest", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1965,7 +1965,7 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -1977,7 +1977,7 @@ dependencies = [ "bstr", "gix-features", "gix-path", - "thiserror 2.0.4", + "thiserror 2.0.6", "url", ] @@ -1998,7 +1998,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd520d09f9f585b34b32aba1d0b36ada89ab7fefb54a8ca3fe37fc482a750937" dependencies = [ "bstr", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -2037,7 +2037,7 @@ dependencies = [ "gix-path", "gix-worktree", "io-close", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -2156,7 +2156,7 @@ dependencies = [ "rand", "ring", "rustls", - "thiserror 2.0.4", + "thiserror 2.0.6", "time", "tinyvec", "tokio", @@ -2184,7 +2184,7 @@ dependencies = [ "resolv-conf", "rustls", "smallvec", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tokio-native-tls", "tokio-rustls", @@ -2615,9 +2615,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.74" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705" +checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" dependencies = [ "once_cell", "wasm-bindgen", @@ -2645,7 +2645,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42a865ffec5587961f5afc6d365bccb304f4feaa1928f4fe94c91c9d210d7310" dependencies = [ "miette", - "thiserror 2.0.4", + "thiserror 2.0.6", ] [[package]] @@ -2662,9 +2662,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.167" +version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" +checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" [[package]] name = "libmimalloc-sys" @@ -2684,7 +2684,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.6.0", "libc", - "redox_syscall 0.5.7", + "redox_syscall 0.5.8", ] [[package]] @@ -2841,9 +2841,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "minisign-verify" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a05b5d0594e0cb1ad8cee3373018d2b84e25905dc75b2468114cc9a8e86cfc20" +checksum = "6367d84fb54d4242af283086402907277715b8fe46976963af5ebf173f8efba3" [[package]] name = "miniz_oxide" @@ -2950,9 +2950,9 @@ dependencies = [ [[package]] name = "netlink-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "416060d346fbaf1f23f9512963e3e878f1a78e707cb699ba9215761754244307" +checksum = "16c903aa70590cb93691bf97a767c8d1d6122d2cc9070433deb3bbf36ce8bd23" dependencies = [ "bytes", "libc", @@ -3173,7 +3173,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.7", + "redox_syscall 0.5.8", "smallvec", "windows-targets 0.52.6", ] @@ -3327,9 +3327,9 @@ dependencies = [ [[package]] name = "quanta" -version = "0.12.3" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5167a477619228a0b284fac2674e3c388cba90631d7b7de620e6f1fcd08da5" +checksum = "773ce68d0bb9bc7ef20be3536ffe94e223e1f365bd374108b2659fac0c65cfe6" dependencies = [ "crossbeam-utils", "libc", @@ -3360,7 +3360,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror 2.0.4", + "thiserror 2.0.6", "tokio", "tracing", ] @@ -3379,7 +3379,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.4", + "thiserror 2.0.6", "tinyvec", "tracing", "web-time", @@ -3387,9 +3387,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d5a626c6807713b15cac82a6acaccd6043c9a5408c24baae07611fec3f243da" +checksum = "52cd4b1eff68bf27940dd39811292c49e007f4d0b4c357358dc9b0197be6b527" dependencies = [ "cfg_aliases", "libc", @@ -3494,9 +3494,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ "bitflags 2.6.0", ] @@ -3656,22 +3656,22 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.41" +version = "0.38.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" dependencies = [ "bitflags 2.6.0", "errno 0.3.10", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] name = "rustls" -version = "0.23.19" +version = "0.23.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" dependencies = [ "log", "once_cell", @@ -3797,18 +3797,18 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" dependencies = [ "serde_derive", ] @@ -3824,9 +3824,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.216" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" dependencies = [ "proc-macro2", "quote", @@ -4178,11 +4178,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.4" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f49a1853cf82743e3b7950f77e0f4d622ca36cf4317cba00c767838bac8d490" +checksum = "8fec2a1820ebd077e2b90c4df007bebf344cd394098a13c563957d0afc83ea47" dependencies = [ - "thiserror-impl 2.0.4", + "thiserror-impl 2.0.6", ] [[package]] @@ -4198,9 +4198,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.4" +version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8381894bb3efe0c4acac3ded651301ceee58a15d47c2e34885ed1908ad667061" +checksum = "d65750cab40f4ff1929fb1ba509e9914eb756131cef4210da8d5d700d26f6312" dependencies = [ "proc-macro2", "quote", @@ -4325,9 +4325,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -4658,9 +4658,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c" +checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" dependencies = [ "cfg-if", "once_cell", @@ -4669,13 +4669,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd" +checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", "syn", @@ -4684,9 +4683,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.47" +version = "0.4.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dfaf8f50e5f293737ee323940c7d8b08a66a95a419223d9f41610ca08b0833d" +checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" dependencies = [ "cfg-if", "js-sys", @@ -4697,9 +4696,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051" +checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4707,9 +4706,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" +checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", @@ -4720,9 +4719,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.97" +version = "0.2.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49" +checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" [[package]] name = "wasm-streams" @@ -4739,9 +4738,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.74" +version = "0.3.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a98bc3c33f0fe7e59ad7cd041b89034fa82a7c2d4365ca538dda6cdaf513863c" +checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" dependencies = [ "js-sys", "wasm-bindgen", From 299c771d8fb5d102862bc3eaf7fedf4c5f201dbf Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 12:14:33 +1000 Subject: [PATCH 1938/2020] build(deps): bump the deps group with 2 updates (#1997) Bumps the deps group with 2 updates: [thiserror](https://github.com/dtolnay/thiserror) and [bzip2](https://github.com/trifectatechfoundation/bzip2-rs). Updates `thiserror` from 2.0.6 to 2.0.7 - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/2.0.6...2.0.7) Updates `bzip2` from 0.4.4 to 0.5.0 - [Release notes](https://github.com/trifectatechfoundation/bzip2-rs/releases) - [Commits](https://github.com/trifectatechfoundation/bzip2-rs/compare/0.4.4...v0.5.0) --- updated-dependencies: - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: bzip2 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 128 +++++++++++++----------- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 4 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-git-repo-api/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- 9 files changed, 78 insertions(+), 68 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 16677764..c243f750 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -154,7 +154,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df895a515f70646414f4b45c0b79082783b80552b373a68283012928df56f522" dependencies = [ "brotli", - "bzip2", + "bzip2 0.4.4", "flate2", "futures-core", "memchr", @@ -279,7 +279,7 @@ dependencies = [ "strum", "target-lexicon", "tempfile", - "thiserror 2.0.6", + "thiserror 2.0.7", "tokio", "tracing", "url", @@ -296,7 +296,7 @@ dependencies = [ "leon", "miette", "normalize-path", - "thiserror 2.0.6", + "thiserror 2.0.7", "tracing", ] @@ -309,7 +309,7 @@ dependencies = [ "binstalk-types", "binstall-tar", "bytes", - "bzip2", + "bzip2 0.5.0", "cfg-if", "compact_str", "default-net", @@ -326,7 +326,7 @@ dependencies = [ "serde", "serde_json", "tempfile", - "thiserror 2.0.6", + "thiserror 2.0.7", "tokio", "tokio-tar", "tokio-util", @@ -354,7 +354,7 @@ dependencies = [ "minisign-verify", "once_cell", "strum", - "thiserror 2.0.6", + "thiserror 2.0.7", "tokio", "tracing", "url", @@ -371,7 +371,7 @@ dependencies = [ "serde", "serde-tuple-vec-map", "serde_json", - "thiserror 2.0.6", + "thiserror 2.0.7", "tokio", "tracing", "tracing-subscriber", @@ -395,7 +395,7 @@ dependencies = [ "serde-tuple-vec-map", "serde_json", "tempfile", - "thiserror 2.0.6", + "thiserror 2.0.7", "toml_edit", "url", ] @@ -420,7 +420,7 @@ dependencies = [ "sha2", "simple-git", "tempfile", - "thiserror 2.0.6", + "thiserror 2.0.7", "tokio", "toml_edit", "tracing", @@ -540,6 +540,16 @@ dependencies = [ "libc", ] +[[package]] +name = "bzip2" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bafdbf26611df8c14810e268ddceda071c297570a5fb360ceddf617fe417ef58" +dependencies = [ + "bzip2-sys", + "libc", +] + [[package]] name = "bzip2-sys" version = "0.1.11+1.0.8" @@ -610,7 +620,7 @@ dependencies = [ "normalize-path", "serde", "tempfile", - "thiserror 2.0.6", + "thiserror 2.0.7", "tracing", ] @@ -1339,7 +1349,7 @@ dependencies = [ "gix-worktree-state", "once_cell", "smallvec", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1352,7 +1362,7 @@ dependencies = [ "gix-date", "gix-utils", "itoa", - "thiserror 2.0.6", + "thiserror 2.0.7", "winnow 0.6.20", ] @@ -1369,7 +1379,7 @@ dependencies = [ "gix-trace", "kstring", "smallvec", - "thiserror 2.0.6", + "thiserror 2.0.7", "unicode-bom", ] @@ -1379,7 +1389,7 @@ version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d48b897b4bbc881aea994b4a5bbb340a04979d7be9089791304e04a9fbc66b53" dependencies = [ - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1388,7 +1398,7 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6ffbeb3a5c0b8b84c3fe4133a6f8c82fa962f4caefe8d0762eced025d3eb4f7" dependencies = [ - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1414,7 +1424,7 @@ dependencies = [ "gix-features", "gix-hash", "memmap2", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1433,7 +1443,7 @@ dependencies = [ "memchr", "once_cell", "smallvec", - "thiserror 2.0.6", + "thiserror 2.0.7", "unicode-bom", "winnow 0.6.20", ] @@ -1448,7 +1458,7 @@ dependencies = [ "bstr", "gix-path", "libc", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1465,7 +1475,7 @@ dependencies = [ "gix-sec", "gix-trace", "gix-url", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1477,7 +1487,7 @@ dependencies = [ "bstr", "itoa", "jiff", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1489,7 +1499,7 @@ dependencies = [ "bstr", "gix-hash", "gix-object", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1505,7 +1515,7 @@ dependencies = [ "gix-path", "gix-ref", "gix-sec", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1528,7 +1538,7 @@ dependencies = [ "prodash", "sha1", "sha1_smol", - "thiserror 2.0.6", + "thiserror 2.0.7", "walkdir", ] @@ -1550,7 +1560,7 @@ dependencies = [ "gix-trace", "gix-utils", "smallvec", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1583,7 +1593,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b5eccc17194ed0e67d49285e4853307e4147e95407f91c1c3e4a13ba9f4e4ce" dependencies = [ "faster-hex", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1635,7 +1645,7 @@ dependencies = [ "memmap2", "rustix", "smallvec", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1646,7 +1656,7 @@ checksum = "1cd3ab68a452db63d9f3ebdacb10f30dba1fa0d31ac64f4203d395ed1102d940" dependencies = [ "gix-tempfile", "gix-utils", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1662,7 +1672,7 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1681,7 +1691,7 @@ dependencies = [ "gix-validate", "itoa", "smallvec", - "thiserror 2.0.6", + "thiserror 2.0.7", "winnow 0.6.20", ] @@ -1703,7 +1713,7 @@ dependencies = [ "gix-quote", "parking_lot", "tempfile", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1723,7 +1733,7 @@ dependencies = [ "memmap2", "parking_lot", "smallvec", - "thiserror 2.0.6", + "thiserror 2.0.7", "uluru", ] @@ -1736,7 +1746,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1748,7 +1758,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1761,7 +1771,7 @@ dependencies = [ "gix-trace", "home", "once_cell", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1776,7 +1786,7 @@ dependencies = [ "gix-config-value", "gix-glob", "gix-path", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1789,7 +1799,7 @@ dependencies = [ "gix-config-value", "parking_lot", "rustix", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1806,7 +1816,7 @@ dependencies = [ "gix-transport", "gix-utils", "maybe-async", - "thiserror 2.0.6", + "thiserror 2.0.7", "winnow 0.6.20", ] @@ -1818,7 +1828,7 @@ checksum = "64a1e282216ec2ab2816cd57e6ed88f8009e634aec47562883c05ac8a7009a63" dependencies = [ "bstr", "gix-utils", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1838,7 +1848,7 @@ dependencies = [ "gix-utils", "gix-validate", "memmap2", - "thiserror 2.0.6", + "thiserror 2.0.7", "winnow 0.6.20", ] @@ -1853,7 +1863,7 @@ dependencies = [ "gix-revision", "gix-validate", "smallvec", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1868,7 +1878,7 @@ dependencies = [ "gix-hash", "gix-object", "gix-revwalk", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1883,7 +1893,7 @@ dependencies = [ "gix-hashtable", "gix-object", "smallvec", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1910,7 +1920,7 @@ dependencies = [ "gix-pathspec", "gix-refspec", "gix-url", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1948,7 +1958,7 @@ dependencies = [ "gix-sec", "gix-url", "reqwest", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1965,7 +1975,7 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -1977,7 +1987,7 @@ dependencies = [ "bstr", "gix-features", "gix-path", - "thiserror 2.0.6", + "thiserror 2.0.7", "url", ] @@ -1998,7 +2008,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd520d09f9f585b34b32aba1d0b36ada89ab7fefb54a8ca3fe37fc482a750937" dependencies = [ "bstr", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -2037,7 +2047,7 @@ dependencies = [ "gix-path", "gix-worktree", "io-close", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -2156,7 +2166,7 @@ dependencies = [ "rand", "ring", "rustls", - "thiserror 2.0.6", + "thiserror 2.0.7", "time", "tinyvec", "tokio", @@ -2184,7 +2194,7 @@ dependencies = [ "resolv-conf", "rustls", "smallvec", - "thiserror 2.0.6", + "thiserror 2.0.7", "tokio", "tokio-native-tls", "tokio-rustls", @@ -2645,7 +2655,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42a865ffec5587961f5afc6d365bccb304f4feaa1928f4fe94c91c9d210d7310" dependencies = [ "miette", - "thiserror 2.0.6", + "thiserror 2.0.7", ] [[package]] @@ -3360,7 +3370,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror 2.0.6", + "thiserror 2.0.7", "tokio", "tracing", ] @@ -3379,7 +3389,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.6", + "thiserror 2.0.7", "tinyvec", "tracing", "web-time", @@ -3453,7 +3463,7 @@ version = "5.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14e24471baa77d6e0e8be04c7d62d5e3c3454e7f1863ed7d74faddd6e4786007" dependencies = [ - "bzip2", + "bzip2 0.4.4", "chardetng", "chrono", "crc32fast", @@ -4178,11 +4188,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.6" +version = "2.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec2a1820ebd077e2b90c4df007bebf344cd394098a13c563957d0afc83ea47" +checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767" dependencies = [ - "thiserror-impl 2.0.6", + "thiserror-impl 2.0.7", ] [[package]] @@ -4198,9 +4208,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.6" +version = "2.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d65750cab40f4ff1929fb1ba509e9914eb756131cef4210da8d5d700d26f6312" +checksum = "e1d8749b4531af2117677a5fcd12b1348a3fe2b81e36e61ffeac5c4aa3273e36" dependencies = [ "proc-macro2", "quote", diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index b60066af..9daf8956 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -17,5 +17,5 @@ compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } -thiserror = "2.0.1" +thiserror = "2.0.7" tracing = "0.1.39" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 196d3a2b..f9add7fd 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -20,7 +20,7 @@ async-compression = { version = "0.4.4", features = [ ] } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } bytes = "1.4.0" -bzip2 = "0.4.4" +bzip2 = "0.5.0" cfg-if = "1" compact_str = "0.8.0" flate2 = { version = "1.0.28", default-features = false } @@ -50,7 +50,7 @@ serde_json = { version = "1.0.107", optional = true } #tar = "0.4.38" tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.5.0" -thiserror = "2.0.1" +thiserror = "2.0.7" tokio = { version = "1.35.0", features = [ "macros", "rt-multi-thread", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 0527e947..1724eccb 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -25,7 +25,7 @@ miette = "7.0.0" minisign-verify = "0.2.1" once_cell = "1.18.0" strum = "0.26.1" -thiserror = "2.0.1" +thiserror = "2.0.7" tokio = { version = "1.35.0", features = [ "rt", "sync", diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index b0ea3e58..698148dc 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -18,7 +18,7 @@ percent-encoding = "2.2.0" serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = { version = "1.0.107" } -thiserror = "2.0.1" +thiserror = "2.0.7" tokio = { version = "1.35.0", features = ["sync"], default-features = false } tracing = "0.1.39" url = "2.5.4" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 9f3da790..bcb6b3d5 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -20,7 +20,7 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.107" -thiserror = "2.0.1" +thiserror = "2.0.7" toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index c941e411..7a2396f7 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -29,7 +29,7 @@ serde_json = "1.0.107" sha2 = "0.10.7" simple-git = { version = "0.2.4", optional = true } tempfile = "3.5.0" -thiserror = "2.0.1" +thiserror = "2.0.7" tokio = { version = "1.35.0", features = [ "rt", "sync", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 0f3bfcc2..6a51f11c 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -35,7 +35,7 @@ simple-git = { version = "0.2.10", optional = true } strum = "0.26.1" target-lexicon = { version = "0.13.0", features = ["std"] } tempfile = "3.5.0" -thiserror = "2.0.1" +thiserror = "2.0.7" tokio = { version = "1.35.0", features = [ "rt", "process", diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 95d676a3..34129c26 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -15,7 +15,7 @@ compact_str = { version = "0.8.0", features = ["serde"] } glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } serde = "1.0.163" -thiserror = "2.0.1" +thiserror = "2.0.7" tracing = "0.1.39" [dev-dependencies] From 7604d8d28684ce2243d3a338621937c3780d9729 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 05:14:05 +0000 Subject: [PATCH 1939/2020] chore: release (#1996) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 20 ++++++++++---------- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-bins/CHANGELOG.md | 6 ++++++ crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-downloader/CHANGELOG.md | 6 ++++++ crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/CHANGELOG.md | 6 ++++++ crates/binstalk-fetchers/Cargo.toml | 8 ++++---- crates/binstalk-git-repo-api/CHANGELOG.md | 6 ++++++ crates/binstalk-git-repo-api/Cargo.toml | 6 +++--- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk-registry/CHANGELOG.md | 6 ++++++ crates/binstalk-registry/Cargo.toml | 8 ++++---- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 16 ++++++++-------- crates/cargo-toml-workspace/CHANGELOG.md | 6 ++++++ crates/cargo-toml-workspace/Cargo.toml | 2 +- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- 22 files changed, 98 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c243f750..9b84eda7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -256,7 +256,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.16" +version = "0.28.17" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -288,7 +288,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.6.5" +version = "0.6.6" dependencies = [ "atomic-file-install", "binstalk-types", @@ -302,7 +302,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.13.5" +version = "0.13.6" dependencies = [ "async-compression", "async-trait", @@ -338,7 +338,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.10.6" +version = "0.10.7" dependencies = [ "async-trait", "binstalk-downloader", @@ -362,7 +362,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.7" +version = "0.5.8" dependencies = [ "binstalk-downloader", "compact_str", @@ -381,7 +381,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.13" +version = "0.15.14" dependencies = [ "beef", "binstalk-types", @@ -402,7 +402,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.11.6" +version = "0.11.7" dependencies = [ "async-trait", "base16", @@ -612,7 +612,7 @@ dependencies = [ [[package]] name = "cargo-toml-workspace" -version = "7.0.0" +version = "7.0.1" dependencies = [ "cargo_toml", "compact_str", @@ -937,7 +937,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.32" +version = "0.1.33" dependencies = [ "cfg-if", "guess_host_triple", @@ -949,7 +949,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.15" +version = "1.0.16" dependencies = [ "tempfile", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 80196773..86acb1a1 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,8 +23,8 @@ pkg-fmt = "zip" [dependencies] atomic-file-install = { version = "1.0.6", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.16", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.13" } +binstalk = { path = "../binstalk", version = "0.28.17", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.14" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-bins/CHANGELOG.md b/crates/binstalk-bins/CHANGELOG.md index 3a3709ab..54f22cf6 100644 --- a/crates/binstalk-bins/CHANGELOG.md +++ b/crates/binstalk-bins/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.6.6](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.5...binstalk-bins-v0.6.6) - 2024-12-14 + +### Other + +- *(deps)* bump the deps group with 2 updates (#1997) + ## [0.6.5](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.4...binstalk-bins-v0.6.5) - 2024-11-23 ### Other diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 9daf8956..f8f911e9 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.6.5" +version = "0.6.6" edition = "2021" description = "The binstall binaries discovery and installation crate." diff --git a/crates/binstalk-downloader/CHANGELOG.md b/crates/binstalk-downloader/CHANGELOG.md index f05520c0..8ddb88ec 100644 --- a/crates/binstalk-downloader/CHANGELOG.md +++ b/crates/binstalk-downloader/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.13.6](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.5...binstalk-downloader-v0.13.6) - 2024-12-14 + +### Other + +- *(deps)* bump the deps group with 2 updates (#1997) + ## [0.13.5](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.4...binstalk-downloader-v0.13.5) - 2024-11-23 ### Other diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index f9add7fd..35e3bb63 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.13.5" +version = "0.13.6" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index 1cc2b06c..f3697659 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.7](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.6...binstalk-fetchers-v0.10.7) - 2024-12-14 + +### Other + +- *(deps)* bump the deps group with 2 updates (#1997) + ## [0.10.6](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.5...binstalk-fetchers-v0.10.6) - 2024-11-29 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 1724eccb..c49320b1 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.10.6" +version = "0.10.7" edition = "2021" description = "The binstall fetchers" @@ -12,8 +12,8 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.68" -binstalk-downloader = { version = "0.13.5", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.7", path = "../binstalk-git-repo-api" } +binstalk-downloader = { version = "0.13.6", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.8", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.5.4" [dev-dependencies] -binstalk-downloader = { version = "0.13.5", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.6", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index 4f21b017..d4e7eb88 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.8](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.7...binstalk-git-repo-api-v0.5.8) - 2024-12-14 + +### Other + +- *(deps)* bump the deps group with 2 updates (#1997) + ## [0.5.7](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.6...binstalk-git-repo-api-v0.5.7) - 2024-11-23 ### Other diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 698148dc..c67e2d34 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.7" +version = "0.5.8" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.13.5", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.6", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.8.0" @@ -25,6 +25,6 @@ url = "2.5.4" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.5", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.6", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index a91c5d95..b9afe0b8 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.14](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.13...binstalk-manifests-v0.15.14) - 2024-12-14 + +### Other + +- *(deps)* bump the deps group with 2 updates (#1997) + ## [0.15.13](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.12...binstalk-manifests-v0.15.13) - 2024-12-07 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index bcb6b3d5..2f7aa6ff 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.13" +version = "0.15.14" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.32", path = "../detect-targets" } +detect-targets = { version = "0.1.33", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md index 462e3e37..fc11d1c6 100644 --- a/crates/binstalk-registry/CHANGELOG.md +++ b/crates/binstalk-registry/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.7](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.6...binstalk-registry-v0.11.7) - 2024-12-14 + +### Other + +- *(deps)* bump the deps group with 2 updates (#1997) + ## [0.11.6](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.5...binstalk-registry-v0.11.6) - 2024-12-07 ### Other diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 7a2396f7..c93f0e82 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.11.6" +version = "0.11.7" edition = "2021" rust-version = "1.65.0" @@ -13,11 +13,11 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.68" base16 = "0.2.1" -binstalk-downloader = { version = "0.13.5", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.6", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } -cargo-toml-workspace = { version = "7.0.0", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "7.0.1", path = "../cargo-toml-workspace" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" @@ -40,7 +40,7 @@ url = "2.5.4" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.13.5", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.6", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index 5ab91fc5..177b0839 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.17](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.16...binstalk-v0.28.17) - 2024-12-14 + +### Other + +- *(deps)* bump the deps group with 2 updates (#1997) + ## [0.28.16](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.15...binstalk-v0.28.16) - 2024-12-07 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 6a51f11c..ae11e7db 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,25 +3,25 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.16" +version = "0.28.17" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.6.5", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.13.5", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.7", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.10.6", path = "../binstalk-fetchers", features = [ +binstalk-bins = { version = "0.6.6", path = "../binstalk-bins" } +binstalk-downloader = { version = "0.13.6", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.8", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.10.7", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.11.6", path = "../binstalk-registry" } +binstalk-registry = { version = "0.11.7", path = "../binstalk-registry" } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } -cargo-toml-workspace = { version = "7.0.0", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "7.0.1", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.32", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.33", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/cargo-toml-workspace/CHANGELOG.md b/crates/cargo-toml-workspace/CHANGELOG.md index 862bf006..83359be0 100644 --- a/crates/cargo-toml-workspace/CHANGELOG.md +++ b/crates/cargo-toml-workspace/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [7.0.1](https://github.com/cargo-bins/cargo-binstall/compare/cargo-toml-workspace-v7.0.0...cargo-toml-workspace-v7.0.1) - 2024-12-14 + +### Other + +- *(deps)* bump the deps group with 2 updates (#1997) + ## [7.0.0](https://github.com/cargo-bins/cargo-binstall/compare/cargo-toml-workspace-v6.0.3...cargo-toml-workspace-v7.0.0) - 2024-12-07 ### Other diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 34129c26..97fa7b47 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-toml-workspace" -version = "7.0.0" +version = "7.0.1" edition = "2021" description = "Parse cargo workspace and load specific crate" repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index ab6ec246..54947952 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.33](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.32...detect-targets-v0.1.33) - 2024-12-14 + +### Other + +- update Cargo.lock dependencies + ## [0.1.32](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.31...detect-targets-v0.1.32) - 2024-12-07 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index d937131f..411b18a2 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.32" +version = "0.1.33" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index 4ecee1f5..590b9b3e 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.16](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.15...detect-wasi-v1.0.16) - 2024-12-14 + +### Other + +- update Cargo.lock dependencies + ## [1.0.15](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.14...detect-wasi-v1.0.15) - 2024-12-07 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index ec715b6c..263bc648 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.15" +version = "1.0.16" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From 9bc0ba964d12bf4c034d65ce732726a2b1a8d9df Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 14 Dec 2024 07:15:39 +0000 Subject: [PATCH 1940/2020] release: cargo-binstall v1.10.17 (#1998) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9b84eda7..e0699047 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -572,7 +572,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.16" +version = "1.10.17" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 86acb1a1..e7628c59 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.16" +version = "1.10.17" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 7d1d3b87..84a42e01 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 0ae1928c13799e83a10772bc10bdbe563c21fe3e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 20 Dec 2024 04:48:11 +0000 Subject: [PATCH 1941/2020] dep: Upgrade transitive dependencies (#2000) Co-authored-by: github-actions --- Cargo.lock | 176 ++++++++++++++++++++++++++--------------------------- 1 file changed, 88 insertions(+), 88 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e0699047..69d5ff3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -218,7 +218,7 @@ dependencies = [ "addr2line", "cfg-if", "libc", - "miniz_oxide 0.8.0", + "miniz_oxide 0.8.2", "object", "rustc-demangle", "windows-targets 0.52.6", @@ -279,7 +279,7 @@ dependencies = [ "strum", "target-lexicon", "tempfile", - "thiserror 2.0.7", + "thiserror 2.0.8", "tokio", "tracing", "url", @@ -296,7 +296,7 @@ dependencies = [ "leon", "miette", "normalize-path", - "thiserror 2.0.7", + "thiserror 2.0.8", "tracing", ] @@ -326,7 +326,7 @@ dependencies = [ "serde", "serde_json", "tempfile", - "thiserror 2.0.7", + "thiserror 2.0.8", "tokio", "tokio-tar", "tokio-util", @@ -354,7 +354,7 @@ dependencies = [ "minisign-verify", "once_cell", "strum", - "thiserror 2.0.7", + "thiserror 2.0.8", "tokio", "tracing", "url", @@ -371,7 +371,7 @@ dependencies = [ "serde", "serde-tuple-vec-map", "serde_json", - "thiserror 2.0.7", + "thiserror 2.0.8", "tokio", "tracing", "tracing-subscriber", @@ -395,7 +395,7 @@ dependencies = [ "serde-tuple-vec-map", "serde_json", "tempfile", - "thiserror 2.0.7", + "thiserror 2.0.8", "toml_edit", "url", ] @@ -420,7 +420,7 @@ dependencies = [ "sha2", "simple-git", "tempfile", - "thiserror 2.0.7", + "thiserror 2.0.8", "tokio", "toml_edit", "tracing", @@ -620,7 +620,7 @@ dependencies = [ "normalize-path", "serde", "tempfile", - "thiserror 2.0.7", + "thiserror 2.0.8", "tracing", ] @@ -659,9 +659,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.3" +version = "1.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27f657647bcff5394bf56c7317665bbf790a137a50eaaa5c6bfbb9e27a518f2d" +checksum = "c31a0499c1dc64f458ad13872de75c0eb7e3fdb0e67964610c914b034fc5956e" dependencies = [ "jobserver", "libc", @@ -854,9 +854,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.13" +version = "0.5.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33480d6946193aa8033910124896ca395333cae7e2d1113d1fef6c3272217df2" +checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" dependencies = [ "crossbeam-utils", ] @@ -872,9 +872,9 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crypto-common" @@ -1132,7 +1132,7 @@ checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "libz-ng-sys", - "miniz_oxide 0.8.0", + "miniz_oxide 0.8.2", ] [[package]] @@ -1349,7 +1349,7 @@ dependencies = [ "gix-worktree-state", "once_cell", "smallvec", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1362,7 +1362,7 @@ dependencies = [ "gix-date", "gix-utils", "itoa", - "thiserror 2.0.7", + "thiserror 2.0.8", "winnow 0.6.20", ] @@ -1379,7 +1379,7 @@ dependencies = [ "gix-trace", "kstring", "smallvec", - "thiserror 2.0.7", + "thiserror 2.0.8", "unicode-bom", ] @@ -1389,7 +1389,7 @@ version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d48b897b4bbc881aea994b4a5bbb340a04979d7be9089791304e04a9fbc66b53" dependencies = [ - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1398,7 +1398,7 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6ffbeb3a5c0b8b84c3fe4133a6f8c82fa962f4caefe8d0762eced025d3eb4f7" dependencies = [ - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1424,7 +1424,7 @@ dependencies = [ "gix-features", "gix-hash", "memmap2", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1443,7 +1443,7 @@ dependencies = [ "memchr", "once_cell", "smallvec", - "thiserror 2.0.7", + "thiserror 2.0.8", "unicode-bom", "winnow 0.6.20", ] @@ -1458,7 +1458,7 @@ dependencies = [ "bstr", "gix-path", "libc", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1475,7 +1475,7 @@ dependencies = [ "gix-sec", "gix-trace", "gix-url", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1487,7 +1487,7 @@ dependencies = [ "bstr", "itoa", "jiff", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1499,7 +1499,7 @@ dependencies = [ "bstr", "gix-hash", "gix-object", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1515,7 +1515,7 @@ dependencies = [ "gix-path", "gix-ref", "gix-sec", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1538,7 +1538,7 @@ dependencies = [ "prodash", "sha1", "sha1_smol", - "thiserror 2.0.7", + "thiserror 2.0.8", "walkdir", ] @@ -1560,7 +1560,7 @@ dependencies = [ "gix-trace", "gix-utils", "smallvec", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1593,7 +1593,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b5eccc17194ed0e67d49285e4853307e4147e95407f91c1c3e4a13ba9f4e4ce" dependencies = [ "faster-hex", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1645,7 +1645,7 @@ dependencies = [ "memmap2", "rustix", "smallvec", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1656,7 +1656,7 @@ checksum = "1cd3ab68a452db63d9f3ebdacb10f30dba1fa0d31ac64f4203d395ed1102d940" dependencies = [ "gix-tempfile", "gix-utils", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1672,7 +1672,7 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1691,7 +1691,7 @@ dependencies = [ "gix-validate", "itoa", "smallvec", - "thiserror 2.0.7", + "thiserror 2.0.8", "winnow 0.6.20", ] @@ -1713,7 +1713,7 @@ dependencies = [ "gix-quote", "parking_lot", "tempfile", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1733,7 +1733,7 @@ dependencies = [ "memmap2", "parking_lot", "smallvec", - "thiserror 2.0.7", + "thiserror 2.0.8", "uluru", ] @@ -1746,7 +1746,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1758,7 +1758,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1771,7 +1771,7 @@ dependencies = [ "gix-trace", "home", "once_cell", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1786,7 +1786,7 @@ dependencies = [ "gix-config-value", "gix-glob", "gix-path", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1799,7 +1799,7 @@ dependencies = [ "gix-config-value", "parking_lot", "rustix", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1816,7 +1816,7 @@ dependencies = [ "gix-transport", "gix-utils", "maybe-async", - "thiserror 2.0.7", + "thiserror 2.0.8", "winnow 0.6.20", ] @@ -1828,7 +1828,7 @@ checksum = "64a1e282216ec2ab2816cd57e6ed88f8009e634aec47562883c05ac8a7009a63" dependencies = [ "bstr", "gix-utils", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1848,7 +1848,7 @@ dependencies = [ "gix-utils", "gix-validate", "memmap2", - "thiserror 2.0.7", + "thiserror 2.0.8", "winnow 0.6.20", ] @@ -1863,7 +1863,7 @@ dependencies = [ "gix-revision", "gix-validate", "smallvec", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1878,7 +1878,7 @@ dependencies = [ "gix-hash", "gix-object", "gix-revwalk", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1893,7 +1893,7 @@ dependencies = [ "gix-hashtable", "gix-object", "smallvec", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1920,7 +1920,7 @@ dependencies = [ "gix-pathspec", "gix-refspec", "gix-url", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1958,7 +1958,7 @@ dependencies = [ "gix-sec", "gix-url", "reqwest", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1975,7 +1975,7 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -1987,7 +1987,7 @@ dependencies = [ "bstr", "gix-features", "gix-path", - "thiserror 2.0.7", + "thiserror 2.0.8", "url", ] @@ -2008,7 +2008,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd520d09f9f585b34b32aba1d0b36ada89ab7fefb54a8ca3fe37fc482a750937" dependencies = [ "bstr", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -2047,7 +2047,7 @@ dependencies = [ "gix-path", "gix-worktree", "io-close", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -2166,7 +2166,7 @@ dependencies = [ "rand", "ring", "rustls", - "thiserror 2.0.7", + "thiserror 2.0.8", "time", "tinyvec", "tokio", @@ -2194,7 +2194,7 @@ dependencies = [ "resolv-conf", "rustls", "smallvec", - "thiserror 2.0.7", + "thiserror 2.0.8", "tokio", "tokio-native-tls", "tokio-rustls", @@ -2203,11 +2203,11 @@ dependencies = [ [[package]] name = "home" -version = "0.5.9" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" dependencies = [ - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2275,9 +2275,9 @@ checksum = "5c3b1f728c459d27b12448862017b96ad4767b1ec2ec5e6434e99f1577f085b8" [[package]] name = "hyper" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ "bytes", "futures-channel", @@ -2295,9 +2295,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.3" +version = "0.27.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +checksum = "f6884a48c6826ec44f524c7456b163cebe9e55a18d7b5e307cb4f100371cc767" dependencies = [ "futures-util", "http", @@ -2655,7 +2655,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42a865ffec5587961f5afc6d365bccb304f4feaa1928f4fe94c91c9d210d7310" dependencies = [ "miette", - "thiserror 2.0.7", + "thiserror 2.0.8", ] [[package]] @@ -2672,9 +2672,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.168" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libmimalloc-sys" @@ -2866,9 +2866,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ "adler2", ] @@ -3370,7 +3370,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror 2.0.7", + "thiserror 2.0.8", "tokio", "tracing", ] @@ -3389,7 +3389,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.7", + "thiserror 2.0.8", "tinyvec", "tracing", "web-time", @@ -3397,9 +3397,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52cd4b1eff68bf27940dd39811292c49e007f4d0b4c357358dc9b0197be6b527" +checksum = "1c40286217b4ba3a71d644d752e6a0b71f13f1b6a2c5311acfcbe0c2418ed904" dependencies = [ "cfg_aliases", "libc", @@ -3459,9 +3459,9 @@ dependencies = [ [[package]] name = "rc-zip" -version = "5.1.3" +version = "5.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14e24471baa77d6e0e8be04c7d62d5e3c3454e7f1863ed7d74faddd6e4786007" +checksum = "a26a26f527c4dcc6f72f18ec24bd7172dff872a1a6a3ad616566b6e3359701f6" dependencies = [ "bzip2 0.4.4", "chardetng", @@ -3483,9 +3483,9 @@ dependencies = [ [[package]] name = "rc-zip-sync" -version = "4.2.3" +version = "4.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdebaff0e109a140208ab5ffbbe4862aada391d94456cbf7887757f3078a328b" +checksum = "57e1d13c4c826c9a6af74f5077e58435d97ee966940c79fbabcfb0917c8e925d" dependencies = [ "oval", "positioned-io", @@ -3701,7 +3701,7 @@ dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", - "security-framework 3.0.1", + "security-framework 3.1.0", ] [[package]] @@ -3715,9 +3715,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" dependencies = [ "web-time", ] @@ -3784,9 +3784,9 @@ dependencies = [ [[package]] name = "security-framework" -version = "3.0.1" +version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1415a607e92bec364ea2cf9264646dcce0f91e6d65281bd6f2819cca3bf39c8" +checksum = "81d3f8c9bfcc3cbb6b0179eb57042d75b1582bdc65c3cb95f3fa999509c03cbc" dependencies = [ "bitflags 2.6.0", "core-foundation 0.10.0", @@ -3797,9 +3797,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.1" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" +checksum = "1863fd3768cd83c56a7f60faa4dc0d403f1b6df0a38c3c25f44b7894e45370d5" dependencies = [ "core-foundation-sys", "libc", @@ -4188,11 +4188,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.7" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767" +checksum = "08f5383f3e0071702bf93ab5ee99b52d26936be9dedd9413067cbdcddcb6141a" dependencies = [ - "thiserror-impl 2.0.7", + "thiserror-impl 2.0.8", ] [[package]] @@ -4208,9 +4208,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.7" +version = "2.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d8749b4531af2117677a5fcd12b1348a3fe2b81e36e61ffeac5c4aa3273e36" +checksum = "f2f357fcec90b3caef6623a099691be676d033b40a058ac95d2a6ade6fa0c943" dependencies = [ "proc-macro2", "quote", From 1d16cbc4394a26fff145c29d683ef0547213084e Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 28 Dec 2024 00:10:16 +0000 Subject: [PATCH 1942/2020] dep: Upgrade transitive dependencies (#2005) Co-authored-by: github-actions --- Cargo.lock | 294 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 170 insertions(+), 124 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 69d5ff3f..db2ccc59 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -131,9 +131,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "arc-swap" @@ -279,7 +279,7 @@ dependencies = [ "strum", "target-lexicon", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tracing", "url", @@ -296,7 +296,7 @@ dependencies = [ "leon", "miette", "normalize-path", - "thiserror 2.0.8", + "thiserror 2.0.9", "tracing", ] @@ -326,7 +326,7 @@ dependencies = [ "serde", "serde_json", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tokio-tar", "tokio-util", @@ -354,7 +354,7 @@ dependencies = [ "minisign-verify", "once_cell", "strum", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tracing", "url", @@ -371,7 +371,7 @@ dependencies = [ "serde", "serde-tuple-vec-map", "serde_json", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tracing", "tracing-subscriber", @@ -395,7 +395,7 @@ dependencies = [ "serde-tuple-vec-map", "serde_json", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.9", "toml_edit", "url", ] @@ -420,7 +420,7 @@ dependencies = [ "sha2", "simple-git", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "toml_edit", "tracing", @@ -620,7 +620,7 @@ dependencies = [ "normalize-path", "serde", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.9", "tracing", ] @@ -659,9 +659,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.5" +version = "1.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31a0499c1dc64f458ad13872de75c0eb7e3fdb0e67964610c914b034fc5956e" +checksum = "8d6dbb628b8f8555f86d0323c2eb39e3ec81901f4b83e091db8a6a76d316a333" dependencies = [ "jobserver", "libc", @@ -1302,9 +1302,9 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gix" -version = "0.68.0" +version = "0.69.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b04c66359b5e17f92395abc433861df0edf48f39f3f590818d1d7217327dd6a1" +checksum = "8d0eebdaecdcf405d5433a36f85e4f058cf4de48ee2604388be0dbccbaad353e" dependencies = [ "gix-actor", "gix-attributes", @@ -1337,6 +1337,7 @@ dependencies = [ "gix-revision", "gix-revwalk", "gix-sec", + "gix-shallow", "gix-submodule", "gix-tempfile", "gix-trace", @@ -1349,7 +1350,7 @@ dependencies = [ "gix-worktree-state", "once_cell", "smallvec", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -1362,7 +1363,7 @@ dependencies = [ "gix-date", "gix-utils", "itoa", - "thiserror 2.0.8", + "thiserror 2.0.9", "winnow 0.6.20", ] @@ -1379,7 +1380,7 @@ dependencies = [ "gix-trace", "kstring", "smallvec", - "thiserror 2.0.8", + "thiserror 2.0.9", "unicode-bom", ] @@ -1389,7 +1390,7 @@ version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d48b897b4bbc881aea994b4a5bbb340a04979d7be9089791304e04a9fbc66b53" dependencies = [ - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -1398,14 +1399,14 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6ffbeb3a5c0b8b84c3fe4133a6f8c82fa962f4caefe8d0762eced025d3eb4f7" dependencies = [ - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] name = "gix-command" -version = "0.3.11" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7d6b8f3a64453fd7e8191eb80b351eb7ac0839b40a1237cd2c137d5079fe53" +checksum = "9405c0a56e17f8365a46870cd2c7db71323ecc8bda04b50cb746ea37bd091e90" dependencies = [ "bstr", "gix-path", @@ -1424,7 +1425,7 @@ dependencies = [ "gix-features", "gix-hash", "memmap2", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -1443,7 +1444,7 @@ dependencies = [ "memchr", "once_cell", "smallvec", - "thiserror 2.0.8", + "thiserror 2.0.9", "unicode-bom", "winnow 0.6.20", ] @@ -1458,14 +1459,14 @@ dependencies = [ "bstr", "gix-path", "libc", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] name = "gix-credentials" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2be87bb8685fc7e6e7032ef71c45068ffff609724a0c897b8047fde10db6ae71" +checksum = "82a50c56b785c29a151ab4ccf74a83fe4e21d2feda0d30549504b4baed353e0a" dependencies = [ "bstr", "gix-command", @@ -1475,31 +1476,31 @@ dependencies = [ "gix-sec", "gix-trace", "gix-url", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] name = "gix-date" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "691142b1a34d18e8ed6e6114bc1a2736516c5ad60ef3aa9bd1b694886e3ca92d" +checksum = "c57c477b645ee248b173bb1176b52dd528872f12c50375801a58aaf5ae91113f" dependencies = [ "bstr", "itoa", "jiff", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] name = "gix-diff" -version = "0.48.0" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a327be31a392144b60ab0b1c863362c32a1c8f7effdfa2141d5d5b6b916ef3bf" +checksum = "a8e92566eccbca205a0a0f96ffb0327c061e85bc5c95abbcddfe177498aa04f6" dependencies = [ "bstr", "gix-hash", "gix-object", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -1515,7 +1516,7 @@ dependencies = [ "gix-path", "gix-ref", "gix-sec", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -1538,15 +1539,15 @@ dependencies = [ "prodash", "sha1", "sha1_smol", - "thiserror 2.0.8", + "thiserror 2.0.9", "walkdir", ] [[package]] name = "gix-filter" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5108cc58d58b27df10ac4de7f31b2eb96d588a33e5eba23739b865f5d8db7995" +checksum = "3d0ecdee5667f840ba20c7fe56d63f8e1dc1e6b3bfd296151fe5ef07c874790a" dependencies = [ "bstr", "encoding_rs", @@ -1560,14 +1561,14 @@ dependencies = [ "gix-trace", "gix-utils", "smallvec", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] name = "gix-fs" -version = "0.12.0" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34740384d8d763975858fa2c176b68652a6fcc09f616e24e3ce967b0d370e4d8" +checksum = "3b3d4fac505a621f97e5ce2c69fdc425742af00c0920363ca4074f0eb48b1db9" dependencies = [ "fastrand", "gix-features", @@ -1593,7 +1594,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b5eccc17194ed0e67d49285e4853307e4147e95407f91c1c3e4a13ba9f4e4ce" dependencies = [ "faster-hex", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -1645,7 +1646,7 @@ dependencies = [ "memmap2", "rustix", "smallvec", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -1656,7 +1657,7 @@ checksum = "1cd3ab68a452db63d9f3ebdacb10f30dba1fa0d31ac64f4203d395ed1102d940" dependencies = [ "gix-tempfile", "gix-utils", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -1672,14 +1673,14 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] name = "gix-object" -version = "0.46.0" +version = "0.46.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "65d93e2bbfa83a307e47f45e45de7b6c04d7375a8bd5907b215f4bf45237d879" +checksum = "e42d58010183ef033f31088479b4eb92b44fe341b35b62d39eb8b185573d77ea" dependencies = [ "bstr", "gix-actor", @@ -1687,19 +1688,20 @@ dependencies = [ "gix-features", "gix-hash", "gix-hashtable", + "gix-path", "gix-utils", "gix-validate", "itoa", "smallvec", - "thiserror 2.0.8", + "thiserror 2.0.9", "winnow 0.6.20", ] [[package]] name = "gix-odb" -version = "0.65.0" +version = "0.66.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93bed6e1b577c25a6bb8e6ecbf4df525f29a671ddf5f2221821a56a8dbeec4e3" +checksum = "cb780eceb3372ee204469478de02eaa34f6ba98247df0186337e0333de97d0ae" dependencies = [ "arc-swap", "gix-date", @@ -1713,14 +1715,14 @@ dependencies = [ "gix-quote", "parking_lot", "tempfile", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] name = "gix-pack" -version = "0.55.0" +version = "0.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b91fec04d359544fecbb8e85117ec746fbaa9046ebafcefb58cb74f20dc76d4" +checksum = "4158928929be29cae7ab97afc8e820a932071a7f39d8ba388eed2380c12c566c" dependencies = [ "clru", "gix-chunk", @@ -1733,20 +1735,20 @@ dependencies = [ "memmap2", "parking_lot", "smallvec", - "thiserror 2.0.8", + "thiserror 2.0.9", "uluru", ] [[package]] name = "gix-packetline" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a720e5bebf494c3ceffa85aa89f57a5859450a0da0a29ebe89171e23543fa78" +checksum = "911aeea8b2dabeed2f775af9906152a1f0109787074daf9e64224e3892dde453" dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -1758,7 +1760,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -1771,7 +1773,7 @@ dependencies = [ "gix-trace", "home", "once_cell", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -1786,37 +1788,45 @@ dependencies = [ "gix-config-value", "gix-glob", "gix-path", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] name = "gix-prompt" -version = "0.8.9" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a7822afc4bc9c5fbbc6ce80b00f41c129306b7685cac3248dbfa14784960594" +checksum = "82433a19aa44688e3bde05c692870eda50b5db053df53ed5ae6d8ea594a6babd" dependencies = [ "gix-command", "gix-config-value", "parking_lot", "rustix", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] name = "gix-protocol" -version = "0.46.1" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a7e7e51a0dea531d3448c297e2fa919b2de187111a210c324b7e9f81508b8ca" +checksum = "c84642e8b6fed7035ce9cc449593019c55b0ec1af7a5dce1ab8a0636eaaeb067" dependencies = [ "bstr", "gix-credentials", "gix-date", "gix-features", "gix-hash", + "gix-lock", + "gix-negotiate", + "gix-object", + "gix-ref", + "gix-refspec", + "gix-revwalk", + "gix-shallow", + "gix-trace", "gix-transport", "gix-utils", "maybe-async", - "thiserror 2.0.8", + "thiserror 2.0.9", "winnow 0.6.20", ] @@ -1828,14 +1838,14 @@ checksum = "64a1e282216ec2ab2816cd57e6ed88f8009e634aec47562883c05ac8a7009a63" dependencies = [ "bstr", "gix-utils", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] name = "gix-ref" -version = "0.49.0" +version = "0.49.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1eae462723686272a58f49501015ef7c0d67c3e042c20049d8dd9c7eff92efde" +checksum = "a91b61776c839d0f1b7114901179afb0947aa7f4d30793ca1c56d335dfef485f" dependencies = [ "gix-actor", "gix-features", @@ -1848,7 +1858,7 @@ dependencies = [ "gix-utils", "gix-validate", "memmap2", - "thiserror 2.0.8", + "thiserror 2.0.9", "winnow 0.6.20", ] @@ -1863,14 +1873,14 @@ dependencies = [ "gix-revision", "gix-validate", "smallvec", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] name = "gix-revision" -version = "0.31.0" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44488e0380847967bc3e3cacd8b22652e02ea1eb58afb60edd91847695cd2d8d" +checksum = "61e1ddc474405a68d2ce8485705dd72fe6ce959f2f5fe718601ead5da2c8f9e7" dependencies = [ "bstr", "gix-commitgraph", @@ -1878,7 +1888,7 @@ dependencies = [ "gix-hash", "gix-object", "gix-revwalk", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -1893,7 +1903,7 @@ dependencies = [ "gix-hashtable", "gix-object", "smallvec", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -1908,6 +1918,18 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "gix-shallow" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88d2673242e87492cb6ff671f0c01f689061ca306c4020f137197f3abc84ce01" +dependencies = [ + "bstr", + "gix-hash", + "gix-lock", + "thiserror 2.0.9", +] + [[package]] name = "gix-submodule" version = "0.16.0" @@ -1920,7 +1942,7 @@ dependencies = [ "gix-pathspec", "gix-refspec", "gix-url", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -1944,9 +1966,9 @@ checksum = "04bdde120c29f1fc23a24d3e115aeeea3d60d8e65bab92cc5f9d90d9302eb952" [[package]] name = "gix-transport" -version = "0.43.1" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39a1a41357b7236c03e0c984147f823d87c3e445a8581bac7006df141577200b" +checksum = "dd04d91e507a8713cfa2318d5a85d75b36e53a40379cc7eb7634ce400ecacbaf" dependencies = [ "base64", "bstr", @@ -1958,14 +1980,14 @@ dependencies = [ "gix-sec", "gix-url", "reqwest", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] name = "gix-traverse" -version = "0.43.0" +version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ff2ec9f779680f795363db1c563168b32b8d6728ec58564c628e85c92d29faf" +checksum = "6ed47d648619e23e93f971d2bba0d10c1100e54ef95d2981d609907a8cabac89" dependencies = [ "bitflags 2.6.0", "gix-commitgraph", @@ -1975,19 +1997,20 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] name = "gix-url" -version = "0.28.1" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e09f97db3618fb8e473d7d97e77296b50aaee0ddcd6a867f07443e3e87391099" +checksum = "d096fb733ba6bd3f5403dba8bd72bdd8809fe2b347b57844040b8f49c93492d9" dependencies = [ "bstr", "gix-features", "gix-path", - "thiserror 2.0.8", + "percent-encoding", + "thiserror 2.0.9", "url", ] @@ -2008,7 +2031,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd520d09f9f585b34b32aba1d0b36ada89ab7fefb54a8ca3fe37fc482a750937" dependencies = [ "bstr", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -2032,9 +2055,9 @@ dependencies = [ [[package]] name = "gix-worktree-state" -version = "0.15.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebd5eead61d37b334bc31810c9980aa72d659044513cae0e342a88fed2c22ba" +checksum = "672a5416fae50538a0af0374bf67e0c97a932fd9e9b72f7d4bfd25355967cbe1" dependencies = [ "bstr", "gix-features", @@ -2047,7 +2070,7 @@ dependencies = [ "gix-path", "gix-worktree", "io-close", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -2166,7 +2189,7 @@ dependencies = [ "rand", "ring", "rustls", - "thiserror 2.0.8", + "thiserror 2.0.9", "time", "tinyvec", "tokio", @@ -2194,7 +2217,7 @@ dependencies = [ "resolv-conf", "rustls", "smallvec", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tokio-native-tls", "tokio-rustls", @@ -2295,9 +2318,9 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.4" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6884a48c6826ec44f524c7456b163cebe9e55a18d7b5e307cb4f100371cc767" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", "http", @@ -2576,11 +2599,12 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jiff" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db69f08d4fb10524cacdb074c10b296299d71274ddbc830a8ee65666867002e9" +checksum = "24a46169c7a10358cdccfb179910e8a5a392fc291bdb409da9aeece5b19786d8" dependencies = [ "jiff-tzdb-platform", + "serde", "windows-sys 0.59.0", ] @@ -2655,7 +2679,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42a865ffec5587961f5afc6d365bccb304f4feaa1928f4fe94c91c9d210d7310" dependencies = [ "miette", - "thiserror 2.0.8", + "thiserror 2.0.9", ] [[package]] @@ -3041,9 +3065,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -3370,7 +3394,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror 2.0.8", + "thiserror 2.0.9", "tokio", "tracing", ] @@ -3389,7 +3413,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.8", + "thiserror 2.0.9", "tinyvec", "tracing", "web-time", @@ -3411,9 +3435,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -3564,9 +3588,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.9" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" +checksum = "7fe060fe50f524be480214aba758c71f99f90ee8c83c5a36b5e9e1d568eb4eb3" dependencies = [ "async-compression", "base64", @@ -3608,6 +3632,7 @@ dependencies = [ "tokio-native-tls", "tokio-rustls", "tokio-util", + "tower", "tower-service", "url", "wasm-bindgen", @@ -3735,9 +3760,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "ryu" @@ -3816,9 +3841,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] @@ -3834,9 +3859,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", @@ -3845,9 +3870,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" dependencies = [ "itoa", "memchr", @@ -3946,9 +3971,9 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55e6ebf253d8da3d8233aa7a30956f4ea4365d2baf39e5c48b3160ce2b499914" +checksum = "cf86f3da0e36928216c9f5f6b600a381abe9c4d860d2eac2853843941e5a001c" dependencies = [ "compact_str", "derive_destructure2", @@ -4061,9 +4086,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.90" +version = "2.0.92" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "70ae51629bf965c5c098cc9e87908a3df5301051a9e087d6f9bef5c9771ed126" dependencies = [ "proc-macro2", "quote", @@ -4140,9 +4165,9 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "target-lexicon" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ff4a4048091358129767b8a200d6927f58876c8b5ea16fb7b0222d43b79bfa8" +checksum = "dc12939a1c9b9d391e0b7135f72fd30508b73450753e28341fed159317582a77" [[package]] name = "tempfile" @@ -4188,11 +4213,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.8" +version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f5383f3e0071702bf93ab5ee99b52d26936be9dedd9413067cbdcddcb6141a" +checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" dependencies = [ - "thiserror-impl 2.0.8", + "thiserror-impl 2.0.9", ] [[package]] @@ -4208,9 +4233,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.8" +version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2f357fcec90b3caef6623a099691be676d033b40a058ac95d2a6ade6fa0c943" +checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" dependencies = [ "proc-macro2", "quote", @@ -4272,9 +4297,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" +checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" dependencies = [ "tinyvec_macros", ] @@ -4406,6 +4431,27 @@ dependencies = [ "winnow 0.6.20", ] +[[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-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" From f1f4d98da7feb57d8be8c35629b377c38a9be6d6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 28 Dec 2024 01:33:57 +0000 Subject: [PATCH 1943/2020] chore: release (#2001) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 4 ++-- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- 10 files changed, 36 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index db2ccc59..e9ca9f88 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -256,7 +256,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.17" +version = "0.28.18" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -381,7 +381,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.14" +version = "0.15.15" dependencies = [ "beef", "binstalk-types", @@ -937,7 +937,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.33" +version = "0.1.34" dependencies = [ "cfg-if", "guess_host_triple", @@ -949,7 +949,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.16" +version = "1.0.17" dependencies = [ "tempfile", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index e7628c59..452cea03 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,8 +23,8 @@ pkg-fmt = "zip" [dependencies] atomic-file-install = { version = "1.0.6", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.17", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.14" } +binstalk = { path = "../binstalk", version = "0.28.18", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.15" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index b9afe0b8..97885ced 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.15](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.14...binstalk-manifests-v0.15.15) - 2024-12-28 + +### Other + +- updated the following local packages: detect-targets + ## [0.15.14](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.13...binstalk-manifests-v0.15.14) - 2024-12-14 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 2f7aa6ff..1310733a 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.14" +version = "0.15.15" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.33", path = "../detect-targets" } +detect-targets = { version = "0.1.34", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index 177b0839..1e6c2d88 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.18](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.17...binstalk-v0.28.18) - 2024-12-28 + +### Other + +- updated the following local packages: detect-targets + ## [0.28.17](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.16...binstalk-v0.28.17) - 2024-12-14 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index ae11e7db..7377e6ce 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.17" +version = "0.28.18" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -21,7 +21,7 @@ binstalk-types = { version = "0.9.2", path = "../binstalk-types" } cargo-toml-workspace = { version = "7.0.1", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.33", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.34", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index 54947952..be7d8f3f 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.34](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.33...detect-targets-v0.1.34) - 2024-12-28 + +### Other + +- update Cargo.lock dependencies + ## [0.1.33](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.32...detect-targets-v0.1.33) - 2024-12-14 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 411b18a2..8aeaae9b 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.33" +version = "0.1.34" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index 590b9b3e..67aa16b6 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.17](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.16...detect-wasi-v1.0.17) - 2024-12-28 + +### Other + +- update Cargo.lock dependencies + ## [1.0.16](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.15...detect-wasi-v1.0.16) - 2024-12-14 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index 263bc648..65531ef9 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.16" +version = "1.0.17" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From f43d7fca03182e9a6a403e064e8a896e3da92735 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 28 Dec 2024 05:20:10 +0000 Subject: [PATCH 1944/2020] release: cargo-binstall v1.10.18 (#2006) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e9ca9f88..f4ec4a9f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -572,7 +572,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.17" +version = "1.10.18" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 452cea03..4209c2a0 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.17" +version = "1.10.18" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 84a42e01..d82e9a34 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 15571ebca85c34ebb0db581de2c63b88bda3aa27 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 3 Jan 2025 03:58:23 +0000 Subject: [PATCH 1945/2020] dep: Upgrade transitive dependencies (#2008) Co-authored-by: github-actions --- Cargo.lock | 148 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 110 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f4ec4a9f..30b84d95 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -497,12 +497,12 @@ dependencies = [ [[package]] name = "bstr" -version = "1.11.1" +version = "1.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786a307d683a5bf92e6fd5fd69a7eb613751668d1d8d67d802846dfe367c62c8" +checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" dependencies = [ "memchr", - "regex-automata", + "regex-automata 0.4.9", "serde", ] @@ -780,9 +780,9 @@ dependencies = [ [[package]] name = "compact_str" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6050c3a16ddab2e412160b31f2c871015704239bca62f72f6e5f0be631d3f644" +checksum = "3b79c4069c6cad78e2e0cdfcbd26275770669fb39fd308a752dc110e83b9af32" dependencies = [ "castaway", "cfg-if", @@ -1271,6 +1271,19 @@ dependencies = [ "slab", ] +[[package]] +name = "generator" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc6bd114ceda131d3b1d665eba35788690ad37f5916457286b32ab6fd3c438dd" +dependencies = [ + "cfg-if", + "libc", + "log", + "rustversion", + "windows 0.58.0", +] + [[package]] name = "generic-array" version = "0.14.7" @@ -1364,7 +1377,7 @@ dependencies = [ "gix-utils", "itoa", "thiserror 2.0.9", - "winnow 0.6.20", + "winnow 0.6.21", ] [[package]] @@ -1446,7 +1459,7 @@ dependencies = [ "smallvec", "thiserror 2.0.9", "unicode-bom", - "winnow 0.6.20", + "winnow 0.6.21", ] [[package]] @@ -1694,7 +1707,7 @@ dependencies = [ "itoa", "smallvec", "thiserror 2.0.9", - "winnow 0.6.20", + "winnow 0.6.21", ] [[package]] @@ -1827,7 +1840,7 @@ dependencies = [ "gix-utils", "maybe-async", "thiserror 2.0.9", - "winnow 0.6.20", + "winnow 0.6.21", ] [[package]] @@ -1859,7 +1872,7 @@ dependencies = [ "gix-validate", "memmap2", "thiserror 2.0.9", - "winnow 0.6.20", + "winnow 0.6.21", ] [[package]] @@ -2075,9 +2088,9 @@ dependencies = [ [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "guess_host_triple" @@ -2599,11 +2612,14 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jiff" -version = "0.1.16" +version = "0.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24a46169c7a10358cdccfb179910e8a5a392fc291bdb409da9aeece5b19786d8" +checksum = "943611a469f78ab9afdac9022e473a80fca16a9deca6c5be3eb566d872231e76" dependencies = [ "jiff-tzdb-platform", + "log", + "portable-atomic", + "portable-atomic-util", "serde", "windows-sys 0.59.0", ] @@ -2759,6 +2775,19 @@ version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +[[package]] +name = "loom" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "419e0dc8046cb947daa77eb95ae174acfbddb7673b4151f56d1eed8e93fbfaca" +dependencies = [ + "cfg-if", + "generator", + "scoped-tls", + "tracing", + "tracing-subscriber", +] + [[package]] name = "lzma-rs" version = "0.3.0" @@ -2786,6 +2815,15 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" +[[package]] +name = "matchers" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" +dependencies = [ + "regex-automata 0.1.10", +] + [[package]] name = "maybe-async" version = "0.2.10" @@ -2910,21 +2948,20 @@ dependencies = [ [[package]] name = "moka" -version = "0.12.8" +version = "0.12.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cf62eb4dd975d2dde76432fb1075c49e3ee2331cf36f1f8fd4b66550d32b6f" +checksum = "23db87a7f248211f6a7c8644a1b750541f8a4c68ae7de0f908860e44c0c201f6" dependencies = [ "crossbeam-channel", "crossbeam-epoch", "crossbeam-utils", - "once_cell", + "loom", "parking_lot", "quanta", "rustc_version", "smallvec", "tagptr", "thiserror 1.0.69", - "triomphe", "uuid", ] @@ -3280,6 +3317,21 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +[[package]] +name = "portable-atomic" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" + +[[package]] +name = "portable-atomic-util" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +dependencies = [ + "portable-atomic", +] + [[package]] name = "positioned-io" version = "0.3.3" @@ -3361,9 +3413,9 @@ dependencies = [ [[package]] name = "quanta" -version = "0.12.4" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773ce68d0bb9bc7ef20be3536ffe94e223e1f365bd374108b2659fac0c65cfe6" +checksum = "3bd1fe6824cea6538803de3ff1bc0cf3949024db3d43c9643024bfb33a807c0e" dependencies = [ "crossbeam-utils", "libc", @@ -3565,8 +3617,17 @@ checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", - "regex-automata", - "regex-syntax", + "regex-automata 0.4.9", + "regex-syntax 0.8.5", +] + +[[package]] +name = "regex-automata" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" +dependencies = [ + "regex-syntax 0.6.29", ] [[package]] @@ -3577,9 +3638,15 @@ checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", - "regex-syntax", + "regex-syntax 0.8.5", ] +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + [[package]] name = "regex-syntax" version = "0.8.5" @@ -3588,9 +3655,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.11" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe060fe50f524be480214aba758c71f99f90ee8c83c5a36b5e9e1d568eb4eb3" +checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" dependencies = [ "async-compression", "base64", @@ -3788,6 +3855,12 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "scoped-tls" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" + [[package]] name = "scopeguard" version = "1.2.0" @@ -4086,9 +4159,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.92" +version = "2.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ae51629bf965c5c098cc9e87908a3df5301051a9e087d6f9bef5c9771ed126" +checksum = "987bc0be1cdea8b10216bd06e2ca407d40b9543468fafd3ddfb02f36e77f71f3" dependencies = [ "proc-macro2", "quote", @@ -4171,12 +4244,13 @@ checksum = "dc12939a1c9b9d391e0b7135f72fd30508b73450753e28341fed159317582a77" [[package]] name = "tempfile" -version = "3.14.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" dependencies = [ "cfg-if", "fastrand", + "getrandom", "once_cell", "rustix", "windows-sys 0.59.0", @@ -4428,7 +4502,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.20", + "winnow 0.6.21", ] [[package]] @@ -4518,23 +4592,21 @@ version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8189decb5ac0fa7bc8b96b7cb9b2701d60d48805aca84a238004d665fcc4008" dependencies = [ + "matchers", "nu-ansi-term", + "once_cell", + "regex", "serde", "serde_json", "sharded-slab", "smallvec", "thread_local", + "tracing", "tracing-core", "tracing-log", "tracing-serde", ] -[[package]] -name = "triomphe" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859eb650cfee7434994602c3a68b25d77ad9e68c8a6cd491616ef86661382eb3" - [[package]] name = "try-lock" version = "0.2.5" @@ -5110,9 +5182,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.20" +version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "e6f5bb5257f2407a5425c6e749bfd9692192a73e70a6060516ac04f889087d68" dependencies = [ "memchr", ] From b491e5e81d4b4313b1d39e2fcd3856d64e39c8ec Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 4 Jan 2025 11:46:19 +1000 Subject: [PATCH 1946/2020] build(deps): bump the deps group with 2 updates (#2010) Bumps the deps group with 2 updates: [itertools](https://github.com/rust-itertools/itertools) and [async-trait](https://github.com/dtolnay/async-trait). Updates `itertools` from 0.13.0 to 0.14.0 - [Changelog](https://github.com/rust-itertools/itertools/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-itertools/itertools/compare/v0.13.0...v0.14.0) Updates `async-trait` from 0.1.83 to 0.1.84 - [Release notes](https://github.com/dtolnay/async-trait/releases) - [Commits](https://github.com/dtolnay/async-trait/compare/0.1.83...0.1.84) --- updated-dependencies: - dependency-name: itertools dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: async-trait dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 4 ++-- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 30b84d95..7dc62afd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -178,9 +178,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "1b1244b10dcd56c92219da4e14caa97e312079e185f04ba3eea25061561dc0a0" dependencies = [ "proc-macro2", "quote", @@ -2597,9 +2597,9 @@ checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" dependencies = [ "either", ] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 35e3bb63..108f7f9b 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -async-trait = "0.1.68" +async-trait = "0.1.84" async-compression = { version = "0.4.4", features = [ "gzip", "zstd", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index c49320b1..6fd118d8 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -11,14 +11,14 @@ authors = ["Jiahao XU "] license = "GPL-3.0-only" [dependencies] -async-trait = "0.1.68" +async-trait = "0.1.84" binstalk-downloader = { version = "0.13.6", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.5.8", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } either = "1.11.0" -itertools = "0.13.0" +itertools = "0.14.0" leon = "3.0.0" leon-macros = "1.0.1" miette = "7.0.0" diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index c93f0e82..2b29ab20 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -11,7 +11,7 @@ authors = ["Jiahao_XU@outlook "] license = "Apache-2.0 OR MIT" [dependencies] -async-trait = "0.1.68" +async-trait = "0.1.84" base16 = "0.2.1" binstalk-downloader = { version = "0.13.6", path = "../binstalk-downloader", default-features = false, features = [ "json", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 7377e6ce..55ec009c 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -25,7 +25,7 @@ detect-targets = { version = "0.1.34", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" -itertools = "0.13.0" +itertools = "0.14.0" jobslot = { version = "0.2.11", features = ["tokio"] } leon = "3.0.0" maybe-owned = "0.3.4" From 158fb2fb14c619631dc82b768201e837a7553fde Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 4 Jan 2025 02:16:37 +0000 Subject: [PATCH 1947/2020] chore: release (#2009) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 16 ++++++++-------- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-downloader/CHANGELOG.md | 6 ++++++ crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/CHANGELOG.md | 6 ++++++ crates/binstalk-fetchers/Cargo.toml | 8 ++++---- crates/binstalk-git-repo-api/CHANGELOG.md | 6 ++++++ crates/binstalk-git-repo-api/Cargo.toml | 6 +++--- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk-registry/CHANGELOG.md | 6 ++++++ crates/binstalk-registry/Cargo.toml | 6 +++--- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 12 ++++++------ crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- 18 files changed, 79 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7dc62afd..599b5ece 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -256,7 +256,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.18" +version = "0.28.19" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -302,7 +302,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.13.6" +version = "0.13.7" dependencies = [ "async-compression", "async-trait", @@ -338,7 +338,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.10.7" +version = "0.10.8" dependencies = [ "async-trait", "binstalk-downloader", @@ -362,7 +362,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.8" +version = "0.5.9" dependencies = [ "binstalk-downloader", "compact_str", @@ -381,7 +381,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.15" +version = "0.15.16" dependencies = [ "beef", "binstalk-types", @@ -402,7 +402,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.11.7" +version = "0.11.8" dependencies = [ "async-trait", "base16", @@ -937,7 +937,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.34" +version = "0.1.35" dependencies = [ "cfg-if", "guess_host_triple", @@ -949,7 +949,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.17" +version = "1.0.18" dependencies = [ "tempfile", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 4209c2a0..83103b84 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,8 +23,8 @@ pkg-fmt = "zip" [dependencies] atomic-file-install = { version = "1.0.6", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.18", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.15" } +binstalk = { path = "../binstalk", version = "0.28.19", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.16" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-downloader/CHANGELOG.md b/crates/binstalk-downloader/CHANGELOG.md index 8ddb88ec..028493fe 100644 --- a/crates/binstalk-downloader/CHANGELOG.md +++ b/crates/binstalk-downloader/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.13.7](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.6...binstalk-downloader-v0.13.7) - 2025-01-04 + +### Other + +- *(deps)* bump the deps group with 2 updates (#2010) + ## [0.13.6](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.5...binstalk-downloader-v0.13.6) - 2024-12-14 ### Other diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 108f7f9b..b4cdf30f 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.13.6" +version = "0.13.7" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index f3697659..39bcaf2a 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.8](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.7...binstalk-fetchers-v0.10.8) - 2025-01-04 + +### Other + +- *(deps)* bump the deps group with 2 updates (#2010) + ## [0.10.7](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.6...binstalk-fetchers-v0.10.7) - 2024-12-14 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 6fd118d8..3a245512 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.10.7" +version = "0.10.8" edition = "2021" description = "The binstall fetchers" @@ -12,8 +12,8 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.84" -binstalk-downloader = { version = "0.13.6", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.8", path = "../binstalk-git-repo-api" } +binstalk-downloader = { version = "0.13.7", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.9", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.5.4" [dev-dependencies] -binstalk-downloader = { version = "0.13.6", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.7", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index d4e7eb88..e8471ee5 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.9](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.8...binstalk-git-repo-api-v0.5.9) - 2025-01-04 + +### Other + +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.5.8](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.7...binstalk-git-repo-api-v0.5.8) - 2024-12-14 ### Other diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index c67e2d34..bd3f4243 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.8" +version = "0.5.9" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.13.6", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.7", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.8.0" @@ -25,6 +25,6 @@ url = "2.5.4" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.6", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.7", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index 97885ced..5b5adf40 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.16](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.15...binstalk-manifests-v0.15.16) - 2025-01-04 + +### Other + +- updated the following local packages: detect-targets + ## [0.15.15](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.14...binstalk-manifests-v0.15.15) - 2024-12-28 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 1310733a..5a47f7fa 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.15" +version = "0.15.16" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.34", path = "../detect-targets" } +detect-targets = { version = "0.1.35", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md index fc11d1c6..bd2bc84c 100644 --- a/crates/binstalk-registry/CHANGELOG.md +++ b/crates/binstalk-registry/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.8](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.7...binstalk-registry-v0.11.8) - 2025-01-04 + +### Other + +- *(deps)* bump the deps group with 2 updates (#2010) + ## [0.11.7](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.6...binstalk-registry-v0.11.7) - 2024-12-14 ### Other diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 2b29ab20..4d1f83d2 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.11.7" +version = "0.11.8" edition = "2021" rust-version = "1.65.0" @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.84" base16 = "0.2.1" -binstalk-downloader = { version = "0.13.6", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.7", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } @@ -40,7 +40,7 @@ url = "2.5.4" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.13.6", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.7", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index 1e6c2d88..096e4560 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.19](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.18...binstalk-v0.28.19) - 2025-01-04 + +### Other + +- *(deps)* bump the deps group with 2 updates (#2010) + ## [0.28.18](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.17...binstalk-v0.28.18) - 2024-12-28 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 55ec009c..4843c2e2 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.18" +version = "0.28.19" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -11,17 +11,17 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.6.6", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.13.6", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.8", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.10.7", path = "../binstalk-fetchers", features = [ +binstalk-downloader = { version = "0.13.7", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.9", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.10.8", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.11.7", path = "../binstalk-registry" } +binstalk-registry = { version = "0.11.8", path = "../binstalk-registry" } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } cargo-toml-workspace = { version = "7.0.1", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.34", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.35", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index be7d8f3f..3a66e7f7 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.35](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.34...detect-targets-v0.1.35) - 2025-01-04 + +### Other + +- update Cargo.lock dependencies + ## [0.1.34](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.33...detect-targets-v0.1.34) - 2024-12-28 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 8aeaae9b..f96d4875 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.34" +version = "0.1.35" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index 67aa16b6..fb9d1127 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.18](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.17...detect-wasi-v1.0.18) - 2025-01-04 + +### Other + +- update Cargo.lock dependencies + ## [1.0.17](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.16...detect-wasi-v1.0.17) - 2024-12-28 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index 65531ef9..62a7861a 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.17" +version = "1.0.18" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From 1f43e1af11cf5eb18fb1f2660e0d6dcddd24b6ea Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 4 Jan 2025 05:18:15 +0000 Subject: [PATCH 1948/2020] release: cargo-binstall v1.10.19 (#2011) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 599b5ece..17b2f2d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -572,7 +572,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.18" +version = "1.10.19" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 83103b84..46682849 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.18" +version = "1.10.19" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index d82e9a34..697faf18 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 67b2c6aada6b4723ab446b805c7cad26ee8c5eae Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 10 Jan 2025 17:55:03 +1100 Subject: [PATCH 1949/2020] Fix creating PR in upgrade-transitive-deps.yml (#2012) Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- .github/workflows/upgrade-transitive-deps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/upgrade-transitive-deps.yml b/.github/workflows/upgrade-transitive-deps.yml index a1f8d117..8d9aad41 100644 --- a/.github/workflows/upgrade-transitive-deps.yml +++ b/.github/workflows/upgrade-transitive-deps.yml @@ -45,4 +45,4 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - gh pr create --base main --label 'PR: dependencies' --title 'dep: Upgrade transitive dependencies' --body 'Update dependencies' + gh pr create --base main --label 'PR: dependencies' --title 'dep: Upgrade transitive dependencies' --body 'Update dependencies' --head $(git branch --show-current) From f15549e0c77584feeadafc2cc073a0cba93409dc Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 10 Jan 2025 21:43:37 +1100 Subject: [PATCH 1950/2020] dep: Upgrade transitive dependencies (#2013) Co-authored-by: github-actions --- Cargo.lock | 439 +++++++++++++++++++++++++++++++++-------------------- 1 file changed, 271 insertions(+), 168 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 17b2f2d3..b8730f4f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -178,9 +178,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.84" +version = "0.1.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1244b10dcd56c92219da4e14caa97e312079e185f04ba3eea25061561dc0a0" +checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" dependencies = [ "proc-macro2", "quote", @@ -279,7 +279,7 @@ dependencies = [ "strum", "target-lexicon", "tempfile", - "thiserror 2.0.9", + "thiserror 2.0.10", "tokio", "tracing", "url", @@ -296,7 +296,7 @@ dependencies = [ "leon", "miette", "normalize-path", - "thiserror 2.0.9", + "thiserror 2.0.10", "tracing", ] @@ -326,7 +326,7 @@ dependencies = [ "serde", "serde_json", "tempfile", - "thiserror 2.0.9", + "thiserror 2.0.10", "tokio", "tokio-tar", "tokio-util", @@ -354,7 +354,7 @@ dependencies = [ "minisign-verify", "once_cell", "strum", - "thiserror 2.0.9", + "thiserror 2.0.10", "tokio", "tracing", "url", @@ -371,7 +371,7 @@ dependencies = [ "serde", "serde-tuple-vec-map", "serde_json", - "thiserror 2.0.9", + "thiserror 2.0.10", "tokio", "tracing", "tracing-subscriber", @@ -395,7 +395,7 @@ dependencies = [ "serde-tuple-vec-map", "serde_json", "tempfile", - "thiserror 2.0.9", + "thiserror 2.0.10", "toml_edit", "url", ] @@ -420,7 +420,7 @@ dependencies = [ "sha2", "simple-git", "tempfile", - "thiserror 2.0.9", + "thiserror 2.0.10", "tokio", "toml_edit", "tracing", @@ -461,9 +461,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" [[package]] name = "block-buffer" @@ -620,7 +620,7 @@ dependencies = [ "normalize-path", "serde", "tempfile", - "thiserror 2.0.9", + "thiserror 2.0.10", "tracing", ] @@ -659,9 +659,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.6" +version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d6dbb628b8f8555f86d0323c2eb39e3ec81901f4b83e091db8a6a76d316a333" +checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" dependencies = [ "jobserver", "libc", @@ -707,9 +707,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.23" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3135e7ec2ef7b10c6ed8950f0f792ed96ee093fa088608f1c76e569722700c84" +checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" dependencies = [ "clap_builder", "clap_derive", @@ -717,9 +717,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.23" +version = "4.5.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30582fc632330df2bd26877bde0c1f4470d57c582bbc070376afcd04d8cb4838" +checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" dependencies = [ "anstream", "anstyle", @@ -729,9 +729,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" dependencies = [ "heck", "proc-macro2", @@ -1363,7 +1363,7 @@ dependencies = [ "gix-worktree-state", "once_cell", "smallvec", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1376,8 +1376,8 @@ dependencies = [ "gix-date", "gix-utils", "itoa", - "thiserror 2.0.9", - "winnow 0.6.21", + "thiserror 2.0.10", + "winnow 0.6.22", ] [[package]] @@ -1393,7 +1393,7 @@ dependencies = [ "gix-trace", "kstring", "smallvec", - "thiserror 2.0.9", + "thiserror 2.0.10", "unicode-bom", ] @@ -1403,7 +1403,7 @@ version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d48b897b4bbc881aea994b4a5bbb340a04979d7be9089791304e04a9fbc66b53" dependencies = [ - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1412,7 +1412,7 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6ffbeb3a5c0b8b84c3fe4133a6f8c82fa962f4caefe8d0762eced025d3eb4f7" dependencies = [ - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1438,7 +1438,7 @@ dependencies = [ "gix-features", "gix-hash", "memmap2", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1457,9 +1457,9 @@ dependencies = [ "memchr", "once_cell", "smallvec", - "thiserror 2.0.9", + "thiserror 2.0.10", "unicode-bom", - "winnow 0.6.21", + "winnow 0.6.22", ] [[package]] @@ -1468,11 +1468,11 @@ version = "0.14.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49aaeef5d98390a3bcf9dbc6440b520b793d1bf3ed99317dc407b02be995b28e" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "bstr", "gix-path", "libc", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1489,7 +1489,7 @@ dependencies = [ "gix-sec", "gix-trace", "gix-url", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1501,7 +1501,7 @@ dependencies = [ "bstr", "itoa", "jiff", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1513,7 +1513,7 @@ dependencies = [ "bstr", "gix-hash", "gix-object", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1529,7 +1529,7 @@ dependencies = [ "gix-path", "gix-ref", "gix-sec", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1552,7 +1552,7 @@ dependencies = [ "prodash", "sha1", "sha1_smol", - "thiserror 2.0.9", + "thiserror 2.0.10", "walkdir", ] @@ -1574,7 +1574,7 @@ dependencies = [ "gix-trace", "gix-utils", "smallvec", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1594,7 +1594,7 @@ version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aaf69a6bec0a3581567484bf99a4003afcaf6c469fd4214352517ea355cf3435" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "bstr", "gix-features", "gix-path", @@ -1607,7 +1607,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b5eccc17194ed0e67d49285e4853307e4147e95407f91c1c3e4a13ba9f4e4ce" dependencies = [ "faster-hex", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1640,7 +1640,7 @@ version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "270645fd20556b64c8ffa1540d921b281e6994413a0ca068596f97e9367a257a" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "bstr", "filetime", "fnv", @@ -1659,7 +1659,7 @@ dependencies = [ "memmap2", "rustix", "smallvec", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1670,7 +1670,7 @@ checksum = "1cd3ab68a452db63d9f3ebdacb10f30dba1fa0d31ac64f4203d395ed1102d940" dependencies = [ "gix-tempfile", "gix-utils", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1679,14 +1679,14 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d27f830a16405386e9c83b9d5be8261fe32bbd6b3caf15bd1b284c6b2b7ef1a8" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "gix-commitgraph", "gix-date", "gix-hash", "gix-object", "gix-revwalk", "smallvec", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1706,8 +1706,8 @@ dependencies = [ "gix-validate", "itoa", "smallvec", - "thiserror 2.0.9", - "winnow 0.6.21", + "thiserror 2.0.10", + "winnow 0.6.22", ] [[package]] @@ -1728,7 +1728,7 @@ dependencies = [ "gix-quote", "parking_lot", "tempfile", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1748,7 +1748,7 @@ dependencies = [ "memmap2", "parking_lot", "smallvec", - "thiserror 2.0.9", + "thiserror 2.0.10", "uluru", ] @@ -1761,7 +1761,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1773,7 +1773,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1786,7 +1786,7 @@ dependencies = [ "gix-trace", "home", "once_cell", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1795,13 +1795,13 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c472dfbe4a4e96fcf7efddcd4771c9037bb4fdea2faaabf2f4888210c75b81e" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "bstr", "gix-attributes", "gix-config-value", "gix-glob", "gix-path", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1814,7 +1814,7 @@ dependencies = [ "gix-config-value", "parking_lot", "rustix", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1839,8 +1839,8 @@ dependencies = [ "gix-transport", "gix-utils", "maybe-async", - "thiserror 2.0.9", - "winnow 0.6.21", + "thiserror 2.0.10", + "winnow 0.6.22", ] [[package]] @@ -1851,7 +1851,7 @@ checksum = "64a1e282216ec2ab2816cd57e6ed88f8009e634aec47562883c05ac8a7009a63" dependencies = [ "bstr", "gix-utils", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1871,8 +1871,8 @@ dependencies = [ "gix-utils", "gix-validate", "memmap2", - "thiserror 2.0.9", - "winnow 0.6.21", + "thiserror 2.0.10", + "winnow 0.6.22", ] [[package]] @@ -1886,7 +1886,7 @@ dependencies = [ "gix-revision", "gix-validate", "smallvec", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1901,7 +1901,7 @@ dependencies = [ "gix-hash", "gix-object", "gix-revwalk", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1916,7 +1916,7 @@ dependencies = [ "gix-hashtable", "gix-object", "smallvec", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1925,7 +1925,7 @@ version = "0.10.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8b876ef997a955397809a2ec398d6a45b7a55b4918f2446344330f778d14fd6" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "gix-path", "libc", "windows-sys 0.52.0", @@ -1940,7 +1940,7 @@ dependencies = [ "bstr", "gix-hash", "gix-lock", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1955,7 +1955,7 @@ dependencies = [ "gix-pathspec", "gix-refspec", "gix-url", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -1993,7 +1993,7 @@ dependencies = [ "gix-sec", "gix-url", "reqwest", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -2002,7 +2002,7 @@ version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ed47d648619e23e93f971d2bba0d10c1100e54ef95d2981d609907a8cabac89" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "gix-commitgraph", "gix-date", "gix-hash", @@ -2010,7 +2010,7 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -2023,7 +2023,7 @@ dependencies = [ "gix-features", "gix-path", "percent-encoding", - "thiserror 2.0.9", + "thiserror 2.0.10", "url", ] @@ -2044,7 +2044,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd520d09f9f585b34b32aba1d0b36ada89ab7fefb54a8ca3fe37fc482a750937" dependencies = [ "bstr", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -2083,7 +2083,7 @@ dependencies = [ "gix-path", "gix-worktree", "io-close", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -2181,7 +2181,7 @@ checksum = "d063c0692ee669aa6d261988aa19ca5510f1cc40e4f211024f50c888499a35d7" dependencies = [ "async-recursion", "async-trait", - "bitflags 2.6.0", + "bitflags 2.7.0", "bytes", "cfg-if", "data-encoding", @@ -2202,7 +2202,7 @@ dependencies = [ "rand", "ring", "rustls", - "thiserror 2.0.9", + "thiserror 2.0.10", "time", "tinyvec", "tokio", @@ -2230,7 +2230,7 @@ dependencies = [ "resolv-conf", "rustls", "smallvec", - "thiserror 2.0.9", + "thiserror 2.0.10", "tokio", "tokio-native-tls", "tokio-rustls", @@ -2612,9 +2612,9 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jiff" -version = "0.1.19" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943611a469f78ab9afdac9022e473a80fca16a9deca6c5be3eb566d872231e76" +checksum = "ed0ce60560149333a8e41ca7dc78799c47c5fd435e2bc18faf6a054382eec037" dependencies = [ "jiff-tzdb-platform", "log", @@ -2695,7 +2695,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42a865ffec5587961f5afc6d365bccb304f4feaa1928f4fe94c91c9d210d7310" dependencies = [ "miette", - "thiserror 2.0.9", + "thiserror 2.0.10", ] [[package]] @@ -2732,16 +2732,16 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "libc", "redox_syscall 0.5.8", ] [[package]] name = "libz-ng-sys" -version = "1.1.20" +version = "1.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0f7295a34685977acb2e8cc8b08ee4a8dffd6cf278eeccddbe1ed55ba815d5" +checksum = "7cee1488e961a80d172564fd6fcda11d8a4ac6672c06fe008e9213fa60520c2b" dependencies = [ "cmake", "libc", @@ -2749,9 +2749,9 @@ dependencies = [ [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "litemap" @@ -2948,16 +2948,16 @@ dependencies = [ [[package]] name = "moka" -version = "0.12.9" +version = "0.12.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23db87a7f248211f6a7c8644a1b750541f8a4c68ae7de0f908860e44c0c201f6" +checksum = "a9321642ca94a4282428e6ea4af8cc2ca4eac48ac7a6a4ea8f33f76d0ce70926" dependencies = [ "crossbeam-channel", "crossbeam-epoch", "crossbeam-utils", "loom", "parking_lot", - "quanta", + "portable-atomic", "rustc_version", "smallvec", "tagptr", @@ -3036,7 +3036,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cfg-if", "libc", ] @@ -3133,7 +3133,7 @@ version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "cfg-if", "foreign-types", "libc", @@ -3263,18 +3263,18 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "phf" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +checksum = "1fd6780a80ae0c52cc120a26a1a42c1ae51b247a253e4e06113d23d2c2edd078" dependencies = [ "phf_shared", ] [[package]] name = "phf_codegen" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" +checksum = "aef8048c789fa5e851558d709946d6d79a8ff88c0440c587967f8e94bfb1216a" dependencies = [ "phf_generator", "phf_shared", @@ -3282,9 +3282,9 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ "phf_shared", "rand", @@ -3292,18 +3292,18 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +checksum = "67eabc2ef2a60eb7faa00097bd1ffdb5bd28e62bf39990626a582201b7a754e5" dependencies = [ "siphasher", ] [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -3411,21 +3411,6 @@ dependencies = [ "parking_lot", ] -[[package]] -name = "quanta" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd1fe6824cea6538803de3ff1bc0cf3949024db3d43c9643024bfb33a807c0e" -dependencies = [ - "crossbeam-utils", - "libc", - "once_cell", - "raw-cpuid", - "wasi", - "web-sys", - "winapi", -] - [[package]] name = "quick-error" version = "1.2.3" @@ -3446,7 +3431,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror 2.0.9", + "thiserror 2.0.10", "tokio", "tracing", ] @@ -3465,7 +3450,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.9", + "thiserror 2.0.10", "tinyvec", "tracing", "web-time", @@ -3524,15 +3509,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "raw-cpuid" -version = "11.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ab240315c661615f2ee9f0f2cd32d5a7343a84d5ebcccb99d46e6637565e7b0" -dependencies = [ - "bitflags 2.6.0", -] - [[package]] name = "rc-zip" version = "5.2.0" @@ -3584,7 +3560,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", ] [[package]] @@ -3600,13 +3576,13 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17400ed684c3a0615932f00c271ae3eea13e47056a1455821995122348ab6438" +checksum = "8a076c8c302cbd01e62bd6c2f74fc4913c3131aa6fa72dae78047f5535e4fc88" dependencies = [ "cfg-if", "rustix", - "windows 0.58.0", + "windows 0.59.0", ] [[package]] @@ -3758,11 +3734,11 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.42" +version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" +checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "errno 0.3.10", "libc", "linux-raw-sys", @@ -3793,7 +3769,7 @@ dependencies = [ "openssl-probe", "rustls-pki-types", "schannel", - "security-framework 3.1.0", + "security-framework 3.2.0", ] [[package]] @@ -3873,7 +3849,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -3882,11 +3858,11 @@ dependencies = [ [[package]] name = "security-framework" -version = "3.1.0" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81d3f8c9bfcc3cbb6b0179eb57042d75b1582bdc65c3cb95f3fa999509c03cbc" +checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation 0.10.0", "core-foundation-sys", "libc", @@ -3895,9 +3871,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.13.0" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1863fd3768cd83c56a7f60faa4dc0d403f1b6df0a38c3c25f44b7894e45370d5" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -3943,9 +3919,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.134" +version = "1.0.135" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" +checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" dependencies = [ "itoa", "memchr", @@ -4058,9 +4034,9 @@ dependencies = [ [[package]] name = "siphasher" -version = "0.3.11" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" +checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d" [[package]] name = "slab" @@ -4159,9 +4135,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.94" +version = "2.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "987bc0be1cdea8b10216bd06e2ca407d40b9543468fafd3ddfb02f36e77f71f3" +checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" dependencies = [ "proc-macro2", "quote", @@ -4205,7 +4181,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.7.0", "core-foundation 0.9.4", "system-configuration-sys 0.6.0", ] @@ -4287,11 +4263,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.9" +version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" +checksum = "a3ac7f54ca534db81081ef1c1e7f6ea8a3ef428d2fc069097c079443d24124d3" dependencies = [ - "thiserror-impl 2.0.9", + "thiserror-impl 2.0.10", ] [[package]] @@ -4307,9 +4283,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.9" +version = "2.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" +checksum = "9e9465d30713b56a37ede7185763c3492a91be2f5fa68d958c44e41ab9248beb" dependencies = [ "proc-macro2", "quote", @@ -4386,9 +4362,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.42.0" +version = "1.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cec9b21b0450273377fc97bd4c33a8acffc8c996c987a7c5b319a0083707551" +checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" dependencies = [ "backtrace", "bytes", @@ -4403,9 +4379,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", @@ -4502,7 +4478,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.21", + "winnow 0.6.22", ] [[package]] @@ -4699,9 +4675,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "b913a3b5fe84142e269d63cc62b64319ccaf89b748fc31fe025177f767a756c4" dependencies = [ "getrandom", ] @@ -4949,6 +4925,16 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f919aee0a93304be7f62e8e5027811bbba96bcb1de84d6618be56e43f8a32a1" +dependencies = [ + "windows-core 0.59.0", + "windows-targets 0.53.0", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -4964,13 +4950,26 @@ version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ba6d44ec8c2591c134257ce647b7ea6b20335bf6379a27dac5f1641fcf59f99" dependencies = [ - "windows-implement", - "windows-interface", - "windows-result", - "windows-strings", + "windows-implement 0.58.0", + "windows-interface 0.58.0", + "windows-result 0.2.0", + "windows-strings 0.1.0", "windows-targets 0.52.6", ] +[[package]] +name = "windows-core" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "810ce18ed2112484b0d4e15d022e5f598113e220c53e373fb31e67e21670c1ce" +dependencies = [ + "windows-implement 0.59.0", + "windows-interface 0.59.0", + "windows-result 0.3.0", + "windows-strings 0.3.0", + "windows-targets 0.53.0", +] + [[package]] name = "windows-implement" version = "0.58.0" @@ -4982,6 +4981,17 @@ dependencies = [ "syn", ] +[[package]] +name = "windows-implement" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83577b051e2f49a058c308f17f273b570a6a758386fc291b5f6a934dd84e48c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "windows-interface" version = "0.58.0" @@ -4993,14 +5003,25 @@ dependencies = [ "syn", ] +[[package]] +name = "windows-interface" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb26fd936d991781ea39e87c3a27285081e3c0da5ca0fcbc02d368cc6f52ff01" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "windows-registry" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" dependencies = [ - "windows-result", - "windows-strings", + "windows-result 0.2.0", + "windows-strings 0.1.0", "windows-targets 0.52.6", ] @@ -5013,16 +5034,34 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "windows-result" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d08106ce80268c4067c0571ca55a9b4e9516518eaa1a1fe9b37ca403ae1d1a34" +dependencies = [ + "windows-targets 0.53.0", +] + [[package]] name = "windows-strings" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" dependencies = [ - "windows-result", + "windows-result 0.2.0", "windows-targets 0.52.6", ] +[[package]] +name = "windows-strings" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b888f919960b42ea4e11c2f408fadb55f78a9f236d5eef084103c8ce52893491" +dependencies = [ + "windows-targets 0.53.0", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -5074,13 +5113,29 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -5093,6 +5148,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -5105,6 +5166,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -5117,12 +5184,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -5135,6 +5214,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -5147,6 +5232,12 @@ 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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -5159,6 +5250,12 @@ 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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -5171,6 +5268,12 @@ 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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "winnow" version = "0.5.40" @@ -5182,9 +5285,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.21" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6f5bb5257f2407a5425c6e749bfd9692192a73e70a6060516ac04f889087d68" +checksum = "39281189af81c07ec09db316b302a3e67bf9bd7cbf6c820b50e35fee9c2fa980" dependencies = [ "memchr", ] @@ -5223,9 +5326,9 @@ checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] name = "xattr" -version = "1.3.1" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" +checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" dependencies = [ "libc", "linux-raw-sys", From fa7478ca78893e286ca624ebfa6f8b96f47b3fa2 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 11 Jan 2025 13:20:03 +1100 Subject: [PATCH 1951/2020] build(deps): bump the deps group with 3 updates (#2015) Bumps the deps group with 3 updates: [windows](https://github.com/microsoft/windows-rs), [log](https://github.com/rust-lang/log) and [thiserror](https://github.com/dtolnay/thiserror). Updates `windows` from 0.58.0 to 0.59.0 - [Release notes](https://github.com/microsoft/windows-rs/releases) - [Commits](https://github.com/microsoft/windows-rs/compare/0.58.0...0.59.0) Updates `log` from 0.4.22 to 0.4.24 - [Release notes](https://github.com/rust-lang/log/releases) - [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md) - [Commits](https://github.com/rust-lang/log/compare/0.4.22...0.4.24) Updates `thiserror` from 2.0.10 to 2.0.11 - [Release notes](https://github.com/dtolnay/thiserror/releases) - [Commits](https://github.com/dtolnay/thiserror/compare/2.0.10...2.0.11) --- updated-dependencies: - dependency-name: windows dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: log dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: thiserror dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 262 ++++++++++++++++++------ crates/atomic-file-install/Cargo.toml | 2 +- crates/bin/Cargo.toml | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-git-repo-api/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- 11 files changed, 212 insertions(+), 70 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b8730f4f..3ce265c5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -194,7 +194,7 @@ dependencies = [ "reflink-copy", "tempfile", "tracing", - "windows 0.58.0", + "windows 0.59.0", ] [[package]] @@ -279,7 +279,7 @@ dependencies = [ "strum", "target-lexicon", "tempfile", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tracing", "url", @@ -296,7 +296,7 @@ dependencies = [ "leon", "miette", "normalize-path", - "thiserror 2.0.10", + "thiserror 2.0.11", "tracing", ] @@ -326,7 +326,7 @@ dependencies = [ "serde", "serde_json", "tempfile", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tokio-tar", "tokio-util", @@ -354,7 +354,7 @@ dependencies = [ "minisign-verify", "once_cell", "strum", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tracing", "url", @@ -371,7 +371,7 @@ dependencies = [ "serde", "serde-tuple-vec-map", "serde_json", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tracing", "tracing-subscriber", @@ -395,7 +395,7 @@ dependencies = [ "serde-tuple-vec-map", "serde_json", "tempfile", - "thiserror 2.0.10", + "thiserror 2.0.11", "toml_edit", "url", ] @@ -420,7 +420,7 @@ dependencies = [ "sha2", "simple-git", "tempfile", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "toml_edit", "tracing", @@ -620,7 +620,7 @@ dependencies = [ "normalize-path", "serde", "tempfile", - "thiserror 2.0.10", + "thiserror 2.0.11", "tracing", ] @@ -1060,6 +1060,16 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +[[package]] +name = "erased-serde" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" +dependencies = [ + "serde", + "typeid", +] + [[package]] name = "errno" version = "0.2.8" @@ -1363,7 +1373,7 @@ dependencies = [ "gix-worktree-state", "once_cell", "smallvec", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1376,7 +1386,7 @@ dependencies = [ "gix-date", "gix-utils", "itoa", - "thiserror 2.0.10", + "thiserror 2.0.11", "winnow 0.6.22", ] @@ -1393,7 +1403,7 @@ dependencies = [ "gix-trace", "kstring", "smallvec", - "thiserror 2.0.10", + "thiserror 2.0.11", "unicode-bom", ] @@ -1403,7 +1413,7 @@ version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d48b897b4bbc881aea994b4a5bbb340a04979d7be9089791304e04a9fbc66b53" dependencies = [ - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1412,7 +1422,7 @@ version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6ffbeb3a5c0b8b84c3fe4133a6f8c82fa962f4caefe8d0762eced025d3eb4f7" dependencies = [ - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1438,7 +1448,7 @@ dependencies = [ "gix-features", "gix-hash", "memmap2", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1457,7 +1467,7 @@ dependencies = [ "memchr", "once_cell", "smallvec", - "thiserror 2.0.10", + "thiserror 2.0.11", "unicode-bom", "winnow 0.6.22", ] @@ -1472,7 +1482,7 @@ dependencies = [ "bstr", "gix-path", "libc", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1489,7 +1499,7 @@ dependencies = [ "gix-sec", "gix-trace", "gix-url", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1501,7 +1511,7 @@ dependencies = [ "bstr", "itoa", "jiff", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1513,7 +1523,7 @@ dependencies = [ "bstr", "gix-hash", "gix-object", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1529,7 +1539,7 @@ dependencies = [ "gix-path", "gix-ref", "gix-sec", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1552,7 +1562,7 @@ dependencies = [ "prodash", "sha1", "sha1_smol", - "thiserror 2.0.10", + "thiserror 2.0.11", "walkdir", ] @@ -1574,7 +1584,7 @@ dependencies = [ "gix-trace", "gix-utils", "smallvec", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1607,7 +1617,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b5eccc17194ed0e67d49285e4853307e4147e95407f91c1c3e4a13ba9f4e4ce" dependencies = [ "faster-hex", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1659,7 +1669,7 @@ dependencies = [ "memmap2", "rustix", "smallvec", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1670,7 +1680,7 @@ checksum = "1cd3ab68a452db63d9f3ebdacb10f30dba1fa0d31ac64f4203d395ed1102d940" dependencies = [ "gix-tempfile", "gix-utils", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1686,7 +1696,7 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1706,7 +1716,7 @@ dependencies = [ "gix-validate", "itoa", "smallvec", - "thiserror 2.0.10", + "thiserror 2.0.11", "winnow 0.6.22", ] @@ -1728,7 +1738,7 @@ dependencies = [ "gix-quote", "parking_lot", "tempfile", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1748,7 +1758,7 @@ dependencies = [ "memmap2", "parking_lot", "smallvec", - "thiserror 2.0.10", + "thiserror 2.0.11", "uluru", ] @@ -1761,7 +1771,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1773,7 +1783,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1786,7 +1796,7 @@ dependencies = [ "gix-trace", "home", "once_cell", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1801,7 +1811,7 @@ dependencies = [ "gix-config-value", "gix-glob", "gix-path", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1814,7 +1824,7 @@ dependencies = [ "gix-config-value", "parking_lot", "rustix", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1839,7 +1849,7 @@ dependencies = [ "gix-transport", "gix-utils", "maybe-async", - "thiserror 2.0.10", + "thiserror 2.0.11", "winnow 0.6.22", ] @@ -1851,7 +1861,7 @@ checksum = "64a1e282216ec2ab2816cd57e6ed88f8009e634aec47562883c05ac8a7009a63" dependencies = [ "bstr", "gix-utils", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1871,7 +1881,7 @@ dependencies = [ "gix-utils", "gix-validate", "memmap2", - "thiserror 2.0.10", + "thiserror 2.0.11", "winnow 0.6.22", ] @@ -1886,7 +1896,7 @@ dependencies = [ "gix-revision", "gix-validate", "smallvec", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1901,7 +1911,7 @@ dependencies = [ "gix-hash", "gix-object", "gix-revwalk", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1916,7 +1926,7 @@ dependencies = [ "gix-hashtable", "gix-object", "smallvec", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1940,7 +1950,7 @@ dependencies = [ "bstr", "gix-hash", "gix-lock", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1955,7 +1965,7 @@ dependencies = [ "gix-pathspec", "gix-refspec", "gix-url", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -1993,7 +2003,7 @@ dependencies = [ "gix-sec", "gix-url", "reqwest", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -2010,7 +2020,7 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -2023,7 +2033,7 @@ dependencies = [ "gix-features", "gix-path", "percent-encoding", - "thiserror 2.0.10", + "thiserror 2.0.11", "url", ] @@ -2044,7 +2054,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd520d09f9f585b34b32aba1d0b36ada89ab7fefb54a8ca3fe37fc482a750937" dependencies = [ "bstr", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -2083,7 +2093,7 @@ dependencies = [ "gix-path", "gix-worktree", "io-close", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -2202,7 +2212,7 @@ dependencies = [ "rand", "ring", "rustls", - "thiserror 2.0.10", + "thiserror 2.0.11", "time", "tinyvec", "tokio", @@ -2230,7 +2240,7 @@ dependencies = [ "resolv-conf", "rustls", "smallvec", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tokio-native-tls", "tokio-rustls", @@ -2695,7 +2705,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42a865ffec5587961f5afc6d365bccb304f4feaa1928f4fe94c91c9d210d7310" dependencies = [ "miette", - "thiserror 2.0.10", + "thiserror 2.0.11", ] [[package]] @@ -2771,9 +2781,12 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "3d6ea2a48c204030ee31a7d7fc72c93294c92fe87ecb1789881c9543516e1a0d" +dependencies = [ + "value-bag", +] [[package]] name = "loom" @@ -3431,7 +3444,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror 2.0.10", + "thiserror 2.0.11", "tokio", "tracing", ] @@ -3450,7 +3463,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.10", + "thiserror 2.0.11", "tinyvec", "tracing", "web-time", @@ -3917,6 +3930,15 @@ dependencies = [ "syn", ] +[[package]] +name = "serde_fmt" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1d4ddca14104cd60529e8c7f7ba71a2c8acd8f7f5cfcdc2faf97eeb7c3010a4" +dependencies = [ + "serde", +] + [[package]] name = "serde_json" version = "1.0.135" @@ -4133,6 +4155,84 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" +[[package]] +name = "sval" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6dc0f9830c49db20e73273ffae9b5240f63c42e515af1da1fceefb69fceafd8" + +[[package]] +name = "sval_buffer" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "429922f7ad43c0ef8fd7309e14d750e38899e32eb7e8da656ea169dd28ee212f" +dependencies = [ + "sval", + "sval_ref", +] + +[[package]] +name = "sval_dynamic" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68f16ff5d839396c11a30019b659b0976348f3803db0626f736764c473b50ff4" +dependencies = [ + "sval", +] + +[[package]] +name = "sval_fmt" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c01c27a80b6151b0557f9ccbe89c11db571dc5f68113690c1e028d7e974bae94" +dependencies = [ + "itoa", + "ryu", + "sval", +] + +[[package]] +name = "sval_json" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0deef63c70da622b2a8069d8600cf4b05396459e665862e7bdb290fd6cf3f155" +dependencies = [ + "itoa", + "ryu", + "sval", +] + +[[package]] +name = "sval_nested" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a39ce5976ae1feb814c35d290cf7cf8cd4f045782fe1548d6bc32e21f6156e9f" +dependencies = [ + "sval", + "sval_buffer", + "sval_ref", +] + +[[package]] +name = "sval_ref" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb7c6ee3751795a728bc9316a092023529ffea1783499afbc5c66f5fabebb1fa" +dependencies = [ + "sval", +] + +[[package]] +name = "sval_serde" +version = "2.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a5572d0321b68109a343634e3a5d576bf131b82180c6c442dee06349dfc652a" +dependencies = [ + "serde", + "sval", + "sval_nested", +] + [[package]] name = "syn" version = "2.0.96" @@ -4263,11 +4363,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.10" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3ac7f54ca534db81081ef1c1e7f6ea8a3ef428d2fc069097c079443d24124d3" +checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" dependencies = [ - "thiserror-impl 2.0.10", + "thiserror-impl 2.0.11", ] [[package]] @@ -4283,9 +4383,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.10" +version = "2.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e9465d30713b56a37ede7185763c3492a91be2f5fa68d958c44e41ab9248beb" +checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" dependencies = [ "proc-macro2", "quote", @@ -4589,6 +4689,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" +[[package]] +name = "typeid" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" + [[package]] name = "typenum" version = "1.17.0" @@ -4688,6 +4794,42 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +[[package]] +name = "value-bag" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2" +dependencies = [ + "value-bag-serde1", + "value-bag-sval2", +] + +[[package]] +name = "value-bag-serde1" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bb773bd36fd59c7ca6e336c94454d9c66386416734817927ac93d81cb3c5b0b" +dependencies = [ + "erased-serde", + "serde", + "serde_fmt", +] + +[[package]] +name = "value-bag-sval2" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53a916a702cac43a88694c97657d449775667bcd14b70419441d05b7fea4a83a" +dependencies = [ + "sval", + "sval_buffer", + "sval_dynamic", + "sval_fmt", + "sval_json", + "sval_ref", + "sval_serde", +] + [[package]] name = "vcpkg" version = "0.2.15" diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index 04018d0b..bf4bc839 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -15,4 +15,4 @@ tempfile = "3.5.0" tracing = "0.1.39" [target.'cfg(windows)'.dependencies] -windows = { version = "0.58.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } +windows = { version = "0.59.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 46682849..49e29dfe 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -30,7 +30,7 @@ compact_str = "0.8.0" dirs = "5.0.1" file-format = { version = "0.26.0", default-features = false } home = "0.5.9" -log = { version = "0.4.18", features = ["std"] } +log = { version = "0.4.24", features = ["std"] } miette = "7.0.0" mimalloc = { version = "0.1.39", default-features = false, optional = true } once_cell = "1.18.0" diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index f8f911e9..fdebedd4 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -17,5 +17,5 @@ compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } -thiserror = "2.0.7" +thiserror = "2.0.11" tracing = "0.1.39" diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index b4cdf30f..204e22f9 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -50,7 +50,7 @@ serde_json = { version = "1.0.107", optional = true } #tar = "0.4.38" tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.5.0" -thiserror = "2.0.7" +thiserror = "2.0.11" tokio = { version = "1.35.0", features = [ "macros", "rt-multi-thread", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 3a245512..dbd0583e 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -25,7 +25,7 @@ miette = "7.0.0" minisign-verify = "0.2.1" once_cell = "1.18.0" strum = "0.26.1" -thiserror = "2.0.7" +thiserror = "2.0.11" tokio = { version = "1.35.0", features = [ "rt", "sync", diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index bd3f4243..c6fcaed1 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -18,7 +18,7 @@ percent-encoding = "2.2.0" serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = { version = "1.0.107" } -thiserror = "2.0.7" +thiserror = "2.0.11" tokio = { version = "1.35.0", features = ["sync"], default-features = false } tracing = "0.1.39" url = "2.5.4" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 5a47f7fa..8306a9bf 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -20,7 +20,7 @@ semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = "1.0.107" -thiserror = "2.0.7" +thiserror = "2.0.11" toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 4d1f83d2..b4ce12a9 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -29,7 +29,7 @@ serde_json = "1.0.107" sha2 = "0.10.7" simple-git = { version = "0.2.4", optional = true } tempfile = "3.5.0" -thiserror = "2.0.7" +thiserror = "2.0.11" tokio = { version = "1.35.0", features = [ "rt", "sync", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 4843c2e2..7cee8754 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -35,7 +35,7 @@ simple-git = { version = "0.2.10", optional = true } strum = "0.26.1" target-lexicon = { version = "0.13.0", features = ["std"] } tempfile = "3.5.0" -thiserror = "2.0.7" +thiserror = "2.0.11" tokio = { version = "1.35.0", features = [ "rt", "process", diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 97fa7b47..239aebd6 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -15,7 +15,7 @@ compact_str = { version = "0.8.0", features = ["serde"] } glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } serde = "1.0.163" -thiserror = "2.0.7" +thiserror = "2.0.11" tracing = "0.1.39" [dev-dependencies] From c6a51aaf3e744b8bd495e559145ca562d84b6e58 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 11 Jan 2025 04:00:58 +0000 Subject: [PATCH 1952/2020] chore: release (#2014) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 22 +++++++++++----------- crates/atomic-file-install/CHANGELOG.md | 6 ++++++ crates/atomic-file-install/Cargo.toml | 2 +- crates/bin/Cargo.toml | 6 +++--- crates/binstalk-bins/CHANGELOG.md | 6 ++++++ crates/binstalk-bins/Cargo.toml | 4 ++-- crates/binstalk-downloader/CHANGELOG.md | 6 ++++++ crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/CHANGELOG.md | 6 ++++++ crates/binstalk-fetchers/Cargo.toml | 8 ++++---- crates/binstalk-git-repo-api/CHANGELOG.md | 6 ++++++ crates/binstalk-git-repo-api/Cargo.toml | 6 +++--- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk-registry/CHANGELOG.md | 6 ++++++ crates/binstalk-registry/Cargo.toml | 8 ++++---- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 16 ++++++++-------- crates/cargo-toml-workspace/CHANGELOG.md | 6 ++++++ crates/cargo-toml-workspace/Cargo.toml | 2 +- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- 24 files changed, 108 insertions(+), 42 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3ce265c5..eb947ef9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -189,7 +189,7 @@ dependencies = [ [[package]] name = "atomic-file-install" -version = "1.0.6" +version = "1.0.7" dependencies = [ "reflink-copy", "tempfile", @@ -256,7 +256,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.19" +version = "0.28.20" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -288,7 +288,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.6.6" +version = "0.6.7" dependencies = [ "atomic-file-install", "binstalk-types", @@ -302,7 +302,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.13.7" +version = "0.13.8" dependencies = [ "async-compression", "async-trait", @@ -338,7 +338,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.10.8" +version = "0.10.9" dependencies = [ "async-trait", "binstalk-downloader", @@ -362,7 +362,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.9" +version = "0.5.10" dependencies = [ "binstalk-downloader", "compact_str", @@ -381,7 +381,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.16" +version = "0.15.17" dependencies = [ "beef", "binstalk-types", @@ -402,7 +402,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.11.8" +version = "0.11.9" dependencies = [ "async-trait", "base16", @@ -612,7 +612,7 @@ dependencies = [ [[package]] name = "cargo-toml-workspace" -version = "7.0.1" +version = "7.0.2" dependencies = [ "cargo_toml", "compact_str", @@ -937,7 +937,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.35" +version = "0.1.36" dependencies = [ "cfg-if", "guess_host_triple", @@ -949,7 +949,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.18" +version = "1.0.19" dependencies = [ "tempfile", ] diff --git a/crates/atomic-file-install/CHANGELOG.md b/crates/atomic-file-install/CHANGELOG.md index 17f2fa7e..ec7114ec 100644 --- a/crates/atomic-file-install/CHANGELOG.md +++ b/crates/atomic-file-install/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.7](https://github.com/cargo-bins/cargo-binstall/compare/atomic-file-install-v1.0.6...atomic-file-install-v1.0.7) - 2025-01-11 + +### Other + +- *(deps)* bump the deps group with 3 updates (#2015) + ## [1.0.6](https://github.com/cargo-bins/cargo-binstall/compare/atomic-file-install-v1.0.5...atomic-file-install-v1.0.6) - 2024-11-18 ### Other diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index bf4bc839..71716a26 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "atomic-file-install" -version = "1.0.6" +version = "1.0.7" edition = "2021" description = "For atomically installing a file or a symlink." repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 49e29dfe..ff38d9ee 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,9 +22,9 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -atomic-file-install = { version = "1.0.6", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.19", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.16" } +atomic-file-install = { version = "1.0.7", path = "../atomic-file-install" } +binstalk = { path = "../binstalk", version = "0.28.20", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.17" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "5.0.1" diff --git a/crates/binstalk-bins/CHANGELOG.md b/crates/binstalk-bins/CHANGELOG.md index 54f22cf6..81f06815 100644 --- a/crates/binstalk-bins/CHANGELOG.md +++ b/crates/binstalk-bins/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.6.7](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.6...binstalk-bins-v0.6.7) - 2025-01-11 + +### Other + +- *(deps)* bump the deps group with 3 updates (#2015) + ## [0.6.6](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.5...binstalk-bins-v0.6.6) - 2024-12-14 ### Other diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index fdebedd4..f796e189 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.6.6" +version = "0.6.7" edition = "2021" description = "The binstall binaries discovery and installation crate." @@ -11,7 +11,7 @@ authors = ["Jiahao XU "] license = "GPL-3.0-only" [dependencies] -atomic-file-install = { version = "1.0.6", path = "../atomic-file-install" } +atomic-file-install = { version = "1.0.7", path = "../atomic-file-install" } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" diff --git a/crates/binstalk-downloader/CHANGELOG.md b/crates/binstalk-downloader/CHANGELOG.md index 028493fe..6567405d 100644 --- a/crates/binstalk-downloader/CHANGELOG.md +++ b/crates/binstalk-downloader/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.13.8](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.7...binstalk-downloader-v0.13.8) - 2025-01-11 + +### Other + +- *(deps)* bump the deps group with 3 updates (#2015) + ## [0.13.7](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.6...binstalk-downloader-v0.13.7) - 2025-01-04 ### Other diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 204e22f9..498446d9 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.13.7" +version = "0.13.8" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index 39bcaf2a..71226a92 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.9](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.8...binstalk-fetchers-v0.10.9) - 2025-01-11 + +### Other + +- *(deps)* bump the deps group with 3 updates (#2015) + ## [0.10.8](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.7...binstalk-fetchers-v0.10.8) - 2025-01-04 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index dbd0583e..b1ad3606 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.10.8" +version = "0.10.9" edition = "2021" description = "The binstall fetchers" @@ -12,8 +12,8 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.84" -binstalk-downloader = { version = "0.13.7", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.9", path = "../binstalk-git-repo-api" } +binstalk-downloader = { version = "0.13.8", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.10", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.5.4" [dev-dependencies] -binstalk-downloader = { version = "0.13.7", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.8", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index e8471ee5..14ad3df1 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.10](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.9...binstalk-git-repo-api-v0.5.10) - 2025-01-11 + +### Other + +- *(deps)* bump the deps group with 3 updates (#2015) + ## [0.5.9](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.8...binstalk-git-repo-api-v0.5.9) - 2025-01-04 ### Other diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index c6fcaed1..641ec4ce 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.9" +version = "0.5.10" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.13.7", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.8", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.8.0" @@ -25,6 +25,6 @@ url = "2.5.4" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.7", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.8", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index 5b5adf40..85330b57 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.17](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.16...binstalk-manifests-v0.15.17) - 2025-01-11 + +### Other + +- *(deps)* bump the deps group with 3 updates (#2015) + ## [0.15.16](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.15...binstalk-manifests-v0.15.16) - 2025-01-04 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 8306a9bf..a3ca82de 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.16" +version = "0.15.17" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.35", path = "../detect-targets" } +detect-targets = { version = "0.1.36", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md index bd2bc84c..438865ce 100644 --- a/crates/binstalk-registry/CHANGELOG.md +++ b/crates/binstalk-registry/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.9](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.8...binstalk-registry-v0.11.9) - 2025-01-11 + +### Other + +- *(deps)* bump the deps group with 3 updates (#2015) + ## [0.11.8](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.7...binstalk-registry-v0.11.8) - 2025-01-04 ### Other diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index b4ce12a9..41877cf2 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.11.8" +version = "0.11.9" edition = "2021" rust-version = "1.65.0" @@ -13,11 +13,11 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.84" base16 = "0.2.1" -binstalk-downloader = { version = "0.13.7", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.8", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } -cargo-toml-workspace = { version = "7.0.1", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "7.0.2", path = "../cargo-toml-workspace" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" @@ -40,7 +40,7 @@ url = "2.5.4" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.13.7", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.8", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index 096e4560..015ed4ba 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.20](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.19...binstalk-v0.28.20) - 2025-01-11 + +### Other + +- *(deps)* bump the deps group with 3 updates (#2015) + ## [0.28.19](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.18...binstalk-v0.28.19) - 2025-01-04 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 7cee8754..820dc07b 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,25 +3,25 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.19" +version = "0.28.20" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.6.6", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.13.7", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.9", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.10.8", path = "../binstalk-fetchers", features = [ +binstalk-bins = { version = "0.6.7", path = "../binstalk-bins" } +binstalk-downloader = { version = "0.13.8", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.10", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.10.9", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.11.8", path = "../binstalk-registry" } +binstalk-registry = { version = "0.11.9", path = "../binstalk-registry" } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } -cargo-toml-workspace = { version = "7.0.1", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "7.0.2", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.35", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.36", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/cargo-toml-workspace/CHANGELOG.md b/crates/cargo-toml-workspace/CHANGELOG.md index 83359be0..4045e486 100644 --- a/crates/cargo-toml-workspace/CHANGELOG.md +++ b/crates/cargo-toml-workspace/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [7.0.2](https://github.com/cargo-bins/cargo-binstall/compare/cargo-toml-workspace-v7.0.1...cargo-toml-workspace-v7.0.2) - 2025-01-11 + +### Other + +- *(deps)* bump the deps group with 3 updates (#2015) + ## [7.0.1](https://github.com/cargo-bins/cargo-binstall/compare/cargo-toml-workspace-v7.0.0...cargo-toml-workspace-v7.0.1) - 2024-12-14 ### Other diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 239aebd6..d8adff00 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-toml-workspace" -version = "7.0.1" +version = "7.0.2" edition = "2021" description = "Parse cargo workspace and load specific crate" repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index 3a66e7f7..0250915b 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.36](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.35...detect-targets-v0.1.36) - 2025-01-11 + +### Other + +- update Cargo.lock dependencies + ## [0.1.35](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.34...detect-targets-v0.1.35) - 2025-01-04 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index f96d4875..3bc95de6 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.35" +version = "0.1.36" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index fb9d1127..211546f9 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.19](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.18...detect-wasi-v1.0.19) - 2025-01-11 + +### Other + +- update Cargo.lock dependencies + ## [1.0.18](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.17...detect-wasi-v1.0.18) - 2025-01-04 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index 62a7861a..c289f6a7 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.18" +version = "1.0.19" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From 7bcb061e8888b85b43b5addc082de33986263fe9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 11 Jan 2025 06:31:30 +0000 Subject: [PATCH 1953/2020] release: cargo-binstall v1.10.20 (#2016) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index eb947ef9..2673f7f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -572,7 +572,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.19" +version = "1.10.20" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index ff38d9ee..05fc6ab0 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.19" +version = "1.10.20" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 697faf18..78f25689 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 9d375f94612cc3f3abe749bab41b65d5edb7665f Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sun, 12 Jan 2025 17:35:47 +1100 Subject: [PATCH 1954/2020] Reduce log version requirements back to 0.4.22 (#2020) Since new versions are yanked Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/bin/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 05fc6ab0..adbdf35d 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -30,7 +30,7 @@ compact_str = "0.8.0" dirs = "5.0.1" file-format = { version = "0.26.0", default-features = false } home = "0.5.9" -log = { version = "0.4.24", features = ["std"] } +log = { version = "0.4.22", features = ["std"] } miette = "7.0.0" mimalloc = { version = "0.1.39", default-features = false, optional = true } once_cell = "1.18.0" From 4e1592c8c6081d797c5bbe926439fbbd19f96ca0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 22:32:23 +1100 Subject: [PATCH 1955/2020] dep: Upgrade transitive dependencies (#2021) Co-authored-by: github-actions --- Cargo.lock | 218 ++++++++++------------------------------------------- 1 file changed, 40 insertions(+), 178 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2673f7f2..5d2995a7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -659,9 +659,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.7" +version = "1.2.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" +checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" dependencies = [ "jobserver", "libc", @@ -1060,16 +1060,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "erased-serde" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24e2389d65ab4fab27dc2a5de7b191e1f6617d1f1c8855c0dc569c94a4cbb18d" -dependencies = [ - "serde", - "typeid", -] - [[package]] name = "errno" version = "0.2.8" @@ -1387,7 +1377,7 @@ dependencies = [ "gix-utils", "itoa", "thiserror 2.0.11", - "winnow 0.6.22", + "winnow 0.6.24", ] [[package]] @@ -1469,7 +1459,7 @@ dependencies = [ "smallvec", "thiserror 2.0.11", "unicode-bom", - "winnow 0.6.22", + "winnow 0.6.24", ] [[package]] @@ -1717,7 +1707,7 @@ dependencies = [ "itoa", "smallvec", "thiserror 2.0.11", - "winnow 0.6.22", + "winnow 0.6.24", ] [[package]] @@ -1850,7 +1840,7 @@ dependencies = [ "gix-utils", "maybe-async", "thiserror 2.0.11", - "winnow 0.6.22", + "winnow 0.6.24", ] [[package]] @@ -1882,7 +1872,7 @@ dependencies = [ "gix-validate", "memmap2", "thiserror 2.0.11", - "winnow 0.6.22", + "winnow 0.6.24", ] [[package]] @@ -2622,9 +2612,9 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jiff" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed0ce60560149333a8e41ca7dc78799c47c5fd435e2bc18faf6a054382eec037" +checksum = "5c258647f65892e500c2478ef2c71ba008e7dc1774a8289345adbbb502a4def1" dependencies = [ "jiff-tzdb-platform", "log", @@ -2675,9 +2665,9 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6717b6b5b077764fb5966237269cb3c64edddde4b14ce42647430a78ced9e7b7" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ "once_cell", "wasm-bindgen", @@ -2781,12 +2771,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.24" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6ea2a48c204030ee31a7d7fc72c93294c92fe87ecb1789881c9543516e1a0d" -dependencies = [ - "value-bag", -] +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "loom" @@ -3405,9 +3392,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" dependencies = [ "unicode-ident", ] @@ -3589,9 +3576,9 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.21" +version = "0.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a076c8c302cbd01e62bd6c2f74fc4913c3131aa6fa72dae78047f5535e4fc88" +checksum = "0a7aea22fc8204e0f291719120cbcdae4f25f0807d7b00f5b6b27d95a8f1a2ad" dependencies = [ "cfg-if", "rustix", @@ -3760,9 +3747,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.20" +version = "0.23.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" +checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" dependencies = [ "log", "once_cell", @@ -3930,15 +3917,6 @@ dependencies = [ "syn", ] -[[package]] -name = "serde_fmt" -version = "1.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d4ddca14104cd60529e8c7f7ba71a2c8acd8f7f5cfcdc2faf97eeb7c3010a4" -dependencies = [ - "serde", -] - [[package]] name = "serde_json" version = "1.0.135" @@ -4155,84 +4133,6 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" -[[package]] -name = "sval" -version = "2.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6dc0f9830c49db20e73273ffae9b5240f63c42e515af1da1fceefb69fceafd8" - -[[package]] -name = "sval_buffer" -version = "2.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "429922f7ad43c0ef8fd7309e14d750e38899e32eb7e8da656ea169dd28ee212f" -dependencies = [ - "sval", - "sval_ref", -] - -[[package]] -name = "sval_dynamic" -version = "2.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68f16ff5d839396c11a30019b659b0976348f3803db0626f736764c473b50ff4" -dependencies = [ - "sval", -] - -[[package]] -name = "sval_fmt" -version = "2.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c01c27a80b6151b0557f9ccbe89c11db571dc5f68113690c1e028d7e974bae94" -dependencies = [ - "itoa", - "ryu", - "sval", -] - -[[package]] -name = "sval_json" -version = "2.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0deef63c70da622b2a8069d8600cf4b05396459e665862e7bdb290fd6cf3f155" -dependencies = [ - "itoa", - "ryu", - "sval", -] - -[[package]] -name = "sval_nested" -version = "2.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a39ce5976ae1feb814c35d290cf7cf8cd4f045782fe1548d6bc32e21f6156e9f" -dependencies = [ - "sval", - "sval_buffer", - "sval_ref", -] - -[[package]] -name = "sval_ref" -version = "2.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7c6ee3751795a728bc9316a092023529ffea1783499afbc5c66f5fabebb1fa" -dependencies = [ - "sval", -] - -[[package]] -name = "sval_serde" -version = "2.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a5572d0321b68109a343634e3a5d576bf131b82180c6c442dee06349dfc652a" -dependencies = [ - "serde", - "sval", - "sval_nested", -] - [[package]] name = "syn" version = "2.0.96" @@ -4578,7 +4478,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.22", + "winnow 0.6.24", ] [[package]] @@ -4689,12 +4589,6 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" -[[package]] -name = "typeid" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e13db2e0ccd5e14a544e8a246ba2312cd25223f616442d7f2cb0e3db614236e" - [[package]] name = "typenum" version = "1.17.0" @@ -4794,42 +4688,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" -[[package]] -name = "value-bag" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2" -dependencies = [ - "value-bag-serde1", - "value-bag-sval2", -] - -[[package]] -name = "value-bag-serde1" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bb773bd36fd59c7ca6e336c94454d9c66386416734817927ac93d81cb3c5b0b" -dependencies = [ - "erased-serde", - "serde", - "serde_fmt", -] - -[[package]] -name = "value-bag-sval2" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53a916a702cac43a88694c97657d449775667bcd14b70419441d05b7fea4a83a" -dependencies = [ - "sval", - "sval_buffer", - "sval_dynamic", - "sval_fmt", - "sval_json", - "sval_ref", - "sval_serde", -] - [[package]] name = "vcpkg" version = "0.2.15" @@ -4904,20 +4762,21 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a474f6281d1d70c17ae7aa6a613c87fce69a127e2624002df63dcb39d6cf6396" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f89bb38646b4f81674e8f5c3fb81b562be1fd936d84320f3264486418519c79" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", @@ -4929,9 +4788,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.49" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38176d9b44ea84e9184eff0bc34cc167ed044f816accfe5922e54d84cf48eca2" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", @@ -4942,9 +4801,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cc6181fd9a7492eef6fef1f33961e3695e4579b9872a6f7c83aee556666d4fe" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -4952,9 +4811,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", @@ -4965,9 +4824,12 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.99" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "943aab3fdaaa029a6e0271b35ea10b72b943135afe9bffca82384098ad0e06a6" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "wasm-streams" @@ -4984,9 +4846,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.76" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04dd7223427d52553d3702c004d3b2fe07c148165faa56313cb00211e31c12bc" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" dependencies = [ "js-sys", "wasm-bindgen", @@ -5427,9 +5289,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.22" +version = "0.6.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39281189af81c07ec09db316b302a3e67bf9bd7cbf6c820b50e35fee9c2fa980" +checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" dependencies = [ "memchr", ] From 33a38e49e6a61f6616c631f3227ba44924ed3539 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 23:25:42 +1100 Subject: [PATCH 1956/2020] build(deps): bump dirs from 5.0.1 to 6.0.0 in the deps group (#2022) Bumps the deps group with 1 update: [dirs](https://github.com/soc/dirs-rs). Updates `dirs` from 5.0.1 to 6.0.0 - [Commits](https://github.com/soc/dirs-rs/commits) --- updated-dependencies: - dependency-name: dirs dependency-type: direct:production update-type: version-update:semver-major dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 16 ++++++++-------- crates/bin/Cargo.toml | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5d2995a7..c8b1a794 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -966,23 +966,23 @@ dependencies = [ [[package]] name = "dirs" -version = "5.0.1" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -3565,13 +3565,13 @@ dependencies = [ [[package]] name = "redox_users" -version = "0.4.6" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" dependencies = [ "getrandom", "libredox", - "thiserror 1.0.69", + "thiserror 2.0.11", ] [[package]] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index adbdf35d..b96eca7c 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -27,7 +27,7 @@ binstalk = { path = "../binstalk", version = "0.28.20", default-features = false binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.17" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" -dirs = "5.0.1" +dirs = "6.0.0" file-format = { version = "0.26.0", default-features = false } home = "0.5.9" log = { version = "0.4.22", features = ["std"] } From 9d2dbb3dffed19d66f652bce549e7a7c59c8294a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 13:41:19 +0000 Subject: [PATCH 1957/2020] chore: release (#2023) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 20 ++++++++++---------- crates/atomic-file-install/CHANGELOG.md | 6 ++++++ crates/atomic-file-install/Cargo.toml | 2 +- crates/bin/Cargo.toml | 6 +++--- crates/binstalk-bins/CHANGELOG.md | 6 ++++++ crates/binstalk-bins/Cargo.toml | 4 ++-- crates/binstalk-downloader/CHANGELOG.md | 6 ++++++ crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/CHANGELOG.md | 6 ++++++ crates/binstalk-fetchers/Cargo.toml | 8 ++++---- crates/binstalk-git-repo-api/CHANGELOG.md | 6 ++++++ crates/binstalk-git-repo-api/Cargo.toml | 6 +++--- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk-registry/CHANGELOG.md | 6 ++++++ crates/binstalk-registry/Cargo.toml | 8 ++++---- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 16 ++++++++-------- crates/cargo-toml-workspace/CHANGELOG.md | 6 ++++++ crates/cargo-toml-workspace/Cargo.toml | 2 +- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- 22 files changed, 100 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c8b1a794..fdbfb64d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -189,7 +189,7 @@ dependencies = [ [[package]] name = "atomic-file-install" -version = "1.0.7" +version = "1.0.8" dependencies = [ "reflink-copy", "tempfile", @@ -256,7 +256,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.20" +version = "0.28.21" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -288,7 +288,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.6.7" +version = "0.6.8" dependencies = [ "atomic-file-install", "binstalk-types", @@ -302,7 +302,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.13.8" +version = "0.13.9" dependencies = [ "async-compression", "async-trait", @@ -338,7 +338,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.10.9" +version = "0.10.10" dependencies = [ "async-trait", "binstalk-downloader", @@ -362,7 +362,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.10" +version = "0.5.11" dependencies = [ "binstalk-downloader", "compact_str", @@ -381,7 +381,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.17" +version = "0.15.18" dependencies = [ "beef", "binstalk-types", @@ -402,7 +402,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.11.9" +version = "0.11.10" dependencies = [ "async-trait", "base16", @@ -612,7 +612,7 @@ dependencies = [ [[package]] name = "cargo-toml-workspace" -version = "7.0.2" +version = "7.0.3" dependencies = [ "cargo_toml", "compact_str", @@ -937,7 +937,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.36" +version = "0.1.37" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/atomic-file-install/CHANGELOG.md b/crates/atomic-file-install/CHANGELOG.md index ec7114ec..4e62f1b4 100644 --- a/crates/atomic-file-install/CHANGELOG.md +++ b/crates/atomic-file-install/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.8](https://github.com/cargo-bins/cargo-binstall/compare/atomic-file-install-v1.0.7...atomic-file-install-v1.0.8) - 2025-01-13 + +### Other + +- update Cargo.lock dependencies + ## [1.0.7](https://github.com/cargo-bins/cargo-binstall/compare/atomic-file-install-v1.0.6...atomic-file-install-v1.0.7) - 2025-01-11 ### Other diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index 71716a26..d7cde6a2 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "atomic-file-install" -version = "1.0.7" +version = "1.0.8" edition = "2021" description = "For atomically installing a file or a symlink." repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index b96eca7c..012b474f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,9 +22,9 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -atomic-file-install = { version = "1.0.7", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.20", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.17" } +atomic-file-install = { version = "1.0.8", path = "../atomic-file-install" } +binstalk = { path = "../binstalk", version = "0.28.21", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.18" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "6.0.0" diff --git a/crates/binstalk-bins/CHANGELOG.md b/crates/binstalk-bins/CHANGELOG.md index 81f06815..36888556 100644 --- a/crates/binstalk-bins/CHANGELOG.md +++ b/crates/binstalk-bins/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.6.8](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.7...binstalk-bins-v0.6.8) - 2025-01-13 + +### Other + +- update Cargo.lock dependencies + ## [0.6.7](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.6...binstalk-bins-v0.6.7) - 2025-01-11 ### Other diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index f796e189..4a4cbda4 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.6.7" +version = "0.6.8" edition = "2021" description = "The binstall binaries discovery and installation crate." @@ -11,7 +11,7 @@ authors = ["Jiahao XU "] license = "GPL-3.0-only" [dependencies] -atomic-file-install = { version = "1.0.7", path = "../atomic-file-install" } +atomic-file-install = { version = "1.0.8", path = "../atomic-file-install" } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" diff --git a/crates/binstalk-downloader/CHANGELOG.md b/crates/binstalk-downloader/CHANGELOG.md index 6567405d..dbf0bd67 100644 --- a/crates/binstalk-downloader/CHANGELOG.md +++ b/crates/binstalk-downloader/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.13.9](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.8...binstalk-downloader-v0.13.9) - 2025-01-13 + +### Other + +- update Cargo.lock dependencies + ## [0.13.8](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.7...binstalk-downloader-v0.13.8) - 2025-01-11 ### Other diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 498446d9..a9b9db82 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.13.8" +version = "0.13.9" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index 71226a92..cca0cb3a 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.10](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.9...binstalk-fetchers-v0.10.10) - 2025-01-13 + +### Other + +- update Cargo.lock dependencies + ## [0.10.9](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.8...binstalk-fetchers-v0.10.9) - 2025-01-11 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index b1ad3606..eae82085 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.10.9" +version = "0.10.10" edition = "2021" description = "The binstall fetchers" @@ -12,8 +12,8 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.84" -binstalk-downloader = { version = "0.13.8", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.10", path = "../binstalk-git-repo-api" } +binstalk-downloader = { version = "0.13.9", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.11", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.5.4" [dev-dependencies] -binstalk-downloader = { version = "0.13.8", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.9", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index 14ad3df1..3bdab9b7 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.11](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.10...binstalk-git-repo-api-v0.5.11) - 2025-01-13 + +### Other + +- update Cargo.lock dependencies + ## [0.5.10](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.9...binstalk-git-repo-api-v0.5.10) - 2025-01-11 ### Other diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 641ec4ce..e42b1e03 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.10" +version = "0.5.11" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.13.8", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.9", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.8.0" @@ -25,6 +25,6 @@ url = "2.5.4" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.8", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.9", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index 85330b57..aeb6dc1f 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.18](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.17...binstalk-manifests-v0.15.18) - 2025-01-13 + +### Other + +- update Cargo.lock dependencies + ## [0.15.17](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.16...binstalk-manifests-v0.15.17) - 2025-01-11 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index a3ca82de..af87cbf4 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.17" +version = "0.15.18" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.36", path = "../detect-targets" } +detect-targets = { version = "0.1.37", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md index 438865ce..9eb7fe86 100644 --- a/crates/binstalk-registry/CHANGELOG.md +++ b/crates/binstalk-registry/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.10](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.9...binstalk-registry-v0.11.10) - 2025-01-13 + +### Other + +- update Cargo.lock dependencies + ## [0.11.9](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.8...binstalk-registry-v0.11.9) - 2025-01-11 ### Other diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 41877cf2..1403c209 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.11.9" +version = "0.11.10" edition = "2021" rust-version = "1.65.0" @@ -13,11 +13,11 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.84" base16 = "0.2.1" -binstalk-downloader = { version = "0.13.8", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.9", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } -cargo-toml-workspace = { version = "7.0.2", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "7.0.3", path = "../cargo-toml-workspace" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" @@ -40,7 +40,7 @@ url = "2.5.4" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.13.8", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.9", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index 015ed4ba..ca35e68e 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.21](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.20...binstalk-v0.28.21) - 2025-01-13 + +### Other + +- update Cargo.lock dependencies + ## [0.28.20](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.19...binstalk-v0.28.20) - 2025-01-11 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 820dc07b..4293ff64 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,25 +3,25 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.20" +version = "0.28.21" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.6.7", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.13.8", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.10", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.10.9", path = "../binstalk-fetchers", features = [ +binstalk-bins = { version = "0.6.8", path = "../binstalk-bins" } +binstalk-downloader = { version = "0.13.9", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.11", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.10.10", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.11.9", path = "../binstalk-registry" } +binstalk-registry = { version = "0.11.10", path = "../binstalk-registry" } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } -cargo-toml-workspace = { version = "7.0.2", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "7.0.3", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.36", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.37", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/cargo-toml-workspace/CHANGELOG.md b/crates/cargo-toml-workspace/CHANGELOG.md index 4045e486..b9d68ecc 100644 --- a/crates/cargo-toml-workspace/CHANGELOG.md +++ b/crates/cargo-toml-workspace/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [7.0.3](https://github.com/cargo-bins/cargo-binstall/compare/cargo-toml-workspace-v7.0.2...cargo-toml-workspace-v7.0.3) - 2025-01-13 + +### Other + +- update Cargo.lock dependencies + ## [7.0.2](https://github.com/cargo-bins/cargo-binstall/compare/cargo-toml-workspace-v7.0.1...cargo-toml-workspace-v7.0.2) - 2025-01-11 ### Other diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index d8adff00..147f8d3d 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-toml-workspace" -version = "7.0.2" +version = "7.0.3" edition = "2021" description = "Parse cargo workspace and load specific crate" repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index 0250915b..ab225935 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.37](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.36...detect-targets-v0.1.37) - 2025-01-13 + +### Other + +- update Cargo.lock dependencies + ## [0.1.36](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.35...detect-targets-v0.1.36) - 2025-01-11 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 3bc95de6..bab8a590 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.36" +version = "0.1.37" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" From aa7d47ed3675669106637149ee53db50d962262a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 14:12:56 +0000 Subject: [PATCH 1958/2020] release: cargo-binstall v1.10.21 (#2024) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fdbfb64d..e127e9b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -572,7 +572,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.20" +version = "1.10.21" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 012b474f..2ea5f3ce 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.20" +version = "1.10.21" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 78f25689..4546402d 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 18b803e946fc93327e479a505dc2f5469a5b0c64 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 17 Jan 2025 07:04:51 +0000 Subject: [PATCH 1959/2020] dep: Upgrade transitive dependencies (#2026) Co-authored-by: github-actions --- Cargo.lock | 77 +++++++++++++++++++++++++++--------------------------- 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e127e9b2..32b83559 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -121,11 +121,12 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.6" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", + "once_cell", "windows-sys 0.59.0", ] @@ -218,7 +219,7 @@ dependencies = [ "addr2line", "cfg-if", "libc", - "miniz_oxide 0.8.2", + "miniz_oxide 0.8.3", "object", "rustc-demangle", "windows-targets 0.52.6", @@ -461,9 +462,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1be3f42a67d6d345ecd59f675f3f012d6974981560836e938c22b424b85ce1be" +checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" [[package]] name = "block-buffer" @@ -888,9 +889,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "0e60eed09d8c01d3cee5b7d30acb059b76614c918fa0f992e0dd6eeb10daad6f" [[package]] name = "default-net" @@ -1132,7 +1133,7 @@ checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "libz-ng-sys", - "miniz_oxide 0.8.2", + "miniz_oxide 0.8.3", ] [[package]] @@ -1468,7 +1469,7 @@ version = "0.14.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49aaeef5d98390a3bcf9dbc6440b520b793d1bf3ed99317dc407b02be995b28e" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "bstr", "gix-path", "libc", @@ -1594,7 +1595,7 @@ version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aaf69a6bec0a3581567484bf99a4003afcaf6c469fd4214352517ea355cf3435" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "bstr", "gix-features", "gix-path", @@ -1640,7 +1641,7 @@ version = "0.37.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "270645fd20556b64c8ffa1540d921b281e6994413a0ca068596f97e9367a257a" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "bstr", "filetime", "fnv", @@ -1679,7 +1680,7 @@ version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d27f830a16405386e9c83b9d5be8261fe32bbd6b3caf15bd1b284c6b2b7ef1a8" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "gix-commitgraph", "gix-date", "gix-hash", @@ -1795,7 +1796,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c472dfbe4a4e96fcf7efddcd4771c9037bb4fdea2faaabf2f4888210c75b81e" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "bstr", "gix-attributes", "gix-config-value", @@ -1925,7 +1926,7 @@ version = "0.10.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8b876ef997a955397809a2ec398d6a45b7a55b4918f2446344330f778d14fd6" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "gix-path", "libc", "windows-sys 0.52.0", @@ -2002,7 +2003,7 @@ version = "0.43.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ed47d648619e23e93f971d2bba0d10c1100e54ef95d2981d609907a8cabac89" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "gix-commitgraph", "gix-date", "gix-hash", @@ -2181,7 +2182,7 @@ checksum = "d063c0692ee669aa6d261988aa19ca5510f1cc40e4f211024f50c888499a35d7" dependencies = [ "async-recursion", "async-trait", - "bitflags 2.7.0", + "bitflags 2.8.0", "bytes", "cfg-if", "data-encoding", @@ -2612,9 +2613,9 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jiff" -version = "0.1.22" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c258647f65892e500c2478ef2c71ba008e7dc1774a8289345adbbb502a4def1" +checksum = "d2bb0c2e28117985a4d90e3bc70092bc8f226f434c7ec7e23dd9ff99c5c5721a" dependencies = [ "jiff-tzdb-platform", "log", @@ -2626,15 +2627,15 @@ dependencies = [ [[package]] name = "jiff-tzdb" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91335e575850c5c4c673b9bd467b0e025f164ca59d0564f69d0c2ee0ffad4653" +checksum = "cf2cec2f5d266af45a071ece48b1fb89f3b00b2421ac3a5fe10285a6caaa60d3" [[package]] name = "jiff-tzdb-platform" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9835f0060a626fe59f160437bc725491a6af23133ea906500027d1bd2f8f4329" +checksum = "a63c62e404e7b92979d2792352d885a7f8f83fd1d0d31eea582d77b2ceca697e" dependencies = [ "jiff-tzdb", ] @@ -2732,7 +2733,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "libc", "redox_syscall 0.5.8", ] @@ -2771,9 +2772,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" [[package]] name = "loom" @@ -2928,9 +2929,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" +checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" dependencies = [ "adler2", ] @@ -3036,7 +3037,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "cfg-if", "libc", ] @@ -3133,7 +3134,7 @@ version = "0.10.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "cfg-if", "foreign-types", "libc", @@ -3560,7 +3561,7 @@ version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", ] [[package]] @@ -3738,7 +3739,7 @@ version = "0.38.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "errno 0.3.10", "libc", "linux-raw-sys", @@ -3849,7 +3850,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -3862,7 +3863,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "core-foundation 0.10.0", "core-foundation-sys", "libc", @@ -4181,7 +4182,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.7.0", + "bitflags 2.8.0", "core-foundation 0.9.4", "system-configuration-sys 0.6.0", ] @@ -4675,18 +4676,18 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.11.1" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b913a3b5fe84142e269d63cc62b64319ccaf89b748fc31fe025177f767a756c4" +checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4" dependencies = [ "getrandom", ] [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "vcpkg" From 4c9e82a8ad826436d60c3881a4170df15a59ed6f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 19 Jan 2025 02:22:20 +0000 Subject: [PATCH 1960/2020] dep: Upgrade transitive dependencies (#2028) Co-authored-by: github-actions --- Cargo.lock | 209 +++++++++++++++++++++++++++-------------------------- 1 file changed, 105 insertions(+), 104 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 32b83559..88bb31ce 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -660,9 +660,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.9" +version = "1.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8293772165d9345bdaaa39b45b2109591e63fe5e6fbc23c6ff930a048aa310b" +checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" dependencies = [ "jobserver", "libc", @@ -1316,9 +1316,9 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gix" -version = "0.69.1" +version = "0.70.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d0eebdaecdcf405d5433a36f85e4f058cf4de48ee2604388be0dbccbaad353e" +checksum = "736f14636705f3a56ea52b553e67282519418d9a35bb1e90b3a9637a00296b68" dependencies = [ "gix-actor", "gix-attributes", @@ -1369,9 +1369,9 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.33.1" +version = "0.33.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b24171f514cef7bb4dfb72a0b06dacf609b33ba8ad2489d4c4559a03b7afb3" +checksum = "20018a1a6332e065f1fcc8305c1c932c6b8c9985edea2284b3c79dc6fa3ee4b2" dependencies = [ "bstr", "gix-date", @@ -1383,9 +1383,9 @@ dependencies = [ [[package]] name = "gix-attributes" -version = "0.23.1" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf9bf852194c0edfe699a2d36422d2c1f28f73b7c6d446c3f0ccd3ba232cadc" +checksum = "f151000bf662ef5f641eca6102d942ee31ace80f271a3ef642e99776ce6ddb38" dependencies = [ "bstr", "gix-glob", @@ -1400,27 +1400,27 @@ dependencies = [ [[package]] name = "gix-bitmap" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d48b897b4bbc881aea994b4a5bbb340a04979d7be9089791304e04a9fbc66b53" +checksum = "b1db9765c69502650da68f0804e3dc2b5f8ccc6a2d104ca6c85bc40700d37540" dependencies = [ "thiserror 2.0.11", ] [[package]] name = "gix-chunk" -version = "0.4.10" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6ffbeb3a5c0b8b84c3fe4133a6f8c82fa962f4caefe8d0762eced025d3eb4f7" +checksum = "0b1f1d8764958699dc764e3f727cef280ff4d1bd92c107bbf8acd85b30c1bd6f" dependencies = [ "thiserror 2.0.11", ] [[package]] name = "gix-command" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9405c0a56e17f8365a46870cd2c7db71323ecc8bda04b50cb746ea37bd091e90" +checksum = "cb410b84d6575db45e62025a9118bdbf4d4b099ce7575a76161e898d9ca98df1" dependencies = [ "bstr", "gix-path", @@ -1430,9 +1430,9 @@ dependencies = [ [[package]] name = "gix-commitgraph" -version = "0.25.1" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8da6591a7868fb2b6dabddea6b09988b0b05e0213f938dbaa11a03dd7a48d85" +checksum = "e23a8ec2d8a16026a10dafdb6ed51bcfd08f5d97f20fa52e200bc50cb72e4877" dependencies = [ "bstr", "gix-chunk", @@ -1444,9 +1444,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.42.0" +version = "0.43.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6649b406ca1f99cb148959cf00468b231f07950f8ec438cc0903cda563606f19" +checksum = "377c1efd2014d5d469e0b3cd2952c8097bce9828f634e04d5665383249f1d9e9" dependencies = [ "bstr", "gix-config-value", @@ -1465,9 +1465,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.10" +version = "0.14.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49aaeef5d98390a3bcf9dbc6440b520b793d1bf3ed99317dc407b02be995b28e" +checksum = "11365144ef93082f3403471dbaa94cfe4b5e72743bdb9560719a251d439f4cee" dependencies = [ "bitflags 2.8.0", "bstr", @@ -1478,9 +1478,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82a50c56b785c29a151ab4ccf74a83fe4e21d2feda0d30549504b4baed353e0a" +checksum = "cf950f9ee1690bb9c4388b5152baa8a9f41ad61e5cf1ba0ec8c207b08dab9e45" dependencies = [ "bstr", "gix-command", @@ -1507,9 +1507,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.49.0" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8e92566eccbca205a0a0f96ffb0327c061e85bc5c95abbcddfe177498aa04f6" +checksum = "62afb7f4ca0acdf4e9dad92065b2eb1bf2993bcc5014b57bc796e3a365b17c4d" dependencies = [ "bstr", "gix-hash", @@ -1519,9 +1519,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83bf6dfa4e266a4a9becb4d18fc801f92c3f7cc6c433dd86fdadbcf315ffb6ef" +checksum = "d0c2414bdf04064e0f5a5aa029dfda1e663cf9a6c4bfc8759f2d369299bb65d8" dependencies = [ "bstr", "dunce", @@ -1535,9 +1535,9 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.39.1" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d85d673f2e022a340dba4713bed77ef2cf4cd737d2f3e0f159d45e0935fd81f" +checksum = "8bfdd4838a8d42bd482c9f0cb526411d003ee94cc7c7b08afe5007329c71d554" dependencies = [ "bytes", "bytesize", @@ -1559,9 +1559,9 @@ dependencies = [ [[package]] name = "gix-filter" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d0ecdee5667f840ba20c7fe56d63f8e1dc1e6b3bfd296151fe5ef07c874790a" +checksum = "bdcc36cd7dbc63ed0ec3558645886553d1afd3cd09daa5efb9cba9cceb942bbb" dependencies = [ "bstr", "encoding_rs", @@ -1580,9 +1580,9 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b3d4fac505a621f97e5ce2c69fdc425742af00c0920363ca4074f0eb48b1db9" +checksum = "182e7fa7bfdf44ffb7cfe7451b373cdf1e00870ac9a488a49587a110c562063d" dependencies = [ "fastrand", "gix-features", @@ -1591,9 +1591,9 @@ dependencies = [ [[package]] name = "gix-glob" -version = "0.17.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aaf69a6bec0a3581567484bf99a4003afcaf6c469fd4214352517ea355cf3435" +checksum = "4e9c7249fa0a78f9b363aa58323db71e0a6161fd69860ed6f48dedf0ef3a314e" dependencies = [ "bitflags 2.8.0", "bstr", @@ -1603,9 +1603,9 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.15.1" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5eccc17194ed0e67d49285e4853307e4147e95407f91c1c3e4a13ba9f4e4ce" +checksum = "e81c5ec48649b1821b3ed066a44efb95f1a268b35c1d91295e61252539fbe9f8" dependencies = [ "faster-hex", "thiserror 2.0.11", @@ -1613,9 +1613,9 @@ dependencies = [ [[package]] name = "gix-hashtable" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ef65b256631078ef733bc5530c4e6b1c2e7d5c2830b75d4e9034ab3997d18fe" +checksum = "189130bc372accd02e0520dc5ab1cef318dcc2bc829b76ab8d84bbe90ac212d1" dependencies = [ "gix-hash", "hashbrown 0.14.5", @@ -1624,9 +1624,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6b1fb24d2a4af0aa7438e2771d60c14a80cf2c9bd55c29cf1712b841f05bb8a" +checksum = "4f529dcb80bf9855c0a7c49f0ac588df6d6952d63a63fefc254b9c869d2cdf6f" dependencies = [ "bstr", "gix-glob", @@ -1637,9 +1637,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.37.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "270645fd20556b64c8ffa1540d921b281e6994413a0ca068596f97e9367a257a" +checksum = "acd12e3626879369310fffe2ac61acc828613ef656b50c4ea984dd59d7dc85d8" dependencies = [ "bitflags 2.8.0", "bstr", @@ -1665,9 +1665,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "15.0.1" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cd3ab68a452db63d9f3ebdacb10f30dba1fa0d31ac64f4203d395ed1102d940" +checksum = "9739815270ff6940968441824d162df9433db19211ca9ba8c3fc1b50b849c642" dependencies = [ "gix-tempfile", "gix-utils", @@ -1676,9 +1676,9 @@ dependencies = [ [[package]] name = "gix-negotiate" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d27f830a16405386e9c83b9d5be8261fe32bbd6b3caf15bd1b284c6b2b7ef1a8" +checksum = "a6a8af1ef7bbe303d30b55312b7f4d33e955de43a3642ae9b7347c623d80ef80" dependencies = [ "bitflags 2.8.0", "gix-commitgraph", @@ -1692,9 +1692,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.46.1" +version = "0.47.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42d58010183ef033f31088479b4eb92b44fe341b35b62d39eb8b185573d77ea" +checksum = "ddc4b3a0044244f0fe22347fb7a79cca165e37829d668b41b85ff46a43e5fd68" dependencies = [ "bstr", "gix-actor", @@ -1713,9 +1713,9 @@ dependencies = [ [[package]] name = "gix-odb" -version = "0.66.0" +version = "0.67.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb780eceb3372ee204469478de02eaa34f6ba98247df0186337e0333de97d0ae" +checksum = "3e93457df69cd09573608ce9fa4f443fbd84bc8d15d8d83adecd471058459c1b" dependencies = [ "arc-swap", "gix-date", @@ -1734,9 +1734,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.56.0" +version = "0.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4158928929be29cae7ab97afc8e820a932071a7f39d8ba388eed2380c12c566c" +checksum = "fc13a475b3db735617017fb35f816079bf503765312d4b1913b18cf96f3fa515" dependencies = [ "clru", "gix-chunk", @@ -1755,9 +1755,9 @@ dependencies = [ [[package]] name = "gix-packetline" -version = "0.18.2" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "911aeea8b2dabeed2f775af9906152a1f0109787074daf9e64224e3892dde453" +checksum = "c7e5ae6bc3ac160a6bf44a55f5537813ca3ddb08549c0fd3e7ef699c73c439cd" dependencies = [ "bstr", "faster-hex", @@ -1767,9 +1767,9 @@ dependencies = [ [[package]] name = "gix-packetline-blocking" -version = "0.18.1" +version = "0.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce9004ce1bc00fd538b11c1ec8141a1558fb3af3d2b7ac1ac5c41881f9e42d2a" +checksum = "c1cbf8767c6abd5a6779f586702b5bcd8702380f4208219449cf1c9d0cd1e17c" dependencies = [ "bstr", "faster-hex", @@ -1779,9 +1779,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.13" +version = "0.10.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afc292ef1a51e340aeb0e720800338c805975724c1dfbd243185452efd8645b7" +checksum = "c40f12bb65a8299be0cfb90fe718e3be236b7a94b434877012980863a883a99f" dependencies = [ "bstr", "gix-trace", @@ -1792,9 +1792,9 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.8.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c472dfbe4a4e96fcf7efddcd4771c9037bb4fdea2faaabf2f4888210c75b81e" +checksum = "6430d3a686c08e9d59019806faa78c17315fe22ae73151a452195857ca02f86c" dependencies = [ "bitflags 2.8.0", "bstr", @@ -1807,9 +1807,9 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82433a19aa44688e3bde05c692870eda50b5db053df53ed5ae6d8ea594a6babd" +checksum = "79f2185958e1512b989a007509df8d61dca014aa759a22bee80cfa6c594c3b6d" dependencies = [ "gix-command", "gix-config-value", @@ -1820,9 +1820,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.47.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c84642e8b6fed7035ce9cc449593019c55b0ec1af7a5dce1ab8a0636eaaeb067" +checksum = "6c61bd61afc6b67d213241e2100394c164be421e3f7228d3521b04f48ca5ba90" dependencies = [ "bstr", "gix-credentials", @@ -1846,9 +1846,9 @@ dependencies = [ [[package]] name = "gix-quote" -version = "0.4.14" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a1e282216ec2ab2816cd57e6ed88f8009e634aec47562883c05ac8a7009a63" +checksum = "e49357fccdb0c85c0d3a3292a9f6db32d9b3535959b5471bb9624908f4a066c6" dependencies = [ "bstr", "gix-utils", @@ -1857,9 +1857,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.49.1" +version = "0.50.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a91b61776c839d0f1b7114901179afb0947aa7f4d30793ca1c56d335dfef485f" +checksum = "47adf4c5f933429f8554e95d0d92eee583cfe4b95d2bf665cd6fd4a1531ee20c" dependencies = [ "gix-actor", "gix-features", @@ -1878,9 +1878,9 @@ dependencies = [ [[package]] name = "gix-refspec" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00c056bb747868c7eb0aeb352c9f9181ab8ca3d0a2550f16470803500c6c413d" +checksum = "59650228d8f612f68e7f7a25f517fcf386c5d0d39826085492e94766858b0a90" dependencies = [ "bstr", "gix-hash", @@ -1892,9 +1892,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.31.1" +version = "0.32.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e1ddc474405a68d2ce8485705dd72fe6ce959f2f5fe718601ead5da2c8f9e7" +checksum = "3fe28bbccca55da6d66e6c6efc6bb4003c29d407afd8178380293729733e6b53" dependencies = [ "bstr", "gix-commitgraph", @@ -1907,9 +1907,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "510026fc32f456f8f067d8f37c34088b97a36b2229d88a6a5023ef179fcb109d" +checksum = "d4ecb80c235b1e9ef2b99b23a81ea50dd569a88a9eb767179793269e0e616247" dependencies = [ "gix-commitgraph", "gix-date", @@ -1922,9 +1922,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.10.10" +version = "0.10.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8b876ef997a955397809a2ec398d6a45b7a55b4918f2446344330f778d14fd6" +checksum = "d84dae13271f4313f8d60a166bf27e54c968c7c33e2ffd31c48cafe5da649875" dependencies = [ "bitflags 2.8.0", "gix-path", @@ -1934,9 +1934,9 @@ dependencies = [ [[package]] name = "gix-shallow" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88d2673242e87492cb6ff671f0c01f689061ca306c4020f137197f3abc84ce01" +checksum = "ab72543011e303e52733c85bef784603ef39632ddf47f69723def52825e35066" dependencies = [ "bstr", "gix-hash", @@ -1946,9 +1946,9 @@ dependencies = [ [[package]] name = "gix-submodule" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2455f8c0fcb6ebe2a6e83c8f522d30615d763eb2ef7a23c7d929f9476e89f5c" +checksum = "74972fe8d46ac8a09490ae1e843b4caf221c5b157c5ac17057e8e1c38417a3ac" dependencies = [ "bstr", "gix-config", @@ -1961,9 +1961,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "15.0.0" +version = "16.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2feb86ef094cc77a4a9a5afbfe5de626897351bbbd0de3cb9314baf3049adb82" +checksum = "2558f423945ef24a8328c55d1fd6db06b8376b0e7013b1bb476cc4ffdf678501" dependencies = [ "gix-fs", "libc", @@ -1974,15 +1974,15 @@ dependencies = [ [[package]] name = "gix-trace" -version = "0.1.11" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04bdde120c29f1fc23a24d3e115aeeea3d60d8e65bab92cc5f9d90d9302eb952" +checksum = "7c396a2036920c69695f760a65e7f2677267ccf483f25046977d87e4cb2665f7" [[package]] name = "gix-transport" -version = "0.44.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd04d91e507a8713cfa2318d5a85d75b36e53a40379cc7eb7634ce400ecacbaf" +checksum = "11187418489477b1b5b862ae1aedbbac77e582f2c4b0ef54280f20cfe5b964d9" dependencies = [ "base64", "bstr", @@ -1999,9 +1999,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.43.1" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed47d648619e23e93f971d2bba0d10c1100e54ef95d2981d609907a8cabac89" +checksum = "2bec70e53896586ef32a3efa7e4427b67308531ed186bb6120fb3eca0f0d61b4" dependencies = [ "bitflags 2.8.0", "gix-commitgraph", @@ -2016,9 +2016,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.28.2" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d096fb733ba6bd3f5403dba8bd72bdd8809fe2b347b57844040b8f49c93492d9" +checksum = "29218c768b53dd8f116045d87fec05b294c731a4b2bdd257eeca2084cc150b13" dependencies = [ "bstr", "gix-features", @@ -2030,9 +2030,9 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.13" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba427e3e9599508ed98a6ddf8ed05493db114564e338e41f6a996d2e4790335f" +checksum = "ff08f24e03ac8916c478c8419d7d3c33393da9bb41fa4c24455d5406aeefd35f" dependencies = [ "fastrand", "unicode-normalization", @@ -2040,9 +2040,9 @@ dependencies = [ [[package]] name = "gix-validate" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd520d09f9f585b34b32aba1d0b36ada89ab7fefb54a8ca3fe37fc482a750937" +checksum = "9eaa01c3337d885617c0a42e92823922a2aea71f4caeace6fe87002bdcadbd90" dependencies = [ "bstr", "thiserror 2.0.11", @@ -2050,9 +2050,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "756dbbe15188fa22540d5eab941f8f9cf511a5364d5aec34c88083c09f4bea13" +checksum = "6673512f7eaa57a6876adceca6978a501d6c6569a4f177767dc405f8b9778958" dependencies = [ "bstr", "gix-attributes", @@ -2069,9 +2069,9 @@ dependencies = [ [[package]] name = "gix-worktree-state" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "672a5416fae50538a0af0374bf67e0c97a932fd9e9b72f7d4bfd25355967cbe1" +checksum = "86f5e199ad5af972086683bd31d640c82cb85885515bf86d86236c73ce575bf0" dependencies = [ "bstr", "gix-features", @@ -3577,11 +3577,12 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.22" +version = "0.1.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a7aea22fc8204e0f291719120cbcdae4f25f0807d7b00f5b6b27d95a8f1a2ad" +checksum = "fbd3533fd4222b8337470456ea84d80436b4c91c53db51c372461d5f7e6eb0b4" dependencies = [ "cfg-if", + "libc", "rustix", "windows 0.59.0", ] @@ -3920,9 +3921,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.135" +version = "1.0.136" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b0d7ba2887406110130a978386c4e1befb98c674b4fba677954e4db976630d9" +checksum = "336a0c23cf42a38d9eaa7cd22c7040d04e1228a19a933890805ffd00a16437d2" dependencies = [ "itoa", "memchr", @@ -4021,9 +4022,9 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf86f3da0e36928216c9f5f6b600a381abe9c4d860d2eac2853843941e5a001c" +checksum = "08a8a45589d3c21c71abb5d84374ce14058d1acb0c1ea299660d5b494a5d95e9" dependencies = [ "compact_str", "derive_destructure2", From bd6f0c6b140f8c94b9f72fbb949221cb52ea0821 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 19 Jan 2025 02:58:41 +0000 Subject: [PATCH 1961/2020] chore: release (#2027) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 22 +++++++++++----------- crates/atomic-file-install/CHANGELOG.md | 6 ++++++ crates/atomic-file-install/Cargo.toml | 2 +- crates/bin/Cargo.toml | 6 +++--- crates/binstalk-bins/CHANGELOG.md | 6 ++++++ crates/binstalk-bins/Cargo.toml | 4 ++-- crates/binstalk-downloader/CHANGELOG.md | 6 ++++++ crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/CHANGELOG.md | 6 ++++++ crates/binstalk-fetchers/Cargo.toml | 8 ++++---- crates/binstalk-git-repo-api/CHANGELOG.md | 6 ++++++ crates/binstalk-git-repo-api/Cargo.toml | 6 +++--- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk-registry/CHANGELOG.md | 6 ++++++ crates/binstalk-registry/Cargo.toml | 8 ++++---- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 16 ++++++++-------- crates/cargo-toml-workspace/CHANGELOG.md | 6 ++++++ crates/cargo-toml-workspace/Cargo.toml | 2 +- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- 24 files changed, 108 insertions(+), 42 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 88bb31ce..90566916 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -190,7 +190,7 @@ dependencies = [ [[package]] name = "atomic-file-install" -version = "1.0.8" +version = "1.0.9" dependencies = [ "reflink-copy", "tempfile", @@ -257,7 +257,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.21" +version = "0.28.22" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -289,7 +289,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.6.8" +version = "0.6.9" dependencies = [ "atomic-file-install", "binstalk-types", @@ -303,7 +303,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.13.9" +version = "0.13.10" dependencies = [ "async-compression", "async-trait", @@ -339,7 +339,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.10.10" +version = "0.10.11" dependencies = [ "async-trait", "binstalk-downloader", @@ -363,7 +363,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.11" +version = "0.5.12" dependencies = [ "binstalk-downloader", "compact_str", @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.18" +version = "0.15.19" dependencies = [ "beef", "binstalk-types", @@ -403,7 +403,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.11.10" +version = "0.11.11" dependencies = [ "async-trait", "base16", @@ -613,7 +613,7 @@ dependencies = [ [[package]] name = "cargo-toml-workspace" -version = "7.0.3" +version = "7.0.4" dependencies = [ "cargo_toml", "compact_str", @@ -938,7 +938,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.37" +version = "0.1.38" dependencies = [ "cfg-if", "guess_host_triple", @@ -950,7 +950,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.19" +version = "1.0.20" dependencies = [ "tempfile", ] diff --git a/crates/atomic-file-install/CHANGELOG.md b/crates/atomic-file-install/CHANGELOG.md index 4e62f1b4..00f49d8d 100644 --- a/crates/atomic-file-install/CHANGELOG.md +++ b/crates/atomic-file-install/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.9](https://github.com/cargo-bins/cargo-binstall/compare/atomic-file-install-v1.0.8...atomic-file-install-v1.0.9) - 2025-01-19 + +### Other + +- update Cargo.lock dependencies + ## [1.0.8](https://github.com/cargo-bins/cargo-binstall/compare/atomic-file-install-v1.0.7...atomic-file-install-v1.0.8) - 2025-01-13 ### Other diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index d7cde6a2..70bf4af7 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "atomic-file-install" -version = "1.0.8" +version = "1.0.9" edition = "2021" description = "For atomically installing a file or a symlink." repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 2ea5f3ce..762ffcde 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,9 +22,9 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -atomic-file-install = { version = "1.0.8", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.21", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.18" } +atomic-file-install = { version = "1.0.9", path = "../atomic-file-install" } +binstalk = { path = "../binstalk", version = "0.28.22", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.19" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "6.0.0" diff --git a/crates/binstalk-bins/CHANGELOG.md b/crates/binstalk-bins/CHANGELOG.md index 36888556..7147874c 100644 --- a/crates/binstalk-bins/CHANGELOG.md +++ b/crates/binstalk-bins/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.6.9](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.8...binstalk-bins-v0.6.9) - 2025-01-19 + +### Other + +- update Cargo.lock dependencies + ## [0.6.8](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.7...binstalk-bins-v0.6.8) - 2025-01-13 ### Other diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 4a4cbda4..4b6404fc 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.6.8" +version = "0.6.9" edition = "2021" description = "The binstall binaries discovery and installation crate." @@ -11,7 +11,7 @@ authors = ["Jiahao XU "] license = "GPL-3.0-only" [dependencies] -atomic-file-install = { version = "1.0.8", path = "../atomic-file-install" } +atomic-file-install = { version = "1.0.9", path = "../atomic-file-install" } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" diff --git a/crates/binstalk-downloader/CHANGELOG.md b/crates/binstalk-downloader/CHANGELOG.md index dbf0bd67..3004fdd8 100644 --- a/crates/binstalk-downloader/CHANGELOG.md +++ b/crates/binstalk-downloader/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.13.10](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.9...binstalk-downloader-v0.13.10) - 2025-01-19 + +### Other + +- update Cargo.lock dependencies + ## [0.13.9](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.8...binstalk-downloader-v0.13.9) - 2025-01-13 ### Other diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index a9b9db82..b24c7316 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.13.9" +version = "0.13.10" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index cca0cb3a..ee3153fa 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.11](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.10...binstalk-fetchers-v0.10.11) - 2025-01-19 + +### Other + +- update Cargo.lock dependencies + ## [0.10.10](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.9...binstalk-fetchers-v0.10.10) - 2025-01-13 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index eae82085..1ba66355 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.10.10" +version = "0.10.11" edition = "2021" description = "The binstall fetchers" @@ -12,8 +12,8 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.84" -binstalk-downloader = { version = "0.13.9", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.11", path = "../binstalk-git-repo-api" } +binstalk-downloader = { version = "0.13.10", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.12", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.5.4" [dev-dependencies] -binstalk-downloader = { version = "0.13.9", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.10", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index 3bdab9b7..ebea91b1 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.12](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.11...binstalk-git-repo-api-v0.5.12) - 2025-01-19 + +### Other + +- update Cargo.lock dependencies + ## [0.5.11](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.10...binstalk-git-repo-api-v0.5.11) - 2025-01-13 ### Other diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index e42b1e03..12df6596 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.11" +version = "0.5.12" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.13.9", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.10", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.8.0" @@ -25,6 +25,6 @@ url = "2.5.4" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.9", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.10", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index aeb6dc1f..0ccda073 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.19](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.18...binstalk-manifests-v0.15.19) - 2025-01-19 + +### Other + +- update Cargo.lock dependencies + ## [0.15.18](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.17...binstalk-manifests-v0.15.18) - 2025-01-13 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index af87cbf4..75586072 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.18" +version = "0.15.19" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.37", path = "../detect-targets" } +detect-targets = { version = "0.1.38", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md index 9eb7fe86..35aea301 100644 --- a/crates/binstalk-registry/CHANGELOG.md +++ b/crates/binstalk-registry/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.11](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.10...binstalk-registry-v0.11.11) - 2025-01-19 + +### Other + +- update Cargo.lock dependencies + ## [0.11.10](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.9...binstalk-registry-v0.11.10) - 2025-01-13 ### Other diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 1403c209..76d9f0a4 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.11.10" +version = "0.11.11" edition = "2021" rust-version = "1.65.0" @@ -13,11 +13,11 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.84" base16 = "0.2.1" -binstalk-downloader = { version = "0.13.9", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.10", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } -cargo-toml-workspace = { version = "7.0.3", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "7.0.4", path = "../cargo-toml-workspace" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" @@ -40,7 +40,7 @@ url = "2.5.4" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.13.9", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.10", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index ca35e68e..cea6214d 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.22](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.21...binstalk-v0.28.22) - 2025-01-19 + +### Other + +- update Cargo.lock dependencies + ## [0.28.21](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.20...binstalk-v0.28.21) - 2025-01-13 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 4293ff64..d18d65e4 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,25 +3,25 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.21" +version = "0.28.22" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.6.8", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.13.9", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.11", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.10.10", path = "../binstalk-fetchers", features = [ +binstalk-bins = { version = "0.6.9", path = "../binstalk-bins" } +binstalk-downloader = { version = "0.13.10", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.12", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.10.11", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.11.10", path = "../binstalk-registry" } +binstalk-registry = { version = "0.11.11", path = "../binstalk-registry" } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } -cargo-toml-workspace = { version = "7.0.3", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "7.0.4", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.37", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.38", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/cargo-toml-workspace/CHANGELOG.md b/crates/cargo-toml-workspace/CHANGELOG.md index b9d68ecc..5ebea8e7 100644 --- a/crates/cargo-toml-workspace/CHANGELOG.md +++ b/crates/cargo-toml-workspace/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [7.0.4](https://github.com/cargo-bins/cargo-binstall/compare/cargo-toml-workspace-v7.0.3...cargo-toml-workspace-v7.0.4) - 2025-01-19 + +### Other + +- update Cargo.lock dependencies + ## [7.0.3](https://github.com/cargo-bins/cargo-binstall/compare/cargo-toml-workspace-v7.0.2...cargo-toml-workspace-v7.0.3) - 2025-01-13 ### Other diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 147f8d3d..0998b69b 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-toml-workspace" -version = "7.0.3" +version = "7.0.4" edition = "2021" description = "Parse cargo workspace and load specific crate" repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index ab225935..036df434 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.38](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.37...detect-targets-v0.1.38) - 2025-01-19 + +### Other + +- update Cargo.lock dependencies + ## [0.1.37](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.36...detect-targets-v0.1.37) - 2025-01-13 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index bab8a590..f8a236e5 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.37" +version = "0.1.38" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index 211546f9..11c902a1 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.20](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.19...detect-wasi-v1.0.20) - 2025-01-19 + +### Other + +- update Cargo.lock dependencies + ## [1.0.19](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.18...detect-wasi-v1.0.19) - 2025-01-11 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index c289f6a7..a4e21508 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.19" +version = "1.0.20" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From 639cca973755257a5103d314f08e37e3f861d9ab Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 19 Jan 2025 06:37:17 +0000 Subject: [PATCH 1962/2020] release: cargo-binstall v1.10.22 (#2029) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 90566916..af4c6268 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -573,7 +573,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.21" +version = "1.10.22" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 762ffcde..0a5d609b 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.21" +version = "1.10.22" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 4546402d..31e24a88 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 2b6f5de5d2bbe6592d90c12b587b999a05a8e7e6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 24 Jan 2025 07:01:51 +0000 Subject: [PATCH 1963/2020] dep: Upgrade transitive dependencies (#2030) Co-authored-by: github-actions --- Cargo.lock | 48 ++++++++++++++++++++++++------------------------ 1 file changed, 24 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index af4c6268..56bf84bc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -488,9 +488,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "4.0.1" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" +checksum = "74fa05ad7d803d413eb8380983b092cbbaf9a85f151b871360e7b00cd7060b37" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -708,9 +708,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.26" +version = "4.5.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8eb5e908ef3a6efbe1ed62520fb7287959888c88485abe072543190ecc66783" +checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796" dependencies = [ "clap_builder", "clap_derive", @@ -718,9 +718,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.26" +version = "4.5.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b01801b5fc6a0a232407abc821660c9c6d25a1cafc0d4f85f29fb8d9afc121" +checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" dependencies = [ "anstream", "anstyle", @@ -2548,9 +2548,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.0" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -2580,9 +2580,9 @@ dependencies = [ [[package]] name = "ipnet" -version = "2.10.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "is_ci" @@ -2613,9 +2613,9 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jiff" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2bb0c2e28117985a4d90e3bc70092bc8f226f434c7ec7e23dd9ff99c5c5721a" +checksum = "e58800dee30ca82a1c107c64a0effca7ccb4e6106645c0e3af40d5aaba9f5457" dependencies = [ "jiff-tzdb-platform", "log", @@ -3156,9 +3156,9 @@ dependencies = [ [[package]] name = "openssl-probe" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-src" @@ -3736,9 +3736,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.43" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ "bitflags 2.8.0", "errno 0.3.10", @@ -3883,9 +3883,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.24" +version = "1.0.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" +checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" dependencies = [ "serde", ] @@ -3921,9 +3921,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.136" +version = "1.0.137" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "336a0c23cf42a38d9eaa7cd22c7040d04e1228a19a933890805ffd00a16437d2" +checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" dependencies = [ "itoa", "memchr", @@ -4614,9 +4614,9 @@ checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "11cd88e12b17c6494200a9c1b683a04fcac9573ed74cd1b62aeb2727c5592243" [[package]] name = "unicode-linebreak" @@ -4677,9 +4677,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4" +checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b" dependencies = [ "getrandom", ] From 38b5ccd8fe3b8010301a457abe6ef78e5224daf2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 31 Jan 2025 06:46:28 +0000 Subject: [PATCH 1964/2020] dep: Upgrade transitive dependencies (#2033) Co-authored-by: github-actions --- Cargo.lock | 141 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 90 insertions(+), 51 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 56bf84bc..aa056ad4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -509,9 +509,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "byteorder" @@ -754,9 +754,9 @@ checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" [[package]] name = "cmake" -version = "0.1.52" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c682c223677e0e5b6b7f63a64b9351844c3f1b1678a68b7ee617e30fb082620e" +checksum = "e24a03c8b52922d68a1589ad61032f2c1aa5a8158d2aa0d93c6e9534944bbad6" dependencies = [ "cc", ] @@ -822,9 +822,9 @@ checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "cpufeatures" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ "libc", ] @@ -1304,10 +1304,22 @@ dependencies = [ "cfg-if", "js-sys", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "wasm-bindgen", ] +[[package]] +name = "getrandom" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.13.3+wasi-0.2.2", + "windows-targets 0.52.6", +] + [[package]] name = "gimli" version = "0.31.1" @@ -1378,7 +1390,7 @@ dependencies = [ "gix-utils", "itoa", "thiserror 2.0.11", - "winnow 0.6.24", + "winnow 0.6.26", ] [[package]] @@ -1460,7 +1472,7 @@ dependencies = [ "smallvec", "thiserror 2.0.11", "unicode-bom", - "winnow 0.6.24", + "winnow 0.6.26", ] [[package]] @@ -1708,7 +1720,7 @@ dependencies = [ "itoa", "smallvec", "thiserror 2.0.11", - "winnow 0.6.24", + "winnow 0.6.26", ] [[package]] @@ -1841,7 +1853,7 @@ dependencies = [ "gix-utils", "maybe-async", "thiserror 2.0.11", - "winnow 0.6.24", + "winnow 0.6.26", ] [[package]] @@ -1873,7 +1885,7 @@ dependencies = [ "gix-validate", "memmap2", "thiserror 2.0.11", - "winnow 0.6.24", + "winnow 0.6.26", ] [[package]] @@ -2294,9 +2306,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.9.5" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" +checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" [[package]] name = "httpdate" @@ -2312,9 +2324,9 @@ checksum = "5c3b1f728c459d27b12448862017b96ad4767b1ec2ec5e6434e99f1577f085b8" [[package]] name = "hyper" -version = "1.5.2" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" dependencies = [ "bytes", "futures-channel", @@ -2613,9 +2625,9 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jiff" -version = "0.1.26" +version = "0.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e58800dee30ca82a1c107c64a0effca7ccb4e6106645c0e3af40d5aaba9f5457" +checksum = "c607c728e28764fecde611a2764a3a5db19ae21dcec46f292244f5cc5c085a81" dependencies = [ "jiff-tzdb-platform", "log", @@ -2651,13 +2663,13 @@ dependencies = [ [[package]] name = "jobslot" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe10868679d7a24c2c67d862d0e64a342ce9aef7cdde9ce8019bd35d353d458d" +checksum = "c14ffb4145759d1032337501fb73b427c754a5f37d89dfe281dd89f48048e6ef" dependencies = [ "cfg-if", "derive_destructure2", - "getrandom", + "getrandom 0.3.1", "libc", "scopeguard", "tokio", @@ -2943,7 +2955,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] @@ -2968,9 +2980,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.12" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +checksum = "0dab59f8e050d5df8e4dd87d9206fb6f65a483e20ac9fda365ade4fab353196c" dependencies = [ "libc", "log", @@ -3130,9 +3142,9 @@ checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl" -version = "0.10.68" +version = "0.10.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" +checksum = "f5e534d133a060a3c19daec1eb3e98ec6f4685978834f2dbadfe2ec215bab64e" dependencies = [ "bitflags 2.8.0", "cfg-if", @@ -3444,7 +3456,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", - "getrandom", + "getrandom 0.2.15", "rand", "ring", "rustc-hash", @@ -3507,7 +3519,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.15", ] [[package]] @@ -3570,7 +3582,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" dependencies = [ - "getrandom", + "getrandom 0.2.15", "libredox", "thiserror 2.0.11", ] @@ -3706,7 +3718,7 @@ checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" dependencies = [ "cc", "cfg-if", - "getrandom", + "getrandom 0.2.15", "libc", "spin", "untrusted", @@ -3749,9 +3761,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.21" +version = "0.23.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f287924602bf649d949c63dc8ac8b235fa5387d394020705b80c4eb597ce5b8" +checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" dependencies = [ "log", "once_cell", @@ -3785,9 +3797,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" +checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" dependencies = [ "web-time", ] @@ -3811,9 +3823,9 @@ checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" [[package]] name = "same-file" @@ -3921,9 +3933,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.137" +version = "1.0.138" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "930cfb6e6abf99298aaad7d29abbef7a9999a9a8806a40088f55f0dcec03146b" +checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" dependencies = [ "itoa", "memchr", @@ -4222,13 +4234,13 @@ checksum = "dc12939a1c9b9d391e0b7135f72fd30508b73450753e28341fed159317582a77" [[package]] name = "tempfile" -version = "3.15.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" +checksum = "38c246215d7d24f48ae091a2902398798e05d978b24315d6efbc00ede9a8bb91" dependencies = [ "cfg-if", "fastrand", - "getrandom", + "getrandom 0.3.1", "once_cell", "rustix", "windows-sys 0.59.0", @@ -4472,15 +4484,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "02a8b472d1a3d7c18e2d61a489aee3453fd9031c33e4f55bd533f4a7adca1bee" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", - "winnow 0.6.24", + "winnow 0.7.0", ] [[package]] @@ -4614,9 +4626,9 @@ checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" [[package]] name = "unicode-ident" -version = "1.0.15" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11cd88e12b17c6494200a9c1b683a04fcac9573ed74cd1b62aeb2727c5592243" +checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" [[package]] name = "unicode-linebreak" @@ -4681,7 +4693,7 @@ version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b" dependencies = [ - "getrandom", + "getrandom 0.2.15", ] [[package]] @@ -4762,6 +4774,15 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.13.3+wasi-0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "wasm-bindgen" version = "0.2.100" @@ -4868,9 +4889,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.7" +version = "0.26.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" +checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" dependencies = [ "rustls-pki-types", ] @@ -5291,9 +5312,18 @@ dependencies = [ [[package]] name = "winnow" -version = "0.6.24" +version = "0.6.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d71a593cc5c42ad7876e2c1fda56f314f3754c084128833e64f1345ff8a03a" +checksum = "1e90edd2ac1aa278a5c4599b1d89cf03074b610800f866d4026dc199d7929a28" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e49d2d35d3fad69b39b94139037ecfb4f359f08958b9c11e7315ce770462419" dependencies = [ "memchr", ] @@ -5318,6 +5348,15 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "wit-bindgen-rt" +version = "0.33.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +dependencies = [ + "bitflags 2.8.0", +] + [[package]] name = "write16" version = "1.0.0" From f68f7698997fb442371f6d0e26d2bbc056e1f1b7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 07:25:43 +1100 Subject: [PATCH 1965/2020] build(deps): bump openssl from 0.10.69 to 0.10.70 in the cargo group (#2034) Bumps the cargo group with 1 update: [openssl](https://github.com/sfackler/rust-openssl). Updates `openssl` from 0.10.69 to 0.10.70 - [Release notes](https://github.com/sfackler/rust-openssl/releases) - [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.69...openssl-v0.10.70) --- updated-dependencies: - dependency-name: openssl dependency-type: indirect dependency-group: cargo ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index aa056ad4..b59f908a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3142,9 +3142,9 @@ checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl" -version = "0.10.69" +version = "0.10.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5e534d133a060a3c19daec1eb3e98ec6f4685978834f2dbadfe2ec215bab64e" +checksum = "61cfb4e166a8bb8c9b55c500bc2308550148ece889be90f609377e58140f42c6" dependencies = [ "bitflags 2.8.0", "cfg-if", @@ -3183,9 +3183,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.104" +version = "0.9.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +checksum = "8b22d5b84be05a8d6947c7cb71f7c849aa0f112acd4bf51c2a7c1c988ac0a9dc" dependencies = [ "cc", "libc", From 8dd91862fb61ae09d9b622206bfb74efd8bd2e99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Wed, 5 Feb 2025 00:30:31 +1300 Subject: [PATCH 1966/2020] feat(downloader): allow remote::Client to be customised (#2035) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is for usage outside of binstall itself. Sometimes it's useful to be able to specify more reqwest options, such as doing custom DNS resolution. This leaves the existing API identical but adds a couple methods that make it possible to construct a client with custom options. Signed-off-by: Félix Saparelli --- crates/binstalk-downloader/src/remote.rs | 120 +++++++++++++---------- 1 file changed, 68 insertions(+), 52 deletions(-) diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 1d1547fa..66fd365c 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -86,13 +86,17 @@ pub struct Client(Arc); #[cfg_attr(not(feature = "__tls"), allow(unused_variables, unused_mut))] impl Client { - /// * `per_millis` - The duration (in millisecond) for which at most - /// `num_request` can be sent, itcould be increased if rate-limit - /// happens. - /// * `num_request` - maximum number of requests to be processed for - /// each `per` duration. + /// Construct a new downloader client /// - /// The Client created would use at least tls 1.2 + /// * `per_millis` - The duration (in millisecond) for which at most + /// `num_request` can be sent. Increase it if rate-limit errors + /// happen. + /// * `num_request` - maximum number of requests to be processed for + /// each `per_millis` duration. + /// + /// The [`reqwest::Client`] constructed has secure defaults, such as allowing + /// only TLS v1.2 and above, and disallowing plaintext HTTP altogether. If you + /// need more control, use the `from_builder` variant. pub fn new( user_agent: impl AsRef, min_tls: Option, @@ -100,57 +104,69 @@ impl Client { num_request: NonZeroU64, certificates: impl IntoIterator, ) -> Result { - fn inner( - user_agent: &str, - min_tls: Option, - per_millis: NonZeroU16, - num_request: NonZeroU64, - certificates: &mut dyn Iterator, - ) -> Result { - let mut builder = reqwest::ClientBuilder::new() - .user_agent(user_agent) - .https_only(true) - .tcp_nodelay(false); - - #[cfg(feature = "hickory-dns")] - { - builder = builder.dns_resolver(Arc::new(TrustDnsResolver::default())); - } - - #[cfg(feature = "__tls")] - { - let tls_ver = min_tls - .map(|tls| tls.max(DEFAULT_MIN_TLS)) - .unwrap_or(DEFAULT_MIN_TLS); - - builder = builder.min_tls_version(tls_ver.into()); - - for certificate in certificates { - builder = builder.add_root_certificate(certificate.0); - } - } - - let client = builder.build()?; - - Ok(Client(Arc::new(Inner { - client: client.clone(), - service: DelayRequest::new( - num_request, - Duration::from_millis(per_millis.get() as u64), - client, - ), - }))) - } - - inner( - user_agent.as_ref(), - min_tls, + Self::from_builder( + Self::default_builder(user_agent.as_ref(), min_tls, &mut certificates.into_iter()), per_millis, num_request, - &mut certificates.into_iter(), ) } + /// Constructs a default [`reqwest::ClientBuilder`]. + /// + /// This may be used alongside [`Client::from_builder`] to start from reasonable + /// defaults, but still be able to customise the reqwest instance. Arguments are + /// as [`Client::new`], but without generic parameters. + pub fn default_builder( + user_agent: &str, + min_tls: Option, + certificates: &mut dyn Iterator, + ) -> reqwest::ClientBuilder { + let mut builder = reqwest::ClientBuilder::new() + .user_agent(user_agent) + .https_only(true) + .tcp_nodelay(false); + + #[cfg(feature = "hickory-dns")] + { + builder = builder.dns_resolver(Arc::new(TrustDnsResolver::default())); + } + + #[cfg(feature = "__tls")] + { + let tls_ver = min_tls + .map(|tls| tls.max(DEFAULT_MIN_TLS)) + .unwrap_or(DEFAULT_MIN_TLS); + + builder = builder.min_tls_version(tls_ver.into()); + + for certificate in certificates { + builder = builder.add_root_certificate(certificate.0); + } + } + + builder + } + + /// Construct a custom client from a [`reqwest::ClientBuilder`]. + /// + /// You may want to also use [`Client::default_builder`]. + pub fn from_builder( + builder: reqwest::ClientBuilder, + per_millis: NonZeroU16, + num_request: NonZeroU64, + ) -> Result { + let client = builder.build()?; + + Ok(Client(Arc::new(Inner { + client: client.clone(), + service: DelayRequest::new( + num_request, + Duration::from_millis(per_millis.get() as u64), + client, + ), + }))) + } + /// Return inner reqwest client. pub fn get_inner(&self) -> &reqwest::Client { &self.0.client From a3f88b5cbf6e02b87ff2b64a3e7ebcda513a13d7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 4 Feb 2025 21:30:08 +0000 Subject: [PATCH 1967/2020] chore: release (#2031) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 16 ++++++++-------- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-downloader/CHANGELOG.md | 6 ++++++ crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/CHANGELOG.md | 6 ++++++ crates/binstalk-fetchers/Cargo.toml | 8 ++++---- crates/binstalk-git-repo-api/CHANGELOG.md | 6 ++++++ crates/binstalk-git-repo-api/Cargo.toml | 6 +++--- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk-registry/CHANGELOG.md | 6 ++++++ crates/binstalk-registry/Cargo.toml | 6 +++--- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 12 ++++++------ crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- 18 files changed, 79 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b59f908a..ba90741a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -257,7 +257,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.22" +version = "0.28.23" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -303,7 +303,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.13.10" +version = "0.13.11" dependencies = [ "async-compression", "async-trait", @@ -339,7 +339,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.10.11" +version = "0.10.12" dependencies = [ "async-trait", "binstalk-downloader", @@ -363,7 +363,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.12" +version = "0.5.13" dependencies = [ "binstalk-downloader", "compact_str", @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.19" +version = "0.15.20" dependencies = [ "beef", "binstalk-types", @@ -403,7 +403,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.11.11" +version = "0.11.12" dependencies = [ "async-trait", "base16", @@ -938,7 +938,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.38" +version = "0.1.39" dependencies = [ "cfg-if", "guess_host_triple", @@ -950,7 +950,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.20" +version = "1.0.21" dependencies = [ "tempfile", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 0a5d609b..6d3bc23c 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,8 +23,8 @@ pkg-fmt = "zip" [dependencies] atomic-file-install = { version = "1.0.9", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.22", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.19" } +binstalk = { path = "../binstalk", version = "0.28.23", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.20" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "6.0.0" diff --git a/crates/binstalk-downloader/CHANGELOG.md b/crates/binstalk-downloader/CHANGELOG.md index 3004fdd8..722ee354 100644 --- a/crates/binstalk-downloader/CHANGELOG.md +++ b/crates/binstalk-downloader/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.13.11](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.10...binstalk-downloader-v0.13.11) - 2025-02-04 + +### Added + +- *(downloader)* allow remote::Client to be customised (#2035) + ## [0.13.10](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.9...binstalk-downloader-v0.13.10) - 2025-01-19 ### Other diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index b24c7316..2d43104d 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.13.10" +version = "0.13.11" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index ee3153fa..4d17d34c 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.12](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.11...binstalk-fetchers-v0.10.12) - 2025-02-04 + +### Other + +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.10.11](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.10...binstalk-fetchers-v0.10.11) - 2025-01-19 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 1ba66355..1469e155 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.10.11" +version = "0.10.12" edition = "2021" description = "The binstall fetchers" @@ -12,8 +12,8 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.84" -binstalk-downloader = { version = "0.13.10", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.12", path = "../binstalk-git-repo-api" } +binstalk-downloader = { version = "0.13.11", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.13", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.5.4" [dev-dependencies] -binstalk-downloader = { version = "0.13.10", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.11", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index ebea91b1..4dec5743 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.13](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.12...binstalk-git-repo-api-v0.5.13) - 2025-02-04 + +### Other + +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.5.12](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.11...binstalk-git-repo-api-v0.5.12) - 2025-01-19 ### Other diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 12df6596..b2d059cf 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.12" +version = "0.5.13" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.13.10", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.11", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.8.0" @@ -25,6 +25,6 @@ url = "2.5.4" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.10", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.11", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index 0ccda073..c997055f 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.20](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.19...binstalk-manifests-v0.15.20) - 2025-02-04 + +### Other + +- updated the following local packages: detect-targets + ## [0.15.19](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.18...binstalk-manifests-v0.15.19) - 2025-01-19 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 75586072..5d7174f9 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.19" +version = "0.15.20" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.38", path = "../detect-targets" } +detect-targets = { version = "0.1.39", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md index 35aea301..9723a0b0 100644 --- a/crates/binstalk-registry/CHANGELOG.md +++ b/crates/binstalk-registry/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.12](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.11...binstalk-registry-v0.11.12) - 2025-02-04 + +### Other + +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.11.11](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.10...binstalk-registry-v0.11.11) - 2025-01-19 ### Other diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 76d9f0a4..c8b09931 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.11.11" +version = "0.11.12" edition = "2021" rust-version = "1.65.0" @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.84" base16 = "0.2.1" -binstalk-downloader = { version = "0.13.10", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.11", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } @@ -40,7 +40,7 @@ url = "2.5.4" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.13.10", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.11", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index cea6214d..d9729852 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.23](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.22...binstalk-v0.28.23) - 2025-02-04 + +### Other + +- update Cargo.lock dependencies + ## [0.28.22](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.21...binstalk-v0.28.22) - 2025-01-19 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index d18d65e4..056ee268 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.22" +version = "0.28.23" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -11,17 +11,17 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.6.9", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.13.10", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.12", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.10.11", path = "../binstalk-fetchers", features = [ +binstalk-downloader = { version = "0.13.11", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.13", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.10.12", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.11.11", path = "../binstalk-registry" } +binstalk-registry = { version = "0.11.12", path = "../binstalk-registry" } binstalk-types = { version = "0.9.2", path = "../binstalk-types" } cargo-toml-workspace = { version = "7.0.4", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.38", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.39", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index 036df434..6b6bc0c6 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.39](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.38...detect-targets-v0.1.39) - 2025-02-04 + +### Other + +- update Cargo.lock dependencies + ## [0.1.38](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.37...detect-targets-v0.1.38) - 2025-01-19 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index f8a236e5..29527246 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.38" +version = "0.1.39" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index 11c902a1..bf7757bb 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.21](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.20...detect-wasi-v1.0.21) - 2025-02-04 + +### Other + +- update Cargo.lock dependencies + ## [1.0.20](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.19...detect-wasi-v1.0.20) - 2025-01-19 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index a4e21508..546c7e58 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.20" +version = "1.0.21" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From 7918038770c58d230f8c403f39f99d86c5007229 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 8 Feb 2025 21:45:39 +1100 Subject: [PATCH 1968/2020] dep: Upgrade transitive dependencies (#2039) Co-authored-by: github-actions --- Cargo.lock | 64 +++++++++++++++++++++++++++--------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ba90741a..7b26783b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -179,9 +179,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.85" +version = "0.1.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f934833b4b7233644e5848f235df3f57ed8c80f1528a26c3dfa13d2147fa056" +checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" dependencies = [ "proc-macro2", "quote", @@ -521,9 +521,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.9.0" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" [[package]] name = "bytesize" @@ -660,9 +660,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.10" +version = "1.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13208fcbb66eaeffe09b99fffbe1af420f00a7b35aa99ad683dfc1aa76145229" +checksum = "c7777341816418c02e033934a09f20dc0ccaf65a5201ef8a450ae0105a573fda" dependencies = [ "jobserver", "libc", @@ -708,9 +708,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.27" +version = "4.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "769b0145982b4b48713e01ec42d61614425f27b7058bda7180a3a41f30104796" +checksum = "3e77c3243bd94243c03672cb5154667347c457ca271254724f9f393aee1c05ff" dependencies = [ "clap_builder", "clap_derive", @@ -730,9 +730,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.24" +version = "4.5.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54b755194d6389280185988721fffba69495eed5ee9feeee9a599b53db80318c" +checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" dependencies = [ "heck", "proc-macro2", @@ -2625,9 +2625,9 @@ checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" [[package]] name = "jiff" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c607c728e28764fecde611a2764a3a5db19ae21dcec46f292244f5cc5c085a81" +checksum = "c04ef77ae73f3cf50510712722f0c4e8b46f5aaa1bf5ffad2ae213e6495e78e5" dependencies = [ "jiff-tzdb-platform", "log", @@ -2880,9 +2880,9 @@ dependencies = [ [[package]] name = "miette" -version = "7.4.0" +version = "7.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "317f146e2eb7021892722af37cf1b971f0a70c8406f487e24952667616192c64" +checksum = "1a955165f87b37fd1862df2a59547ac542c77ef6d17c666f619d1ad22dd89484" dependencies = [ "backtrace", "backtrace-ext", @@ -2900,9 +2900,9 @@ dependencies = [ [[package]] name = "miette-derive" -version = "7.4.0" +version = "7.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23c9b935fbe1d6cbd1dac857b54a688145e2d93f48db36010514d0f612d0ad67" +checksum = "bf45bf44ab49be92fd1227a3be6fc6f617f1a337c06af54981048574d8783147" dependencies = [ "proc-macro2", "quote", @@ -3136,9 +3136,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.2" +version = "1.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" [[package]] name = "openssl" @@ -3733,9 +3733,9 @@ checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" -version = "2.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fb8039b3032c191086b10f11f319a6e99e1e82889c5cc6046f515c9db1d497" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" [[package]] name = "rustc_version" @@ -4149,9 +4149,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.96" +version = "2.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5d0adab1ae378d7f53bdebc67a39f1f151407ef230f0ce2883572f5d8985c80" +checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" dependencies = [ "proc-macro2", "quote", @@ -4228,9 +4228,9 @@ checksum = "7b2093cf4c8eb1e67749a6762251bc9cd836b6fc171623bd0a9d324d37af2417" [[package]] name = "target-lexicon" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc12939a1c9b9d391e0b7135f72fd30508b73450753e28341fed159317582a77" +checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" [[package]] name = "tempfile" @@ -4463,9 +4463,9 @@ dependencies = [ [[package]] name = "toml" -version = "0.8.19" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" +checksum = "cd87a5cdd6ffab733b2f74bc4fd7ee5fff6634124999ac278c35fc78c6120148" dependencies = [ "serde", "serde_spanned", @@ -4492,7 +4492,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.7.0", + "winnow 0.7.1", ] [[package]] @@ -4689,11 +4689,11 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.12.1" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b" +checksum = "ced87ca4be083373936a67f8de945faa23b6b42384bd5b64434850802c6dccd0" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.3.1", ] [[package]] @@ -5321,9 +5321,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e49d2d35d3fad69b39b94139037ecfb4f359f08958b9c11e7315ce770462419" +checksum = "86e376c75f4f43f44db463cf729e0d3acbf954d13e22c51e26e4c264b4ab545f" dependencies = [ "memchr", ] From 9b8ba9902d4338ea8e1fe70d4318f70aa6c5d519 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 11 Feb 2025 20:54:04 +1100 Subject: [PATCH 1969/2020] Upgrade hickory-resolver to 0.25.0-alpha.5 (#2038) * Upgrade hickory-resolver to 0.25.0-alpha.5 Update dependencies Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix compilation for hickory-resolver Cleanup use of removed feature Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix resolver.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Pin hickory-resolver to avoid breakage Cargo considers 0.25.0-alpha.* to be compatible while they can contain breaking changes between alpha versions. Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/binstalk-downloader/Cargo.toml | 3 +-- crates/binstalk-downloader/src/remote/resolver.rs | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 2d43104d..df5d8493 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -61,7 +61,7 @@ tokio = { version = "1.35.0", features = [ tokio-tar = "0.3.0" tokio-util = { version = "0.7.8", features = ["io"] } tracing = "0.1.39" -hickory-resolver = { version = "0.25.0-alpha.3", optional = true, features = [ +hickory-resolver = { version = "=0.25.0-alpha.5", optional = true, features = [ "dnssec-ring", ] } once_cell = { version = "1.18.0", optional = true } @@ -111,7 +111,6 @@ native-tls = [ "__tls", "native-tls-crate", "reqwest/native-tls", - "hickory-resolver?/dns-over-native-tls", ] # Enable hickory-resolver so that features on it will also be enabled. diff --git a/crates/binstalk-downloader/src/remote/resolver.rs b/crates/binstalk-downloader/src/remote/resolver.rs index 4a7b64bc..5982d309 100644 --- a/crates/binstalk-downloader/src/remote/resolver.rs +++ b/crates/binstalk-downloader/src/remote/resolver.rs @@ -2,7 +2,7 @@ use std::{net::SocketAddr, sync::Arc}; use hickory_resolver::{ config::{LookupIpStrategy, ResolverConfig, ResolverOpts}, - system_conf, TokioAsyncResolver, + system_conf, TokioResolver as TokioAsyncResolver, }; use once_cell::sync::OnceCell; use reqwest::dns::{Addrs, Name, Resolve, Resolving}; @@ -50,8 +50,6 @@ fn get_configs() -> Result<(ResolverConfig, ResolverOpts), BoxError> { protocol, tls_dns_name: None, trust_negative_responses: false, - #[cfg(feature = "rustls")] - tls_config: None, bind_addr: None, http_endpoint: None, }) From 8c130934bf64851359d1194da3b4416ce3905bef Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 10:20:00 +0000 Subject: [PATCH 1970/2020] dep: Upgrade transitive dependencies (#2043) Co-authored-by: github-actions --- Cargo.lock | 105 +++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 77 insertions(+), 28 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 7b26783b..adb6e173 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -32,7 +32,7 @@ dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -527,9 +527,9 @@ checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" [[package]] name = "bytesize" -version = "1.3.0" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e368af43e418a04d52505cf3dbc23dda4e3407ae2fa99fd0e4f308ce546acc" +checksum = "2d2c12f985c78475a6b8d629afd0c360260ef34cfef52efccdcfd31972f81c2e" [[package]] name = "bzip2" @@ -754,9 +754,9 @@ checksum = "cbd0f76e066e64fdc5631e3bb46381254deab9ef1158292f27c8c57e3bf3fe59" [[package]] name = "cmake" -version = "0.1.53" +version = "0.1.54" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e24a03c8b52922d68a1589ad61032f2c1aa5a8158d2aa0d93c6e9534944bbad6" +checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0" dependencies = [ "cc", ] @@ -889,9 +889,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.7.0" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e60eed09d8c01d3cee5b7d30acb059b76614c918fa0f992e0dd6eeb10daad6f" +checksum = "575f75dfd25738df5b91b8e43e14d44bda14637a58fae779fd2b064f8bf3e010" [[package]] name = "default-net" @@ -2188,9 +2188,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hickory-proto" -version = "0.25.0-alpha.4" +version = "0.25.0-alpha.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d063c0692ee669aa6d261988aa19ca5510f1cc40e4f211024f50c888499a35d7" +checksum = "1d00147af6310f4392a31680db52a3ed45a2e0f68eb18e8c3fe5537ecc96d9e2" dependencies = [ "async-recursion", "async-trait", @@ -2208,18 +2208,17 @@ dependencies = [ "http", "idna", "ipnet", - "native-tls", "once_cell", "pin-project-lite", "quinn", - "rand", + "rand 0.9.0", "ring", "rustls", + "rustls-pki-types", "thiserror 2.0.11", "time", "tinyvec", "tokio", - "tokio-native-tls", "tokio-rustls", "tracing", "url", @@ -2227,9 +2226,9 @@ dependencies = [ [[package]] name = "hickory-resolver" -version = "0.25.0-alpha.4" +version = "0.25.0-alpha.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42bc352e4412fb657e795f79b4efcf2bd60b59ee5ca0187f3554194cd1107a27" +checksum = "5762f69ebdbd4ddb2e975cd24690bf21fe6b2604039189c26acddbc427f12887" dependencies = [ "cfg-if", "futures-util", @@ -2239,13 +2238,12 @@ dependencies = [ "once_cell", "parking_lot", "quinn", - "rand", + "rand 0.9.0", "resolv-conf", "rustls", "smallvec", "thiserror 2.0.11", "tokio", - "tokio-native-tls", "tokio-rustls", "tracing", ] @@ -3300,7 +3298,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d" dependencies = [ "phf_shared", - "rand", + "rand 0.8.5", ] [[package]] @@ -3368,7 +3366,7 @@ version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" dependencies = [ - "zerocopy", + "zerocopy 0.7.35", ] [[package]] @@ -3457,7 +3455,7 @@ checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" dependencies = [ "bytes", "getrandom 0.2.15", - "rand", + "rand 0.8.5", "ring", "rustc-hash", "rustls", @@ -3499,8 +3497,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.0", + "zerocopy 0.8.17", ] [[package]] @@ -3510,7 +3519,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[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 0.9.0", ] [[package]] @@ -3522,6 +3541,16 @@ dependencies = [ "getrandom 0.2.15", ] +[[package]] +name = "rand_core" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b08f3c9802962f7e1b25113931d94f43ed9725bebc59db9d0c3e9a23b67e15ff" +dependencies = [ + "getrandom 0.3.1", + "zerocopy 0.8.17", +] + [[package]] name = "rc-zip" version = "5.2.0" @@ -4484,15 +4513,15 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.22.23" +version = "0.22.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02a8b472d1a3d7c18e2d61a489aee3453fd9031c33e4f55bd533f4a7adca1bee" +checksum = "17b4795ff5edd201c7cd6dca065ae59972ce77d1b80fa0a84d94950ece7d1474" dependencies = [ "indexmap", "serde", "serde_spanned", "toml_datetime", - "winnow 0.7.1", + "winnow 0.7.2", ] [[package]] @@ -5321,9 +5350,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.1" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86e376c75f4f43f44db463cf729e0d3acbf954d13e22c51e26e4c264b4ab545f" +checksum = "59690dea168f2198d1a3b0cac23b8063efcd11012f10ae4698f284808c8ef603" dependencies = [ "memchr", ] @@ -5420,7 +5449,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ "byteorder", - "zerocopy-derive", + "zerocopy-derive 0.7.35", +] + +[[package]] +name = "zerocopy" +version = "0.8.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa91407dacce3a68c56de03abe2760159582b846c6a4acd2f456618087f12713" +dependencies = [ + "zerocopy-derive 0.8.17", ] [[package]] @@ -5434,6 +5472,17 @@ dependencies = [ "syn", ] +[[package]] +name = "zerocopy-derive" +version = "0.8.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06718a168365cad3d5ff0bb133aad346959a2074bd4a85c121255a11304a8626" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "zerofrom" version = "0.1.5" From 04a243ff8f3d144e704fc1d844241e7a0d57dc33 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 22:03:28 +1100 Subject: [PATCH 1971/2020] build(deps): bump the deps group with 2 updates (#2044) Bumps the deps group with 2 updates: [strum](https://github.com/Peternator7/strum) and [strum_macros](https://github.com/Peternator7/strum). Updates `strum` from 0.26.3 to 0.27.0 - [Release notes](https://github.com/Peternator7/strum/releases) - [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md) - [Commits](https://github.com/Peternator7/strum/compare/v0.26.3...v0.27.0) Updates `strum_macros` from 0.26.4 to 0.27.0 - [Release notes](https://github.com/Peternator7/strum/releases) - [Changelog](https://github.com/Peternator7/strum/blob/master/CHANGELOG.md) - [Commits](https://github.com/Peternator7/strum/commits/v0.27.0) --- updated-dependencies: - dependency-name: strum dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: strum_macros dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 4 ++-- crates/binstalk/Cargo.toml | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index adb6e173..d063f034 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4132,15 +4132,15 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.26.3" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" +checksum = "ce1475c515a4f03a8a7129bb5228b81a781a86cb0b3fbbc19e1c556d491a401f" [[package]] name = "strum_macros" -version = "0.26.4" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6bee85a5a24955dc440386795aa378cd9cf82acd5f764469152d2270e581be" +checksum = "9688894b43459159c82bfa5a5fa0435c19cbe3c9b427fa1dd7b1ce0c279b18a7" dependencies = [ "heck", "proc-macro2", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 6d3bc23c..904482f8 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -35,8 +35,8 @@ miette = "7.0.0" mimalloc = { version = "0.1.39", default-features = false, optional = true } once_cell = "1.18.0" semver = "1.0.17" -strum = "0.26.1" -strum_macros = "0.26.1" +strum = "0.27.0" +strum_macros = "0.27.0" supports-color = "3.0.0" tempfile = "3.5.0" tokio = { version = "1.35.0", features = ["rt-multi-thread", "signal"], default-features = false } diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 1469e155..516fa538 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -24,7 +24,7 @@ leon-macros = "1.0.1" miette = "7.0.0" minisign-verify = "0.2.1" once_cell = "1.18.0" -strum = "0.26.1" +strum = "0.27.0" thiserror = "2.0.11" tokio = { version = "1.35.0", features = [ "rt", diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index d87c983f..0ccc82f8 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -15,8 +15,8 @@ maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.18.0" semver = { version = "1.0.17", features = ["serde"] } serde = { version = "1.0.163", features = ["derive"] } -strum = "0.26.1" -strum_macros = "0.26.1" +strum = "0.27.0" +strum_macros = "0.27.0" url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 056ee268..be5e83dc 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -32,7 +32,7 @@ maybe-owned = "0.3.4" miette = "7.0.0" semver = { version = "1.0.17", features = ["serde"] } simple-git = { version = "0.2.10", optional = true } -strum = "0.26.1" +strum = "0.27.0" target-lexicon = { version = "0.13.0", features = ["std"] } tempfile = "3.5.0" thiserror = "2.0.11" From 8a18d5f024963e18773fb688ffe18bd38307cd64 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 11 Feb 2025 16:10:36 +0000 Subject: [PATCH 1972/2020] chore: release (#2040) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 20 ++++++++++---------- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-bins/CHANGELOG.md | 6 ++++++ crates/binstalk-bins/Cargo.toml | 4 ++-- crates/binstalk-downloader/CHANGELOG.md | 6 ++++++ crates/binstalk-downloader/Cargo.toml | 4 ++-- crates/binstalk-fetchers/CHANGELOG.md | 6 ++++++ crates/binstalk-fetchers/Cargo.toml | 10 +++++----- crates/binstalk-git-repo-api/CHANGELOG.md | 6 ++++++ crates/binstalk-git-repo-api/Cargo.toml | 6 +++--- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 6 +++--- crates/binstalk-registry/CHANGELOG.md | 6 ++++++ crates/binstalk-registry/Cargo.toml | 8 ++++---- crates/binstalk-types/CHANGELOG.md | 6 ++++++ crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 16 ++++++++-------- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- 22 files changed, 102 insertions(+), 42 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d063f034..986e5a11 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -257,7 +257,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.23" +version = "0.28.24" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -289,7 +289,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.6.9" +version = "0.6.10" dependencies = [ "atomic-file-install", "binstalk-types", @@ -303,7 +303,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.13.11" +version = "0.13.12" dependencies = [ "async-compression", "async-trait", @@ -339,7 +339,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.10.12" +version = "0.10.13" dependencies = [ "async-trait", "binstalk-downloader", @@ -363,7 +363,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.13" +version = "0.5.14" dependencies = [ "binstalk-downloader", "compact_str", @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.20" +version = "0.15.21" dependencies = [ "beef", "binstalk-types", @@ -403,7 +403,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.11.12" +version = "0.11.13" dependencies = [ "async-trait", "base16", @@ -430,7 +430,7 @@ dependencies = [ [[package]] name = "binstalk-types" -version = "0.9.2" +version = "0.9.3" dependencies = [ "compact_str", "maybe-owned", @@ -938,7 +938,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.39" +version = "0.1.40" dependencies = [ "cfg-if", "guess_host_triple", @@ -950,7 +950,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.21" +version = "1.0.22" dependencies = [ "tempfile", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 904482f8..bb9d7d7c 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,8 +23,8 @@ pkg-fmt = "zip" [dependencies] atomic-file-install = { version = "1.0.9", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.23", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.20" } +binstalk = { path = "../binstalk", version = "0.28.24", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.21" } clap = { version = "4.5.3", features = ["derive", "env"] } compact_str = "0.8.0" dirs = "6.0.0" diff --git a/crates/binstalk-bins/CHANGELOG.md b/crates/binstalk-bins/CHANGELOG.md index 7147874c..604d8169 100644 --- a/crates/binstalk-bins/CHANGELOG.md +++ b/crates/binstalk-bins/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.6.10](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.9...binstalk-bins-v0.6.10) - 2025-02-11 + +### Other + +- updated the following local packages: binstalk-types + ## [0.6.9](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.8...binstalk-bins-v0.6.9) - 2025-01-19 ### Other diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 4b6404fc..2a031d35 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.6.9" +version = "0.6.10" edition = "2021" description = "The binstall binaries discovery and installation crate." @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] atomic-file-install = { version = "1.0.9", path = "../atomic-file-install" } -binstalk-types = { version = "0.9.2", path = "../binstalk-types" } +binstalk-types = { version = "0.9.3", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" diff --git a/crates/binstalk-downloader/CHANGELOG.md b/crates/binstalk-downloader/CHANGELOG.md index 722ee354..cac56050 100644 --- a/crates/binstalk-downloader/CHANGELOG.md +++ b/crates/binstalk-downloader/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.13.12](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.11...binstalk-downloader-v0.13.12) - 2025-02-11 + +### Other + +- Upgrade hickory-resolver to 0.25.0-alpha.5 ([#2038](https://github.com/cargo-bins/cargo-binstall/pull/2038)) + ## [0.13.11](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.10...binstalk-downloader-v0.13.11) - 2025-02-04 ### Added diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index df5d8493..43def914 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.13.11" +version = "0.13.12" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -18,7 +18,7 @@ async-compression = { version = "0.4.4", features = [ "bzip2", "tokio", ] } -binstalk-types = { version = "0.9.2", path = "../binstalk-types" } +binstalk-types = { version = "0.9.3", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = "0.5.0" cfg-if = "1" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index 4d17d34c..1785b909 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.13](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.12...binstalk-fetchers-v0.10.13) - 2025-02-11 + +### Other + +- *(deps)* bump the deps group with 2 updates (#2044) + ## [0.10.12](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.11...binstalk-fetchers-v0.10.12) - 2025-02-04 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 516fa538..cb89c0a9 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.10.12" +version = "0.10.13" edition = "2021" description = "The binstall fetchers" @@ -12,9 +12,9 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.84" -binstalk-downloader = { version = "0.13.11", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.13", path = "../binstalk-git-repo-api" } -binstalk-types = { version = "0.9.2", path = "../binstalk-types" } +binstalk-downloader = { version = "0.13.12", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.14", path = "../binstalk-git-repo-api" } +binstalk-types = { version = "0.9.3", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } either = "1.11.0" @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.5.4" [dev-dependencies] -binstalk-downloader = { version = "0.13.11", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.12", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index 4dec5743..98b0b784 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.14](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.13...binstalk-git-repo-api-v0.5.14) - 2025-02-11 + +### Other + +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.5.13](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.12...binstalk-git-repo-api-v0.5.13) - 2025-02-04 ### Other diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index b2d059cf..82094b50 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.13" +version = "0.5.14" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.13.11", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.12", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.8.0" @@ -25,6 +25,6 @@ url = "2.5.4" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.11", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.12", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index c997055f..6ef39745 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.21](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.20...binstalk-manifests-v0.15.21) - 2025-02-11 + +### Other + +- updated the following local packages: binstalk-types, detect-targets + ## [0.15.20](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.19...binstalk-manifests-v0.15.20) - 2025-02-04 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 5d7174f9..8699903d 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.20" +version = "0.15.21" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] beef = { version = "0.5.2", features = ["impl_serde"] } -binstalk-types = { version = "0.9.2", path = "../binstalk-types" } +binstalk-types = { version = "0.9.3", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } fs-lock = { version = "0.1.7", path = "../fs-lock" } home = "0.5.9" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.39", path = "../detect-targets" } +detect-targets = { version = "0.1.40", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md index 9723a0b0..5fd11fe5 100644 --- a/crates/binstalk-registry/CHANGELOG.md +++ b/crates/binstalk-registry/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.13](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.12...binstalk-registry-v0.11.13) - 2025-02-11 + +### Other + +- updated the following local packages: binstalk-types, binstalk-downloader, binstalk-downloader + ## [0.11.12](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.11...binstalk-registry-v0.11.12) - 2025-02-04 ### Other diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index c8b09931..ebf3db5c 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.11.12" +version = "0.11.13" edition = "2021" rust-version = "1.65.0" @@ -13,10 +13,10 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.84" base16 = "0.2.1" -binstalk-downloader = { version = "0.13.11", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.12", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } -binstalk-types = { version = "0.9.2", path = "../binstalk-types" } +binstalk-types = { version = "0.9.3", path = "../binstalk-types" } cargo-toml-workspace = { version = "7.0.4", path = "../cargo-toml-workspace" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" @@ -40,7 +40,7 @@ url = "2.5.4" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.13.11", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.12", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk-types/CHANGELOG.md b/crates/binstalk-types/CHANGELOG.md index b512eccc..0f52cad8 100644 --- a/crates/binstalk-types/CHANGELOG.md +++ b/crates/binstalk-types/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.9.3](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-types-v0.9.2...binstalk-types-v0.9.3) - 2025-02-11 + +### Other + +- *(deps)* bump the deps group with 2 updates (#2044) + ## [0.9.2](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-types-v0.9.1...binstalk-types-v0.9.2) - 2024-11-23 ### Other diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 0ccc82f8..3c9f3272 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-types" description = "The binstall toolkit that contains basic types for binstalk crates" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-types" -version = "0.9.2" +version = "0.9.3" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index d9729852..d5be4588 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.24](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.23...binstalk-v0.28.24) - 2025-02-11 + +### Other + +- *(deps)* bump the deps group with 2 updates (#2044) + ## [0.28.23](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.22...binstalk-v0.28.23) - 2025-02-04 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index be5e83dc..9e49411f 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,25 +3,25 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.23" +version = "0.28.24" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.6.9", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.13.11", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.13", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.10.12", path = "../binstalk-fetchers", features = [ +binstalk-bins = { version = "0.6.10", path = "../binstalk-bins" } +binstalk-downloader = { version = "0.13.12", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.14", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.10.13", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.11.12", path = "../binstalk-registry" } -binstalk-types = { version = "0.9.2", path = "../binstalk-types" } +binstalk-registry = { version = "0.11.13", path = "../binstalk-registry" } +binstalk-types = { version = "0.9.3", path = "../binstalk-types" } cargo-toml-workspace = { version = "7.0.4", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.39", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.40", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index 6b6bc0c6..221f4aae 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.40](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.39...detect-targets-v0.1.40) - 2025-02-11 + +### Other + +- update Cargo.lock dependencies + ## [0.1.39](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.38...detect-targets-v0.1.39) - 2025-02-04 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 29527246..8bb90419 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.39" +version = "0.1.40" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index bf7757bb..91debe8b 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.22](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.21...detect-wasi-v1.0.22) - 2025-02-11 + +### Other + +- update Cargo.lock dependencies + ## [1.0.21](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.20...detect-wasi-v1.0.21) - 2025-02-04 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index 546c7e58..651bcfcf 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.21" +version = "1.0.22" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From c175bb02c4d5486f22e1a9cb4186cb6097f01434 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 12 Feb 2025 00:21:51 +0000 Subject: [PATCH 1973/2020] release: cargo-binstall v1.10.23 (#2048) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 986e5a11..62a09c8f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -573,7 +573,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.22" +version = "1.10.23" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index bb9d7d7c..256bea3d 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.22" +version = "1.10.23" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 31e24a88..bef43c64 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 2c624c26f44c53d25f8b3aa34eae9732fb3906c0 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 14 Feb 2025 07:48:22 +0000 Subject: [PATCH 1974/2020] dep: Upgrade transitive dependencies (#2050) Co-authored-by: github-actions --- Cargo.lock | 46 +++++++++++++++++++--------------------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 62a09c8f..8d65f0a0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -219,7 +219,7 @@ dependencies = [ "addr2line", "cfg-if", "libc", - "miniz_oxide 0.8.3", + "miniz_oxide 0.8.4", "object", "rustc-demangle", "windows-targets 0.52.6", @@ -310,7 +310,7 @@ dependencies = [ "binstalk-types", "binstall-tar", "bytes", - "bzip2 0.5.0", + "bzip2 0.5.1", "cfg-if", "compact_str", "default-net", @@ -543,19 +543,18 @@ dependencies = [ [[package]] name = "bzip2" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bafdbf26611df8c14810e268ddceda071c297570a5fb360ceddf617fe417ef58" +checksum = "75b89e7c29231c673a61a46e722602bcd138298f6b9e81e71119693534585f5c" dependencies = [ "bzip2-sys", - "libc", ] [[package]] name = "bzip2-sys" -version = "0.1.11+1.0.8" +version = "0.1.12+1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736a955f3fa7875102d57c82b8cac37ec45224a07fd32d58f9f7a186b6cd4cdc" +checksum = "72ebc2f1a417f01e1da30ef264ee86ae31d2dcd2d603ea283d3c244a883ca2a9" dependencies = [ "cc", "libc", @@ -708,9 +707,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.28" +version = "4.5.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e77c3243bd94243c03672cb5154667347c457ca271254724f9f393aee1c05ff" +checksum = "8acebd8ad879283633b343856142139f2da2317c96b05b4dd6181c61e2480184" dependencies = [ "clap_builder", "clap_derive", @@ -718,9 +717,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.27" +version = "4.5.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b26884eb4b57140e4d2d93652abfa49498b938b3c9179f9fc487b0acc3edad7" +checksum = "f6ba32cbda51c7e1dfd49acc1457ba1a7dec5b64fe360e828acb13ca8dc9c2f9" dependencies = [ "anstream", "anstyle", @@ -1133,7 +1132,7 @@ checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "libz-ng-sys", - "miniz_oxide 0.8.3", + "miniz_oxide 0.8.4", ] [[package]] @@ -2939,9 +2938,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8402cab7aefae129c6977bb0ff1b8fd9a04eb5b51efc50a70bea51cda0c7924" +checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" dependencies = [ "adler2", ] @@ -3172,9 +3171,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-src" -version = "300.4.1+3.4.0" +version = "300.4.2+3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faa4eac4138c62414b5622d1b31c5c304f34b406b013c079c2bbc652fdd6678c" +checksum = "168ce4e058f975fe43e89d9ccf78ca668601887ae736090aacc23ae353c298e2" dependencies = [ "cc", ] @@ -3741,15 +3740,14 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.8" +version = "0.17.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "e75ec5e92c4d8aede845126adc388046234541629e76029599ed35a003c7ed24" dependencies = [ "cc", "cfg-if", "getrandom 0.2.15", "libc", - "spin", "untrusted", "windows-sys 0.52.0", ] @@ -3790,9 +3788,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.22" +version = "0.23.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb9263ab4eb695e42321db096e3b8fbd715a59b154d5c88d82db2175b681ba7" +checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" dependencies = [ "log", "once_cell", @@ -4106,12 +4104,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "spin" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" - [[package]] name = "stable_deref_trait" version = "1.2.0" From 95a981856553df4af11790213b39547af44591dd Mon Sep 17 00:00:00 2001 From: Josh McKinney Date: Fri, 14 Feb 2025 23:40:19 -0800 Subject: [PATCH 1975/2020] feat: add color and wrapping to help text (#2052) * feat: add color to help text Uses the same coloring that cargo uses to make it easier to skim read the help * fix: wrap help text * fix: shorten value placeholders in help text * fix: docs for override help text --- Cargo.lock | 12 ++++++++++ crates/bin/Cargo.toml | 5 +++-- crates/bin/src/args.rs | 50 ++++++++++++++++++++++++++++++++---------- 3 files changed, 53 insertions(+), 14 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8d65f0a0..ed1446f0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -578,6 +578,7 @@ dependencies = [ "binstalk", "binstalk-manifests", "clap", + "clap-cargo", "compact_str", "dirs", "embed-resource", @@ -715,6 +716,16 @@ dependencies = [ "clap_derive", ] +[[package]] +name = "clap-cargo" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d546f0e84ff2bfa4da1ce9b54be42285767ba39c688572ca32412a09a73851e5" +dependencies = [ + "anstyle", + "clap", +] + [[package]] name = "clap_builder" version = "4.5.29" @@ -725,6 +736,7 @@ dependencies = [ "anstyle", "clap_lex", "strsim", + "terminal_size", ] [[package]] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 256bea3d..933af024 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -25,7 +25,8 @@ pkg-fmt = "zip" atomic-file-install = { version = "1.0.9", path = "../atomic-file-install" } binstalk = { path = "../binstalk", version = "0.28.24", default-features = false } binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.21" } -clap = { version = "4.5.3", features = ["derive", "env"] } +clap = { version = "4.5.3", features = ["derive", "env", "wrap_help"] } +clap-cargo = "0.15.2" compact_str = "0.8.0" dirs = "6.0.0" file-format = { version = "0.26.0", default-features = false } @@ -40,8 +41,8 @@ strum_macros = "0.27.0" supports-color = "3.0.0" tempfile = "3.5.0" tokio = { version = "1.35.0", features = ["rt-multi-thread", "signal"], default-features = false } -tracing-core = "0.1.32" tracing = { version = "0.1.39", default-features = false } +tracing-core = "0.1.32" tracing-log = { version = "0.2.0", default-features = false } tracing-subscriber = { version = "0.3.17", features = ["fmt", "json", "ansi"], default-features = false } zeroize = "1.8.1" diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 8cf81ac7..5dc38677 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -35,6 +35,7 @@ use zeroize::Zeroizing; arg_required_else_help(true), // Avoid conflict with version_req disable_version_flag(true), + styles = clap_cargo::style::CLAP_STYLING, )] pub struct Args { /// Packages to install. @@ -66,7 +67,8 @@ pub struct Args { #[clap( help_heading = "Package selection", long = "version", - value_parser(VersionReq::parse_from_cli) + value_parser(VersionReq::parse_from_cli), + value_name = "VERSION" )] pub(crate) version_req: Option, @@ -97,7 +99,7 @@ pub struct Args { /// containing a Cargo.toml file, or the Cargo.toml file itself. /// /// This option cannot be used with `--git`. - #[clap(help_heading = "Overrides", long)] + #[clap(help_heading = "Overrides", long, value_name = "PATH")] pub(crate) manifest_path: Option, #[cfg(feature = "git")] @@ -107,14 +109,23 @@ pub struct Args { /// runs as if `--manifest-path $cloned_repo` is passed to binstall. /// /// This option cannot be used with `--manifest-path`. - #[clap(help_heading = "Overrides", long, conflicts_with("manifest_path"))] + #[clap( + help_heading = "Overrides", + long, + conflicts_with("manifest_path"), + value_name = "URL" + )] pub(crate) git: Option, - /// Override Cargo.toml package manifest bin-dir. + /// Path template for binary files in packages + /// + /// Overrides the Cargo.toml package manifest bin-dir. #[clap(help_heading = "Overrides", long)] pub(crate) bin_dir: Option, - /// Override Cargo.toml package manifest pkg-fmt. + /// Format for package downloads + /// + /// Overrides the Cargo.toml package manifest pkg-fmt. /// /// The available package formats are: /// @@ -134,8 +145,10 @@ pub struct Args { #[clap(help_heading = "Overrides", long, value_name = "PKG_FMT")] pub(crate) pkg_fmt: Option, - /// Override Cargo.toml package manifest pkg-url. - #[clap(help_heading = "Overrides", long)] + /// URL template for package downloads + /// + /// Overrides the Cargo.toml package manifest pkg-url. + #[clap(help_heading = "Overrides", long, value_name = "TEMPLATE")] pub(crate) pkg_url: Option, /// Override the rate limit duration. @@ -154,7 +167,8 @@ pub struct Args { help_heading = "Overrides", long, default_value_t = RateLimit::default(), - env = "BINSTALL_RATE_LIMIT" + env = "BINSTALL_RATE_LIMIT", + value_name = "LIMIT", )] pub(crate) rate_limit: RateLimit, @@ -185,7 +199,8 @@ pub struct Args { help_heading = "Overrides", long, value_delimiter(','), - env = "BINSTALL_DISABLE_STRATEGIES" + env = "BINSTALL_DISABLE_STRATEGIES", + value_name = "STRATEGIES" )] pub(crate) disable_strategies: Vec, @@ -207,6 +222,7 @@ pub struct Args { long, env = "BINSTALL_MAXIMUM_RESOLUTION_TIMEOUT", default_value_t = NonZeroU16::new(15).unwrap(), + value_name = "TIMEOUT" )] pub(crate) maximum_resolution_timeout: NonZeroU16, @@ -266,7 +282,7 @@ pub struct Args { /// metadata files are updated with the package information. Specifying another path here /// switches over to a "local" install, where binaries are installed at the path given, and the /// global metadata files are not updated. - #[clap(help_heading = "Options", long)] + #[clap(help_heading = "Options", long, value_name = "PATH")] pub(crate) install_path: Option, /// Install binaries with a custom cargo root. @@ -332,7 +348,12 @@ pub struct Args { /// Specify the root certificates to use for https connnections, /// in addition to default system-wide ones. - #[clap(help_heading = "Options", long, env = "BINSTALL_HTTPS_ROOT_CERTS")] + #[clap( + help_heading = "Options", + long, + env = "BINSTALL_HTTPS_ROOT_CERTS", + value_name = "PATH" + )] pub(crate) root_certificates: Vec, /// Print logs in json format to be parsable. @@ -348,7 +369,12 @@ pub struct Args { /// If none of them is present, then binstall will try to extract github /// token from `$HOME/.git-credentials` or `$HOME/.config/gh/hosts.yml` /// unless `--no-discover-github-token` is specified. - #[clap(help_heading = "Options", long, env = "GITHUB_TOKEN")] + #[clap( + help_heading = "Options", + long, + env = "GITHUB_TOKEN", + value_name = "TOKEN" + )] pub(crate) github_token: Option, /// Only install packages that are signed From cdc492db98aa38315edc60e297b8a725392370c9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 15 Feb 2025 08:22:41 +0000 Subject: [PATCH 1976/2020] chore: release (#2051) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 6 +++--- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 4 ++-- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- 8 files changed, 28 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ed1446f0..d8775e99 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -257,7 +257,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.24" +version = "0.28.25" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.21" +version = "0.15.22" dependencies = [ "beef", "binstalk-types", @@ -949,7 +949,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.40" +version = "0.1.41" dependencies = [ "cfg-if", "guess_host_triple", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 933af024..9f91be2b 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,8 +23,8 @@ pkg-fmt = "zip" [dependencies] atomic-file-install = { version = "1.0.9", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.24", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.21" } +binstalk = { path = "../binstalk", version = "0.28.25", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.22" } clap = { version = "4.5.3", features = ["derive", "env", "wrap_help"] } clap-cargo = "0.15.2" compact_str = "0.8.0" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index 6ef39745..e0e53d06 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.22](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.21...binstalk-manifests-v0.15.22) - 2025-02-15 + +### Other + +- updated the following local packages: detect-targets + ## [0.15.21](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.20...binstalk-manifests-v0.15.21) - 2025-02-11 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 8699903d..47fc7066 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.21" +version = "0.15.22" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.40", path = "../detect-targets" } +detect-targets = { version = "0.1.41", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index d5be4588..e23af4fd 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.25](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.24...binstalk-v0.28.25) - 2025-02-15 + +### Other + +- updated the following local packages: detect-targets + ## [0.28.24](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.23...binstalk-v0.28.24) - 2025-02-11 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 9e49411f..107c44a7 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.24" +version = "0.28.25" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -21,7 +21,7 @@ binstalk-types = { version = "0.9.3", path = "../binstalk-types" } cargo-toml-workspace = { version = "7.0.4", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.40", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.41", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index 221f4aae..e3430ed6 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.41](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.40...detect-targets-v0.1.41) - 2025-02-15 + +### Other + +- update Cargo.lock dependencies + ## [0.1.40](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.39...detect-targets-v0.1.40) - 2025-02-11 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 8bb90419..6391fc64 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.40" +version = "0.1.41" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" From ac0e34cc778e82d0fda528e42de57e41afd2fb1f Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 15 Feb 2025 09:20:04 +0000 Subject: [PATCH 1977/2020] release: cargo-binstall v1.11.0 (#2053) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d8775e99..a3a4b4c6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -572,7 +572,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.10.23" +version = "1.11.0" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 9f91be2b..1000f875 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.10.23" +version = "1.11.0" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index bef43c64..895f476d 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 395a586265ba67a7cf0523885aae7ac7eb34576f Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 22 Feb 2025 21:21:02 +1100 Subject: [PATCH 1978/2020] Fix fs-lock error on nightly (#2059) * Fix fs-lock error on nightly Since File::*lock* API is stablised on 1.87, it overrides fs4::fs_std::FileExt Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix other fs-lock method Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix unit-tests when no test is run Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/fs-lock/src/lib.rs | 10 +++++----- justfile | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/crates/fs-lock/src/lib.rs b/crates/fs-lock/src/lib.rs index 0a96609f..0bf20a96 100644 --- a/crates/fs-lock/src/lib.rs +++ b/crates/fs-lock/src/lib.rs @@ -19,7 +19,7 @@ impl FileLock { /// /// Note that this operation is blocking, and should not be called in async contexts. pub fn new_exclusive(file: File) -> io::Result { - file.lock_exclusive()?; + FileExt::lock_exclusive(&file)?; Ok(Self(file)) } @@ -32,7 +32,7 @@ impl FileLock { /// /// Note that this operation is blocking, and should not be called in async contexts. pub fn new_try_exclusive(file: File) -> Result)> { - match file.try_lock_exclusive() { + match FileExt::try_lock_exclusive(&file) { Ok(()) => Ok(Self(file)), Err(e) if e.raw_os_error() == fs4::lock_contended_error().raw_os_error() => { Err((file, None)) @@ -45,7 +45,7 @@ impl FileLock { /// /// Note that this operation is blocking, and should not be called in async contexts. pub fn new_shared(file: File) -> io::Result { - file.lock_shared()?; + FileExt::lock_shared(&file)?; Ok(Self(file)) } @@ -58,7 +58,7 @@ impl FileLock { /// /// Note that this operation is blocking, and should not be called in async contexts. pub fn new_try_shared(file: File) -> Result)> { - match file.try_lock_shared() { + match FileExt::try_lock_shared(&file) { Ok(()) => Ok(Self(file)), Err(e) if e.raw_os_error() == fs4::lock_contended_error().raw_os_error() => { Err((file, None)) @@ -70,7 +70,7 @@ impl FileLock { impl Drop for FileLock { fn drop(&mut self) { - let _ = self.unlock(); + let _ = FileExt::unlock(&self.0); } } diff --git a/justfile b/justfile index 291ad42a..ca2122d2 100644 --- a/justfile +++ b/justfile @@ -257,7 +257,7 @@ e2e-tests: e2e-test-live e2e-test-manifest-path e2e-test-git e2e-test-other-repo unit-tests: print-env cargo test --no-run --target {{target}} - cargo nextest run --target {{target}} {{cargo-nextest-additional-args}} + cargo nextest run --target {{target}} --no-tests=pass {{cargo-nextest-additional-args}} cargo test --doc --target {{target}} test: unit-tests build e2e-tests From 583cdc48b0f89d28241bd297ae85a4d7730acf2d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 22 Feb 2025 10:51:34 +0000 Subject: [PATCH 1979/2020] dep: Upgrade transitive dependencies (#2062) Co-authored-by: github-actions --- Cargo.lock | 170 +++++++++++++++++++++++++++-------------------------- 1 file changed, 88 insertions(+), 82 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a3a4b4c6..62b59517 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -132,9 +132,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.95" +version = "1.0.96" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" +checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4" [[package]] name = "arc-swap" @@ -219,7 +219,7 @@ dependencies = [ "addr2line", "cfg-if", "libc", - "miniz_oxide 0.8.4", + "miniz_oxide 0.8.5", "object", "rustc-demangle", "windows-targets 0.52.6", @@ -660,9 +660,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.13" +version = "1.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7777341816418c02e033934a09f20dc0ccaf65a5201ef8a450ae0105a573fda" +checksum = "c736e259eea577f443d5c86c304f9f4ae0295c43f3ba05c21f1d66b5f06001af" dependencies = [ "jobserver", "libc", @@ -708,9 +708,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.29" +version = "4.5.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acebd8ad879283633b343856142139f2da2317c96b05b4dd6181c61e2480184" +checksum = "92b7b18d71fad5313a1e320fa9897994228ce274b60faa4d694fe0ea89cd9e6d" dependencies = [ "clap_builder", "clap_derive", @@ -728,9 +728,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.29" +version = "4.5.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ba32cbda51c7e1dfd49acc1457ba1a7dec5b64fe360e828acb13ca8dc9c2f9" +checksum = "a35db2071778a7344791a4fb4f95308b5673d219dee3ae348b86642574ecc90c" dependencies = [ "anstream", "anstyle", @@ -1068,9 +1068,9 @@ dependencies = [ [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" @@ -1144,7 +1144,7 @@ checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" dependencies = [ "crc32fast", "libz-ng-sys", - "miniz_oxide 0.8.4", + "miniz_oxide 0.8.5", ] [[package]] @@ -2130,9 +2130,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccae279728d634d083c00f6099cb58f01cc99c145b84b8be2f6c74618d79922e" +checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" dependencies = [ "atomic-waker", "bytes", @@ -2756,7 +2756,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.8.0", "libc", - "redox_syscall 0.5.8", + "redox_syscall 0.5.9", ] [[package]] @@ -2793,9 +2793,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.25" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04cbf5b083de1c7e0222a7a51dbfdba1cbe1c6ab0b15e29fff3f6c077fd9cd9f" +checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" [[package]] name = "loom" @@ -2950,9 +2950,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" +checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" dependencies = [ "adler2", ] @@ -2989,9 +2989,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dab59f8e050d5df8e4dd87d9206fb6f65a483e20ac9fda365ade4fab353196c" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" dependencies = [ "libc", "log", @@ -3151,9 +3151,9 @@ checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" [[package]] name = "openssl" -version = "0.10.70" +version = "0.10.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61cfb4e166a8bb8c9b55c500bc2308550148ece889be90f609377e58140f42c6" +checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" dependencies = [ "bitflags 2.8.0", "cfg-if", @@ -3192,9 +3192,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.105" +version = "0.9.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b22d5b84be05a8d6947c7cb71f7c849aa0f112acd4bf51c2a7c1c988ac0a9dc" +checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" dependencies = [ "cc", "libc", @@ -3266,7 +3266,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.8", + "redox_syscall 0.5.9", "smallvec", "windows-targets 0.52.6", ] @@ -3480,9 +3480,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.9" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c40286217b4ba3a71d644d752e6a0b71f13f1b6a2c5311acfcbe0c2418ed904" +checksum = "e46f3055866785f6b92bc6164b76be02ca8f2eb4b002c0354b28cf4c119e5944" dependencies = [ "cfg_aliases", "libc", @@ -3519,8 +3519,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ "rand_chacha 0.9.0", - "rand_core 0.9.0", - "zerocopy 0.8.17", + "rand_core 0.9.1", + "zerocopy 0.8.20", ] [[package]] @@ -3540,7 +3540,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.0", + "rand_core 0.9.1", ] [[package]] @@ -3554,12 +3554,12 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b08f3c9802962f7e1b25113931d94f43ed9725bebc59db9d0c3e9a23b67e15ff" +checksum = "a88e0da7a2c97baa202165137c158d0a2e824ac465d13d81046727b34cb247d3" dependencies = [ "getrandom 0.3.1", - "zerocopy 0.8.17", + "zerocopy 0.8.20", ] [[package]] @@ -3609,9 +3609,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" +checksum = "82b568323e98e49e2a0899dcee453dd679fae22d69adf9b11dd508d1549b7e2f" dependencies = [ "bitflags 2.8.0", ] @@ -3752,9 +3752,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.9" +version = "0.17.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e75ec5e92c4d8aede845126adc388046234541629e76029599ed35a003c7ed24" +checksum = "d34b5020fcdea098ef7d95e9f89ec15952123a4a039badd09fabebe9e963e839" dependencies = [ "cc", "cfg-if", @@ -3943,9 +3943,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" dependencies = [ "serde_derive", ] @@ -3961,9 +3961,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.218" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" dependencies = [ "proc-macro2", "quote", @@ -3972,9 +3972,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.138" +version = "1.0.139" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" dependencies = [ "itoa", "memchr", @@ -4102,9 +4102,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" [[package]] name = "socket2" @@ -4136,15 +4136,15 @@ checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" [[package]] name = "strum" -version = "0.27.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce1475c515a4f03a8a7129bb5228b81a781a86cb0b3fbbc19e1c556d491a401f" +checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" [[package]] name = "strum_macros" -version = "0.27.0" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9688894b43459159c82bfa5a5fa0435c19cbe3c9b427fa1dd7b1ce0c279b18a7" +checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" dependencies = [ "heck", "proc-macro2", @@ -4267,9 +4267,9 @@ checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" [[package]] name = "tempfile" -version = "3.16.0" +version = "3.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38c246215d7d24f48ae091a2902398798e05d978b24315d6efbc00ede9a8bb91" +checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" dependencies = [ "cfg-if", "fastrand", @@ -4525,7 +4525,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.7.2", + "winnow 0.7.3", ] [[package]] @@ -4638,9 +4638,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "uluru" @@ -4659,9 +4659,9 @@ checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" [[package]] name = "unicode-linebreak" @@ -4722,9 +4722,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.13.1" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ced87ca4be083373936a67f8de945faa23b6b42384bd5b64434850802c6dccd0" +checksum = "93d59ca99a559661b96bf898d8fce28ed87935fd2bea9f05983c1464dd6c71b1" dependencies = [ "getrandom 0.3.1", ] @@ -4774,9 +4774,9 @@ dependencies = [ [[package]] name = "vswhom-sys" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3b17ae1f6c8a2b28506cd96d412eebf83b4a0ff2cbefeeb952f2f9dfa44ba18" +checksum = "fb067e4cbd1ff067d1df46c9194b5de0e98efd2810bbc95c5d5e5f25a3231150" dependencies = [ "cc", "libc", @@ -5025,8 +5025,8 @@ checksum = "810ce18ed2112484b0d4e15d022e5f598113e220c53e373fb31e67e21670c1ce" dependencies = [ "windows-implement 0.59.0", "windows-interface 0.59.0", - "windows-result 0.3.0", - "windows-strings 0.3.0", + "windows-result 0.3.1", + "windows-strings 0.3.1", "windows-targets 0.53.0", ] @@ -5074,6 +5074,12 @@ dependencies = [ "syn", ] +[[package]] +name = "windows-link" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" + [[package]] name = "windows-registry" version = "0.2.0" @@ -5096,11 +5102,11 @@ dependencies = [ [[package]] name = "windows-result" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d08106ce80268c4067c0571ca55a9b4e9516518eaa1a1fe9b37ca403ae1d1a34" +checksum = "06374efe858fab7e4f881500e6e86ec8bc28f9462c47e5a9941a0142ad86b189" dependencies = [ - "windows-targets 0.53.0", + "windows-link", ] [[package]] @@ -5115,11 +5121,11 @@ dependencies = [ [[package]] name = "windows-strings" -version = "0.3.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b888f919960b42ea4e11c2f408fadb55f78a9f236d5eef084103c8ce52893491" +checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" dependencies = [ - "windows-targets 0.53.0", + "windows-link", ] [[package]] @@ -5354,9 +5360,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.2" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59690dea168f2198d1a3b0cac23b8063efcd11012f10ae4698f284808c8ef603" +checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1" dependencies = [ "memchr", ] @@ -5458,11 +5464,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.17" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa91407dacce3a68c56de03abe2760159582b846c6a4acd2f456618087f12713" +checksum = "dde3bb8c68a8f3f1ed4ac9221aad6b10cece3e60a8e2ea54a6a2dec806d0084c" dependencies = [ - "zerocopy-derive 0.8.17", + "zerocopy-derive 0.8.20", ] [[package]] @@ -5478,9 +5484,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.17" +version = "0.8.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06718a168365cad3d5ff0bb133aad346959a2074bd4a85c121255a11304a8626" +checksum = "eea57037071898bf96a6da35fd626f4f27e9cee3ead2a6c703cf09d472b2e700" dependencies = [ "proc-macro2", "quote", @@ -5538,27 +5544,27 @@ dependencies = [ [[package]] name = "zstd" -version = "0.13.2" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf2b778a664581e31e389454a7072dab1647606d44f7feea22cd5abb9c9f3f9" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" dependencies = [ "zstd-safe", ] [[package]] name = "zstd-safe" -version = "7.2.1" +version = "7.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54a3ab4db68cea366acc5c897c7b4d4d1b8994a9cd6e6f841f8964566a419059" +checksum = "f3051792fbdc2e1e143244dc28c60f73d8470e93f3f9cbd0ead44da5ed802722" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.13+zstd.1.5.6" +version = "2.0.14+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38ff0f21cfee8f97d94cef41359e0c89aa6113028ab0291aa8ca0038995a95aa" +checksum = "8fb060d4926e4ac3a3ad15d864e99ceb5f343c6b34f5bd6d81ae6ed417311be5" dependencies = [ "cc", "pkg-config", From 86a7e90175653b9e643cf482ea29e6a456fdae39 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 22 Feb 2025 11:18:19 +0000 Subject: [PATCH 1980/2020] build(deps): bump windows from 0.59.0 to 0.60.0 in the deps group across 1 directory (#2063) build(deps): bump windows in the deps group across 1 directory Bumps the deps group with 1 update in the / directory: [windows](https://github.com/microsoft/windows-rs). Updates `windows` from 0.59.0 to 0.60.0 - [Release notes](https://github.com/microsoft/windows-rs/releases) - [Commits](https://github.com/microsoft/windows-rs/compare/0.59.0...0.60.0) --- updated-dependencies: - dependency-name: windows dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 57 ++++++++++++++++++++++++++- crates/atomic-file-install/Cargo.toml | 2 +- 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 62b59517..504ed8f7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -195,7 +195,7 @@ dependencies = [ "reflink-copy", "tempfile", "tracing", - "windows 0.59.0", + "windows 0.60.0", ] [[package]] @@ -4995,6 +4995,28 @@ dependencies = [ "windows-targets 0.53.0", ] +[[package]] +name = "windows" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddf874e74c7a99773e62b1c671427abf01a425e77c3d3fb9fb1e4883ea934529" +dependencies = [ + "windows-collections", + "windows-core 0.60.1", + "windows-future", + "windows-link", + "windows-numerics", +] + +[[package]] +name = "windows-collections" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5467f79cc1ba3f52ebb2ed41dbb459b8e7db636cc3429458d9a852e15bc24dec" +dependencies = [ + "windows-core 0.60.1", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -5030,6 +5052,29 @@ dependencies = [ "windows-targets 0.53.0", ] +[[package]] +name = "windows-core" +version = "0.60.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca21a92a9cae9bf4ccae5cf8368dce0837100ddf6e6d57936749e85f152f6247" +dependencies = [ + "windows-implement 0.59.0", + "windows-interface 0.59.0", + "windows-link", + "windows-result 0.3.1", + "windows-strings 0.3.1", +] + +[[package]] +name = "windows-future" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a787db4595e7eb80239b74ce8babfb1363d8e343ab072f2ffe901400c03349f0" +dependencies = [ + "windows-core 0.60.1", + "windows-link", +] + [[package]] name = "windows-implement" version = "0.58.0" @@ -5080,6 +5125,16 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" +[[package]] +name = "windows-numerics" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "005dea54e2f6499f2cee279b8f703b3cf3b5734a2d8d21867c8f44003182eeed" +dependencies = [ + "windows-core 0.60.1", + "windows-link", +] + [[package]] name = "windows-registry" version = "0.2.0" diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index 70bf4af7..99068c77 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -15,4 +15,4 @@ tempfile = "3.5.0" tracing = "0.1.39" [target.'cfg(windows)'.dependencies] -windows = { version = "0.59.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } +windows = { version = "0.60.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } From 8ee6c537e4b2fe6bbff290eca15644e3f40f9583 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sun, 23 Feb 2025 01:33:36 +1100 Subject: [PATCH 1981/2020] Log when FileLock::drop fails to unlock file (#2064) * Add optional dependency tracing to fs-lock Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Add optional logging to FileLock::drop Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Enable fs-lock/tracing in binstalk-manifest Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Add FileLock::set_file_path Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Update create_if_not_exist to return FileLock on successs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Update create_if_not_exist usage in mod binstall_crates_v1 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Simplify create_if_not_exist Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Refactor mod crates_manifests to use create_if_not_exist Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Set file path for FileLock Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Set file path for file lock in mod cargo_config Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix fs-lock impl Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Import Path in fs-lock lib.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix fs-lock lib.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix fs-lock lib.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix typo in crates_manifests.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix calling create_if_not_exist in crates_manifests.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fox fmt crates_manifests.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix fmt in lib.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/binstalk-manifests/Cargo.toml | 2 +- .../src/binstall_crates_v1.rs | 5 +- crates/binstalk-manifests/src/cargo_config.rs | 2 +- .../binstalk-manifests/src/cargo_crates_v1.rs | 8 +-- .../src/crates_manifests.rs | 9 +--- crates/binstalk-manifests/src/helpers.rs | 18 ++++--- crates/fs-lock/Cargo.toml | 1 + crates/fs-lock/src/lib.rs | 52 ++++++++++++++++--- 8 files changed, 69 insertions(+), 28 deletions(-) diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 47fc7066..f42a69d1 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" beef = { version = "0.5.2", features = ["impl_serde"] } binstalk-types = { version = "0.9.3", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } -fs-lock = { version = "0.1.7", path = "../fs-lock" } +fs-lock = { version = "0.1.7", path = "../fs-lock", features = ["tracing"] } home = "0.5.9" miette = "7.0.0" semver = { version = "1.0.17", features = ["serde"] } diff --git a/crates/binstalk-manifests/src/binstall_crates_v1.rs b/crates/binstalk-manifests/src/binstall_crates_v1.rs index e0234f77..e9282d61 100644 --- a/crates/binstalk-manifests/src/binstall_crates_v1.rs +++ b/crates/binstalk-manifests/src/binstall_crates_v1.rs @@ -43,7 +43,8 @@ where Iter: IntoIterator, Data: From, { - let mut file = FileLock::new_exclusive(create_if_not_exist(path.as_ref())?)?; + let path = path.as_ref(); + let mut file = create_if_not_exist(path)?; // Move the cursor to EOF file.seek(io::SeekFrom::End(0))?; @@ -166,7 +167,7 @@ impl Records { pub fn load_from_path(path: impl AsRef) -> Result { let mut this = Self { - file: FileLock::new_exclusive(create_if_not_exist(path.as_ref())?)?, + file: create_if_not_exist(path.as_ref())?, data: BTreeSet::default(), }; this.load_impl()?; diff --git a/crates/binstalk-manifests/src/cargo_config.rs b/crates/binstalk-manifests/src/cargo_config.rs index 6bc36d96..dc9985dc 100644 --- a/crates/binstalk-manifests/src/cargo_config.rs +++ b/crates/binstalk-manifests/src/cargo_config.rs @@ -138,7 +138,7 @@ impl Config { fn inner(path: &Path) -> Result { match File::open(path) { Ok(file) => { - let file = FileLock::new_shared(file)?; + let file = FileLock::new_shared(file)?.set_file_path(path); // Any regular file must have a parent dir Config::load_from_reader(file, path.parent().unwrap()) } diff --git a/crates/binstalk-manifests/src/cargo_crates_v1.rs b/crates/binstalk-manifests/src/cargo_crates_v1.rs index a4821285..3cf0794e 100644 --- a/crates/binstalk-manifests/src/cargo_crates_v1.rs +++ b/crates/binstalk-manifests/src/cargo_crates_v1.rs @@ -62,7 +62,8 @@ impl CratesToml<'_> { } pub fn load_from_path(path: impl AsRef) -> Result { - let file = FileLock::new_shared(File::open(path)?)?; + let path = path.as_ref(); + let file = FileLock::new_shared(File::open(path)?)?.set_file_path(path); Self::load_from_reader(file) } @@ -100,7 +101,8 @@ impl CratesToml<'_> { } pub fn write_to_path(&self, path: impl AsRef) -> Result<(), CratesTomlParseError> { - let mut file = FileLock::new_exclusive(File::create(path)?)?; + let path = path.as_ref(); + let mut file = FileLock::new_exclusive(File::create(path)?)?.set_file_path(path); self.write_to_file(&mut file) } @@ -142,7 +144,7 @@ impl CratesToml<'_> { where Iter: IntoIterator, { - let mut file = FileLock::new_exclusive(create_if_not_exist(path.as_ref())?)?; + let mut file = create_if_not_exist(path.as_ref())?; Self::append_to_file(&mut file, iter) } diff --git a/crates/binstalk-manifests/src/crates_manifests.rs b/crates/binstalk-manifests/src/crates_manifests.rs index 265e1e0d..3208b5e5 100644 --- a/crates/binstalk-manifests/src/crates_manifests.rs +++ b/crates/binstalk-manifests/src/crates_manifests.rs @@ -13,6 +13,7 @@ use crate::{ binstall_crates_v1::{Error as BinstallCratesV1Error, Records as BinstallCratesV1Records}, cargo_crates_v1::{CratesToml, CratesTomlParseError}, crate_info::CrateInfo, + helpers::create_if_not_exist, CompactString, Version, }; @@ -47,13 +48,7 @@ impl Manifests { // Read cargo_install_v1_metadata let manifest_path = cargo_roots.join(".crates.toml"); - let cargo_crates_v1 = fs::File::options() - .read(true) - .write(true) - .create(true) - .truncate(false) - .open(manifest_path) - .and_then(FileLock::new_exclusive)?; + let cargo_crates_v1 = create_if_not_exist(&manifest_path)?; Ok(Self { binstall, diff --git a/crates/binstalk-manifests/src/helpers.rs b/crates/binstalk-manifests/src/helpers.rs index 029564c9..45d55fb8 100644 --- a/crates/binstalk-manifests/src/helpers.rs +++ b/crates/binstalk-manifests/src/helpers.rs @@ -1,13 +1,15 @@ use std::{fs, io, path::Path}; -/// Returned file is readable and writable. -pub(crate) fn create_if_not_exist(path: &Path) -> io::Result { - let mut options = fs::File::options(); - options.read(true).write(true); +use fs_lock::FileLock; - options - .clone() - .create_new(true) +/// Return exclusively locked file that is readable and writable. +pub(crate) fn create_if_not_exist(path: &Path) -> io::Result { + fs::File::options() + .read(true) + .write(true) + .create(true) + .truncate(false) .open(path) - .or_else(|_| options.open(path)) + .and_then(FileLock::new_exclusive) + .map(|file_lock| file_lock.set_file_path(path)) } diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 04d36516..6306e32a 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -11,3 +11,4 @@ license = "Apache-2.0 OR MIT" [dependencies] fs4 = "0.12.0" +tracing = { version = "0.1", optional = true } diff --git a/crates/fs-lock/src/lib.rs b/crates/fs-lock/src/lib.rs index 0bf20a96..abf60873 100644 --- a/crates/fs-lock/src/lib.rs +++ b/crates/fs-lock/src/lib.rs @@ -6,22 +6,33 @@ use std::{ fs::File, io::{self, IoSlice, IoSliceMut, SeekFrom}, ops, + path::Path, }; use fs4::fs_std::FileExt; /// A locked file. #[derive(Debug)] -pub struct FileLock(File); +pub struct FileLock(File, #[cfg(feature = "tracing")] Option>); impl FileLock { + #[cfg(not(feature = "tracing"))] + fn new(file: File) -> Self { + Self(file) + } + + #[cfg(feature = "tracing")] + fn new(file: File) -> Self { + Self(file, None) + } + /// Take an exclusive lock on a [`File`]. /// /// Note that this operation is blocking, and should not be called in async contexts. pub fn new_exclusive(file: File) -> io::Result { FileExt::lock_exclusive(&file)?; - Ok(Self(file)) + Ok(Self::new(file)) } /// Try to take an exclusive lock on a [`File`]. @@ -33,7 +44,7 @@ impl FileLock { /// Note that this operation is blocking, and should not be called in async contexts. pub fn new_try_exclusive(file: File) -> Result)> { match FileExt::try_lock_exclusive(&file) { - Ok(()) => Ok(Self(file)), + Ok(()) => Ok(Self::new(file)), Err(e) if e.raw_os_error() == fs4::lock_contended_error().raw_os_error() => { Err((file, None)) } @@ -47,7 +58,7 @@ impl FileLock { pub fn new_shared(file: File) -> io::Result { FileExt::lock_shared(&file)?; - Ok(Self(file)) + Ok(Self::new(file)) } /// Try to take a shared lock on a [`File`]. @@ -59,18 +70,47 @@ impl FileLock { /// Note that this operation is blocking, and should not be called in async contexts. pub fn new_try_shared(file: File) -> Result)> { match FileExt::try_lock_shared(&file) { - Ok(()) => Ok(Self(file)), + Ok(()) => Ok(Self::new(file)), Err(e) if e.raw_os_error() == fs4::lock_contended_error().raw_os_error() => { Err((file, None)) } Err(e) => Err((file, Some(e))), } } + + /// Set path to the file for logging on unlock error, if feature tracing is enabled + pub fn set_file_path(mut self, path: impl Into>) -> Self { + #[cfg(feature = "tracing")] + { + self.1 = Some(path.into()); + } + self + } } impl Drop for FileLock { fn drop(&mut self) { - let _ = FileExt::unlock(&self.0); + let _res = FileExt::unlock(&self.0); + #[cfg(feature = "tracing")] + if let Err(err) = _res { + use std::fmt; + + struct OptionalPath<'a>(Option<&'a Path>); + impl fmt::Display for OptionalPath<'_> { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + if let Some(path) = self.0 { + fmt::Display::fmt(&path.display(), f) + } else { + Ok(()) + } + } + } + + tracing::warn!( + "Failed to unlock file{}: {err}", + OptionalPath(self.1.as_deref()), + ); + } } } From f71ab715ab4c375693866343dd9e547e0252555d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 22 Feb 2025 15:38:19 +0000 Subject: [PATCH 1982/2020] chore: release (#2061) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 15 ++++++++------- crates/atomic-file-install/CHANGELOG.md | 6 ++++++ crates/atomic-file-install/Cargo.toml | 2 +- crates/bin/Cargo.toml | 6 +++--- crates/binstalk-bins/CHANGELOG.md | 6 ++++++ crates/binstalk-bins/Cargo.toml | 4 ++-- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 6 +++--- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 6 +++--- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- crates/fs-lock/CHANGELOG.md | 7 +++++++ crates/fs-lock/Cargo.toml | 2 +- 16 files changed, 66 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 504ed8f7..a2659865 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -190,7 +190,7 @@ dependencies = [ [[package]] name = "atomic-file-install" -version = "1.0.9" +version = "1.0.10" dependencies = [ "reflink-copy", "tempfile", @@ -257,7 +257,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.25" +version = "0.28.26" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -289,7 +289,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.6.10" +version = "0.6.11" dependencies = [ "atomic-file-install", "binstalk-types", @@ -382,7 +382,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.22" +version = "0.15.23" dependencies = [ "beef", "binstalk-types", @@ -949,7 +949,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.41" +version = "0.1.42" dependencies = [ "cfg-if", "guess_host_triple", @@ -961,7 +961,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.22" +version = "1.0.23" dependencies = [ "tempfile", ] @@ -1179,9 +1179,10 @@ dependencies = [ [[package]] name = "fs-lock" -version = "0.1.7" +version = "0.1.8" dependencies = [ "fs4", + "tracing", ] [[package]] diff --git a/crates/atomic-file-install/CHANGELOG.md b/crates/atomic-file-install/CHANGELOG.md index 00f49d8d..9a0e77e4 100644 --- a/crates/atomic-file-install/CHANGELOG.md +++ b/crates/atomic-file-install/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.10](https://github.com/cargo-bins/cargo-binstall/compare/atomic-file-install-v1.0.9...atomic-file-install-v1.0.10) - 2025-02-22 + +### Other + +- *(deps)* bump windows from 0.59.0 to 0.60.0 in the deps group across 1 directory (#2063) + ## [1.0.9](https://github.com/cargo-bins/cargo-binstall/compare/atomic-file-install-v1.0.8...atomic-file-install-v1.0.9) - 2025-01-19 ### Other diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index 99068c77..7510103f 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "atomic-file-install" -version = "1.0.9" +version = "1.0.10" edition = "2021" description = "For atomically installing a file or a symlink." repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 1000f875..c44d2e24 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,9 +22,9 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -atomic-file-install = { version = "1.0.9", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.25", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.22" } +atomic-file-install = { version = "1.0.10", path = "../atomic-file-install" } +binstalk = { path = "../binstalk", version = "0.28.26", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.23" } clap = { version = "4.5.3", features = ["derive", "env", "wrap_help"] } clap-cargo = "0.15.2" compact_str = "0.8.0" diff --git a/crates/binstalk-bins/CHANGELOG.md b/crates/binstalk-bins/CHANGELOG.md index 604d8169..2e5711e7 100644 --- a/crates/binstalk-bins/CHANGELOG.md +++ b/crates/binstalk-bins/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.6.11](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.10...binstalk-bins-v0.6.11) - 2025-02-22 + +### Other + +- updated the following local packages: atomic-file-install + ## [0.6.10](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.9...binstalk-bins-v0.6.10) - 2025-02-11 ### Other diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 2a031d35..71f2ce9d 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.6.10" +version = "0.6.11" edition = "2021" description = "The binstall binaries discovery and installation crate." @@ -11,7 +11,7 @@ authors = ["Jiahao XU "] license = "GPL-3.0-only" [dependencies] -atomic-file-install = { version = "1.0.9", path = "../atomic-file-install" } +atomic-file-install = { version = "1.0.10", path = "../atomic-file-install" } binstalk-types = { version = "0.9.3", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } leon = "3.0.0" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index e0e53d06..dc8d150a 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.23](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.22...binstalk-manifests-v0.15.23) - 2025-02-22 + +### Other + +- Log when FileLock::drop fails to unlock file ([#2064](https://github.com/cargo-bins/cargo-binstall/pull/2064)) + ## [0.15.22](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.21...binstalk-manifests-v0.15.22) - 2025-02-15 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index f42a69d1..f403bf5c 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.22" +version = "0.15.23" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" beef = { version = "0.5.2", features = ["impl_serde"] } binstalk-types = { version = "0.9.3", path = "../binstalk-types" } compact_str = { version = "0.8.0", features = ["serde"] } -fs-lock = { version = "0.1.7", path = "../fs-lock", features = ["tracing"] } +fs-lock = { version = "0.1.8", path = "../fs-lock", features = ["tracing"] } home = "0.5.9" miette = "7.0.0" semver = { version = "1.0.17", features = ["serde"] } @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.41", path = "../detect-targets" } +detect-targets = { version = "0.1.42", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index e23af4fd..c5cf2526 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.26](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.25...binstalk-v0.28.26) - 2025-02-22 + +### Other + +- updated the following local packages: detect-targets + ## [0.28.25](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.24...binstalk-v0.28.25) - 2025-02-15 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 107c44a7..d32f4479 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.25" +version = "0.28.26" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.6.10", path = "../binstalk-bins" } +binstalk-bins = { version = "0.6.11", path = "../binstalk-bins" } binstalk-downloader = { version = "0.13.12", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.5.14", path = "../binstalk-git-repo-api" } binstalk-fetchers = { version = "0.10.13", path = "../binstalk-fetchers", features = [ @@ -21,7 +21,7 @@ binstalk-types = { version = "0.9.3", path = "../binstalk-types" } cargo-toml-workspace = { version = "7.0.4", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.41", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.42", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index e3430ed6..adeddc34 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.42](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.41...detect-targets-v0.1.42) - 2025-02-22 + +### Other + +- update Cargo.lock dependencies + ## [0.1.41](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.40...detect-targets-v0.1.41) - 2025-02-15 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 6391fc64..88b7511d 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.41" +version = "0.1.42" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index 91debe8b..435526a0 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.23](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.22...detect-wasi-v1.0.23) - 2025-02-22 + +### Other + +- update Cargo.lock dependencies + ## [1.0.22](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.21...detect-wasi-v1.0.22) - 2025-02-11 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index 651bcfcf..2f24e090 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.22" +version = "1.0.23" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" diff --git a/crates/fs-lock/CHANGELOG.md b/crates/fs-lock/CHANGELOG.md index 2f99c1b6..c58488df 100644 --- a/crates/fs-lock/CHANGELOG.md +++ b/crates/fs-lock/CHANGELOG.md @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.8](https://github.com/cargo-bins/cargo-binstall/compare/fs-lock-v0.1.7...fs-lock-v0.1.8) - 2025-02-22 + +### Other + +- Log when FileLock::drop fails to unlock file ([#2064](https://github.com/cargo-bins/cargo-binstall/pull/2064)) +- Fix fs-lock error on nightly ([#2059](https://github.com/cargo-bins/cargo-binstall/pull/2059)) + ## [0.1.7](https://github.com/cargo-bins/cargo-binstall/compare/fs-lock-v0.1.6...fs-lock-v0.1.7) - 2024-12-07 ### Other diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 6306e32a..7c9156e7 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -3,7 +3,7 @@ name = "fs-lock" description = "Locked files that can be used like normal File" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/fs-lock" -version = "0.1.7" +version = "0.1.8" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From 6010abb1da3dbaae07e8823fa57c0cd7cf183245 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 23 Feb 2025 01:37:27 +0000 Subject: [PATCH 1983/2020] release: cargo-binstall v1.11.1 (#2065) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a2659865..d45a4a2d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -572,7 +572,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.11.0" +version = "1.11.1" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index c44d2e24..f0b0a9fc 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.11.0" +version = "1.11.1" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 895f476d..cca2317f 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 72ddf9c3f4608c56937c04428bc5b5bd620a86a8 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 28 Feb 2025 03:49:21 +0000 Subject: [PATCH 1984/2020] dep: Upgrade transitive dependencies (#2066) Co-authored-by: github-actions --- Cargo.lock | 275 +++++++++++++++-------------------------------------- 1 file changed, 75 insertions(+), 200 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d45a4a2d..4c1b6e9c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -65,21 +65,6 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - -[[package]] -name = "android_system_properties" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" -dependencies = [ - "libc", -] - [[package]] name = "anstream" version = "0.6.18" @@ -150,12 +135,12 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "async-compression" -version = "0.4.18" +version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df895a515f70646414f4b45c0b79082783b80552b373a68283012928df56f522" +checksum = "06575e6a9673580f52661c92107baabffbf41e2141373441cbcdc47cb733003c" dependencies = [ "brotli", - "bzip2 0.4.4", + "bzip2 0.5.1", "flate2", "futures-core", "memchr", @@ -267,7 +252,7 @@ dependencies = [ "binstalk-types", "cargo-toml-workspace", "command-group", - "compact_str", + "compact_str 0.8.1", "detect-targets", "either", "itertools", @@ -293,7 +278,7 @@ version = "0.6.11" dependencies = [ "atomic-file-install", "binstalk-types", - "compact_str", + "compact_str 0.8.1", "leon", "miette", "normalize-path", @@ -312,7 +297,7 @@ dependencies = [ "bytes", "bzip2 0.5.1", "cfg-if", - "compact_str", + "compact_str 0.8.1", "default-net", "flate2", "futures-io", @@ -346,7 +331,7 @@ dependencies = [ "binstalk-git-repo-api", "binstalk-types", "bytes", - "compact_str", + "compact_str 0.8.1", "either", "itertools", "leon", @@ -366,7 +351,7 @@ name = "binstalk-git-repo-api" version = "0.5.14" dependencies = [ "binstalk-downloader", - "compact_str", + "compact_str 0.8.1", "once_cell", "percent-encoding", "serde", @@ -386,7 +371,7 @@ version = "0.15.23" dependencies = [ "beef", "binstalk-types", - "compact_str", + "compact_str 0.8.1", "detect-targets", "fs-lock", "home", @@ -410,7 +395,7 @@ dependencies = [ "binstalk-downloader", "binstalk-types", "cargo-toml-workspace", - "compact_str", + "compact_str 0.8.1", "leon", "miette", "normalize-path", @@ -432,7 +417,7 @@ dependencies = [ name = "binstalk-types" version = "0.9.3" dependencies = [ - "compact_str", + "compact_str 0.8.1", "maybe-owned", "once_cell", "semver", @@ -579,7 +564,7 @@ dependencies = [ "binstalk-manifests", "clap", "clap-cargo", - "compact_str", + "compact_str 0.8.1", "dirs", "embed-resource", "file-format", @@ -616,7 +601,7 @@ name = "cargo-toml-workspace" version = "7.0.4" dependencies = [ "cargo_toml", - "compact_str", + "compact_str 0.8.1", "glob", "normalize-path", "serde", @@ -694,23 +679,18 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e36cc9d416881d2e24f9a963be5fb1cd90966419ac844274161d10488b3e825" +checksum = "1a7964611d71df112cb1730f2ee67324fcf4d0fc6606acbbe9bfe06df124637c" dependencies = [ - "android-tzdata", - "iana-time-zone", - "js-sys", "num-traits", - "wasm-bindgen", - "windows-targets 0.52.6", ] [[package]] name = "clap" -version = "4.5.30" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92b7b18d71fad5313a1e320fa9897994228ce274b60faa4d694fe0ea89cd9e6d" +checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" dependencies = [ "clap_builder", "clap_derive", @@ -728,9 +708,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.30" +version = "4.5.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35db2071778a7344791a4fb4f95308b5673d219dee3ae348b86642574ecc90c" +checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" dependencies = [ "anstream", "anstyle", @@ -805,6 +785,20 @@ dependencies = [ "static_assertions", ] +[[package]] +name = "compact_str" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdb1325a1cece981e8a296ab8f0f9b63ae357bd0784a9faaf548cc7b480707a" +dependencies = [ + "castaway", + "cfg-if", + "itoa", + "rustversion", + "ryu", + "static_assertions", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -1027,9 +1021,9 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "either" -version = "1.13.0" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "b7914353092ddf589ad78f25c5c1c21b7f80b0ff8621e7c814c3485b5306da9d" [[package]] name = "embed-resource" @@ -1138,9 +1132,9 @@ dependencies = [ [[package]] name = "flate2" -version = "1.0.35" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c936bfdafb507ebbf50b8074c54fa31c5be9a1e7e5f467dd659697041407d07c" +checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" dependencies = [ "crc32fast", "libz-ng-sys", @@ -2406,29 +2400,6 @@ dependencies = [ "tracing", ] -[[package]] -name = "iana-time-zone" -version = "0.1.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" -dependencies = [ - "android_system_properties", - "core-foundation-sys", - "iana-time-zone-haiku", - "js-sys", - "wasm-bindgen", - "windows-core 0.52.0", -] - -[[package]] -name = "iana-time-zone-haiku" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" -dependencies = [ - "cc", -] - [[package]] name = "icu_collections" version = "1.5.0" @@ -2735,9 +2706,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.169" +version = "0.2.170" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" +checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" [[package]] name = "libmimalloc-sys" @@ -2778,9 +2749,9 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "litemap" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" [[package]] name = "lock_api" @@ -3245,9 +3216,9 @@ dependencies = [ [[package]] name = "owo-colors" -version = "4.1.0" +version = "4.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb37767f6569cd834a413442455e0f066d0d522de8630436e2a1761d9726ba56" +checksum = "1036865bb9422d3300cf723f657c2851d0e9ab12567854b1f4eba3d77decf564" [[package]] name = "parking_lot" @@ -3342,9 +3313,9 @@ checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "portable-atomic" -version = "1.10.0" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "280dc24453071f1b63954171985a0b0d30058d287960968b9b2aca264c8d4ee6" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" [[package]] name = "portable-atomic-util" @@ -3520,8 +3491,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ "rand_chacha 0.9.0", - "rand_core 0.9.1", - "zerocopy 0.8.20", + "rand_core 0.9.2", + "zerocopy 0.8.21", ] [[package]] @@ -3541,7 +3512,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.1", + "rand_core 0.9.2", ] [[package]] @@ -3555,19 +3526,19 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a88e0da7a2c97baa202165137c158d0a2e824ac465d13d81046727b34cb247d3" +checksum = "7a509b1a2ffbe92afab0e55c8fd99dea1c280e8171bd2d88682bb20bc41cbc2c" dependencies = [ "getrandom 0.3.1", - "zerocopy 0.8.20", + "zerocopy 0.8.21", ] [[package]] name = "rc-zip" -version = "5.2.0" +version = "5.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a26a26f527c4dcc6f72f18ec24bd7172dff872a1a6a3ad616566b6e3359701f6" +checksum = "917010d96cfbd55325038a1db68b0eb70b0a06f70aed2272642c544961c1e9d4" dependencies = [ "bzip2 0.4.4", "chardetng", @@ -3589,9 +3560,9 @@ dependencies = [ [[package]] name = "rc-zip-sync" -version = "4.2.4" +version = "4.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57e1d13c4c826c9a6af74f5077e58435d97ee966940c79fbabcfb0917c8e925d" +checksum = "335abe288500174621cf56f4ebd65ec91d3e30b7bc9063b4633fc4e4ffbcb12b" dependencies = [ "oval", "positioned-io", @@ -3630,14 +3601,14 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbd3533fd4222b8337470456ea84d80436b4c91c53db51c372461d5f7e6eb0b4" +checksum = "9efd944f26afa2406cbbabff39fac533c9bc24b13d7f1f12e14ae3e7bdc66cdb" dependencies = [ "cfg-if", "libc", "rustix", - "windows 0.59.0", + "windows 0.60.0", ] [[package]] @@ -3753,9 +3724,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.10" +version = "0.17.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34b5020fcdea098ef7d95e9f89ec15952123a4a039badd09fabebe9e963e839" +checksum = "da5349ae27d3887ca812fb375b45a4fbb36d8d12d2df394968cd86e35683fe73" dependencies = [ "cc", "cfg-if", @@ -4074,11 +4045,11 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.16" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08a8a45589d3c21c71abb5d84374ce14058d1acb0c1ea299660d5b494a5d95e9" +checksum = "c73b7cfffb1daffacab7bbb42f02b6c5d9117957edad4c58c6aa83bea187ec84" dependencies = [ - "compact_str", + "compact_str 0.9.0", "derive_destructure2", "gix", "thiserror 1.0.69", @@ -4723,9 +4694,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.14.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d59ca99a559661b96bf898d8fce28ed87935fd2bea9f05983c1464dd6c71b1" +checksum = "e0f540e3240398cce6128b64ba83fdbdd86129c16a3aa1a3a252efd66eb3d587" dependencies = [ "getrandom 0.3.1", ] @@ -4986,16 +4957,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f919aee0a93304be7f62e8e5027811bbba96bcb1de84d6618be56e43f8a32a1" -dependencies = [ - "windows-core 0.59.0", - "windows-targets 0.53.0", -] - [[package]] name = "windows" version = "0.60.0" @@ -5018,15 +4979,6 @@ dependencies = [ "windows-core 0.60.1", ] -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-core" version = "0.58.0" @@ -5040,19 +4992,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-core" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "810ce18ed2112484b0d4e15d022e5f598113e220c53e373fb31e67e21670c1ce" -dependencies = [ - "windows-implement 0.59.0", - "windows-interface 0.59.0", - "windows-result 0.3.1", - "windows-strings 0.3.1", - "windows-targets 0.53.0", -] - [[package]] name = "windows-core" version = "0.60.1" @@ -5235,29 +5174,13 @@ 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_gnullvm", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] -[[package]] -name = "windows-targets" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" -dependencies = [ - "windows_aarch64_gnullvm 0.53.0", - "windows_aarch64_msvc 0.53.0", - "windows_i686_gnu 0.53.0", - "windows_i686_gnullvm 0.53.0", - "windows_i686_msvc 0.53.0", - "windows_x86_64_gnu 0.53.0", - "windows_x86_64_gnullvm 0.53.0", - "windows_x86_64_msvc 0.53.0", -] - [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -5270,12 +5193,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" - [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -5288,12 +5205,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" - [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -5306,24 +5217,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" -[[package]] -name = "windows_i686_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" - [[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.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" - [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -5336,12 +5235,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_i686_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" - [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -5354,12 +5247,6 @@ 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.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" - [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -5372,12 +5259,6 @@ 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.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" - [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -5390,12 +5271,6 @@ 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.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" - [[package]] name = "winnow" version = "0.5.40" @@ -5520,11 +5395,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dde3bb8c68a8f3f1ed4ac9221aad6b10cece3e60a8e2ea54a6a2dec806d0084c" +checksum = "dcf01143b2dd5d134f11f545cf9f1431b13b749695cb33bcce051e7568f99478" dependencies = [ - "zerocopy-derive 0.8.20", + "zerocopy-derive 0.8.21", ] [[package]] @@ -5540,9 +5415,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.20" +version = "0.8.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eea57037071898bf96a6da35fd626f4f27e9cee3ead2a6c703cf09d472b2e700" +checksum = "712c8386f4f4299382c9abee219bee7084f78fb939d88b6840fcc1320d5f6da2" dependencies = [ "proc-macro2", "quote", @@ -5551,18 +5426,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", From 712ad730a6971e37a8df1236f4c69c74375de227 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 28 Feb 2025 19:08:34 +1000 Subject: [PATCH 1985/2020] Use flate2/zlib-rs for dev/release build (#2068) * Add feature zlib-rs to binstalk-downloader Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Add feature zlib-rs to binstalk Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Add feature zlib-rs to cargo-binstall Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Enable zlib-rs for CI build pipeline Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- crates/bin/Cargo.toml | 1 + crates/binstalk-downloader/Cargo.toml | 1 + crates/binstalk/Cargo.toml | 1 + justfile | 24 ++---------------------- 4 files changed, 5 insertions(+), 22 deletions(-) diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index f0b0a9fc..6e3dec6f 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -63,6 +63,7 @@ static = ["binstalk/static"] pkg-config = ["binstalk/pkg-config"] zlib-ng = ["binstalk/zlib-ng"] +zlib-rs = ["binstalk/zlib-rs"] rustls = ["binstalk/rustls"] native-tls = ["binstalk/native-tls"] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 43def914..1213170b 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -88,6 +88,7 @@ static = ["bzip2/static", "xz2/static", "native-tls-crate?/vendored"] pkg-config = ["zstd/pkg-config"] zlib-ng = ["flate2/zlib-ng"] +zlib-rs = ["flate2/zlib-rs"] # Dummy feature, enabled if rustls or native-tls is enabled. # Used to avoid compilation error when no feature is enabled. diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index d32f4479..c5cc6fb6 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -56,6 +56,7 @@ static = ["binstalk-downloader/static"] pkg-config = ["binstalk-downloader/pkg-config"] zlib-ng = ["binstalk-downloader/zlib-ng"] +zlib-rs = ["binstalk-downloader/zlib-rs"] rustls = ["binstalk-downloader/rustls", "binstalk-registry/rustls"] native-tls = ["binstalk-downloader/native-tls", "binstalk-registry/native-tls"] diff --git a/justfile b/justfile index ca2122d2..2e266f61 100644 --- a/justfile +++ b/justfile @@ -79,30 +79,10 @@ support-pkg-config := if target == target-host { if target-os == "linux" { "true" } else { "" } } else { "" } -#} else if target == "aarch64-unknown-linux-gnu" { -# ",zlib-ng" -#} else if target == "aarch64-unknown-linux-musl" { -# ",zlib-ng" -git-max-perf-feature := if target == "x86_64-apple-darwin" { - ",zlib-ng" -} else if target == "x86_64h-apple-darwin" { - ",zlib-ng" -} else if target == "aarch64-apple-darwin" { - ",zlib-ng" -} else if target-os == "windows" { - ",zlib-ng" -} else if target == "x86_64-unknown-linux-gnu" { - ",zlib-ng" -} else if target == "x86_64-unknown-linux-musl" { - ",zlib-ng" -} else { - "" -} - h3-features := if enable-h3 != "" { ",http3" } else { "" } cargo-features := trim_end_match(if override-features != "" { override-features + h3-features - } else if (cargo-profile / ci-or-no) == "dev/ci" { "git,rustls,fancy-with-backtrace,zstd-thin,log_max_level_debug" + git-max-perf-feature + (if support-pkg-config != "" { ",pkg-config" } else { "" }) + h3-features + extra-features - } else if (cargo-profile / ci-or-no) == "release/ci" { "git,static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug,cross-lang-fat-lto" + git-max-perf-feature + h3-features + extra-features + } else if (cargo-profile / ci-or-no) == "dev/ci" { "git,rustls,fancy-with-backtrace,zstd-thin,log_max_level_debug,zlib-rs" + (if support-pkg-config != "" { ",pkg-config" } else { "" }) + h3-features + extra-features + } else if (cargo-profile / ci-or-no) == "release/ci" { "git,static,rustls,trust-dns,fancy-no-backtrace,zstd-thin,log_release_max_level_debug,cross-lang-fat-lto,zlib-rs" + h3-features + extra-features } else if extra-features != "" { extra-features + h3-features } else if enable-h3 != "" { "http3" } else { "" From 708a489062656b6bd8a64137633a0f672b02a20b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 28 Feb 2025 21:55:33 +1000 Subject: [PATCH 1986/2020] chore: release (#2067) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 32 +++++++++++++++++------ crates/bin/Cargo.toml | 4 +-- crates/binstalk-downloader/CHANGELOG.md | 6 +++++ crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/CHANGELOG.md | 6 +++++ crates/binstalk-fetchers/Cargo.toml | 8 +++--- crates/binstalk-git-repo-api/CHANGELOG.md | 6 +++++ crates/binstalk-git-repo-api/Cargo.toml | 6 ++--- crates/binstalk-manifests/CHANGELOG.md | 6 +++++ crates/binstalk-manifests/Cargo.toml | 4 +-- crates/binstalk-registry/CHANGELOG.md | 6 +++++ crates/binstalk-registry/Cargo.toml | 6 ++--- crates/binstalk/CHANGELOG.md | 6 +++++ crates/binstalk/Cargo.toml | 12 ++++----- crates/detect-targets/CHANGELOG.md | 6 +++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 +++++ crates/detect-wasi/Cargo.toml | 2 +- 18 files changed, 95 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4c1b6e9c..f3fdb9b2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -242,7 +242,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.26" +version = "0.28.27" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -288,7 +288,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.13.12" +version = "0.13.13" dependencies = [ "async-compression", "async-trait", @@ -324,7 +324,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.10.13" +version = "0.10.14" dependencies = [ "async-trait", "binstalk-downloader", @@ -348,7 +348,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.14" +version = "0.5.15" dependencies = [ "binstalk-downloader", "compact_str 0.8.1", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.23" +version = "0.15.24" dependencies = [ "beef", "binstalk-types", @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.11.13" +version = "0.11.14" dependencies = [ "async-trait", "base16", @@ -943,7 +943,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.42" +version = "0.1.43" dependencies = [ "cfg-if", "guess_host_triple", @@ -955,7 +955,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.23" +version = "1.0.24" dependencies = [ "tempfile", ] @@ -1138,6 +1138,7 @@ checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" dependencies = [ "crc32fast", "libz-ng-sys", + "libz-rs-sys", "miniz_oxide 0.8.5", ] @@ -2741,6 +2742,15 @@ dependencies = [ "libc", ] +[[package]] +name = "libz-rs-sys" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "902bc563b5d65ad9bba616b490842ef0651066a1a1dc3ce1087113ffcb873c8d" +dependencies = [ + "zlib-rs", +] + [[package]] name = "linux-raw-sys" version = "0.4.15" @@ -5473,6 +5483,12 @@ dependencies = [ "syn", ] +[[package]] +name = "zlib-rs" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b20717f0917c908dc63de2e44e97f1e6b126ca58d0e391cee86d504eb8fbd05" + [[package]] name = "zstd" version = "0.13.3" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 6e3dec6f..6a5e2b34 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,8 +23,8 @@ pkg-fmt = "zip" [dependencies] atomic-file-install = { version = "1.0.10", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.26", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.23" } +binstalk = { path = "../binstalk", version = "0.28.27", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.24" } clap = { version = "4.5.3", features = ["derive", "env", "wrap_help"] } clap-cargo = "0.15.2" compact_str = "0.8.0" diff --git a/crates/binstalk-downloader/CHANGELOG.md b/crates/binstalk-downloader/CHANGELOG.md index cac56050..ba6a34e3 100644 --- a/crates/binstalk-downloader/CHANGELOG.md +++ b/crates/binstalk-downloader/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.13.13](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.12...binstalk-downloader-v0.13.13) - 2025-02-28 + +### Other + +- Use flate2/zlib-rs for dev/release build ([#2068](https://github.com/cargo-bins/cargo-binstall/pull/2068)) + ## [0.13.12](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.11...binstalk-downloader-v0.13.12) - 2025-02-11 ### Other diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 1213170b..84991a2e 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.13.12" +version = "0.13.13" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index 1785b909..33a2558b 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.14](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.13...binstalk-fetchers-v0.10.14) - 2025-02-28 + +### Other + +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.10.13](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.12...binstalk-fetchers-v0.10.13) - 2025-02-11 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index cb89c0a9..a1532b1f 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.10.13" +version = "0.10.14" edition = "2021" description = "The binstall fetchers" @@ -12,8 +12,8 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.84" -binstalk-downloader = { version = "0.13.12", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.14", path = "../binstalk-git-repo-api" } +binstalk-downloader = { version = "0.13.13", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.15", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.9.3", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.8.0" } @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.5.4" [dev-dependencies] -binstalk-downloader = { version = "0.13.12", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.13", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index 98b0b784..a77bff45 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.15](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.14...binstalk-git-repo-api-v0.5.15) - 2025-02-28 + +### Other + +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.5.14](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.13...binstalk-git-repo-api-v0.5.14) - 2025-02-11 ### Other diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 82094b50..606b173e 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.14" +version = "0.5.15" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.13.12", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.13", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.8.0" @@ -25,6 +25,6 @@ url = "2.5.4" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.12", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.13", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index dc8d150a..c76e9f90 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.24](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.23...binstalk-manifests-v0.15.24) - 2025-02-28 + +### Other + +- updated the following local packages: detect-targets + ## [0.15.23](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.22...binstalk-manifests-v0.15.23) - 2025-02-22 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index f403bf5c..377e77db 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.23" +version = "0.15.24" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.42", path = "../detect-targets" } +detect-targets = { version = "0.1.43", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md index 5fd11fe5..e4bdede5 100644 --- a/crates/binstalk-registry/CHANGELOG.md +++ b/crates/binstalk-registry/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.14](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.13...binstalk-registry-v0.11.14) - 2025-02-28 + +### Other + +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.11.13](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.12...binstalk-registry-v0.11.13) - 2025-02-11 ### Other diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index ebf3db5c..f4b42154 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.11.13" +version = "0.11.14" edition = "2021" rust-version = "1.65.0" @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.84" base16 = "0.2.1" -binstalk-downloader = { version = "0.13.12", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.13", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.9.3", path = "../binstalk-types" } @@ -40,7 +40,7 @@ url = "2.5.4" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.13.12", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.13", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index c5cf2526..88b532bd 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.27](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.26...binstalk-v0.28.27) - 2025-02-28 + +### Other + +- Use flate2/zlib-rs for dev/release build ([#2068](https://github.com/cargo-bins/cargo-binstall/pull/2068)) + ## [0.28.26](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.25...binstalk-v0.28.26) - 2025-02-22 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index c5cc6fb6..241877d3 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.26" +version = "0.28.27" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -11,17 +11,17 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.6.11", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.13.12", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.14", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.10.13", path = "../binstalk-fetchers", features = [ +binstalk-downloader = { version = "0.13.13", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.15", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.10.14", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.11.13", path = "../binstalk-registry" } +binstalk-registry = { version = "0.11.14", path = "../binstalk-registry" } binstalk-types = { version = "0.9.3", path = "../binstalk-types" } cargo-toml-workspace = { version = "7.0.4", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.8.0", features = ["serde"] } -detect-targets = { version = "0.1.42", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.43", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index adeddc34..82189757 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.43](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.42...detect-targets-v0.1.43) - 2025-02-28 + +### Other + +- update Cargo.lock dependencies + ## [0.1.42](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.41...detect-targets-v0.1.42) - 2025-02-22 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 88b7511d..e461ef1e 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.42" +version = "0.1.43" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index 435526a0..2fbda866 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.24](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.23...detect-wasi-v1.0.24) - 2025-02-28 + +### Other + +- update Cargo.lock dependencies + ## [1.0.23](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.22...detect-wasi-v1.0.23) - 2025-02-22 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index 2f24e090..c97e8fdc 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.23" +version = "1.0.24" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From a799bb428cec50963bc94008d58da133e25f9a8d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 28 Feb 2025 13:01:26 +0000 Subject: [PATCH 1987/2020] release: cargo-binstall v1.11.2 (#2069) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f3fdb9b2..b448d194 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -557,7 +557,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.11.1" +version = "1.11.2" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 6a5e2b34..32b6e888 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.11.1" +version = "1.11.2" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index cca2317f..2db0f5b1 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 7c38109b23696143172d290582057fde456d647c Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 28 Feb 2025 23:29:25 +1000 Subject: [PATCH 1988/2020] Simplify release-pr.yml (#2070) We only want to use it for cargo-binstall release Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- .github/workflows/release-pr.yml | 33 ++++---------------------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/.github/workflows/release-pr.yml b/.github/workflows/release-pr.yml index 39486a8c..0a1943ef 100644 --- a/.github/workflows/release-pr.yml +++ b/.github/workflows/release-pr.yml @@ -1,37 +1,12 @@ -name: Open a release PR +name: Open cargo-binstall release PR on: workflow_dispatch: inputs: - crate: - description: Crate to release - required: true - type: choice - options: - - atomic-file-install - - bin - - binstalk - - binstalk-bins - - binstalk-fetchers - - binstalk-git-repo-api - - binstalk-registry - - binstalk-manifests - - binstalk-types - - binstalk-downloader - - cargo-toml-workspace - - detect-targets - - detect-wasi - - fs-lock - - normalize-path version: description: Version to release required: true type: string default: patch - no-check-semver: - description: To disable check semver - required: true - type: string - default: "false" permissions: pull-requests: write @@ -62,11 +37,11 @@ jobs: with: github-token: ${{ secrets.GITHUB_TOKEN }} version: ${{ inputs.version }} - crate-path: crates/${{ inputs.crate }} + crate-path: crates/bin pr-label: release - pr-release-notes: ${{ inputs.crate == 'bin' }} + pr-release-notes: true pr-template-file: .github/scripts/release-pr-template.ejs - check-semver: ${{ inputs.crate != 'bin' && inputs.no-check-semver != 'true' }} + check-semver: false check-package: true env: RUSTFLAGS: --cfg reqwest_unstable From d9da8aaba487ec2e2b43a26f7d324d84ca92764a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 1 Mar 2025 18:11:06 +1100 Subject: [PATCH 1989/2020] build(deps): bump the deps group with 3 updates (#2072) * build(deps): bump the deps group with 3 updates Bumps the deps group with 3 updates: [compact_str](https://github.com/ParkMyCar/compact_str), [bzip2](https://github.com/trifectatechfoundation/bzip2-rs) and [fs4](https://github.com/al8n/fs4-rs). Updates `compact_str` from 0.8.1 to 0.9.0 - [Changelog](https://github.com/ParkMyCar/compact_str/blob/main/CHANGELOG.md) - [Commits](https://github.com/ParkMyCar/compact_str/compare/v0.8.1...v0.9.0) Updates `bzip2` from 0.5.1 to 0.5.2 - [Release notes](https://github.com/trifectatechfoundation/bzip2-rs/releases) - [Commits](https://github.com/trifectatechfoundation/bzip2-rs/compare/v0.5.1...v0.5.2) Updates `fs4` from 0.12.0 to 0.13.0 - [Release notes](https://github.com/al8n/fs4-rs/releases) - [Changelog](https://github.com/al8n/fs4-rs/blob/main/CHANGELOG.md) - [Commits](https://github.com/al8n/fs4-rs/commits) --- updated-dependencies: - dependency-name: compact_str dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps - dependency-name: bzip2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: fs4 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] * Fix use of fs4::fs_std::FileExt::try_lock* Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: dependabot[bot] Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- Cargo.lock | 57 +++++++++---------------- crates/bin/Cargo.toml | 2 +- crates/binstalk-bins/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 4 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-git-repo-api/Cargo.toml | 2 +- crates/binstalk-manifests/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- crates/fs-lock/Cargo.toml | 2 +- crates/fs-lock/src/lib.rs | 4 +- 13 files changed, 35 insertions(+), 50 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b448d194..18b29a76 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -140,7 +140,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06575e6a9673580f52661c92107baabffbf41e2141373441cbcdc47cb733003c" dependencies = [ "brotli", - "bzip2 0.5.1", + "bzip2 0.5.2", "flate2", "futures-core", "memchr", @@ -252,7 +252,7 @@ dependencies = [ "binstalk-types", "cargo-toml-workspace", "command-group", - "compact_str 0.8.1", + "compact_str", "detect-targets", "either", "itertools", @@ -278,7 +278,7 @@ version = "0.6.11" dependencies = [ "atomic-file-install", "binstalk-types", - "compact_str 0.8.1", + "compact_str", "leon", "miette", "normalize-path", @@ -295,9 +295,9 @@ dependencies = [ "binstalk-types", "binstall-tar", "bytes", - "bzip2 0.5.1", + "bzip2 0.5.2", "cfg-if", - "compact_str 0.8.1", + "compact_str", "default-net", "flate2", "futures-io", @@ -331,7 +331,7 @@ dependencies = [ "binstalk-git-repo-api", "binstalk-types", "bytes", - "compact_str 0.8.1", + "compact_str", "either", "itertools", "leon", @@ -351,7 +351,7 @@ name = "binstalk-git-repo-api" version = "0.5.15" dependencies = [ "binstalk-downloader", - "compact_str 0.8.1", + "compact_str", "once_cell", "percent-encoding", "serde", @@ -371,7 +371,7 @@ version = "0.15.24" dependencies = [ "beef", "binstalk-types", - "compact_str 0.8.1", + "compact_str", "detect-targets", "fs-lock", "home", @@ -395,7 +395,7 @@ dependencies = [ "binstalk-downloader", "binstalk-types", "cargo-toml-workspace", - "compact_str 0.8.1", + "compact_str", "leon", "miette", "normalize-path", @@ -417,7 +417,7 @@ dependencies = [ name = "binstalk-types" version = "0.9.3" dependencies = [ - "compact_str 0.8.1", + "compact_str", "maybe-owned", "once_cell", "semver", @@ -528,21 +528,20 @@ dependencies = [ [[package]] name = "bzip2" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75b89e7c29231c673a61a46e722602bcd138298f6b9e81e71119693534585f5c" +checksum = "49ecfb22d906f800d4fe833b6282cf4dc1c298f5057ca0b5445e5c209735ca47" dependencies = [ "bzip2-sys", ] [[package]] name = "bzip2-sys" -version = "0.1.12+1.0.8" +version = "0.1.13+1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72ebc2f1a417f01e1da30ef264ee86ae31d2dcd2d603ea283d3c244a883ca2a9" +checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" dependencies = [ "cc", - "libc", "pkg-config", ] @@ -564,7 +563,7 @@ dependencies = [ "binstalk-manifests", "clap", "clap-cargo", - "compact_str 0.8.1", + "compact_str", "dirs", "embed-resource", "file-format", @@ -601,7 +600,7 @@ name = "cargo-toml-workspace" version = "7.0.4" dependencies = [ "cargo_toml", - "compact_str 0.8.1", + "compact_str", "glob", "normalize-path", "serde", @@ -770,21 +769,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "compact_str" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b79c4069c6cad78e2e0cdfcbd26275770669fb39fd308a752dc110e83b9af32" -dependencies = [ - "castaway", - "cfg-if", - "itoa", - "rustversion", - "ryu", - "serde", - "static_assertions", -] - [[package]] name = "compact_str" version = "0.9.0" @@ -796,6 +780,7 @@ dependencies = [ "itoa", "rustversion", "ryu", + "serde", "static_assertions", ] @@ -1182,12 +1167,12 @@ dependencies = [ [[package]] name = "fs4" -version = "0.12.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c29c30684418547d476f0b48e84f4821639119c483b1eccd566c8cd0cd05f521" +checksum = "be058769cf1633370c3d0dac6bb9b223b8f18900cf808abadf7843192e706238" dependencies = [ "rustix", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4059,7 +4044,7 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c73b7cfffb1daffacab7bbb42f02b6c5d9117957edad4c58c6aa83bea187ec84" dependencies = [ - "compact_str 0.9.0", + "compact_str", "derive_destructure2", "gix", "thiserror 1.0.69", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 32b6e888..49db729a 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -27,7 +27,7 @@ binstalk = { path = "../binstalk", version = "0.28.27", default-features = false binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.24" } clap = { version = "4.5.3", features = ["derive", "env", "wrap_help"] } clap-cargo = "0.15.2" -compact_str = "0.8.0" +compact_str = "0.9.0" dirs = "6.0.0" file-format = { version = "0.26.0", default-features = false } home = "0.5.9" diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 71f2ce9d..08e9dfd6 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -13,7 +13,7 @@ license = "GPL-3.0-only" [dependencies] atomic-file-install = { version = "1.0.10", path = "../atomic-file-install" } binstalk-types = { version = "0.9.3", path = "../binstalk-types" } -compact_str = { version = "0.8.0", features = ["serde"] } +compact_str = { version = "0.9.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 84991a2e..0d0c0c84 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -20,9 +20,9 @@ async-compression = { version = "0.4.4", features = [ ] } binstalk-types = { version = "0.9.3", path = "../binstalk-types" } bytes = "1.4.0" -bzip2 = "0.5.0" +bzip2 = "0.5.2" cfg-if = "1" -compact_str = "0.8.0" +compact_str = "0.9.0" flate2 = { version = "1.0.28", default-features = false } futures-util = "0.3.30" futures-io = "0.3.30" diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index a1532b1f..c12fc77b 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -16,7 +16,7 @@ binstalk-downloader = { version = "0.13.13", path = "../binstalk-downloader", de binstalk-git-repo-api = { version = "0.5.15", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.9.3", path = "../binstalk-types" } bytes = "1.4.0" -compact_str = { version = "0.8.0" } +compact_str = { version = "0.9.0" } either = "1.11.0" itertools = "0.14.0" leon = "3.0.0" diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 606b173e..a8a314c7 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" binstalk-downloader = { version = "0.13.13", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } -compact_str = "0.8.0" +compact_str = "0.9.0" percent-encoding = "2.2.0" serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 377e77db..f83e3882 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -12,7 +12,7 @@ license = "Apache-2.0 OR MIT" [dependencies] beef = { version = "0.5.2", features = ["impl_serde"] } binstalk-types = { version = "0.9.3", path = "../binstalk-types" } -compact_str = { version = "0.8.0", features = ["serde"] } +compact_str = { version = "0.9.0", features = ["serde"] } fs-lock = { version = "0.1.8", path = "../fs-lock", features = ["tracing"] } home = "0.5.9" miette = "7.0.0" diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index f4b42154..886bdd5b 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -18,7 +18,7 @@ binstalk-downloader = { version = "0.13.13", path = "../binstalk-downloader", de ] } binstalk-types = { version = "0.9.3", path = "../binstalk-types" } cargo-toml-workspace = { version = "7.0.4", path = "../cargo-toml-workspace" } -compact_str = { version = "0.8.0", features = ["serde"] } +compact_str = { version = "0.9.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" normalize-path = { version = "0.2.1", path = "../normalize-path" } diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index 3c9f3272..b0ca6a48 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -compact_str = { version = "0.8.0", features = ["serde"] } +compact_str = { version = "0.9.0", features = ["serde"] } maybe-owned = { version = "0.3.4", features = ["serde"] } once_cell = "1.18.0" semver = { version = "1.0.17", features = ["serde"] } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 241877d3..dce8a49e 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -20,7 +20,7 @@ binstalk-registry = { version = "0.11.14", path = "../binstalk-registry" } binstalk-types = { version = "0.9.3", path = "../binstalk-types" } cargo-toml-workspace = { version = "7.0.4", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } -compact_str = { version = "0.8.0", features = ["serde"] } +compact_str = { version = "0.9.0", features = ["serde"] } detect-targets = { version = "0.1.43", path = "../detect-targets", features = [ "tracing", ] } diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 0998b69b..e3bd5f6f 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -11,7 +11,7 @@ license = "Apache-2.0 OR MIT" [dependencies] cargo_toml = "0.21.0" -compact_str = { version = "0.8.0", features = ["serde"] } +compact_str = { version = "0.9.0", features = ["serde"] } glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } serde = "1.0.163" diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 7c9156e7..c690c59e 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -10,5 +10,5 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -fs4 = "0.12.0" +fs4 = "0.13.0" tracing = { version = "0.1", optional = true } diff --git a/crates/fs-lock/src/lib.rs b/crates/fs-lock/src/lib.rs index abf60873..f3c8ac8a 100644 --- a/crates/fs-lock/src/lib.rs +++ b/crates/fs-lock/src/lib.rs @@ -44,7 +44,7 @@ impl FileLock { /// Note that this operation is blocking, and should not be called in async contexts. pub fn new_try_exclusive(file: File) -> Result)> { match FileExt::try_lock_exclusive(&file) { - Ok(()) => Ok(Self::new(file)), + Ok(_) => Ok(Self::new(file)), Err(e) if e.raw_os_error() == fs4::lock_contended_error().raw_os_error() => { Err((file, None)) } @@ -70,7 +70,7 @@ impl FileLock { /// Note that this operation is blocking, and should not be called in async contexts. pub fn new_try_shared(file: File) -> Result)> { match FileExt::try_lock_shared(&file) { - Ok(()) => Ok(Self::new(file)), + Ok(_) => Ok(Self::new(file)), Err(e) if e.raw_os_error() == fs4::lock_contended_error().raw_os_error() => { Err((file, None)) } From a8daf8eb3b89856b98170d0d6a03f75cd28fa4f3 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Tue, 4 Mar 2025 23:20:35 +1000 Subject: [PATCH 1990/2020] Use bzip2/libbz2-rs-sys (#2071) Also upgrade rc-zip-sync so that it uses bzip the same major version v0.5.2 as our crate, so that it doesn't pull in c bzip and rust bzip at the same time. Signed-off-by: Jiahao XU --- Cargo.lock | 31 ++++++++++++--------------- crates/binstalk-downloader/Cargo.toml | 12 +++++------ 2 files changed, 19 insertions(+), 24 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 18b29a76..69106d3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -140,7 +140,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06575e6a9673580f52661c92107baabffbf41e2141373441cbcdc47cb733003c" dependencies = [ "brotli", - "bzip2 0.5.2", + "bzip2", "flate2", "futures-core", "memchr", @@ -295,7 +295,7 @@ dependencies = [ "binstalk-types", "binstall-tar", "bytes", - "bzip2 0.5.2", + "bzip2", "cfg-if", "compact_str", "default-net", @@ -516,16 +516,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d2c12f985c78475a6b8d629afd0c360260ef34cfef52efccdcfd31972f81c2e" -[[package]] -name = "bzip2" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8" -dependencies = [ - "bzip2-sys", - "libc", -] - [[package]] name = "bzip2" version = "0.5.2" @@ -533,6 +523,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49ecfb22d906f800d4fe833b6282cf4dc1c298f5057ca0b5445e5c209735ca47" dependencies = [ "bzip2-sys", + "libbz2-rs-sys", ] [[package]] @@ -2690,6 +2681,12 @@ dependencies = [ "syn", ] +[[package]] +name = "libbz2-rs-sys" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0864a00c8d019e36216b69c2c4ce50b83b7bd966add3cf5ba554ec44f8bebcf5" + [[package]] name = "libc" version = "0.2.170" @@ -3531,11 +3528,11 @@ dependencies = [ [[package]] name = "rc-zip" -version = "5.3.0" +version = "5.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "917010d96cfbd55325038a1db68b0eb70b0a06f70aed2272642c544961c1e9d4" +checksum = "ebde715984a68b306e5b41884cbcb8158e0e1dbe6e2841212983333b1662c416" dependencies = [ - "bzip2 0.4.4", + "bzip2", "chardetng", "chrono", "crc32fast", @@ -3555,9 +3552,9 @@ dependencies = [ [[package]] name = "rc-zip-sync" -version = "4.2.5" +version = "4.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "335abe288500174621cf56f4ebd65ec91d3e30b7bc9063b4633fc4e4ffbcb12b" +checksum = "fdd21d17384a7da18df6b70f49bc2daa84d15e0fa0929bc635541383b3827190" dependencies = [ "oval", "positioned-io", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 0d0c0c84..01de29c6 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -20,14 +20,16 @@ async-compression = { version = "0.4.4", features = [ ] } binstalk-types = { version = "0.9.3", path = "../binstalk-types" } bytes = "1.4.0" -bzip2 = "0.5.2" +bzip2 = { version = "0.5.2", default-features = false, features = [ + "libbz2-rs-sys", +] } cfg-if = "1" compact_str = "0.9.0" flate2 = { version = "1.0.28", default-features = false } futures-util = "0.3.30" futures-io = "0.3.30" httpdate = "1.0.2" -rc-zip-sync = { version = "4.2.3", features = [ +rc-zip-sync = { version = "4.2.6", features = [ "deflate", "bzip2", "deflate64", @@ -108,11 +110,7 @@ rustls = [ "hickory-resolver?/dns-over-quic", "hickory-resolver?/dns-over-h3", ] -native-tls = [ - "__tls", - "native-tls-crate", - "reqwest/native-tls", -] +native-tls = ["__tls", "native-tls-crate", "reqwest/native-tls"] # Enable hickory-resolver so that features on it will also be enabled. hickory-dns = ["hickory-resolver", "default-net", "ipconfig", "once_cell"] From 92973c13924b82e74473bdcee16ce788f4cd3c9b Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 7 Mar 2025 05:56:49 +1000 Subject: [PATCH 1991/2020] Fix detect-targets musl fallback for android and alpine (#2076) Android does not have `-unknown-` in target and alpine uses `-alpine-` instead of `-unknown-`, so the musl fallback must be taken special care when generating Signed-off-by: Jiahao XU --- crates/detect-targets/src/detect/linux.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/crates/detect-targets/src/detect/linux.rs b/crates/detect-targets/src/detect/linux.rs index 04a88924..1b81f688 100644 --- a/crates/detect-targets/src/detect/linux.rs +++ b/crates/detect-targets/src/detect/linux.rs @@ -22,7 +22,14 @@ pub(super) async fn detect_targets(target: String) -> Vec { (postfix, Libc::Unknown) }; - let musl_fallback_target = || format!("{prefix}-{}{abi}", "musl"); + let cpu_arch = target + .split_once('-') + .expect("unwrap: target always has a - for cpu_arch") + .0; + + // For android the `-unknown-` is omitted, for alpine it has `-alpine-` + // instead of `-unknown-`. + let musl_fallback_target = || format!("{cpu_arch}-unknown-linux-musl{abi}"); match libc { // guess_host_triple cannot detect whether the system is using glibc, @@ -33,11 +40,6 @@ pub(super) async fn detect_targets(target: String) -> Vec { // // As such, we need to launch the test ourselves. Libc::Gnu | Libc::Musl => { - let cpu_arch = target - .split_once('-') - .expect("unwrap: target always has a - for cpu_arch") - .0; - let handles: Vec<_> = { let cpu_arch_suffix = cpu_arch.replace('_', "-"); let filename = format!("ld-linux-{cpu_arch_suffix}.so.2"); From 451450603f2526aaeefb8e4d2d17dad2841b52be Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 7 Mar 2025 07:14:11 +0000 Subject: [PATCH 1992/2020] dep: Upgrade transitive dependencies (#2077) Co-authored-by: github-actions --- Cargo.lock | 341 ++++++++++++++++++++++++++++------------------------- 1 file changed, 182 insertions(+), 159 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 69106d3f..f8f636f2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -117,9 +117,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.96" +version = "1.0.97" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b964d184e89d9b6b67dd2715bc8e74cf3107fb2b529990c90cf517326150bf4" +checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" [[package]] name = "arc-swap" @@ -164,9 +164,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.86" +version = "0.1.87" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" +checksum = "d556ec1359574147ec0c4fc5eb525f3f23263a592b1a9c07e0a75b427de55c97" dependencies = [ "proc-macro2", "quote", @@ -265,7 +265,7 @@ dependencies = [ "strum", "target-lexicon", "tempfile", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tracing", "url", @@ -282,7 +282,7 @@ dependencies = [ "leon", "miette", "normalize-path", - "thiserror 2.0.11", + "thiserror 2.0.12", "tracing", ] @@ -312,7 +312,7 @@ dependencies = [ "serde", "serde_json", "tempfile", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-tar", "tokio-util", @@ -340,7 +340,7 @@ dependencies = [ "minisign-verify", "once_cell", "strum", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tracing", "url", @@ -357,7 +357,7 @@ dependencies = [ "serde", "serde-tuple-vec-map", "serde_json", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tracing", "tracing-subscriber", @@ -381,7 +381,7 @@ dependencies = [ "serde-tuple-vec-map", "serde_json", "tempfile", - "thiserror 2.0.11", + "thiserror 2.0.12", "toml_edit", "url", ] @@ -406,7 +406,7 @@ dependencies = [ "sha2", "simple-git", "tempfile", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "toml_edit", "tracing", @@ -447,9 +447,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f68f53c83ab957f72c32642f3868eec03eb974d1fb82e453128456482613d36" +checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" [[package]] name = "block-buffer" @@ -506,9 +506,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "bytesize" @@ -596,7 +596,7 @@ dependencies = [ "normalize-path", "serde", "tempfile", - "thiserror 2.0.11", + "thiserror 2.0.12", "tracing", ] @@ -635,9 +635,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.15" +version = "1.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c736e259eea577f443d5c86c304f9f4ae0295c43f3ba05c21f1d66b5f06001af" +checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" dependencies = [ "jobserver", "libc", @@ -997,15 +997,15 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "either" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7914353092ddf589ad78f25c5c1c21b7f80b0ff8621e7c814c3485b5306da9d" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "embed-resource" -version = "3.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4762ce03154ba57ebaeee60cc631901ceae4f18219cbb874e464347471594742" +checksum = "7fbc6e0d8e0c03a655b53ca813f0463d2c956bc4db8138dbc89f120b066551e3" dependencies = [ "cc", "memchr", @@ -1162,7 +1162,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "be058769cf1633370c3d0dac6bb9b223b8f18900cf808abadf7843192e706238" dependencies = [ - "rustix", + "rustix 0.38.44", "windows-sys 0.59.0", ] @@ -1359,7 +1359,7 @@ dependencies = [ "gix-worktree-state", "once_cell", "smallvec", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1372,7 +1372,7 @@ dependencies = [ "gix-date", "gix-utils", "itoa", - "thiserror 2.0.11", + "thiserror 2.0.12", "winnow 0.6.26", ] @@ -1389,7 +1389,7 @@ dependencies = [ "gix-trace", "kstring", "smallvec", - "thiserror 2.0.11", + "thiserror 2.0.12", "unicode-bom", ] @@ -1399,7 +1399,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1db9765c69502650da68f0804e3dc2b5f8ccc6a2d104ca6c85bc40700d37540" dependencies = [ - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1408,7 +1408,7 @@ version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b1f1d8764958699dc764e3f727cef280ff4d1bd92c107bbf8acd85b30c1bd6f" dependencies = [ - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1434,7 +1434,7 @@ dependencies = [ "gix-features", "gix-hash", "memmap2", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1453,7 +1453,7 @@ dependencies = [ "memchr", "once_cell", "smallvec", - "thiserror 2.0.11", + "thiserror 2.0.12", "unicode-bom", "winnow 0.6.26", ] @@ -1464,11 +1464,11 @@ version = "0.14.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "11365144ef93082f3403471dbaa94cfe4b5e72743bdb9560719a251d439f4cee" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "bstr", "gix-path", "libc", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1485,7 +1485,7 @@ dependencies = [ "gix-sec", "gix-trace", "gix-url", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1497,7 +1497,7 @@ dependencies = [ "bstr", "itoa", "jiff", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1509,7 +1509,7 @@ dependencies = [ "bstr", "gix-hash", "gix-object", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1525,7 +1525,7 @@ dependencies = [ "gix-path", "gix-ref", "gix-sec", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1548,7 +1548,7 @@ dependencies = [ "prodash", "sha1", "sha1_smol", - "thiserror 2.0.11", + "thiserror 2.0.12", "walkdir", ] @@ -1570,7 +1570,7 @@ dependencies = [ "gix-trace", "gix-utils", "smallvec", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1590,7 +1590,7 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4e9c7249fa0a78f9b363aa58323db71e0a6161fd69860ed6f48dedf0ef3a314e" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "bstr", "gix-features", "gix-path", @@ -1603,7 +1603,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e81c5ec48649b1821b3ed066a44efb95f1a268b35c1d91295e61252539fbe9f8" dependencies = [ "faster-hex", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1636,7 +1636,7 @@ version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acd12e3626879369310fffe2ac61acc828613ef656b50c4ea984dd59d7dc85d8" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "bstr", "filetime", "fnv", @@ -1653,9 +1653,9 @@ dependencies = [ "itoa", "libc", "memmap2", - "rustix", + "rustix 0.38.44", "smallvec", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1666,7 +1666,7 @@ checksum = "9739815270ff6940968441824d162df9433db19211ca9ba8c3fc1b50b849c642" dependencies = [ "gix-tempfile", "gix-utils", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1675,14 +1675,14 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a6a8af1ef7bbe303d30b55312b7f4d33e955de43a3642ae9b7347c623d80ef80" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "gix-commitgraph", "gix-date", "gix-hash", "gix-object", "gix-revwalk", "smallvec", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1702,7 +1702,7 @@ dependencies = [ "gix-validate", "itoa", "smallvec", - "thiserror 2.0.11", + "thiserror 2.0.12", "winnow 0.6.26", ] @@ -1724,7 +1724,7 @@ dependencies = [ "gix-quote", "parking_lot", "tempfile", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1744,7 +1744,7 @@ dependencies = [ "memmap2", "parking_lot", "smallvec", - "thiserror 2.0.11", + "thiserror 2.0.12", "uluru", ] @@ -1757,7 +1757,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1769,7 +1769,7 @@ dependencies = [ "bstr", "faster-hex", "gix-trace", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1782,7 +1782,7 @@ dependencies = [ "gix-trace", "home", "once_cell", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1791,13 +1791,13 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6430d3a686c08e9d59019806faa78c17315fe22ae73151a452195857ca02f86c" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "bstr", "gix-attributes", "gix-config-value", "gix-glob", "gix-path", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1809,8 +1809,8 @@ dependencies = [ "gix-command", "gix-config-value", "parking_lot", - "rustix", - "thiserror 2.0.11", + "rustix 0.38.44", + "thiserror 2.0.12", ] [[package]] @@ -1835,7 +1835,7 @@ dependencies = [ "gix-transport", "gix-utils", "maybe-async", - "thiserror 2.0.11", + "thiserror 2.0.12", "winnow 0.6.26", ] @@ -1847,7 +1847,7 @@ checksum = "e49357fccdb0c85c0d3a3292a9f6db32d9b3535959b5471bb9624908f4a066c6" dependencies = [ "bstr", "gix-utils", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1867,7 +1867,7 @@ dependencies = [ "gix-utils", "gix-validate", "memmap2", - "thiserror 2.0.11", + "thiserror 2.0.12", "winnow 0.6.26", ] @@ -1882,7 +1882,7 @@ dependencies = [ "gix-revision", "gix-validate", "smallvec", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1897,7 +1897,7 @@ dependencies = [ "gix-hash", "gix-object", "gix-revwalk", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1912,7 +1912,7 @@ dependencies = [ "gix-hashtable", "gix-object", "smallvec", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1921,7 +1921,7 @@ version = "0.10.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d84dae13271f4313f8d60a166bf27e54c968c7c33e2ffd31c48cafe5da649875" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "gix-path", "libc", "windows-sys 0.52.0", @@ -1936,7 +1936,7 @@ dependencies = [ "bstr", "gix-hash", "gix-lock", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1951,7 +1951,7 @@ dependencies = [ "gix-pathspec", "gix-refspec", "gix-url", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1989,7 +1989,7 @@ dependencies = [ "gix-sec", "gix-url", "reqwest", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -1998,7 +1998,7 @@ version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bec70e53896586ef32a3efa7e4427b67308531ed186bb6120fb3eca0f0d61b4" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "gix-commitgraph", "gix-date", "gix-hash", @@ -2006,7 +2006,7 @@ dependencies = [ "gix-object", "gix-revwalk", "smallvec", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -2019,7 +2019,7 @@ dependencies = [ "gix-features", "gix-path", "percent-encoding", - "thiserror 2.0.11", + "thiserror 2.0.12", "url", ] @@ -2040,7 +2040,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9eaa01c3337d885617c0a42e92823922a2aea71f4caeace6fe87002bdcadbd90" dependencies = [ "bstr", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -2079,7 +2079,7 @@ dependencies = [ "gix-path", "gix-worktree", "io-close", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -2177,7 +2177,7 @@ checksum = "1d00147af6310f4392a31680db52a3ed45a2e0f68eb18e8c3fe5537ecc96d9e2" dependencies = [ "async-recursion", "async-trait", - "bitflags 2.8.0", + "bitflags 2.9.0", "bytes", "cfg-if", "data-encoding", @@ -2198,7 +2198,7 @@ dependencies = [ "ring", "rustls", "rustls-pki-types", - "thiserror 2.0.11", + "thiserror 2.0.12", "time", "tinyvec", "tokio", @@ -2225,7 +2225,7 @@ dependencies = [ "resolv-conf", "rustls", "smallvec", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tokio-rustls", "tracing", @@ -2287,9 +2287,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2d708df4e7140240a16cd6ab0ab65c972d7433ab77819ea693fde9c43811e2a" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -2577,9 +2577,9 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jiff" @@ -2597,9 +2597,9 @@ dependencies = [ [[package]] name = "jiff-tzdb" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf2cec2f5d266af45a071ece48b1fb89f3b00b2421ac3a5fe10285a6caaa60d3" +checksum = "962e1dfe9b2d75a84536cf5bf5eaaa4319aa7906c7160134a22883ac316d5f31" [[package]] name = "jiff-tzdb-platform" @@ -2666,7 +2666,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42a865ffec5587961f5afc6d365bccb304f4feaa1928f4fe94c91c9d210d7310" dependencies = [ "miette", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -2709,9 +2709,9 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "libc", - "redox_syscall 0.5.9", + "redox_syscall 0.5.10", ] [[package]] @@ -2739,6 +2739,12 @@ version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" +[[package]] +name = "linux-raw-sys" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6db9c683daf087dc577b7506e9695b3d556a9f3849903fa28186283afd6809e9" + [[package]] name = "litemap" version = "0.7.5" @@ -2868,7 +2874,7 @@ dependencies = [ "terminal_size", "textwrap", "thiserror 1.0.69", - "unicode-width", + "unicode-width 0.1.14", ] [[package]] @@ -3022,7 +3028,7 @@ version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "cfg-if", "libc", ] @@ -3119,7 +3125,7 @@ version = "0.10.71" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "cfg-if", "foreign-types", "libc", @@ -3230,7 +3236,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.9", + "redox_syscall 0.5.10", "smallvec", "windows-targets 0.52.6", ] @@ -3299,9 +3305,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "portable-atomic" @@ -3346,9 +3352,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" dependencies = [ "toml_edit", ] @@ -3378,9 +3384,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" dependencies = [ "unicode-ident", ] @@ -3417,7 +3423,7 @@ dependencies = [ "rustc-hash", "rustls", "socket2", - "thiserror 2.0.11", + "thiserror 2.0.12", "tokio", "tracing", ] @@ -3436,7 +3442,7 @@ dependencies = [ "rustls", "rustls-pki-types", "slab", - "thiserror 2.0.11", + "thiserror 2.0.12", "tinyvec", "tracing", "web-time", @@ -3458,9 +3464,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.38" +version = "1.0.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" dependencies = [ "proc-macro2", ] @@ -3483,8 +3489,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ "rand_chacha 0.9.0", - "rand_core 0.9.2", - "zerocopy 0.8.21", + "rand_core 0.9.3", + "zerocopy 0.8.23", ] [[package]] @@ -3504,7 +3510,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" dependencies = [ "ppv-lite86", - "rand_core 0.9.2", + "rand_core 0.9.3", ] [[package]] @@ -3518,12 +3524,11 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a509b1a2ffbe92afab0e55c8fd99dea1c280e8171bd2d88682bb20bc41cbc2c" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ "getrandom 0.3.1", - "zerocopy 0.8.21", ] [[package]] @@ -3573,11 +3578,11 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.9" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82b568323e98e49e2a0899dcee453dd679fae22d69adf9b11dd508d1549b7e2f" +checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -3588,7 +3593,7 @@ checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" dependencies = [ "getrandom 0.2.15", "libredox", - "thiserror 2.0.11", + "thiserror 2.0.12", ] [[package]] @@ -3599,7 +3604,7 @@ checksum = "9efd944f26afa2406cbbabff39fac533c9bc24b13d7f1f12e14ae3e7bdc66cdb" dependencies = [ "cfg-if", "libc", - "rustix", + "rustix 0.38.44", "windows 0.60.0", ] @@ -3716,9 +3721,9 @@ dependencies = [ [[package]] name = "ring" -version = "0.17.11" +version = "0.17.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da5349ae27d3887ca812fb375b45a4fbb36d8d12d2df394968cd86e35683fe73" +checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" dependencies = [ "cc", "cfg-if", @@ -3755,10 +3760,23 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "errno 0.3.10", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17f8dcd64f141950290e45c99f7710ede1b600297c91818bb30b3667c0f45dc0" +dependencies = [ + "bitflags 2.9.0", + "errno 0.3.10", + "libc", + "linux-raw-sys 0.9.2", "windows-sys 0.59.0", ] @@ -3820,15 +3838,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "same-file" @@ -3866,7 +3884,7 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "core-foundation 0.9.4", "core-foundation-sys", "libc", @@ -3879,7 +3897,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "core-foundation 0.10.0", "core-foundation-sys", "libc", @@ -3898,9 +3916,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" dependencies = [ "serde", ] @@ -3936,9 +3954,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.139" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44f86c3acccc9c65b153fe1b85a3be07fe5515274ec9f0653b4a0875731c72a6" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -4146,9 +4164,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.98" +version = "2.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "e02e925281e18ffd9d640e234264753c43edc62d64b2d4cf898f1bc5e75f3fc2" dependencies = [ "proc-macro2", "quote", @@ -4192,7 +4210,7 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", "core-foundation 0.9.4", "system-configuration-sys 0.6.0", ] @@ -4231,15 +4249,15 @@ checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" [[package]] name = "tempfile" -version = "3.17.1" +version = "3.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22e5a0acb1f3f55f65cc4a866c361b2fb2a0ff6366785ae6fbb5f85df07ba230" +checksum = "2c317e0a526ee6120d8dabad239c8dadca62b24b6f168914bbbc8e2fb1f0e567" dependencies = [ "cfg-if", "fastrand", "getrandom 0.3.1", "once_cell", - "rustix", + "rustix 1.0.0", "windows-sys 0.59.0", ] @@ -4249,18 +4267,18 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5352447f921fda68cf61b4101566c0bdb5104eff6804d0678e5227580ab6a4e9" dependencies = [ - "rustix", + "rustix 0.38.44", "windows-sys 0.59.0", ] [[package]] name = "textwrap" -version = "0.16.1" +version = "0.16.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d434d3f8967a09480fb04132ebe0a3e088c173e6d0ee7897abbdf4eab0f8b9" +checksum = "c13547615a44dc9c452a8a534638acdf07120d4b6847c8178705da06306a3057" dependencies = [ "unicode-linebreak", - "unicode-width", + "unicode-width 0.2.0", ] [[package]] @@ -4274,11 +4292,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.11" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d452f284b73e6d76dd36758a0c8684b1d5be31f92b89d07fd5822175732206fc" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ - "thiserror-impl 2.0.11", + "thiserror-impl 2.0.12", ] [[package]] @@ -4294,9 +4312,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.11" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26afc1baea8a989337eeb52b6e72a039780ce45c3edfcc9c5b9d112feeb173c2" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", @@ -4315,9 +4333,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.37" +version = "0.3.39" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35e7868883861bd0e56d9ac6efcaaca0d6d5d82a2a7ec8209ff492c07cf37b21" +checksum = "dad298b01a40a23aac4580b67e3dbedb7cc8402f3592d7f49469de2ea4aecdd8" dependencies = [ "deranged", "itoa", @@ -4332,15 +4350,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "765c97a5b985b7c11d7bc27fa927dc4fe6af3a6dfb021d28deb60d3bf51e76ef" [[package]] name = "time-macros" -version = "0.2.19" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2834e6017e3e5e4b9834939793b282bc03b37a3336245fa820e35e233e2a85de" +checksum = "e8093bc3e81c3bc5f7879de09619d06c9a5a5e45ca44dfeeb7225bae38005c5c" dependencies = [ "num-conv", "time-core", @@ -4358,9 +4376,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.8.1" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "022db8904dfa342efe721985167e9fcd16c29b226db4397ed752a761cfce81e8" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" dependencies = [ "tinyvec_macros", ] @@ -4411,9 +4429,9 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" dependencies = [ "rustls", "tokio", @@ -4623,9 +4641,9 @@ checksum = "7eec5d1121208364f6793f7d2e222bf75a915c19557537745b195b253dd64217" [[package]] name = "unicode-ident" -version = "1.0.17" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00e2473a93778eb0bad35909dff6a10d28e63f792f16ed15e404fca9d5eeedbe" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-linebreak" @@ -4648,6 +4666,12 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +[[package]] +name = "unicode-width" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fc81956842c57dac11422a97c3b8195a1ff727f06e85c84ed2e8aa277c9a0fd" + [[package]] name = "untrusted" version = "0.9.0" @@ -5316,7 +5340,7 @@ version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" dependencies = [ - "bitflags 2.8.0", + "bitflags 2.9.0", ] [[package]] @@ -5333,13 +5357,12 @@ checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" [[package]] name = "xattr" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e105d177a3871454f754b33bb0ee637ecaaac997446375fd3e5d43a2ed00c909" +checksum = "0d65cbf2f12c15564212d48f4e3dfb87923d25d611f2aed18f4cb23f0413d89e" dependencies = [ "libc", - "linux-raw-sys", - "rustix", + "rustix 1.0.0", ] [[package]] @@ -5387,11 +5410,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.21" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcf01143b2dd5d134f11f545cf9f1431b13b749695cb33bcce051e7568f99478" +checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" dependencies = [ - "zerocopy-derive 0.8.21", + "zerocopy-derive 0.8.23", ] [[package]] @@ -5407,9 +5430,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.21" +version = "0.8.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712c8386f4f4299382c9abee219bee7084f78fb939d88b6840fcc1320d5f6da2" +checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" dependencies = [ "proc-macro2", "quote", From 268efdf6e6798babb48fd1d6cc91319274ec58f9 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Fri, 7 Mar 2025 23:18:15 +1000 Subject: [PATCH 1993/2020] feat: Use `CARGO_BUILD_TARGET` as fallback for `--target` (#2075) * feat: Use `CARGO_BUILD_TARGET` as fallback for `--target` Signed-off-by: Jiahao XU * Fix e2e-tests: Unset CARGO_BUILD_TARGET before running e2e-tests Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU --- crates/bin/src/args.rs | 3 ++- justfile | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/bin/src/args.rs b/crates/bin/src/args.rs index 5dc38677..b993ed72 100644 --- a/crates/bin/src/args.rs +++ b/crates/bin/src/args.rs @@ -88,7 +88,8 @@ pub struct Args { help_heading = "Package selection", alias = "target", long, - value_name = "TRIPLE" + value_name = "TRIPLE", + env = "CARGO_BUILD_TARGET" )] pub(crate) targets: Option>, diff --git a/justfile b/justfile index 2e266f61..f4590818 100644 --- a/justfile +++ b/justfile @@ -207,7 +207,7 @@ get-binary outdir=".": (get-output output-filename outdir) -chmod +x {{ outdir / output-filename }} e2e-test file *arguments: (get-binary "e2e-tests") - cd e2e-tests && env -u RUSTFLAGS bash {{file}}.sh {{output-filename}} {{arguments}} + cd e2e-tests && env -u RUSTFLAGS -u CARGO_BUILD_TARGET bash {{file}}.sh {{output-filename}} {{arguments}} e2e-test-live: (e2e-test "live") e2e-test-subcrate: (e2e-test "subcrate") From b243c176fed21bae9ee5883deae97b7f500e5ae2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 7 Mar 2025 13:49:46 +0000 Subject: [PATCH 1994/2020] chore: release (#2073) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 24 +++++++++++------------ crates/bin/Cargo.toml | 4 ++-- crates/binstalk-bins/CHANGELOG.md | 6 ++++++ crates/binstalk-bins/Cargo.toml | 4 ++-- crates/binstalk-downloader/CHANGELOG.md | 7 +++++++ crates/binstalk-downloader/Cargo.toml | 4 ++-- crates/binstalk-fetchers/CHANGELOG.md | 6 ++++++ crates/binstalk-fetchers/Cargo.toml | 10 +++++----- crates/binstalk-git-repo-api/CHANGELOG.md | 6 ++++++ crates/binstalk-git-repo-api/Cargo.toml | 6 +++--- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 8 ++++---- crates/binstalk-registry/CHANGELOG.md | 6 ++++++ crates/binstalk-registry/Cargo.toml | 10 +++++----- crates/binstalk-types/CHANGELOG.md | 6 ++++++ crates/binstalk-types/Cargo.toml | 2 +- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 18 ++++++++--------- crates/cargo-toml-workspace/CHANGELOG.md | 6 ++++++ crates/cargo-toml-workspace/Cargo.toml | 2 +- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- crates/fs-lock/CHANGELOG.md | 6 ++++++ crates/fs-lock/Cargo.toml | 2 +- 26 files changed, 122 insertions(+), 49 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f8f636f2..6773e9eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -242,7 +242,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.27" +version = "0.28.28" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -274,7 +274,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.6.11" +version = "0.6.12" dependencies = [ "atomic-file-install", "binstalk-types", @@ -288,7 +288,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.13.13" +version = "0.13.14" dependencies = [ "async-compression", "async-trait", @@ -324,7 +324,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.10.14" +version = "0.10.15" dependencies = [ "async-trait", "binstalk-downloader", @@ -348,7 +348,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.15" +version = "0.5.16" dependencies = [ "binstalk-downloader", "compact_str", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.24" +version = "0.15.25" dependencies = [ "beef", "binstalk-types", @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.11.14" +version = "0.11.15" dependencies = [ "async-trait", "base16", @@ -415,7 +415,7 @@ dependencies = [ [[package]] name = "binstalk-types" -version = "0.9.3" +version = "0.9.4" dependencies = [ "compact_str", "maybe-owned", @@ -588,7 +588,7 @@ dependencies = [ [[package]] name = "cargo-toml-workspace" -version = "7.0.4" +version = "7.0.5" dependencies = [ "cargo_toml", "compact_str", @@ -919,7 +919,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.43" +version = "0.1.44" dependencies = [ "cfg-if", "guess_host_triple", @@ -931,7 +931,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.24" +version = "1.0.25" dependencies = [ "tempfile", ] @@ -1150,7 +1150,7 @@ dependencies = [ [[package]] name = "fs-lock" -version = "0.1.8" +version = "0.1.9" dependencies = [ "fs4", "tracing", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 49db729a..2aa1c8dd 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,8 +23,8 @@ pkg-fmt = "zip" [dependencies] atomic-file-install = { version = "1.0.10", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.27", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.24" } +binstalk = { path = "../binstalk", version = "0.28.28", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.25" } clap = { version = "4.5.3", features = ["derive", "env", "wrap_help"] } clap-cargo = "0.15.2" compact_str = "0.9.0" diff --git a/crates/binstalk-bins/CHANGELOG.md b/crates/binstalk-bins/CHANGELOG.md index 2e5711e7..12bc4bff 100644 --- a/crates/binstalk-bins/CHANGELOG.md +++ b/crates/binstalk-bins/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.6.12](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.11...binstalk-bins-v0.6.12) - 2025-03-07 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#2072](https://github.com/cargo-bins/cargo-binstall/pull/2072)) + ## [0.6.11](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.10...binstalk-bins-v0.6.11) - 2025-02-22 ### Other diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 08e9dfd6..658e6f22 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.6.11" +version = "0.6.12" edition = "2021" description = "The binstall binaries discovery and installation crate." @@ -12,7 +12,7 @@ license = "GPL-3.0-only" [dependencies] atomic-file-install = { version = "1.0.10", path = "../atomic-file-install" } -binstalk-types = { version = "0.9.3", path = "../binstalk-types" } +binstalk-types = { version = "0.9.4", path = "../binstalk-types" } compact_str = { version = "0.9.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" diff --git a/crates/binstalk-downloader/CHANGELOG.md b/crates/binstalk-downloader/CHANGELOG.md index ba6a34e3..dd26344b 100644 --- a/crates/binstalk-downloader/CHANGELOG.md +++ b/crates/binstalk-downloader/CHANGELOG.md @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.13.14](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.13...binstalk-downloader-v0.13.14) - 2025-03-07 + +### Other + +- Use bzip2/libbz2-rs-sys ([#2071](https://github.com/cargo-bins/cargo-binstall/pull/2071)) +- *(deps)* bump the deps group with 3 updates ([#2072](https://github.com/cargo-bins/cargo-binstall/pull/2072)) + ## [0.13.13](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.12...binstalk-downloader-v0.13.13) - 2025-02-28 ### Other diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 01de29c6..d6ef0245 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.13.13" +version = "0.13.14" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -18,7 +18,7 @@ async-compression = { version = "0.4.4", features = [ "bzip2", "tokio", ] } -binstalk-types = { version = "0.9.3", path = "../binstalk-types" } +binstalk-types = { version = "0.9.4", path = "../binstalk-types" } bytes = "1.4.0" bzip2 = { version = "0.5.2", default-features = false, features = [ "libbz2-rs-sys", diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index 33a2558b..0d4fb5d1 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.15](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.14...binstalk-fetchers-v0.10.15) - 2025-03-07 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#2072](https://github.com/cargo-bins/cargo-binstall/pull/2072)) + ## [0.10.14](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.13...binstalk-fetchers-v0.10.14) - 2025-02-28 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index c12fc77b..2b7175ca 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.10.14" +version = "0.10.15" edition = "2021" description = "The binstall fetchers" @@ -12,9 +12,9 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.84" -binstalk-downloader = { version = "0.13.13", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.15", path = "../binstalk-git-repo-api" } -binstalk-types = { version = "0.9.3", path = "../binstalk-types" } +binstalk-downloader = { version = "0.13.14", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.16", path = "../binstalk-git-repo-api" } +binstalk-types = { version = "0.9.4", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.9.0" } either = "1.11.0" @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.5.4" [dev-dependencies] -binstalk-downloader = { version = "0.13.13", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.14", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index a77bff45..b1852bb6 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.16](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.15...binstalk-git-repo-api-v0.5.16) - 2025-03-07 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#2072](https://github.com/cargo-bins/cargo-binstall/pull/2072)) + ## [0.5.15](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.14...binstalk-git-repo-api-v0.5.15) - 2025-02-28 ### Other diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index a8a314c7..7c6c7df2 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.15" +version = "0.5.16" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.13.13", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.14", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.9.0" @@ -25,6 +25,6 @@ url = "2.5.4" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.13", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.14", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index c76e9f90..ad888881 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.25](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.24...binstalk-manifests-v0.15.25) - 2025-03-07 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#2072](https://github.com/cargo-bins/cargo-binstall/pull/2072)) + ## [0.15.24](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.23...binstalk-manifests-v0.15.24) - 2025-02-28 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index f83e3882..bc38865f 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.24" +version = "0.15.25" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -11,9 +11,9 @@ license = "Apache-2.0 OR MIT" [dependencies] beef = { version = "0.5.2", features = ["impl_serde"] } -binstalk-types = { version = "0.9.3", path = "../binstalk-types" } +binstalk-types = { version = "0.9.4", path = "../binstalk-types" } compact_str = { version = "0.9.0", features = ["serde"] } -fs-lock = { version = "0.1.8", path = "../fs-lock", features = ["tracing"] } +fs-lock = { version = "0.1.9", path = "../fs-lock", features = ["tracing"] } home = "0.5.9" miette = "7.0.0" semver = { version = "1.0.17", features = ["serde"] } @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.43", path = "../detect-targets" } +detect-targets = { version = "0.1.44", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md index e4bdede5..b44e848f 100644 --- a/crates/binstalk-registry/CHANGELOG.md +++ b/crates/binstalk-registry/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.15](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.14...binstalk-registry-v0.11.15) - 2025-03-07 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#2072](https://github.com/cargo-bins/cargo-binstall/pull/2072)) + ## [0.11.14](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.13...binstalk-registry-v0.11.14) - 2025-02-28 ### Other diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 886bdd5b..f7211b6c 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.11.14" +version = "0.11.15" edition = "2021" rust-version = "1.65.0" @@ -13,11 +13,11 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.84" base16 = "0.2.1" -binstalk-downloader = { version = "0.13.13", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.14", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } -binstalk-types = { version = "0.9.3", path = "../binstalk-types" } -cargo-toml-workspace = { version = "7.0.4", path = "../cargo-toml-workspace" } +binstalk-types = { version = "0.9.4", path = "../binstalk-types" } +cargo-toml-workspace = { version = "7.0.5", path = "../cargo-toml-workspace" } compact_str = { version = "0.9.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" @@ -40,7 +40,7 @@ url = "2.5.4" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.13.13", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.14", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk-types/CHANGELOG.md b/crates/binstalk-types/CHANGELOG.md index 0f52cad8..8d7e76d6 100644 --- a/crates/binstalk-types/CHANGELOG.md +++ b/crates/binstalk-types/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.9.4](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-types-v0.9.3...binstalk-types-v0.9.4) - 2025-03-07 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#2072](https://github.com/cargo-bins/cargo-binstall/pull/2072)) + ## [0.9.3](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-types-v0.9.2...binstalk-types-v0.9.3) - 2025-02-11 ### Other diff --git a/crates/binstalk-types/Cargo.toml b/crates/binstalk-types/Cargo.toml index b0ca6a48..70f83f2e 100644 --- a/crates/binstalk-types/Cargo.toml +++ b/crates/binstalk-types/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-types" description = "The binstall toolkit that contains basic types for binstalk crates" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-types" -version = "0.9.3" +version = "0.9.4" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index 88b532bd..c7f1d973 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.28](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.27...binstalk-v0.28.28) - 2025-03-07 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#2072](https://github.com/cargo-bins/cargo-binstall/pull/2072)) + ## [0.28.27](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.26...binstalk-v0.28.27) - 2025-02-28 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index dce8a49e..cf768975 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,25 +3,25 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.27" +version = "0.28.28" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.6.11", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.13.13", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.15", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.10.14", path = "../binstalk-fetchers", features = [ +binstalk-bins = { version = "0.6.12", path = "../binstalk-bins" } +binstalk-downloader = { version = "0.13.14", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.16", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.10.15", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.11.14", path = "../binstalk-registry" } -binstalk-types = { version = "0.9.3", path = "../binstalk-types" } -cargo-toml-workspace = { version = "7.0.4", path = "../cargo-toml-workspace" } +binstalk-registry = { version = "0.11.15", path = "../binstalk-registry" } +binstalk-types = { version = "0.9.4", path = "../binstalk-types" } +cargo-toml-workspace = { version = "7.0.5", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.9.0", features = ["serde"] } -detect-targets = { version = "0.1.43", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.44", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/cargo-toml-workspace/CHANGELOG.md b/crates/cargo-toml-workspace/CHANGELOG.md index 5ebea8e7..bff88ca2 100644 --- a/crates/cargo-toml-workspace/CHANGELOG.md +++ b/crates/cargo-toml-workspace/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [7.0.5](https://github.com/cargo-bins/cargo-binstall/compare/cargo-toml-workspace-v7.0.4...cargo-toml-workspace-v7.0.5) - 2025-03-07 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#2072](https://github.com/cargo-bins/cargo-binstall/pull/2072)) + ## [7.0.4](https://github.com/cargo-bins/cargo-binstall/compare/cargo-toml-workspace-v7.0.3...cargo-toml-workspace-v7.0.4) - 2025-01-19 ### Other diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index e3bd5f6f..df86352e 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-toml-workspace" -version = "7.0.4" +version = "7.0.5" edition = "2021" description = "Parse cargo workspace and load specific crate" repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index 82189757..2208d719 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.44](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.43...detect-targets-v0.1.44) - 2025-03-07 + +### Other + +- Fix detect-targets musl fallback for android and alpine ([#2076](https://github.com/cargo-bins/cargo-binstall/pull/2076)) + ## [0.1.43](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.42...detect-targets-v0.1.43) - 2025-02-28 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index e461ef1e..08a85ea3 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.43" +version = "0.1.44" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index 2fbda866..29c7b634 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.25](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.24...detect-wasi-v1.0.25) - 2025-03-07 + +### Other + +- update Cargo.lock dependencies + ## [1.0.24](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.23...detect-wasi-v1.0.24) - 2025-02-28 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index c97e8fdc..d187cf16 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.24" +version = "1.0.25" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" diff --git a/crates/fs-lock/CHANGELOG.md b/crates/fs-lock/CHANGELOG.md index c58488df..feb14406 100644 --- a/crates/fs-lock/CHANGELOG.md +++ b/crates/fs-lock/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.9](https://github.com/cargo-bins/cargo-binstall/compare/fs-lock-v0.1.8...fs-lock-v0.1.9) - 2025-03-07 + +### Other + +- *(deps)* bump the deps group with 3 updates ([#2072](https://github.com/cargo-bins/cargo-binstall/pull/2072)) + ## [0.1.8](https://github.com/cargo-bins/cargo-binstall/compare/fs-lock-v0.1.7...fs-lock-v0.1.8) - 2025-02-22 ### Other diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index c690c59e..366cc721 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -3,7 +3,7 @@ name = "fs-lock" description = "Locked files that can be used like normal File" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/fs-lock" -version = "0.1.8" +version = "0.1.9" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From acd08f184561622f67f0e4406a62a10f656777a9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 7 Mar 2025 14:58:55 +0000 Subject: [PATCH 1995/2020] release: cargo-binstall v1.12.0 (#2078) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6773e9eb..41ca1bbf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -547,7 +547,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.11.2" +version = "1.12.0" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 2aa1c8dd..6ac1e35a 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.11.2" +version = "1.12.0" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 2db0f5b1..9f21fcf3 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From ed230386144099a0923e77fb3d70d9fbba42174e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 8 Mar 2025 12:18:01 +1000 Subject: [PATCH 1996/2020] build(deps): bump tokio from 1.43.0 to 1.44.0 in the deps group (#2079) Bumps the deps group with 1 update: [tokio](https://github.com/tokio-rs/tokio). Updates `tokio` from 1.43.0 to 1.44.0 - [Release notes](https://github.com/tokio-rs/tokio/releases) - [Commits](https://github.com/tokio-rs/tokio/compare/tokio-1.43.0...tokio-1.44.0) --- updated-dependencies: - dependency-name: tokio dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- crates/bin/Cargo.toml | 2 +- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-git-repo-api/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/binstalk/Cargo.toml | 2 +- crates/detect-targets/Cargo.toml | 4 ++-- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 41ca1bbf..d4049711 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4391,9 +4391,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.43.0" +version = "1.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d61fa4ffa3de412bfea335c6ecff681de2b609ba3c77ef3e00e521813a9ed9e" +checksum = "9975ea0f48b5aa3972bf2d888c238182458437cc2a19374b81b25cdf1023fb3a" dependencies = [ "backtrace", "bytes", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 6ac1e35a..f8f569da 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -40,7 +40,7 @@ strum = "0.27.0" strum_macros = "0.27.0" supports-color = "3.0.0" tempfile = "3.5.0" -tokio = { version = "1.35.0", features = ["rt-multi-thread", "signal"], default-features = false } +tokio = { version = "1.44.0", features = ["rt-multi-thread", "signal"], default-features = false } tracing = { version = "0.1.39", default-features = false } tracing-core = "0.1.32" tracing-log = { version = "0.2.0", default-features = false } diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index d6ef0245..20b56ead 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -53,7 +53,7 @@ serde_json = { version = "1.0.107", optional = true } tar = { package = "binstall-tar", version = "0.4.39" } tempfile = "3.5.0" thiserror = "2.0.11" -tokio = { version = "1.35.0", features = [ +tokio = { version = "1.44.0", features = [ "macros", "rt-multi-thread", "sync", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 2b7175ca..0817836c 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -26,7 +26,7 @@ minisign-verify = "0.2.1" once_cell = "1.18.0" strum = "0.27.0" thiserror = "2.0.11" -tokio = { version = "1.35.0", features = [ +tokio = { version = "1.44.0", features = [ "rt", "sync", ], default-features = false } diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 7c6c7df2..3f46cb08 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -19,7 +19,7 @@ serde = { version = "1.0.163", features = ["derive"] } serde-tuple-vec-map = "1.0.1" serde_json = { version = "1.0.107" } thiserror = "2.0.11" -tokio = { version = "1.35.0", features = ["sync"], default-features = false } +tokio = { version = "1.44.0", features = ["sync"], default-features = false } tracing = "0.1.39" url = "2.5.4" zeroize = "1.8.1" diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index f7211b6c..47fbf9bd 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -30,7 +30,7 @@ sha2 = "0.10.7" simple-git = { version = "0.2.4", optional = true } tempfile = "3.5.0" thiserror = "2.0.11" -tokio = { version = "1.35.0", features = [ +tokio = { version = "1.44.0", features = [ "rt", "sync", ], default-features = false } diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index cf768975..29b13a76 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -36,7 +36,7 @@ strum = "0.27.0" target-lexicon = { version = "0.13.0", features = ["std"] } tempfile = "3.5.0" thiserror = "2.0.11" -tokio = { version = "1.35.0", features = [ +tokio = { version = "1.44.0", features = [ "rt", "process", "sync", diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 08a85ea3..07ec2d32 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -tokio = { version = "1.35.0", features = [ +tokio = { version = "1.44.0", features = [ "rt", "process", "sync", @@ -35,7 +35,7 @@ windows-sys = { version = "0.59.0", features = [ ] } [dev-dependencies] -tokio = { version = "1.35.0", features = ["macros"], default-features = false } +tokio = { version = "1.44.0", features = ["macros"], default-features = false } [package.metadata.binstall] pkg-url = "{ repo }/releases/download/v{ version }/cargo-binstall-{ target }.full.{ archive-format }" From 17c2ba863baee8edf4808ab7ee86294c36528129 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 14 Mar 2025 07:02:47 +0000 Subject: [PATCH 1997/2020] dep: Upgrade transitive dependencies (#2083) Co-authored-by: github-actions --- Cargo.lock | 234 ++++++++++++++++++++++++++++++++++------------------- 1 file changed, 151 insertions(+), 83 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d4049711..9f96dc3a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -678,9 +678,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.31" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "027bb0d98429ae334a8698531da7077bdf906419543a35a55c2cb1b66437d767" +checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" dependencies = [ "clap_builder", "clap_derive", @@ -698,9 +698,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.31" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5589e0cba072e0f3d23791efac0fd8627b49c829c196a492e88168e6a669d863" +checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" dependencies = [ "anstream", "anstyle", @@ -711,9 +711,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.28" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4ced95c6f4a675af3da73304b9ac4ed991640c36374e4b46795c49e17cf1ed" +checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" dependencies = [ "heck", "proc-macro2", @@ -1158,11 +1158,11 @@ dependencies = [ [[package]] name = "fs4" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be058769cf1633370c3d0dac6bb9b223b8f18900cf808abadf7843192e706238" +checksum = "8640e34b88f7652208ce9e88b1a37a2ae95227d84abec377ccd3c5cfeb141ed4" dependencies = [ - "rustix 0.38.44", + "rustix 1.0.2", "windows-sys 0.59.0", ] @@ -2242,20 +2242,20 @@ dependencies = [ [[package]] name = "hostname" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c731c3e10504cc8ed35cfe2f1db4c9274c3d35fa486e3b31df46f068ef3e867" +checksum = "f9c7c7c8ac16c798734b8a24560c1362120597c40d5e1459f09498f8f6c8f2ba" dependencies = [ + "cfg-if", "libc", - "match_cfg", - "winapi", + "windows 0.52.0", ] [[package]] name = "http" -version = "1.2.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f16ca2af56261c99fba8bac40a10251ce8188205a4c448fbb745a2e4daa76fea" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" dependencies = [ "bytes", "fnv", @@ -2274,12 +2274,12 @@ dependencies = [ [[package]] name = "http-body-util" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", - "futures-util", + "futures-core", "http", "http-body", "pin-project-lite", @@ -2518,9 +2518,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.1" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -2689,9 +2689,9 @@ checksum = "0864a00c8d019e36216b69c2c4ce50b83b7bd966add3cf5ba554ec44f8bebcf5" [[package]] name = "libc" -version = "0.2.170" +version = "0.2.171" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "875b3680cb2f8f71bdcf9a30f38d48282f5d3c95cbf9b3fa57269bb5d5c06828" +checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "libmimalloc-sys" @@ -2801,12 +2801,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "match_cfg" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4" - [[package]] name = "matchers" version = "0.1.0" @@ -3115,9 +3109,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.20.3" +version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "945462a4b81e43c4e3ba96bd7b49d834c6f61198356aa858733bc4acf3cbe62e" +checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" [[package]] name = "openssl" @@ -3343,11 +3337,11 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.7.35", + "zerocopy 0.8.23", ] [[package]] @@ -3393,9 +3387,9 @@ dependencies = [ [[package]] name = "prodash" -version = "29.0.0" +version = "29.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a266d8d6020c61a437be704c5e618037588e1985c7dbb7bf8d265db84cffe325" +checksum = "9ee7ce24c980b976607e2d6ae4aae92827994d23fed71659c3ede3f92528b58b" dependencies = [ "bytesize", "human_format", @@ -3403,12 +3397,6 @@ dependencies = [ "parking_lot", ] -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - [[package]] name = "quinn" version = "0.11.6" @@ -3464,9 +3452,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.39" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1f1914ce909e1658d9907913b4b91947430c7d9be598b15a1912935b8c04801" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] @@ -3598,13 +3586,13 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9efd944f26afa2406cbbabff39fac533c9bc24b13d7f1f12e14ae3e7bdc66cdb" +checksum = "4b86038e146b9a61557e1a2e58cdf2eddc0b46ce141b55541b1c1b9f3189d618" dependencies = [ "cfg-if", "libc", - "rustix 0.38.44", + "rustix 1.0.2", "windows 0.60.0", ] @@ -3654,9 +3642,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.12" +version = "0.12.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" +checksum = "989e327e510263980e231de548a33e63d34962d29ae61b467389a1a09627a254" dependencies = [ "async-compression", "base64", @@ -3711,19 +3699,18 @@ dependencies = [ [[package]] name = "resolv-conf" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52e44394d2086d010551b14b53b1f24e31647570cd1deb0379e2c21b329aba00" +checksum = "48375394603e3dd4b2d64371f7148fd8c7baa2680e28741f2cb8d23b59e3d4c4" dependencies = [ "hostname", - "quick-error", ] [[package]] name = "ring" -version = "0.17.13" +version = "0.17.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ac5d832aa16abd7d1def883a8545280c20a60f523a370aa3a9617c2b8550ee" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", @@ -3769,9 +3756,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17f8dcd64f141950290e45c99f7710ede1b600297c91818bb30b3667c0f45dc0" +checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825" dependencies = [ "bitflags 2.9.0", "errno 0.3.10", @@ -3925,9 +3912,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.218" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8dfc9d19bdbf6d17e22319da49161d5d0108e4188e8b680aef6299eed22df60" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] @@ -3943,9 +3930,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.218" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f09503e191f4e797cb8aac08e9a4a4695c5edf6a2e70e376d961ddd5c969f82b" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", @@ -4164,9 +4151,9 @@ checksum = "b7401a30af6cb5818bb64852270bb722533397edcfc7344954a38f420819ece2" [[package]] name = "syn" -version = "2.0.99" +version = "2.0.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e02e925281e18ffd9d640e234264753c43edc62d64b2d4cf898f1bc5e75f3fc2" +checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" dependencies = [ "proc-macro2", "quote", @@ -4249,25 +4236,24 @@ checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" [[package]] name = "tempfile" -version = "3.18.0" +version = "3.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c317e0a526ee6120d8dabad239c8dadca62b24b6f168914bbbc8e2fb1f0e567" +checksum = "488960f40a3fd53d72c2a29a58722561dee8afdd175bd88e3db4677d7b2ba600" dependencies = [ - "cfg-if", "fastrand", "getrandom 0.3.1", "once_cell", - "rustix 1.0.0", + "rustix 1.0.2", "windows-sys 0.59.0", ] [[package]] name = "terminal_size" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5352447f921fda68cf61b4101566c0bdb5104eff6804d0678e5227580ab6a4e9" +checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" dependencies = [ - "rustix 0.38.44", + "rustix 1.0.2", "windows-sys 0.59.0", ] @@ -4391,9 +4377,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.44.0" +version = "1.44.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9975ea0f48b5aa3972bf2d888c238182458437cc2a19374b81b25cdf1023fb3a" +checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" dependencies = [ "backtrace", "bytes", @@ -4465,9 +4451,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.13" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7fcaa8d55a2bdd6b83ace262b016eca0d79ee02818c5c1bcdf0305114081078" +checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034" dependencies = [ "bytes", "futures-core", @@ -4507,7 +4493,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.7.3", + "winnow 0.7.4", ] [[package]] @@ -4963,6 +4949,16 @@ dependencies = [ "windows-targets 0.48.5", ] +[[package]] +name = "windows" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" +dependencies = [ + "windows-core 0.52.0", + "windows-targets 0.52.6", +] + [[package]] name = "windows" version = "0.58.0" @@ -4995,6 +4991,15 @@ dependencies = [ "windows-core 0.60.1", ] +[[package]] +name = "windows-core" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +dependencies = [ + "windows-targets 0.52.6", +] + [[package]] name = "windows-core" version = "0.58.0" @@ -5093,13 +5098,13 @@ dependencies = [ [[package]] name = "windows-registry" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" dependencies = [ - "windows-result 0.2.0", - "windows-strings 0.1.0", - "windows-targets 0.52.6", + "windows-result 0.3.1", + "windows-strings 0.3.1", + "windows-targets 0.53.0", ] [[package]] @@ -5190,13 +5195,29 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -5209,6 +5230,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -5221,6 +5248,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -5233,12 +5266,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -5251,6 +5296,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -5263,6 +5314,12 @@ 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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -5275,6 +5332,12 @@ 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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -5287,6 +5350,12 @@ 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.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "winnow" version = "0.5.40" @@ -5307,9 +5376,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.3" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7f4ea97f6f78012141bcdb6a216b2609f0979ada50b20ca5b52dde2eac2bb1" +checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" dependencies = [ "memchr", ] @@ -5362,7 +5431,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d65cbf2f12c15564212d48f4e3dfb87923d25d611f2aed18f4cb23f0413d89e" dependencies = [ "libc", - "rustix 1.0.0", + "rustix 1.0.2", ] [[package]] @@ -5404,7 +5473,6 @@ version = "0.7.35" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" dependencies = [ - "byteorder", "zerocopy-derive 0.7.35", ] From 120bca5a45da6fad1a41618025bff088af73366f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 15 Mar 2025 01:25:01 +0000 Subject: [PATCH 1998/2020] build(deps): bump the deps group with 2 updates (#2084) Bumps the deps group with 2 updates: [async-trait](https://github.com/dtolnay/async-trait) and [cargo_toml](https://gitlab.com/lib.rs/cargo_toml). Updates `async-trait` from 0.1.87 to 0.1.88 - [Release notes](https://github.com/dtolnay/async-trait/releases) - [Commits](https://github.com/dtolnay/async-trait/compare/0.1.87...0.1.88) Updates `cargo_toml` from 0.21.0 to 0.22.1 - [Commits](https://gitlab.com/lib.rs/cargo_toml/commits/v0.22.1) --- updated-dependencies: - dependency-name: async-trait dependency-type: direct:production update-type: version-update:semver-patch dependency-group: deps - dependency-name: cargo_toml dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/Cargo.toml | 2 +- crates/binstalk-registry/Cargo.toml | 2 +- crates/cargo-toml-workspace/Cargo.toml | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9f96dc3a..41e9c515 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -164,9 +164,9 @@ dependencies = [ [[package]] name = "async-trait" -version = "0.1.87" +version = "0.1.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d556ec1359574147ec0c4fc5eb525f3f23263a592b1a9c07e0a75b427de55c97" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", @@ -616,9 +616,9 @@ dependencies = [ [[package]] name = "cargo_toml" -version = "0.21.0" +version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fbd1fe9db3ebf71b89060adaf7b0504c2d6a425cf061313099547e382c2e472" +checksum = "02260d489095346e5cafd04dea8e8cb54d1d74fcd759022a9b72986ebe9a1257" dependencies = [ "serde", "toml", diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 20b56ead..fad86382 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -10,7 +10,7 @@ edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -async-trait = "0.1.84" +async-trait = "0.1.88" async-compression = { version = "0.4.4", features = [ "gzip", "zstd", diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 0817836c..8b2e2606 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -11,7 +11,7 @@ authors = ["Jiahao XU "] license = "GPL-3.0-only" [dependencies] -async-trait = "0.1.84" +async-trait = "0.1.88" binstalk-downloader = { version = "0.13.14", path = "../binstalk-downloader", default-features = false } binstalk-git-repo-api = { version = "0.5.16", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.9.4", path = "../binstalk-types" } diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 47fbf9bd..778f3242 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -11,7 +11,7 @@ authors = ["Jiahao_XU@outlook "] license = "Apache-2.0 OR MIT" [dependencies] -async-trait = "0.1.84" +async-trait = "0.1.88" base16 = "0.2.1" binstalk-downloader = { version = "0.13.14", path = "../binstalk-downloader", default-features = false, features = [ "json", diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index df86352e..3a1d30e3 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -10,7 +10,7 @@ authors = ["Jiahao XU "] license = "Apache-2.0 OR MIT" [dependencies] -cargo_toml = "0.21.0" +cargo_toml = "0.22.1" compact_str = { version = "0.9.0", features = ["serde"] } glob = "0.3.1" normalize-path = { version = "0.2.1", path = "../normalize-path" } From e2ef5918cfe7391c4649430196353b96ceeba34d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 15 Mar 2025 03:38:12 +0000 Subject: [PATCH 1999/2020] chore: release (#2080) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 18 +++++++++--------- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-downloader/CHANGELOG.md | 7 +++++++ crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/CHANGELOG.md | 7 +++++++ crates/binstalk-fetchers/Cargo.toml | 8 ++++---- crates/binstalk-git-repo-api/CHANGELOG.md | 6 ++++++ crates/binstalk-git-repo-api/Cargo.toml | 6 +++--- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk-registry/CHANGELOG.md | 7 +++++++ crates/binstalk-registry/Cargo.toml | 8 ++++---- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 14 +++++++------- crates/cargo-toml-workspace/CHANGELOG.md | 6 ++++++ crates/cargo-toml-workspace/Cargo.toml | 2 +- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- 20 files changed, 92 insertions(+), 35 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 41e9c515..f08124ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -242,7 +242,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.28" +version = "0.28.29" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -288,7 +288,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.13.14" +version = "0.13.15" dependencies = [ "async-compression", "async-trait", @@ -324,7 +324,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.10.15" +version = "0.10.16" dependencies = [ "async-trait", "binstalk-downloader", @@ -348,7 +348,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.16" +version = "0.5.17" dependencies = [ "binstalk-downloader", "compact_str", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.25" +version = "0.15.26" dependencies = [ "beef", "binstalk-types", @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.11.15" +version = "0.11.16" dependencies = [ "async-trait", "base16", @@ -588,7 +588,7 @@ dependencies = [ [[package]] name = "cargo-toml-workspace" -version = "7.0.5" +version = "7.0.6" dependencies = [ "cargo_toml", "compact_str", @@ -919,7 +919,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.44" +version = "0.1.45" dependencies = [ "cfg-if", "guess_host_triple", @@ -931,7 +931,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.25" +version = "1.0.26" dependencies = [ "tempfile", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index f8f569da..411cf13d 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,8 +23,8 @@ pkg-fmt = "zip" [dependencies] atomic-file-install = { version = "1.0.10", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.28", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.25" } +binstalk = { path = "../binstalk", version = "0.28.29", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.26" } clap = { version = "4.5.3", features = ["derive", "env", "wrap_help"] } clap-cargo = "0.15.2" compact_str = "0.9.0" diff --git a/crates/binstalk-downloader/CHANGELOG.md b/crates/binstalk-downloader/CHANGELOG.md index dd26344b..2ac2413c 100644 --- a/crates/binstalk-downloader/CHANGELOG.md +++ b/crates/binstalk-downloader/CHANGELOG.md @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.13.15](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.14...binstalk-downloader-v0.13.15) - 2025-03-15 + +### Other + +- *(deps)* bump the deps group with 2 updates ([#2084](https://github.com/cargo-bins/cargo-binstall/pull/2084)) +- *(deps)* bump tokio from 1.43.0 to 1.44.0 in the deps group ([#2079](https://github.com/cargo-bins/cargo-binstall/pull/2079)) + ## [0.13.14](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.13...binstalk-downloader-v0.13.14) - 2025-03-07 ### Other diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index fad86382..353c3edd 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.13.14" +version = "0.13.15" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index 0d4fb5d1..ebdfcf91 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.16](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.15...binstalk-fetchers-v0.10.16) - 2025-03-15 + +### Other + +- *(deps)* bump the deps group with 2 updates ([#2084](https://github.com/cargo-bins/cargo-binstall/pull/2084)) +- *(deps)* bump tokio from 1.43.0 to 1.44.0 in the deps group ([#2079](https://github.com/cargo-bins/cargo-binstall/pull/2079)) + ## [0.10.15](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.14...binstalk-fetchers-v0.10.15) - 2025-03-07 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 8b2e2606..b170d182 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.10.15" +version = "0.10.16" edition = "2021" description = "The binstall fetchers" @@ -12,8 +12,8 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.88" -binstalk-downloader = { version = "0.13.14", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.16", path = "../binstalk-git-repo-api" } +binstalk-downloader = { version = "0.13.15", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.17", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.9.4", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.9.0" } @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.5.4" [dev-dependencies] -binstalk-downloader = { version = "0.13.14", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.15", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index b1852bb6..bb7623c7 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.17](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.16...binstalk-git-repo-api-v0.5.17) - 2025-03-15 + +### Other + +- *(deps)* bump tokio from 1.43.0 to 1.44.0 in the deps group ([#2079](https://github.com/cargo-bins/cargo-binstall/pull/2079)) + ## [0.5.16](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.15...binstalk-git-repo-api-v0.5.16) - 2025-03-07 ### Other diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index 3f46cb08..e6893cc3 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.16" +version = "0.5.17" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.13.14", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.15", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.9.0" @@ -25,6 +25,6 @@ url = "2.5.4" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.14", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.15", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index ad888881..67c5506c 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.26](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.25...binstalk-manifests-v0.15.26) - 2025-03-15 + +### Other + +- updated the following local packages: detect-targets + ## [0.15.25](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.24...binstalk-manifests-v0.15.25) - 2025-03-07 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index bc38865f..833531f6 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.25" +version = "0.15.26" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.44", path = "../detect-targets" } +detect-targets = { version = "0.1.45", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md index b44e848f..ae525d81 100644 --- a/crates/binstalk-registry/CHANGELOG.md +++ b/crates/binstalk-registry/CHANGELOG.md @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.16](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.15...binstalk-registry-v0.11.16) - 2025-03-15 + +### Other + +- *(deps)* bump the deps group with 2 updates ([#2084](https://github.com/cargo-bins/cargo-binstall/pull/2084)) +- *(deps)* bump tokio from 1.43.0 to 1.44.0 in the deps group ([#2079](https://github.com/cargo-bins/cargo-binstall/pull/2079)) + ## [0.11.15](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.14...binstalk-registry-v0.11.15) - 2025-03-07 ### Other diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 778f3242..2669a1d2 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.11.15" +version = "0.11.16" edition = "2021" rust-version = "1.65.0" @@ -13,11 +13,11 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.88" base16 = "0.2.1" -binstalk-downloader = { version = "0.13.14", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.15", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.9.4", path = "../binstalk-types" } -cargo-toml-workspace = { version = "7.0.5", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "7.0.6", path = "../cargo-toml-workspace" } compact_str = { version = "0.9.0", features = ["serde"] } leon = "3.0.0" miette = "7.0.0" @@ -40,7 +40,7 @@ url = "2.5.4" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.13.14", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.15", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index c7f1d973..29efefb9 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.29](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.28...binstalk-v0.28.29) - 2025-03-15 + +### Other + +- *(deps)* bump tokio from 1.43.0 to 1.44.0 in the deps group ([#2079](https://github.com/cargo-bins/cargo-binstall/pull/2079)) + ## [0.28.28](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.27...binstalk-v0.28.28) - 2025-03-07 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 29b13a76..76abe744 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.28" +version = "0.28.29" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -11,17 +11,17 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.6.12", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.13.14", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.16", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.10.15", path = "../binstalk-fetchers", features = [ +binstalk-downloader = { version = "0.13.15", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.17", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.10.16", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.11.15", path = "../binstalk-registry" } +binstalk-registry = { version = "0.11.16", path = "../binstalk-registry" } binstalk-types = { version = "0.9.4", path = "../binstalk-types" } -cargo-toml-workspace = { version = "7.0.5", path = "../cargo-toml-workspace" } +cargo-toml-workspace = { version = "7.0.6", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.9.0", features = ["serde"] } -detect-targets = { version = "0.1.44", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.45", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/cargo-toml-workspace/CHANGELOG.md b/crates/cargo-toml-workspace/CHANGELOG.md index bff88ca2..a0846372 100644 --- a/crates/cargo-toml-workspace/CHANGELOG.md +++ b/crates/cargo-toml-workspace/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [7.0.6](https://github.com/cargo-bins/cargo-binstall/compare/cargo-toml-workspace-v7.0.5...cargo-toml-workspace-v7.0.6) - 2025-03-15 + +### Other + +- *(deps)* bump the deps group with 2 updates ([#2084](https://github.com/cargo-bins/cargo-binstall/pull/2084)) + ## [7.0.5](https://github.com/cargo-bins/cargo-binstall/compare/cargo-toml-workspace-v7.0.4...cargo-toml-workspace-v7.0.5) - 2025-03-07 ### Other diff --git a/crates/cargo-toml-workspace/Cargo.toml b/crates/cargo-toml-workspace/Cargo.toml index 3a1d30e3..0a7c62ac 100644 --- a/crates/cargo-toml-workspace/Cargo.toml +++ b/crates/cargo-toml-workspace/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cargo-toml-workspace" -version = "7.0.5" +version = "7.0.6" edition = "2021" description = "Parse cargo workspace and load specific crate" repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index 2208d719..bf837cdb 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.45](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.44...detect-targets-v0.1.45) - 2025-03-15 + +### Other + +- *(deps)* bump tokio from 1.43.0 to 1.44.0 in the deps group ([#2079](https://github.com/cargo-bins/cargo-binstall/pull/2079)) + ## [0.1.44](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.43...detect-targets-v0.1.44) - 2025-03-07 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index 07ec2d32..c054a06a 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.44" +version = "0.1.45" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index 29c7b634..297c5f50 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.26](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.25...detect-wasi-v1.0.26) - 2025-03-15 + +### Other + +- update Cargo.lock dependencies + ## [1.0.25](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.24...detect-wasi-v1.0.25) - 2025-03-07 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index d187cf16..4cade40f 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.25" +version = "1.0.26" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From e017e53588d17fb508d0a3ad79a16ae1d0fcc049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Saparelli?= Date: Sat, 15 Mar 2025 18:14:48 +1300 Subject: [PATCH 2000/2020] security: pin tj-actions/changed-files to a non-compromised commit (#2086) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit pin tj-actions/changed-files to a non-compromised commit https://www.stepsecurity.io/blog/harden-runner-detection-tj-actions-changed-files-action-is-compromised Signed-off-by: Félix Saparelli --- .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 b3602944..c52fe3e6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: - name: Get changed files id: changed-files - uses: tj-actions/changed-files@v45 + uses: tj-actions/changed-files@9200e69727eb73eb060652b19946b8a2fdfb654b with: dir_names: true dir_names_exclude_current_dir: true From 89e50159140fdba08fc64e36186a014c5c253d33 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 15 Mar 2025 06:13:23 +0000 Subject: [PATCH 2001/2020] release: cargo-binstall v1.12.1 (#2085) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f08124ef..502a811a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -547,7 +547,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.12.0" +version = "1.12.1" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 411cf13d..30efca8c 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.12.0" +version = "1.12.1" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 9f21fcf3..97300dc6 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From e24cc406c62635d312fd06da54c3ea704f497683 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 17 Mar 2025 15:11:09 +1300 Subject: [PATCH 2002/2020] build(deps): bump tj-actions/changed-files from 9200e69727eb73eb060652b19946b8a2fdfb654b to 531f5f7d163941f0c1c04e0ff4d8bb243ac4366f (#2087) build(deps): bump tj-actions/changed-files Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 9200e69727eb73eb060652b19946b8a2fdfb654b to 531f5f7d163941f0c1c04e0ff4d8bb243ac4366f. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/9200e69727eb73eb060652b19946b8a2fdfb654b...531f5f7d163941f0c1c04e0ff4d8bb243ac4366f) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .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 c52fe3e6..60f2d306 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: - name: Get changed files id: changed-files - uses: tj-actions/changed-files@9200e69727eb73eb060652b19946b8a2fdfb654b + uses: tj-actions/changed-files@531f5f7d163941f0c1c04e0ff4d8bb243ac4366f with: dir_names: true dir_names_exclude_current_dir: true From 2a0dbc27d2f6a9ac9ba2c0e797f0bb5230cb4859 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 18 Mar 2025 15:58:25 +1300 Subject: [PATCH 2003/2020] build(deps): bump tj-actions/changed-files from 531f5f7d163941f0c1c04e0ff4d8bb243ac4366f to 0fee5fb278312d962ff465bb38dc4cae9f446de2 (#2088) build(deps): bump tj-actions/changed-files Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 531f5f7d163941f0c1c04e0ff4d8bb243ac4366f to 0fee5fb278312d962ff465bb38dc4cae9f446de2. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/531f5f7d163941f0c1c04e0ff4d8bb243ac4366f...0fee5fb278312d962ff465bb38dc4cae9f446de2) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .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 60f2d306..8114965e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: - name: Get changed files id: changed-files - uses: tj-actions/changed-files@531f5f7d163941f0c1c04e0ff4d8bb243ac4366f + uses: tj-actions/changed-files@0fee5fb278312d962ff465bb38dc4cae9f446de2 with: dir_names: true dir_names_exclude_current_dir: true From 779094319006f777856bc3abc0b752527ffd7572 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Mar 2025 01:47:44 +0000 Subject: [PATCH 2004/2020] build(deps): bump tj-actions/changed-files from 0fee5fb278312d962ff465bb38dc4cae9f446de2 to 0b975f61488402a699abcebd6a1e25924cf85218 (#2092) build(deps): bump tj-actions/changed-files Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 0fee5fb278312d962ff465bb38dc4cae9f446de2 to 0b975f61488402a699abcebd6a1e25924cf85218. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/0fee5fb278312d962ff465bb38dc4cae9f446de2...0b975f61488402a699abcebd6a1e25924cf85218) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .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 8114965e..dfd78722 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: - name: Get changed files id: changed-files - uses: tj-actions/changed-files@0fee5fb278312d962ff465bb38dc4cae9f446de2 + uses: tj-actions/changed-files@0b975f61488402a699abcebd6a1e25924cf85218 with: dir_names: true dir_names_exclude_current_dir: true From d8ecdcaeec5c63f45d9087df820967486a5ede64 Mon Sep 17 00:00:00 2001 From: elsirion <84478054+elsirion@users.noreply.github.com> Date: Wed, 19 Mar 2025 12:41:51 +0300 Subject: [PATCH 2005/2020] fix: actually check if lock was acquired (#2091) --- crates/fs-lock/src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/fs-lock/src/lib.rs b/crates/fs-lock/src/lib.rs index f3c8ac8a..311c72d7 100644 --- a/crates/fs-lock/src/lib.rs +++ b/crates/fs-lock/src/lib.rs @@ -44,7 +44,8 @@ impl FileLock { /// Note that this operation is blocking, and should not be called in async contexts. pub fn new_try_exclusive(file: File) -> Result)> { match FileExt::try_lock_exclusive(&file) { - Ok(_) => Ok(Self::new(file)), + Ok(true) => Ok(Self::new(file)), + Ok(false) => Err((file, None)), Err(e) if e.raw_os_error() == fs4::lock_contended_error().raw_os_error() => { Err((file, None)) } @@ -70,7 +71,8 @@ impl FileLock { /// Note that this operation is blocking, and should not be called in async contexts. pub fn new_try_shared(file: File) -> Result)> { match FileExt::try_lock_shared(&file) { - Ok(_) => Ok(Self::new(file)), + Ok(true) => Ok(Self::new(file)), + Ok(false) => Err((file, None)), Err(e) if e.raw_os_error() == fs4::lock_contended_error().raw_os_error() => { Err((file, None)) } From ce998d1af4a4c08f4105742630eb1bc8a7257466 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Wed, 19 Mar 2025 23:33:44 +1000 Subject: [PATCH 2006/2020] dep: Bump hickory-resolver to 0.25.1 (#2096) * dep: Bump hickory-resolver to 0.25.0 Fix #2089 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix use of hickory-resolver features And bump hickory-resolver to 0.25.1 Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Update lockfile and bump transitive dependencies Signed-off-by: Jiahao XU * Fix use of hickory-dns updated API Signed-off-by: Jiahao XU --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Signed-off-by: Jiahao XU --- Cargo.lock | 263 ++++++++++++------ crates/binstalk-downloader/Cargo.toml | 10 +- .../src/remote/resolver.rs | 4 +- 3 files changed, 180 insertions(+), 97 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 502a811a..55a5b3f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -834,6 +834,12 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + [[package]] name = "crossbeam-channel" version = "0.5.14" @@ -899,9 +905,9 @@ checksum = "da692b8d1080ea3045efaab14434d40468c3d8657e42abddfffca87b428f4c1b" [[package]] name = "deranged" -version = "0.3.11" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" dependencies = [ "powerfmt", ] @@ -1162,7 +1168,7 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8640e34b88f7652208ce9e88b1a37a2ae95227d84abec377ccd3c5cfeb141ed4" dependencies = [ - "rustix 1.0.2", + "rustix 1.0.3", "windows-sys 0.59.0", ] @@ -1293,14 +1299,16 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" dependencies = [ "cfg-if", + "js-sys", "libc", - "wasi 0.13.3+wasi-0.2.2", - "windows-targets 0.52.6", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", + "wasm-bindgen", ] [[package]] @@ -2121,9 +2129,9 @@ dependencies = [ [[package]] name = "h3" -version = "0.0.6" +version = "0.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e7675a0963b47a6d12fe44c279918b4ffb19baee838ac37f48d2722ad5bc6ab" +checksum = "7dfb059a4f28a66f186ed16ad912d142f490676acba59353831d7cb45a96b0d3" dependencies = [ "bytes", "fastrand", @@ -2135,9 +2143,9 @@ dependencies = [ [[package]] name = "h3-quinn" -version = "0.0.7" +version = "0.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17c799f413fceeea505236c4d8132f084ff4b55a652288d91439ee93dc24d855" +checksum = "6d482318ae94198fc8e3cbb0b7ba3099c865d744e6ec7c62039ca7b6b6c66fbf" dependencies = [ "bytes", "futures", @@ -2171,15 +2179,16 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" [[package]] name = "hickory-proto" -version = "0.25.0-alpha.5" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d00147af6310f4392a31680db52a3ed45a2e0f68eb18e8c3fe5537ecc96d9e2" +checksum = "6d844af74f7b799e41c78221be863bade11c430d46042c3b49ca8ae0c6d27287" dependencies = [ "async-recursion", "async-trait", "bitflags 2.9.0", "bytes", "cfg-if", + "critical-section", "data-encoding", "enum-as-inner", "futures-channel", @@ -2209,9 +2218,9 @@ dependencies = [ [[package]] name = "hickory-resolver" -version = "0.25.0-alpha.5" +version = "0.25.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5762f69ebdbd4ddb2e975cd24690bf21fe6b2604039189c26acddbc427f12887" +checksum = "a128410b38d6f931fcc6ca5c107a3b02cabd6c05967841269a4ad65d23c44331" dependencies = [ "cfg-if", "futures-util", @@ -2627,7 +2636,7 @@ checksum = "c14ffb4145759d1032337501fb73b427c754a5f37d89dfe281dd89f48048e6ef" dependencies = [ "cfg-if", "derive_destructure2", - "getrandom 0.3.1", + "getrandom 0.3.2", "libc", "scopeguard", "tokio", @@ -2695,9 +2704,9 @@ checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "libmimalloc-sys" -version = "0.1.39" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23aa6811d3bd4deb8a84dde645f943476d13b248d818edcf8ce0b2f37f036b44" +checksum = "07d0e07885d6a754b9c7993f2625187ad694ee985d60f23355ff0e7077261502" dependencies = [ "cc", "libc", @@ -2716,9 +2725,9 @@ dependencies = [ [[package]] name = "libz-ng-sys" -version = "1.1.21" +version = "1.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cee1488e961a80d172564fd6fcda11d8a4ac6672c06fe008e9213fa60520c2b" +checksum = "a7118c2c2a3c7b6edc279a8b19507672b9c4d716f95e671172dfa4e23f9fd824" dependencies = [ "cmake", "libc", @@ -2741,9 +2750,9 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux-raw-sys" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9c683daf087dc577b7506e9695b3d556a9f3849903fa28186283afd6809e9" +checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" [[package]] name = "litemap" @@ -2884,9 +2893,9 @@ dependencies = [ [[package]] name = "mimalloc" -version = "0.1.43" +version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68914350ae34959d83f732418d51e2427a794055d0b9529f48259ac07af65633" +checksum = "99585191385958383e13f6b822e6b6d8d9cf928e7d286ceb092da92b43c87bc1" dependencies = [ "libmimalloc-sys", ] @@ -3112,6 +3121,10 @@ name = "once_cell" version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +dependencies = [ + "critical-section", + "portable-atomic", +] [[package]] name = "openssl" @@ -3399,11 +3412,12 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.6" +version = "0.11.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef" +checksum = "c3bd15a6f2967aef83887dcb9fec0014580467e33720d073560cf015a5683012" dependencies = [ "bytes", + "cfg_aliases", "futures-io", "pin-project-lite", "quinn-proto", @@ -3414,17 +3428,18 @@ dependencies = [ "thiserror 2.0.12", "tokio", "tracing", + "web-time", ] [[package]] name = "quinn-proto" -version = "0.11.9" +version = "0.11.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d" +checksum = "b820744eb4dc9b57a3398183639c511b5a26d2ed702cedd3febaa1393caa22cc" dependencies = [ "bytes", - "getrandom 0.2.15", - "rand 0.8.5", + "getrandom 0.3.2", + "rand 0.9.0", "ring", "rustc-hash", "rustls", @@ -3459,14 +3474,18 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "rand" version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "libc", - "rand_chacha 0.3.1", "rand_core 0.6.4", ] @@ -3476,21 +3495,11 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ - "rand_chacha 0.9.0", + "rand_chacha", "rand_core 0.9.3", "zerocopy 0.8.23", ] -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - [[package]] name = "rand_chacha" version = "0.9.0" @@ -3506,9 +3515,6 @@ name = "rand_core" version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.15", -] [[package]] name = "rand_core" @@ -3516,7 +3522,7 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ - "getrandom 0.3.1", + "getrandom 0.3.2", ] [[package]] @@ -3586,14 +3592,14 @@ dependencies = [ [[package]] name = "reflink-copy" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b86038e146b9a61557e1a2e58cdf2eddc0b46ce141b55541b1c1b9f3189d618" +checksum = "78c81d000a2c524133cc00d2f92f019d399e57906c3b7119271a2495354fe895" dependencies = [ "cfg-if", "libc", - "rustix 1.0.2", - "windows 0.60.0", + "rustix 1.0.3", + "windows 0.61.1", ] [[package]] @@ -3642,9 +3648,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.12.14" +version = "0.12.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "989e327e510263980e231de548a33e63d34962d29ae61b467389a1a09627a254" +checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb" dependencies = [ "async-compression", "base64", @@ -3756,22 +3762,22 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7178faa4b75a30e269c71e61c353ce2748cf3d76f0c44c393f4e60abf49b825" +checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" dependencies = [ "bitflags 2.9.0", "errno 0.3.10", "libc", - "linux-raw-sys 0.9.2", + "linux-raw-sys 0.9.3", "windows-sys 0.59.0", ] [[package]] name = "rustls" -version = "0.23.23" +version = "0.23.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47796c98c480fce5406ef69d1c76378375492c3b0a0de587be0c1d9feb12f395" +checksum = "822ee9188ac4ec04a2f0531e55d035fb2de73f18b41a63c70c2712503b6fb13c" dependencies = [ "log", "once_cell", @@ -3814,9 +3820,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.8" +version = "0.103.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +checksum = "0aa4eeac2588ffff23e9d7a7e9b3f971c5fb5b7ebc9452745e0c232c64f83b2f" dependencies = [ "ring", "rustls-pki-types", @@ -4241,9 +4247,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "488960f40a3fd53d72c2a29a58722561dee8afdd175bd88e3db4677d7b2ba600" dependencies = [ "fastrand", - "getrandom 0.3.1", + "getrandom 0.3.2", "once_cell", - "rustix 1.0.2", + "rustix 1.0.3", "windows-sys 0.59.0", ] @@ -4253,7 +4259,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" dependencies = [ - "rustix 1.0.2", + "rustix 1.0.3", "windows-sys 0.59.0", ] @@ -4319,9 +4325,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.39" +version = "0.3.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad298b01a40a23aac4580b67e3dbedb7cc8402f3592d7f49469de2ea4aecdd8" +checksum = "9d9c75b47bdff86fa3334a3db91356b8d7d86a9b839dab7d0bdc5c3d3a077618" dependencies = [ "deranged", "itoa", @@ -4336,15 +4342,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "765c97a5b985b7c11d7bc27fa927dc4fe6af3a6dfb021d28deb60d3bf51e76ef" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" [[package]] name = "time-macros" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8093bc3e81c3bc5f7879de09619d06c9a5a5e45ca44dfeeb7225bae38005c5c" +checksum = "29aa485584182073ed57fd5004aa09c371f021325014694e432313345865fd04" dependencies = [ "num-conv", "time-core", @@ -4696,11 +4702,11 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.15.1" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f540e3240398cce6128b64ba83fdbdd86129c16a3aa1a3a252efd66eb3d587" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" dependencies = [ - "getrandom 0.3.1", + "getrandom 0.3.2", ] [[package]] @@ -4783,9 +4789,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasi" -version = "0.13.3+wasi-0.2.2" +version = "0.14.2+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" dependencies = [ "wit-bindgen-rt", ] @@ -4905,9 +4911,9 @@ dependencies = [ [[package]] name = "widestring" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" +checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d" [[package]] name = "winapi" @@ -4975,11 +4981,24 @@ version = "0.60.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddf874e74c7a99773e62b1c671427abf01a425e77c3d3fb9fb1e4883ea934529" dependencies = [ - "windows-collections", + "windows-collections 0.1.1", "windows-core 0.60.1", - "windows-future", + "windows-future 0.1.1", "windows-link", - "windows-numerics", + "windows-numerics 0.1.1", +] + +[[package]] +name = "windows" +version = "0.61.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5ee8f3d025738cb02bad7868bbb5f8a6327501e870bf51f1b455b0a2454a419" +dependencies = [ + "windows-collections 0.2.0", + "windows-core 0.61.0", + "windows-future 0.2.0", + "windows-link", + "windows-numerics 0.2.0", ] [[package]] @@ -4991,6 +5010,15 @@ dependencies = [ "windows-core 0.60.1", ] +[[package]] +name = "windows-collections" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +dependencies = [ + "windows-core 0.61.0", +] + [[package]] name = "windows-core" version = "0.52.0" @@ -5020,12 +5048,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca21a92a9cae9bf4ccae5cf8368dce0837100ddf6e6d57936749e85f152f6247" dependencies = [ "windows-implement 0.59.0", - "windows-interface 0.59.0", + "windows-interface 0.59.1", "windows-link", - "windows-result 0.3.1", + "windows-result 0.3.2", "windows-strings 0.3.1", ] +[[package]] +name = "windows-core" +version = "0.61.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4763c1de310c86d75a878046489e2e5ba02c649d185f21c67d4cf8a56d098980" +dependencies = [ + "windows-implement 0.60.0", + "windows-interface 0.59.1", + "windows-link", + "windows-result 0.3.2", + "windows-strings 0.4.0", +] + [[package]] name = "windows-future" version = "0.1.1" @@ -5036,6 +5077,16 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows-future" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a1d6bbefcb7b60acd19828e1bc965da6fcf18a7e39490c5f8be71e54a19ba32" +dependencies = [ + "windows-core 0.61.0", + "windows-link", +] + [[package]] name = "windows-implement" version = "0.58.0" @@ -5058,6 +5109,17 @@ dependencies = [ "syn", ] +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "windows-interface" version = "0.58.0" @@ -5071,9 +5133,9 @@ dependencies = [ [[package]] name = "windows-interface" -version = "0.59.0" +version = "0.59.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb26fd936d991781ea39e87c3a27285081e3c0da5ca0fcbc02d368cc6f52ff01" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" dependencies = [ "proc-macro2", "quote", @@ -5082,9 +5144,9 @@ dependencies = [ [[package]] name = "windows-link" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dccfd733ce2b1753b03b6d3c65edf020262ea35e20ccdf3e288043e6dd620e3" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" [[package]] name = "windows-numerics" @@ -5096,13 +5158,23 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows-numerics" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +dependencies = [ + "windows-core 0.61.0", + "windows-link", +] + [[package]] name = "windows-registry" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" dependencies = [ - "windows-result 0.3.1", + "windows-result 0.3.2", "windows-strings 0.3.1", "windows-targets 0.53.0", ] @@ -5118,9 +5190,9 @@ dependencies = [ [[package]] name = "windows-result" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06374efe858fab7e4f881500e6e86ec8bc28f9462c47e5a9941a0142ad86b189" +checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" dependencies = [ "windows-link", ] @@ -5144,6 +5216,15 @@ dependencies = [ "windows-link", ] +[[package]] +name = "windows-strings" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a2ba9642430ee452d5a7aa78d72907ebe8cfda358e8cb7918a2050581322f97" +dependencies = [ + "windows-link", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -5405,9 +5486,9 @@ dependencies = [ [[package]] name = "wit-bindgen-rt" -version = "0.33.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ "bitflags 2.9.0", ] @@ -5431,7 +5512,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d65cbf2f12c15564212d48f4e3dfb87923d25d611f2aed18f4cb23f0413d89e" dependencies = [ "libc", - "rustix 1.0.2", + "rustix 1.0.3", ] [[package]] diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 353c3edd..99f3a676 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -63,7 +63,7 @@ tokio = { version = "1.44.0", features = [ tokio-tar = "0.3.0" tokio-util = { version = "0.7.8", features = ["io"] } tracing = "0.1.39" -hickory-resolver = { version = "=0.25.0-alpha.5", optional = true, features = [ +hickory-resolver = { version = "0.25.1", optional = true, features = [ "dnssec-ring", ] } once_cell = { version = "1.18.0", optional = true } @@ -104,11 +104,11 @@ rustls = [ "reqwest/rustls-tls-native-roots", # Enable the following features only if hickory-resolver is enabled. - "hickory-resolver?/dns-over-rustls", + "hickory-resolver?/tls-ring", # hickory-resolver currently supports https with rustls - "hickory-resolver?/dns-over-https-rustls", - "hickory-resolver?/dns-over-quic", - "hickory-resolver?/dns-over-h3", + "hickory-resolver?/https-ring", + "hickory-resolver?/quic-ring", + "hickory-resolver?/h3-ring", ] native-tls = ["__tls", "native-tls-crate", "reqwest/native-tls"] diff --git a/crates/binstalk-downloader/src/remote/resolver.rs b/crates/binstalk-downloader/src/remote/resolver.rs index 5982d309..1df98aab 100644 --- a/crates/binstalk-downloader/src/remote/resolver.rs +++ b/crates/binstalk-downloader/src/remote/resolver.rs @@ -65,7 +65,9 @@ fn new_resolver() -> Result { debug!("Resolver configuration complete"); opts.ip_strategy = LookupIpStrategy::Ipv4AndIpv6; - Ok(TokioAsyncResolver::tokio(config, opts)) + let mut builder = TokioAsyncResolver::builder_with_config(config, Default::default()); + *builder.options_mut() = opts; + Ok(builder.build()) } #[cfg(windows)] From bb0d6c1f9cc0f6f842030f15c0e85a6bdbd493a4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 19 Mar 2025 14:10:25 +0000 Subject: [PATCH 2007/2020] build(deps): bump windows from 0.60.0 to 0.61.1 in the deps group across 1 directory (#2097) build(deps): bump windows in the deps group across 1 directory Bumps the deps group with 1 update in the / directory: [windows](https://github.com/microsoft/windows-rs). Updates `windows` from 0.60.0 to 0.61.1 - [Release notes](https://github.com/microsoft/windows-rs/releases) - [Commits](https://github.com/microsoft/windows-rs/commits) --- updated-dependencies: - dependency-name: windows dependency-type: direct:production update-type: version-update:semver-minor dependency-group: deps ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 74 ++------------------------- crates/atomic-file-install/Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 71 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 55a5b3f9..fc39c164 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -180,7 +180,7 @@ dependencies = [ "reflink-copy", "tempfile", "tracing", - "windows 0.60.0", + "windows 0.61.1", ] [[package]] @@ -4975,39 +4975,17 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows" -version = "0.60.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf874e74c7a99773e62b1c671427abf01a425e77c3d3fb9fb1e4883ea934529" -dependencies = [ - "windows-collections 0.1.1", - "windows-core 0.60.1", - "windows-future 0.1.1", - "windows-link", - "windows-numerics 0.1.1", -] - [[package]] name = "windows" version = "0.61.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c5ee8f3d025738cb02bad7868bbb5f8a6327501e870bf51f1b455b0a2454a419" dependencies = [ - "windows-collections 0.2.0", + "windows-collections", "windows-core 0.61.0", - "windows-future 0.2.0", + "windows-future", "windows-link", - "windows-numerics 0.2.0", -] - -[[package]] -name = "windows-collections" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5467f79cc1ba3f52ebb2ed41dbb459b8e7db636cc3429458d9a852e15bc24dec" -dependencies = [ - "windows-core 0.60.1", + "windows-numerics", ] [[package]] @@ -5041,19 +5019,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-core" -version = "0.60.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca21a92a9cae9bf4ccae5cf8368dce0837100ddf6e6d57936749e85f152f6247" -dependencies = [ - "windows-implement 0.59.0", - "windows-interface 0.59.1", - "windows-link", - "windows-result 0.3.2", - "windows-strings 0.3.1", -] - [[package]] name = "windows-core" version = "0.61.0" @@ -5067,16 +5032,6 @@ dependencies = [ "windows-strings 0.4.0", ] -[[package]] -name = "windows-future" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a787db4595e7eb80239b74ce8babfb1363d8e343ab072f2ffe901400c03349f0" -dependencies = [ - "windows-core 0.60.1", - "windows-link", -] - [[package]] name = "windows-future" version = "0.2.0" @@ -5098,17 +5053,6 @@ dependencies = [ "syn", ] -[[package]] -name = "windows-implement" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83577b051e2f49a058c308f17f273b570a6a758386fc291b5f6a934dd84e48c1" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "windows-implement" version = "0.60.0" @@ -5148,16 +5092,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" -[[package]] -name = "windows-numerics" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "005dea54e2f6499f2cee279b8f703b3cf3b5734a2d8d21867c8f44003182eeed" -dependencies = [ - "windows-core 0.60.1", - "windows-link", -] - [[package]] name = "windows-numerics" version = "0.2.0" diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index 7510103f..3f581134 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -15,4 +15,4 @@ tempfile = "3.5.0" tracing = "0.1.39" [target.'cfg(windows)'.dependencies] -windows = { version = "0.60.0", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } +windows = { version = "0.61.1", features = ["Win32_Storage_FileSystem", "Win32_Foundation"] } From 028b24de4db4d6a1ada0e4424aefa63f84af59f1 Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Thu, 20 Mar 2025 00:19:43 +1000 Subject: [PATCH 2008/2020] Fix clippy warnings for detect-targets and binstalk-downloader (#2098) binstalk-downloader clippy warning is specific to windows Signed-off-by: Jiahao XU --- crates/binstalk-downloader/src/download/zip_extraction.rs | 6 ++++-- crates/detect-targets/src/detect/linux.rs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/crates/binstalk-downloader/src/download/zip_extraction.rs b/crates/binstalk-downloader/src/download/zip_extraction.rs index 0bdfc425..cb5af6e7 100644 --- a/crates/binstalk-downloader/src/download/zip_extraction.rs +++ b/crates/binstalk-downloader/src/download/zip_extraction.rs @@ -1,6 +1,6 @@ use std::{ - fs::{self, create_dir_all, File}, - io::{self, Read}, + fs::{create_dir_all, File}, + io, path::Path, }; @@ -38,6 +38,8 @@ pub(super) fn do_extract_zip(f: File, dir: &Path) -> Result fs::remove_file(&path)?, _ => (), diff --git a/crates/detect-targets/src/detect/linux.rs b/crates/detect-targets/src/detect/linux.rs index 1b81f688..c1fcf75b 100644 --- a/crates/detect-targets/src/detect/linux.rs +++ b/crates/detect-targets/src/detect/linux.rs @@ -8,7 +8,7 @@ use tokio::{process::Command, task}; use tracing::debug; pub(super) async fn detect_targets(target: String) -> Vec { - let (prefix, postfix) = target + let (_, postfix) = target .rsplit_once('-') .expect("unwrap: target always has a -"); From 88fd813c05a5480d23b406f4d097cdb5d71765ec Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Thu, 20 Mar 2025 00:25:08 +1000 Subject: [PATCH 2009/2020] Use zlib-rs for gitoxide and avoid pulling in zlib-ng (#2099) Since we already use zlib-rs there is no point in pulling in zlib-ng Signed-off-by: Jiahao XU --- Cargo.lock | 26 ++------------------------ crates/binstalk/Cargo.toml | 4 ++-- 2 files changed, 4 insertions(+), 26 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fc39c164..3bfdd5e9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1554,7 +1554,6 @@ dependencies = [ "once_cell", "parking_lot", "prodash", - "sha1", "sha1_smol", "thiserror 2.0.12", "walkdir", @@ -3978,27 +3977,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha1" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest", - "sha1-asm", -] - -[[package]] -name = "sha1-asm" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "286acebaf8b67c1130aedffad26f594eff0c1292389158135327d2e23aed582b" -dependencies = [ - "cc", -] - [[package]] name = "sha1_smol" version = "1.0.1" @@ -4048,9 +4026,9 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.17" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c73b7cfffb1daffacab7bbb42f02b6c5d9117957edad4c58c6aa83bea187ec84" +checksum = "5e87f19cbb1c57c67e149b4d14ee0ae97a96b4bfd97d4fe122880a4a14370af9" dependencies = [ "compact_str", "derive_destructure2", diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 76abe744..d234d7d7 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -31,7 +31,7 @@ leon = "3.0.0" maybe-owned = "0.3.4" miette = "7.0.0" semver = { version = "1.0.17", features = ["serde"] } -simple-git = { version = "0.2.10", optional = true } +simple-git = { version = "0.2.18", optional = true } strum = "0.27.0" target-lexicon = { version = "0.13.0", features = ["std"] } tempfile = "3.5.0" @@ -50,7 +50,7 @@ zeroize = "1.8.1" default = ["static", "rustls", "git"] git = ["binstalk-registry/git", "simple-git"] -git-max-perf = ["git", "simple-git/git-max-perf"] +git-max-perf = ["git", "simple-git/git-max-perf-safe", "zlib-rs"] static = ["binstalk-downloader/static"] pkg-config = ["binstalk-downloader/pkg-config"] From 08cf94c5bf37872cae7005e5537458ed851877c7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Wed, 19 Mar 2025 15:24:05 +0000 Subject: [PATCH 2010/2020] chore: release (#2095) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 22 +++++++++++----------- crates/atomic-file-install/CHANGELOG.md | 6 ++++++ crates/atomic-file-install/Cargo.toml | 2 +- crates/bin/Cargo.toml | 6 +++--- crates/binstalk-bins/CHANGELOG.md | 6 ++++++ crates/binstalk-bins/Cargo.toml | 4 ++-- crates/binstalk-downloader/CHANGELOG.md | 7 +++++++ crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/CHANGELOG.md | 6 ++++++ crates/binstalk-fetchers/Cargo.toml | 8 ++++---- crates/binstalk-git-repo-api/CHANGELOG.md | 6 ++++++ crates/binstalk-git-repo-api/Cargo.toml | 6 +++--- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 6 +++--- crates/binstalk-registry/CHANGELOG.md | 6 ++++++ crates/binstalk-registry/Cargo.toml | 6 +++--- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 14 +++++++------- crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- crates/fs-lock/CHANGELOG.md | 6 ++++++ crates/fs-lock/Cargo.toml | 2 +- 24 files changed, 108 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3bfdd5e9..50088b98 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -175,7 +175,7 @@ dependencies = [ [[package]] name = "atomic-file-install" -version = "1.0.10" +version = "1.0.11" dependencies = [ "reflink-copy", "tempfile", @@ -242,7 +242,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.29" +version = "0.28.30" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -274,7 +274,7 @@ dependencies = [ [[package]] name = "binstalk-bins" -version = "0.6.12" +version = "0.6.13" dependencies = [ "atomic-file-install", "binstalk-types", @@ -288,7 +288,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.13.15" +version = "0.13.16" dependencies = [ "async-compression", "async-trait", @@ -324,7 +324,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.10.16" +version = "0.10.17" dependencies = [ "async-trait", "binstalk-downloader", @@ -348,7 +348,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.17" +version = "0.5.18" dependencies = [ "binstalk-downloader", "compact_str", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.26" +version = "0.15.27" dependencies = [ "beef", "binstalk-types", @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.11.16" +version = "0.11.17" dependencies = [ "async-trait", "base16", @@ -925,7 +925,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.45" +version = "0.1.46" dependencies = [ "cfg-if", "guess_host_triple", @@ -937,7 +937,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.26" +version = "1.0.27" dependencies = [ "tempfile", ] @@ -1156,7 +1156,7 @@ dependencies = [ [[package]] name = "fs-lock" -version = "0.1.9" +version = "0.1.10" dependencies = [ "fs4", "tracing", diff --git a/crates/atomic-file-install/CHANGELOG.md b/crates/atomic-file-install/CHANGELOG.md index 9a0e77e4..f49d292d 100644 --- a/crates/atomic-file-install/CHANGELOG.md +++ b/crates/atomic-file-install/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.11](https://github.com/cargo-bins/cargo-binstall/compare/atomic-file-install-v1.0.10...atomic-file-install-v1.0.11) - 2025-03-19 + +### Other + +- *(deps)* bump windows from 0.60.0 to 0.61.1 in the deps group across 1 directory ([#2097](https://github.com/cargo-bins/cargo-binstall/pull/2097)) + ## [1.0.10](https://github.com/cargo-bins/cargo-binstall/compare/atomic-file-install-v1.0.9...atomic-file-install-v1.0.10) - 2025-02-22 ### Other diff --git a/crates/atomic-file-install/Cargo.toml b/crates/atomic-file-install/Cargo.toml index 3f581134..2394f0eb 100644 --- a/crates/atomic-file-install/Cargo.toml +++ b/crates/atomic-file-install/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "atomic-file-install" -version = "1.0.10" +version = "1.0.11" edition = "2021" description = "For atomically installing a file or a symlink." repository = "https://github.com/cargo-bins/cargo-binstall" diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 30efca8c..14dde5f2 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -22,9 +22,9 @@ pkg-fmt = "zip" pkg-fmt = "zip" [dependencies] -atomic-file-install = { version = "1.0.10", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.29", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.26" } +atomic-file-install = { version = "1.0.11", path = "../atomic-file-install" } +binstalk = { path = "../binstalk", version = "0.28.30", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.27" } clap = { version = "4.5.3", features = ["derive", "env", "wrap_help"] } clap-cargo = "0.15.2" compact_str = "0.9.0" diff --git a/crates/binstalk-bins/CHANGELOG.md b/crates/binstalk-bins/CHANGELOG.md index 12bc4bff..de489e3e 100644 --- a/crates/binstalk-bins/CHANGELOG.md +++ b/crates/binstalk-bins/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.6.13](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.12...binstalk-bins-v0.6.13) - 2025-03-19 + +### Other + +- updated the following local packages: atomic-file-install + ## [0.6.12](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-bins-v0.6.11...binstalk-bins-v0.6.12) - 2025-03-07 ### Other diff --git a/crates/binstalk-bins/Cargo.toml b/crates/binstalk-bins/Cargo.toml index 658e6f22..d3f8c6c4 100644 --- a/crates/binstalk-bins/Cargo.toml +++ b/crates/binstalk-bins/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-bins" -version = "0.6.12" +version = "0.6.13" edition = "2021" description = "The binstall binaries discovery and installation crate." @@ -11,7 +11,7 @@ authors = ["Jiahao XU "] license = "GPL-3.0-only" [dependencies] -atomic-file-install = { version = "1.0.10", path = "../atomic-file-install" } +atomic-file-install = { version = "1.0.11", path = "../atomic-file-install" } binstalk-types = { version = "0.9.4", path = "../binstalk-types" } compact_str = { version = "0.9.0", features = ["serde"] } leon = "3.0.0" diff --git a/crates/binstalk-downloader/CHANGELOG.md b/crates/binstalk-downloader/CHANGELOG.md index 2ac2413c..ecfd5143 100644 --- a/crates/binstalk-downloader/CHANGELOG.md +++ b/crates/binstalk-downloader/CHANGELOG.md @@ -6,6 +6,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.13.16](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.15...binstalk-downloader-v0.13.16) - 2025-03-19 + +### Other + +- Fix clippy warnings for detect-targets and binstalk-downloader ([#2098](https://github.com/cargo-bins/cargo-binstall/pull/2098)) +- Bump hickory-resolver to 0.25.1 ([#2096](https://github.com/cargo-bins/cargo-binstall/pull/2096)) + ## [0.13.15](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.14...binstalk-downloader-v0.13.15) - 2025-03-15 ### Other diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 99f3a676..20a71b8b 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.13.15" +version = "0.13.16" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index ebdfcf91..e8d9bd8b 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.17](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.16...binstalk-fetchers-v0.10.17) - 2025-03-19 + +### Other + +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.10.16](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.15...binstalk-fetchers-v0.10.16) - 2025-03-15 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index b170d182..8da104e5 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.10.16" +version = "0.10.17" edition = "2021" description = "The binstall fetchers" @@ -12,8 +12,8 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.88" -binstalk-downloader = { version = "0.13.15", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.17", path = "../binstalk-git-repo-api" } +binstalk-downloader = { version = "0.13.16", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.18", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.9.4", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.9.0" } @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.5.4" [dev-dependencies] -binstalk-downloader = { version = "0.13.15", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.16", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index bb7623c7..7cf15cdf 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.18](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.17...binstalk-git-repo-api-v0.5.18) - 2025-03-19 + +### Other + +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.5.17](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.16...binstalk-git-repo-api-v0.5.17) - 2025-03-15 ### Other diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index e6893cc3..e77b9097 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.17" +version = "0.5.18" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.13.15", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.16", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.9.0" @@ -25,6 +25,6 @@ url = "2.5.4" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.15", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.16", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index 67c5506c..7ec47ad1 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.27](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.26...binstalk-manifests-v0.15.27) - 2025-03-19 + +### Other + +- updated the following local packages: detect-targets, fs-lock + ## [0.15.26](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.25...binstalk-manifests-v0.15.26) - 2025-03-15 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index 833531f6..a6417d49 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.26" +version = "0.15.27" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" beef = { version = "0.5.2", features = ["impl_serde"] } binstalk-types = { version = "0.9.4", path = "../binstalk-types" } compact_str = { version = "0.9.0", features = ["serde"] } -fs-lock = { version = "0.1.9", path = "../fs-lock", features = ["tracing"] } +fs-lock = { version = "0.1.10", path = "../fs-lock", features = ["tracing"] } home = "0.5.9" miette = "7.0.0" semver = { version = "1.0.17", features = ["serde"] } @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.45", path = "../detect-targets" } +detect-targets = { version = "0.1.46", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md index ae525d81..5c8b7e50 100644 --- a/crates/binstalk-registry/CHANGELOG.md +++ b/crates/binstalk-registry/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.17](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.16...binstalk-registry-v0.11.17) - 2025-03-19 + +### Other + +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.11.16](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.15...binstalk-registry-v0.11.16) - 2025-03-15 ### Other diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index 2669a1d2..def687fe 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.11.16" +version = "0.11.17" edition = "2021" rust-version = "1.65.0" @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.88" base16 = "0.2.1" -binstalk-downloader = { version = "0.13.15", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.16", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.9.4", path = "../binstalk-types" } @@ -40,7 +40,7 @@ url = "2.5.4" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.13.15", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.16", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index 29efefb9..7e130c42 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.30](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.29...binstalk-v0.28.30) - 2025-03-19 + +### Other + +- Use zlib-rs for gitoxide and avoid pulling in zlib-ng ([#2099](https://github.com/cargo-bins/cargo-binstall/pull/2099)) + ## [0.28.29](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.28...binstalk-v0.28.29) - 2025-03-15 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index d234d7d7..22e62e3f 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,25 +3,25 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.29" +version = "0.28.30" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" license = "GPL-3.0-only" [dependencies] -binstalk-bins = { version = "0.6.12", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.13.15", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.17", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.10.16", path = "../binstalk-fetchers", features = [ +binstalk-bins = { version = "0.6.13", path = "../binstalk-bins" } +binstalk-downloader = { version = "0.13.16", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.18", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.10.17", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.11.16", path = "../binstalk-registry" } +binstalk-registry = { version = "0.11.17", path = "../binstalk-registry" } binstalk-types = { version = "0.9.4", path = "../binstalk-types" } cargo-toml-workspace = { version = "7.0.6", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.9.0", features = ["serde"] } -detect-targets = { version = "0.1.45", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.46", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index bf837cdb..6d5e95b2 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.46](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.45...detect-targets-v0.1.46) - 2025-03-19 + +### Other + +- Fix clippy warnings for detect-targets and binstalk-downloader ([#2098](https://github.com/cargo-bins/cargo-binstall/pull/2098)) + ## [0.1.45](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.44...detect-targets-v0.1.45) - 2025-03-15 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index c054a06a..c82c516c 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.45" +version = "0.1.46" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index 297c5f50..56144956 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.27](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.26...detect-wasi-v1.0.27) - 2025-03-19 + +### Other + +- update Cargo.lock dependencies + ## [1.0.26](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.25...detect-wasi-v1.0.26) - 2025-03-15 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index 4cade40f..feb37dbb 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.26" +version = "1.0.27" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" diff --git a/crates/fs-lock/CHANGELOG.md b/crates/fs-lock/CHANGELOG.md index feb14406..b9213f27 100644 --- a/crates/fs-lock/CHANGELOG.md +++ b/crates/fs-lock/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.10](https://github.com/cargo-bins/cargo-binstall/compare/fs-lock-v0.1.9...fs-lock-v0.1.10) - 2025-03-19 + +### Fixed + +- actually check if lock was acquired ([#2091](https://github.com/cargo-bins/cargo-binstall/pull/2091)) + ## [0.1.9](https://github.com/cargo-bins/cargo-binstall/compare/fs-lock-v0.1.8...fs-lock-v0.1.9) - 2025-03-07 ### Other diff --git a/crates/fs-lock/Cargo.toml b/crates/fs-lock/Cargo.toml index 366cc721..2c0e8711 100644 --- a/crates/fs-lock/Cargo.toml +++ b/crates/fs-lock/Cargo.toml @@ -3,7 +3,7 @@ name = "fs-lock" description = "Locked files that can be used like normal File" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/fs-lock" -version = "0.1.9" +version = "0.1.10" rust-version = "1.61.0" authors = ["Jiahao XU "] edition = "2021" From b9bf4400702f721d469eec4d280125f650c85638 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 21 Mar 2025 00:03:34 +1000 Subject: [PATCH 2011/2020] release: cargo-binstall v1.12.2 (#2101) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 50088b98..6b0243b8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -547,7 +547,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.12.1" +version = "1.12.2" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 14dde5f2..97f8e960 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.12.1" +version = "1.12.2" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index 97300dc6..be3ad5b3 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From 9c0726d197fe4fd47a244dad51211f8d8701c72c Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 28 Mar 2025 07:20:30 +0000 Subject: [PATCH 2012/2020] dep: Upgrade transitive dependencies (#2105) Co-authored-by: github-actions --- Cargo.lock | 86 +++++++++++++++++++++++++++--------------------------- 1 file changed, 43 insertions(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6b0243b8..b2a95cde 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -635,9 +635,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.16" +version = "1.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" dependencies = [ "jobserver", "libc", @@ -678,9 +678,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.32" +version = "4.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6088f3ae8c3608d19260cd7445411865a485688711b78b5be70d78cd96136f83" +checksum = "e958897981290da2a852763fe9cdb89cd36977a5d729023127095fa94d95e2ff" dependencies = [ "clap_builder", "clap_derive", @@ -698,9 +698,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.32" +version = "4.5.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22a7ef7f676155edfb82daa97f99441f3ebf4a58d5e32f295a56259f1b6facc8" +checksum = "83b0f35019843db2160b5bb19ae09b4e6411ac33fc6a712003c33e03090e2489" dependencies = [ "anstream", "anstyle", @@ -905,9 +905,9 @@ checksum = "da692b8d1080ea3045efaab14434d40468c3d8657e42abddfffca87b428f4c1b" [[package]] name = "deranged" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +checksum = "28cfac68e08048ae1883171632c2aef3ebc555621ae56fbccce1cbf22dd7f058" dependencies = [ "powerfmt", ] @@ -2426,9 +2426,9 @@ dependencies = [ [[package]] name = "icu_locid_transform_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" +checksum = "7515e6d781098bf9f7205ab3fc7e9709d34554ae0b21ddbcb5febfa4bc7df11d" [[package]] name = "icu_normalizer" @@ -2450,9 +2450,9 @@ dependencies = [ [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "c5e8338228bdc8ab83303f16b797e177953730f601a96c25d10cb3ab0daa0cb7" [[package]] name = "icu_properties" @@ -2471,9 +2471,9 @@ dependencies = [ [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "85fb8799753b75aee8d2a21d7c14d9f38921b54b3dbda10f5a3c7a7b82dba5e2" [[package]] name = "icu_provider" @@ -2605,15 +2605,15 @@ dependencies = [ [[package]] name = "jiff-tzdb" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "962e1dfe9b2d75a84536cf5bf5eaaa4319aa7906c7160134a22883ac316d5f31" +checksum = "c1283705eb0a21404d2bfd6eef2a7593d240bc42a0bdb39db0ad6fa2ec026524" [[package]] name = "jiff-tzdb-platform" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a63c62e404e7b92979d2792352d885a7f8f83fd1d0d31eea582d77b2ceca697e" +checksum = "875a5a69ac2bab1a891711cf5eccbec1ce0341ea805560dcd90b7a2e925132e8" dependencies = [ "jiff-tzdb", ] @@ -2771,9 +2771,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.26" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "loom" @@ -3117,9 +3117,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.1" +version = "1.21.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +checksum = "c2806eaa3524762875e21c3dcd057bc4b7bfa01ce4da8d46be1cd43649e1cc6b" dependencies = [ "critical-section", "portable-atomic", @@ -3353,7 +3353,7 @@ version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.8.23", + "zerocopy 0.8.24", ] [[package]] @@ -3452,9 +3452,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e46f3055866785f6b92bc6164b76be02ca8f2eb4b002c0354b28cf4c119e5944" +checksum = "541d0f57c6ec747a90738a52741d3221f7960e8ac2f0ff4b1a63680e033b4ab5" dependencies = [ "cfg_aliases", "libc", @@ -3496,7 +3496,7 @@ checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" dependencies = [ "rand_chacha", "rand_core 0.9.3", - "zerocopy 0.8.23", + "zerocopy 0.8.24", ] [[package]] @@ -3819,9 +3819,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.0" +version = "0.103.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aa4eeac2588ffff23e9d7a7e9b3f971c5fb5b7ebc9452745e0c232c64f83b2f" +checksum = "fef8b8769aaccf73098557a87cd1816b4f9c7c16811c9c77142aa695c16f2c03" dependencies = [ "ring", "rustls-pki-types", @@ -4220,9 +4220,9 @@ checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" [[package]] name = "tempfile" -version = "3.19.0" +version = "3.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488960f40a3fd53d72c2a29a58722561dee8afdd175bd88e3db4677d7b2ba600" +checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" dependencies = [ "fastrand", "getrandom 0.3.2", @@ -4303,9 +4303,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.40" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d9c75b47bdff86fa3334a3db91356b8d7d86a9b839dab7d0bdc5c3d3a077618" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" dependencies = [ "deranged", "itoa", @@ -4326,9 +4326,9 @@ checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" [[package]] name = "time-macros" -version = "0.2.21" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29aa485584182073ed57fd5004aa09c371f021325014694e432313345865fd04" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" dependencies = [ "num-conv", "time-core", @@ -5471,11 +5471,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.23" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" +checksum = "2586fea28e186957ef732a5f8b3be2da217d65c5969d4b1e17f973ebbe876879" dependencies = [ - "zerocopy-derive 0.8.23", + "zerocopy-derive 0.8.24", ] [[package]] @@ -5491,9 +5491,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.23" +version = "0.8.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" +checksum = "a996a8f63c5c4448cd959ac1bab0aaa3306ccfd060472f85943ee0750f0169be" dependencies = [ "proc-macro2", "quote", @@ -5566,18 +5566,18 @@ dependencies = [ [[package]] name = "zstd-safe" -version = "7.2.3" +version = "7.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3051792fbdc2e1e143244dc28c60f73d8470e93f3f9cbd0ead44da5ed802722" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" dependencies = [ "zstd-sys", ] [[package]] name = "zstd-sys" -version = "2.0.14+zstd.1.5.7" +version = "2.0.15+zstd.1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fb060d4926e4ac3a3ad15d864e99ceb5f343c6b34f5bd6d81ae6ed417311be5" +checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" dependencies = [ "cc", "pkg-config", From b49bcb7a167c846541dcc97b4078370d6a6a923d Mon Sep 17 00:00:00 2001 From: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> Date: Sat, 5 Apr 2025 00:14:17 +1000 Subject: [PATCH 2013/2020] Fix clippy lints (#2111) * Fix indentation of docs in extracted_files.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Optimize parse_header_retry_after Use next_back instead of last Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> * Fix doc indentation in cargo_config.rs Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --------- Signed-off-by: Jiahao XU <30436523+NobodyXu@users.noreply.github.com> --- .../src/download/extracted_files.rs | 18 +++++++++--------- crates/binstalk-downloader/src/remote.rs | 2 +- crates/binstalk-manifests/src/cargo_config.rs | 6 +++--- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/crates/binstalk-downloader/src/download/extracted_files.rs b/crates/binstalk-downloader/src/download/extracted_files.rs index bf4c0f8a..ac45d4fb 100644 --- a/crates/binstalk-downloader/src/download/extracted_files.rs +++ b/crates/binstalk-downloader/src/download/extracted_files.rs @@ -80,17 +80,17 @@ impl ExtractedFiles { } /// * `path` - must be a relative path without `.`, `..`, `/`, `prefix:/` - /// and must not be empty, for these values it is guaranteed to - /// return `None`. - /// But could be set to "." for top-level. + /// and must not be empty, for these values it is guaranteed to + /// return `None`. + /// But could be set to "." for top-level. pub fn get_entry(&self, path: &Path) -> Option<&ExtractedFilesEntry> { self.0.get(path) } /// * `path` - must be a relative path without `.`, `..`, `/`, `prefix:/` - /// and must not be empty, for these values it is guaranteed to - /// return `None`. - /// But could be set to "." for top-level. + /// and must not be empty, for these values it is guaranteed to + /// return `None`. + /// But could be set to "." for top-level. pub fn get_dir(&self, path: &Path) -> Option<&HashSet>> { match self.get_entry(path)? { ExtractedFilesEntry::Dir(file_names) => Some(file_names), @@ -99,9 +99,9 @@ impl ExtractedFiles { } /// * `path` - must be a relative path without `.`, `..`, `/`, `prefix:/` - /// and must not be empty, for these values it is guaranteed to - /// return `false`. - /// But could be set to "." for top-level. + /// and must not be empty, for these values it is guaranteed to + /// return `false`. + /// But could be set to "." for top-level. pub fn has_file(&self, path: &Path) -> bool { matches!(self.get_entry(path), Some(ExtractedFilesEntry::File)) } diff --git a/crates/binstalk-downloader/src/remote.rs b/crates/binstalk-downloader/src/remote.rs index 66fd365c..1ab1391c 100644 --- a/crates/binstalk-downloader/src/remote.rs +++ b/crates/binstalk-downloader/src/remote.rs @@ -390,7 +390,7 @@ fn parse_header_retry_after(headers: &HeaderMap) -> Option { let header = headers .get_all(RETRY_AFTER) .into_iter() - .last()? + .next_back()? .to_str() .ok()?; diff --git a/crates/binstalk-manifests/src/cargo_config.rs b/crates/binstalk-manifests/src/cargo_config.rs index dc9985dc..22e25971 100644 --- a/crates/binstalk-manifests/src/cargo_config.rs +++ b/crates/binstalk-manifests/src/cargo_config.rs @@ -86,9 +86,9 @@ impl Config { } /// * `dir` - path to the dir where the config.toml is located. - /// For relative path in the config, `Config::load_from_reader` - /// will join the `dir` and the relative path to form the final - /// path. + /// For relative path in the config, `Config::load_from_reader` + /// will join the `dir` and the relative path to form the final + /// path. pub fn load_from_reader( mut reader: R, dir: &Path, From 96d89924106dc83fcef1f2d528035882dabcecc1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 4 Apr 2025 14:57:01 +0000 Subject: [PATCH 2014/2020] dep: Upgrade transitive dependencies (#2110) Co-authored-by: github-actions --- Cargo.lock | 116 ++++++++++++++++++++++++++++++----------------------- 1 file changed, 65 insertions(+), 51 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b2a95cde..a0d40cf2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -204,7 +204,7 @@ dependencies = [ "addr2line", "cfg-if", "libc", - "miniz_oxide 0.8.5", + "miniz_oxide 0.8.7", "object", "rustc-demangle", "windows-targets 0.52.6", @@ -512,9 +512,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "bytesize" -version = "1.3.2" +version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2c12f985c78475a6b8d629afd0c360260ef34cfef52efccdcfd31972f81c2e" +checksum = "2e93abca9e28e0a1b9877922aacb20576e05d4679ffa78c3d6dc22a26a216659" [[package]] name = "bzip2" @@ -678,9 +678,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.34" +version = "4.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e958897981290da2a852763fe9cdb89cd36977a5d729023127095fa94d95e2ff" +checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944" dependencies = [ "clap_builder", "clap_derive", @@ -698,9 +698,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.34" +version = "4.5.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83b0f35019843db2160b5bb19ae09b4e6411ac33fc6a712003c33e03090e2489" +checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9" dependencies = [ "anstream", "anstyle", @@ -1114,14 +1114,14 @@ dependencies = [ [[package]] name = "flate2" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc" +checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" dependencies = [ "crc32fast", "libz-ng-sys", "libz-rs-sys", - "miniz_oxide 0.8.5", + "miniz_oxide 0.8.7", ] [[package]] @@ -1168,7 +1168,7 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8640e34b88f7652208ce9e88b1a37a2ae95227d84abec377ccd3c5cfeb141ed4" dependencies = [ - "rustix 1.0.3", + "rustix 1.0.5", "windows-sys 0.59.0", ] @@ -1468,9 +1468,9 @@ dependencies = [ [[package]] name = "gix-config-value" -version = "0.14.11" +version = "0.14.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11365144ef93082f3403471dbaa94cfe4b5e72743bdb9560719a251d439f4cee" +checksum = "8dc2c844c4cf141884678cabef736fd91dd73068b9146e6f004ba1a0457944b6" dependencies = [ "bitflags 2.9.0", "bstr", @@ -1498,9 +1498,9 @@ dependencies = [ [[package]] name = "gix-date" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c57c477b645ee248b173bb1176b52dd528872f12c50375801a58aaf5ae91113f" +checksum = "daa30058ec7d3511fbc229e4f9e696a35abd07ec5b82e635eff864a2726217e4" dependencies = [ "bstr", "itoa", @@ -1757,9 +1757,9 @@ dependencies = [ [[package]] name = "gix-packetline" -version = "0.18.3" +version = "0.18.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7e5ae6bc3ac160a6bf44a55f5537813ca3ddb08549c0fd3e7ef699c73c439cd" +checksum = "123844a70cf4d5352441dc06bab0da8aef61be94ec239cb631e0ba01dc6d3a04" dependencies = [ "bstr", "faster-hex", @@ -1769,9 +1769,9 @@ dependencies = [ [[package]] name = "gix-packetline-blocking" -version = "0.18.2" +version = "0.18.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cbf8767c6abd5a6779f586702b5bcd8702380f4208219449cf1c9d0cd1e17c" +checksum = "1ecf3ea2e105c7e45587bac04099824301262a6c43357fad5205da36dbb233b3" dependencies = [ "bstr", "faster-hex", @@ -1781,9 +1781,9 @@ dependencies = [ [[package]] name = "gix-path" -version = "0.10.14" +version = "0.10.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c40f12bb65a8299be0cfb90fe718e3be236b7a94b434877012980863a883a99f" +checksum = "f910668e2f6b2a55ff35a1f04df88a1a049f7b868507f4cbeeaa220eaba7be87" dependencies = [ "bstr", "gix-trace", @@ -1924,9 +1924,9 @@ dependencies = [ [[package]] name = "gix-sec" -version = "0.10.11" +version = "0.10.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d84dae13271f4313f8d60a166bf27e54c968c7c33e2ffd31c48cafe5da649875" +checksum = "47aeb0f13de9ef2f3033f5ff218de30f44db827ac9f1286f9ef050aacddd5888" dependencies = [ "bitflags 2.9.0", "gix-path", @@ -2042,9 +2042,9 @@ dependencies = [ [[package]] name = "gix-validate" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9eaa01c3337d885617c0a42e92823922a2aea71f4caeace6fe87002bdcadbd90" +checksum = "34b5f1253109da6c79ed7cf6e1e38437080bb6d704c76af14c93e2f255234084" dependencies = [ "bstr", "thiserror 2.0.12", @@ -2368,9 +2368,9 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "497bbc33a26fdd4af9ed9c70d63f61cf56a938375fbb32df34db9b1cd6d643f2" dependencies = [ "bytes", "futures-channel", @@ -2378,6 +2378,7 @@ dependencies = [ "http", "http-body", "hyper", + "libc", "pin-project-lite", "socket2", "tokio", @@ -2591,10 +2592,11 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jiff" -version = "0.1.29" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c04ef77ae73f3cf50510712722f0c4e8b46f5aaa1bf5ffad2ae213e6495e78e5" +checksum = "c102670231191d07d37a35af3eb77f1f0dbf7a71be51a962dcd57ea607be7260" dependencies = [ + "jiff-static", "jiff-tzdb-platform", "log", "portable-atomic", @@ -2603,6 +2605,17 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "jiff-static" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cdde31a9d349f1b1f51a0b3714a5940ac022976f4b49485fc04be052b183b4c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "jiff-tzdb" version = "0.1.4" @@ -2620,10 +2633,11 @@ dependencies = [ [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" dependencies = [ + "getrandom 0.3.2", "libc", ] @@ -2703,9 +2717,9 @@ checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "libmimalloc-sys" -version = "0.1.40" +version = "0.1.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07d0e07885d6a754b9c7993f2625187ad694ee985d60f23355ff0e7077261502" +checksum = "6b20daca3a4ac14dbdc753c5e90fc7b490a48a9131daed3c9a9ced7b2defd37b" dependencies = [ "cc", "libc", @@ -2734,9 +2748,9 @@ dependencies = [ [[package]] name = "libz-rs-sys" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "902bc563b5d65ad9bba616b490842ef0651066a1a1dc3ce1087113ffcb873c8d" +checksum = "6489ca9bd760fe9642d7644e827b0c9add07df89857b0416ee15c1cc1a3b8c5a" dependencies = [ "zlib-rs", ] @@ -2892,9 +2906,9 @@ dependencies = [ [[package]] name = "mimalloc" -version = "0.1.44" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99585191385958383e13f6b822e6b6d8d9cf928e7d286ceb092da92b43c87bc1" +checksum = "03cb1f88093fe50061ca1195d336ffec131347c7b833db31f9ab62a2d1b7925f" dependencies = [ "libmimalloc-sys", ] @@ -2922,9 +2936,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.5" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +checksum = "ff70ce3e48ae43fa075863cef62e8b43b71a4f2382229920e0df362592919430" dependencies = [ "adler2", ] @@ -3117,9 +3131,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2806eaa3524762875e21c3dcd057bc4b7bfa01ce4da8d46be1cd43649e1cc6b" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" dependencies = [ "critical-section", "portable-atomic", @@ -3597,7 +3611,7 @@ checksum = "78c81d000a2c524133cc00d2f92f019d399e57906c3b7119271a2495354fe895" dependencies = [ "cfg-if", "libc", - "rustix 1.0.3", + "rustix 1.0.5", "windows 0.61.1", ] @@ -3761,9 +3775,9 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.3" +version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" +checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" dependencies = [ "bitflags 2.9.0", "errno 0.3.10", @@ -4061,9 +4075,9 @@ checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" [[package]] name = "socket2" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" dependencies = [ "libc", "windows-sys 0.52.0", @@ -4227,7 +4241,7 @@ dependencies = [ "fastrand", "getrandom 0.3.2", "once_cell", - "rustix 1.0.3", + "rustix 1.0.5", "windows-sys 0.59.0", ] @@ -4237,7 +4251,7 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "45c6481c4829e4cc63825e62c49186a34538b7b2750b73b266581ffb612fb5ed" dependencies = [ - "rustix 1.0.3", + "rustix 1.0.5", "windows-sys 0.59.0", ] @@ -5424,7 +5438,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d65cbf2f12c15564212d48f4e3dfb87923d25d611f2aed18f4cb23f0413d89e" dependencies = [ "libc", - "rustix 1.0.3", + "rustix 1.0.5", ] [[package]] @@ -5551,9 +5565,9 @@ dependencies = [ [[package]] name = "zlib-rs" -version = "0.4.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b20717f0917c908dc63de2e44e97f1e6b126ca58d0e391cee86d504eb8fbd05" +checksum = "868b928d7949e09af2f6086dfc1e01936064cc7a819253bce650d4e2a2d63ba8" [[package]] name = "zstd" From d7a1d1aeacd96b5d60fbe20e18e5b7c372a25d77 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 5 Apr 2025 10:31:27 +0000 Subject: [PATCH 2015/2020] dep: Upgrade transitive dependencies (#2113) Co-authored-by: github-actions --- Cargo.lock | 237 +++++++++++++++++++++++++++-------------------------- 1 file changed, 123 insertions(+), 114 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a0d40cf2..ef813e7f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -635,9 +635,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.17" +version = "1.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fcb57c740ae1daf453ae85f16e37396f672b039e00d9d866e07ddb24e328e3a" +checksum = "525046617d8376e3db1deffb079e91cef90a89fc3ca5c185bbf8c9ecdd15cd5c" dependencies = [ "jobserver", "libc", @@ -1061,9 +1061,9 @@ dependencies = [ [[package]] name = "errno" -version = "0.3.10" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e" dependencies = [ "libc", "windows-sys 0.59.0", @@ -1319,9 +1319,9 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "gix" -version = "0.70.0" +version = "0.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "736f14636705f3a56ea52b553e67282519418d9a35bb1e90b3a9637a00296b68" +checksum = "a61e71ec6817fc3c9f12f812682cfe51ee6ea0d2e27e02fc3849c35524617435" dependencies = [ "gix-actor", "gix-attributes", @@ -1372,23 +1372,23 @@ dependencies = [ [[package]] name = "gix-actor" -version = "0.33.2" +version = "0.34.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20018a1a6332e065f1fcc8305c1c932c6b8c9985edea2284b3c79dc6fa3ee4b2" +checksum = "f438c87d4028aca4b82f82ba8d8ab1569823cfb3e5bc5fa8456a71678b2a20e7" dependencies = [ "bstr", "gix-date", "gix-utils", "itoa", "thiserror 2.0.12", - "winnow 0.6.26", + "winnow 0.7.4", ] [[package]] name = "gix-attributes" -version = "0.24.0" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f151000bf662ef5f641eca6102d942ee31ace80f271a3ef642e99776ce6ddb38" +checksum = "e4e25825e0430aa11096f8b65ced6780d4a96a133f81904edceebb5344c8dd7f" dependencies = [ "bstr", "gix-glob", @@ -1421,25 +1421,25 @@ dependencies = [ [[package]] name = "gix-command" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb410b84d6575db45e62025a9118bdbf4d4b099ce7575a76161e898d9ca98df1" +checksum = "c0378995847773a697f8e157fe2963ecf3462fe64be05b7b3da000b3b472def8" dependencies = [ "bstr", "gix-path", + "gix-quote", "gix-trace", "shell-words", ] [[package]] name = "gix-commitgraph" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e23a8ec2d8a16026a10dafdb6ed51bcfd08f5d97f20fa52e200bc50cb72e4877" +checksum = "043cbe49b7a7505150db975f3cb7c15833335ac1e26781f615454d9d640a28fe" dependencies = [ "bstr", "gix-chunk", - "gix-features", "gix-hash", "memmap2", "thiserror 2.0.12", @@ -1447,9 +1447,9 @@ dependencies = [ [[package]] name = "gix-config" -version = "0.43.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "377c1efd2014d5d469e0b3cd2952c8097bce9828f634e04d5665383249f1d9e9" +checksum = "9c6f830bf746604940261b49abf7f655d2c19cadc9f4142ae9379e3a316e8cfa" dependencies = [ "bstr", "gix-config-value", @@ -1463,7 +1463,7 @@ dependencies = [ "smallvec", "thiserror 2.0.12", "unicode-bom", - "winnow 0.6.26", + "winnow 0.7.4", ] [[package]] @@ -1481,9 +1481,9 @@ dependencies = [ [[package]] name = "gix-credentials" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf950f9ee1690bb9c4388b5152baa8a9f41ad61e5cf1ba0ec8c207b08dab9e45" +checksum = "25322308aaf65789536b860d21137c3f7b69004ac4971c15c1abb08d3951c062" dependencies = [ "bstr", "gix-command", @@ -1510,9 +1510,9 @@ dependencies = [ [[package]] name = "gix-diff" -version = "0.50.0" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62afb7f4ca0acdf4e9dad92065b2eb1bf2993bcc5014b57bc796e3a365b17c4d" +checksum = "a2c975dad2afc85e4e233f444d1efbe436c3cdcf3a07173984509c436d00a3f8" dependencies = [ "bstr", "gix-hash", @@ -1522,9 +1522,9 @@ dependencies = [ [[package]] name = "gix-discover" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c2414bdf04064e0f5a5aa029dfda1e663cf9a6c4bfc8759f2d369299bb65d8" +checksum = "f7fb8a4349b854506a3915de18d3341e5f1daa6b489c8affc9ca0d69efe86781" dependencies = [ "bstr", "dunce", @@ -1538,32 +1538,30 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.40.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bfdd4838a8d42bd482c9f0cb526411d003ee94cc7c7b08afe5007329c71d554" +checksum = "729b7e708352a35b2b37ab39cbc7a2b9d22f8386808a10b6ea7dd4cd1cf817cd" dependencies = [ "bytes", "bytesize", "crc32fast", "crossbeam-channel", "flate2", - "gix-hash", "gix-trace", "gix-utils", "libc", "once_cell", "parking_lot", "prodash", - "sha1_smol", "thiserror 2.0.12", "walkdir", ] [[package]] name = "gix-filter" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdcc36cd7dbc63ed0ec3558645886553d1afd3cd09daa5efb9cba9cceb942bbb" +checksum = "cb2b2bbffdc5cc9b2b82fc82da1b98163c9b423ac2b45348baa83a947ac9ab89" dependencies = [ "bstr", "encoding_rs", @@ -1582,20 +1580,23 @@ dependencies = [ [[package]] name = "gix-fs" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "182e7fa7bfdf44ffb7cfe7451b373cdf1e00870ac9a488a49587a110c562063d" +checksum = "951e886120dc5fa8cac053e5e5c89443f12368ca36811b2e43d1539081f9c111" dependencies = [ + "bstr", "fastrand", "gix-features", + "gix-path", "gix-utils", + "thiserror 2.0.12", ] [[package]] name = "gix-glob" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e9c7249fa0a78f9b363aa58323db71e0a6161fd69860ed6f48dedf0ef3a314e" +checksum = "20972499c03473e773a2099e5fd0c695b9b72465837797a51a43391a1635a030" dependencies = [ "bitflags 2.9.0", "bstr", @@ -1605,19 +1606,21 @@ dependencies = [ [[package]] name = "gix-hash" -version = "0.16.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e81c5ec48649b1821b3ed066a44efb95f1a268b35c1d91295e61252539fbe9f8" +checksum = "834e79722063958b03342edaa1e17595cd2939bb2b3306b3225d0815566dcb49" dependencies = [ "faster-hex", + "gix-features", + "sha1-checked", "thiserror 2.0.12", ] [[package]] name = "gix-hashtable" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "189130bc372accd02e0520dc5ab1cef318dcc2bc829b76ab8d84bbe90ac212d1" +checksum = "f06066d8702a9186dc1fdc1ed751ff2d7e924ceca21cb5d51b8f990c9c2e014a" dependencies = [ "gix-hash", "hashbrown 0.14.5", @@ -1626,9 +1629,9 @@ dependencies = [ [[package]] name = "gix-ignore" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f529dcb80bf9855c0a7c49f0ac588df6d6952d63a63fefc254b9c869d2cdf6f" +checksum = "9a27c8380f493a10d1457f756a3f81924d578fc08d6535e304dfcafbf0261d18" dependencies = [ "bstr", "gix-glob", @@ -1639,9 +1642,9 @@ dependencies = [ [[package]] name = "gix-index" -version = "0.38.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acd12e3626879369310fffe2ac61acc828613ef656b50c4ea984dd59d7dc85d8" +checksum = "855bece2d4153453aa5d0a80d51deea1ce8cd6a3b4cf213da85ac344ccb908a7" dependencies = [ "bitflags 2.9.0", "bstr", @@ -1667,9 +1670,9 @@ dependencies = [ [[package]] name = "gix-lock" -version = "16.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9739815270ff6940968441824d162df9433db19211ca9ba8c3fc1b50b849c642" +checksum = "df47b8f11c34520db5541bc5fc9fbc8e4b0bdfcec3736af89ccb1a5728a0126f" dependencies = [ "gix-tempfile", "gix-utils", @@ -1678,9 +1681,9 @@ dependencies = [ [[package]] name = "gix-negotiate" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6a8af1ef7bbe303d30b55312b7f4d33e955de43a3642ae9b7347c623d80ef80" +checksum = "dad912acf5a68a7defa4836014337ff4381af8c3c098f41f818a8c524285e57b" dependencies = [ "bitflags 2.9.0", "gix-commitgraph", @@ -1694,9 +1697,9 @@ dependencies = [ [[package]] name = "gix-object" -version = "0.47.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc4b3a0044244f0fe22347fb7a79cca165e37829d668b41b85ff46a43e5fd68" +checksum = "4943fcdae6ffc135920c9ea71e0362ed539182924ab7a85dd9dac8d89b0dd69a" dependencies = [ "bstr", "gix-actor", @@ -1710,14 +1713,14 @@ dependencies = [ "itoa", "smallvec", "thiserror 2.0.12", - "winnow 0.6.26", + "winnow 0.7.4", ] [[package]] name = "gix-odb" -version = "0.67.0" +version = "0.68.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e93457df69cd09573608ce9fa4f443fbd84bc8d15d8d83adecd471058459c1b" +checksum = "50306d40dcc982eb6b7593103f066ea6289c7b094cb9db14f3cd2be0b9f5e610" dependencies = [ "arc-swap", "gix-date", @@ -1736,9 +1739,9 @@ dependencies = [ [[package]] name = "gix-pack" -version = "0.57.0" +version = "0.58.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc13a475b3db735617017fb35f816079bf503765312d4b1913b18cf96f3fa515" +checksum = "9b65fffb09393c26624ca408d32cfe8776fb94cd0a5cdf984905e1d2f39779cb" dependencies = [ "clru", "gix-chunk", @@ -1794,9 +1797,9 @@ dependencies = [ [[package]] name = "gix-pathspec" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6430d3a686c08e9d59019806faa78c17315fe22ae73151a452195857ca02f86c" +checksum = "fef8422c3c9066d649074b24025125963f85232bfad32d6d16aea9453b82ec14" dependencies = [ "bitflags 2.9.0", "bstr", @@ -1809,9 +1812,9 @@ dependencies = [ [[package]] name = "gix-prompt" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79f2185958e1512b989a007509df8d61dca014aa759a22bee80cfa6c594c3b6d" +checksum = "fbf9cbf6239fd32f2c2c9c57eeb4e9b28fa1c9b779fa0e3b7c455eb1ca49d5f0" dependencies = [ "gix-command", "gix-config-value", @@ -1822,9 +1825,9 @@ dependencies = [ [[package]] name = "gix-protocol" -version = "0.48.0" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c61bd61afc6b67d213241e2100394c164be421e3f7228d3521b04f48ca5ba90" +checksum = "5678ddae1d62880bc30e2200be1b9387af3372e0e88e21f81b4e7f8367355b5a" dependencies = [ "bstr", "gix-credentials", @@ -1843,14 +1846,14 @@ dependencies = [ "gix-utils", "maybe-async", "thiserror 2.0.12", - "winnow 0.6.26", + "winnow 0.7.4", ] [[package]] name = "gix-quote" -version = "0.4.15" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e49357fccdb0c85c0d3a3292a9f6db32d9b3535959b5471bb9624908f4a066c6" +checksum = "1b005c550bf84de3b24aa5e540a23e6146a1c01c7d30470e35d75a12f827f969" dependencies = [ "bstr", "gix-utils", @@ -1859,9 +1862,9 @@ dependencies = [ [[package]] name = "gix-ref" -version = "0.50.0" +version = "0.51.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47adf4c5f933429f8554e95d0d92eee583cfe4b95d2bf665cd6fd4a1531ee20c" +checksum = "b2e1f7eb6b7ce82d2d19961f74bd637bab3ea79b1bc7bfb23dbefc67b0415d8b" dependencies = [ "gix-actor", "gix-features", @@ -1875,14 +1878,14 @@ dependencies = [ "gix-validate", "memmap2", "thiserror 2.0.12", - "winnow 0.6.26", + "winnow 0.7.4", ] [[package]] name = "gix-refspec" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59650228d8f612f68e7f7a25f517fcf386c5d0d39826085492e94766858b0a90" +checksum = "1d8587b21e2264a6e8938d940c5c99662779c13a10741a5737b15fc85c252ffc" dependencies = [ "bstr", "gix-hash", @@ -1894,9 +1897,9 @@ dependencies = [ [[package]] name = "gix-revision" -version = "0.32.0" +version = "0.33.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fe28bbccca55da6d66e6c6efc6bb4003c29d407afd8178380293729733e6b53" +checksum = "342caa4e158df3020cadf62f656307c3948fe4eacfdf67171d7212811860c3e9" dependencies = [ "bstr", "gix-commitgraph", @@ -1909,9 +1912,9 @@ dependencies = [ [[package]] name = "gix-revwalk" -version = "0.18.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4ecb80c235b1e9ef2b99b23a81ea50dd569a88a9eb767179793269e0e616247" +checksum = "2dc7c3d7e5cdc1ab8d35130106e4af0a4f9f9eca0c81f4312b690780e92bde0d" dependencies = [ "gix-commitgraph", "gix-date", @@ -1936,9 +1939,9 @@ dependencies = [ [[package]] name = "gix-shallow" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab72543011e303e52733c85bef784603ef39632ddf47f69723def52825e35066" +checksum = "cc0598aacfe1d52575a21c9492fee086edbb21e228ec36c819c42ab923f434c3" dependencies = [ "bstr", "gix-hash", @@ -1948,9 +1951,9 @@ dependencies = [ [[package]] name = "gix-submodule" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74972fe8d46ac8a09490ae1e843b4caf221c5b157c5ac17057e8e1c38417a3ac" +checksum = "78c7390c2059505c365e9548016d4edc9f35749c6a9112b7b1214400bbc68da2" dependencies = [ "bstr", "gix-config", @@ -1963,9 +1966,9 @@ dependencies = [ [[package]] name = "gix-tempfile" -version = "16.0.0" +version = "17.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2558f423945ef24a8328c55d1fd6db06b8376b0e7013b1bb476cc4ffdf678501" +checksum = "3d6de439bbb9a5d3550c9c7fab0e16d2d637d120fcbe0dfbc538772a187f099b" dependencies = [ "gix-fs", "libc", @@ -1982,9 +1985,9 @@ checksum = "7c396a2036920c69695f760a65e7f2677267ccf483f25046977d87e4cb2665f7" [[package]] name = "gix-transport" -version = "0.45.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11187418489477b1b5b862ae1aedbbac77e582f2c4b0ef54280f20cfe5b964d9" +checksum = "b3f68c2870bfca8278389d2484a7f2215b67d0b0cc5277d3c72ad72acf41787e" dependencies = [ "base64", "bstr", @@ -2001,9 +2004,9 @@ dependencies = [ [[package]] name = "gix-traverse" -version = "0.44.0" +version = "0.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bec70e53896586ef32a3efa7e4427b67308531ed186bb6120fb3eca0f0d61b4" +checksum = "36c0b049f8bdb61b20016694102f7b507f2e1727e83e9c5e6dad4f7d84ff7384" dependencies = [ "bitflags 2.9.0", "gix-commitgraph", @@ -2018,9 +2021,9 @@ dependencies = [ [[package]] name = "gix-url" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29218c768b53dd8f116045d87fec05b294c731a4b2bdd257eeca2084cc150b13" +checksum = "48dfe23f93f1ddb84977d80bb0dd7aa09d1bf5d5afc0c9b6820cccacc25ae860" dependencies = [ "bstr", "gix-features", @@ -2032,9 +2035,9 @@ dependencies = [ [[package]] name = "gix-utils" -version = "0.1.14" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff08f24e03ac8916c478c8419d7d3c33393da9bb41fa4c24455d5406aeefd35f" +checksum = "189f8724cf903e7fd57cfe0b7bc209db255cacdcb22c781a022f52c3a774f8d0" dependencies = [ "fastrand", "unicode-normalization", @@ -2052,9 +2055,9 @@ dependencies = [ [[package]] name = "gix-worktree" -version = "0.39.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6673512f7eaa57a6876adceca6978a501d6c6569a4f177767dc405f8b9778958" +checksum = "f7760dbc4b79aa274fed30adc0d41dca6b917641f26e7867c4071b1fb4dc727b" dependencies = [ "bstr", "gix-attributes", @@ -2071,9 +2074,9 @@ dependencies = [ [[package]] name = "gix-worktree-state" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f5e199ad5af972086683bd31d640c82cb85885515bf86d86236c73ce575bf0" +checksum = "490eb4d38ec2735b3466840aa3881b44ec1a4c180d6a658abfab03910380e18b" dependencies = [ "bstr", "gix-features", @@ -2527,9 +2530,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", "hashbrown 0.15.2", @@ -3141,9 +3144,9 @@ dependencies = [ [[package]] name = "openssl" -version = "0.10.71" +version = "0.10.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e14130c6a98cd258fdcb0fb6d744152343ff729cbfcb28c656a9d12b999fbcd" +checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" dependencies = [ "bitflags 2.9.0", "cfg-if", @@ -3182,9 +3185,9 @@ dependencies = [ [[package]] name = "openssl-sys" -version = "0.9.106" +version = "0.9.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd" +checksum = "8288979acd84749c744a9014b4382d42b8f7b2592847b5afb2ed29e5d16ede07" dependencies = [ "cc", "libc", @@ -3767,7 +3770,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ "bitflags 2.9.0", - "errno 0.3.10", + "errno 0.3.11", "libc", "linux-raw-sys 0.4.15", "windows-sys 0.59.0", @@ -3780,7 +3783,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d97817398dd4bb2e6da002002db259209759911da105da92bec29ccb12cf58bf" dependencies = [ "bitflags 2.9.0", - "errno 0.3.10", + "errno 0.3.11", "libc", "linux-raw-sys 0.9.3", "windows-sys 0.59.0", @@ -3992,10 +3995,25 @@ dependencies = [ ] [[package]] -name = "sha1_smol" -version = "1.0.1" +name = "sha1" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbfa15b3dddfee50a0fff136974b3e1bde555604ba463834a7eb7deb6417705d" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha1-checked" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89f599ac0c323ebb1c6082821a54962b839832b03984598375bff3975b804423" +dependencies = [ + "digest", + "sha1", +] [[package]] name = "sha2" @@ -4040,9 +4058,9 @@ dependencies = [ [[package]] name = "simple-git" -version = "0.2.18" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e87f19cbb1c57c67e149b4d14ee0ae97a96b4bfd97d4fe122880a4a14370af9" +checksum = "532b9541e0f6fe54f7a721953d81371b58b601d618294bd8eba284df79acefff" dependencies = [ "compact_str", "derive_destructure2", @@ -4069,9 +4087,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" [[package]] name = "socket2" @@ -5372,15 +5390,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "winnow" -version = "0.6.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e90edd2ac1aa278a5c4599b1d89cf03074b610800f866d4026dc199d7929a28" -dependencies = [ - "memchr", -] - [[package]] name = "winnow" version = "0.7.4" From e986d53f05c7967b1482bab1b5a3bd92a822ee0a Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sat, 5 Apr 2025 11:02:32 +0000 Subject: [PATCH 2016/2020] chore: release (#2106) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- Cargo.lock | 16 ++++++++-------- crates/bin/Cargo.toml | 4 ++-- crates/binstalk-downloader/CHANGELOG.md | 6 ++++++ crates/binstalk-downloader/Cargo.toml | 2 +- crates/binstalk-fetchers/CHANGELOG.md | 6 ++++++ crates/binstalk-fetchers/Cargo.toml | 8 ++++---- crates/binstalk-git-repo-api/CHANGELOG.md | 6 ++++++ crates/binstalk-git-repo-api/Cargo.toml | 6 +++--- crates/binstalk-manifests/CHANGELOG.md | 6 ++++++ crates/binstalk-manifests/Cargo.toml | 4 ++-- crates/binstalk-registry/CHANGELOG.md | 6 ++++++ crates/binstalk-registry/Cargo.toml | 6 +++--- crates/binstalk/CHANGELOG.md | 6 ++++++ crates/binstalk/Cargo.toml | 12 ++++++------ crates/detect-targets/CHANGELOG.md | 6 ++++++ crates/detect-targets/Cargo.toml | 2 +- crates/detect-wasi/CHANGELOG.md | 6 ++++++ crates/detect-wasi/Cargo.toml | 2 +- 18 files changed, 79 insertions(+), 31 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index ef813e7f..89599192 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -242,7 +242,7 @@ dependencies = [ [[package]] name = "binstalk" -version = "0.28.30" +version = "0.28.31" dependencies = [ "binstalk-bins", "binstalk-downloader", @@ -288,7 +288,7 @@ dependencies = [ [[package]] name = "binstalk-downloader" -version = "0.13.16" +version = "0.13.17" dependencies = [ "async-compression", "async-trait", @@ -324,7 +324,7 @@ dependencies = [ [[package]] name = "binstalk-fetchers" -version = "0.10.17" +version = "0.10.18" dependencies = [ "async-trait", "binstalk-downloader", @@ -348,7 +348,7 @@ dependencies = [ [[package]] name = "binstalk-git-repo-api" -version = "0.5.18" +version = "0.5.19" dependencies = [ "binstalk-downloader", "compact_str", @@ -367,7 +367,7 @@ dependencies = [ [[package]] name = "binstalk-manifests" -version = "0.15.27" +version = "0.15.28" dependencies = [ "beef", "binstalk-types", @@ -388,7 +388,7 @@ dependencies = [ [[package]] name = "binstalk-registry" -version = "0.11.17" +version = "0.11.18" dependencies = [ "async-trait", "base16", @@ -925,7 +925,7 @@ dependencies = [ [[package]] name = "detect-targets" -version = "0.1.46" +version = "0.1.47" dependencies = [ "cfg-if", "guess_host_triple", @@ -937,7 +937,7 @@ dependencies = [ [[package]] name = "detect-wasi" -version = "1.0.27" +version = "1.0.28" dependencies = [ "tempfile", ] diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 97f8e960..3e8a9c1a 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -23,8 +23,8 @@ pkg-fmt = "zip" [dependencies] atomic-file-install = { version = "1.0.11", path = "../atomic-file-install" } -binstalk = { path = "../binstalk", version = "0.28.30", default-features = false } -binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.27" } +binstalk = { path = "../binstalk", version = "0.28.31", default-features = false } +binstalk-manifests = { path = "../binstalk-manifests", version = "0.15.28" } clap = { version = "4.5.3", features = ["derive", "env", "wrap_help"] } clap-cargo = "0.15.2" compact_str = "0.9.0" diff --git a/crates/binstalk-downloader/CHANGELOG.md b/crates/binstalk-downloader/CHANGELOG.md index ecfd5143..3dfaa698 100644 --- a/crates/binstalk-downloader/CHANGELOG.md +++ b/crates/binstalk-downloader/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.13.17](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.16...binstalk-downloader-v0.13.17) - 2025-04-05 + +### Other + +- Fix clippy lints ([#2111](https://github.com/cargo-bins/cargo-binstall/pull/2111)) + ## [0.13.16](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-downloader-v0.13.15...binstalk-downloader-v0.13.16) - 2025-03-19 ### Other diff --git a/crates/binstalk-downloader/Cargo.toml b/crates/binstalk-downloader/Cargo.toml index 20a71b8b..c89c539e 100644 --- a/crates/binstalk-downloader/Cargo.toml +++ b/crates/binstalk-downloader/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-downloader" description = "The binstall toolkit for downloading and extracting file" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-downloader" -version = "0.13.16" +version = "0.13.17" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/binstalk-fetchers/CHANGELOG.md b/crates/binstalk-fetchers/CHANGELOG.md index e8d9bd8b..5158130e 100644 --- a/crates/binstalk-fetchers/CHANGELOG.md +++ b/crates/binstalk-fetchers/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.10.18](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.17...binstalk-fetchers-v0.10.18) - 2025-04-05 + +### Other + +- updated the following local packages: binstalk-downloader, binstalk-downloader, binstalk-git-repo-api + ## [0.10.17](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-fetchers-v0.10.16...binstalk-fetchers-v0.10.17) - 2025-03-19 ### Other diff --git a/crates/binstalk-fetchers/Cargo.toml b/crates/binstalk-fetchers/Cargo.toml index 8da104e5..4d525049 100644 --- a/crates/binstalk-fetchers/Cargo.toml +++ b/crates/binstalk-fetchers/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-fetchers" -version = "0.10.17" +version = "0.10.18" edition = "2021" description = "The binstall fetchers" @@ -12,8 +12,8 @@ license = "GPL-3.0-only" [dependencies] async-trait = "0.1.88" -binstalk-downloader = { version = "0.13.16", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.18", path = "../binstalk-git-repo-api" } +binstalk-downloader = { version = "0.13.17", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.19", path = "../binstalk-git-repo-api" } binstalk-types = { version = "0.9.4", path = "../binstalk-types" } bytes = "1.4.0" compact_str = { version = "0.9.0" } @@ -34,7 +34,7 @@ tracing = "0.1.39" url = "2.5.4" [dev-dependencies] -binstalk-downloader = { version = "0.13.16", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.17", path = "../binstalk-downloader" } [features] quickinstall = [] diff --git a/crates/binstalk-git-repo-api/CHANGELOG.md b/crates/binstalk-git-repo-api/CHANGELOG.md index 7cf15cdf..1d6ac3c8 100644 --- a/crates/binstalk-git-repo-api/CHANGELOG.md +++ b/crates/binstalk-git-repo-api/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.5.19](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.18...binstalk-git-repo-api-v0.5.19) - 2025-04-05 + +### Other + +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.5.18](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-git-repo-api-v0.5.17...binstalk-git-repo-api-v0.5.18) - 2025-03-19 ### Other diff --git a/crates/binstalk-git-repo-api/Cargo.toml b/crates/binstalk-git-repo-api/Cargo.toml index e77b9097..1ce83fb4 100644 --- a/crates/binstalk-git-repo-api/Cargo.toml +++ b/crates/binstalk-git-repo-api/Cargo.toml @@ -3,14 +3,14 @@ name = "binstalk-git-repo-api" description = "The binstall toolkit for accessing API for git repository" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-git-repo-api" -version = "0.5.18" +version = "0.5.19" rust-version = "1.70.0" authors = ["Jiahao XU "] edition = "2021" license = "Apache-2.0 OR MIT" [dependencies] -binstalk-downloader = { version = "0.13.16", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.17", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } compact_str = "0.9.0" @@ -25,6 +25,6 @@ url = "2.5.4" zeroize = "1.8.1" [dev-dependencies] -binstalk-downloader = { version = "0.13.16", path = "../binstalk-downloader" } +binstalk-downloader = { version = "0.13.17", path = "../binstalk-downloader" } tracing-subscriber = "0.3" once_cell = "1" diff --git a/crates/binstalk-manifests/CHANGELOG.md b/crates/binstalk-manifests/CHANGELOG.md index 7ec47ad1..aa0fe9bf 100644 --- a/crates/binstalk-manifests/CHANGELOG.md +++ b/crates/binstalk-manifests/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.15.28](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.27...binstalk-manifests-v0.15.28) - 2025-04-05 + +### Other + +- Fix clippy lints ([#2111](https://github.com/cargo-bins/cargo-binstall/pull/2111)) + ## [0.15.27](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-manifests-v0.15.26...binstalk-manifests-v0.15.27) - 2025-03-19 ### Other diff --git a/crates/binstalk-manifests/Cargo.toml b/crates/binstalk-manifests/Cargo.toml index a6417d49..8f650dfb 100644 --- a/crates/binstalk-manifests/Cargo.toml +++ b/crates/binstalk-manifests/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk-manifests" description = "The binstall toolkit for manipulating with manifest" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk-manifests" -version = "0.15.27" +version = "0.15.28" rust-version = "1.61.0" authors = ["ryan "] edition = "2021" @@ -25,5 +25,5 @@ toml_edit = { version = "0.22.12", features = ["serde"] } url = { version = "2.5.4", features = ["serde"] } [dev-dependencies] -detect-targets = { version = "0.1.46", path = "../detect-targets" } +detect-targets = { version = "0.1.47", path = "../detect-targets" } tempfile = "3.5.0" diff --git a/crates/binstalk-registry/CHANGELOG.md b/crates/binstalk-registry/CHANGELOG.md index 5c8b7e50..e1f6edfc 100644 --- a/crates/binstalk-registry/CHANGELOG.md +++ b/crates/binstalk-registry/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.11.18](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.17...binstalk-registry-v0.11.18) - 2025-04-05 + +### Other + +- updated the following local packages: binstalk-downloader, binstalk-downloader + ## [0.11.17](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-registry-v0.11.16...binstalk-registry-v0.11.17) - 2025-03-19 ### Other diff --git a/crates/binstalk-registry/Cargo.toml b/crates/binstalk-registry/Cargo.toml index def687fe..4c6b879d 100644 --- a/crates/binstalk-registry/Cargo.toml +++ b/crates/binstalk-registry/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "binstalk-registry" -version = "0.11.17" +version = "0.11.18" edition = "2021" rust-version = "1.65.0" @@ -13,7 +13,7 @@ license = "Apache-2.0 OR MIT" [dependencies] async-trait = "0.1.88" base16 = "0.2.1" -binstalk-downloader = { version = "0.13.16", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.17", path = "../binstalk-downloader", default-features = false, features = [ "json", ] } binstalk-types = { version = "0.9.4", path = "../binstalk-types" } @@ -40,7 +40,7 @@ url = "2.5.4" [dev-dependencies] tokio = { version = "1", features = ["rt-multi-thread", "macros"] } toml_edit = { version = "0.22.12", features = ["serde"] } -binstalk-downloader = { version = "0.13.16", path = "../binstalk-downloader", default-features = false, features = [ +binstalk-downloader = { version = "0.13.17", path = "../binstalk-downloader", default-features = false, features = [ "rustls", ] } diff --git a/crates/binstalk/CHANGELOG.md b/crates/binstalk/CHANGELOG.md index 7e130c42..ce5bb284 100644 --- a/crates/binstalk/CHANGELOG.md +++ b/crates/binstalk/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.28.31](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.30...binstalk-v0.28.31) - 2025-04-05 + +### Other + +- updated the following local packages: binstalk-downloader, detect-targets, binstalk-git-repo-api, binstalk-fetchers, binstalk-registry + ## [0.28.30](https://github.com/cargo-bins/cargo-binstall/compare/binstalk-v0.28.29...binstalk-v0.28.30) - 2025-03-19 ### Other diff --git a/crates/binstalk/Cargo.toml b/crates/binstalk/Cargo.toml index 22e62e3f..3c26c8a7 100644 --- a/crates/binstalk/Cargo.toml +++ b/crates/binstalk/Cargo.toml @@ -3,7 +3,7 @@ name = "binstalk" description = "The binstall toolkit (library interface)" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/binstalk" -version = "0.28.30" +version = "0.28.31" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" @@ -11,17 +11,17 @@ license = "GPL-3.0-only" [dependencies] binstalk-bins = { version = "0.6.13", path = "../binstalk-bins" } -binstalk-downloader = { version = "0.13.16", path = "../binstalk-downloader", default-features = false } -binstalk-git-repo-api = { version = "0.5.18", path = "../binstalk-git-repo-api" } -binstalk-fetchers = { version = "0.10.17", path = "../binstalk-fetchers", features = [ +binstalk-downloader = { version = "0.13.17", path = "../binstalk-downloader", default-features = false } +binstalk-git-repo-api = { version = "0.5.19", path = "../binstalk-git-repo-api" } +binstalk-fetchers = { version = "0.10.18", path = "../binstalk-fetchers", features = [ "quickinstall", ] } -binstalk-registry = { version = "0.11.17", path = "../binstalk-registry" } +binstalk-registry = { version = "0.11.18", path = "../binstalk-registry" } binstalk-types = { version = "0.9.4", path = "../binstalk-types" } cargo-toml-workspace = { version = "7.0.6", path = "../cargo-toml-workspace" } command-group = { version = "5.0.1", features = ["with-tokio"] } compact_str = { version = "0.9.0", features = ["serde"] } -detect-targets = { version = "0.1.46", path = "../detect-targets", features = [ +detect-targets = { version = "0.1.47", path = "../detect-targets", features = [ "tracing", ] } either = "1.11.0" diff --git a/crates/detect-targets/CHANGELOG.md b/crates/detect-targets/CHANGELOG.md index 6d5e95b2..d73d200d 100644 --- a/crates/detect-targets/CHANGELOG.md +++ b/crates/detect-targets/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.47](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.46...detect-targets-v0.1.47) - 2025-04-05 + +### Other + +- update Cargo.lock dependencies + ## [0.1.46](https://github.com/cargo-bins/cargo-binstall/compare/detect-targets-v0.1.45...detect-targets-v0.1.46) - 2025-03-19 ### Other diff --git a/crates/detect-targets/Cargo.toml b/crates/detect-targets/Cargo.toml index c82c516c..cfc01aaa 100644 --- a/crates/detect-targets/Cargo.toml +++ b/crates/detect-targets/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-targets" description = "Detect the target of the env at runtime" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-targets" -version = "0.1.46" +version = "0.1.47" rust-version = "1.62.0" authors = ["Jiahao XU "] edition = "2021" diff --git a/crates/detect-wasi/CHANGELOG.md b/crates/detect-wasi/CHANGELOG.md index 56144956..9466296f 100644 --- a/crates/detect-wasi/CHANGELOG.md +++ b/crates/detect-wasi/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [1.0.28](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.27...detect-wasi-v1.0.28) - 2025-04-05 + +### Other + +- update Cargo.lock dependencies + ## [1.0.27](https://github.com/cargo-bins/cargo-binstall/compare/detect-wasi-v1.0.26...detect-wasi-v1.0.27) - 2025-03-19 ### Other diff --git a/crates/detect-wasi/Cargo.toml b/crates/detect-wasi/Cargo.toml index feb37dbb..65920f7a 100644 --- a/crates/detect-wasi/Cargo.toml +++ b/crates/detect-wasi/Cargo.toml @@ -3,7 +3,7 @@ name = "detect-wasi" description = "Detect if WASI can be run" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/detect-wasi" -version = "1.0.27" +version = "1.0.28" rust-version = "1.61.0" authors = ["Félix Saparelli "] edition = "2021" From 63aaa5c1932cebabc34eceda9d92a70215dcead6 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Sun, 6 Apr 2025 04:47:09 +0000 Subject: [PATCH 2017/2020] release: cargo-binstall v1.12.3 (#2114) chore: Release Co-authored-by: github-actions --- Cargo.lock | 2 +- crates/bin/Cargo.toml | 2 +- crates/bin/windows.manifest | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 89599192..b241aea8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -547,7 +547,7 @@ dependencies = [ [[package]] name = "cargo-binstall" -version = "1.12.2" +version = "1.12.3" dependencies = [ "atomic-file-install", "binstalk", diff --git a/crates/bin/Cargo.toml b/crates/bin/Cargo.toml index 3e8a9c1a..fd5c42b3 100644 --- a/crates/bin/Cargo.toml +++ b/crates/bin/Cargo.toml @@ -3,7 +3,7 @@ name = "cargo-binstall" description = "Binary installation for rust projects" repository = "https://github.com/cargo-bins/cargo-binstall" documentation = "https://docs.rs/cargo-binstall" -version = "1.12.2" +version = "1.12.3" rust-version = "1.79.0" authors = ["ryan "] edition = "2021" diff --git a/crates/bin/windows.manifest b/crates/bin/windows.manifest index be3ad5b3..215f50b2 100644 --- a/crates/bin/windows.manifest +++ b/crates/bin/windows.manifest @@ -3,7 +3,7 @@ From b28889078798cc98d3e7dc49684c64d77cd374bc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 7 Apr 2025 13:52:11 +1200 Subject: [PATCH 2018/2020] build(deps): bump tj-actions/changed-files from 0b975f61488402a699abcebd6a1e25924cf85218 to 6f67ee9ac810f0192ea7b3d2086406f97847bcf9 (#2115) build(deps): bump tj-actions/changed-files Bumps [tj-actions/changed-files](https://github.com/tj-actions/changed-files) from 0b975f61488402a699abcebd6a1e25924cf85218 to 6f67ee9ac810f0192ea7b3d2086406f97847bcf9. - [Release notes](https://github.com/tj-actions/changed-files/releases) - [Changelog](https://github.com/tj-actions/changed-files/blob/main/HISTORY.md) - [Commits](https://github.com/tj-actions/changed-files/compare/0b975f61488402a699abcebd6a1e25924cf85218...6f67ee9ac810f0192ea7b3d2086406f97847bcf9) --- updated-dependencies: - dependency-name: tj-actions/changed-files dependency-version: 6f67ee9ac810f0192ea7b3d2086406f97847bcf9 dependency-type: direct:production ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .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 dfd78722..42774319 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -53,7 +53,7 @@ jobs: - name: Get changed files id: changed-files - uses: tj-actions/changed-files@0b975f61488402a699abcebd6a1e25924cf85218 + uses: tj-actions/changed-files@6f67ee9ac810f0192ea7b3d2086406f97847bcf9 with: dir_names: true dir_names_exclude_current_dir: true From acc44cb2074df76ed5fcafe8c2ef6167ad1d750d Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 11 Apr 2025 08:26:47 +0000 Subject: [PATCH 2019/2020] dep: Upgrade transitive dependencies (#2122) Co-authored-by: github-actions --- Cargo.lock | 112 ++++++++++++++++++++++------------------------------- 1 file changed, 47 insertions(+), 65 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b241aea8..418ebe58 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -204,7 +204,7 @@ dependencies = [ "addr2line", "cfg-if", "libc", - "miniz_oxide 0.8.7", + "miniz_oxide 0.8.8", "object", "rustc-demangle", "windows-targets 0.52.6", @@ -483,9 +483,9 @@ dependencies = [ [[package]] name = "bstr" -version = "1.11.3" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" +checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4" dependencies = [ "memchr", "regex-automata 0.4.9", @@ -842,9 +842,9 @@ checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" [[package]] name = "crossbeam-channel" -version = "0.5.14" +version = "0.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ba6d68e24814cb8de6bb986db8222d3a027d15872cabc0d18817bc3c0e4471" +checksum = "82b8f8f868b36967f9606790d1903570de9ceaf870a7bf9fbbd3016d636a2cb2" dependencies = [ "crossbeam-utils", ] @@ -905,9 +905,9 @@ checksum = "da692b8d1080ea3045efaab14434d40468c3d8657e42abddfffca87b428f4c1b" [[package]] name = "deranged" -version = "0.4.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cfac68e08048ae1883171632c2aef3ebc555621ae56fbccce1cbf22dd7f058" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" dependencies = [ "powerfmt", ] @@ -1121,7 +1121,7 @@ dependencies = [ "crc32fast", "libz-ng-sys", "libz-rs-sys", - "miniz_oxide 0.8.7", + "miniz_oxide 0.8.8", ] [[package]] @@ -1381,7 +1381,7 @@ dependencies = [ "gix-utils", "itoa", "thiserror 2.0.12", - "winnow 0.7.4", + "winnow 0.7.6", ] [[package]] @@ -1463,7 +1463,7 @@ dependencies = [ "smallvec", "thiserror 2.0.12", "unicode-bom", - "winnow 0.7.4", + "winnow 0.7.6", ] [[package]] @@ -1538,15 +1538,16 @@ dependencies = [ [[package]] name = "gix-features" -version = "0.41.0" +version = "0.41.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729b7e708352a35b2b37ab39cbc7a2b9d22f8386808a10b6ea7dd4cd1cf817cd" +checksum = "016d6050219458d14520fe22bdfdeb9cb71631dec9bc2724767c983f60109634" dependencies = [ "bytes", "bytesize", "crc32fast", "crossbeam-channel", "flate2", + "gix-path", "gix-trace", "gix-utils", "libc", @@ -1713,7 +1714,7 @@ dependencies = [ "itoa", "smallvec", "thiserror 2.0.12", - "winnow 0.7.4", + "winnow 0.7.6", ] [[package]] @@ -1846,7 +1847,7 @@ dependencies = [ "gix-utils", "maybe-async", "thiserror 2.0.12", - "winnow 0.7.4", + "winnow 0.7.6", ] [[package]] @@ -1878,7 +1879,7 @@ dependencies = [ "gix-validate", "memmap2", "thiserror 2.0.12", - "winnow 0.7.4", + "winnow 0.7.6", ] [[package]] @@ -2253,13 +2254,13 @@ dependencies = [ [[package]] name = "hostname" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9c7c7c8ac16c798734b8a24560c1362120597c40d5e1459f09498f8f6c8f2ba" +checksum = "a56f203cd1c76362b69e3863fd987520ac36cf70a8c92627449b2f64a8cf7d65" dependencies = [ "cfg-if", "libc", - "windows 0.52.0", + "windows-link", ] [[package]] @@ -2595,9 +2596,9 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jiff" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c102670231191d07d37a35af3eb77f1f0dbf7a71be51a962dcd57ea607be7260" +checksum = "1f33145a5cbea837164362c7bd596106eb7c5198f97d1ba6f6ebb3223952e488" dependencies = [ "jiff-static", "jiff-tzdb-platform", @@ -2610,9 +2611,9 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.5" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cdde31a9d349f1b1f51a0b3714a5940ac022976f4b49485fc04be052b183b4c" +checksum = "43ce13c40ec6956157a3635d97a1ee2df323b263f09ea14165131289cb0f5c19" dependencies = [ "proc-macro2", "quote", @@ -2720,9 +2721,9 @@ checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" [[package]] name = "libmimalloc-sys" -version = "0.1.41" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b20daca3a4ac14dbdc753c5e90fc7b490a48a9131daed3c9a9ced7b2defd37b" +checksum = "ec9d6fac27761dabcd4ee73571cdb06b7022dc99089acbe5435691edffaac0f4" dependencies = [ "cc", "libc", @@ -2736,7 +2737,7 @@ checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ "bitflags 2.9.0", "libc", - "redox_syscall 0.5.10", + "redox_syscall 0.5.11", ] [[package]] @@ -2766,9 +2767,9 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux-raw-sys" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "litemap" @@ -2909,9 +2910,9 @@ dependencies = [ [[package]] name = "mimalloc" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03cb1f88093fe50061ca1195d336ffec131347c7b833db31f9ab62a2d1b7925f" +checksum = "995942f432bbb4822a7e9c3faa87a695185b0d09273ba85f097b54f4e458f2af" dependencies = [ "libmimalloc-sys", ] @@ -2939,9 +2940,9 @@ dependencies = [ [[package]] name = "miniz_oxide" -version = "0.8.7" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff70ce3e48ae43fa075863cef62e8b43b71a4f2382229920e0df362592919430" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" dependencies = [ "adler2", ] @@ -3176,9 +3177,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-src" -version = "300.4.2+3.4.1" +version = "300.5.0+3.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168ce4e058f975fe43e89d9ccf78ca668601887ae736090aacc23ae353c298e2" +checksum = "e8ce546f549326b0e6052b649198487d91320875da901e7bd11a06d1ee3f9c2f" dependencies = [ "cc", ] @@ -3259,7 +3260,7 @@ checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.5.10", + "redox_syscall 0.5.11", "smallvec", "windows-targets 0.52.6", ] @@ -3349,9 +3350,9 @@ dependencies = [ [[package]] name = "positioned-io" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccabfeeb89c73adf4081f0dca7f8e28dbda90981a222ceea37f619e93ea6afe9" +checksum = "e8078ce4d22da5e8f57324d985cc9befe40c49ab0507a192d6be9e59584495c9" dependencies = [ "byteorder", "libc", @@ -3588,9 +3589,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.10" +version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1" +checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3" dependencies = [ "bitflags 2.9.0", ] @@ -3785,15 +3786,15 @@ dependencies = [ "bitflags 2.9.0", "errno 0.3.11", "libc", - "linux-raw-sys 0.9.3", + "linux-raw-sys 0.9.4", "windows-sys 0.59.0", ] [[package]] name = "rustls" -version = "0.23.25" +version = "0.23.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "822ee9188ac4ec04a2f0531e55d035fb2de73f18b41a63c70c2712503b6fb13c" +checksum = "df51b5869f3a441595eac5e8ff14d486ff285f7b8c0df8770e49c3b56351f0f0" dependencies = [ "log", "once_cell", @@ -4393,9 +4394,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.44.1" +version = "1.44.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a" +checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48" dependencies = [ "backtrace", "bytes", @@ -4509,7 +4510,7 @@ dependencies = [ "serde", "serde_spanned", "toml_datetime", - "winnow 0.7.4", + "winnow 0.7.6", ] [[package]] @@ -4965,16 +4966,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" -dependencies = [ - "windows-core 0.52.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows" version = "0.58.0" @@ -5007,15 +4998,6 @@ dependencies = [ "windows-core 0.61.0", ] -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-core" version = "0.58.0" @@ -5392,9 +5374,9 @@ dependencies = [ [[package]] name = "winnow" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e97b544156e9bebe1a0ffbc03484fc1ffe3100cbce3ffb17eac35f7cdd7ab36" +checksum = "63d3fcd9bba44b03821e7d699eeee959f3126dcc4aa8e4ae18ec617c2a5cea10" dependencies = [ "memchr", ] From a803508dbf9c51e6ba0a3a68aa5bcb3b8fc6f4e2 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Fri, 18 Apr 2025 04:02:19 +0000 Subject: [PATCH 2020/2020] dep: Upgrade transitive dependencies (#2130) Co-authored-by: github-actions --- Cargo.lock | 65 +++++++++++++++++++++++++++++------------------------- 1 file changed, 35 insertions(+), 30 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 418ebe58..c19a45dd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -117,9 +117,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.97" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "arc-swap" @@ -516,6 +516,12 @@ version = "1.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e93abca9e28e0a1b9877922aacb20576e05d4679ffa78c3d6dc22a26a216659" +[[package]] +name = "bytesize" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3c8f83209414aacf0eeae3cf730b18d6981697fba62f200fcfb92b9f082acba" + [[package]] name = "bzip2" version = "0.5.2" @@ -635,9 +641,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.18" +version = "1.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525046617d8376e3db1deffb079e91cef90a89fc3ca5c185bbf8c9ecdd15cd5c" +checksum = "8e3a13707ac958681c13b39b458c073d0d9bc8a22cb1b2f4c8e55eb72c13f362" dependencies = [ "jobserver", "libc", @@ -678,9 +684,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.35" +version = "4.5.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8aa86934b44c19c50f87cc2790e19f54f7a67aedb64101c2e1a2e5ecfb73944" +checksum = "2df961d8c8a0d08aa9945718ccf584145eee3f3aa06cddbeac12933781102e04" dependencies = [ "clap_builder", "clap_derive", @@ -698,9 +704,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.35" +version = "4.5.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2414dbb2dd0695280da6ea9261e327479e9d37b0630f6b53ba2a11c60c679fd9" +checksum = "132dbda40fb6753878316a489d5a1242a8ef2f0d9e47ba01c951ea8aa7d013a5" dependencies = [ "anstream", "anstyle", @@ -876,9 +882,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "575f75dfd25738df5b91b8e43e14d44bda14637a58fae779fd2b064f8bf3e010" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" [[package]] name = "default-net" @@ -1543,7 +1549,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "016d6050219458d14520fe22bdfdeb9cb71631dec9bc2724767c983f60109634" dependencies = [ "bytes", - "bytesize", + "bytesize 1.3.3", "crc32fast", "crossbeam-channel", "flate2", @@ -2113,9 +2119,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.4.8" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5017294ff4bb30944501348f6f8e42e6ad28f42c8bbef7a74029aff064a4e3c2" +checksum = "75249d144030531f8dee69fe9cea04d3edf809a017ae445e2abdff6629e86633" dependencies = [ "atomic-waker", "bytes", @@ -2206,7 +2212,7 @@ dependencies = [ "once_cell", "pin-project-lite", "quinn", - "rand 0.9.0", + "rand 0.9.1", "ring", "rustls", "rustls-pki-types", @@ -2233,7 +2239,7 @@ dependencies = [ "once_cell", "parking_lot", "quinn", - "rand 0.9.0", + "rand 0.9.1", "resolv-conf", "rustls", "smallvec", @@ -2596,9 +2602,9 @@ checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jiff" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f33145a5cbea837164362c7bd596106eb7c5198f97d1ba6f6ebb3223952e488" +checksum = "e5ad87c89110f55e4cd4dc2893a9790820206729eaf221555f742d540b0724a0" dependencies = [ "jiff-static", "jiff-tzdb-platform", @@ -2611,9 +2617,9 @@ dependencies = [ [[package]] name = "jiff-static" -version = "0.2.6" +version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43ce13c40ec6956157a3635d97a1ee2df323b263f09ea14165131289cb0f5c19" +checksum = "d076d5b64a7e2fe6f0743f02c43ca4a6725c0f904203bfe276a5b3e793103605" dependencies = [ "proc-macro2", "quote", @@ -2715,9 +2721,9 @@ checksum = "0864a00c8d019e36216b69c2c4ce50b83b7bd966add3cf5ba554ec44f8bebcf5" [[package]] name = "libc" -version = "0.2.171" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "libmimalloc-sys" @@ -3408,20 +3414,20 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "prodash" -version = "29.0.1" +version = "29.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ee7ce24c980b976607e2d6ae4aae92827994d23fed71659c3ede3f92528b58b" +checksum = "f04bb108f648884c23b98a0e940ebc2c93c0c3b89f04dbaf7eb8256ce617d1bc" dependencies = [ - "bytesize", + "bytesize 2.0.1", "human_format", "log", "parking_lot", @@ -3456,7 +3462,7 @@ checksum = "b820744eb4dc9b57a3398183639c511b5a26d2ed702cedd3febaa1393caa22cc" dependencies = [ "bytes", "getrandom 0.3.2", - "rand 0.9.0", + "rand 0.9.1", "ring", "rustc-hash", "rustls", @@ -3508,13 +3514,12 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" dependencies = [ "rand_chacha", "rand_core 0.9.3", - "zerocopy 0.8.24", ] [[package]]