mirror of
https://github.com/NixOS/nix.git
synced 2025-02-19 18:32:36 +00:00
Recursive build error.... *2
This commit is contained in:
parent
65ba1f3008
commit
0ee803935e
@ -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<SubstitutionGoal *>(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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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<string, Strings> settings;
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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
|
||||
|
||||
|
File diff suppressed because one or more lines are too long
@ -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="){
|
||||
|
@ -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;
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user