1

When running stack setup in Miso sample-app (https://github.com/dmjio/miso/tree/master/sample-app) following error occurred.

Shorter version:

exit status: 1                                
stderr: solver must be one of: modular        
CallStack (from HasCallStack):                
  error, called at libraries/Cabal/Cabal/Distribution/ReadE.hs:46:24 in Cabal-2.0.1.0:Distribution.ReadE

Verbose:

/Users/username/Documents/projects/hs/miso/sample-app$ [ghcjs-pkg]: /Users/username/.stack/programs/x86_64-osx/ghcjs-0.2.0.9006020_ghc-7.10.3/src/.stack-work/install/x86_64-osx/lts-6.20/7.10.3/bin/ghcjs-pkg "recache" "--global" "--no-user-package-db"
installing stage 0
/Users/username/.ghcjs/x86_64-darwin-0.2.0.9006020-7.10.3/ghcjs/ghcjs-boot/boot/ghc-prim$ rm_rf dist
/Users/username/.ghcjs/x86_64-darwin-0.2.0.9006020-7.10.3/ghcjs/ghcjs-boot$ [cabal]: /usr/local/bin/cabal "--config-file" "/Users/username/.ghcjs/x86_64-darwin-0.2.0.9006020-7.10.3/ghcjs/cabalBootConfig" "--ignore-sandbox" "install" "./boot/ghc-prim" "--solver=topdown" "--global" "--ghcjs" "--one-shot" "--avoid-reinstalls" "--builddir" "dist" "--with-compiler" "/Users/username/.stack/programs/x86_64-osx/ghcjs-0.2.0.9006020_ghc-7.10.3/src/.stack-work/install/x86_64-osx/lts-6.20/7.10.3/bin/ghcjs" "--with-hc-pkg" "/Users/username/.stack/programs/x86_64-osx/ghcjs-0.2.0.9006020_ghc-7.10.3/src/.stack-work/install/x86_64-osx/lts-6.20/7.10.3/bin/ghcjs-pkg" "--prefix" "/Users/username/.ghcjs/x86_64-darwin-0.2.0.9006020-7.10.3/ghcjs" "--enable-documentation" "--haddock-html" "--haddock-hyperlink-source" "--enable-shared" "--enable-library-profiling" "--root-cmd" "/Users/username/.ghcjs/x86_64-darwin-0.2.0.9006020-7.10.3/ghcjs/run.sh" "-v2" "--dry-run"
/usr/local/bin/cabal --config-file /Users/username/.ghcjs/x86_64-darwin-0.2.0.9006020-7.10.3/ghcjs/cabalBootConfig --ignore-sandbox install ./boot/ghc-prim --solver=topdown --global --ghcjs --one-shot --avoid-reinstalls --builddir dist --with-compiler /Users/username/.stack/programs/x86_64-osx/ghcjs-0.2.0.9006020_ghc-7.10.3/src/.stack-work/install/x86_64-osx/lts-6.20/7.10.3/bin/ghcjs --with-hc-pkg /Users/username/.stack/programs/x86_64-osx/ghcjs-0.2.0.9006020_ghc-7.10.3/src/.stack-work/install/x86_64-osx/lts-6.20/7.10.3/bin/ghcjs-pkg --prefix /Users/username/.ghcjs/x86_64-darwin-0.2.0.9006020-7.10.3/ghcjs --enable-documentation --haddock-html --haddock-hyperlink-source --enable-shared --enable-library-profiling --root-cmd /Users/username/.ghcjs/x86_64-darwin-0.2.0.9006020-7.10.3/ghcjs/run.sh -v2 --dry-run
solver must be one of: modular
CallStack (from HasCallStack):
  error, called at libraries/Cabal/Cabal/Distribution/ReadE.hs:46:24 in Cabal-2.0.1.0:Distribution.ReadE
ghcjs-boot: error running: /usr/local/bin/cabal --config-file /Users/username/.ghcjs/x86_64-darwin-0.2.0.9006020-7.10.3/ghcjs/cabalBootConfig --ignore-sandbox install ./boot/ghc-prim --solver=topdown --global --ghcjs --one-shot --avoid-reinstalls --builddir dist --with-compiler /Users/username/.stack/programs/x86_64-osx/ghcjs-0.2.0.9006020_ghc-7.10.3/src/.stack-work/install/x86_64-osx/lts-6.20/7.10.3/bin/ghcjs --with-hc-pkg /Users/username/.stack/programs/x86_64-osx/ghcjs-0.2.0.9006020_ghc-7.10.3/src/.stack-work/install/x86_64-osx/lts-6.20/7.10.3/bin/ghcjs-pkg --prefix /Users/username/.ghcjs/x86_64-darwin-0.2.0.9006020-7.10.3/ghcjs --enable-documentation --haddock-html --haddock-hyperlink-source --enable-shared --enable-library-profiling --root-cmd /Users/username/.ghcjs/x86_64-darwin-0.2.0.9006020-7.10.3/ghcjs/run.sh -v2 --dry-run
exit status: 1
stderr: solver must be one of: modular
CallStack (from HasCallStack):                
  error, called at libraries/Cabal/Cabal/Distribution/ReadE.hs:46:24 in Cabal-2.0.1.0:Distribution.ReadE

Booting GHCJS (this will take a long time) ...Process exited with ExitFailure 1: /Users/username/.stack/programs/x86_64-osx/ghcjs-0.2.0.9006020_ghc-7.10.3/src/.stack-work/install/x86_64-osx/lts-6.20/7.10.3/bin/ghcjs-boot --clean

Stack and cabal version:

[sample-app] stack --version                                          master  ✱
Version 1.6.3 x86_64 hpack-0.20.0
[sample-app] cabal --version                                          master  ✱
cabal-install version 2.0.0.1
compiled using version 2.0.1.0 of the Cabal library 
Nagarjuna Pamu
  • 14,737
  • 3
  • 22
  • 40
  • 2
    Just a guess: perhaps the `stack setup` code hasn't been tested with cabal-install 2.0 yet. You could try putting version 1.24 on your $PATH and see if things work then. – Michael Snoyman Jan 03 '18 at 18:33
  • @MichaelSnoyman Thanks for the advice. you mean stack-1.24 right! – Nagarjuna Pamu Jan 03 '18 at 18:35
  • 2
    No, I meant cabal 1.24. I'm not familiar with the GHCJS code path, but it appears to use the `cabal` executable under the surface to do some of the work, and may be making assumptions about its version. (It's also very likely that it's the GHCJS scripts themselves making these assumptions.) – Michael Snoyman Jan 03 '18 at 18:36
  • @MichaelSnoyman Thanks, I will definitely try. `stack setup`, `stack build`, `stack clean` also fails with same error. – Nagarjuna Pamu Jan 03 '18 at 18:40
  • 1
    @MichaelSnoyman Works after deleting `cabal-install` and running `stack build` – Nagarjuna Pamu Jan 03 '18 at 18:59

1 Answers1

2

Works after deleting cabal-install and running stack build. As hinted by @MichaelSnoyman ghcjs might be expecting right cabal version.

Nagarjuna Pamu
  • 14,737
  • 3
  • 22
  • 40