leepike / SmartCheck

A Smarter QuickCheck
BSD 3-Clause "New" or "Revised" License
102 stars 2 forks source link

SmartCheck not compiling with GHC 8.0.2 or QuickCheck 2.10.* #9

Closed rudymatela closed 7 years ago

rudymatela commented 7 years ago

Hello,

I think SmartCheck-0.2.2 does not compile under GHC 8.0.2 or with QuickCheck 2.10.*. Though this may be just my system misbehaving. I have tried the following.

Starting from a fresh home directory, I did:

$ cabal update
Downloading the latest package list from hackage.haskell.org
$ cabal install smartcheck
Resolving dependencies...
Downloading smartcheck-0.2.2...
Configuring smartcheck-0.2.2...
Building smartcheck-0.2.2...
Failed to install smartcheck-0.2.2
Build log ( /home/testuser/.cabal/logs/smartcheck-0.2.2.log ):
cabal: Entering directory '/tmp/cabal-tmp-30973/smartcheck-0.2.2'
Configuring smartcheck-0.2.2...
Building smartcheck-0.2.2...
Preprocessing library smartcheck-0.2.2...
<command line>: cannot satisfy -package-id QuickCheck-2.10.0.1-ALuGysu7txTB2VnkPyDuTq
    (use -v for more information)
cabal: Leaving directory '/tmp/cabal-tmp-30973/smartcheck-0.2.2'
cabal: Error: some packages failed to install:
smartcheck-0.2.2 failed during the building phase. The exception was:
ExitFailure 1

After some fiddling around, I installed the immediately previous version of QuickCheck (2.9.2):

$ cabal install tf-random primitive random generic-deriving mtl --reinstall --force-reinstalls
...
$ cabal install QuickCheck-2.9.2
...
Installed QuickCheck-2.9.2

When I try to install install SmartCheck bound with QuickCheck-2.9.2, I get a compilation error message:

$ cabal install smartcheck --constraint 'QuickCheck <= 2.9.2'
Resolving dependencies...
Configuring smartcheck-0.2.2...
Building smartcheck-0.2.2...
Failed to install smartcheck-0.2.2
Build log ( /home/testuser/.cabal/logs/smartcheck-0.2.2.log ):
cabal: Entering directory '/tmp/cabal-tmp-1490/smartcheck-0.2.2'
Configuring smartcheck-0.2.2...
Building smartcheck-0.2.2...
Preprocessing library smartcheck-0.2.2...

src/Test/SmartCheck/Types.hs:6:14: warning:
    -XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS
[ 1 of 11] Compiling Test.SmartCheck.Types ( src/Test/SmartCheck/Types.hs, dist/build/Test/SmartCheck/Types.o )

src/Test/SmartCheck/Types.hs:256:10: error:
    • No instance for (Generic Char)
        arising from a use of ‘Test.SmartCheck.Types.$dmsubTypes’
    • In the expression: Test.SmartCheck.Types.$dmsubTypes @Char
      In an equation for ‘subTypes’:
          subTypes = Test.SmartCheck.Types.$dmsubTypes @Char
      In the instance declaration for ‘SubTypes Char’

...

src/Test/SmartCheck/Types.hs:259:10: error:
    • No instance for (Generic Int)
        arising from a use of ‘Test.SmartCheck.Types.$dmshowForest’
    • In the expression: Test.SmartCheck.Types.$dmshowForest @Int
      In an equation for ‘showForest’:
          showForest = Test.SmartCheck.Types.$dmshowForest @Int
      In the instance declaration for ‘SubTypes Int’
cabal: Leaving directory '/tmp/cabal-tmp-1490/smartcheck-0.2.2'
cabal: Error: some packages failed to install:
smartcheck-0.2.2 failed during the building phase. The exception was:
ExitFailure 1

This may be my system, but it seems this issue is related to the fact that Generic instances have been removed from base types starting with GHC 8.0. See comment number 7 from GHC ticket 10532. See also this issue from lens and this issue from optparse.

I am using GHC 8.0.2, cabal-install 1.24.0.2 and Cabal 1.24.2.0.

I tried installing under GHC 7.10 and it worked fine.

leepike commented 7 years ago

You're right. I needed to access the internals of QC, and those have changed (and there were some other bugs related to changes in GHC Generics). I have it building, but it's not behaving correctly, which I suspect is due to issues in the interaction with QC. This is going to take me a bit of time to investigate, and I won't have much time for the next week. By when do you need the fix?

rudymatela commented 7 years ago

Hi Lee,

There is no rush really. I was just reporting the issue so you are aware of it :-).

As I mentioned in the bug report, it works fine under GHC 7.10. So, I am using SmartCheck-0.2.2 with GHC 7.10 compiled against QuickCheck 2.8.2 and it is working perfectly.

Thanks!

leepike commented 7 years ago

Fixed as of 43b4ae0. Note that for now, we've pinned to QuickCheck 2.8.2, until I get around to (1) updating the QC internals to match the latest version, or (2) depending on something other QC. :)