head aches in parser/Parser.hs

Claus Reinke claus.reinke at talk21.com
Tue Aug 5 05:30:51 EDT 2008


> contrast, Cabal stores all generated files in a separate directory
> (compiler/dist-stage[1/2]), and thus doesn't need to look at relative
> timestamps; so it gets confused by the old, leftover Parser.hs et al.

While that is cleaner, it also takes some getting used to, as generated
sources are no longer in source directories - then again, they aren't
often readable anyway, and perhaps there will be fewer things to go
wrong with them.

It is confusing, though, that Cabal silently uses compiler/parser/Parser.hs,
if it is meant to generate and use compiler/dist-stage[12]/Parser.hs.

There should be a Cabal warning: 
"variant of generated file in source dir, using that instead of generated file".

> Ironically this is another reason that switching to Cabal is a win --
> cleaning of preprocessed files happens automatically.  Unfortunately,
> though, it looks like all of those leftover preprocessed files will
> need to be deleted manually (but only this one time).  The following
> command worked for me (run inside the 'compilers' directory);
> 
> find . -name "*.x" -or -name "*.y" -or -name "*.hsc" | sed
> 's/\(.*\)\..*/\1.hs/' | xargs rm

What about '*.pp'? Any others? Cabal warnings would really help.

    ./compiler/parser/Parser.y.pp
    ./compiler/parser/Parser.y
    ./compiler/prelude/primops.txt.pp
    ./compiler/prelude/primops.txt

Claus



More information about the Cvs-ghc mailing list