tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
2020-12-31T21:37:26.176100Z

Happy NYE everyone! I was curious if anyone has seen the following error when the clojure command is run:

Error building classpath. class java.util.HashMap$Node cannot be cast to class java.util.HashMap$TreeNode (java.util.HashMap$Node and java.util.HashMap$TreeNode are in module java.base of loader 'bootstrap')
I’m on clj version: 1.10.1.727 It seems to be intermittent but I’ve only seen it when clj is run with -Sdeps and -Sforce. I’ve seen this error thrown with both the -e and the -m flags used.

seancorfield 2020-12-31T21:41:27.177200Z

@splayemu I wonder if you might be hitting a race condition when it is trying to figure out dependencies in parallel for some reason? You can try adding -Sthreads 1 to force it to be single-threaded.

2020-12-31T21:49:46.177300Z

thank you! It’s been popping up a bunch on our CI lately so I’ll give that a go and report back if it solves the problem.

2020-12-31T21:56:49.177500Z

Does it force the whole clojure process to only use 1 thread, or does it just change the classpath generation / clojure initialization?

seancorfield 2020-12-31T21:59:54.177700Z

Just the part that calculates/downloads dependencies. Once all the dependencies are figured out, the subsequent process that actually runs your code will run as normal.

dominicm 2020-12-31T21:59:55.177900Z

Classpath generation

2020-12-31T22:00:14.178100Z

Great, thanks 🙏

seancorfield 2020-12-31T22:01:25.178300Z

I'm a bit surprised folks don't run into this issue more often. I've never seen it happen -- not locally on my Mac, nor on our build/QA server -- but I have seen a handful of people run into it repeatedly.

2020-12-31T22:09:10.178500Z

hmm yeah I wonder what makes it more likely to happen… I haven’t seen it locally - only on our drone env

alexmiller 2020-12-31T22:26:17.179Z

are you using any git deps or s3 maven repo deps?

ghadi 2020-12-31T22:26:19.179300Z

@splayemu is there more stacktrace youre omitting?

2020-12-31T22:30:13.179700Z

yes we have our own maven repo in s3

2020-12-31T22:30:38.179900Z

and we also use git deps - though not used heavily

2020-12-31T22:32:51.180100Z

We also use a lot of :local/root deps (not sure if that’s useful info for you)

alexmiller 2020-12-31T22:42:56.180400Z

yep, although that doesn't help narrow it down much :) s3 repos do dynamic loading of the s3 code so that's a known issue but your stack trace looks like something else. a lot of the maven model building stuff is not thread-safe.

👍 1