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: ignore directories under goroot/src #3390

Closed
alberts opened this issue Mar 25, 2012 · 8 comments
Closed

cmd/go: ignore directories under goroot/src #3390

alberts opened this issue Mar 25, 2012 · 8 comments

Comments

@alberts
Copy link
Contributor

alberts commented Mar 25, 2012

What steps will reproduce the problem?

Make a tree with src/cmd/main.go:

$ cat src/cmd/main.go
package main
func main() {}

What is the expected output?

a command called cmd

What do you see instead?

GOPATH=/path/to/proj go list ./...
_/path/to/proj/src/cmd

GOPATH=/path/to/proj go install -v ./...
_/path/to/proj/src/cmd

this go install also doesn't actually install anything to the bin directory.

If you run go install -x you can see that it links an a.out but after that nothing
happens.

Which compiler are you using (5g, 6g, 8g, gccgo)?

6g

Which operating system are you using?

linux

Which revision are you using?  (hg identify)

go version weekly.2012-03-22 +ee5c7588cb7f

Please provide any additional information below.
@minux
Copy link
Member

minux commented Mar 25, 2012

Comment 1:

http://golang.org/cl/5905055/
cmd/go also doesn't like lib9, libbio, and libmach as cmd names.

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

Owner changed to @minux.

Status changed to Started.

@rsc
Copy link
Contributor

rsc commented Mar 26, 2012

Comment 2:

You cannot use 'cmd' as an import path,
just as you cannot use 'math'.  That's our name.
I don't believe the go command cares about lib9 etc though.
Russ

@alberts
Copy link
Contributor Author

alberts commented Mar 26, 2012

Comment 3:

Just to check, is it okay to use stuff under cmd? e.g. src/cmd/foo? Or is the whole
cmd/* reserved? If it is, an error might be better than having it mostly work.

@rsc
Copy link
Contributor

rsc commented Mar 26, 2012

Comment 4:

I believe cmd/* is reserved, just as math/* is reserved.
It does mostly work, and I don't want to change that,
but we are very clear everywhere we explain import paths
that if you want to avoid conflicts you need to use a
unique prefix.

@alberts
Copy link
Contributor Author

alberts commented Mar 26, 2012

Comment 5:

Okay, makes sense. Thanks. This is probably Retracted then.

@minux
Copy link
Member

minux commented Mar 26, 2012

Comment 6:

cmd/go doesn't care about lib9, but the relevant code in go/build does
(http://golang.org/cl/5905055/).
You can try writing a command named lib9 and install it using 'go install -x ./...'.

@rsc
Copy link
Contributor

rsc commented Mar 26, 2012

Comment 7:

Thanks for the lib9 fix.

Labels changed: added priority-later, removed priority-go1.

@rsc
Copy link
Contributor

rsc commented Mar 27, 2012

Comment 8:

This issue was closed by revision 6718627.

Status changed to Fixed.

@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