[commit: ghc] wip/nfs-locking: Filter out repeated ways when copying libffi (b94612d)
git at git.haskell.org
git at git.haskell.org
Fri Oct 27 00:48:50 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : wip/nfs-locking
Link : http://ghc.haskell.org/trac/ghc/changeset/b94612d33b8febed57d26bc696c9454b883f4aed/ghc
>---------------------------------------------------------------
commit b94612d33b8febed57d26bc696c9454b883f4aed
Author: Andrey Mokhov <andrey.mokhov at gmail.com>
Date: Fri Jan 13 11:43:58 2017 +0000
Filter out repeated ways when copying libffi
>---------------------------------------------------------------
b94612d33b8febed57d26bc696c9454b883f4aed
src/Rules/Libffi.hs | 3 ++-
src/Way.hs | 5 ++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/Rules/Libffi.hs b/src/Rules/Libffi.hs
index 0f703d9..99b77c8 100644
--- a/src/Rules/Libffi.hs
+++ b/src/Rules/Libffi.hs
@@ -56,7 +56,8 @@ libffiRules = do
copyFile header (rtsBuildPath -/- takeFileName header)
ways <- interpretInContext libffiContext (getLibraryWays <> getRtsWays)
- forM_ ways $ \way -> copyFile libffiLibrary =<< rtsLibffiLibrary way
+ forM_ (nubOrd ways) $ \way ->
+ copyFile libffiLibrary =<< rtsLibffiLibrary way
putSuccess $ "| Successfully built custom library 'libffi'"
diff --git a/src/Way.hs b/src/Way.hs
index 22ae6fa8..cb73f04 100644
--- a/src/Way.hs
+++ b/src/Way.hs
@@ -24,7 +24,7 @@ data WayUnit = Threaded
| Profiling
| Logging
| Dynamic
- deriving (Eq, Enum, Bounded)
+ deriving (Bounded, Enum, Eq, Ord)
-- TODO: get rid of non-derived Show instances
instance Show WayUnit where
@@ -74,6 +74,9 @@ instance Read Way where
instance Eq Way where
Way a == Way b = a == b
+instance Ord Way where
+ compare (Way a) (Way b) = compare a b
+
-- | Build default _vanilla_ way.
vanilla :: Way
vanilla = wayFromUnits []
More information about the ghc-commits
mailing list