From 612f3324c91890db17c94d42bc257e4178e69c3a Mon Sep 17 00:00:00 2001 From: Tyson Whitehead Date: Thu, 30 Jul 2020 12:43:59 -0400 Subject: [PATCH] haskell-generic-builder: Use args ? attr for passthru (closes #94246) Comparing to a default value to detect if an argument was provided forces it to at least WHNF, which can cause failure (e.g., if the argument is a string with a quoted path from a broken package). --- .../haskell-modules/generic-builder.nix | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/pkgs/development/haskell-modules/generic-builder.nix b/pkgs/development/haskell-modules/generic-builder.nix index 20fa2c840629..29609e86389b 100644 --- a/pkgs/development/haskell-modules/generic-builder.nix +++ b/pkgs/development/haskell-modules/generic-builder.nix @@ -21,7 +21,7 @@ in , configureFlags ? [] , buildFlags ? [] , haddockFlags ? [] -, description ? "" +, description ? null , doCheck ? !isCross && stdenv.lib.versionOlder "7.4" ghc.version , doBenchmark ? false , doHoogle ? true @@ -50,7 +50,7 @@ in , jailbreak ? false , license , enableParallelBuilding ? true -, maintainers ? [] +, maintainers ? null , doCoverage ? false , doHaddock ? !(ghc.isHaLVM or false) , passthru ? {} @@ -59,14 +59,14 @@ in , benchmarkDepends ? [], benchmarkHaskellDepends ? [], benchmarkSystemDepends ? [], benchmarkFrameworkDepends ? [] , testTarget ? "" , broken ? false -, preCompileBuildDriver ? "", postCompileBuildDriver ? "" -, preUnpack ? "", postUnpack ? "" -, patches ? [], patchPhase ? "", prePatch ? "", postPatch ? "" -, preConfigure ? "", postConfigure ? "" -, preBuild ? "", postBuild ? "" -, installPhase ? "", preInstall ? "", postInstall ? "" -, checkPhase ? "", preCheck ? "", postCheck ? "" -, preFixup ? "", postFixup ? "" +, preCompileBuildDriver ? null, postCompileBuildDriver ? null +, preUnpack ? null, postUnpack ? null +, patches ? null, patchPhase ? null, prePatch ? "", postPatch ? "" +, preConfigure ? null, postConfigure ? null +, preBuild ? null, postBuild ? null +, installPhase ? null, preInstall ? null, postInstall ? null +, checkPhase ? null, preCheck ? null, postCheck ? null +, preFixup ? null, postFixup ? null , shellHook ? "" , coreSetup ? false # Use only core packages to build Setup.hs. , useCpphs ? false @@ -636,34 +636,34 @@ stdenv.mkDerivation ({ }; meta = { inherit homepage license platforms; } - // optionalAttrs broken { inherit broken; } - // optionalAttrs (description != "") { inherit description; } - // optionalAttrs (maintainers != []) { inherit maintainers; } - // optionalAttrs (hydraPlatforms != null) { inherit hydraPlatforms; } + // optionalAttrs (args ? broken) { inherit broken; } + // optionalAttrs (args ? description) { inherit description; } + // optionalAttrs (args ? maintainers) { inherit maintainers; } + // optionalAttrs (args ? hydraPlatforms) { inherit hydraPlatforms; } ; } -// optionalAttrs (preCompileBuildDriver != "") { inherit preCompileBuildDriver; } -// optionalAttrs (postCompileBuildDriver != "") { inherit postCompileBuildDriver; } -// optionalAttrs (preUnpack != "") { inherit preUnpack; } -// optionalAttrs (postUnpack != "") { inherit postUnpack; } -// optionalAttrs (patches != []) { inherit patches; } -// optionalAttrs (patchPhase != "") { inherit patchPhase; } -// optionalAttrs (preConfigure != "") { inherit preConfigure; } -// optionalAttrs (postConfigure != "") { inherit postConfigure; } -// optionalAttrs (preBuild != "") { inherit preBuild; } -// optionalAttrs (postBuild != "") { inherit postBuild; } -// optionalAttrs (doBenchmark) { inherit doBenchmark; } -// optionalAttrs (checkPhase != "") { inherit checkPhase; } -// optionalAttrs (preCheck != "") { inherit preCheck; } -// optionalAttrs (postCheck != "") { inherit postCheck; } -// optionalAttrs (preInstall != "") { inherit preInstall; } -// optionalAttrs (installPhase != "") { inherit installPhase; } -// optionalAttrs (postInstall != "") { inherit postInstall; } -// optionalAttrs (preFixup != "") { inherit preFixup; } -// optionalAttrs (postFixup != "") { inherit postFixup; } -// optionalAttrs (dontStrip) { inherit dontStrip; } -// optionalAttrs (hardeningDisable != []) { inherit hardeningDisable; } +// optionalAttrs (args ? preCompileBuildDriver) { inherit preCompileBuildDriver; } +// optionalAttrs (args ? postCompileBuildDriver) { inherit postCompileBuildDriver; } +// optionalAttrs (args ? preUnpack) { inherit preUnpack; } +// optionalAttrs (args ? postUnpack) { inherit postUnpack; } +// optionalAttrs (args ? patches) { inherit patches; } +// optionalAttrs (args ? patchPhase) { inherit patchPhase; } +// optionalAttrs (args ? preConfigure) { inherit preConfigure; } +// optionalAttrs (args ? postConfigure) { inherit postConfigure; } +// optionalAttrs (args ? preBuild) { inherit preBuild; } +// optionalAttrs (args ? postBuild) { inherit postBuild; } +// optionalAttrs (args ? doBenchmark) { inherit doBenchmark; } +// optionalAttrs (args ? checkPhase) { inherit checkPhase; } +// optionalAttrs (args ? preCheck) { inherit preCheck; } +// optionalAttrs (args ? postCheck) { inherit postCheck; } +// optionalAttrs (args ? preInstall) { inherit preInstall; } +// optionalAttrs (args ? installPhase) { inherit installPhase; } +// optionalAttrs (args ? postInstall) { inherit postInstall; } +// optionalAttrs (args ? preFixup) { inherit preFixup; } +// optionalAttrs (args ? postFixup) { inherit postFixup; } +// optionalAttrs (args ? dontStrip) { inherit dontStrip; } +// optionalAttrs (args ? hardeningDisable) { inherit hardeningDisable; } // optionalAttrs (stdenv.buildPlatform.libc == "glibc"){ LOCALE_ARCHIVE = "${glibcLocales}/lib/locale/locale-archive"; } ) )