Support generated modules better #719

bos opened this Issue May 24, 2012 · 1 comment


None yet
3 participants

bos commented May 24, 2012

(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.

ttuegel added this to the _|_ milestone Apr 23, 2015

@fmaste fmaste added a commit that referenced this issue Aug 11, 2016

@fmaste fmaste Merge pull request #3670 from fmaste/autogen-modules
Add new 'autogen-modules' field. This closes #3656 and  #719

fmaste commented Aug 11, 2016

Closed with #3656 and #3670

fmaste closed this Aug 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment