diff --git a/src/libstore/build.cc b/src/libstore/build.cc index d5fe41d1b..bdec30151 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}) :