首页 > 解决方案 > 为什么 Cabal 在 cabal 初始化后不问我任何问题

问题描述

当我查看 cabal 教程时,他们总是说 cabal,在cabal init继续向您询问“一堆问题”(https://www.youtube.com/watch?v=a7R-2vtPLDM)并且当我运行命令时阴谋集团不这样做,而是猜测一切。无论我在 Windows 10 上使用 cygwin 还是 cmd,都会发生这种情况。

控制台输出如下:

Warning: The package list for 'hackage.haskell.org' is 20 days old.
Run 'cabal update' to get the latest list of available packages.

Guessing dependencies...

Generating LICENSE...
Warning: unknown license type, you must put a copy in LICENSE yourself.
Generating Setup.hs...
Generating CHANGELOG.md...
Generating Main.hs...
Generating g.cabal...

Warning: no synopsis given. You should edit the .cabal file and add one.
You may want to edit the .cabal file and add a Description field.

(是的,无论包裹清单是否更新,问题都是一样的)

我如何让阴谋集团像平常一样问我问题?我需要重新安装吗?它也无法识别cabal sandbox init为命令,但这是另一个问题。

标签: haskellcabal

解决方案


似乎在最近版本的 cabal-install 中,必须invoke cabal init --interactive回答“否”,但“生成一个具有合理默认值的简单项目”问题。

此外,沙盒现在已经过时了;在 cabal 项目中,cabal build应该安装任何必需的依赖项并构建本地包,而无需创建沙箱。

处理已安装依赖项的新方法(在手册中称为“nix 样式”)比沙盒更好。它避免了 cabal 依赖地狱——就像沙盒一样——也避免了多次构建相同的依赖,因为编译的依赖保存在中央存储中,并且可以跨项目重用。


推荐阅读