[Yhc] Re: Issue 122 in project yhc

Thorkil Naur naur at post11.tele.dk
Sat Feb 24 15:27:35 EST 2007


Hello,

On Saturday 24 February 2007 19:28, Neil Mitchell wrote:
> ...
> > I've just added some code so it now reads:
> >
> > case (local,res) of
> >   ([x], _) -> return x
> >   (_, [x]) -> return x
> >   ([], []) -> raiseError $ ErrorFileNone noErrPos askMsg file rs
> >   (as, bs) ->
> >       -- ASSERTION TO DEBUG GHC 6.6 WITHOUT -O CODEGEN ON A MAC!
> >       assert (not $ null $ as ++ bs) $
> >       raiseError $ ErrorFileMany noErrPos askMsg file (map anyOne (as ++ 
bs))
> >
> > That (to me) looks like an assertion that should always be true, but
> > which appears at first glance to be being violated by GHC 6.6 on a Mac
> > when compiled without -O. Can you try that on your machine, and see if
> > it does raise an assertion? If it does, we can then contact the GHC
> > developers and let them get a minimal test case :)
> ...

To clarify: The yhc failure (i.e. erroneously reporting "multiple files found" 
instead of "no files found") occurs when yhc has been built with "scons build 
yhc type=release" so that Package.hs is compiled by ghc-6.6 with -O option. 
If I compile Package.hs without type=release (i.e. "scons build yhc" which 
then recompiles a lot, (all?) including Package.hs) so that Package.hs and 
the other .hs files are compiled without ghc-6.6 option -O, then the 
resulting yhc works, i.e. reports "no files found" as it should.

So: Compiled with type=release (and therefore ghc-6.6 -O), yhc fails. And 
compiled without type=release (and therefore ghc-6.6 without -O) yhc works.

And further: I have tried the above on my machine. Unfortunately, the bug 
(erroneous report) now disappears, i.e. after scons build yhc type=release, 
yhc correctly reports "not files found". And, if I remove the assert that you 
have inserted, the bug re-appears, i.e. yhc incorrectly reports "multiple 
files" when there are, in fact, none.

Neat, eh?

I am now trying to introduce the assert in Error.hs instead, don't know if 
this is a good idea. But in any case, I have the additional problem that 
(according to ghc documentation), -O (which we need to see the error) implies 
-fignore-asserts. So I am trying now with GHCFLAGS=-fno-ignore-asserts 
scons ...

Best regards
Thorkil


More information about the Yhc mailing list