Skip to content

cmd/go: emit an explicit error when packages in GOPATH/src/vendor overlap with GOROOT/src/vendor #34068

Not planned
@javasgl

Description

@javasgl

What version of Go are you using (go version)?

$ go version
go version go1.13 darwin/amd64

Does this issue reproduce with the latest release?

only in go1.13 happened, back to go1.12.9 can fix this

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/username/Library/Caches/go-build"
GOENV="/Users/username/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH=""
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/b1/bhf9j3q96m75223l3hh41ccw0000gn/T/go-build173249759=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

go install -v ./...

What did you expect to see?

no errrors

What did you see instead?

src/vendor/golang.org/x/net/http2/frame.go:17:2: use of vendored package not allowed
src/vendor/google.golang.org/grpc/internal/transport/controlbuf.go:28:2: use of vendored package not allowed
src/vendor/golang.org/x/net/http2/transport.go:35:2: use of vendored package not allowed

Activity

changed the title [-]Breaking changes! use of vendored package not allowed[/-] [+]1.13 Breaking changes! use of vendored package not allowed[/+] on Sep 4, 2019
changed the title [-]1.13 Breaking changes! use of vendored package not allowed[/-] [+]go1.13 Breaking changes! use of vendored package not allowed[/+] on Sep 4, 2019
mvdan

mvdan commented on Sep 4, 2019

@mvdan
Member

Please provide full instructions to show that this worked on 1.12, and broke in 1.13. For example, using the official Docker images.

added
WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.
on Sep 4, 2019
changed the title [-]go1.13 Breaking changes! use of vendored package not allowed[/-] [+]cmd/go: "use of vendored package not allowed"[/+] on Sep 4, 2019
bcmills

bcmills commented on Sep 4, 2019

@bcmills
Contributor

@javasgl, to amplify what @mvdan said: go install -v ./... doesn't help us reproduce your problem unless you also include the contents of the module or repo that you were working in.

In particular, do the import statements in your code include the vendor/ prefix?

This change probably relates to CL 164619, but we did add a regression test in that CL to try to avoid any change in behavior for existing code using the correct import paths.

added
NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.
WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.
and removed
WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.
on Sep 4, 2019
added this to the Go1.14 milestone on Sep 4, 2019
psanford

psanford commented on Sep 4, 2019

@psanford

I think I ran into the same issue. I made an example repo here to demonstrate the issue: https://github.com/psanford/gobug34068

If you checkout that repo and set your GOPATH to the git working directory you can try building package example.com/foo from go 1.12 (works) vs 1.13 (errors). example.com/foo is a grpc client hello world example.

Grpc and its dependencies were vendored in src/vendor via gvt.

javasgl

javasgl commented on Sep 5, 2019

@javasgl
Author

@bcmills same project structure with @psanford

removed
WaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.
on Sep 5, 2019

39 remaining items

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GoCommandcmd/goNeedsFixThe path to resolution is known, but the work has not been done.modules

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @psanford@rsc@bronze1man@mvdan@ALTree

        Issue actions

          cmd/go: emit an explicit error when packages in GOPATH/src/vendor overlap with GOROOT/src/vendor · Issue #34068 · golang/go