Upstream wasm-wave instances in wasmtime #8872
Draft
+780
−25
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is upstreaming instances of the
wasm-wave
crate's traits for wasmtime values. However, we won't be able to land this PR in wasmtime untilwasm-wave
is written entirely in safe rust, which it presently is not, because it useslogos
to derive its lexer here: https://github.com/bytecodealliance/wasm-tools/blob/main/crates/wasm-wave/src/lex.rs#L11I hadn't looked into how
logos
works prior to making this PR, but when I got to thecargo vet
for thelogos
crate, I discovered that logos derive macro generates significant amounts ofunsafe
rust. While I don't have any evidencelogos
is unsound, but it seems too risky to me to accept it into our audits, since I also have no reasonable way of ruling out thatlogos
is unsound. In the particular case ofwasm-wave
, we should expect that strings accepted by the crate come from untrusted sources, so we want to be very rigorous on how they are parsed into values.The particular bits of Lann's root wasm-wave repo this PR is upstreaming are found in https://github.com/lann/wasm-wave/tree/main/src/wasmtime. I was able to eliminate the
struct FuncType
definition in that code by definingcomponent::Func::ty
5918a4b tso that theComponentFunc
impl of WasmType is usable.