[Haskell-cafe] Cabal: other-modules necessary?

Nicolas Trangez ikke at nicolast.be
Fri Sep 16 08:53:29 UTC 2022


Hello Volker,

Compilation will, indeed, succeed. However, distribution won't: if the
module is not listed in `Other-Modules` (or any of the other sections),
it won't be included in the tarball generated when you invoke `cabal
sdist`, i.e., the source archive uploaded to Hackage.

Hence, if someone then tries to download and build your package from
Hackage, this will fail, since some module source files are missing.

There may be other effects of not listing some module, though above is
the one I'm aware of.

Cheers,

Nicolas

On Fri, 2022-09-16 at 10:47 +0200, Volker Wysk wrote:
> Hi
> 
> The cabal user guide says (in section 6.2.12): "Every module in the
> package
> must be listed in one of other-modules, library:exposed-modules or
> executable:main-is fields."
> 
> However, I only get a warning message, when I comment out the other-
> modules
> field in my .cabal file. The program compiles. This is the message:
> 
> <no location info>: warning: [-Wmissing-home-modules]
>     These modules are needed for compilation but not listed in your
> .cabal 
>     file's other-modules: 
>         Hsskripte Sicherung SicherungAktionen Text Wahl Zeit
> 
> Is it really necessary to specify all the imported modules? If so,
> why does
> the program compile? Can that warning message be turned off?
> 
> Apart from that, I'm happy with cabal.   :-)
> 
> Cheers,
> Volker
> _______________________________________________
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe
> Only members subscribed via the mailman list are allowed to post.



More information about the Haskell-Cafe mailing list