hashicorp / serf

Service orchestration and management tool.
https://www.serf.io/
Mozilla Public License 2.0
5.86k stars 594 forks source link

compile to WebAssembly #625

Open VitaliiShpital opened 3 years ago

VitaliiShpital commented 3 years ago

Hello guys!

I'm using macOS Big Sur 11.2.1 go version go1.14.4 darwin/amd64

I'm trying to compile my test app (which uses Serf) to WebAssembly with this command GOOS=js GOARCH=wasm go build -o membership.wasm

I always get these errors `

github.com/hashicorp/go-sockaddr

../../../go/pkg/mod/github.com/hashicorp/go-sockaddr@v1.0.2/ifaddrs.go:116:13: undefined: NewRouteInfo ../../../go/pkg/mod/github.com/hashicorp/go-sockaddr@v1.0.2/ifaddrs.go:276:13: undefined: NewRouteInfo ../../../go/pkg/mod/github.com/hashicorp/go-sockaddr@v1.0.2/route_info.go:14:10: undefined: routeInfo

github.com/armon/go-metrics

../../../go/pkg/mod/github.com/armon/go-metrics@v0.3.6/const_unix.go:11:18: undefined: syscall.SIGUSR1 `

Could you tell me please if it is even possible to build wasm binary using Serf?

Thank you in advance!

timo-klarshift commented 1 year ago

Doesn't web assembly disallows general sockets? I doubt you will be able to open udp transports. But I might be wrong here.