[commit: ghc] wip/nfs-locking: Match generator sources exactly, see #69 and #70. (6c80bd8)
git at git.haskell.org
git at git.haskell.org
Thu Oct 26 23:34:00 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/6c80bd874eb2d4ca9607009dcf33eedbe011d5cd/ghc
>---------------------------------------------------------------
commit 6c80bd874eb2d4ca9607009dcf33eedbe011d5cd
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Thu Dec 31 19:01:38 2015 +0000
Match generator sources exactly, see #69 and #70.
>---------------------------------------------------------------
6c80bd874eb2d4ca9607009dcf33eedbe011d5cd
src/Rules/Generate.hs | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/Rules/Generate.hs b/src/Rules/Generate.hs
index fd101a1..b53b2b8 100644
--- a/src/Rules/Generate.hs
+++ b/src/Rules/Generate.hs
@@ -83,11 +83,13 @@ generate file target expr = do
generatePackageCode :: Resources -> PartialTarget -> Rules ()
generatePackageCode _ target @ (PartialTarget stage pkg) =
let buildPath = targetPath stage pkg -/- "build"
+ dropBuild = drop (length buildPath + 1)
generated f = (buildPath ++ "//*.hs") ?== f && not ("//autogen/*" ?== f)
file <~ gen = generate file target gen
in do
generated ?> \file -> do
- let pattern = "//" ++ takeBaseName file <.> "*"
+ let srcFile = dropBuild file
+ pattern = "//" ++ srcFile <.> "*"
files <- fmap (filter (pattern ?==)) $ moduleFiles stage pkg
let gens = [ (f, b) | f <- files, Just b <- [determineBuilder f] ]
when (length gens /= 1) . putError $
More information about the ghc-commits
mailing list