Skip to content

Commit

Permalink
Merge pull request #6 from second-state/chore/update_readme
Browse files Browse the repository at this point in the history
  • Loading branch information
juntao authored Jul 13, 2024
2 parents fff4f7b + fbeb96d commit 0f1cac1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,29 @@ We need to add some code into `src/main.rs`.

## Build and run it

<details>

<summary> Note on Mac </summary>

> `ring v0.17` can't build on Mac with default clang.
> So, you need install wasi-sdk.
### [Download wasi-sdk](https://github.com/WebAssembly/wasi-sdk?tab=readme-ov-file#install)
```
export WASI_VERSION=22
export WASI_VERSION_FULL=${WASI_VERSION}.0
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WASI_VERSION}/wasi-sdk-${WASI_VERSION_FULL}-macos.tar.gz
tar xvf wasi-sdk-${WASI_VERSION_FULL}-macos.tar.gz
```

### [Use the clang included in wasi-sdk for compilation.](https://github.com/WebAssembly/wasi-sdk?tab=readme-ov-file#use)
```
export WASI_SDK_PATH=`pwd`/wasi-sdk-${WASI_VERSION_FULL}
export CC="${WASI_SDK_PATH}/bin/clang --sysroot=${WASI_SDK_PATH}/share/wasi-sysroot"
```

</details>

First we need to compile the code. You will need to pass some flags to make sure that the Rust compiler knows to use the correct patches for the `wasmedge` target.

```bash
Expand Down

0 comments on commit 0f1cac1

Please sign in to comment.