[Pkg-ganeti-devel] [ganeti] 05/06: Fix build with GHC8

Apollon Oikonomopoulos apoikos at moszumanska.debian.org
Mon Dec 12 13:57:43 UTC 2016


This is an automated email from the git hooks/post-receive script.

apoikos pushed a commit to branch ghc8
in repository ganeti.

commit 8034641736d3ce321d6e8d7da4a03a97845b71b2
Author: Apollon Oikonomopoulos <apoikos at debian.org>
Date:   Mon Nov 21 13:11:59 2016 +0200

    Fix build with GHC8
---
 debian/patches/0001-GHC-8-support.patch | 121 ++++++++++++++++++++++++++++++++
 debian/patches/series                   |   1 +
 2 files changed, 122 insertions(+)

diff --git a/debian/patches/0001-GHC-8-support.patch b/debian/patches/0001-GHC-8-support.patch
new file mode 100644
index 0000000..a8ca000
--- /dev/null
+++ b/debian/patches/0001-GHC-8-support.patch
@@ -0,0 +1,121 @@
+From feda79f89c5fb07b8a048f4c589ec14fecbe1ce6 Mon Sep 17 00:00:00 2001
+From: Apollon Oikonomopoulos <apoikos at gmail.com>
+Date: Mon, 21 Nov 2016 13:25:21 +0200
+Subject: [PATCH] GHC 8 support
+
+commit 33259158fd5bee89c761d7475bf4fab173454d65
+Author: Apollon Oikonomopoulos <apoikos at gmail.com>
+Date:   Mon Nov 21 13:23:17 2016 +0200
+
+    GHC 8 compatibility
+
+commit 16b9154edda729fb93335500cb467a194573025a
+Author: Bhimanavajjula Aditya <bsrk at google.com>
+Date:   Wed Sep 9 12:10:27 2015 +0200
+
+    Use explicit forall quantification for types
+
+    Implict quantifications will give an error from ghc 7.12
+
+    Signed-off-by: Bhimanavajjula Aditya <bsrk at google.com>
+    Signed-off-by: Petr Pudlak <pudlak at google.com>
+    Reviewed-by: Petr Pudlak <pudlak at google.com>
+---
+ src/Ganeti/Query/Filter.hs |  2 +-
+ src/Ganeti/THH.hs          | 23 +++++++++++++++--------
+ 2 files changed, 16 insertions(+), 9 deletions(-)
+
+--- a/src/Ganeti/Query/Filter.hs
++++ b/src/Ganeti/Query/Filter.hs
+@@ -136,7 +136,7 @@
+ -- | A type synonim for a rank-2 comparator function. This is used so
+ -- that we can pass the usual '<=', '>', '==' functions to 'binOpFilter'
+ -- and for them to be used in multiple contexts.
+-type Comparator = (Eq a, Ord a) => a -> a -> Bool
++type Comparator = forall a . (Eq a, Ord a) => a -> a -> Bool
+ 
+ -- | Equality checker.
+ --
+--- a/src/Ganeti/THH.hs
++++ b/src/Ganeti/THH.hs
+@@ -1,4 +1,4 @@
+-{-# LANGUAGE ParallelListComp, TemplateHaskell #-}
++{-# LANGUAGE ParallelListComp, TemplateHaskell, RankNTypes #-}
+ 
+ {-| TemplateHaskell helper for Ganeti Haskell code.
+ 
+@@ -105,6 +105,8 @@
+ import Ganeti.PyValue
+ import Ganeti.THH.PyType
+ 
++myNotStrict :: Bang
++myNotStrict = Bang NoSourceUnpackedness NoSourceStrictness
+ 
+ -- * Exported types
+ 
+@@ -417,7 +419,7 @@
+ buildConsField :: Q Type -> StrictTypeQ
+ buildConsField ftype = do
+   ftype' <- ftype
+-  return (NotStrict, ftype')
++  return (myNotStrict, ftype')
+ 
+ -- | Builds a constructor based on a simple definition (not field-based).
+ buildSimpleCons :: Name -> SimpleObject -> Q Dec
+@@ -425,7 +427,7 @@
+   decl_d <- mapM (\(cname, fields) -> do
+                     fields' <- mapM (buildConsField . snd) fields
+                     return $ NormalC (mkName cname) fields') cons
+-  return $ DataD [] tname [] decl_d [''Show, ''Eq]
++  return $ DataD [] tname [] Nothing decl_d <$> mapM conT [''Show, ''Eq]
+ 
+ -- | Generate the save function for a given type.
+ genSaveSimpleObj :: Name                            -- ^ Object type
+@@ -482,7 +484,7 @@
+ genFromRaw :: Name -> Name -> Name -> [(String, Either String Name)] -> Q [Dec]
+ genFromRaw traw fname tname constructors = do
+   -- signature of form (Monad m) => String -> m $name
+-  sigt <- [t| (Monad m) => $(conT traw) -> m $(conT tname) |]
++  sigt <- [t| forall m. (Monad m) => $(conT traw) -> m $(conT tname) |]
+   -- clauses for a guarded pattern
+   let varp = mkName "s"
+       varpe = varE varp
+@@ -911,7 +913,7 @@
+   decl_d <- mapM (\(cname, fields) -> do
+                     -- we only need the type of the field, without Q
+                     fields' <- mapM actualFieldType fields
+-                    let fields'' = zip (repeat NotStrict) fields'
++                    let fields'' = zip (repeat myNotStrict) fields'
+                     return $ NormalC (mkName cname) fields'')
+             cons
+   let declD = DataD [] (mkName name) [] decl_d [''Show, ''Eq]
+@@ -949,7 +951,7 @@
+ fieldTypeInfo field_pfx fd = do
+   t <- actualFieldType fd
+   let n = mkName . (field_pfx ++) . fieldRecordName $ fd
+-  return (n, NotStrict, t)
++  return (n, myNotStrict, t)
+ 
+ -- | Build an object declaration.
+ buildObject :: String -> String -> [Field] -> Q [Dec]
+@@ -1056,9 +1058,9 @@
+                       (map makeOptional fields)
+   let name = mkName sname
+       real_d = NormalC (mkName real_nm)
+-                 [(NotStrict, ConT (mkName real_data_nm))]
++                 [(myNotStrict, ConT (mkName real_data_nm))]
+       forth_d = NormalC (mkName forth_nm)
+-                  [(NotStrict, ConT (mkName forth_data_nm))]
++                  [(myNotStrict, ConT (mkName forth_data_nm))]
+       declD = DataD [] name [] [real_d, forth_d] [''Show, ''Eq]
+ 
+   read_body <- [| branchOnField "forthcoming"
+@@ -1324,7 +1326,7 @@
+ paramFieldTypeInfo :: String -> Field -> VarStrictTypeQ
+ paramFieldTypeInfo field_pfx fd = do
+   t <- actualFieldType fd
+-  return (snd $ paramFieldNames field_pfx fd, NotStrict, AppT (ConT ''Maybe) t)
++  return (snd $ paramFieldNames field_pfx fd, myNotStrict, AppT (ConT ''Maybe) t)
+ 
+ -- | Build a parameter declaration.
+ --
diff --git a/debian/patches/series b/debian/patches/series
index 65c8990..9cf0382 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -7,3 +7,4 @@ fix_FTBFS_with_sphinx-1.3.5
 fix_ftbfs_with_sphinx_1.4
 use-proper-cabal-dev.patch
 0001-Drop-dependency-on-MonadCatchIO-transformers.patch
+0001-GHC-8-support.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ganeti/ganeti.git



More information about the Pkg-ganeti-devel mailing list