Commit 156388d1 authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

README rewrite.


Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 020289e0
......@@ -5,8 +5,148 @@ This Cabal Git repository contains the following packages:
* [Cabal](Cabal/README.md): the Cabal library package ([license](Cabal/LICENSE))
* [cabal-install](cabal-install/README.md): the package containing the `cabal` tool ([license](cabal-install/LICENSE))
See [HACKING.md](HACKING.md) for information about contributing and building
from git cloned sources.
The canonical upstream repository is located at
https://github.com/haskell/cabal.
Installing 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)
~~~~
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-install
~~~~
To build a local, development copy of cabal-install. The binary
will be located at
`dist-newstyle/build/cabal-install-$VERSION/build/cabal/cabal`;
you can determine the `$VERSION` of cabal-install by looking at
[cabal-install/cabal-install.cabal](cabal-install/cabal-install.cabal).
Here are some other useful variations on the commands:
~~~~
cabal new-build Cabal # build library only
cabal new-build Cabal:package-tests # build Cabal's package test suite
cabal new-build cabal-install:integration-tests # etc...
~~~~
Running tests
-------------
The easiest 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.
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. In general, the test executable for
`{Cabal,cabal-install}:$TESTNAME` will be stored at
`dist-newstyle/build/{Cabal,cabal-install}-$VERSION/build/$TESTNAME/$TESTNAME`.
* `Cabal:package-tests` are out-of-process integration tests on the top-level `Setup`
command line interface. If you are hacking on the Cabal library you
want to run this test suite. It must be run from the `Cabal` subdirectory
(ugh!) This test suite can be a bit touchy; see
[Cabal/tests/README.md](Cabal/tests/README.md) for more information.
Build products and test logs are generated and stored in
`Cabal/tests/PackageTests` under folders named `dist-test` and
`dist-test.$subname`.
* `Cabal:unit-tests` are small, quick-running unit tests
on small pieces of functionality in Cabal. If you are working
on some utility functions in the Cabal library you should run this
test suite.
* `cabal-install:unit-tests` are small, quick-running unit tests on
small pieces of functionality in cabal-install. If you are working
on some utility functions in cabal-install you should run this test
suite.
* `cabal-install:solver-quickcheck` are QuickCheck tests on
cabal-install's dependency solver. If you are working
on the solver you should run this test suite.
* `cabal-install:integration-tests` are out-of-process integration tests on the
top-level `cabal` command line interface. The coverage is not
very good but it attempts to exercise most of cabal-install.
* `cabal-install:integration-tests2` are integration tests on some
top-level API functions inside the `cabal-install` source code.
You should also run this test suite.
Conventions
-----------
* Spaces, not tabs.
* Try to follow style conventions of a file you are modifying, and
avoid gratuitous reformatting (it makes merges harder!)
* A lot of Cabal does not have top-level comments. We are trying to
fix this. If you add new top-level definitions, please Haddock them;
and if you spend some time understanding what a function does, help
us out and add a comment. We'll try to remind you during code review.
* If you do something tricky or non-obvious, add a comment.
* For local imports (Cabal module importing Cabal module), import lists
are NOT required (although you may use them at your discretion.) For
third-party and standard library imports, please use explicit import
lists.
* You can use basically any GHC extension supported by a GHC in our
support window, except Template Haskell, which would cause
bootstrapping problems in the GHC compilation process.
* Our GHC support window is three years: that is, the Cabal library
must be buildable out-of-the-box with the dependencies that shipped
with GHC for at least three years. The Travis CI checks this, so
most developers submit a PR to see if their code works on all
these versions of Haskell. cabal-install must also be buildable
on all these GHCs, although it does not have to be buildable
out-of-the-box. Instead, the `cabal-install/bootstrap.sh` script
must be able to download and install all of the dependencies.
(This is also checked by CI!)
We like [this style guide][guide].
[guide]: https://github.com/tibbe/haskell-style-guide/blob/master/haskell-style.md
Communicating
-------------
There are a few main venues of communication:
* Most developers subscribe to receive messages from [all issues](https://github.com/haskell/cabal/issues); issues can be used to [open discussion](https://github.com/haskell/cabal/issues?q=is%3Aissue+is%3Aopen+custom+label%3A%22type%3A+discussion%22). If you know someone who should hear about a message, CC them explicitly using the @username GitHub syntax.
* For more organizational concerns, the [mailing
list](http://www.haskell.org/mailman/listinfo/cabal-devel) is used.
* Many developers idle on `#hackage` on `irc.freenode.net`. `#ghc` is
also a decently good bet.
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment