Replies: 1 comment
-
This looks like a bug in TinyGo. Can you make a bug report? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, I'm trying out switching compiling from go to tinygo for WASI, and the setup I have is, in part, as follows:
with the compilation function being:
GOOS=wasip1 GOARCH=wasm go build -o ../scripts.wasm -buildmode=c-shared .
As you can see in the code above, the
_Input.ActionPressed()
function returns an imported function that is provided by the host, running through extism. However, tinygo won't compile this - it returns:utils/system.go:15:6: cannot use an exported function as value: solarlune.com/smallAdventureGame/assets/scripts/utils.inputActionPressed
. However, this isn't an exported function from TinyGo, it's an imported function from the host.When I switch
//go:wasmimport ...
to just// import ...
, then I get:wasm-ld: error: lto.tmp: undefined symbol: solarlune.com/smallAdventureGame/assets/scripts/utils.systemReadFile
. Of course, switching//go:wasmimport
to//go:wasmexport
doesn't work, as the functions are not definitions.Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions