From 0bbd4efc8f2f88ed9edb93f55e6896fda89cd07d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Piotr=20Miko=C5=82ajczyk?= Date: Mon, 8 Sep 2025 14:53:35 +0200 Subject: [PATCH 1/2] Migrate from `wasm32-wasi` to `wasm32-wasip1` --- .github/workflows/build.yml | 5 ----- .github/workflows/cloudcompiler.yaml | 18 +++++++++--------- .github/workflows/test.yaml | 6 +++--- Makefile | 8 ++++---- docs/en/examples-coredump.md | 2 +- lib/api/src/lib.rs | 2 +- lib/cli/src/commands/init.rs | 2 +- lib/config/src/package/mod.rs | 6 +++--- lib/wasix/README.md | 4 ++-- lib/wasix/src/lib.rs | 2 +- .../integration/cli/tests/fixtures/init4.toml | 2 +- tests/integration/cli/tests/publish.rs | 2 +- tests/wasi-fyi/build.sh | 2 +- tests/wasi-wast/src/set_up_toolchain.rs | 2 +- tests/wasi-wast/src/wasitests.rs | 2 +- 15 files changed, 30 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 89c2e32f95..2a102c2052 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -204,11 +204,6 @@ jobs: shell: bash run: | make build-wasmer - #- name: Build Wasmer binary on Wasm32-WASI without LLVM - # if: matrix.build_wasm - # shell: bash - # run: | - # make build-wasmer-wasm - name: Install Nightly Rust for Headless if: matrix.build != 'linux-musl-x64' uses: dtolnay/rust-toolchain@master diff --git a/.github/workflows/cloudcompiler.yaml b/.github/workflows/cloudcompiler.yaml index 22ac4b1e7d..8e8dd7fee5 100644 --- a/.github/workflows/cloudcompiler.yaml +++ b/.github/workflows/cloudcompiler.yaml @@ -24,19 +24,19 @@ jobs: with: toolchain: ${{ env.MSRV }} target: ${{ matrix.target }} - - name: Install wasm32-wasi target + - name: Install wasm32-wasip1 target shell: bash run: | - rustup target add wasm32-wasi + rustup target add wasm32-wasip1 - name: Setup Wasmer uses: wasmerio/setup-wasmer@v1 - name: Build cloudcompiler.wasm shell: bash run: | make build-wasmer-wasm && - mkdir target/wasm32-wasi/release/cloudcompiler - cp target/wasm32-wasi/release/wasmer-compiler.wasm target/wasm32-wasi/release/cloudcompiler/cloudcompiler.wasm && - cat << EOF > target/wasm32-wasi/release/cloudcompiler/wasmer.toml + mkdir target/wasm32-wasip1/release/cloudcompiler + cp target/wasm32-wasip1/release/wasmer-compiler.wasm target/wasm32-wasip1/release/cloudcompiler/cloudcompiler.wasm && + cat << EOF > target/wasm32-wasip1/release/cloudcompiler/wasmer.toml [package] name = "${{ secrets.WAPM_DEV_USERNAME }}/cloudcompiler" version = "0.1.0" @@ -61,18 +61,18 @@ jobs: echo $(git tag | tail -n1) > ./version.txt v=$(git describe --tags --abbrev=0) && \ echo "version = ${v}" && - sed -i "s/version = \".*\"/version = \"${v}\"/g" target/wasm32-wasi/release/cloudcompiler/wasmer.toml \ + sed -i "s/version = \".*\"/version = \"${v}\"/g" target/wasm32-wasip1/release/cloudcompiler/wasmer.toml \ - name: Build cloudcompiler.wasm shell: bash run: | git tag && - cat target/wasm32-wasi/release/cloudcompiler/wasmer.toml && + cat target/wasm32-wasip1/release/cloudcompiler/wasmer.toml && echo "ls" && - ls target/wasm32-wasi/release/cloudcompiler + ls target/wasm32-wasip1/release/cloudcompiler - name: Publish to WAPM uses: wasmerio/wapm-publish@v1 with: registry: https://registry.wapm.dev - directory: target/wasm32-wasi/release/cloudcompiler + directory: target/wasm32-wasip1/release/cloudcompiler username: ${{ secrets.WAPM_DEV_USERNAME }} password: ${{ secrets.WAPM_DEV_PASSWORD }} diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index f39c8b8fbd..18e2f4f2ba 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -131,7 +131,7 @@ jobs: uses: dtolnay/rust-toolchain@stable with: toolchain: nightly - targets: "wasm32-wasi" + targets: "wasm32-wasip1" - name: Install wasm-pack run: | curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh @@ -183,8 +183,8 @@ jobs: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - - name: rustup target add wasm32-wasi - run: rustup target add wasm32-wasi + - name: rustup target add wasm32-wasip1 + run: rustup target add wasm32-wasip1 - name: make build-wasmer-wasm run: make build-wasmer-wasm diff --git a/Makefile b/Makefile index 97dc61d550..993d6b0a80 100644 --- a/Makefile +++ b/Makefile @@ -377,7 +377,7 @@ check-wasmer: $(CARGO_BINARY) check $(CARGO_TARGET_FLAG) --manifest-path lib/cli/Cargo.toml $(compiler_features) --bin wasmer --locked check-wasmer-wasm: - $(CARGO_BINARY) check --manifest-path lib/cli-compiler/Cargo.toml --target wasm32-wasi --features singlepass,cranelift --bin wasmer-compiler --locked + $(CARGO_BINARY) check --manifest-path lib/cli-compiler/Cargo.toml --target wasm32-wasip1 --features singlepass,cranelift --bin wasmer-compiler --locked check-capi: RUSTFLAGS="${RUSTFLAGS}" $(CARGO_BINARY) check $(CARGO_TARGET_FLAG) --manifest-path lib/c-api/Cargo.toml \ @@ -396,7 +396,7 @@ bench: $(CARGO_BINARY) bench $(CARGO_TARGET_FLAG) $(compiler_features) build-wasmer-wasm: - $(CARGO_BINARY) build --release --manifest-path lib/cli-compiler/Cargo.toml --target wasm32-wasi --features singlepass,cranelift --bin wasmer-compiler --locked + $(CARGO_BINARY) build --release --manifest-path lib/cli-compiler/Cargo.toml --target wasm32-wasip1 --features singlepass,cranelift --bin wasmer-compiler --locked # For best results ensure the release profile looks like the following # in Cargo.toml: @@ -638,12 +638,12 @@ test-wasix: build-wasmer test-integration-cli: build-wasmer build-capi package-capi-headless package distribution cp ./dist/wasmer.tar.gz ./link.tar.gz - rustup target add wasm32-wasi + rustup target add wasm32-wasip1 WASMER_DIR=`pwd`/package $(CARGO_BINARY) test $(CARGO_TARGET_FLAG) --features webc_runner --no-fail-fast -p wasmer-integration-tests-cli --locked # Before running this in the CI, we need to set up link.tar.gz and /cache/wasmer-[target].tar.gz test-integration-cli-ci: require-nextest - rustup target add wasm32-wasi + rustup target add wasm32-wasip1 $(CARGO_BINARY) nextest run $(CARGO_TARGET_FLAG) --features webc_runner -p wasmer-integration-tests-cli --locked test-integration-ios: diff --git a/docs/en/examples-coredump.md b/docs/en/examples-coredump.md index 19a7754b10..8105dd6054 100644 --- a/docs/en/examples-coredump.md +++ b/docs/en/examples-coredump.md @@ -5,7 +5,7 @@ The following steps describe how to debug using Wasm coredump in Wasmer: 1. Compile your WebAssembly with debug info enabled; for example: ```sh - $ rustc foo.rs --target=wasm32-wasi -C debuginfo=2 + $ rustc foo.rs --target=wasm32-wasip1 -C debuginfo=2 ```
diff --git a/lib/api/src/lib.rs b/lib/api/src/lib.rs index c1dd8814fd..f2bd8983b5 100755 --- a/lib/api/src/lib.rs +++ b/lib/api/src/lib.rs @@ -417,7 +417,7 @@ compile_error!("The `jsc` feature must be enabled only for non-`wasm32` target." #[cfg(all(feature = "js", not(target_arch = "wasm32")))] compile_error!( - "The `js` feature must be enabled only for the `wasm32` target (either `wasm32-unknown-unknown` or `wasm32-wasi`)." + "The `js` feature must be enabled only for the `wasm32` target (either `wasm32-unknown-unknown` or `wasm32-wasip1`)." ); mod access; diff --git a/lib/cli/src/commands/init.rs b/lib/cli/src/commands/init.rs index 0e127a30b6..a319734cfe 100644 --- a/lib/cli/src/commands/init.rs +++ b/lib/cli/src/commands/init.rs @@ -554,6 +554,6 @@ fn parse_cargo_toml(manifest_path: &PathBuf) -> Result Date: Mon, 8 Sep 2025 14:58:04 +0200 Subject: [PATCH 2/2] Use upload-artifact@v4 (CI banned v3) --- .github/workflows/build.yml | 12 ++++++------ .github/workflows/check-public-api.yaml | 2 +- .github/workflows/test.yaml | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a102c2052..0554ceff2e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -233,7 +233,7 @@ jobs: run: | make distribution - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: ${{ matrix.artifact_name }} path: dist @@ -300,7 +300,7 @@ jobs: CARGO_TARGET: x86_64-pc-windows-gnu TARGET_DIR: target/x86_64-pc-windows-gnu/release - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: 'wasmer-windows-gnu64' path: dist @@ -333,7 +333,7 @@ jobs: CARGO_TARGET: aarch64-apple-darwin TARGET_DIR: target/aarch64-apple-darwin/release - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: 'aarch64-apple-darwin-jsc' path: dist @@ -362,7 +362,7 @@ jobs: CARGO_TARGET: x86_64-apple-darwin TARGET_DIR: target/x86_64-apple-darwin/release - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: 'x86_64-apple-darwin-jsc' path: dist @@ -427,7 +427,7 @@ jobs: TARGET: aarch64-unknown-linux-gnu TARGET_DIR: target/aarch64-unknown-linux-gnu/release - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wasmer-linux-aarch64 path: dist @@ -492,7 +492,7 @@ jobs: TARGET: riscv64gc-unknown-linux-gnu TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release - name: Upload Artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wasmer-linux-riscv64 path: dist diff --git a/.github/workflows/check-public-api.yaml b/.github/workflows/check-public-api.yaml index fc47e79c5e..ab503e5874 100644 --- a/.github/workflows/check-public-api.yaml +++ b/.github/workflows/check-public-api.yaml @@ -38,7 +38,7 @@ jobs: cargo public-api --manifest-path=lib/api/Cargo.toml --diff-git-checkouts $LATEST_VERSION main > diff.txt - name: Archive change report - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: api-diff-report path: | diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 18e2f4f2ba..f30a0e874e 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -272,7 +272,7 @@ jobs: TARGET_DIR: target/aarch64-unknown-linux-gnu/release - name: Upload Artifacts if: ${{ matrix.build-what.key == 'capi' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: capi-linux-aarch64 path: dist @@ -330,7 +330,7 @@ jobs: TARGET_DIR: target/riscv64gc-unknown-linux-gnu/release - name: Upload Artifacts if: ${{ matrix.build-what.key == 'capi' }} - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: capi-linux-riscv64 path: dist @@ -538,14 +538,14 @@ jobs: TARGET_DIR: target/${{ matrix.metadata.target }}/release CARGO_TARGET: ${{ matrix.metadata.target }} - name: Archive production artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: wasmer-cli-${{ matrix.metadata.build }} path: build-wasmer.tar.gz if-no-files-found: ignore retention-days: 2 - name: Archive production artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: capi-${{ matrix.metadata.build }} path: build-capi.tar.gz