build-hook: Allow empty

Like always declining; local builds only, as can be inferred from the
docs. (Not worth spending too many words on this pretty obvious
behavior, I think. Also, plans to remove it? https://github.com/NixOS/nix/issues/1221)
This commit is contained in:
Robert Hensing 2024-04-07 16:31:57 +02:00
parent c145ce0e1a
commit ed13cf05a2

View file

@ -1138,7 +1138,7 @@ void DerivationGoal::resolvedFinished()
HookReply DerivationGoal::tryBuildHook()
{
if (!worker.tryBuildHook || !useDerivation) return rpDecline;
if (settings.buildHook.get().empty() || !worker.tryBuildHook || !useDerivation) return rpDecline;
if (!worker.hook)
worker.hook = std::make_unique<HookInstance>();