oschwald / maxminddb-golang

MaxMind DB Reader for Go
ISC License
615 stars 101 forks source link

Add wasi directives for tinygo #114

Closed alexkashintsev-tomtom closed 1 year ago

alexkashintsev-tomtom commented 1 year ago

Goal Adding WASI directives to be able to compile with tinygo (and use it with WASM for Envoy).

Without these directives for compiler, compiling with tinygo v0.28.1 on Darwin fails with:

tinygo build -o main.wasm -scheduler=none -target=wasi main.go
# golang.org/x/sys/unix
../../go/pkg/mod/golang.org/x/sys@v0.10.0/unix/syscall_linux.go:1901:64: undefined: syscall.Rlimit
../../go/pkg/mod/golang.org/x/sys@v0.10.0/unix/syscall_linux.go:1906:50: undefined: syscall.Rlimit
../../go/pkg/mod/golang.org/x/sys@v0.10.0/unix/syscall_linux.go:1906:79: undefined: syscall.Rlimit
../../go/pkg/mod/golang.org/x/sys@v0.10.0/unix/syscall_unix.go:595:17: undefined: syscall.Setrlimit
../../go/pkg/mod/golang.org/x/sys@v0.10.0/unix/syscall_unix.go:595:47: undefined: syscall.Rlimit
alexkashintsev-tomtom commented 1 year ago

Sorry for spam, after double-checking we indeed need this directives to use maxmind with Tinygo.

oschwald commented 1 year ago

Thanks!