[commit: ghc] wip/nfs-locking: Fix paths to generated Haskell files. (7274771)

git at git.haskell.org git at git.haskell.org
Thu Oct 26 23:31:33 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/7274771087702c22c23b94c27560de1199cb005f/ghc

>---------------------------------------------------------------

commit 7274771087702c22c23b94c27560de1199cb005f
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date:   Mon Dec 28 03:02:08 2015 +0000

    Fix paths to generated Haskell files.


>---------------------------------------------------------------

7274771087702c22c23b94c27560de1199cb005f
 src/Oracles/ModuleFiles.hs | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/Oracles/ModuleFiles.hs b/src/Oracles/ModuleFiles.hs
index 832deef..33f6138 100644
--- a/src/Oracles/ModuleFiles.hs
+++ b/src/Oracles/ModuleFiles.hs
@@ -21,8 +21,9 @@ moduleFiles stage pkg = do
 
 haskellModuleFiles :: Stage -> Package -> Action ([FilePath], [String])
 haskellModuleFiles stage pkg = do
-    let path    = targetPath stage pkg
-        autogen = path -/- "build/autogen"
+    let path        = targetPath stage pkg
+        autogen     = path -/- "build/autogen"
+        dropPkgPath = drop $ length (pkgPath pkg) + 1
     srcDirs <- fmap sort . pkgDataList $ SrcDirs path
     modules <- fmap sort . pkgDataList $ Modules path
     let dirs = [ pkgPath pkg -/- dir | dir <- srcDirs ]
@@ -31,9 +32,10 @@ haskellModuleFiles stage pkg = do
 
     let found          = foundSrcDirs ++ foundAutogen
         missingMods    = modules `minusOrd` (sort $ map fst found)
-        otherMods      = map (replaceEq '/' '.' . dropExtension) otherFiles
+        otherFileToMod = replaceEq '/' '.' . dropExtension . dropPkgPath
         (haskellFiles, otherFiles) = partition ("//*hs" ?==) (map snd found)
-    return (haskellFiles, missingMods ++ otherMods)
+
+    return (haskellFiles, missingMods ++ map otherFileToMod otherFiles)
 
 moduleFilesOracle :: Rules ()
 moduleFilesOracle = do



More information about the ghc-commits mailing list