Cleanup moduleImportPaths now that file paths are normalized (#1980)

This commit is contained in:
Moritz Kiefer 2019-07-03 11:55:40 +02:00 committed by Gary Verhaegen
parent 27f547fd94
commit 2ba7d08ed6

View File

@ -184,11 +184,7 @@ moduleImportPaths :: GHC.ParsedModule -> Maybe FilePath
moduleImportPaths pm
| rootModDir == "." = Just rootPathDir
| otherwise =
-- TODO (MK) stripSuffix (normalise rootModDir) (normalise rootPathDir)
-- would be a better choice but at the moment we do not consistently
-- normalize file paths in the Shake graph so we can end up with the
-- same module being represented twice in the Shake graph.
Just $ dropTrailingPathSeparator $ dropEnd (length rootModDir) rootPathDir
dropTrailingPathSeparator <$> stripSuffix (normalise rootModDir) (normalise rootPathDir)
where
ms = GHC.pm_mod_summary pm
file = GHC.ms_hspp_file ms