NorfairKing / validity

Validity and validity-based testing
https://www.youtube.com/watch?v=eIs9qNh17SM
MIT License
156 stars 31 forks source link

validity-path-0.4.0.1: Overlapping instances for Eq (Maybe (Path Rel Dir)) #115

Closed juhp closed 1 year ago

juhp commented 1 year ago

I hit this while trying to build new Stackage LTS 21.14

       /var/stackage/work/unpack-dir/unpacked/validity-path-0.4.0.1-0ece151d5a19f4eeb6e9460b07bb4972bfce423e4a76cc0e3cf31398773a0706/src/Data/Validity/Path.hs:130:30: error:
           • Overlapping instances for Eq (Maybe (Path Rel Dir))
               arising from a use of ‘==’
             Matching instance:
               instance Eq a => Eq (Maybe a) -- Defined in ‘GHC.Maybe’
             There exists a (perhaps superclass) match:
             (To pick the first instance above, use IncoherentInstances
              when compiling the other instance declarations)
           • In the second argument of ‘($)’, namely
               ‘parseRelDir fp == Just p’
             In the expression:
               declare
                 "The path can be identically parsed as a relative directory path."
                 $ parseRelDir fp == Just p
             In the first argument of ‘mconcat’, namely
               ‘[declare "The path is relative." $ FilePath.isRelative fp,
                 declare "The path has a trailing path separator."
                   $ FilePath.hasTrailingPathSeparator fp,
                 declare "System.FilePath considers the path valid."
                   $ FilePath.isValid fp,
                 declare "The path is not empty." $ not (null fp), ....]’
           |
       130 |               parseRelDir fp == Just p
           |                              ^^
juhp commented 1 year ago

So I had to disable genvalidity-path too

NorfairKing commented 1 year ago

How is that even possible? Where do two instances like this come from:

           • Overlapping instances for Eq (Maybe (Path Rel Dir))
               arising from a use of ‘==’
             Matching instance:
               instance Eq a => Eq (Maybe a) -- Defined in ‘GHC.Maybe’
NorfairKing commented 1 year ago

I can't repro this because GHC 9.6.3 isn't in nixpkgs yet and lts-21.14 isn't out yet.

NorfairKing commented 1 year ago

PR welcome, I guess. I'm a bit sick of having to keep up with base upgrades breaking things that are really not fancy.

NorfairKing commented 1 year ago

I'm building with GHC 9.8 and still can't repro it. @juhp how did you?

NorfairKing commented 1 year ago

Can't fix it if I can't repro it.

juhp commented 1 year ago

Well LTS 21 is ghc-9.4.7

I haven't tried to reproduce this locally, but if i were going to I would try something like stack --resolver lts build.