From e1af006ae2620de965380a8f9d01b64f56b37801 Mon Sep 17 00:00:00 2001 From: Roman Volosatovs Date: Mon, 5 Aug 2024 09:58:26 +0200 Subject: [PATCH] build(rust): update wit-bindgen and wasm-tools Signed-off-by: Roman Volosatovs --- Cargo.lock | 71 +++++++++++------------- Cargo.toml | 10 ++-- crates/test-helpers/src/lib.rs | 6 +- crates/wit-bindgen-rust-macro/src/lib.rs | 6 +- src/bin/wit-bindgen-wrpc.rs | 4 +- 5 files changed, 44 insertions(+), 53 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c050652e..9a88d0eb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2354,7 +2354,7 @@ version = "0.0.0" dependencies = [ "codegen-macro", "wit-bindgen-core", - "wit-parser 0.214.0", + "wit-parser 0.215.0", ] [[package]] @@ -2886,16 +2886,6 @@ dependencies = [ "leb128", ] -[[package]] -name = "wasm-encoder" -version = "0.214.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff694f02a8d7a50b6922b197ae03883fbf18cdb2ae9fbee7b6148456f5f44041" -dependencies = [ - "leb128", - "wasmparser 0.214.0", -] - [[package]] name = "wasm-encoder" version = "0.215.0" @@ -2903,13 +2893,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb56df3e06b8e6b77e37d2969a50ba51281029a9aeb3855e76b7f49b6418847" dependencies = [ "leb128", + "wasmparser 0.215.0", ] [[package]] name = "wasm-metadata" -version = "0.214.0" +version = "0.215.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "865c5bff5f7a3781b5f92ea4cfa99bb38267da097441cdb09080de1568ef3075" +checksum = "0c6bb07c5576b608f7a2a9baa2294c1a3584a249965d695a9814a496cb6d232f" dependencies = [ "anyhow", "indexmap", @@ -2917,8 +2908,8 @@ dependencies = [ "serde_derive", "serde_json", "spdx", - "wasm-encoder 0.214.0", - "wasmparser 0.214.0", + "wasm-encoder 0.215.0", + "wasmparser 0.215.0", ] [[package]] @@ -2950,9 +2941,9 @@ dependencies = [ [[package]] name = "wasmparser" -version = "0.214.0" +version = "0.215.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5309c1090e3e84dad0d382f42064e9933fdaedb87e468cc239f0eabea73ddcb6" +checksum = "53fbde0881f24199b81cf49b6ff8f9c145ac8eb1b7fc439adb5c099734f7d90e" dependencies = [ "ahash", "bitflags 2.6.0", @@ -3519,9 +3510,9 @@ dependencies = [ [[package]] name = "wit-bindgen" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89178260ed223de8a5a81f9cff961481dfbbd55b25c17e4dd0b4c8e4b8ae646d" +checksum = "6878f363ff82b1fce56d448380b56458a85d282aa08c2be80afe4f4cd9051070" dependencies = [ "wit-bindgen-rt", "wit-bindgen-rust-macro", @@ -3529,29 +3520,29 @@ dependencies = [ [[package]] name = "wit-bindgen-core" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e3fd9b11c16b9888c1bd159130b1b3487da913c45dbd34d408bfdf81f8a865a" +checksum = "66f98ab0edef3218244a87b125f4f7047f0af104f2e4718255226c0367688d1c" dependencies = [ "anyhow", "heck 0.5.0", - "wit-parser 0.214.0", + "wit-parser 0.215.0", ] [[package]] name = "wit-bindgen-rt" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7a37bd9274cb2d4754b915d624447ec0dce9105d174361841c0826efc79ceb9" +checksum = "4b18e27825442721d23ed98591a80f55220cfe0bf883d92b1ead6c9be237bb34" dependencies = [ "bitflags 2.6.0", ] [[package]] name = "wit-bindgen-rust" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f195cd3774ff22f9bbd582a4ab97667c0a47d36ed8ed0c9ed357afe811b564b" +checksum = "a44f91ca4e1f0d6d2522a7cbbbea6410992d92eb48e686623eb94e2278839b95" dependencies = [ "anyhow", "heck 0.5.0", @@ -3565,9 +3556,9 @@ dependencies = [ [[package]] name = "wit-bindgen-rust-macro" -version = "0.28.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683e47441b5d0a82fc4304619dcc0672bc84ef47de2c85cd493c37cb29de062f" +checksum = "826e65d7f2eb5e52795c125a2d40f1acdc3bee7a8cb15bfdc6d1078f02ac4f49" dependencies = [ "anyhow", "prettyplease", @@ -3637,9 +3628,9 @@ dependencies = [ [[package]] name = "wit-component" -version = "0.214.0" +version = "0.215.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd9fd46f0e783bf80f1ab7291f9d442fa5553ff0e96cdb71964bd8859b734b55" +checksum = "f725e3885fc5890648be5c5cbc1353b755dc932aa5f1aa7de968b912a3280743" dependencies = [ "anyhow", "bitflags 2.6.0", @@ -3648,10 +3639,10 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "wasm-encoder 0.214.0", + "wasm-encoder 0.215.0", "wasm-metadata", - "wasmparser 0.214.0", - "wit-parser 0.214.0", + "wasmparser 0.215.0", + "wit-parser 0.215.0", ] [[package]] @@ -3674,9 +3665,9 @@ dependencies = [ [[package]] name = "wit-parser" -version = "0.214.0" +version = "0.215.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "681d526d6ea42e28f9afe9eae2b50e0b0a627aef8822c75eb04078db84d03e57" +checksum = "935a97eaffd57c3b413aa510f8f0b550a4a9fe7d59e79cd8b89a83dcb860321f" dependencies = [ "anyhow", "id-arena", @@ -3687,7 +3678,7 @@ dependencies = [ "serde_derive", "serde_json", "unicode-xid", - "wasmparser 0.214.0", + "wasmparser 0.215.0", ] [[package]] @@ -3733,7 +3724,7 @@ dependencies = [ name = "wrpc-introspect" version = "0.2.0" dependencies = [ - "wit-parser 0.214.0", + "wit-parser 0.215.0", ] [[package]] @@ -3750,7 +3741,7 @@ dependencies = [ "wasm-tokio", "wasmtime", "wasmtime-wasi", - "wit-parser 0.214.0", + "wit-parser 0.215.0", "wrpc-introspect", "wrpc-transport", ] @@ -3823,12 +3814,12 @@ dependencies = [ "url", "wasi-preview1-component-adapter-provider", "wasm-tokio", - "wasmparser 0.214.0", + "wasmparser 0.215.0", "wasmtime", "wasmtime-wasi", "wit-bindgen-wrpc", "wit-component", - "wit-parser 0.214.0", + "wit-parser 0.215.0", "wrpc-cli", "wrpc-introspect", "wrpc-runtime-wasmtime", diff --git a/Cargo.toml b/Cargo.toml index 6dd80cac..2f06418e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -125,17 +125,17 @@ url = { version = "2", default-features = false } uuid = { version = "1", default-features = false } wasi-preview1-component-adapter-provider = { version = "23.0.2", default-features = false } wasm-tokio = { version = "0.5.16", default-features = false } -wasmparser = { version = "0.214", default-features = false } +wasmparser = { version = "0.215", default-features = false } wasmtime = { version = "23", default-features = false } wasmtime-wasi = { version = "23", default-features = false } -wit-bindgen = { version = "0.28", default-features = false } -wit-bindgen-core = { version = "0.28", default-features = false } +wit-bindgen = { version = "0.29", default-features = false } +wit-bindgen-core = { version = "0.29", default-features = false } wit-bindgen-wrpc = { version = "0.5", default-features = false, path = "./crates/wit-bindgen" } wit-bindgen-wrpc-go = { version = "0.3", default-features = false, path = "./crates/wit-bindgen-go" } wit-bindgen-wrpc-rust = { version = "0.5", default-features = false, path = "./crates/wit-bindgen-rust" } wit-bindgen-wrpc-rust-macro = { version = "0.5", default-features = false, path = "./crates/wit-bindgen-rust-macro" } -wit-component = { version = "0.214", default-features = false } -wit-parser = { version = "0.214", default-features = false } +wit-component = { version = "0.215", default-features = false } +wit-parser = { version = "0.215", default-features = false } wrpc-cli = { version = "0.2.1", path = "./crates/cli", default-features = false } wrpc-introspect = { version = "0.2", default-features = false, path = "./crates/introspect" } wrpc-runtime-wasmtime = { version = "0.20", path = "./crates/runtime-wasmtime", default-features = false } diff --git a/crates/test-helpers/src/lib.rs b/crates/test-helpers/src/lib.rs index 363c665c..d48f6cd0 100644 --- a/crates/test-helpers/src/lib.rs +++ b/crates/test-helpers/src/lib.rs @@ -89,10 +89,10 @@ pub fn run_world_codegen_test( fn parse_wit(path: &Path) -> (Resolve, WorldId) { let mut resolve = Resolve::default(); - let (pkgs, _files) = resolve.push_path(path).unwrap(); - let world = resolve.select_world(&pkgs, None).unwrap_or_else(|_| { + let (pkg, _files) = resolve.push_path(path).unwrap(); + let world = resolve.select_world(pkg, None).unwrap_or_else(|_| { // note: if there are multiples worlds in the wit package, we assume the "imports" world - resolve.select_world(&pkgs, Some("imports")).unwrap() + resolve.select_world(pkg, Some("imports")).unwrap() }); (resolve, world) } diff --git a/crates/wit-bindgen-rust-macro/src/lib.rs b/crates/wit-bindgen-rust-macro/src/lib.rs index d4898846..ccac3c30 100644 --- a/crates/wit-bindgen-rust-macro/src/lib.rs +++ b/crates/wit-bindgen-rust-macro/src/lib.rs @@ -131,10 +131,10 @@ impl Parse for Config { source = Some(Source::Path(input.parse::()?.value())); } } - let (resolve, pkgs, files) = + let (resolve, pkg, files) = parse_source(&source, &features).map_err(|err| anyhow_to_syn(call_site, err))?; let world = resolve - .select_world(&pkgs, world.as_deref()) + .select_world(pkg, world.as_deref()) .map_err(|e| anyhow_to_syn(call_site, e))?; Ok(Config { opts, @@ -149,7 +149,7 @@ impl Parse for Config { fn parse_source( source: &Option, features: &[String], -) -> anyhow::Result<(Resolve, Vec, Vec)> { +) -> anyhow::Result<(Resolve, PackageId, Vec)> { let mut resolve = Resolve::default(); resolve.features.extend(features.iter().cloned()); let mut files = Vec::new(); diff --git a/src/bin/wit-bindgen-wrpc.rs b/src/bin/wit-bindgen-wrpc.rs index 0fb7d65b..5a44f46c 100644 --- a/src/bin/wit-bindgen-wrpc.rs +++ b/src/bin/wit-bindgen-wrpc.rs @@ -136,8 +136,8 @@ fn gen_world( resolve.features.insert(feature.to_string()); } } - let (pkgs, _files) = resolve.push_path(&opts.wit)?; - let world = resolve.select_world(&pkgs, opts.world.as_deref())?; + let (pkg, _files) = resolve.push_path(&opts.wit)?; + let world = resolve.select_world(pkg, opts.world.as_deref())?; generator.generate(&resolve, world, files)?; Ok(())