(Imported from Trac #729, reported by @dcoutts on 2010-08-21)
Currently Cabal's simple build system expects that all modules listed in the exposed-modules and other-modules have some original source file (possibly one that needs a preprocessor). There is a built-in hack for the generated Paths_pkgname module.
Adding other generated modules is rather tricky because of the assumption that an original source file can be found. This should not be too hard to fix for build, since we can just look for the generated source file in the build location, but it affects sdist more severely. There is no way for sdist to know if a file is generated or not, so if a source file is not found then currently it just fails. Unlike at build time, it's reasonable to run sdist in a clean build tree.
People can hack around it in the Setup.hs by filtering out the module name for various stages, but that is still tricky due to the combination of #410 and #627.
This affects some core ghc components and also darcs.
Merge pull request #3670 from fmaste/autogen-modules
Add new 'autogen-modules' field. This closes #3656 and #719
Closed with #3656 and #3670