bytecodealliance / bytecodealliance/wac

wac plug error: "error: encoding produced a component that failed validation"

Open
#141 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
208
Forks
41
Avg merge
2d 7h
Merged PRs (30d)
3

Description

## Repro
https://github.com/estk/hotswap-example

## The error
```
wac plug --plug types.wasm salutation.wasm -o tysal.wasm
error: encoding produced a component that failed validation

Caused by:
instance not valid to be used as export (at offset 0x36d3bf)
```

## Why this is surprising to me

Since the `user-interface` _interface_ is local to the hotswap::salutation package and the plugged world `types` exports the `user-interface` interface, I would have thought that the imports were satisfied and that the underlying types in `user-interface` would be automatically re-exported.

## WIT at a glance

In the salutation package we have the following:

```
package hotswap:salutation@0.1.0;

interface salutation {
use user-interface.{user};

variant formal-honorific {
sir,
maam,
sir-maam,
custom(string)
}
get-formal-honorific: func(u: user) -> formal-honorific;
greet: func(u: user) -> string;
}

world app {
import user-interface;
export salutation;
}

...

interface salutation {
use user-interface.{user};

variant formal-honorific {
sir,
maam,
sir-maam,
custom(string)
}
get-formal-honorific: func(u: user) -> formal-honorific;
greet: func(u: user) -> string;
}

world app {
import user-interface;
export salutation;
}
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.