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
cmd/go: transient "unexpected directory layout" error #21057
Comments
I don't know, I've never seen this error before. The only similar issue I've found on GitHub was alecthomas/gometalinter#242 and that was reported with go1.8 already, but I don't know if it's the same problem. |
Aye aye, gotcha. Thanks for the update. I'll mark this as needing investigation and for Go1.10. |
I'm seeing this on go1.8.3
It's definitely transient, and occurs even with pristine and brand new GOPATHs |
I can't see how @tsuna's report can happen unless there are symlinks involved. (Symlinks are basically unsupported.) Somehow the package in his $GOPATH/src/github.com/fatih/color/vendor/github.com/mattn/go-colorable has been loaded as if its fully-qualified import path were only "github.com/mattn/go-colorable" when in fact it should be "github.com/fatih/color/vendor/github.com/mattn/go-colorable". The most likely culprit for this kind of confusion is symlinks. I cannot reproduce the problem right now, although it should of course not be transient in any way. I tried reproducing this with both Go 1.8 and Go 1.9, with no luck:
If anyone can send a set of commands to reproduce this with a specific version of Go, starting with an empty GOPATH directory and not using Docker, that would be great. @pbdeuchler since you didn't post any command output it's impossible to know whether you're really seeing the same problem @tsuna is or a different bug entirely. |
EDIT: I believe this is due to the way files are generated by go protobuf and not go itself. |
Sorry, you cannot use symlinks with the go tool, they break its concept of a single path to find a particular package.
… On 10 Dec 2017, at 10:11, Francis Chuang ***@***.***> wrote:
I believe I am seeing the same issue with symlinks using Go 1.10-beta1 (was fine in Go 1.9.2).
In my case, my project is copied into /source in the docker golang:1.10-rc-alpine image.
I then symlink the directory to /go/src/github.com/user/someproject.
This is the output when I try to run go test -v $(go list ./... | grep -v /vendor/)t:
unexpected directory layout:
import path: _/go/src/github.com/user/project/cockroachdb/cockroachdbpb
root: /go/src
dir: /go/src/github.com/user/project/cockroachdb/cockroachdbpb
expand root: /go/src
expand dir: /source/cockroachdb/cockroachdbpb
separator: /
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
Timed out in state WaitingForInfo. Closing. (I am just a bot, though. Please speak up if this is a mistake or you have the requested information.) |
What version of Go are you using (
go version
)?go version go1.9beta2 darwin/amd64
What operating system and processor architecture are you using (
go env
)?What did you do?
While trying to update a package:
What did you expect to see?
go get
should've either failed consistently or succeeded from the first time.What did you see instead?
A transient and somewhat confusing "unexpected directory layout" error.
The text was updated successfully, but these errors were encountered: