tools.deps

Windows installation scripts

Details

  • Type: Task Task
  • Status: Open Open
  • Priority: Critical Critical
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows

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.

  1. clj.bat
    03/Feb/18 1:47 PM
    0.1 kB
    Konrad Mrożek
  2. clj.ps1
    22/Jan/18 6:17 AM
    0.0 kB
    Konrad Mrożek
  3. clojure.bat
    03/Feb/18 1:47 PM
    0.1 kB
    Konrad Mrożek
  4. clojure.ps1
    03/Feb/18 1:47 PM
    6 kB
    Konrad Mrożek
  5. funcs.ps1
    01/Feb/18 3:03 PM
    0.7 kB
    Konrad Mrożek
  6. install.ps1
    22/Jan/18 6:17 AM
    2 kB
    Konrad Mrożek

Activity

Hide
Konrad Mrożek added a comment -

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

Show
Konrad Mrożek added a comment - I forgot to mention that those scripts work on MacOS. They should work on Linux too (install.ps1 should be executed with sudo).
Hide
Alex Miller added a comment -

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.

Show
Alex Miller added a comment - 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.
Hide
Konrad Mrożek added a comment -

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.

Show
Konrad Mrożek added a comment - 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.
Hide
Konrad Mrożek added a comment -

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

Show
Konrad Mrożek added a comment - Newer version with -Sdeps and -Stree. It is also refactored a little bit.
Hide
Alex Miller added a comment -

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

Show
Alex Miller added a comment - Thanks! I am very interested in evaluating this, but probably won't get to it immediately.
Hide
Alex Miller added a comment -

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

Show
Alex Miller added a comment - Just an update to mention that I've been working through these making some tweaks, just not done yet.
Hide
Adrian A. added a comment -

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.

Show
Adrian A. added a comment - 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.
Hide
Alex Miller added a comment -

Definitely in the plan

Show
Alex Miller added a comment - Definitely in the plan
Hide
Yehonathan Sharvit added a comment -

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

Show
Yehonathan Sharvit added a comment - Any ETA for the availability of Clojure CLI's scripts for Windows?
Hide
Alex Miller added a comment -

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

Show
Alex Miller added a comment - No, haven't had time to work on it recently. Still high in the priority list.
Hide
Alex Miller added a comment - - edited

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.

Show
Alex Miller added a comment - - edited 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.
Hide
Martin Clausen added a comment - - edited

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

Show
Martin Clausen added a comment - - edited 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
Hide
Alex Miller added a comment -

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.

Show
Alex Miller added a comment - 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.

People

Vote (9)
Watch (9)

Dates

  • Created:
    Updated: