about summary refs log tree commit diff
path: root/src/libexpr/primops.cc
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2011-08-31T21·11+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2011-08-31T21·11+0000
commit93227ff65c73e726c4ceef0cdd9439e7a4301417 (patch)
treeba7b60ca132c373913dd4a1c42a900009aeb8a77 /src/libexpr/primops.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/libexpr/primops.cc')
-rw-r--r--src/libexpr/primops.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc
index 9d226a327017..0e81f7b72fae 100644
--- a/src/libexpr/primops.cc
+++ b/src/libexpr/primops.cc
@@ -357,7 +357,7 @@ static void prim_derivationStrict(EvalState & state, Value * * args, Value & v)
            runs. */
         if (path.at(0) == '=') {
             path = string(path, 1);
-            PathSet refs; computeFSClosure(path, refs);
+            PathSet refs; computeFSClosure(*store, path, refs);
             foreach (PathSet::iterator, j, refs) {
                 drv.inputSrcs.insert(*j);
                 if (isDerivation(*j))
@@ -433,7 +433,7 @@ static void prim_derivationStrict(EvalState & state, Value * * args, Value & v)
 
         /* Use the masked derivation expression to compute the output
            path. */
-        Hash h = hashDerivationModulo(drv);
+        Hash h = hashDerivationModulo(*store, drv);
         
         foreach (DerivationOutputs::iterator, i, drv.outputs)
             if (i->second.path == "") {
@@ -444,7 +444,7 @@ static void prim_derivationStrict(EvalState & state, Value * * args, Value & v)
     }
 
     /* Write the resulting term into the Nix store directory. */
-    Path drvPath = writeDerivation(drv, drvName);
+    Path drvPath = writeDerivation(*store, drv, drvName);
 
     printMsg(lvlChatty, format("instantiated `%1%' -> `%2%'")
         % drvName % drvPath);
@@ -452,7 +452,7 @@ static void prim_derivationStrict(EvalState & state, Value * * args, Value & v)
     /* Optimisation, but required in read-only mode! because in that
        case we don't actually write store derivations, so we can't
        read them later. */
-    drvHashes[drvPath] = hashDerivationModulo(drv);
+    drvHashes[drvPath] = hashDerivationModulo(*store, drv);
 
     state.mkAttrs(v, 1 + drv.outputs.size());
     mkString(*state.allocAttr(v, state.sDrvPath), drvPath, singleton<PathSet>("=" + drvPath));