aboutsummaryrefslogtreecommitdiff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2011-08-31 21:11:50 +0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2011-08-31 21:11:50 +0000
commit93227ff65c73e726c4ceef0cdd9439e7a4301417 (patch)
treeba7b60ca132c373913dd4a1c42a900009aeb8a77 /src/libstore/build.cc
parent5bcdc7e3517e6d679cad1aaba41e4deb76d5a6e7 (diff)
* Eliminate all uses of the global variable ‘store’ from libstore.
This should also fix: nix-instantiate: ./../boost/shared_ptr.hpp:254: T* boost::shared_ptr<T>::operator->() const [with T = nix::StoreAPI]: Assertion `px != 0' failed. which was caused by hashDerivationModulo() calling the ‘store’ object (during store upgrades) before openStore() assigned it.
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index 26f9fcc59..d12f41d66 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -934,7 +934,7 @@ void DerivationGoal::haveDerivation()
assert(worker.store.isValidPath(drvPath));
/* Get the derivation. */
- drv = derivationFromPath(drvPath);
+ drv = derivationFromPath(worker.store, drvPath);
foreach (DerivationOutputs::iterator, i, drv.outputs)
worker.store.addTempRoot(i->second.path);
@@ -1030,10 +1030,10 @@ void DerivationGoal::inputsRealised()
`*i' as input paths. Only add the closures of output paths
that are specified as inputs. */
assert(worker.store.isValidPath(i->first));
- Derivation inDrv = derivationFromPath(i->first);
+ Derivation inDrv = derivationFromPath(worker.store, i->first);
foreach (StringSet::iterator, j, i->second)
if (inDrv.outputs.find(*j) != inDrv.outputs.end())
- computeFSClosure(inDrv.outputs[*j].path, inputPaths);
+ computeFSClosure(worker.store, inDrv.outputs[*j].path, inputPaths);
else
throw Error(
format("derivation `%1%' requires non-existent output `%2%' from input derivation `%3%'")
@@ -1042,7 +1042,7 @@ void DerivationGoal::inputsRealised()
/* Second, the input sources. */
foreach (PathSet::iterator, i, drv.inputSrcs)
- computeFSClosure(*i, inputPaths);
+ computeFSClosure(worker.store, *i, inputPaths);
debug(format("added input paths %1%") % showPaths(inputPaths));
@@ -1399,7 +1399,7 @@ HookReply DerivationGoal::tryBuildHook()
list it since the remote system *probably* already has it.) */
PathSet allInputs;
allInputs.insert(inputPaths.begin(), inputPaths.end());
- computeFSClosure(drvPath, allInputs);
+ computeFSClosure(worker.store, drvPath, allInputs);
string s;
foreach (PathSet::iterator, i, allInputs) s += *i + " ";
@@ -1545,14 +1545,14 @@ void DerivationGoal::startBuilder()
like passing all build-time dependencies of some path to a
derivation that builds a NixOS DVD image. */
PathSet paths, paths2;
- computeFSClosure(storePath, paths);
+ computeFSClosure(worker.store, storePath, paths);
paths2 = paths;
foreach (PathSet::iterator, j, paths2) {
if (isDerivation(*j)) {
- Derivation drv = derivationFromPath(*j);
+ Derivation drv = derivationFromPath(worker.store, *j);
foreach (DerivationOutputs::iterator, k, drv.outputs)
- computeFSClosure(k->second.path, paths);
+ computeFSClosure(worker.store, k->second.path, paths);
}
}