Conflict with spec
Closed this issue · 5 comments
Including [org.clojure/spec.alpha "0.1.143"] as a :dependency in a project using the new tracing feature of 10x causes clojurescript compile to fail with an error like the one appended. So far only observed in apps that include electron, as yet to determine if this relevant.
I have a basic app at https://github.com/soulflyer/electron-re-frame-example which demos this effect. Uncommenting the spec dependency and doing a lein clean; lein decjop-once causes the failure for me. Note that this is in the call-api branch where there is a little more code to actually try out the tracing on.
Here is the rather long error trace from the command line clojurescript compile:
(call-api) electron-re-frame-example: lein clean
(call-api) electron-re-frame-example: lein descjop-once
Compiling ClojureScript...
Compiling "app/dev/js/cljsbuild-main.js" from ["src"]...
Successfully compiled "app/dev/js/cljsbuild-main.js" in 22.358 seconds.
Compiling ClojureScript...
Compiling "app/dev/js/front.js" from ["src_front" "src_front_profile/setup_front/dev"]...
Compiling "app/dev/js/front.js" failed.
clojure.lang.ExceptionInfo: failed compiling file:app/dev/js/out_front/day8/re_frame/tracing.cljc {:file #object[java.io.File 0x770cf7e6 "app/dev/js/out_front/day8/re_frame/tracing.cljc"]}
at clojure.core$ex_info.invokeStatic(core.clj:4617)
at clojure.core$ex_info.invoke(core.clj:4617)
at cljs.compiler$compile_file$fn__4383.invoke(compiler.cljc:1567)
at cljs.compiler$compile_file.invokeStatic(compiler.cljc:1528)
at cljs.compiler$compile_file.invoke(compiler.cljc:1504)
at cljs.closure$compile_file.invokeStatic(closure.clj:558)
at cljs.closure$compile_file.invoke(closure.clj:549)
at cljs.closure$eval6487$fn__6488.invoke(closure.clj:627)
at cljs.closure$eval6423$fn__6424$G__6412__6431.invoke(closure.clj:511)
at cljs.closure$compile_from_jar.invokeStatic(closure.clj:609)
at cljs.closure$compile_from_jar.invoke(closure.clj:597)
at cljs.closure$eval6493$fn__6494.invoke(closure.clj:637)
at cljs.closure$eval6423$fn__6424$G__6412__6431.invoke(closure.clj:511)
at cljs.closure$compile_sources$iter__6611__6615$fn__6616.invoke(closure.clj:972)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.Cons.next(Cons.java:39)
at clojure.lang.RT.next(RT.java:688)
at clojure.core$next__4341.invokeStatic(core.clj:64)
at clojure.core$dorun.invokeStatic(core.clj:3033)
at clojure.core$doall.invokeStatic(core.clj:3039)
at clojure.core$doall.invoke(core.clj:3039)
at cljs.closure$compile_sources.invokeStatic(closure.clj:968)
at cljs.closure$compile_sources.invoke(closure.clj:957)
at cljs.closure$build.invokeStatic(closure.clj:2757)
at cljs.closure$build.invoke(closure.clj:2663)
at cljs.build.api$build.invokeStatic(api.clj:205)
at cljs.build.api$build.invoke(api.clj:189)
at cljs.build.api$build.invokeStatic(api.clj:192)
at cljs.build.api$build.invoke(api.clj:189)
at cljsbuild.compiler$compile_cljs$fn__7441.invoke(compiler.clj:60)
at cljsbuild.compiler$compile_cljs.invokeStatic(compiler.clj:59)
at cljsbuild.compiler$compile_cljs.invoke(compiler.clj:48)
at cljsbuild.compiler$run_compiler.invokeStatic(compiler.clj:168)
at cljsbuild.compiler$run_compiler.invoke(compiler.clj:122)
at user$eval7578$iter__7614__7618$fn__7619$fn__7637.invoke(form-init3588566648707863894.clj:1)
at user$eval7578$iter__7614__7618$fn__7619.invoke(form-init3588566648707863894.clj:1)
at clojure.lang.LazySeq.sval(LazySeq.java:40)
at clojure.lang.LazySeq.seq(LazySeq.java:49)
at clojure.lang.RT.seq(RT.java:521)
at clojure.core$seq__4357.invokeStatic(core.clj:137)
at clojure.core$dorun.invokeStatic(core.clj:3024)
at clojure.core$doall.invokeStatic(core.clj:3039)
at clojure.core$doall.invoke(core.clj:3039)
at user$eval7578.invokeStatic(form-init3588566648707863894.clj:1)
at user$eval7578.invoke(form-init3588566648707863894.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6927)
at clojure.lang.Compiler.eval(Compiler.java:6917)
at clojure.lang.Compiler.load(Compiler.java:7379)
at clojure.lang.Compiler.loadFile(Compiler.java:7317)
at clojure.main$load_script.invokeStatic(main.clj:275)
at clojure.main$init_opt.invokeStatic(main.clj:277)
at clojure.main$init_opt.invoke(main.clj:277)
at clojure.main$initialize.invokeStatic(main.clj:308)
at clojure.main$null_opt.invokeStatic(main.clj:342)
at clojure.main$null_opt.invoke(main.clj:339)
at clojure.main$main.invokeStatic(main.clj:421)
at clojure.main$main.doInvoke(main.clj:384)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:383)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Caused by: clojure.lang.ExceptionInfo: java.lang.ExceptionInInitializerError, compiling:(debux/common/macro_specs.cljc:1:1) in file app/dev/js/out_front/day8/re_frame/tracing.cljc {:tag :cljs/analysis-error}
at clojure.core$ex_info.invokeStatic(core.clj:4617)
at clojure.core$ex_info.invoke(core.clj:4617)
at cljs.analyzer$error.invokeStatic(analyzer.cljc:697)
at cljs.analyzer$error.invoke(analyzer.cljc:693)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3619)
at cljs.analyzer$analyze.invoke(analyzer.cljc:3605)
at cljs.compiler$emit_source.invokeStatic(compiler.cljc:1391)
at cljs.compiler$emit_source.invoke(compiler.cljc:1370)
at cljs.compiler$compile_file_STAR_$fn__4352.invoke(compiler.cljc:1471)
at cljs.compiler$with_core_cljs.invokeStatic(compiler.cljc:1285)
at cljs.compiler$with_core_cljs.invoke(compiler.cljc:1274)
at cljs.compiler$compile_file_STAR_.invokeStatic(compiler.cljc:1456)
at cljs.compiler$compile_file_STAR_.invoke(compiler.cljc:1449)
at cljs.compiler$compile_file$fn__4383.invoke(compiler.cljc:1553)
... 60 more
Caused by: java.lang.ExceptionInInitializerError, compiling:(debux/common/macro_specs.cljc:1:1)
at clojure.lang.Compiler.load(Compiler.java:7391)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.loadResourceScript(RT.java:363)
at clojure.lang.RT.load(RT.java:453)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5677.invoke(core.clj:5893)
at clojure.core$load.invokeStatic(core.clj:5892)
at clojure.core$load.doInvoke(core.clj:5876)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5697)
at clojure.core$load_one.invoke(core.clj:5692)
at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
at clojure.core$load_lib.invokeStatic(core.clj:5736)
at clojure.core$load_lib.doInvoke(core.clj:5717)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$load_libs.invokeStatic(core.clj:5774)
at clojure.core$load_libs.doInvoke(core.clj:5758)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$require.invokeStatic(core.clj:5796)
at clojure.core$require.doInvoke(core.clj:5796)
at clojure.lang.RestFn.invoke(RestFn.java:619)
at debux.dbgn$eval21330$loading__5569__auto____21331.invoke(dbgn.clj:1)
at debux.dbgn$eval21330.invokeStatic(dbgn.clj:1)
at debux.dbgn$eval21330.invoke(dbgn.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6927)
at clojure.lang.Compiler.eval(Compiler.java:6916)
at clojure.lang.Compiler.load(Compiler.java:7379)
at clojure.lang.RT.loadResourceScript(RT.java:372)
at clojure.lang.RT.loadResourceScript(RT.java:363)
at clojure.lang.RT.load(RT.java:453)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5677.invoke(core.clj:5893)
at clojure.core$load.invokeStatic(core.clj:5892)
at clojure.core$load.doInvoke(core.clj:5876)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5697)
at clojure.core$load_one.invoke(core.clj:5692)
at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
at clojure.core$load_lib.invokeStatic(core.clj:5736)
at clojure.core$load_lib.doInvoke(core.clj:5717)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$load_libs.invokeStatic(core.clj:5774)
at clojure.core$load_libs.doInvoke(core.clj:5758)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$require.invokeStatic(core.clj:5796)
at clojure.core$require.doInvoke(core.clj:5796)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at cljs.analyzer$ns_side_effects$fn__3151.invoke(analyzer.cljc:3502)
at cljs.analyzer$ns_side_effects.invokeStatic(analyzer.cljc:3501)
at cljs.analyzer$ns_side_effects.invoke(analyzer.cljc:3473)
at cljs.analyzer$analyze_STAR_$fn__3204.invoke(analyzer.cljc:3598)
at clojure.lang.PersistentVector.reduce(PersistentVector.java:341)
at clojure.core$reduce.invokeStatic(core.clj:6544)
at clojure.core$reduce.invoke(core.clj:6527)
at cljs.analyzer$analyze_STAR_.invokeStatic(analyzer.cljc:3598)
at cljs.analyzer$analyze_STAR_.invoke(analyzer.cljc:3588)
at cljs.analyzer$analyze.invokeStatic(analyzer.cljc:3622)
... 69 more
Caused by: java.lang.ExceptionInInitializerError
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at clojure.lang.RT.classForName(RT.java:2168)
at clojure.lang.RT.classForName(RT.java:2177)
at clojure.lang.RT.loadClassForName(RT.java:2196)
at clojure.lang.RT.load(RT.java:443)
at clojure.lang.RT.load(RT.java:419)
at clojure.core$load$fn__5677.invoke(core.clj:5893)
at clojure.core$load.invokeStatic(core.clj:5892)
at clojure.core$load.doInvoke(core.clj:5876)
at clojure.lang.RestFn.invoke(RestFn.java:408)
at clojure.core$load_one.invokeStatic(core.clj:5697)
at clojure.core$load_one.invoke(core.clj:5692)
at clojure.core$load_lib$fn__5626.invoke(core.clj:5737)
at clojure.core$load_lib.invokeStatic(core.clj:5736)
at clojure.core$load_lib.doInvoke(core.clj:5717)
at clojure.lang.RestFn.applyTo(RestFn.java:142)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$load_libs.invokeStatic(core.clj:5774)
at clojure.core$load_libs.doInvoke(core.clj:5758)
at clojure.lang.RestFn.applyTo(RestFn.java:137)
at clojure.core$apply.invokeStatic(core.clj:648)
at clojure.core$require.invokeStatic(core.clj:5796)
at clojure.core$require.doInvoke(core.clj:5796)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at debux.common.macro_specs$eval21338$loading__5569__auto____21339.invoke(macro_specs.cljc:1)
at debux.common.macro_specs$eval21338.invokeStatic(macro_specs.cljc:1)
at debux.common.macro_specs$eval21338.invoke(macro_specs.cljc:1)
at clojure.lang.Compiler.eval(Compiler.java:6927)
at clojure.lang.Compiler.eval(Compiler.java:6916)
at clojure.lang.Compiler.load(Compiler.java:7379)
... 129 more
Caused by: java.lang.IllegalStateException: Attempting to call unbound fn: #'clojure.core/ident?
at clojure.lang.Var$Unbound.throwArity(Var.java:43)
at clojure.lang.AFn.invoke(AFn.java:32)
at clojure.spec.alpha$spec_impl.invokeStatic(alpha.clj:867)
at clojure.spec.alpha$spec_impl.invoke(alpha.clj:860)
at clojure.spec.alpha__init.load(Unknown Source)
at clojure.spec.alpha__init.<clinit>(Unknown Source)
... 160 more
Subprocess failed
(call-api) electron-re-frame-example:
If you want to use that version of spec, you’ll need to also update Clojure to 1.9.0, as it includes many changes for spec, including the ident?
function. Can you try updating Clojure and let me know if you still have this issue?
Well, the command line clojurescript build works now, but then I get a failure on trying to start the repl.
error in process sentinel: Could not start nREPL server: Compiling ClojureScript... Error loading cider.nrepl.middleware.test: java.lang.RuntimeException: Invalid token: ::clojure.test/once-fixtures, compiling:(cider/nrepl/middleware/test.clj:129:57) WARNING: boolean? already refers to: #’clojure.core/boolean? in namespace: mranderson047.toolsanalyzerjvm.v0v6v9.toolsanalyzer.v0v6v7.clojure.tools.analyzer.utils, being replaced by: #’mranderson047.toolsanalyzerjvm.v0v6v9.toolsanalyzer.v0v6v7.clojure.tools.analyzer.utils/boolean? WARNING: boolean? already refers to: #’clojure.core/boolean? in namespace: mranderson047.toolsanalyzerjvm.v0v6v9.toolsanalyzer.v0v6v7.clojure.tools.analyzer, being replaced by: #’mranderson047.toolsanalyzerjvm.v0v6v9.toolsanalyzer.v0v6v7.clojure.tools.analyzer.utils/boolean? Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: cider.nrepl.middleware.test/wrap-test in this context, compiling:(/private/var/folders/8z/fnlgpwg91ml91_fsljwj9x0h0000gn/T/form-init7688658203147163722.clj:1:8568) at clojure.lang.Compiler.analyzeSeq(Compiler.java:7010) at clojure.lang.Compiler.analyze(Compiler.java:6773) at clojure.lang.Compiler.analyze(Compiler.java:6729) at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3881) at clojure.lang.Compiler.analyzeSeq(Compiler.java:7005) at clojure.lang.Compiler.analyze(Compiler.java:6773) at clojure.lang.Compiler.analyze(Compiler.java:6729) at clojure.lang.Compiler$InvokeExpr.parse(Compiler.java:3881) at clojure.lang.Compiler.analyzeSeq(Compiler.java:7005) at clojure.lang.Compiler.analyze(Compiler.java:6773) at clojure.lang.Compiler.access$300(Compiler.java:38) at clojure.lang.Compiler$LetExpr$Parser.parse(Compiler.java:6368) at clojure.lang.Compiler.analyzeSeq(Compiler.java:7003) at clojure.lang.Compiler.analyze(Compiler.java:6773) at clojure.lang.Compiler.analyze(Compiler.java:6729) at clojure.lang.Compiler$BodyExpr$Parser.parse(Compiler.java:6100) at clojure.lang.Compiler$FnMethod.parse(Compiler.java:5460) at clojure.lang.Compiler$FnExpr.parse(Compiler.java:4022) at clojure.lang.Compiler.analyzeSeq(Compiler.java:7001) at clojure.lang.Compiler.analyze(Compiler.java:6773) at clojure.lang.Compiler.eval(Compiler.java:7059) at clojure.lang.Compiler.eval(Compiler.java:7052) at clojure.lang.Compiler.load(Compiler.java:7514) at clojure.lang.Compiler.loadFile(Compiler.java:7452) at clojure.main$load_script.invokeStatic(main.clj:278) at clojure.main$init_opt.invokeStatic(main.clj:280) at clojure.main$init_opt.invoke(main.clj:280) at clojure.main$initialize.invokeStatic(main.clj:311) at clojure.main$null_opt.invokeStatic(main.clj:345) at clojure.main$null_opt.invoke(main.clj:342) at clojure.main$main.invokeStatic(main.clj:424) at clojure.main$main.doInvoke(main.clj:387) at clojure.lang.RestFn.applyTo(RestFn.java:137) at clojure.lang.Var.applyTo(Var.java:702) at clojure.main.main(main.java:37) Caused by: java.lang.RuntimeException: Unable to resolve var: cider.nrepl.middleware.test/wrap-test in this context at clojure.lang.Util.runtimeException(Util.java:221) at clojure.lang.Compiler$TheVarExpr$Parser.parse(Compiler.java:720) at clojure.lang.Compiler.analyzeSeq(Compiler.java:7003) ... 34 more Subprocess failed
I'm thinking this is probably not an issue with 10x at all. Probably just incorrect set up for spec..
Looks like an outdated version of Cider to me? Btw, if you wrap your code blocks in triple backticks, they are easier to read in the GitHub UI: ```
.
Will close for now, but come back if it turns out to be an issue with 10x. Thanks!