Skip to content

Commit

Permalink
Merge pull request #30 from dhil/wasmfx-merge
Browse files Browse the repository at this point in the history
Merge with upstream
  • Loading branch information
dhil authored Oct 25, 2024
2 parents 6d38d1a + 82bb277 commit 95ca6e9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
lang: [c, rust, teavm-java, go, csharp, moonbit]
# moonbit removed from language matrix for now - causing CI failures
lang: [c, rust, teavm-java, go, csharp]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,11 +185,11 @@ world host {

### Guest: Rust

The Rust compiler supports a native `wasm32-wasip1` target and can be added to
The Rust compiler since version 1.82 supports a native `wasm32-wasip2` target and can be added to
any `rustup`-based toolchain with:

```sh
rustup target add wasm32-wasip1
rustup target add wasm32-wasip2
```

In order to compile a wasi dynamic library, the following must be added to the
Expand Down Expand Up @@ -244,17 +244,15 @@ generated code (which is probably also a bug in `wit-bindgen`), you can use
This project can then be built with:

```sh
cargo build --target wasm32-wasip1
wasm-tools component new ./target/wasm32-wasip1/debug/my-project.wasm \
-o my-component.wasm --adapt ./wasi_snapshot_preview1.reactor.wasm
cargo build --target wasm32-wasip2
```

This creates a `my-component.wasm` file which is suitable to execute in any
This creates a `./target/wasm32-wasip2/debug/my-project.wasm` file which is suitable to execute in any
component runtime. Using `wasm-tools` you can inspect the binary as well, for
example inferring the WIT world that is the component:

```sh
wasm-tools component wit my-component.wasm
wasm-tools component wit ./target/wasm32-wasip2/debug/my-project.wasm
# world my-component {
# import print: func(msg: string)
# export run: func()
Expand Down

0 comments on commit 95ca6e9

Please sign in to comment.