Open gedw99 opened 3 years ago
Mhhh
No luck and i think it might be reflection, but need to look further.
here is repro of me trying to build benthos-lab.
dep tinygo:
brew tap tinygo-org/tools
brew install tinygo
tinygo version
build golang wasm: ( works )
GOOS=js GOARCH=wasm go build -ldflags="-s -w" -o /Users/apple/workspace/go/src/github.com/gedw99/research/servers/dataflow/benthos/_bin/benthos-lab-wasm.wasm ./client/wasm/benthos-lab.go
build tinygo wasm: ( does not work )
tinygo build -o /Users/apple/workspace/go/src/github.com/gedw99/research/servers/dataflow/benthos/_bin/benthos-lab-wasm.wasm -target wasm --no-debug ./client/wasm/benthos-lab.go
../../../../../../../../pkg/mod/github.com/rcrowley/go-metrics@v0.0.0-20200313005456-10cdbea86bc0/debug.go:4:2: package runtime/debug is not in GOROOT (/Users/apple/Library/Caches/tinygo/goroot-go1.16.2-53d3c84e483c6ef0ed352a46dda63ea5bb8115d56e71e900a29c71fcd629271d/src/runtime/debug)
/Users/apple/Library/Caches/tinygo/goroot-go1.16.2-53d3c84e483c6ef0ed352a46dda63ea5bb8115d56e71e900a29c71fcd629271d/src/net/http/pprof/pprof.go:73:2: package runtime/trace is not in GOROOT (/Users/apple/Library/Caches/tinygo/goroot-go1.16.2-53d3c84e483c6ef0ed352a46dda63ea5bb8115d56e71e900a29c71fcd629271d/src/runtime/trace)
make: *** [build-lab-tinygo] Error 1
The latest release has been working for me on 2 golang projects so far.
Might be worth trying it out for benthos lab.
This is able to compile a golang badgerDB to tinygo.