]> gitweb.michael.orlitzky.com - mailbox-count.git/commitdiff
mailbox-count.cabal: depend on semigroups conditionally.
authorMichael Orlitzky <michael@orlitzky.com>
Sun, 2 Feb 2020 17:26:47 +0000 (12:26 -0500)
committerMichael Orlitzky <michael@orlitzky.com>
Sun, 2 Feb 2020 17:26:47 +0000 (12:26 -0500)
Just kidding, when the semigroups package promises "a backwards-
compatible API," what they mean is that they deleted the entire source
tree in the minor release 0.18.2 and nothing works at all. So instead,
we need to do a version check on GHC within the cabal file, and
conditionally depend on a version of semigroups before 0.18.2.

mailbox-count.cabal

index 0f14055e24b054b973bed0fd64261a5d08a79609..6b0716ed305aa0198fd220686492d4320bca6044 100644 (file)
@@ -163,9 +163,13 @@ executable mailbox-count
     HDBC-postgresql             >= 2.3,
     HDBC-sqlite3                >= 2.3,
     MissingH                    >= 1.2,
-    semigroups                  >= 0.18,
     tasty                       >= 0.8,
     tasty-hunit                 >= 0.8
+  -- Data.Semigroup was added to GHC.Base in ghc-8.0
+  if impl(ghc < 8.0)
+     -- The minor version 0.18.2 deleted the entire API?
+     build-depends: semigroups < 0.18.2
+
   main-is:
     Main.hs
 
@@ -210,10 +214,12 @@ test-suite testsuite
     HDBC-postgresql             >= 2.3,
     HDBC-sqlite3                >= 2.3,
     MissingH                    >= 1.2,
-    semigroups                  >= 0.18,
     tasty                       >= 0.8,
     tasty-hunit                 >= 0.8
-
+  -- Data.Semigroup was added to GHC.Base in ghc-8.0
+  if impl(ghc < 8.0)
+     -- The minor version 0.18.2 deleted the entire API?
+     build-depends: semigroups < 0.18.2
 
 
 test-suite doctests