在运行cabal安装grapefruit-ui-gtk时,我在依赖项TypeCompose上生成了构建错误。我运行的确切命令是
cabal install grapefruit-ui-gtk
并获得以下错误输出:
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版本:
荣耀的格拉斯哥Haskell编译系统,版本8.4.3
Cabal版本:
使用2.2.0.1版的 阴谋图书馆
什么可能导致此问题?我尝试将其安装在带有cabal init的新目录中,但这似乎没有任何效果。
答案 0 :(得分:2)
这是known issue,TypeCompose低于8.4,has been fixed但尚未放入Hackage。
您也许可以使用较早版本的GHC(请参阅this question)(例如8.2.2)来配置cabal
命令,而不会出现此问题。
或者,使用stack
,这将使您可以按项目切换ghc版本,并在LTS resolver上为8.2.2提供TypeCompose。