dirac

Dirac v1.7.2 is out: https://github.com/binaryage/dirac/releases/tag/v1.7.2
frank 2016-01-28T15:47:38.000123Z

does anything special need to be done to upgrade to 0.1.2?

frank 2016-01-28T15:47:42.000124Z

my code no longer compiles šŸ˜•

2016-01-28T15:48:14.000125Z

Iā€™m not aware of anything

frank 2016-01-28T15:48:21.000126Z

actually

frank 2016-01-28T15:48:27.000127Z

0.1.1 doesn't work for me either

2016-01-28T15:50:06.000128Z

just what I wrote into release notes, you donā€™t have to specify all deps dirac needs, they are bundled in the jar

2016-01-28T15:50:16.000129Z

but that was the case since beginning

frank 2016-01-28T15:54:17.000130Z

removing the dependencies didn't help šŸ˜•

frank 2016-01-28T15:54:33.000131Z

23:54:06 figwheel.1 | Exception in thread "main" java.lang.NoClassDefFoundError: clojure/lang/Tuple, compiling:(cljs/repl.cljc:1:1)
23:54:06 figwheel.1 | 	at clojure.lang.Compiler.load(Compiler.java:7239)
23:54:06 figwheel.1 | 	at clojure.lang.RT.loadResourceScript(RT.java:371)
23:54:06 figwheel.1 | 	at clojure.lang.RT.loadResourceScript(RT.java:362)
23:54:06 figwheel.1 | 	at clojure.lang.RT.load(RT.java:446)
23:54:06 figwheel.1 | 	at clojure.lang.RT.load(RT.java:412)
23:54:06 figwheel.1 | 	at clojure.core$load$fn__5448.invoke(core.clj:5866)
23:54:06 figwheel.1 | 	at clojure.core$load.doInvoke(core.clj:5865)
23:54:06 figwheel.1 | 	at clojure.lang.RestFn.invoke(RestFn.java:408)
23:54:06 figwheel.1 | 	at clojure.core$load_one.invoke(core.clj:5671)
23:54:06 figwheel.1 | 	at clojure.core$load_lib$fn__5397.invoke(core.clj:5711)
23:54:06 figwheel.1 | 	at clojure.core$load_lib.doInvoke(core.clj:5710)
23:54:06 figwheel.1 | 	at clojure.lang.RestFn.applyTo(RestFn.java:142)
23:54:06 figwheel.1 | 	at clojure.core$apply.invoke(core.clj:632)
23:54:06 figwheel.1 | 	at clojure.core$load_libs.doInvoke(core.clj:5749)
23:54:06 figwheel.1 | 	at clojure.lang.RestFn.applyTo(RestFn.java:137)
23:54:06 figwheel.1 | 	at clojure.core$apply.invoke(core.clj:632)
23:54:06 figwheel.1 | 	at clojure.core$require.doInvoke(core.clj:5832)
23:54:06 figwheel.1 | 	at clojure.lang.RestFn.invoke(RestFn.java:3204)
23:54:06 figwheel.1 | 	at figwheel_sidecar.repl$eval9$loading__5340__auto____10.invoke(repl.clj:1)
23:54:06 figwheel.1 | 	at figwheel_sidecar.repl$eval9.invoke(repl.clj:1)
23:54:06 figwheel.1 | 	at clojure.lang.Compiler.eval(Compiler.java:6782)
23:54:06 figwheel.1 | 	at clojure.lang.Compiler.eval(Compiler.java:6771)
23:54:06 figwheel.1 | 	at clojure.lang.Compiler.load(Compiler.java:7227)
...

frank 2016-01-28T15:54:57.000133Z

I realize it says figwheel, but this doesn't happen on dirac 0.1.0

2016-01-28T15:55:21.000135Z

did you upgrade to the latest figwheel? with that dependency fix I linked?

2016-01-28T15:55:52.000136Z

also make sure you donā€™t have mixed Clojure 1.7 and 1.8 deps, that Tuple thing could be confusion between clojure versions

frank 2016-01-28T15:56:36.000137Z

does 0.1.2 require clojure 1.8?

2016-01-28T15:56:55.000138Z

yes, I think

2016-01-28T15:57:28.000139Z

yes, it has scope ā€œprovidedā€

2016-01-28T15:58:24.000142Z

I wonder why you are having problems with figwheel_sidecar, do you include dirac agent in your figwheel repl?

frank 2016-01-28T15:59:21.000143Z

I don't think so

2016-01-28T16:00:15.000144Z

where does that figwheel_sidecar come from? this is not dirac agent, is it your code?

frank 2016-01-28T16:01:29.000145Z

oh sorry

frank 2016-01-28T16:01:47.000146Z

this is me trying to compile the code with the lein figwheel command

frank 2016-01-28T16:02:05.000147Z

anyhow, it looks like upgrading to clojure 1.8 solved the problem

frank 2016-01-28T16:02:24.000148Z

although I'm not sure if I can safely upgrade the clojure version on the project šŸ˜ž

2016-01-28T16:02:55.000149Z

dirac has scope ā€œprovidedā€ so it should inherit your clojure version, if specified

2016-01-28T16:03:14.000150Z

try lein deps :tree

2016-01-28T16:03:33.000151Z

and see who is depending on what and what version wins

frank 2016-01-28T16:13:54.000152Z

I don't see clojure 1.8 anywhere in the output šŸ˜•

frank 2016-01-28T16:15:01.000153Z

not sure what this bit of the output means:

[org.clojure/clojure "1.7.0" :exclusions [[org.clojure/clojurescript] [org.clojure/clojure]]]

frank 2016-01-28T16:20:37.000155Z

looking at the history, I'm inclined to believe that the clojure version change is causing this

frank 2016-01-28T16:20:56.000156Z

since that change was made between 0.1.0 and 0.1.1

frank 2016-01-28T16:21:02.000157Z

which is the same point where this is breaking for me šŸ˜ž

2016-01-28T16:21:55.000159Z

ok, where you include dirac, try to put org.clojure/clojure into :exclusions

2016-01-28T16:22:17.000160Z

so you donā€™t bring diracā€™s clojure and you use your own

frank 2016-01-28T16:23:20.000161Z

I seem to be able to reproduce this on the demo project when I change the clojure version to 1.7.0 as well

frank 2016-01-28T16:23:35.000162Z

I tried putting org.clojure/clojure into exclusions but that didn't seem to work šŸ˜ž

2016-01-28T16:23:59.000163Z

ok, Iā€™m going to try it here

2016-01-28T16:24:03.000164Z

on the demo project

šŸ‘ 1
jaen 2016-01-28T16:35:39.000165Z

@frank: a shot in the dark, but are you sure you have the appropriate Chrome plugin version?

jaen 2016-01-28T16:36:15.000166Z

When I updated dirac to 0.1.2 but I forgot about plugin the REPL was hanging on connect and I later noticed NPEs in logs.

jaen 2016-01-28T16:37:03.000167Z

Also Tuple? I thought it had been rejected.

frank 2016-01-28T16:37:40.000168Z

I haven't had the chance to test the chrome plugin yet since upgrading

frank 2016-01-28T16:37:56.000170Z

still at the point where I'm trying to compile the cljs

2016-01-28T16:38:19.000171Z

Iā€™m able to reproduce it here

frank 2016-01-28T16:40:42.000172Z

ah ok good to know I'm not crazy :simple_smile:

2016-01-28T16:50:19.000173Z

how the hell can I figure out what is introducing a dependency displayed in lein deps :tree

jaen 2016-01-28T16:51:22.000174Z

Doesn't what's it child of introduce it? Though it's been a while since I've used lein deps tree

2016-01-28T16:55:37.000175Z

I think this has to do something with how dirac bundles all deps into ā€œuberjarā€ althought I never told lein to do that

2016-01-28T16:56:13.000176Z

it looks the code is AOTed wiht Clojure 1.8 or something and it crashes when included into environment with Clojure 1.7 (my theory)(

2016-01-28T16:56:42.000177Z

I will try to prepare a new release with dirac sources only, didnā€™t have energy yesterday to investigate this

2016-01-28T16:57:18.000178Z

I used lein jar and lein deploy clojars which works just fine in my other projects

2016-01-28T17:02:10.000179Z

ok, the problem is caused by https://github.com/binaryage/dirac/blob/master/project.clj#L26

2016-01-28T17:02:35.000181Z

that :main causes bundling all dependencies and AOTing them inside dirac.jar

2016-01-28T17:04:15.000182Z

that is why 0.1.0 worked for your @frank, and 0.1.1 does not

2016-01-28T17:04:31.000183Z

Iā€™m going to cut a new release without all the crap,

frank 2016-01-28T17:05:36.000184Z

ah I see

2016-01-28T17:06:16.000185Z

I did spot the huge jar files size of 0.1.2, but I compared it only to 0.1.1, not to 0.1.0 - otherwise I would spot the difference

frank 2016-01-28T17:13:23.000186Z

looking forward to it!

2016-01-28T17:14:11.000187Z

just pushed it to clojars, bump dirac version to 0.1.3 and it should work

2016-01-28T17:14:14.000188Z

(testing)

2016-01-28T17:20:50.000189Z

works for me in the demo project with both 1.7 and 1.8

2016-01-28T17:21:23.000190Z

now when I think about it more, it makes sense, AOTed code is probably fragile (I can imagine, Iā€™m not a java guy)

2016-01-28T17:22:18.000191Z

a side note: in the demo I noticed something it bringing in dependency [org.clojure/tools.nrepl ā€œ0.2.10ā€], lein deps :tree does not tell me who

2016-01-28T17:22:51.000192Z

there is newer version 0.2.12 (referenced by dirac) but that 0.2.10 wins for some reason

2016-01-28T17:25:13.000193Z

btw. @jaen yesterday I almost switched to boot, because of inconsistency how lein deals with ā€œcheckoutsā€ dependencies, I needed to read my project version during runtime and it is non-trivial task to achieve, and impossible when you want to use checkouts dependencies

2016-01-28T17:27:08.000194Z

but then I realized rewriting all my project.clj files would take me several hours, maybe days with learning boot, so I decided to do it dirty way: have version in multiple places and use some bash scripts to keep them in sync: https://github.com/binaryage/dirac/blob/master/scripts/update-versions.sh

jaen 2016-01-28T17:27:59.000196Z

Hah, I think it's for example what Clojurescript does as well - just has a script to update versions when building.

jaen 2016-01-28T17:28:51.000197Z

But yeah, rewriting the project file into a boot build script might have taken a while, but if you feel compelled to try it now, then Modern Cljs series is a really good introduction.

2016-01-28T17:29:57.000198Z

I will switch eventually. bootā€™s design is great.

2016-01-28T17:31:44.000199Z

also I like how they deal with ā€œcheckouts depsā€ feature, you can watch dependency project and continuously install it into local maven repo on every change, other boot watch task can trigger rebuild when that dependency changes

2016-01-28T17:32:00.000200Z

this way you get exact behaviour like it would be installed by hand or from clojars

2016-01-28T17:32:25.000201Z

not some ā€œemulationā€ by parsing dependenciesā€™ project.clj files like lein does

jaen 2016-01-28T17:44:07.000203Z

I think they are not 100% satisfied with that, since I remember some talk about making checkout deps better, but not sure what's the plan exactly.