|
1 | 1 | # Bootstrapping cabal-install |
2 | 2 |
|
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`. |
| 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`. |
6 | 6 |
|
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: |
| 7 | +## Bootstrapping on Linux |
9 | 8 |
|
10 | | -On a (linux) system you are bootstrapping, run |
| 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: |
11 | 11 |
|
12 | | - ./bootstrap/bootstrap.py -d ./bootstrap/linux-ghcver.json -w /path/to-ghc |
| 12 | +On a Linux system you are bootstrapping, run |
| 13 | + |
| 14 | + ./bootstrap/bootstrap.py -d ./bootstrap/linux-${GHCVER}.json -w /path/to-ghc |
13 | 15 |
|
14 | 16 | from the top directory of the source checkout. |
15 | 17 |
|
| 18 | +### Offline build |
| 19 | + |
16 | 20 | For offline builds, you can first run |
17 | 21 |
|
18 | | - ./bootstrap/bootstrap.py -d ./bootstrap/linux-ghcver.json -w /path/to-ghc fetch |
| 22 | + ./bootstrap/bootstrap.py -d ./bootstrap/linux-${GHCVER}.json -w /path/to-ghc fetch |
19 | 23 |
|
20 | 24 | to fetch tarballs for all the dependencies. These can then be used by a further |
21 | 25 | bootstrap command by way of the `--bootstrap-sources` argument: |
22 | 26 |
|
23 | | - ./bootstrap/bootstrap.py -w /path/to-ghc --bootstrap-sources bootstrap-sources.tar.gz |
| 27 | + ./bootstrap/bootstrap.py -w /path/to-ghc --bootstrap-sources bootstrap-sources.tar.gz |
24 | 28 |
|
25 | | -To generate the `platform-{ghc-ver}` files for other platforms, do: |
| 29 | +## Bootstrapping on other (non-Linux) platforms |
26 | 30 |
|
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. |
| 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: |
29 | 33 |
|
30 | | - 2. Build a dependency description file (`$PLATFORM-$GHCVER.json`, e.g. `linux-8.8.4.json`) by running: |
| 34 | +1. Install the same GHC version as you will use to bootstrap on the host system. |
31 | 35 |
|
32 | | - ```sh |
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 |
35 | | - cd bootstrap |
36 | | - cabal v2-run -v0 cabal-bootstrap-gen -- $PLATFORM-$GHCVER.plan.json | tee $PLATFORM-$GHCVER.json |
37 | | - ``` |
| 36 | +2. Build a dependency description file (`$PLATFORM-$GHCVER.json`, e.g. `macosx-8.8.4.json`) by running: |
38 | 37 |
|
39 | | - 3. You may need to tweak `bootstrap/$PLATFORM-$GHCVER.json` file manually, |
40 | | - for example toggle flags. |
| 38 | + ```sh |
| 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 |
| 41 | + cd bootstrap |
| 42 | + cabal run -v0 cabal-bootstrap-gen -- $PLATFORM-$GHCVER.plan.json | tee $PLATFORM-$GHCVER.json |
| 43 | + ``` |
| 44 | + |
| 45 | +3. You may need to tweak `bootstrap/$PLATFORM-$GHCVER.json` file manually, |
| 46 | + for example, to toggle flags. |
41 | 47 |
|
42 | 48 | There are rules in the top-level `Makefile` for generation of these files. |
| 49 | + |
0 commit comments