aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libstore/build.cc5
-rw-r--r--src/libstore/globals.cc2
-rw-r--r--tests/recursive.sh4
3 files changed, 8 insertions, 3 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index e8b23d396..e77512ca4 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -2248,7 +2248,8 @@ void DerivationGoal::startBuilder()
/* Fire up a Nix daemon to process recursive Nix calls from the
builder. */
- startDaemon();
+ if (parsedDrv->getRequiredSystemFeatures().count("recursive-nix"))
+ startDaemon();
/* Run the builder. */
printMsg(lvlChatty, format("executing builder '%1%'") % drv->builder);
@@ -2832,6 +2833,8 @@ struct RestrictedStore : public LocalFSStore
void DerivationGoal::startDaemon()
{
+ settings.requireExperimentalFeature("recursive-nix");
+
Store::Params params;
params["path-info-cache-size"] = "0";
params["store"] = worker.store.storeDir;
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index 249c36673..042aaea95 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -95,7 +95,7 @@ StringSet Settings::getDefaultSystemFeatures()
/* For backwards compatibility, accept some "features" that are
used in Nixpkgs to route builds to certain machines but don't
actually require anything special on the machines. */
- StringSet features{"nixos-test", "benchmark", "big-parallel"};
+ StringSet features{"nixos-test", "benchmark", "big-parallel", "recursive-nix"};
#if __linux__
if (access("/dev/kvm", R_OK | W_OK) == 0)
diff --git a/tests/recursive.sh b/tests/recursive.sh
index 25204caf1..62896c015 100644
--- a/tests/recursive.sh
+++ b/tests/recursive.sh
@@ -4,7 +4,7 @@ clearStore
export unreachable=$(nix add-to-store ./recursive.sh)
-nix build -o $TEST_ROOT/result -L '(
+nix --experimental-features 'nix-command recursive-nix' build -o $TEST_ROOT/result -L '(
with import ./config.nix;
with import <nix/config.nix>;
mkDerivation {
@@ -15,6 +15,8 @@ nix build -o $TEST_ROOT/result -L '(
# Note: this is a string without context.
unreachable = builtins.getEnv "unreachable";
+ requiredSystemFeatures = [ "recursive-nix" ];
+
buildCommand = '\'\''
mkdir $out
PATH=${nixBinDir}:$PATH