cabal cannot be updated and "some packages failed to install"

Anju Fabulina picture Anju Fabulina · Aug 22, 2012 · Viewed 7.6k times · Source

I am rather new to the Haskell world and I would like to use the package HaskellCharts. The way to go seems to be using cabal, so I installed cabal-install from my repository (I'm on Ubuntu 10.04.4 LTS 32-bit).

My specs are:

$ ghc --version
The Glorious Glasgow Haskell Compilation System, version 6.12.1
$ which ghc
/usr/bin/ghc

$ cabal --version
cabal-install version 0.8.0
using version 1.8.0.2 of the Cabal library

The HaskellCharts installation guide (as of May 27th 2010) told me to

cabal update
cabal install gtk2hs-buildtools
cabal install gtk
cabal install chart

cabal update was successful and informed me that a newer version of cabal was available.

$ cabal install gtk2hs-buildtools

however, yields

Resolving dependencies...
Downloading gtk2hs-buildtools-0.12.3.1...
Configuring gtk2hs-buildtools-0.12.3.1...
cabal: alex is required but it could not be found.
cabal: Error: some packages failed to install:
gtk2hs-buildtools-0.12.3.1 failed during the configure step. The exception
was:
ExitFailure 1

So I tried to install alex first, but this also results in an error, the origin of which I cannot make out:

$ cabal install alex
Resolving dependencies...
Downloading alex-3.0.2...
[1 of 1] Compiling Main             ( /tmp/alex-3.0.219087/alex-3.0.2/Setup.lhs, /tmp/alex-3.0.219087/alex-3.0.2/dist/setup/Main.o )
Linking /tmp/alex-3.0.219087/alex-3.0.2/dist/setup/setup ...
Configuring alex-3.0.2...
Preprocessing executables for alex-3.0.2...
Building alex-3.0.2...
ghc: unrecognised flags: -rtsopts
Usage: For basic information, try the `--help' option.
cabal: Error: some packages failed to install:
alex-3.0.2 failed during the building phase. The exception was:
ExitFailure 1

In order to make sure that problems would not arise from an outdated version/incompatible versions of packages etc., I tried to update cabal itself.

$ cabal install cabal-install

leads to

Resolving dependencies...
Warning: network.cabal: Ignoring unknown section type: test-suite
Warning: network.cabal: Ignoring unknown section type: test-suite
Configuring network-2.3.1.0...
configure: WARNING: unrecognized options: --with-compiler
checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking for an ANSI C-conforming const... yes
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking for stdlib.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for unistd.h... (cached) yes
checking winsock2.h usability... no
checking winsock2.h presence... no
checking for winsock2.h... no
checking ws2tcpip.h usability... no
checking ws2tcpip.h presence... no
checking for ws2tcpip.h... no
checking wspiapi.h usability... no
checking wspiapi.h presence... no
checking for wspiapi.h... no
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking netinet/tcp.h usability... yes
checking netinet/tcp.h presence... yes
checking for netinet/tcp.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/uio.h usability... yes
checking sys/uio.h presence... yes
checking for sys/uio.h... yes
checking sys/un.h usability... yes
checking sys/un.h presence... yes
checking for sys/un.h... yes
checking for readlink... yes
checking for symlink... yes
checking for struct msghdr.msg_control... yes
checking for struct msghdr.msg_accrights... no
checking for struct sockaddr.sa_len... no
checking for in_addr_t in netinet/in.h... yes
checking for SO_PEERCRED and struct ucred in sys/socket.h... yes
checking for _head_libws2_32_a in -lws2_32... no
checking for getaddrinfo... yes
checking for gai_strerror... yes
checking whether AI_ADDRCONFIG is declared... yes
checking whether AI_ALL is declared... yes
checking whether AI_NUMERICSERV is declared... yes
checking whether AI_V4MAPPED is declared... yes
checking whether IPV6_V6ONLY is declared... yes
checking for sendfile in sys/sendfile.h... yes
checking for sendfile in sys/socket.h... no
checking for gethostent... yes
checking for accept4... yes
configure: creating ./config.status
config.status: creating network.buildinfo
config.status: creating include/HsNetworkConfig.h
configure: WARNING: unrecognized options: --with-compiler
Preprocessing library network-2.3.1.0...
Building network-2.3.1.0...
[ 1 of 10] Compiling Network.URI      ( Network/URI.hs, dist/build/Network/URI.o )

Network/URI.hs:580:24:
    Couldn't match expected type `Char' against inferred type `[Char]'
      Expected type: GenParser Char () Char
      Inferred type: URIParser String
    In the first argument of `notFollowedBy', namely `regName'
    In a stmt of a 'do' expression: notFollowedBy regName
cabal: Error: some packages failed to install:
HTTP-4000.2.3 depends on network-2.3.1.0 which failed to install.
cabal-install-0.10.2 depends on network-2.3.1.0 which failed to install.
network-2.3.1.0 failed during the building phase. The exception was:
ExitFailure 1

Trying to install the network package on its own via cabal install network yields the exact same error.

I tried

$ ghc-pkg check

which prints this:

There are problems in package QuickCheck-2.5:
  import-dirs: /home/kenny/.cabal/lib/QuickCheck-2.5/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/QuickCheck-2.5/ghc-6.12.1 doesn't exist or isn't a directory
  file Test/QuickCheck/All.hi is missing
  file Test/QuickCheck/Function.hi is missing
  file Test/QuickCheck.hi is missing
  file Test/QuickCheck/Arbitrary.hi is missing
  file Test/QuickCheck/Gen.hi is missing
  file Test/QuickCheck/Monadic.hi is missing
  file Test/QuickCheck/Modifiers.hi is missing
  file Test/QuickCheck/Property.hi is missing
  file Test/QuickCheck/Test.hi is missing
  file Test/QuickCheck/Text.hi is missing
  file Test/QuickCheck/Poly.hi is missing
  file Test/QuickCheck/State.hi is missing
  file Test/QuickCheck/Exception.hi is missing
  cannot find libHSQuickCheck-2.5.a on library path
There are problems in package Chart-0.16:
  import-dirs: /home/kenny/.cabal/lib/Chart-0.16/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/Chart-0.16/ghc-6.12.1 doesn't exist or isn't a directory
  file Graphics/Rendering/Chart.hi is missing
  file Graphics/Rendering/Chart/Types.hi is missing
  file Graphics/Rendering/Chart/Renderable.hi is missing
  file Graphics/Rendering/Chart/Axis.hi is missing
  file Graphics/Rendering/Chart/Axis/Floating.hi is missing
  file Graphics/Rendering/Chart/Axis/Indexed.hi is missing
  file Graphics/Rendering/Chart/Axis/Int.hi is missing
  file Graphics/Rendering/Chart/Axis/LocalTime.hi is missing
  file Graphics/Rendering/Chart/Axis/Types.hi is missing
  file Graphics/Rendering/Chart/Axis/Unit.hi is missing
  file Graphics/Rendering/Chart/Layout.hi is missing
  file Graphics/Rendering/Chart/Legend.hi is missing
  file Graphics/Rendering/Chart/Simple.hi is missing
  file Graphics/Rendering/Chart/Simple/Internal.hi is missing
  file Graphics/Rendering/Chart/Grid.hi is missing
  file Graphics/Rendering/Chart/Plot.hi is missing
  file Graphics/Rendering/Chart/Plot/Types.hi is missing
  file Graphics/Rendering/Chart/Plot/Annotation.hi is missing
  file Graphics/Rendering/Chart/Plot/AreaSpots.hi is missing
  file Graphics/Rendering/Chart/Plot/Bars.hi is missing
  file Graphics/Rendering/Chart/Plot/Candle.hi is missing
  file Graphics/Rendering/Chart/Plot/ErrBars.hi is missing
  file Graphics/Rendering/Chart/Plot/FillBetween.hi is missing
  file Graphics/Rendering/Chart/Plot/Hidden.hi is missing
  file Graphics/Rendering/Chart/Plot/Lines.hi is missing
  file Graphics/Rendering/Chart/Plot/Pie.hi is missing
  file Graphics/Rendering/Chart/Plot/Points.hi is missing
  file Graphics/Rendering/Chart/SparkLine.hi is missing
  cannot find libHSChart-0.16.a on library path
There are problems in package data-accessor-template-0.2.1.9:
  import-dirs: /home/kenny/.cabal/lib/data-accessor-template-0.2.1.9/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/data-accessor-template-0.2.1.9/ghc-6.12.1 doesn't exist or isn't a directory
  file Data/Accessor/Template.hi is missing
  file Data/Accessor/Template/Example.hi is missing
  cannot find libHSdata-accessor-template-0.2.1.9.a on library path
There are problems in package utility-ht-0.0.8:
  import-dirs: /home/kenny/.cabal/lib/utility-ht-0.0.8/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/utility-ht-0.0.8/ghc-6.12.1 doesn't exist or isn't a directory
  file Data/Bool/HT.hi is missing
  file Data/Eq/HT.hi is missing
  file Data/Function/HT.hi is missing
  file Data/Ix/Enum.hi is missing
  file Data/List/HT.hi is missing
  file Data/List/Key.hi is missing
  file Data/List/Match.hi is missing
  file Data/Maybe/HT.hi is missing
  file Data/Monoid/HT.hi is missing
  file Data/Ord/HT.hi is missing
  file Data/Record/HT.hi is missing
  file Data/String/HT.hi is missing
  file Data/Tuple/HT.hi is missing
  file Control/Monad/HT.hi is missing
  file Control/Functor/HT.hi is missing
  file Data/Strictness/HT.hi is missing
  file Text/Read/HT.hi is missing
  file Text/Show/HT.hi is missing
  file Data/Bool/HT/Private.hi is missing
  file Data/List/HT/Private.hi is missing
  file Data/List/Key/Private.hi is missing
  file Data/List/Match/Private.hi is missing
  file Data/Function/HT/Private.hi is missing
  file Data/Record/HT/Private.hi is missing
  cannot find libHSutility-ht-0.0.8.a on library path
There are problems in package data-accessor-0.2.2.2:
  import-dirs: /home/kenny/.cabal/lib/data-accessor-0.2.2.2/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/data-accessor-0.2.2.2/ghc-6.12.1 doesn't exist or isn't a directory
  file Data/Accessor.hi is missing
  file Data/Accessor/Basic.hi is missing
  file Data/Accessor/Container.hi is missing
  file Data/Accessor/Show.hi is missing
  file Data/Accessor/Tuple.hi is missing
  file Data/Accessor/BinaryRead.hi is missing
  file Data/Accessor/MonadState.hi is missing
  file Data/Accessor/Example.hi is missing
  file Data/Accessor/Private.hi is missing
  file Data/Accessor/MonadStatePrivate.hi is missing
  cannot find libHSdata-accessor-0.2.2.2.a on library path
There are problems in package mtl-2.1.2:
  import-dirs: /home/kenny/.cabal/lib/mtl-2.1.2/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/mtl-2.1.2/ghc-6.12.1 doesn't exist or isn't a directory
  file Control/Monad/Cont.hi is missing
  file Control/Monad/Cont/Class.hi is missing
  file Control/Monad/Error.hi is missing
  file Control/Monad/Error/Class.hi is missing
  file Control/Monad/Identity.hi is missing
  file Control/Monad/List.hi is missing
  file Control/Monad/RWS.hi is missing
  file Control/Monad/RWS/Class.hi is missing
  file Control/Monad/RWS/Lazy.hi is missing
  file Control/Monad/RWS/Strict.hi is missing
  file Control/Monad/Reader.hi is missing
  file Control/Monad/Reader/Class.hi is missing
  file Control/Monad/State.hi is missing
  file Control/Monad/State/Class.hi is missing
  file Control/Monad/State/Lazy.hi is missing
  file Control/Monad/State/Strict.hi is missing
  file Control/Monad/Trans.hi is missing
  file Control/Monad/Writer.hi is missing
  file Control/Monad/Writer/Class.hi is missing
  file Control/Monad/Writer/Lazy.hi is missing
  file Control/Monad/Writer/Strict.hi is missing
  cannot find libHSmtl-2.1.2.a on library path
There are problems in package transformers-0.3.0.0:
  import-dirs: /home/kenny/.cabal/lib/transformers-0.3.0.0/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/transformers-0.3.0.0/ghc-6.12.1 doesn't exist or isn't a directory
  file Control/Applicative/Backwards.hi is missing
  file Control/Applicative/Lift.hi is missing
  file Control/Monad/IO/Class.hi is missing
  file Control/Monad/Trans/Class.hi is missing
  file Control/Monad/Trans/Cont.hi is missing
  file Control/Monad/Trans/Error.hi is missing
  file Control/Monad/Trans/Identity.hi is missing
  file Control/Monad/Trans/List.hi is missing
  file Control/Monad/Trans/Maybe.hi is missing
  file Control/Monad/Trans/Reader.hi is missing
  file Control/Monad/Trans/RWS.hi is missing
  file Control/Monad/Trans/RWS/Lazy.hi is missing
  file Control/Monad/Trans/RWS/Strict.hi is missing
  file Control/Monad/Trans/State.hi is missing
  file Control/Monad/Trans/State/Lazy.hi is missing
  file Control/Monad/Trans/State/Strict.hi is missing
  file Control/Monad/Trans/Writer.hi is missing
  file Control/Monad/Trans/Writer/Lazy.hi is missing
  file Control/Monad/Trans/Writer/Strict.hi is missing
  file Data/Functor/Compose.hi is missing
  file Data/Functor/Constant.hi is missing
  file Data/Functor/Identity.hi is missing
  file Data/Functor/Product.hi is missing
  file Data/Functor/Reverse.hi is missing
  cannot find libHStransformers-0.3.0.0.a on library path
There are problems in package Cabal-1.14.0:
  import-dirs: /home/kenny/.cabal/lib/Cabal-1.14.0/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/Cabal-1.14.0/ghc-6.12.1 doesn't exist or isn't a directory
  file Distribution/Compiler.hi is missing
  file Distribution/InstalledPackageInfo.hi is missing
  file Distribution/License.hi is missing
  file Distribution/Make.hi is missing
  file Distribution/ModuleName.hi is missing
  file Distribution/Package.hi is missing
  file Distribution/PackageDescription.hi is missing
  file Distribution/PackageDescription/Configuration.hi is missing
  file Distribution/PackageDescription/Parse.hi is missing
  file Distribution/PackageDescription/Check.hi is missing
  file Distribution/PackageDescription/PrettyPrint.hi is missing
  file Distribution/ParseUtils.hi is missing
  file Distribution/ReadE.hi is missing
  file Distribution/Simple.hi is missing
  file Distribution/Simple/Build.hi is missing
  file Distribution/Simple/Build/Macros.hi is missing
  file Distribution/Simple/Build/PathsModule.hi is missing
  file Distribution/Simple/BuildPaths.hi is missing
  file Distribution/Simple/Bench.hi is missing
  file Distribution/Simple/Command.hi is missing
  file Distribution/Simple/Compiler.hi is missing
  file Distribution/Simple/Configure.hi is missing
  file Distribution/Simple/GHC.hi is missing
  file Distribution/Simple/LHC.hi is missing
  file Distribution/Simple/Haddock.hi is missing
  file Distribution/Simple/Hpc.hi is missing
  file Distribution/Simple/Hugs.hi is missing
  file Distribution/Simple/Install.hi is missing
  file Distribution/Simple/InstallDirs.hi is missing
  file Distribution/Simple/JHC.hi is missing
  file Distribution/Simple/LocalBuildInfo.hi is missing
  file Distribution/Simple/NHC.hi is missing
  file Distribution/Simple/PackageIndex.hi is missing
  file Distribution/Simple/PreProcess.hi is missing
  file Distribution/Simple/PreProcess/Unlit.hi is missing
  file Distribution/Simple/Program.hi is missing
  file Distribution/Simple/Program/Ar.hi is missing
  file Distribution/Simple/Program/Builtin.hi is missing
  file Distribution/Simple/Program/Db.hi is missing
  file Distribution/Simple/Program/HcPkg.hi is missing
  file Distribution/Simple/Program/Hpc.hi is missing
  file Distribution/Simple/Program/Ld.hi is missing
  file Distribution/Simple/Program/Run.hi is missing
  file Distribution/Simple/Program/Script.hi is missing
  file Distribution/Simple/Program/Types.hi is missing
  file Distribution/Simple/Register.hi is missing
  file Distribution/Simple/Setup.hi is missing
  file Distribution/Simple/SrcDist.hi is missing
  file Distribution/Simple/Test.hi is missing
  file Distribution/Simple/UHC.hi is missing
  file Distribution/Simple/UserHooks.hi is missing
  file Distribution/Simple/Utils.hi is missing
  file Distribution/System.hi is missing
  file Distribution/TestSuite.hi is missing
  file Distribution/Text.hi is missing
  file Distribution/Verbosity.hi is missing
  file Distribution/Version.hi is missing
  file Distribution/Compat/ReadP.hi is missing
  file Language/Haskell/Extension.hi is missing
  file Distribution/GetOpt.hi is missing
  file Distribution/Compat/Exception.hi is missing
  file Distribution/Compat/CopyFile.hi is missing
  file Distribution/Compat/TempFile.hi is missing
  file Distribution/Simple/GHC/IPI641.hi is missing
  file Distribution/Simple/GHC/IPI642.hi is missing
  file Paths_Cabal.hi is missing
  cannot find libHSCabal-1.14.0.a on library path
There are problems in package zlib-0.5.3.3:
  import-dirs: /home/kenny/.cabal/lib/zlib-0.5.3.3/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/zlib-0.5.3.3/ghc-6.12.1 doesn't exist or isn't a directory
  file Codec/Compression/GZip.hi is missing
  file Codec/Compression/Zlib.hi is missing
  file Codec/Compression/Zlib/Raw.hi is missing
  file Codec/Compression/Zlib/Internal.hi is missing
  file Codec/Compression/Zlib/Stream.hi is missing
  cannot find libHSzlib-0.5.3.3.a on library path
There are problems in package colour-2.3.3:
  import-dirs: /home/kenny/.cabal/lib/colour-2.3.3/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/colour-2.3.3/ghc-6.12.1 doesn't exist or isn't a directory
  file Data/Colour.hi is missing
  file Data/Colour/SRGB.hi is missing
  file Data/Colour/SRGB/Linear.hi is missing
  file Data/Colour/CIE.hi is missing
  file Data/Colour/CIE/Illuminant.hi is missing
  file Data/Colour/RGBSpace.hi is missing
  file Data/Colour/RGBSpace/HSL.hi is missing
  file Data/Colour/RGBSpace/HSV.hi is missing
  file Data/Colour/Names.hi is missing
  file Data/Colour/Internal.hi is missing
  file Data/Colour/Chan.hi is missing
  file Data/Colour/RGB.hi is missing
  file Data/Colour/Matrix.hi is missing
  file Data/Colour/CIE/Chromaticity.hi is missing
  cannot find libHScolour-2.3.3.a on library path
There are problems in package Cabal-1.10.2.0:
  import-dirs: /home/kenny/.cabal/lib/Cabal-1.10.2.0/ghc-6.12.1 doesn't exist or isn't a directory
  library-dirs: /home/kenny/.cabal/lib/Cabal-1.10.2.0/ghc-6.12.1 doesn't exist or isn't a directory
  file Distribution/Compiler.hi is missing
  file Distribution/InstalledPackageInfo.hi is missing
  file Distribution/License.hi is missing
  file Distribution/Make.hi is missing
  file Distribution/ModuleName.hi is missing
  file Distribution/Package.hi is missing
  file Distribution/PackageDescription.hi is missing
  file Distribution/PackageDescription/Configuration.hi is missing
  file Distribution/PackageDescription/Parse.hi is missing
  file Distribution/PackageDescription/Check.hi is missing
  file Distribution/ParseUtils.hi is missing
  file Distribution/ReadE.hi is missing
  file Distribution/Simple.hi is missing
  file Distribution/Simple/Build.hi is missing
  file Distribution/Simple/Build/Macros.hi is missing
  file Distribution/Simple/Build/PathsModule.hi is missing
  file Distribution/Simple/BuildPaths.hi is missing
  file Distribution/Simple/Command.hi is missing
  file Distribution/Simple/Compiler.hi is missing
  file Distribution/Simple/Configure.hi is missing
  file Distribution/Simple/GHC.hi is missing
  file Distribution/Simple/LHC.hi is missing
  file Distribution/Simple/Haddock.hi is missing
  file Distribution/Simple/Hugs.hi is missing
  file Distribution/Simple/Install.hi is missing
  file Distribution/Simple/InstallDirs.hi is missing
  file Distribution/Simple/JHC.hi is missing
  file Distribution/Simple/LocalBuildInfo.hi is missing
  file Distribution/Simple/NHC.hi is missing
  file Distribution/Simple/PackageIndex.hi is missing
  file Distribution/Simple/PreProcess.hi is missing
  file Distribution/Simple/PreProcess/Unlit.hi is missing
  file Distribution/Simple/Program.hi is missing
  file Distribution/Simple/Program/Ar.hi is missing
  file Distribution/Simple/Program/Builtin.hi is missing
  file Distribution/Simple/Program/Db.hi is missing
  file Distribution/Simple/Program/HcPkg.hi is missing
  file Distribution/Simple/Program/Ld.hi is missing
  file Distribution/Simple/Program/Run.hi is missing
  file Distribution/Simple/Program/Script.hi is missing
  file Distribution/Simple/Program/Types.hi is missing
  file Distribution/Simple/Register.hi is missing
  file Distribution/Simple/Setup.hi is missing
  file Distribution/Simple/SrcDist.hi is missing
  file Distribution/Simple/Test.hi is missing
  file Distribution/Simple/UHC.hi is missing
  file Distribution/Simple/UserHooks.hi is missing
  file Distribution/Simple/Utils.hi is missing
  file Distribution/System.hi is missing
  file Distribution/TestSuite.hi is missing
  file Distribution/Text.hi is missing
  file Distribution/Verbosity.hi is missing
  file Distribution/Version.hi is missing
  file Distribution/Compat/ReadP.hi is missing
  file Language/Haskell/Extension.hi is missing
  file Distribution/GetOpt.hi is missing
  file Distribution/Compat/Exception.hi is missing
  file Distribution/Compat/CopyFile.hi is missing
  file Distribution/Compat/TempFile.hi is missing
  file Distribution/Simple/GHC/IPI641.hi is missing
  file Distribution/Simple/GHC/IPI642.hi is missing
  file Paths_Cabal.hi is missing
  cannot find libHSCabal-1.10.2.0.a on library path

The following packages are broken, either because they have a problem
listed above, or because they depend on a broken package.
QuickCheck-2.5
Chart-0.16
data-accessor-template-0.2.1.9
utility-ht-0.0.8
data-accessor-0.2.2.2
mtl-2.1.2
transformers-0.3.0.0
Cabal-1.14.0
zlib-0.5.3.3
colour-2.3.3
Cabal-1.10.2.0

I reinstalled all of the packages mentioned above via cabal install --reinstall $PACKAGE. After this, ghc-pkg check yields no more errors except for Cabal-1.10.2.0. What I find very weird is that

$ cabal install --reinstall Cabal

tries to install Cabal-1.14.0, which seems to work out fine, but ghc-pkg check nevertheless keeps complaining about a missing or broken Cabal-1.10.2.0.

The stack trace concerning the unsuccessful installation of the network package looks to me as if the network package itself hasn't been built properly (there seem to be compilation errors?).

I tried the whole thing using sudo, too, but it did not make any difference. I also found cabal-install-0.10.2 failed during the building phase which deals with a similar cryptic "packages failed to install" error, but the issue wasn't really resolved, it seems.

What am I to do here? At the moment it looks like an awfully screwed up cabal install to me. Is there anything I can do about this or should I just forget about it and download the Haskell Platform from the Haskell website?

Answer

Daniel Wagner picture Daniel Wagner · Aug 22, 2012

The simplest solution is to just upgrade from the ground up, starting with GHC. Version 6.12 is old. However, if for some reason you can't or don't want to upgrade GHC, here are some hints aimed at helping you fix each problem.

cabal: alex is required but it could not be found.

Your instinct to run cabal install alex was the correct response.

ghc: unrecognised flags: -rtsopts

It looks like you have an old-ish GHC; the -rtsopts flag was added in GHC 7 (I see from later in your question that you're running 6.12). You should probably try installing an older version of alex -- perhaps one contemporary with 6.12, which was released 2.5 years ago or so. Optionally, complain to the alex maintainer if you think it should still support GHC6. One other choice is to try fixing it yourself; take a look in the .cabal file bundled with alex and see if just removing the -rtsopts flag lets things continue.

Couldn't match expected type `Char' against inferred type `[Char]'

Not as sure about this one, but it sounds like the version bounds on network's dependencies aren't strict enough. Again, one solution is to attempt to install an older version of network, and another is to attempt to fix it yourself by changing network's .cabal file. Honestly, this sounds like the hardest problem to fix of all the ones you talk about.

(edited to add:) per some discussion on #haskell, it seems that the type of notFollowedBy has changed between parsec-2 and parsec-3. So perhaps this is as easy as bumping the dependency in network's cabal file to parsec >= 3 instead of >= 2.

but ghc-pkg check nevertheless keeps complaining about a missing or broken Cabal-1.10.2.0

GHC is capable of tracking multiple versions of a single library, so installing a new version of Cabal won't fix the old versions. You can ask cabal-install to reinstall a particular version to try fixing this; e.g.

cabal install --reinstall Cabal-1.10.2.0