From 60a32fcbf3f9ff08d7eea97d21cbbb368702c2d7 Mon Sep 17 00:00:00 2001 From: Wouter den Breejen Date: Fri, 12 Oct 2007 14:01:43 +0000 Subject: [PATCH] Fixed recursive build error --- src/libstore/build.cc | 2 ++ src/libstore/local-store.cc | 9 ++++++++- src/libstore/misc.cc | 9 +++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 44be9f093..d4b1704d7 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -2828,6 +2828,8 @@ void ensurePathTxn(const Transaction & txn, const Path & path) if (isValidPathTxn(txn, path)) return; + printMsg(lvlError, format("ensurePathTxn(%1%)") % path); + Worker worker; GoalPtr goal = worker.makeSubstitutionGoal(path); Goals goals = singleton(goal); diff --git a/src/libstore/local-store.cc b/src/libstore/local-store.cc index ee2732910..514ac2222 100644 --- a/src/libstore/local-store.cc +++ b/src/libstore/local-store.cc @@ -626,6 +626,9 @@ void LocalStore::queryStateReferrers(const Path & storePath, PathSet & stateRefe nix::queryStateReferrersTxn(noTxn, storePath, stateReferrers, revision); } +/* + * You can substitute a path withouth substituting the deriver!!!!! + */ void setDeriver(const Transaction & txn, const Path & storePath, const Path & deriver) { assertStorePath(storePath); @@ -635,7 +638,11 @@ void setDeriver(const Transaction & txn, const Path & storePath, const Path & de if (!isValidPathTxn(txn, storePath)) throw Error(format("path `%1%' is not valid") % storePath); - if (isStateDrvPathTxn(txn, deriver)){ //Redirect if its a state component + if (isStateComponentTxn(txn, storePath)){ //Redirect if its a state component + + if (!isValidPathTxn(txn, deriver)) + throw Error(format("Derivers `%1%' is not valid so we dont have the info for a store-state path") % storePath); + addStateDeriver(txn, storePath, deriver); } else{ diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc index f35938823..4e9fe2fde 100644 --- a/src/libstore/misc.cc +++ b/src/libstore/misc.cc @@ -12,14 +12,11 @@ namespace nix { Derivation derivationFromPathPrivate(const bool dotxn, const Transaction & txn, const Path & drvPath) { assertStorePath(drvPath); - if(dotxn){ - printMsg(lvlError, format("ensurePathTxn(txn,%1%)") % drvPath); + if(dotxn) ensurePathTxn(txn, drvPath); - } - else{ - printMsg(lvlError, format("store->ensurePathTxn(%1%)") % drvPath); + else store->ensurePath(drvPath); - } + ATerm t = ATreadFromNamedFile(drvPath.c_str()); if (!t) throw Error(format("cannot read aterm from `%1%'") % drvPath);