leiningen

N.B. The maintainers are on #leiningen on Libera chat IRC. Go there for direct support/bug reports.
2020-01-21T18:23:09.001900Z

Does anyone know how a Leiningen REPL outside of a project, differs to a Leiningen REPL inside a project? I’m getting an error that occurs only in Leiningen REPLs started outside of a project.

2020-01-21T18:25:39.002600Z

It also occurs in projects that are set to :eval-in-leiningen.

2020-01-21T18:27:03.003200Z

I know they might not use the same version of Clojure

2020-01-21T18:27:47.004500Z

I think outside a project, all deps are the ones lein uses itself, that includes the version of Clojure

2020-01-21T18:31:31.005500Z

The specific problem is in implementing a protocol for java.sql.Timestamp (https://github.com/brandonbloom/fipp/issues/72), so I’m guessing it has something to do with Java’s module system.

2020-01-21T18:48:58.007400Z

that does sound like the module system stuff - may be there is a link within the following that might shed some light on the matter: https://www.deps.co/blog/how-to-upgrade-clojure-projects-to-use-java-9/

alexmiller 2020-01-21T18:54:40.008100Z

java.sql.Timestamp is not in the base module, and leiningen is often started by modifying the bootclasspath, which includes nothing outside the base module

alexmiller 2020-01-21T18:55:12.008600Z

we put a conditional load in for that in Clojure at some point

alexmiller 2020-01-21T18:55:28.009Z

so using a different clojure version could be triggering that difference

alexmiller 2020-01-21T18:56:20.009600Z

Leiningen shouldn't be modifying the bootclasspath imo as I've said before (and that is outright not allowed in java 14 I believe)

alexmiller 2020-01-21T18:57:00.009900Z

or maybe I'm just thinking of the warning about disabling the verifier

2020-01-21T18:59:20.010200Z

Thanks for the explanation

alexmiller 2020-01-21T19:00:02.010900Z

(Timestamp is used in core for loading #inst formatters and extending the Inst protocol)

alexmiller 2020-01-21T19:00:16.011200Z

so if started in bootclasspath, those things don't get installed

2020-01-21T19:10:57.011700Z

for reference: https://github.com/technomancy/leiningen/pull/2319

2020-01-21T19:14:45.012800Z

in 2.9.0 it looks like bootclasspath use was re-enabled: https://github.com/technomancy/leiningen/releases/tag/2.9.0

2020-01-21T19:16:26.014100Z

so iiuc 2.8.0 through 2.8.3 didn't use the bootclasspath optimization

alexmiller 2020-01-21T19:33:18.014400Z

Java 14 warning: "OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release."

👀 1
alexmiller 2020-01-21T19:33:22.014600Z

fyi

2020-01-21T19:49:02.014900Z

@alexmiller what could be done to keep things speedy then?

2020-01-21T19:49:09.015100Z

or is there no hope

alexmiller 2020-01-21T19:53:10.015800Z

I don't think it ever really made that much of a difference tbh

2020-01-21T19:53:29.016100Z

interesting

alexmiller 2020-01-21T19:53:53.016600Z

clj is faster than leiningen on startup because it (usually) starts only one jvm, not two

alexmiller 2020-01-21T19:54:23.016900Z

that's a bigger factor than the verifier

alexmiller 2020-01-21T19:55:02.017500Z

startup speed is a multi-faceted problem

2020-01-21T20:03:20.017900Z

sure

alexmiller 2020-01-21T20:21:07.018600Z

disabling the security of your jvm is not a good solution imo (esp given that apparently a large percentage of people start their production servers that way)

2020-01-21T21:01:40.018900Z

well, I’m certainly not onboard with disabling any of this in production flows hah

2020-01-21T21:01:47.019200Z

but either way - sounds like perhaps not worth the effort

ghadi 2020-01-21T22:27:56.020Z

my 2c -- JVM options hacks are just hacks

ghadi 2020-01-21T22:28:20.020600Z

nothing going to make startup faster than explicitly designing for fast startup, and going on a classloading diet