installing ghc fails

Gregory Wright gwright at antiope.com
Thu Jul 2 06:15:49 PDT 2009


Hi Inky,

On Jun 30, 2009, at 10:03 AM, Inky 788 wrote:

> Hi,
>
> I just tried installing pandoc, which requires ghc (among other  
> things), and it seems that there was a problem configuring ghc.
>
> I'm on Mac OS X 10.5.7, Intel. This is just after a fresh install of  
> MacPorts 1.7.1-10.5-Leopard. I'm brand new to MacPorts. Xcode tools  
> is installed on this machine, as is X11, and OS X's Software Update  
> says everything is up to date.
>
> Here's the terminal output:
>
> ~~~ snip ~~~
> -->  Building ghc
> Error: Target org.macports.build returned: shell command "cd /opt/ 
> local/var/macports/build/ 
> _opt_local_var_macports_sources_rsync 
> .macports.org_release_ports_lang_ghc/work/ghc-6.10.3 && env  
> DYLD_FALLBACK_LIBRARY_PATH=/opt/local/lib make" returned error 2
> Command output:                        --flags=-stage1 --flags=ncg -- 
> flags=ghci --ghc-option=-DGHCI_TABLES_NEXT_TO_CODE --enable-library- 
> profiling --with-compiler=/opt/local/var/macports/build/ 
> _opt_local_var_macports_sources_rsync 
> .macports.org_release_ports_lang_ghc/work/ghc-6.10.3/ghc/stage1- 
> inplace/ghc --with-hc-pkg=/opt/local/var/macports/build/ 
> _opt_local_var_macports_sources_rsync 
> .macports.org_release_ports_lang_ghc/work/ghc-6.10.3/utils/ghc-pkg/ 
> install-inplace/bin/ghc-pkg   \
>                        --prefix=/NONEXISTENT --bindir=/NONEXISTENT -- 
> libdir=/NONEXISTENT --libexecdir=/NONEXISTENT --datadir=/NONEXISTENT  
> --docdir=/NONEXISTENT --haddockdir=/NONEXISTENT --htmldir=/ 
> NONEXISTENT \
>                        --libsubdir='$pkgid' --with-gcc=gcc --with- 
> ld=/usr/bin/ld --hsc2hs-option=-I/opt/local/include    --configure- 
> option='--prefix=/opt/local'  --configure-option='--prefix=/opt/ 
> local/var/macports/build/ 
> _opt_local_var_macports_sources_rsync 
> .macports.org_release_ports_lang_ghc/work/destroot/opt/local'  -- 
> configure-option='--datadir=/opt/local/var/macports/build/ 
> _opt_local_var_macports_sources_rsync 
> .macports.org_release_ports_lang_ghc/work/destroot/opt/local/share/ 
> ghc-6.10.3'  --configure-option='--with-gmp-includes=/opt/local/ 
> include'  --configure-option='--with-gmp-libraries=/opt/local/lib'   
> --configure-option='--with-ghc=/opt/local/var/macports/build/ 
> _opt_local_var_macports_sources_rsync 
> .macports.org_release_ports_lang_ghc/work/ghc-bootstrap/bin/ghc'  -- 
> configure-option='CC=/usr/bin/gcc-4.0'  --configure-option='CFLAGS=- 
> O2 -I/opt/local/include'  --configure-option='LDFLAGS=-L/opt/local/ 
> lib -L/usr/lib'  --configure-option='CPPFLAGS=-I/opt/local/include'   
> --configure-option='CPP=/usr/bin/cpp-4.0' --configure-option=--with- 
> cc="gcc" --with-hsc2hs=/opt/local/var/macports/build/ 
> _opt_local_var_macports_sources_rsync 
> .macports.org_release_ports_lang_ghc/work/ghc-6.10.3/utils/hsc2hs/ 
> install-inplace/bin/hsc2hs \
>                        --ghc-option=-DSTAGE=2
> Configuring ghc-6.10.3...
> Warning: 'include-dirs: ../libffi/build/include' is a relative path  
> outside of
> the source tree. This will not work when generating a tarball with  
> 'sdist'.
> 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: 'include-dirs: stage2plus' directory does not exist.
> rm -f -f Makefile-stage2
> /opt/local/var/macports/build/ 
> _opt_local_var_macports_sources_rsync 
> .macports.org_release_ports_lang_ghc/work/ghc-6.10.3/libraries/cabal- 
> bin /opt/local/var/macports/build/ 
> _opt_local_var_macports_sources_rsync 
> .macports.org_release_ports_lang_ghc/work/ghc-bootstrap/bin/ghc /opt/ 
> local/var/macports/build/ 
> _opt_local_var_macports_sources_rsync 
> .macports.org_release_ports_lang_ghc/work/ghc-6.10.3/libraries/ 
> bootstrapping.conf 1.6.0.3 makefile  --distpref dist-stage2 -f  
> Makefile-stage2
> Preprocessing library ghc-6.10.3...
> Generating Makefile ghc-6.10.3...
> ../utils/mkdirhier/mkdirhier stage2plus
> mkdir stage2plus
> Creating stage2plus/ghc_boot_platform.h...
> Done.
> make -C compiler stage=2
> make -f Makefile-stage2 stage=2
> Makefile-stage2:86: dist-stage2/build/.depend: No such file or  
> directory
> /opt/local/var/macports/build/ 
> _opt_local_var_macports_sources_rsync 
> .macports.org_release_ports_lang_ghc/work/ghc-6.10.3/ghc/stage1- 
> inplace/ghc -M -dep-makefile dist-stage2/build/.depend -dep-suffix-s  
> -dep-suffixp  -DGHCI_TABLES_NEXT_TO_CODE -DSTAGE=2 -package-name  
> ghc-6.10.3 -hide-all-packages -no-user-package-conf -i -idist-stage2/ 
> build -inativeGen -ibasicTypes -icmm -icodeGen -icoreSyn - 
> icprAnalysis -ideSugar -ighci -ihsSyn -iiface -imain -iparser - 
> iprelude -iprofiling -irename -isimplCore -isimplStg -ispecialise - 
> istgSyn -istranal -itypecheck -itypes -iutils -ivectorise -idist- 
> stage2/build/autogen -Idist-stage2/build/autogen -Idist-stage2/build  
> -I../libffi/build/include -Istage2plus -I../libraries/base/cbits - 
> I../libraries/base/include -I. -Iparser -Iutils -optP-DGHCI -optP- 
> include -optPdist-stage2/build/autogen/cabal_macros.h -odir dist- 
> stage2/build -hidir dist-stage2/build -stubdir dist-stage2/build - 
> package Cabal-1.6.0.3 -package array-0.2.0.0 -package base-4.1.0.0 - 
> package bytestring-0.9.1.4 -package containers-0.2.0.1 -package  
> directory-1.0.0.3 -package filepath-1.1.0.2 -package  
> haskell98-1.0.1.0 -package hpc-0.5.0.3 -package old-time-1.0.0.2 - 
> package process-1.0.1.1 -package template-haskell-2.3.0.1 -package  
> unix-2.3.2.0 -O -Wall -fno-warn-name-shadowing -fno-warn-orphans - 
> XCPP -XMagicHash -XUnboxedTuples -XPatternGuards - 
> XForeignFunctionInterface -XEmptyDataDecls -XTypeSynonymInstances - 
> XMultiParamTypeClasses -XFlexibleInstances -XRank2Types - 
> XScopedTypeVariables -XDeriveDataTypeable -idist-stage2/build -H32m - 
> O -I/opt/local/include -L/opt/local/lib -Rghc-timing -O2 AsmCodeGen  
> MachCodeGen MachInstrs MachRegs NCGMonad PositionIndependentCode  
> PprMach RegAllocColor RegAllocInfo RegAllocLinear RegAllocStats  
> RegArchBase RegArchX86 RegCoalesce RegLiveness RegSpill  
> RegSpillClean RegSpillCost DsMeta TcSplice Convert ByteCodeAsm  
> ByteCodeFFI ByteCodeGen ByteCodeInstr ByteCodeItbls ByteCodeLink  
> Debugger LibFFI Linker ObjLink RtClosureInspect BasicTypes DataCon  
> Demand Exception Id IdInfo Literal MkId Module Name NameEnv NameSet  
> NewDemand OccName RdrName SrcLoc UniqSupply Unique Var VarEnv VarSet  
> BlockId CLabel Cmm CmmBrokenBlock CmmCPS CmmCPSGen CmmCPSZ  
> CmmCallConv CmmCommonBlockElimZ CmmContFlowOpt CmmCvt CmmExpr  
> CmmInfo CmmLex CmmLint CmmLive CmmLiveZ CmmOpt CmmParse CmmProcPoint  
> CmmProcPointZ CmmSpillReload CmmTx CmmUtils CmmZipUtil DFMonad  
> Dataflow MachOp MkZipCfg MkZipCfgCmm OptimizationFuel PprC PprCmm  
> PprCmmZ StackColor StackPlacements ZipCfg ZipCfgCmmRep ZipCfgExtras  
> ZipDataflow Bitmap CgBindery CgCallConv CgCase CgClosure CgCon  
> CgExpr CgForeignCall CgHeapery CgHpc CgInfoTbls CgLetNoEscape  
> CgMonad CgParallel CgPrimOp CgProf CgStackery CgTailCall CgTicky  
> CgUtils ClosureInfo CodeGen SMRep CoreFVs CoreLint CorePrep  
> CoreSubst CoreSyn CoreTidy CoreUnfold CoreUtils ExternalCore MkCore  
> MkExternalCore PprCore PprExternalCore CprAnalyse Check Coverage  
> Desugar DsArrows DsBinds DsCCall DsExpr DsForeign DsGRHSs DsListComp  
> DsMonad DsUtils Match MatchCon MatchLit HsBinds HsDecls HsDoc HsExpr  
> HsImpExp HsLit HsPat HsSyn HsTypes HsUtils BinIface BuildTyCl  
> IfaceEnv IfaceSyn IfaceType LoadIface MkIface TcIface BreakArray  
> CmdLineParser CodeOutput Config Constants DriverMkDepend  
> DriverPhases DriverPipeline DynFlags ErrUtils Finder GHC HeaderInfo  
> HscMain HscStats HscTypes InteractiveEval PackageConfig Packages  
> ParsePkgConf PprTyThing StaticFlags StaticFlagParser SysTools  
> TidyPgm Ctype HaddockLex HaddockParse HaddockUtils LexCore Lexer  
> Parser ParserCore ParserCoreUtils RdrHsSyn ForeignCall PrelInfo  
> PrelNames PrelRules PrimOp TysPrim TysWiredIn CostCentre SCCfinal  
> RnBinds RnEnv RnExpr RnHsDoc RnHsSyn RnNames RnPat RnSource RnTypes  
> CSE FloatIn FloatOut LiberateCase OccurAnal SAT SetLevels SimplCore  
> SimplEnv SimplMonad SimplUtils Simplify SRT SimplStg StgStats Rules  
> SpecConstr Specialise CoreToStg StgLint StgSyn DmdAnal SaAbsInt  
> SaLib StrictAnal WorkWrap WwLib FamInst Inst TcArrows TcBinds  
> TcClassDcl TcDefaults TcDeriv TcEnv TcExpr TcForeign TcGenDeriv  
> TcHsSyn TcHsType TcInstDcls TcMType TcMatches TcPat TcRnDriver  
> TcRnMonad TcRnTypes TcRules TcSimplify TcTyClsDecls TcTyDecls  
> TcTyFuns TcType TcUnify Class Coercion FamInstEnv FunDeps Generics  
> InstEnv TyCon Type TypeRep Unify Bag Binary BufWrite Digraph  
> Encoding FastBool FastFunctions FastMutInt FastString FastTypes  
> Fingerprint FiniteMap GraphBase GraphColor GraphOps GraphPpr IOEnv  
> Interval LazyUniqFM ListSetOps Maybes MonadUtils OrdList Outputable  
> Panic Pretty State StringBuffer Unicode UniqFM UniqSet Util  
> VectBuiltIn VectCore VectMonad VectType VectUtils Vectorise
> cmm/OptimizationFuel.hs: openBinaryFile: resource busy (file is  
> locked)
> <<ghc: 151205468 bytes, 23 GCs, 1713493/3493888 avg/max bytes  
> residency (3 samples), 34M in use, 0.00 INIT (0.00 elapsed), 0.16  
> MUT (1.34 elapsed), 0.04 GC (0.05 elapsed) :ghc>>
> make[3]: *** [dist-stage2/build/.depend] Error 1
> make[2]: *** [build.stage.2] Error 2
> make[1]: *** [stage2] Error 2
> make: *** [bootstrap2] Error 2
>
> Error: The following dependencies failed to build: ghc haddock hs- 
> ghc-paths
> Error: Status 1 encountered during processing.
> ~~~ /snip ~~~


The underlying cause here is a hard to reproduce file locking bug in  
ghc.  At the moment, if you get
the error "resource busy (file is locked)" you should try clean and  
try again.  The bug is in ghc itself,
and is not limited to OS X.

A bunch of these bugs were squashed about a year ago but I've seen  
this one on my own machine,
but have not been able to track it down.

Greg



More information about the macports-users mailing list