Questions tagged [cabal]

Cabal is a package distribution and build system for the Haskell programming language.

Cabal stands for Common Architecture for Building Applications and Libraries. It is a package distribution and build system for the Haskell programming language. It is integrated with Hackage, a central package archive of open-source software written in Haskell. Cabal can refer both to the Cabal library which Setup.hs files can link against in order to build Haskell packages, and the command-line tool, which provides a range of additional functionality, including automatically fetching packages from , solving dependency graphs of version constraints to obtain install plans, managing sandboxed package environments, and much more.

More information about Cabal can be found at the Cabal website.

1793 questions
161
votes
3 answers

What is the difference between Cabal and Stack?

Yesterday I learnt about a new Haskell tool called Stack. At the first blush, it looks like it does much the same job as Cabal. So, what is the difference between them? Is stack a replacement for Cabal? In which cases should I use Stack instead of…
ZhekaKozlov
  • 36,558
  • 20
  • 126
  • 155
123
votes
1 answer

Emacs Interactive-Haskell repl non-response if either the cabal or working directory set to project directory

I'm running into odd behavior with the Interactive-Haskell repl in emacs. When I source a file, the emacs mini buffer shows a series of interactive prompts: Start a new project named 'myproject'? Cabal dir (guessed from myproject.cabal): Build…
daj
  • 6,962
  • 9
  • 45
  • 79
85
votes
4 answers

How can I uninstall a version of a Cabal package?

Happstack Lite is breaking on me because it's getting blaze-html version 0.5 and it wants version 0.4. Cabal says that both versions 0.4.3.4 and 0.5.0.0 are installed. I want to remove the 0.5.0.0 and use just the older version. But cabal does…
Norman Ramsey
  • 198,648
  • 61
  • 360
  • 533
72
votes
4 answers

Profiling builds with Stack

How do I tell stack to build my executable and all its dependencies with -prof? Simply adding it to ghc-options in the .cabal file is not enough, because it only tries to build the executable with profiling enabled, which fails.
Sebastian Graf
  • 3,602
  • 3
  • 27
  • 38
70
votes
1 answer

How can my Haskell program or library find its version number?

I would like my cabalised program to have a --version switch. I would like it to report the same version as is present in the .cabal file. If I have to update the version number separately in my Haskell source code as well as in the .cabal file, I…
dave4420
  • 46,404
  • 6
  • 118
  • 152
67
votes
3 answers

How to install a package using stack?

Using cabal, I could install hakyll with the command: cabal install hakyll How can I do the same thing using stack?
Ben
  • 3,612
  • 3
  • 19
  • 24
66
votes
2 answers

My cabal packages are FUBAR; how can I purge them and start over?

I forgot to enable building libs for profiling in my ~/.cabal/config before installing a bunch of packages on a new machine and now a --reinstall world to try to fix the situation has left everything broken (naturally). I think it's a better use of…
jberryman
  • 16,334
  • 5
  • 42
  • 83
61
votes
5 answers

How to reduce duplication in the build-depends fields of a .cabal file?

Here's a .cabal file: Name: myprogram Version: 0.1 -- blah blah blah Cabal-version: >=1.9.2 Executable myprogram HS-source-dirs: src Main-is: Main.hs Build-depends: attoparsec ==…
dave4420
  • 46,404
  • 6
  • 118
  • 152
56
votes
2 answers

How to make a Haskell cabal project with library+executables that still run with runhaskell/ghci?

If you declare a library + executable sections in a cabal file while avoiding double compilation of the library by putting the library into a hs-source-dirs directory, you cannot usually run your project with ghci and runhaskell anymore, especially…
nh2
  • 24,526
  • 11
  • 79
  • 128
48
votes
1 answer

Independent subset of cabal packages set

Given a set of cabal packages, is there a way to automatically calculate subset of independent packages? In other words, subset of packages that will be sufficient to install them all. For [network,parsec] the answer is [network] because it network…
46
votes
3 answers

How to use a DLL in a Haskell project?

I would like to use an external library, RDFox, in a Haskell project. Context: I am working on Windows and Linux, both 64 bits, using GHC 7.10 and stack. RDFox is programmed in C++. RDFox shared libraries (.dll, .so) can be downloaded with Java and…
Der Vogel
  • 460
  • 3
  • 6
46
votes
5 answers

Cabal not installing dependencies when needing profiling libraries?

I want to compile my program with profiling, so I run: $ cabal configure --enable-executable-profiling ... $ cabal build ... Could not find module 'Graphics.UI.GLUT': Perhaps you havent installed the profiling libraries for package…
yairchu
  • 23,680
  • 7
  • 69
  • 109
46
votes
2 answers

How can I set up a simple test with Cabal?

I have a Haskell project and Cabal package-description that allows me to build and install my package with $ cabal configure $ cabal build $ cabal install But what about cabal test? Cabal's help says to configure a test suite with UserHooks, but how…
Greg Bacon
  • 134,834
  • 32
  • 188
  • 245
42
votes
3 answers

Can I get `cabal install` to use multiple cores?

Does anyone know how to get cabal install to exploit parallelism? I'm compiling with GHC, and while I don't know if GHC itself can do parallel builds, surely cabal install could run multiple compilations in parallel, no? At least for distinct,…
Norman Ramsey
  • 198,648
  • 61
  • 360
  • 533
41
votes
1 answer

How to install/use a local version of package using Stack?

The situation is, I am trying to install Netwire using Stack. However, there is a problem in the latest netwire 5.0.1, as reported by dhobbs: http://hub.darcs.net/ertes/netwire/issue/13 Since I don't know when the problem will ever be fixed, I…
Carl Dong
  • 1,299
  • 15
  • 26
1
2 3
99 100