Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tinygo can't compile GO app to wasm file #4222

Open
iltatarin opened this issue Apr 9, 2024 · 1 comment
Open

tinygo can't compile GO app to wasm file #4222

iltatarin opened this issue Apr 9, 2024 · 1 comment
Labels
wasm WebAssembly

Comments

@iltatarin
Copy link

iltatarin commented Apr 9, 2024

When I want compile my golang app to wasm file I get errors:
/go/pkg/mod/golang.org/x/net@v0.24.0/http2/transport.go:26:2: package net/http/httptrace is not in std (/root/.cache/tinygo/goroot-646f794f1c545d78f790d72fe3114fa1e0882f6cfab7deac934ba87ff42a6934/src/net/http/httptrace) /go/pkg/mod/google.golang.org/grpc@v1.63.2/internal/transport/proxy.go:29:2: package net/http/httputil is not in std (/root/.cache/tinygo/goroot-646f794f1c545d78f790d72fe3114fa1e0882f6cfab7deac934ba87ff42a6934/src/net/http/httputil)

Golang version: go version go1.21.6 linux/amd64
tinygo version: tinygo version 0.31.2 linux/amd64 (using go version go1.21.6 and LLVM version 17.0.1)
My command: tinygo build --no-debug -scheduler=none -target=wasi -o filter.wasm cmd/filter.go

image

If I use tinygo version 0.29 I get errors:
image

@iltatarin iltatarin changed the title tinygo can't compile wasm file tinygo can't compile GO app to wasm file Apr 9, 2024
@orsinium
Copy link

WASI preview 1 does not provide enough functions to implement a full HTTP server. More info:

https://go.dev/blog/wasi#limitations

You can use the main Go compiler with stealthrocket/net if your target wasm runtime is wasmedge.

@orsinium orsinium added the wasm WebAssembly label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wasm WebAssembly
Projects
None yet
Development

No branches or pull requests

2 participants