lynaghk / cljx

Write a portable codebase targeting Clojure/ClojureScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Break when upgrading from Cljx 0.4.0 to 0.6.0

ptaoussanis opened this issue · comments

Hi Chas,

Upgrading from Cljx 0.4.0 to 0.6.0 produces the following new error on lein check:

Exception in thread "main" java.lang.Exception: namespace 'cemerick.piggieback' not found, compiling:(cljx/repl_middleware.clj:1:1)
    at clojure.core$throw_if.doInvoke(core.clj:5572)
    at clojure.lang.RestFn.invoke(RestFn.java:442)
    at clojure.core$load_lib.doInvoke(core.clj:5658)
    at clojure.lang.RestFn.applyTo(RestFn.java:142)
    at clojure.core$apply.invoke(core.clj:628)
    at clojure.core$load_libs.doInvoke(core.clj:5691)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.core$apply.invoke(core.clj:628)
    at clojure.core$require.doInvoke(core.clj:5774)
    at clojure.lang.RestFn.invoke(RestFn.java:512)
    at cljx.repl_middleware$eval48740$loading__5295__auto____48741.invoke(repl_middleware.clj:1)

lein deps :tree shows that the correct deps are being pulled in:

 [com.keminglabs/cljx "0.6.0"]
   [com.cemerick/piggieback "0.1.5"]
   [net.cgrand/sjacket "0.1.1" :exclusions [[org.clojure/clojure]]]
     [net.cgrand/parsley "0.9.2"]
     [net.cgrand/regex "1.1.0"]
   [org.clojure/core.match "0.2.0"]
   [watchtower "0.1.1"]

I suspect that this is the breaking change you're referring to here, but I'm a little unclear from the description there what the problem / correct migration actually are.

My project.clj config:

  1. A top-level :dependencies entry: [com.keminglabs/cljx "0.6.0"] - since I'm using my own nrepl middleware stack which includes cljx.repl-middleware/wrap-cljx and needs to exist in production.
  2. A top-level :plugins entry: [com.keminglabs/cljx "0.6.0" :middleware false].
  3. A top-level :prep-tasks [["cljx" "once"] "javac" "compile"] entry.
  4. A top-level :cljx entry:
:cljx
{:builds
 [{:source-paths ["src" "test"] :rules :clj  :output-path  "target/classes"}
  {:source-paths ["src" "test"] :rules :cljs :output-path  "target/classes"}]}''

0.4.0 works fine with this config, 0.6.0 throws the piggieback exception. Would appreciate your input if you have any ideas?

Thanks a lot!

Cheers :-)

No the breakage in 0.6.0 was only if you were using custom rulesets (which no one is AFAIK). This would manifest in your using :rules your.ns/var-containing-custom-ruleset in your configuration.

That's a bizarre error. Any chance you're using trampoline? Is piggieback actually present in lein classpath?

I'm sorry, this was my fault. Error seems to occur only with older versions of ClojureScript. Bumping to the latest release has solved the issue.

For reference: was on 0.0-2505, bumping to 0.0-3126 solves. Guessing this is due to Piggieback's dependency on 0.0.2665+ mentioned here.

Thought I'd already tested newer Cljs versions.

Thanks for the quick response Chas, and sorry again for the noise! Cheers :-)

Oh yeah...so, piggieback wasn't found because its require of ClojureScript failed. Clojure sometimes doesn't percolate up the root cause of a transitive load failure, thus the confusion here.

Glad it worked out! At some point, I'd love to hear what bits you have in your custom nREPL stack, maybe on the clojure-tools list? ;-)

At some point, I'd love to hear what bits you have in your custom nREPL stack, maybe on the clojure-tools list? ;-)

Oh, nothing interesting. Just have an nrepl server embedded in production so that I can tunnel into servers for maintenance, etc.