Handle GHC 9 changes in a backwards compatible manner. Taken from upstream: https://github.com/ganeti/ganeti/commit/b279fa738fd5b30320584f79f4d2f0e894315aab diff --git a/src/Ganeti/THH.hs b/src/Ganeti/THH.hs index 818c11f84..9ab93d5e3 100644 --- a/src/Ganeti/THH.hs +++ b/src/Ganeti/THH.hs @@ -884,7 +884,7 @@ genLoadOpCode opdefs fn = do ) $ zip mexps opdefs defmatch = Match WildP (NormalB fails) [] cst = NoBindS $ CaseE (VarE opid) $ mpats++[defmatch] - body = DoE [st, cst] + body = mkDoE [st, cst] -- include "OP_ID" to the list of used keys bodyAndOpId <- [| $(return body) <* tell (mkUsedKeys . S.singleton . T.pack $ opidKey) |] @@ -1541,7 +1541,7 @@ loadExcConstructor inname sname fields = do [x] -> BindS (ListP [VarP x]) _ -> BindS (TupP (map VarP f_names)) cval = appCons name $ map VarE f_names - return $ DoE [binds read_args, NoBindS (AppE (VarE 'return) cval)] + return $ mkDoE [binds read_args, NoBindS (AppE (VarE 'return) cval)] {-| Generates the loadException function. diff --git a/src/Ganeti/THH/Compat.hs b/src/Ganeti/THH/Compat.hs index d29e30d18..1f51e49d7 100644 --- a/src/Ganeti/THH/Compat.hs +++ b/src/Ganeti/THH/Compat.hs @@ -40,9 +40,11 @@ module Ganeti.THH.Compat , extractDataDConstructors , myNotStrict , nonUnaryTupE + , mkDoE ) where import Language.Haskell.TH +import Language.Haskell.TH.Syntax -- | Convert Names to DerivClauses -- @@ -61,7 +63,11 @@ derivesFromNames names = map ConT names -- -- Handle TH 2.11 and 2.12 changes in a transparent manner using the pre-2.11 -- API. +#if MIN_VERSION_template_haskell(2,17,0) +gntDataD :: Cxt -> Name -> [TyVarBndr ()] -> [Con] -> [Name] -> Dec +#else gntDataD :: Cxt -> Name -> [TyVarBndr] -> [Con] -> [Name] -> Dec +#endif gntDataD x y z a b = #if MIN_VERSION_template_haskell(2,12,0) DataD x y z Nothing a $ derivesFromNames b @@ -114,3 +120,12 @@ nonUnaryTupE es = TupE $ map Just es #else nonUnaryTupE es = TupE $ es #endif + +-- | DoE is now qualified with an optional ModName +mkDoE :: [Stmt] -> Exp +mkDoE s = +#if MIN_VERSION_template_haskell(2,17,0) + DoE Nothing s +#else + DoE s +#endif ontent'>
AgeCommit message (Expand)Author
2020-09-28tests: Simplify shell exit status negation;...* tests/guix-archive.sh, tests/guix-build-branch.sh, tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh, tests/guix-environment.sh, tests/guix-gc.sh, tests/guix-git-authenticate.sh, tests/guix-graph.sh, tests/guix-hash.sh, tests/guix-lint.sh, tests/guix-pack-relocatable.sh, tests/guix-pack.sh, tests/guix-package-aliases.sh, tests/guix-package-net.sh, tests/guix-package.sh: Use the shell '!' keyword to negate command exit status in place of 'if ...; then false; else true; fi' Eric Bavier
2019-04-10guix gc: Add '--list-roots'....* guix/scripts/gc.scm (show-help, %options): Add '--list-roots'. (guix-gc)[list-roots]: New procedure. Handle '--list-roots'. * tests/guix-gc.sh: Test it. * doc/guix.texi (Invoking guix gc): Document it. Ludovic Courtès
2018-03-27guix gc: Add '--derivers'....* guix/scripts/gc.scm (show-help, %options): Add '--derivers'. (guix-gc): Handle 'list-derivers'. * tests/guix-gc.sh: Add test. * doc/guix.texi (Invoking guix gc): Document it. Ludovic Courtès
2017-12-18guix gc: '--verify=foo' is reported as an error....Fixes <https://bugs.gnu.org/29761>. Reported by Martin Castillo <castilma@uni-bremen.de>. * guix/scripts/gc.scm (argument->verify-options): New procedure. (%options) ["verify"]: Adjust to use it. * tests/guix-gc.sh: Add test. Ludovic Courtès
2017-11-13tests: 'guix-gc.sh' passes even when 'out' or 'drv' are defined as env vars....This fixes a test failure exhibited by fb17a89912c2a3738dae716e30481c11e1c6f0ac whereby assignments to 'out' in guix-gc.sh would go to the 'out' environment variable, when it exists, which in turn prevents garbage collection of $out. * tests/guix-gc.sh: Add 'unset' invocations. Ludovic Courtès