diff --git a/.cargo/config.toml b/.cargo/config.toml index 4734df8..46f84d0 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -2,4 +2,4 @@ git-fetch-with-cli = true [build] -target = "wasm32-wasi" +target = "wasm32-wasip1" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1ce4d7a..7bcfc81 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: components: clippy, rustfmt - name: Install Wasm Rust target - run: rustup target add wasm32-wasi + run: rustup target add wasm32-wasip1 - name: Install spin-test run: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ca39fae..0d8f590 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -24,7 +24,7 @@ jobs: components: clippy, rustfmt - name: Install Wasm Rust target - run: rustup target add wasm32-wasi + run: rustup target add wasm32-wasip1 - name: Make run: make @@ -33,7 +33,7 @@ jobs: - name: generate checksums run: | - sha256sum target/wasm32-wasi/release/spin_static_fs.wasm > checksums-${{ env.RELEASE_VERSION }}.txt + sha256sum target/wasm32-wasip1/release/spin_static_fs.wasm > checksums-${{ env.RELEASE_VERSION }}.txt - name: Create release uses: softprops/action-gh-release@v1 @@ -41,5 +41,5 @@ jobs: fail_on_unmatched_files: true generate_release_notes: true files: | - target/wasm32-wasi/release/spin_static_fs.wasm + target/wasm32-wasip1/release/spin_static_fs.wasm checksums-${{ env.RELEASE_VERSION }}.txt diff --git a/README.md b/README.md index 3e69454..62cb8d1 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ and [NGINX Unit](https://unit.nginx.org/). Prerequisites: -- [Rust](https://www.rust-lang.org/) at [1.72+](https://www.rust-lang.org/tools/install) with the `wasm32-wasi` target configured +- [Rust](https://www.rust-lang.org/) at [1.72+](https://www.rust-lang.org/tools/install) with the `wasm32-wasip1` target configured - [cargo-component](https://github.com/bytecodealliance/cargo-component) - [Spin v2.0](https://github.com/fermyon/spin) to run the component/examples @@ -36,7 +36,7 @@ See the [examples](./examples) directory for examples of using and composing `sp Prerequisites: - [Rust](https://www.rust-lang.org/) at - [1.72+](https://www.rust-lang.org/tools/install) with the `wasm32-wasi` target + [1.72+](https://www.rust-lang.org/tools/install) with the `wasm32-wasip1` target configured Running test cases: @@ -84,7 +84,7 @@ component = "fs" # For more on configuring a component, see: https://developer.fermyon.com/spin/writing-apps [component.fs] -source = "target/wasm32-wasi/release/spin_static_fs.wasm" +source = "target/wasm32-wasip1/release/spin_static_fs.wasm" files = [{ source = "", destination = "/" }] [component.fs.build] command = "make" @@ -145,7 +145,7 @@ is useful for Single Page Applications that use view routers on the front-end li ```toml # For more on configuring a component, see: https://developer.fermyon.com/spin/writing-apps#adding-environment-variables-to-components [component.fs] -source = "target/wasm32-wasi/release/spin_static_fs.wasm" +source = "target/wasm32-wasip1/release/spin_static_fs.wasm" files = [{ source = "test", destination = "/" }] environment = { FALLBACK_PATH = "index.html" } ``` @@ -157,7 +157,7 @@ You can configure a `CUSTOM_404_PATH` environment variable and point to a file t ```toml # For more on configuring a component, see: https://developer.fermyon.com/spin/writing-apps#adding-environment-variables-to-components [component.fs] -source = "target/wasm32-wasi/release/spin_static_fs.wasm" +source = "target/wasm32-wasip1/release/spin_static_fs.wasm" files = [{ source = "test", destination = "/" }] environment = { CUSTOM_404_PATH = "404.html" } ``` diff --git a/examples/javascript/README.md b/examples/javascript/README.md index eb1864a..8c19c1d 100644 --- a/examples/javascript/README.md +++ b/examples/javascript/README.md @@ -19,7 +19,7 @@ component for serving static files. Once you have Rust and NodeJS installed, the following should give you everything else: ```shell -rustup target add wasm32-wasi +rustup target add wasm32-wasip1 cargo install cargo-component cargo install wac-cli npm install -g @bytecodealliance/jco @bytecodealliance/componentize-js diff --git a/examples/javascript/spin.toml b/examples/javascript/spin.toml index 05100ab..b8c4fa2 100644 --- a/examples/javascript/spin.toml +++ b/examples/javascript/spin.toml @@ -14,5 +14,5 @@ component = "spin-fileserver-example" source = "composed.wasm" files = [{ source = "../static", destination = "/" }] [component.spin-fileserver-example.build] -command = "npm install && node build.mjs && (cd .. && cargo component build --release) && RUST_LOG=error wac plug --plug ../../target/wasm32-wasi/release/spin_static_fs.wasm http.wasm -o composed.wasm" +command = "npm install && node build.mjs && (cd .. && cargo component build --release) && RUST_LOG=error wac plug --plug ../../target/wasm32-wasip1/release/spin_static_fs.wasm http.wasm -o composed.wasm" watch = ["*.js"] diff --git a/examples/python/README.md b/examples/python/README.md index 1f94a01..eb28fdb 100644 --- a/examples/python/README.md +++ b/examples/python/README.md @@ -20,7 +20,7 @@ component for serving static files. Once you have Rust, Python, and pip installed, the following should give you everything else: ```shell -rustup target add wasm32-wasi +rustup target add wasm32-wasip1 cargo install cargo-component cargo install wac-cli pip install componentize-py=0.13.5 diff --git a/examples/python/spin.toml b/examples/python/spin.toml index 26a16b9..cedfae0 100644 --- a/examples/python/spin.toml +++ b/examples/python/spin.toml @@ -14,5 +14,5 @@ component = "spin-fileserver-example" source = "composed.wasm" files = [{ source = "../static", destination = "/" }] [component.spin-fileserver-example.build] -command = "componentize-py -d ../wit -w proxy componentize app -o http.wasm && (cd .. && cargo component build --release) && RUST_LOG=error wac plug --plug ../../target/wasm32-wasi/release/spin_static_fs.wasm http.wasm -o composed.wasm" +command = "componentize-py -d ../wit -w proxy componentize app -o http.wasm && (cd .. && cargo component build --release) && RUST_LOG=error wac plug --plug ../../target/wasm32-wasip1/release/spin_static_fs.wasm http.wasm -o composed.wasm" watch = ["*.py"] diff --git a/examples/rust-standalone/README.md b/examples/rust-standalone/README.md index e2b1f6f..2c92881 100644 --- a/examples/rust-standalone/README.md +++ b/examples/rust-standalone/README.md @@ -8,13 +8,13 @@ in the [rust](../rust), [javascript](../javascript/) and [pythong](../python/) e ## Prerequisites - [Spin v2.0+](https://developer.fermyon.com/spin/install) -- [Rust](https://rustup.rs/), including the `wasm32-wasi` target +- [Rust](https://rustup.rs/), including the `wasm32-wasip1` target - [curl](https://curl.se/download.html) or a web browser for testing Once you have Rust installed, the following should give you everything else: ```shell -rustup target add wasm32-wasi +rustup target add wasm32-wasip1 ``` ## Building and Running diff --git a/examples/rust-standalone/spin.toml b/examples/rust-standalone/spin.toml index 90ce0a3..502d28d 100644 --- a/examples/rust-standalone/spin.toml +++ b/examples/rust-standalone/spin.toml @@ -15,7 +15,7 @@ route = "/hello" component = "hello" [component.fs] -source = "../../target/wasm32-wasi/release/spin_static_fs.wasm" +source = "../../target/wasm32-wasip1/release/spin_static_fs.wasm" description = "A fileserver component to serve static assets" files = [{ source = "../static", destination = "/" }] [component.fs.build] @@ -23,8 +23,8 @@ workdir = "../../" command = "cargo build --release" [component.hello] -source = "target/wasm32-wasi/release/rust_standalone.wasm" +source = "target/wasm32-wasip1/release/rust_standalone.wasm" description = "A simple component that returns hello." [component.hello.build] -command = "cargo build --target wasm32-wasi --release" +command = "cargo build --target wasm32-wasip1 --release" watch = ["src/**/*.rs", "Cargo.toml"] diff --git a/examples/rust/README.md b/examples/rust/README.md index 27fdf79..0809277 100644 --- a/examples/rust/README.md +++ b/examples/rust/README.md @@ -9,7 +9,7 @@ component for serving static files. ## Prerequisites - [Spin v2.0+](https://developer.fermyon.com/spin/install) -- [Rust](https://rustup.rs/), including the `wasm32-wasi` target +- [Rust](https://rustup.rs/), including the `wasm32-wasip1` target - [cargo-component](https://github.com/bytecodealliance/cargo-component) - [wac](https://github.com/bytecodealliance/wac) - [curl](https://curl.se/download.html) or a web browser for testing @@ -17,7 +17,7 @@ component for serving static files. Once you have Rust installed, the following should give you everything else: ```shell -rustup target add wasm32-wasi +rustup target add wasm32-wasip1 cargo install cargo-component cargo install wac-cli ``` diff --git a/examples/rust/spin.toml b/examples/rust/spin.toml index ea2e412..5b130ce 100644 --- a/examples/rust/spin.toml +++ b/examples/rust/spin.toml @@ -11,8 +11,8 @@ route = "/..." component = "spin-fileserver-example" [component.spin-fileserver-example] -source = "target/wasm32-wasi/release/composed.wasm" +source = "target/wasm32-wasip1/release/composed.wasm" files = [{ source = "../static", destination = "/" }] [component.spin-fileserver-example.build] -command = "cargo component build --release && (cd .. && cargo component build --release) && RUST_LOG=error wac plug --plug ../../target/wasm32-wasi/release/spin_static_fs.wasm target/wasm32-wasi/release/spin_fileserver_example.wasm -o target/wasm32-wasi/release/composed.wasm" +command = "cargo component build --release && (cd .. && cargo component build --release) && RUST_LOG=error wac plug --plug ../../target/wasm32-wasip1/release/spin_static_fs.wasm target/wasm32-wasip1/release/spin_fileserver_example.wasm -o target/wasm32-wasip1/release/composed.wasm" watch = ["src/**/*.rs", "Cargo.toml"] diff --git a/spin.toml b/spin.toml index 2803527..1b2d974 100644 --- a/spin.toml +++ b/spin.toml @@ -12,13 +12,13 @@ component = "fs" # For more on configuring a component, see: https://developer.fermyon.com/spin/writing-apps [component.fs] -source = "target/wasm32-wasi/release/spin_static_fs.wasm" +source = "target/wasm32-wasip1/release/spin_static_fs.wasm" files = [{ source = "", destination = "/" }] exclude_files = ["target/**/*"] [component.fs.build] command = "make" [component.fs.tool.spin-test] -source = "target/wasm32-wasi/release/tests.wasm" +source = "target/wasm32-wasip1/release/tests.wasm" build = "cargo component build --release" workdir = "tests"