Skip to content

wit-bindgen bindings for renamed interface #5961

@sunfishcode

Description

@sunfishcode

This wit:

interface red {
  use self.green.{thing}

  foo: func() -> thing
}

interface green {
  type thing = s32
}

default world neptune {
  import blue: self.red
  import orange: self.green
}

with this Rust:

wasmtime::component::bindgen!({
   path: "test.wit",
});

fn main() {}

gets this error:

error[E0433]: failed to resolve: could not find `green` in the crate root
 --> src/main.rs:1:1
  |
1 | / wasmtime::component::bindgen!({
2 | |    path: "a.wit",
3 | | });
  | |__^ could not find `green` in the crate root
  |

It appears the bindgen-generated bindings for the neptune world use the original name of the interface green rather than the world's name orange.

For comparison, the wit-bindgen guest bindings do appear to use the orange name.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions