Ticket #3852 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

Building GHC 6.12.1 with Cabal 1.9.0 installed

Reported by: simonmar Owned by:
Priority: high Milestone: 6.12.3
Component: Build System Version: 6.12.1
Keywords: Cc: khaelin@…, duncan
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: Building GHC failed Difficulty: Easy (less than 1 hour)
Test Case: Blocked By:
Blocking: Related Tickets:

Description

Reported by Nicolas Martyanoff <khaelin@gmail.com> on glasgow-haskell-users. I expect the build system is picking up Cabal 1.9.0 in preference to the version in the source tree.


I thought it might be good to build GHC 6.12.1 with itself just to be sure it's working fine before make a dist, but I now get the following error:

"/usr/local/bin/ghc"   -H32m -O  -package-conf libraries/bootstrapping.conf  -package-name ghc-6.12.1 -hide-all-packages -i -icompiler/nativeGen -icompiler/basicTypes -icompiler/cmm -icompiler/codeGen -icompiler/coreSyn -icompiler/cprAnalysis -icompiler/deSugar -icompiler/ghci -icompiler/hsSyn -icompiler/iface -icompiler/main -icompiler/parser -icompiler/prelude -icompiler/profiling -icompiler/rename -icompiler/simplCore -icompiler/simplStg -icompiler/specialise -icompiler/stgSyn -icompiler/stranal -icompiler/typecheck -icompiler/types -icompiler/utils -icompiler/vectorise -icompiler/stage1/build -icompiler/stage1/build/autogen -Icompiler/stage1/build -Icompiler/stage1/build/autogen -Icompiler/stage1 -Icompiler/../libraries/base/cbits -Icompiler/../libraries/base/include -Icompiler/. -Icompiler/parser -Icompiler/utils    -optP-include -optPcompiler/stage1/build/autogen/cabal_macros.h -package Cabal-1.9.0 -package array-0.3.0.0 -package base-4.2.0.0 -package bin-package-db-0.0.0.0 -package bytestring-0.9.1.5 -package containers-0.3.0.0 -package directory-1.0.1.0 -package filepath-1.1.0.3 -package hpc-0.5.0.4 -package old-time-1.0.0.3 -package process-1.0.1.2 -package unix-2.4.0.0  -DSTAGE=1 -Wall -fno-warn-name-shadowing -fno-warn-orphans -XCPP -XMagicHash -XUnboxedTuples -XPatternGuards -XForeignFunctionInterface -XEmptyDataDecls -XTypeSynonymInstances -XMultiParamTypeClasses -XFlexibleInstances -XRank2Types -XScopedTypeVariables -XDeriveDataTypeable -XRelaxedPolyRec     -odir compiler/stage1/build -hidir compiler/stage1/build -stubdir compiler/stage1/build -hisuf hi -osuf  o -hcsuf hc -c compiler/main/Packages.lhs -o compiler/stage1/build/Packages.o

compiler/main/Packages.lhs:233:63:
    Couldn't match expected type `InstalledPackageInfo_ String'
           against inferred type `Cabal-1.8.0.2:Distribution.InstalledPackageInfo.InstalledPackageInfo_
                                    m'
      Expected type: [InstalledPackageInfo_ String]
      Inferred type: [Cabal-1.8.0.2:Distribution.InstalledPackageInfo.InstalledPackageInfo_
                        m]
    In the second argument of `map', namely `conf'
    In the first argument of `return', namely
        `(map installedPackageInfoToPackageConfig conf)'
gmake[1]: *** [compiler/stage1/build/Packages.o] Error 1
gmake: *** [all] Error 2

I tried to "ghc-pkg mask" Cabal-1.8.0.2, then Cabal-1.9.0, didn't change anything.

Does someone know what's going on here, and what can be done to fix it ?

Change History

Changed 3 years ago by galdor

I just got the exact same result on a Linux x86_64 platform, so it's really platform/os independant.

Changed 3 years ago by igloo

  • cc duncan added

I'm having problems installing Cabal HEAD as a user with 6.8.2:

$ ghc --make Setup
[...]
$ ./Setup configure --user --prefix=`pwd`/inst
[...]
$ ./Setup build -v
[...]
Registering Cabal-1.9.0...
/usr/bin/ghc-pkg update - --global --user --package-conf=dist/package.conf.inplace
Setup: Unable to rename "/usr/lib/ghc-6.8.2/package.conf" to
"/usr/lib/ghc-6.8.2/package.conf.old"
ghc-pkg.bin: /usr/lib/ghc-6.8.2/package.conf: renameFile: permission denied
(Permission denied)

Duncan, any idea what's going on?

Changed 3 years ago by igloo

  • owner set to duncan

Changed 3 years ago by simonmar

Presumably the problem here is that the build system is picking up the more recent version of Cabal and using it instead of the bundled version? Ian - why does this hanve anything to do with GHC 6.8.2, isn't that a separate problem?

Changed 3 years ago by igloo

  • owner duncan deleted
  • milestone changed from 6.12.2 to 6.12.3

Yes, the build problem is a separate issue, but I needed to build it in order to reproduce the problem :-)

Anyway, I've worked around it by using 6.10.4 instead.

It looks like what's happening is that bin-package-db.cabal says

build-depends: Cabal == 1.8.*

but compiler/ghc.cabal just says

build-depends: Cabal

I'm not entirely sure why Cabal doesn't decide to use 1.8.0.3 for ghc, but it doesn't:

"/home/ian/bindists/6.10.4/inst/bin/ghc" --with-ghc-pkg="/home/ian/bindists/6.10.4/inst/bin/ghc-pkg" --with-gcc="/usr/bin/gcc" --configure-option=--with-cc="/usr/bin/gcc"  --flags=stage1 --flags=ncg --ghc-options='-#include "cutils.h"' --ghc-option=-DSTAGE=1 --ghc-options=' -O' --package-db=/home/ian/ghc/6.12-branch/ghc/libraries/bootstrapping.conf --enable-shared --with-hscolour="/usr/bin/HsColour" --configure-option=CFLAGS="-Wall   " --configure-option=LDFLAGS="  " -- stage1 compiler
Configuring ghc-6.12.1.20100327...
Warning: 'include-dirs: ../libraries/base/cbits' is a relative path outside of
the source tree. This will not work when generating a tarball with 'sdist'.
Warning: 'include-dirs: ../libraries/base/include' is a relative path outside
of the source tree. This will not work when generating a tarball with 'sdist'.
Warning: This package indirectly depends on multiple versions of the same
package. This is highly likely to cause a compile failure.
package bin-package-db-0.0.0.0 requires Cabal-1.8.0.3
package ghc-6.12.1.20100327 requires Cabal-1.9.0

We could fix this by passing --constraint "Cabal == 1.8.0.3" (or whatever the right syntax is) whenever we configure a Cabal package (I assume that that is a no-op if the package doesn't depend on Cabal?) but the same thing could happen with any package we use from the bootstrapping compiler.

I think we should punt on this for now, as building with Cabal HEAD isn't something we support anyway.

Changed 3 years ago by simonmar

I suspect that we should be using --constraint for all of our bootstrap packages, to avoid problems when the user has installed later versions.

Do we really not support building with Cabal HEAD? I thought the GHC build was supposed to be independent of what packages the user has installed, at least for the bootstrap packages.

Changed 3 years ago by igloo

  • status changed from new to closed
  • resolution set to fixed

Fixed in 6.12 branch and HEAD.

Sun May  9 18:47:24 BST 2010  Ian Lynagh <igloo@earth.li>
  * Add version constraints for the boot packages; fixes trac #3852
  When using the bootstrapping compiler, we now explicitly constrain
  the version of boot packages (Cabal, extensible-exceptions, etc) to the
  in-tree version, so that the build system is less fragile should the
  user have a newer version installed for the bootstrapping compiler.
Note: See TracTickets for help on using tickets.