From 93227ff65c73e726c4ceef0cdd9439e7a4301417 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Wed, 31 Aug 2011 21:11:50 +0000 Subject: * Eliminate all uses of the global variable ‘store’ from libstore. This should also fix: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit nix-instantiate: ./../boost/shared_ptr.hpp:254: T* boost::shared_ptr::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. --- src/nix-env/nix-env.cc | 8 ++++---- src/nix-env/profiles.cc | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src/nix-env') diff --git a/src/nix-env/nix-env.cc b/src/nix-env/nix-env.cc index 731f91bba058..3dfecb2d7313 100644 --- a/src/nix-env/nix-env.cc +++ b/src/nix-env/nix-env.cc @@ -381,7 +381,7 @@ static void queryInstSources(EvalState & state, if (isDerivation(path)) { elem.setDrvPath(path); - elem.setOutPath(findOutput(derivationFromPath(path), "out")); + elem.setOutPath(findOutput(derivationFromPath(*store, path), "out")); if (name.size() >= drvExtension.size() && string(name, name.size() - drvExtension.size()) == drvExtension) name = string(name, 0, name.size() - drvExtension.size()); @@ -430,7 +430,7 @@ static void printMissing(EvalState & state, const DrvInfos & elems) targets.insert(i->queryOutPath(state)); } - printMissing(targets); + printMissing(*store, targets); } @@ -693,12 +693,12 @@ static void opSet(Globals & globals, if (drv.queryDrvPath(globals.state) != "") { PathSet paths = singleton(drv.queryDrvPath(globals.state)); - printMissing(paths); + printMissing(*store, paths); if (globals.dryRun) return; store->buildDerivations(paths); } else { - printMissing(singleton(drv.queryOutPath(globals.state))); + printMissing(*store, singleton(drv.queryOutPath(globals.state))); if (globals.dryRun) return; store->ensurePath(drv.queryOutPath(globals.state)); } diff --git a/src/nix-env/profiles.cc b/src/nix-env/profiles.cc index 60576f1ae74b..5cc0d9a1cd42 100644 --- a/src/nix-env/profiles.cc +++ b/src/nix-env/profiles.cc @@ -91,7 +91,7 @@ Path createGeneration(Path profile, Path outPath) user environment etc. we've just built. */ Path generation; makeName(profile, num + 1, generation); - addPermRoot(outPath, generation, false, true); + addPermRoot(*store, outPath, generation, false, true); return generation; } -- cgit 1.4.1