libstore/registerOutputs: Don't try to optimize a non-existent actualPath
Since3c610df550this resulted in `getting status of` errors on paths inside the chroot if a path was already valid. Careful inspection of the logic shows that if buildMode != bmCheck actualPath gets reassigned to store.toRealPath(finalDestPath). The only branch that cares about actualPath is the buildMode == bmCheck case, which doesn't lead to optimisePath anyway. (cherry picked from commit4cbcaad435)
This commit is contained in:
committed by
github-actions[bot]
parent
3c39583e55
commit
dadb5b01b7
@@ -1717,7 +1717,6 @@ SingleDrvOutputs DerivationBuilderImpl::registerOutputs()
|
||||
if (buildMode == bmRepair) {
|
||||
/* Path already exists, need to replace it */
|
||||
replaceValidPath(store.toRealPath(finalDestPath), actualPath);
|
||||
actualPath = store.toRealPath(finalDestPath);
|
||||
} else if (buildMode == bmCheck) {
|
||||
/* Path already exists, and we want to compare, so we leave out
|
||||
new path in place. */
|
||||
@@ -1731,7 +1730,6 @@ SingleDrvOutputs DerivationBuilderImpl::registerOutputs()
|
||||
auto destPath = store.toRealPath(finalDestPath);
|
||||
deletePath(destPath);
|
||||
movePath(actualPath, destPath);
|
||||
actualPath = destPath;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1784,7 +1782,9 @@ SingleDrvOutputs DerivationBuilderImpl::registerOutputs()
|
||||
debug("unreferenced input: '%1%'", store.printStorePath(i));
|
||||
}
|
||||
|
||||
store.optimisePath(actualPath, NoRepair); // FIXME: combine with scanForReferences()
|
||||
if (!store.isValidPath(newInfo.path))
|
||||
store.optimisePath(
|
||||
store.toRealPath(finalDestPath), NoRepair); // FIXME: combine with scanForReferences()
|
||||
|
||||
newInfo.deriver = drvPath;
|
||||
newInfo.ultimate = true;
|
||||
|
||||
Reference in New Issue
Block a user