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

x/tools/cmd/bundle: use caller's module version, not $GOPATH #32031

Open
bradfitz opened this issue May 14, 2019 · 2 comments

Comments

Projects
None yet
4 participants
@bradfitz
Copy link
Member

commented May 14, 2019

There are two bundled packages in $GOROOT/src/net/http:

bradfitz@go:~/go/src/net/http$ git grep go:gener
h2_bundle.go://go:generate bundle -o h2_bundle.go -prefix http2 golang.org/x/net/http2
socks_bundle.go://go:generate bundle -o socks_bundle.go -dst net/http -prefix socks -underscore golang.org/x/net/internal/socks

A bundled package is a a package that gets fused in with another package to avoid an otherwise-circular dependency. (We can't just import golang.org/x/net/http2 from net/http as http2 implements interfaces using types in their signatures defined in net/http)

Currently, to update http2 in std you need to both update the go.mod+vendor files (for some of the http2 subpackages) as well as run the go generate bundle step to generate h2_bundle.go.

The bundle appears to just gets it code from whatever you have on your disk in $GOPATH, though. It should use the same version from the current module ($GOROOT/src/go.mod).

/cc @bcmills @jayconrod @alandonovan @dmitshur @ianlancetaylor

@gopherbot gopherbot added this to the Unreleased milestone May 14, 2019

@gopherbot

This comment has been minimized.

Copy link

commented May 14, 2019

Change https://golang.org/cl/177037 mentions this issue: net/http: update vendored, bundled x/net/http2

@dmitshur

This comment has been minimized.

Copy link
Member

commented May 15, 2019

bundle currently uses golang.org/x/tools/go/loader to load packages. At first glance, this issue is about making it use golang.org/x/tools/go/packages instead, which will make it support modules.

Added bundle to #24661.

/cc @ianthehat @matloob

gopherbot pushed a commit that referenced this issue May 16, 2019

net/http: update vendored, bundled x/net/http2
For:

    http2: track reused connections
    https://golang.org/cl/176720 (updates #31982)

Some x/sys/unix updates come along for the ride too.

I filed #32031 for making the bundling process less difficult and
error-prone in the future.

Change-Id: Ic822080991ffa2d50352c5f613e45648a327cf16
Reviewed-on: https://go-review.googlesource.com/c/go/+/177037
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.