Stream: wit-bindgen

Topic: Host Exports across versions


view this post on Zulip James Sturtevant (Dec 06 2023 at 18:11):

should it be possible to have a Host world with exports across versions like the following? I've run into an issue when trying to add a test case: https://github.com/bytecodealliance/wit-bindgen/pull/787/files#r1416724258

world foo {
  import test:dep/test@0.1.0;
  import test:dep/test@0.2.0;

  export test:dep/test@0.1.0;
  export test:dep/test@0.2.0;
}
When working on #781 I noticed there wasn't a runtime test that had versions in the wit files. This adds test for a wit file that has multiple versions for rust and csharp.

view this post on Zulip Joel Dice (Dec 06 2023 at 18:24):

Yes, I that should work, but I wouldn't be surprised if there are bugs.

view this post on Zulip James Sturtevant (Dec 06 2023 at 18:33):

ok, I think I know where this one is happening. Can try to get it fixed wasmtime::component::bindgen! function

view this post on Zulip James Sturtevant (Dec 08 2023 at 02:54):

https://github.com/bytecodealliance/wasmtime/pull/7656

When exporting multiple versions of the same package the version name needs to be included. Before this change the generator would produce: pub fn test_dep_test(&self) -> &exports::test::dep0_1_0::...

Last updated: Dec 23 2024 at 12:05 UTC