You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Validation of exporting instance types with resources is not correct #1253
$ cargo run validate foo.wat --features component-model
Finished dev [unoptimized + debuginfo] target(s) in 3.71s
Running `target/debug/wasm-tools validate foo.wat --features component-model`
error: type not valid to be used as export (at offset 0x26)
but this component should be valid.
#1251 was a historical version of starting this, but required solving the problem of going from ResourceId to TypeId in a more robust way. That'd require some extra fields to be tracked in component instance types.
One reason we decided not to fix it at the time of that PR is that this starts opening some larger questions which we're not entirely sure the answer to about what possible ways to fix this are in scope and which modules are valid and not. To sidestep these questions we figured it'd be best to leave the current validation in place which effectively rejects any instance types with resources in them. This is not correct but hopefully won't cause any road bumps for anyone else down the line for awhile at least. The thinking is that when there's a more formal definition of the component model's validation rules we can rely on that for providing better answers of what's valid and what's not and better design a solution within those constraints.
Activity