-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upstream wasm-wave instances in wasmtime #8872
base: main
Are you sure you want to change the base?
Conversation
I'd be interested in contributing to this, but I'll have to check with my employer first since it is under a separate repo. In the meantime, you can use the |
Thanks! Yes, the plan is to merge this by enabling forbid-unsafe logos over in wasm tools, however I just haven't taken the time to get back to this because it fell off my radar. I don't think we should write a new lexer. |
Once bytecodealliance/wasm-tools#1874 lands and is in a wasm-tools release, I'll update this PR to use it. |
7f37566
to
9b718b1
Compare
This PR is now a single commit on top of #9601 update and now, 9601 has landed, so its a single commit on main |
9b718b1
to
076a6f6
Compare
@alexcrichton Can you please double-check my safe-to-deploy audit of https://diff.rs/beef/0.5.2/0.5.2 as part of reviewing this PR? |
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.