Heroku and lein-cljsbuild

546 views
Skip to first unread message

Timothy Licata

unread,
Mar 2, 2012, 3:31:51 AM3/2/12
to clo...@googlegroups.com
Hello all,

I'm having trouble getting clojurescript to compile with
lein-cljsbuild on heroku. It works locally through foreman and runs
fine on heroku other than the cljs compilation issue.

I've tried a few things. First of all, heroku doesn't put
:dev-dependencies on the classpath by default[1]. When I enable
LEIN_DEV, the :dev-dependencies are downloaded, but the app times out
while booting[2]. If I try moving lein-cljsbuild from :dev-depencies
to :plugins in my project.clj, heroku rejects my git push[3].

Anyone faring any better?

Thanks,
Tim


[1] app[web.1]: Warning: problem requiring leiningen.cljsbuild hook:
Could not locate leiningen/cljsbuild__init.class or
leiningen/cljsbuild.clj on classpath


[2] heroku config:add LEIN_DEV=y
...
heroku[web.1]: Starting process with command `lein run -m tl.core`
app[web.1]: Compiling ClojureScript.
... (downloads lots of dependencies. can't finish before timing out?) ...
heroku[web.1]: Error R10 (Boot timeout) -> Web process failed
to bind to $PORT within 60 seconds of launch


[3] heroku config:remove LEIN_DEV
...
Copying 4 files to /tmp/build_c47l93hhsxf4/.lein-plugins
exec: 1: -client: not found
! Failed to install dependencies with Leiningen
! Heroku push rejected, failed to compile Clojure app
! [remote rejected] sessions -> master (pre-receive hook declined)

Phil Hagelberg

unread,
Mar 5, 2012, 3:34:52 PM3/5/12
to clo...@googlegroups.com
Timothy Licata <timothy...@gmail.com> writes:

> I've tried a few things. First of all, heroku doesn't put
> :dev-dependencies on the classpath by default[1]. When I enable
> LEIN_DEV, the :dev-dependencies are downloaded, but the app times out
> while booting[2]. If I try moving lein-cljsbuild from :dev-depencies
> to :plugins in my project.clj, heroku rejects my git push[3].

It looks like there's a bug in the Heroku buildpack for Clojure where
JAVA_CMD isn't getting exported for when plugins are brought in. I've
pushed a fix and will deploy it soon, but in the mean time you can bring
it in with this command:

$ heroku config:add BUILDPACK_URL=git://github.com/heroku/heroku-buildpack-clojure.git

Thanks for catching this!

-Phil

Phil Hagelberg

unread,
Mar 5, 2012, 3:50:52 PM3/5/12
to clo...@googlegroups.com

Sorry, that wasn't too clear. Using :plugins is the correct approach here.

-Phil

Timothy Licata

unread,
Mar 6, 2012, 3:10:16 AM3/6/12
to clo...@googlegroups.com
On Mon, Mar 5, 2012 at 12:50 PM, Phil Hagelberg <ph...@hagelb.org> wrote:
> Sorry, that wasn't too clear. Using :plugins is the correct approach here.

Awesome, that works with the new buildpack. Thanks!

I also had to set up AOT compilation to avoid the boot timeout
mentioned in my original post.

$heroku config:add LEIN_BUILD_TASK="compile :all"

Thanks again,
Tim

Reply all
Reply to author
Forward
0 new messages