Question

I am trying to install elm-server on a x86_64 linux box which fails because of errors with aeson-pretty compilation. I will appreciate help with fixing this error. Googling for the error didn't help much. So, I am reaching out here.

Cabal dry-run output first for what I am trying to do - it shows what dependencies will change:

$ cabal install elm-server --max-backjumps 1000 -v --dry-run
Reading available packages...
Choosing modular solver.
Resolving dependencies...
In order, the following would be installed:
aeson-0.7.0.2 (reinstall)
aeson-pretty-0.7.1 (reinstall) changes: aeson-0.7.0.1 -> 0.7.0.2,
attoparsec-0.10.4.0 added, cmdargs-0.10.3 added
pandoc-types-1.12.3.2 (reinstall)
texmath-0.6.6 (reinstall)
yaml-0.8.8.1 (reinstall)
pandoc-1.12.3.3 (reinstall) changes: old-time-1.1.0.1 added
Elm-0.12 (reinstall) changes: aeson-0.7.0.1 -> 0.7.0.2, aeson-pretty-0.7.1
added, pandoc-1.12.3.3 added
elm-server-0.11 (new package)

Error when aeson-pretty is compiled during actual run - I will appreciate pointers on how to resolve this (I have removed absolute file system path from the log below to remove some identifying information of work server):

ghc/7.6.1/bin/ghc --make -no-link -fbuilding-cabal-package -O -static -outputdir dist/build/aeson-pretty/aeson-pretty-tmp -odir dist/build/aeson-pretty/aeson-pretty-tmp -hidir dist/build/aeson-pretty/aeson-pretty-tmp -stubdir dist/build/aeson-pretty/aeson-pretty-tmp -i -idist/build/aeson-pretty/aeson-pretty-tmp -icli-tool -idist/build/autogen -Idist/build/autogen -Idist/build/aeson-pretty/aeson-pretty-tmp -optP-include -optPdist/build/autogen/cabal_macros.h -hide-all-packages -package-db dist/package.conf.inplace -package-id aeson-0.7.0.2-f4ad04aa4d2e7f65b938bd54f014afc0 -package-id attoparsec-0.10.4.0-a54b3de99ba828be808aba7bf3812cbc -package-id base-4.6.0.0-26b6c2181978d0c24c3b2f1a3f0f4de0 -package-id bytestring-0.10.0.0-bd919bc93a32f3db2328df9effbade89 -package-id cmdargs-0.10.3-e485ed32e993ef88a56151ce766e3511 -package-id aeson-pretty-0.7.1-inplace -XHaskell98 cli-tool/Main.hs -Wall
<command line>: cannot satisfy -package-id aeson-0.7.0.2-f4ad04aa4d2e7f65b938bd54f014afc0:
    aeson-0.7.0.2-f4ad04aa4d2e7f65b938bd54f014afc0 is unusable due to missing or recursive dependencies:
      template-haskell-2.8.0.0-3c3595becd07418f521cf03c08f6ee4e
    (use -v for more information)
Failed to install aeson-pretty-0.7.1

Running ghc-pkg on template-haskell, I get this:

$ ghc-pkg list template-haskell
WARNING: there are broken packages.  Run 'ghc-pkg check' for more details.
ghc/7.6.1/lib/ghc-7.6.1/package.conf.d
   template-haskell-2.8.0.0
.ghc/x86_64-linux-7.6.1/package.conf.d
   template-haskell-2.8.0.0

Running ghc-pkg check, I get this (just to verify it is not template-haskell that is broken) - makes sense that Elm is broken since it needs to be re-installed with elm-server:

The following packages are broken, either because they have a problem
listed above, or because they depend on a broken package.
Elm-0.12

So, it looks like I need to do my own modification of cabal package for elm-server to fix some dependencies on template-haskell. To do that, I need help with figuring out how to debug the error above in terms of cabal configuration.

In case any one is wondering about sandbox, I don't want to use cabal sandbox because of disk quota limit on work server. I am ok with breaking existing packages if I can get elm and elm-server to install.

Was it helpful?

Solution

template-haskell is tied to your GHC version, so it shouldn't be in your user package database. Unregister template-haskell then reinstall any broken packages.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top