From 33aabe07d42219a0cadb4fc5d652f4fedae0a460 Mon Sep 17 00:00:00 2001 From: Erik de Castro Lopo Date: Thu, 9 May 2024 17:12:17 +1000 Subject: [PATCH] Pass the exit code of the preBuildHook to the postBuildHook --- .../src/Distribution/Client/ProjectBuilding/UnpackedPackage.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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))