Closed mhmd-azeez closed 10 months ago
Can't reproduce, I cloned repo and installed tinygo and needed to install wasm-opt
too.
I can build countvowels
successfully with tinygo build -o example/tiny_countvowels.wasm -target wasi ./example/countvowels
I can build http
successfully with tinygo build -o example/tiny_http.wasm -target wasi ./example/http
C:\Users\jay\github\go-pdk>go version
go version go1.20.7 windows/amd64
C:\Users\jay\github\go-pdk>tinygo version
tinygo version 0.30.0 windows/amd64 (using go version go1.20.7 and LLVM version 16.0.1)
Edit:
Can you try upgrading tinygo version to latest? It's only two versions but worth a try.
Ah interesting, I can reproduce similar errors with tinygo build example\countvowels\main.go
.
ld.lld: error: undefined symbol: github.com/extism/go-pdk.extism_input_load_u8_
>>> referenced by main
>>> C:\Users\jay\AppData\Local\Temp\tinygo2640000697\main.o
ld.lld: error: undefined symbol: github.com/extism/go-pdk.extism_store_u8_
>>> referenced by main
>>> C:\Users\jay\AppData\Local\Temp\tinygo2640000697\main.o
ld.lld: error: undefined symbol: github.com/extism/go-pdk.extism_load_u8_
>>> referenced by main
>>> C:\Users\jay\AppData\Local\Temp\tinygo2640000697\main.o
ld.lld: error: undefined symbol: github.com/extism/go-pdk.extism_free
>>> referenced by main
>>> C:\Users\jay\AppData\Local\Temp\tinygo2640000697\main.o
ld.lld: error: undefined symbol: github.com/extism/go-pdk.extism_load_u64
>>> referenced by main
>>> C:\Users\jay\AppData\Local\Temp\tinygo2640000697\main.o
ld.lld: error: undefined symbol: github.com/extism/go-pdk.extism_store_u64
>>> referenced by main
>>> C:\Users\jay\AppData\Local\Temp\tinygo2640000697\main.o
ld.lld: error: undefined symbol: github.com/extism/go-pdk.extism_input_length
>>> referenced by main
>>> C:\Users\jay\AppData\Local\Temp\tinygo2640000697\main.o
ld.lld: error: undefined symbol: github.com/extism/go-pdk.extism_input_load_u64
>>> referenced by main
>>> C:\Users\jay\AppData\Local\Temp\tinygo2640000697\main.o
ld.lld: error: undefined symbol: github.com/extism/go-pdk.extism_alloc
>>> referenced by main
>>> C:\Users\jay\AppData\Local\Temp\tinygo2640000697\main.o
ld.lld: error: undefined symbol: github.com/extism/go-pdk.extism_output_set
>>> referenced by main
>>> C:\Users\jay\AppData\Local\Temp\tinygo2640000697\main.o
ld.lld: error: undefined symbol: github.com/extism/go-pdk.extism_config_get
>>> referenced by main
>>> C:\Users\jay\AppData\Local\Temp\tinygo2640000697\main.o
ld.lld: error: undefined symbol: github.com/extism/go-pdk.extism_length
>>> referenced by main
>>> C:\Users\jay\AppData\Local\Temp\tinygo2640000697\main.o
ld.lld: error: undefined symbol: github.com/extism/go-pdk.extism_var_get
>>> referenced by main
>>> C:\Users\jay\AppData\Local\Temp\tinygo2640000697\main.o
ld.lld: error: undefined symbol: github.com/extism/go-pdk.extism_var_set
>>> referenced by main
>>> C:\Users\jay\AppData\Local\Temp\tinygo2640000697\main.o
failed to run tool: ld.lld
error: failed to link C:\Users\jay\AppData\Local\Temp\tinygo2640000697\main.exe: exit status 1
With the latest version of TinyGo and latest version of the examples in the repo, you can build the examples on windows too:
PS D:\dylibso\go-pdk\example\countvowels> tinygo version
tinygo version 0.30.0 windows/amd64 (using go version go1.21.1 and LLVM version 16.0.1)
PS D:\dylibso\go-pdk\example\countvowels> tinygo build -target wasi -o c.wasm .\tiny_main.go
PS D:\dylibso\go-pdk\example\countvowels> extism call .\c.wasm count_vowels --input "Hello World!" --wasi
{"count": 3, "config": "<unset by host>", "a": "this is var a"}
I tried compiling the samples in
example
folder of this repo on Windows, but it seems like the C FFI is not working as expected. The examples build just fine on Windows Subsystem for Linux.Versions:
Windows: Windows 11 - 22H2 (OS Build 22621.1848) Go: go1.20.5 windows/amd64 TinyGo: 0.28.1 windows/amd64 (using go version go1.20.5 and LLVM version 15.0.0)
Logs