如何将 runhaskell 与 cabal-dev 一起使用?
不幸的是 cabal-dev ghci 在这个项目中不起作用,我收到一个错误:
Loading package download-0.3.2 ... linking ...
ghc: /home/stulli/haskell/ifdl/cabal-dev//lib/download-0.3.2/ghc-7.4.1/HSdownload-0.3.2.o: unknown symbol `stat64'
ghc: unable to load package `download-0.3.2'
所以我尝试 runhaskell,但它使用与 cabal 而不是 cabal-dev 一起安装的软件包,因此失败。
更新: runhaskell 会产生相同的错误:
$ runhaskell -isrc:src/test -package-conf=cabal-dev/packages-7.4.1.conf src/test/Test.hs
Test.hs: /home/stulli/haskell/ifdl/cabal-dev//lib/download-0.3.2/ghc-7.4.1/HSdownload-0.3.2.o: unknown symbol `stat64'
Test.hs: Test.hs: unable to load package `download-0.3.2'
另一方面, cabal-dev install 可以正常工作。
Unfortunately cabal-dev ghci does not work in this project, i get an error:
Loading package download-0.3.2 ... linking ...
ghc: /home/stulli/haskell/ifdl/cabal-dev//lib/download-0.3.2/ghc-7.4.1/HSdownload-0.3.2.o: unknown symbol `stat64'
ghc: unable to load package `download-0.3.2'
So i try runhaskell, but it uses the packages that come installed with cabal instead of cabal-dev and thus fails.
update:
runhaskell produces the same error:
$ runhaskell -isrc:src/test -package-conf=cabal-dev/packages-7.4.1.conf src/test/Test.hs
Test.hs: /home/stulli/haskell/ifdl/cabal-dev//lib/download-0.3.2/ghc-7.4.1/HSdownload-0.3.2.o: unknown symbol `stat64'
Test.hs: Test.hs: unable to load package `download-0.3.2'
cabal-dev install on the other hand works without problems.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以尝试类似以下的操作:
但我认为如果
cabal-dev ghci
不起作用,那么runhaskell
也将不起作用。您需要找出download
包有什么问题。You can try something like the next:
But I think if
cabal-dev ghci
doesn't work, thenrunhaskell
will not work too. You need to find out what is wrong withdownload
package.要将
runhaskell
与 cabal 沙箱 (cabal >= 1.18) 一起使用,请运行命令,并将正确的
*-packages.conf.d
目录替换为您的 GHC 版本。To use
runhaskell
with cabal sandboxes (cabal >= 1.18), run the commandsubstituting the proper
*-packages.conf.d
directory for your GHC version.cabal-dev
设置对于ghci
来说效果不佳,因此很可能它对于runhaskell
也效果不佳>。也许 virthualenv 更适合这个用例?The
cabal-dev
setup doesn't work very well forghci
, so it might very well be that it also doesn't work well forrunhaskell
. Maybe virthualenv will work better for this use case?