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.
vemv 2021-01-17T16:33:13.007600Z

anyone has a .github/workflows CI setup using https://github.com/DeLaGuardo/setup-clojure and exercising it over Windows? I'm curious to see how a (possiby advanced) clj pipeline on windows looks like. I have zero experience in this area

borkdude 2021-01-17T16:34:46.008400Z

@vemv I have multiple projects running in Windows CI, but I stick with Appveyor for Windows since this has given me the least amount of headaches.

borkdude 2021-01-17T16:35:18.008900Z

Also I use bb --clojure or deps.exe in Windows CI for the same reason (less headaches than the Powershell stuff)

1👀
borkdude 2021-01-17T16:36:08.009600Z

Here is one for a relatively simple project: https://github.com/babashka/pod-babashka-buddy/blob/main/appveyor.yml

vemv 2021-01-17T16:36:28.010200Z

Is GH actions too problematic? Ideally I'd extend my existing macos+linux matrix to also span Win

borkdude 2021-01-17T16:38:05.011700Z

Not sure, I haven't spent much energy on that. I did replicate my CircleCI setup to Github actions, but found CircleCI more pleasant to work with. The idea I'm getting from Actions is that it's good for running things on your code, like linters, but not so much for builds that require non-trivial performance.

borkdude 2021-01-17T16:38:40.012200Z

And the UI is fairly annoying too (no output for several hours and then after 6 hours an e-mail that your build failed).

vemv 2021-01-17T16:39:43.013Z

I can second that :) currently using GH Actions for org reasons I wonder if there's a Circle template for clj+win

borkdude 2021-01-17T16:40:15.013400Z

I think the ideas from the appveyor example I just posted translate fairly well to other CI envs

1👍
vemv 2021-01-17T16:40:47.013900Z

good call, thanks!

borkdude 2021-01-17T16:41:10.014100Z

You might also be able to use scoop to install the official clj tool, but for GraalVM builds this doesn't work as it is powershell

borkdude 2021-01-17T16:41:17.014300Z

And Graal builds need cmd.exe

lread 2021-01-17T18:58:49.015900Z

@vemv FWIW, I use GitHub Actions on Windows for rewrite-cljc. https://github.com/lread/rewrite-cljc-playground/blob/c09689e955d650fe7564a955ae22a2f02b7352fe/.github/workflows/unit-test.yml#L82 (well actually deps.exe and then I pretend it is clojure.exe).

borkdude 2021-01-17T19:01:40.016900Z

@lee Note that with the latest bb you can also do bb --clojure without installing deps.exe (but imitating "clojure" might be more difficult in Windows, dunno)

lread 2021-01-17T19:02:23.017300Z

Good to know, thanks @borkdude!

lread 2021-01-17T19:03:58.018400Z

The escaping rules on various Windows shells for various windows executable targets are mind numbing to me. I started to try to understand them, maybe I’ll get back to that someday…

borkdude 2021-01-17T19:04:39.019100Z

@lee The most important one I find in almost every tool I write is the escaping of double quotes. This is now the default in babashka.process on Windows.

borkdude 2021-01-17T19:04:51.019300Z

(for shelling out that is)

lread 2021-01-17T19:09:51.020500Z

Ya, that helps tons. But the full story is weird and complicated. https://github.com/lread/info-process-builder, which is currently not at all deep.

lread 2021-01-17T19:10:28.020900Z

Maybe I’ll get back to that someday…

borkdude 2021-01-17T19:11:02.021400Z

The escape function in babashka.process is pluggable, so if you have better rules, you can override it

lread 2021-01-17T19:11:41.021900Z

Dat’s cool, I actually remember you doing that!

borkdude 2021-01-17T19:14:26.022400Z

It manifests itself mostly when sending EDN or JSON as ProcessBuilder args. I've also made a PR to depstar to fix it there

lread 2021-01-17T19:22:43.023700Z

I had such a weird time with trying to send some clj-kondo config that contained [ and ^ along the Windows cmd line that I gave up and moved the config to a file.

borkdude 2021-01-17T19:52:34.024Z

oh yea, the carrets..

lread 2021-01-17T21:20:36.024300Z

🥕😡

vemv 2021-01-17T23:58:33.024400Z

that's handy, thanks! kudos @borkdude for the related work