1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 08:31:16 +02:00

Move structured attrs handling into a separate class

This is primarily because Derivation::{can,will}BuildLocally() depends
on attributes like preferLocalBuild and requiredSystemFeatures, but it
can't handle them properly because it doesn't have access to the
structured attributes.
This commit is contained in:
Eelco Dolstra 2018-09-28 14:31:16 +02:00
parent 99d4bb2d4c
commit 7ae7a38c9a
No known key found for this signature in database
GPG key ID: 8170B4726D7198DE
5 changed files with 145 additions and 116 deletions

View file

@ -36,12 +36,6 @@ Path BasicDerivation::findOutput(const string & id) const
}
bool BasicDerivation::willBuildLocally() const
{
return get(env, "preferLocalBuild") == "1" && canBuildLocally();
}
bool BasicDerivation::substitutesAllowed() const
{
return get(env, "allowSubstitutes", "1") == "1";
@ -54,14 +48,6 @@ bool BasicDerivation::isBuiltin() const
}
bool BasicDerivation::canBuildLocally() const
{
return platform == settings.thisSystem
|| settings.extraPlatforms.get().count(platform) > 0
|| isBuiltin();
}
Path writeDerivation(ref<Store> store,
const Derivation & drv, const string & name, RepairFlag repair)
{