首页 > 解决方案 > 我正在尝试运行 cabal build,但出现以下错误

问题描述

Build profile: -w ghc-9.0.1 -O1
In order, the following will be built (use -v for more details):
 - csound-expression-dynamic-0.3.8 (lib) (requires build)
 - csound-expression-typed-0.2.7 (lib) (requires build)
 - csound-expression-opcodes-0.0.5.1 (lib) (requires build)
 - csound-expression-5.3.4 (lib) (requires build)
 - csound-sampler-0.0.10.0 (lib) (requires build)
 - csound-catalog-0.7.4 (lib) (requires build)
 - solve-0.2.0.0 (exe:solve) (first run)
Starting     csound-expression-dynamic-0.3.8 (lib)
Building     csound-expression-dynamic-0.3.8 (lib)

Failed to build csound-expression-dynamic-0.3.8.
Build log (
C:\Users\Shiro\AppData\Roaming\cabal\logs\ghc-9.0.1\csound-expres_-0.3.8-3e9f98bb37e846ae1dd789bc6c80c4d50504a214.log
):
Preprocessing library for csound-expression-dynamic-0.3.8..
Building library for csound-expression-dynamic-0.3.8..
[ 1 of 15] Compiling Csound.Dynamic.Tfm.DeduceTypes ( src\Csound\Dynamic\Tfm\DeduceTypes.hs, dist\build\Csound\Dynamic\Tfm\DeduceTypes.o )
[ 2 of 15] Compiling Csound.Dynamic.Tfm.UnfoldMultiOuts ( src\Csound\Dynamic\Tfm\UnfoldMultiOuts.hs, dist\build\Csound\Dynamic\Tfm\UnfoldMultiOuts.o )
[ 3 of 15] Compiling Csound.Dynamic.Types.Exp ( src\Csound\Dynamic\Types\Exp.hs, dist\build\Csound\Dynamic\Types\Exp.o )

src\Csound\Dynamic\Types\Exp.hs:202:66: error:
    * No instance for (Data.Functor.Classes.Eq1 RatedExp)
        arising from a use of `=='
    * In the second argument of `(&&)', namely
        `(ratedExpExp re == EmptyExp)'
      In the expression:
        isNothing (ratedExpDepends re) && (ratedExpExp re == EmptyExp)
      In an equation for `isEmptyExp':
          isEmptyExp e
            = isNothing (ratedExpDepends re) && (ratedExpExp re == EmptyExp)
            where
                re = unFix e
    |
202 | isEmptyExp e = isNothing (ratedExpDepends re) && (ratedExpExp re == EmptyExp)
    |                                                                  ^^
cabal.exe: Failed to build csound-expression-dynamic-0.3.8 (which is required
by exe:solve from solve-0.2.0.0). See the build log above for details.

这是我第一次接触 Haskell 和 Cabal。所以,据我了解,我需要solve.exe,它需要csound-expression-dynamic-0.3.8,它需要别的东西。我如何让它工作?

标签: haskellcabalcabal-install

解决方案


它似乎csound-expression-dynamic与 GHC 9.0.1 不兼容。试试 GHC 8.10.7,它仍然是一般使用的推荐版本。

我在他们的 GitHub 页面上打开了一个关于此的问题:https ://github.com/spell-music/csound-expression-dynamic/issues/2 。


推荐阅读