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: document "go install" and "go get" can only be run on packages inside a valid root #5396

Closed
tianon opened this issue May 2, 2013 · 6 comments

Comments

@tianon
Copy link
Contributor

tianon commented May 2, 2013

What steps will reproduce the problem?
1. install go1.1rc1
2. setup GOPATH nicely
3. create directory of code outside GOPATH (ie, GOPATH=/home/user/go and directory is
/home/user/some-project) -- make sure it contains some remote dependencies
4. enter directory and type "go get" to download dependencies prior to
"go build"


What is the expected output?
With go1.0.3, the behavior was as described by "go help gopath", in that
"go get" downloaded all dependencies of the project in the current directory
to the first directory in $GOPATH.


What do you see instead?
With go1.1rc1, "go get" now errors out with "go install: no install
location for directory /home/user/some-project outside GOPATH".


To be clear, I am not necessarily taking issue with the new behavior, but do believe it
should be noted in the go1.1 migration document and with more clear language in one of
"go help gopath" and/or "go help get".

Also, the previous behavior was very convenient, so if there is an easy workaround for
go1.1 (assuming this new behavior is intended) short of moving the code into some part
of GOPATH (which would require more strict structure), I'd love to hear about it.

Of course, as always and should be expected, I am happy to provide any further
clarification or information necessary or possible.
@tianon
Copy link
Contributor Author

tianon commented May 2, 2013

Comment 1:

It's also worth noting that "go build" inside /home/user/some-project in my example
works correctly if the necessary dependencies are already downloaded somewhere within
the GOPATH, as one would expect. :)

@davecheney
Copy link
Contributor

Comment 2:

I will document this change. I cannot promise that it will make it into Go 1.1

Owner changed to @davecheney.

Status changed to Accepted.

@davecheney
Copy link
Contributor

Comment 3:

Labels changed: added priority-soon, removed priority-triage.

@davecheney
Copy link
Contributor

Comment 4:

https://golang.org/cl/9145045/

Status changed to Started.

@adg
Copy link
Contributor

adg commented May 3, 2013

Comment 5:

Dave, your change addresses the release notes, but I think this is really a deficiency
in the go tool's internal docs.

@davecheney
Copy link
Contributor

Comment 8:

Based on the comments on 9145045, I'm going to mark this WorkingAsIntended. I understand
that rsc has a patch to improve one aspect of the error message which will probably land
before 1.1

Owner changed to ---.

Status changed to WorkingAsIntended.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
This issue was closed.
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

4 participants