Search code examples
yesod

Stack install Yesod fails at GHC decompressing


Running stack install yesod-bin --install-ghc fails at ghc decompressing with message: "Problem while decompressing C:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.4.4.tar.xz"

I try to run this command on Windows 10 64 bit, cmd, with the latest Haskell platform version 8.6.5-core-x86_64 after creating a project with yesod-sqlite template. I've tried a different version as well, with same result. stack install yesod-bin-1.4.11 --install-ghc

> stack install yesod-bin --install-ghc
Preparing to install GHC to an isolated location.
This will not interfere with any system-level installation.
Downloaded ghc-8.4.4.
Downloaded 7z.dll.
Downloaded 7z.exe.
Problem while decompressing C:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.4.4.tar.xz

stack build retries and fails at the same point. I'd expect some proper install instead.

Update: stack setup --verbose output:

Version 1.9.3, Git revision 40cf7b37526b86d1676da82167ea8758a854953b (6211 commits) x86_64 hpack-0.31.1
2019-06-16 16:47:58.662299: [debug] Checking for project config at: E:\Dev\haskell\dosey\stack.yaml
2019-06-16 16:47:58.666295: [debug] Loading project config file stack.yaml
2019-06-16 16:47:58.675310: [debug] Decoding build plan from: C:\sr\build-plan\lts-12.26.yaml
2019-06-16 16:47:58.678295: [debug] Trying to decode C:\sr\build-plan-cache\lts-12.26.cache
2019-06-16 16:47:58.689295: [debug] Success decoding C:\sr\build-plan-cache\lts-12.26.cache
2019-06-16 16:47:58.696299: [debug] Potential GHC builds: standard
2019-06-16 16:47:58.698299: [debug] Found already installed GHC builds:
2019-06-16 16:47:59.145295: [debug] Trying to setup GHC build: standard
2019-06-16 16:47:59.147298: [info] Preparing to install GHC to an isolated location.
2019-06-16 16:47:59.149296: [info] This will not interfere with any system-level installation.
2019-06-16 16:47:59.151297: [debug] Downloading from https://github.com/commercialhaskell/ghc/releases/download/ghc-8.4.4-release/ghc-8.4.4-x86_64-unknown-mingw32.tar.xz to C:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.4.4.tar.xz ...
2019-06-16 16:47:59.153294: [debug] Will check against sha1 hash: 697db44cdf7fdf1a6d83ada61e36857f2e241e3d
2019-06-16 16:47:59.157298: [debug] Will check against sha256 hash: da29dbb0f1199611c7d5bb7b0dd6a7426ca98f67dfd6da1526b033cd3830dc05
2019-06-16 16:48:00.717297: [info] Already downloaded.
2019-06-16 16:48:00.721299: [debug] Downloading from https://github.com/fpco/minghc/blob/master/bin/7z.dll?raw=true to C:\Users\user\AppData\Local\Programs\stack\x86_64-windows\7z.dll ...
2019-06-16 16:48:00.724298: [debug] Will check against sha1 hash: 168a288d4456f0473f66e86a2d6fec4eb6f4b993
2019-06-16 16:48:00.729295: [info] Already downloaded.
2019-06-16 16:48:00.731294: [debug] Downloading from https://github.com/fpco/minghc/blob/master/bin/7z.exe?raw=true to C:\Users\user\AppData\Local\Programs\stack\x86_64-windows\7z.exe ...
2019-06-16 16:48:00.738296: [debug] Will check against sha1 hash: 187dff8a3327da87050f678579816e5bae40c632
2019-06-16 16:48:00.742294: [info] Already downloaded.
2019-06-16 16:48:00.744297: [debug] Run process: C:\Users\user\AppData\Local\Programs\stack\x86_64-windows\7z.exe x -oC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.4.4-tmp1496\ -y C:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.4.4.tar.xz
2019-06-16 16:48:02.169297: [debug] Process finished in 1423ms: C:\Users\user\AppData\Local\Programs\stack\x86_64-windows\7z.exe x -oC:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.4.4-tmp1496\ -y C:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.4.4.tar.xz
Problem while decompressing C:\Users\user\AppData\Local\Programs\stack\x86_64-windows\ghc-8.4.4.tar.xz

Solution

  • Another cabal install attempt revealed that the network package is not willing to compile in Windows at all, at least not in the generic command prompt (cmd), but it requires MingW, MSys or Cygwin. I tried the latter for cabal self update, and it succeeded. Then still in Cygwin, I tried the stack install again, and it worked.

    Unfortunately the stack command's output didn't provide any hint towards Cygwin, and left me clueless for a while. In Cygwin however, Yesod builds and starts, and demo website works properly. Maybe some emphasis against generic windows command prompt could help to avoid such misunderstandings.