From a780ad2d49c2768a86f3b8c1c1c5f885f7518c7a Mon Sep 17 00:00:00 2001 From: Pat Hickey Date: Fri, 18 Oct 2024 12:00:05 -0700 Subject: [PATCH 1/2] remove moonbit from CI language matrix (#1068) --- .github/workflows/main.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5491b1b8f..f7d46bc65 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -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 From 9b754f27d71cf25d1bd169eee57937eb0bac7516 Mon Sep 17 00:00:00 2001 From: HKalbasi <45197576+HKalbasi@users.noreply.github.com> Date: Fri, 18 Oct 2024 16:45:29 -0700 Subject: [PATCH 2/2] Recommend using `wasm32-wasip2` in Rust example (#1067) --- README.md | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index acde24f4c..95f87e7d8 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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()