From 7ed8ef2f80366da1adb68ad585f2442b8e3fe0e8 Mon Sep 17 00:00:00 2001 From: James Sturtevant Date: Fri, 8 Dec 2023 13:24:43 -0800 Subject: [PATCH] Include Version in the export name if required Signed-off-by: James Sturtevant --- crates/component-macro/tests/codegen/multiversion/root.wit | 1 + crates/wit-bindgen/src/lib.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/component-macro/tests/codegen/multiversion/root.wit b/crates/component-macro/tests/codegen/multiversion/root.wit index 52225f02beb3..b3bb3c80d3da 100644 --- a/crates/component-macro/tests/codegen/multiversion/root.wit +++ b/crates/component-macro/tests/codegen/multiversion/root.wit @@ -3,5 +3,6 @@ package foo:bar; world foo { import my:dep/a@0.1.0; import my:dep/a@0.2.0; + export my:dep/a@0.1.0; export my:dep/a@0.2.0; } diff --git a/crates/wit-bindgen/src/lib.rs b/crates/wit-bindgen/src/lib.rs index eca7fd3916cd..2c1422f597e2 100644 --- a/crates/wit-bindgen/src/lib.rs +++ b/crates/wit-bindgen/src/lib.rs @@ -474,7 +474,7 @@ impl Wasmtime { format!( "{}_{}_{snake}", pkgname.namespace.to_snake_case(), - pkgname.name.to_snake_case() + self.name_package_module(resolve, iface.package.unwrap()) ), ), None => (format!("exports::{snake}::{camel}"), snake.clone()),