Commit 9e59b862 authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Fixup haddock backpack support

1) Bugfix so that we get library source files from the correct
   directories (it was wrong previously; it only ever looked
   in the library directory)
2) Search for hsig/lhsig files when looking for source files
parent fa79bdf0
......@@ -729,10 +729,10 @@ getLibSourceFiles :: LocalBuildInfo
getLibSourceFiles lbi lib clbi = getSourceFiles searchpaths modules
where
bi = libBuildInfo lib
modules = PD.exposedModules lib ++ otherModules bi
searchpaths = autogenComponentModulesDir lbi clbi
: autogenPackageModulesDir lbi
: buildDir lbi : hsSourceDirs bi
modules = allLibModules lib clbi
searchpaths = componentBuildDir lbi clbi : hsSourceDirs bi ++
[ autogenComponentModulesDir lbi clbi
, autogenPackageModulesDir lbi ]
getExeSourceFiles :: LocalBuildInfo
-> Executable
......@@ -753,10 +753,10 @@ getSourceFiles :: [FilePath]
-> [ModuleName.ModuleName]
-> IO [(ModuleName.ModuleName, FilePath)]
getSourceFiles dirs modules = flip traverse modules $ \m -> fmap ((,) m) $
findFileWithExtension ["hs", "lhs"] dirs (ModuleName.toFilePath m)
findFileWithExtension ["hs", "lhs", "hsig", "lhsig"] dirs (ModuleName.toFilePath m)
>>= maybe (notFound m) (return . normalise)
where
notFound module_ = die $ "can't find source for module " ++ display module_
notFound module_ = die $ "haddock: can't find source for module " ++ display module_
-- | The directory where we put build results for an executable
exeBuildDir :: LocalBuildInfo -> Executable -> FilePath
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment