leiningen

N.B. The maintainers are on #leiningen on Libera chat IRC. Go there for direct support/bug reports.
dangercoder 2020-11-05T09:47:37.054500Z

Can the change command add a non-existing key?

Franklin 2020-11-05T11:30:29.055300Z

I wonder if leiningen should be installed in a production server and if it's ok then to run lein repl on the server? Thoughts anyone?

Franklin 2020-11-05T11:40:28.055600Z

asking this because it would be nice if you could reproduce issues you are having in production by running code in the same environment it's deployed in (on the same box) while trying to debug....

Franklin 2020-11-05T11:40:45.055800Z

just like you can do in a django shell or something similar

Franklin 2020-11-05T11:44:34.056Z

I noticed in the leiningen documentation that they recommend that you don't use leiningen in production and use an uberjar instead... but still...

2020-11-05T12:41:50.056900Z

You can also embed nrepl in your app

1
Louis Kottmann 2020-11-05T13:10:19.058800Z

you should start a NRepl in your production on a secured port (not forwarded publicly)

Louis Kottmann 2020-11-05T13:10:27.059Z

and then connect to it locally

Louis Kottmann 2020-11-05T13:10:38.059300Z

with lein repl :connect ...

dangercoder 2020-11-05T14:21:19.061Z

Hi, I have a wierd error with lein update-in. This does not work: lein update-in : assoc :local-repo "/workspace/lein-repo" -- test This works lein update-in : assoc :local-repo "123" -- test

dangercoder 2020-11-05T14:21:27.061200Z

not sure why "/workspace/lein-repo" would not work

2020-11-05T14:25:20.062200Z

@jarvinenemil what is not working. And the second command doesn’t do anything really on its own . So what “works” about it ?

dangercoder 2020-11-05T14:25:47.063300Z

im expecing the config map to be updated but 1 throws exception

dangercoder 2020-11-05T14:26:06.064Z

getting error in the lisp interpreter when using the workspace-string

2020-11-05T14:26:06.064100Z

What sort of exception

dangercoder 2020-11-05T14:26:09.064300Z

1 sec...

dangercoder 2020-11-05T14:26:41.064400Z

2020-11-05T14:36:09.064700Z

I think a lot of developers prefer to create and deploy JAR files to their production environment, rather than run Leiningen there. For one, running Leiningen in production deployment machines opens you up to the possibility of resolving dependencies differently, and/or failing to retrieve those dependencies over the network.

Louis Kottmann 2020-11-05T14:39:03.065200Z

why is there a space between : and assoc?

dangercoder 2020-11-05T14:44:14.066100Z

I use : so I am at the top-level

dangercoder 2020-11-05T14:44:20.066300Z

since there is only update-in

2020-11-05T14:54:47.066800Z

@jarvinenemil maybe just a bash escaping issue

2020-11-05T14:54:55.067200Z

Put single quotes around your path string

2020-11-05T14:55:02.067500Z

Perhaps it’s being interpolated.

2020-11-05T14:55:34.067900Z

Although weird to me

Franklin 2020-11-05T14:55:37.068100Z

I'll investigate using nrepl...

2020-11-05T14:56:41.069900Z

:local-repo is assumed relative path

2020-11-05T14:56:46.070200Z

Relative to the project root.

2020-11-05T14:57:09.070600Z

So you’d path may just not be a supported type here.

dangercoder 2020-11-05T14:57:31.071100Z

ah, I am trying to get my ci/cd pipeline to cache dependencies

dangercoder 2020-11-05T14:57:59.071500Z

when using leiningen, so I figured that :local-repo was the way to go

2020-11-05T14:58:39.071800Z

Yeah. I’ve done similar before

2020-11-05T14:58:47.072100Z

But I had some other workarounds I think

2020-11-05T14:58:59.072600Z

You maybe could try some sort of symlink

2020-11-05T14:59:04.072800Z

I never tried that before

dangercoder 2020-11-05T15:02:09.074900Z

I have a maven pipeline that works so I figured it should play almost the same 😉

2020-11-05T15:26:36.075Z

There are also socket REPLs that can be enabled, built into Clojure with no extra dependency, if you prefer, which can be used during development and in production (as can nrepl, if you wish). The choice between those is, I believe, primarily driven by whether the dev environment that you want to connect to the JVM process is using nrepl

dangercoder 2020-11-05T18:38:41.077500Z

Is anyone building clojure code in docker containers? I am running the official clojure:lein image and it does not recognize with-profile commands etc. test and uberjar works fine

dangercoder 2020-11-05T18:38:57.077800Z

If you are, please tell me which image ur using

2020-11-05T20:13:01.077900Z

@jarvinenemil so you're saying lein with-profile +foo ... isn't working? what did you try and what's the symptom?

dangercoder 2020-11-06T09:19:32.078300Z

I tried to execute that command inside the docker-container and it says 'with-profile +ci-cd test' is not a task. See 'lein help'.

dangercoder 2020-11-06T09:19:56.078500Z

@noisesmith

dangercoder 2020-11-06T09:21:30.078700Z

I am using clojure:openjdk-11-lein from DockerHub

2020-11-06T15:51:16.078900Z

it looks to me like it wanted "with-profile" "+ci-cd" "test" in the Dockerfile, and got "with-profile +ci-cd test" instead

2020-11-06T15:52:23.079100Z

(ins)justin@abjection:~/clojure-experiments$ lein with-profile +foo repl
Warning: profile :foo not found.
Warning: profile :foo not found.
nREPL server started on port 46677 on host 127.0.0.1 - <nrepl://127.0.0.1:46677>
REPL-y 0.4.4, nREPL 0.6.0
Clojure 1.10.0
OpenJDK 64-Bit Server VM 11.0.7+10-post-Ubuntu-2ubuntu219.10
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

user=&gt; Bye for now!
(ins)justin@abjection:~/clojure-experiments$ lein 'with-profile +foo repl'
'with-profile +foo repl' is not a task. See 'lein help'.

dangercoder 2020-11-06T18:48:52.079600Z

im gonna try to split it up thanks

dangercoder 2020-11-06T18:49:01.079800Z

because when I only have one command, such as "test" it works just fine

2020-11-06T20:41:13.080Z

right, that's what I'd expect from shell quoting

dangercoder 2020-11-06T21:10:22.080200Z

thanks @noisesmith I just verified that this solved my issue. I am very grateful that you took the time to help me out 🙂.