about summary refs log tree commit diff
path: root/src/libexpr
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-07-18T14·47-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-07-18T14·47-0400
commitfe241ece2932492866693d268d02a7912e766ac7 (patch)
tree2cb24a4d45f563e32946bf34d878969bd05263ec /src/libexpr
parenta6f348599c94d8a5f7b41c7d8e43658dc6407be7 (diff)
parentccc52adfb2121ade510d35dc9b91193af9fa731e (diff)
Merge branch 'master' into no-manifests
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/eval.cc9
-rw-r--r--src/libexpr/eval.hh4
-rw-r--r--src/libexpr/primops.cc6
3 files changed, 5 insertions, 14 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 6ce65e3e1162..cf7c62ad20cf 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -143,9 +143,7 @@ EvalState::EvalState()
     , staticBaseEnv(false, 0)
 {
     nrEnvs = nrValuesInEnvs = nrValues = nrListElems = 0;
-    nrEvaluated = recursionDepth = maxRecursionDepth = 0;
     nrAttrsets = nrOpUpdates = nrOpUpdateValuesCopied = 0;
-    deepestStack = (char *) -1;
 
 #if HAVE_BOEHMGC
     static bool gcInitialised = true;
@@ -190,7 +188,6 @@ EvalState::EvalState()
 
 EvalState::~EvalState()
 {
-    assert(recursionDepth == 0);
 }
 
 
@@ -1206,12 +1203,6 @@ void EvalState::printStats()
 
     printMsg(v, format("  time elapsed: %1%") % cpuTime);
     printMsg(v, format("  size of a value: %1%") % sizeof(Value));
-    printMsg(v, format("  expressions evaluated: %1%") % nrEvaluated);
-    char x;
-    printMsg(v, format("  stack space used: %1% bytes") % (&x - deepestStack));
-    printMsg(v, format("  max eval() nesting depth: %1%") % maxRecursionDepth);
-    printMsg(v, format("  stack space per eval() level: %1% bytes")
-        % ((&x - deepestStack) / (float) maxRecursionDepth));
     printMsg(v, format("  environments allocated: %1% (%2% bytes)")
         % nrEnvs % (nrEnvs * sizeof(Env) + nrValuesInEnvs * sizeof(Value *)));
     printMsg(v, format("  list elements: %1% (%2% bytes)")
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index c4ba170e8cc7..bab9303b08eb 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -242,13 +242,9 @@ private:
     unsigned long nrValuesInEnvs;
     unsigned long nrValues;
     unsigned long nrListElems;
-    unsigned long nrEvaluated;
     unsigned long nrAttrsets;
     unsigned long nrOpUpdates;
     unsigned long nrOpUpdateValuesCopied;
-    unsigned int recursionDepth;
-    unsigned int maxRecursionDepth;
-    char * deepestStack; /* for measuring stack usage */
     
     friend class RecursionCounter;
     friend class ExprOpUpdate;
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 354fc39be073..f20c2f2879ab 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -508,7 +508,11 @@ static void prim_toPath(EvalState & state, Value * * args, Value & v)
 static void prim_storePath(EvalState & state, Value * * args, Value & v)
 {
     PathSet context;
-    Path path = canonPath(state.coerceToPath(*args[0], context));
+    Path path = state.coerceToPath(*args[0], context);
+    /* Resolve symlinks in ‘path’, unless ‘path’ itself is a symlink
+       directly in the store.  The latter condition is necessary so
+       e.g. nix-push does the right thing. */
+    if (!isStorePath(path)) path = canonPath(path, true);
     if (!isInStore(path))
         throw EvalError(format("path `%1%' is not in the Nix store") % path);
     Path path2 = toStorePath(path);