Skip to content

package hello:wasm/subpackage@1.0.0 doesn't work #2277

@jcbhmr

Description

@jcbhmr

In the WIT.md from https://github.com/WebAssembly/component-model/blob/main/design/mvp/WIT.md#package-declaration it seems to indicate that you can have package identifiers like this:

package hello:wasm/subpackage@1.0.0;
package-decl        ::= 'package' ( id ':' )+ id ( '/' id )* ('@' valid-semver)?

but that doesn't work with any of the wasm-tools or other tooling right now.

To reproduce:

  1. create a wit folder
  2. create wit/whatever.wit
  3. add this code to it: package hello:wasm/subpackage@1.0.0;
  4. try to wasm-tools component wit ./wit
  5. it fails
error: failed to parse package: wit

Caused by:
    0: expected '{', found `/`
            --> wit/hello.wit:1:19
             |
           1 | package hello:wasm/subpackage@1.0.0;
             |                   ^

☝ this same error pops up with wkg wit fetch, the vscode syntax highlighter, etc.

i don't know if it's the WIT.md that's wrong or the wit parser in this wasm-tools project or me understanding it incorrectly 😅

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