Fold two stack trace messages in derivations

Combined with the previous changes, stack traces involving derivations
are now much less verbose, since something like

  while evaluating the builtin function `getAttr':
  while evaluating the builtin function `derivationStrict':
  while instantiating the derivation named `gtk+-2.24.20' at `/home/eelco/Dev/nixpkgs/pkgs/development/libraries/gtk+/2.x.nix:11:3':
  while evaluating the derivation attribute `propagatedNativeBuildInputs' at `/home/eelco/Dev/nixpkgs/pkgs/stdenv/generic/default.nix:78:17':
  while evaluating the attribute `outPath' at `/nix/store/212ngf4ph63mp6p1np2bapkfikpakfv7-nix-1.6/share/nix/corepkgs/derivation.nix:18:9':
  ...

now reads

  while evaluating the attribute `propagatedNativeBuildInputs' of the derivation `gtk+-2.24.20' at `/home/eelco/Dev/nixpkgs/pkgs/development/libraries/gtk+/2.x.nix:11:3':
  ...
This commit is contained in:
Eelco Dolstra 2013-10-17 11:53:40 +02:00
parent f440558acc
commit 792fd51f41
2 changed files with 5 additions and 6 deletions

View File

@ -57,8 +57,9 @@ are:</para>
</listitem>
<listitem>
<para>In order to be less verbose, stack traces no longer show
calls to builtin functions.</para>
<para>Stack traces are less verbose: they no longer show calls to
builtin functions and only show a single line for each derivation
on the call stack.</para>
</listitem>
</itemizedlist>

View File

@ -394,10 +394,8 @@ static void prim_derivationStrict(EvalState & state, Value * * args, Value & v)
}
} catch (Error & e) {
e.addPrefix(format("while evaluating the derivation attribute `%1%' at %2%:\n")
% key % *i->pos);
e.addPrefix(format("while instantiating the derivation named `%1%' at %2%:\n")
% drvName % posDrvName);
e.addPrefix(format("while evaluating the attribute `%1%' of the derivation `%2%' at %3%:\n")
% key % drvName % posDrvName);
throw;
}
}