-
Notifications
You must be signed in to change notification settings - Fork 256
Open
Labels
gen-goRelated to the Go code generatorRelated to the Go code generator
Description
Description
When attempting to run unit tests I get the following compilation error when wit-bindgen go bindings are imported:
$ go test ./...
# <go-project>/types/wasi_logging_logging
<go-project>/types/wasi_logging_logging/wit_bindings.go:42:6: missing function body
FAIL <go-project> [build failed]
FAILWith the bindings file showing the following:
...
//go:wasmimport wasi:logging/logging@0.1.0-draft log
func wasm_import_log(arg0 int32, arg1 uintptr, arg2 uint32, arg3 uintptr, arg4 uint32)
...wit-bindgen-go got round this issue by including a blank empty.s assembly file within each of the directories which includes a Go file that uses the //go:wasmimport directive. See here for example.
This tricks the Go compile into thinking there is an assembly implementation of the function which has been declared, and so it no longer complains about the missing function body.
Is this something which we could include in these bindings to get around this build error?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
gen-goRelated to the Go code generatorRelated to the Go code generator