[commit: packages/binary] master: In test-suites and benchmarks, depend on source (d9e361f)

git at git.haskell.org git at git.haskell.org
Sun Dec 14 17:54:53 UTC 2014


Repository : ssh://git@git.haskell.org/binary

On branch  : master
Link       : http://git.haskell.org/packages/binary.git/commitdiff/d9e361fd92e3183a8b536a74508e64726538b437

>---------------------------------------------------------------

commit d9e361fd92e3183a8b536a74508e64726538b437
Author: Lennart Kolmodin <kolmodin at gmail.com>
Date:   Sun May 11 15:00:31 2014 +0400

    In test-suites and benchmarks, depend on source
    
    Depend directly on the source of binary, instead of the library itself.
    This is unfortunate as it complicates the cabal file, but we have to in
    order to remove circular dependencies when installing dependencies of
    the test-suites and benchmarks.


>---------------------------------------------------------------

d9e361fd92e3183a8b536a74508e64726538b437
 binary.cabal | 32 ++++++++++++++++++++------------
 1 file changed, 20 insertions(+), 12 deletions(-)

diff --git a/binary.cabal b/binary.cabal
index e9b6bde..8ed0e95 100644
--- a/binary.cabal
+++ b/binary.cabal
@@ -56,78 +56,86 @@ library
 
   ghc-options:     -O2 -Wall -fliberate-case-threshold=1000
 
+-- Due to circular dependency, we cannot make any of the test-suites or
+-- benchmark depend on the binary library. Instead, for each test-suite and
+-- benchmark, we include the source directory of binary and build-depend on all
+-- the dependencies binary has.
+
 test-suite qc
   type:  exitcode-stdio-1.0
-  hs-source-dirs: tests
+  hs-source-dirs: src tests
   main-is: QC.hs
   other-modules:
     Action
     Arbitrary
   build-depends:
-    array,
     base >= 3.0 && < 5,
     bytestring >= 0.9,
-    containers,
     random>=1.0.1.0,
     test-framework,
     test-framework-quickcheck2 >= 0.3,
     QuickCheck>=2.7
 
+  -- build dependencies from using binary source rather than depending on the library
+  build-depends: array, containers
   ghc-options: -Wall -O2 -threaded
-  hs-source-dirs: src
 
 test-suite read-write-file
   type:  exitcode-stdio-1.0
-  hs-source-dirs: tests
+  hs-source-dirs: src tests
   main-is: File.hs
   build-depends:
     base >= 3.0 && < 5,
     bytestring >= 0.9,
-    binary,
     Cabal,
     directory,
     filepath,
     HUnit
 
+  -- build dependencies from using binary source rather than depending on the library
+  build-depends: array, containers
   ghc-options: -Wall
 
 benchmark bench
   type: exitcode-stdio-1.0
-  hs-source-dirs: benchmarks
+  hs-source-dirs: src benchmarks
   main-is: Benchmark.hs
   other-modules: MemBench
   build-depends:
     base >= 3.0 && < 5,
-    binary,
     bytestring
+  -- build dependencies from using binary source rather than depending on the library
+  build-depends: array, containers
   c-sources: benchmarks/CBenchmark.c
   include-dirs: benchmarks
   ghc-options: -O2
 
 benchmark get
   type: exitcode-stdio-1.0
-  hs-source-dirs: benchmarks
+  hs-source-dirs: src benchmarks
   main-is: Get.hs
   build-depends:
     attoparsec,
     base >= 3.0 && < 5,
-    binary,
     bytestring,
     cereal,
     criterion,
     deepseq,
     mtl
+  -- build dependencies from using binary source rather than depending on the library
+  build-depends: array, containers
   ghc-options: -O2
 
 benchmark builder
   type: exitcode-stdio-1.0
-  hs-source-dirs: benchmarks
+  hs-source-dirs: src benchmarks
   main-is: Builder.hs
   build-depends:
     base >= 3.0 && < 5,
-    binary,
     bytestring,
     criterion,
     deepseq,
     mtl
+  -- build dependencies from using binary source rather than depending on the library
+  build-depends: array, containers
   ghc-options: -O2



More information about the ghc-commits mailing list