Fork me on GitHub
#clj-on-windows
<
2022-05-02
>
respatialized18:05:46

@alexmiller I'm encountering the long classpath issue described in https://clojure.atlassian.net/browse/TDEPS-120. Because my projects have lots of transitive dependencies, I think I can expect to hit this issue fairly frequently. I'd be interested in submitting a patch based on your suggestion to use the existing -cp flag with a cpfile.txt file defining the classpath. Could you provide an example of such a file? I'm having some trouble finding an example of the java CLI that uses this type of file to denote the classpath, and it would be helpful to have an example to work from. Anything else I need to watch out for?

borkdude18:05:39

@afoltzm if you're interested, I'd be happy to receive a patch at deps.clj for this too, while TDEPS-120 is still being investigated. Instead of the classpath string https://github.com/borkdude/deps.clj/blob/bac835661adbcd06b07ce2c408bb3e4911a48c28/src/borkdude/deps.clj#L700, it needs to be written to a file and then the argument should be @file.txt or so. This only works on Java 9+, so the challenge is: how do we know we're on Java 9, without losing too much startup time. We could invoke java once and then cache the result or so.

borkdude18:05:19

I think it could be cached per java installation, so that would be fairly cheap to look up. So as long as you use the same java binary, the version only has to be cached once.

borkdude18:05:40

e.g.

~/.deps.clj/.cache/java_versions/<java_binary_filename_hash>/version.txt