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() {}