Skip to content

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

Closed
@bradfitz

Description

@bradfitz

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.ToolsThis label describes issues relating to any tools in the x/tools repository.modules

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions