diff options
author | Matthew Bauer <mjbauer95@gmail.com> | 2022-09-02 11:46:34 -0500 |
---|---|---|
committer | Matthew Bauer <mjbauer95@gmail.com> | 2022-09-02 11:46:34 -0500 |
commit | 4894e567fb27c02866abd75f59da740efa6c33a5 (patch) | |
tree | b05e2d6ea91b123d406eb93958ae224307796b91 | |
parent | a9af12e658f0ea3f30515079f191bd4c1057ad7b (diff) |
Don’t readDerivation if impure derivations feature is disabled
readDerivation is pretty slow, and while it may not be significant for
some use cases, on things like ghc-nix where we have thousands of
derivations is really slows things down.
So, this just doesn’t do the impure derivation check if the impure
derivation experimental feature is disabled. Perhaps we could cache
the result of isPure() and keep the check, but this is a quick fix to
for the slowdown introduced with impure derivations features in 2.8.0.
-rw-r--r-- | src/libstore/build/derivation-goal.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstore/build/derivation-goal.cc b/src/libstore/build/derivation-goal.cc index 83da657f0..41d2e2a1c 100644 --- a/src/libstore/build/derivation-goal.cc +++ b/src/libstore/build/derivation-goal.cc @@ -344,7 +344,7 @@ void DerivationGoal::gaveUpOnSubstitution() for (auto & i : dynamic_cast<Derivation *>(drv.get())->inputDrvs) { /* Ensure that pure, non-fixed-output derivations don't depend on impure derivations. */ - if (drv->type().isPure() && !drv->type().isFixed()) { + if (settings.isExperimentalFeatureEnabled(Xp::ImpureDerivations) && drv->type().isPure() && !drv->type().isFixed()) { auto inputDrv = worker.evalStore.readDerivation(i.first); if (!inputDrv.type().isPure()) throw Error("pure derivation '%s' depends on impure derivation '%s'", |