leiningen

N.B. The maintainers are on #leiningen on Libera chat IRC. Go there for direct support/bug reports.
2019-08-14T01:13:24.052200Z

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.

alexmiller 2019-08-14T01:53:03.052600Z

this is a jdk regression that was introduced in u202

alexmiller 2019-08-14T01:53:23.053Z

in particular with loading things in user.clj (which you do when you start the repl)

alexmiller 2019-08-14T01:53:59.053400Z

same issue in java 11.0.2 and 12

alexmiller 2019-08-14T01:55:24.054300Z

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

alexmiller 2019-08-14T01:55:35.054600Z

easiest is probably to fall back to 1.8.0u198

alexmiller 2019-08-14T01:56:17.054900Z

we've also included a mitigation for this in Clojure 1.10.1

2019-08-14T02:20:15.056100Z

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!

alexmiller 2019-08-14T02:27:16.056400Z

oh, me too when it happened. I did the fix for 1.10.1 :)

🎉 3
alexmiller 2019-08-14T02:28:32.057100Z

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.

😜 4
vemv 2019-08-14T07:48:14.059700Z

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)

2019-08-14T08:39:25.060900Z

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.

vemv 2019-08-14T08:42:41.061Z

nice! how did you achieve that? (I guess that I could hack the Lein script, but maybe there's a tight/clean approach)

2019-08-14T09:18:53.061200Z

Download the lein bash script, rename it to lein-2.9.1, or whatever name you want.

2019-08-14T09:19:45.061400Z

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.

2019-08-14T09:20:44.061600Z

Each lein bash script has an assignment like export LEIN_VERSION="<version>" near the beginning

vemv 2019-08-14T09:21:47.061800Z

ace, ty Andy!

2019-08-14T09:22:45.062Z

I am not certain where to get download older versions -- they are probably available in the git history of the Leiningen Github repository.

2019-08-14T09:24:11.062200Z

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.

vemv 2019-08-14T09:24:43.062400Z

🤝

vemv 2019-08-14T09:25:00.062600Z

yeah, git history seems the way to fetch those

2019-08-14T09:25:54.062800Z

Just noticed that I have a version 1.7.1 JAR file in my directory 🙂

2019-08-14T14:06:49.070500Z

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 "&lt;os&gt;/&lt;arch&gt;/" 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?