Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to build cabal-dev-0.9.2 #99

Open
vjchem opened this issue Mar 20, 2013 · 5 comments
Open

Unable to build cabal-dev-0.9.2 #99

vjchem opened this issue Mar 20, 2013 · 5 comments

Comments

@vjchem
Copy link

vjchem commented Mar 20, 2013

Hi, I'm unable to build cabal-dev (or install it via cabal). Here's my system details:
$ cabal --version
cabal-install version 1.16.0.2
using version 1.16.0.3 of the Cabal library

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.2

And the error:
$ cabal build
Building cabal-dev-0.9.2...
Preprocessing executable 'ghc-pkg-6_8-compat' for cabal-dev-0.9.2...
Preprocessing executable 'fake-ghc-cabal-dev' for cabal-dev-0.9.2...
Preprocessing executable 'cabal-dev' for cabal-dev-0.9.2...
[ 8 of 19] Compiling Distribution.Dev.CabalInstall ( src/Distribution/Dev/CabalInstall.hs, dist/build/cabal-dev/cabal-dev-tmp/Distribution/Dev/CabalInstall.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package bytestring-0.9.2.1 ... linking ... done.
Loading package zlib-0.5.4.0 ... linking ... done.
Loading package array-0.4.0.0 ... linking ... done.
Loading package deepseq-1.3.0.0 ... linking ... done.
Loading package containers-0.5.2.1 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package filepath-1.3.0.0 ... linking ... done.
Loading package old-locale-1.0.0.4 ... linking ... done.
Loading package old-time-1.1.0.0 ... linking ... done.
Loading package unix-2.5.1.1 ... linking ... done.
Loading package directory-1.1.0.2 ... linking ... done.
Loading package time-1.4 ... linking ... done.
Loading package tar-0.4.0.1 ... linking ... done.
Loading package setenv-0.1.0 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.2 ... linking ... done.
Loading package text-0.11.2.3 ... linking ... done.
Loading package parsec-3.1.3 ... linking ... done.
Loading package network-2.3.1.0 ... linking ... done.
Loading package HTTP-4000.2.5 ... linking ... done.
Loading package process-1.1.0.1 ... linking ... done.
Loading package Cabal-1.16.0.3 ... linking ... done.
cabal --help
Interrogating cabal-install executable:
cabal install --help
cabal install --help
cabal update --help
cabal list --help
cabal info --help
cabal fetch --help
cabal unpack --help
cabal check --help
cabal sdist --help
cabal upload --help
cabal report --help
cabal init --help
cabal configure --help
cabal build --help
cabal copy --help
cabal haddock --help
cabal clean --help
cabal hscolour --help
cabal register --help
cabal test --help
cabal bench --help
cabal upgrade --help
cabal help --help

src/Distribution/Dev/CabalInstall.hs:118:3:
Illegal type variable name: `'
When splicing a TH declaration: stringToCommand ::

I'm just learning Haskell so I'm not having too much success debugging this myself, but am happy to help if you need other information.

@markandrus
Copy link

I'm posting here because I have the same versions of cabal and ghc, but a different error after line src/Distribution/Dev/CabalInstall.hs:118:3:.

$ cabal --version
cabal-install version 1.16.0.2
using version 1.16.0.3 of the Cabal library
$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 7.4.2
$ cabal install cabal-dev         
Resolving dependencies...
[1 of 1] Compiling Main             ( /var/folders/cd/73686r0574x0mpb30w0brjvc0000gp/T/cabal-dev-0.9.2-46140/cabal-dev-0.9.2/Setup.hs, /var/folders/cd/73686r0574x0mpb30w0brjvc0000gp/T/cabal-dev-0.9.2-46140/cabal-dev-0.9.2/dist/setup/Main.o )
Linking /var/folders/cd/73686r0574x0mpb30w0brjvc0000gp/T/cabal-dev-0.9.2-46140/cabal-dev-0.9.2/dist/setup/setup ...
Configuring cabal-dev-0.9.2...
Building cabal-dev-0.9.2...
Preprocessing executable 'ghc-pkg-6_8-compat' for cabal-dev-0.9.2...
[1 of 1] Compiling Main             ( src/GhcPkgCompat.hs, dist/build/ghc-pkg-6_8-compat/ghc-pkg-6_8-compat-tmp/Main.o )
Linking dist/build/ghc-pkg-6_8-compat/ghc-pkg-6_8-compat ...
Preprocessing executable 'fake-ghc-cabal-dev' for cabal-dev-0.9.2...
[1 of 2] Compiling Distribution.Dev.GhcArgs ( src/Distribution/Dev/GhcArgs.hs, dist/build/fake-ghc-cabal-dev/fake-ghc-cabal-dev-tmp/Distribution/Dev/GhcArgs.o )
[2 of 2] Compiling Main             ( src/FakeGhc.hs, dist/build/fake-ghc-cabal-dev/fake-ghc-cabal-dev-tmp/Main.o )
Linking dist/build/fake-ghc-cabal-dev/fake-ghc-cabal-dev ...
Preprocessing executable 'cabal-dev' for cabal-dev-0.9.2...
[ 1 of 19] Compiling Distribution.Dev.MergeCabalConfig ( src/Distribution/Dev/MergeCabalConfig.hs, dist/build/cabal-dev/cabal-dev-tmp/Distribution/Dev/MergeCabalConfig.o )
[ 2 of 19] Compiling Distribution.Dev.RewriteCabalConfig ( src/Distribution/Dev/RewriteCabalConfig.hs, dist/build/cabal-dev/cabal-dev-tmp/Distribution/Dev/RewriteCabalConfig.o )
[ 3 of 19] Compiling Distribution.Dev.GhcArgs ( src/Distribution/Dev/GhcArgs.hs, dist/build/cabal-dev/cabal-dev-tmp/Distribution/Dev/GhcArgs.o )
[ 4 of 19] Compiling Distribution.Dev.Utilities ( src/Distribution/Dev/Utilities.hs, dist/build/cabal-dev/cabal-dev-tmp/Distribution/Dev/Utilities.o )
[ 5 of 19] Compiling Distribution.Dev.InterrogateCabalInstall ( src/Distribution/Dev/InterrogateCabalInstall.hs, dist/build/cabal-dev/cabal-dev-tmp/Distribution/Dev/InterrogateCabalInstall.o )
[ 6 of 19] Compiling Distribution.Dev.TH.DeriveCabalCommands ( src/Distribution/Dev/TH/DeriveCabalCommands.hs, dist/build/cabal-dev/cabal-dev-tmp/Distribution/Dev/TH/DeriveCabalCommands.o )
[ 7 of 19] Compiling Paths_cabal_dev  ( dist/build/autogen/Paths_cabal_dev.hs, dist/build/cabal-dev/cabal-dev-tmp/Paths_cabal_dev.o )
[ 8 of 19] Compiling Distribution.Dev.CabalInstall ( src/Distribution/Dev/CabalInstall.hs, dist/build/cabal-dev/cabal-dev-tmp/Distribution/Dev/CabalInstall.o )
Loading package ghc-prim ... linking ... done.
Loading package integer-gmp ... linking ... done.
Loading package base ... linking ... done.
Loading package bytestring-0.9.2.1 ... linking ... done.
Loading package zlib-0.5.4.0 ... linking ... done.
Loading package array-0.4.0.0 ... linking ... done.
Loading package deepseq-1.3.0.0 ... linking ... done.
Loading package containers-0.5.2.1 ... linking ... done.
Loading package pretty-1.1.1.0 ... linking ... done.
Loading package template-haskell ... linking ... done.
Loading package filepath-1.3.0.0 ... linking ... done.
Loading package old-locale-1.0.0.4 ... linking ... done.
Loading package old-time-1.1.0.0 ... linking ... done.
Loading package unix-2.5.1.1 ... linking ... done.
Loading package directory-1.1.0.2 ... linking ... done.
Loading package time-1.4 ... linking ... done.
Loading package tar-0.4.0.1 ... linking ... done.
Loading package setenv-0.1.0 ... linking ... done.
Loading package transformers-0.3.0.0 ... linking ... done.
Loading package mtl-2.1.2 ... linking ... done.
Loading package text-0.11.2.3 ... linking ... done.
Loading package parsec-3.1.3 ... linking ... done.
Loading package network-2.3.1.0 ... linking ... done.
Loading package HTTP-4000.2.5 ... linking ... done.
Loading package process-1.1.0.1 ... linking ... done.
Loading package Cabal-1.16.0.3 ... linking ... done.
cabal --help
Interrogating cabal-install executable:
cabal install --help
cabal install --help
cabal update --help
cabal list --help
cabal info --help
cabal fetch --help
cabal unpack --help
cabal check --help
cabal sdist --help
cabal upload --help
cabal report --help
cabal init --help
cabal configure --help
cabal build --help
cabal copy --help
cabal haddock --help
cabal clean --help
cabal hscolour --help
cabal register --help
cabal test --help
cabal bench --help
cabal upgrade --help
cabal help --help

src/Distribution/Dev/CabalInstall.hs:118:3:Failed to install cabal-dev-0.9.2
cabal: Error: some packages failed to install:
cabal-dev-0.9.2 failed during the building phase. The exception was:
ExitFailure 11

@markandrus
Copy link

In my case, I had both template-haskell-2.7.0.0 and template-haskell-2.8.0.0 installed (noticed this when trying to build an unrelated project and ld gave duplicate symbol errors).

Did the following to get cabal-dev building:

  1. ghc-pkg unregister template-haskell-2.8.0.0.
  2. Edited cabal-dev.cabal to specify template-haskell-2.7.0.0 rather than template-haskell.
  3. cabal install --force-reinstalls with fingers crossed.

Seems to have worked in my case.

@vjchem
Copy link
Author

vjchem commented Mar 28, 2013

That was it for me too, I had both of those versions of template-haskell installed. Thanks, Mark.

I'll leave this issue open in case you all want to do anything with it, but things are working for me.

@agocorona
Copy link

In my case the log is the same, but at the end:

src\Distribution\Dev\CabalInstall.hs:118:3:Segmentation fault/access violation i
n generated code
cabal: Error: some packages failed to install:
cabal-dev-0.9.2 failed during the building phase. The exception was:
ExitFailure 1

I use ghc-7.4.2

It seems a problem in the compiler with the template Haskell version.

The cabal-dev.cabal file warn about the problem:

  -- Template haskell is special: the compiler will die if a
  -- version other than the one that is shipped with the compiler
  -- is used. Here, we don't constrain the version and hope that
  -- there will be only one.

the markandrus solution works for me too.

@ppetr
Copy link

ppetr commented Jun 3, 2013

I had the same problem as markandrus, and managed to solve it using

cabal install --solver=modular --avoid-reinstalls --constraint='template-haskell == 2.7.0.0'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants