From aaab224bea76cc6882884f9223b4bec2a781ebd4 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Sat, 22 Feb 2025 23:20:54 +0100 Subject: [PATCH] libstore: kill sandboxes before removing paths otherwise we may end up trying to delete a temporary directory that is still actively being written to if a derivation is killed due to other derivations failing or the build is aborted due to a user interruption fixes #678 Change-Id: I4678723f11bdd261b27af8784d040a787690b107 --- lix/libstore/build/local-derivation-goal.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lix/libstore/build/local-derivation-goal.cc b/lix/libstore/build/local-derivation-goal.cc index 5e35ebdb5..495a2ebb8 100644 --- a/lix/libstore/build/local-derivation-goal.cc +++ b/lix/libstore/build/local-derivation-goal.cc @@ -104,9 +104,9 @@ LocalDerivationGoal::~LocalDerivationGoal() noexcept(false) { /* Careful: we should never ever throw an exception from a destructor. */ - try { deleteTmpDir(false); } catch (...) { ignoreExceptionInDestructor(); } try { killChild(); } catch (...) { ignoreExceptionInDestructor(); } try { stopDaemon(); } catch (...) { ignoreExceptionInDestructor(); } + try { deleteTmpDir(false); } catch (...) { ignoreExceptionInDestructor(); } }