about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEelco Dolstra <eelco.dolstra@logicblox.com>2012-07-31T21·56-0400
committerEelco Dolstra <eelco.dolstra@logicblox.com>2012-07-31T21·56-0400
commit89a8207029e7f6d5cfe3ab972c49ea46f5b9a784 (patch)
treef924e15d0fc6ec21a1f26376e6ca95141b08d9ba
parent97421eb5ecde86b75441094fda017b12b5eca2a6 (diff)
Add an option ‘build-fallback’ (equivalent to the --fallback flag)
-rw-r--r--doc/manual/conf-file.xml10
-rw-r--r--src/libmain/shared.cc2
-rw-r--r--src/libstore/globals.cc3
3 files changed, 13 insertions, 2 deletions
diff --git a/doc/manual/conf-file.xml b/doc/manual/conf-file.xml
index c73466ef5cf6..c19e44ebf608 100644
--- a/doc/manual/conf-file.xml
+++ b/doc/manual/conf-file.xml
@@ -246,6 +246,16 @@ flag, e.g. <literal>--option gc-keep-outputs false</literal>.</para>
   </varlistentry>
 
     
+  <varlistentry><term><literal>build-fallback</literal></term>
+
+    <listitem><para>If set to <literal>true</literal>, Nix will fall
+    back to building from source if a binary substitute fails.  This
+    is equivalent to the <option>--fallback</option> flag.  The
+    default is <literal>false</literal>.</para></listitem>
+
+  </varlistentry>
+
+    
   <varlistentry xml:id="conf-build-chroot-dirs"><term><literal>build-chroot-dirs</literal></term>
 
     <listitem><para>When builds are performed in a chroot environment,
diff --git a/src/libmain/shared.cc b/src/libmain/shared.cc
index 9c62e320f66e..e1280911b399 100644
--- a/src/libmain/shared.cc
+++ b/src/libmain/shared.cc
@@ -191,7 +191,7 @@ static void initAndRun(int argc, char * * argv)
         else if (arg == "--keep-going" || arg == "-k")
             settings.keepGoing = true;
         else if (arg == "--fallback")
-            settings.tryFallback = true;
+            settings.set("build-fallback", "true");
         else if (arg == "--max-jobs" || arg == "-j")
             settings.set("build-max-jobs", getArg(arg, i, args.end()));
         else if (arg == "--cores")
diff --git a/src/libstore/globals.cc b/src/libstore/globals.cc
index 7dc2e714bc9d..f5f4f15f011f 100644
--- a/src/libstore/globals.cc
+++ b/src/libstore/globals.cc
@@ -118,9 +118,10 @@ void Settings::set(const string & name, const string & value)
 
 void Settings::update()
 {
-    get(thisSystem, "system");
+    get(tryFallback, "build-fallback");
     get(maxBuildJobs, "build-max-jobs");
     get(buildCores, "build-cores");
+    get(thisSystem, "system");
     get(maxSilentTime, "build-max-silent-time");
     get(buildTimeout, "build-timeout");
     get(reservedSize, "gc-reserved-space");