aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/ganeti-template-haskell-2.18.patch
diff options
context:
space:
mode:
authorLiliana Marie Prikler <liliana.prikler@gmail.com>2023-09-09 12:22:14 +0200
committerLiliana Marie Prikler <liliana.prikler@gmail.com>2023-09-09 12:22:14 +0200
commit94ca5b4357af8f8921f0cb0873a7cf316f13aa69 (patch)
tree6ef30120737f26f298f7f17d86597b0b729517e0 /gnu/packages/patches/ganeti-template-haskell-2.18.patch
parent6750c114e3e988249f4069d0180316c6d0192350 (diff)
parentdb61bdd7f52270a35bd0a3a88650d98276dab20b (diff)
downloadguix-94ca5b4357af8f8921f0cb0873a7cf316f13aa69.tar.gz
guix-94ca5b4357af8f8921f0cb0873a7cf316f13aa69.zip
Merge branch 'master' into emacs-team
Diffstat (limited to 'gnu/packages/patches/ganeti-template-haskell-2.18.patch')
-rw-r--r--gnu/packages/patches/ganeti-template-haskell-2.18.patch179
1 files changed, 179 insertions, 0 deletions
diff --git a/gnu/packages/patches/ganeti-template-haskell-2.18.patch b/gnu/packages/patches/ganeti-template-haskell-2.18.patch
new file mode 100644
index 0000000000..e7be869636
--- /dev/null
+++ b/gnu/packages/patches/ganeti-template-haskell-2.18.patch
@@ -0,0 +1,179 @@
+Fix compatibility with Template Haskell 2.18 and GHC 9.2.
+
+
+diff --git a/src/Ganeti/BasicTypes.hs b/src/Ganeti/BasicTypes.hs
+index 10d0426cd..d68bc7d5b 100644
+--- a/src/Ganeti/BasicTypes.hs
++++ b/src/Ganeti/BasicTypes.hs
+@@ -206,12 +206,12 @@ instance MonadTrans (ResultT a) where
+ instance (MonadIO m, Error a) => MonadIO (ResultT a m) where
+ liftIO = ResultT . liftIO
+ . liftM (either (failError . show) return)
+- . (try :: IO a -> IO (Either IOError a))
++ . (try :: IO α -> IO (Either IOError α))
+
+ instance (MonadBase IO m, Error a) => MonadBase IO (ResultT a m) where
+ liftBase = ResultT . liftBase
+ . liftM (either (failError . show) return)
+- . (try :: IO a -> IO (Either IOError a))
++ . (try :: IO α -> IO (Either IOError α))
+
+ instance (Error a) => MonadTransControl (ResultT a) where
+ #if MIN_VERSION_monad_control(1,0,0)
+diff --git a/src/Ganeti/Lens.hs b/src/Ganeti/Lens.hs
+index faa5900ed..747366e6a 100644
+--- a/src/Ganeti/Lens.hs
++++ b/src/Ganeti/Lens.hs
+@@ -93,14 +93,14 @@ makeCustomLenses' name lst = makeCustomLensesFiltered f name
+ -- Most often the @g@ functor is @(,) r@ and 'traverseOf2' is used to
+ -- traverse an effectful computation that also returns an additional output
+ -- value.
+-traverseOf2 :: Over (->) (Compose f g) s t a b
+- -> (a -> f (g b)) -> s -> f (g t)
++-- traverseOf2 :: Over (->) (Compose f g) s t a b
++-- -> (a -> f (g b)) -> s -> f (g t)
+ traverseOf2 k f = getCompose . traverseOf k (Compose . f)
+
+ -- | Traverses over a composition of a monad and a functor.
+ -- See 'traverseOf2'.
+-mapMOf2 :: Over (->) (Compose (WrappedMonad m) g) s t a b
+- -> (a -> m (g b)) -> s -> m (g t)
++-- mapMOf2 :: Over (->) (Compose (WrappedMonad m) g) s t a b
++-- -> (a -> m (g b)) -> s -> m (g t)
+ mapMOf2 k f = unwrapMonad . traverseOf2 k (WrapMonad . f)
+
+ -- | A helper lens over sets.
+diff --git a/src/Ganeti/THH.hs b/src/Ganeti/THH.hs
+index 9ab93d5e3..9a10a9a07 100644
+--- a/src/Ganeti/THH.hs
++++ b/src/Ganeti/THH.hs
+@@ -996,8 +996,8 @@ buildAccessor fnm fpfx rnm rpfx nm pfx field = do
+ f_body = AppE (VarE fpfx_name) $ VarE x
+ return $ [ SigD pfx_name $ ArrowT `AppT` ConT nm `AppT` ftype
+ , FunD pfx_name
+- [ Clause [ConP rnm [VarP x]] (NormalB r_body) []
+- , Clause [ConP fnm [VarP x]] (NormalB f_body) []
++ [ Clause [myConP rnm [VarP x]] (NormalB r_body) []
++ , Clause [myConP fnm [VarP x]] (NormalB f_body) []
+ ]]
+
+ -- | Build lense declartions for a field.
+@@ -1037,10 +1037,10 @@ buildLens (fnm, fdnm) (rnm, rdnm) nm pfx ar (field, i) = do
+ (ConE cdn)
+ $ zip [0..] vars
+ let setterE = LamE [VarP context, VarP var] $ CaseE (VarE context)
+- [ Match (ConP fnm [ConP fdnm . set (element i) WildP
++ [ Match (myConP fnm [myConP fdnm . set (element i) WildP
+ $ map VarP vars])
+ (body (not isSimple) fnm fdnm) []
+- , Match (ConP rnm [ConP rdnm . set (element i) WildP
++ , Match (myConP rnm [myConP rdnm . set (element i) WildP
+ $ map VarP vars])
+ (body False rnm rdnm) []
+ ]
+@@ -1098,9 +1098,9 @@ buildObjectWithForthcoming sname field_pfx fields = do
+ $ JSON.showJSON $(varE x) |]
+ let rdjson = FunD 'JSON.readJSON [Clause [] (NormalB read_body) []]
+ shjson = FunD 'JSON.showJSON
+- [ Clause [ConP (mkName real_nm) [VarP x]]
++ [ Clause [myConP (mkName real_nm) [VarP x]]
+ (NormalB show_real_body) []
+- , Clause [ConP (mkName forth_nm) [VarP x]]
++ , Clause [myConP (mkName forth_nm) [VarP x]]
+ (NormalB show_forth_body) []
+ ]
+ instJSONdecl = gntInstanceD [] (AppT (ConT ''JSON.JSON) (ConT name))
+@@ -1121,9 +1121,9 @@ buildObjectWithForthcoming sname field_pfx fields = do
+ (fromDictWKeys $(varE xs)) |]
+ todictx_r <- [| toDict $(varE x) |]
+ todictx_f <- [| ("forthcoming", JSON.JSBool True) : toDict $(varE x) |]
+- let todict = FunD 'toDict [ Clause [ConP (mkName real_nm) [VarP x]]
++ let todict = FunD 'toDict [ Clause [myConP (mkName real_nm) [VarP x]]
+ (NormalB todictx_r) []
+- , Clause [ConP (mkName forth_nm) [VarP x]]
++ , Clause [myConP (mkName forth_nm) [VarP x]]
+ (NormalB todictx_f) []
+ ]
+ fromdict = FunD 'fromDictWKeys [ Clause [VarP xs]
+@@ -1136,9 +1136,9 @@ buildObjectWithForthcoming sname field_pfx fields = do
+ let forthPredDecls = [ SigD forthPredName
+ $ ArrowT `AppT` ConT name `AppT` ConT ''Bool
+ , FunD forthPredName
+- [ Clause [ConP (mkName real_nm) [WildP]]
++ [ Clause [myConP (mkName real_nm) [WildP]]
+ (NormalB $ ConE 'False) []
+- , Clause [ConP (mkName forth_nm) [WildP]]
++ , Clause [myConP (mkName forth_nm) [WildP]]
+ (NormalB $ ConE 'True) []
+ ]
+ ]
+@@ -1412,9 +1412,9 @@ savePParamField fvar field = do
+ normalexpr <- saveObjectField actualVal field
+ -- we have to construct the block here manually, because we can't
+ -- splice-in-splice
+- return $ CaseE (VarE fvar) [ Match (ConP 'Nothing [])
++ return $ CaseE (VarE fvar) [ Match (myConP 'Nothing [])
+ (NormalB (ConE '[])) []
+- , Match (ConP 'Just [VarP actualVal])
++ , Match (myConP 'Just [VarP actualVal])
+ (NormalB normalexpr) []
+ ]
+
+@@ -1440,9 +1440,9 @@ fillParam sname field_pfx fields = do
+ -- due to apparent bugs in some older GHC versions, we need to add these
+ -- prefixes to avoid "binding shadows ..." errors
+ fbinds <- mapM (newName . ("f_" ++) . nameBase) fnames
+- let fConP = ConP name_f (map VarP fbinds)
++ let fConP = myConP name_f (map VarP fbinds)
+ pbinds <- mapM (newName . ("p_" ++) . nameBase) pnames
+- let pConP = ConP name_p (map VarP pbinds)
++ let pConP = myConP name_p (map VarP pbinds)
+ -- PartialParams instance --------
+ -- fillParams
+ let fromMaybeExp fn pn = AppE (AppE (VarE 'fromMaybe) (VarE fn)) (VarE pn)
+@@ -1462,7 +1462,7 @@ fillParam sname field_pfx fields = do
+ memptyClause = Clause [] (NormalB memptyExp) []
+ -- mappend
+ pbinds2 <- mapM (newName . ("p2_" ++) . nameBase) pnames
+- let pConP2 = ConP name_p (map VarP pbinds2)
++ let pConP2 = myConP name_p (map VarP pbinds2)
+ -- note the reversal of 'l' and 'r' in the call to <|>
+ -- as we want the result to be the rightmost value
+ let altExp = zipWith (\l r -> AppE (AppE (VarE '(<|>)) (VarE r)) (VarE l))
+@@ -1575,9 +1575,9 @@ genLoadExc tname sname opdefs = do
+ opdefs
+ -- the first function clause; we can't use [| |] due to TH
+ -- limitations, so we have to build the AST by hand
+- let clause1 = Clause [ConP 'JSON.JSArray
+- [ListP [ConP 'JSON.JSString [VarP exc_name],
+- VarP exc_args]]]
++ let clause1 = Clause [myConP 'JSON.JSArray
++ [ListP [myConP 'JSON.JSString [VarP exc_name],
++ VarP exc_args]]]
+ (NormalB (CaseE (AppE (VarE 'JSON.fromJSString)
+ (VarE exc_name))
+ (str_matches ++ [defmatch]))) []
+diff --git a/src/Ganeti/THH/Compat.hs b/src/Ganeti/THH/Compat.hs
+index 1f51e49d7..9b07c47ef 100644
+--- a/src/Ganeti/THH/Compat.hs
++++ b/src/Ganeti/THH/Compat.hs
+@@ -41,6 +41,7 @@ module Ganeti.THH.Compat
+ , myNotStrict
+ , nonUnaryTupE
+ , mkDoE
++ , myConP
+ ) where
+
+ import Language.Haskell.TH
+@@ -129,3 +130,11 @@ mkDoE s =
+ #else
+ DoE s
+ #endif
++
++-- | ConP is now qualified with an optional [Type].
++myConP :: Name -> [Pat] -> Pat
++myConP n patterns = ConP n
++#if MIN_VERSION_template_haskell(2,18,0)
++ []
++#endif
++ patterns
> 2020-06-14system: image: Remove left-over....* gnu/system/image.scm: Remove a left-over since maybe-with-target procedure was removed. Mathieu Othacehe 2020-06-13image: Remove 'maybe-with-target'....* gnu/system/image.scm (maybe-with-target): Remove, (system-image): adapt accordingly. Mathieu Othacehe 2020-06-13image: Add 'target' support....* gnu/image.scm (<image>)[target]: New field, (image-target): new public method. * gnu/system/image.scm (hurd-disk-image): Set "i586-pc-gnu" as image 'target' field, (maybe-with-target): new procedure, (system-image): honor image 'target' field using the above procedure. Mathieu Othacehe 2020-06-13image: Make 'find-image' non-monadic....* gnu/system/image.scm (find-image): Make non-monadic. Add 'target' parameter. * gnu/tests/install.scm (run-install): Update caller, passing (%current-target-system). * guix/scripts/system.scm (perform-action): Likewise. Jan (janneke) Nieuwenhuizen 2020-06-12system: image: Do not produce an HFS tree when building an ISO....Use "mbr_only" mode to make sure that no HFS+ tree are generated. * gnu/system/image.scm (system-image): Set MKRESCUE_SED_MODE to "mbr_only". Mathieu Othacehe 2020-06-08hurd-boot: Further cleanup of "rc"....* gnu/packages/hurd.scm (hurd-rc-script): Move implementation to ... * gnu/build/hurd-boot.scm (boot-hurd-system): ...here, new file. * gnu/build/linux-boot.scm (make-hurd-device-nodes): Move there likewise. * gnu/local.mk (GNU_SYSTEM_MODULES): Add it. Jan (janneke) Nieuwenhuizen 2020-06-08image: Add Hurd support....* gnu/system/image.scm (hurd-disk-image): New exported variable, (root-offset, root-label): new variables, (esp-partition, root-partition): adapt accordingly, (find-image): add Hurd support. Mathieu Othacehe 2020-05-29image: Do not use VM to create disk-images....Now that installing Grub on raw disk-images is supported, we do not need to rely on (gnu system vm) module. * gnu/system/image.scm (make-system-image): Rename to ... (system-image): ... this, and remove the compatibility wrapper. (find-image): Turn to a monadic procedure. This will become useful when introducing Hurd support, to be able to detect the target system. * gnu/ci.scm (qemu-jobs): Use lower-object now that system-image returns a file-like object. * gnu/tests/install.scm (run-install): Ditto. * guix/scripts/system.scm (system-derivation-for-action): Add a 'base-image' argument, (perform-action): adapt accordingly. Mathieu Othacehe 2020-05-29image: Add a post-MBR gap to the default image....The generic 'efi-disk-image' needs to be bootable on systems without EFI. To do that, GRUB is installed in the post-MBR gap. Make sure that the first partition starts with an offset, to make this gap large enough for GRUB. * gnu/system/image.scm (root-offset, root-label): New variables, (esp-partition): use 'root-offset' as the partition offset, (root-partition): use 'root-label' as the partition label. Mathieu Othacehe 2020-05-29system: image: Fix image-with-os....* gnu/system/image.scm (image-with-os): Do not reorder partitions, as we want them to be created according to definition order. Mathieu Othacehe 2020-05-29image: Use grub-efi to install the EFI bootloader....* gnu/build/image.scm (initialize-efi-partition): Rename bootloader-package argument to grub-efi. * gnu/system/image.scm (system-disk-image): Adapt accordingly to pass grub-efi package. Mathieu Othacehe 2020-05-29system: image: Correct genimage configuration file indentation....* gnu/system/image.scm (system-disk-image): Fix genimage configuration file indentation. Mathieu Othacehe 2020-05-29image: Add bootloader installation support....* gnu/build/image.scm (initialize-root-partition): Add bootloader-package and bootloader-installer arguments. Run the bootloader-installer if defined. * gnu/system/image.scm (system-disk-image): Adapt the partition initializer call accordingly. Mathieu Othacehe 2020-05-29bootloader: Add 'disk-image-installer'....* gnu/bootloader.scm (<bootloader>)[disk-image-installer]: New field, (bootloader-disk-image-installer): export it. * gnu/bootloader/grub.scm (install-grub-disk-image): New procedure ... (grub-bootloader): ... used as "disk-image-installer" here. (grub-efi-bootloader): set "disk-image-installer" to #f. * gnu/system/image.scm (root-partition?, find-root-partition): Move to "Helpers" section. (root-partition-index): New procedure. (system-disk-image): Honor disk-image-installer, and use it to install the bootloader directly on the disk-image, if supported. Mathieu Othacehe 2020-05-26image: Add partition file-system options support....* gnu/image.scm (<partition>)[file-system-options]: New field, (partition-file-system-options): new exported procedure. * gnu/system/image.scm (partition->gexp): Adapt accordingly. * gnu/build/image.scm (sexp->partition): Also adapt accordingly, (make-ext-image): and pass file-system options to mke2fs. Mathieu Othacehe 2020-05-26image: Set offset default to zero....* gnu/image.scm (<partition>)[offset]: Set to zero by default. * gnu/system/image.scm (system-disk-image): Adapt accordingly. Mathieu Othacehe 2020-05-26system: image: Fix disk-image cross-compilation....* gnu/system/image.scm (system-disk-image): Use the native version of the helper packages (e2fsprogs, dosfstools, mtools, genimage, coreutils and findutils). Mathieu Othacehe 2020-05-26image: Add partition offset support....* gnu/image.scm (partition-offset): New procedure, (<partition>)[offset]: new field. * gnu/system/image.scm (system-disk-image): Apply the partition offset. Mathieu Othacehe 2020-05-05image: Add a new API....Raw disk-images and ISO9660 images are created in a Qemu virtual machine. This is quite fragile, very slow, and almost unusable without KVM. For all these reasons, add support for host image generation. This implies the use new image generation mechanisms. - Raw disk images: images of partitions are created using tools such as mke2fs and mkdosfs depending on the partition file-system type. The partition images are then assembled into a final image using genimage. - ISO9660 images: the ISO root directory is populated within the store. GNU xorriso is then called on that directory, in the exact same way as this is done in (gnu build vm) module. Those mechanisms are built upon the new (gnu image) module. * gnu/image.scm: New file. * gnu/system/image.scm: New file. * gnu/build/image: New file. * gnu/local.mk: Add them. * gnu/system/vm.scm (system-disk-image): Rename to system-disk-image-in-vm. * gnu/ci.scm (qemu-jobs): Adapt to new API. * gnu/tests/install.scm (run-install): Ditto. * guix/scripts/system.scm (system-derivation-for-action): Ditto. Mathieu Othacehe