Skip to content

Error when package imports interface behind feature flag #197

@n0emo

Description

@n0emo

Environment

  • Fedora Linux 43
  • componentize-py 0.19.3

Problem

When generating component using WIT containing wasi:cli@0.2.10, componentize-py errors out unable to process the package

world exports {
    include wasi:cli/imports@0.2.10;
    include wasi:clocks/imports@0.2.10;
    include wasi:config/imports@0.2.0-rc.1;
    include wasi:filesystem/imports@0.2.10;
    include wasi:http/imports@0.2.10;
    include wasi:io/imports@0.2.10;
    include wasi:random/imports@0.2.10;
    include wasi:sockets/imports@0.2.10;
}
$ componentize-py --wit-path wit --world plugin componentize app -o add.wasm
Traceback (most recent call last):
  File "/home/albert/.local/bin/componentize-py", line 7, in <module>
    sys.exit(script())
             ~~~~~~^^
AssertionError: interface not found in package
     --> wit/deps/wasi-cli-0.2.10/package.wit:172:22
      |
  172 |   import wasi:clocks/timezone@0.2.10;
      |                      ^-------

Inside wit/deps/wasi-cli-0.2.10/package.wit, timezone import is behind feature flag

  @unstable(feature = clocks-timezone)
  import wasi:clocks/timezone@0.2.10;

Looks like the issue is with the old version of wasm-tools and is already fixed by bytecodealliance/wasm-tools#2394.

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