Skip to content

Commit

Permalink
Fix commercialhaskell#2886: include package names in the haddock cont…
Browse files Browse the repository at this point in the history
…ents.

It turned out that Haddock expects to see packages with those names
in the GHC package DB, and omits the names otherwise.  Pointing
Haddock to the local and snapshot DBs resolved the issue.
  • Loading branch information
judah committed Jun 21, 2017
1 parent aa063a5 commit 3c3e66c
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/Stack/Build/Haddock.hs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ generateLocalHaddockIndex envOverride wc bco localDumpPkgs locals = do
"local packages"
envOverride
wc
(boptsHaddockOpts (bcoBuildOpts bco))
bco
dumpPackages
"."
(localDocDir bco)
Expand All @@ -161,7 +161,7 @@ generateDepsHaddockIndex envOverride wc bco globalDumpPkgs snapshotDumpPkgs loca
"local packages and dependencies"
envOverride
wc
(boptsHaddockOpts (bcoBuildOpts bco))
bco
deps
".."
depDocDir
Expand Down Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3c3e66c

Please sign in to comment.