Skip to content

Commit 5d3975e

Browse files
authored
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.
1 parent 413adb0 commit 5d3975e

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

overlays/hackage-quirks.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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:

0 commit comments

Comments
 (0)