-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add Rust impl of wasmtime_ssp_fd_prestat_dir_name #131
Conversation
Hi Kubkon, I saw the request #120 and would like to contribute as well. I am new to Rust however so I want any change to be thoroughly tested. How are you exercising your changes here to make sure it doesn't have bugs? |
All contributions are welcome. Please check in your interest in #120 and what you'd like to work on with @sunfishcode. As far as the tests are concerned, we don't have any in that crate yet, but it's probably something we'd like to have in the long run. I'm not sure in what form yet though. I'm sure @sunfishcode would offer some great comments and direction here. One way of testing the ported host calls from C to Rust, is to run a WebAssembly module using the
where Hope that helps! Let me know if anything is unclear. |
Yes this helps, thanks! I'll examine your change a little more, try this technique, and then see what I can contribute first. |
Testing is indeed something we're still figuring out. I've started experimenting with writing WASI tests in Rust using Rust's libc crates' WASI bindings, here: https://github.com/sunfishcode/misc-tests which you can compile with "cargo build +nightly --target=wasm32-unknown-wasi" and run with wasmtime, though it's still a little rough. I'm interested in other ideas people have for how we can write tests too! |
LGTM! |
* Remove unsafety * Remove transmutes and pointer casts
…iance#131) LLVM has special handling for functions named `main`, which we need to avoid because we're creating the component-level `main` rather than the C-level `main`. To do this, write the `main` function in assembly, which is fortunately very simple now.
…alliance#165) Changing LLVM and/or Rust to avoid special handling of `main` is a fair amount of work, and there could be other toolchains with similar special rules for functions named `main`, so rename the command entrypoint back to `run`. We could potentially re-evaluate this in the future, such as in a preview3 timeframe, but for now, let's go with the simplest thing that works.
…iance#131) LLVM has special handling for functions named `main`, which we need to avoid because we're creating the component-level `main` rather than the C-level `main`. To do this, write the `main` function in assembly, which is fortunately very simple now.
…alliance#165) Changing LLVM and/or Rust to avoid special handling of `main` is a fair amount of work, and there could be other toolchains with similar special rules for functions named `main`, so rename the command entrypoint back to `run`. We could potentially re-evaluate this in the future, such as in a preview3 timeframe, but for now, let's go with the simplest thing that works.
Implement `lower_br_icmp`
Verify `load_i64` expansions involving `MovWide` instructions. We added `MovWide` ASLp specs in bytecodealliance#127. This PR provides additional specs to utilize them. Updates avanhatt#49 avanhatt#34
This PR is a continuation of #130, and also addresses #120. It ports
wasmtime_ssp_fd_prestat_dir_name
from C to Rust, re-using the functions and mechanisms ported in #130 (i.e., things likerwlock_rdlock!
macro orfd_prestats_get_entry
).