Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
git-fetch-with-cli = true

[build]
target = "wasm32-wasi"
target = "wasm32-wasip1"
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -33,13 +33,13 @@ 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
with:
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
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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:
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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" }
```
Expand All @@ -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" }
```
Expand Down
2 changes: 1 addition & 1 deletion examples/javascript/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/javascript/spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
2 changes: 1 addition & 1 deletion examples/python/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/python/spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 2 additions & 2 deletions examples/rust-standalone/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions examples/rust-standalone/spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,16 +15,16 @@ 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]
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"]
4 changes: 2 additions & 2 deletions examples/rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ 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

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
```
Expand Down
4 changes: 2 additions & 2 deletions examples/rust/spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
4 changes: 2 additions & 2 deletions spin.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Loading