Skip to content
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

Merged
merged 1 commit into from
May 7, 2019
Merged

Add Rust impl of wasmtime_ssp_fd_prestat_dir_name #131

merged 1 commit into from
May 7, 2019

Conversation

kubkon
Copy link
Member

@kubkon kubkon commented May 2, 2019

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 like rwlock_rdlock! macro or fd_prestats_get_entry).

@jlb6740
Copy link
Contributor

jlb6740 commented May 3, 2019

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?

@kubkon
Copy link
Member Author

kubkon commented May 3, 2019

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 wasmtime runtime with trace on for the wasmtime-wasi crate:

$ RUST_LOG=wasmtime_wasi=trace wasmtime a.out

where a.out is a WebAssembly module. This will generate a trace of all syscalls that the WebAssembly module invokes, and you can inspect there whether any changes you've committed work as expected.

Hope that helps! Let me know if anything is unclear.

@jlb6740
Copy link
Contributor

jlb6740 commented May 3, 2019

Yes this helps, thanks! I'll examine your change a little more, try this technique, and then see what I can contribute first.

@sunfishcode
Copy link
Member

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!

@sunfishcode
Copy link
Member

LGTM!

@sunfishcode sunfishcode merged commit 3e94af8 into bytecodealliance:master May 7, 2019
grishasobol pushed a commit to grishasobol/wasmtime that referenced this pull request Nov 29, 2021
* Remove unsafety

* Remove transmutes and pointer casts
pchickey pushed a commit to pchickey/wasmtime that referenced this pull request May 12, 2023
…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.
pchickey pushed a commit to pchickey/wasmtime that referenced this pull request May 12, 2023
…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.
pchickey pushed a commit to pchickey/wasmtime that referenced this pull request May 16, 2023
…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.
pchickey pushed a commit to pchickey/wasmtime that referenced this pull request May 16, 2023
…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.
mooori pushed a commit to mooori/wasmtime that referenced this pull request Dec 20, 2023
dhil added a commit to frank-emrich/wasmtime that referenced this pull request Mar 18, 2024
avanhatt pushed a commit to wellesley-prog-sys/wasmtime that referenced this pull request Oct 18, 2024
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
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants