我正在尝试使用分析选项编译我的一个可执行文件。我在 cabal 文件中添加了 -prof
选项。当我这样做时,我收到一条消息:
Could not find module ‘Package-X’
Perhaps you haven't installed the profiling libraries for package ‘package-x’?
Use -v to see a list of the files searched for.
我该怎么做?我尝试了 cabal install --only-dependency --reinstall
并得到以下响应:
All the requested packages are already installed:
Use --reinstall if you want to reinstall anyway.
我已经使用了--reinstall
我该怎么办?我还尝试了cabal configure --enable-profiling-libraries
等...
最佳答案
link bheklilr 的建议有所帮助,但并没有立即发挥作用。
我最终在我的 .cabal/config
文件中添加了 library-profiling: True
并重新安装了所有内容。
cabal install --reinstall wolrd
不起作用,也许是因为我在沙箱内。然而,好的
关于沙箱的事情是你可以把它们扔掉,所以我使用重新安装了所有东西
cabal sandbox delete
cabal sandbox init
cabal install
尽管此解决方案有效,但由于以下原因并不令人满意:
我必须修改
.cabal/config
这是一个全局文件,而在理想的情况下 我应该只修改我的沙箱。但是,我没有尝试创建本地 cabal 配置文件我必须重新安装所有内容,即每个库的分析版本以及已安装的普通版本。
关于haskell - 如何编译依赖项以在 cabal 沙箱中进行分析,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26020314/