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:
parent
99d4bb2d4c
commit
7ae7a38c9a
5 changed files with 145 additions and 116 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue