diff --git a/src/libstore/build/local-derivation-goal.cc b/src/libstore/build/local-derivation-goal.cc index 6a298e6eb..d523ef51f 100644 --- a/src/libstore/build/local-derivation-goal.cc +++ b/src/libstore/build/local-derivation-goal.cc @@ -117,14 +117,9 @@ LocalDerivationGoal::~LocalDerivationGoal() noexcept(false) } -inline bool LocalDerivationGoal::needsHashRewrite() +bool LocalDerivationGoal::needsHashRewrite() { -#if __linux__ return !useChroot; -#else - /* Darwin requires hash rewriting even when sandboxing is enabled. */ - return true; -#endif } diff --git a/src/libstore/build/local-derivation-goal.hh b/src/libstore/build/local-derivation-goal.hh index 727a7f406..4ac18b974 100644 --- a/src/libstore/build/local-derivation-goal.hh +++ b/src/libstore/build/local-derivation-goal.hh @@ -206,7 +206,7 @@ struct LocalDerivationGoal : public DerivationGoal /** * Whether we need to perform hash rewriting if there are valid output paths. */ - bool needsHashRewrite(); + virtual bool needsHashRewrite(); /** * The additional states. diff --git a/src/libstore/platform/darwin.hh b/src/libstore/platform/darwin.hh index 70e8a8587..111d50d87 100644 --- a/src/libstore/platform/darwin.hh +++ b/src/libstore/platform/darwin.hh @@ -52,6 +52,13 @@ private: * Set process flags to enter or leave rosetta, then execute the builder */ 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; }; }; }