Skip to content

Commit

Permalink
build(rust): update wit-bindgen and wasm-tools
Browse files Browse the repository at this point in the history
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
  • Loading branch information
rvolosatovs committed Aug 14, 2024
1 parent 691e006 commit e1af006
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 53 deletions.
71 changes: 31 additions & 40 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down
6 changes: 3 additions & 3 deletions crates/test-helpers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
6 changes: 3 additions & 3 deletions crates/wit-bindgen-rust-macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,10 +131,10 @@ impl Parse for Config {
source = Some(Source::Path(input.parse::<syn::LitStr>()?.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,
Expand All @@ -149,7 +149,7 @@ impl Parse for Config {
fn parse_source(
source: &Option<Source>,
features: &[String],
) -> anyhow::Result<(Resolve, Vec<PackageId>, Vec<PathBuf>)> {
) -> anyhow::Result<(Resolve, PackageId, Vec<PathBuf>)> {
let mut resolve = Resolve::default();
resolve.features.extend(features.iter().cloned());
let mut files = Vec::new();
Expand Down
4 changes: 2 additions & 2 deletions src/bin/wit-bindgen-wrpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
Expand Down

0 comments on commit e1af006

Please sign in to comment.