Fork me on GitHub
#clj-on-windows
<
2023-05-08
>
pauld16:05:40

I'm getting this error during compilation (compile-clj) and it only happens when I depend on maven dependency that has lots of transitive dependencies. I thought it could be the long classpath issue so I tried adjusting my maven-local to something shorter on a different drive (D). However it is still looking for some main class on my C drive:

Error: Could not find or load main class Dumais\AppData\Local\Temp\compile-clj15644282254864761747\compile-clj;target.classes;src;C:\Users\Paul
Caused by: java.lang.ClassNotFoundException: Dumais\AppData\Local\Temp\compile-clj15644282254864761747\compile-clj;target/classes;src;C:\Users\Paul
Execution error (ExceptionInfo) at clojure.tools.build.tasks.compile-clj/compile-clj (compile_clj.clj:114).
Clojure compilation failed, working dir preserved: C:\Users\Paul Dumais\AppData\Local\Temp\compile-clj15644282254864761747 

pauld16:05:28

It seems to have an issue with the space in my home directory name.

borkdude16:05:14

I've heard about this issue recently in #C6QH853H8 or #C02B5GHQWP4 as well. Maybe it helps looking in there as well

pauld16:05:42

haha, was that me?

borkdude16:05:52

oh that was probably you :)

borkdude16:05:59

what answer did you get there then?

pauld16:05:48

Nothing yet, but then I went down a different path and back again - so I got help on the second issue.

pauld16:05:10

At first I was going to launch clojure code via java in an existing app, but then thought a separate app that uses the java app as a dependency would be easier.

pauld16:05:43

Hence I'm back to trying to make an uberjar using tools.build.

borkdude16:05:01

Have you tried :use-cp-file?

borkdude16:05:48

I'm suspecting it's a Windows specific escaping issue with how tools.build calls process builder (which I've accounted for in babashka.process when I ran into that) but I'm not sure. :use-cp-file may help

pauld16:05:19

I find it interesting that running clj -P is now downloading a bunch of dependencies that it didn't do before trying to compile.

pauld16:05:46

Haven't tried :use-cp-file

pauld16:05:05

Do I change this to :always or :never?

pauld16:05:20

Tried always but that didn't work. Trying never...

borkdude16:05:55

I think true?

pauld16:05:06

I'm using clojure via scoop and bash.

borkdude16:05:36

ah yes :always

pauld16:05:48

hmmm, now I get:

Execution error (FileNotFoundException) at java.io.FileInputStream/open0 (FileInputStream.java:-2).
C:\Users\Paul Dumais\AppData\Local\Temp\uber10211030562887780850\LICENSE (Access is denied)

borkdude16:05:15

This has come up before in #C02B5GHQWP4: sometimes a dependency has a LICENSE directory but another has a LICENSE file

borkdude16:05:23

you can add a conflict handler for that

pauld16:05:39

ahhh, yeah seen that too somewhere...

borkdude16:05:43

but this is a good sign, it's getting further now

pauld16:05:48

Hmm, tried putting in this as an option to compile-clj but no joy so far:

:exclude [#"(?i)^META-INF/LICENSE/.*"
                            #"^LICENSE/.*"]

borkdude17:05:53

what about just ".LICENSE."`

borkdude17:05:59

fucking markup

pauld17:05:35

I had the options in the wrong part - trying it in b/uber

pauld17:05:06

Ok, added #".LICENSE." , but that didn't work either.

borkdude17:05:44

i meant .*LICENSE.*

borkdude17:05:48

but the markup fucked it up

pauld17:05:08

That did it!

borkdude17:05:51

You may want to report your first issue before :use-cp-file in #C02B5GHQWP4 though, I think I know the root cause but it's better if it got solved properly. I think clojure.java.process in 1.12 will suffer from the same issue actually

borkdude17:05:55

A repro that people can readily clone and run will help

borkdude17:05:24

Also specify Java version / vendor

pauld16:05:49

But maybe that's not the root of the issue - not sure.