fjl / gencodec

Command gencodec generates marshaling methods for Go struct types.
MIT License
54 stars 26 forks source link

"tinygo test" fails #19

Closed dkegel-fastly closed 12 months ago

dkegel-fastly commented 2 years ago

Normally, one only needs the generated code to be tinygo-compatible, but it'd be convenient to be able to run tests with tinygo.

Currently, "tinygo test" fails with this error:

--- FAIL: TestGolden (0.01s)
    --- FAIL: TestGolden/mapconv (0.01s)
        couldn't exec 'go [list -e -json -compiled=false -test=true -export=false -deps=true -find=false -- .]': fork/exec /usr/bin/go: operation not implemented T

On Mac, one has to use -tags appengine to get past a problem in x/tools.

fjl commented 2 years ago

Sorry, but I don't have the bandwidth to deal with tinygo issues in this repo. Please send a PR if you know how to fix this. The error looks like an implementation restriction of tinygo to me.

dkegel-fastly commented 2 years ago

Tinygo doesn't support exec (!), so whoever needs this working with tinygo is going to have to get creative (e.g. the tinygo version could add a Makefile that did the needed command before running the tinygo version of the test).

fjl commented 2 years ago

I don't understand why you need to build this tool with tinygo, or run its tests with tinygo.

gencodec is a code generator tool. It is expected that you run this tool on your development machine. You can just compile it with regular go. The output of the code generator can be compiled with tinygo, and doesn't need exec.