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

saw-core fails to build with hashable-1.3.4.0 or later #1472

Closed
RyanGlScott opened this issue Oct 6, 2021 · 0 comments · Fixed by #1474
Closed

saw-core fails to build with hashable-1.3.4.0 or later #1472

RyanGlScott opened this issue Oct 6, 2021 · 0 comments · Fixed by #1474
Labels
tooling: build system Issues involving SAW's build system type: bug Issues reporting bugs or unexpected/unwanted behavior

Comments

@RyanGlScott
Copy link
Contributor

hashable-1.3.4.0 and later include Hashable instances for data types from the containers package, including Map. See this changelog. This causes saw-core to fail to build, as it defines its own orphan Hashable instance for Map:

$ cabal build saw-core --constraint="hashable>=1.3.4.0"
Build profile: -w ghc-8.10.4 -O1
In order, the following will be built (use -v for more details):
 - saw-core-0.1 (lib) (file prelude/Prelude.sawcore changed)
 - saw-core-0.1 (exe:extcore-info) (cannot read state cache)
Preprocessing library for saw-core-0.1..
Building library for saw-core-0.1..
[12 of 40] Compiling Verifier.SAW.Term.Functor ( src/Verifier/SAW/Term/Functor.hs, /home/rscott/Documents/Hacking/Haskell/saw-script/dist-newstyle/build/x86_64-linux/ghc-8.10.4/saw-core-0.1/build/Verifier/SAW/Term/Functor.o, /home/rscott/Documents/Hacking/Haskell/saw-script/dist-newstyle/build/x86_64-linux/ghc-8.10.4/saw-core-0.1/build/Verifier/SAW/Term/Functor.dyn_o ) [Data.Hashable changed]

src/Verifier/SAW/Term/Functor.hs:91:10: error:
    Duplicate instance declarations:
      instance (Hashable k, Hashable a) => Hashable (Map k a)
        -- Defined at src/Verifier/SAW/Term/Functor.hs:91:10
      instance (Hashable k, Hashable v) => Hashable (Map k v)
        -- Defined in ‘hashable-1.3.4.1:Data.Hashable.Class’
   |
91 | instance (Hashable k, Hashable a) => Hashable (Map k a) where
   |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cabal: Failed to build saw-core-0.1 (which is required by exe:extcore-info
from saw-core-0.1).

On the other hand, the build succeeds if you specify --constraint="hashable<1.3.4.0" instead.

@RyanGlScott RyanGlScott added type: bug Issues reporting bugs or unexpected/unwanted behavior tooling: build system Issues involving SAW's build system labels Oct 6, 2021
RyanGlScott added a commit that referenced this issue Oct 11, 2021
Issue #1472 is caused by `saw-core` defining an orphan `Hashable` instance
for `Map` that clashes with an instance introduced in `hashable-1.3.4.0`. To
fix the issue, simply depend on `hashable-1.3.4.0` or later to ensure that the
instance is always available, which allows removing the orphan instance
entirely.

Fixes #1472.
@mergify mergify bot closed this as completed in #1474 Oct 11, 2021
mergify bot added a commit that referenced this issue Oct 11, 2021
Fix #1472 by depending on `hashable-1.3.4.0` or later
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tooling: build system Issues involving SAW's build system type: bug Issues reporting bugs or unexpected/unwanted behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant