0

When running cabal install grapefruit-ui-gtk I get build errors on the dependency TypeCompose. The exact command I run is

cabal install grapefruit-ui-gtk

and get the following error output:

Resolving dependencies...
Configuring TypeCompose-0.9.12...
Configuring hashtables-1.2.3.1...
Building TypeCompose-0.9.12...
Building hashtables-1.2.3.1...
Failed to install TypeCompose-0.9.12
Build log ( C:\Users\me\AppData\Roaming\cabal\logs\ghc-8.4.3\TypeCompose-0.9.12-4FepCXFvbF94E2D2EggnNC.log ):
Preprocessing library for TypeCompose-0.9.12..
Building library for TypeCompose-0.9.12..
src\Data\Title.hs:1:33: warning:
    -XOverlappingInstances is deprecated: instead use per-instance pragmas OVERLAPPING/OVERLAPPABLE/OVERLAPS
  |
1 | {-# LANGUAGE FlexibleInstances, OverlappingInstances, TypeOperators, TypeSynonymInstances #-}
  |                                 ^^^^^^^^^^^^^^^^^^^^
[ 1 of 10] Compiling Control.Instances ( src\Control\Instances.hs, dist\build\Control\Instances.o )
[ 2 of 10] Compiling Data.Bijection   ( src\Data\Bijection.hs, dist\build\Data\Bijection.o )
[ 3 of 10] Compiling Control.Compose  ( src\Control\Compose.hs, dist\build\Control\Compose.o )
src\Control\Compose.hs:596:10: error:
    * Could not deduce (Semigroup (Flip j o a))
        arising from the superclasses of an instance declaration
      from the context: (Applicative (j a), Monoid o)
        bound by the instance declaration
        at src\Control\Compose.hs:596:10-61
    * In the instance declaration for `Monoid (Flip j o a)'
    |
596 | instance (Applicative (j a), Monoid o) => Monoid (Flip j o a) where
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src\Control\Compose.hs:645:10: error:
    * Could not deduce (Semigroup (App f m))
        arising from the superclasses of an instance declaration
      from the context: (Applicative f, Monoid m)
        bound by the instance declaration
        at src\Control\Compose.hs:645:10-54
    * In the instance declaration for `Monoid (App f m)'
    |
645 | instance (Applicative f, Monoid m) => Monoid (App f m) where
    |          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
src\Control\Compose.hs:851:1: error:
    * Could not deduce (Semigroup (Arrw j f g a))
        arising from the superclasses of an instance declaration
      from the context: Monoid (j (f a) (g a))
        bound by the instance declaration
        at src\Control\Compose.hs:851:1-63
    * In the instance declaration for `Monoid (Arrw j f g a)'
    |
851 | deriving instance Monoid (f a `j` g a) => Monoid (Arrw j f g a)
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
cabal: Leaving directory 'C:\Users\me\AppData\Local\Temp\cabal-tmp-17748\TypeCompose-0.9.12'
Installed hashtables-1.2.3.1
cabal.exe: Error: some packages failed to install:
TypeCompose-0.9.12-4FepCXFvbF94E2D2EggnNC failed during the building phase.
The exception was:
ExitFailure 1
grapefruit-frp-0.1.0.7-28vOfRvsiGH71mjsrgG35Q depends on
grapefruit-frp-0.1.0.7 which failed to install.
grapefruit-records-0.1.0.7-Ih2DxRIbFnG7TB7BHtPbwq depends on
grapefruit-records-0.1.0.7 which failed to install.
grapefruit-ui-0.1.0.7-DMol4wZpyyFEHFP2NRKthr depends on grapefruit-ui-0.1.0.7
which failed to install.
grapefruit-ui-gtk-0.1.0.7-EsNz0f5KGlp47W2BX85WRG depends on
grapefruit-ui-gtk-0.1.0.7 which failed to install.

GHC Version:

The Glorious Glasgow Haskell Compilation System, version 8.4.3

Cabal version:

cabal-install version 2.2.0.0 compiled using version 2.2.0.1 of the Cabal library

What could be causing this issue? I have tried installing it in a fresh directory with cabal init, and that didn't seem to have any effect.

Isaac van Bakel
  • 1,772
  • 10
  • 22
zcleghern
  • 827
  • 7
  • 21
  • It looks like the dependency bounds on the problematic version of `TypeCompose` have been fixed: https://hackage.haskell.org/package/TypeCompose-0.9.12/revisions/ – sjakobi Jan 29 '22 at 16:27

1 Answers1

2

This is a known issue with TypeCompose under 8.4, which has been fixed but not put on Hackage yet.

You might be able to configure your cabal commands with an older version of GHC (see this question), such as 8.2.2, which shouldn't have this issue.

Alternatively, use stack, which will let you switch ghc versions per-project, and which provides TypeCompose for 8.2.2 on the LTS resolver.

Isaac van Bakel
  • 1,772
  • 10
  • 22
  • I have done this, and now I'm getting an entirely *different* error: src\Graphics\UI\Grapefruit\GTK.hs:182:67: error: * Couldn't match expected type `Maybe model0' with actual type `Gtk.ListStore el' – zcleghern Aug 30 '18 at 01:20
  • Apparently the 8.4.3 compatible version has been released to Hackage - have you had any luck trying to install it again with that GHC version? – Isaac van Bakel Sep 09 '18 at 01:24