From 02eca2ae4cf51d8e83d94d8359e15ac053451109 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 23 Apr 2018 13:56:56 -0400 Subject: Added dependency on concurrent-output; removed embedded copy. Removed deps on transformers, text, stm. Updated debian/control and Propellor.Bootstrap accordingly. Sorted the lists of deps to make it easier to keep them in sync. This commit was sponsored by Nick Daly on Patreon. --- src/Propellor/Bootstrap.hs | 50 +++++++++++++++++++--------------------------- 1 file changed, 21 insertions(+), 29 deletions(-) (limited to 'src/Propellor') diff --git a/src/Propellor/Bootstrap.hs b/src/Propellor/Bootstrap.hs index 04f23f85..a8713535 100644 --- a/src/Propellor/Bootstrap.hs +++ b/src/Propellor/Bootstrap.hs @@ -138,19 +138,17 @@ depsCommand bs msys = "( " ++ intercalate " ; " (go bs) ++ ") || true" -- Below are the same deps listed in debian/control. , "ghc" , "cabal-install" + , "libghc-ansi-terminal-dev" , "libghc-async-dev" - , "libghc-split-dev" + , "libghc-concurrent-output-dev" + , "libghc-exceptions-dev" + , "libghc-hashable-dev" , "libghc-hslogger-dev" - , "libghc-unix-compat-dev" - , "libghc-ansi-terminal-dev" , "libghc-ifelse-dev" - , "libghc-network-dev" , "libghc-mtl-dev" - , "libghc-transformers-dev" - , "libghc-exceptions-dev" - , "libghc-stm-dev" - , "libghc-text-dev" - , "libghc-hashable-dev" + , "libghc-network-dev" + , "libghc-split-dev" + , "libghc-unix-compat-dev" ] debdeps Stack = [ "gnupg" @@ -161,19 +159,16 @@ depsCommand bs msys = "( " ++ intercalate " ; " (go bs) ++ ") || true" [ "gnupg" , "ghc" , "hs-cabal-install" + , "hs-ansi-terminal" , "hs-async" - , "hs-split" + , "hs-exceptions" + , "hs-hashable" , "hs-hslogger" - , "hs-unix-compat" - , "hs-ansi-terminal" , "hs-IfElse" - , "hs-network" , "hs-mtl" - , "hs-transformers-base" - , "hs-exceptions" - , "hs-stm" - , "hs-text" - , "hs-hashable" + , "hs-network" + , "hs-split" + , "hs-unix-compat" ] fbsddeps Stack = [ "gnupg" @@ -184,20 +179,17 @@ depsCommand bs msys = "( " ++ intercalate " ; " (go bs) ++ ") || true" [ "gnupg" , "ghc" , "cabal-install" - , "haskell-async" - , "haskell-split" - , "haskell-hslogger" - , "haskell-unix-compat" - , "haskell-ansi-terminal" , "haskell-hackage-security" - , "haskell-ifelse" - , "haskell-network" - , "haskell-mtl" - , "haskell-transformers-base" + , "haskell-ansi-terminal" + , "haskell-async" , "haskell-exceptions" - , "haskell-stm" - , "haskell-text" , "hashell-hashable" + , "haskell-ifelse" + , "haskell-hslogger" + , "haskell-mtl" + , "haskell-network" + , "haskell-split" + , "haskell-unix-compat" ] archlinuxdeps Stack = [ "gnupg" -- cgit v1.3-2-g0d8e From 237a8a8b7035447f83731bf83d236c31d6a89e88 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 23 Apr 2018 14:49:03 -0400 Subject: stack.yaml: Updated to lts-9.21. Also tested with lts-11.6 / ghc 8.2.2 and it does build, however the stack in debian stable (and even unstable currently) does not support that version's data. --- debian/changelog | 1 + src/Propellor/DotDir.hs | 2 +- stack.yaml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/Propellor') diff --git a/debian/changelog b/debian/changelog index 729eed4f..42871285 100644 --- a/debian/changelog +++ b/debian/changelog @@ -5,6 +5,7 @@ propellor (5.3.6) UNRELEASED; urgency=medium oldstable), to avoid needing to depend on the semigroups transitional package, but also because it's just too old to be worth supporting. * Added dependency on concurrent-output; removed embedded copy. + * stack.yaml: Updated to lts-9.21. -- Joey Hess Mon, 23 Apr 2018 13:12:25 -0400 diff --git a/src/Propellor/DotDir.hs b/src/Propellor/DotDir.hs index dc881eeb..749fcd9f 100644 --- a/src/Propellor/DotDir.hs +++ b/src/Propellor/DotDir.hs @@ -316,7 +316,7 @@ minimalConfig = do ] stackResolver :: String -stackResolver = "lts-8.22" +stackResolver = "lts-9.21" fullClone :: IO Result fullClone = do diff --git a/stack.yaml b/stack.yaml index f7377cc7..eb243950 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,4 +1,4 @@ # When updating the resolver here, also update stackResolver in Propellor.DotDir -resolver: lts-8.22 +resolver: lts-9.21 packages: - '.' -- cgit v1.3-2-g0d8e From f2bb9a3db7ccb5fc0e64920017d305715b34ba95 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Mon, 23 Apr 2018 15:20:25 -0400 Subject: more ghc 8.4 build fixes Tested build with ghc 8.4 now. --- src/Propellor/Property/List.hs | 1 + src/Propellor/Types.hs | 29 ++++++++++++++++++++++------- src/Propellor/Types/Chroot.hs | 3 ++- src/Propellor/Types/Docker.hs | 3 ++- src/Propellor/Types/ResultCheck.hs | 1 + 5 files changed, 28 insertions(+), 9 deletions(-) (limited to 'src/Propellor') diff --git a/src/Propellor/Property/List.hs b/src/Propellor/Property/List.hs index 758e51ce..e53b5ccb 100644 --- a/src/Propellor/Property/List.hs +++ b/src/Propellor/Property/List.hs @@ -20,6 +20,7 @@ import Propellor.Engine import Propellor.Exception import Data.Monoid +import Prelude toProps :: [Property (MetaTypes metatypes)] -> Props (MetaTypes metatypes) toProps ps = Props (map toChildProperty ps) diff --git a/src/Propellor/Types.hs b/src/Propellor/Types.hs index b7c7c7f7..c3926229 100644 --- a/src/Propellor/Types.hs +++ b/src/Propellor/Types.hs @@ -43,6 +43,7 @@ module Propellor.Types ( , module Propellor.Types.ZFS ) where +import qualified Data.Semigroup as Sem import Data.Monoid import Control.Applicative import Prelude @@ -212,14 +213,13 @@ class TightenTargets p where instance TightenTargets Property where tightenTargets (Property _ d a i c) = Property sing d a i c --- | Any type of Property is a monoid. When properties x and y are +-- | Any type of Property is a Semigroup. When properties x and y are -- appended together, the resulting property has a description like -- "x and y". Note that when x fails to be ensured, it will not -- try to ensure y. -instance SingI metatypes => Monoid (Property (MetaTypes metatypes)) +instance SingI metatypes => Sem.Semigroup (Property (MetaTypes metatypes)) where - mempty = Property sing "noop property" Nothing mempty mempty - mappend (Property _ d1 a1 i1 c1) (Property _ d2 a2 i2 c2) = + Property _ d1 a1 i1 c1 <> Property _ d2 a2 i2 c2 = Property sing d (a1 <> a2) (i1 <> i2) (c1 <> c2) where -- Avoid including "noop property" in description @@ -230,10 +230,26 @@ instance SingI metatypes => Monoid (Property (MetaTypes metatypes)) (Nothing, Just _) -> d2 (Nothing, Nothing) -> d1 --- | Any type of RevertableProperty is a monoid. When revertable +-- | Any type of Property is a Monoid. +instance SingI metatypes => Monoid (Property (MetaTypes metatypes)) + where + -- | A property that does nothing. + mempty = Property sing "noop property" Nothing mempty mempty + mappend = (<>) + +-- | Any type of RevertableProperty is a Semigroup. When revertable -- properties x and y are appended together, the resulting revertable -- property has a description like "x and y". -- Note that when x fails to be ensured, it will not try to ensure y. +instance + ( Sem.Semigroup (Property setupmetatypes) + , Sem.Semigroup (Property undometatypes) + ) + => Sem.Semigroup (RevertableProperty setupmetatypes undometatypes) + where + RevertableProperty s1 u1 <> RevertableProperty s2 u2 = + RevertableProperty (s1 <> s2) (u2 <> u1) + instance ( Monoid (Property setupmetatypes) , Monoid (Property undometatypes) @@ -241,5 +257,4 @@ instance => Monoid (RevertableProperty setupmetatypes undometatypes) where mempty = RevertableProperty mempty mempty - mappend (RevertableProperty s1 u1) (RevertableProperty s2 u2) = - RevertableProperty (s1 <> s2) (u2 <> u1) + mappend = (<>) diff --git a/src/Propellor/Types/Chroot.hs b/src/Propellor/Types/Chroot.hs index b27203e5..b3751a9a 100644 --- a/src/Propellor/Types/Chroot.hs +++ b/src/Propellor/Types/Chroot.hs @@ -6,9 +6,10 @@ import Propellor.Types import Propellor.Types.Empty import Propellor.Types.Info -import Data.Monoid import qualified Data.Semigroup as Sem import qualified Data.Map as M +import Data.Monoid +import Prelude data ChrootInfo = ChrootInfo { _chroots :: M.Map FilePath Host diff --git a/src/Propellor/Types/Docker.hs b/src/Propellor/Types/Docker.hs index 79577591..72703b82 100644 --- a/src/Propellor/Types/Docker.hs +++ b/src/Propellor/Types/Docker.hs @@ -6,9 +6,10 @@ import Propellor.Types import Propellor.Types.Empty import Propellor.Types.Info -import Data.Monoid import qualified Data.Semigroup as Sem import qualified Data.Map as M +import Data.Monoid +import Prelude data DockerInfo = DockerInfo { _dockerRunParams :: [DockerRunParam] diff --git a/src/Propellor/Types/ResultCheck.hs b/src/Propellor/Types/ResultCheck.hs index f03c174f..8c161850 100644 --- a/src/Propellor/Types/ResultCheck.hs +++ b/src/Propellor/Types/ResultCheck.hs @@ -14,6 +14,7 @@ import Propellor.Exception import Utility.Monad import Data.Monoid +import Prelude -- | This is a `Property` but its `Result` is not accurate; in particular -- it may return `NoChange` despite having made a change. -- cgit v1.3-2-g0d8e