mietek / haskell-on-heroku

Buildpack for deploying Haskell apps
BSD 3-Clause "New" or "Revised" License
131 stars 16 forks source link

Compile fails with no config variables #46

Closed sardonicpresence closed 9 years ago

sardonicpresence commented 9 years ago

I attempted to run through the tutorial however upon first push I encounter the following:

remote: Building source: remote: remote: -----> Fetching custom git buildpack... done remote: -----> Haskell app detected remote: remote: remote: -----> Welcome to Haskell on Heroku remote: *\ ERROR: Failed to set config vars remote: remote: ! Push rejected, failed to compile Haskell app

Setting any config variable (I set Test=Test using the heroku web UI) works-around the issue and everything builds as expected.

mietek commented 9 years ago

Thanks. Can you provide a full log of your commands? I’m unable to reproduce this issue:

$ git clone -q https://github.com/mietek/haskell-on-heroku-tutorial
$ cd haskell-on-heroku-tutorial
$ heroku create -b https://github.com/mietek/haskell-on-heroku
Creating protected-hollows-7282... done, stack is cedar-14
BUILDPACK_URL=https://github.com/mietek/haskell-on-heroku
https://protected-hollows-7282.herokuapp.com/ | https://git.heroku.com/protected-hollows-7282.git
Git remote heroku added
updating...done. Updated to 3.26.1

$ git push -q heroku master
Compressing source files... done.
Building source:

-----> Fetching custom git buildpack... done
-----> Haskell app detected

-----> Welcome to Haskell on Heroku
       BUILDPACK_URL:                            https://github.com/mietek/haskell-on-heroku

-----> Installing buildpack... done, 5d07279
-----> Installing Halcyon... done, fd5fc7d
-----> Installing bashmenot... done, 5165edd
-----> Installing haskell-on-heroku-tutorial-1.0
       Label:                                    haskell-on-heroku-tutorial-1.0
       Prefix:                                   /app
       Source hash:                              a1f7195
       External storage:                         public
       GHC version:                              7.8.4

-----> Restoring install directory
       Downloading https://halcyon.global.ssl.fastly.net/linux-ubuntu-14.04-x86_64/ghc-7.8.4/halcyon-install-a1f7195-haskell-on-heroku-tutorial-1.0.tar.gz... done
       Extracting halcyon-install-a1f7195-haskell-on-heroku-tutorial-1.0.tar.gz... done, 8.8MB
-----> Installing app to /app
-----> Installed haskell-on-heroku-tutorial-1.0

-----> Examining cache changes
       + halcyon-install-a1f7195-haskell-on-heroku-tutorial-1.0.tar.gz

-----> App deployed:                             haskell-on-heroku-tutorial-1.0

       To see the app, spin up at least one web dyno:
       $ heroku ps:scale web=1
       $ heroku open

       To run GHCi, use a one-off dyno:
       $ heroku run bash
       ~ $ restore
       ~ $ cabal repl

-----> Discovering process types
       Procfile declares types -> web

-----> Compressing... done, 3.5MB
-----> Launching... done, v4
       https://protected-hollows-7282.herokuapp.com/ deployed to Heroku

Verifying deploy... done.
sardonicpresence commented 9 years ago

Certainly. Commands were executing from an msys bash shell on Windows 7 & my heroku account is a free account I had just created without changing any settings.

$ git --version
git version 1.9.5.msysgit.0
$ heroku version
heroku/toolbelt/3.26.1 (i386-mingw32) ruby/1.9.3
You have no installed plugins.
$ git clone -q https://github.com/mietek/haskell-on-heroku-tutorial
$ cd haskell-on-heroku-tutorial
$ heroku create -b https://github.com/mietek/haskell-on-heroku
Creating intense-meadow-1268... done, stack is cedar-14
Buildpack set. Next release on intense-meadow-1268 will use https://github.com/mietek/haskell-on-heroku.
https://intense-meadow-1268.herokuapp.com/ | https://git.heroku.com/intense-meadow-1268.git
Git remote heroku added

$ git push -q heroku master
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Fetching custom git buildpack... done
remote: -----> Haskell app detected
remote:
remote:
remote: -----> Welcome to Haskell on Heroku
remote:    *** ERROR: Failed to set config vars
remote:
remote:  !     Push rejected, failed to compile Haskell app
remote:
remote: Verifying deploy...
remote:
remote: !       Push rejected to intense-meadow-1268.
remote:
To https://git.heroku.com/intense-meadow-1268.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/intense-meadow-1268.git'
mietek commented 9 years ago

Well, this is quite odd. When you add a dummy config var, does BUILDPACK_URL appear when you push?

sardonicpresence commented 9 years ago

Nope, just the config var I added:

$ git push -q heroku master
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Fetching custom git buildpack... done
remote: -----> Haskell app detected
remote:
remote:
remote: -----> Welcome to Haskell on Heroku
remote:        Test:                                     Test
remote:
remote: -----> Installing buildpack... done, 5d07279
remote: -----> Installing Halcyon... done, fd5fc7d
remote: -----> Installing bashmenot... done, 5165edd
remote: -----> Installing haskell-on-heroku-tutorial-1.0
remote:        Label:                                    haskell-on-heroku-tutorial-1.0
remote:        Prefix:                                   /app
remote:        Source hash:                              a1f7195
remote:        External storage:                         public
remote:        GHC version:                              7.8.4
remote:
remote: -----> Restoring install directory
remote:        Downloading https://halcyon.global.ssl.fastly.net/linux-ubuntu-14.04-x86_64/ghc-7.8.4/halcyon-install-a1f7195-haskell-on-heroku-tutorial-1.0.tar.gz... done
remote:        Extracting halcyon-install-a1f7195-haskell-on-heroku-tutorial-1.0.tar.gz... done, 8.8MB
remote: -----> Installing app to /app
remote: -----> Installed haskell-on-heroku-tutorial-1.0
remote:
remote: -----> Examining cache changes
remote:        + halcyon-install-a1f7195-haskell-on-heroku-tutorial-1.0.tar.gz
remote:
remote: -----> App deployed:                             haskell-on-heroku-tutorial-1.0
remote:
remote:        To see the app, spin up at least one web dyno:
remote:        $ heroku ps:scale web=1
remote:        $ heroku open
remote:
remote:        To run GHCi, use a one-off dyno:
remote:        $ heroku run bash
remote:        ~ $ restore
remote:        ~ $ cabal repl
remote:
remote:
remote: -----> Discovering process types
remote:        Procfile declares types -> web
remote:
remote: -----> Compressing... done, 3.5MB
remote: -----> Launching... done, v4
remote:        https://intense-meadow-1268.herokuapp.com/ deployed to Heroku
remote:
remote: Verifying deploy... done.
mietek commented 9 years ago

What does heroku config say?

sardonicpresence commented 9 years ago

With the addition of the Test config var:

$ heroku config
=== intense-meadow-1268 Config Vars
Test: Test
sardonicpresence commented 9 years ago

I noticed that the result of heroku create on your log was quite different from mine and mentioned BUILDPACK_URL. Am I perhaps using a different heroku toolbelt version that doesn't setup that config var on app creation?

The absence of that var doesn't appear to negatively affect the build. Could the compile script perhaps just be tolerant to zero config vars?

sardonicpresence commented 9 years ago

Discovered the following at https://devcenter.heroku.com/articles/buildpacks, perhaps related?

Previously you could set a config var for BUILDPACK_URL, this value will still be used if set, though a buildpack value set through the CLI will take precedence. BUILDPACK_URL as a config var is now deprecated in favor of the buildpack value on the API and in the future will be migrated.

mietek commented 9 years ago

Very good. Thanks.

mietek commented 9 years ago

Fixed in e52a46e.