How to debug project.clj to find which dependency is breaking my project compilation

1.1k Views Asked by At

I have just updated my system from Java 8 to the OpenJDK Java 11 version. I have one project that won't compile and I get the following error:

Java.lang.IllegalArgumentException: Must hint overloaded method: 
toArray, compiling:(flatland/ordered/set.clj:19:1)
Exception in thread "main" java.lang.IllegalArgumentException: Must 
hint overloaded method: toArray, compiling: 
(flatland/ordered/set.clj:19:1)

From the looks of it, this error was fixed here: https://dev.clojure.org/jira/browse/CLJ-2374

So I update my project to clojure 1.10.0-RC3 and now I get this error:

Syntax error compiling deftype* at (flatland/ordered/set.clj:19:1).
Exception in thread "main" Syntax error compiling deftype* at 
(flatland/ordered/set.clj:19:1).

Has anyone seen this error OR is there a way for me to expand Clojure's error messages to show me which dependency in my project is failing during compilation (could be multiple)?

I also noticed that I copied over the dependency list which was failing in my first project to a new project and the new project compiled. However, I didn't reference the dependencies or call functions from the deps list. Does Clojure bring in the dependencies/libraries and then reference the required dependencies from the libraries that are included in my project.clj?

EDIT*** I found that this is likely the error.

https://github.com/amalloy/ordered/pull/37

1

There are 1 best solutions below

0
On

You already have an answer though I thought i'd leave my general process for this incase it's useful for folks who come along later:

  • turn of any auto AOT in my tooling so i can get a repl witout triggering the problem.
  • load namespaces one at a time till i find one that triggers the problem (this usually doesn't take long ;-)
  • comment out half the dependencies of that namespace and evaluate the ns form at the top of the file
  • do a binary search till i find the one or two that trigger it
  • load just that dependency in a scrap project.
  • ... lots of effort ...
  • SUCCESS !