<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=utf-8"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style></head><body lang=EN-US link=blue vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Hi Jack,</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks for this! I’ll respond in turn.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> * The big one was students who installed ghc without msys. Installing msys</p><p class=MsoNormal>>   afterwards does not make GHC aware of it. Is there an equivalent of</p><p class=MsoNormal>>   dpkg-reconfigure for chocolatey?</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Yes, the msys2 detection is part of cabal not ghc, (ghc just has a dependency on cabal)</p><p class=MsoNormal>As such</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>choco install cabal -y --reinstall</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Would have corrected it.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> * Some students who were repeating the course had old</p><p class=MsoNormal>>   %appdata%/cabal/config files, which meant that programs failed to copy</p><p class=MsoNormal>>   across.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The presence of an old cabal file itself is not an issue.  The issue is the presence of an old</p><p class=MsoNormal>broken cabal config file.  There were some circumstances (mainly to do with paths with whitespaces) where</p><p class=MsoNormal>the haskell-platform installer may create an invalid config file.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>The cabal user-config command won't behave properly if the config file is syntactically damaged.</p><p class=MsoNormal>So my chocolatey packages refuse to modify it because it's not in a sane state.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>This is why the Haskell platform site recommend running</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>cabal user-config init -f</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>which resets the config file to a clean state. I should however emit a warning when it can’t modify the</p><p class=MsoNormal>config file with instructions on how to fix it.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> </p><p class=MsoNormal>> * Some students somehow managed to wind up with cabal-install installed</p><p class=MsoNormal>>   but not GHC.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>cabal is a dependency of ghc, so it will always be installed after GHC, the only exception here is</p><p class=MsoNormal>if you manually install cabal first.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>e.g. choco install cabal ghc.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>haskell-dev prevents this by having dependencies to all three packages.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> </p><p class=MsoNormal>> * Some students somehow managed to wind up with cabal-install and ghc</p><p class=MsoNormal>>   installed, but not on %path%.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>If the install finished (because of a quirk in how Windows shells update paths) you need to</p><p class=MsoNormal>either run `refreshenv` to refresh your PATH or simply close and open a new shell.</p><p class=MsoNormal>(You really MUST use one of these two, just running cmd again from the outdated cmd won't work for instance).</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>chocolatey runs scripts in a separate shell then the one you're executing in, so it can't update your running</p><p class=MsoNormal>session automatically.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> </p><p class=MsoNormal>> * Some students hit the following error when starting GHCi:</p><p class=MsoNormal>> </p><p class=MsoNormal>> GHCi, version 8.8.3: https://www.haskell.org/ghc/ :? for help</p><p class=MsoNormal>> <command line>: user specified .o/.so/.DLL could not be loaded (addDLL: pthread or dependencies not loaded. (Win32 error 5))</p><p class=MsoNormal>> Whilst trying to load: (dynamic) pthread</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>This is an ABI issue, generally happens when you have a program installed on your computer that has put an incompatible version of pthreads on your PATH.  This is why you shouldn't put MSYS2 on your path either as</p><p class=MsoNormal>when the versions of pthread changes in msys2 it may become incompatoble with the one in GHC. The GHC 8.8.x</p><p class=MsoNormal>series is using GCC 8, and so GHC expects an ABI compatible pthreads.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>We have been trying to tighten up where GHC loads dependencies from, but this is a GHC issue not a chocolatey one.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> * There were also a number of minor issues around spaces in paths, or</p><p class=MsoNormal>>   possibly non-Latin characters in paths, or non-Latin system</p><p class=MsoNormal>>   locale. Many of these will happen regardless of installation method,</p><p class=MsoNormal>>   so it's not fair to lay them at Chocolatey's feet.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Path with white spaces is indeed a general issue when using configure, The approach platform took was</p><p class=MsoNormal>using dos 8.3 short paths, I haven't taken the same approach primarily because dos short names have a</p><p class=MsoNormal>performance overhead, can be disabled and not available on all filesystems.  So the solution should be</p><p class=MsoNormal>something with how configure is invoked.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I am looking into that.  For non-latin locales we are at the mercy of the fact that GCC and binutils on</p><p class=MsoNormal>Windows can't handle them.  While we've always had tickets for them we haven't been able to do much about it.</p><p class=MsoNormal>However since we have now started experimenting with binary patch gcc we might be able to.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> > You can still use Haskell-dev if you want older GHCs. Just install it and then</p><p class=MsoNormal>> > Downgrade the ghc.</p><p class=MsoNormal>> </p><p class=MsoNormal>> I was not aware that this was possible. Thanks for telling me.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>It's also possible to install any number of GHCs concurrently. Just give chocolatey the -m flag</p><p class=MsoNormal>when installing ghc, which stands for multiple</p><p class=MsoNormal><o:p> </o:p></p><div style='mso-element:para-border-div;border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in'><p class=MsoNormal style='border:none;padding:0in'><b>From: </b><a href="mailto:jack@jackkelly.name">Jack Kelly</a><br><b>Sent: </b>Saturday, April 25, 2020 11:00<br><b>To: </b><a href="mailto:lonetiger@gmail.com">lonetiger@gmail.com</a><br><b>Cc: </b><a href="mailto:dreixel@gmail.com">dreixel@gmail.com</a>; <a href="mailto:haskell-cafe@haskell.org">haskell</a><br><b>Subject: </b>Re: [Haskell-cafe] When did it become so hard toinstallHaskellonWindows?</p></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Dear Tamar,</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks for your response and suggestions. I'll respond pointwise:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> What made it remarkably tough for students to set up on their machines?</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>* The big one was students who installed ghc without msys. Installing msys</p><p class=MsoNormal>  afterwards does not make GHC aware of it. Is there an equivalent of</p><p class=MsoNormal>  dpkg-reconfigure for chocolatey?</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>* Some students who were repeating the course had old</p><p class=MsoNormal>  %appdata%/cabal/config files, which meant that programs failed to copy</p><p class=MsoNormal>  across.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>* Some students somehow managed to wind up with cabal-install installed</p><p class=MsoNormal>  but not GHC.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>* Some students somehow managed to wind up with cabal-install and ghc</p><p class=MsoNormal>  installed, but not on %path%.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>* Some students hit the following error when starting GHCi:</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>GHCi, version 8.8.3: https://www.haskell.org/ghc/ :? for help</p><p class=MsoNormal><command line>: user specified .o/.so/.DLL could not be loaded (addDLL: pthread or dependencies not loaded. (Win32 error 5))</p><p class=MsoNormal>Whilst trying to load: (dynamic) pthread</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>* Some students seem to have computers that are straight-up haunted.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>* There were also a number of minor issues around spaces in paths, or</p><p class=MsoNormal>  possibly non-Latin characters in paths, or non-Latin system</p><p class=MsoNormal>  locale. Many of these will happen regardless of installation method,</p><p class=MsoNormal>  so it's not fair to lay them at Chocolatey's feet.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Unfortunately, I can't give you more detailed information than</p><p class=MsoNormal>this. This semester was tougher than usual because of the remote</p><p class=MsoNormal>troubles with COVID-19, and on top of that many of the students who had the</p><p class=MsoNormal>really cursed problems stopped responding before we could get to the</p><p class=MsoNormal>bottom of things. Perhaps they dropped the course?</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> You can still use Haskell-dev if you want older GHCs. Just install it and then</p><p class=MsoNormal>> Downgrade the ghc.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I was not aware that this was possible. Thanks for telling me.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> I would be quite interested to figure out what the pain points were.</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> Surely if they are new to Windows they would have come from a platform where</p><p class=MsoNormal>> they know what a package manager is.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Not necessarily. These are first-year CS students, some of whom have</p><p class=MsoNormal>never programmed before, although they're computer-literate. I have</p><p class=MsoNormal>personally seen students who ask questions like "what's a terminal?" in</p><p class=MsoNormal>the first lab session pass the course with very good marks.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> Would providing a binary to automate the steps work for you? I have been reluctant to</p><p class=MsoNormal>> do so because I don’t want to hide what the installer is doing.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I think this would be extremely helpful.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>> And to be clear, if it because you don’t want to use a commandline and want an installer</p><p class=MsoNormal>> Chocolatey also provides a GUI overlay, It is after all. A bog standard package manager.</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> https://github.com/chocolatey/ChocolateyGUI/releases/download/0.17.0/ChocolateyGUI.msi</p><p class=MsoNormal>><o:p> </o:p></p><p class=MsoNormal>> Is the latest release. It has the familiar “Click and installer asks for UAC and magic happens in background”.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>I was not aware that this existed. It may help, thanks for showing it to</p><p class=MsoNormal>me.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Thanks again.</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>Best,</p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>-- Jack</p><p class=MsoNormal><o:p> </o:p></p></div></body></html>