From d8d2faece72eabd18c2ff303e5fb63c3a69961f6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Sun, 22 Apr 2018 12:15:35 -0400 Subject: separate Hs-Source-Dirs for binaries This is a trick I only just learned about, see https://stackoverflow.com/questions/6711151/how-to-avoid-recompiling-in-this-cabal-file#6711739 Significantly increased propellor build speed when your config.hs is in a fork of the propellor repository, by avoiding redundant builds of propellor library. Also avoids needing to list all the build deps 3 times. Also avoids cabal 2.x wanting every module to be listed 3 times. Note that the bulk of wrapper.hs had to move into the propellor library, since that code depended on stuff not exposed by the library. This commit was sponsored by Henrik Riomar on Patreon. --- propellor.cabal | 53 +++++++++++++++++++++-------------------------------- 1 file changed, 21 insertions(+), 32 deletions(-) (limited to 'propellor.cabal') diff --git a/propellor.cabal b/propellor.cabal index 18d28db3..4e4102d0 100644 --- a/propellor.cabal +++ b/propellor.cabal @@ -35,38 +35,6 @@ Description: . It is configured using haskell. -Executable propellor - Default-Language: Haskell98 - Main-Is: wrapper.hs - GHC-Options: -threaded -Wall -fno-warn-tabs -O0 - if impl(ghc >= 8.0) - GHC-Options: -fno-warn-redundant-constraints - Default-Extensions: TypeOperators - Hs-Source-Dirs: src - Build-Depends: - -- propellor needs to support the ghc shipped in Debian stable, - -- and also only depends on packages in Debian stable. - base >= 4.5, base < 5, - directory, filepath, IfElse, process, bytestring, hslogger, split, - unix, unix-compat, ansi-terminal, containers (>= 0.5), network, async, - time, mtl, transformers, exceptions (>= 0.6), stm, text, hashable - Other-Modules: - Propellor.DotDir - -Executable propellor-config - Default-Language: Haskell98 - Main-Is: propellor-config.hs - GHC-Options: -threaded -Wall -fno-warn-tabs -O0 - if impl(ghc >= 8.0) - GHC-Options: -fno-warn-redundant-constraints - Default-Extensions: TypeOperators - Hs-Source-Dirs: src - Build-Depends: - base >= 4.5, base < 5, - directory, filepath, IfElse, process, bytestring, hslogger, split, - unix, unix-compat, ansi-terminal, containers (>= 0.5), network, async, - time, mtl, transformers, exceptions (>= 0.6), stm, text, hashable - Library Default-Language: Haskell98 GHC-Options: -Wall -fno-warn-tabs -O0 @@ -75,6 +43,8 @@ Library Default-Extensions: TypeOperators Hs-Source-Dirs: src Build-Depends: + -- propellor needs to support the ghc shipped in Debian stable, + -- and also only depends on packages in Debian stable. base >= 4.5, base < 5, directory, filepath, IfElse, process, bytestring, hslogger, split, unix, unix-compat, ansi-terminal, containers (>= 0.5), network, async, @@ -83,6 +53,7 @@ Library Exposed-Modules: Propellor Propellor.Base + Propellor.DotDir Propellor.Location Propellor.Property Propellor.Property.Aiccu @@ -211,6 +182,7 @@ Library Propellor.Types.ResultCheck Propellor.Types.Singletons Propellor.Types.ZFS + Propellor.Wrapper Other-Modules: Propellor.Bootstrap Propellor.Git @@ -254,6 +226,23 @@ Library System.Console.Concurrent System.Console.Concurrent.Internal System.Process.Concurrent + Paths_propellor + +Executable propellor-config + Default-Language: Haskell98 + Hs-Source-Dirs: executables + Main-Is: propellor-config.hs + GHC-Options: -threaded -Wall -fno-warn-tabs -O0 + if impl(ghc >= 8.0) + GHC-Options: -fno-warn-redundant-constraints + Default-Extensions: TypeOperators + Build-Depends: propellor, base + +Executable propellor + Default-Language: Haskell98 + Hs-Source-Dirs: executables + Main-Is: wrapper.hs + Build-Depends: propellor, base source-repository head type: git -- cgit v1.2.3