From fbdc40affeeb41c3aaf357cceab9829a6c00e36b Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Sun, 26 Aug 2018 19:24:03 +0200 Subject: Remove wrapper, integrate functionality into the library The use of a wrapper executable to compile the real helper was a design mistake originally intended to isolate the calling application from a dependency on the Cabal library completely. This isolation turned out to be rather tedious and thus was ignored soon, the wrapper remained though. Due to the way cabal-install installs components of a package into seperate install trees when using new-install finding the wrapper exe reliably has become pretty much impossible without huge effort. Hence we remove it and integrate the functionality into the library instead. --- cabal-helper.cabal | 68 ++++++++++++++---------------------------------------- 1 file changed, 17 insertions(+), 51 deletions(-) (limited to 'cabal-helper.cabal') diff --git a/cabal-helper.cabal b/cabal-helper.cabal index 1d6bbf3..b7b5f73 100644 --- a/cabal-helper.cabal +++ b/cabal-helper.cabal @@ -87,61 +87,25 @@ library default-extensions: NondecreasingIndentation hs-source-dirs: lib, src exposed-modules: Distribution.Helper - other-modules: - CabalHelper.Shared.InterfaceTypes - CabalHelper.Shared.Sandbox - Paths_cabal_helper - autogen-modules: Paths_cabal_helper - - ghc-options: -Wall - - -- well actually this is a "runtime"-tool-depends :) - build-tool-depends: cabal-helper:cabal-helper-wrapper - - build-depends: base < 5 && >= 4.7 - build-depends: Cabal < 2.5 && >= 2.0 || < 1.26 && >= 1.14 - , cabal-plan < 0.5 && >= 0.3.0.0 - , containers < 1 && >= 0.5.5.1 - , directory < 1.4 && >= 1.2.1.0 - , filepath < 1.5 && >= 1.3.0.0 - , transformers < 0.6 && >= 0.3.0.0 - , mtl < 2.3 && >= 2.0 - , process < 1.7 && >= 1.1.0.1 - if !os(windows) - build-depends: unix < 2.8 && >= 2.5.1.1 - build-depends: unix-compat < 0.6 && >= 0.4.3.1 - , semigroupoids < 5.3 && >= 5.2 - - - -executable cabal-helper-wrapper - main-is: CabalHelper/Compiletime/Wrapper.hs - if flag(dev) - ghc-options: -Wall - scope: private - - -- Common c-h-wrapper-fields -- See [Note test dependencies] - default-language: Haskell2010 - default-extensions: NondecreasingIndentation - other-extensions: TemplateHaskell - hs-source-dirs: src other-modules: CabalHelper.Compiletime.Compat.Environment CabalHelper.Compiletime.Compat.ProgramDb CabalHelper.Compiletime.Compat.Version CabalHelper.Compiletime.Compile CabalHelper.Compiletime.Data - CabalHelper.Compiletime.Log CabalHelper.Compiletime.Types CabalHelper.Shared.Common CabalHelper.Shared.InterfaceTypes CabalHelper.Shared.Sandbox Paths_cabal_helper - build-tool-depends: cabal-install:cabal + + autogen-modules: + Paths_cabal_helper + + ghc-options: -Wall + build-depends: base < 5 && >= 4.7 - if os(windows) - build-depends: base >= 4.7 - build-depends: Cabal < 2.5 && >= 2.0 || < 1.26 && >= 1.14 + build-depends: Cabal < 2.5 && >= 2.0 || < 1.26 && >= 1.14 , cabal-plan < 0.5 && >= 0.3.0.0 , containers < 1 && >= 0.5.5.1 , bytestring < 0.11 && >= 0.9.2.1 @@ -150,6 +114,7 @@ executable cabal-helper-wrapper , mtl < 2.3 && >= 2.0 , process < 1.7 && >= 1.1.0.1 , pretty-show < 1.9 && >= 1.8.1 + , semigroupoids < 5.3 && >= 5.2 , text < 1.3 && >= 1.0.0.0 , template-haskell < 2.14 && >= 2.7.0.0 , temporary < 1.3 && >= 1.2.1 @@ -158,7 +123,9 @@ executable cabal-helper-wrapper build-depends: unix < 2.8 && >= 2.5.1.1 build-depends: unix-compat < 0.6 && >= 0.4.3.1 , utf8-string < 1.1 && >= 1.0.1.1 + build-tools: cabal + build-tool-depends: cabal-install:cabal test-suite compile-test @@ -166,9 +133,8 @@ test-suite compile-test main-is: CompileTest.hs hs-source-dirs: tests ghc-options: -Wall - build-tools: cabal - -- Instantiate common c-h-wrapper-fields -- See [Note test dependencies] + -- Common c-h-wrapper-fields -- See [Note test dependencies] default-language: Haskell2010 default-extensions: NondecreasingIndentation other-extensions: TemplateHaskell @@ -179,13 +145,13 @@ test-suite compile-test CabalHelper.Compiletime.Compat.Version CabalHelper.Compiletime.Compile CabalHelper.Compiletime.Data - CabalHelper.Compiletime.Log CabalHelper.Compiletime.Types CabalHelper.Shared.Common CabalHelper.Shared.InterfaceTypes CabalHelper.Shared.Sandbox Paths_cabal_helper build-tool-depends: cabal-install:cabal + build-tools: cabal build-depends: base < 5 && >= 4.7 if os(windows) build-depends: base >= 4.7 @@ -206,7 +172,6 @@ test-suite compile-test build-depends: unix < 2.8 && >= 2.5.1.1 build-depends: unix-compat < 0.6 && >= 0.4.3.1 , utf8-string < 1.1 && >= 1.0.1.1 - build-tools: cabal test-suite ghc-session @@ -230,13 +195,13 @@ test-suite ghc-session CabalHelper.Compiletime.Compat.Version CabalHelper.Compiletime.Compile CabalHelper.Compiletime.Data - CabalHelper.Compiletime.Log CabalHelper.Compiletime.Types CabalHelper.Shared.Common CabalHelper.Shared.InterfaceTypes CabalHelper.Shared.Sandbox Paths_cabal_helper build-tool-depends: cabal-install:cabal + build-tools: cabal build-depends: base < 5 && >= 4.7 if os(windows) build-depends: base >= 4.7 @@ -257,7 +222,7 @@ test-suite ghc-session build-depends: unix < 2.8 && >= 2.5.1.1 build-depends: unix-compat < 0.6 && >= 0.4.3.1 , utf8-string < 1.1 && >= 1.0.1.1 - build-tools: cabal + executable cabal-helper-main @@ -269,9 +234,10 @@ executable cabal-helper-main CabalHelper.Shared.Common CabalHelper.Shared.InterfaceTypes CabalHelper.Shared.Sandbox + CabalHelper.Shared.Common - -- This component is usually built at runtime by cabal-helper-wrapper but - -- during development it's convinient to build it via cabal + -- This component is usually built at runtime but during development it's + -- convinient to build it via cabal if flag(dev) buildable: True else -- cgit v1.2.3