about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-07-23T19·02-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-07-23T21·14-0400
commit619310571002fc74e428824bd603604d1055b61b (patch)
tree6292457190b40d41e2f5a3c2504d77edab8d4057 /src/libstore/build.cc
parent564fb7d9fa80d06397a88d69f26439727cb922c5 (diff)
Automatically optimise the Nix store when a new path is added
Auto-optimisation is enabled by default.  It can be turned off by
setting auto-optimise-store to false in nix.conf.
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 26268f6ddb..a3bde34623 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -2093,6 +2093,8 @@ void DerivationGoal::computeClosure()
                 if (allowed.find(*i) == allowed.end())
                     throw BuildError(format("output is not allowed to refer to path `%1%'") % *i);
         }
+
+        worker.store.optimisePath(path); // FIXME: combine with scanForReferences()
     }
 
     /* Register each output path as valid, and register the sets of
@@ -2546,6 +2548,8 @@ void SubstitutionGoal::finished()
 
     HashResult hash = hashPath(htSHA256, storePath);
     
+    worker.store.optimisePath(storePath); // FIXME: combine with hashPath()
+    
     ValidPathInfo info2;
     info2.path = storePath;
     info2.hash = hash.first;