1 # Bootstrapping cabal-install
3 This utility is only intended for use in building `cabal-install`
4 on a new platform. If you already have a functional cabal-install, however old, then
5 please instead run `cabal install cabal-install`.
7 ## Bootstrapping on Linux
9 The typical use case is porting to a new Linux architecture. In that case,
10 a `linux-${GHCVER}.json` file is available in the `bootstrap/` folder:
12 On a Linux system you are bootstrapping, run
14 ./bootstrap/bootstrap.py -d ./bootstrap/linux-${GHCVER}.json -w /path/to-ghc
16 from the top directory of the source checkout.
20 For offline builds, you can first run
22 ./bootstrap/bootstrap.py -d ./bootstrap/linux-${GHCVER}.json -w /path/to-ghc fetch
24 to fetch tarballs for all the dependencies. These can then be used by a further
25 bootstrap command by way of the `--bootstrap-sources` argument:
27 ./bootstrap/bootstrap.py -w /path/to-ghc --bootstrap-sources bootstrap-sources.tar.gz
29 ## Bootstrapping on other (non-Linux) platforms
31 You will need to generate a `${PLATFORM}-${GHCVER}.json` file for other platforms and then use it
32 in the same way as it is shown for Linux above. On a system with functional `cabal-install`, do:
34 1. Install the same GHC version as you will use to bootstrap on the host system.
36 2. Build a dependency description file (`$PLATFORM-$GHCVER.json`, e.g. `macosx-8.8.4.json`) by running:
39 cabal build --with-compiler=/path/to/ghc --dry-run cabal-install:exe:cabal
40 cp dist-newstyle/cache/plan.json bootstrap/$PLATFORM-$GHCVER.plan.json
42 cabal run -v0 cabal-bootstrap-gen -- $PLATFORM-$GHCVER.plan.json | tee $PLATFORM-$GHCVER.json
45 3. You may need to tweak `bootstrap/$PLATFORM-$GHCVER.json` file manually,
46 for example, to toggle flags.
48 There are rules in the top-level `Makefile` for generation of these files.