From 6c293ef8b15f0f465a3ed2f62e7b264d36ee2a67 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 13 Mar 2026 12:46:39 +0000 Subject: [PATCH 1/4] build(deps): bump async-tar from 0.5.1 to 0.6.0 Bumps [async-tar](https://github.com/dignifiedquire/async-tar) from 0.5.1 to 0.6.0. - [Release notes](https://github.com/dignifiedquire/async-tar/releases) - [Commits](https://github.com/dignifiedquire/async-tar/compare/v0.5.1...v0.6.0) --- updated-dependencies: - dependency-name: async-tar dependency-version: 0.6.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- Cargo.lock | 394 ++--------------------------------------------------- Cargo.toml | 2 +- 2 files changed, 12 insertions(+), 384 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cf4a4c2..bcb2edf 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -73,29 +73,6 @@ version = "1.0.102" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - -[[package]] -name = "async-channel" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "924ed96dd52d1b75e9c1a3e6275715fd320f5f9439fb5a4a11fa51f4221158d2" -dependencies = [ - "concurrent-queue", - "event-listener-strategy", - "futures-core", - "pin-project-lite", -] - [[package]] name = "async-compression" version = "0.4.41" @@ -108,146 +85,18 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "async-executor" -version = "1.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c96bf972d85afc50bf5ab8fe2d54d1586b4e0b46c97c50a0c9e71e2f7bcd812a" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "pin-project-lite", - "slab", -] - -[[package]] -name = "async-global-executor" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b1b633a2115cd122d73b955eadd9916c18c8f510ec9cd1686404c60ad1c29c" -dependencies = [ - "async-channel 2.5.0", - "async-executor", - "async-io", - "async-lock", - "blocking", - "futures-lite", - "once_cell", -] - -[[package]] -name = "async-io" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456b8a8feb6f42d237746d4b3e9a178494627745c3c56c6ea55d92ba50d026fc" -dependencies = [ - "autocfg", - "cfg-if", - "concurrent-queue", - "futures-io", - "futures-lite", - "parking", - "polling", - "rustix", - "slab", - "windows-sys 0.61.2", -] - -[[package]] -name = "async-lock" -version = "3.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f7f2596bd5b78a9fec8088ccd89180d7f9f55b94b0576823bbbdc72ee8311" -dependencies = [ - "event-listener 5.4.1", - "event-listener-strategy", - "pin-project-lite", -] - -[[package]] -name = "async-process" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc50921ec0055cdd8a16de48773bfeec5c972598674347252c0399676be7da75" -dependencies = [ - "async-channel 2.5.0", - "async-io", - "async-lock", - "async-signal", - "async-task", - "blocking", - "cfg-if", - "event-listener 5.4.1", - "futures-lite", - "rustix", -] - -[[package]] -name = "async-signal" -version = "0.2.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43c070bbf59cd3570b6b2dd54cd772527c7c3620fce8be898406dd3ed6adc64c" -dependencies = [ - "async-io", - "async-lock", - "atomic-waker", - "cfg-if", - "futures-core", - "futures-io", - "rustix", - "signal-hook-registry", - "slab", - "windows-sys 0.61.2", -] - -[[package]] -name = "async-std" -version = "1.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c8e079a4ab67ae52b7403632e4618815d6db36d2a010cfe41b02c1b1578f93b" -dependencies = [ - "async-channel 1.9.0", - "async-global-executor", - "async-io", - "async-lock", - "async-process", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - [[package]] name = "async-tar" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1937db2d56578aa3919b9bdb0e5100693fd7d1c0f145c53eb81fbb03e217550" +checksum = "3e9933aa2da420042c67e2ea83eec765919347d9742592744dc97cc42ef20c5d" dependencies = [ - "async-std", "filetime", + "futures-core", "libc", - "pin-project", - "redox_syscall 0.2.16", + "redox_syscall", ] -[[package]] -name = "async-task" -version = "4.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" - [[package]] name = "async-trait" version = "0.1.89" @@ -265,24 +114,12 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" -[[package]] -name = "autocfg" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" - [[package]] name = "base64" version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - [[package]] name = "bitflags" version = "2.11.0" @@ -298,19 +135,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "blocking" -version = "1.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e83f8d02be6967315521be875afa792a316e28d57b5a2d401897e2a7921b7f21" -dependencies = [ - "async-channel 2.5.0", - "async-task", - "futures-io", - "futures-lite", - "piper", -] - [[package]] name = "build-test" version = "0.0.0" @@ -425,15 +249,6 @@ version = "0.4.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "75984efb6ed102a0d42db99afb6c1948f0380d1d91808d5529916e6c08b49d8d" -[[package]] -name = "concurrent-queue" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" -dependencies = [ - "crossbeam-utils", -] - [[package]] name = "cpufeatures" version = "0.2.17" @@ -452,12 +267,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam-utils" -version = "0.8.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" - [[package]] name = "crypto-common" version = "0.1.7" @@ -516,49 +325,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" -[[package]] -name = "errno" -version = "0.3.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "event-listener" -version = "5.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13b66accf52311f30a0db42147dadea9850cb48cd070028831ae5f5d4b856ab" -dependencies = [ - "concurrent-queue", - "parking", - "pin-project-lite", -] - -[[package]] -name = "event-listener-strategy" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" -dependencies = [ - "event-listener 5.4.1", - "pin-project-lite", -] - -[[package]] -name = "fastrand" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" - [[package]] name = "filetime" version = "0.2.27" @@ -637,19 +403,6 @@ version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" -[[package]] -name = "futures-lite" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f78e10609fe0e0b3f4157ffab1876319b5b0db102a2c60dc4626306dc46b44ad" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "parking", - "pin-project-lite", -] - [[package]] name = "futures-macro" version = "0.3.32" @@ -727,18 +480,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "gloo-timers" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb143cf96099802033e0d4f4963b19fd2e0b728bcf076cd9cf7f6634f092994" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - [[package]] name = "hashbrown" version = "0.16.1" @@ -754,12 +495,6 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" - [[package]] name = "hex" version = "0.4.3" @@ -1024,15 +759,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - [[package]] name = "lazy_static" version = "1.5.0" @@ -1057,18 +783,12 @@ version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1744e39d1d6a9948f4f388969627434e31128196de472883b39f148769bfe30a" dependencies = [ - "bitflags 2.11.0", + "bitflags", "libc", "plain", - "redox_syscall 0.7.3", + "redox_syscall", ] -[[package]] -name = "linux-raw-sys" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" - [[package]] name = "litemap" version = "0.8.1" @@ -1080,9 +800,6 @@ name = "log" version = "0.4.29" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" -dependencies = [ - "value-bag", -] [[package]] name = "lru-slab" @@ -1153,38 +870,12 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" -[[package]] -name = "parking" -version = "2.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f38d5652c16fde515bb1ecef450ab0f6a219d619a7274976324d5e377f7dceba" - [[package]] name = "percent-encoding" version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" -[[package]] -name = "pin-project" -version = "1.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1749c7ed4bcaf4c3d0a3efc28538844fb29bcdd7d2b67b2be7e20ba861ff517" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b20ed30f105399776b9c883e68e536ef602a16ae6f596d2c473591d6ad64c6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "pin-project-lite" version = "0.2.17" @@ -1197,37 +888,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" -[[package]] -name = "piper" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c835479a4443ded371d6c535cbfd8d31ad92c5d23ae9770a61bc155e4992a3c1" -dependencies = [ - "atomic-waker", - "fastrand", - "futures-io", -] - [[package]] name = "plain" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4596b6d070b27117e987119b4dac604f3c58cfb0b191112e24771b2faeac1a6" -[[package]] -name = "polling" -version = "3.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d0e4f59085d47d8241c88ead0f274e8a0cb551f3625263c05eb8dd897c34218" -dependencies = [ - "cfg-if", - "concurrent-queue", - "hermit-abi", - "pin-project-lite", - "rustix", - "windows-sys 0.61.2", -] - [[package]] name = "potential_utf" version = "0.1.4" @@ -1364,22 +1030,13 @@ dependencies = [ "getrandom 0.3.4", ] -[[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.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce70a74e890531977d37e532c34d45e9055d2409ed08ddba14529471ed0be16" dependencies = [ - "bitflags 2.11.0", + "bitflags", ] [[package]] @@ -1471,19 +1128,6 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" -[[package]] -name = "rustix" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" -dependencies = [ - "bitflags 2.11.0", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.52.0", -] - [[package]] name = "rustls" version = "0.23.37" @@ -1627,16 +1271,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" -[[package]] -name = "signal-hook-registry" -version = "1.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" -dependencies = [ - "errno", - "libc", -] - [[package]] name = "simd-adler32" version = "0.3.8" @@ -1895,7 +1529,7 @@ version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4e6559d53cc268e5031cd8429d05415bc4cb4aefc4aa5d6cc35fbf5b924a1f8" dependencies = [ - "bitflags 2.11.0", + "bitflags", "bytes", "futures-util", "http", @@ -2047,12 +1681,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" -[[package]] -name = "value-bag" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ba6f5989077681266825251a52748b8c1d8a4ad098cc37e440103d0ea717fc0" - [[package]] name = "version_check" version = "0.9.5" @@ -2183,7 +1811,7 @@ version = "0.245.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4f08c9adee0428b7bddf3890fc27e015ac4b761cc608c822667102b8bfd6995e" dependencies = [ - "bitflags 2.11.0", + "bitflags", "hashbrown", "indexmap", "semver", @@ -2327,7 +1955,7 @@ version = "0.53.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e915216dde3e818093168df8380a64fba25df468d626c80dd5d6a184c87e7c7" dependencies = [ - "bitflags 2.11.0", + "bitflags", "wit-bindgen-rust-macro", ] @@ -2380,7 +2008,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4894f10d2d5cbc17c77e91f86a1e48e191a788da4425293b55c98b44ba3fcac9" dependencies = [ "anyhow", - "bitflags 2.11.0", + "bitflags", "indexmap", "log", "serde", diff --git a/Cargo.toml b/Cargo.toml index 6da9372..eb0aadf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,7 @@ wit-bindgen = { workspace = true, features = ["default"] } [workspace.dependencies] anyhow = { version = "1", default-features = false } async-compression = { version = "0.4", default-features = false } -async-tar = { version = "0.5", default-features = false } +async-tar = { version = "0.6", default-features = false } async-trait = { version = "0.1", default-features = false } camino = { version = "1", default-features = false } clap = { version = "4", default-features = false } From 9fec3d45aa3b9a6f2dbf976aa73682f6d88704d3 Mon Sep 17 00:00:00 2001 From: Roman Volosatovs Date: Fri, 13 Mar 2026 14:09:55 +0100 Subject: [PATCH 2/4] feat!: switch to Tokio traits Signed-off-by: Roman Volosatovs --- Cargo.lock | 6 ++-- Cargo.toml | 1 - crates/wit-deps/Cargo.toml | 8 ++--- crates/wit-deps/src/cache.rs | 10 +++--- crates/wit-deps/src/digest.rs | 25 ++++++++------ crates/wit-deps/src/lib.rs | 5 +-- crates/wit-deps/src/lock.rs | 2 +- crates/wit-deps/src/manifest.rs | 60 ++++++++++++++++----------------- src/bin/wit-deps/main.rs | 5 ++- 9 files changed, 62 insertions(+), 60 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bcb2edf..e1649e0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -81,8 +81,8 @@ checksum = "d0f9ee0f6e02ffd7ad5816e9464499fba7b3effd01123b515c41d1697c43dad1" dependencies = [ "compression-codecs", "compression-core", - "futures-io", "pin-project-lite", + "tokio", ] [[package]] @@ -95,6 +95,8 @@ dependencies = [ "futures-core", "libc", "redox_syscall", + "tokio", + "tokio-stream", ] [[package]] @@ -1467,7 +1469,6 @@ checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" dependencies = [ "bytes", "futures-core", - "futures-io", "futures-sink", "pin-project-lite", "tokio", @@ -2052,7 +2053,6 @@ dependencies = [ "camino", "clap", "tokio", - "tokio-util", "toml", "tracing-subscriber", "wit-bindgen 0.53.1", diff --git a/Cargo.toml b/Cargo.toml index eb0aadf..7cefa12 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,6 @@ camino = { workspace = true } clap = { workspace = true, features = ["std", "color", "help", "usage", "error-context", "suggestions", "derive"] } wit-deps = { workspace = true } tokio = { workspace = true, features = ["io-std", "fs", "macros", "rt-multi-thread"] } -tokio-util = { workspace = true, features = ["compat"] } toml = { workspace = true, features = ["display", "parse"] } tracing-subscriber = { workspace = true, features = ["ansi", "env-filter", "fmt", "json", "std"] } diff --git a/crates/wit-deps/Cargo.toml b/crates/wit-deps/Cargo.toml index 2555bdc..341468d 100644 --- a/crates/wit-deps/Cargo.toml +++ b/crates/wit-deps/Cargo.toml @@ -12,8 +12,8 @@ repository.workspace = true [dependencies] anyhow = { workspace = true, features = ["std"] } -async-compression = { workspace = true, features = ["futures-io", "gzip"] } -async-tar = { workspace = true } +async-compression = { workspace = true, features = ["tokio", "gzip"] } +async-tar = { workspace = true, features = ["runtime-tokio"] } async-trait = { workspace = true } directories = { workspace = true } futures = { workspace = true, features = ["async-await", "std"] } @@ -21,9 +21,9 @@ hex = { workspace = true, features = ["alloc"] } reqwest = { workspace = true, features = ["rustls-tls", "stream"] } serde = { workspace = true, features = ["derive"] } sha2 = { workspace = true } -tokio = { workspace = true, features = ["fs"] } +tokio = { workspace = true, features = ["fs", "io-util", "sync"] } tokio-stream = { workspace = true, features = ["fs"] } -tokio-util = { workspace = true, features = ["compat"] } +tokio-util = { workspace = true, features = ["io"] } toml = { workspace = true, features = ["display", "parse", "preserve_order"] } tracing = { workspace = true, features = ["attributes"] } url = { workspace = true, features = ["serde"] } diff --git a/crates/wit-deps/src/cache.rs b/crates/wit-deps/src/cache.rs index 8f83ac4..f53ef03 100644 --- a/crates/wit-deps/src/cache.rs +++ b/crates/wit-deps/src/cache.rs @@ -7,9 +7,8 @@ use std::path::{Path, PathBuf}; use anyhow::{bail, Context as _}; use async_trait::async_trait; use directories::ProjectDirs; -use futures::{io::BufReader, AsyncBufRead, AsyncWrite}; use tokio::fs::{self, File, OpenOptions}; -use tokio_util::compat::{Compat, TokioAsyncReadCompatExt}; +use tokio::io::{AsyncBufRead, AsyncWrite, BufReader}; use url::{Host, Url}; /// Resource caching layer @@ -130,12 +129,12 @@ impl Local { #[async_trait] impl Cache for Local { - type Read = BufReader>; - type Write = Compat; + type Read = BufReader; + type Write = File; async fn get(&self, url: &Url) -> anyhow::Result> { match File::open(self.path(url)).await { - Ok(file) => Ok(Some(BufReader::new(file.compat()))), + Ok(file) => Ok(Some(BufReader::new(file))), Err(e) if e.kind() == std::io::ErrorKind::NotFound => Ok(None), Err(e) => bail!("failed to lookup `{url}` in cache: {e}"), } @@ -153,7 +152,6 @@ impl Cache for Local { .write(true) .open(path) .await - .map(tokio_util::compat::TokioAsyncReadCompatExt::compat) .context("failed to open file for writing") } } diff --git a/crates/wit-deps/src/digest.rs b/crates/wit-deps/src/digest.rs index 9f77870..7b931ef 100644 --- a/crates/wit-deps/src/digest.rs +++ b/crates/wit-deps/src/digest.rs @@ -2,11 +2,11 @@ use core::fmt; use core::pin::Pin; use core::task::{Context, Poll}; -use futures::{AsyncRead, AsyncWrite}; use hex::FromHex; use serde::ser::SerializeStruct; use serde::{de, Deserialize, Serialize}; use sha2::{Digest as _, Sha256, Sha512}; +use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; /// A resource digest #[derive(Clone, Debug, Eq, Hash, PartialEq)] @@ -91,13 +91,18 @@ impl AsyncRead for Reader { fn poll_read( mut self: Pin<&mut Self>, cx: &mut Context<'_>, - buf: &mut [u8], - ) -> Poll> { - Pin::new(&mut self.inner).poll_read(cx, buf).map_ok(|n| { - self.sha256.update(&buf[..n]); - self.sha512.update(&buf[..n]); - n - }) + buf: &mut ReadBuf<'_>, + ) -> Poll> { + let n = buf.filled().len(); + match Pin::new(&mut self.inner).poll_read(cx, buf) { + Poll::Ready(Ok(())) => { + let buf = buf.filled(); + self.sha256.update(&buf[n..]); + self.sha512.update(&buf[n..]); + Poll::Ready(Ok(())) + } + other => other, + } } } @@ -143,8 +148,8 @@ impl AsyncWrite for Writer { Pin::new(&mut self.inner).poll_flush(cx) } - fn poll_close(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { - Pin::new(&mut self.inner).poll_close(cx) + fn poll_shutdown(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll> { + Pin::new(&mut self.inner).poll_shutdown(cx) } } diff --git a/crates/wit-deps/src/lib.rs b/crates/wit-deps/src/lib.rs index 0acd846..ae574d1 100644 --- a/crates/wit-deps/src/lib.rs +++ b/crates/wit-deps/src/lib.rs @@ -23,8 +23,9 @@ use std::ffi::{OsStr, OsString}; use std::path::{Path, PathBuf}; use anyhow::Context; -use futures::{try_join, AsyncRead, AsyncWrite, FutureExt, Stream, TryStreamExt}; +use futures::{try_join, FutureExt, Stream, TryStreamExt}; use tokio::fs; +use tokio::io::{AsyncRead, AsyncWrite}; use tokio_stream::wrappers::ReadDirStream; use tracing::{debug, instrument, trace}; @@ -197,7 +198,7 @@ pub async fn untar( use std::io::{Error, Result}; async fn unpack(e: &mut async_tar::Entry, dst: &Path) -> Result<()> { - e.unpack(dst).await.map_err(|e| { + e.unpack(dst).await.map_err(|e: Error| { Error::new( e.kind(), format!("failed to unpack `{}`: {e}", dst.display()), diff --git a/crates/wit-deps/src/lock.rs b/crates/wit-deps/src/lock.rs index 3e1c95d..f192d48 100644 --- a/crates/wit-deps/src/lock.rs +++ b/crates/wit-deps/src/lock.rs @@ -6,8 +6,8 @@ use std::collections::{BTreeMap, BTreeSet}; use std::path::{Path, PathBuf}; use anyhow::Context; -use futures::io::sink; use serde::{Deserialize, Serialize}; +use tokio::io::sink; use url::Url; /// Source of this dependency diff --git a/crates/wit-deps/src/manifest.rs b/crates/wit-deps/src/manifest.rs index fd657cf..efcdf5d 100644 --- a/crates/wit-deps/src/manifest.rs +++ b/crates/wit-deps/src/manifest.rs @@ -16,12 +16,12 @@ use std::sync::Arc; use anyhow::ensure; use anyhow::{bail, Context as _}; -use async_compression::futures::bufread::GzipDecoder; -use futures::io::BufReader; -use futures::lock::Mutex; -use futures::{stream, AsyncWriteExt, StreamExt, TryStreamExt}; +use async_compression::tokio::bufread::GzipDecoder; +use futures::{stream, StreamExt, TryStreamExt}; use hex::FromHex; use serde::{de, Deserialize}; +use tokio::io::{AsyncWriteExt, BufReader}; +use tokio::sync::Mutex; use tracing::{debug, error, info, instrument, trace, warn}; use url::Url; @@ -400,34 +400,34 @@ impl Entry { .error_for_status() .context("GET request failed") .map_err(std::io::Error::other)?; - let tar_gz = res - .bytes_stream() - .map_err(std::io::Error::other) - .then(|chunk| async { - let chunk = chunk?; - let mut cache = cache.lock().await; - let cache_res = if let Some(w) = cache.as_mut().map(|w| async { - if let Err(e) = w.write(&chunk).await { - error!("failed to write chunk to cache: {e}"); - if let Err(e) = w.close().await { - error!("failed to close cache writer: {e}"); + let tar_gz = + res.bytes_stream() + .map_err(std::io::Error::other) + .then(|chunk| async { + let chunk = chunk?; + let mut cache = cache.lock().await; + let cache_res = if let Some(w) = cache.as_mut().map(|w| async { + if let Err(e) = w.write(&chunk).await { + error!("failed to write chunk to cache: {e}"); + if let Err(e) = w.shutdown().await { + error!("failed to close cache writer: {e}"); + } + return Err(e); } - return Err(e); + Ok(()) + }) { + Some(w.await) + } else { + None } - Ok(()) - }) { - Some(w.await) - } else { - None - } - .transpose(); - if cache_res.is_err() { - // Drop the cache writer if a failure occurs - cache.take(); - } - Ok(chunk) - }) - .into_async_read(); + .transpose(); + if cache_res.is_err() { + // Drop the cache writer if a failure occurs + cache.take(); + } + Ok::<_, std::io::Error>(chunk) + }); + let tar_gz = tokio_util::io::StreamReader::new(tar_gz); let mut hashed = DigestReader::from(Box::pin(tar_gz)); let deps = untar( GzipDecoder::new(BufReader::new(&mut hashed)), diff --git a/src/bin/wit-deps/main.rs b/src/bin/wit-deps/main.rs index dd837bd..fa2d59b 100644 --- a/src/bin/wit-deps/main.rs +++ b/src/bin/wit-deps/main.rs @@ -7,7 +7,6 @@ use anyhow::Context; use clap::{Parser, Subcommand}; use tokio::fs::File; use tokio::io; -use tokio_util::compat::TokioAsyncWriteCompatExt; use tracing_subscriber::prelude::*; use wit_deps::Identifier; @@ -101,9 +100,9 @@ async fn main() -> anyhow::Result { let output = File::create(&output).await.with_context(|| { format!("failed to create output path `{}`", output.display()) })?; - wit_deps::tar(package, output.compat_write()).await?; + wit_deps::tar(package, output).await?; } else { - wit_deps::tar(package, io::stdout().compat_write()).await?; + wit_deps::tar(package, io::stdout()).await?; } Ok(ExitCode::SUCCESS) } From 19c637ebaafbebea5cd84aeaffcf90a11146d7a9 Mon Sep 17 00:00:00 2001 From: Roman Volosatovs Date: Fri, 13 Mar 2026 14:51:30 +0100 Subject: [PATCH 3/4] fix: avoid `async-std` panic on drop Signed-off-by: Roman Volosatovs --- crates/wit-deps/src/lib.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/crates/wit-deps/src/lib.rs b/crates/wit-deps/src/lib.rs index ae574d1..8554625 100644 --- a/crates/wit-deps/src/lib.rs +++ b/crates/wit-deps/src/lib.rs @@ -269,10 +269,19 @@ where let path = path.as_ref(); let mut tar = async_tar::Builder::new(dst); tar.mode(async_tar::HeaderMode::Deterministic); - for name in read_wits(path).await?.try_collect::>().await? { - tar.append_path_with_name(path.join(&name), Path::new("wit").join(name)) - .await?; + let res = async { + for name in read_wits(path).await?.try_collect::>().await? { + tar.append_path_with_name(path.join(&name), Path::new("wit").join(name)) + .await?; + } + std::io::Result::Ok(()) + } + .await; + if res.is_err() { + // Finalize the builder to avoid a panic on drop. + let _ = tar.finish().await; } + res?; tar.into_inner().await } From b71b878974adcd922676bc82423f4ba9543a765f Mon Sep 17 00:00:00 2001 From: Roman Volosatovs Date: Fri, 13 Mar 2026 14:55:41 +0100 Subject: [PATCH 4/4] chore: address clippy warnings Signed-off-by: Roman Volosatovs --- crates/wit-deps/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/wit-deps/src/lib.rs b/crates/wit-deps/src/lib.rs index 8554625..16bdb9e 100644 --- a/crates/wit-deps/src/lib.rs +++ b/crates/wit-deps/src/lib.rs @@ -220,7 +220,7 @@ pub async fn untar( let Ok(path) = path.strip_prefix(prefix) else { return Ok(untared); }; - let mut path = path.into_iter(); + let mut path = path.iter(); match array::from_fn::<_, 6, _>(|_| path.next().and_then(OsStr::to_str)) { [Some(name), None, ..] | [Some("wit"), Some(name), None, ..]