Skip to content

Commit 27767a6

Browse files
authored
Merge pull request NixOS#14276 from NixOS/fix-14193
libstore/registerOutputs: Don't try to optimize a non-existent actual…
2 parents d87a06a + 4cbcaad commit 27767a6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libstore/unix/build/derivation-builder.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1742,7 +1742,6 @@ SingleDrvOutputs DerivationBuilderImpl::registerOutputs()
17421742
if (buildMode == bmRepair) {
17431743
/* Path already exists, need to replace it */
17441744
replaceValidPath(store.toRealPath(finalDestPath), actualPath);
1745-
actualPath = store.toRealPath(finalDestPath);
17461745
} else if (buildMode == bmCheck) {
17471746
/* Path already exists, and we want to compare, so we leave out
17481747
new path in place. */
@@ -1756,7 +1755,6 @@ SingleDrvOutputs DerivationBuilderImpl::registerOutputs()
17561755
auto destPath = store.toRealPath(finalDestPath);
17571756
deletePath(destPath);
17581757
movePath(actualPath, destPath);
1759-
actualPath = destPath;
17601758
}
17611759
}
17621760

@@ -1809,7 +1807,9 @@ SingleDrvOutputs DerivationBuilderImpl::registerOutputs()
18091807
debug("unreferenced input: '%1%'", store.printStorePath(i));
18101808
}
18111809

1812-
store.optimisePath(actualPath, NoRepair); // FIXME: combine with scanForReferences()
1810+
if (!store.isValidPath(newInfo.path))
1811+
store.optimisePath(
1812+
store.toRealPath(finalDestPath), NoRepair); // FIXME: combine with scanForReferences()
18131813

18141814
newInfo.deriver = drvPath;
18151815
newInfo.ultimate = true;

0 commit comments

Comments
 (0)