about summary refs log tree commit diff
path: root/src/libstore
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2013-11-12T11·51+0100
committerEelco Dolstra <eelco.dolstra@logicblox.com>2013-11-12T11·51+0100
commit89e6781cc5885cbf6284a51c0403dded62ce8bc0 (patch)
tree8ce64784036d7db386aa929dc27c0445ff63c49f /src/libstore
parent2bcb384e95500ff197fd4888c659ccf0034cf214 (diff)
Make function calls show up in stack traces again
Note that adding --show-trace prevents functions calls from being
tail-recursive, so an expression that evaluates without --show-trace
may fail with a stack overflow if --show-trace is given.
Diffstat (limited to 'src/libstore')
-rw-r--r--src/libstore/globals.cc1
-rw-r--r--src/libstore/globals.hh3
2 files changed, 4 insertions, 0 deletions
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index 7e0157cd365a..1ecc629cb55f 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -55,6 +55,7 @@ Settings::Settings()
     autoOptimiseStore = false;
     envKeepDerivations = false;
     lockCPU = getEnv("NIX_AFFINITY_HACK", "1") == "1";
+    showTrace = false;
 }
 
 
diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh
index cbc6d4e9848e..9300edbe9615 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -186,6 +186,9 @@ struct Settings {
     /* Whether to lock the Nix client and worker to the same CPU. */
     bool lockCPU;
 
+    /* Whether to show a stack trace if Nix evaluation fails. */
+    bool showTrace;
+
 private:
     SettingsMap settings, overrides;