diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-03-24T10·57+0100 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2015-03-24T10·57+0100 |
commit | 5114a07d9578e06c66862270a3d624fc0944f33a (patch) | |
tree | 3ad9c94488ed0f48cea25f8a1dd619203ed143ba /src | |
parent | fd89f97be97d4f698efd208140062a3f701ef76e (diff) |
Improve setting the default chroot dirs
Diffstat (limited to 'src')
-rw-r--r-- | src/libstore/build.cc | 7 | ||||
-rw-r--r-- | src/libstore/local.mk | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 1c510fa7d514..90bcccd243a7 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -1784,9 +1784,14 @@ void DerivationGoal::startBuilder() } if (useChroot) { + + string defaultChrootDirs; + if (isInStore(BASH_PATH)) + defaultChrootDirs = "/bin/sh=" BASH_PATH; + /* Allow a user-configurable set of directories from the host file system. */ - PathSet dirs = tokenizeString<StringSet>(settings.get("build-chroot-dirs", string(DEFAULT_CHROOT_DIRS))); + PathSet dirs = tokenizeString<StringSet>(settings.get("build-chroot-dirs", defaultChrootDirs)); PathSet dirs2 = tokenizeString<StringSet>(settings.get("build-extra-chroot-dirs", string(""))); dirs.insert(dirs2.begin(), dirs2.end()); diff --git a/src/libstore/local.mk b/src/libstore/local.mk index 7c99fd77aea5..78b4d0fd4b94 100644 --- a/src/libstore/local.mk +++ b/src/libstore/local.mk @@ -22,7 +22,7 @@ libstore_CXXFLAGS = \ -DNIX_CONF_DIR=\"$(sysconfdir)/nix\" \ -DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \ -DNIX_BIN_DIR=\"$(bindir)\" \ - -DDEFAULT_CHROOT_DIRS="\"$(DEFAULT_CHROOT_DIRS)\"" + -DBASH_PATH="\"$(bash)\"" $(d)/local-store.cc: $(d)/schema.sql.hh |