Ryoichiro Oka
Ryoichiro Oka

Reputation: 1997

Hidden package binary-0.7.5.0?

I get this error:

Could not find module ‘Data.Binary’
It is a member of the hidden package ‘binary-0.7.5.0@binar_IvYoLp9H6Xy3zEH13MmZwd’.

as I import Data.Binary in my stack project with GHCi version 7.10.2.

Strange things are that this does not appear if I execute the GHCi through stack exec ghci, and that I cannot install newer versions of binary package through stack, which looks:

D:\p>stack install binary
Setting codepage to UTF-8 (65001) to ensure correct output from GHC
NOTE: the install command is functionally equivalent to 'build --copy-bins'

D:\p>stack install binary-0.7.6.1
Setting codepage to UTF-8 (65001) to ensure correct output from GHC
NOTE: the install command is functionally equivalent to 'build --copy-bins'
Error parsing targets: Specified target version 0.7.6.1 for package binary does not match snapshot version 0.7.5.0

D:\p>stack install binary-0.7.5.0
Setting codepage to UTF-8 (65001) to ensure correct output from GHC
NOTE: the install command is functionally equivalent to 'build --copy-bins'

How would you get around this problem?

Upvotes: 2

Views: 308

Answers (1)

josejuan
josejuan

Reputation: 9566

Add binary dependency to your cabal file.

build-depends:       base >= 4.7 && < 5
                   , binary >= 0.7.5

When you use stack install you are installing certain library or executable but not as dependency (e.g. is a utility like yesod or some library you are using only inside ghci ...).

Upvotes: 5

Related Questions