diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ef7b42a..8d64877 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,11 +38,11 @@ jobs: if: matrix.env.CARGO_BUILD_TARGET == 'wasm32-wasip1' run: | rustup target add wasm32-wasip1 - curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-linux.deb - sudo dpkg --install wasi-sdk-25.0-x86_64-linux.deb - curl -LO https://github.com/bytecodealliance/wasmtime/releases/download/v13.0.0/wasmtime-v13.0.0-x86_64-linux.tar.xz - tar xvf wasmtime-v13.0.0-x86_64-linux.tar.xz - echo `pwd`/wasmtime-v13.0.0-x86_64-linux >> $GITHUB_PATH + curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-33/wasi-sdk-33.0-x86_64-linux.deb + sudo dpkg --install wasi-sdk-33.0-x86_64-linux.deb + curl -LO https://github.com/bytecodealliance/wasmtime/releases/download/v46.0.1/wasmtime-v46.0.1-x86_64-linux.tar.xz + tar xvf wasmtime-v46.0.1-x86_64-linux.tar.xz + echo `pwd`/wasmtime-v46.0.1-x86_64-linux >> $GITHUB_PATH - uses: Swatinem/rust-cache@v2 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1c101e2..046d895 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -40,11 +40,11 @@ jobs: if: matrix.env.CARGO_BUILD_TARGET == 'wasm32-wasip1' run: | rustup target add wasm32-wasip1 - curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-25/wasi-sdk-25.0-x86_64-linux.deb - sudo dpkg --install wasi-sdk-25.0-x86_64-linux.deb - curl -LO https://github.com/bytecodealliance/wasmtime/releases/download/v43.0.0/wasmtime-v43.0.0-x86_64-linux.tar.xz - tar xvf wasmtime-v43.0.0-x86_64-linux.tar.xz - echo `pwd`/wasmtime-v43.0.0-x86_64-linux >> $GITHUB_PATH + curl -LO https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-33/wasi-sdk-33.0-x86_64-linux.deb + sudo dpkg --install wasi-sdk-33.0-x86_64-linux.deb + curl -LO https://github.com/bytecodealliance/wasmtime/releases/download/v46.0.1/wasmtime-v46.0.1-x86_64-linux.tar.xz + tar xvf wasmtime-v46.0.1-x86_64-linux.tar.xz + echo `pwd`/wasmtime-v46.0.1-x86_64-linux >> $GITHUB_PATH - uses: Swatinem/rust-cache@v2 with: diff --git a/build.rs b/build.rs index dc641c1..746695e 100644 --- a/build.rs +++ b/build.rs @@ -157,9 +157,17 @@ fn main() { } _ => "wasm32-wasip1", }; - println!( - "cargo:rustc-link-search={wasi_sdk}/share/wasi-sysroot/lib/{wasi_sysroot_lib}" - ); + let sysroot_lib = format!("{wasi_sdk}/share/wasi-sysroot/lib/{wasi_sysroot_lib}"); + // libc and its startup objects (crt1) live directly in this directory. + println!("cargo:rustc-link-search={sysroot_lib}"); + // wasi-sdk 27+ split libc++/libc++abi into `eh/` (exceptions) and + // `noeh/` (no exceptions) subdirectories. We build with + // `-fno-exceptions`, so add the `noeh` variant to the search path + // when it exists; older wasi-sdk keeps these libs flat in `sysroot_lib`. + let noeh_lib = format!("{sysroot_lib}/noeh"); + if Path::new(&noeh_lib).exists() { + println!("cargo:rustc-link-search={noeh_lib}"); + } // Wasm exceptions are new and not yet supported by WASI SDK. build.flag("-fno-exceptions"); // WASI SDK only has libc++ available. diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 2ce412d..1000197 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.90.0" +channel = "1.96.1" profile = "default" diff --git a/scripts/wasmtime-wrapper.sh b/scripts/wasmtime-wrapper.sh index d6ece59..557e640 100755 --- a/scripts/wasmtime-wrapper.sh +++ b/scripts/wasmtime-wrapper.sh @@ -1,4 +1,4 @@ #!/bin/bash SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" cd $SCRIPT_DIR/.. -wasmtime run --max-wasm-stack=4194304 --env INSTA_WORKSPACE_ROOT=/ --mapdir "/::$(pwd)" -- "$@" +wasmtime run -W max-wasm-stack=4194304 --env INSTA_WORKSPACE_ROOT=/ --dir "$(pwd)::/" -- "$@"