guix-commits
[Top][All Lists]
Advanced

[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;
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]