From 732e12095e9f405e3fb6ef28e6d714e75402e6ba Mon Sep 17 00:00:00 2001 From: Michael Raskin <7c6f434c@mail.ru> Date: Sun, 18 May 2008 05:12:39 +0000 Subject: [PATCH] Added debug option alwaysFail to builderDefs; fixed a long-time bug in the process.. svn path=/nixpkgs/trunk/; revision=11838 --- pkgs/top-level/builder-defs.nix | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/pkgs/top-level/builder-defs.nix b/pkgs/top-level/builder-defs.nix index 7773b3da6d7..b6f1a07f824 100644 --- a/pkgs/top-level/builder-defs.nix +++ b/pkgs/top-level/builder-defs.nix @@ -396,8 +396,16 @@ args: with args; with stringsWithDeps; with lib; GHC_PACKAGE_PATH=\$PACKAGE_DB ./register.sh " ["defCreateEmptyPackageDatabaseAndSetupHook" "defCabalSetupCmd"]; - phaseNames = args.phaseNames ++ - ["doForceShare" "doPropagate"]; + realPhaseNames = args.phaseNames ++ + ["doForceShare" "doPropagate"] + ++ + (optional (getAttr ["alwaysFail"] false args) "doFail") + ; + + doFail = noDepEntry " + echo 'Failing to keep builddir (and to invalidate result).' + a() { return 127; } ; a ; + "; extraDerivationAttrs = lib.getAttr ["extraDerivationAttrs"] {} args; @@ -407,7 +415,7 @@ args: with args; with stringsWithDeps; with lib; stdenv.mkDerivation ((rec { inherit (localDefs) name; builder = writeScript (name + "-builder") - (textClosure localDefs localDefs.phaseNames); + (textClosure localDefs localDefs.realPhaseNames); meta = localDefs.meta // {inherit src;}; }) // (if localDefs ? propagatedBuildInputs then { inherit (localDefs) propagatedBuildInputs;