about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-01-15T11·14+0100
committerEelco Dolstra <edolstra@gmail.com>2018-01-15T11·14+0100
commitba75c69e0014178cf524cc07427bb4e9eac333f7 (patch)
treef08b476f346b6ff400f8fe71ba9a7f0e6df32a44 /src/libstore/build.cc
parent53b520708a3c8677e70a70880ed3ec24f49fcd2b (diff)
Barf when using a diverted store on macOS
Fixes #1792.
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index d4bd650baf22..523d737d9bf8 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1810,8 +1810,13 @@ void DerivationGoal::startBuilder()
             useChroot = !fixedOutput && get(drv->env, "__noChroot") != "1";
     }
 
-    if (worker.store.storeDir != worker.store.realStoreDir)
-        useChroot = true;
+    if (worker.store.storeDir != worker.store.realStoreDir) {
+        #if __linux__
+            useChroot = true;
+        #else
+            throw Error("building using a diverted store is not supported on this platform");
+        #endif
+    }
 
     /* If `build-users-group' is not empty, then we have to build as
        one of the members of that group. */