File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -707,13 +707,16 @@ StorePath AttrCursor::forceDerivation()
707707 auto aDrvPath = getAttr (root->state .s .drvPath );
708708 auto drvPath = root->state .store ->parseStorePath (aDrvPath->getString ());
709709 drvPath.requireDerivation ();
710- if (!root->state .store ->isValidPath (drvPath) && !settings.readOnlyMode ) {
711- /* The eval cache contains 'drvPath', but the actual path has
712- been garbage-collected. So force it to be regenerated. */
713- aDrvPath->forceValue ();
714- if (!root->state .store ->isValidPath (drvPath))
715- throw Error (
716- " don't know how to recreate store derivation '%s'!" , root->state .store ->printStorePath (drvPath));
710+ if (!settings.readOnlyMode ) {
711+ root->state .store ->addTempRoot (drvPath);
712+ if (!root->state .store ->isValidPath (drvPath)) {
713+ /* The eval cache contains 'drvPath', but the actual path has
714+ been garbage-collected. So force it to be regenerated. */
715+ aDrvPath->forceValue ();
716+ if (!root->state .store ->isValidPath (drvPath))
717+ throw Error (
718+ " don't know how to recreate store derivation '%s'!" , root->state .store ->printStorePath (drvPath));
719+ }
717720 }
718721 return drvPath;
719722}
You can’t perform that action at this time.
0 commit comments