Commit 8717428c authored by Ben Gamari's avatar Ben Gamari 🐢

Allow additional arguments to be passed to GHC

parent d0112e7e
......@@ -30,6 +30,10 @@ variables:
# ACCESS_TOKEN provided via protected environment variable
# EXTRA_HC_OPTS provided by GHC job. These are passed to via --ghc-options to
# GHC during the package builds. This is instantiated with, e.g., -dcore-lint
# during GHC validation builds.
build:
stage: test
......@@ -67,7 +71,8 @@ build:
- nix-build scripts/build-all.nix -j$CPUS
--no-build-output
-A buildDepends
--arg bindistTarball $GHC_TARBALL
--arg bindistTarball "$GHC_TARBALL"
--arg extraHcOpts "\"$EXTRA_HC_OPTS\""
- nix-store --export $(nix-store -qR --include-outputs $(nix-instantiate --quiet scripts/build-all.nix --arg bindistTarball $GHC_TARBALL -A buildDepends -A ghc)) > store.nar
- ret=0
- nix-build scripts/build-all.nix
......
......@@ -149,8 +149,9 @@ 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 testedPackages \
--arg bindistTarball ./ghc-x86_64-fedora27-linux.tar.xz
$ nix build -f scripts/build-all.nix --keep-going testedPackages \
--arg bindistTarball ./ghc-x86_64-fedora27-linux.tar.xz \
--arg extraHcOpts \"-dcore-lint\"
```
This will build the set of packages defined by the `testedPackages` list in
`scripts/build-all.nix`.
......
......@@ -4,7 +4,9 @@
# Expects to be run on x86_64.
# bindistTarball should be a fedora27 tarball.
{ bindistTarball }:
{ bindistTarball
, extraHcOpts ? ""
}:
let
# GHC from the given bindist.
......@@ -34,6 +36,7 @@ let
hyperlinkSource = false;
configureFlags = (drv.configureFlags or []) ++ [
"--ghc-options=-ddump-timings"
"--ghc-options=\"${extraHcOpts}\""
];
});
};
......
......@@ -10,6 +10,7 @@ def read_summary():
summary = subprocess.check_output(
['nix', 'eval', '--json',
'--arg', 'bindistTarball', os.environ['GHC_TARBALL'],
'--arg', 'extraHcOpts', f"\"{os.environ.get('EXTRA_HC_OPTS', '')}\"",
'-f', 'scripts/build-all.nix',
'summary'],
encoding = 'UTF-8')
......
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