阴谋集团潮汐末端警告 [英] Cabal install tidal ends with warning

查看:81
本文介绍了阴谋集团潮汐末端警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试通过以下方式在命令行中安装潮汐:

I'm trying install tidal in command line this way:

cabal安装潮汐

但它以以下消息结尾:

警告:您要求安装可执行文件,但是其中没有可执行文件.目标:潮汐.也许您想使用--lib安装库.

Warning: You asked to install executables, but there are no executables in target: tidal. Perhaps you want to use --lib to install libraries instead.

返回:

cabal install tidal --lib

是:

解决依赖关系...最新

Resolving dependencies... Up to date

如果我检查ghk-pkg列表,则没有潮汐包裹...有人有类似的问题或我在做什么错吗?

If I check ghk-pkg list, there is no package tidal ... Have somebody similar problem or what I'm doing wrong?

我的环境是:

  • Windows 10教育版
  • Haskell 8.4.3
  • Cabal 3.2.0.0
  • Ghc 8.10.1

感谢您的帮助.

推荐答案

类似于Stack更长的时间,Cabal-install现在(从3.2版本开始)不再是真正的安装库-在某种意义上更改计算机的状态,以便GHC可以访问计算机上的库.这两个工具现在仅安装可执行文件.它过去也曾经对库执行此操作,但是由于现在默认的 Nix样式的构建.

Like Stack for a longer time, Cabal-install does now (as of 3.2) not really install libraries anymore – in the sense of, change the computer's state so that GHC can access the library on it. Both tools only install executables now. It used to do that for libraries too, but that was stopped with the now default Nix-style builds.

现在(实际上,实际上也已经在以前),使用库的方法只是依赖,并让Cabal在幕后弄清楚是否需要安装.也就是说,您将 .cabal 文件添加到 .hs 源文件中,并且其中包含 build-depends:tidal .然后,当您说 cabal install.时,它将首先下载并安装该库,然后再使用它来构建自己的可执行文件.

Now (and, really, also already before), the way to use a library is instead to just depend on it, and let Cabal figure out behind the scenes if it needs to be installed. I.e., you add a .cabal file to your .hs source file with build-depends: tidal in it. Then when you say cabal install ., it will first download and install the library before then using it for building your own executable.

当然,从技术上来讲,Stack和Cabal都可以安装库,只是它们不会全局注册.也就是说,cabal知道它在哪里安装了库,但是您真的不应该知道这一点.这是持续集成的精神:如果您的代码现在使用您刚安装的库的特定状态进行构建,则不是很可靠.如果仅使用在项目文件中明确列出的库进行构建,则将来(您或其他人)仍然可以在另一台计算机上使用您的代码而无需花费数小时来确定要安装什么库的机会就大得多.首先.

Of course both Stack and Cabal do technically speaking install libraries, just they don't globally register them. I.e., cabal knows where it has installed the library, but you're not really supposed to know about that. It's in the spirit of continuous integration: if your code builds now with the particular state of libraries you happen to have installed, that's not very reliable. If it builds with just those libraries that are explicitly listed in a project file, the chances are much better that future-you (or somebody else) will still be able to use your code on another computer without hours of figuring out what libraries to install first.

这篇关于阴谋集团潮汐末端警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆