简体   繁体   English

无法秘密安装Hunit

[英]Can't cabal install hunit

Very new to the Haskell ecosystem here. 这对Haskell生态系统来说是非常新的。 I'm trying to install hunit but when I run cabal install hunit I get the following message: 我正在尝试安装hunit,但是当我运行cabal install hunit我收到以下消息:

Warning: The install command is a part of the legacy v1 style of cabal usage.

Please switch to using either the new project style and the new-install
command or the legacy v1-install alias as new-style projects will become the
default in the next version of cabal-install. Please file a bug if you cannot
replicate a working v1- use case with the new-style commands.

For more information, see: https://wiki.haskell.org/Cabal/NewBuild

cabal: There is no package named 'hunit'. However, the following package name
exists: 'HUnit'.

This message is telling you two different things. 此消息告诉您两件事。 "Install" is a legacy command and "hunit" does not exist. “安装”是旧命令,“ hunit”不存在。

Your short solution is cabal v2-install --lib HUnit . 您的简短解决方案是cabal v2-install --lib HUnit For a legacy behavior consider cabal v1-install HUnit . 对于旧的行为,请考虑cabal v1-install HUnit

install is legacy: The big paragraph 安装很重要:大款

Cabal used to install everything into a single store, either user or system wide, and if any package ever disagreed on package version then good luck. Cabal过去将所有内容都安装到一个用户或系统范围内的单个商店中,如果有任何软件包在软件包版本上不一致,那么祝您好运。 The v2 commands move to a "nix style build" where different versions can co-exist in the store and projects can continue to benefit by sharing builds for common packages. v2命令移至“ nix样式构建”,其中不同版本可以共存于商店中,并且项目可以通过共享通用软件包的构建而继续受益。 The v2 commands are literally the commands prefixed with v2- , such as v2-install , v2-build and v2-configure . v2命令实际上是前缀为v2-的命令,例如v2-installv2-buildv2-configure

hunit does not exist 单位不存在

Hackage is case sensitive. 黑客是区分大小写的。 The tool already informed you that you might have intended to install HUnit instead of hunit . 该工具已经通知您,您可能打算安装HUnit而不是hunit

Epilog: Use --lib 结语:使用--lib

The v2-install does not expose the built libraries unless installed explicitly via --lib . 除非通过--lib显式安装,否则v2-install不会公开构建的库。 This reduces namespace clutter at some expensive of us programmers needing to retrain. 这减少了名称空间的混乱,使我们需要重新培训一些昂贵的程序员。 To use HUnit as a library and play with it in the repl, add --lib as shown at the beginning. 要将HUnit用作库并在repl中使用它, --lib按开头所示添加--lib

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM