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
16
votes
2 answers

How are `ghc-pkg` and `cabal` programs related? (Haskell)

As I know cabal is a program to manage installation of packages like FreeBSD's pkg_add. But there is another tool called ghc-pkg. I don't know why there are two different programs. What's the role of each of them and how are they related?
eonil
  • 83,476
  • 81
  • 317
  • 516
16
votes
3 answers

Conventions for Stability field of Cabal packages

Cabal allows for a freeform Stability field: stability: freeform The stability level of the package, e.g. alpha, experimental, provisional, stable. What are the community conventions about these stability values? What is considered experimental…
sastanin
  • 40,473
  • 13
  • 103
  • 130
16
votes
3 answers

Flags in cabal files

I am following the user-guide for package developing: https://www.haskell.org/cabal/users-guide/developing-packages.html#quickstart I got stuck in the Flags section. How do I pass flags to my files? Is it just at build time? I have tried to search…
Afonso Matos
  • 2,406
  • 1
  • 20
  • 30
16
votes
2 answers

How to profile libraries?

Is there any hidden option that will put cost centres in libraries? Currently I have set up my profiling like this: cabal: ghc-prof-options: -O2 …
fho
  • 6,787
  • 26
  • 71
16
votes
2 answers

How to use HUnit and Cabal to do Automated Testing?

I've been fighting with Cabal for a good portion of a day trying to make its automated testing features work with HUnit. I've read the documentation here and here, and I have my Test-Suite section set up like it shows, but whenever I try and build…
Dwilson
  • 1,239
  • 9
  • 18
16
votes
1 answer

Statically link GMP to an Haskell application using GHC (+ LLVM)

How can I drop dynamic dependency on libgmp and go from this: linux-vdso.so.1 => (0x00007fffdccb1000) libgmp.so.10 => /usr/lib/x86_64-linux-gnu/libgmp.so.10 (0x00007fb01afc1000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6…
Cetin Sert
  • 4,497
  • 5
  • 38
  • 76
16
votes
1 answer

How to upgrade gtk2hsC2hs?

I am trying cabal install glib-0.12.3 under my Ubuntu 11.10 using cabal-install 0.10.2. However, it shows the following error messages: setup: The program gtk2hsC2hs version >=0.13.5 is required but the version found at /usr/bin/gtk2hsC2hs is…
zw324
  • 26,764
  • 16
  • 85
  • 118
15
votes
4 answers

How to handle feature requests that add new package dependencies

I am the maintainer of a package on hackage, lrucache. I recently received a feature request for adding instances for Binary and NFData. Both of those are useful things to have, and I have no issue with those instances, in principle. However, both…
Carl
  • 26,500
  • 4
  • 65
  • 86
15
votes
3 answers

Haskell Cabal regenerate documentation for all installed packages

How can I generate and install documentation for all locally installed cabal packages? I turned on the documentation flag in ~/.cabal/config which means that all newly installed packages will have documentation also generated. But how to generate…
Anupam Jain
  • 7,851
  • 2
  • 39
  • 74
15
votes
4 answers

Stack has not been tested with GHC & Cabal versions

In my Haskell project when I stack run, it is showing the following, but still runs. What warning is this? How can I get rid of it? Stack has not been tested with GHC versions above 8.6, and using 8.8.2, this may fail Stack has not been tested with…
Muhammadjon
  • 1,476
  • 2
  • 14
  • 35
15
votes
2 answers

Using alex/happy with Cabal

I'm writing a compiler for a class I'm taking. The class isn't specifically Haskell but I'm using Haskell to write my compiler and interpreter. I have a cabal package setup to hopefully make it easy for my prof to run/compile. I have happy and alex…
Edward
  • 1,786
  • 1
  • 15
  • 33
15
votes
1 answer

How to set ghci options for cabal repl?

I have a haskell project which I compile with -Werror by default. This means that when I run cabal repl it runs with the option -Werror turned on. This means that for example when I evaluate 2 + 2 I get the following error…
11Kilobytes
  • 451
  • 1
  • 6
  • 15
15
votes
4 answers

Which Haskell package contains given module

I know a Haskell module name, but I can't figure out in what package it is defined. This is bad because I can't compile without a package exposing this module. Specificaly it is Text.Regex that I can't locate, but I would like to know how to solve…
luntain
  • 4,560
  • 6
  • 37
  • 48
15
votes
1 answer

cabal FFI dependency

I am making a small Haskell game in Windows, where I would like to respond each time the user presses a key. Because getChar behaves strangely on Windows, I use FFI to get access to getch in conio.h, as described here. The relevant code is: foreign…
Boris
  • 5,094
  • 4
  • 45
  • 71
15
votes
2 answers

Monadic expressions in conditionals - GHC compiles, cabal refuses

Been scratching my head for a day over this one. I have a few functions in my code that look like this: function :: IO (Maybe Whatever) function = do monadFun yaySomeIO status <- maybeItWillFail if checkStatus status -- Did we succeed? …
Colin Woodbury
  • 1,799
  • 2
  • 15
  • 25