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.
ajoberstar 2019-02-28T02:28:45.058Z

Just a quick update. Have made a decent amount of progress on fixes to the clojure.ps1. Have been able to start a REPL, start rebel.readline via alias, and a couple other things. The big challenge is reconciling the PowerShell token parsing with the arguments clj expects. Have had issues both with what how powershell parses the args that come into the script and using the args that tools.deps outputs to the "<checksum>.main" file. Current workarounds feel a little brittle. Will think more about this (and provide some more specific questions and sample code/patches) as I get through more testing.

alexmiller 2019-02-28T02:47:31.058300Z

this is a problem area with *nix too

alexmiller 2019-02-28T02:50:36.059400Z

what's the scope of the changes needed in the script? happy to take a patch on the windows branch

ajoberstar 2019-02-28T03:40:24.061700Z

I temporarily broke the windows stuff into its own repo, purely to make the testing process easier for myself. Can see it here: https://github.com/ajoberstar/ClojureTools Mostly its been a lot of PowerShell syntax issues were things weren't fully translated from bash to PowerShell. There's a couple weird spots (where I've marked TODOs) that have to do some string replacements that I'm not super happy with right now.

ajoberstar 2019-02-28T03:41:59.062400Z

Once I get more of the kinks worked out, I'll get this into a better format to submit patches back to the brew-install repo.

alexmiller 2019-02-28T04:17:01.062800Z

cool, thanks for all the work on it

seancorfield 2019-02-28T04:43:05.001Z

@ajoberstar I don't know PowerShell but I'd be happy to do some testing for you. I'm very keen to see clojure/`clj` come to Windows but I just don't have the PS chops to contribute.

seancorfield 2019-02-28T04:44:00.001900Z

(right now I'm running the Linux version of clojure/`clj` on Ubuntu via WSL on Windows 10 but that has some... "limitations", shall we say)

ajoberstar 2019-02-28T05:05:16.002900Z

@seancorfield That would be appreciated. The readme on the repo I linked documents how to install it for testing. I think it's usable for basic stuff, but I'm sure there are still plenty of corners that need fixing. Let me know if you find any issues.

seancorfield 2019-02-28T05:15:06.003400Z

'k... let's see how I get on (since I use cmd not PS when I open a Windows shell)...

seancorfield 2019-02-28T05:20:21.003600Z

PS C:\Users\sean\clojure\cool&gt; Import-Module ClojureTools
Import-Module : The specified module 'ClojureTools' was not loaded because no valid module file was found in any
module directory.
At line:1 char:1
+ Import-Module ClojureTools
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : ResourceUnavailable: (ClojureTools:String) [Import-Module], FileNotFoundException
    + FullyQualifiedErrorId : Modules_ModuleNotFound,Microsoft.PowerShell.Commands.ImportModuleCommand

PS C:\Users\sean\clojure\cool&gt;

seancorfield 2019-02-28T05:20:43.003900Z

Based on following the readme...

seancorfield 2019-02-28T05:21:25.004100Z

PS C:\Users\sean\clojure\cool&gt; cd C:\Users\sean\Documents\WindowsPowerShell\Modules\
PS C:\Users\sean\Documents\WindowsPowerShell\Modules&gt; ls


    Directory: C:\Users\sean\Documents\WindowsPowerShell\Modules


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----        2/27/2019   9:18 PM                ClojureTools


PS C:\Users\sean\Documents\WindowsPowerShell\Modules&gt;

seancorfield 2019-02-28T05:22:10.004300Z

@ajoberstar ^^

ajoberstar 2019-02-28T13:25:28.005100Z

@seancorfield I'll be able to take a look this evening to see what's wrong about the steps I gave.