-
Mikhail Glushenkov authoredMikhail Glushenkov authored
This Cabal Git repository contains the following packages:
- Cabal: the Cabal library package (license)
-
cabal-install: the package containing the
cabal
tool (license)
The canonical upstream repository is located at https://github.com/haskell/cabal.
Installing Cabal (by downloading the binary)
Prebuilt binary releases can be obtained from https://www.haskell.org/cabal/download.html.
The cabal-install
binary download for your platform should contain the cabal
executable.
Installing Cabal (with cabal)
Assuming that you have a pre-existing, older version of cabal-install
,
run:
cabal install cabal-install
To get the latest version of cabal-install
. (You may want to cabal update
first.)
To install the latest version from the Git repository, clone the Git repository and then run:
(cd Cabal; cabal install)
(cd cabal-install; cabal install)
Installing Cabal (without cabal)
Assuming you don't have a pre-existing copy of cabal-install
, run:
cabal-install $ ./bootstrap.sh # running ./bootstrap.sh from within in cabal-install folder.
For more details, and non-unix like systems, see the README.md in cabal-install
Building Cabal for hacking
The current recommended way of developing Cabal is to use the
new-build
feature which shipped in cabal-install-1.24. Assuming
that you have a sufficiently recent cabal-install (see above),
it is sufficient to run:
cabal new-build cabal
To build a local, development copy of cabal-install. 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 new-build Cabal # build library only
cabal new-build Cabal:unit-tests # build Cabal's unit test suite
cabal new-build cabal-tests # etc...
Dogfooding HEAD.
Many of the core developers of Cabal dogfood cabal-install
HEAD
when doing development on Cabal. This helps us identify bugs
which were missed by the test suite and easily experiment with new
features.
The recommended workflow in this case is slightly different: you will
maintain two Cabal source trees: your production tree (built with a
released version of Cabal) which always tracks master
and which you
update only when you want to move to a new version of Cabal to dogfood,
and your development tree (built with your production Cabal) that you
actually do development on.
In more detail, suppose you have checkouts of Cabal at ~/cabal-prod
and ~/cabal-dev
, and you have a release copy of cabal installed at
/opt/cabal/2.4/bin/cabal
. First, build your production tree:
cd ~/cabal-prod
/opt/cabal/2.4/bin/cabal new-build cabal
This will produce a cabal binary (see also: Where are my build products? ). Add this binary to your PATH, and then use it to build your development copy:
cd ~/cabal-dev
cabal new-build cabal
Running tests
Using Travis and AppVeyor. If you are not in a hurry, the most convenient way to run tests on Cabal is to make a branch on GitHub and then open a pull request; our continuous integration service on Travis and AppVeyor will build and test your code. Title your PR with WIP so we know that it does not need code review.