on iko/ghcjs-patch-master help sign in
Exclude pre/postCheck from `all` used by shellFor (#306)

Without this fix `shellFor` fails for packages where a component has a `preCheck` or `postCheck` option set. It should be safe to exclude these because `shellFor` uses `phases = ["installPhase"]` and it seems like a bad idea to use `all` for running tests (better to run the individual `tests` components).

commitbe5ce45b317da106f1e3c6363fd877765010699b authorHamish Mackenzie <Hamish.Mackenzie@iohk.io> dateFri 8 Nov 2019, 21:01 (7 years ago) parent26d7b00
1 file changed+8−1
modules/package.nix+8−1
modules/package.nix+8−1
@@ -316,5 +316,12 @@ in {
316316 # this is relevant would be to switch from the bool type to
317317 # something like an anyBool type, which would merge definitions by
318318 # returning true if any is true.
319− config.components.all = lib.mkMerge (haskellLib.getAllComponents config);
319+ config.components.all = lib.mkMerge (
320+ builtins.map (c:
321+ # Exclude attributes that are likely to have conflicting definitions
322+ # (a common use case for `all` is in `shellFor` and it only has an
323+ # install phase).
324+ builtins.removeAttrs c ["preCheck" "postCheck"]
325+ ) (haskellLib.getAllComponents config)
326+ );
320327}