From 652817046b2f999e29de8109fce9c61b5b18d22c Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 11 Dec 2008 17:52:34 +0000 Subject: [PATCH] * Revert r13150: now that we use private namespaces for the chroot, we don't have to put the chroot in /nix/var/nix/chroots anymore. They're back in /tmp now. --- src/libmain/shared.cc | 1 - src/libstore/build.cc | 2 +- src/libstore/globals.cc | 1 - src/libstore/globals.hh | 6 ------ 4 files changed, 1 insertion(+), 9 deletions(-) diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc index dee9a5320..cfb34d7eb 100644 --- a/src/libmain/shared.cc +++ b/src/libmain/shared.cc @@ -138,7 +138,6 @@ static void initAndRun(int argc, char * * argv) nixConfDir = canonPath(getEnv("NIX_CONF_DIR", NIX_CONF_DIR)); nixLibexecDir = canonPath(getEnv("NIX_LIBEXEC_DIR", NIX_LIBEXEC_DIR)); nixBinDir = canonPath(getEnv("NIX_BIN_DIR", NIX_BIN_DIR)); - nixChrootsDir = canonPath(getEnv("NIX_CHROOTS_DIR", nixStateDir + "/chroots")); string subs = getEnv("NIX_SUBSTITUTERS", "default"); if (subs == "default") { diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 466e3326d..cbbd3aa39 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -1657,7 +1657,7 @@ void DerivationGoal::startBuilder() #if CHROOT_ENABLED /* Create a temporary directory in which we set up the chroot environment using bind-mounts. */ - chrootRootDir = createTempDir(nixChrootsDir, "chroot-nix"); + chrootRootDir = createTempDir("", "nix-chroot"); /* Clean up the chroot directory automatically. */ autoDelChroot = boost::shared_ptr(new AutoDelete(chrootRootDir)); diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc index 27d75faec..296cc4ac8 100644 --- a/src/libstore/globals.cc +++ b/src/libstore/globals.cc @@ -16,7 +16,6 @@ string nixDBPath = "/UNINIT"; string nixConfDir = "/UNINIT"; string nixLibexecDir = "/UNINIT"; string nixBinDir = "/UNINIT"; -string nixChrootsDir = "/UNINIT"; bool keepFailed = false; bool keepGoing = false; diff --git a/src/libstore/globals.hh b/src/libstore/globals.hh index 7e973025c..b8e2bae66 100644 --- a/src/libstore/globals.hh +++ b/src/libstore/globals.hh @@ -35,12 +35,6 @@ extern string nixLibexecDir; /* nixBinDir is the directory where the main programs are stored. */ extern string nixBinDir; -/* nixChrootsDir is the directory where we create chroot environments - (when chroot builds are enabled). We don't put these under /tmp to - prevent "rm -rf /tmp" from recursing into /nix/store via the bind - mounts in the chroots. */ -extern string nixChrootsDir; - /* Misc. global flags. */