Disable benchmarks and tests for tools (#1044)
By default haskell.nix cabalProject functions run cabal
configure with --enable-tests and --enable-benchmarks.
This is good when you are working on a project as
it means your tests and benchmarks are in the
package `components`.
The `tools` functions (and `shellFor` `tools` arg)
return `components.exes.${toolName}` and while
it is possible to access the other components
via the `project` and `package` properties of
tool component.
In some cases the benchmarks and tests can
have problematic constraints that cause
problems building other components.
Disabling the tests and benchmarks by default
when building `tools` should reduce the these
issues.
commit5d3975e33886b2b9945b98859a4ab629b63055e1
authorHamish Mackenzie <Hamish.Mackenzie@iohk.io>
dateWed 17 Feb 2021, 01:27 (6 years ago)
parent413adb0
overlays/hackage-quirks.nix−1
@@ -71,7 +71,6 @@ in { haskell-nix = prev.haskell-nix // {
7171 allow-newer: haskell-language-server:ghcide
7272 constraints: ghcide <0.7.4
7373 '';
74− configureArgs = "--disable-benchmarks --disable-tests";
7574 };
7675
7776 }."${name}" or {};
overlays/tools.nix+4−1
@@ -62,7 +62,10 @@ in { haskell-nix = prev.haskell-nix // {
6262 args = { caller = "hackage-tool"; } // args';
6363 in
6464 (final.haskell-nix.hackage-package
65− (args // { name = final.haskell-nix.toolPackageName.${name} or name; }))
65+ ( # Disable benchmarks and tests by default (since we only want the exe component)
66+ { configureArgs = "--disable-benchmarks --disable-tests"; }
67+ // args
68+ // { name = final.haskell-nix.toolPackageName.${name} or name; }))
6669 .components.exes."${final.haskell-nix.packageToolName.${name} or name}";
6770
6871 tool = compiler-nix-name: name: versionOrArgs: