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
2008/11/13 J. Garrett Morris <jgmorris@cecs.pdx.edu>:
(addToUFM_C add inst_env cls_nm (ClsIE [ins_item] ins_tyvar))
Did you try make distclean and building again? This often fixes things, it could also be that extendInstEnv was inlined somewhere, though that should not lead to the error, either. No idea what else could have happened. -- Push the envelope. Watch it bend.
J. Garrett Morris wrote:
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>>
This is rather strange. It looks like an error when compiling Data.Maybe in the base package. I'm not sure why that would need to be recompiled at all, and the error itself is strange. Anyway, when modifying GHC you only need to say 'make' in compiler/, not at the top-level, that is unless you really want to recompile libraries, in which case you should probably 'make clean' in libraries/, then 'make boot' and 'make'. Cheers, Simon
participants (3)
-
J. Garrett Morris -
Simon Marlow -
Thomas Schilling