我正在尝试cabal install yesod在我的Windows机器上.我有一个相对全新的Haskell平台安装.cabal安装失败,报告我需要sqlite3 C库才能安装"持久",这是Yesod所依赖的软件包.
Run Code Online (Sandbox Code Playgroud)cabal: Missing dependency on a foreign library: * Missing C library: sqlite3
所以我去了http://www.sqlite.org/download.html并抓住了C源代码和预编译二进制代码.我尝试使用两者,无济于事:
cabal install persistent --extra-lib-dirs=C:\Path\To\C\Source\Files
cabal install persistent --extra-lib-dirs=C:\Path\To\Binary
Run Code Online (Sandbox Code Playgroud)
在这两种情况下,我得到了相同的结果:它没有用.:(我该怎么做才能给它需要的C库?(在这种情况下是sqlite3)
我正在尝试cabal-dev一个我正在研究的项目; 该项目是一个图书馆,并且cabal-dev很好地构建了它的沙盒版本 - 但是我的部分工作流程遇到了麻烦......
我有一个脚本,scratch.hs(cabal-dev我预先)我会加载ghci进行尝试.当然,scratch.hs随着时间的推移,变化的内容取决于我正在处理的功能. scratch.hs不是库代码库的一部分,它只是我个人的刮擦空间,而我正在研究它.
现在,为了获得ghci加载沙箱的会话,我可以cabal-dev ghci,然后加载scratch.hs到那个.问题是这(通过设计,明智地)排除了我的用户包数据库,所以如果scratch.hs引用不在我的库中的包的模块build-depends(这不是不合理的 - 它毕竟不是库的一部分),那些包不是看得见,所以我得到一个错误,如:
scripts/scratch.hs:8:8:
Could not find module `Data.Aeson.Generic':
It is a member of the hidden package `aeson-0.3.2.11'.
Perhaps you need to add `aeson' to the build-depends in your .cabal file.
Use -v to see a list of the files searched for.
Failed, modules loaded: none.
Run Code Online (Sandbox Code Playgroud)
其中,在这种情况下,scratch.hs要进口Data.Aeson.Generic …
在我的~/.cabal/config档案中,我有
require-sandbox: True
Run Code Online (Sandbox Code Playgroud)
根据Cabal用户指南,我应该能够像这样覆盖:
amy@wombat$ cabal install xmonad xmonad-contrib --no-require-sandbox
cabal: unrecognized 'install' option `--no-require-sandbox'
Run Code Online (Sandbox Code Playgroud)
我究竟做错了什么?我正在使用cabal-install版本1.21.0.0.
在GHC 7.10.1和cabal 1.23下建议的分析程序是什么?来自GHC和cabal-install的与性能分析相关的错误和警告消息非常不一致.
尝试使用性能分析运行可执行文件,然后告诉您:
$ prediction-interactive +RTS -p
prediction-interactive: the flag -p requires the program to be built with -prof
Run Code Online (Sandbox Code Playgroud)放入-prof你的cabal文件,你会被告知:
$ cabal build
Warning: 'ghc-options: -prof' is not necessary and will lead to problems when
used on a library. Use the configure flag --enable-library-profiling and/or
--enable-executable-profiling.
Run Code Online (Sandbox Code Playgroud)遵循该建议(并从cabal文件中删除-prof),并告诉您:
$ cabal configure --enable-executable-profiling
Resolving dependencies...
Configuring creatur-wains-prediction-1.0...
Warning: The flag --enable-executable-profiling is deprecated. Please use
--enable-profiling instead.
Run Code Online (Sandbox Code Playgroud)遵循这个建议,你被告知:
$ cabal configure --enable-profiling
Resolving dependencies...
Configuring creatur-wains-prediction-1.0...
$ cabal build …Run Code Online (Sandbox Code Playgroud)该~/.cabal/world文件的作用是什么,其内容是什么意思?我找不到任何文件,并对我在那里看到的东西感到困惑.
例如,它对应于我的用户数据库中的包和我的全局包数据库,虽然它似乎只列出了我的用户数据库中的一些包,但它列出了一些我已经"删除"的包ghc-pkg unregister.
我正在尝试将项目从cabal移动到堆栈.直到我试图让亚历克斯使用自定义包装器时,它才是无痛的.现在我被卡住了.
我以前使用cabal build --alex-options =".."来传递它们,但是那个选项不存在堆栈(至少堆栈版本1.1.2).同样,我曾经把调试标志传递给happy,但是现在它似乎不再可能了.有没有其他方法来实现这一点,仍然使用堆栈?
移动这个项目的目的是帮助协作者能够毫不费力地重现我的构建(说服他们使用Haskell已经有了一些工作).
可能重复:
Cabal在需要分析库时不安装依赖项?
情况就是这样.我想安装\重新包装一个有一些新的选项或标志(例如我添加library-profiling: True的~/.cabal/config).
cabal install --reinstall A
Run Code Online (Sandbox Code Playgroud)
软件包A取决于软件包B,它安装时不支持该选项.这就是为什么(如果我理解正确的话)告诉我:
Could not find module `B':
Perhaps you haven't installed the profiling libraries for package `B'?
Use -v to see a list of the files searched for.
Run Code Online (Sandbox Code Playgroud)
所以我需要重新安装包B,然后尝试安装包A:
cabal install --reinstall B
cabal install --reinstall A
Run Code Online (Sandbox Code Playgroud)
我想要的只是告诉cabal我需要重新安装所有依赖于A的软件包.我怎样才能做到这一点?
目前我正在使用 cabal-install 1.16.0 我尝试更新 cabal-install 因为有人告诉我有更新版本的 ghc (7.6.1) 可用。除了此消息外,安装结果非常成功。
警告:无法在 /Users/MyName/Library/Haskell/bin 中为 cabal 创建符号链接,因为该文件已存在于那里但不受 cabal 管理。如果您愿意,您可以手动为此可执行文件创建符号链接。可执行文件已安装在 /Users/MyName/Library/Haskell/ghc-7.4.1/lib/cabal-install-1.16.0.2/bin/cabal
我检查了这些位置并且有文件。所以安装没问题。
根据我收到的警告消息,我尝试通过键入以下内容在 /Users/MyName/Library/Haskell/bin 中创建符号链接。
ln -s /Users/MyName/Library/Haskell/bin /Users/MyName/Library/Haskell/ghc-7.4.1/lib/cabal-install-1.16.0.2/bin/cabal
但它给了我简单但令人沮丧的信息。“文件已存在”
所以我再次尝试,用 Finder 删除了现有文件。(我只是将符号链接文件移动到回收站。)但机器给了我同样的信息。“文件已存在”
结果,我仍然安装了文件夹,但无法运行 Cabal,这促使我不断更新。(版本 1.16.0)
我怎么解决这个问题?
当我这样做时,cabal --version我看到:
cabal-install version 0.14.0
using version 1.14.0 of the Cabal library
Run Code Online (Sandbox Code Playgroud)
那有什么区别?我认为,当我这样做时,cabal build我只使用一个程序.为什么它分成两个不同版本的独立程序?
命令install、v1-install、v2-install和new-install简单地描述为运行时“安装软件包” man cabal。它们彼此不同吗?哪个是首选?