Skip to content
Snippets Groups Projects
Commit 1512c1b9 authored by Ben Gamari's avatar Ben Gamari :turtle:
Browse files

Add build-nix.sh wrapper

parent f4203e27
No related branches found
No related tags found
No related merge requests found
...@@ -149,14 +149,15 @@ snapshots. ...@@ -149,14 +149,15 @@ snapshots.
To run a similar build locally simply download a binary distribution from a To run a similar build locally simply download a binary distribution from a
`x86_64-fedora27-linux` CI job and run: `x86_64-fedora27-linux` CI job and run:
``` ```
$ nix build -f scripts/build-all.nix --keep-going testedPackages \ $ export GHC_TARBALL=./ghc-x86_64-fedora27-linux.tar.xz
--arg bindistTarball ./ghc-x86_64-fedora27-linux.tar.xz \ # for extra correctness assurance...
--arg extraHcOpts \"-dcore-lint\" $ export EXTRA_HC_OPTS=-dcore-lint
$ scripts/build-nix.sh
``` ```
This will build the set of packages defined by the `testedPackages` list in This will build the set of packages defined by the `testedPackages` list in
`scripts/build-all.nix`. `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: `scripts/summarize.py`, which produces a few artifacts:
* a JSON summary (`summary.json`) which includes the full dependency graph as * 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 ...@@ -165,10 +166,10 @@ After building `testedPackages` (allowing for failures) the CI job runs
success. This can be rendered with `scripts/render-graph.sh`. success. This can be rendered with `scripts/render-graph.sh`.
* a directory (`./logs`) of build logs * 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 $ scripts/build-nix.sh pandoc
$ python3 scripts/summarize.py
``` ```
### Hackage repository ### 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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment