0

I am trying to install the diagrams package written in haskell using Cabal. I get the following errors when I run cabal install diagrams

[~]$ cabal install diagrams
Resolving dependencies...
In order, the following will be installed:
bytes-0.15.2 (via: linear-1.20.4) (reinstall) (changes: binary-0.8.2.1 -> 0.6.4.0)
linear-1.20.4 (via: diagrams-contrib-1.3.0.8 force-layout-0.4.0.3 diagrams-lib-1.3.1.1 diagrams-core-1.3.0.6 active-0.2.0.8) (new package)
active-0.2.0.8 (via: diagrams-lib-1.3.1.1) (new package)
diagrams-core-1.3.0.6 (via: diagrams-1.3.0.1 diagrams-contrib-1.3.0.8 diagrams-svg-1.4 diagrams-lib-1.3.1.1) (new package)
diagrams-lib-1.3.1.1 (via: diagrams-1.3.0.1 diagrams-contrib-1.3.0.8 diagrams-svg-1.4) (new package)
diagrams-svg-1.4 (via: diagrams-1.3.0.1) (new package)
force-layout-0.4.0.3 (via: diagrams-contrib-1.3.0.8) (new package)
diagrams-contrib-1.3.0.8 (via: diagrams-1.3.0.1) (new package)
diagrams-1.3.0.1 (new package)
Warning: Note that reinstalls are always dangerous. Continuing anyway...
[1 of 1] Compiling Main             ( /tmp/cabal-tmp-12921/bytes-0.15.2/dist/setup/setup.hs, /tmp/cabal-tmp-12921/bytes-0.15.2/dist/setup/Main.o )
Linking /tmp/cabal-tmp-12921/bytes-0.15.2/dist/setup/setup ...
Configuring bytes-0.15.2...
Building bytes-0.15.2...
Preprocessing library bytes-0.15.2...
[1 of 5] Compiling Data.Bytes.Signed ( src/Data/Bytes/Signed.hs, dist/build/Data/Bytes/Signed.o )
[2 of 5] Compiling Data.Bytes.VarInt ( src/Data/Bytes/VarInt.hs, dist/build/Data/Bytes/VarInt.o )
[3 of 5] Compiling Data.Bytes.Put   ( src/Data/Bytes/Put.hs, dist/build/Data/Bytes/Put.o )
[4 of 5] Compiling Data.Bytes.Get   ( src/Data/Bytes/Get.hs, dist/build/Data/Bytes/Get.o )

src/Data/Bytes/Get.hs:205:15:
    Not in scope: `B.lookAhead'
    Perhaps you meant one of these:
      `S.lookAhead' (imported from Data.Serialize.Get),
      `S.lookAheadM' (imported from Data.Serialize.Get),
      `S.lookAheadE' (imported from Data.Serialize.Get)

src/Data/Bytes/Get.hs:207:16:
    Not in scope: `B.lookAheadM'
    Perhaps you meant one of these:
      `S.lookAheadM' (imported from Data.Serialize.Get),
      `S.lookAhead' (imported from Data.Serialize.Get),
      `S.lookAheadE' (imported from Data.Serialize.Get)

src/Data/Bytes/Get.hs:209:16:
    Not in scope: `B.lookAheadE'
    Perhaps you meant one of these:
      `S.lookAheadE' (imported from Data.Serialize.Get),
      `S.lookAhead' (imported from Data.Serialize.Get),
      `S.lookAheadM' (imported from Data.Serialize.Get)
Failed to install bytes-0.15.2
cabal: Error: some packages failed to install:
active-0.2.0.8 depends on bytes-0.15.2 which failed to install.
bytes-0.15.2 failed during the building phase. The exception was:
ExitFailure 1
diagrams-1.3.0.1 depends on bytes-0.15.2 which failed to install.
diagrams-contrib-1.3.0.8 depends on bytes-0.15.2 which failed to install.
diagrams-core-1.3.0.6 depends on bytes-0.15.2 which failed to install.
diagrams-lib-1.3.1.1 depends on bytes-0.15.2 which failed to install.
diagrams-svg-1.4 depends on bytes-0.15.2 which failed to install.
force-layout-0.4.0.3 depends on bytes-0.15.2 which failed to install.
linear-1.20.4 depends on bytes-0.15.2 which failed to install.

I have installed bytes-0.15.2 separately with cabal using the command cabal install bytes. What could be going wrong? When installing diagrams cabal seems to be needlessly trying to install bytes again.

What can I do to fix these compilation errors?

I am running this on an Ubuntu 14.04 with ghc version 7.6.3 and cabal version 1.22.7.0

duplode
  • 33,731
  • 7
  • 79
  • 150
smilingbuddha
  • 14,334
  • 33
  • 112
  • 189
  • 1
    cabal-install is reinstalling bytes because it depends on binary; binary’s version is being changed from 0.8 to 0.6 because linear depends on binary<0.8. bytes is apparently misreporting its binary dependency because it’s using functions that aren’t present in 0.6. (Welcome to Haskell!) Try explicitly installing previous versions of bytes (0.15, 0.15.0.1, 0.15.1); since the maintainers of linear have set bytes>=0.15, it must not have always been broken. – Ry- Feb 29 '16 at 01:30
  • @RyanO'Hara Thank you for the response! Can you tell me how to do that? Do I need to modify my cabal command to install diagrams for this? – smilingbuddha Feb 29 '16 at 01:36
  • `cabal install bytes==0.15.1 diagrams` should do it. – Ry- Feb 29 '16 at 01:37
  • 2
    You can also use stack to install diagrams; it's just `stack install diagrams`. Cabal-install is lovely in many ways, but it often breaks in the face of older packages with loose bounds. (If you do stick with cabal-install, I also recommend that you use a sandbox.) https://github.com/commercialhaskell/stack – hao Feb 29 '16 at 01:40
  • @RyanO'Hara Nope! Got the same error message with 0.15.1 in place of 0.15.2 – smilingbuddha Feb 29 '16 at 01:46
  • @smilingbuddha: So try 0.15.0.1, then 0.15. – Ry- Feb 29 '16 at 01:49
  • @haoformayor I think the underlying problem here is that the user is running ghc 7.6. Stackage isn't compat with that stuff -- the advantage for the user with stack would just be that it would install a more recent ghc... – sclv Feb 29 '16 at 18:01

0 Answers0