From 3c610df550be35d9696efe9dd3217a6e1ec100f2 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Fri, 26 Sep 2025 00:22:54 -0400 Subject: [PATCH] Delete scratch data for CA derivation that produced already-extant output In the case where the store object doesn't exist, we do correctly move (rather than copy) the scratch data into place. In this case, the destination store object already exists, but we still want to clean up after ourselves. --- src/libstore/unix/build/derivation-builder.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/libstore/unix/build/derivation-builder.cc b/src/libstore/unix/build/derivation-builder.cc index 770bdad4d..3a6f71555 100644 --- a/src/libstore/unix/build/derivation-builder.cc +++ b/src/libstore/unix/build/derivation-builder.cc @@ -1712,6 +1712,8 @@ SingleDrvOutputs DerivationBuilderImpl::registerOutputs() /* Path already exists because CA path produced by something else. No moving needed. */ assert(newInfo.ca); + /* Can delete our scratch copy now. */ + deletePath(actualPath); } else { auto destPath = store.toRealPath(finalDestPath); deletePath(destPath);