package description fields

Brian Smith brianlsmith at gmail.com
Wed Aug 3 20:27:01 EDT 2005


On 8/3/05, Ross Paterson <ross at soi.city.ac.uk> wrote:
> Proposals:
> 
> 1) New field extra-tmp-files, a list of extra files to be removed by
>    setup clean, beyond those that can be deduced.

What is the use case for this? Temporary files are either created by
tools Cabal already "knows" about (GHC, hsc2hs, etc.), or they are
created by hooks. It seems like Cabal should know enough to clean
temporary files created by the tools it invokes. If the user writes a
hook that generates temporary files, then they should also write a
pre/-post-clean hook to delete them.

Alternative proposal: Modify Cabal so that all temporary files are
generated in the scratch directory, and "setup clean" merely deletes
the scratch directory. Hooks that generate their temporary files into
the scratch directory will have them deleted automatically by "setup
clean," and hooks that generate temporary files anywhere else (and in
the source tree in particular) are discouraged and not directly
supported (though the package author could still use a pre/post-clean
hook to delete them manually).

> 3) New field data-files, a list of files to be copied to a place where
>    an executable can find them (e.g. template-hsc.h for hsc2hs):
>         Hugs: the directory containing the Main module
>         GHC/Windows: the directory containing the executable
>         GHC/Unix: /usr/local/share/<exename>
>    plus a new function in System.Directory to return the name of this
>    directory.  That would address Dimitry's requirements in

How about allowing directories too, which would be copied recursively?
What would the paths in data-files be relative to? How would one
reference a file that is generated by a hook into the scratch
directory? For example, imagine that wxHaskell was Cabalized, and that
its source distribution was to include the .hs files generated from
the wxdirect tool.

BTW, what exactly is a "source distribution?" I think a very
reasonable definition is "A source distribution can be built with
nothing more than a Haskell compiler/interpreter that supports the
required language features and that has the correct packages and
libraries installed" In particular, a source distribution would never
require any preprocessors.

Regards,
Brian


More information about the Libraries mailing list