From 0ee803935e4be2cb005873d6a8f3def5e4e209ba Mon Sep 17 00:00:00 2001 From: Wouter den Breejen Date: Fri, 12 Oct 2007 10:05:17 +0000 Subject: [PATCH] Recursive build error.... *2 --- src/libstore/build.cc | 49 +++++++++++++++++++-------------- src/libstore/globals.cc | 2 +- src/libstore/misc.cc | 8 ++++-- src/libstore/remote-store.cc | 2 +- src/libstore/store-api.cc | 39 ++++++++++++++++---------- src/libstore/worker-protocol.hh | 26 ++++++++--------- src/libutil/util.cc | 2 +- src/nix-state/help.txt | 1 + src/nix-state/help.txt.hh | 2 +- src/nix-state/nix-state.cc | 11 +++++++- src/nix-store/nix-store.cc | 2 ++ src/nix-worker/nix-worker.cc | 9 ++++-- 12 files changed, 97 insertions(+), 56 deletions(-) diff --git a/src/libstore/build.cc b/src/libstore/build.cc index b870bfc05..44be9f093 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -1146,22 +1146,24 @@ static string makeValidityRegistration(const PathSet & paths, j != references.end(); ++j) s += *j + "\n"; - //state references - - PathSet stateReferences; - store->queryStateReferences(*i, stateReferences, 0); + if(store->isStateComponent(*i)){ - s += (format("%1%\n") % stateReferences.size()).str(); - - for (PathSet::iterator j = stateReferences.begin(); - j != stateReferences.end(); ++j) - s += *j + "\n"; - - //revision - - string revision = unsignedInt2String(0); - s += revision + "\n"; - + //state references + + PathSet stateReferences; + store->queryStateReferences(*i, stateReferences, 0); + + s += (format("%1%\n") % stateReferences.size()).str(); + + for (PathSet::iterator j = stateReferences.begin(); + j != stateReferences.end(); ++j) + s += *j + "\n"; + + //revision + + string revision = unsignedInt2String(0); + s += revision + "\n"; + } } return s; @@ -1852,7 +1854,7 @@ void DerivationGoal::computeClosure() * If state is enabled for the path we: * [scan for and state references and component references in the state path] //3,4 */ - if(isStateDrv(drv)){ //TODO + if(isStateDrv(drv)){ Path sharedState = drv.stateOutputs.find("state")->second.sharedState; if(sharedState != ""){ @@ -1861,8 +1863,7 @@ void DerivationGoal::computeClosure() //We dont need to scan for state references since at the query to the state path we give the results of the linked-to path } - else - { + else{ Path statePath = drv.stateOutputs.find("state")->second.statepath; printMsg(lvlTalkative, format("scanning for component and state references inside `%1%'") % statePath); @@ -2395,7 +2396,10 @@ static bool working = false; Worker::Worker() { /* Debugging: prevent recursive workers. */ - if (working) abort(); + printMsg(lvlError, format("Before abort '%1%'") % working); + if (working) + abort(); + printMsg(lvlError, format("After abort")); working = true; nrChildren = 0; } @@ -2592,6 +2596,7 @@ void Worker::getInfo() args.push_back("--query-info"); args.insert(args.end(), paths2.begin(), paths2.end()); string res = runProgram(sub, false, args); + printMsg(lvlError, format("run: '%1%' res: '%2%'") % sub % res); std::istringstream str(res); while (true) { @@ -2606,14 +2611,18 @@ void Worker::getInfo() if (goal) { SubstitutionGoal * goal2 = dynamic_cast(goal.get()); if (goal2->storePath == info.path) { - goal2->references = info.references; + goal2->references = info.references; goal2->deriver = info.deriver; + //goal2->stateReferences = info.stateReferences; //TODO !!!!!!!!!!!!!!!!!!!!!!!!!! STATE REFERENCES FOR A SubstitutionGoal + //goal2->revision = info.revision; goal2->infoOkay = true; wakeUp(goal); } } } } + + printMsg(lvlError, format("AAAAAAAAA: '%1%'") % store->isStateComponent("/nix/store/3pw7vmdwdf3ccx6h6i2w0j52ribjswzn-hellotest-1.0")); } } diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index e473f6799..23a23c25c 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -34,7 +34,7 @@ Paths substituters; static bool settingsRead = false; uid_t callingUID = 0; //A root user will not set this value, so the default uid is 0 -bool singleThreaded = false; //TODO Gives an error: cannot start worker (environment already open) / waiting for process 7487: No child processes +bool singleThreaded = false; //TODO Gives an error: cannot start worker (environment already open) / waiting for process X: No child processes bool sendOutput = true; static std::map settings; diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc index 72535880f..f35938823 100644 --- a/src/libstore/misc.cc +++ b/src/libstore/misc.cc @@ -12,10 +12,14 @@ namespace nix { Derivation derivationFromPathPrivate(const bool dotxn, const Transaction & txn, const Path & drvPath) { assertStorePath(drvPath); - if(dotxn) + if(dotxn){ + printMsg(lvlError, format("ensurePathTxn(txn,%1%)") % drvPath); ensurePathTxn(txn, drvPath); - else + } + else{ + printMsg(lvlError, format("store->ensurePathTxn(%1%)") % drvPath); store->ensurePath(drvPath); + } ATerm t = ATreadFromNamedFile(drvPath.c_str()); if (!t) throw Error(format("cannot read aterm from `%1%'") % drvPath); diff --git a/src/libstore/remote-store.cc b/src/libstore/remote-store.cc index 396e5077d..07f4be0b9 100644 --- a/src/libstore/remote-store.cc +++ b/src/libstore/remote-store.cc @@ -535,7 +535,7 @@ PathSet RemoteStore::toNonSharedPathSet(const PathSet & statePaths) writeInt(wopToNonSharedPathSet, to); writeStringSet(statePaths, to); processStderr(); - return readStringSet(from); //TODO !!!!!!!!!!!!!!! create a readStatePaths just like readStorePaths + return readStringSet(from); //TODO !!!!!!!!!!!!!!! create a readStatePaths just like readStorePaths } void RemoteStore::revertToRevision(const Path & statePath, const unsigned int revision_arg, const bool recursive) diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index a937f80be..d10e496ea 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -212,6 +212,8 @@ ValidPathInfo decodeValidPathInfo(std::istream & str) { ValidPathInfo info; + printMsg(lvlError, format("BEFORE decodeValidPathInfo")); + getline(str, info.path); if (str.eof()) { info.path = ""; return info; } @@ -226,22 +228,31 @@ ValidPathInfo decodeValidPathInfo(std::istream & str) getline(str, s); info.references.insert(s); } - - getline(str, s); - if (!string2Int(s, n)) - throw Error("number expected"); - while (n--) { - getline(str, s); - info.stateReferences.insert(s); + + if(store->isStateComponent(info.path)){ + + printMsg(lvlError, format("STATE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")); + + getline(str, s); + if (!string2Int(s, n)) + throw Error("number expected"); + while (n--) { + getline(str, s); + info.stateReferences.insert(s); + } + + unsigned int u; + getline(str, s); + if (!string2UnsignedInt(s, u)) + throw Error("number expected"); + info.revision = u; } - unsigned int u; - getline(str, s); - if (!string2UnsignedInt(s, u)) - throw Error("number expected"); - info.revision = u; - - if (!str || str.eof()) throw Error("missing input"); + if (!str || str.eof()) + throw Error("missing input"); + + printMsg(lvlError, format("AFTER decodeValidPathInfo")); + return info; } diff --git a/src/libstore/worker-protocol.hh b/src/libstore/worker-protocol.hh index 1831ff775..5725598e7 100644 --- a/src/libstore/worker-protocol.hh +++ b/src/libstore/worker-protocol.hh @@ -14,26 +14,26 @@ namespace nix { typedef enum { wopQuit = 0, //0 - wopIsValidPath, - wopHasSubstitutes = 3, + wopIsValidPath, //1 + wopHasSubstitutes = 3, //3 wopIsValidStatePath, wopIsValidComponentOrStatePath, wopQueryPathHash, wopQueryStatePathDrv, wopQueryStoreReferences, wopQueryStateReferences, - wopQueryStoreReferrers, - wopQueryStateReferrers, //10 + wopQueryStoreReferrers, //10 + wopQueryStateReferrers, wopAddToStore, - wopAddTextToStore, - wopBuildDerivations, //13 - wopEnsurePath, + wopAddTextToStore, //13 + wopBuildDerivations, //14 + wopEnsurePath, //15 wopAddTempRoot, wopAddIndirectRoot, wopSyncWithGC, wopFindRoots, - wopCollectGarbage, - wopExportPath, //20 + wopCollectGarbage, //20 + wopExportPath, wopImportPath, wopQueryDeriver, wopQueryDerivers, @@ -42,16 +42,16 @@ typedef enum { wopIsStateComponent, wopStorePathRequisites, wopSetStateRevisions, - wopQueryStateRevisions, - wopQueryAvailableStateRevisions, //30 + wopQueryStateRevisions, //30 + wopQueryAvailableStateRevisions, wopCommitStatePath, wopScanAndUpdateAllReferences, wopGetSharedWith, wopToNonSharedPathSet, wopRevertToRevision, wopShareState, - wopUnShareState, //37 - wopSetOptions, + wopUnShareState, + wopSetOptions, //39 } WorkerOp; diff --git a/src/libutil/util.cc b/src/libutil/util.cc index 65627ec71..f8b29ad9b 100644 --- a/src/libutil/util.cc +++ b/src/libutil/util.cc @@ -467,7 +467,7 @@ void readFull(int fd, unsigned char * buf, size_t count) throw SysError("reading from file"); } if (res == 0) - throw EndOfFile("unexpected end-of-file (in readFull so deamon communication)"); + throw EndOfFile("unexpected end-of-file (in readFull so daemon communication)"); count -= res; buf += res; } diff --git a/src/nix-state/help.txt b/src/nix-state/help.txt index 236a0b440..690b7d0ec 100644 --- a/src/nix-state/help.txt +++ b/src/nix-state/help.txt @@ -20,6 +20,7 @@ Information: --showderivations: print all derivations of this path --showrevisions: show all revisions of the state path --showsharedpaths: show where this path points to + --XXXXXXXXXXXXXXXX: print if the path is a state/store path --version: output version information --help: display help diff --git a/src/nix-state/help.txt.hh b/src/nix-state/help.txt.hh index 0dd54eb8b..4a079a68e 100644 --- a/src/nix-state/help.txt.hh +++ b/src/nix-state/help.txt.hh @@ -1 +1 @@ -static unsigned char helpText[] = {0x55, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x20, 0x6e, 0x69, 0x78, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x5b, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x2e, 0x2e, 0x2e, 0x5d, 0x20, 0x5b, 0x41, 0x52, 0x47, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x53, 0x2e, 0x2e, 0x2e, 0x5d, 0x20, 0x5b, 0x4e, 0x49, 0x58, 0x20, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2d, 0x50, 0x61, 0x74, 0x68, 0x5d, 0x0a, 0x0a, 0x60, 0x6e, 0x69, 0x78, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x27, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x74, 0x6f, 0x6f, 0x6c, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x6e, 0x69, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4e, 0x69, 0x78, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2d, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x0a, 0x0a, 0x52, 0x75, 0x6e, 0x20, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x72, 0x75, 0x6e, 0x20, 0x2f, 0x20, 0x2d, 0x72, 0x3a, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x3a, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x72, 0x75, 0x6e, 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x3a, 0x20, 0x72, 0x75, 0x6e, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x73, 0x63, 0x61, 0x6e, 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x3a, 0x20, 0x73, 0x63, 0x61, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x0a, 0x0a, 0x52, 0x75, 0x6e, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x09, 0x09, 0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x73, 0x63, 0x61, 0x6e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x3a, 0x20, 0x73, 0x65, 0x74, 0x20, 0x73, 0x63, 0x61, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x2e, 0x2e, 0x2e, 0x3a, 0x20, 0x41, 0x64, 0x64, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x20, 0x0a, 0x0a, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x73, 0x68, 0x6f, 0x77, 0x73, 0x74, 0x61, 0x74, 0x65, 0x70, 0x61, 0x74, 0x68, 0x3a, 0x20, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x73, 0x68, 0x6f, 0x77, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x20, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x70, 0x61, 0x74, 0x68, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x73, 0x68, 0x6f, 0x77, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x20, 0x73, 0x68, 0x6f, 0x77, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x73, 0x68, 0x6f, 0x77, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x70, 0x61, 0x74, 0x68, 0x73, 0x3a, 0x20, 0x73, 0x68, 0x6f, 0x77, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x20, 0x74, 0x6f, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x68, 0x65, 0x6c, 0x70, 0x3a, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x68, 0x65, 0x6c, 0x70, 0x0a, 0x0a, 0x28, 0x55, 0x6e, 0x29, 0x53, 0x68, 0x61, 0x72, 0x65, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x75, 0x6e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x3a, 0x20, 0x75, 0x6e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x70, 0x61, 0x74, 0x68, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2d, 0x77, 0x69, 0x74, 0x68, 0x3d, 0x61, 0x20, 0x62, 0x3a, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x70, 0x61, 0x74, 0x68, 0x20, 0x62, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x72, 0x73, 0x79, 0x6e, 0x63, 0x2d, 0x66, 0x72, 0x6f, 0x6d, 0x3d, 0x61, 0x20, 0x62, 0x3a, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x70, 0x61, 0x74, 0x68, 0x20, 0x62, 0x20, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x0a, 0x0a, 0x55, 0x6e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x75, 0x6e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2d, 0x61, 0x6e, 0x64, 0x2d, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x75, 0x6e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2d, 0x61, 0x6e, 0x64, 0x2d, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2d, 0x6f, 0x6c, 0x64, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x28, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x29, 0x0a, 0x20, 0x0a, 0x52, 0x65, 0x76, 0x65, 0x72, 0x74, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x2d, 0x74, 0x6f, 0x2d, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x78, 0x3a, 0x20, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x78, 0x0a, 0x0a, 0x52, 0x65, 0x76, 0x65, 0x72, 0x74, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x2d, 0x74, 0x6f, 0x2d, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2d, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x6c, 0x79, 0x3a, 0x20, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x20, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x6c, 0x79, 0x0a, }; +static unsigned char helpText[] = {0x55, 0x73, 0x61, 0x67, 0x65, 0x3a, 0x20, 0x6e, 0x69, 0x78, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x5b, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x53, 0x2e, 0x2e, 0x2e, 0x5d, 0x20, 0x5b, 0x41, 0x52, 0x47, 0x55, 0x4d, 0x45, 0x4e, 0x54, 0x53, 0x2e, 0x2e, 0x2e, 0x5d, 0x20, 0x5b, 0x4e, 0x49, 0x58, 0x20, 0x53, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x53, 0x74, 0x61, 0x74, 0x65, 0x2d, 0x50, 0x61, 0x74, 0x68, 0x5d, 0x0a, 0x0a, 0x60, 0x6e, 0x69, 0x78, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x27, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x74, 0x6f, 0x6f, 0x6c, 0x20, 0x74, 0x6f, 0x20, 0x6d, 0x61, 0x6e, 0x69, 0x70, 0x75, 0x6c, 0x61, 0x74, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x4e, 0x69, 0x78, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2d, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x70, 0x72, 0x6f, 0x67, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x0a, 0x0a, 0x52, 0x75, 0x6e, 0x20, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x72, 0x75, 0x6e, 0x20, 0x2f, 0x20, 0x2d, 0x72, 0x3a, 0x20, 0x72, 0x75, 0x6e, 0x20, 0x61, 0x6e, 0x64, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x3a, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x72, 0x75, 0x6e, 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x3a, 0x20, 0x72, 0x75, 0x6e, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x73, 0x63, 0x61, 0x6e, 0x2d, 0x6f, 0x6e, 0x6c, 0x79, 0x3a, 0x20, 0x73, 0x63, 0x61, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x0a, 0x0a, 0x52, 0x75, 0x6e, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x09, 0x09, 0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x73, 0x63, 0x61, 0x6e, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x3a, 0x20, 0x73, 0x65, 0x74, 0x20, 0x73, 0x63, 0x61, 0x6e, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x3d, 0x2e, 0x2e, 0x2e, 0x3a, 0x20, 0x41, 0x64, 0x64, 0x20, 0x61, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x65, 0x6e, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x63, 0x6f, 0x6d, 0x6d, 0x69, 0x74, 0x69, 0x6e, 0x67, 0x20, 0x20, 0x0a, 0x0a, 0x49, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x73, 0x68, 0x6f, 0x77, 0x73, 0x74, 0x61, 0x74, 0x65, 0x70, 0x61, 0x74, 0x68, 0x3a, 0x20, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x73, 0x68, 0x6f, 0x77, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x20, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x64, 0x65, 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x70, 0x61, 0x74, 0x68, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x73, 0x68, 0x6f, 0x77, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x20, 0x73, 0x68, 0x6f, 0x77, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x73, 0x68, 0x6f, 0x77, 0x73, 0x68, 0x61, 0x72, 0x65, 0x64, 0x70, 0x61, 0x74, 0x68, 0x73, 0x3a, 0x20, 0x73, 0x68, 0x6f, 0x77, 0x20, 0x77, 0x68, 0x65, 0x72, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x73, 0x20, 0x74, 0x6f, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x58, 0x3a, 0x20, 0x70, 0x72, 0x69, 0x6e, 0x74, 0x20, 0x69, 0x66, 0x20, 0x74, 0x68, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x20, 0x70, 0x61, 0x74, 0x68, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x6f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x69, 0x6e, 0x66, 0x6f, 0x72, 0x6d, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x68, 0x65, 0x6c, 0x70, 0x3a, 0x20, 0x64, 0x69, 0x73, 0x70, 0x6c, 0x61, 0x79, 0x20, 0x68, 0x65, 0x6c, 0x70, 0x0a, 0x0a, 0x28, 0x55, 0x6e, 0x29, 0x53, 0x68, 0x61, 0x72, 0x65, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x75, 0x6e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x3a, 0x20, 0x75, 0x6e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x20, 0x74, 0x68, 0x69, 0x73, 0x20, 0x70, 0x61, 0x74, 0x68, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2d, 0x77, 0x69, 0x74, 0x68, 0x3d, 0x61, 0x20, 0x62, 0x3a, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x70, 0x61, 0x74, 0x68, 0x20, 0x62, 0x20, 0x70, 0x6f, 0x69, 0x6e, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x72, 0x73, 0x79, 0x6e, 0x63, 0x2d, 0x66, 0x72, 0x6f, 0x6d, 0x3d, 0x61, 0x20, 0x62, 0x3a, 0x20, 0x6d, 0x61, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x70, 0x61, 0x74, 0x68, 0x20, 0x62, 0x20, 0x65, 0x71, 0x75, 0x61, 0x6c, 0x20, 0x74, 0x6f, 0x20, 0x74, 0x68, 0x65, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x73, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x0a, 0x0a, 0x55, 0x6e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x75, 0x6e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2d, 0x61, 0x6e, 0x64, 0x2d, 0x62, 0x72, 0x61, 0x6e, 0x63, 0x68, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x75, 0x6e, 0x73, 0x68, 0x61, 0x72, 0x65, 0x2d, 0x61, 0x6e, 0x64, 0x2d, 0x72, 0x65, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2d, 0x6f, 0x6c, 0x64, 0x2d, 0x73, 0x74, 0x61, 0x74, 0x65, 0x3a, 0x20, 0x28, 0x64, 0x65, 0x66, 0x61, 0x75, 0x6c, 0x74, 0x29, 0x0a, 0x20, 0x0a, 0x52, 0x65, 0x76, 0x65, 0x72, 0x74, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x2d, 0x74, 0x6f, 0x2d, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x3d, 0x78, 0x3a, 0x20, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x20, 0x74, 0x6f, 0x20, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x20, 0x78, 0x0a, 0x0a, 0x52, 0x65, 0x76, 0x65, 0x72, 0x74, 0x20, 0x73, 0x74, 0x61, 0x74, 0x65, 0x20, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x0a, 0x0a, 0x20, 0x20, 0x2d, 0x2d, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x2d, 0x74, 0x6f, 0x2d, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x2d, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x6c, 0x79, 0x3a, 0x20, 0x72, 0x65, 0x76, 0x65, 0x72, 0x74, 0x20, 0x72, 0x65, 0x63, 0x75, 0x72, 0x73, 0x69, 0x76, 0x65, 0x6c, 0x79, 0x0a, }; diff --git a/src/nix-state/nix-state.cc b/src/nix-state/nix-state.cc index ac9a10db8..63087f279 100644 --- a/src/nix-state/nix-state.cc +++ b/src/nix-state/nix-state.cc @@ -246,6 +246,14 @@ static void queryAvailableStateRevisions(Strings opFlags, Strings opArgs) } } +static void opIsStateStorePath(Strings opFlags, Strings opArgs) //Used by .......... +{ + Path path = *(opArgs.begin()); + bool isStateComponent = store->isStateComponent(path); + cout << format("%s") % bool2string(isStateComponent); + //TODO !!!!!!!!!!!!!!!!!!!!!!!!!!!! replace lvlErrors by cout << format("%s\n") % *i; +} + static void opShowSharedPaths(Strings opFlags, Strings opArgs) { @@ -635,7 +643,8 @@ void run(Strings args) op = opShowDerivations; else if (arg == "--showrevisions") op = queryAvailableStateRevisions; - + else if (arg == "--is-state-store-path-download-using-manifests") + op = opIsStateStorePath; //Revering State options else if (arg.substr(0,21) == "--revert-to-revision="){ diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc index 41fa00a2d..1bf67a9d5 100644 --- a/src/nix-store/nix-store.cc +++ b/src/nix-store/nix-store.cc @@ -430,6 +430,8 @@ static void opRegisterValidity(Strings opFlags, Strings opArgs) ValidPathInfos infos; + printMsg(lvlError, format("opRegisterValidity!!!!!!!!!!!!!!!!!!!!!!!!!!!!!")); + while (1) { ValidPathInfo info = decodeValidPathInfo(cin); if (info.path == "") break; diff --git a/src/nix-worker/nix-worker.cc b/src/nix-worker/nix-worker.cc index a85fbf9b5..ea52a0758 100644 --- a/src/nix-worker/nix-worker.cc +++ b/src/nix-worker/nix-worker.cc @@ -702,7 +702,12 @@ static void processConnection() while (true) { WorkerOp op; try { - op = (WorkerOp) readInt(from); + int oppp = readInt(from); + op = (WorkerOp) oppp; + if(oppp == 14){ + printMsg(lvlError, format("Sleeping 10")); + sleep(10); + } } catch (EndOfFile & e) { break; } @@ -710,7 +715,7 @@ static void processConnection() opCount++; try { - printMsg(lvlInfo, format("Processing op '%1%'") % op); + printMsg(lvlInfo, format("Processing op '%1%' with pid '%2%'") % op % myPid); performOp(from, to, op); printMsg(lvlInfo, format("Processed op '%1%'") % op); } catch (Error & e) {