haskell/cabal

Name: cabal

Owner: Haskell

Description: Official upstream development repository for Cabal and cabal-install

Created: 2012-03-15 12:53:38.0

Updated: 2018-04-02 15:18:37.0

Pushed: 2018-04-02 15:17:08.0

Homepage: http://haskell.org/cabal

Size: 31499

Language: Haskell

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Cabal Hackage version Stackage version Build Status Windows build status Documentation Status

This Cabal Git repository contains the following packages:

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:

l 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:

Cabal; cabal install)
cabal-install; cabal install)
Installing Cabal (without cabal)

Assuming you don't have a pre-existing copy of cabal-install, run:

l-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:

l 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:

l new-build Cabal # build library only
l new-build Cabal:unit-tests # build Cabal's unit test suite
l 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/1.24/bin/cabal. First, build your production tree:

/cabal-prod
/cabal/1.24/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:

/cabal-dev
l 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.

Some tips for using Travis effectively:

How to debug a failing CI test. One of the annoying things about running tests on CI is when they fail, there is often no easy way to further troubleshoot the broken build. Here are some guidelines for debugging continuous integration failures:

  1. Can you tell what the problem is by looking at the logs? The cabal-testsuite tests run with -v logging by default, which is dumped to the log upon failure; you may be able to figure out what the problem is directly this way.

  2. Can you reproduce the problem by running the test locally? See the next section for how to run the various test suites on your local machine.

  3. Is the test failing only for a specific version of GHC, or a specific operating system? If so, try reproducing the problem on the specific configuration.

  4. Is the test failing on a Travis per-GHC build (for example)? In this case, if you click on “Branch”, you can get access to the precise binaries that were built by Travis that are being tested. If you have an Ubuntu system, you can download the binaries and run them directly.

  5. Is the test failing on AppVeyor? Consider logging in via Remote Desktop to the build VM: https://www.appveyor.com/docs/how-to/rdp-to-build-worker/

If none of these let you reproduce, there might be some race condition or continuous integration breakage; please file a bug.

Running tests locally. To run tests locally with new-build, you will need to know the name of the test suite you want. Cabal and cabal-install have several. Also, you'll want to read Where are my build products?

The most important test suite is cabal-testsuite: most user-visible changes to Cabal should come with a test in this framework. See cabal-testsuite/README.md for more information about how to run tests and write new ones. Quick start: use cabal-tests to run Cabal tests, and cabal-tests --with-cabal=/path/to/cabal to run cabal-install tests (don't forget --with-cabal! Your cabal-install tests won't run without it).

There are also other test suites:

For these test executables, -p which applies a regex filter to the test names.

Conventions

We like this style guide.

Communicating

There are a few main venues of communication:

Releases

Notes for how to make a release are at the wiki page “Making a release”. Currently, @23Skidoo, @rthomas, @tibbe and @dcoutts have access to haskell.org/cabal, and @davean is the point of contact for getting permissions.

API Documentation

Auto-generated API documentation for the master branch of Cabal is automatically uploaded here: http://haskell.github.io/cabal-website/doc/html/Cabal/.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.