From aa978a8d630622c63d8b6248782fd0fe3fde637e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=86=8D=E8=BF=9F=E7=96=91?= <896369042@qq.com> Date: Fri, 24 Nov 2023 09:52:04 +0800 Subject: [PATCH 1/2] Update README.md How to build wasmtime-c-api --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 78172d7..8be92cd 100644 --- a/README.md +++ b/README.md @@ -134,7 +134,7 @@ You'll need to build at least the `wasmtime-c-api` crate, which, at the time of this writing, would be: ```sh -$ cargo build -p wasmtime-c-api +$ cargo +nightly build -p wasmtime-c-api --release ``` Once you've got that you can set up the environment of this library with: From 2829122550efcd40b28c83e0af498b72bcc9215d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=B8=8D=E5=86=8D=E8=BF=9F=E7=96=91?= <896369042@qq.com> Date: Fri, 24 Nov 2023 09:52:04 +0800 Subject: [PATCH 2/2] Update README.md How to build wasmtime-c-api --- README.md | 9 +++++---- ci/local.sh | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 8be92cd..721fe66 100644 --- a/README.md +++ b/README.md @@ -131,16 +131,17 @@ Next up you'll want to have a [local Wasmtime build available](https://bytecodealliance.github.io/wasmtime/contributing-building.html). You'll need to build at least the `wasmtime-c-api` crate, which, at the time of -this writing, would be: +this writing, would be (apple m1 example): ```sh -$ cargo +nightly build -p wasmtime-c-api --release +$ rustup target add aarch64-apple-darwin +$ cargo build --release --target aarch64-apple-darwin -p wasmtime-c-api ``` -Once you've got that you can set up the environment of this library with: +Once you've got that you can set up the environment of this library with (apple m1 example): ```sh -$ ./ci/local.sh /path/to/wasmtime +$ ./ci/local.sh /path/to/wasmtime aarch64-apple-darwin ``` This will create a `build` directory which has the compiled libraries and header diff --git a/ci/local.sh b/ci/local.sh index d211ebe..c860289 100755 --- a/ci/local.sh +++ b/ci/local.sh @@ -1,6 +1,7 @@ #!/bin/bash wasmtime=$1 +target=$2 if [ "$wasmtime" = "" ]; then echo "must pass path to wasmtime" exit 1 @@ -15,9 +16,9 @@ for d in "include" "include/wasmtime" "linux-x86_64" "macos-x86_64" "windows-x86 echo "package ${name/-/_}" > "$path/empty.go" done -build="$wasmtime/target/release" +build="$wasmtime/target/"$target"/release" if [ ! -d "$build" ]; then - build="$wasmtime/target/debug" + build="$wasmtime/target/"$target"/debug" fi # Use absolute path for symbolic links build=$(cd "$build" && pwd)