Stream: git-wasmtime

Topic: wasmtime / PR #2789 Remove the type-driven ability for du...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 29 2021 at 16:04):

alexcrichton opened PR #2789 from better-linker-errors to main:

When Linker was first created it was attempted to be created with the
ability to instantiate any wasm modules, including those with duplicate
import strings of different types. In an effort to support this a
Linker supports defining the same names twice so long as they're
defined with differently-typed values.

This ended up causing wast testsuite failures module linking is enabled,
however, because the wrong error message is returned. While it would be
possible to fix this there's already the possibility for confusing error
messages today due to the Linker trying to take on this type-level
complexity. In a way this is yet-another type checker for wasm imports,
but sort of a bad one because it only supports things like
globals/functions, and otherwise you can only define one Memory, for
example, with a particular name.

This commit completely removes this feature from Linker to simplify
the implementation and make error messages more straightforward. This
means that any error message coming from a Linker is purely "this
thing wasn't defined" rather than a hybrid of "maybe the types didn't
match?". I think this also better aligns with the direction that we see
conventional wasm modules going which is that duplicate imports are not
ever present.

<!--

Please ensure that the following steps are all taken care of before submitting
the PR.

Please ensure all communication adheres to the code of conduct.
-->

view this post on Zulip Wasmtime GitHub notifications bot (Mar 29 2021 at 20:44):

sunfishcode submitted PR Review.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 29 2021 at 22:26):

alexcrichton merged PR #2789.


Last updated: Nov 22 2024 at 16:03 UTC