From 7f5b750b401e98e9e2a346552aba5bd2e0a9203f Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 12 Jun 2017 16:07:34 +0200 Subject: 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). --- src/libstore/build.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/libstore/build.cc') 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(drv.get())) { printMsg(lvlChatty, format("executing pre-build hook ‘%1%’") % settings.preBuildHook); auto args = useChroot ? Strings({drvPath, chrootRootDir}) : -- cgit 1.4.1