[commit: ghc] wip/nfs-locking: Fix file names for package names with slashes (e.g. Cabal/Cabal). (f124e23)
git at git.haskell.org
git at git.haskell.org
Thu Oct 26 23:06:30 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/f124e23635f6fa05edc945e4b0200acc0e57d8c2/ghc
>---------------------------------------------------------------
commit f124e23635f6fa05edc945e4b0200acc0e57d8c2
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Wed Jan 14 04:02:44 2015 +0000
Fix file names for package names with slashes (e.g. Cabal/Cabal).
>---------------------------------------------------------------
f124e23635f6fa05edc945e4b0200acc0e57d8c2
src/Package/Data.hs | 3 ++-
src/Package/Dependencies.hs | 2 +-
2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/Package/Data.hs b/src/Package/Data.hs
index d3b13a5..c5d3bd2 100644
--- a/src/Package/Data.hs
+++ b/src/Package/Data.hs
@@ -59,6 +59,7 @@ buildPackageData :: Package -> TodoItem -> Rules ()
buildPackageData (Package name path _) (stage, dist, settings) =
let pathDist = path </> dist
configure = path </> "configure"
+ cabal = path </> takeBaseName name <.> "cabal"
cabalArgs = arg ["configure", path, dist]
-- this is a positional argument, hence:
-- * if it is empty, we need to emit one empty string argument
@@ -91,7 +92,7 @@ buildPackageData (Package name path _) (stage, dist, settings) =
-- , "build" </> "autogen" </> ("Paths_" ++ name) <.> "hs"
] &%> \_ -> do
need ["shake/src/Package/Data.hs"]
- need [path </> name <.> "cabal"]
+ need [cabal]
when (doesFileExist $ configure <.> "ac") $ need [configure]
terseRun GhcCabal cabalArgs
when (registerPackage settings) $ terseRun (GhcPkg stage) ghcPkgArgs
diff --git a/src/Package/Dependencies.hs b/src/Package/Dependencies.hs
index e428371..1d3a8d2 100644
--- a/src/Package/Dependencies.hs
+++ b/src/Package/Dependencies.hs
@@ -8,7 +8,7 @@ buildPackageDependencies (Package name path _) (stage, dist, settings) =
let buildDir = toStandard $ path </> dist </> "build"
pkgData = path </> dist </> "package-data.mk"
in
- (buildDir </> name <.> "m") %> \out -> do
+ (buildDir </> takeBaseName name <.> "m") %> \out -> do
need ["shake/src/Package/Dependencies.hs"]
terseRun (Ghc stage) $ arg "-M"
<> packageArgs stage pkgData
More information about the ghc-commits
mailing list