From a0a00948dfd2c44d293bc2fa7268cf71564d7f44 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Fri, 27 Jun 2025 15:38:53 +0200 Subject: [PATCH] libstore: fix scratch output cleanup the daemon must use real store paths, not virtual store paths. using virtual paths may inadvertently delete paths in the system nix store when a build was run on a redirected store as root, which isn't good Change-Id: Id048b236bda0e0ab1f3be6ccba0ddc1de2a3e941 --- lix/libstore/build/local-derivation-goal.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lix/libstore/build/local-derivation-goal.cc b/lix/libstore/build/local-derivation-goal.cc index 13bda5df9..2222d10c6 100644 --- a/lix/libstore/build/local-derivation-goal.cc +++ b/lix/libstore/build/local-derivation-goal.cc @@ -490,7 +490,9 @@ try { /* Schedule this scratch output path for automatic deletion * if we do not cancel it, e.g. when registering the outputs. */ - scratchOutputsCleaner.emplace(outputName, worker.store.printStorePath(scratchPath)); + scratchOutputsCleaner.emplace( + outputName, worker.store.toRealPath(worker.store.printStorePath(scratchPath)) + ); /* Substitute output placeholders with the scratch output paths. We'll use during the build. */