Use nix::willBuildLocally()

This commit is contained in:
Eelco Dolstra
2015-10-21 15:44:29 +02:00
parent 30823078c4
commit 71bf7e02d5
3 changed files with 3 additions and 11 deletions

View File

@ -1,6 +1,7 @@
#include "state.hh"
#include "build-result.hh"
#include "globals.hh"
#include "misc.hh"
using namespace nix;
@ -358,10 +359,7 @@ Step::ptr State::createStep(std::shared_ptr<StoreAPI> store,
runnable while step->created == false. */
step->drv = readDerivation(drvPath);
auto attr = step->drv.env.find("preferLocalBuild");
step->preferLocalBuild =
attr != step->drv.env.end() && attr->second == "1"
&& has(localPlatforms, step->drv.platform);
step->preferLocalBuild = willBuildLocally(step->drv);
step->systemType = step->drv.platform;
{