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: 'go install' reports GOBIN not set when installing .go source file #28122

Open
nutmix opened this Issue Oct 10, 2018 · 3 comments

Comments

Projects
None yet
4 participants
@nutmix

nutmix commented Oct 10, 2018

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

go version go1.10.2 darwin/amd64

Does this issue reproduce with the latest release?

unknown.

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN="/Users/xxx/go/bin"
GOCACHE="/Users/xxx/Library/Caches/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/xxx/go"
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="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=/var/folders/hz/mqzhd2cj5cj48knw7wkywpnh0000gn/T/go-build293557160=/tmp/go-build -gno-record-gcc-switches -fno-common"

Above I have replaced my username with xxx

What did you do?

Very simple. I am trying to do "go install" on github.com/golang-migrate/migrate/migrate.go
My env vars are correctly exported (since years).

What I have trided:
$ cd ~/go/src/github.com/golang-migrate/migrate/
$ go install migrate.go
go install: no install location for .go files listed on command line (GOBIN not set)
$ echo $GOBIN
/Users/xxx/go/bin
$ ls $GOBIN
long list of installed go binaries.
$ echo $GOPATH
/Users/xxx/go
$ export GOBIN=$GOPATH/bin
$ echo $GOBIN
/Users/xxx/go/bin
$ go install migrate.go
go install: no install location for .go files listed on command line (GOBIN not set)

What did you expect to see?

Expected it to install migrate

What did you see instead?

go install: no install location for .go files listed on command line (GOBIN not set)
when GOBIN IS set, exported, exists, and has the correct ownership and permissions.

@bcmills bcmills changed the title from go install reports GOBIN not set when GOBIN and GOPATH are correctly set and exported. to cmd/go: 'go install' reports GOBIN not set when installing .go source file Oct 10, 2018

@gopherbot

This comment has been minimized.

gopherbot commented Oct 10, 2018

Change https://golang.org/cl/141337 mentions this issue: go/scanner: don't return token.INVALID for ".." sequence

Edit: Was incorrectly referenced because of typo in CL.

@nutmix

This comment has been minimized.

nutmix commented Oct 10, 2018

Is there a work around? i.e. a way to install go programs?

@hellozee

This comment has been minimized.

Contributor

hellozee commented Oct 19, 2018

go install github.com/golang-migrate/migrate works though, plus they provide a separate Makefile for the development purposes.

@bcmills bcmills added this to the Go1.13 milestone Nov 16, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment