Add an option ‘build-fallback’ (equivalent to the --fallback flag)

This commit is contained in:
Eelco Dolstra 2012-07-31 17:56:02 -04:00
parent 97421eb5ec
commit 89a8207029
3 changed files with 13 additions and 2 deletions

View File

@ -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,

View File

@ -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")

View File

@ -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");