Can't build Yesod project using Haskell's stack tool
<p>I've recently been trying to use <code>stack</code> to create a Yesod project, given the <a href="http://www.yesodweb.com/page/quickstart" rel="nofollow">quick start</a> at their website:</p>

<ol>
<li>Follow the installation instructions for stack to get stack.</li>
<li>Create a new scaffolded site: <code>stack new my-project yesod-sqlite &amp;&amp; cd my-project</code></li>
<li>Install the yesod command line tool: <code>stack build yesod-bin cabal-install --install-ghc</code></li>
<li>Build libraries: <code>stack build</code></li>
<li>Launch devel server: <code>stack exec -- yesod devel</code></li>
<li>View your Yesod site at <a href="http://localhost:3000/" rel="nofollow">http://localhost:3000/</a></li>
</ol>

<p>The problem I've encounter appears when I try to do <code>stack build yesod-bin cabal-install --install-ghc</code>, it says:</p>

<pre><code>&lt;command line&gt;: cannot satisfy -package Cabal-1.18.1.5
(use -v for more information)
Exit code ExitFailure 1 while running ["ghc","-clear-package-db","-global-package-db","-hide-all-packages","-package","base","-package","Cabal-1.18.1.5","/tmp/stack8413/Setup.hs","-o","/home/self/.stack/setup-exe-cache/x86_64-linux/tmp-setup-Simple-Cabal-1.18.1.5-ghc-7.10.3","-rtsopts"] in /tmp/stack8413/
</code></pre>

<p>Trying with the <code>-v</code> flag brings this beauty:</p>

<pre><code>Version 1.1.2, Git revision cebe10e845fed4420b6224d97dcabf20477bbd4b (3646 commits) x86_64 hpack-0.14.0
2016-07-28 16:44:34.775633: [debug] Checking for project config at: /home/self/my-project/stack.yaml @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Config src/Stack/Config.hs:811:9)
2016-07-28 16:44:34.776033: [debug] Loading project config file stack.yaml @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Config src/Stack/Config.hs:829:13)
2016-07-28 16:44:34.779083: [debug] Checking whether stack was built with libgmp4 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Config src/Stack/Config.hs:326:5)
2016-07-28 16:44:34.779324: [debug] Run process: ldd /usr/bin/stack @(stack_K1e6VSKnzs1HNYmTJGAgTQ:System.Process.Read src/System/Process/Read.hs:283:3)
2016-07-28 16:44:34.793798: [debug] Stack was not built with libgmp4 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Config src/Stack/Config.hs:330:14)
2016-07-28 16:44:34.794072: [debug] Trying to decode /home/self/.stack/build-plan-cache/x86_64-linux/lts-6.9.cache @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-07-28 16:44:34.832346: [debug] Success decoding /home/self/.stack/build-plan-cache/x86_64-linux/lts-6.9.cache @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:64:13)
2016-07-28 16:44:34.832617: [debug] Getting system compiler version @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Setup src/Stack/Setup.hs:341:17)
2016-07-28 16:44:34.832839: [debug] Run process: ghc --info @(stack_K1e6VSKnzs1HNYmTJGAgTQ:System.Process.Read src/System/Process/Read.hs:283:3)
2016-07-28 16:44:34.900832: [debug] Asking GHC for its version @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Setup.Installed src/Stack/Setup/Installed.hs:94:13)
2016-07-28 16:44:34.901074: [debug] Run process: ghc --numeric-version @(stack_K1e6VSKnzs1HNYmTJGAgTQ:System.Process.Read src/System/Process/Read.hs:283:3)
2016-07-28 16:44:34.944872: [debug] Getting Cabal package version @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.GhcPkg src/Stack/GhcPkg.hs:165:5)
2016-07-28 16:44:34.945501: [debug] Run process: ghc-pkg --no-user-package-db field --simple-output Cabal version @(stack_K1e6VSKnzs1HNYmTJGAgTQ:System.Process.Read src/System/Process/Read.hs:283:3)
2016-07-28 16:44:34.974350: [debug] Resolving package entries @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Setup src/Stack/Setup.hs:221:5)
2016-07-28 16:44:34.975024: [debug] Getting global package database location @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.GhcPkg src/Stack/GhcPkg.hs:48:5)
2016-07-28 16:44:34.975170: [debug] Run process: ghc-pkg --no-user-package-db list --global @(stack_K1e6VSKnzs1HNYmTJGAgTQ:System.Process.Read src/System/Process/Read.hs:283:3)
2016-07-28 16:44:35.054707: [debug] Run process: ghc-pkg --global --no-user-package-db dump --expand-pkgroot @(stack_K1e6VSKnzs1HNYmTJGAgTQ:System.Process.Read src/System/Process/Read.hs:283:3)
2016-07-28 16:44:35.146223: [debug] Ignoring package old-time due to wanting version 1.1.0.3 instead of 1.1.0.2 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.146521: [debug] Ignoring package haskeline due to wanting version 0.7.2.3 instead of 0.7.1.2 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.146669: [debug] Ignoring package terminfo due to wanting version 0.4.0.2 instead of 0.4.0.0 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.146817: [debug] Ignoring package transformers due to wanting version 0.4.2.0 instead of 0.3.0.0 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.146950: [debug] Ignoring package hoopl due to wanting version 3.10.0.2 instead of 3.10.0.1 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.147092: [debug] Ignoring package binary due to wanting version 0.7.5.0 instead of 0.7.1.0 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.147878: [debug] Ignoring package Cabal due to wanting version 1.22.8.0 instead of 1.18.1.5 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.148051: [debug] Ignoring package pretty due to wanting version 1.1.2.0 instead of 1.1.1.1 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.148183: [debug] Ignoring package hpc due to wanting version 0.6.0.2 instead of 0.6.0.1 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.148313: [debug] Ignoring package process due to wanting version 1.2.3.0 instead of 1.2.0.0 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.148442: [debug] Ignoring package directory due to wanting version 1.2.2.0 instead of 1.2.1.0 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.148589: [debug] Ignoring package unix due to wanting version 2.7.1.0 instead of 2.7.0.1 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.148720: [debug] Ignoring package time due to wanting version 1.5.0.1 instead of 1.4.2 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.148849: [debug] Ignoring package old-locale due to wanting version 1.0.0.7 instead of 1.0.0.6 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.149174: [debug] Ignoring package containers due to wanting version 0.5.6.2 instead of 0.5.5.1 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.149310: [debug] Ignoring package bytestring due to wanting version 0.10.6.0 instead of 0.10.4.0 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.149440: [debug] Ignoring package deepseq due to wanting version 1.4.1.1 instead of 1.3.0.2 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.149568: [debug] Ignoring package array due to wanting version 0.5.1.0 instead of 0.5.0.0 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.149698: [debug] Ignoring package filepath due to wanting version 1.4.0.0 instead of 1.3.0.2 @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Stack.Build.Installed src/Stack/Build/Installed.hs:189:5)
2016-07-28 16:44:35.149909: [debug] Run process: ghc-pkg --user --no-user-package-db --package-db /home/self/.stack/snapshots/x86_64-linux/lts-6.9/7.10.3/pkgdb dump --expand-pkgroot @(stack_K1e6VSKnzs1HNYmTJGAgTQ:System.Process.Read src/System/Process/Read.hs:283:3)
2016-07-28 16:44:35.166946: [debug] Run process: ghc-pkg --user --no-user-package-db --package-db /home/self/my-project/.stack-work/install/x86_64-linux/lts-6.9/7.10.3/pkgdb dump --expand-pkgroot @(stack_K1e6VSKnzs1HNYmTJGAgTQ:System.Process.Read src/System/Process/Read.hs:283:3)
2016-07-28 16:44:35.185054: [debug] Trying to decode /home/self/.stack/indices/Hackage/00-index.cache @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:55:5)
2016-07-28 16:44:35.700635: [debug] Success decoding /home/self/.stack/indices/Hackage/00-index.cache @(stack_K1e6VSKnzs1HNYmTJGAgTQ:Data.Binary.VersionTagged src/Data/Binary/VersionTagged.hs:64:13)
2016-07-28 16:44:36.305361: [debug] Creating process: /usr/bin/ghc -clear-package-db -global-package-db -hide-all-packages -package base -package Cabal-1.18.1.5 /tmp/stack8898/Setup.hs -o /home/self/.stack/setup-exe-cache/x86_64-linux/tmp-setup-Simple-Cabal-1.18.1.5-ghc-7.10.3 -rtsopts @(stack_K1e6VSKnzs1HNYmTJGAgTQ:System.Process.Run src/System/Process/Run.hs:102:5)
&lt;command line&gt;: cannot satisfy -package Cabal-1.18.1.5
    (use -v for more information)
2016-07-28 16:44:36.415789: [error] Exit code ExitFailure 1 while running ["ghc","-clear-package-db","-global-package-db","-hide-all-packages","-package","base","-package","Cabal-1.18.1.5","/tmp/stack8898/Setup.hs","-o","/home/self/.stack/setup-exe-cache/x86_64-linux/tmp-setup-Simple-Cabal-1.18.1.5-ghc-7.10.3","-rtsopts"] in /tmp/stack8898/ @(stack_K1e6VSKnzs1HNYmTJGAgTQ:System.Process.Run src/System/Process/Run.hs:70:13)
</code></pre>

<p>When I do an <code>ls</code> over the directory <code>/home/self/.stack/setup-exe-cache/x86_64-linux/</code> it shows an empty folder.
Doing <code>stack setup</code>:</p>

<pre><code>stack will use the GHC on your PATH
For more information on paths, see 'stack path' and 'stack exec env'
To use this GHC and packages outside of a project, consider using:
stack ghc, stack ghci, stack runghc, or stack exec
</code></pre>

<p>My dev env is basically Lubuntu, with ghc 7.10.3 and cabal 1.22.5.0.
I already try reinstalling <code>stack</code> :P.</p>

<p><strong>Update</strong>:
I run <code>stack build yesod-bin cabal-install --install-ghc --no-system-ghc</code>, and get:</p>

<pre><code>Running /home/self/.stack/programs/x86_64-linux/ghc-7.10.3/bin/ghc-pkg --user --no-user-package-db --package-db /home/self/.stack/snapshots/x86_64-linux/lts-6.9/7.10.3/pkgdb dump --expand-pkgroot exited with ExitFailure 1
ghc-pkg: /home/self/.stack/snapshots/x86_64-linux/lts-6.9/7.10.3/pkgdb/package.cache: GHC.PackageDb.readPackageDb: inappropriate type (not a ghc-pkg db file, wrong file magic number)
</code></pre>