Skip to content

Commit

Permalink
Use "wasm32-wasip1" instead of "wasm32-wasm" for UDF
Browse files Browse the repository at this point in the history
Signed-off-by: TennyZhuang <[email protected]>
  • Loading branch information
TennyZhuang authored Nov 24, 2024
1 parent 1f26c3d commit fec6394
Showing 1 changed file with 5 additions and 5 deletions.
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

0 comments on commit fec6394

Please sign in to comment.