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 (if dated) cabal-install
5 please rather run `cabal v2-install`.
7 The typical usage is porting to a new linux architecture,
8 then the `linux-{ghc-ver}.json` file is available in the `bootstrap/` folder:
10 On a (linux) system you are bootstrapping, run
12 ./bootstrap/bootstrap.py -d ./bootstrap/linux-ghcver.json -w /path/to-ghc
14 from the top directory of the source checkout.
16 For offline builds, you can first run
18 ./bootstrap/bootstrap.py -d ./bootstrap/linux-ghcver.json -w /path/to-ghc fetch
20 to fetch tarballs for all the dependencies. These can then be used by a further
21 bootstrap command by way of the `--bootstrap-sources` argument:
23 ./bootstrap/bootstrap.py -w /path/to-ghc --bootstrap-sources bootstrap-sources.tar.gz
25 To generate the `platform-{ghc-ver}` files for other platforms, do:
27 1. On a system with functional cabal-install, install the same GHC version
28 as you will use to bootstrap on the host system.
30 2. Build a dependency description file (`$PLATFORM-$GHCVER.json`, e.g. `linux-8.8.4.json`) by running:
33 cabal v2-build --with-compiler=/path/to/ghc --dry-run cabal-install:exe:cabal
34 cp dist-newstyle/cache/plan.json bootstrap/$PLATFORM-$GHCVER.plan.json
36 cabal v2-run -v0 cabal-bootstrap-gen -- $PLATFORM-$GHCVER.plan.json | tee $PLATFORM-$GHCVER.json
39 3. You may need to tweak `bootstrap/$PLATFORM-$GHCVER.json` file manually,
40 for example toggle flags.
42 There are rules in the top-level `Makefile` for generation of these files.