6

Somewhat annoyingly, I keep getting this warning (for some oh 20 modules or so, polluting the build output I'd otherwise see without scrolling such as actual ghc warnings etc):

"The following modules should be added to exposed-modules or other-modules in proj-name.cabal

with:

  • a freshly created (via stack new proj-name simple) project,
  • with its .cabal set to only contain an executable proj-name (no library),
  • where I then right after stack new .. copied the src files/sub-dirs over from a non-stack/cabal project.

What's the supposed workflow here, am I seriously to manually keep those modules listings in the .cabal in sync with my module files?

In this thread someone suggests "the modern answer is Stack (and hpack)" but I was really hoping stack alone would somehow suffice here or could be set up to. If I am to set up yet-another (3rd after stack and thus implicitly cabal) tool just for builds, might as well go back to build scripts invoking ghc..

So the question: how can the overall very flexible powerful and robust stack help overcome also this cabal abomination, too? =)

Community
  • 1
  • 1
metaleap
  • 2,132
  • 2
  • 22
  • 40
  • 4
    I think your best option is still hpack. Stack calls `hpack` when it finds a `package.yaml` file, so you don't have to call `hpack` manually. To derive a `package.yaml` from an existing .cabal file, use [hpack-convert](https://github.com/yamadapc/hpack-convert#readme) which you can simply install via `stack install hpack-convert`. – sjakobi Feb 11 '17 at 10:02

0 Answers0