Skip to content

Commit

Permalink
Always do the runBuild step )see comments)
Browse files Browse the repository at this point in the history
  • Loading branch information
erikd committed May 9, 2024
1 parent ffa9b5e commit 98b6d7f
Showing 1 changed file with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
code <-
void $
rawSystemExitCode
verbosity
(Just srcdir)
Expand All @@ -691,9 +691,12 @@ buildAndInstallUnpackedPackage
, (getSymbolicPath builddir)
]
Nothing
`catchIO` (\_ -> return (ExitFailure 10))
when (code /= ExitSuccess) $ do
runBuild
`catchIO` (\_ -> pure (ExitFailure 10))
-- Regardless of whether the preBuildHook exists or not, or whether it returned an
-- error or not, we want to run the build command.
-- If the preBuildHook downloads a cached version of the build products, the following
-- should be a NOOP.
runBuild
-- not sure, if we want to care about a failed postBuildHook?
void $
rawSystemExitCode
Expand All @@ -705,7 +708,7 @@ buildAndInstallUnpackedPackage
, (getSymbolicPath builddir)
]
Nothing
`catchIO` (\_ -> return (ExitFailure 10))
`catchIO` (\_ -> pure (ExitFailure 10))
PBHaddockPhase{runHaddock} -> do
noticeProgress ProgressHaddock
runHaddock
Expand Down

0 comments on commit 98b6d7f

Please sign in to comment.