clojure-dev

vemv 2024-05-02T10:45:44.094209Z

For cider stuff, we can wrap clojure with a clojure.sh script which seemingly breaks the add-lib feature. (the user who reported this also uses a HTTP proxy) Which specific things does the add-lib implementation expect?

Ivar Refsdal 2024-05-02T11:33:28.164829Z

Do you get an exception? I know that add-lib(s) requires *repl* to be set: https://github.com/clojure/clojure/blob/9f4dc520a9ee95fb527152f65900aa2c97cb676e/src/clj/clojure/repl/deps.clj#L40

Alex Miller (Clojure team) 2024-05-02T11:37:28.870059Z

It expects to shell out to clojure and use stdin and stdout

Alex Miller (Clojure team) 2024-05-02T11:39:02.321499Z

The stdin part is different than other uses of clojure which mostly pass args instead

Alex Miller (Clojure team) 2024-05-02T11:39:44.076409Z

What does clojure.sh do?

2024-05-02T12:17:21.308759Z

https://github.com/clojure-emacs/enrich-classpath/blob/master/tools.deps/src/cider/enrich_classpath/clojure.sh#L40 it is for wrapping the clojure command to add more things to the classpath with some bash black magic

Alex Miller (Clojure team) 2024-05-02T12:35:50.691289Z

Well that would certainly not work with the add-libs calls

vemv 2024-05-02T12:45:51.334869Z

> Do you get an exception? Not directly https://github.com/clojure-emacs/cider/issues/3651 We get a ArtifactDescriptorException Failed to read artifact descriptor for com.fasterxml.jackson.core:jackson-core:jar:2.17.0

vemv 2024-05-02T12:47:21.498979Z

Well that would certainly not work with the add-libs callsWhat part not? clojure.sh ends up calling clojure (the official one) as usual with a speficic classpath pre-computed, that's all. Nothing should prevent the produced JVM process from calling clojure , hence my question

Alex Miller (Clojure team) 2024-05-02T13:07:11.079679Z

I guess it’s not obvious to me that stdin will be piped through that? The error above seems totally unrelated though

Alex Miller (Clojure team) 2024-05-02T13:08:39.609139Z

Proxy seems more likely relevant, but not sure

vemv 2024-05-02T13:35:23.787929Z

From the issue report it seemed fairly likely. How is proxy info conveyed?

Alex Miller (Clojure team) 2024-05-02T13:46:45.345989Z

https://clojure.org/reference/clojure_cli#procurer_maven has a section on proxies but I’m not sure why this wrapper would affect things

vemv 2024-05-02T13:53:37.183799Z

Yeah definitely we don't go that deep. I'll try to repro the issue locally first and then get back to this. Thanks for the assistance!

2024-05-02T17:37:51.532769Z

@alexmiller is there a easy way of debugging the .basis file writing? Looking at this issue I see the .cpcache/xxx.basis file is being written with nil when clojure is run with this clojure.sh wrapper script. But I'm finding it hard to debug since the clojure command is loading the AOT compiled version of tools.deps inside clojure-tools-1.11.3.1463.jar

Alex Miller (Clojure team) 2024-05-02T17:42:41.792559Z

You can hack the Clojure classpath inside your clojure script file to prefix a local checkout of tools.deps if that helps

2024-05-02T17:43:44.320619Z

by building a tools.dep jar and prefixing it in the -cp ?

Alex Miller (Clojure team) 2024-05-02T17:44:26.586359Z

Don’t need a jar, just checkout and put tools.deps/src/main/clojure on the classpath

2024-05-02T17:44:46.612839Z

oh yeah, make sense

Alex Miller (Clojure team) 2024-05-02T17:44:50.331449Z

Then you can modify that source or even debug it remotely

2024-05-02T17:44:57.553599Z

thanks!

Alex Miller (Clojure team) 2024-05-02T17:45:35.985299Z

Writing nil is pretty weird though

Alex Miller (Clojure team) 2024-05-02T17:47:35.142059Z

If you capture the args to make-classpath2, that’s the entry point from the bash, would be good to know which side of that is the problem

2024-05-02T17:48:45.843969Z

yeah, I was trying to do that

2024-05-02T17:56:18.586979Z

quite a few differences

2024-05-02T18:09:20.811429Z

@vemv added some comments to https://github.com/clojure-emacs/cider/issues/3651

❤️ 1
Alex Miller (Clojure team) 2024-05-02T18:23:20.329569Z

yeah, if using -Scp, you're basically turning off the whole "calculate deps and basis" system