@@ -82,7 +82,7 @@ import Stack.Coverage ( generateHpcReport, updateTixFile )
8282import Stack.GhcPkg ( ghcPkg , ghcPkgPathEnvVar , unregisterGhcPkgIds )
8383import Stack.Package
8484 ( buildLogPath , buildableExes , buildableSubLibs
85- , hasBuildableMainLibrary , mainLibraryHasExposedModules
85+ , hasBuildableMainLibrary
8686 )
8787import Stack.PackageDump ( conduitDumpPackage , ghcPkgDescribe )
8888import Stack.Prelude
@@ -347,8 +347,10 @@ announceTask ee taskType action = logInfo $
347347
348348-- | Implements running a package's build, used to implement
349349-- 'Control.Concurrent.Execute.ATBuild' and
350- -- 'Control.Concurrent.Execute.ATBuildFinal' tasks. In particular this does the
351- -- following:
350+ -- 'Control.Concurrent.Execute.ATBuildFinal' tasks. The latter is a task for
351+ -- building a package's benchmarks and test-suites.
352+ --
353+ -- In particular this does the following:
352354--
353355-- * Checks if the package exists in the precompiled cache, and if so, add it to
354356-- the database instead of performing the build.
@@ -471,12 +473,9 @@ realConfigAndBuild
471473 where
472474 pkgId = taskProvides task
473475 PackageIdentifier pname _ = pkgId
474- doHaddock curator package =
476+ doHaddock curator =
475477 task. buildHaddocks
476478 && not isFinalBuild
477- -- Works around haddock failing on bytestring-builder since it has no
478- -- modules when bytestring is new enough.
479- && mainLibraryHasExposedModules package
480479 -- Special help for the curator tool to avoid haddocks that are known
481480 -- to fail
482481 && maybe True (Set. notMember pname . (. skipHaddock)) curator
@@ -593,7 +592,7 @@ realConfigAndBuild
593592 postBuildCheck True
594593
595594 mcurator <- view $ buildConfigL . to (. curator)
596- when (doHaddock mcurator package ) $ do
595+ when (doHaddock mcurator) $ do
597596 let isTaskTargetMutable = taskTargetIsMutable task == Mutable
598597 isHaddockForHackage =
599598 ee. buildOpts. haddockForHackage && isTaskTargetMutable
0 commit comments