Open elewis787 opened 2 weeks ago
@Mossaka ran into this issue working on wasi-http-go.
Should we have TinyGo check the version of wasm-tools
and warn if it is an older or unsupported version?
I think that would be great. Happy to get a PR drafted - My main ask would be if you have an idea of where we can easily pin/map wasm-tool version to tinygo version.
Should it be added to the Homebrew dependencies?
Should it be added to the Homebrew dependencies?
That would make sense - we can start there.
My main ask would be if you have an idea of where we can easily pin/map wasm-tool version to tinygo version.
this is a difficult question to answer and I don't think anyone has an answer to it. Also wasm-tools has a pre-v1 version meaning that any new minor change could be a breaking change so you can't really always get the latest wasm-tools. My suggestion would be starting to document the versions we know are working, like TinyGo 0.34
and wit-component 0.218.0
this is a difficult question to answer and I don't think anyone has an answer to it. Also wasm-tools has a pre-v1 version meaning that any new minor change could be a breaking change so you can't really always get the latest wasm-tools. My suggestion would be starting to document the versions we know are working, like
TinyGo 0.34
andwit-component 0.218.0
I agree. I will look into finding any similar docs, in the meantime @Jeff1010322 and I are thinking we could add something similar to the wasm-opt flows.
Do you think this would be a good first-step error if wasm-tools isn't found or a known minimum version isn't met?
We are also looking at adding a depends_on
wasm-tools in https://github.com/tinygo-org/homebrew-tools
@jeff1010322 and I recently ran into an issue with the version of wasm-tools causing the following error:
This occurred when using tinygo v0.34 and wit-component 0.215 when targeting wasip2.
In order to get this to work, wit-component needed to be set to at least 0.218 and used to embed wasip2 components. This was uncovered by inspecting the wat generated off a tinygo compiled wasm component
i.e
There are envs for
WASMTOOLS
that can be set https://github.com/tinygo-org/tinygo/blob/release/builder/build.go#L885.However, there seems to still be a potential for a mismatch tinygo wasip2 support and wasm-tools version support.
Would it be acceptable to submodule wasm-tools and default to using the built binary from tinygo, and optionally fall back to the env that is set for wasmtools?
Alternatively, when embedding a wit package/world, could we require a wasm-tools version that is supported and error on mismatch, something similar to the go/llvm required version?