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?
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
It expects to shell out to clojure and use stdin and stdout
The stdin part is different than other uses of clojure which mostly pass args instead
What does clojure.sh do?
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
Well that would certainly not work with the add-libs calls
> 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
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
I guess it’s not obvious to me that stdin will be piped through that? The error above seems totally unrelated though
Proxy seems more likely relevant, but not sure
From the issue report it seemed fairly likely. How is proxy info conveyed?
https://clojure.org/reference/clojure_cli#procurer_maven has a section on proxies but I’m not sure why this wrapper would affect things
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!
@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
You can hack the Clojure classpath inside your clojure script file to prefix a local checkout of tools.deps if that helps
by building a tools.dep jar and prefixing it in the -cp ?
Don’t need a jar, just checkout and put tools.deps/src/main/clojure on the classpath
oh yeah, make sense
Then you can modify that source or even debug it remotely
thanks!
Writing nil is pretty weird though
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
yeah, I was trying to do that
quite a few differences
@vemv added some comments to https://github.com/clojure-emacs/cider/issues/3651
yeah, if using -Scp, you're basically turning off the whole "calculate deps and basis" system