2

最近我尝试通过 cabal install 在 OS X 10.9 上安装 fpco-api,但在构建阶段出现错误。以下是错误列表:

... lots of 'loading package'
Loading package asn1-data-0.7.1 ... linking ... done.
Loading package asn1-types-0.2.3 ... linking ... done.
Loading package crypto-pubkey-types-0.4.1 ... linking ... done.
Loading package pem-0.2.1 ... linking ... done.
Loading package certificate-1.3.9 ... linking ... done.
Loading package publicsuffixlist-0.1 ... linking ... done.
Loading package regex-base-0.93.2 ... linking ... done.
Loading package regex-posix-0.95.2 ... linking ... done.
Loading package regex-compat-0.95.1 ... linking ... done.
Loading package socks-0.5.4 ... linking ... done.
Loading package crypto-numbers-0.2.3 ... linking ... done.
Loading package crypto-pubkey-0.2.4 ... linking ... done.
Loading package tls-1.1.5 ... linking ... done.
Loading package cipher-rc4-0.1.4 ... linking ... done.
Loading package tls-extra-0.6.6 ... linking ... done.
Loading package http-conduit-1.9.6 ... linking ... done.
Loading package hslogger-1.2.3 ... linking ... done.
Loading package MissingH-1.2.0.2 ... linking ... done.
Loading package ConfigFile-1.1.1 ... linking ... done.
[ 5 of 10] Compiling FP.API.Run ( src/library/FP/API/Run.hs, dist/build/FP/API/Run.o )

src/library/FP/API/Run.hs:37:1: Warning:
Module `Prelude' does not export `catch'
[ 6 of 10] Compiling FP.API.TH ( src/library/FP/API/TH.hs, dist/build/FP/API/TH.o )
[ 7 of 10] Compiling FP.Server.Types ( src/library/FP/Server/Types.hs, dist/build/FP/Server/Types.o )

src/library/FP/Server/Types.hs:97:36:
Ambiguous occurrence `Loc'
It could refer to either `FP.Server.Types.Loc',
defined at src/library/FP/Server/Types.hs:115:6
or `Control.Monad.Logger.Loc',
imported from `Control.Monad.Logger' at src/library/FP/Server/Types.hs:18:1-27
(and originally defined in `Language.Haskell.TH.Syntax')

src/library/FP/Server/Types.hs:102:46:
Ambiguous occurrence `Loc'
It could refer to either `FP.Server.Types.Loc',
defined at src/library/FP/Server/Types.hs:115:6
or `Control.Monad.Logger.Loc',
imported from `Control.Monad.Logger' at src/library/FP/Server/Types.hs:18:1-27
(and originally defined in `Language.Haskell.TH.Syntax')

src/library/FP/Server/Types.hs:103:46:
Ambiguous occurrence `Loc'
It could refer to either `FP.Server.Types.Loc',
defined at src/library/FP/Server/Types.hs:115:6
or `Control.Monad.Logger.Loc',
imported from `Control.Monad.Logger' at src/library/FP/Server/Types.hs:18:1-27
(and originally defined in `Language.Haskell.TH.Syntax')

src/library/FP/Server/Types.hs:118:17:
Ambiguous occurrence `Loc'
It could refer to either `FP.Server.Types.Loc',
defined at src/library/FP/Server/Types.hs:115:6
or `Control.Monad.Logger.Loc',
imported from `Control.Monad.Logger' at src/library/FP/Server/Types.hs:18:1-27
(and originally defined in `Language.Haskell.TH.Syntax')

src/library/FP/Server/Types.hs:119:19:
Ambiguous occurrence `Loc'
It could refer to either `FP.Server.Types.Loc',
defined at src/library/FP/Server/Types.hs:115:6
or `Control.Monad.Logger.Loc',
imported from `Control.Monad.Logger' at src/library/FP/Server/Types.hs:18:1-27
(and originally defined in `Language.Haskell.TH.Syntax')
Failed to install fpco-api-1.0.5
cabal: Error: some packages failed to install:
fpco-api-1.0.5 failed during the building phase. The exception was:
ExitFailure 1

有谁知道如何处理这个错误?

4

1 回答 1

3

似乎monad-logger包开始导出Loc以 version 开头的符号0.3.4.0。此版本不被 .Cabal 文件排除在外fpco-api

你可以试试

cabal install fpco-api --constraint="monad-logger < 0.3.4"

强制使用旧版本的monad-logger.


关于错误的更多解释:

FP.Server.Types包中的模块fpco-api定义了Loc在整个包中使用的数据类型。该模块Language.Haskell.TH.Syntax定义了不同的数据类型Loc。此模块不直接由使用fpco-api,而是fpco-api使用monad-logger包,而包又使用Language.Haskell.TH.Syntax. 只要在程序中没有任何一点,这两种不同的Loc类型都在范围内,这没有问题。但在其最新版本中0.3.4.0,该monad-logger包决定从 .重新导出Loc数据类型Language.Haskell.TH.Syntax。现在在 logger monad 被导入的许多地方fpco-api,突然这两种Loc类型都在范围内,而 GHC 不知道本地出现的Loc引用是哪一种。

The proper fix for this error is for fpco-api to be hiding the Loc re-export from the logger monad, or to explicitly refer to the right one by using qualified names. But this requires a source code update of fpco-api. The temporary fix to use an older version of monad-logger should hopefully be sufficient.

于 2014-01-22T13:52:57.163 回答