-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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
go/build: regression in go 1.7rc1, cannot vendor golang.org/x/net/http2 #16333
Comments
I can reproduce. Thanks for the report. |
As far as I can tell this only fails when the directory is precisely |
I don't see a simple fix for the general problem. The go tool only wants to a single import path to denote a single package. I can fix it so that The only options I can see are to punt this to 1.8 as unfortunately broken in 1.7, or to move the @bradfitz Do you see anything else we can do? Any preferences? |
Another non-invasive partial* fix would be to relocate (* Agreed with @ianlancetaylor that the correct fix involves making the compiler aware that "vendor" and "internal" packages are workspace-specific.) |
CL https://golang.org/cl/24902 mentions this issue. |
@mdempsky, maybe I don't understand the issue enough, but that still scares me. What does the compiler see then for a user who imports it in their "src/vendor/golang.org/x/net/http2" and their code does |
@bradfitz If a user creates Because If it makes you feel more comfortable, we have |
I think it's likely a user would vendor I think the |
@bradfitz This causes issues, at least with gb. |
@YvanDaSilva, that is not a sufficiently complete bug report. What do you mean "When I fetch"? What did you run? Please file a new bug, in any case, since we tend to lose comments on closed bugs. You can reference this bug number in your new bug and they'll be cross-linked for bug archaeologists later. Be sure to copy @davecheney if it's a gb-specific bug. |
@bradfitz Sorry for that, gb vendor fetch is somehow equivalent to a go get. Concerning the command I executed it is : "gb vendor fetch -tag v1.3.0 k8s.io/kubernetes/pkg/api/v1" Note: Not sure I'll open an issue with this, because I don't have another package where I can test this with "go get" and provide you more output. |
@YvanDaSilva For me, it looks like gb's regex issue. You might want to open issue on gb repo to allow "_" in the regex below. CC: @davecheney |
Thank you, will definitively add this to the currently open issue on GB. |
Fixes #635 golang/go#16333 renamed $GOROOT/src/vendor/golang.org to $GOROOT/src/vendor/golang_org. This solved a nasty problem where code in GOROOT would shadow any other copy of the net/http2 library, but meant that gb vendor could no longer resolve the package and try to fetch it (even if that was pointless). To solve this, include $GOROOT/src/vendor in the set of search paths so that golang_org/net/http/... is always found (if present). I'll add a test for this in the integration test repo.
#640) * cmd/gb-vendor: search $GOROOT/src/vendor when resolving recursive deps Fixes #635 golang/go#16333 renamed $GOROOT/src/vendor/golang.org to $GOROOT/src/vendor/golang_org. This solved a nasty problem where code in GOROOT would shadow any other copy of the net/http2 library, but meant that gb vendor could no longer resolve the package and try to fetch it (even if that was pointless). To solve this, include $GOROOT/src/vendor in the set of search paths so that golang_org/net/http/... is always found (if present). I'll add a test for this in the integration test repo. * internal/vendor: handle missing depset roots $GOROOT/src/vendor does not exist in Go < 1.6
CL https://golang.org/cl/29086 mentions this issue. |
I've been doing this by hand since Go 1.7rc2. Updates golang/go#16333 Change-Id: Ib12c013b14210123d48d6ad78922caf1286c20cc Reviewed-on: https://go-review.googlesource.com/29086 Reviewed-by: Alan Donovan <[email protected]>
Please answer these questions before submitting your issue. Thanks!
go version
)?go 1.7rc1
go env
)?Put a copy of golang.org/x/net/http2 at $GOPATH/src/vendor/golang.org/x/net/http2
Try to build the following program using go build :
Everything was working fine using go 1.6
With go 1.7 I get :
package github.com/vanackere/bugs/vendoring17
imports golang.org/x/net/http2: use of vendored package not allowed
This bug appears at 0104a31 where golang.org/x/net/http2/hpack moves from internal to vendor
From a first look it appears that (*Context) Import is confused by this change and assumes that vendor/golang.org/x/net/http2 is a package located in GOROOT. I don't have a proper fix for the moment (still looking into it) but I believe that this bug should be fixed for go 1.7.
The text was updated successfully, but these errors were encountered: