Skip to content

Commit c1659a3

Browse files
ulysses4evergeekosaurmergify[bot]
authored
facelift bootstrap/README.md (#9096)
* facelift bootstrap/README.md * fixup! facelift bootstrap/README.md Co-authored-by: Artem Pelenitsyn <[email protected]> * Update bootstrap/README.md --------- Co-authored-by: brandon s allbery kf8nh <[email protected]> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
1 parent bd7197b commit c1659a3

File tree

1 file changed

+28
-21
lines changed

1 file changed

+28
-21
lines changed

bootstrap/README.md

Lines changed: 28 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,49 @@
11
# Bootstrapping cabal-install
22

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`.
66

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
98

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

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
1315

1416
from the top directory of the source checkout.
1517

18+
### Offline build
19+
1620
For offline builds, you can first run
1721

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
1923

2024
to fetch tarballs for all the dependencies. These can then be used by a further
2125
bootstrap command by way of the `--bootstrap-sources` argument:
2226

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
2428

25-
To generate the `platform-{ghc-ver}` files for other platforms, do:
29+
## Bootstrapping on other (non-Linux) platforms
2630

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

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.
3135

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

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.
4147

4248
There are rules in the top-level `Makefile` for generation of these files.
49+

0 commit comments

Comments
 (0)