1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 21:41:48 +02:00

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.
This commit is contained in:
Eelco Dolstra 2012-07-23 15:02:52 -04:00
parent 564fb7d9fa
commit 6193105710
5 changed files with 45 additions and 10 deletions

View file

@ -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;