-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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/net/http2/h2demo: should not be single-handedly responsible for adding 3 required modules to x/net #30685
Comments
Either solution SGTM. |
I'd rather not move it away from the code that it's a demo of. |
Are you ok with carving it out into its own module, keeping it at the same path (and in the same repo)? |
Ok. If Brad is okay with making it a separate module in x/net instead, I want @matloob and @ianthehat's agreement of introducing a multi-module repository in order to resolve this issue. I propose making it a separate module but not making any tagged releases yet, which is more in line with @bcmills's plan described in #28136 (comment) that we have been following so far for all subrepos. Edit: I don't yet know if it's better to include a |
That's fine with me, and shouldn't impact its users, since its users are approximately 1-2 people (us). |
Change https://golang.org/cl/166337 mentions this issue: |
I've created CL 166337 that implements the carving of If CL 162822 (adding a root go.mod to golang.org/x/net module) is rebased on top of it and updated, the x/net root go.mod file becomes just:
Before we can proceed, I'm waiting to make sure @matloob and @ianthehat are okay with the decision of creating a new |
I'd be okay with it, as long as we put in a replace directive in net pointing to the local h2demo. |
Do you mean a replace directive in h2demo, pointing to the local x/net? I can add that to CL 166337. Deciding on whether to commit a |
Alternatively, it may make more sense to add the root go.mod file first, and carve out h2demo into a separate module second. @matloob Thoughts on that? |
Sure, that's okay |
It would be interesting for those of us following along at home (:wave:) to know what is the effect you desire from this choice. Asking because I want to understand the thought processes and perhaps apply the same ideas elsewhere. |
The effect of having a It also means any local changes to the |
Change https://golang.org/cl/162822 mentions this issue: |
Change https://golang.org/cl/166857 mentions this issue: |
Now that a pseudo-version of golang.org/x/net with h2demo carved exists, we can depend on it. Add the dependency to h2demo's go.mod file. Updates golang/go#30685 Change-Id: I3dbb2493d97be381350881228025d27c7e8e8623 Reviewed-on: https://go-review.googlesource.com/c/net/+/166857 Run-TryBot: Michael Matloob <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]>
Change https://golang.org/cl/196036 mentions this issue: |
The build constraint is no longer useful. It doesn't prevent this package contributing module requirements to x/net, that was already resolved by carving h2demo into its own module in golang/go#30685. Few people do go get -u golang.org/x/net/... in GOPATH mode by now, so there's no need to optimize for avoiding polluting GOPATH/bin. Removing the build constraint allows the package to be visible and tested by trybots and builders. It's also simpler. Fixes golang/go#34361 Change-Id: I84b5d70aab210ca8e4f5494160ae4d9049ef08ad Reviewed-on: https://go-review.googlesource.com/c/net/+/196036 Run-TryBot: Dmitri Shuralyov <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]>
Change https://golang.org/cl/198917 mentions this issue: |
The build constraint is no longer useful. It doesn't prevent this package contributing module requirements to x/net, that was already resolved by carving h2demo into its own module in golang/go#30685. Few people do go get -u golang.org/x/net/... in GOPATH mode by now, so there's no need to optimize for avoiding polluting GOPATH/bin. Removing the build constraint allows the package to be visible and tested by trybots and builders. It's also simpler. Updates golang/go#34361 Change-Id: I84b5d70aab210ca8e4f5494160ae4d9049ef08ad Reviewed-on: https://go-review.googlesource.com/c/net/+/196036 Run-TryBot: Dmitri Shuralyov <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]> Reviewed-by: Brad Fitzpatrick <[email protected]> (cherry picked from commit a8b05e9) Reviewed-on: https://go-review.googlesource.com/c/net/+/198917
This change adds a go.mod and go.sum file to this repo, following the requirements stated in bcmills's comment here: https://golang.org/issue/28136#issuecomment-462971974. It's important to note that we will not be adding versions to the repo for now. This change also creates a new module with the module path golang.org/x/net/http2/h2demo, and moves the h2demo command into it. This is done by adding a go.mod file in the http2/h2demo directory. As a result, the h2demo command and its dependencies are removed from this and later pseudo-versions of the golang.org/x/net module. The change was generated using Go 1.12. Updates golang/go#28136 Fixes golang/go#30685 Change-Id: Ia5b0f6623c3374355b76106432190a0c9acf3d05 Reviewed-on: https://go-review.googlesource.com/c/net/+/162822 Run-TryBot: Michael Matloob <[email protected]> Reviewed-by: Dmitri Shuralyov <[email protected]> TryBot-Result: Gobot Gobot <[email protected]>
The golang.org/x/net module holds supplementary Go networking libraries. It currently requires 5 modules:
The
h2demo
package is single-handedly responsible for x/net requiringcloud.google.com/go
,go4.org
, andgolang.org/x/build
modules (it has a// +build h2demo
build constraint, but that doesn't have any effect when computing module requirements):https://github.com/golang/net/blob/16b79f2e4e95ea23b2bf9903c9809ff7b013ce85/http2/h2demo/h2demo.go#L31-L33
The x/net module should not be requiring x/build (and in turn, the world, due to #29935).
If the
h2demo
package is removed, the list of required modules in x/net becomes just:I see 2 possible paths to resolve this:
Based on the content of the h2demo directory and the fact it's a part of our infrastructure (i.e., it's the server powering http2.golang.org), I suggest we move h2demo to x/build. It can use the http2 package by requiring x/net module. @bradfitz How does that sound to to you?
/cc @bradfitz @matloob @bcmills
The text was updated successfully, but these errors were encountered: