<< Back to previous view

[TDEPS-67] Windows installation scripts Created: 22/Jan/18  Updated: 12/Apr/19  Resolved: 12/Apr/19

Status: Closed
Project: tools.deps
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Critical
Reporter: Konrad Mrożek Assignee: Alex Miller
Resolution: Completed Votes: 12
Labels: None
Environment:

Windows


Attachments: Text File 0001-Ignore-Eclipse-files.patch     Text File 0002-Ensure-shell-files-are-checked-out-with-lf-endings.patch     Text File 0003-Install-on-Windows-as-a-PowerShell-Module.patch     Text File 0004-Install-on-Windows-as-a-PowerShell-Module.patch     File clj.bat     File clj.ps1     File clojure.bat     File clojure.ps1     File funcs.ps1     File install.ps1    

 Description   

There is no version of Clojure CLI's scripts for Windows. I developed them with Powershell. Scripts contain installation script as well. There are some changes though.

1. Windows doesn't contain tar tool, so the clojure-tools-$version.tar.gz has to be packed additionally with clojure-tools-$version.zip file.
2. I didn't find simple way for hashing with CRC32 with Powershell so it does use MD5 hashing function.
3. clj script just calls clojure script, because there was no need for rlwrap in Windows (at least Windows 10).
4. I've added additional .bat counterparts (clj.bat and clojure.bat) for compatibility with other tools like Emacs.



 Comments   
Comment by Konrad Mrożek [ 22/Jan/18 6:19 AM ]

I forgot to mention that those scripts work on MacOS. They should work on Linux too (install.ps1 should be executed with sudo).

Comment by Alex Miller [ 22/Jan/18 9:21 AM ]

Thanks for working on this! Before I can consider your contribution, I need to make sure you have a signed Contributor's Agreement on file - please see https://clojure.org/community/contributing for how to do so.

Comment by Konrad Mrożek [ 23/Jan/18 3:57 AM ]

I have signed the Contributor's Agreement a week ago or so. The form generated document on my last name, but my full name is in the agreement.

Comment by Konrad Mrożek [ 01/Feb/18 3:03 PM ]

Newer version with -Sdeps and -Stree. It is also refactored a little bit.

Comment by Alex Miller [ 01/Feb/18 3:19 PM ]

Thanks! I am very interested in evaluating this, but probably won't get to it immediately.

Comment by Alex Miller [ 04/Mar/18 10:44 AM ]

Just an update to mention that I've been working through these making some tweaks, just not done yet.

Comment by Adrian A. [ 17/Jun/18 1:57 PM ]

Would be nice if this package could be installed with Chocolatey too:
https://dev.clojure.org/jira/browse/TDEPS-84
e.g. This would also allow to specify as a dependency a minimal JDK version or GIT (with Unix tools - tar, curl, etc.) for bash script compatibility.

Comment by Alex Miller [ 17/Jun/18 5:35 PM ]

Definitely in the plan

Comment by Yehonathan Sharvit [ 20/Sep/18 6:31 AM ]

Any ETA for the availability of Clojure CLI's scripts for Windows?

Comment by Alex Miller [ 20/Sep/18 8:18 AM ]

No, haven't had time to work on it recently. Still high in the priority list.

Comment by Alex Miller [ 30/Jan/19 3:19 PM ]

I've asked the community to help with moving this forward as my time to do so is limited.

The scripts in this ticket have been applied and substantially updated in this branch: https://github.com/clojure/brew-install/tree/windows-port

There is a room in Clojurians Slack under #clj-on-windows if you would like to chat about it.

You can build (on a *nix system, which is where we CI) by running script/package.sh. This should generate a zip file at target/clojure-tools-<version>.zip. That zip contains a win-install.ps1 script, and other files - the executable uber jar file, the scripts, example deps.edn file, install-level deps.edn file, etc.

At this point, I haven’t worked on this in about 8 months, so I don’t recall how well that install works, or how well the scripts work. It would be good to test all of that on Windows and see how badly broken it is. I assume there are some things to fix. If those are small, you can just tell me what to fix or feed me patches. If that becomes an obstacle, we’ll look at commit rights.

And then I think it’s worth thinking about the best installation path for people. I don’t know if it’s a chocolatey package, or an executable zip, or whatever. I haven’t developed on Windows for 15 years, so I’m not in touch with current best practices. If there are options, let’s make a table somewhere and evaluate.

Keeping all this stuff in the brew-install repo (I know, name is bad) and part of the main build is advantageous because I can then build and release all the versions at the same time, which seems preferable unless there is some reason it can’t work, so I’d like to push that as far as possible.

Comment by Martin Clausen [ 04/Feb/19 1:40 PM ]

Latest version of win-install.ps1 at brew-install fails for me with the below.

Invoke-WebRequest : Anmodningen blev afslået: Der kunne ikke etableres en sikker kanal til SSL/TLS.
At C:\Users\mac\tmp\brew-install\src\main\resources\win-install.ps1:10 char:5
+ Invoke-WebRequest Uri $ClojureToolsUrl -OutFile "clojure-tools$ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebExc
eption
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

This can be fixed by adding:

[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12

Now the script fails with:

Invoke-WebRequest : Fjernserveren returnerede en fejl: (403) Forbudt.
At C:\Users\mac\tmp\brew-install\src\main\resources\win-install.ps1:11 char:5
+ Invoke-WebRequest Uri $ClojureToolsUrl -OutFile "clojure-tools$ ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-WebRequest], WebException
+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

Comment by Alex Miller [ 06/Feb/19 9:01 AM ]

Are you using the script directly out of the repo or the version that is a result of the build? There are some text replacements, etc that happen in the build.

Comment by Andrew Oberstar [ 06/Mar/19 7:20 PM ]

Minor patch (0001-Ignore-Eclipse-files.patch) to ignore some files that were generated by VS Code when I opened the project.

Comment by Andrew Oberstar [ 06/Mar/19 7:21 PM ]

Minor patch (0002-Ensure-shell-files-are-checked-out-with-lf-endings.patch) to ensure shell files get checked out with lf bindings on windows.

Comment by Andrew Oberstar [ 06/Mar/19 7:23 PM ]

The real patch (0003-Install-on-Windows-as-a-PowerShell-Module.patch) for updating the Windows install setup. This one converts it to a PowerShell module, and the install script copies it out to the module path for installation (prompting for which location the user wants to use).

See the patch for additional detail, but this isn't "done" but it does provide some fixes and a working install script (as well as I could test it without the download piece in place). I plan to continue comparing the script to the linux one to deal with issues like the one Sean reported.

See also my temporary Git repo for the PowerShell module testing.

https://github.com/ajoberstar/ClojureTools

Comment by Andrew Oberstar [ 06/Mar/19 8:59 PM ]

Update the patch (0004-...patch) with the some additional fixes for parity with the Linux script. Still needs the exhaustive test of each option.

Comment by Alex Miller [ 08/Mar/19 1:37 PM ]

Merged everything over and now building alpha versions.

See https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows for info.

Comment by Alex Miller [ 12/Apr/19 4:03 PM ]

I'm going to call this "done" as far as it getting out to the world. Obviously more work to do, but that can be separate tickets as needed.

Generated at Tue May 21 08:26:04 CDT 2019 using JIRA 4.4#649-r158309.