From 7f176002c67ef0dc92e4adf82095147ea705f70a Mon Sep 17 00:00:00 2001 From: Alois Wohlschlager Date: Sun, 30 Nov 2025 13:05:12 +0100 Subject: [PATCH] libstore/build: warn when the sandbox is force-enabled due to a diverted store Builds using a diverted store strictly require sandboxing. It therefore makes sense to automatically enable it even if otherwise explicitly disabled by the user. However, they should still be informed that their choice is not being respected. Change-Id: Ia2cbdc24a4c55d8ecc49094e35e698e16a6a6964 --- lix/libstore/build/local-derivation-goal.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lix/libstore/build/local-derivation-goal.cc b/lix/libstore/build/local-derivation-goal.cc index 084b1d6d8..6acc2372f 100644 --- a/lix/libstore/build/local-derivation-goal.cc +++ b/lix/libstore/build/local-derivation-goal.cc @@ -229,6 +229,9 @@ retry: auto & localStore = getLocalStore(); if (localStore.config().storeDir != localStore.config().realStoreDir.get()) { #if __linux__ + if (!useChroot) { + printTaggedWarning("auto-enabling the sandbox due to using a diverted store"); + } useChroot = true; #else throw Error("building using a diverted store is not supported on this platform");