【问题标题】:Can't install Grapefruit on Windows 10无法在 Windows 10 上安装葡萄柚
【发布时间】:2018-08-29 07:15:48
【问题描述】:

运行 cabal install 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 版本:

Glorious Glasgow Haskell 编译系统,版本 8.4.3

阴谋版:

cabal-install version 2.2.0.0 使用 2.2.0.1 编译的 阴谋集团图书馆

什么可能导致此问题?我尝试使用 cabal init 将其安装在新目录中,但似乎没有任何效果。

【问题讨论】:

标签: haskell cabal


【解决方案1】:

这是一个known issue,TypeCompose 低于 8.4,has been fixed,但尚未安装 Hackage。

您也许可以使用旧版本的 GHC(请参阅this question)配置您的 cabal 命令,例如 8.2.2,它不应该有这个问题。

或者,使用 stack,它可以让您切换每个项目的 ghc 版本,并在 LTS resolver 上提供 8.2.2 的 TypeCompose。

【讨论】:

  • 我已经这样做了,现在我得到一个完全不同的错误:src\Graphics\UI\Grapefruit\GTK.hs:182:67: error: *无法匹配预期类型 Maybe model0' with actual type Gtk.ListStore el'
  • 显然 8.4.3 兼容版本已经发布到 Hackage - 你有没有运气尝试用那个 GHC 版本再次安装它?
猜你喜欢
  • 2018-11-30
  • 2020-11-02
  • 2020-05-03
  • 2021-06-18
  • 2017-05-12
  • 2019-05-08
  • 2017-01-25
  • 1970-01-01
相关资源
最近更新 更多