Fork me on GitHub
#clojure
<
2020-08-07
>
Michael du Breuil01:08:13

I use libgdx across windows/linux and sometimes Mac (OpenGL and Apple make that enough of a continual annoyance I don't bother with it anymore, particularly since neither I or any of my users seem to have the hardware anymore). There's a couple of Clojure wrappers out there for it, but I've found it easiest to use without any of them. It is more game focused, so you're more responsible for implementing the actual charting yourself, but it gives you fairly nice 2D layout stuff, and direct access to OpenGL to do custom stuff as you want.

Ian Davies01:08:19

Awesome thanks for the suggestion I’ll check them out!

Rawad06:08:03

Hello, I am trying to add support for Solr based search in my clojure web app. Any recommended solr client libraries in clojure? I found clojure-solr on github but the last commit on the repo is 10 yrs ago. Thanks!

donavan10:08:29

Has anyone run into this error when trying to resolve git deps (`clojure` + deps.edn): org.eclipse.jgit.api.errors.TransportException: [REPO] java.lang.NoClassDefFoundError: com/jcraft/jzlib/ZStream?

donavan10:08:07

I’ve hacked together a solution by edited the clojure executable to add the jzlib jar to the tools_cp. I did try using the CLASSPATH env var before but that didn’t work. What is the preferred way of modifying the tooling classpath?

Alex Miller (Clojure team)12:08:27

There is no preferred method - this is very unusual

Alex Miller (Clojure team)12:08:57

What version of clj are you on and what os?

donavan12:08:51

clj version: 1.10.1.561 installed via:

brew install clojure/tools/clojure
MacOS Catalina 10.15.5 (19F101)

Alex Miller (Clojure team)12:08:02

and is the git project something public that I could repro with?

donavan12:08:12

No it’s private

donavan12:08:21

I could try recreate with something public?

Alex Miller (Clojure team)12:08:26

I've never seen anyone having this issue so would love to understand more about it

Alex Miller (Clojure team)12:08:44

if you're getting a full stack trace, could I see that?

donavan12:08:10

Error building classpath. [PRIVATE GIT REPO]: java.lang.NoClassDefFoundError: com/jcraft/jzlib/ZStream
org.eclipse.jgit.api.errors.TransportException: [PRIVATE GIT REPO]: java.lang.NoClassDefFoundError: com/jcraft/jzlib/ZStream
	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:248)
	at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:306)
	at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:200)
	at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:89)
	at clojure.tools.gitlibs.impl$call_with_auth.invokeStatic(impl.clj:51)
	at clojure.tools.gitlibs.impl$call_with_auth.invoke(impl.clj:43)
	at clojure.tools.gitlibs.impl$git_clone_bare.invokeStatic(impl.clj:73)
	at clojure.tools.gitlibs.impl$git_clone_bare.invoke(impl.clj:70)
	at clojure.tools.gitlibs.impl$ensure_git_dir.invokeStatic(impl.clj:112)
	at clojure.tools.gitlibs.impl$ensure_git_dir.invoke(impl.clj:102)
	at clojure.tools.gitlibs$resolve.invokeStatic(gitlibs.clj:33)
	at clojure.tools.gitlibs$resolve.invoke(gitlibs.clj:29)
	at clojure.tools.gitlibs$procure.invokeStatic(gitlibs.clj:47)
	at clojure.tools.gitlibs$procure.invoke(gitlibs.clj:41)
	at clojure.tools.deps.alpha.extensions.git$eval1060$fn__1062.invoke(git.clj:42)
	at clojure.lang.MultiFn.invoke(MultiFn.java:239)
	at clojure.tools.deps.alpha$expand_deps.invokeStatic(alpha.clj:269)
	at clojure.tools.deps.alpha$expand_deps.invoke(alpha.clj:237)
	at clojure.tools.deps.alpha$resolve_deps.invokeStatic(alpha.clj:332)
	at clojure.tools.deps.alpha$resolve_deps.invoke(alpha.clj:307)
	at clojure.tools.deps.alpha.script.make_classpath2$create_classpath.invokeStatic(make_classpath2.clj:57)
	at clojure.tools.deps.alpha.script.make_classpath2$create_classpath.invoke(make_classpath2.clj:49)
	at clojure.tools.deps.alpha.script.make_classpath2$run_core.invokeStatic(make_classpath2.clj:96)
	at clojure.tools.deps.alpha.script.make_classpath2$run_core.invoke(make_classpath2.clj:74)
	at clojure.tools.deps.alpha.script.make_classpath2$run.invokeStatic(make_classpath2.clj:117)
	at clojure.tools.deps.alpha.script.make_classpath2$run.invoke(make_classpath2.clj:111)
	at clojure.tools.deps.alpha.script.make_classpath2$_main.invokeStatic(make_classpath2.clj:162)
	at clojure.tools.deps.alpha.script.make_classpath2$_main.doInvoke(make_classpath2.clj:134)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:705)
	at clojure.core$apply.invokeStatic(core.clj:665)
	at clojure.main$main_opt.invokeStatic(main.clj:514)
	at clojure.main$main_opt.invoke(main.clj:510)
	at clojure.main$main.invokeStatic(main.clj:664)
	at clojure.main$main.doInvoke(main.clj:616)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.lang.Var.applyTo(Var.java:705)
	at clojure.main.main(main.java:40)
Caused by: org.eclipse.jgit.errors.TransportException: [PRIVATE GIT REPO]: java.lang.NoClassDefFoundError: com/jcraft/jzlib/ZStream
	at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:172)
	at clojure.tools.gitlibs.impl.proxy$org.eclipse.jgit.transport.JschConfigSessionFactory$ff19274a.getSession(Unknown Source)
	at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:140)
	at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:280)
	at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:170)
	at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:137)
	at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:123)
	at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1269)
	at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:237)
	... 37 more
Caused by: com.jcraft.jsch.JSchException: java.lang.NoClassDefFoundError: com/jcraft/jzlib/ZStream
	at com.jcraft.jsch.Session.initDeflater(Session.java:2241)
	at com.jcraft.jsch.Session.read(Session.java:1048)
	at com.jcraft.jsch.UserAuthPublicKey.start(UserAuthPublicKey.java:198)
	at com.jcraft.jsch.Session.connect(Session.java:470)
	at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:126)
	... 45 more
Caused by: java.lang.NoClassDefFoundError: com/jcraft/jzlib/ZStream
	at com.jcraft.jsch.jcraft.Compression.<init>(Compression.java:42)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at java.lang.Class.newInstance(Class.java:442)
	at com.jcraft.jsch.Session.initDeflater(Session.java:2234)
	... 49 more

donavan12:08:34

For the temp fix I did: adding the jzlib jar to m2 using

mvn dependency:get -DremoteRepositories= -DgroupId=com.jcraft -DartifactId=jzlib -Dversion=1.1.3 -Dtransitive=false
Then editing the clojure executable to the line that constructs the tooling classpath
tools_cp="$install_dir/libexec/clojure-tools-1.10.1.561.jar:/Users/donavan/.m2/repository/com/jcraft/jzlib/1.1.3/jzlib-1.1.3.jar"

Alex Miller (Clojure team)12:08:39

do you have "Compression yes" in your ~/.ssh/config ?

Alex Miller (Clojure team)12:08:50

seems like this is jgit issue, I found a bug report explaining it

Alex Miller (Clojure team)12:08:19

jzlib is an optional dependency and used if ssh compression is on

donavan12:08:25

probably yes

Alex Miller (Clojure team)12:08:46

thanks, that all fits then - turning that off would also probably address the problem

Alex Miller (Clojure team)12:08:06

thanks for finding it! :) I'll get a fix in the next version of clj

donavan13:08:43

Np, now I see compression.<init> at the bottom of the stacktrace. Having never been a Java dev I still get a bit mystified when confronted with these sorts of issues. Thanks for figuring it out so quickly 🙂

Alex Miller (Clojure team)18:08:31

there's a new clj build out there with this change in it - 1.10.1.624 if you want to try it brew install clojure/tools/[email protected] (you might need to brew uninstall or brew unlink first)

scknkkrer13:08:25

Something to read from R. Hickey. That made my day.

dvingo13:08:10

I'd like a zipper over a map which has only keyword keys and values of scalars, maps, and vectors (of maps) - and I'd like to remove map entries recursively given a predicate that operates on the keywords. I have a recursive version working and I'm wondering how you'd go about doing the same with a zipper to avoid any stack overflow issues.

Ben Sless14:08:59

Why not use postwalk?

Jeff Evans15:08:07

> Remove key/value pair from nested map:

dvingo15:08:24

thanks @UK0810AQ2 ! - postwalk should be perfect for this - just slipped my mind

👍 3
dvingo15:08:18

@U0183EZCD0D sorry, should have mentioned I also want to target cljs so don't want to use specter due to the large js payload size increase

👍 3
dvingo13:08:54

there are some good example on clojuredocs (https://clojuredocs.org/clojure.zip/zipper) for updating a map/vector, but not of removing entries