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

x/vgo: GOPATH required #24064

Closed
rogpeppe opened this issue Feb 23, 2018 · 2 comments

Comments

@rogpeppe
Copy link
Contributor

commented Feb 23, 2018

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

go version devel +104445e Wed Feb 7 19:22:09 2018 +0000 linux/amd64 vgo:2018-02-20.1

What did you do?

unset GOPATH
vgo build

What did you expect to see?

I expected it to build. AIUI, vgo should not need GOPATH set.

What did you see instead?

% vgo build
missing $GOPATH

@gopherbot gopherbot added this to the vgo milestone Feb 23, 2018

@rsc

This comment has been minimized.

Copy link
Contributor

commented Mar 27, 2018

This is working as intended. A $GOPATH is needed to hold the cache. You must have unset not just GOPATH but also HOME, or else the default GOPATH=$HOME/go would have kicked in.

@rsc rsc closed this Mar 27, 2018

@rogpeppe

This comment has been minimized.

Copy link
Contributor Author

commented Apr 3, 2018

For the record, I did not unset $HOME too, although it's quite possible I've got some other environment variable that causes the default value to fail.

$ echo $HOME
/home/rog
$ vgo version
go version devel +3c16934 Tue Mar 13 05:03:31 2018 +0000 linux/amd64 vgo:2018-02-20.1
$ vgo build tst.go
$ unset GOPATH
$ vgo build tst.go
missing $GOPATH
$ vgo env
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/rog/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH=""
GORACE=""
GOROOT="/home/rog/go"
GOTMPDIR=""
GOTOOLDIR="/home/rog/go/pkg/tool/linux_amd64"
GCCGO="/usr/bin/gccgo"
CC="clang"
CXX="clang++"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build278954061=/tmp/go-build -gno-record-gcc-switches"
VGOMODROOT=""
$ go build tst.go
$ 
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.