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
20
votes
1 answer

Why cabal tool doesn't use Setup.lhs/Setup.hs?

I've added a putStrLn "Hello" line into main function of my Setup.lhs and was expecting to see it when running cabal configure or cabal build. But i did not. Then i've compiled Setup.lhs with ghc --make and ran ./Setup configure and the line was…
arrowd
  • 33,231
  • 8
  • 79
  • 110
19
votes
2 answers

Where do QuickCheck instances belong in a cabal package?

I have a cabal package that exports a type NBT which might be useful for other developers. I've gone through the trouble of defining an Arbitrary instance for my type, and it would be a shame to not offer it to other developers for testing their…
acfoltzer
  • 5,588
  • 31
  • 48
19
votes
2 answers

How to specify dependency on external C library in .cabal?

I maintain a library with FFI bindings on Hackage. So my Haskell library depends on the corresponding C library and its header files. Now I specify the external dependency in the .cabal file like this: PkgConfig-Depends: libfoo >= 1.2 And it…
sastanin
  • 40,473
  • 13
  • 103
  • 130
19
votes
1 answer

Is there a way to get version of Cabal package in source code of the package?

Say I have a console program that has an option to display its version. Currently whenever I update version in .cabal file I need to go to source code and update constant — string representation of current version number as well. This feels against…
Mark Karpov
  • 7,499
  • 2
  • 27
  • 62
19
votes
1 answer

Trying out "cabal sandbox init" and cabal not recognizing the command "sandbox"

I'm trying out the tutorial about making a simple website with scotty but I get an error when I try the command "cabal sandbox init": cabal: unrecognised command: sandbox (try --help) Does anyone know what is wrong?
19
votes
2 answers

Haskell reinstall base with profiling enabled

I am trying reinstall my Haskell libraries with profiling enabled by following the instructions listed here However, whenever cabal attempts to reinstall one of the libraries I get the following message: LibraryNameHere.hs:1:1: Could not find…
recursion.ninja
  • 5,377
  • 7
  • 46
  • 78
18
votes
1 answer

Haskell Cabal: "package indirectly depends on multiple versions of the same package"

After clearing out all of my cabal installed packages, I ran this following session: $ cabal update Downloading the latest package list from hackage.haskell.org james@bast:~/.cabal/packages$ cabal install cabal-dev Resolving…
jameshfisher
  • 34,029
  • 31
  • 121
  • 167
18
votes
1 answer

Cabal: build dir with source

I have a src directory. In this directory I have Main.hs file and Test directory. In the Test directory I have Test.hs module. I need to compile it with cabal. In my cabal file I have: Executable main -- .hs or .lhs file containing the Main…
0xAX
  • 20,957
  • 26
  • 117
  • 206
18
votes
1 answer

What is package.yaml & stack.yaml & Setup.hs & the-project-name.cabal files?

I find that, when I use the stack new the-project-name new-template command, many files is generated into a new directory. and I notice the following 4 special files: package.yaml stack.yaml Setup.hs the-project-name.cabal These 4 files seems…
luochen1990
  • 3,689
  • 1
  • 22
  • 37
17
votes
3 answers

How do i use runhaskell with cabal-dev?

Unfortunately cabal-dev ghci does not work in this project, i get an error: Loading package download-0.3.2 ... linking ... ghc: /home/stulli/haskell/ifdl/cabal-dev//lib/download-0.3.2/ghc-7.4.1/HSdownload-0.3.2.o: unknown symbol `stat64' ghc:…
somesoaccount
  • 1,267
  • 15
  • 37
17
votes
5 answers

Using cabal with multiple GHC versions

I got both ghc6 and ghc7 on my desktop. To install new packages (for the specific ghc version), I use cabal with the flag --with-compiler= to specify for which ghc i want the package installed. I do cabal update before installing any new…
vis
  • 2,279
  • 1
  • 19
  • 27
17
votes
2 answers

Limit memory used by cabal install?

I'm limited by 1GB memory on my server hosting. When I want to compile some big program like git-annex, Cabal eats lot of memory. Is there a way to limit cabal or gcl using some option to limit memory usage? I updated question with some details: I'm…
reyman64
  • 523
  • 4
  • 34
  • 73
17
votes
1 answer

Blacklisting your own faulty hackage release

I've accidentally uploaded a faulty distribution and tried to reupload it right away, but cabal replied with: This version of the package has already been uploaded. As a matter of policy we do not allow package tarballs to be changed after…
Nikita Volkov
  • 42,792
  • 11
  • 94
  • 169
17
votes
1 answer

Statically linking a C library with a Haskell library

I have a Haskell project that aims to create some C++ bindings. I've written the C wrappers and compiled them into a stand-alone statically linked library. I'd like to write the Haskell bindings to link statically to the C wrappers so that I don't…
Deech
  • 2,223
  • 15
  • 20
16
votes
1 answer

Cabal to setup a new Haskell project?

Is it possible to (ab)use Cabal to have it create a generic Haskell project with a simple command, similar to what you can do in the Scala world with Sbt or Maven? e.g. > cabal create AwesomeProject > ls AwesomeProject.hs awesomeProject.cabal …
Alexander Battisti
  • 2,178
  • 2
  • 19
  • 24