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

vendor: go install -pkgdir <dir> fails with vendored packages #18703

Open
stevenh opened this issue Jan 18, 2017 · 3 comments
Open

vendor: go install -pkgdir <dir> fails with vendored packages #18703

stevenh opened this issue Jan 18, 2017 · 3 comments
Milestone

Comments

@stevenh
Copy link
Contributor

stevenh commented Jan 18, 2017

When running go install with -pkgdir <directory> it fails if the package includes a vendored package.
e.g.

git clone git@github.com:stevenh/golang-pkgdir-test.git
cd golang-pkgdir-test/cmd/test
go install -pkgdir pkgs

This fails with:

# github.com/stevenh/golang-pkgdir-test/pkg1
../../pkg1/test.go:4: can't find import: "github.com/stevenh/golang-pkgdir-test/vendor/golang.org/x/net/context"

go version 1.7.3

GOBIN="/data/go/bin"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="freebsd"
GOOS="freebsd"
GOPATH="/data/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/freebsd_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build318285652=/tmp/go-build -gno-record-gcc-switches"
CXX="clang++"
CGO_ENABLED="1"```


@bradfitz bradfitz changed the title go install -pkgdir <dir> fails with vendored packages vendor: go install -pkgdir <dir> fails with vendored packages Jan 19, 2017
@bradfitz bradfitz added this to the Unplanned milestone Jan 19, 2017
@DirtyHairy
Copy link

DirtyHairy commented Aug 14, 2017

Is there anything planned on this issue? This keeps us from using go install together with -pkgdir to create static and cross builds without messing with the installed standard library 😏 We are now using go build for each binary as a workaround.

@prateekgogia
Copy link

Workaround is if you pass in the absolute path to -pkgdir flag it works.
I will send a PR shortly for the fix for this.

@gopherbot
Copy link

Change https://golang.org/cl/58613 mentions this issue: cmd/go/internal/work: Fixes -pkgdir for install command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants