cider

oyakushev 2024-09-06T11:51:52.123409Z

Harold 2024-09-06T15:20:32.940489Z

It would be good for this to be an option (if it isn't already), but I wouldn't personally default it to 'on'. There are analogous things in cljs that are on by default in some scenarios and it's weird and distracting.

1
2024-09-06T12:44:04.003359Z

I haven't used lein projects in a while and trying to jack in on an empty project I'm getting an error when the lein command adds -- update-in :jvm-opts conj -Djdk.attach.allowAttachSelf -- . If I M-x C-u cider-jack-in edit the command and remove it so it runs :

/home/jmonetta/bin/lein update-in :dependencies conj \[nrepl/nrepl\ \"1.3.0-beta2\"\] -- update-in :dependencies conj \[refactor-nrepl/refactor-nrepl\ \"3.10.0\"\] -- update-in :plugins conj \[refactor-nrepl/refactor-nrepl\ \"3.10.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.49.0\"\] -- with-profile +dev repl :headless :host ::
then it works, but when it runs the default command :
/home/jmonetta/bin/lein update-in :dependencies conj \[nrepl/nrepl\ \"1.3.0-beta2\"\] -- update-in :dependencies conj \[refactor-nrepl/refactor-nrepl\ \"3.10.0\"\] -- update-in :plugins conj \[refactor-nrepl/refactor-nrepl\ \"3.10.0\"\] -- update-in :plugins conj \[cider/cider-nrepl\ \"0.49.0\"\] -- update-in :jvm-opts conj -Djdk.attach.allowAttachSelf -- with-profile +dev repl :headless :host ::
then it fails with : Error encountered performing task 'repl' with profile(s): 'base,system,user,provided,dev' java.lang.IllegalArgumentException: array element type mismatch Any ideas?

2024-09-06T12:45:52.961059Z

Lein version is Leiningen 2.11.1 on Java 17.0.12-ea OpenJDK 64-Bit Server VM

2024-09-06T12:49:00.076099Z

oh, I see quoting the property like -- update-in :jvm-opts conj '"-Djdk.attach.allowAttachSelf"' -- seams to fix it

2024-09-06T12:59:12.879289Z

changing it like this makes it work

2024-09-06T13:00:38.232449Z

but not sure how this affect other OSs

oyakushev 2024-09-06T13:02:17.200589Z

I suppose it might be shell-dependent. Which one do you use?

2024-09-06T13:04:05.866909Z

zsh

2024-09-06T13:05:24.655619Z

but I get the same issue running that command on bash

2024-09-06T13:05:40.041129Z

I mean, without quoting

oyakushev 2024-09-06T13:05:53.498929Z

Interesting. It's weird that you are the first person to run into this

oyakushev 2024-09-06T13:06:51.622419Z

Is that the stable CIDER that you are using?

2024-09-06T13:07:20.447909Z

I'm on CIDER 1.15.0-snapshot (package: 20240603.825)

oyakushev 2024-09-06T13:07:45.848879Z

I would ask you to update to the latest one before debugging this further

2024-09-06T13:09:05.792569Z

I will, but since on master I see cider-enable-nrepl-jvmti-agent being nil by default, and I have it customized on t maybe that is why not many people complained ?

oyakushev 2024-09-06T13:10:08.178319Z

Oh, damn, you are right. I thought it was on by default

2024-09-06T13:11:56.198069Z

I could also reproduce with the latest cider CIDER 1.15.1 (Cogne)

❤️ 1
oyakushev 2024-09-06T13:12:57.419559Z

Thanks for verifying! It works for me on Fish though

oyakushev 2024-09-06T13:13:12.807779Z

I wonder why this would have to be quoted, looks like a shell-friendly string to me

2024-09-06T13:13:16.981939Z

yeah, that quoting thing is tricky

2024-09-06T13:13:54.506329Z

I guess it is about the jvm-opts vector requiring Clojure strings, and this goes like a symbol?

oyakushev 2024-09-06T13:15:34.883029Z

Doesn't seem so. I can run that command from the terminal, both Fish, Bash, and ZSH, and it works everywhere

oyakushev 2024-09-06T13:15:44.747049Z

Does it work when you run that from the terminal (without the extra quotes)?

2024-09-06T13:15:58.476439Z

no, I tried zsh and bash

oyakushev 2024-09-06T13:16:14.536769Z

Fails with the same error in the terminal?

2024-09-06T13:17:03.175959Z

yeah like this :

oyakushev 2024-09-06T13:17:27.329439Z

I can reproduce now

2024-09-06T13:17:54.532489Z

with fish?

oyakushev 2024-09-06T13:18:17.794959Z

Everywhere. It seems to be the exact command that's faulty

2024-09-06T13:18:35.886119Z

great, at least it is consistent

2024-09-06T13:19:24.723499Z

probably for windows it has to be different quoting? no idea, I don't have a windows setup

oyakushev 2024-09-06T13:20:16.467969Z

This is fun

oyakushev 2024-09-06T13:20:24.176429Z

If you add trampoline in front of repl, it works

2024-09-06T13:21:14.341959Z

interesting

oyakushev 2024-09-06T13:21:37.093699Z

Why would my CIDER inject trampoline and yours not, I wonder

oyakushev 2024-09-06T13:22:47.041349Z

Because of cider-lein-parameters, obviously

2024-09-06T13:24:02.000649Z

it doesn't work for me, adding trampoline in front of repl on that same command

oyakushev 2024-09-06T13:24:10.884879Z

Same error still?

2024-09-06T13:24:47.832649Z

no

oyakushev 2024-09-06T13:26:23.017149Z

Must be something with your setup that prevents trampoline REPL from starting. But, to be honest, I no longer have idea what that trampoline thing does. I think it was something about killing the original Lein process and leaving only one running

2024-09-06T13:27:00.027559Z

yeah it was about leaving one JVM instead of two

oyakushev 2024-09-06T13:27:28.611619Z

Anyway, you seem to be right that Leiningen treats the unquoted string as symbol and that's why it breaks. I guess we need to quote it, but I'm not sure if it wouldn't break somewhere else. Maybe @bozhidar can chime in?

2024-09-06T13:28:09.820769Z

and there is also the Windows case, which is probably different

bozhidar 2024-09-06T13:31:56.317669Z

I’m on the road for the next week, so I can’t really check much. Off the top of my head, nothing comes to mind. I’m guessing when we can just expose the configuration option in Leiningen, so this wouldn’t need to be part of the shell command. But it will obviously require a PR in Lein.

oyakushev 2024-09-06T13:33:13.824919Z

I'll ask in #leiningen to see if I can extract some knowledge from there

👍 1
oyakushev 2024-09-06T13:33:39.868769Z

I also remember @vemv mentioning that modifying :jvm-opts from shell is tricky, that was probably it

vemv 2024-09-06T13:37:14.747739Z

I think Enrich (not in use in this thread, I guess) uses that style of quoting and nobody has complained so it would seem a safe change

🙏 1