Haskell Cabal 为所有已安装的软件包重新生成文档

发布于 2024-11-18 09:55:04 字数 183 浏览 3 评论 0原文

如何为所有本地安装的 cabal 软件包生成并安装文档?我在 ~/.cabal/config 中打开了文档标志,这意味着所有新安装的软件包也将生成文档。但是如何为所有已安装的软件包生成文档呢?

有没有办法自动 cabal install --reinstall 所有已安装的软件包?更重要的是,这是个好主意吗?

How can I generate and install documentation for all locally installed cabal packages? I turned on the documentation flag in ~/.cabal/config which means that all newly installed packages will have documentation also generated. But how to generate documentation for all already installed packages?

Is there a way to automatically cabal install --reinstall all already installed packages? And more importantly, is that a good idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

泪是无色的血 2024-11-25 09:55:04

如果您有 cabal-install 的最新版本(我认为>= 0.10),您可以尝试这样做

$ cabal install --reinstall --upgrade-dependencies world

不幸的是,它在我的情况下不起作用:

$ cabal install --dry-run --reinstall world
Resolving dependencies...
cabal: cannot configure Agda-2.2.10. It requires haskell-src-exts >=1.9.6 &&
<1.10
For the dependency on haskell-src-exts >=1.9.6 && <1.10 there are these
packages: haskell-src-exts-1.9.6. However none of them are available.
haskell-src-exts-1.9.6 was excluded because haskell-src-exts-1.11.1 was
selected instead
haskell-src-exts-1.9.6 was excluded because hlint-1.8.12 requires
haskell-src-exts ==1.11.*

如果您遇到错误像这样,您可以尝试手动编辑 ~/.cabal/world 文件。

If you have a recent-ish version of cabal-install (>= 0.10, I think), you can try doing

$ cabal install --reinstall --upgrade-dependencies world

Unfortunately, it didn't work in my case:

$ cabal install --dry-run --reinstall world
Resolving dependencies...
cabal: cannot configure Agda-2.2.10. It requires haskell-src-exts >=1.9.6 &&
<1.10
For the dependency on haskell-src-exts >=1.9.6 && <1.10 there are these
packages: haskell-src-exts-1.9.6. However none of them are available.
haskell-src-exts-1.9.6 was excluded because haskell-src-exts-1.11.1 was
selected instead
haskell-src-exts-1.9.6 was excluded because hlint-1.8.12 requires
haskell-src-exts ==1.11.*

If you bump into an error like this, you can try manually editing the ~/.cabal/world file.

情痴 2024-11-25 09:55:04

请注意,cabal install --only-dep --reinstall 不起作用

如果您使用的是沙箱,则可以执行

cabal sandbox delete
cabal sandbox init
cabal install -j --only-dep --enable-documentation

-j 选项允许其并行构建。

Please note that cabal install --only-dep --reinstall does not work.

If you are using a sandbox, you can do

cabal sandbox delete
cabal sandbox init
cabal install -j --only-dep --enable-documentation

The -j option allows it to build in parallel.

浮萍、无处依 2024-11-25 09:55:04

你可以在 bash 中尝试这样的事情。

for pkg in `ghc-pkg list --simple`
do
cabal install $pkg --reinstall
done

但我真的不知道这是否是一个好主意。

You could try something like this in bash.

for pkg in `ghc-pkg list --simple`
do
cabal install $pkg --reinstall
done

But I really don't know, whether it's a good idea.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文