mirror of
https://github.com/NixOS/nix.git
synced 2025-11-26 20:20:58 +01:00
State is now maintained (their paths are automatically shared), unless sharedState is set in the nix-expr, when a new version with the same drv-name of the component is installed
This commit is contained in:
parent
7424d72098
commit
4089bd5f19
9 changed files with 110 additions and 75 deletions
|
|
@ -1821,16 +1821,10 @@ void DerivationGoal::computeClosure()
|
|||
if(sharedState != ""){
|
||||
//Remove state path
|
||||
deletePathWrapped(statePath);
|
||||
|
||||
//Symlink link to the share path
|
||||
Strings p_args;
|
||||
p_args.push_back("-sf");
|
||||
p_args.push_back(sharedState);
|
||||
p_args.push_back(statePath);
|
||||
runProgram_AndPrintOutput("ln", true, p_args, "ln"); //run
|
||||
sharePath(sharedState, statePath);
|
||||
|
||||
//Set in database
|
||||
setSharedStateTxn(txn, statePath, sharedState);
|
||||
setSharedStateTxn(txn, sharedState, statePath);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -2587,9 +2581,7 @@ void LocalStore::buildDerivations(const PathSet & drvPaths)
|
|||
Worker worker;
|
||||
Goals goals;
|
||||
for (PathSet::const_iterator i = drvPaths.begin(); i != drvPaths.end(); ++i){
|
||||
|
||||
printMsg(lvlError, format("BUILD: '%1%'") % *i);
|
||||
|
||||
//printMsg(lvlError, format("BUILD: '%1%'") % *i);
|
||||
goals.insert(worker.makeDerivationGoal(*i));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1729,13 +1729,13 @@ bool querySolidStateReferencesTxn(const Transaction & txn, const Path & statePat
|
|||
return notempty;
|
||||
}
|
||||
|
||||
void setSharedStateTxn(const Transaction & txn, const Path & statePath, const Path & shared_with)
|
||||
void setSharedStateTxn(const Transaction & txn, const Path & fromExisting, const Path & toNew)
|
||||
{
|
||||
//Remove earlier entries
|
||||
nixDB.delPair(txn, dbSharedState, statePath);
|
||||
nixDB.delPair(txn, dbSharedState, toNew);
|
||||
|
||||
//Set new entry
|
||||
nixDB.setString(txn, dbSharedState, statePath, shared_with);
|
||||
nixDB.setString(txn, dbSharedState, toNew, fromExisting);
|
||||
}
|
||||
|
||||
bool querySharedStateTxn(const Transaction & txn, const Path & statePath, Path & shared_with)
|
||||
|
|
|
|||
|
|
@ -239,7 +239,7 @@ bool isValidStatePathTxn(const Transaction & txn, const Path & path);
|
|||
void setSolidStateReferencesTxn(const Transaction & txn, const Path & statePath, const PathSet & paths);
|
||||
bool querySolidStateReferencesTxn(const Transaction & txn, const Path & statePath, PathSet & paths);
|
||||
|
||||
void setSharedStateTxn(const Transaction & txn, const Path & statePath, const Path & shared_with);
|
||||
void setSharedStateTxn(const Transaction & txn, const Path & fromExisting, const Path & toNew);
|
||||
PathSet toNonSharedPathSetTxn(const Transaction & txn, const PathSet & statePaths);
|
||||
Path toNonSharedPathTxn(const Transaction & txn, const Path & statePath);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue