leiningen

N.B. The maintainers are on #leiningen on Libera chat IRC. Go there for direct support/bug reports.
FiVo 2020-02-03T13:03:04.067500Z

Hey, running into some issues when testing something with clojure 1.8. I get

Exception in thread "main" java.lang.RuntimeException: Unable to resolve var: *print-namespace-maps* in this context, compiling:(leiningen/core/main.clj:342:5)
using lein 2.9.1 the variable was introduced in clojure 1.9 is this expected behavior? https://github.com/technomancy/leiningen/blob/master/leiningen-core/src/leiningen/core/main.clj#L342

2020-02-03T17:37:51.068200Z

@finn.volkel I don’t think I understand enough context. It’d be easier if you could show a project.clj setup like you are describing with your error.

FiVo 2020-02-03T17:39:40.069200Z

@mikerod https://github.com/clojure-emacs/cider-nrepl/blob/master/project.clj lein with-profile 1.8,dev test

2020-02-03T17:39:56.069800Z

what's the motivation for using clojure 1.8 instead of a newer one? afaik your options are downgrading lein ot an older version, or upgrading clojure

2020-02-03T17:52:22.070200Z

@finn.volkel I’m still confused. Why are you showing me the cider-nrepl project ?

2020-02-03T17:53:30.071300Z

or perhaps this is what you want to test - in that case though, the issue sounds like it just is that cider-nrepl no longer is 1.8 compatible - since it uses something new from 1.9 perhaps - I’m not sure if these profiles are all regularly tested for that project

2020-02-03T17:53:41.071600Z

leiningen’s clojure version is independent of your project’s version

2020-02-03T17:53:44.071900Z

that goes for all dependencies - unless you are writing a plugin - then you are on leiningen’s own classpath

2020-02-03T17:54:46.073100Z

(this is one major reason why leiningen defaults to launching 2 jvm’s - 1 for it’s own setup and libs, and one for your independent project runtime)

2020-02-03T17:55:21.073800Z

there's a gotcha for trampoline though right?

2020-02-03T17:55:26.074Z

which actually comes down to the eval-in-project and friends fns in leiningen.core.eval

2020-02-03T17:55:38.074500Z

I don’t know of a caveat w/trampoline

2020-02-03T17:55:55.075Z

lein launches it’s own jvm first - emits some info for the next process to run w/ so it can shutdown

2020-02-03T17:56:11.075700Z

and later launches, I think it tries to avoid relaunching it’s first jvm if “nothing has changed with project setup”

2020-02-03T17:56:16.076Z

oh, I thought fast-trampoline would reuse the vm

2020-02-03T17:56:19.076200Z

ahh

2020-02-03T17:56:32.076700Z

you may referring to specific usages - that’s possible

2020-02-03T17:56:43.076900Z

I believe https://github.com/technomancy/leiningen/wiki/Faster goes through some of this - I’d have to re-read

2020-02-03T17:57:16.077600Z

yeah, following that guide and using fast trampoline is the only time I've used trampoline, so I kind of conflated the two

2020-02-03T17:57:52.078100Z

Yeah, I think its doing more with it - for raw speed

2020-02-03T17:58:03.078700Z

and that doesn't have the mentioned issue since it caches the state the lein jvm creates, it doesn't try to share a vm

2020-02-03T17:58:06.078900Z

not the only usage of it - at least how I see it

2020-02-03T17:58:19.079400Z

yeah, you should still get your own classpath for your project with the standard trampoline

2020-02-03T17:58:30.079700Z

meaning whatever clj version you support etc

FiVo 2020-02-03T17:58:38.079900Z

I just got the error when running the tests. I guess it has to do with cider-nrepl containing some leiningen plugin.

2020-02-03T17:59:28.080300Z

on the surface (not looking at it), seems like it doesn’t correctly function with clj 1.8

2020-02-03T17:59:31.080500Z

and perhaps it’s just out of date

2020-02-03T17:59:44.080900Z

I’d recommend you do lein with-profile +1.8 test though

2020-02-03T18:00:02.081400Z

to avoid assuming which profiles you need - just take the defaults in addition to 1.8

2020-02-03T18:00:19.081800Z

but really, that comes down to how project is configured and things are expected to be ran

2020-02-03T18:01:32.082100Z

this looks to be the way it is automatically built https://github.com/clojure-emacs/cider-nrepl/blob/master/Makefile#L15

2020-02-03T18:01:39.082500Z

(assuming this is used - haven’t dug too much)

2020-02-03T18:01:44.082700Z

but it does do the +1.8 style

2020-02-03T18:01:56.082900Z

actually,

lein with-profile +$(CLOJURE_VERSION),+test,+plugin.mranderson/config

2020-02-03T18:02:22.083600Z

for the test task, the +test should be superfluous, but still probably just run it the same as the scripts

2020-02-03T18:02:45.083900Z

or you can acutlaly use this Makefile if you want to go about testing that way

2020-02-03T18:03:03.084400Z

Of course at this point, looks like a #cider question

FiVo 2020-02-03T18:05:35.086200Z

yes already asked there as well, was just wondering if is more some wrong assumptions about leiningen

2020-02-03T18:05:40.086400Z

sure