Heroku instructions no longer works on go 1.5

Issue #55 open
Shuhao created an issue

When you try to import the cmd package with _ prefixed, you'll get an error message like this:

can't load package: /home/shuhao/go/src/gitlab.com/shuhao/towncrier/install_goose.go:3:8: import "bitbucket.org/liamstask/goose/cmd/goose" is a program, not an importable package
godep: go exit status 1

Is there another way of installing the goose binary during heroku buildpacks?

Comments (5)

  1. Parker M
    • changed status to open

    Thanks for the bug report. I'm unfortunately not sure how to resolve this. We'll leave this open for now.

  2. Peter Li

    Copy the cmd/goose package into a subdirectory in your main application, then in Heroku you can run goose normally with 'heroku run goose -env production up'

  3. Rodrigo Pavano

    @peter_li I tried what you suggested, but the locally compile version of the goose executable doesn't run on Heroku. I get the following error:

    $ heroku run bin/goose -env production up Running bin/goose -env production up on massaga-production... up, run.8075 bash: bin/goose: cannot execute binary file: Exec format error

  4. Eric Gravert

    Hi all, With the change to heroku's go build pack, you can now install goose from your vendor directory if you are using govendor for dependency management.

    In the heroku.install section of the vendor.json file, just add the path to goose as one of the build targets and you are gtg.

    For example, here is what my vendor.json file looks like now:

        "heroku": {
            "goVersion": "go1.7",
            "install": [
                ".",
          "bitbucket.org/liamstask/goose/cmd/goose"
            ]
        },
    
  5. Schnouki

    Hi all. I'm using glide, so I had to to it a little bit differently.

    I created a file named deps.go with the following content:

    // Use a phony build constraint to force glide into keeping some dependencies
    // +build glide_deps
    
    package main
    
    import (
            _ "bitbucket.org/liamstask/goose/cmd/goose"
    )
    

    The build tag is never used, so that the build never fails, but when glide parses the files during a glide update it still detects the dependency and keeps it in glide.lock and in the vendor dir.

    Then on Heroku I set the GO_INSTALL_PACKAGE_SPEC environment variable for my project to myapp myapp/vendor/bitbucket.org/liamstask/goose/cmd/goose. This way, both my app and goose get build when I deploy.

  6. Log in to comment