summaryrefslogtreecommitdiff
path: root/propellor.cabal
diff options
context:
space:
mode:
authorJoey Hess <joeyh@joeyh.name>2016-03-28 05:53:38 -0400
committerJoey Hess <joeyh@joeyh.name>2016-03-28 05:55:48 -0400
commita1655d24bbb1db9caccdf93eae8110d746389ae2 (patch)
tree66b6890d852c19daec2306920fecf9108e055273 /propellor.cabal
parentebf30061d8f8a251330070e69c2710fe4a8fd9da (diff)
type safe targets for properties
* Property types have been improved to indicate what systems they target. This prevents using eg, Property FreeBSD on a Debian system. Transition guide for this sweeping API change: - Change "host name & foo & bar" to "host name $ props & foo & bar" - Similarly, `propertyList` and `combineProperties` need `props` to be used to combine together properties; they no longer accept lists of properties. (If you have such a list, use `toProps`.) - And similarly, Chroot, Docker, and Systemd container need `props` to be used to combine together the properies used inside them. - The `os` property is removed. Instead use `osDebian`, `osBuntish`, or `osFreeBSD`. These tell the type checker the target OS of a host. - Change "Property NoInfo" to "Property UnixLike" - Change "Property HasInfo" to "Property (HasInfo + UnixLike)" - Change "RevertableProperty NoInfo" to "RevertableProperty UnixLike UnixLike" - Change "RevertableProperty HasInfo" to "RevertableProperty (HasInfo + UnixLike) UnixLike" - GHC needs {-# LANGUAGE TypeOperators #-} to use these fancy types. This is enabled by default for all modules in propellor.cabal. But if you are using propellor as a library, you may need to enable it manually. - If you know a property only works on a particular OS, like Debian or FreeBSD, use that instead of "UnixLike". For example: "Property Debian" - It's also possible make a property support a set of OS's, for example: "Property (Debian + FreeBSD)" - Removed `infoProperty` and `simpleProperty` constructors, instead use `property` to construct a Property. - Due to the polymorphic type returned by `property`, additional type signatures tend to be needed when using it. For example, this will fail to type check, because the type checker cannot guess what type you intend the intermediate property "go" to have: foo :: Property UnixLike foo = go `requires` bar where go = property "foo" (return NoChange) To fix, specify the type of go: go :: Property UnixLike - `ensureProperty` now needs to be passed a witness to the type of the property it's used in. change this: foo = property desc $ ... ensureProperty bar to this: foo = property' desc $ \w -> ... ensureProperty w bar - General purpose properties like cmdProperty have type "Property UnixLike". When using that to run a command only available on Debian, you can tighten the type to only the OS that your more specific property works on. For example: upgraded :: Property Debian upgraded = tightenTargets (cmdProperty "apt-get" ["upgrade"]) - Several utility functions have been renamed: getInfo to fromInfo propertyInfo to getInfo propertyDesc to getDesc propertyChildren to getChildren * The new `pickOS` property combinator can be used to combine different properties, supporting different OS's, into one Property that chooses which to use based on the Host's OS. * Re-enabled -O0 in propellor.cabal to reign in ghc's memory use handling these complex new types. * Added dependency on concurrent-output; removed embedded copy.
Diffstat (limited to 'propellor.cabal')
-rw-r--r--propellor.cabal46
1 files changed, 28 insertions, 18 deletions
diff --git a/propellor.cabal b/propellor.cabal
index dc322e88..06142155 100644
--- a/propellor.cabal
+++ b/propellor.cabal
@@ -1,5 +1,5 @@
Name: propellor
-Version: 2.17.0
+Version: 3.0.0
Cabal-Version: >= 1.8
License: BSD3
Maintainer: Joey Hess <id@joeyh.name>
@@ -36,31 +36,39 @@ Description:
Executable propellor
Main-Is: wrapper.hs
- GHC-Options: -threaded -Wall -fno-warn-tabs
+ GHC-Options: -threaded -Wall -fno-warn-tabs -O0
+ Extensions: TypeOperators
Hs-Source-Dirs: src
- Build-Depends:
+ Build-Depends:
-- propellor needs to support the ghc shipped in Debian stable
base >= 4.5, base < 5,
MissingH, directory, filepath, IfElse, process, bytestring, hslogger,
unix, unix-compat, ansi-terminal, containers (>= 0.5), network, async,
- time, mtl, transformers, exceptions (>= 0.6), stm, text
+ time, mtl, transformers, exceptions (>= 0.6), stm, text,
+ concurrent-output
Executable propellor-config
Main-Is: config.hs
- GHC-Options: -threaded -Wall -fno-warn-tabs
+ GHC-Options: -threaded -Wall -fno-warn-tabs -O0
+ Extensions: TypeOperators
Hs-Source-Dirs: src
- Build-Depends: MissingH, directory, filepath, base >= 4.5, base < 5,
- IfElse, process, bytestring, hslogger, unix-compat, ansi-terminal,
- containers (>= 0.5), network, async, time, mtl, transformers,
- exceptions (>= 0.6), stm, text, unix
+ Build-Depends:
+ base >= 4.5, base < 5,
+ MissingH, directory, filepath, IfElse, process, bytestring, hslogger,
+ unix, unix-compat, ansi-terminal, containers (>= 0.5), network, async,
+ time, mtl, transformers, exceptions (>= 0.6), stm, text,
+ concurrent-output
Library
- GHC-Options: -Wall -fno-warn-tabs
+ GHC-Options: -Wall -fno-warn-tabs -O0
+ Extensions: TypeOperators
Hs-Source-Dirs: src
- Build-Depends: MissingH, directory, filepath, base >= 4.5, base < 5,
- IfElse, process, bytestring, hslogger, unix-compat, ansi-terminal,
- containers (>= 0.5), network, async, time, mtl, transformers,
- exceptions (>= 0.6), stm, text, unix
+ Build-Depends:
+ base >= 4.5, base < 5,
+ MissingH, directory, filepath, IfElse, process, bytestring, hslogger,
+ unix, unix-compat, ansi-terminal, containers (>= 0.5), network, async,
+ time, mtl, transformers, exceptions (>= 0.6), stm, text,
+ concurrent-output
Exposed-Modules:
Propellor
@@ -138,24 +146,29 @@ Library
Propellor.PropAccum
Propellor.Utilities
Propellor.CmdLine
+ Propellor.Container
Propellor.Info
Propellor.Message
Propellor.Debug
Propellor.PrivData
Propellor.Engine
+ Propellor.EnsureProperty
Propellor.Exception
Propellor.Types
+ Propellor.Types.Core
Propellor.Types.Chroot
+ Propellor.Types.CmdLine
Propellor.Types.Container
Propellor.Types.Docker
Propellor.Types.Dns
Propellor.Types.Empty
Propellor.Types.Info
+ Propellor.Types.MetaTypes
Propellor.Types.OS
Propellor.Types.PrivData
Propellor.Types.Result
Propellor.Types.ResultCheck
- Propellor.Types.CmdLine
+ Propellor.Types.Singletons
Propellor.Types.ZFS
Other-Modules:
Propellor.Bootstrap
@@ -193,9 +206,6 @@ Library
Utility.ThreadScheduler
Utility.Tmp
Utility.UserInfo
- System.Console.Concurrent
- System.Console.Concurrent.Internal
- System.Process.Concurrent
source-repository head
type: git