compute-sdk-go icon indicating copy to clipboard operation
compute-sdk-go copied to clipboard

fsthttp/{transport,adapter}.go imports net/http, breaking native mac build?

Open dkegel-fastly opened this issue 2 years ago • 3 comments

An app that imports fsthttp, and which builds in both go, tinygo native, and tinygo wasm (with -tag nofastlyhostcalls) stopped building on tinygo native when we upgraded it to v0.1.2; wrapping fsthttp/{transport,adapter}.go in another build tag seems to resolve the problem.

So adding a build tag to disable the net/http dependency seems like a good thing to add... maybe named fastly.compute.nostdhttp for clarity.

dkegel-fastly avatar Mar 11 '23 01:03 dkegel-fastly

This seems reasonable. The net/http package is also a large dependency, and people who are only using C@E won't need it. That's probably easier than moving those two files to their own subpackage.

dgryski avatar Mar 11 '23 03:03 dgryski

I wonder if we should actually go the other way and require opting in to the net/http dependency? Although if we're going to break the API, having it in a separate package is probably nicer.

dgryski avatar Mar 11 '23 16:03 dgryski

https://github.com/tinygo-org/tinygo/pull/4502 should fix the Mac build but doesn't solve the issue of adding in a net/http for everybody who doesn't need it.

dgryski avatar Oct 09 '24 17:10 dgryski