[commit: ghc] wip/nfs-locking: Print more diagnostic info. (0ad3af2)
git at git.haskell.org
git at git.haskell.org
Thu Oct 26 23:21:58 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/0ad3af27554bdaa8ba765353ca53256d4f342f32/ghc
>---------------------------------------------------------------
commit 0ad3af27554bdaa8ba765353ca53256d4f342f32
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Tue Jan 13 04:05:59 2015 +0000
Print more diagnostic info.
>---------------------------------------------------------------
0ad3af27554bdaa8ba765353ca53256d4f342f32
src/Oracles.hs | 1 +
src/Oracles/PackageData.hs | 2 ++
src/Package/Library.hs | 16 ++++++++++++----
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/src/Oracles.hs b/src/Oracles.hs
index 3a0c430..5b2ff11 100644
--- a/src/Oracles.hs
+++ b/src/Oracles.hs
@@ -49,6 +49,7 @@ packageDataOracle :: Rules ()
packageDataOracle = do
pkgData <- newCache $ \file -> do
need [file]
+ putNormal $ "Parsing " ++ file ++ "..."
liftIO $ readConfigFile file
addOracle $ \(PackageDataKey (file, key)) -> M.lookup key <$> pkgData file
return ()
diff --git a/src/Oracles/PackageData.hs b/src/Oracles/PackageData.hs
index 6bffafd..66a3f55 100644
--- a/src/Oracles/PackageData.hs
+++ b/src/Oracles/PackageData.hs
@@ -18,6 +18,7 @@ data PackageData = Modules FilePath
| IncludeDirs FilePath
| Deps FilePath
| DepKeys FilePath
+ | Synopsis FilePath
instance ShowArgs PackageData where
showArgs packageData = do
@@ -28,6 +29,7 @@ instance ShowArgs PackageData where
IncludeDirs file -> ("INCLUDE_DIRS", file, ".")
Deps file -> ("DEPS" , file, "" )
DepKeys file -> ("DEP_KEYS" , file, "" )
+ Synopsis file -> ("SYNOPSIS" , file, "" )
fullKey = replaceSeparators '_' $ takeDirectory file ++ "_" ++ key
res <- askOracle $ PackageDataKey (file, fullKey)
return $ words $ case res of
diff --git a/src/Package/Library.hs b/src/Package/Library.hs
index 0c2e1f8..6660a2f 100644
--- a/src/Package/Library.hs
+++ b/src/Package/Library.hs
@@ -5,14 +5,16 @@ import Package.Base
{- "/usr/bin/ar" q
libraries/deepseq/dist-install/build/libHSdeeps_FT5iVCELxOr62eHY0nbvnU.a
- at libraries/deepseq/dist-install/build/libHSdeeps_FT5iVCELxOr62eHY0nbvnU.a.contents
+ at libraries/deepseq/dist-install/build/libHSdeeps_FT5iVCELxOr62eHY0nbvnU.a
+.contents
-}
--- "$$(XARGS)" $$(XARGS_OPTS) "$$($1_$2_AR)" $$($1_$2_AR_OPTS) $$($1_$2_EXTRA_AR_ARGS) $$@ < $$@.contents
+-- "$$(XARGS)" $$(XARGS_OPTS) "$$($1_$2_AR)" $$($1_$2_AR_OPTS)
+-- $$($1_$2_EXTRA_AR_ARGS) $$@ < $$@.contents
-- AR_OPTS = $(SRC_AR_OPTS) $(WAY$(_way)_AR_OPTS) $(EXTRA_AR_OPTS)
buildPackageLibrary :: Package -> TodoItem -> Rules ()
-buildPackageLibrary (Package _ path _) (stage, dist, _) =
+buildPackageLibrary (Package name path _) (stage, dist, _) =
let buildDir = path </> dist </> "build"
pkgData = path </> dist </> "package-data.mk"
in
@@ -22,5 +24,11 @@ buildPackageLibrary (Package _ path _) (stage, dist, _) =
depObjs <- pkgDepObjects path dist way
need depObjs
libObjs <- pkgLibObjects path dist stage way
- liftIO $ removeFiles "" [out]
+ liftIO $ removeFiles "." [out]
terseRun Ar $ arArgs <+> out <+> libObjs
+ when (way == vanilla) $ do
+ synopsis <- unwords <$> arg (Synopsis pkgData)
+ putNormal $ "Successfully built library for package "
+ ++ name ++ "."
+ putNormal $ "Synopsis: " ++ synopsis ++ "."
+
More information about the ghc-commits
mailing list