Hi, congrats for the new windows support. I've tried to run the bootstrap executable in windows 7 and i've got an error about missing powershell definitions. I guess the builtin powershell version of windows 7, 2.0 is not compatible with the tool usage (does it expect powershell-3.0, i guess?).
In the wikipedia page for powershell we have the default ps version per os:
PowerShell 2.0 is integrated with Windows 7 and Windows Server 2008 R2[59] and is released for Windows XP with Service Pack 3, Windows Server 2003 with Service Pack 2, and Windows Vista with Service Pack 1
PowerShell 3.0 is integrated with Windows 8 and with Windows Server 2012. Microsoft has also made PowerShell 3.0 available for Windows 7 with Service Pack 1, for Windows Server 2008 with Service Pack 1, and for Windows Server 2008 R2 with Service Pack 1.[71][72]
Javier Neira changed title from Support for windows 7 (or document which versions are supported) to Support for powershell 2.0 (default version in windows 7) (or document which versions are supported)
changed title from Support for windows 7 (or document which versions are supported) to Support for powershell 2.0 (default version in windows 7) (or document which versions are supported)
It ended with a certificate error trying to get https://gitlab.haskell.org/haskell/ghcup-hs/-/raw/windows-support/bootstrap-haskell. Then i tried the same command standalone with -k and it failed cause cabal is not in PATH (although the script is supposed to install cabal at some point?):
PS D:\ws\haskell\hls> $GhcupDir = "C:\ghcup"; $MsysDir = ('{0}\msys64' -f $GhcupDir); $Bash = ('{0}\usr\bin\bash' -f $MsysDir)PS D:\ws\haskell\hls> & "$Bash" -lc "export PATH=`"/c/ghcup/bin:`$PATH`" ; curl --proto =https --tlsv1.2 -sSf -k https://gitlab.haskell.org/haskell/ghcup-hs/-/raw/windows-support/bootstrap-haskell | bash"Welcome to Haskell!This script will download and install the following binaries: * ghcup - The Haskell toolchain installer * ghc - The Glasgow Haskell Compiler * cabal - The Cabal build tool for managing Haskell software * stack - (optional) A cross-platform program for developing Haskell projects * hls - (optional) A language server for developers to integrate with their editor/IDEghcup installs only into the following directory, which can be removed anytime: C:\ghcupPress ENTER to proceed or ctrl-c to abort.Note that this script can be re-run at any given time.Press ENTER to proceed or ctrl-c to abort.Installation may take a while.Create an initial cabal.config including relevant msys2 paths (recommended)?[Y] Yes [N] No [?] Help (default is "Y").Ymain: línea 63: cabal: orden no encontrada"cabal user-config -a extra-prog-path: C:\ghcup\bin, C:\Users\user\AppData\Roaming\cabal\bin, C:\ghcup\msys64\usr\bin, C:\ghcup\msys64\mingw64\bin -a extra-include-dirs: C:\ghcup\msys64\mingw64\include -a extra-lib-dirs: C:\ghcup\msys64\mingw64\lib -f init" failed!
It worths to mention that i have cabal in PATH for the dos/ps console but no inside the mingw console (cause it does not inherit the windows system PATH by default i think). Maybe it is cause i executed the command standalone instead as part of the main bootstrap script?
Also note that i had to pulse enter two times, without any new message between both.
At this point i only has ghcup.exe in C:\ghcup\bin.
At last consideration, i already have a msys2 installation configured for my use cases, maybe it would be nice that ghcup reuses it instead download a new one?
It ended with a certificate error trying to get https://gitlab.haskell.org/haskell/ghcup-hs/-/raw/windows-support/bootstrap-haskell.
That sounds weird. I've never got one and there shouldn't be one.
Then i tried the same command standalone with -k and it failed cause cabal is not in PATH (although the script is supposed to install cabal at some point?):
The command standalone from within powershell doesn't behave well (e.g. you're missing output). But it does work when converted to an executables. Running it directly from within powershell, you need something different:
I didn't use that because it makes the script more difficult, since this is an interactive shell and now I have to set signal traps in place etc for the window to not vanish on errors and so on.
It worths to mention that i have cabal in PATH for the dos/ps console but no inside the mingw console (cause it does not inherit the windows system PATH by default i think). Maybe it is cause i executed the command standalone instead as part of the main bootstrap script?
C:\ghcup\bin is added to PATH in the above invocation you're running, so I don't see why it would not find cabal, unless the installation failed or the binary is broken. This isn't powershell environment, this is bash environment.
However, the powershell script also runs this, which you might have omitted:
At this point i only has ghcup.exe in C:\ghcup\bin.
That's definitely not right... so I'm assuming the shell is borked and you have to do the msys2_shell.cmd thing from above.
At last consideration, i already have a msys2 installation configured for my use cases, maybe it would be nice that ghcup reuses it instead download a new one?
Yes, I considered that, but currently C:\ghcup\msys64 is hardcoded. Power users could just download the ghcup binary and not do anything with the boostrap script.
If you have your own msys2, you have to understand:
how to configure cabal.config to use those paths
how to expose them temporarily in PATH in case you want to use ghcup compile
Just hardcoding seemed like the easiest solution, especially because you can get nasty problems if your msys2 path is too long, your installation isn't proper etc etc. That's gonna be support work for me.
Packaging Requires .NET Core SDK version 1.0.0 or higher and the .NET 4.6.2 Developer Pack installed.Resulting executables can be run on machines running PowerShell v3 or greater.Resulting executables run under the .NET 4.6.2 framework.
Hi, i've tried the new brand script from master in windows 7 and i've hit an error which was not thrown previously:
No se encuentra ninguna sobrecarga para "PromptForChoice" y el número de argumentos "4".En D:\ws\haskell\issues\ghcup-sandbox\bootstrap-haskell.ps1: 105 Carácter: 39+ $decision = $Host.UI.PromptForChoice <<<< ('Install GHCup' + CategoryInfo : NotSpecified: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : MethodCountCouldNotFindBest
$decision = $Host.UI.PromptForChoice('Install GHCup' , 'GHCup is already installed, what do you want to do?' , [System.Management.Automation.Host.ChoiceDescription[]] @('&Reinstall' '&Continue' '&Abort'), 1)
changing the two existing calls to $Host.UI.PromptForChoice made the script work
Ok, the bash script launched at final step failed due to the lack of the haskell.org server certificate in the ghcup msys installation. The initial -k did the trick for the very first fetch of https://www.haskell.org/ghcup/sh/bootstrap-haskell-windows but the script itself does several calls to haskell.org, so you need to have the server certificate installed. Dont know why firefox accepts the certificate with no problem but msys2 curl doesnt.