can't build plugins-1.0 with ghc-6.9

Valery V. Vorotyntsev valery.vv at gmail.com
Mon Jan 7 04:59:57 EST 2008


Hi,

(The message below contains bunch of "preformatted" sections.
I hope it's still readable, otherwise, please, let me know.)

My quest is to install lambdabot (for the sake of offline `@hoogle'
and `@pl' commands), and the one depends on `plugins'.

1) plugins.cabal should be updated
----------------------------------

A patch to .cabal file[1] is needed to get rid of config-time
warning[2] and resolve build-time errors[3].

  [1]
  vvv:~/src/plugins-1.0$ diff -u plugins.cabal{.orig,}
  --- plugins.cabal.orig  2008-01-06 22:23:44.657177486 +0200
  +++ plugins.cabal       2008-01-06 22:25:45.160728537 +0200
  @@ -33,6 +33,6 @@
           src/Language/Hi/hschooks.c
   includes:             Linker.h
   extensions:           CPP, ForeignFunctionInterface
  -Build-Depends:        base, Cabal, haskell-src
  +Build-Depends:        base, Cabal, haskell-src, array, containers,
directory, random, process
   ghc-options:          -Wall -O -fasm -funbox-strict-fields
-fno-warn-missing-signatures
  -hs-source-dir: src
  +hs-source-dirs: src

  [2]
  vvv:~/src/plugins-1.0$ runhaskell Setup configure --prefix=$HOME --user
  Warning: The field "hs-source-dir" is deprecated, please use "hs-source-dirs"
  Configuring plugins-1.0...
  [...]

  [3]
  vvv:~/src/plugins-1.0$ runhaskell Setup build
  Preprocessing library plugins-1.0...
  Building plugins-1.0...

  src/Language/Hi/Binary.hs:90:7:
      Could not find module `Data.Array.Base':
        it is a member of package array-0.1, which is hidden

2) it doesn't build with Cabal-1.3.2
------------------------------------

`InstalledPackageInfo' is a type alias in GHC's Cabal[4], not a data
constructor; `plugins' library[5] gets confused[6].

  [4]
  vvv:~/src$ diff -u
cabal-1.2.2.0/Distribution/InstalledPackageInfo.hs
ghc/libraries/Cabal/Distribution/InstalledPackageInfo.hs
  --- cabal-1.2.2.0/Distribution/InstalledPackageInfo.hs  2007-11-01
17:02:35.000000000 +0200
  +++ ghc/libraries/Cabal/Distribution/InstalledPackageInfo.hs
2007-12-17 17:53:21.691532864 +0200
  @@ -46,7 +46,7 @@
   -- This module is meant to be local-only to Distribution...

   module Distribution.InstalledPackageInfo (
  -       InstalledPackageInfo(..),
  +       InstalledPackageInfo_(..), InstalledPackageInfo,
          ParseResult(..), PError(..), PWarning,
          emptyInstalledPackageInfo,
          parseInstalledPackageInfo,
  @@ -72,8 +72,8 @@
   -- -----------------------------------------------------------------------------
   -- The InstalledPackageInfo type

  -data InstalledPackageInfo
  -   = InstalledPackageInfo {
  +data InstalledPackageInfo_ m
  +   = InstalledPackageInfo_ {
          -- these parts are exactly the same as PackageDescription
          package           :: PackageIdentifier,
           license           :: License,
  @@ -87,8 +87,8 @@
          category          :: String,
          -- these parts are required by an installed package only:
           exposed           :: Bool,
  -       exposedModules    :: [String],
  -       hiddenModules     :: [String],
  +       exposedModules    :: [m],
  +       hiddenModules     :: [m],
           importDirs        :: [FilePath],  -- contain sources in case of Hugs
           libraryDirs       :: [FilePath],
           hsLibraries       :: [String],
  @@ -107,9 +107,11 @@
       }
       deriving (Read, Show)

  -emptyInstalledPackageInfo :: InstalledPackageInfo
  +type InstalledPackageInfo = InstalledPackageInfo_ String
  +
  +emptyInstalledPackageInfo :: InstalledPackageInfo_ m
   emptyInstalledPackageInfo
  -   = InstalledPackageInfo {
  +   = InstalledPackageInfo_ {
           package           = PackageIdentifier "" noVersion,
           license           = AllRightsReserved,
           copyright         = "",

  [5]
  vvv:~/src/plugins-1.0$ sed -n 64,66p src/System/Plugins/PackageAPI.hs
  updImportDirs f pk@(InstalledPackageInfo { importDirs = idirs }) =
          pk { importDirs = f idirs }
  updLibraryDirs f pk@(InstalledPackageInfo { libraryDirs = ldirs }) =

  [6]
  vvv:~/src/plugins-1.0$ runhaskell Setup build
  Preprocessing library plugins-1.0...
  Building plugins-1.0...
  [ 1 of 24] Compiling System.Plugins.Process (
src/System/Plugins/Process.hs, dist/build/System/Plugins/Process.o )
  [ 2 of 24] Compiling System.Plugins.Parser (
src/System/Plugins/Parser.hs, dist/build/System/Plugins/Parser.o )
  [ 3 of 24] Compiling System.Plugins.ParsePkgConfCabal (
src/System/Plugins/ParsePkgConfCabal.hs,
dist/build/System/Plugins/ParsePkgConfCabal.o )
  [ 4 of 24] Compiling System.Plugins.PackageAPI (
src/System/Plugins/PackageAPI.hs,
dist/build/System/Plugins/PackageAPI.o )

  src/System/Plugins/PackageAPI.hs:64:20:
      Not in scope: data constructor `InstalledPackageInfo'

  src/System/Plugins/PackageAPI.hs:66:21:
      Not in scope: data constructor `InstalledPackageInfo'

I would like to hear your suggestions.

Should I try harder[7] installing Cabal-1.2.2.0?
Or is this a bug of GHC's Cabal? In this case I've just reported it. :)

  [7]
  vvv:~/src/cabal-1.2.2.0$ runhaskell Setup configure --prefix=$HOME --user
  Configuring Cabal-1.2.2.0...
  Setup: At least the following dependencies are missing:
      base <3, filepath -any
  vvv:~/src/cabal-1.2.2.0$ runhaskell Setup configure --prefix=$HOME
--user -f small_base
  Configuring Cabal-1.2.2.0...
  Setup: At least the following dependencies are missing:
      base >=3,
      pretty -any,
      directory -any,
      old-time -any,
      process -any,
      containers -any,
      filepath -any
  vvv:~/src/cabal-1.2.2.0$ ghc-pkg list
  /home/vvv/lib/ghc-6.9.20080104/package.conf:
      Cabal-1.3.2, array-0.1, base-3.0, bytestring-0.9, containers-0.1,
      directory-1.0, filepath-1.1, (ghc-6.9.20080104), haskell98-1.0.1,
      hpc-0.5, old-locale-1.0, old-time-1.0, packedstring-0.1,
      pretty-1.0, process-1.0, random-1.0, readline-1.0.1, rts-1.0,
      template-haskell-2.2, unix-2.2
  /home/vvv/.ghc/i386-linux-6.9.20080104/package.conf:
      X11-1.4.1, binary-0.4.1, haskell-src-1.0.1.1, mtl-1.1.0.0,
      network-2.1.0.0, parsec-2.1.0.0, xmonad-0.5, xmonad-contrib-0.5

Thanks a lot.

Happy hacking!

-- 
vvv


More information about the Glasgow-haskell-users mailing list