Commit 1512c1b9 authored by Ben Gamari's avatar Ben Gamari 🐢

Add build-nix.sh wrapper

parent f4203e27
Pipeline #8107 passed with stage
in 34 minutes and 26 seconds
......@@ -149,14 +149,15 @@ snapshots.
To run a similar build locally simply download a binary distribution from a
`x86_64-fedora27-linux` CI job and run:
```
$ nix build -f scripts/build-all.nix --keep-going testedPackages \
--arg bindistTarball ./ghc-x86_64-fedora27-linux.tar.xz \
--arg extraHcOpts \"-dcore-lint\"
$ export GHC_TARBALL=./ghc-x86_64-fedora27-linux.tar.xz
# for extra correctness assurance...
$ export EXTRA_HC_OPTS=-dcore-lint
$ scripts/build-nix.sh
```
This will build the set of packages defined by the `testedPackages` list in
`scripts/build-all.nix`.
After building `testedPackages` (allowing for failures) the CI job runs
After building `testedPackages` (allowing for failures) the script job runs
`scripts/summarize.py`, which produces a few artifacts:
* a JSON summary (`summary.json`) which includes the full dependency graph as
......@@ -165,10 +166,10 @@ After building `testedPackages` (allowing for failures) the CI job runs
success. This can be rendered with `scripts/render-graph.sh`.
* a directory (`./logs`) of build logs
You can run `scripts/summarize.py` locally with
Note that `build-nix.sh` can also be used to build packages not included in
`testedPackages`:
```
$ export GHC_TARBALL=./ghc-x86_64-fedora27-linux.tar.xz
$ python3 scripts/summarize.py
$ scripts/build-nix.sh pandoc
```
### Hackage repository
......
#!/bin/sh
# A convenient wrapper for build-all.nix.
if [ -z "$GHC_TARBALL" ]; then
echo '$GHC_TARBALL is not set; please set it.'
exit 1
fi
targets=$@
if [ -z "$targets" ]; then
targets=testedPackages
fi
echo "Building $targets with GHC options \"$EXTRA_HC_OPTS\"..."
nix build -f scripts/build-all.nix --keep-going testedPackages \
--arg bindistTarball $GHC_TARBALL
--arg extraHcOpts \"$EXTRA_HC_OPTS\"
echo "Build finished. Running summarize..."
python3 scripts/summarize.py
echo
echo "Build finished. I produced the following:"
echo " * summary.json: a summary of the build"
echo " * summary.dot: the dependency graph of packages I built"
echo " * logs/*: the build logs"
echo
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