Skip to content

Commit

Permalink
WIP Allow users to change chrootRootDirBase location
Browse files Browse the repository at this point in the history
  • Loading branch information
Artturin committed Sep 10, 2023
1 parent 26546f2 commit 267f471
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/libstore/build/local-derivation-goal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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. */
Expand Down
1 change: 1 addition & 0 deletions src/libstore/build/local-derivation-goal.hh
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ struct LocalDerivationGoal : public DerivationGoal
*/
bool useChroot = false;

Path chrootRootDirBase;
Path chrootRootDir;

/**
Expand Down

0 comments on commit 267f471

Please sign in to comment.