[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
112/376: Add option ‘build-extra-chroot-dirs’
From: |
Ludovic Courtès |
Subject: |
112/376: Add option ‘build-extra-chroot-dirs’ |
Date: |
Wed, 28 Jan 2015 22:04:24 +0000 |
civodul pushed a commit to tag 1.8
in repository guix.
commit d5a076c36f6588366fd9766c1054807bbbfd8559
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.
---
release.nix | 2 +-
src/libstore/build.cc | 11 +++++++----
src/libstore/globals.cc | 4 ----
src/libstore/globals.hh | 4 ----
src/libstore/local.mk | 3 ++-
5 files changed, 10 insertions(+), 14 deletions(-)
diff --git a/release.nix b/release.nix
index c439257..bc4c06a 100644
--- a/release.nix
+++ b/release.nix
@@ -98,7 +98,7 @@ let
preHook = lib.optionalString stdenv.isLinux (
let sh = stdenv.shell; in
''
- NIX_CFLAGS_COMPILE+=" -DDEFAULT_CHROOT_DIRS=\"/bin/sh=${sh}:$(tr
'\n' ':' < ${writeReferencesToFile sh})\""
+ export DEFAULT_CHROOT_DIRS="/bin/sh=${sh} $(tr '\n' ' ' <
${writeReferencesToFile sh})"
'');
enableParallelBuilding = true;
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index e3d96d9..5c67222 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1792,12 +1792,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/src/libstore/globals.cc b/src/libstore/globals.cc
index 77f2500..3e8c2c6 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -48,9 +48,6 @@ Settings::Settings()
useSubstitutes = true;
buildUsersGroup = getuid() == 0 ? "nixbld" : "";
useChroot = false;
-#ifdef DEFAULT_CHROOT_DIRS
- dirsInChroot = tokenizeString<StringSet>(DEFAULT_CHROOT_DIRS, ":");
-#endif
useSshSubstituter = true;
impersonateLinux26 = false;
keepLog = true;
@@ -148,7 +145,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/src/libstore/globals.hh b/src/libstore/globals.hh
index d16969c..c3baca2 100644
--- a/src/libstore/globals.hh
+++ b/src/libstore/globals.hh
@@ -144,10 +144,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;
diff --git a/src/libstore/local.mk b/src/libstore/local.mk
index 64dbfa3..180088d 100644
--- a/src/libstore/local.mk
+++ b/src/libstore/local.mk
@@ -21,7 +21,8 @@ libstore_CXXFLAGS = \
-DNIX_LOG_DIR=\"$(localstatedir)/log/nix\" \
-DNIX_CONF_DIR=\"$(sysconfdir)/nix\" \
-DNIX_LIBEXEC_DIR=\"$(libexecdir)\" \
- -DNIX_BIN_DIR=\"$(bindir)\"
+ -DNIX_BIN_DIR=\"$(bindir)\" \
+ -DDEFAULT_CHROOT_DIRS="\"$(DEFAULT_CHROOT_DIRS)\""
$(d)/local-store.cc: $(d)/schema.sql.hh
- 106/376: Eliminate redundant copy, (continued)
- 106/376: Eliminate redundant copy, Ludovic Courtès, 2015/01/28
- 110/376: Make chroot builds easier to set up, Ludovic Courtès, 2015/01/28
- 109/376: Speed up nix-shell, Ludovic Courtès, 2015/01/28
- 121/376: nix-install-package: Use extra-binary-caches, Ludovic Courtès, 2015/01/28
- 119/376: Add support for order-only dependencies, Ludovic Courtès, 2015/01/28
- 118/376: install-nix-from-closure.sh: Use https channel if possible, Ludovic Courtès, 2015/01/28
- 114/376: Refactor, Ludovic Courtès, 2015/01/28
- 117/376: Remove unnecessary call to addTempRoot(), Ludovic Courtès, 2015/01/28
- 115/376: Move some options out of globals, Ludovic Courtès, 2015/01/28
- 116/376: Doh, Ludovic Courtès, 2015/01/28
- 112/376: Add option ‘build-extra-chroot-dirs’,
Ludovic Courtès <=
- 111/376: Get rid of "killing <pid>" message for unused build hooks, Ludovic Courtès, 2015/01/28
- 129/376: Remove log2html.xsl and friends, Ludovic Courtès, 2015/01/28
- 122/376: Warn about untrusted binary caches in extra-binary-caches, Ludovic Courtès, 2015/01/28
- 113/376: Update manual, Ludovic Courtès, 2015/01/28
- 126/376: Handle compound single dash options properly, Ludovic Courtès, 2015/01/28
- 124/376: Fix warning about non-existant -I directories, Ludovic Courtès, 2015/01/28
- 127/376: Use regular file GC roots if possible, Ludovic Courtès, 2015/01/28
- 128/376: nix-log2xml: Handle UTF-8 characters, Ludovic Courtès, 2015/01/28
- 132/376: nix-shell: Use $XDG_RUNTIME_DIR, Ludovic Courtès, 2015/01/28
- 120/376: download-from-binary-cache.pl: Respect $SSL_CERT_FILE, Ludovic Courtès, 2015/01/28