CF cli switching to godep

52 views
Skip to first unread message

tjar...@pivotallabs.com

unread,
May 6, 2014, 5:06:57 PM5/6/14
to vcap...@cloudfoundry.org
Hey all,

Just wanted to briefly announce that the cf cli has switched from git submodules to godep for managing our dependencies. We've updated the instructions in our README for cloning the repository and getting started developing. The main impetus for this change was to match the other teams writing Go that have already switched to using godep. We believe that there is a lot of value in having our projects use similar conventions and style.

Please let us know if you think we missed anything. 

Cheers,

       The cf cli team
{{Tim, Anand and David}}

Mike Youngstrom

unread,
May 6, 2014, 6:15:50 PM5/6/14
to vcap...@cloudfoundry.org
Thanks for the heads up.


To unsubscribe from this group and stop receiving emails from it, send an email to vcap-dev+u...@cloudfoundry.org.

Ben Hale

unread,
May 7, 2014, 4:45:44 AM5/7/14
to vcap...@cloudfoundry.org
I just had a go at building from source and encountered the following problem:

bhale-desktop master: bin/build


Generating Binary...
main
/main.go:11:2: cannot find package "github.com/cloudfoundry/cli/cf" in any of:
 
/usr/local/Cellar/go/1.2.1/libexec/src/pkg/github.com/cloudfoundry/cli/cf (from $GOROOT)
 
/Users/bhale/dev/sources/cloudfoundry/cli/Godeps/_workspace/src/github.com/cloudfoundry/cli/cf (from $GOPATH)
 
/Users/bhale/dev/go/src/github.com/cloudfoundry/cli/cf
main
/main.go:12:2: cannot find package "github.com/cloudfoundry/cli/cf/api" in any of:
 
/usr/local/Cellar/go/1.2.1/libexec/src/pkg/github.com/cloudfoundry/cli/cf/api (from $GOROOT)
 
/Users/bhale/dev/sources/cloudfoundry/cli/Godeps/_workspace/src/github.com/cloudfoundry/cli/cf/api (from $GOPATH)
 
/Users/bhale/dev/go/src/github.com/cloudfoundry/cli/cf/api
main
/main.go:13:2: cannot find package "github.com/cloudfoundry/cli/cf/app" in any of:
 
/usr/local/Cellar/go/1.2.1/libexec/src/pkg/github.com/cloudfoundry/cli/cf/app (from $GOROOT)
 
/Users/bhale/dev/sources/cloudfoundry/cli/Godeps/_workspace/src/github.com/cloudfoundry/cli/cf/app (from $GOPATH)
 
/Users/bhale/dev/go/src/github.com/cloudfoundry/cli/cf/app
main
/main.go:14:2: cannot find package "github.com/cloudfoundry/cli/cf/command_factory" in any of:
 
/usr/local/Cellar/go/1.2.1/libexec/src/pkg/github.com/cloudfoundry/cli/cf/command_factory (from $GOROOT)
 
/Users/bhale/dev/sources/cloudfoundry/cli/Godeps/_workspace/src/github.com/cloudfoundry/cli/cf/command_factory (from $GOPATH)
 
/Users/bhale/dev/go/src/github.com/cloudfoundry/cli/cf/command_factory
main
/main.go:15:2: cannot find package "github.com/cloudfoundry/cli/cf/command_runner" in any of:
 
/usr/local/Cellar/go/1.2.1/libexec/src/pkg/github.com/cloudfoundry/cli/cf/command_runner (from $GOROOT)
 
/Users/bhale/dev/sources/cloudfoundry/cli/Godeps/_workspace/src/github.com/cloudfoundry/cli/cf/command_runner (from $GOPATH)
 
/Users/bhale/dev/go/src/github.com/cloudfoundry/cli/cf/command_runner
main
/main.go:16:2: cannot find package "github.com/cloudfoundry/cli/cf/configuration" in any of:
 
/usr/local/Cellar/go/1.2.1/libexec/src/pkg/github.com/cloudfoundry/cli/cf/configuration (from $GOROOT)
 
/Users/bhale/dev/sources/cloudfoundry/cli/Godeps/_workspace/src/github.com/cloudfoundry/cli/cf/configuration (from $GOPATH)
 
/Users/bhale/dev/go/src/github.com/cloudfoundry/cli/cf/configuration
main
/main.go:17:2: cannot find package "github.com/cloudfoundry/cli/cf/manifest" in any of:
 
/usr/local/Cellar/go/1.2.1/libexec/src/pkg/github.com/cloudfoundry/cli/cf/manifest (from $GOROOT)
 
/Users/bhale/dev/sources/cloudfoundry/cli/Godeps/_workspace/src/github.com/cloudfoundry/cli/cf/manifest (from $GOPATH)
 
/Users/bhale/dev/go/src/github.com/cloudfoundry/cli/cf/manifest
main
/main.go:18:2: cannot find package "github.com/cloudfoundry/cli/cf/net" in any of:
 
/usr/local/Cellar/go/1.2.1/libexec/src/pkg/github.com/cloudfoundry/cli/cf/net (from $GOROOT)
 
/Users/bhale/dev/sources/cloudfoundry/cli/Godeps/_workspace/src/github.com/cloudfoundry/cli/cf/net (from $GOPATH)
 
/Users/bhale/dev/go/src/github.com/cloudfoundry/cli/cf/net
main
/main.go:19:2: cannot find package "github.com/cloudfoundry/cli/cf/requirements" in any of:
 
/usr/local/Cellar/go/1.2.1/libexec/src/pkg/github.com/cloudfoundry/cli/cf/requirements (from $GOROOT)
 
/Users/bhale/dev/sources/cloudfoundry/cli/Godeps/_workspace/src/github.com/cloudfoundry/cli/cf/requirements (from $GOPATH)
 
/Users/bhale/dev/go/src/github.com/cloudfoundry/cli/cf/requirements
main
/main.go:20:2: cannot find package "github.com/cloudfoundry/cli/cf/terminal" in any of:
 
/usr/local/Cellar/go/1.2.1/libexec/src/pkg/github.com/cloudfoundry/cli/cf/terminal (from $GOROOT)
 
/Users/bhale/dev/sources/cloudfoundry/cli/Godeps/_workspace/src/github.com/cloudfoundry/cli/cf/terminal (from $GOPATH)
 
/Users/bhale/dev/go/src/github.com/cloudfoundry/cli/cf/terminal

Granted I'm a novice, but it appears that the build cannot find the actual cf cli code itself.  You can see that it looks for terminal there at the end which is located in <REPO-ROOT>/cf/terminal but that's not on the search path.  I've started with a clean clone and followed the cloning and building instructions so if the problem is on my end, we need to beef up the instructions a bit.


-Ben Hale
Cloud Foundry Java Experience

Michael Fraenkel

unread,
May 8, 2014, 8:31:47 AM5/8/14
to vcap...@cloudfoundry.org
There are a few issues at play here.

1. The CLI is now assuming you have placed it in a proper Go workspace.
  go_code/src/github.com/cloudfoundry/cli   <--- CLI cloned here
A "go get github.com/cloudfoundry/cli" will place it in the right location for you if your GOPATH is set.

2. It seems ./bin/test is the only script currently that is relying on godeps.
Hence the reason why ./bin/build, ./bin/run will not work.
A temporary fix is to adjust your GOPATH with
GOPATH=$GOPATH:`godep path`

My path looks like:
/Users/...../go:/Users/..../go/src/github.com/cloudfoundry/cli/Godeps/_workspace


Tim Jarratt

unread,
May 9, 2014, 12:04:59 PM5/9/14
to vcap...@cloudfoundry.org
Thank you, Ben, for fixing those instructions.

I think Michael is helping me to realize that we should be instructing would-be contributors to use 'go get github.com/cloudfoundry/cli' rather than encouraging them to use 'git clone'. Fetching the project this way includes the git history, so it should be easy to submit changes upstream, or fork it. The added advantage of 'go get' is that it encourages users to already have their $GOPATH configured.

We've also fixed up 'bin/build' and 'bin/run' per Michael's comments.

Ben Hale

unread,
May 9, 2014, 12:10:38 PM5/9/14
to vcap...@cloudfoundry.org, tjar...@pivotallabs.com
I think Michael is helping me to realize that we should be instructing would-be contributors to use 'go get github.com/cloudfoundry/cli' rather than encouraging them to use 'git clone'. Fetching the project this way includes the git history, so it should be easy to submit changes upstream, or fork it. The added advantage of 'go get' is that it encourages users to already have their $GOPATH configured.

Well, beyond having $GOPATH configured, it ensures that the clone happens in the location that go expects it to be located at.

As a side note, because of the strict requirements around where the code is checked out, the Homebrew formula now has to do a horrible move into the proper location.  Not the end of the world, just indicative of a tool that isn't particularly flexible.


-Ben

Tim Jarratt

unread,
May 9, 2014, 12:48:51 PM5/9/14
to Ben Hale, vcap...@cloudfoundry.org
We hadn't considered the cost of switching to Godep would have on maintaining the Homebrew formulas... that is truly painful indeed.
Reply all
Reply to author
Forward
0 new messages