diff --git a/src/Stack/Build/Haddock.hs b/src/Stack/Build/Haddock.hs index 39404c9d47..4c719c9a0c 100644 --- a/src/Stack/Build/Haddock.hs +++ b/src/Stack/Build/Haddock.hs @@ -138,7 +138,7 @@ generateLocalHaddockIndex envOverride wc bco localDumpPkgs locals = do "local packages" envOverride wc - (boptsHaddockOpts (bcoBuildOpts bco)) + bco dumpPackages "." (localDocDir bco) @@ -161,7 +161,7 @@ generateDepsHaddockIndex envOverride wc bco globalDumpPkgs snapshotDumpPkgs loca "local packages and dependencies" envOverride wc - (boptsHaddockOpts (bcoBuildOpts bco)) + bco deps ".." depDocDir @@ -202,7 +202,7 @@ generateSnapHaddockIndex envOverride wc bco globalDumpPkgs snapshotDumpPkgs = "snapshot packages" envOverride wc - (boptsHaddockOpts (bcoBuildOpts bco)) + bco (Map.elems snapshotDumpPkgs ++ Map.elems globalDumpPkgs) "." (snapDocDir bco) @@ -213,12 +213,12 @@ generateHaddockIndex => Text -> EnvOverride -> WhichCompiler - -> HaddockOpts + -> BaseConfigOpts -> [DumpPackage () () ()] -> FilePath -> Path Abs Dir -> m () -generateHaddockIndex descr envOverride wc hdopts dumpPackages docRelFP destDir = do +generateHaddockIndex descr envOverride wc bco dumpPackages docRelFP destDir = do ensureDir destDir interfaceOpts <- (liftIO . fmap nubOrd . mapMaybeM toInterfaceOpt) dumpPackages unless (null interfaceOpts) $ do @@ -239,7 +239,9 @@ generateHaddockIndex descr envOverride wc hdopts dumpPackages docRelFP destDir = (Just destDir) envOverride (haddockExeName wc) - (hoAdditionalArgs hdopts ++ + (map (("--optghc=-package-db=" ++ ) . toFilePathNoTrailingSep) + [bcoSnapDB bco, bcoLocalDB bco] ++ + hoAdditionalArgs (boptsHaddockOpts (bcoBuildOpts bco)) ++ ["--gen-contents", "--gen-index"] ++ [x | (xs,_,_,_) <- interfaceOpts, x <- xs]) else