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: go get fails when GOPATH dir is relative #11234

Closed
techtonik opened this issue Jun 16, 2015 · 7 comments
Closed

cmd/go: go get fails when GOPATH dir is relative #11234

techtonik opened this issue Jun 16, 2015 · 7 comments
Milestone

Comments

@techtonik
Copy link

When I specify GOPATH as relative to current dir, the go get command fails.

From https://github.com/syncthing/syncthing-cli/issues/12

$ mkdir .go
$ GOPATH=.go go get github.com/syncthing/syncthing-cli  
# github.com/AudriusButkevicius/cli
open .go/src/github.com/AudriusButkevicius/cli/app.go: No such file or directory
...
$ go version
go version go1.2.1 linux/amd64

I am using Ubuntu 14.04 packaged Go. http://packages.ubuntu.com/trusty/devel/golang-go

@bradfitz bradfitz changed the title go get fails when GOPATH dir is relative cmd/go: go get fails when GOPATH dir is relative Jun 16, 2015
@bradfitz
Copy link
Contributor

Instead of making relative paths work, we should probably just detect relative paths and fail earlier with a nice error.

@bradfitz bradfitz added this to the Go1.5Maybe milestone Jun 16, 2015
@bradfitz
Copy link
Contributor

/cc @robpike @rsc @adg for thoughts

@robpike
Copy link
Contributor

robpike commented Jun 16, 2015

Relative paths are dangerous when applied globally like this. I agree it should just be diagnosed.

@davecheney
Copy link
Contributor

Seconded.

On Wed, Jun 17, 2015 at 3:41 AM, Rob Pike notifications@github.com wrote:

Relative paths are dangerous when applied globally like this. I agree it
should just be diagnosed.


Reply to this email directly or view it on GitHub
#11234 (comment).

@adg
Copy link
Contributor

adg commented Jun 16, 2015

This was fixed by @broady in 239ec73. Note that the issue reporter's go version is 1.2.1.

@adg adg closed this as completed Jun 16, 2015
@mikioh mikioh modified the milestones: Go1.5, Go1.5Maybe Jun 17, 2015
@techtonik
Copy link
Author

I am +1 on detecting error case. Is it possible to backport it to stable Debian/Ubuntu?

@bradfitz
Copy link
Contributor

That is a question for Debian and/or Ubuntu, but not us. We don't do their packaging, nor do we maintain very old releases.

@golang golang locked and limited conversation to collaborators Jun 25, 2016
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

7 participants