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
Closed

x/vgo: GOPATH required #24064

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

Comments

@rogpeppe
Copy link
Contributor

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
Copy link
Contributor

rsc 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 as completed Mar 27, 2018
@rogpeppe
Copy link
Contributor Author

rogpeppe 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
Development

No branches or pull requests

3 participants