tinygo icon indicating copy to clipboard operation
tinygo copied to clipboard

Missing various net/http packages in std

Open inliquid opened this issue 1 year ago • 5 comments

This is follow up of #4580 as the initial issue was closed.

I have same issue when trying to build module, which imports quite complex *.proto definitions:

$ tinygo build -o wasm/plugin.wasm -scheduler=none -target=wasip1 --no-debug ./wasm
../../../../pkg/mod/golang.org/x/[email protected]/http2/transport.go:26:2: package net/http/httptrace is not in std (/home/***/.cache/tinygo/goroot-8cbcb1d9555609a60075264735fce03217a624835ebf583eb96aa0c5bf08e840/src/net/http/httptrace)
../../../../pkg/mod/google.golang.org/[email protected]/internal/transport/proxy.go:29:2: package net/http/httputil is not in std (/home/***/.cache/tinygo/goroot-8cbcb1d9555609a60075264735fce03217a624835ebf583eb96aa0c5bf08e840/src/net/http/httputil)

I would like to be able to compile these dependencies into my Wasm modules. And I see a lot of progress, previously there were much more scaring compiler errors, now when reflect support is there, only those left. At the moment I have to regenerate these *.proto definitions using alternative generators.

inliquid avatar Nov 13 '24 18:11 inliquid

Is this solved by tinygo-org/net#34?

scottfeldman avatar Jan 18 '25 10:01 scottfeldman

Hi @scottfeldman, I don't see httptrace or httputil was added in that PR.

inliquid avatar Jan 18 '25 14:01 inliquid

Hi @scottfeldman, I don't see httptrace or httputil was added in that PR.

Oh, you're right. My bad.

Can you supply your program or a test program I can use to repro? Then I can look into adding httptrace and httputil. THanks.

scottfeldman avatar Jan 19 '25 07:01 scottfeldman

httptrace was just added in https://github.com/tinygo-org/net/pull/39

deadprogram avatar Aug 10 '25 10:08 deadprogram

I ran into the same issue and upgraded to 0.39 which resolved the httptrace but still running into missing httputil

../../../../../../../pkg/mod/google.golang.org/[email protected]/internal/transport/proxy.go:29:2: package net/http/httputil is not in std 

Is that one planned to be added?

jeff1010322 avatar Oct 13 '25 19:10 jeff1010322