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.
borkdude 2021-04-11T08:46:13.185800Z

re: winget, I didn't realize winget was a Microsoft tool. might be worth pursueing

littleli 2021-04-11T09:07:22.185900Z

maybe, but not yet.

borkdude 2021-04-11T09:29:28.186400Z

Is it a known issue that powershell splits command line args like this?

-foo:bar:bar
:args ("-foo:" "bar:bar")

borkdude 2021-04-11T09:35:57.187200Z

This snippet from the powershell stuff seems to suggest so?

} elseif ($arg -ceq '-X:') {
      $Mode = "exec"
      $kw, $params = $params
      $ExecAliases = ":$kw"
      $ClojureArgs += $params
This makes command line arg parsing even more complex. Oh well.

borkdude 2021-04-11T09:40:29.187800Z

So if I write the arg parsing in some general purpose programming language I have to detect "if invoked from powershell"? How do I do this?

borkdude 2021-04-11T09:43:47.188500Z

or maybe just make a special rule that always is like: when passing args like -X: foo these args are considered together, even in bash?

borkdude 2021-04-11T09:44:07.188800Z

might be a trade-off...

borkdude 2021-04-11T09:51:48.189Z

I'll only apply that workaround on Windows

borkdude 2021-04-11T09:54:09.189400Z

or wait, powershell also works on linux and macos nowadays

borkdude 2021-04-11T10:04:14.189900Z

On Windows PS:

bb -e '*command-line-args*' -X:foo:bar
("-X:" "foo:bar")
On macOS PS:
bb -e '*command-line-args*' -X:foo:bar
("-X:foo:bar")

borkdude 2021-04-11T10:13:12.190500Z

Juxt checking: -A:, -M: and -X: are the only args that receive optional aliases appended to it, amirite?

borkdude 2021-04-11T10:16:00.190800Z

according to the help yes. :duckie:

borkdude 2021-04-11T10:50:55.191300Z

I wonder if the clojure CLI for Windows works on macOS powershell, but I'm not going there...

borkdude 2021-04-11T10:51:28.191600Z

I expect the above edge case to break it

alexmiller 2021-04-11T12:11:24.192400Z

Yeah, this is some “special” parsing they do

borkdude 2021-04-11T12:23:26.192600Z

Only in the Windows powershell, not in the macOS Powershell. It's really special