-
Notifications
You must be signed in to change notification settings - Fork 917
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
missing various net/http packages in std #4580
Comments
According to https://tinygo.org/docs/reference/lang-support/stdlib/#nethttphttptrace the packages you are trying to import are not supported. Can you share more about what you are trying to do with the HTTP server? I see you are targeting wasm. HTTP in WASM can be tricky. However, there are a few examples of how you can use wasip2 and a runtime such as wasmtime to run something close. Here is one project https://github.com/rajatjindal/wasi-go-sdk/tree/main/examples. Wasmcloud, Spin, Wasmtime, and Extistim are a few tools you could look into if you are working with wasm server side. If you are using wasm in the browser, that will be a different story. |
I was trying to use https://github.com/syumai/workers, but my current HTTP Server has a lot more extra dependencies such as tracing, so I think its just not cut out for my case atm. I will look into wasip2 and see if cloudflare has support for that. |
I have same issue when trying to build module, which imports quite complex
I think problem is there and needs to be fixed. Can we keep issue open, or should I open another one? |
@inliquid - I believe the main problem is the deps that are getting pulled in by grpc. One solve for this would not be handled in tiny-go. Recently the tiny-go net package was updated to handle custom transports for HTTP. This was a core requirement for getting HTTP in wasi working IMO. There might be something that could be done using a similar pattern but it will be in the packages uses x/net or grpc. Otherwise, you are right these packages would need to be pulled over into tinygo - I haven't looked into that but my guess is that is fairly far out - just a guess tho. I don't see a problem leaving this issue open - but I would also recommend looking here https://github.com/tinygo-org/net to see what we could do. |
I would like to be able to just compile these dependencies into my Wasm modules. And I see a lot of progress, previously there were much more scaring compiler errors, now when |
Opened #4598. |
I am currently trying to build my net/http server and getting various errors
Running:
tinygo build -o ./build/app.wasm -target wasm -no-debug ./cmd/main.go
Anything I can do to bypass this?
The text was updated successfully, but these errors were encountered: