
Iavor Diatchki
Hello, The other day I tried to use the Cabal library for the first time, and mostly it worked, but I have the following questions that perhaps someone can help me with:
- In the .cabal file there is a field for Exported modules, is there a way to specify that all modules should be exported, or at least a "hiding" version, where I can specify: "export all modules, but the ones in this directory", etc.
There's not currently a way to do this. We'd like to be able to build a dependency tree based on import lists or something to scan for .hs files, and we plan to do that some day, but we haven't gotten around to that yet. How many modules are we talking about, by the way? For this first release, we wanted to get the basic functionality down as well as possible. Patches gladly accepted!
If not, it seems that I have to write some sort of a script to generate the .cabal file so that I don't accidentally forget some modules, and so again I need a Makefile even for the simplest libraries.
BTW, you may want to look into the .buildinfo files if you're thinking of generating a .cabal file, that won't help in this case, though. Generating the .cabal file is sorta frowned upon for the sake of layered tools like Hackage, which will not be able to use a Makefile to generate them, so you won't really be able to conform to the cabal interface. There are some advantages to listing all the modules by hand, and it's usually not that hard.
- I like the "generate source tarball feature", but can one customize it a bit? Typically when I generate a source tarball I don't just include the source files, but READMEs, examples, documentation etc. Is there a way to specify this?
This feature is a bit buggy and not ready for prime-time, I'm afraid. However, you can customize any command by using pre-and-post hooks to some extent: http://www.haskell.org/ghc/docs/latest/html/libraries/Cabal/Distribution.Sim... I think the right way to do what you're asking for is to add a field like "sdist-extras" or "documentation" or something to just list the filenames, that you also want included in the sdist, or to do a better job with the hooks so you can provide a function to generate the filenames or something? Good luck! Let us know if you have more questions, and how Cabal fits or doesn't fit your needs. It's trying to be a lot of things to a lot of people, and we had to guess in some places. peace, isaac