diff --git a/nix/libstore/build.cc b/nix/libstore/build.cc index d68e8b2bc..03a8f5080 100644 --- a/nix/libstore/build.cc +++ b/nix/libstore/build.cc @@ -1034,8 +1034,10 @@ void DerivationGoal::haveDerivation() /* We are first going to try to create the invalid output paths through substitutes. If that doesn't work, we'll build - them. */ - if (settings.useSubstitutes && substitutesAllowed(drv)) + them. Always enable substitutes for fixed-output derivations to + protect against disappearing files and in-place modifications on + upstream sites. */ + if ((fixedOutput || settings.useSubstitutes) && substitutesAllowed(drv)) foreach (PathSet::iterator, i, invalidOutputs) addWaitee(worker.makeSubstitutionGoal(*i, buildMode == bmRepair));