Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unordered-containers-0.2.20 fails to build with hashable < 1.4 #487

Open
RyanGlScott opened this issue Jan 10, 2024 · 4 comments
Open

unordered-containers-0.2.20 fails to build with hashable < 1.4 #487

RyanGlScott opened this issue Jan 10, 2024 · 4 comments

Comments

@RyanGlScott
Copy link
Contributor

unordered-containers-0.2.20 fails to build when using a version of hashable older than 1.4.*:

$ cabal build --constraint="hashable<1.4" -w ghc-9.2
Build profile: -w ghc-9.2.8 -O1
In order, the following will be built (use -v for more details):
 - unordered-containers-0.2.20 (lib) (first run)
Preprocessing library for unordered-containers-0.2.20..
Building library for unordered-containers-0.2.20..
[4 of 9] Compiling Data.HashMap.Internal.Debug ( Data/HashMap/Internal/Debug.hs, /home/ryanscott/Documents/Hacking/Haskell/unordered-containers-0.2.20/dist-newstyle/build/x86_64-linux/ghc-9.2.8/unordered-containers-0.2.20/build/Data/HashMap/Internal/Debug.o, /home/ryanscott/Documents/Hacking/Haskell/unordered-containers-0.2.20/dist-newstyle/build/x86_64-linux/ghc-9.2.8/unordered-containers-0.2.20/build/Data/HashMap/Internal/Debug.dyn_o )

Data/HashMap/Internal/Debug.hs:99:15-27: error:
    • Could not deduce (Eq k) arising from a use of ‘validInternal’
      from the context: Hashable k
        bound by the type signature for:
                   valid :: forall k v. Hashable k => HashMap k v -> Validity k
        at Data/HashMap/Internal/Debug.hs:97:1-48
      Possible fix:
        add (Eq k) to the context of
          the type signature for:
            valid :: forall k v. Hashable k => HashMap k v -> Validity k
    • In the expression: validInternal initialSubHashPath t
      In an equation for ‘valid’:
          valid t
            = validInternal initialSubHashPath t
            where
                validInternal p Empty = Invalid INV1_internal_Empty p
                validInternal p (Leaf h l) = validHash p h <> validLeaf p h l
                validInternal p (Collision h ary)
                  = validHash p h <> validCollision p h ary
                validInternal p (BitmapIndexed b ary) = validBitmapIndexed p b ary
                validInternal p (Full ary) = validFull p ary
                validHash p h
                  | hashMatchesSubHashPath p h = Valid
                  | otherwise = Invalid (INV6_misplaced_hash h) p
                validLeaf p h (L k _)
                  | hash k == h = Valid
                  | otherwise = Invalid (INV7_key_hash_mismatch k h) p
                validCollision p h ary
                  = validCollisionSize
                      <> A.foldMap (validLeaf p h) ary <> distinctKeys
                  where
                      n = A.length ary
                      validCollisionSize
                        | n < 2 = Invalid (INV9_Collision_size n) p
                        | otherwise = Valid
                      ....
                ....
   |
99 | valid t     = validInternal initialSubHashPath t
   |               ^^^^^^^^^^^^^
Error: cabal: Failed to build unordered-containers-0.2.20.

unordered-containers-0.2.19.1 does not have this issue, based on my local testing.

@HuwCampbell
Copy link

I hit this one here. A package revision would seem to be in order.

@treeowl
Copy link
Collaborator

treeowl commented Jan 11, 2024

Oof. I should be able to do that today. I think we broke that comparability intentionally, but forgot to change the bound.

@treeowl
Copy link
Collaborator

treeowl commented Jan 11, 2024

Okay, I just published a Hackage revision. Let's keep this issue open to fix it properly.

@HuwCampbell
Copy link

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants