diff --git a/cabal-install/src/Distribution/Client/ProjectBuilding/UnpackedPackage.hs b/cabal-install/src/Distribution/Client/ProjectBuilding/UnpackedPackage.hs index 2f7ee3ea87a..2c9a38ad2df 100644 --- a/cabal-install/src/Distribution/Client/ProjectBuilding/UnpackedPackage.hs +++ b/cabal-install/src/Distribution/Client/ProjectBuilding/UnpackedPackage.hs @@ -681,7 +681,7 @@ buildAndInstallUnpackedPackage hooksDir <- ( "cabalHooks") <$> getCurrentDirectory -- run preBuildHook. If it returns with 0, we assume the build was -- successful. If not, run the build. - void $ + preCode <- rawSystemExitCode verbosity (Just srcdir) @@ -706,6 +706,7 @@ buildAndInstallUnpackedPackage [ (unUnitId $ installedUnitId rpkg) , (getSymbolicPath srcdir) , (getSymbolicPath builddir) + , show preCode ] Nothing `catchIO` (\_ -> pure (ExitFailure 10))