From 267f471d596afcb932b03e7066f6b769eb129b8b Mon Sep 17 00:00:00 2001 From: Artturin Date: Mon, 11 Sep 2023 01:20:56 +0300 Subject: [PATCH] WIP Allow users to change chrootRootDirBase location --- src/libstore/build/local-derivation-goal.cc | 5 ++++- src/libstore/build/local-derivation-goal.hh | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc index 8dab795b42e..90ee79d3751 100644 --- a/src/libstore/build/local-derivation-goal.cc +++ b/src/libstore/build/local-derivation-goal.cc @@ -651,7 +651,10 @@ void LocalDerivationGoal::startBuilder() environment using bind-mounts. We put it in the Nix store to ensure that we can create hard-links to non-directory inputs in the fake Nix store in the chroot (see below). */ - chrootRootDir = worker.store.Store::toRealPath(drvPath) + ".chroot"; + chrootRootDirBase = canonPath("/testchroot"); + createDirs(chrootRootDirBase); + + chrootRootDir = chrootRootDirBase + "/" + drvPath.to_string() + ".chroot"; deletePath(chrootRootDir); /* Clean up the chroot directory automatically. */ diff --git a/src/libstore/build/local-derivation-goal.hh b/src/libstore/build/local-derivation-goal.hh index d6ace70fe5d..021dfba863f 100644 --- a/src/libstore/build/local-derivation-goal.hh +++ b/src/libstore/build/local-derivation-goal.hh @@ -64,6 +64,7 @@ struct LocalDerivationGoal : public DerivationGoal */ bool useChroot = false; + Path chrootRootDirBase; Path chrootRootDir; /**