forked from lix-project/lix
libstore: make LocalDerivationGoal::needsHashRewrite virtual
This rather simple function existed just to check some flags,
but the response varies by platform. This is a perfect case for
our subclasses.
Change-Id: Ieb1732a8d024019236e0d0028ad843a24ec3dc59
This commit is contained in:
parent
55a32f24d3
commit
d461cc1d7b
|
@ -117,14 +117,9 @@ LocalDerivationGoal::~LocalDerivationGoal() noexcept(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline bool LocalDerivationGoal::needsHashRewrite()
|
bool LocalDerivationGoal::needsHashRewrite()
|
||||||
{
|
{
|
||||||
#if __linux__
|
|
||||||
return !useChroot;
|
return !useChroot;
|
||||||
#else
|
|
||||||
/* Darwin requires hash rewriting even when sandboxing is enabled. */
|
|
||||||
return true;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -206,7 +206,7 @@ struct LocalDerivationGoal : public DerivationGoal
|
||||||
/**
|
/**
|
||||||
* Whether we need to perform hash rewriting if there are valid output paths.
|
* Whether we need to perform hash rewriting if there are valid output paths.
|
||||||
*/
|
*/
|
||||||
bool needsHashRewrite();
|
virtual bool needsHashRewrite();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The additional states.
|
* The additional states.
|
||||||
|
|
|
@ -52,6 +52,13 @@ private:
|
||||||
* Set process flags to enter or leave rosetta, then execute the builder
|
* Set process flags to enter or leave rosetta, then execute the builder
|
||||||
*/
|
*/
|
||||||
void execBuilder(std::string builder, Strings args, Strings envStrs) override;
|
void execBuilder(std::string builder, Strings args, Strings envStrs) override;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether we need to rewrite output hashes.
|
||||||
|
* Always true on Darwin since Darwin requires hash rewriting
|
||||||
|
* even when sandboxing is enabled.
|
||||||
|
*/
|
||||||
|
bool needsHashRewrite() override { return true; };
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue