Not sure the best place to ask this, but using the new add-libs on windows I seem to keep getting the dreaded CreateProcess error=206, The filename or extension is too long error. It happens even when adding the same deps to my deps.edn file and restarting my repl works fine. Is anyone else hitting this? Is there a way to debug the CLI command being ran?
@jjttjj I've done an experiment here by re-binding the invoke-tool var (which is an intentional use of that): https://github.com/borkdude/lein.repl.deps
This code is not coupled to lein at all, but it would enable you to use add-libs in leiningen without installing the CLI. Playing around with that code might give you some ideas
It might still have the same issue as you encountered though. The issue is that Windows has a certain limit on the argument length and if your classpath gets really long that's a problem. There is an ask issue for this though. It could be solved easily on Java 9+
Cool I'll try playing with that at some point. You mean this ask question right? https://ask.clojure.org/index.php/7864/windows-version-tools-deps-fails-launch-java-classpath-long So the idea would be to rebind invoke tool to use a "pathing jar" as described there to keep the command short
https://clojure.atlassian.net/browse/TDEPS-120?focusedCommentId=49241
I think I could fix this in deps.clj but I don't want to get too far ahead of the official CLI
The change would be here:
https://github.com/borkdude/deps.clj/blob/2f93fe8ba712c855feb6ecf26d2ed70646b34356/src/borkdude/deps.clj#L872
The solution would be to first write the classpath to a temp-file and then use --classpath @file
Oh yeah thanks. I've definitely hit this before prior to the new add-libs things but usually it works for me to just set my mvn/local-repo to /r.
I wasn't sure of the nature of it yet relating to add-libs though, curious if there might be a way to get the command string length more in line with the normal clj one. I've just been hitting this with one medium sized project though.
The --classpath option seems pretty straightforward to get working for a custom invoke tool though
The issue with fixing this is compatibility with java 8. So you'd have to probe java --version or just try it and if it fails go back to the old behavior, or do it through an explicit setting or env var or so: DEPS_CLJ_USE_CP_FILE_ARGUMENT=true
I actually think the issue in add-lib might not be just that but the large arguments we pass, so not sure just the classpath thing is enough
which is to say, ask clojure question is welcome :)
The whole basis is serialized through a CLI arg?
asked here: https://ask.clojure.org/index.php/12916/libs-clojure-alphas-causing-filename-extension-long-windows
yeah
well, not the whole basis, but significant portion
it's in my queue, will definitely be working on this for next alpha
I've released a new deps.clj which at least solves one "too long file argument" problem when passing a long classpath.
Try scoop install clj-deps from the scoop-clojure by @ales.najmann
It might not solve the add-lib problem yet as the whole basis is passed via a CLI argument. I think Alex is working on improving this by passing it via a file or so.