haskell/cabal — pull request #1046 by lpotmann (2012-09-21 21:44:44+00:00)
Title: Add way to exclude generated modules from sdists

In one of my projects, I am machine-generating a number of modules, which other parts of the code then import. These need to be specified in the .cabal file, otherwise hard-to-debug linker errors happen. However, then they get included in sdist tarballs, or sdist chokes if they're not present, which is undesirable. This patch lets generated modules be excluded from sdists on the command line with a `--generated-module` option.

(An alternative (and perhaps more robust) approach would be to add a `generated-modules` field to cabal files, but that's only just occurred to me and this patch is sitting here!)