最近我尝试通过cabal安装在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
有谁知道如何处理此错误?
答案 0 :(得分:3)
似乎monad-logger
包开始从版本Loc
开始导出0.3.4.0
符号。 fpco-api
的Cabal文件不排除此版本。
你可以尝试
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
数据类型。现在,在fpco-api
中导入记录器monad的许多地方,突然两个Loc
类型都在范围内,并且GHC不知道Loc
的本地实例引用哪一个。< / p>
此错误的正确修复方法是fpco-api
隐藏Loc
从记录器monad重新导出,或使用限定名称明确引用正确的名称。但这需要更新fpco-api
的源代码。 1}}使用旧版monad-logger
的临时修复程序应该足够了。