about summary refs log tree commit diff
path: root/src/libstore/derivations.hh
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/libstore/derivations.hh
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/derivations.hh')
-rw-r--r--src/libstore/derivations.hh8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libstore/derivations.hh b/src/libstore/derivations.hh
index 4860f708c56f..27e471d885cc 100644
--- a/src/libstore/derivations.hh
+++ b/src/libstore/derivations.hh
@@ -53,8 +53,12 @@ struct Derivation
 };
 
 
+class StoreAPI;
+
+
 /* Write a derivation to the Nix store, and return its path. */
-Path writeDerivation(const Derivation & drv, const string & name);
+Path writeDerivation(StoreAPI & store,
+    const Derivation & drv, const string & name);
 
 /* Parse a derivation. */
 Derivation parseDerivation(const string & s);
@@ -69,7 +73,7 @@ bool isDerivation(const string & fileName);
 /* Return true iff this is a fixed-output derivation. */
 bool isFixedOutputDrv(const Derivation & drv);
 
-Hash hashDerivationModulo(Derivation drv);
+Hash hashDerivationModulo(StoreAPI & store, Derivation drv);
 
 /* Memoisation of hashDerivationModulo(). */
 typedef std::map<Path, Hash> DrvHashes;