From 6f0d57e6370d56b2996744c5a58bc1b8c3258cec Mon Sep 17 00:00:00 2001 From: Benjamin Eckel Date: Thu, 24 Oct 2024 14:08:34 -0500 Subject: [PATCH 1/4] Bump the version of tinygo used in CI --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index da34cf0..bc51ed0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: - name: Install TinyGo uses: acifani/setup-tinygo@v1.1.0 with: - tinygo-version: 0.31.2 + tinygo-version: 0.33.0 binaryen-version: "116" - name: Compile example From f2b28caef2ab108e5f7f71cb577ec2901264d125 Mon Sep 17 00:00:00 2001 From: Benjamin Eckel Date: Thu, 24 Oct 2024 14:09:15 -0500 Subject: [PATCH 2/4] Add codeowners file --- .github/CODEOWNERS | 1 + 1 file changed, 1 insertion(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..1f374da --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +* @zshipko @nilslice @mhmd-azeez From c0e266098699a6b3f2b9c1bdd51593e523b0640d Mon Sep 17 00:00:00 2001 From: zach Date: Fri, 1 Nov 2024 11:16:55 -0700 Subject: [PATCH 3/4] fix: update examples for tinygo 0.34 --- .github/workflows/ci.yml | 2 +- Makefile | 8 ++++---- example/countvowels/tiny_main.go | 4 +--- example/http/tiny_main.go | 1 - example/reactor/tiny_main.go | 5 +---- 5 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bc51ed0..4fb2337 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,7 +28,7 @@ jobs: - name: Install TinyGo uses: acifani/setup-tinygo@v1.1.0 with: - tinygo-version: 0.33.0 + tinygo-version: 0.34.0 binaryen-version: "116" - name: Compile example diff --git a/Makefile b/Makefile index 1a37f86..fb20523 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,8 @@ .PHONY: example example: - tinygo build -o example/tiny_countvowels.wasm -target wasi ./example/countvowels - tinygo build -o example/tiny_http.wasm -target wasi ./example/http - tinygo build -o example/tiny_reactor.wasm -target wasi ./example/reactor + tinygo build -o example/tiny_countvowels.wasm -target wasi -buildmode c-shared ./example/countvowels + tinygo build -o example/tiny_http.wasm -target wasi -buildmode c-shared ./example/http + tinygo build -o example/tiny_reactor.wasm -target wasi -buildmode c-shared ./example/reactor GOOS=wasip1 GOARCH=wasm go build -tags std -o example/std_countvowels.wasm ./example/countvowels GOOS=wasip1 GOARCH=wasm go build -tags std -o example/std_http.wasm ./example/http @@ -14,5 +14,5 @@ test: extism call example/tiny_countvowels.wasm count_vowels_roundtrip_json_mem --wasi extism call example/std_countvowels.wasm _start --wasi --input "this is a test" --set-config '{"thing": "1234"}' - extism call example/std_http.wasm _start --wasi --log-level info --allow-host "jsonplaceholder.typicode.com" + extism call example/std_http.wasm http_get --wasi --log-level info --allow-host "jsonplaceholder.typicode.com" diff --git a/example/countvowels/tiny_main.go b/example/countvowels/tiny_main.go index 6b2046f..89e382e 100644 --- a/example/countvowels/tiny_main.go +++ b/example/countvowels/tiny_main.go @@ -70,7 +70,7 @@ func countVowelsJSONRoundtripMem() int32 { return 0 } -//export count_vowels +//go:wasmexport count_vowels func countVowels() int32 { input := pdk.Input() @@ -102,5 +102,3 @@ func countVowels() int32 { return 0 } - -func main() {} diff --git a/example/http/tiny_main.go b/example/http/tiny_main.go index cd828e6..76c77e5 100644 --- a/example/http/tiny_main.go +++ b/example/http/tiny_main.go @@ -22,4 +22,3 @@ func httpGet() int32 { return 0 } -func main() {} diff --git a/example/reactor/tiny_main.go b/example/reactor/tiny_main.go index e84ff2a..58c3fc9 100644 --- a/example/reactor/tiny_main.go +++ b/example/reactor/tiny_main.go @@ -7,10 +7,9 @@ import ( "os" "github.com/extism/go-pdk" - _ "github.com/extism/go-pdk/wasi-reactor" ) -//export read_file +//go:wasmexport read_file func readFile() { name := pdk.InputString() @@ -22,5 +21,3 @@ func readFile() { pdk.Output(content) } - -func main() {} From a0c2b768c0444b2389bab2064d379e9e60157446 Mon Sep 17 00:00:00 2001 From: zach Date: Fri, 1 Nov 2024 11:28:39 -0700 Subject: [PATCH 4/4] fix: std go test should call _start --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fb20523..86f339e 100644 --- a/Makefile +++ b/Makefile @@ -14,5 +14,5 @@ test: extism call example/tiny_countvowels.wasm count_vowels_roundtrip_json_mem --wasi extism call example/std_countvowels.wasm _start --wasi --input "this is a test" --set-config '{"thing": "1234"}' - extism call example/std_http.wasm http_get --wasi --log-level info --allow-host "jsonplaceholder.typicode.com" + extism call example/std_http.wasm _start --wasi --log-level info --allow-host "jsonplaceholder.typicode.com"