-
Phil de Joux authoredPhil de Joux authored
Contributing to Cabal
Building Cabal for hacking
If you use the latest version of cabal published on Hackage, it is sufficient to run:
cabal build cabal
If not, you aren't able to build the testsuite, so you need to disable the default cabal.project
that implies configuring the testsuite, e.g., with:
cabal build --project-file=cabal.project.release cabal
Note If you're using Nix, you might find it convenient to work within a shell that has all the
Cabal
development dependencies:$ nix-shell -p cabal-install ghc ghcid haskellPackages.fourmolu_0_12_0_0 pkgconfig zlib.dev
A Nix flake developer shell with these dependencies is also available, supported solely by the community, through the command
nix develop github:yvan-sraka/cabal.nix
.
The location of your build products will vary depending on which version of
cabal-install you use to build; see the documentation section
Where are my build products?
to find the binary (or just run find -type f -executable -name cabal
).
Here are some other useful variations on the commands:
cabal build Cabal # build library only
cabal build Cabal-tests:unit-tests # build Cabal's unit test suite
cabal build cabal-tests # etc...