On Tue, Mar 19, 2013 at 3:05 PM, Carlos Castillo <
cook...@gmail.com> wrote:
> I suspect this is what is going on with the heroku system.
We don't have to speculate. :)
The the Go Heroku buildpack is this shell script:
https://github.com/kr/heroku-buildpack-go/blob/master/bin/compile
> To be nicer to
> it's users, it downloads all packages and attempts to build every potential
> package in the repositories it downloads (go get ./...), but since that can
> easily lead to errors in packages that are pulled in as part of poorly
> designed repositories, the build can easily fail.
Note, this command tries to run in the root of the git repo for the app
being pushed to Heroku. That command should cause go to fetch
and install all packages contained in the Heroku app's repo, as
well as their explicitly named dependencies, but not necessarily
all packages contained in the repos of the dependencies.
> The following, which suggested by the output is what heroku does instead,
> does not succeed because of the "broken" examples in log4go:
>
> cd $GOPATH/src ; go get -x ./...
In this example, the equivalent of the buildpack's behavior is meant
to be:
cd $GOPATH/src/foo ; go get ./...
However, the buildpack relies on a file called .godir to know the
name of this directory. If that file contains something other than
the relative path from $GOPATH/src to the app's root, the buildpack
will do something wrong.
Ollie Castle: can you share the contents of file .godir in your repo?
Also, can you tell us the path on your local system where you're
successfully building the package?
I'd welcome any suggestions from the community on how better
to solve the problem of naming the package being built. The existing
design, .godir, has proven to be error-prone.
Some possible improvements:
- Sanity checking the contents of .godir. In addition to ensuring the
file exists, also make sure it's not empty, contains at least one
path component other than '.', etc.
- Have the buildpack print out the directory where it runs go get.
Other thoughts?