Skip to content

Support generated modules better #719

@bos

Description

@bos

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions