about summary refs log tree commit diff
path: root/src/libstore/build.cc
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2017-06-12T14·07+0200
committerEelco Dolstra <edolstra@gmail.com>2017-06-12T14·07+0200
commit7f5b750b401e98e9e2a346552aba5bd2e0a9203f (patch)
tree7321ec3b328282126a30792a80c8c8fa682e89e8 /src/libstore/build.cc
parent186571965dccf57d15b9f37c1cca92a57187b7b3 (diff)
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).
Diffstat (limited to 'src/libstore/build.cc')
-rw-r--r--src/libstore/build.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libstore/build.cc b/src/libstore/build.cc
index d5fe41d1b165..bdec30151b08 100644
--- a/src/libstore/build.cc
+++ b/src/libstore/build.cc
@@ -1950,7 +1950,7 @@ void DerivationGoal::startBuilder()
                 }
     }
 
-    if (settings.preBuildHook != "") {
+    if (useChroot && settings.preBuildHook != "" && dynamic_cast<Derivation *>(drv.get())) {
         printMsg(lvlChatty, format("executing pre-build hook ‘%1%’")
             % settings.preBuildHook);
         auto args = useChroot ? Strings({drvPath, chrootRootDir}) :