Home > Blockchain >  Haskell Cabal: omitting version a big mistake
Haskell Cabal: omitting version a big mistake

Time:01-26

I ran cabal build on a *.cabal file that doesn't have a version: specified and it seems to have confused cabal. When I put back the version specification, I got

$ cabal build
Resolving dependencies...
TODO: add support for multiple packages in a directory.  Got
yah-0.1.0.0
yah-0.1.0.0

CallStack (from HasCallStack):
  error, called at src\\Distribution\\Client\\ProjectOrchestration.hs:586:9 in cabal-install-3.8.1.0-inplace:Distribution.
Client.ProjectOrchestration

That is, normally the yah.cabal file would read

cabal-version:      3.0
name:               yah
version:            0.1.0.0
license:        etc., etc.

and cabal build was fed the above without the version and maybe without the cabal-version -- not sure. In any case, starting over with cabal init doesn't fix it, but other projects can be compiled fine.

My guess is that the various modules that are in the yah project are registered somewhere/somehow and it's not clear how to expunge that and start over. I'm on Windows, cabal 3.8.1.0. I've looked in C:\cabal, C:\ghccup, C:\Users\...\AppData\Roaming\cabal...

CodePudding user response:

It looks like you have more than one .cabal file in that directory. Remove the one that's not named yah.cabal.

  • Related