[DX] Testing changes in x/net (net/http/h2_bundle.go issue) with gotip

163 views
Skip to first unread message

Kirth Gersen

unread,
Dec 6, 2021, 9:11:18 AM12/6/21
to golang-dev
hi,

I'm struggling to build a program using changes made to golang.org/x/net.
Using "replace" in go.mod works fine for a change that doesn't require net/http to be updated.
But because of h2_bundle.go 'trick' in net/http the std lib must be updated for the changes to be integrated in net/http.
This video explains the h2_bundle.go trick: https://www.youtube.com/watch?v=FARQMJndUn0&t=814s

I've tried using gotip but it gets complicated because of "vendor" bits in std lib source.
I managed to get around this but I find the whole experience not very user friendly.
Then I get an error when trying to "go generate net/http":

bundle: internal error: package "strings" without types was imported from "golang.org/x/net/http2"
net/http/http.go:5: running "bundle": exit status 1
(is this related to generics introduction in 1.18 and not having them in golang.org/x/net yet ?)

Are there recommended/better steps to test changes made to golang.org/x/net ?

here the steps I used:
Another issue is that gotip doesn't have a 'make' option only 'download'. gotip doesn't generate either (could be on purpose).

so gotip is probably not the right tool to test changes made to golang.org/x/net ?

I've read https://go.dev/doc/contribute but it doesn't provide much information about using a modified go root env.


Ian Lance Taylor

unread,
Dec 6, 2021, 9:32:49 AM12/6/21
to Kirth Gersen, golang-dev
On Mon, Dec 6, 2021 at 6:11 AM Kirth Gersen <kirth...@gmail.com> wrote:
>
> Then I get an error when trying to "go generate net/http":
>
> bundle: internal error: package "strings" without types was imported from "golang.org/x/net/http2"
> net/http/http.go:5: running "bundle": exit status 1
> (is this related to generics introduction in 1.18 and not having them in golang.org/x/net yet ?)

Make sure to run "gotip install golang.org/x/tools/cmd/bundle" with
gotip, so that bundle understands the export data used by gotip.

Ian

Kirth Gersen

unread,
Dec 6, 2021, 12:50:26 PM12/6/21
to golang-dev
> Make sure to run "gotip install golang.org/x/tools/cmd/bundle" with
> gotip, so that bundle understands the export data used by gotip.

thx that indeed fixed the error.
Reply all
Reply to author
Forward
0 new messages