Skip to content

Commit

Permalink
Update Rust target from 'wasm32-wasi' to 'wasm32-wasip1' in CI (#4050)
Browse files Browse the repository at this point in the history
- update Rust target from 'wasm32-wasi' to 'wasm32-wasip1' in ci
  • Loading branch information
TianlongLiang authored Feb 1, 2025
1 parent b6dea22 commit 5dcffaa
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/compilation_on_android_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -817,7 +817,7 @@ jobs:

- name: install dependencies
run: |
rustup target add wasm32-wasi
rustup target add wasm32-wasip1
sudo apt update && sudo apt-get install -y lld ninja-build
npm install
working-directory: test-tools/wamr-ide/VSCode-Extension
Expand Down
10 changes: 5 additions & 5 deletions doc/build_wasm_app.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,24 +16,24 @@ For [AssemblyScript](https://github.com/AssemblyScript/assemblyscript), please r

For Rust, please refer to [Install Rust and Cargo](https://doc.rust-lang.org/cargo/getting-started/installation.html) to install *cargo*, *rustc* and *rustup*. By default they are under ~/.cargo/bin.

And then run such a command to install `wasm32-wasi` target.
And then run such a command to install `wasm32-wasip1` target.

``` bash
$ rustup target add wasm32-wasi
$ rustup target add wasm32-wasip1
```

To build WASM applications, run

``` bash
$ cargo build --target wasm32-wasi
$ cargo build --target wasm32-wasip1
```

The output files are under `target/wasm32-wasi`.
The output files are under `target/wasm32-wasip1`.

To build a release version

``` bash
$ cargo build --release --target wasm32-wasi
$ cargo build --release --target wasm32-wasip1
```


Expand Down
2 changes: 1 addition & 1 deletion samples/debug-tools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE})
include(ExternalProject)

# wasm32-wasi
ExternalProject_Add(wasm33-wasi
ExternalProject_Add(wasm32-wasi
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/wasm-apps"
CONFIGURE_COMMAND ${CMAKE_COMMAND} -S ${CMAKE_CURRENT_SOURCE_DIR}/wasm-apps -B build
-DWASI_SDK_PREFIX=${WASISDK_HOME}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# compile with debug symbols and no optimization
rustc --target wasm32-wasi ./test.rs -g -C opt-level=0
rustc --target wasm32-wasip1 ./test.rs -g -C opt-level=0
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export function setBpAtMarker(file: string, bpMarker: string): void {
export function compileRustToWasm(): void {
const testResourceFolder = `${EXTENSION_PATH}/resource/test`;
// compile with debug symbols and no optimization
const cmd = `rustc --target wasm32-wasi ${testResourceFolder}/test.rs -g -C opt-level=0 -o ${testResourceFolder}/test.wasm`;
const cmd = `rustc --target wasm32-wasip1 ${testResourceFolder}/test.rs -g -C opt-level=0 -o ${testResourceFolder}/test.wasm`;

try {
cp.execSync(cmd, { stdio: [null, null, process.stderr] });
Expand Down

0 comments on commit 5dcffaa

Please sign in to comment.