Cannot find package "github.com/hashicorp/consul/command"

229 views
Skip to first unread message

David Tinker

unread,
Oct 11, 2016, 2:52:08 AM10/11/16
to Consul
I am trying to build consul from source and not having much luck. I haven't used go before so likely I am just making a noob mistake somewhere.

david@porker:~/consul$ git status
HEAD detached at v0.7.0

david@porker:~/consul$ env | grep GO
GOPATH=/Users/david/consul

david@porker:~/consul$ go version
go version go1.7.1 darwin/amd64

I installed go using the package for OS X. I am on Sierra.

david@porker:~/consul$ make
Parsing meta tags from https://golang.org/x/tools/cmd/cover?go-get=1 (status code 200)
get "golang.org/x/tools/cmd/cover": verifying non-authoritative meta tag
Parsing meta tags from https://golang.org/x/tools?go-get=1 (status code 200)
Parsing meta tags from https://golang.org/x/tools/cover?go-get=1 (status code 200)
get "golang.org/x/tools/cover": verifying non-authoritative meta tag
Parsing meta tags from https://golang.org/x/tools/cmd/stringer?go-get=1 (status code 200)
get "golang.org/x/tools/cmd/stringer": verifying non-authoritative meta tag
==> Removing old directory...
==> Building...
Number of parallel builds: 7

-->    darwin/amd64: _/Users/david/consul

1 errors occurred:
--> darwin/amd64 error: exit status 1
Stderr: commands.go:8:2: cannot find package "github.com/hashicorp/consul/command" in any of:
/usr/local/go/src/github.com/hashicorp/consul/command (from $GOROOT)
/Users/david/consul/src/github.com/hashicorp/consul/command (from $GOPATH)
commands.go:9:2: cannot find package "github.com/hashicorp/consul/command/agent" in any of:
/usr/local/go/src/github.com/hashicorp/consul/command/agent (from $GOROOT)
/Users/david/consul/src/github.com/hashicorp/consul/command/agent (from $GOPATH)
main.go:10:2: cannot find package "github.com/hashicorp/consul/lib" in any of:
/usr/local/go/src/github.com/hashicorp/consul/lib (from $GOROOT)
/Users/david/consul/src/github.com/hashicorp/consul/lib (from $GOPATH)

make: *** [all] Error 1

Any ideas?

kyle havlovitz

unread,
Oct 11, 2016, 1:06:48 PM10/11/16
to consu...@googlegroups.com
You don't want GOPATH to be the path to the repo here; if you set GOPATH=~/go and clone consul to ~/go/src/github.com/hashicorp/consul it should compile fine. Go expects a certain directory structure within the gopath when building (https://golang.org/doc/code.html#ImportPaths).

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/consul/issues
IRC: #consul on Freenode
---
You received this message because you are subscribed to the Google Groups "Consul" group.
To unsubscribe from this group and stop receiving emails from it, send an email to consul-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/consul-tool/51b3fdd0-7b04-42f9-a725-dc88c170d2e0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

David Tinker

unread,
Oct 11, 2016, 2:43:48 PM10/11/16
to consu...@googlegroups.com
That worked! Thanks. I should have RTFMed a bit more.

You received this message because you are subscribed to a topic in the Google Groups "Consul" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/consul-tool/RJLX3Eq3SmI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to consul-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/consul-tool/CALSeyB1eWreQ6EwqQ4g_Jn1dC16ARmkGeU-LkPFbTPGjPi7PQw%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages