clj-on-windows

For those interested in making clj on Windows https://dev.clojure.org/jira/browse/TDEPS-67. Also see https://github.com/littleli/scoop-clojure.
paulbutcher 2021-04-24T11:10:45.271100Z

I’ve just run into the classpath too long issue (TDEPS-120). I’ve tried the “reduce the path to your local Maven repository” advice without any luck (my classpath is still too long even with a path to the maven repo of /mvn. Is there anything else I can try, or am I out of luck until TDEPS-120 is fixed? (I’m on 1.10.3.822). Thanks!

borkdude 2021-04-24T11:16:14.272Z

@paulbutcher A workaround is to create an uberjar from your deps and put that uberjar on your classpath. It's an ugly workaround, but therefore it's called a workaround.

paulbutcher 2021-04-24T11:16:56.272500Z

That does sound ugly :rolling_on_the_floor_laughing:. Is there a cheatsheet explaining how to go about doing that lying around?

borkdude 2021-04-24T11:17:25.272800Z

for creating an uberjar I would use seancorfield/depstar

borkdude 2021-04-24T11:18:43.274100Z

then you can add the uberjar to your classpath like:

{:deps
 {db/driver {:local/root "/path/to/db/driver.jar"}}}

paulbutcher 2021-04-24T11:19:16.274700Z

I’m using that already to create the uberjar for my project: I may be missing something, but how do I get depstar to create the uberjar without running into exactly this issue?

paulbutcher 2021-04-24T11:20:12.276Z

I may revert back to doing what I was doing before, which is develop on my Mac and play with port forwarding to get the Windows machine I need to test on (I have a Windows-specific bug I’m trying to nail) to connect through to the code running on the Mac…

borkdude 2021-04-24T11:20:26.276400Z

that's a good question: creating the uberjar itself also runs into this issue? I've gotten away with this before where the uberjar worked, but not the normal approach

paulbutcher 2021-04-24T11:21:22.277300Z

Yeah, I have a single deps.edn which describes a combined clojurescript front-end and clojure back-end so there are a lot of dependencies.

borkdude 2021-04-24T11:21:45.277900Z

make multiple uberjars? ;)

borkdude 2021-04-24T11:22:01.278400Z

we have split our big app up into front-end and back-end deps

borkdude 2021-04-24T11:22:05.278700Z

under two different aliases

paulbutcher 2021-04-24T11:22:18.279Z

I could break them apart, but given that I’m not looking to develop on Windows as a matter of course, it might be easiest to give up on getting it to build there and just play port-forwarding games.

borkdude 2021-04-24T11:22:39.279700Z

you could build the uberjar on your mac and then use that on Windows

borkdude 2021-04-24T11:22:45.280100Z

or use WSL to create the uberjar

paulbutcher 2021-04-24T11:23:45.281500Z

Yeah, but what I really want to do is run the development build so that I can watch what’s going on. I have a bug which only manifests on Windows Chrome (Mac Chrome runs fine). So what I hoped to do was run it with Figwheel and all that other goodness on Windows.

borkdude 2021-04-24T11:23:53.281700Z

beware of AOT though: don't AOT your own sources when you want to develop

paulbutcher 2021-04-24T11:24:15.282200Z

I think I’ll just give up and get port forwarding sorted.

borkdude 2021-04-24T11:24:35.282600Z

oh then you can solve it actually easier. run your development in WSL and then use the Windows browser to view your WSL dev server

paulbutcher 2021-04-24T11:25:06.282800Z

Ah! Of course.

paulbutcher 2021-04-24T11:25:12.283Z

Thanks - I should have worked that out