[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
86/118: Add option ‘build-extra-chroot-dirs’
From: |
Ludovic Courtès |
Subject: |
86/118: Add option ‘build-extra-chroot-dirs’ |
Date: |
Tue, 19 May 2015 14:45:52 +0000 |
civodul pushed a commit to branch nix
in repository guix.
commit f530ee6f356f4299ca343dde7f4c0742300ffa08
Author: Eelco Dolstra <address@hidden>
Date: Mon Aug 4 18:00:00 2014 +0200
Add option ‘build-extra-chroot-dirs’
This is useful for extending (rather than overriding) the default set
of chroot paths.
---
nix/libstore/build.cc | 11 +++++++----
nix/libstore/globals.cc | 1 -
nix/libstore/globals.hh | 4 ----
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc
index 9b9f3d2..c73170e 100644
--- a/nix/libstore/build.cc
+++ b/nix/libstore/build.cc
@@ -1804,12 +1804,15 @@ void DerivationGoal::startBuilder()
/* Bind-mount a user-configurable set of directories from the
host file system. */
- foreach (StringSet::iterator, i, settings.dirsInChroot) {
- size_t p = i->find('=');
+ PathSet dirs =
tokenizeString<StringSet>(settings.get(string("build-chroot-dirs"),
DEFAULT_CHROOT_DIRS));
+ PathSet dirs2 =
tokenizeString<StringSet>(settings.get(string("build-extra-chroot-dirs"), ""));
+ dirs.insert(dirs2.begin(), dirs2.end());
+ for (auto & i : dirs) {
+ size_t p = i.find('=');
if (p == string::npos)
- dirsInChroot[*i] = *i;
+ dirsInChroot[i] = i;
else
- dirsInChroot[string(*i, 0, p)] = string(*i, p + 1);
+ dirsInChroot[string(i, 0, p)] = string(i, p + 1);
}
dirsInChroot[tmpDir] = tmpDir;
diff --git a/nix/libstore/globals.cc b/nix/libstore/globals.cc
index 21fbfba..b4c858b 100644
--- a/nix/libstore/globals.cc
+++ b/nix/libstore/globals.cc
@@ -131,7 +131,6 @@ void Settings::update()
get(useSubstitutes, "build-use-substitutes");
get(buildUsersGroup, "build-users-group");
get(useChroot, "build-use-chroot");
- get(dirsInChroot, "build-chroot-dirs");
get(impersonateLinux26, "build-impersonate-linux-26");
get(keepLog, "build-keep-log");
get(compressLog, "build-compress-log");
diff --git a/nix/libstore/globals.hh b/nix/libstore/globals.hh
index f174833..7a81283 100644
--- a/nix/libstore/globals.hh
+++ b/nix/libstore/globals.hh
@@ -142,10 +142,6 @@ struct Settings {
/* Whether to build in chroot. */
bool useChroot;
- /* The directories from the host filesystem to be included in the
- chroot. */
- StringSet dirsInChroot;
-
/* Set of ssh connection strings for the ssh substituter */
Strings sshSubstituterHosts;
- 61/118: Handle case collisions on case-insensitive systems, (continued)
- 61/118: Handle case collisions on case-insensitive systems, Ludovic Courtès, 2015/05/19
- 60/118: Make dev-shell script work on Darwin, Ludovic Courtès, 2015/05/19
- 71/118: Revert old useBuildHook behaviour, Ludovic Courtès, 2015/05/19
- 63/118: Get rid of a compiler warning, Ludovic Courtès, 2015/05/19
- 67/118: nix-daemon: Add trusted-users and allowed-users options, Ludovic Courtès, 2015/05/19
- 70/118: Better fix for strcasecmp on Darwin, Ludovic Courtès, 2015/05/19
- 75/118: Merge commit 'fdee1ced43fb495d612a29e955141cdf6b9a95ba' into nix, Ludovic Courtès, 2015/05/19
- 74/118: Merge commit '8e9140cfdef9dbd1eb61e4c75c91d452ab5e4a74' into nix, Ludovic Courtès, 2015/05/19
- 73/118: startProcess: Make writing error messages from the child more robust, Ludovic Courtès, 2015/05/19
- 69/118: Bump, Ludovic Courtès, 2015/05/19
- 86/118: Add option ‘build-extra-chroot-dirs’,
Ludovic Courtès <=
- 76/118: nix-daemon: Simplify stderr handling, Ludovic Courtès, 2015/05/19
- 77/118: nix-daemon: Less verbosity, Ludovic Courtès, 2015/05/19
- 90/118: Remove unnecessary call to addTempRoot(), Ludovic Courtès, 2015/05/19
- 88/118: Move some options out of globals, Ludovic Courtès, 2015/05/19
- 83/118: Call commonChildInit() before doing chroot init, Ludovic Courtès, 2015/05/19
- 84/118: Remove ugly hack for detecting build environment setup errors, Ludovic Courtès, 2015/05/19
- 85/118: Get rid of "killing <pid>" message for unused build hooks, Ludovic Courtès, 2015/05/19
- 93/118: Reduce verbosity, Ludovic Courtès, 2015/05/19
- 92/118: Propagate remote timeouts properly, Ludovic Courtès, 2015/05/19
- 87/118: Refactor, Ludovic Courtès, 2015/05/19