Skip to content
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: unexpected directory layout while building project #33752

Closed
scrumteamravens opened this issue Aug 21, 2019 · 4 comments
Closed

cmd/go: unexpected directory layout while building project #33752

scrumteamravens opened this issue Aug 21, 2019 · 4 comments
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.

Comments

@scrumteamravens
Copy link

    unexpected directory layout:
    	import path: github.com/gruntwork-io/terratest/modules/helm
    	root: /home/vagrant/go/src
    	dir: /home/vagrant/go/src/k8stests/vendor/github.com/gruntwork-io/terratest/modules/helm
    	expand root: /home/vagrant/go/src
    	expand dir: /home/vagrant/go/src/k8stests/vendor/github.com/gruntwork-io/terratest/modules/helm
    	separator: /

Can you please help me on where i am going wrong here.

$ go env

    GOARCH="amd64"
    GOBIN=""
    GOCACHE="/home/vagrant/.cache/go-build"
    GOEXE=""
    GOHOSTARCH="amd64"
    GOHOSTOS="linux"
    GOOS="linux"
    GOPATH="/home/vagrant/go:/home/vagrant/go/src/k8stests"
    GORACE=""
    GOROOT="/usr/lib/go-1.10"
    GOTMPDIR=""
    GOTOOLDIR="/usr/lib/go-1.10/pkg/tool/linux_amd64"
    GCCGO="gccgo"
    CC="gcc"
    CXX="g++"
    CGO_ENABLED="1"
    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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build737322677=/tmp/go-build -gno-record-gcc-switches"

go version go1.10.4 linux/amd64

@smasher164 smasher164 changed the title unexpected directory layout while building project. cmd/go: unexpected directory layout while building project Aug 21, 2019
@smasher164
Copy link
Member

Can you provide the exact commands you ran to fetch and build this package?

@smasher164 smasher164 added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Aug 21, 2019
@scrumteamravens
Copy link
Author

in the project root directory /home/vagrant/go/src/k8stests
go build ...

@agnivade
Copy link
Contributor

Since you are using Go 1.10, you need to do everything according to the GOPATH. First of all, you have an incorrect GOPATH setting. There is no need to append /home/vagrant/go/src/k8stests to /home/vagrant/go. Just /home/vagrant/go is fine. And secondly, clone your repo under the correct path. If you are building github.com/gruntwork-io/terratest, create that folder structure under home/vagrant/go/src and then clone the repo there and build it.

Please see this answer - https://stackoverflow.com/questions/45428744/golang-unexpected-directory-layout.

I will go ahead and close this since this is not a bug. If this still does not solve your issue please feel free to ask it in any of these forums below:

Thanks

@scrumteamravens
Copy link
Author

@agnivade Its working fine if i pull the dependency using "go get" but as soon as i move to godep to resolve dependency it pulls everything in vendor folder but while building my project it shows " unexpected directory layout" . Not sure where i went wrong.
As per your suggestion i changed the GOPATH to "/home/vagrant/go" still no luck.

@golang golang locked and limited conversation to collaborators Aug 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

4 participants