@@ -936,6 +936,13 @@ buildAndInstallUnpackedPackage verbosity
936
936
annotateFailure mlogFile BuildFailed $
937
937
setup buildCommand buildFlags
938
938
939
+ -- Haddock phase
940
+ whenHaddock $ do
941
+ when isParallelBuild $
942
+ notice verbosity $ " Generating " ++ dispname ++ " documentation..."
943
+ annotateFailureNoLog HaddocksFailed $
944
+ setup haddockCommand haddockFlags
945
+
939
946
-- Install phase
940
947
annotateFailure mlogFile InstallFailed $ do
941
948
@@ -954,7 +961,7 @@ buildAndInstallUnpackedPackage verbosity
954
961
-- While this breaks the prefix-relocatable property of the lirbaries
955
962
-- it is necessary on macOS to stay under the load command limit of the
956
963
-- macOS mach-o linker. See also @PackageHash.hashedInstalledPackageIdVeryShort@.
957
- otherFiles <- filter (not . isPrefixOf entryDir) <$> listFilesRecursive tmpDir
964
+ otherFiles <- filter (not . isPrefixOf entryDir) <$> listFilesRecursive tmpDir
958
965
-- here's where we could keep track of the installed files ourselves
959
966
-- if we wanted to by making a manifest of the files in the tmp dir
960
967
return (entryDir, otherFiles)
@@ -1022,6 +1029,10 @@ buildAndInstallUnpackedPackage verbosity
1022
1029
1023
1030
isParallelBuild = buildSettingNumJobs >= 2
1024
1031
1032
+ whenHaddock action
1033
+ | elabBuildHaddocks pkg = action
1034
+ | otherwise = return ()
1035
+
1025
1036
configureCommand = Cabal. configureCommand defaultProgramDb
1026
1037
configureFlags v = flip filterConfigureFlags v $
1027
1038
setupHsConfigureFlags rpkg pkgshared
@@ -1031,6 +1042,10 @@ buildAndInstallUnpackedPackage verbosity
1031
1042
buildCommand = Cabal. buildCommand defaultProgramDb
1032
1043
buildFlags _ = setupHsBuildFlags pkg pkgshared verbosity builddir
1033
1044
1045
+ haddockCommand = Cabal. haddockCommand
1046
+ haddockFlags _ = setupHsHaddockFlags pkg pkgshared
1047
+ verbosity builddir
1048
+
1034
1049
generateInstalledPackageInfo :: IO InstalledPackageInfo
1035
1050
generateInstalledPackageInfo =
1036
1051
withTempInstalledPackageInfoFile
0 commit comments