lynaghk / cljx

Write a portable codebase targeting Clojure/ClojureScript
Other
398 stars 34 forks source link

0.5.0 fails to run cljx in sequence of prep tasks #60

Closed sritchie closed 9 years ago

sritchie commented 9 years ago

I run my builds with the following in my uberjar profile:

:prep-tasks ^:replace [["clean"]
                                              ["cljx" "once"]
                                              ["cljsbuild" "clean"]
                                              ["cljsbuild" "once" "prod"]
                                              ["javac"]
                                              ["compile" ":all"]]

With cljx 0.4.0 and Leiningen 2.5.0, this works great. When I upgrade to cljx 0.5.0, the cljsbuild task starts running before cljx, causing a compilation failure and crashing the process. Moving cljx after cljsbuild doesn't help.

If I remove all tasks except for cljx, it works.

Any ideas on what might have changed here?

sritchie commented 9 years ago

Sorry, submitted without a description. Adding now.

cemerick commented 9 years ago

No, no idea, that's bizarre. 0.5.0 was a very incremental release over 0.4.0; the only thing related to :prep-tasks was the elimination of cljx's hooks in https://github.com/lynaghk/cljx/commit/5a6feb7395cf6541589d77b6356a6151fb592693 because due to their semi-deprecation given :prep-tasks.

Haven't tried to repro yet, will do so.

anibali commented 9 years ago

I believe that I'm experiencing the same issue (though I'm new to Clojure in general so I may be way off base).

With version 0.4.0 :prep-tasks [["cljx" "once"] "javac" "compile"] works perfectly fine. With 0.5.0 cljx seems to not run because I get a "java.io.FileNotFoundException: target/generated/cljs" (which is my output dir for cljx ClojureScript).

viesti commented 9 years ago

I ran into this too, here's some debug:

0% lein clean && DEBUG=1 lein uberjar && java -jar target/lupapiste-toj.jar
Leiningen's classpath: /Users/kimmoko/.lein/self-installs/leiningen-2.5.1-standalone.jar
Applying task uberjar to []
(true and target/cljs/public/main.js.map have a type mismatch merging profiles.)
Applying task clean to nil
Applying task cljx to (once)
Applying task clean to nil
Applying task cljsbuild to (once)
Compiling ClojureScript.

It's interesting that cljx task seems to get called (Applying task cljx to (once) in the log above) but somehow it doesn't do anything.

sritchie commented 9 years ago

Still running into this one. Any thoughts, @cemerick?

sritchie commented 9 years ago

I'm seeing this on Leiningen 2.5.1.

I got around this for now by moving the clean and cljx tasks out of the prep-tasks vector and making an alias:

:aliases {"uberjar" ["do" "clean," "cljx" "once," "uberjar"]}
lbradstreet commented 9 years ago

Thanks Chas. This one was a pain for me too.

cemerick commented 9 years ago

I've drastically simplified cljx's "lifecycle" w.r.t. leiningen task execution (no more eval-in-project). This means that anyone that was crazy enough to have their own transformation functions and rulesets (!) needs to now make sure they're added as a :plugin dependency. I'm not aware of anyone that's actually doing this, but this is technically a breaking change.

Available in [org.clojars.cemerick/cljx "0.6.0-SNAPSHOT"] until the final 0.6.0 release is cut. Confirmations of the fix are appreciated.

anibali commented 9 years ago

Works for me, thanks

lbradstreet commented 9 years ago

Fixed for me too.