Newbish building question
J. Garrett Morris
jgmorris at cecs.pdx.edu
Wed Nov 12 19:29:34 EST 2008
Hello,
I've been attempting to add some minor instrumentation to my pet copy
of GHC 6.10.1. In particular, I'd like to add some code to
extendInstEnv in compiler/types/InstEnv.lhs.
First, I tried importing Debug.Trace into the InstEnv module, and
changing the extendInstEnv function to trace "foobar". This built
file, although was not tremendously useful.
Next, I tried the following modification:
extendInstEnv :: InstEnv -> Instance -> InstEnv
extendInstEnv inst_env ins_item@(Instance { is_cls = cls_nm, is_tcs = mb_tcs })
= trace (showSDocDebug (ppr ins_item)) (addToUFM_C add inst_env
cls_nm (ClsIE [ins_item] ins_tyvar))
where
add (ClsIE cur_insts cur_tyvar) _ = ClsIE (ins_item : cur_insts)
(ins_tyvar || cur_tyvar)
ins_tyvar = not (any isJust mb_tcs)
This produced the following error message:
home/garrett/code/ghc-6.10.1/ghc/stage1-inplace/ghc -package-name
base-4.0.0.0-hide-all-packages -no-user-package-conf -split-objs -i
-idist/build -i. -idist/build/autogen -Idist/build/autogen
-Idist/build -Iinclude -optP-include
-optPdist/build/autogen/cabal_macros.h -#include "HsBase.h" -odir
dist/build -hidir dist/build -stubdir dist/build -package
ghc-prim-0.1.0.0 -package integer-0.1.0.0 -package rts-1.0 -O
-package-name base -XMagicHash -XExistentialQuantification
-XRank2Types -XScopedTypeVariables -XUnboxedTuples
-XForeignFunctionInterface -XUnliftedFFITypes -XDeriveDataTypeable
-XGeneralizedNewtypeDeriving -XFlexibleInstances -XPatternSignatures
-XStandaloneDeriving -XPatternGuards -XEmptyDataDecls -XCPP
-idist/build -H32m -O -O2 -Rghc-timing -XGenerics -Wall
-fno-warn-deprecated-flags -c Data/Maybe.hs -o dist/build/Data/Maybe.o
-ohi dist/build/Data/Maybe.hi
dist/build/GHC/Base.hi
Dict fun GHC.Base.$f9:
Interface file inconsistency:
home-package module `base:GHC.Base' is needed,
but is not listed in the dependencies of the interfaces directly
imported by the module being compiled
Cannot continue after interface file error
<<ghc: 20271680 bytes, 2 GCs, 132152/132152 avg/max bytes residency (1
samples), 31M in use, 0.01 INIT (0.02 elapsed), 0.06 MUT (0.14
elapsed), 0.03 GC (0.04 elapsed) :ghc>>
I'm not sure what to do from here - showSDocDebug comes from
Outputable, which was already imported by InstEnv, so it didn't seem
like I should have to change anything in the build..
/g
--
I am in here
More information about the Glasgow-haskell-users
mailing list