mirror of
https://github.com/NixOS/nix.git
synced 2025-11-26 04:00:59 +01:00
Recursive build error.... *2
This commit is contained in:
parent
65ba1f3008
commit
0ee803935e
12 changed files with 97 additions and 56 deletions
|
|
@ -1146,22 +1146,24 @@ static string makeValidityRegistration(const PathSet & paths,
|
||||||
j != references.end(); ++j)
|
j != references.end(); ++j)
|
||||||
s += *j + "\n";
|
s += *j + "\n";
|
||||||
|
|
||||||
//state references
|
if(store->isStateComponent(*i)){
|
||||||
|
|
||||||
PathSet stateReferences;
|
|
||||||
store->queryStateReferences(*i, stateReferences, 0);
|
|
||||||
|
|
||||||
s += (format("%1%\n") % stateReferences.size()).str();
|
//state references
|
||||||
|
|
||||||
for (PathSet::iterator j = stateReferences.begin();
|
PathSet stateReferences;
|
||||||
j != stateReferences.end(); ++j)
|
store->queryStateReferences(*i, stateReferences, 0);
|
||||||
s += *j + "\n";
|
|
||||||
|
s += (format("%1%\n") % stateReferences.size()).str();
|
||||||
//revision
|
|
||||||
|
for (PathSet::iterator j = stateReferences.begin();
|
||||||
string revision = unsignedInt2String(0);
|
j != stateReferences.end(); ++j)
|
||||||
s += revision + "\n";
|
s += *j + "\n";
|
||||||
|
|
||||||
|
//revision
|
||||||
|
|
||||||
|
string revision = unsignedInt2String(0);
|
||||||
|
s += revision + "\n";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return s;
|
return s;
|
||||||
|
|
@ -1852,7 +1854,7 @@ void DerivationGoal::computeClosure()
|
||||||
* If state is enabled for the path we:
|
* If state is enabled for the path we:
|
||||||
* [scan for and state references and component references in the state path] //3,4
|
* [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;
|
Path sharedState = drv.stateOutputs.find("state")->second.sharedState;
|
||||||
if(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
|
//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;
|
Path statePath = drv.stateOutputs.find("state")->second.statepath;
|
||||||
printMsg(lvlTalkative, format("scanning for component and state references inside `%1%'") % statePath);
|
printMsg(lvlTalkative, format("scanning for component and state references inside `%1%'") % statePath);
|
||||||
|
|
||||||
|
|
@ -2395,7 +2396,10 @@ static bool working = false;
|
||||||
Worker::Worker()
|
Worker::Worker()
|
||||||
{
|
{
|
||||||
/* Debugging: prevent recursive workers. */
|
/* Debugging: prevent recursive workers. */
|
||||||
if (working) abort();
|
printMsg(lvlError, format("Before abort '%1%'") % working);
|
||||||
|
if (working)
|
||||||
|
abort();
|
||||||
|
printMsg(lvlError, format("After abort"));
|
||||||
working = true;
|
working = true;
|
||||||
nrChildren = 0;
|
nrChildren = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -2592,6 +2596,7 @@ void Worker::getInfo()
|
||||||
args.push_back("--query-info");
|
args.push_back("--query-info");
|
||||||
args.insert(args.end(), paths2.begin(), paths2.end());
|
args.insert(args.end(), paths2.begin(), paths2.end());
|
||||||
string res = runProgram(sub, false, args);
|
string res = runProgram(sub, false, args);
|
||||||
|
printMsg(lvlError, format("run: '%1%' res: '%2%'") % sub % res);
|
||||||
std::istringstream str(res);
|
std::istringstream str(res);
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
|
|
@ -2606,14 +2611,18 @@ void Worker::getInfo()
|
||||||
if (goal) {
|
if (goal) {
|
||||||
SubstitutionGoal * goal2 = dynamic_cast<SubstitutionGoal *>(goal.get());
|
SubstitutionGoal * goal2 = dynamic_cast<SubstitutionGoal *>(goal.get());
|
||||||
if (goal2->storePath == info.path) {
|
if (goal2->storePath == info.path) {
|
||||||
goal2->references = info.references;
|
goal2->references = info.references;
|
||||||
goal2->deriver = info.deriver;
|
goal2->deriver = info.deriver;
|
||||||
|
//goal2->stateReferences = info.stateReferences; //TODO !!!!!!!!!!!!!!!!!!!!!!!!!! STATE REFERENCES FOR A SubstitutionGoal
|
||||||
|
//goal2->revision = info.revision;
|
||||||
goal2->infoOkay = true;
|
goal2->infoOkay = true;
|
||||||
wakeUp(goal);
|
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;
|
static bool settingsRead = false;
|
||||||
|
|
||||||
uid_t callingUID = 0; //A root user will not set this value, so the default uid is 0
|
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;
|
bool sendOutput = true;
|
||||||
|
|
||||||
static std::map<string, Strings> settings;
|
static std::map<string, Strings> settings;
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,14 @@ namespace nix {
|
||||||
Derivation derivationFromPathPrivate(const bool dotxn, const Transaction & txn, const Path & drvPath)
|
Derivation derivationFromPathPrivate(const bool dotxn, const Transaction & txn, const Path & drvPath)
|
||||||
{
|
{
|
||||||
assertStorePath(drvPath);
|
assertStorePath(drvPath);
|
||||||
if(dotxn)
|
if(dotxn){
|
||||||
|
printMsg(lvlError, format("ensurePathTxn(txn,%1%)") % drvPath);
|
||||||
ensurePathTxn(txn, drvPath);
|
ensurePathTxn(txn, drvPath);
|
||||||
else
|
}
|
||||||
|
else{
|
||||||
|
printMsg(lvlError, format("store->ensurePathTxn(%1%)") % drvPath);
|
||||||
store->ensurePath(drvPath);
|
store->ensurePath(drvPath);
|
||||||
|
}
|
||||||
ATerm t = ATreadFromNamedFile(drvPath.c_str());
|
ATerm t = ATreadFromNamedFile(drvPath.c_str());
|
||||||
if (!t)
|
if (!t)
|
||||||
throw Error(format("cannot read aterm from `%1%'") % drvPath);
|
throw Error(format("cannot read aterm from `%1%'") % drvPath);
|
||||||
|
|
|
||||||
|
|
@ -535,7 +535,7 @@ PathSet RemoteStore::toNonSharedPathSet(const PathSet & statePaths)
|
||||||
writeInt(wopToNonSharedPathSet, to);
|
writeInt(wopToNonSharedPathSet, to);
|
||||||
writeStringSet(statePaths, to);
|
writeStringSet(statePaths, to);
|
||||||
processStderr();
|
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)
|
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;
|
ValidPathInfo info;
|
||||||
|
|
||||||
|
printMsg(lvlError, format("BEFORE decodeValidPathInfo"));
|
||||||
|
|
||||||
getline(str, info.path);
|
getline(str, info.path);
|
||||||
if (str.eof()) { info.path = ""; return info; }
|
if (str.eof()) { info.path = ""; return info; }
|
||||||
|
|
||||||
|
|
@ -226,22 +228,31 @@ ValidPathInfo decodeValidPathInfo(std::istream & str)
|
||||||
getline(str, s);
|
getline(str, s);
|
||||||
info.references.insert(s);
|
info.references.insert(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
getline(str, s);
|
if(store->isStateComponent(info.path)){
|
||||||
if (!string2Int(s, n))
|
|
||||||
throw Error("number expected");
|
printMsg(lvlError, format("STATE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"));
|
||||||
while (n--) {
|
|
||||||
getline(str, s);
|
getline(str, s);
|
||||||
info.stateReferences.insert(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;
|
if (!str || str.eof())
|
||||||
getline(str, s);
|
throw Error("missing input");
|
||||||
if (!string2UnsignedInt(s, u))
|
|
||||||
throw Error("number expected");
|
printMsg(lvlError, format("AFTER decodeValidPathInfo"));
|
||||||
info.revision = u;
|
|
||||||
|
|
||||||
if (!str || str.eof()) throw Error("missing input");
|
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,26 +14,26 @@ namespace nix {
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
wopQuit = 0, //0
|
wopQuit = 0, //0
|
||||||
wopIsValidPath,
|
wopIsValidPath, //1
|
||||||
wopHasSubstitutes = 3,
|
wopHasSubstitutes = 3, //3
|
||||||
wopIsValidStatePath,
|
wopIsValidStatePath,
|
||||||
wopIsValidComponentOrStatePath,
|
wopIsValidComponentOrStatePath,
|
||||||
wopQueryPathHash,
|
wopQueryPathHash,
|
||||||
wopQueryStatePathDrv,
|
wopQueryStatePathDrv,
|
||||||
wopQueryStoreReferences,
|
wopQueryStoreReferences,
|
||||||
wopQueryStateReferences,
|
wopQueryStateReferences,
|
||||||
wopQueryStoreReferrers,
|
wopQueryStoreReferrers, //10
|
||||||
wopQueryStateReferrers, //10
|
wopQueryStateReferrers,
|
||||||
wopAddToStore,
|
wopAddToStore,
|
||||||
wopAddTextToStore,
|
wopAddTextToStore, //13
|
||||||
wopBuildDerivations, //13
|
wopBuildDerivations, //14
|
||||||
wopEnsurePath,
|
wopEnsurePath, //15
|
||||||
wopAddTempRoot,
|
wopAddTempRoot,
|
||||||
wopAddIndirectRoot,
|
wopAddIndirectRoot,
|
||||||
wopSyncWithGC,
|
wopSyncWithGC,
|
||||||
wopFindRoots,
|
wopFindRoots,
|
||||||
wopCollectGarbage,
|
wopCollectGarbage, //20
|
||||||
wopExportPath, //20
|
wopExportPath,
|
||||||
wopImportPath,
|
wopImportPath,
|
||||||
wopQueryDeriver,
|
wopQueryDeriver,
|
||||||
wopQueryDerivers,
|
wopQueryDerivers,
|
||||||
|
|
@ -42,16 +42,16 @@ typedef enum {
|
||||||
wopIsStateComponent,
|
wopIsStateComponent,
|
||||||
wopStorePathRequisites,
|
wopStorePathRequisites,
|
||||||
wopSetStateRevisions,
|
wopSetStateRevisions,
|
||||||
wopQueryStateRevisions,
|
wopQueryStateRevisions, //30
|
||||||
wopQueryAvailableStateRevisions, //30
|
wopQueryAvailableStateRevisions,
|
||||||
wopCommitStatePath,
|
wopCommitStatePath,
|
||||||
wopScanAndUpdateAllReferences,
|
wopScanAndUpdateAllReferences,
|
||||||
wopGetSharedWith,
|
wopGetSharedWith,
|
||||||
wopToNonSharedPathSet,
|
wopToNonSharedPathSet,
|
||||||
wopRevertToRevision,
|
wopRevertToRevision,
|
||||||
wopShareState,
|
wopShareState,
|
||||||
wopUnShareState, //37
|
wopUnShareState,
|
||||||
wopSetOptions,
|
wopSetOptions, //39
|
||||||
} WorkerOp;
|
} WorkerOp;
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -467,7 +467,7 @@ void readFull(int fd, unsigned char * buf, size_t count)
|
||||||
throw SysError("reading from file");
|
throw SysError("reading from file");
|
||||||
}
|
}
|
||||||
if (res == 0)
|
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;
|
count -= res;
|
||||||
buf += res;
|
buf += res;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ Information:
|
||||||
--showderivations: print all derivations of this path
|
--showderivations: print all derivations of this path
|
||||||
--showrevisions: show all revisions of the state path
|
--showrevisions: show all revisions of the state path
|
||||||
--showsharedpaths: show where this path points to
|
--showsharedpaths: show where this path points to
|
||||||
|
--XXXXXXXXXXXXXXXX: print if the path is a state/store path
|
||||||
--version: output version information
|
--version: output version information
|
||||||
--help: display help
|
--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)
|
static void opShowSharedPaths(Strings opFlags, Strings opArgs)
|
||||||
{
|
{
|
||||||
|
|
@ -635,7 +643,8 @@ void run(Strings args)
|
||||||
op = opShowDerivations;
|
op = opShowDerivations;
|
||||||
else if (arg == "--showrevisions")
|
else if (arg == "--showrevisions")
|
||||||
op = queryAvailableStateRevisions;
|
op = queryAvailableStateRevisions;
|
||||||
|
else if (arg == "--is-state-store-path-download-using-manifests")
|
||||||
|
op = opIsStateStorePath;
|
||||||
|
|
||||||
//Revering State options
|
//Revering State options
|
||||||
else if (arg.substr(0,21) == "--revert-to-revision="){
|
else if (arg.substr(0,21) == "--revert-to-revision="){
|
||||||
|
|
|
||||||
|
|
@ -430,6 +430,8 @@ static void opRegisterValidity(Strings opFlags, Strings opArgs)
|
||||||
|
|
||||||
ValidPathInfos infos;
|
ValidPathInfos infos;
|
||||||
|
|
||||||
|
printMsg(lvlError, format("opRegisterValidity!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"));
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
ValidPathInfo info = decodeValidPathInfo(cin);
|
ValidPathInfo info = decodeValidPathInfo(cin);
|
||||||
if (info.path == "") break;
|
if (info.path == "") break;
|
||||||
|
|
|
||||||
|
|
@ -702,7 +702,12 @@ static void processConnection()
|
||||||
while (true) {
|
while (true) {
|
||||||
WorkerOp op;
|
WorkerOp op;
|
||||||
try {
|
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) {
|
} catch (EndOfFile & e) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
@ -710,7 +715,7 @@ static void processConnection()
|
||||||
opCount++;
|
opCount++;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
printMsg(lvlInfo, format("Processing op '%1%'") % op);
|
printMsg(lvlInfo, format("Processing op '%1%' with pid '%2%'") % op % myPid);
|
||||||
performOp(from, to, op);
|
performOp(from, to, op);
|
||||||
printMsg(lvlInfo, format("Processed op '%1%'") % op);
|
printMsg(lvlInfo, format("Processed op '%1%'") % op);
|
||||||
} catch (Error & e) {
|
} catch (Error & e) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue