I have a project running lein 2.9.1, clojure 1.8 and openjdk version “1.8.0_212”. No changes to the project.clj and no SNAPSHOT version in the project.clj. All of the sudden lein repl
is taking like 5 minutes to start. initially it was timing out, I had to bump it up twice to get the process to even come up. has anyone seen anything similar? This is a pretty old application, but we work on it frequently. This was working fine literally yesterday and then today the repl started timing out.
this is a jdk regression that was introduced in u202
in particular with loading things in user.clj (which you do when you start the repl)
same issue in java 11.0.2 and 12
they've been working through fixes in various releases, I think java 13 has most of them but not sure of the status of all the backports
easiest is probably to fall back to 1.8.0u198
we've also included a mitigation for this in Clojure 1.10.1
thank you @alexmiller,much appreciated. I’ve been working with clojure for a long time and can work most things out myself, but this one had me pulling my hair out!
oh, me too when it happened. I did the fix for 1.10.1 :)
I've been working with the JVM for 20 years and 99% of the time when you think it's the JVM, you're wrong. occasionally though, it actually is.
Is it possible to have multiple versions of Lein installed and selectable in my system? (rationale: I must use 2.8.1 for most work, for emacs-y reasons. But I also need to run my test suite against the latest Lein as well)
I have several versions of lein in my command path on macOS and Linux systems, working fine. I choose to name the shell scripts differently, e.g. lein-2.8.1 lein-2.9.3 etc. with whatever the 'default' version I want to use being a symbolic link from 'lein' to the version number I want to be the default.
nice! how did you achieve that? (I guess that I could hack the Lein script, but maybe there's a tight/clean approach)
Download the lein bash script, rename it to lein-2.9.1, or whatever name you want.
I guess I tend to create another one when I download a new version of the lein bash script, and rename it soon afterwords so I do not forget what version that bash script corresponds to.
Each lein bash script has an assignment like export LEIN_VERSION="<version>"
near the beginning
ace, ty Andy!
I am not certain where to get download older versions -- they are probably available in the git history of the Leiningen Github repository.
Each lein bash script has its own corresponding JAR file -- the bash script checks in a /.lein/self-installs directory to see if the appropriately versioned JAR file is already there, and uses it if so. Otherwise it downloads it and puts it in that directory. All such JAR files have version numbers as part of their names, so they can all coexist in that /.lein/self-installs directory just fine.
🤝
yeah, git history seems the way to fetch those
Just noticed that I have a version 1.7.1 JAR file in my directory 🙂
Hi! My question concerns packaging a native library with lein, and being able to use it later when running the jar. In the sample.project.clj, I read "Dependencies are listed as [group-id/name version]; in addition to keywords supported by Pomegranate, you can use :native-prefix to specify a prefix. This prefix is used to extract natives in jars that don't adhere to the default "<os>/<arch>/" layout that Leiningen expects". From this I gather the best thing is to adhere to the default layout, but I don't find the documentation on where exactly to create the <os>/<arch>/ directory structure in the lein project. Once I have created that directory structure in the right place, and put my .so-file there, I guess I will need to add some JVM-flag in runtime (-Djava.library.path=something), in order for (clojure.lang.RT/loadLibrary "name")
to find it? Has anyone a good pattern i place for this?