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.
thheller 2019-05-14T06:56:33.035300Z

@carkh although I'm on windows myself I don't actually know how powershell works and only use WSL myself

thheller 2019-05-14T06:56:48.035700Z

if there is something I can do to make detecting clojure better I'd be happy to do that

thheller 2019-05-14T06:58:09.036100Z

right now I'm using https://www.npmjs.com/package/which to detect the clojure command

thheller 2019-05-14T06:59:20.036900Z

I guess this needs a .ps1?

thheller 2019-05-14T07:01:14.037400Z

.cmd actually sucks because you get the annoying Terminate batch job (Y/N) on CTRL+C

carkh 2019-05-14T08:02:50.039100Z

@thheller as far as i know there is no file that you can call, i think the clj installer defines the clj and clojure commands out of a powershell module...

carkh 2019-05-14T08:03:31.039800Z

it looks like the installer makes those commands available globally to any powershell command line

carkh 2019-05-14T08:05:04.041200Z

the difficulty i had in making a batch (or cmd file) to invoke clojure via powershell resides in escaping the different levels of nested double quotes

carkh 2019-05-14T08:07:13.042800Z

because you have to keep in mind the escaping rules from the cmd file, then from powershell and java maybe ?

thheller 2019-05-14T08:08:08.043600Z

hmm I guess I need to figure out how powershell actually works 😛

carkh 2019-05-14T08:08:11.043700Z

It might be possible to sidestep the problem entirely by using one of those node libraries to work directly with powershell

carkh 2019-05-14T08:08:48.044100Z

but i know nothing about node..

carkh 2019-05-14T08:10:39.045100Z

@thheller well not a problem for me, but i guess you might want to think about it at some point in the future

carkh 2019-05-14T08:11:31.046500Z

looks like the clojure team is full steam ahead on pwoershell now, and you ain't turning that boat easily =)

2019-05-14T08:11:57.046900Z

I'm unable to download maven dependencies behind a proxy. The clj tool doesn't seem to use the HTTP(S)_PROXY environment variables. Is there a way around this?

borkdude 2019-05-14T09:07:13.047700Z

@carkh I ran into exactly the same problem of clojure being a Powershell thing when trying to get compilation with GraalVM in Windows working

borkdude 2019-05-14T09:08:12.048400Z

if you start something from a regular cmd.exe shell, are environment variables passed down to a powershell.exe shell? that’s also something that wasn’t clear to me

borkdude 2019-05-14T09:09:41.048900Z

I’ll revert to lein native-image for GraalVM for now, so I can stay within cmd.exe. I also ran into another issue with clj.native-image (TDEPS-128).

alexmiller 2019-05-14T11:42:56.050800Z

Latest version of clj uses the Maven proxy settings in settings.xml

alexmiller 2019-05-14T11:46:24.051700Z

See the Maven Proxies section in https://clojure.org/reference/deps_and_cli

borkdude 2019-05-14T21:59:55.052800Z

since it’s now feasible to create Windows binaries with Clojure + GraalVM, maybe it makes sense to do this instead of the powershell approach? clojure.exe

carkh 2019-05-14T22:03:58.054Z

That would be neat

borkdude 2019-05-14T22:05:35.054200Z

just got this working today: https://twitter.com/borkdude/status/1128419191588106241

carkh 2019-05-14T22:07:48.054700Z

17mb not too bad, what's the startup time like ?

borkdude 2019-05-14T22:09:13.055Z

it says so in the picture in the tweet

borkdude 2019-05-14T22:10:03.056300Z

the binary can be smaller, but I’m compiling along some resources. you can expect 10MB if you have only some code

carkh 2019-05-14T22:10:04.056400Z

hum I understood it as saying trhe duration of the linting operation which would be after startup i guess ?

borkdude 2019-05-14T22:10:18.056700Z

that’s true, linting one file takes 10ms

borkdude 2019-05-14T22:10:23.056900Z

startup is instant

carkh 2019-05-14T22:10:28.057100Z

nice

borkdude 2019-05-14T22:11:04.057500Z

but I found 10ms already instant, that’s why I said that 😉

carkh 2019-05-14T22:11:43.058300Z

i was thinking maybe a half second startup time, so you beat that at the very least =)

borkdude 2019-05-14T22:12:42.059Z

it’s nice that all the major OSes can now be targeted with the same Clojure code, natively