ghci panic! upon initial installation in VSCode
Summary
Upon installation of Haskell in VSCode using Chocolatey and ghc, I wind up with this error:
ghc.exe: Could not load 'libwinpthread-1.dll'. Reason: addDLL: libwinpthread-1.dll or dependencies not loaded. (Win32 error 1920)
ghc.exe: panic! (the 'impossible' happened)
(GHC version 8.6.5 for x86_64-unknown-mingw32):
loadArchive "C:\\ProgramData\\chocolatey\\lib\\ghc\\tools\\ghc-8.6.5\\mingw\\x86_64-w64-mingw32\\lib\\libpthread.dll.a": failed
Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
Steps to reproduce
- Uninstall Haskell if already installed
- Install Chocolatey using Windows Powershell
- Run
choco install -y msys2
in Powershell - Open an MSYS terminal with
C:\tools\msys64\msys2.exe
. Runpacman -Syuu
in the window. Close MSYS window when done. - Run
choco install -y ghc --version 8.6.5
to install GHC. - Install VSCode
- In VSCode, install "Haskell Syntax Highlighting" and "haskell-ghcid" extensions
- Run
ghci
in VSCode inbuilt terminal
Environment
- GHC version used: 8.6.5
- Operating System: Windows 10 v10.0.19041 Build 19041
- Device: Surface Pro 6
- System Architecture: x64