lynaghk / c2

Declarative data visualization in Clojure(Script).
http://keminglabs.com/c2/
Other
643 stars 47 forks source link

C2 projects cannot compile with ClojureScript 2138 #47

Closed avescodes closed 10 years ago

avescodes commented 10 years ago

Hey Kevin.

I was integrating C2 into a work project and discovered that things don't seem to work with more recent versions of ClojureScript.

For example, if you upgrade the hello-bars demo then clean target/ and public/out/ you will find the project can no longer cljsbuild.

diff --git a/hello-bars/project.clj b/hello-bars/project.clj
index 90c8b76..a982bc5 100644
--- a/hello-bars/project.clj
+++ b/hello-bars/project.clj
@@ -1,9 +1,8 @@
 (defproject hello-bars "0.0.1-SNAPSHOT"
   :description "hello-bars: c2 at its simplest"
-  :dependencies [[org.clojure/clojure "1.4.0"]
+  :dependencies [[org.clojure/clojure "1.5.1"]
+                 [org.clojure/clojurescript "0.0-2138"]

Result:

Compiling "public/out/hello-bars.js" from "src/cljs"...
Compiling "public/out/hello-bars.js" failed:
clojure.lang.ExceptionInfo: failed compiling file:src/cljs/hello_bars/core.cljs
                 core.clj:4327 clojure.core/ex-info
             compiler.clj:1005 cljs.compiler/compile-file
             compiler.clj:1057 cljs.compiler/compile-root
# ...
Caused by: clojure.lang.ExceptionInfo: clojure.lang.Cons cannot be cast to clojure.lang.Named at line 109 file:/Users/ryan/.m2/repository/com/keminglabs/c2/0.2.1/c2-0.2.1.jar!/c2/dom.cljs
                 core.clj:4327 clojure.core/ex-info
              analyzer.clj:265 cljs.analyzer/error
             analyzer.clj:1414 cljs.analyzer/analyze-seq
             analyzer.clj:1505 cljs.analyzer/analyze[fn]
...

(Since there doesn't seem to be a 0.2.1 tag, I bumped to 0.2.2 and the line in question is dom.cljs#112)

It seems to be something to do with core.match. Can you make anything of this?

avescodes commented 10 years ago

It seems as if the core.match version c2 relies on is not compatible. Bumping to 0.2.0 or 0.2.1 (the most recent) fixes compilation in the above scenario, but causes three test failures. If I get time, I'll circle around to see if I can fix them.

FAIL "Tick search" at (t_ticks.clj:6)
Actual result did not agree with the checking function.
        Actual result: {:extent [-10.0 100], :max 100, :min -10.0, :ticks (-10.0 0.0 10.0 20.0 30.0 40.0 50.0 60.0 70.0 80.0 90.0 100.0)}
    Checking function: (contains {:extent [0 100], :max 100.0, :min 0, :step 10.0, :ticks [0 10.0 20.0 30.0 40.0 50.0 60.0 70.0 80.0 90.0 100.0]})
    The checker said this about the reason:
        Best match found: {}

FAIL "Clamped tick search" at (t_ticks.clj:12)
Actual result did not agree with the checking function.
        Actual result: {:extent [5.0 20], :max 20, :min 5.0, :ticks (5.0 10.0 15.0 20.0)}
    Checking function: (contains {:extent [5.0 20], :max 20.0, :min 5.0, :step 5.0, :ticks [5.0 10.0 15.0 20.0]})
    The checker said this about the reason:
        Best match found: {:extent [5.0 20], :min 5.0, :ticks (5.0 10.0 15.0 20.0)}

FAIL "Clamped tick search" at (t_ticks.clj:17)
Actual result did not agree with the checking function.
        Actual result: {:extent [5.5 20], :max 20, :min 5.5, :ticks (10.0 15.0 20.0)}
    Checking function: (contains {:extent [5.5 20], :max 20.0, :min 5.5, :step 5.0, :ticks [5.5 10.5 15.5]})
    The checker said this about the reason:
        Best match found: {:extent [5.5 20], :min 5.5}
FAILURE: 3 checks failed.  (But 52 succeeded.)
avescodes commented 10 years ago

Doh, 0.2.3 fixes this. My bad.