From 0be5b949d3b3dd2e14f1e356e7a64f5906fe66dc Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 12 Jun 2017 16:07:34 +0200 Subject: [PATCH] Don't run pre-build-hook if we don't have a derivation This fixes a build failure on OS X when using Hydra or Nix 1.12's build-remote (since they don't copy the derivation to the build machine). (cherry picked from commit 7f5b750b401e98e9e2a346552aba5bd2e0a9203f) --- src/libstore/build.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstore/build.cc b/src/libstore/build.cc index 892b097f..9f9dbde8 100644 --- a/src/libstore/build.cc +++ b/src/libstore/build.cc @@ -2121,7 +2121,7 @@ void DerivationGoal::startBuilder() } } - if (settings.preBuildHook != "") { + if (useChroot && settings.preBuildHook != "" && dynamic_cast(drv.get())) { printMsg(lvlChatty, format("executing pre-build hook ‘%1%’") % settings.preBuildHook); auto args = useChroot ? Strings({drvPath, chrootRootDir}) :