Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "wasm32-wasip1" instead of "wasm32-wasi" for UDF #76

Merged
merged 2 commits into from
Nov 25, 2024
Merged
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
10 changes: 5 additions & 5 deletions sql/udfs/use-udfs-in-rust.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ If you want to use other libraries in your Rust functions, you can manually buil
### Prerequisites

* Ensure that you have [Rust toolchain](https://rustup.rs) (stable channel) installed on your computer.
* Ensure that the Rust standard library for `wasm32-wasi` target is installed:
* Ensure that the Rust standard library for `wasm32-wasip1` target is installed:
```sql
rustup target add wasm32-wasi
rustup target add wasm32-wasip1
```

### 1\. Create a project
Expand Down Expand Up @@ -134,10 +134,10 @@ See the correspondence between SQL types and Rust types in the [Data type mappin
Build your functions into a WebAssembly module:

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

You can find the generated WASM module at `target/wasm32-wasi/release/udf.wasm`.
You can find the generated WASM module at `target/wasm32-wasip1/release/udf.wasm`.

Optional: It is recommended to strip the binary to reduce its size:

Expand All @@ -146,7 +146,7 @@ Optional: It is recommended to strip the binary to reduce its size:
cargo install wasm-tools

# Strip the binary
wasm-tools strip ./target/wasm32-wasi/release/udf.wasm > udf.wasm
wasm-tools strip ./target/wasm32-wasip1/release/udf.wasm > udf.wasm
```

## 4\. Declare your functions in RisingWave
Expand Down