[Haskell-cafe] When did it become so hard to install Haskell on Windows?

Irfon-Kim Ahmad irfon at ambienautica.com
Sun May 10 14:25:09 UTC 2020


Yes, you need to know several magic things to go this route.

The first is to have that link that Ben Gamari provided in the first 
place, which is not an obvious thing at all.

The second is to know about compression formats that nobody uses on 
Windows. The .tar.lz file is much smaller can be decoded on Windows 
using lzip. lzip is available for windows as a 32-bit command-line 
utility from here:

https://www.nongnu.org/lzip/

You need to unzip the file, copy the binaries to somewhere handy 
(probably a folder you create in c:\Program Files (x86) ), and then add 
that folder to the path. Then you need to go to the command line and use 
lzip -d {filename} to decompress the file. This leaves you with a .tar 
file, which Windows also cannot handle. Installing 7zip makes that 
extractable, however.

You can, however, reduce the complexity of the process at the expense of 
bandwidth (which most people have copious amounts of these days) by 
downloading the .tar.xz version. Windows still can't handle this 
natively, but 7zip can handle both the .xz and .tar decompressions using 
a single program.

The third thing you need to know is that:

ghc-8.10.1-windows-extra-src.tar.lz (or .xz)

...which is the only thing in there with "Windows" in the name, is not, 
in fact, the one you want. Or at least, not that I can tell. It appears 
to be a bunch of extra tools required to build the source code on 
Windows. There's a lot in it, so I didn't explore it fully. Also, within 
the .lz is a bunch of .xz files, but fortunately 7zip can handle those. 
In any case, the file you actually want is the cryptically-named:

ghc-8.10.1-x86_64-unknown-mingw32.tar.lz

...because of course "unknown" in this case means Windows, I guess?

Decompressing that, untarring the result, moving the resulting folder to 
your 'c:\Program Files' folder, and adding the bin subfolder to your 
path does indeed get you a working ghc and ghci -- from the command 
line. It doesn't include the GUI versions that I can discern.

Nonetheless, this is still probably the easiest current method of 
installing it. It's not actually hard to do, it just requires you to 
know several non-obvious things that a new user probably won't know.

I'm honestly baffled by the use of .tar.lz or .tar.xz for distributing 
Windows software. Just using .zip would guarantee that anyone can 
decompress it without having to install any tools -- Windows supports 
.zip files natively.

In any case, since it doesn't appear to be obviously documented 
anywhere, the steps to go this route are:

1. Download and install 7zip from here: https://www.7-zip.org/download.html

2. Navigate to the latest version's folder from here: 
https://downloads.haskell.org/ghc/

3. Download ghc-[latest version]-x86_64-unknown-mingw32.tar.xz

4. Right-click it, choose 7zip, and choose Extract to Here

5. Right-click the resulting .tar file, and choose Extract to [folder 
named after file]

6. In that folder, you should find a folder named ghc-[version]. Copy 
that to 'C:\Program Files'.

7. In Control Panel, search for "Environment Variables", and click "Edit 
the System Environment Variables" or "Edit the Environment Variables for 
your Account" depending on whether you wish other users to be able to 
use the software.

8. Click "Environment Variables".

9. Scroll to "Path" under either your username or 'System Variables' 
[see note above] and click Edit.

10. Click "New" and add the 'bin' subfolder of the folder you copied 
(ex. C:\Program Files\ghc-8.10.1\bin)

11. It should now be installed. To test it, open a command prompt of 
your choice and type "ghci" or "ghc".


On 2020-05-10 6:20 a.m., Francesco Ariis wrote:
> Il 25 aprile 2020 alle 11:22 José Pedro Magalhães ha scritto:
>> I honestly don't want this to sound like a rant. I genuinely would like
>> to understand why this multi-step, multi-tool, multi-website process was
>> introduced, how it is superior to a single installer, and whether this is
>> really the process we want newcomers to the language have to follow.
> A data point from a user (OS: Win10) on freenode/#haskell-it today. Shared
> with permission, translated by me:
>
> - he asked: «Hello. To Windows users, can you link the installer to me?
>    It disappeared from the site, now I need to install Chocolatey and to be
>    honest I would prefer not to».
>    I redirected him to the page mentioned here [1] by Ben Gamari and asked
>    why Chocolatey was not an option for him.
>    Reply: «I don't want to use a third party tool, Chocolatey immediately
>    asks me to register to its newsletter... why? Those things are very
>    annoying, I'd rather install Haskell on an RPi and use it via ssh 😅»;
>
> - once the download from [1] was over:
>    «I have downloaded it (400Mb) but I cannot extract it and I don't know
>    what to do with it, it's a .tar.lz file».
>    Indeed after a cursory search, it seems a common (on Windows) open-source
>    extracting tool like 7-zip does not natively support the format [2].
>    Not having used Windows in 10 years I suggested to try WinZip -- stupid
>    idea, as it does not support ".tar.lz" either and it is proprietary
>    nagware;
>
> - I then directed him to the Stack Win64 installer [3]. Feedback:
>    «Microsoft Defender blocks it! 😂»;
>
> - after this, the user created an Ubuntu VM and installed Haskell via
>    "apt-get install haskell-platform". The installation took a few minutes,
>    he seemed satisfied with it.
>
>
> [1] https://mail.haskell.org/pipermail/haskell-cafe/2020-April/132150.html
> [2] https://sourceforge.net/p/sevenzip/discussion/45798/thread/9e77409b/?limit=25
> [3] https://get.haskellstack.org/stable/windows-x86_64-installer.exe
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.


More information about the Haskell-Cafe mailing list