specter

Latest version: 1.1.3
martinklepsch 2018-11-17T11:07:25.050600Z

are there any known issues with specter and CLJS? Getting the following when running cljs.analyzer on the specter code:

com/rpl/specter.cljc - root cause: clojure.lang.ExceptionInfo Unable to resolve var: coll? in this context at line 1449 specter/com/rpl/specter.cljc

nathanmarz 2018-11-17T15:10:58.051100Z

@martinklepsch there's currently this issue but I think it's unrelated https://github.com/nathanmarz/specter/issues/267

jsa-aerial 2018-11-17T16:05:49.054600Z

@martinklepsch Is cljdoc on using cljs later than 1.10.238? That is the version I am using and that code works just fine. I just checked and the current release is 1.10.439(!!) The one I'm using is only a few months old. Seems to be changing at a crazy rate. Let me see what happens if I try the newest version.

jsa-aerial 2018-11-17T16:21:57.057500Z

@nathanmarz @martinklepsch OK, somewhere along the line in those 201 new releases something has changed and causes regressions. Using the latest cljs the code compiles ok (no errors / warning and signals successful completion) but fails immediately when trying to run it with this:

jsa-aerial 2018-11-17T16:22:12.057800Z

#object[RangeError RangeError: Maximum call stack size exceeded]
   cljs.core/build-subvec (jar:file:/home/jsa/.m2/repository/org/clojure/clojurescript/1.10.439/clojurescript-1.10.439.jar!/cljs/core.cljs:5908:25)
   cljs$core$IWithMeta$_with_meta$arity$2 (jar:file:/home/jsa/.m2/repository/org/clojure/clojurescript/1.10.439/clojurescript-1.10.439.jar!/cljs/core.cljs:5793:28)
   cljs.core/-with-meta (jar:file:/home/jsa/.m2/repository/org/clojure/clojurescript/1.10.439/clojurescript-1.10.439.jar!/cljs/core.cljs:686:21)
   cljs.core/with-meta (jar:file:/home/jsa/.m2/repository/org/clojure/clojurescript/1.10.439/clojurescript-1.10.439.jar!/cljs/core.cljs:2059:8)
   cljs.core/vec (jar:file:/home/jsa/.m2/repository/org/clojure/clojurescript/1.10.439/clojurescript-1.10.439.jar!/cljs/core.cljs:5662:6)
   com$rpl$specter$impl$CoercePath$coerce_path$arity$1 (jar:file:/home/jsa/.m2/repository/com/rpl/specter/1.1.1/specter-1.1.1.jar!/com/rpl/specter/impl.cljc:180:27)
   com.rpl.specter.impl/coerce-path (jar:file:/home/jsa/.m2/repository/com/rpl/specter/1.1.1/specter-1.1.1.jar!/com/rpl/specter/impl.cljc:155:17)
   com$rpl$specter$impl$CoercePath$coerce_path$arity$1 (jar:file:/home/jsa/.m2/repository/com/rpl/specter/1.1.1/specter-1.1.1.jar!/com/rpl/specter/impl.cljc:180:14)
   com$rpl$specter$impl$coerce_path (jar:file:/home/jsa/.m2/repository/com/rpl/specter/1.1.1/specter-1.1.1.jar!/com/rpl/specter/impl.cljc:155:17)
aerial.hanami.core> 

jsa-aerial 2018-11-17T16:24:02.059Z

I think I will try a mini binary search to try to pin point in which release cljs was broken (or less likely, 'fixed' something that was broken but causes regressions)

jsa-aerial 2018-11-17T16:34:57.061400Z

OK, didn't take long. Despite a couple hundred point increments, the releases go from 1.10.439 to 1.10.339 as a first jump. 1.10.339 works fine. So, 1.10.439 is what is broken. It has a very large number of differences across 'changes', 'enhancements', and 'fixes'. So, it is not too surprising it went off the rails...

jsa-aerial 2018-11-17T16:41:55.062900Z

Just to finish, the actual releases go 1.10.238 -> 1.10.312 (a lot of 'fixes') -> 1.10.329 (a few 'fixes') -> 1.10.339 (just a transit-clj version bump) -> 1.10.439

jsa-aerial 2018-11-17T16:44:14.064600Z

Likely 'goats'/culprits: CLJS-2805: Bump tools.reader to 1.3.0, Align ClojureScript AST to tools.analyzer, CLJS-2442: set and vec performance enhancements. Those last two definitely smell bad given where the problems here are manifesting...

martinklepsch 2018-11-17T16:47:25.065100Z

@jsa-aerial that's very interesting, thanks for digging in

martinklepsch 2018-11-17T16:50:35.066700Z

I previously had another problem with the analyzer (turned out it was my fault) but I think if you could create a minimal repro how the analyzer fails with specter that would be very interesting to #cljs-dev

martinklepsch 2018-11-17T16:51:05.067400Z

☝️ you can take a look at this for how this could look

martinklepsch 2018-11-17T16:52:07.068300Z

the analyze-file call would need to be pointed at com/rpl/specter.cljc and you'd need to add specter to the :deps map.

martinklepsch 2018-11-17T16:57:33.068700Z

btw, I also get the coll? issue in 1.10.339

jsa-aerial 2018-11-17T17:03:46.072100Z

@martinklepsch just to be clear - I do not get any analyzer problem in my code with any of those releases. So, I can't make that repo. So, if it is still happening with 1.10.339 I would suggest going back further to try to isolate that. For me, the error happens at runtime and since it occurs in vec, I would guess those 'enhancements' to set and vec for performance are the problem.

jsa-aerial 2018-11-17T17:06:09.073800Z

@martinklepsch one other thing of note: I have another repo (Saite) which uses Hanami (the one causing cljdoc bogus analyzer error) which sails through cljdoc just fine. So, maybe there is something wrong in the way cljdoc sets up the analyzer for this?

jsa-aerial 2018-11-17T17:07:19.074700Z

To be clear: Both of those use the specter lib in question, and both use it in exactly the same way.

martinklepsch 2018-11-17T22:43:02.075300Z

Interesting, can you provide dependency coordinates for both of these projects so I can compare? 🙂

jsa-aerial 2018-11-18T18:37:33.075500Z

Not sure what 'dependency coordinates' means. Maybe the repo URLs?

jsa-aerial 2018-11-18T18:38:05.075700Z

https://github.com/jsa-aerial/hanami

jsa-aerial 2018-11-18T18:38:31.076Z

https://github.com/jsa-aerial/saite