Haskell'cabal'only';部分地;安装包
在Ubuntu上使用Haskell'cabal'only';部分地;安装包,haskell,cabal,cabal-install,Haskell,Cabal,Cabal Install,在Ubuntu上使用cabal安装名为Tidal的Haskell软件包时遇到问题18:04 我不是Haskell的专家,以前也曾多次尝试过这个东西,所以我会尝试使用这个新的安装- 我尽可能多地清理Haskell相关的东西- justin@justin-XPS-13-9360:~$ rm -rf ~/.cabal/ justin@justin-XPS-13-9360:~$ rm -rf ~/.ghc justin@justin-XPS-13-9360:~$ rm -rf ~/.ghcup 还
cabal
安装名为Tidal
的Haskell软件包时遇到问题18:04
我不是Haskell的专家,以前也曾多次尝试过这个东西,所以我会尝试使用这个新的安装-
我尽可能多地清理Haskell相关的东西-
justin@justin-XPS-13-9360:~$ rm -rf ~/.cabal/
justin@justin-XPS-13-9360:~$ rm -rf ~/.ghc
justin@justin-XPS-13-9360:~$ rm -rf ~/.ghcup
还有任何Ubuntu遗留的Haskell-
justin@justin-XPS-13-9360:~$ sudo apt-get remove ghc
所以-
justin@justin-XPS-13-9360:~$ ghci
bash: /home/justin/.ghcup/bin/ghci: No such file or directory
好的,我们走吧-
curl https://get-ghcup.haskell.org -sSf | sh
这让我-
{...}
Done installing, run "ghci-8.6.5" or set up your current GHC via: ghcup set 8.6.5
Setting GHC to 8.6.5
Done
Setting GHC to 8.6.5
Done
{...}
Successfully installed cabal-install into
/home/justin/.ghcup/bin
Detected "/home/justin/.bashrc" on your system...
If you want ghcup to automatically fix your "/home/justin/.bashrc" to include the required PATH variable
answer with YES, otherwise with NO and press ENTER.
YES
OK! /home/justin/.bashrc has been modified. Restart your terminal for the changes to take effect,
or type "source /home/justin/.ghcup/env" to apply them in your current terminal session.
让我们设置路径
并进行测试-
justin@justin-XPS-13-9360:~$ source /home/justin/.ghcup/env
justin@justin-XPS-13-9360:~$ ghci
GHCi, version 8.6.5: http://www.haskell.org/ghc/ :? for help
Prelude>
到目前为止还不错。接下来-
我尝试以下方法-
justin@justin-XPS-13-9360:~$ cabal update
Downloading the latest package list from hackage.haskell.org
To revert to previous state run:
cabal v2-update 'hackage.haskell.org,2019-11-20T01:17:49Z'
然后-
justin@justin-XPS-13-9360:~$ cabal new-install tidal --lib
{...}
Starting tidal-1.4.4 (lib)
Building tidal-1.4.4 (lib)
Installing tidal-1.4.4 (lib)
Completed tidal-1.4.4 (lib)
看起来还可以,但问题就从这里开始-
justin@justin-XPS-13-9360:~$ cabal info tidal
* tidal (library)
Synopsis: Pattern language for improvised music
Versions available: 0.8.2, 0.9.9, 0.9.10, 1.2.1, 1.3.0, 1.4.1, 1.4.2, 1.4.3,
1.4.4 (and 99 others)
Versions installed: [ Not installed ]
Hmm-未安装
??及-
justin@justin-XPS-13-9360:~$ ghc-pkg latest tidal
ghc-pkg: cannot find package tidal
Doh。然而,如果我查看~/.cabal
我可以看到一些东西已经安装好了-
justin@justin-XPS-13-9360:~$ ls -l /home/justin/.cabal/store/ghc-8.6.5/
total 100
{...}
drwxr-xr-x 4 justin justin 4096 Nov 20 06:00 tidal-1.4.4-898a4af91fab9d9d757e1a84104bbd7ca568a77d48b4679a3f4addb65912423a
{...}
我甚至可以检查安装在~/.cabal/store
中的库是否正常工作-
justin@justin-XPS-13-9360:~$ ghci
GHCi, version 8.6.5: http://www.haskell.org/ghc/ :? for help
Loaded package environment from /home/justin/.ghc/x86_64-linux-8.6.5/environments/default
Prelude> :script /home/justin/.cabal/store/ghc-8.6.5/tidal-1.4.4-898a4af91fab9d9d757e1a84104bbd7ca568a77d48b4679a3f4addb65912423a/share/BootTidal.hs
Listening for controls on 127.0.0.1:6010
tidal> :t d1
d1 :: Pattern ControlMap -> IO ()
tidal>
但是,我想使用Tidal
及其emacs扩展-
它按如下方式查找包,需要cabal info
返回正确安装的版本-
'(("path" . "ghc-pkg describe $(ghc-pkg latest tidal) | grep data-dir | cut -f2 -d' '")
本质上,emacs扩展希望包在这里(这将使阴谋集团信息潮
起作用)
但是cabal
似乎只是在这里“部分”安装了软件包-
/home/justin/.cabal/store/ghc-8.6.5/tidal-1.4.4-898a4af91fab9d9d757e1a84104bbd7ca568a77d48b4679a3f4addb65912423a/share/BootTidal.hs
现在,我可能可以将emacs扩展指向~/.cabal/store
,而不是~/.cabal/share
,但我更希望它能正常工作并cabal info
返回正确的版本
有谁能告诉我为什么cabal
没有将文件推送到~/.cabal/share
TIA.由于上述程序实际上是“有效”的,这只是因为
阴谋集团似乎正在从“旧式”安装过程转变为“新式”安装过程,新来者并不总是清楚区别。此外,某些包的某些部分(尤其是tidal
包中的tidal.el
)尚未更新,以反映cabal
安装程序的变化。谢谢 安装已正确执行。将Haskell软件包安装到全局数据库是错误的。不幸的是,cabalv1安装
就是这样做的,这就是为什么cabalinfo
会检查数据库中是否有软件包cabal v2安装
不会将软件包安装到全局数据库中,因此它不会损坏。除了GHC附带的软件包之外,您应该(尽可能)永远不要在全局数据库中安装任何东西,因此cabal info
应该总是说“未安装”。这个问题实际上是“如何将此Emacs扩展指向新安装的ed软件包?”如果您只想安装和使用单个软件包(或一组互操作软件包),那么将软件包安装到全局数据库中并不是“坏的”。另外,除非您另外指定,v2 install
会将软件包安装到全局(也称为默认)数据库中,不是吗?有人知道这里哪种类型1-4是“正确”的吗?所有这些都非常令人困惑:-/
/home/justin/.cabal/store/ghc-8.6.5/tidal-1.4.4-898a4af91fab9d9d757e1a84104bbd7ca568a77d48b4679a3f4addb65912423a/share/BootTidal.hs