More hs-boot file troubles
Simon Peyton-Jones
simonpj at microsoft.com
Wed Mar 21 09:45:15 EDT 2007
GHC should not crash.
But, as a separate matter, hs-boot files are always to be regarded with suspicion. Why do you need Num.hs-boot. I think it's because GHC.Num imports GHC.Show which imports GHC.List which imports Data.List.Stream. But that's stupid. Show only uses a couple of functions from List, and it's a Bad Idea to make a great big module loop for the sake of foldr1, or whatever. I urge you to un-loop-ify your code.
Meanwhile I'll find out why it's crashing anyway
S
| -----Original Message-----
| From: cvs-ghc-bounces at haskell.org [mailto:cvs-ghc-bounces at haskell.org] On Behalf Of Donald Bruce
| Stewart
| Sent: 21 March 2007 11:10
| To: cvs-ghc at haskell.org
| Cc: Duncan Coutts
| Subject: More hs-boot file troubles
|
| Looks like there's still something wrong with iface checking and
| .hs-boot files, in today's head (since the latest SPJ patches).
|
| Duncan and I are working on a fork of base using stream fusion for the List
| library. We needed a new .hs-boot breaker between Data.List.Stream and
| GHC.Num. While this was enough to get it compiling last week, now, after
| getting past the boot file, and Data.Stream, GHC.Num itself fails with:
|
| ../../compiler/ghc-inplace -H16m -O -fglasgow-exts -ddump-simpl-stats -cpp -Iinclude -"#include"
| HsBase.h -funbox-strict-fields -package-name base-2.0 -O -Rghc-timing -fgenerics -fgenerics -split-
| objs -c GHC/Num.lhs -o GHC/Num.o -ohi GHC/Num.hi
|
| ==================== FloatOut stats: ====================
| 65 Lets floated to top level; 0 Lets floated elsewhere; from 58 Lambda groups
|
|
| ghc-6.7.20070321: panic! (the 'impossible' happened)
| (GHC version 6.7.20070321 for x86_64-unknown-linux):
| tcIfaceGlobal (local): not found:
| base:GHC.Num.$fx3{v rc8}
| [(0F, Identifier `base:GHC.Num.plusInteger{v 0F}'),
| (0G, Identifier `base:GHC.Num.timesInteger{v 0G}'),
| (01E, Identifier `base:GHC.Num.fromInteger{v 01E}'),
| (01F, Identifier `base:GHC.Num.-{v 01F}'),
| (01N, Identifier `base:GHC.Num.negate{v 01N}'),
| (2b, Class `base:GHC.Num.Num{tc 2b}'),
| (314, Type constructor `base:GHC.Num.Integer{tc 314}'),
| (6e, Data constructor `base:GHC.Num.S#{d 6e}'),
| (6g, Data constructor `base:GHC.Num.J#{d 6g}'),
| (aB9, Identifier `<{v aB9}'), (aBf, Identifier `+{v aBf}'),
| (aBv, Identifier `>{v aBv}'), (aBB, Identifier `+{v aBB}'),
| (aBV, Identifier `<{v aBV}'), (aC0, Identifier `+{v aC0}'),
| (aCk, Identifier `>{v aCk}'), (aCp, Identifier `+{v aCp}'),
| (aCC, Identifier `lit_aCC{v}'), (aCD, Identifier `>={v aCD}'),
| (aCU, Identifier `lit_aCU{v}'), (aCV, Identifier `>={v aCV}'),
| (aGg, Identifier `$dNum{v aGg}'), (aPG, Identifier `$dOrd{v aPG}'),
| (aPI, Identifier `$dOrd{v aPI}'), (aPJ, Identifier `$dNum{v aPJ}'),
| (aPK, Identifier `$dOrd{v aPK}'),
| (rbw, Data constructor `base:GHC.Num.:DNum{d rbw}'),
| (rc5, Identifier `base:GHC.Num.*{v rc5}'),
| (rc7, Identifier `base:GHC.Num.S#{v rc7}'),
| (rc9, Identifier `base:GHC.Num.+{v rc9}'),
| (rdw, Identifier `base:GHC.Num.abs{v rdw}'),
| (rdy, Identifier `base:GHC.Num.signum{v rdy}'),
| (rdD, Identifier `base:GHC.Num.subtract{v rdD}'),
| (rdF, Identifier `base:GHC.Num.quotRemInt{v rdF}'),
| (rdH, Identifier `base:GHC.Num.divModInt{v rdH}'),
| (rdJ, Identifier `base:GHC.Num.zeroInteger{v rdJ}'),
| (rdL, Identifier `base:GHC.Num.int2Integer{v rdL}'),
| (rdN, Identifier `base:GHC.Num.integer2Int{v rdN}'),
| (rdP, Identifier `base:GHC.Num.toBig{v rdP}'),
| (rdR, Identifier `base:GHC.Num.quotRemInteger{v rdR}'),
| (rdT, Identifier `base:GHC.Num.divModInteger{v rdT}'),
| (rdV, Identifier `base:GHC.Num.remInteger{v rdV}'),
| (rdX, Identifier `base:GHC.Num.quotInteger{v rdX}'),
| (rdZ, Identifier `base:GHC.Num.gcdInteger{v rdZ}'),
| (re1, Identifier `base:GHC.Num.lcmInteger{v re1}'),
| (re3, Identifier `base:GHC.Num.divExact{v re3}'),
| (re5, Identifier `base:GHC.Num.minusInteger{v re5}'),
| (re7, Identifier `base:GHC.Num.negateInteger{v re7}'),
| (re9, Identifier `base:GHC.Num.enumDeltaIntegerFB{v re9}'),
| (reb, Identifier `base:GHC.Num.enumDeltaInteger{v reb}'),
| (red, Identifier `base:GHC.Num.enumDeltaToIntegerFB{v red}'),
| (ref, Identifier `base:GHC.Num.enumDeltaToInteger{v ref}'),
| (reh, Identifier `base:GHC.Num.up_fb{v reh}'),
| (rej, Identifier `base:GHC.Num.dn_fb{v rej}'),
| (rel, Identifier `base:GHC.Num.up_list{v rel}'),
| (ren, Identifier `base:GHC.Num.dn_list{v ren}'),
| (rep, Identifier `base:GHC.Num.jtos{v rep}'),
| (rud, Identifier `base:GHC.Num.J#{v rud}'),
| (rue, Type constructor `base:GHC.Num.:TNum{tc rue}'),
| (ruf, Identifier `base:GHC.Num.$p1Num{v ruf}'),
| (rug, Identifier `base:GHC.Num.$p2Num{v rug}'),
| (ruh, Identifier `base:GHC.Num.:DNum{v ruh}'),
| (rus, Identifier `base:GHC.Num.$f1{v rus}'),
| (ruv, Identifier `base:GHC.Num.$f2{v ruv}'),
| (rux, Identifier `base:GHC.Num.$f3{v rux}'),
| (ruA, Identifier `base:GHC.Num.$f4{v ruA}'),
| (ruC, Identifier `base:GHC.Num.$f5{v ruC}'),
| (ruE, Identifier `base:GHC.Num.$f6{v ruE}'),
| (rLN, Identifier `base:GHC.Num.$dm-{v rLN}'),
| (rLP, Identifier `base:GHC.Num.$dmnegate{v rLP}')]
|
| Please report this as a GHC bug: http://www.haskell.org/ghc/reportabug
|
| <<ghc: 110807872 bytes, 16 GCs, 4029053/7271872 avg/max bytes residency (3 samples), 18M in use, 0.00
| INIT (0.00 elapsed), 0.63 MUT (0.71 elapsed), 0.28 GC (0.29 elapsed) :ghc>>
| make: *** [GHC/Num.o] Error 1
|
| To reproduce this, grab a ghc tree, without libraries/base, and instead take base from:
|
| $ mkdir build
| $ cd build
| $ lndir -silent ../ghc
| $ cd libraries
| $ darcs get http://www.cse.unsw.edu.au/~dons/code/streams/base/
| $ cd ..
| $ autoreconf
| $ ./configure
| $ make
|
| And it should fall over building base.
|
| As it is, this bug is rather painful, since we can't build base with our stuff.
| Should we be considering splitting up Data.Stream/Data.List.Stream
| (http://www.cse.unsw.edu.au/~dons/code/streams/list/) to avoid adding Num.hs-boot?
|
| This would mean break up the code to instead map onto the existing
| GHC.List/Data.List split, and somehow breaking up Data.Stream as well.
|
| -- Don
|
| _______________________________________________
| Cvs-ghc mailing list
| Cvs-ghc at haskell.org
| http://www.haskell.org/mailman/listinfo/cvs-ghc
More information about the Cvs-ghc
mailing list