Skip to content

bindgen! fails when a world imports an interface both directly and under a label #14855

Open

Description

@jrandolf

bindgen! fails to compile a world that imports an interface both directly and under a label:

world w {
  import store;
  import a: store;
}
error[E0428]: the name `store` is defined multiple times

It fails in either order, when the direct import is implicit through a use, and for realistic WASI worlds like include wasi:cli/imports@0.3.0; import a: wasi:cli/environment@0.3.0;. Worlds with only labelled imports compile fine. The WIT is valid (wit-component has an encoding test for this exact shape).

The labelled branch in crates/wit-bindgen/src/lib.rs (~518-535) generates the interface module at the interface's own path, and the plain branch doesn't check whether that already happened, so the module is generated twice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions